From: Brian Paul Date: Sat, 23 Oct 2010 15:45:24 +0000 (-0600) Subject: mesa: simplify target_can_be_compressed() function X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=646afcc34045cd482e79ded241aac23082e65f6c;p=mesa.git mesa: simplify target_can_be_compressed() function --- 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; + } }