From 4b8981e4717259935ee4db2fe8b49648c174ebb9 Mon Sep 17 00:00:00 2001 From: Lucas Stach Date: Sat, 16 Mar 2024 16:09:11 +0100 Subject: [PATCH] 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: 8bce68edf553 ("etnaviv: switch to U_FIXED(..) macro") Signed-off-by: Lucas Stach Reviewed-by: Christian Gmeiner Part-of: --- src/gallium/drivers/etnaviv/etnaviv_util.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/gallium/drivers/etnaviv/etnaviv_util.h b/src/gallium/drivers/etnaviv/etnaviv_util.h index 4f3061f2d2e..53f1f4ccf27 100644 --- a/src/gallium/drivers/etnaviv/etnaviv_util.h +++ b/src/gallium/drivers/etnaviv/etnaviv_util.h @@ -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 */