From: Tapani Pälli Date: Wed, 23 Aug 2023 11:55:48 +0000 (+0300) Subject: mesa: fix some TexParameter and SamplerParameter cases X-Git-Tag: upstream/23.3.3~2837 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=d65fe6eff1fbba390d885c84630a96be37ea76a0;p=platform%2Fupstream%2Fmesa.git mesa: fix some TexParameter and SamplerParameter cases 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: --- 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: