From c6a569f2427f4346cd32c9bfd01102ca1cfddbae Mon Sep 17 00:00:00 2001 From: Dave Airlie Date: Wed, 15 Jun 2022 16:26:18 +1000 Subject: [PATCH] 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 Part-of: (cherry picked from commit 6e5d126a657a790cfa58282e4b754c9ea1e2c47c) --- .pick_status.json | 2 +- src/gallium/drivers/llvmpipe/lp_state_fs.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.pick_status.json b/.pick_status.json index d0020e9e712..2f336d2715a 100644 --- a/.pick_status.json +++ b/.pick_status.json @@ -364,7 +364,7 @@ "description": "llvmpipe: disable alpha test branch if multisample is enabled.", "nominated": true, "nomination_type": 0, - "resolution": 0, + "resolution": 1, "main_sha": null, "because_sha": null }, diff --git a/src/gallium/drivers/llvmpipe/lp_state_fs.c b/src/gallium/drivers/llvmpipe/lp_state_fs.c index 756e263b60c..fd82ca981e1 100644 --- a/src/gallium/drivers/llvmpipe/lp_state_fs.c +++ b/src/gallium/drivers/llvmpipe/lp_state_fs.c @@ -995,7 +995,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); } }