summaryrefslogtreecommitdiffstats
path: root/src/mesa/main/teximage.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/mesa/main/teximage.c')
-rw-r--r--src/mesa/main/teximage.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/src/mesa/main/teximage.c b/src/mesa/main/teximage.c
index e22881ce6c9..3cd9d401553 100644
--- a/src/mesa/main/teximage.c
+++ b/src/mesa/main/teximage.c
@@ -1927,6 +1927,23 @@ subtexture_error_check( struct gl_context *ctx, GLuint dimensions,
return GL_TRUE;
}
+ /* OpenGL ES 1.x and OpenGL ES 2.0 impose additional restrictions on the
+ * combinations of format 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) && !_mesa_is_gles3(ctx)) {
+ err = _mesa_es_error_check_format_and_type(format, type, dimensions);
+ if (err != GL_NO_ERROR) {
+ _mesa_error(ctx, err,
+ "glTexSubImage%dD(format = %s, type = %s)",
+ dimensions,
+ _mesa_lookup_enum_by_nr(format),
+ _mesa_lookup_enum_by_nr(type));
+ return GL_TRUE;
+ }
+ }
+
err = _mesa_error_check_format_and_type(ctx, format, type);
if (err != GL_NO_ERROR) {
_mesa_error(ctx, err,