From c73c246e05f87366df3733d66c16fa3e1cf597a8 Mon Sep 17 00:00:00 2001 From: Rhys Perry Date: Thu, 3 Dec 2020 17:38:18 +0000 Subject: [PATCH] nir: gather whether a compute shader uses non-quad subgroup intrinsics Signed-off-by: Rhys Perry Reviewed-by: Samuel Pitoiset Part-of: --- src/compiler/nir/nir_gather_info.c | 2 ++ src/compiler/shader_info.h | 5 +++++ 2 files changed, 7 insertions(+) diff --git a/src/compiler/nir/nir_gather_info.c b/src/compiler/nir/nir_gather_info.c index 3d55698cde1..b9fd6b6b13b 100644 --- a/src/compiler/nir/nir_gather_info.c +++ b/src/compiler/nir/nir_gather_info.c @@ -568,6 +568,8 @@ gather_intrinsic_info(nir_intrinsic_instr *instr, nir_shader *shader, case nir_intrinsic_write_invocation_amd: if (shader->info.stage == MESA_SHADER_FRAGMENT) shader->info.fs.needs_all_helper_invocations = true; + if (shader->info.stage == MESA_SHADER_COMPUTE) + shader->info.cs.uses_wide_subgroup_intrinsics = true; break; case nir_intrinsic_end_primitive: diff --git a/src/compiler/shader_info.h b/src/compiler/shader_info.h index fb9349100f9..f890b6c028f 100644 --- a/src/compiler/shader_info.h +++ b/src/compiler/shader_info.h @@ -378,6 +378,11 @@ typedef struct shader_info { * AddressingModelPhysical64: 64 */ unsigned ptr_size; + + /** + * Uses subgroup intrinsics which can communicate across a quad. + */ + bool uses_wide_subgroup_intrinsics; } cs; /* Applies to both TCS and TES. */