#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));
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 *
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];
}
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] = { };
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)