Mesa (main): radeonsi: don't compile monolithic PS for dual source blending

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Fri Apr 22 21:24:18 UTC 2022


Module: Mesa
Branch: main
Commit: 2234362f54599e90119b490c63efa6174735451d
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=2234362f54599e90119b490c63efa6174735451d

Author: Marek Olšák <marek.olsak at amd.com>
Date:   Mon Mar 21 08:11:05 2022 -0400

radeonsi: don't compile monolithic PS for dual source blending

The code was compiling monolithic PS if a shader output didn't
have a color buffer, but dual src blending never has a color buffer
for mrt1.

Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer at amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15965>

---

 src/gallium/drivers/radeonsi/si_state_shaders.cpp | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/src/gallium/drivers/radeonsi/si_state_shaders.cpp b/src/gallium/drivers/radeonsi/si_state_shaders.cpp
index 8579a2135f6..c9d78016bf2 100644
--- a/src/gallium/drivers/radeonsi/si_state_shaders.cpp
+++ b/src/gallium/drivers/radeonsi/si_state_shaders.cpp
@@ -2196,8 +2196,11 @@ void si_ps_key_update_framebuffer_blend(struct si_context *sctx)
    /* Eliminate shader code computing output values that are unused.
     * This enables dead code elimination between shader parts.
     * Check if any output is eliminated.
+    *
+    * Dual source blending never has color buffer 1 enabled, so ignore it.
     */
    if (sel->colors_written_4bit &
+       (blend->dual_src_blend ? 0xffffff0f : 0xffffffff) &
        ~(sctx->framebuffer.colorbuf_enabled_4bit & blend->cb_target_enabled_4bit))
       key->ps.opt.prefer_mono = 1;
    else



More information about the mesa-commit mailing list