etnaviv: fix fixpoint conversion of negative values

The hand rolled etnaviv conversion functions were able to handle
negative input values when converting to fixpoint. By replacing
them with U_FIXED all negative values are clamped to zero, which
breaks usages where negative inputs are valid, like lodbias.

Fixes: 8bce68edf5 ("etnaviv: switch to U_FIXED(..) macro")
Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
Reviewed-by: Christian Gmeiner <cgmeiner@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/28224>
This commit is contained in:
Lucas Stach 2024-03-16 16:09:11 +01:00 committed by Marge Bot
parent bf3c1cf568
commit 4b8981e471

View file

@ -35,14 +35,14 @@
static inline uint32_t
etna_float_to_fixp55(float f)
{
return U_FIXED(f, 5);
return S_FIXED(f, 5);
}
/* float to fixp 8.8 */
static inline uint32_t
etna_float_to_fixp88(float f)
{
return U_FIXED(f, 8);
return S_FIXED(f, 8);
}
/* texture size to log2 in fixp 5.5 format */