nir: Add gl_LocalInvocationID variable
authorJordan Justen <jordan.l.justen@intel.com>
Fri, 13 Mar 2015 18:32:43 +0000 (11:32 -0700)
committerJordan Justen <jordan.l.justen@intel.com>
Sun, 13 Sep 2015 16:53:16 +0000 (09:53 -0700)
Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Iago Toral Quiroga <itoral@igalia.com>
Reviewed-by: Kristian Høgsberg <krh@bitplanet.net>
src/glsl/nir/nir.c
src/glsl/nir/nir_intrinsics.h
src/glsl/nir/nir_lower_system_values.c

index aafcb939e3aea9320fbaf4716de37d1d0c6ee21a..1774e1c13f477649ea5b411f0391519869afff8f 100644 (file)
@@ -1457,6 +1457,8 @@ nir_system_value_from_intrinsic(nir_intrinsic_op intrin)
       return SYSTEM_VALUE_SAMPLE_POS;
    case nir_intrinsic_load_sample_mask_in:
       return SYSTEM_VALUE_SAMPLE_MASK_IN;
+   case nir_intrinsic_load_local_invocation_id:
+      return SYSTEM_VALUE_LOCAL_INVOCATION_ID;
    /* FINISHME: Add tessellation intrinsics.
       return SYSTEM_VALUE_TESS_COORD;
       return SYSTEM_VALUE_VERTICES_IN;
index 07dd5cf1ec33c9a539ce966d4945d1c117d47fe1..8396612946234889fc62477d480b90a03fd32b9d 100644 (file)
@@ -141,6 +141,7 @@ SYSTEM_VALUE(sample_id, 1)
 SYSTEM_VALUE(sample_pos, 2)
 SYSTEM_VALUE(sample_mask_in, 1)
 SYSTEM_VALUE(invocation_id, 1)
+SYSTEM_VALUE(local_invocation_id, 3)
 
 /*
  * The format of the indices depends on the type of the load.  For uniforms,
index 440fb0b1b8eee1571d633860c0fe48be19dceeb4..91228e367a4bd57985c96b5e174a6f2e611fb673 100644 (file)
@@ -70,6 +70,9 @@ convert_instr(nir_intrinsic_instr *instr)
    case SYSTEM_VALUE_INVOCATION_ID:
       op = nir_intrinsic_load_invocation_id;
       break;
+   case SYSTEM_VALUE_LOCAL_INVOCATION_ID:
+      op = nir_intrinsic_load_local_invocation_id;
+      break;
    default:
       unreachable("not reached");
    }