nir_ssa_def *dst_vec4 = nir_unpack_unorm_4x8(b, packed_dst_color);
nir_ssa_def *src_color[4], *unpacked_dst_color[4];
for (unsigned i = 0; i < 4; i++) {
- src_color[i] = nir_swizzle(b, intr->src[0].ssa, &i, 1, false);
- unpacked_dst_color[i] = nir_swizzle(b, dst_vec4, &i, 1, false);
+ src_color[i] = nir_channel(b, intr->src[0].ssa, i);
+ unpacked_dst_color[i] = nir_channel(b, dst_vec4, i);
}
vc4_nir_emit_alpha_test_discard(c, b, src_color[3]);
static nir_ssa_def *
vc4_nir_unpack_8f(nir_builder *b, nir_ssa_def *src, unsigned chan)
{
- return nir_swizzle(b, nir_unpack_unorm_4x8(b, src), &chan, 1, false);
+ return nir_channel(b, nir_unpack_unorm_4x8(b, src), chan);
}
static nir_ssa_def *
intr_comp->const_index[0] = intr->const_index[0] * 4 + i;
assert(intr->src[0].is_ssa);
- intr_comp->src[0] = nir_src_for_ssa(nir_swizzle(b,
- intr->src[0].ssa,
- &i, 1, false));
+ intr_comp->src[0] =
+ nir_src_for_ssa(nir_channel(b, intr->src[0].ssa, i));
nir_builder_instr_insert(b, &intr_comp->instr);
}