diff options
Diffstat (limited to 'src/mesa')
-rw-r--r-- | src/mesa/main/teximage.c | 2 | ||||
-rw-r--r-- | src/mesa/main/teximage.h | 2 | ||||
-rw-r--r-- | src/mesa/main/texobj.c | 29 |
3 files changed, 4 insertions, 29 deletions
diff --git a/src/mesa/main/teximage.c b/src/mesa/main/teximage.c index 1efdd7dd902..edcb48d9a6d 100644 --- a/src/mesa/main/teximage.c +++ b/src/mesa/main/teximage.c @@ -503,7 +503,7 @@ get_proxy_tex_image(struct gl_context *ctx, GLenum target, GLint level) * \sa gl_constants. */ GLint -_mesa_max_texture_levels(struct gl_context *ctx, GLenum target) +_mesa_max_texture_levels(const struct gl_context *ctx, GLenum target) { switch (target) { case GL_TEXTURE_1D: diff --git a/src/mesa/main/teximage.h b/src/mesa/main/teximage.h index 266a9f3d83d..261daae3948 100644 --- a/src/mesa/main/teximage.h +++ b/src/mesa/main/teximage.h @@ -179,7 +179,7 @@ _mesa_base_tex_image(const struct gl_texture_object *texObj) extern GLint -_mesa_max_texture_levels(struct gl_context *ctx, GLenum target); +_mesa_max_texture_levels(const struct gl_context *ctx, GLenum target); extern GLboolean diff --git a/src/mesa/main/texobj.c b/src/mesa/main/texobj.c index 38860fed4f0..ef6458e417f 100644 --- a/src/mesa/main/texobj.c +++ b/src/mesa/main/texobj.c @@ -715,33 +715,8 @@ _mesa_test_texobj_completeness( const struct gl_context *ctx, return; } - /* Compute _MaxLevel (the maximum mipmap level we'll sample from given the - * mipmap image sizes and GL_TEXTURE_MAX_LEVEL state). - */ - switch (t->Target) { - case GL_TEXTURE_1D: - case GL_TEXTURE_1D_ARRAY_EXT: - maxLevels = ctx->Const.MaxTextureLevels; - break; - case GL_TEXTURE_2D: - case GL_TEXTURE_2D_ARRAY_EXT: - maxLevels = ctx->Const.MaxTextureLevels; - break; - case GL_TEXTURE_3D: - maxLevels = ctx->Const.Max3DTextureLevels; - break; - case GL_TEXTURE_CUBE_MAP: - case GL_TEXTURE_CUBE_MAP_ARRAY: - maxLevels = ctx->Const.MaxCubeTextureLevels; - break; - case GL_TEXTURE_RECTANGLE_NV: - case GL_TEXTURE_BUFFER: - case GL_TEXTURE_EXTERNAL_OES: - case GL_TEXTURE_2D_MULTISAMPLE: - case GL_TEXTURE_2D_MULTISAMPLE_ARRAY: - maxLevels = 1; /* no mipmapping */ - break; - default: + maxLevels = _mesa_max_texture_levels(ctx, t->Target); + if (maxLevels == 0) { _mesa_problem(ctx, "Bad t->Target in _mesa_test_texobj_completeness"); return; } |