Module: Mesa Branch: main Commit: ca4800fa76d8fcc8dd394be99437593d354dcbea URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=ca4800fa76d8fcc8dd394be99437593d354dcbea
Author: Iago Toral Quiroga <[email protected]> Date: Wed Jul 27 14:32:24 2022 +0200 v3dv: vkCmdClearAttachments no longer generates its own RCL We improved this a long time ago and now it emits a clear rect inside the current subpass job instead of emitting its own job with its own RCL, so we no longer need to handle this as an exception to the rule. Reviewed-by: Alejandro PiƱeiro <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17854> --- src/broadcom/vulkan/v3dv_cmd_buffer.c | 58 ++++++++++++++++------------------- 1 file changed, 26 insertions(+), 32 deletions(-) diff --git a/src/broadcom/vulkan/v3dv_cmd_buffer.c b/src/broadcom/vulkan/v3dv_cmd_buffer.c index 3215563b1bc..de2025397c9 100644 --- a/src/broadcom/vulkan/v3dv_cmd_buffer.c +++ b/src/broadcom/vulkan/v3dv_cmd_buffer.c @@ -522,40 +522,34 @@ cmd_buffer_end_render_pass_frame(struct v3dv_cmd_buffer *cmd_buffer) struct v3dv_job *job = cmd_buffer->state.job; assert(job); - /* Typically, we have a single job for each subpass and we emit the job's RCL - * here when we are ending the frame for the subpass. However, some commands - * such as vkCmdClearAttachments need to run in their own separate job and - * they emit their own RCL even if they execute inside a subpass. In this - * scenario, we don't want to emit subpass RCL when we end the frame for - * those jobs, so we only emit the subpass RCL if the job has not recorded - * any RCL commands of its own. - */ - if (v3dv_cl_offset(&job->rcl) == 0) { - /* Decide if we want to enable double-buffer for this job. If we do, then - * we need to rewrite the TILE_BINNING_MODE_CFG packet in the BCL. - */ - if (job_should_enable_double_buffer(job)) { - assert(!job->frame_tiling.double_buffer); - job_compute_frame_tiling(job, - job->frame_tiling.width, - job->frame_tiling.height, - job->frame_tiling.layers, - job->frame_tiling.render_target_count, - job->frame_tiling.internal_bpp, - job->frame_tiling.msaa, - true); - - v3dv_X(job->device, job_emit_enable_double_buffer)(job); - } - /* At this point we have decided whether we want to use double-buffer or - * not and the job's frame tiling represents that decision so we can - * allocate the tile state, which we need to do before we emit the RCL. - */ - v3dv_job_allocate_tile_state(job); + /* For subpass jobs we always emit the RCL here */ + assert(v3dv_cl_offset(&job->rcl) == 0); - v3dv_X(cmd_buffer->device, cmd_buffer_emit_render_pass_rcl)(cmd_buffer); - } + /* Decide if we want to enable double-buffer for this job. If we do, then + * we need to rewrite the TILE_BINNING_MODE_CFG packet in the BCL. + */ + if (job_should_enable_double_buffer(job)) { + assert(!job->frame_tiling.double_buffer); + job_compute_frame_tiling(job, + job->frame_tiling.width, + job->frame_tiling.height, + job->frame_tiling.layers, + job->frame_tiling.render_target_count, + job->frame_tiling.internal_bpp, + job->frame_tiling.msaa, + true); + + v3dv_X(job->device, job_emit_enable_double_buffer)(job); + } + + /* At this point we have decided whether we want to use double-buffer or + * not and the job's frame tiling represents that decision so we can + * allocate the tile state, which we need to do before we emit the RCL. + */ + v3dv_job_allocate_tile_state(job); + + v3dv_X(cmd_buffer->device, cmd_buffer_emit_render_pass_rcl)(cmd_buffer); v3dv_X(cmd_buffer->device, job_emit_binning_flush)(job); }
