nir/spirv: Add support for indirect array accesses
authorJason Ekstrand <jason.ekstrand@intel.com>
Mon, 4 May 2015 19:02:57 +0000 (12:02 -0700)
committerJason Ekstrand <jason.ekstrand@intel.com>
Mon, 31 Aug 2015 23:58:20 +0000 (16:58 -0700)
src/glsl/nir/spirv_to_nir.c

index f36db8a3c27de684d1dc89e58d565dc13191b585..9c056da897f36f16e83530d902e695399b99ba42 100644 (file)
@@ -595,8 +595,8 @@ vtn_handle_variables(struct vtn_builder *b, SpvOp opcode,
             } else {
                assert(idx_val->value_type == vtn_value_type_ssa);
                deref_arr->deref_array_type = nir_deref_array_type_indirect;
-               /* TODO */
-               unreachable("Indirect array accesses not implemented");
+               deref_arr->base_offset = 0;
+               deref_arr->indirect = nir_src_for_ssa(vtn_ssa_value(b, w[1]));
             }
             tail->child = &deref_arr->deref;
             break;