aboutsummaryrefslogtreecommitdiff
path: root/mesalib/src/mesa/main/teximage.c
diff options
context:
space:
mode:
authormarha <marha@users.sourceforge.net>2012-01-25 08:24:51 +0100
committermarha <marha@users.sourceforge.net>2012-01-25 08:24:51 +0100
commite6432710d8a586386b3c7025e845cf4f80830da3 (patch)
treea403fa86779a287c97f5605f9b4d455d662ece66 /mesalib/src/mesa/main/teximage.c
parentd3f0fe49b8cb29295f3e529cc699a2abde1515a1 (diff)
downloadvcxsrv-e6432710d8a586386b3c7025e845cf4f80830da3.tar.gz
vcxsrv-e6432710d8a586386b3c7025e845cf4f80830da3.tar.bz2
vcxsrv-e6432710d8a586386b3c7025e845cf4f80830da3.zip
mesa git update 25 jan 2012
Diffstat (limited to 'mesalib/src/mesa/main/teximage.c')
-rw-r--r--mesalib/src/mesa/main/teximage.c39
1 files changed, 31 insertions, 8 deletions
diff --git a/mesalib/src/mesa/main/teximage.c b/mesalib/src/mesa/main/teximage.c
index 39732522c..c64b10b04 100644
--- a/mesalib/src/mesa/main/teximage.c
+++ b/mesalib/src/mesa/main/teximage.c
@@ -1938,6 +1938,24 @@ copytexture_error_check( struct gl_context *ctx, GLuint dimensions,
return GL_TRUE;
}
+ /* From the EXT_texture_integer spec:
+ *
+ * "INVALID_OPERATION is generated by CopyTexImage* and CopyTexSubImage*
+ * if the texture internalformat is an integer format and the read color
+ * buffer is not an integer format, or if the internalformat is not an
+ * integer format and the read color buffer is an integer format."
+ */
+ if (_mesa_is_color_format(internalFormat)) {
+ struct gl_renderbuffer *rb = ctx->ReadBuffer->_ColorReadBuffer;
+
+ if (_mesa_is_integer_format(rb->InternalFormat) !=
+ _mesa_is_integer_format(internalFormat)) {
+ _mesa_error(ctx, GL_INVALID_OPERATION,
+ "glCopyTexImage%dD(integer vs non-integer)", dimensions);
+ return GL_TRUE;
+ }
+ }
+
/* Do size, level checking */
sizeOK = (proxyTarget == GL_PROXY_TEXTURE_CUBE_MAP_ARB)
? (width == height) : 1;
@@ -2153,16 +2171,21 @@ copytexsubimage_error_check2( struct gl_context *ctx, GLuint dimensions,
return GL_TRUE;
}
- /* If copying into an integer texture, the source buffer must also be
- * integer-valued.
+ /* From the EXT_texture_integer spec:
+ *
+ * "INVALID_OPERATION is generated by CopyTexImage* and CopyTexSubImage*
+ * if the texture internalformat is an integer format and the read color
+ * buffer is not an integer format, or if the internalformat is not an
+ * integer format and the read color buffer is an integer format."
*/
- if (_mesa_is_format_integer_color(teximage->TexFormat)) {
+ if (_mesa_is_color_format(teximage->InternalFormat)) {
struct gl_renderbuffer *rb = ctx->ReadBuffer->_ColorReadBuffer;
- if (!_mesa_is_format_integer_color(rb->Format)) {
- _mesa_error(ctx, GL_INVALID_OPERATION,
- "glCopyTexSubImage%dD(source buffer is not integer format)",
- dimensions);
- return GL_TRUE;
+
+ if (_mesa_is_format_integer_color(rb->Format) !=
+ _mesa_is_format_integer_color(teximage->TexFormat)) {
+ _mesa_error(ctx, GL_INVALID_OPERATION,
+ "glCopyTexImage%dD(integer vs non-integer)", dimensions);
+ return GL_TRUE;
}
}