From b2282e3a571f18b48b8b717ec32da1d0ed93f1b5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alejandro=20Pi=C3=B1eiro?= Date: Wed, 15 May 2024 13:04:22 +0200 Subject: [PATCH] v3dv/meta_clear: use v3dv_renderpass used as parameter emit_subpass_color_clear_rects and emit_subpass_ds_clear_rects is receiving a v3dv_render_pass parameter pass, but then using cmd_buffer->state.pass to access the current pass. All calls to those methods are already initializing that parameter to that value. This commit just uses the parameter. An alternative would be to remove one of the parameters of the function call. I find this option slightly more readable. Reviewed-by: Iago Toral Quiroga Part-of: --- src/broadcom/vulkan/v3dv_meta_clear.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/src/broadcom/vulkan/v3dv_meta_clear.c b/src/broadcom/vulkan/v3dv_meta_clear.c index 9e1435a752e..0342631b50d 100644 --- a/src/broadcom/vulkan/v3dv_meta_clear.c +++ b/src/broadcom/vulkan/v3dv_meta_clear.c @@ -1015,11 +1015,10 @@ emit_subpass_color_clear_rects(struct v3dv_cmd_buffer *cmd_buffer, return; /* Obtain a pipeline for this clear */ - assert(attachment_idx < cmd_buffer->state.pass->attachment_count); - const VkFormat format = - cmd_buffer->state.pass->attachments[attachment_idx].desc.format; + assert(attachment_idx < pass->attachment_count); + const VkFormat format = pass->attachments[attachment_idx].desc.format; const VkSampleCountFlagBits samples = - cmd_buffer->state.pass->attachments[attachment_idx].desc.samples; + pass->attachments[attachment_idx].desc.samples; const uint32_t components = VK_COLOR_COMPONENT_R_BIT | VK_COLOR_COMPONENT_G_BIT | VK_COLOR_COMPONENT_B_BIT | @@ -1116,7 +1115,7 @@ emit_subpass_ds_clear_rects(struct v3dv_cmd_buffer *cmd_buffer, return; /* Obtain a pipeline for this clear */ - assert(attachment_idx < cmd_buffer->state.pass->attachment_count); + assert(attachment_idx < pass->attachment_count); struct v3dv_meta_depth_clear_pipeline *pipeline = NULL; VkResult result = get_depth_clear_pipeline(cmd_buffer->device,