radv: copy the non-compacted color format at pipeline bind time

For PS epilogs on-demand.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20201>
This commit is contained in:
Samuel Pitoiset 2023-01-09 16:16:56 +01:00 committed by Marge Bot
parent bbd7f70073
commit 11469f7553
2 changed files with 4 additions and 2 deletions

View file

@ -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;
}

View file

@ -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;
};