[Mesa-dev] [PATCH v3 1/2] mesa: Fix order of format + type and internal format checks for glTexImage ops
Eduardo Lima Mitev
elima at igalia.com
Fri Aug 21 01:54:03 PDT 2015
On 08/18/2015 10:34 PM, Mark Janes wrote:
> This patch regresses the following tests:
>
> piglit.spec.oes_compressed_paletted_texture.basic api
> piglit.spec.oes_compressed_paletted_texture.basic api
> piglit.spec.oes_compressed_etc1_rgb8_texture.basic
>
> When you submit v4, please verify that there are no piglit or dEQP
> regressions. Also, please combine the three patches into a single
> series; mixing patches from your v2 and your v3 is confusing.
>
Ok, acknowledged. Will fix it and re-submit as a new mini-series. Thanks
for catching these.
Eduardo
> -Mark
>
> Eduardo Lima Mitev <elima at igalia.com> writes:
>
>> The more specific GLES constrains should be checked after the general
>> validation performed by _mesa_error_check_format_and_type(). This is also
>> for consistency with the error checks order of glTexSubImage ops.
>>
>> Fixes 1 dEQP test:
>> * dEQP-GLES2.functional.negative_api.texture.teximage2d_invalid_format
>> ---
>> src/mesa/main/teximage.c | 34 +++++++++++++++++-----------------
>> 1 file changed, 17 insertions(+), 17 deletions(-)
>>
>> diff --git a/src/mesa/main/teximage.c b/src/mesa/main/teximage.c
>> index b15b200..04eb188 100644
>> --- a/src/mesa/main/teximage.c
>> +++ b/src/mesa/main/teximage.c
>> @@ -1694,15 +1694,14 @@ texture_error_check( struct gl_context *ctx,
>> return GL_TRUE;
>> }
>>
>> - /* OpenGL ES 1.x and OpenGL ES 2.0 impose additional restrictions on the
>> - * combinations of format, internalFormat, and type that can be used.
>> - * Formats and types that require additional extensions (e.g., GL_FLOAT
>> - * requires GL_OES_texture_float) are filtered elsewhere.
>> - */
>> - if (_mesa_is_gles(ctx) &&
>> - texture_format_error_check_gles(ctx, format, type, internalFormat,
>> - dimensions, "glTexImage%dD")) {
>> - return GL_TRUE;
>> + /* Check incoming image format and type */
>> + err = _mesa_error_check_format_and_type(ctx, format, type);
>> + if (err != GL_NO_ERROR) {
>> + _mesa_error(ctx, err,
>> + "glTexImage%dD(incompatible format = %s, type = %s)",
>> + dimensions, _mesa_enum_to_string(format),
>> + _mesa_enum_to_string(type));
>> + return GL_TRUE;
>> }
>>
>> /* Check internalFormat */
>> @@ -1713,14 +1712,15 @@ texture_error_check( struct gl_context *ctx,
>> return GL_TRUE;
>> }
>>
>> - /* Check incoming image format and type */
>> - err = _mesa_error_check_format_and_type(ctx, format, type);
>> - if (err != GL_NO_ERROR) {
>> - _mesa_error(ctx, err,
>> - "glTexImage%dD(incompatible format = %s, type = %s)",
>> - dimensions, _mesa_enum_to_string(format),
>> - _mesa_enum_to_string(type));
>> - return GL_TRUE;
>> + /* OpenGL ES 1.x and OpenGL ES 2.0 impose additional restrictions on the
>> + * combinations of format, internalFormat, and type that can be used.
>> + * Formats and types that require additional extensions (e.g., GL_FLOAT
>> + * requires GL_OES_texture_float) are filtered elsewhere.
>> + */
>> + if (_mesa_is_gles(ctx) &&
>> + texture_format_error_check_gles(ctx, format, type, internalFormat,
>> + dimensions, "glTexImage%dD")) {
>> + return GL_TRUE;
>> }
>>
>> /* validate the bound PBO, if any */
>> --
>> 2.4.6
>
More information about the mesa-dev
mailing list