[Mesa-dev] [PATCH v3 12/12] nir/lower_two_sided_color: Update to the new load intrinsic

Jason Ekstrand jason at jlekstrand.net
Tue Dec 8 13:46:29 PST 2015


---
 src/glsl/nir/nir_lower_two_sided_color.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/src/glsl/nir/nir_lower_two_sided_color.c b/src/glsl/nir/nir_lower_two_sided_color.c
index 6995b9d..7df12e0 100644
--- a/src/glsl/nir/nir_lower_two_sided_color.c
+++ b/src/glsl/nir/nir_lower_two_sided_color.c
@@ -73,6 +73,7 @@ load_input(nir_builder *b, nir_variable *in)
    load = nir_intrinsic_instr_create(b->shader, nir_intrinsic_load_input);
    load->num_components = 4;
    load->const_index[0] = in->data.driver_location;
+   load->src[0] = nir_src_for_ssa(nir_imm_int(b, 0));
    nir_ssa_dest_init(&load->instr, &load->dest, 4, NULL);
    nir_builder_instr_insert(b, &load->instr);
 
@@ -151,6 +152,7 @@ nir_lower_two_sided_color_block(nir_block *block, void *void_state)
          unsigned drvloc =
             state->colors[idx].front->data.driver_location;
          if (intr->const_index[0] == drvloc) {
+            assert(nir_src_as_const_value(intr->src[0]));
             break;
          }
       }
-- 
2.5.0.400.gff86faf



More information about the mesa-dev mailing list