Drop our custom calculation of the logarithm base 2 and switch
to log2f(..).
Signed-off-by: Christian Gmeiner <cgmeiner@igalia.com>
Reviewed-by: Lucas Stach <l.stach@pengutronix.de>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24364>
return f * 256.0f;
}
-/* 1/log10(2) */
-#define RCPLOG2 (1.4426950408889634f)
-
/* float to fixp 5.5 */
static inline uint32_t
etna_float_to_fixp55(float f)
static inline uint32_t
etna_log2_fixp55(unsigned width)
{
- return etna_float_to_fixp55(logf((float)width) * RCPLOG2);
+ return etna_float_to_fixp55(log2f((float)width));
}
/* texture size to log2 in fixp 8.8 format */
static inline uint32_t
etna_log2_fixp88(unsigned width)
{
- return etna_float_to_fixp88(logf((float)width) * RCPLOG2);
+ return etna_float_to_fixp88(log2f((float)width));
}
/* float to fixp 16.16 */