summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorJordan Justen <[email protected]>2016-01-22 16:26:34 -0800
committerJordan Justen <[email protected]>2016-01-30 09:00:00 -0800
commitf5b3a2fe32b3cb84a8f3e932e7eebdc2ed900e76 (patch)
tree3a061c84c3bb42b0b60784f36f23a672af5666e5 /src
parent7e46cc86038a57cb13e63acde555f5135cb2a987 (diff)
anv/gen7: Add support for gl_NumWorkGroups
Signed-off-by: Jordan Justen <[email protected]>
Diffstat (limited to 'src')
-rw-r--r--src/vulkan/gen7_cmd_buffer.c19
1 files changed, 19 insertions, 0 deletions
diff --git a/src/vulkan/gen7_cmd_buffer.c b/src/vulkan/gen7_cmd_buffer.c
index 613971651b2..e4a35388170 100644
--- a/src/vulkan/gen7_cmd_buffer.c
+++ b/src/vulkan/gen7_cmd_buffer.c
@@ -725,6 +725,20 @@ void genX(CmdDispatch)(
struct anv_pipeline *pipeline = cmd_buffer->state.compute_pipeline;
struct brw_cs_prog_data *prog_data = &pipeline->cs_prog_data;
+ if (prog_data->uses_num_work_groups) {
+ struct anv_state state =
+ anv_cmd_buffer_alloc_dynamic_state(cmd_buffer, 12, 4);
+ uint32_t *sizes = state.map;
+ sizes[0] = x;
+ sizes[1] = y;
+ sizes[2] = z;
+ if (!cmd_buffer->device->info.has_llc)
+ anv_state_clflush(state);
+ cmd_buffer->state.num_workgroups_offset = state.offset;
+ cmd_buffer->state.num_workgroups_bo =
+ &cmd_buffer->device->dynamic_state_block_pool.bo;
+ }
+
cmd_buffer_flush_compute_state(cmd_buffer);
anv_batch_emit(&cmd_buffer->batch, GEN7_GPGPU_WALKER,
@@ -757,6 +771,11 @@ void genX(CmdDispatchIndirect)(
struct anv_bo *bo = buffer->bo;
uint32_t bo_offset = buffer->offset + offset;
+ if (prog_data->uses_num_work_groups) {
+ cmd_buffer->state.num_workgroups_offset = bo_offset;
+ cmd_buffer->state.num_workgroups_bo = bo;
+ }
+
cmd_buffer_flush_compute_state(cmd_buffer);
gen7_batch_lrm(&cmd_buffer->batch, GPGPU_DISPATCHDIMX, bo, bo_offset);