radv: only skip emitting the pipeline blend state if the FS uses an epilog
authorSamuel Pitoiset <samuel.pitoiset@gmail.com>
Fri, 17 Feb 2023 08:24:14 +0000 (09:24 +0100)
committerMarge Bot <emma+marge@anholt.net>
Fri, 17 Feb 2023 13:19:54 +0000 (13:19 +0000)
The blend state is emitted from the command buffer when the FS uses
an epilog (either compiled from a lib with GPL or compiled on-demand).

This shouldn't change anything but it will allow to disable using a
PS epilog when the fragment shader doesn't write any color outputs.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21341>

src/amd/vulkan/radv_pipeline.c

index c164abe..c83b7c8 100644 (file)
@@ -3745,7 +3745,9 @@ radv_pipeline_emit_blend_state(struct radeon_cmdbuf *ctx_cs,
                                const struct radv_graphics_pipeline *pipeline,
                                const struct radv_blend_state *blend)
 {
-   if (pipeline->ps_epilog || radv_pipeline_needs_dynamic_ps_epilog(pipeline))
+   struct radv_shader *ps = pipeline->base.shaders[MESA_SHADER_FRAGMENT];
+
+   if (ps->info.ps.has_epilog)
       return;
 
    radeon_set_context_reg(ctx_cs, R_028714_SPI_SHADER_COL_FORMAT, blend->spi_shader_col_format);