summaryrefslogtreecommitdiffstats
path: root/src/compiler/nir
diff options
context:
space:
mode:
authorJason Ekstrand <[email protected]>2018-03-21 17:18:05 -0700
committerJason Ekstrand <[email protected]>2018-04-09 19:45:25 -0700
commit131d454c35400fc61b317121ab12881140457208 (patch)
tree28f2dae1bdb1ff901d496f34caf668bdeef65d5f /src/compiler/nir
parentf3353e53dbd1afb1a399e8b2edac4ae403a2ecb2 (diff)
nir/lower_system_values: Support SYSTEM_VALUE_LOCAL_GROUP_SIZE
Reviewed-by: Caio Marcelo de Oliveira Filho <[email protected]>
Diffstat (limited to 'src/compiler/nir')
-rw-r--r--src/compiler/nir/nir_lower_system_values.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/compiler/nir/nir_lower_system_values.c b/src/compiler/nir/nir_lower_system_values.c
index fb560ee21bb..40e0f85deea 100644
--- a/src/compiler/nir/nir_lower_system_values.c
+++ b/src/compiler/nir/nir_lower_system_values.c
@@ -101,6 +101,16 @@ convert_block(nir_block *block, nir_builder *b)
break;
}
+ case SYSTEM_VALUE_LOCAL_GROUP_SIZE: {
+ nir_const_value local_size;
+ memset(&local_size, 0, sizeof(local_size));
+ local_size.u32[0] = b->shader->info.cs.local_size[0];
+ local_size.u32[1] = b->shader->info.cs.local_size[1];
+ local_size.u32[2] = b->shader->info.cs.local_size[2];
+ sysval = nir_build_imm(b, 3, 32, local_size);
+ break;
+ }
+
case SYSTEM_VALUE_VERTEX_ID:
if (b->shader->options->vertex_id_zero_based) {
sysval = nir_iadd(b,