diff options
author | Ben Widawsky <benjamin.widawsky@intel.com> | 2015-10-22 22:00:47 -0700 |
---|---|---|
committer | Ben Widawsky <benjamin.widawsky@intel.com> | 2015-11-04 21:29:45 -0800 |
commit | cbc46c6e01eac6e33554b58c76775e4042140ee2 (patch) | |
tree | b16a921bce73d04cf8dae35b802cebfa85a0ffe7 | |
parent | f4a7f36c9cb35461906437581037af61cc7fea24 (diff) |
arb_shader_stencil_export: Compare all valuesstencil_export
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 <airlied@redhat.com>
Signed-off-by: Ben Widawsky <benjamin.widawsky@intel.com>
-rw-r--r-- | tests/spec/arb_shader_stencil_export/glsl-fs-shader-stencil-export.c | 14 |
1 files 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 e4db7ca8c..9de57faea 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 |