diff options
author | Kenneth Graunke <[email protected]> | 2016-11-14 23:45:16 -0800 |
---|---|---|
committer | Kenneth Graunke <[email protected]> | 2016-11-19 11:39:45 -0800 |
commit | 58c09e72b15768524e5b76b55eae506391b663d8 (patch) | |
tree | 2010b211a1d2fdca23a19829ce94d2db26698396 /src/mesa/drivers | |
parent | 2acfd364798fcefe09acffabb106c9732d403e6c (diff) |
intel: Convert devinfo->urb.max_*_entries into an array.
Signed-off-by: Kenneth Graunke <[email protected]>
Reviewed-by: Topi Pohjolainen <[email protected]>
Diffstat (limited to 'src/mesa/drivers')
-rw-r--r-- | src/mesa/drivers/dri/i965/gen6_urb.c | 8 | ||||
-rw-r--r-- | src/mesa/drivers/dri/i965/gen7_urb.c | 26 |
2 files changed, 20 insertions, 14 deletions
diff --git a/src/mesa/drivers/dri/i965/gen6_urb.c b/src/mesa/drivers/dri/i965/gen6_urb.c index 3658c380c49..b91d7fa3ab3 100644 --- a/src/mesa/drivers/dri/i965/gen6_urb.c +++ b/src/mesa/drivers/dri/i965/gen6_urb.c @@ -64,11 +64,11 @@ gen6_upload_urb(struct brw_context *brw, unsigned vs_size, } /* Then clamp to the maximum allowed by the hardware */ - if (nr_vs_entries > devinfo->urb.max_vs_entries) - nr_vs_entries = devinfo->urb.max_vs_entries; + if (nr_vs_entries > devinfo->urb.max_entries[MESA_SHADER_VERTEX]) + nr_vs_entries = devinfo->urb.max_entries[MESA_SHADER_VERTEX]; - if (nr_gs_entries > devinfo->urb.max_gs_entries) - nr_gs_entries = devinfo->urb.max_gs_entries; + if (nr_gs_entries > devinfo->urb.max_entries[MESA_SHADER_GEOMETRY]) + nr_gs_entries = devinfo->urb.max_entries[MESA_SHADER_GEOMETRY]; /* Finally, both must be a multiple of 4 (see 3DSTATE_URB in the PRM). */ brw->urb.nr_vs_entries = ROUND_DOWN_TO(nr_vs_entries, 4); diff --git a/src/mesa/drivers/dri/i965/gen7_urb.c b/src/mesa/drivers/dri/i965/gen7_urb.c index b60bd23b49f..ca347b49d72 100644 --- a/src/mesa/drivers/dri/i965/gen7_urb.c +++ b/src/mesa/drivers/dri/i965/gen7_urb.c @@ -291,7 +291,8 @@ gen7_upload_urb(struct brw_context *brw, unsigned vs_size, unsigned vs_chunks = DIV_ROUND_UP(vs_min_entries * vs_entry_size_bytes, chunk_size_bytes); unsigned vs_wants = - DIV_ROUND_UP(devinfo->urb.max_vs_entries * vs_entry_size_bytes, + DIV_ROUND_UP(devinfo->urb.max_entries[MESA_SHADER_VERTEX] * + vs_entry_size_bytes, chunk_size_bytes) - vs_chunks; unsigned gs_chunks = 0; @@ -307,7 +308,8 @@ gen7_upload_urb(struct brw_context *brw, unsigned vs_size, */ gs_chunks = DIV_ROUND_UP(MAX2(gs_granularity, 2) * gs_entry_size_bytes, chunk_size_bytes); - gs_wants = DIV_ROUND_UP(devinfo->urb.max_gs_entries * gs_entry_size_bytes, + gs_wants = DIV_ROUND_UP(devinfo->urb.max_entries[MESA_SHADER_GEOMETRY] * + gs_entry_size_bytes, chunk_size_bytes) - gs_chunks; } @@ -321,15 +323,15 @@ gen7_upload_urb(struct brw_context *brw, unsigned vs_size, DIV_ROUND_UP(hs_granularity * hs_entry_size_bytes, chunk_size_bytes); hs_wants = - DIV_ROUND_UP(devinfo->urb.max_tcs_entries * hs_entry_size_bytes, - chunk_size_bytes) - hs_chunks; + DIV_ROUND_UP(devinfo->urb.max_entries[MESA_SHADER_TESS_CTRL] * + hs_entry_size_bytes, chunk_size_bytes) - hs_chunks; ds_chunks = DIV_ROUND_UP(devinfo->urb.min_ds_entries * ds_entry_size_bytes, chunk_size_bytes); ds_wants = - DIV_ROUND_UP(devinfo->urb.max_tes_entries * ds_entry_size_bytes, - chunk_size_bytes) - ds_chunks; + DIV_ROUND_UP(devinfo->urb.max_entries[MESA_SHADER_TESS_EVAL] * + ds_entry_size_bytes, chunk_size_bytes) - ds_chunks; } /* There should always be enough URB space to satisfy the minimum @@ -385,10 +387,14 @@ gen7_upload_urb(struct brw_context *brw, unsigned vs_size, /* Since we rounded up when computing *_wants, this may be slightly more * than the maximum allowed amount, so correct for that. */ - nr_vs_entries = MIN2(nr_vs_entries, devinfo->urb.max_vs_entries); - nr_hs_entries = MIN2(nr_hs_entries, devinfo->urb.max_tcs_entries); - nr_ds_entries = MIN2(nr_ds_entries, devinfo->urb.max_tes_entries); - nr_gs_entries = MIN2(nr_gs_entries, devinfo->urb.max_gs_entries); + nr_vs_entries = + MIN2(nr_vs_entries, devinfo->urb.max_entries[MESA_SHADER_VERTEX]); + nr_hs_entries = + MIN2(nr_hs_entries, devinfo->urb.max_entries[MESA_SHADER_TESS_CTRL]); + nr_ds_entries = + MIN2(nr_ds_entries, devinfo->urb.max_entries[MESA_SHADER_TESS_EVAL]); + nr_gs_entries = + MIN2(nr_gs_entries, devinfo->urb.max_entries[MESA_SHADER_GEOMETRY]); /* Ensure that we program a multiple of the granularity. */ nr_vs_entries = ROUND_DOWN_TO(nr_vs_entries, vs_granularity); |