From 11469f7553dc69a6c4b779527e6738c3206aa21c Mon Sep 17 00:00:00 2001 From: Samuel Pitoiset Date: Mon, 9 Jan 2023 16:16:56 +0100 Subject: [PATCH] radv: copy the non-compacted color format at pipeline bind time For PS epilogs on-demand. Signed-off-by: Samuel Pitoiset Part-of: --- src/amd/vulkan/radv_cmd_buffer.c | 4 ++-- src/amd/vulkan/radv_private.h | 2 ++ 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/amd/vulkan/radv_cmd_buffer.c b/src/amd/vulkan/radv_cmd_buffer.c index cd751c3b43f..56ea06648b1 100644 --- a/src/amd/vulkan/radv_cmd_buffer.c +++ b/src/amd/vulkan/radv_cmd_buffer.c @@ -1730,7 +1730,6 @@ radv_emit_prefetch_L2(struct radv_cmd_buffer *cmd_buffer, static void radv_emit_rbplus_state(struct radv_cmd_buffer *cmd_buffer) { - struct radv_graphics_pipeline *pipeline = cmd_buffer->state.graphics_pipeline; const struct radv_dynamic_state *d = &cmd_buffer->state.dynamic; struct radv_rendering_state *render = &cmd_buffer->state.render; @@ -1758,7 +1757,7 @@ radv_emit_rbplus_state(struct radv_cmd_buffer *cmd_buffer) ? !G_028C74_FORCE_DST_ALPHA_1_GFX11(cb->cb_color_attrib) : !G_028C74_FORCE_DST_ALPHA_1_GFX6(cb->cb_color_attrib); - uint32_t spi_format = (pipeline->col_format_non_compacted >> (i * 4)) & 0xf; + uint32_t spi_format = (cmd_buffer->state.col_format_non_compacted >> (i * 4)) & 0xf; uint32_t colormask = d->vk.cb.attachments[i].write_mask; if (format == V_028C70_COLOR_8 || format == V_028C70_COLOR_16 || format == V_028C70_COLOR_32) @@ -6167,6 +6166,7 @@ radv_CmdBindPipeline(VkCommandBuffer commandBuffer, VkPipelineBindPoint pipeline if (cmd_buffer->device->physical_device->rad_info.rbplus_allowed && (!cmd_buffer->state.emitted_graphics_pipeline || cmd_buffer->state.emitted_graphics_pipeline->col_format_non_compacted != graphics_pipeline->col_format_non_compacted)) { + cmd_buffer->state.col_format_non_compacted = graphics_pipeline->col_format_non_compacted; cmd_buffer->state.dirty |= RADV_CMD_DIRTY_RBPLUS; } diff --git a/src/amd/vulkan/radv_private.h b/src/amd/vulkan/radv_private.h index 4d1aaebee64..2e1850b2b22 100644 --- a/src/amd/vulkan/radv_private.h +++ b/src/amd/vulkan/radv_private.h @@ -1559,6 +1559,8 @@ struct radv_cmd_state { unsigned tess_num_patches; unsigned tess_lds_size; + unsigned col_format_non_compacted; + /* Binning state */ unsigned last_pa_sc_binner_cntl_0; };