mesa: fix some TexParameter and SamplerParameter cases

EXT extension was added without tests so these functions did
not work properly.

Fixes: 799710be88 ("mesa: Add EXT_texture_mirror_clamp_to_edge to extension table")
Signed-off-by: Tapani Pälli <tapani.palli@intel.com>
Reviewed-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24845>
This commit is contained in:
Tapani Pälli
2023-08-23 14:55:48 +03:00
committed by Marge Bot
parent 26c5200acf
commit d65fe6eff1
2 changed files with 14 additions and 4 deletions

View File

@@ -492,6 +492,15 @@ validate_texture_wrap_mode(struct gl_context *ctx, GLenum wrap)
{
const struct gl_extensions * const e = &ctx->Extensions;
bool mirror_clamp =
_mesa_has_ATI_texture_mirror_once(ctx) ||
_mesa_has_EXT_texture_mirror_clamp(ctx);
bool mirror_clamp_to_edge =
_mesa_has_ARB_texture_mirror_clamp_to_edge(ctx) ||
_mesa_has_EXT_texture_mirror_clamp_to_edge(ctx) ||
mirror_clamp;
switch (wrap) {
case GL_CLAMP:
/* From GL 3.0 specification section E.1 "Profiles and Deprecated
@@ -508,9 +517,9 @@ validate_texture_wrap_mode(struct gl_context *ctx, GLenum wrap)
case GL_CLAMP_TO_BORDER:
return GL_TRUE;
case GL_MIRROR_CLAMP_EXT:
return e->ATI_texture_mirror_once || e->EXT_texture_mirror_clamp;
return mirror_clamp;
case GL_MIRROR_CLAMP_TO_EDGE_EXT:
return e->ATI_texture_mirror_once || e->EXT_texture_mirror_clamp || e->ARB_texture_mirror_clamp_to_edge;
return mirror_clamp_to_edge;
case GL_MIRROR_CLAMP_TO_BORDER_EXT:
return e->EXT_texture_mirror_clamp;
default:

View File

@@ -102,8 +102,9 @@ validate_texture_wrap_mode(struct gl_context * ctx, GLenum target, GLenum wrap)
supported = (target != GL_TEXTURE_RECTANGLE_NV)
&& (target != GL_TEXTURE_EXTERNAL_OES)
&& (_mesa_has_ARB_texture_mirror_clamp_to_edge(ctx) ||
_mesa_has_ATI_texture_mirror_once(ctx) ||
_mesa_has_EXT_texture_mirror_clamp(ctx));
_mesa_has_EXT_texture_mirror_clamp_to_edge(ctx) ||
_mesa_has_ATI_texture_mirror_once(ctx) ||
_mesa_has_EXT_texture_mirror_clamp(ctx));
break;
case GL_MIRROR_CLAMP_TO_BORDER_EXT: