summaryrefslogtreecommitdiffstats
path: root/src/intel/compiler
diff options
context:
space:
mode:
authorRob Clark <[email protected]>2018-03-28 08:32:10 -0400
committerRob Clark <[email protected]>2018-04-03 06:08:56 -0400
commit51888bf07dd2f9942708f9a265b18a129ee625f1 (patch)
tree980aa77e4a11fc7360cb734cd252a62fa13c8787 /src/intel/compiler
parent91f9450b3222469d93c270b8ca5fb4bf2ef584f2 (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/intel/compiler')
-rw-r--r--src/intel/compiler/brw_fs_nir.cpp11
1 files changed, 5 insertions, 6 deletions
diff --git a/src/intel/compiler/brw_fs_nir.cpp b/src/intel/compiler/brw_fs_nir.cpp
index 197d41062e3..6c4bcd1c113 100644
--- a/src/intel/compiler/brw_fs_nir.cpp
+++ b/src/intel/compiler/brw_fs_nir.cpp
@@ -3821,6 +3821,7 @@ fs_visitor::nir_emit_intrinsic(const fs_builder &bld, nir_intrinsic_instr *instr
const unsigned arr_dims = type->sampler_array ? 1 : 0;
const unsigned surf_dims = type->coordinate_components() - arr_dims;
const unsigned format = var->data.image.format;
+ const unsigned dest_components = nir_intrinsic_dest_components(instr);
/* Get the arguments of the image intrinsic. */
const fs_reg image = get_nir_image_deref(instr->variables[0]);
@@ -3844,15 +3845,13 @@ fs_visitor::nir_emit_intrinsic(const fs_builder &bld, nir_intrinsic_instr *instr
else
tmp = emit_image_atomic(bld, image, addr, src0, src1,
- surf_dims, arr_dims, info->dest_components,
+ surf_dims, arr_dims, dest_components,
get_image_atomic_op(instr->intrinsic, type));
/* Assign the result. */
- if (nir_intrinsic_infos[instr->intrinsic].has_dest) {
- for (unsigned c = 0; c < info->dest_components; ++c) {
- bld.MOV(offset(retype(dest, base_type), bld, c),
- offset(tmp, bld, c));
- }
+ for (unsigned c = 0; c < dest_components; ++c) {
+ bld.MOV(offset(retype(dest, base_type), bld, c),
+ offset(tmp, bld, c));
}
break;
}