From 646afcc34045cd482e79ded241aac23082e65f6c Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Sat, 23 Oct 2010 09:45:24 -0600 Subject: [PATCH] mesa: simplify target_can_be_compressed() function --- src/mesa/main/teximage.c | 26 ++++++++++++++++++-------- 1 file changed, 18 insertions(+), 8 deletions(-) diff --git a/src/mesa/main/teximage.c b/src/mesa/main/teximage.c index bc66e5d76e0..b31c5792bad 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; + } } -- 2.30.2