nir: use num_components wrappers in print/validate.

These wrappers were introduces, so start using them.

Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
This commit is contained in:
Dave Airlie
2018-05-15 11:11:12 +10:00
parent bad7332f7c
commit 67eccd6aa2
2 changed files with 5 additions and 15 deletions

View File

@@ -199,9 +199,7 @@ print_alu_src(nir_alu_instr *instr, unsigned src, print_state *state)
}
}
unsigned live_channels = instr->src[src].src.is_ssa
? instr->src[src].src.ssa->num_components
: instr->src[src].src.reg.reg->num_components;
unsigned live_channels = nir_src_num_components(instr->src[src].src);
if (print_swizzle || used_channels != live_channels) {
fprintf(fp, ".");