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@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17049>
(cherry picked from commit 6e5d126a65)
This commit is contained in:
Dave Airlie 2022-06-15 16:26:18 +10:00 committed by Dylan Baker
parent 0e3d908eb2
commit c6a569f242
2 changed files with 2 additions and 2 deletions

View file

@ -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
},

View file

@ -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);
}
}