nir/lower_system_values: Support SYSTEM_VALUE_LOCAL_GROUP_SIZE
authorJason Ekstrand <jason.ekstrand@intel.com>
Thu, 22 Mar 2018 00:18:05 +0000 (17:18 -0700)
committerJason Ekstrand <jason.ekstrand@intel.com>
Tue, 10 Apr 2018 02:45:25 +0000 (19:45 -0700)
Reviewed-by: Caio Marcelo de Oliveira Filho <caio.oliveira@intel.com>
src/compiler/nir/nir_lower_system_values.c

index fb560ee21bb3c420f8786b01c2ba6ea80cacd28f..40e0f85deeae1c3cc9108b3a4e00f996c25dec92 100644 (file)
@@ -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,