mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-03 01:18:06 +02:00
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:
parent
bf3c1cf568
commit
4b8981e471
1 changed files with 2 additions and 2 deletions
|
|
@ -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 */
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue