nir+drivers: add helpers to get # of src/dest components
Add helpers to get the number of src/dest components for an intrinsic, and update spots that were open-coding this logic to use the helpers instead. Signed-off-by: Rob Clark <robdclark@gmail.com> Reviewed-by: Eric Anholt <eric@anholt.net>
This commit is contained in:
@@ -257,10 +257,7 @@ copy_prop_instr(nir_instr *instr)
|
||||
nir_intrinsic_instr *intrin = nir_instr_as_intrinsic(instr);
|
||||
for (unsigned i = 0;
|
||||
i < nir_intrinsic_infos[intrin->intrinsic].num_srcs; i++) {
|
||||
unsigned num_components =
|
||||
nir_intrinsic_infos[intrin->intrinsic].src_components[i];
|
||||
if (!num_components)
|
||||
num_components = intrin->num_components;
|
||||
unsigned num_components = nir_intrinsic_src_components(intrin, i);
|
||||
|
||||
while (copy_prop_src(&intrin->src[i], instr, NULL, num_components))
|
||||
progress = true;
|
||||
|
Reference in New Issue
Block a user