vtn: Use const_index helpers
authorJason Ekstrand <jason.ekstrand@intel.com>
Tue, 9 Feb 2016 23:35:51 +0000 (15:35 -0800)
committerJason Ekstrand <jason.ekstrand@intel.com>
Wed, 10 Feb 2016 00:32:38 +0000 (16:32 -0800)
src/compiler/nir/spirv/spirv_to_nir.c
src/compiler/nir/spirv/vtn_variables.c

index c0dd92c36a4c654aec9d035af53c6afc2fc96be8..a7efa196832da65449cd6c37ec8050f21f854755 100644 (file)
@@ -2048,7 +2048,7 @@ vtn_handle_barrier(struct vtn_builder *b, SpvOp opcode,
       nir_intrinsic_instr_create(b->shader, intrinsic_op);
 
    if (opcode == SpvOpEmitStreamVertex || opcode == SpvOpEndStreamPrimitive)
-      intrin->const_index[0] = w[1];
+      nir_intrinsic_set_stream_id(intrin, w[1]);
 
    nir_builder_instr_insert(&b->nb, &intrin->instr);
 }
index 5ca24201498f825ab3ca76d485e87c93fcb63202..31bf416ff5eb6acdfae059c4c06a1b87e76d84a3 100644 (file)
@@ -193,7 +193,7 @@ _vtn_local_load_store(struct vtn_builder *b, bool load, nir_deref_var *deref,
                            intrin->num_components, NULL);
          inout->def = &intrin->dest.ssa;
       } else {
-         intrin->const_index[0] = (1 << intrin->num_components) - 1;
+         nir_intrinsic_set_write_mask(intrin, (1 << intrin->num_components) - 1);
          intrin->src[0] = nir_src_for_ssa(inout->def);
       }
 
@@ -392,7 +392,7 @@ _vtn_load_store_tail(struct vtn_builder *b, nir_intrinsic_op op, bool load,
 
    int src = 0;
    if (!load) {
-      instr->const_index[0] = (1 << instr->num_components) - 1; /* write mask */
+      nir_intrinsic_set_write_mask(instr, (1 << instr->num_components) - 1);
       instr->src[src++] = nir_src_for_ssa((*inout)->def);
    }
 
@@ -400,8 +400,8 @@ _vtn_load_store_tail(struct vtn_builder *b, nir_intrinsic_op op, bool load,
     * constant block for now.
     */
    if (op == nir_intrinsic_load_push_constant) {
-      instr->const_index[0] = 0;
-      instr->const_index[1] = 128;
+      nir_intrinsic_set_base(instr, 0);
+      nir_intrinsic_set_range(instr, 128);
    }
 
    if (index)