[Piglit] [PATCH 1/2] arb_viewport_array/viewport_indices: allow float precision instead of double

Marek Olšák maraeo at gmail.com
Fri Feb 9 00:59:18 UTC 2018


From: Marek Olšák <marek.olsak at amd.com>

Mesa will not use doubles for this state.
---
 tests/spec/arb_viewport_array/viewport_indices.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/tests/spec/arb_viewport_array/viewport_indices.c b/tests/spec/arb_viewport_array/viewport_indices.c
index 0088828..567f83d 100644
--- a/tests/spec/arb_viewport_array/viewport_indices.c
+++ b/tests/spec/arb_viewport_array/viewport_indices.c
@@ -194,21 +194,23 @@ test_preserve_invalid_index(GLint maxVP)
 		    || vpGet[3] != vp[3]) {
 			printf("Viewport index %d got erroneously changed\n",
 			       i);
 			pass = false;
 		}
 #ifdef PIGLIT_USE_OPENGL
 		glGetDoublei_v(GL_DEPTH_RANGE, i, drGet);
 #else
 		glGetFloati_vOES(GL_DEPTH_RANGE, i, drGet);
 #endif
-		if (drGet[0] != dr[0] || drGet[1] != dr[1]) {
+		/* Allow float precisions instead of double for desktop GL. */
+		if ((float)drGet[0] != (float)dr[0] ||
+		    (float)drGet[1] != (float)dr[1]) {
 			printf("DepthRange index %d got erroneously changed\n",
 			       i);
 			pass = false;
 		}
 		glGetIntegeri_v(GL_SCISSOR_BOX, i, scGet);
 		if (scGet[0] != sc[0] || scGet[1] != sc[1] || scGet[2] != sc[2]
 		    || scGet[3] != sc[3]) {
 			printf("Scissor Box for index %d got erroneously changed\n",
 			       i);
 			pass = false;
-- 
2.7.4



More information about the Piglit mailing list