radv: disable MRT compaction with dual-source blending
authorRhys Perry <pendingchaos02@gmail.com>
Wed, 16 Nov 2022 15:08:34 +0000 (15:08 +0000)
committerEric Engestrom <eric@engestrom.ch>
Wed, 23 Nov 2022 19:11:59 +0000 (19:11 +0000)
Fixes crucible tests func.shader.dualsrc_mrt0_undef on navi21 and
func.shader.dualsrc_mrt1_undef on polaris10.

Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Cc: 22.3 mesa-stable
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19806>
(cherry picked from commit ea0ae17fc453401223918b27e0610352fe67e66d)

.pick_status.json
src/amd/vulkan/radv_pipeline.c

index 26c2777..050cc3f 100644 (file)
         "description": "radv: disable MRT compaction with dual-source blending",
         "nominated": true,
         "nomination_type": 0,
-        "resolution": 0,
+        "resolution": 1,
         "main_sha": null,
         "because_sha": null
     },
index 8bb6631..2bdae8f 100644 (file)
@@ -6168,7 +6168,8 @@ radv_graphics_pipeline_init(struct radv_graphics_pipeline *pipeline, struct radv
    pipeline->col_format_non_compacted = blend.spi_shader_col_format;
 
    struct radv_shader *ps = pipeline->base.shaders[MESA_SHADER_FRAGMENT];
-   if (!ps->info.ps.has_epilog) {
+   bool enable_mrt_compaction = !blend.mrt0_is_dual_src && !ps->info.ps.has_epilog;
+   if (enable_mrt_compaction) {
       blend.spi_shader_col_format = radv_compact_spi_shader_col_format(ps, &blend);
    }
 
@@ -6195,7 +6196,7 @@ radv_graphics_pipeline_init(struct radv_graphics_pipeline *pipeline, struct radv
       }
    }
 
-   if (!ps->info.ps.has_epilog) {
+   if (enable_mrt_compaction) {
       /* In presense of MRT holes (ie. the FS exports MRT1 but not MRT0), the compiler will remap
        * them, so that only MRT0 is exported and the driver will compact SPI_SHADER_COL_FORMAT to
        * match what the FS actually exports. Though, to make sure the hw remapping works as