mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2024-11-27 04:04:23 +08:00
nir/conversion_builder: avoid redundant uint->uint clamp
algebraic will clean up but there's no reason to generate it. Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io> Reviewed-by: Georg Lehmann <dadschoorse@gmail.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/32208>
This commit is contained in:
parent
76927a3b43
commit
07ba9335ae
@ -269,7 +269,10 @@ nir_get_clamp_limits(nir_builder *b,
|
||||
case nir_type_uint: {
|
||||
uint64_t uhigh = dest_bit_size == 64 ? ~0ull : (1ull << dest_bit_size) - 1;
|
||||
if (src_base_type != nir_type_float) {
|
||||
*low = nir_imm_intN_t(b, 0, src_bit_size);
|
||||
/* for uint->uint conversions, no need to clamp negatives */
|
||||
if (src_base_type != nir_type_uint)
|
||||
*low = nir_imm_intN_t(b, 0, src_bit_size);
|
||||
|
||||
if (src_base_type == nir_type_uint || src_bit_size > dest_bit_size)
|
||||
*high = nir_imm_intN_t(b, uhigh, src_bit_size);
|
||||
} else {
|
||||
|
Loading…
Reference in New Issue
Block a user