nir/format_convert: nir_shift -> nir_shift_imm
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10619>
This commit is contained in:

committed by
Marge Bot

parent
d09948e006
commit
c948251d2b
@@ -26,7 +26,7 @@
|
||||
#include "util/format_rgb9e5.h"
|
||||
|
||||
static inline nir_ssa_def *
|
||||
nir_shift(nir_builder *b, nir_ssa_def *value, int left_shift)
|
||||
nir_shift_imm(nir_builder *b, nir_ssa_def *value, int left_shift)
|
||||
{
|
||||
if (left_shift > 0)
|
||||
return nir_ishl(b, value, nir_imm_int(b, left_shift));
|
||||
@@ -40,7 +40,7 @@ static inline nir_ssa_def *
|
||||
nir_mask_shift(struct nir_builder *b, nir_ssa_def *src,
|
||||
uint32_t mask, int left_shift)
|
||||
{
|
||||
return nir_shift(b, nir_iand(b, src, nir_imm_int(b, mask)), left_shift);
|
||||
return nir_shift_imm(b, nir_iand(b, src, nir_imm_int(b, mask)), left_shift);
|
||||
}
|
||||
|
||||
static inline nir_ssa_def *
|
||||
@@ -135,7 +135,7 @@ nir_format_pack_uint_unmasked(nir_builder *b, nir_ssa_def *color,
|
||||
nir_ssa_def *packed = nir_imm_int(b, 0);
|
||||
unsigned offset = 0;
|
||||
for (unsigned i = 0; i < num_components; i++) {
|
||||
packed = nir_ior(b, packed, nir_shift(b, nir_channel(b, color, i),
|
||||
packed = nir_ior(b, packed, nir_shift_imm(b, nir_channel(b, color, i),
|
||||
offset));
|
||||
offset += bits[i];
|
||||
}
|
||||
|
@@ -894,7 +894,7 @@ bit_cast_color(struct nir_builder *b, nir_ssa_def *color,
|
||||
if (src_fmtl->channels_array[c].type == ISL_UNORM)
|
||||
chan = nir_format_float_to_unorm(b, chan, &chan_bits);
|
||||
|
||||
packed = nir_ior(b, packed, nir_shift(b, chan, chan_start_bit));
|
||||
packed = nir_ior(b, packed, nir_shift_imm(b, chan, chan_start_bit));
|
||||
}
|
||||
|
||||
nir_ssa_def *chans[4] = { };
|
||||
@@ -906,7 +906,7 @@ bit_cast_color(struct nir_builder *b, nir_ssa_def *color,
|
||||
|
||||
const unsigned chan_start_bit = dst_fmtl->channels_array[c].start_bit;
|
||||
const unsigned chan_bits = dst_fmtl->channels_array[c].bits;
|
||||
chans[c] = nir_iand(b, nir_shift(b, packed, -(int)chan_start_bit),
|
||||
chans[c] = nir_iand(b, nir_shift_imm(b, packed, -(int)chan_start_bit),
|
||||
nir_imm_int(b, BITFIELD_MASK(chan_bits)));
|
||||
|
||||
if (dst_fmtl->channels_array[c].type == ISL_UNORM)
|
||||
|
Reference in New Issue
Block a user