summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRoland Scheidegger <sroland@vmware.com>2016-08-15 04:04:13 +0200
committerRoland Scheidegger <sroland@vmware.com>2016-08-20 03:56:28 +0200
commitc10a05fecce5e61c43dd9d5413d90e3fea332d6d (patch)
treeeb0f106a2725cfecae86fee5309056abb296c4e0
parentd9579605dabf94f3a8747f620975c037779ca376 (diff)
depth-clamp-range: make sure clamping actually makes a difference
The problem with the chosen depth values was that the depth values naturally got viewport-transformed to values below 0.5 (for those quads drawn) or above 0.5 (for those not drawn). This allowed buggy implementations (in particular llvmpipe) to pass the test, even though llvmpipe a) couldn't handle swapped near/far and b) didn't actually do any clamping whatsoever in this particular case. So change the depth values so that transformed values actually end up "on the wrong side" of the depth range. Tested-by: Ilia Mirkin <imirkin@alum.mit.edu>
-rw-r--r--tests/general/depth-clamp-range.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/tests/general/depth-clamp-range.c b/tests/general/depth-clamp-range.c
index dd9300022..d61d35174 100644
--- a/tests/general/depth-clamp-range.c
+++ b/tests/general/depth-clamp-range.c
@@ -89,17 +89,17 @@ piglit_display(void)
/* Now, test that near depth clamping works.*/
glEnable(GL_DEPTH_CLAMP);
glDepthRange(0.25, 1.0);
- quad(30, 10, 2); /* 0.25 - drawn. */
+ quad(30, 10, 4); /* 0.25 - drawn. */
glDepthRange(0.75, 1.0);
- quad(30, 30, 2); /* 0.75 - not drawn. */
+ quad(30, 30, 4); /* 0.75 - not drawn. */
/* Test that far clamping works.*/
glDepthRange(0.0, 0.25);
- quad(50, 10, -2); /* 0.25 - drawn. */
+ quad(50, 10, -4); /* 0.25 - drawn. */
glDepthRange(0.0, 0.75);
- quad(50, 30, -2); /* 0.75 - not drawn. */
+ quad(50, 30, -4); /* 0.75 - not drawn. */
/* Now, flip near and far around and make sure that it's doing the
* min/max of near and far in the clamping.
@@ -107,17 +107,17 @@ piglit_display(void)
/* Test that near (max) clamping works. */
glDepthRange(0.25, 0.0);
- quad(70, 10, 2); /* 0.25 - drawn. */
+ quad(70, 10, 4); /* 0.25 - drawn. */
glDepthRange(0.75, 0.0);
- quad(70, 30, 2); /* 0.75 - not drawn. */
+ quad(70, 30, 4); /* 0.75 - not drawn. */
/* Now, test far (min) clamping works. */
glDepthRange(1.0, 0.0);
- quad(90, 10, -2); /* 0.0 - drawn */
+ quad(90, 10, -4); /* 0.0 - drawn */
glDepthRange(1.0, 0.75);
- quad(90, 30, -2); /* 0.75 - not drawn*/
+ quad(90, 30, -4); /* 0.75 - not drawn*/
pass = piglit_probe_pixel_rgb(15, 15, white) && pass;
pass = piglit_probe_pixel_rgb(15, 35, clear) && pass;