st/mesa: clamp reported max lod bias

mesa clamps lod bias values to -32,31 during quantization,
so the reported max value should also be limited to 31.

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/11977
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/31525>
This commit is contained in:
Utku Iseri
2024-10-04 13:27:34 +02:00
committed by Marge Bot
parent 0727634443
commit 271fdedc5a
+6 -1
View File
@@ -58,6 +58,11 @@ static unsigned _min(unsigned a, unsigned b)
return (a < b) ? a : b;
}
static float _minf(float a, float b)
{
return (a < b) ? a : b;
}
static float _maxf(float a, float b)
{
return (a > b) ? a : b;
@@ -174,7 +179,7 @@ void st_init_limits(struct pipe_screen *screen,
screen->get_paramf(screen, PIPE_CAPF_MAX_TEXTURE_ANISOTROPY));
c->MaxTextureLodBias =
screen->get_paramf(screen, PIPE_CAPF_MAX_TEXTURE_LOD_BIAS);
_minf(31.0f, screen->get_paramf(screen, PIPE_CAPF_MAX_TEXTURE_LOD_BIAS));
c->QuadsFollowProvokingVertexConvention =
screen->get_param(screen,