For certain hardware, the underlying memory format of the buffer is weird.
Comparing all the data is essential for finding bugs on that hardware.

Cc: Dave Airlie <airl...@redhat.com>
Signed-off-by: Ben Widawsky <benjamin.widaw...@intel.com>
---
 .../glsl-fs-shader-stencil-export.c                        | 14 ++++++++------
 1 file changed, 8 insertions(+), 6 deletions(-)

diff --git 
a/tests/spec/arb_shader_stencil_export/glsl-fs-shader-stencil-export.c 
b/tests/spec/arb_shader_stencil_export/glsl-fs-shader-stencil-export.c
index e4db7ca..9de57fa 100644
--- a/tests/spec/arb_shader_stencil_export/glsl-fs-shader-stencil-export.c
+++ b/tests/spec/arb_shader_stencil_export/glsl-fs-shader-stencil-export.c
@@ -46,8 +46,8 @@ static GLint prog;
 enum piglit_result
 piglit_display(void)
 {
-       GLboolean pass = GL_TRUE;
-       float p[4];
+       uint8_t p[256 * 256];
+       int i;
 
        glClearColor(0.5, 0.5, 0.5, 0.5);
        glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT | 
GL_STENCIL_BUFFER_BIT);
@@ -57,13 +57,15 @@ piglit_display(void)
 
        piglit_draw_rect(-1, -1, 2, 2);
 
-       glReadPixels(0, 0, 3, 1, GL_STENCIL_INDEX, GL_FLOAT, p);
+       glReadPixels(0, 0, 256, 256, GL_STENCIL_INDEX, GL_UNSIGNED_BYTE, p);
        piglit_present_results();
 
        /* we hardcode 129 in the shader */
-       if (p[0] != 129)
-               pass = GL_FALSE;
-       return pass ? PIGLIT_PASS : PIGLIT_FAIL;
+       for (i = 0; i < 256 * 256; i++)
+               if (p[i] != 129)
+                       return PIGLIT_FAIL;
+
+       return PIGLIT_PASS;
 }
 
 void
-- 
2.6.1

_______________________________________________
Piglit mailing list
Piglit@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/piglit

Reply via email to