summaryrefslogtreecommitdiffstats
path: root/src/mesa/main
diff options
context:
space:
mode:
authorAnuj Phogat <[email protected]>2012-08-21 11:03:48 -0700
committerAnuj Phogat <[email protected]>2012-08-21 15:00:06 -0700
commitdf2c4cbcedb2dcf2aa44adaa6462d9becccbea49 (patch)
tree3e6db794049f1cb6ed01396657b073c4b89474af /src/mesa/main
parent1cb07bd3b8abd5e52e9dbd80bb1666058545387e (diff)
mesa: Fix generic compressed texture formats' handling in glTexImage/glCopyTexImage
The generic texture formats should be accepted by the <internalformat> parameter of TexImage1D, TexImage2D, TexImage3D, CopyTexImage1D, and CopyTexImage2D functions. When the application specifies a generic format, the driver is free to pick an uncompressed format. This patch reverts the changes due to following commit: commit a36581ccc06693231011c3fe136207e73191b1ce mesa: do more teximage error checking for generic compressed formats This patch fixes compressed texture format failures in intel oglconform pxconv-gettex test case: https://bugs.freedesktop.org/show_bug.cgi?id=47220 Signed-off-by: Anuj Phogat <[email protected]> Reviewed-by: Brian Paul <[email protected]>
Diffstat (limited to 'src/mesa/main')
-rw-r--r--src/mesa/main/teximage.c32
1 files changed, 2 insertions, 30 deletions
diff --git a/src/mesa/main/teximage.c b/src/mesa/main/teximage.c
index fd02a1be23f..27294ba8018 100644
--- a/src/mesa/main/teximage.c
+++ b/src/mesa/main/teximage.c
@@ -541,32 +541,6 @@ _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;
*/
@@ -1745,8 +1719,7 @@ texture_error_check( struct gl_context *ctx,
}
/* additional checks for compressed textures */
- if (_mesa_is_compressed_format(ctx, internalFormat) ||
- is_generic_compressed_format(internalFormat)) {
+ if (_mesa_is_compressed_format(ctx, internalFormat)) {
if (!target_can_be_compressed(ctx, target, internalFormat)) {
if (!isProxy)
_mesa_error(ctx, GL_INVALID_ENUM,
@@ -2077,8 +2050,7 @@ copytexture_error_check( struct gl_context *ctx, GLuint dimensions,
return GL_TRUE;
}
- if (_mesa_is_compressed_format(ctx, internalFormat) ||
- is_generic_compressed_format(internalFormat)) {
+ if (_mesa_is_compressed_format(ctx, internalFormat)) {
if (!target_can_be_compressed(ctx, target, internalFormat)) {
_mesa_error(ctx, GL_INVALID_ENUM,
"glCopyTexImage%dD(target)", dimensions);