mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-07 13:38:06 +02:00
mesa: Fix valid texture target test in _mesa_GetTexLevelParameteriv()
_mesa_max_texture_levels() is also used to test valid texture target
in _mesa_GetTexLevelParameteriv(). GL_TEXTURE_CUBE_MAP is not allowed
as texture target in glGetTexLevelParameter(). So, this should throw
GL_INVALID_ENUM error.
Few other functions which use _mesa_max_texture_levels() like
getcompressedteximage_error_check() and getteximage_error_check()
also don't accept GL_TEXTURE_CUBE_MAP.
Above fix makes piglit fbo-cubemap test to fail. This is because of
incorrect texture target passed to _mesa_max_texture_levels() in
framebuffer_texture(). Fixing that as well
Note: This is a candidate for the stable branches
Signed-off-by: Anuj Phogat <anuj.phogat@gmail.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
(cherry picked from commit a9523af0e8)
This commit is contained in:
parent
a3f6e8f431
commit
1ebdf22224
2 changed files with 1 additions and 2 deletions
|
|
@ -2004,7 +2004,7 @@ framebuffer_texture(struct gl_context *ctx, const char *caller, GLenum target,
|
|||
}
|
||||
|
||||
if ((level < 0) ||
|
||||
(level >= _mesa_max_texture_levels(ctx, texObj->Target))) {
|
||||
(level >= _mesa_max_texture_levels(ctx, textarget))) {
|
||||
_mesa_error(ctx, GL_INVALID_VALUE,
|
||||
"glFramebufferTexture%sEXT(level)", caller);
|
||||
return;
|
||||
|
|
|
|||
|
|
@ -911,7 +911,6 @@ _mesa_max_texture_levels(struct gl_context *ctx, GLenum target)
|
|||
case GL_TEXTURE_CUBE_MAP_NEGATIVE_Y_ARB:
|
||||
case GL_TEXTURE_CUBE_MAP_POSITIVE_Z_ARB:
|
||||
case GL_TEXTURE_CUBE_MAP_NEGATIVE_Z_ARB:
|
||||
case GL_TEXTURE_CUBE_MAP_ARB:
|
||||
case GL_PROXY_TEXTURE_CUBE_MAP_ARB:
|
||||
return ctx->Extensions.ARB_texture_cube_map
|
||||
? ctx->Const.MaxCubeTextureLevels : 0;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue