diff options
author | Jordan Justen <[email protected]> | 2018-11-14 11:41:23 -0800 |
---|---|---|
committer | Marge Bot <[email protected]> | 2020-06-24 00:14:36 +0000 |
commit | ecf3335eef889f1c04b928a1a6371c6bd7b67fa5 (patch) | |
tree | bf205afa63daaab8ae225f0bb08efc3573a32c39 /src/intel | |
parent | 759b7f83dd713c2a41e4e39500b797afdddabde5 (diff) |
anv/cmd_buffer: Split GPGPU_WALKER out to emit_gpgpu_walker
Signed-off-by: Jordan Justen <[email protected]>
Reviewed-by: Lionel Landwerlin <[email protected]>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5571>
Diffstat (limited to 'src/intel')
-rw-r--r-- | src/intel/vulkan/genX_cmd_buffer.c | 64 |
1 files changed, 32 insertions, 32 deletions
diff --git a/src/intel/vulkan/genX_cmd_buffer.c b/src/intel/vulkan/genX_cmd_buffer.c index 5eb05aae19e..34afcf7a505 100644 --- a/src/intel/vulkan/genX_cmd_buffer.c +++ b/src/intel/vulkan/genX_cmd_buffer.c @@ -4321,6 +4321,34 @@ void genX(CmdDispatch)( genX(CmdDispatchBase)(commandBuffer, 0, 0, 0, x, y, z); } +static inline void +emit_gpgpu_walker(struct anv_cmd_buffer *cmd_buffer, + const struct anv_compute_pipeline *pipeline, bool indirect, + const struct brw_cs_prog_data *prog_data, + uint32_t groupCountX, uint32_t groupCountY, + uint32_t groupCountZ) +{ + bool predicate = (GEN_GEN <= 7 && indirect) || + cmd_buffer->state.conditional_render_enabled; + const struct anv_cs_parameters cs_params = anv_cs_parameters(pipeline); + + anv_batch_emit(&cmd_buffer->batch, GENX(GPGPU_WALKER), ggw) { + ggw.IndirectParameterEnable = indirect; + ggw.PredicateEnable = predicate; + ggw.SIMDSize = cs_params.simd_size / 16; + ggw.ThreadDepthCounterMaximum = 0; + ggw.ThreadHeightCounterMaximum = 0; + ggw.ThreadWidthCounterMaximum = cs_params.threads - 1; + ggw.ThreadGroupIDXDimension = groupCountX; + ggw.ThreadGroupIDYDimension = groupCountY; + ggw.ThreadGroupIDZDimension = groupCountZ; + ggw.RightExecutionMask = pipeline->cs_right_mask; + ggw.BottomExecutionMask = 0xffffffff; + } + + anv_batch_emit(&cmd_buffer->batch, GENX(MEDIA_STATE_FLUSH), msf); +} + void genX(CmdDispatchBase)( VkCommandBuffer commandBuffer, uint32_t baseGroupX, @@ -4361,22 +4389,8 @@ void genX(CmdDispatchBase)( if (cmd_buffer->state.conditional_render_enabled) genX(cmd_emit_conditional_render_predicate)(cmd_buffer); - const struct anv_cs_parameters cs_params = anv_cs_parameters(pipeline); - - anv_batch_emit(&cmd_buffer->batch, GENX(GPGPU_WALKER), ggw) { - ggw.PredicateEnable = cmd_buffer->state.conditional_render_enabled; - ggw.SIMDSize = cs_params.simd_size / 16; - ggw.ThreadDepthCounterMaximum = 0; - ggw.ThreadHeightCounterMaximum = 0; - ggw.ThreadWidthCounterMaximum = cs_params.threads - 1; - ggw.ThreadGroupIDXDimension = groupCountX; - ggw.ThreadGroupIDYDimension = groupCountY; - ggw.ThreadGroupIDZDimension = groupCountZ; - ggw.RightExecutionMask = pipeline->cs_right_mask; - ggw.BottomExecutionMask = 0xffffffff; - } - - anv_batch_emit(&cmd_buffer->batch, GENX(MEDIA_STATE_FLUSH), msf); + emit_gpgpu_walker(cmd_buffer, pipeline, false, prog_data, groupCountX, + groupCountY, groupCountZ); } #define GPGPU_DISPATCHDIMX 0x2500 @@ -4393,7 +4407,7 @@ void genX(CmdDispatchIndirect)( struct anv_compute_pipeline *pipeline = cmd_buffer->state.compute.pipeline; const struct brw_cs_prog_data *prog_data = get_cs_prog_data(pipeline); struct anv_address addr = anv_address_add(buffer->address, offset); - struct anv_batch *batch = &cmd_buffer->batch; + UNUSED struct anv_batch *batch = &cmd_buffer->batch; anv_cmd_buffer_push_base_group_id(cmd_buffer, 0, 0, 0); @@ -4477,21 +4491,7 @@ void genX(CmdDispatchIndirect)( genX(cmd_emit_conditional_render_predicate)(cmd_buffer); #endif - const struct anv_cs_parameters cs_params = anv_cs_parameters(pipeline); - - anv_batch_emit(batch, GENX(GPGPU_WALKER), ggw) { - ggw.IndirectParameterEnable = true; - ggw.PredicateEnable = GEN_GEN <= 7 || - cmd_buffer->state.conditional_render_enabled; - ggw.SIMDSize = cs_params.simd_size / 16; - ggw.ThreadDepthCounterMaximum = 0; - ggw.ThreadHeightCounterMaximum = 0; - ggw.ThreadWidthCounterMaximum = cs_params.threads - 1; - ggw.RightExecutionMask = pipeline->cs_right_mask; - ggw.BottomExecutionMask = 0xffffffff; - } - - anv_batch_emit(batch, GENX(MEDIA_STATE_FLUSH), msf); + emit_gpgpu_walker(cmd_buffer, pipeline, true, prog_data, 0, 0, 0); } static void |