diff options
author | Antia Puentes <apuentes@igalia.com> | 2018-02-20 13:55:13 +0100 |
---|---|---|
committer | Antia Puentes <apuentes@igalia.com> | 2018-02-23 10:24:49 +0100 |
commit | 5f11fdff7b329eb5712eed98f783a6164410336f (patch) | |
tree | 55d0d4937adea7ebfc9c2775d1f9b791c0740aed /tests | |
parent | e95fdd20ae72c3def63e08b1b63f2bd9dadef4a9 (diff) |
internalformat_query*: fix SAMPLES pname checks for RGB9_E5
SAMPLES and NUM_SAMPLE_COUNTS queries accept internalformats which
are defined as color-, depth- or stencil-renderable. RGB9_E5 is marked
as non color-renderable in OpenGL 4.6, however if the
EXT_texture_shared_exponent extension is exposed it must be considered
as such. The later was discussed in:
https://github.com/KhronosGroup/OpenGL-API/issues/32
v2: use 'tex' as shortname for texture instead of 'text' (Piñeiro)
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=104794
Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com>
Diffstat (limited to 'tests')
-rw-r--r-- | tests/spec/arb_internalformat_query/api-errors.c | 16 | ||||
-rw-r--r-- | tests/spec/arb_internalformat_query2/samples-pnames.c | 25 |
2 files changed, 39 insertions, 2 deletions
diff --git a/tests/spec/arb_internalformat_query/api-errors.c b/tests/spec/arb_internalformat_query/api-errors.c index a174143a3..9f2fc599a 100644 --- a/tests/spec/arb_internalformat_query/api-errors.c +++ b/tests/spec/arb_internalformat_query/api-errors.c @@ -128,7 +128,10 @@ static const GLenum invalid_formats[] = { GL_BGRA_INTEGER_EXT, GL_LUMINANCE_INTEGER_EXT, GL_LUMINANCE_ALPHA_INTEGER_EXT, - GL_RGB9_E5 +}; + +static const GLenum tex_shared_exponent_formats[] = { + GL_RGB9_E5, }; static const GLenum valid_pnames[] = { @@ -295,6 +298,17 @@ piglit_init(int argc, char **argv) GL_INVALID_ENUM) && pass; + /* RGB9_E5 is defined as color-renderable if EXT_texture_shared_exponent + * is exposed, otherwise INVALID_ENUM should be returned. + */ + if (!piglit_is_extension_supported("GL_EXT_texture_shared_exponent")) { + pass = try(valid_targets, ARRAY_SIZE(valid_targets), + tex_shared_exponent_formats, 1, + valid_pnames, ARRAY_SIZE(valid_pnames), + GL_INVALID_ENUM) + && pass; + } + /* The GL_ARB_internalformat_query spec says: * * "If the <target> parameter to GetInternalformativ is not one of diff --git a/tests/spec/arb_internalformat_query2/samples-pnames.c b/tests/spec/arb_internalformat_query2/samples-pnames.c index f6def23d0..42c18d9de 100644 --- a/tests/spec/arb_internalformat_query2/samples-pnames.c +++ b/tests/spec/arb_internalformat_query2/samples-pnames.c @@ -96,7 +96,10 @@ static const GLenum non_renderable_internalformats[] = { GL_BGRA_INTEGER_EXT, GL_LUMINANCE_INTEGER_EXT, GL_LUMINANCE_ALPHA_INTEGER_EXT, - GL_RGB9_E5 +}; + +static const GLenum tex_shared_exponent_formats[] = { + GL_RGB9_E5, }; enum piglit_result @@ -217,6 +220,16 @@ check_num_sample_counts(void) GL_NUM_SAMPLE_COUNTS, data) && pass; + /* RGB9_E5 is not defined as color-renderable unless + * EXT_texture_shared_exponent is exposed. + */ + if (!piglit_is_extension_supported("GL_EXT_texture_shared_exponent")) { + pass = try(valid_targets, ARRAY_SIZE(valid_targets), + tex_shared_exponent_formats, 1, + GL_NUM_SAMPLE_COUNTS, data) + && pass; + } + /* * ... or if <target> does not support * multiple samples (ie other than @@ -266,6 +279,16 @@ check_samples(void) GL_SAMPLES, data) && pass; + /* RGB9_E5 is not defined as color-renderable unless + * EXT_texture_shared_exponent is exposed. + */ + if (!piglit_is_extension_supported("GL_EXT_texture_shared_exponent")) { + pass = try(valid_targets, ARRAY_SIZE(valid_targets), + tex_shared_exponent_formats, 1, + GL_SAMPLES, data) + && pass; + } + /* * or if <target> does not support multiple samples (ie other * than TEXTURE_2D_MULTISAMPLE, TEXTURE_2D_MULTISAMPLE_ARRAY, |