Mesa (master): mesa: Don't allow snorm internal formats in glCopyTexImage* () in GLES3
Anuj Phogat
aphogat at kemper.freedesktop.org
Tue Aug 5 01:32:10 UTC 2014
Module: Mesa
Branch: master
Commit: 2d362a6aee0a1acab08590f2ba0ce50743546209
URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=2d362a6aee0a1acab08590f2ba0ce50743546209
Author: Anuj Phogat <anuj.phogat at gmail.com>
Date: Fri Jun 6 14:53:12 2014 -0700
mesa: Don't allow snorm internal formats in glCopyTexImage*() in GLES3
Fixes few failures in gles3 Khronos CTS test: packed_pixels
Cc: "10.2" <mesa-stable at lists.freedesktop.org>
Signed-off-by: Anuj Phogat <anuj.phogat at gmail.com>
Reviewed-by: Jason Ekstrand <jason.ekstrand at intel.com>
---
src/mesa/main/teximage.c | 11 +++++++++++
1 file changed, 11 insertions(+)
diff --git a/src/mesa/main/teximage.c b/src/mesa/main/teximage.c
index 21ba4b6..48a9128 100644
--- a/src/mesa/main/teximage.c
+++ b/src/mesa/main/teximage.c
@@ -2711,6 +2711,17 @@ copytexture_error_check( struct gl_context *ctx, GLuint dimensions,
"glCopyTexImage%dD(srgb usage mismatch)", dimensions);
return GL_TRUE;
}
+
+ /* Page 139, Table 3.15 of OpenGL ES 3.0 spec does not define ReadPixels
+ * types for SNORM formats. Also, conversion to SNORM formats is not
+ * allowed by Table 3.2 on Page 110.
+ */
+ if(_mesa_is_enum_format_snorm(internalFormat)) {
+ _mesa_error(ctx, GL_INVALID_OPERATION,
+ "glCopyTexImage%dD(internalFormat=%s)", dimensions,
+ _mesa_lookup_enum_by_nr(internalFormat));
+ return GL_TRUE;
+ }
}
if (!_mesa_source_buffer_exists(ctx, baseFormat)) {
More information about the mesa-commit
mailing list