nir/lower_io: Lower INSTNACE_INDEX
authorJason Ekstrand <jason.ekstrand@intel.com>
Tue, 26 Jan 2016 19:48:07 +0000 (11:48 -0800)
committerJason Ekstrand <jason.ekstrand@intel.com>
Tue, 26 Jan 2016 22:56:37 +0000 (14:56 -0800)
src/glsl/nir/nir_lower_system_values.c

index aeaa3107c1fffd4d6d9eefd98db0b3c0c736ba6c..79f6bedc990bc3e5c3c804c0b17a378eb94a9e3e 100644 (file)
@@ -113,6 +113,12 @@ convert_block(nir_block *block, void *void_state)
          }
          break;
 
+      case SYSTEM_VALUE_INSTANCE_INDEX:
+         sysval = nir_iadd(b,
+            nir_load_system_value(b, nir_intrinsic_load_instance_id, 0),
+            nir_load_system_value(b, nir_intrinsic_load_base_instance, 0));
+         break;
+
       default: {
          nir_intrinsic_op sysval_op =
             nir_intrinsic_from_system_value(var->data.location);