diff options
author | Brian Paul <[email protected]> | 2009-08-13 10:14:13 -0600 |
---|---|---|
committer | Brian Paul <[email protected]> | 2009-08-13 12:50:56 -0600 |
commit | fe988d786c4076bfbf410b84085d8c1115baa489 (patch) | |
tree | c605092b242131a4150ccca8347902c6a10b4a15 /src/mesa/main/teximage.c | |
parent | 47a385b43be9cf2ef0d0b24b1d588dc26940dfe6 (diff) |
mesa: add extension checks in _mesa_max_texture_levels()
Diffstat (limited to 'src/mesa/main/teximage.c')
-rw-r--r-- | src/mesa/main/teximage.c | 15 |
1 files changed, 9 insertions, 6 deletions
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 */ } |