[Piglit] [PATCH] glsl-fs-user-varying-ff: Don't probe an undefined value.

Eric Anholt eric at anholt.net
Wed Jan 23 10:40:15 PST 2013


It's undefined.  You don't get to expect that it's anything in
particular, particularly not green which is a very common undefined
value.
---
 tests/shaders/glsl-fs-user-varying-ff.c |   15 +++++++--------
 1 file changed, 7 insertions(+), 8 deletions(-)

diff --git a/tests/shaders/glsl-fs-user-varying-ff.c b/tests/shaders/glsl-fs-user-varying-ff.c
index 4f7131c..4717008 100644
--- a/tests/shaders/glsl-fs-user-varying-ff.c
+++ b/tests/shaders/glsl-fs-user-varying-ff.c
@@ -52,23 +52,22 @@ enum piglit_result
 piglit_display(void)
 {
 	static const float green[3] = { 0.0, 1.0, 0.0 };
-	enum piglit_result result = PIGLIT_PASS;
+	float junk[4];
 
 	glClear(GL_COLOR_BUFFER_BIT);
 
 	glColor3fv(green);
 	piglit_draw_rect(10, 10, 10, 10);
 
-	/* The vertex shader is passing green to the fragment shader in an
-	 * illegal way.  The rendered result must not be green!
+	/* The result is undefined (and in particular we may find
+	 * green since so many other tests happen to load our
+	 * registers with green), but the GPU shouldn't hang.
 	 */
-	if (piglit_probe_pixel_rgb(15, 15, green))
-		result = PIGLIT_FAIL;
+	glReadPixels(15, 15, 1, 1, GL_RGBA, GL_FLOAT, junk);
 
-	if (!piglit_automatic)
-		piglit_present_results();
+	piglit_present_results();
 
-	return result;
+	return PIGLIT_PASS;
 }
 
 void
-- 
1.7.10.4



More information about the Piglit mailing list