[Piglit] [PATCH 1/4] fs-discard-exit-2: use default window size

Brian Paul brianp at vmware.com
Fri Sep 19 08:12:32 PDT 2014


To fix Windows run.
---
 tests/spec/glsl-1.30/execution/fs-discard-exit-2.c |   19 ++++++++++++-------
 1 file changed, 12 insertions(+), 7 deletions(-)

diff --git a/tests/spec/glsl-1.30/execution/fs-discard-exit-2.c b/tests/spec/glsl-1.30/execution/fs-discard-exit-2.c
index 2a003fe..e9b6cd2 100644
--- a/tests/spec/glsl-1.30/execution/fs-discard-exit-2.c
+++ b/tests/spec/glsl-1.30/execution/fs-discard-exit-2.c
@@ -48,12 +48,12 @@ PIGLIT_GL_TEST_CONFIG_BEGIN
 
 	config.supports_gl_compat_version = 10;
 
-	config.window_width = 64;
-	config.window_height = 64;
 	config.window_visual = PIGLIT_GL_VISUAL_RGBA | PIGLIT_GL_VISUAL_DOUBLE;
 
 PIGLIT_GL_TEST_CONFIG_END
 
+#define SIZE 64
+
 static int coord1_location, coord2_location;
 
 static const char *vs_source =
@@ -90,7 +90,12 @@ piglit_display(void)
 {
 	int x, y;
 	bool pass = true;
-	float expected[64 * 64 * 4];
+	float expected[SIZE * SIZE * 4];
+
+	assert(piglit_width >= SIZE);
+	assert(piglit_height >= SIZE);
+
+	glViewport(0, 0, SIZE, SIZE);
 
 	glClearColor(0.0, 1.0, 0.0, 0.0);
 	glClear(GL_COLOR_BUFFER_BIT);
@@ -106,8 +111,8 @@ piglit_display(void)
 		}
 	}
 
-	for (x = 0; x < 64; x++) {
-		for (y = 0; y < 64; y++) {
+	for (x = 0; x < SIZE; x++) {
+		for (y = 0; y < SIZE; y++) {
 			int sx = x % 8;
 			int sy = y % 8;
 			int dx = fabs(sx - x / 8);
@@ -131,11 +136,11 @@ piglit_display(void)
 					pixel[2] += 0.1;
 			}
 
-			memcpy(expected + (y * 64 + x) * 4, pixel, 4 * 4);
+			memcpy(expected + (y * SIZE + x) * 4, pixel, 4 * 4);
 		}
 	}
 
-	pass = piglit_probe_image_rgba(0, 0, 64, 64, expected);
+	pass = piglit_probe_image_rgba(0, 0, SIZE, SIZE, expected);
 
 	piglit_present_results();
 
-- 
1.7.10.4



More information about the Piglit mailing list