summaryrefslogtreecommitdiffstats
path: root/src/compiler/nir
diff options
context:
space:
mode:
authorKarol Herbst <[email protected]>2018-02-22 23:35:50 +0100
committerKarol Herbst <[email protected]>2018-07-12 13:09:00 +0200
commit154ef32e4633b9aa4eafc8c41e818943fe129630 (patch)
tree1ea4127deac4b50283bd1ea74999a111189d330f /src/compiler/nir
parent31cbcbdb873bc7437e02fbe7ba54b864245c7830 (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.c7
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;
}