From: Brian Paul Date: Thu, 13 Aug 2009 16:14:13 +0000 (-0600) Subject: mesa: add extension checks in _mesa_max_texture_levels() X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=fe988d786c4076bfbf410b84085d8c1115baa489;p=mesa.git mesa: add extension checks in _mesa_max_texture_levels() --- diff --git a/src/mesa/main/teximage.c b/src/mesa/main/teximage.c index 19e47b460fc..82283030409 100644 --- a/src/mesa/main/teximage.c +++ b/src/mesa/main/teximage.c @@ -784,10 +784,6 @@ _mesa_max_texture_levels(GLcontext *ctx, GLenum target) case GL_PROXY_TEXTURE_1D: case GL_TEXTURE_2D: case GL_PROXY_TEXTURE_2D: - case GL_TEXTURE_1D_ARRAY_EXT: - case GL_PROXY_TEXTURE_1D_ARRAY_EXT: - case GL_TEXTURE_2D_ARRAY_EXT: - case GL_PROXY_TEXTURE_2D_ARRAY_EXT: return ctx->Const.MaxTextureLevels; case GL_TEXTURE_3D: case GL_PROXY_TEXTURE_3D: @@ -800,10 +796,17 @@ _mesa_max_texture_levels(GLcontext *ctx, GLenum target) case GL_TEXTURE_CUBE_MAP_NEGATIVE_Z_ARB: case GL_TEXTURE_CUBE_MAP_ARB: case GL_PROXY_TEXTURE_CUBE_MAP_ARB: - return ctx->Const.MaxCubeTextureLevels; + return ctx->Extensions.ARB_texture_cube_map + ? ctx->Const.MaxCubeTextureLevels : 0; case GL_TEXTURE_RECTANGLE_NV: case GL_PROXY_TEXTURE_RECTANGLE_NV: - return 1; + return ctx->Extensions.NV_texture_rectangle ? 1 : 0; + case GL_TEXTURE_1D_ARRAY_EXT: + case GL_PROXY_TEXTURE_1D_ARRAY_EXT: + case GL_TEXTURE_2D_ARRAY_EXT: + case GL_PROXY_TEXTURE_2D_ARRAY_EXT: + return ctx->Extensions.MESA_texture_array + ? ctx->Const.MaxTextureLevels : 0; default: return 0; /* bad target */ }