[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
Tue Aug 18 09:32:25 PDT 2015
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