[Mesa-dev] [PATCH v3 046/104] nir/lower_system_values: Support SYSTEM_VALUE_LOCAL_GROUP_SIZE

Jason Ekstrand jason at jlekstrand.net
Tue Apr 3 18:33:13 UTC 2018


---
 src/compiler/nir/nir_lower_system_values.c | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/src/compiler/nir/nir_lower_system_values.c b/src/compiler/nir/nir_lower_system_values.c
index 104df51..5191fb3 100644
--- a/src/compiler/nir/nir_lower_system_values.c
+++ b/src/compiler/nir/nir_lower_system_values.c
@@ -106,6 +106,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,
-- 
2.5.0.400.gff86faf



More information about the mesa-dev mailing list