diff options
author | Fabian Bieler <fabianbieler@fastmail.fm> | 2017-12-29 16:16:42 +0100 |
---|---|---|
committer | Fabian Bieler <fabianbieler@fastmail.fm> | 2018-01-16 20:10:43 +0100 |
commit | e707dda56cb6767521d99166934434f762e89154 (patch) | |
tree | 2117d22a519d06c3659b2de4c1b12e3c30c47b54 /tests | |
parent | 7841f685ab6c88759e7730eff84838d06b144f7f (diff) |
triangle-rasterization: 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>
Diffstat (limited to 'tests')
-rw-r--r-- | tests/general/triangle-rasterization.cpp | 19 |
1 files changed, 8 insertions, 11 deletions
diff --git a/tests/general/triangle-rasterization.cpp b/tests/general/triangle-rasterization.cpp index db8fbc4a9..3ebff79cc 100644 --- a/tests/general/triangle-rasterization.cpp +++ b/tests/general/triangle-rasterization.cpp @@ -340,22 +340,19 @@ void triangle_art(uint32_t* buffer) */ uint32_t* check_triangle() { + const float black[] = { 0, 0, 0 }; + const float yellow[] = { 1, 1, 0 }; + + if (piglit_probe_rect_two_rgb(0, 0, fbo_width, fbo_height, black, + yellow)) + return NULL; + static uint32_t* buffer = 0; if (!buffer) buffer = new uint32_t[fbo_width * fbo_height]; glReadPixels(0, 0, fbo_width, fbo_height, GL_RGBA, GL_UNSIGNED_INT_8_8_8_8, buffer); - for (int y = 0; y < fbo_height; ++y) { - for (int x = 0; x < fbo_width; ++x) { - uint32_t val = buffer[y*fbo_width + x] & 0xFFFFFF00; - - if (val != 0 && val != 0xFFFF0000) { - return buffer; - } - } - } - - return NULL; + return buffer; } |