mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-06 05:08:08 +02:00
intel: Take a gen_l3_config in gen_get_urb_config
Instead of making each driver pass in the same push constant size and do it's own L3$ config URB size calculation, just make them pass in their L3$ configuration. Cc: "20.0" mesa-stable@lists.freedesktop.org Reviewed-by: Kenneth Graunke <kenneth@whitecape.org> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/merge_requests/3454>
This commit is contained in:
parent
9d05822cb8
commit
73a684964b
5 changed files with 13 additions and 22 deletions
|
|
@ -7225,15 +7225,12 @@ genX(emit_urb_setup)(struct iris_context *ice,
|
|||
bool tess_present, bool gs_present)
|
||||
{
|
||||
const struct gen_device_info *devinfo = &batch->screen->devinfo;
|
||||
const struct gen_l3_config *l3_config = batch->screen->l3_config_3d;
|
||||
const unsigned push_size_kB = 32;
|
||||
unsigned entries[4];
|
||||
unsigned start[4];
|
||||
|
||||
ice->shaders.last_vs_entry_size = size[MESA_SHADER_VERTEX];
|
||||
|
||||
gen_get_urb_config(devinfo, 1024 * push_size_kB,
|
||||
1024 * gen_get_l3_config_urb_size(devinfo, l3_config),
|
||||
gen_get_urb_config(devinfo, batch->screen->l3_config_3d,
|
||||
tess_present, gs_present,
|
||||
size, entries, start);
|
||||
|
||||
|
|
|
|||
|
|
@ -93,7 +93,7 @@ gen_get_l3_config_urb_size(const struct gen_device_info *devinfo,
|
|||
void gen_dump_l3_config(const struct gen_l3_config *cfg, FILE *fp);
|
||||
|
||||
void gen_get_urb_config(const struct gen_device_info *devinfo,
|
||||
unsigned push_constant_bytes, unsigned urb_size_bytes,
|
||||
const struct gen_l3_config *l3_cfg,
|
||||
bool tess_present, bool gs_present,
|
||||
const unsigned entry_size[4],
|
||||
unsigned entries[4], unsigned start[4]);
|
||||
|
|
|
|||
|
|
@ -59,19 +59,23 @@
|
|||
*/
|
||||
void
|
||||
gen_get_urb_config(const struct gen_device_info *devinfo,
|
||||
unsigned push_constant_bytes, unsigned urb_size_bytes,
|
||||
const struct gen_l3_config *l3_cfg,
|
||||
bool tess_present, bool gs_present,
|
||||
const unsigned entry_size[4],
|
||||
unsigned entries[4], unsigned start[4])
|
||||
{
|
||||
const unsigned urb_size_kB = gen_get_l3_config_urb_size(devinfo, l3_cfg);
|
||||
const unsigned push_constant_kB =
|
||||
(devinfo->gen >= 8 || (devinfo->is_haswell && devinfo->gt == 3)) ? 32 : 16;
|
||||
|
||||
const bool active[4] = { true, tess_present, tess_present, gs_present };
|
||||
|
||||
/* URB allocations must be done in 8k chunks. */
|
||||
const unsigned chunk_size_bytes = 8192;
|
||||
const unsigned chunk_size_kB = 8;
|
||||
const unsigned chunk_size_bytes = chunk_size_kB * 1024;
|
||||
|
||||
const unsigned push_constant_chunks =
|
||||
push_constant_bytes / chunk_size_bytes;
|
||||
const unsigned urb_chunks = urb_size_bytes / chunk_size_bytes;
|
||||
const unsigned push_constant_chunks = push_constant_kB / chunk_size_kB;
|
||||
const unsigned urb_chunks = urb_size_kB / chunk_size_kB;
|
||||
|
||||
/* From p35 of the Ivy Bridge PRM (section 1.7.1: 3DSTATE_URB_GS):
|
||||
*
|
||||
|
|
|
|||
|
|
@ -262,18 +262,10 @@ genX(emit_urb_setup)(struct anv_device *device, struct anv_batch *batch,
|
|||
const unsigned entry_size[4])
|
||||
{
|
||||
const struct gen_device_info *devinfo = &device->info;
|
||||
#if GEN_IS_HASWELL
|
||||
const unsigned push_constant_kb = devinfo->gt == 3 ? 32 : 16;
|
||||
#else
|
||||
const unsigned push_constant_kb = GEN_GEN >= 8 ? 32 : 16;
|
||||
#endif
|
||||
|
||||
const unsigned urb_size_kb = gen_get_l3_config_urb_size(devinfo, l3_config);
|
||||
|
||||
unsigned entries[4];
|
||||
unsigned start[4];
|
||||
gen_get_urb_config(devinfo,
|
||||
1024 * push_constant_kb, 1024 * urb_size_kb,
|
||||
gen_get_urb_config(devinfo, l3_config,
|
||||
active_stages &
|
||||
VK_SHADER_STAGE_TESSELLATION_EVALUATION_BIT,
|
||||
active_stages & VK_SHADER_STAGE_GEOMETRY_BIT,
|
||||
|
|
|
|||
|
|
@ -208,8 +208,6 @@ gen7_upload_urb(struct brw_context *brw, unsigned vs_size,
|
|||
bool gs_present, bool tess_present)
|
||||
{
|
||||
const struct gen_device_info *devinfo = &brw->screen->devinfo;
|
||||
const int push_size_kB =
|
||||
(devinfo->gen >= 8 || (devinfo->is_haswell && devinfo->gt == 3)) ? 32 : 16;
|
||||
|
||||
/* BRW_NEW_{VS,TCS,TES,GS}_PROG_DATA */
|
||||
struct brw_vue_prog_data *prog_data[4] = {
|
||||
|
|
@ -249,7 +247,7 @@ gen7_upload_urb(struct brw_context *brw, unsigned vs_size,
|
|||
|
||||
unsigned entries[4];
|
||||
unsigned start[4];
|
||||
gen_get_urb_config(devinfo, 1024 * push_size_kB, 1024 * brw->urb.size,
|
||||
gen_get_urb_config(devinfo, brw->l3.config,
|
||||
tess_present, gs_present, entry_size, entries, start);
|
||||
|
||||
if (devinfo->gen == 7 && !devinfo->is_haswell && !devinfo->is_baytrail)
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue