Mesa (main): llvmpipe: disable alpha test branch if multisample is enabled.

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Thu Jun 16 22:59:38 UTC 2022


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

Author: Dave Airlie <airlied at redhat.com>
Date:   Wed Jun 15 16:26:18 2022 +1000

llvmpipe: disable alpha test branch if multisample is enabled.

If multisample is enabled and alpha testing happens, the
branch can jump out of the fragment shader before the other
samples are generated. Just don't take the branch optimisation
post alpha test if multisample is enabled.

This should fix some rendering bugs in kicad with multisample
enabled.

Cc: mesa-stable
Reviewed-by: Roland Scheidegger <sroland at vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17049>

---

 src/gallium/drivers/llvmpipe/lp_state_fs.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/gallium/drivers/llvmpipe/lp_state_fs.c b/src/gallium/drivers/llvmpipe/lp_state_fs.c
index 5a23202d174..89ec81f569a 100644
--- a/src/gallium/drivers/llvmpipe/lp_state_fs.c
+++ b/src/gallium/drivers/llvmpipe/lp_state_fs.c
@@ -1005,7 +1005,7 @@ generate_fs_loop(struct gallivm_state *gallivm,
 
          lp_build_alpha_test(gallivm, key->alpha.func, type, cbuf_format_desc,
                              &mask, alpha, alpha_ref_value,
-                             (depth_mode & LATE_DEPTH_TEST) != 0);
+                             ((depth_mode & LATE_DEPTH_TEST) != 0) && !key->multisample);
       }
    }
 



More information about the mesa-commit mailing list