diff options
author | Rob Clark <[email protected]> | 2018-03-28 08:32:10 -0400 |
---|---|---|
committer | Rob Clark <[email protected]> | 2018-04-03 06:08:56 -0400 |
commit | 51888bf07dd2f9942708f9a265b18a129ee625f1 (patch) | |
tree | 980aa77e4a11fc7360cb734cd252a62fa13c8787 /src/compiler/nir/nir_validate.c | |
parent | 91f9450b3222469d93c270b8ca5fb4bf2ef584f2 (diff) |
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 <[email protected]>
Reviewed-by: Eric Anholt <[email protected]>
Diffstat (limited to 'src/compiler/nir/nir_validate.c')
-rw-r--r-- | src/compiler/nir/nir_validate.c | 10 |
1 files changed, 2 insertions, 8 deletions
diff --git a/src/compiler/nir/nir_validate.c b/src/compiler/nir/nir_validate.c index 5566ceb2985..eee737e8069 100644 --- a/src/compiler/nir/nir_validate.c +++ b/src/compiler/nir/nir_validate.c @@ -483,10 +483,7 @@ validate_intrinsic_instr(nir_intrinsic_instr *instr, validate_state *state) unsigned num_srcs = nir_intrinsic_infos[instr->intrinsic].num_srcs; for (unsigned i = 0; i < num_srcs; i++) { - unsigned components_read = - nir_intrinsic_infos[instr->intrinsic].src_components[i]; - if (components_read == 0) - components_read = instr->num_components; + unsigned components_read = nir_intrinsic_src_components(instr, i); validate_assert(state, components_read > 0); @@ -499,10 +496,7 @@ validate_intrinsic_instr(nir_intrinsic_instr *instr, validate_state *state) } if (nir_intrinsic_infos[instr->intrinsic].has_dest) { - unsigned components_written = - nir_intrinsic_infos[instr->intrinsic].dest_components; - if (components_written == 0) - components_written = instr->num_components; + unsigned components_written = nir_intrinsic_dest_components(instr); validate_assert(state, components_written > 0); |