aboutsummaryrefslogtreecommitdiff
path: root/mesalib/src/mesa/main/teximage.c
diff options
context:
space:
mode:
authormarha <marha@users.sourceforge.net>2012-05-09 15:52:33 +0200
committermarha <marha@users.sourceforge.net>2012-05-09 15:52:33 +0200
commit8a448108ec0bc3a0a488b2234e0d12aee503c67c (patch)
tree22e71069622608062b2f5eab3ef485438cd32122 /mesalib/src/mesa/main/teximage.c
parent62068b3bc534d504e40df34847b4436f1a496f35 (diff)
downloadvcxsrv-8a448108ec0bc3a0a488b2234e0d12aee503c67c.tar.gz
vcxsrv-8a448108ec0bc3a0a488b2234e0d12aee503c67c.tar.bz2
vcxsrv-8a448108ec0bc3a0a488b2234e0d12aee503c67c.zip
libX11 mesa xserver xkeyboard-config
Diffstat (limited to 'mesalib/src/mesa/main/teximage.c')
-rw-r--r--mesalib/src/mesa/main/teximage.c32
1 files changed, 30 insertions, 2 deletions
diff --git a/mesalib/src/mesa/main/teximage.c b/mesalib/src/mesa/main/teximage.c
index 50095d2c6..694f6fa00 100644
--- a/mesalib/src/mesa/main/teximage.c
+++ b/mesalib/src/mesa/main/teximage.c
@@ -531,6 +531,32 @@ _mesa_base_tex_format( struct gl_context *ctx, GLint internalFormat )
/**
+ * Is the given texture format a generic compressed format?
+ */
+static GLboolean
+is_generic_compressed_format(GLenum format)
+{
+ switch (format) {
+ case GL_COMPRESSED_RED:
+ case GL_COMPRESSED_RG:
+ case GL_COMPRESSED_RGB:
+ case GL_COMPRESSED_RGBA:
+ case GL_COMPRESSED_ALPHA:
+ case GL_COMPRESSED_LUMINANCE:
+ case GL_COMPRESSED_LUMINANCE_ALPHA:
+ case GL_COMPRESSED_INTENSITY:
+ case GL_COMPRESSED_SRGB:
+ case GL_COMPRESSED_SRGB_ALPHA:
+ case GL_COMPRESSED_SLUMINANCE:
+ case GL_COMPRESSED_SLUMINANCE_ALPHA:
+ return GL_TRUE;
+ default:
+ return GL_FALSE;
+ }
+}
+
+
+/**
* For cube map faces, return a face index in [0,5].
* For other targets return 0;
*/
@@ -1705,7 +1731,8 @@ texture_error_check( struct gl_context *ctx,
}
/* additional checks for compressed textures */
- if (_mesa_is_compressed_format(ctx, internalFormat)) {
+ if (_mesa_is_compressed_format(ctx, internalFormat) ||
+ is_generic_compressed_format(internalFormat)) {
if (!target_can_be_compressed(ctx, target, internalFormat)) {
if (!isProxy)
_mesa_error(ctx, GL_INVALID_ENUM,
@@ -2036,7 +2063,8 @@ copytexture_error_check( struct gl_context *ctx, GLuint dimensions,
return GL_TRUE;
}
- if (_mesa_is_compressed_format(ctx, internalFormat)) {
+ if (_mesa_is_compressed_format(ctx, internalFormat) ||
+ is_generic_compressed_format(internalFormat)) {
if (!target_can_be_compressed(ctx, target, internalFormat)) {
_mesa_error(ctx, GL_INVALID_ENUM,
"glCopyTexImage%dD(target)", dimensions);