summaryrefslogtreecommitdiff
path: root/src/mesa
diff options
context:
space:
mode:
authorCaio Marcelo de Oliveira Filho <caio.oliveira@intel.com>2020-03-20 21:02:06 -0700
committerCaio Marcelo de Oliveira Filho <caio.oliveira@intel.com>2020-04-09 19:23:12 -0700
commitc54fc0d07b1a92e065000c1301971b93439595e2 (patch)
treec200851966f48729825c5445c6c456afde7ee45f /src/mesa
parent0536ca20d757b5ca9fc9f989ba64a545ab8235d7 (diff)
intel/compiler: Replace cs_prog_data->push.total with a helper
The push.total field had three values but only one was directly used (size). Replace it with a helper function that explicitly takes the cs_prog_data and the number of threads -- and use that in the drivers. This is a preparation for ARB_compute_variable_group_size where the number of threads (hence the total size for push constants) is not defined at compile time (not cs_prog_data->threads). Reviewed-by: Paulo Zanoni <paulo.r.zanoni@intel.com> Reviewed-by: Jordan Justen <jordan.l.justen@intel.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4504>
Diffstat (limited to 'src/mesa')
-rw-r--r--src/mesa/drivers/dri/i965/gen6_constant_state.c6
-rw-r--r--src/mesa/drivers/dri/i965/genX_state_upload.c7
2 files changed, 8 insertions, 5 deletions
diff --git a/src/mesa/drivers/dri/i965/gen6_constant_state.c b/src/mesa/drivers/dri/i965/gen6_constant_state.c
index 919aee49ade..50e34fc9c8f 100644
--- a/src/mesa/drivers/dri/i965/gen6_constant_state.c
+++ b/src/mesa/drivers/dri/i965/gen6_constant_state.c
@@ -303,14 +303,16 @@ brw_upload_cs_push_constants(struct brw_context *brw,
/* XXX: Should this happen somewhere before to get our state flag set? */
_mesa_load_state_parameters(ctx, prog->Parameters);
- if (cs_prog_data->push.total.size == 0) {
+ const unsigned push_const_size =
+ brw_cs_push_const_total_size(cs_prog_data, cs_prog_data->threads);
+ if (push_const_size == 0) {
stage_state->push_const_size = 0;
return;
}
uint32_t *param =
- brw_state_batch(brw, ALIGN(cs_prog_data->push.total.size, 64),
+ brw_state_batch(brw, ALIGN(push_const_size, 64),
64, &stage_state->push_const_offset);
assert(param);
diff --git a/src/mesa/drivers/dri/i965/genX_state_upload.c b/src/mesa/drivers/dri/i965/genX_state_upload.c
index 898d5aa7a43..fed5eda8e48 100644
--- a/src/mesa/drivers/dri/i965/genX_state_upload.c
+++ b/src/mesa/drivers/dri/i965/genX_state_upload.c
@@ -4358,10 +4358,11 @@ genX(upload_cs_state)(struct brw_context *brw)
vfe.CURBEAllocationSize = vfe_curbe_allocation;
}
- if (cs_prog_data->push.total.size > 0) {
+ const unsigned push_const_size =
+ brw_cs_push_const_total_size(cs_prog_data, cs_prog_data->threads);
+ if (push_const_size > 0) {
brw_batch_emit(brw, GENX(MEDIA_CURBE_LOAD), curbe) {
- curbe.CURBETotalDataLength =
- ALIGN(cs_prog_data->push.total.size, 64);
+ curbe.CURBETotalDataLength = ALIGN(push_const_size, 64);
curbe.CURBEDataStartAddress = stage_state->push_const_offset;
}
}