From d65fe6eff1fbba390d885c84630a96be37ea76a0 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Tapani=20P=C3=A4lli?= Date: Wed, 23 Aug 2023 14:55:48 +0300 Subject: [PATCH] mesa: fix some TexParameter and SamplerParameter cases MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit EXT extension was added without tests so these functions did not work properly. Fixes: 799710be889 ("mesa: Add EXT_texture_mirror_clamp_to_edge to extension table") Signed-off-by: Tapani Pälli Reviewed-by: Alyssa Rosenzweig Part-of: --- src/mesa/main/samplerobj.c | 13 +++++++++++-- src/mesa/main/texparam.c | 5 +++-- 2 files changed, 14 insertions(+), 4 deletions(-) diff --git a/src/mesa/main/samplerobj.c b/src/mesa/main/samplerobj.c index b001089..1018854 100644 --- a/src/mesa/main/samplerobj.c +++ b/src/mesa/main/samplerobj.c @@ -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: diff --git a/src/mesa/main/texparam.c b/src/mesa/main/texparam.c index d8fb1ed..001cc18 100644 --- a/src/mesa/main/texparam.c +++ b/src/mesa/main/texparam.c @@ -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: -- 2.7.4