summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFabian Bieler <fabianbieler@fastmail.fm>2017-12-29 16:06:02 +0100
committerFabian Bieler <fabianbieler@fastmail.fm>2018-01-16 20:10:43 +0100
commit7841f685ab6c88759e7730eff84838d06b144f7f (patch)
treeafb0a0806163faa652d3a53df381fec208ea2a6b
parent748b62a81d1b77cd5a78988245a32cf24566c205 (diff)
ignore-adjacent-veritces: Use util function to probe framebuffer.
Use newly created piglit_probe_rect_two_rgb instead of test-local framebuffer probing code. Reviewed-by: Brian Paul <brianp@vmware.com>
-rw-r--r--tests/spec/arb_geometry_shader4/execution/ignore-adjacent-vertices.c37
1 files changed, 4 insertions, 33 deletions
diff --git a/tests/spec/arb_geometry_shader4/execution/ignore-adjacent-vertices.c b/tests/spec/arb_geometry_shader4/execution/ignore-adjacent-vertices.c
index 22152894f..cda4f079c 100644
--- a/tests/spec/arb_geometry_shader4/execution/ignore-adjacent-vertices.c
+++ b/tests/spec/arb_geometry_shader4/execution/ignore-adjacent-vertices.c
@@ -112,38 +112,6 @@ PIGLIT_GL_TEST_CONFIG_END
GLuint color_uniform;
-/* Check that the framebuffer is yellow and black. */
-static bool
-check_framebuffer(void)
-{
- int y, x;
- uint32_t *buffer = malloc(sizeof(uint32_t) * piglit_width *
- piglit_height);
-#ifdef __BIG_ENDIAN__
- const GLenum type = GL_UNSIGNED_INT_8_8_8_8_REV;
-#else
- const GLenum type = GL_UNSIGNED_INT_8_8_8_8;
-#endif
-
- glReadPixels(0, 0, piglit_width, piglit_height, GL_RGBA, type, buffer);
-
- for (y = 0; y < piglit_height; ++y) {
- for (x = 0; x < piglit_width; ++x) {
- uint32_t val = buffer[y * piglit_width + x] &
- 0xFFFFFF00;
-
- if (val != 0 && val != 0xFFFF0000) {
- fprintf(stderr,
- "FAIL: Rendered primitives differ.\n");
- return false;
- }
- }
- }
-
- free(buffer);
- return true;
-}
-
/* Parse command line arguments.
*
* Recognized command line arguments are:
@@ -240,8 +208,10 @@ enum piglit_result
piglit_display(void)
{
bool pass = true;
+ const float black[] = {0, 0, 0, 1};
const float red[] = {1, 0, 0, 1};
const float green[] = {0, 1, 0, 1};
+ const float yellow[] = {1, 1, 0, 1};
glClear(GL_COLOR_BUFFER_BIT);
@@ -253,7 +223,8 @@ piglit_display(void)
glUniform4fv(color_uniform, 1, green);
draw(test->base);
- pass = check_framebuffer() && pass;
+ pass = piglit_probe_rect_two_rgb(0, 0, piglit_width, piglit_height,
+ black, yellow) && pass;
pass = piglit_check_gl_error(GL_NO_ERROR) && pass;
if (!piglit_automatic)