From 937e1d55b3a7c68b173f291d559809a2358d7dc1 Mon Sep 17 00:00:00 2001 From: Erik Faye-Lund Date: Mon, 11 Dec 2023 17:25:54 +0100 Subject: [PATCH] mesa/main: fix ARB_texture_float quirk MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit While ARB_texture_float is indeed supposed to disable clamping, it should only do so on the APIs where the extension is supported. Otherwise, we end up disabling clamping also when using GLES 1.x, which isn't quite what we want. Reviewed-by: Marek Olšák Part-of: --- src/mesa/main/texparam.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/mesa/main/texparam.c b/src/mesa/main/texparam.c index 651f56d8f91..d827f7e2957 100644 --- a/src/mesa/main/texparam.c +++ b/src/mesa/main/texparam.c @@ -887,8 +887,12 @@ set_tex_parameterf(struct gl_context *ctx, goto invalid_enum; flush(ctx); - /* ARB_texture_float disables clamping */ - if (ctx->Extensions.ARB_texture_float) { + + /* ARB_texture_float, OES_texture_float and OES_texture_half_float + * disables clamping. + */ + if (_mesa_has_float_textures(ctx) || + _mesa_has_half_float_textures(ctx)) { memcpy(texObj->Sampler.Attrib.state.border_color.f, params, 4 * sizeof(float)); } else { texObj->Sampler.Attrib.state.border_color.f[RCOMP] = CLAMP(params[0], 0.0F, 1.0F);