[Mesa-dev] [PATCH 05/15] nir: scalarize AMD_shader_ballot intrinsics
Connor Abbott
connora at valvesoftware.com
Tue Aug 8 01:32:31 UTC 2017
From: Connor Abbott <cwabbott0 at gmail.com>
Scalarizing the group/subgroup reduction ops isn't strictly necessary
for SPIR-V since they're supposed to be scalars anyways, but it will be
useful if we want to wire up the GL version of the extension, so we
might as well wire them up too.
---
.../nir/nir_lower_cross_thread_to_scalar.c | 24 ++++++++++++++++++++++
1 file changed, 24 insertions(+)
diff --git a/src/compiler/nir/nir_lower_cross_thread_to_scalar.c b/src/compiler/nir/nir_lower_cross_thread_to_scalar.c
index 56feba6..a4a82ab 100644
--- a/src/compiler/nir/nir_lower_cross_thread_to_scalar.c
+++ b/src/compiler/nir/nir_lower_cross_thread_to_scalar.c
@@ -93,6 +93,30 @@ nir_lower_cross_thread_to_scalar_impl(nir_function_impl *impl)
switch (intrin->intrinsic) {
case nir_intrinsic_read_invocation:
case nir_intrinsic_read_first_invocation:
+ case nir_intrinsic_write_invocation:
+ case nir_intrinsic_quad_swizzle_amd:
+ case nir_intrinsic_masked_swizzle_amd:
+#define GROUP(name) \
+ case nir_intrinsic_group_##name: \
+ case nir_intrinsic_group_##name##_nonuniform: \
+ case nir_intrinsic_subgroup_##name: \
+ case nir_intrinsic_subgroup_##name##_nonuniform: \
+ case nir_intrinsic_group_##name##_inclusive_scan: \
+ case nir_intrinsic_group_##name##_inclusive_scan_nonuniform: \
+ case nir_intrinsic_subgroup_##name##_inclusive_scan: \
+ case nir_intrinsic_subgroup_##name##_inclusive_scan_nonuniform: \
+ case nir_intrinsic_group_##name##_exclusive_scan: \
+ case nir_intrinsic_group_##name##_exclusive_scan_nonuniform: \
+ case nir_intrinsic_subgroup_##name##_exclusive_scan: \
+ case nir_intrinsic_subgroup_##name##_exclusive_scan_nonuniform:
+GROUP(fadd)
+GROUP(iadd)
+GROUP(fmin)
+GROUP(imin)
+GROUP(umin)
+GROUP(fmax)
+GROUP(imax)
+GROUP(umax)
lower_to_scalar(&b, intrin);
progress = true;
break;
--
2.9.4
More information about the mesa-dev
mailing list