mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-01-02 22:30:11 +01:00
mesa/main: fix texture view enum checks
These were a bit of a mixed bag; we had some open-coded cases, and a few overly permissive code-paths. Anyway, let's stricten this up a bit. Reviewed-by: Marek Olšák <marek.olsak@amd.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/35097>
This commit is contained in:
parent
f87f6d9cd4
commit
214fd4e40d
1 changed files with 6 additions and 6 deletions
|
|
@ -2500,7 +2500,7 @@ get_tex_parameterfv(struct gl_context *ctx,
|
|||
break;
|
||||
|
||||
case GL_TEXTURE_IMMUTABLE_LEVELS:
|
||||
if (_mesa_is_gles3(ctx) || _mesa_has_texture_view(ctx))
|
||||
if (_mesa_has_texture_view(ctx))
|
||||
*params = (GLfloat) obj->Attrib.ImmutableLevels;
|
||||
else
|
||||
goto invalid_pname;
|
||||
|
|
@ -2793,32 +2793,32 @@ get_tex_parameteriv(struct gl_context *ctx,
|
|||
break;
|
||||
|
||||
case GL_TEXTURE_IMMUTABLE_LEVELS:
|
||||
if (_mesa_has_ARB_texture_view(ctx) || _mesa_is_gles3(ctx))
|
||||
if (_mesa_has_texture_view(ctx))
|
||||
*params = obj->Attrib.ImmutableLevels;
|
||||
else
|
||||
goto invalid_pname;
|
||||
break;
|
||||
|
||||
case GL_TEXTURE_VIEW_MIN_LEVEL:
|
||||
if (!ctx->Extensions.ARB_texture_view)
|
||||
if (!_mesa_has_texture_view(ctx))
|
||||
goto invalid_pname;
|
||||
*params = (GLint) obj->Attrib.MinLevel;
|
||||
break;
|
||||
|
||||
case GL_TEXTURE_VIEW_NUM_LEVELS:
|
||||
if (!ctx->Extensions.ARB_texture_view)
|
||||
if (!_mesa_has_texture_view(ctx))
|
||||
goto invalid_pname;
|
||||
*params = (GLint) obj->Attrib.NumLevels;
|
||||
break;
|
||||
|
||||
case GL_TEXTURE_VIEW_MIN_LAYER:
|
||||
if (!ctx->Extensions.ARB_texture_view)
|
||||
if (!_mesa_has_texture_view(ctx))
|
||||
goto invalid_pname;
|
||||
*params = (GLint) obj->Attrib.MinLayer;
|
||||
break;
|
||||
|
||||
case GL_TEXTURE_VIEW_NUM_LAYERS:
|
||||
if (!ctx->Extensions.ARB_texture_view)
|
||||
if (!_mesa_has_texture_view(ctx))
|
||||
goto invalid_pname;
|
||||
*params = (GLint) obj->Attrib.NumLayers;
|
||||
break;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue