aboutsummaryrefslogtreecommitdiffstats
path: root/src/amd/llvm
diff options
context:
space:
mode:
authorMarek Olšák <[email protected]>2020-01-06 19:19:40 -0500
committerMarek Olšák <[email protected]>2020-01-15 15:06:20 -0500
commiteeb4a11c1123c34b4d1c55540f575f6b474f7d08 (patch)
tree408e7a1ebeb6acf660c05086d43302582dc6e2a3 /src/amd/llvm
parent8070402a3043edb34000b1d410f9b73ab45ae686 (diff)
ac/cull: don't read Position.Z if it's not needed for culling
It could be NULL. Reviewed-by: Pierre-Eric Pelloux-Prayer <[email protected]>
Diffstat (limited to 'src/amd/llvm')
-rw-r--r--src/amd/llvm/ac_llvm_cull.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/amd/llvm/ac_llvm_cull.c b/src/amd/llvm/ac_llvm_cull.c
index 9e8409fdbaf..c76d4e1f937 100644
--- a/src/amd/llvm/ac_llvm_cull.c
+++ b/src/amd/llvm/ac_llvm_cull.c
@@ -153,7 +153,7 @@ static LLVMValueRef cull_bbox(struct ac_llvm_context *ctx,
LLVMValueRef accepted = initially_accepted;
/* Compute the primitive bounding box for easy culling. */
- for (unsigned chan = 0; chan < 3; chan++) {
+ for (unsigned chan = 0; chan < (cull_view_near_z || cull_view_far_z ? 3 : 2); chan++) {
bbox_min[chan] = ac_build_fmin(ctx, pos[0][chan], pos[1][chan]);
bbox_min[chan] = ac_build_fmin(ctx, bbox_min[chan], pos[2][chan]);