diff options
author | Jason Ekstrand <[email protected]> | 2017-04-28 01:22:39 -0700 |
---|---|---|
committer | Jason Ekstrand <[email protected]> | 2018-03-07 12:13:47 -0800 |
commit | 03c07ac5480886ef5f5bd4cff4a7b6d20e142bc9 (patch) | |
tree | 154371fbe23ace95aed69e4b87c425ae17e7933c /src/intel/compiler | |
parent | 8b4a5e641bc3cb9cf0cfe7d0487926127fc25de7 (diff) |
anv: Add support for SPIR-V 1.3 subgroup operations
This requires us to bump the subgroup size to 32 for all shader stages
because Vulkan requires that to be a physical device query.
Reviewed-by: Iago Toral Quiroga <[email protected]>
Diffstat (limited to 'src/intel/compiler')
-rw-r--r-- | src/intel/compiler/brw_compiler.h | 8 | ||||
-rw-r--r-- | src/intel/compiler/brw_nir.c | 3 |
2 files changed, 9 insertions, 2 deletions
diff --git a/src/intel/compiler/brw_compiler.h b/src/intel/compiler/brw_compiler.h index d8287dca69a..0e27c898203 100644 --- a/src/intel/compiler/brw_compiler.h +++ b/src/intel/compiler/brw_compiler.h @@ -113,6 +113,14 @@ struct brw_compiler { bool supports_pull_constants; }; +/** + * We use a constant subgroup size of 32. It really only needs to be a + * maximum and, since we do SIMD32 for compute shaders in some cases, it + * needs to be at least 32. SIMD8 and SIMD16 shaders will still claim a + * subgroup size of 32 but will act as if 16 or 24 of those channels are + * disabled. + */ +#define BRW_SUBGROUP_SIZE 32 /** * Program key structures. diff --git a/src/intel/compiler/brw_nir.c b/src/intel/compiler/brw_nir.c index dbad4a14b17..69ab162f888 100644 --- a/src/intel/compiler/brw_nir.c +++ b/src/intel/compiler/brw_nir.c @@ -650,8 +650,7 @@ brw_preprocess_nir(const struct brw_compiler *compiler, nir_shader *nir) OPT(nir_lower_system_values); const nir_lower_subgroups_options subgroups_options = { - .subgroup_size = nir->info.stage == MESA_SHADER_COMPUTE ? 32 : - nir->info.stage == MESA_SHADER_FRAGMENT ? 16 : 8, + .subgroup_size = BRW_SUBGROUP_SIZE, .ballot_bit_size = 32, .lower_to_scalar = true, .lower_subgroup_masks = true, |