[Piglit] [PATCH 1/4] arb_seamless_cube_map/three-faces-average: remove hard-coded window/probe coords

Brian Paul brianp at vmware.com
Fri May 2 14:53:45 PDT 2014


Previously, the test would only pass with 150 x 150 window size.
---
 tests/spec/arb_seamless_cube_map/three-faces-average.c |    8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/tests/spec/arb_seamless_cube_map/three-faces-average.c b/tests/spec/arb_seamless_cube_map/three-faces-average.c
index 260b5b3..d15170f 100644
--- a/tests/spec/arb_seamless_cube_map/three-faces-average.c
+++ b/tests/spec/arb_seamless_cube_map/three-faces-average.c
@@ -183,6 +183,10 @@ void piglit_init( int argc, char **argv)
 enum piglit_result piglit_display(void)
 {
 	bool pass = true;
+	int w = piglit_width / 2;
+	int h = piglit_height / 2;
+
+	glViewport(0, 0, piglit_width, piglit_height);
 
 	glClear(GL_COLOR_BUFFER_BIT);
 
@@ -193,14 +197,14 @@ enum piglit_result piglit_display(void)
 	glDrawArrays(GL_TRIANGLE_FAN, 0, 4);
 
 	/* expect red */
-	pass = piglit_probe_rect_rgb(0, 0, 75, 75, red) && pass;
+	pass = piglit_probe_rect_rgb(0, 0, w, h, red) && pass;
 
 	/* texcoords should target vector to bottom corner */
 	glUniform3fv(cubeVec_loc, 1, cubeVecNegative);
 	glDrawArrays(GL_TRIANGLE_FAN, 4, 4);
 
 	/* expect blue */
-	pass = piglit_probe_rect_rgb(75, 75, 75,75, blue) && pass;
+	pass = piglit_probe_rect_rgb(w, h, w, h, blue) && pass;
 
 	piglit_present_results();
 
-- 
1.7.10.4



More information about the Piglit mailing list