diff options
author | Karol Herbst <[email protected]> | 2018-02-22 23:35:50 +0100 |
---|---|---|
committer | Karol Herbst <[email protected]> | 2018-07-12 13:09:00 +0200 |
commit | 154ef32e4633b9aa4eafc8c41e818943fe129630 (patch) | |
tree | 1ea4127deac4b50283bd1ea74999a111189d330f /src/compiler/nir | |
parent | 31cbcbdb873bc7437e02fbe7ba54b864245c7830 (diff) |
nir/spirv: implement BuiltInGlobalSize
Reviewed-by: Jason Ekstrand <[email protected]>
Signed-off-by: Karol Herbst <[email protected]>
Diffstat (limited to 'src/compiler/nir')
-rw-r--r-- | src/compiler/nir/nir_lower_system_values.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/compiler/nir/nir_lower_system_values.c b/src/compiler/nir/nir_lower_system_values.c index e8367981a5f..da04895d66c 100644 --- a/src/compiler/nir/nir_lower_system_values.c +++ b/src/compiler/nir/nir_lower_system_values.c @@ -171,6 +171,13 @@ convert_block(nir_block *block, nir_builder *b) sysval = nir_imm_int(b, 0); break; + case SYSTEM_VALUE_GLOBAL_GROUP_SIZE: { + nir_ssa_def *group_size = build_local_group_size(b); + nir_ssa_def *num_work_groups = nir_load_num_work_groups(b); + sysval = nir_imul(b, group_size, num_work_groups); + break; + } + default: break; } |