summaryrefslogtreecommitdiff
path: root/src/mesa/main/teximage.c
diff options
context:
space:
mode:
authorBrian Paul <brianp@vmware.com>2010-10-23 09:45:24 -0600
committerBrian Paul <brianp@vmware.com>2010-10-23 10:19:31 -0600
commit646afcc34045cd482e79ded241aac23082e65f6c (patch)
tree45c89f85459eeb964d9b41af4cd7f4b9e1dc6496 /src/mesa/main/teximage.c
parent77ca2044a0b14cfe089763d6e0b548bd9eaf9358 (diff)
mesa: simplify target_can_be_compressed() function
Diffstat (limited to 'src/mesa/main/teximage.c')
-rw-r--r--src/mesa/main/teximage.c26
1 files changed, 18 insertions, 8 deletions
diff --git a/src/mesa/main/teximage.c b/src/mesa/main/teximage.c
index bc66e5d76e..b31c5792ba 100644
--- a/src/mesa/main/teximage.c
+++ b/src/mesa/main/teximage.c
@@ -1230,14 +1230,24 @@ _mesa_test_proxy_teximage(struct gl_context *ctx, GLenum target, GLint level,
static GLboolean
target_can_be_compressed(struct gl_context *ctx, GLenum target)
{
- return (((target == GL_TEXTURE_2D || target == GL_PROXY_TEXTURE_2D))
- || ((ctx->Extensions.ARB_texture_cube_map &&
- (target == GL_PROXY_TEXTURE_CUBE_MAP ||
- (target >= GL_TEXTURE_CUBE_MAP_POSITIVE_X &&
- target <= GL_TEXTURE_CUBE_MAP_NEGATIVE_Z))))
- || ((ctx->Extensions.MESA_texture_array &&
- ((target == GL_PROXY_TEXTURE_2D_ARRAY_EXT) ||
- (target == GL_TEXTURE_2D_ARRAY_EXT)))));
+ switch (target) {
+ case GL_TEXTURE_2D:
+ case GL_PROXY_TEXTURE_2D:
+ return GL_TRUE;
+ case GL_PROXY_TEXTURE_CUBE_MAP:
+ case GL_TEXTURE_CUBE_MAP_POSITIVE_X:
+ case GL_TEXTURE_CUBE_MAP_NEGATIVE_X:
+ case GL_TEXTURE_CUBE_MAP_POSITIVE_Y:
+ case GL_TEXTURE_CUBE_MAP_NEGATIVE_Y:
+ case GL_TEXTURE_CUBE_MAP_POSITIVE_Z:
+ case GL_TEXTURE_CUBE_MAP_NEGATIVE_Z:
+ return ctx->Extensions.ARB_texture_cube_map;
+ case GL_PROXY_TEXTURE_2D_ARRAY_EXT:
+ case GL_TEXTURE_2D_ARRAY_EXT:
+ return ctx->Extensions.MESA_texture_array;
+ default:
+ return GL_FALSE;
+ }
}