print_src(&instr->src[src].src, state);
bool print_swizzle = false;
+ unsigned used_channels = 0;
+
for (unsigned i = 0; i < 4; i++) {
if (!nir_alu_instr_channel_used(instr, src, i))
continue;
+ used_channels++;
+
if (instr->src[src].swizzle[i] != i) {
print_swizzle = true;
break;
}
}
- if (print_swizzle) {
+ unsigned live_channels = instr->src[src].src.is_ssa
+ ? instr->src[src].src.ssa->num_components
+ : instr->src[src].src.reg.reg->num_components;
+
+ if (print_swizzle || used_channels != live_channels) {
fprintf(fp, ".");
for (unsigned i = 0; i < 4; i++) {
if (!nir_alu_instr_channel_used(instr, src, i))