diff options
author | Eric Anholt <eric@anholt.net> | 2015-01-11 15:16:02 +1300 |
---|---|---|
committer | Eric Anholt <eric@anholt.net> | 2015-03-25 12:46:18 -0700 |
commit | a04c0af968922b694221899d6da5f5a752a304f8 (patch) | |
tree | 9b627c3c1272b8482fac83c6493ae3b6d8648c14 | |
parent | c4c2d33b2ae89c5dd53311f8658e1d676ffd9bfa (diff) |
arb_color_buffer_float: Don't try to use MRT if number of draw buffers is 1.
The ARB_draw_buffers spec allows GL_MAX_DRAW_BUFFERS == 1, which means
that our GL_COLOR_ATTACHMENT1 usage will throw a GL error.
Fixes ARB_color_buffer_float/GL_RGBA8-queries on VC4.
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
-rw-r--r-- | tests/spec/arb_color_buffer_float/common.h | 18 |
1 files changed, 13 insertions, 5 deletions
diff --git a/tests/spec/arb_color_buffer_float/common.h b/tests/spec/arb_color_buffer_float/common.h index bc3bf45ce..da59df90f 100644 --- a/tests/spec/arb_color_buffer_float/common.h +++ b/tests/spec/arb_color_buffer_float/common.h @@ -172,13 +172,21 @@ static GLboolean run_test() } else { - enum test_mode_type mrt_modes = (piglit_is_extension_supported("GL_ARB_draw_buffers") ? - (piglit_is_extension_supported("GL_ARB_texture_float") ? - TEST_SRT_MRT : - TEST_MRT) : - TEST_SRT); + enum test_mode_type mrt_modes; enum test_mode_type first_mrt_mode = (test_mode == TEST_MRT) ? TEST_SRT : TEST_NO_RT; + mrt_modes = TEST_SRT_MRT; + if (!piglit_is_extension_supported("GL_ARB_texture_float")) + mrt_modes = TEST_MRT; + if (!piglit_is_extension_supported("GL_ARB_draw_buffers")) + mrt_modes = TEST_SRT; + else { + GLint val; + glGetIntegerv(GL_MAX_DRAW_BUFFERS, &val); + if (val < 2) + mrt_modes = TEST_SRT; + } + for (mrt_mode = first_mrt_mode; mrt_mode < mrt_modes; ++mrt_mode) { fixed1 = fixed; |