llvmpipe: Fix alpha-to-coverage without dithering

Implementing alpha-to-coverage dithering broke the non-dithering case.
(Discovered by accident, not really a big deal since it's almost always
enabled and can only be disabled by using a Nvidia GL extension, and
can't be disabled with Vulkan.)

Fixes: ad4635d6ef
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/33586>
This commit is contained in:
Roland Scheidegger
2025-02-17 19:18:39 +01:00
committed by Marge Bot
parent 244c9cc45e
commit 61911b6a4b
3 changed files with 4 additions and 1 deletions
+2 -1
View File
@@ -321,6 +321,7 @@ lp_build_alpha_to_coverage(struct gallivm_state *gallivm,
struct lp_type type,
struct lp_build_mask_context *mask,
LLVMValueRef alpha,
bool dither,
bool do_branch)
{
struct lp_build_context bld;
@@ -329,7 +330,7 @@ lp_build_alpha_to_coverage(struct gallivm_state *gallivm,
lp_build_context_init(&bld, gallivm, type);
alpha_ref_value = lp_build_const_vec(gallivm, type, 0);
alpha_ref_value = lp_build_const_vec(gallivm, type, dither ? 0 : 0.5);
test = lp_build_cmp(&bld, PIPE_FUNC_GREATER, alpha, alpha_ref_value);
@@ -104,6 +104,7 @@ lp_build_alpha_to_coverage(struct gallivm_state *gallivm,
struct lp_type type,
struct lp_build_mask_context *mask,
LLVMValueRef alpha,
bool dither,
bool do_branch);
#endif /* !LP_BLD_BLEND_H */
@@ -1150,6 +1150,7 @@ generate_fs_loop(struct gallivm_state *gallivm,
if (!key->multisample) {
lp_build_alpha_to_coverage(gallivm, type,
&mask, alpha,
key->blend.alpha_to_coverage_dither,
(depth_mode & LATE_DEPTH_TEST) != 0);
} else {
lp_build_sample_alpha_to_coverage(gallivm, type, key->coverage_samples, num_loop,