summaryrefslogtreecommitdiffstats
path: root/src/gallium/auxiliary/draw/draw_llvm.c
diff options
context:
space:
mode:
authorRoland Scheidegger <[email protected]>2015-12-17 17:54:12 +0100
committerRoland Scheidegger <[email protected]>2015-12-18 00:57:07 +0100
commit6743c68a1190ffeedc0d124ca2dd9c22b3bc851c (patch)
treecf802524abe4cb58c0161e779c05751aecee8ca3 /src/gallium/auxiliary/draw/draw_llvm.c
parent44e87b7b7b49669d10b6d60500885e51b42d05c3 (diff)
draw: fix clip test with NaNs
NaNs mean it should be clipped, otherwise the NaNs might get passed to the next stages (if clipping didn't happen for another reason already), which might cause all kind of problems. The llvm path got this right already (possibly by luck), but this isn't used when there's a gs active. Found by code inspection, verified with some hacked piglit test and some more hacked debug output. (Note the clipper can still itself incorrectly generate NaN and INF position values in its output prims (at least after w divide / viewport transform) even if the inputs weren't NaNs, if the position data of the vertices is "sufficiently bad".) Reviewed-by: Brian Paul <[email protected]>
Diffstat (limited to 'src/gallium/auxiliary/draw/draw_llvm.c')
-rw-r--r--src/gallium/auxiliary/draw/draw_llvm.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/gallium/auxiliary/draw/draw_llvm.c b/src/gallium/auxiliary/draw/draw_llvm.c
index 89ed045ca34..f25dafef954 100644
--- a/src/gallium/auxiliary/draw/draw_llvm.c
+++ b/src/gallium/auxiliary/draw/draw_llvm.c
@@ -1201,6 +1201,10 @@ generate_clipmask(struct draw_llvm *llvm,
cv_w = pos_w;
}
+ /*
+ * Be careful with the comparisons and NaNs (using llvm's unordered
+ * comparisons here).
+ */
/* Cliptest, for hardwired planes */
/*
* XXX should take guardband into account (currently not in key).