mesa/main: fix ARB_texture_float quirk
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 <marek.olsak@amd.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/35097>
This commit is contained in:
committed by
Marge Bot
parent
25830434c2
commit
937e1d55b3
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user