summaryrefslogtreecommitdiff
path: root/src/gallium/drivers/llvmpipe/lp_state_fs.c
diff options
context:
space:
mode:
authorDave Airlie <airlied@redhat.com>2022-09-29 08:19:44 +1000
committerMarge Bot <emma+marge@anholt.net>2022-09-30 01:22:42 +0000
commit38907a40ab0848c9fe8d1b7ad6d0f4047fcf6f5b (patch)
tree5a85735720b490f2d7a844f9b49d0ef34335eb41 /src/gallium/drivers/llvmpipe/lp_state_fs.c
parente28db68e53c3e265df5dd66c5b6bfe7cfb762f2a (diff)
llvmpipe/fs: pass mask type to alpha to coverage handler
Reviewed-by: Brian Paul <brianp@vmware.com> Reviewed-by: Mihai Preda <mhpreda@gmail.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18876>
Diffstat (limited to 'src/gallium/drivers/llvmpipe/lp_state_fs.c')
-rw-r--r--src/gallium/drivers/llvmpipe/lp_state_fs.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/gallium/drivers/llvmpipe/lp_state_fs.c b/src/gallium/drivers/llvmpipe/lp_state_fs.c
index 7e554662bdd..9dabfcb4a80 100644
--- a/src/gallium/drivers/llvmpipe/lp_state_fs.c
+++ b/src/gallium/drivers/llvmpipe/lp_state_fs.c
@@ -408,6 +408,7 @@ lp_build_sample_alpha_to_coverage(struct gallivm_state *gallivm,
unsigned coverage_samples,
LLVMValueRef num_loop,
LLVMValueRef loop_counter,
+ LLVMTypeRef coverage_mask_type,
LLVMValueRef coverage_mask_store,
LLVMValueRef alpha)
{
@@ -422,8 +423,9 @@ lp_build_sample_alpha_to_coverage(struct gallivm_state *gallivm,
LLVMValueRef s_mask_idx = LLVMBuildMul(builder, lp_build_const_int32(gallivm, s), num_loop, "");
s_mask_idx = LLVMBuildAdd(builder, s_mask_idx, loop_counter, "");
- LLVMValueRef s_mask_ptr = LLVMBuildGEP(builder, coverage_mask_store, &s_mask_idx, 1, "");
- LLVMValueRef s_mask = LLVMBuildLoad(builder, s_mask_ptr, "");
+ LLVMValueRef s_mask_ptr = LLVMBuildGEP2(builder, coverage_mask_type,
+ coverage_mask_store, &s_mask_idx, 1, "");
+ LLVMValueRef s_mask = LLVMBuildLoad2(builder, coverage_mask_type, s_mask_ptr, "");
s_mask = LLVMBuildAnd(builder, s_mask, test, "");
LLVMBuildStore(builder, s_mask, s_mask_ptr);
}
@@ -1089,7 +1091,7 @@ generate_fs_loop(struct gallivm_state *gallivm,
} else {
lp_build_sample_alpha_to_coverage(gallivm, type, key->coverage_samples, num_loop,
loop_state.counter,
- mask_store, alpha);
+ mask_type, mask_store, alpha);
}
}
}