diff options
author | Alejandro Piñeiro <apinheiro@igalia.com> | 2017-10-26 16:27:17 +0200 |
---|---|---|
committer | Alejandro Piñeiro <apinheiro@igalia.com> | 2018-01-30 08:43:10 +0100 |
commit | e1e7aa7344a9861e49a0cb454ffaf75d2c4e31a4 (patch) | |
tree | 5d9fc885f5c8cea2d881f0abd5485147a4ae346b /tests | |
parent | 9a5f164e2d9985bad7c0523619bf6aa1f16d5748 (diff) |
arb_internalformat_query2: minmax GL_ALPHA8 deprecated on 3.1+
When ARB_compatibility is missing or the context is Core.
v2: check for ARB_compatibility or core (Marek)
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Diffstat (limited to 'tests')
-rw-r--r-- | tests/spec/arb_internalformat_query2/minmax.c | 18 |
1 files changed, 16 insertions, 2 deletions
diff --git a/tests/spec/arb_internalformat_query2/minmax.c b/tests/spec/arb_internalformat_query2/minmax.c index a2cf05992..2571e3b21 100644 --- a/tests/spec/arb_internalformat_query2/minmax.c +++ b/tests/spec/arb_internalformat_query2/minmax.c @@ -46,6 +46,10 @@ PIGLIT_GL_TEST_CONFIG_END /* These are all the formats that are required to be color-renderable * by the OpenGL 3.0 spec. + * + * But note that GL_ALPHA8 was removed on 3.1 and beyond on core, or + * if ARB_compatibility is missing, so we need to take that into + * account. */ static const GLenum valid_formats[] = { GL_RGBA32F, @@ -283,6 +287,7 @@ piglit_init(int argc, char **argv) const bool tms_supported = piglit_is_extension_supported("GL_ARB_texture_multisample"); GLint max_samples; + GLint valid_formats_size = ARRAY_SIZE(valid_formats); piglit_require_extension("GL_ARB_framebuffer_object"); piglit_require_extension("GL_ARB_internalformat_query2"); @@ -293,8 +298,17 @@ piglit_init(int argc, char **argv) piglit_require_extension("GL_ARB_texture_float"); } + /* GL_ALPHA8 was removed on OpenGL 3.1 core, or if + * ARB_compatibility is missing, so on that case we skip that + * format + */ + if (piglit_get_gl_version() >= 31 && + (piglit_is_core_profile || + !piglit_is_extension_supported("GL_ARB_compatibility"))) + valid_formats_size = valid_formats_size - 1; + glGetIntegerv(GL_MAX_SAMPLES, &max_samples); - for (i = 0; i < ARRAY_SIZE(valid_formats); i++) { + for (i = 0; i < valid_formats_size; i++) { pass = try(GL_RENDERBUFFER, valid_formats[i], max_samples, @@ -345,7 +359,7 @@ piglit_init(int argc, char **argv) max_samples_name = "GL_MAX_COLOR_TEXTURE_SAMPLES"; } - for (j = 0; j < ARRAY_SIZE(valid_formats); j++) { + for (j = 0; j < valid_formats_size; j++) { pass = try(valid_targets_with_tms[i], valid_formats[j], max_samples, |