util/format_pack: Clamp SNORM values to [-1, 1] when unpacking
Reviewed-by: Alyssa Rosenzweig <alyssa@rosenzweig.io> Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/28793>
This commit is contained in:
committed by
Marge Bot
parent
354f0958af
commit
3797fc18d8
@@ -397,6 +397,10 @@ def conversion_expr(src_channel,
|
||||
# bigger than single precision mantissa, use double
|
||||
value = '(%s * (1.0/0x%x))' % (value, one)
|
||||
src_size = 64
|
||||
|
||||
if src_norm and src_type == SIGNED:
|
||||
value = 'MAX2(-1.0f, %s)' % (value)
|
||||
|
||||
src_norm = False
|
||||
else:
|
||||
if src_size <= 23 or dst_channel.size <= 32:
|
||||
|
||||
Reference in New Issue
Block a user