From 382757bb45e61924cef1cd9a01b49f11e0f44326 Mon Sep 17 00:00:00 2001 From: Connor Abbott Date: Wed, 7 Sep 2022 17:16:40 +0200 Subject: [PATCH] tu: Also set SP_FS_MRT_REG for unused attachments This fixes some flakes with dEQP-VK.pipeline.monolithic.multisample.alpha_to_coverage_unused_attachment.samples_2.alpha_opaque on a650 with some other patches on top. I believe this is also the source of the flakes on a630. Part-of: --- src/freedreno/ci/freedreno-a630-flakes.txt | 4 ---- src/freedreno/vulkan/tu_cmd_buffer.c | 7 ++++++- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/src/freedreno/ci/freedreno-a630-flakes.txt b/src/freedreno/ci/freedreno-a630-flakes.txt index 9f14853673c..ef65fdbcc1c 100644 --- a/src/freedreno/ci/freedreno-a630-flakes.txt +++ b/src/freedreno/ci/freedreno-a630-flakes.txt @@ -81,10 +81,6 @@ dEQP-EGL.functional.wide_color.pbuffer_888_colorspace_srgb dEQP-EGL.functional.wide_color.window_8888_colorspace_default dEQP-EGL.functional.wide_color.window_8888_colorspace_srgb -dEQP-VK.pipeline.multisample.alpha_to_coverage_unused_attachment.samples_2.alpha_opaque -dEQP-VK.pipeline.multisample.alpha_to_coverage_unused_attachment.samples_4.alpha_opaque -gmem-dEQP-VK.pipeline.monolithic.multisample.alpha_to_coverage_unused_attachment.samples_2.alpha_opaque - # Started at least by Jan 2020, current as of May 2021 dEQP-GLES31.functional.layout_binding.ssbo.fragment_binding_array diff --git a/src/freedreno/vulkan/tu_cmd_buffer.c b/src/freedreno/vulkan/tu_cmd_buffer.c index ed312b76a32..b047b342e3c 100644 --- a/src/freedreno/vulkan/tu_cmd_buffer.c +++ b/src/freedreno/vulkan/tu_cmd_buffer.c @@ -282,11 +282,16 @@ tu6_emit_mrt(struct tu_cmd_buffer *cmd, * * This means that with dynamic rendering, pipelines may write to * some attachments that are UNUSED here. Setting the format to 0 - * here should prevent them from writing to anything. + * here should prevent them from writing to anything. This also seems + * to also be required for alpha-to-coverage which can use the alpha + * value for an otherwise-unused attachment. */ tu_cs_emit_pkt4(cs, REG_A6XX_RB_MRT_BUF_INFO(i), 6); for (unsigned i = 0; i < 6; i++) tu_cs_emit(cs, 0); + + tu_cs_emit_regs(cs, + A6XX_SP_FS_MRT_REG(i, .dword = 0)); continue; }