[Mesa-dev] [PATCH v3 11/12] nir/lower_clip: Update to the new load/store intrinsics

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


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

diff --git a/src/glsl/nir/nir_lower_clip.c b/src/glsl/nir/nir_lower_clip.c
index c58c778..e2a2bb6 100644
--- a/src/glsl/nir/nir_lower_clip.c
+++ b/src/glsl/nir/nir_lower_clip.c
@@ -74,6 +74,7 @@ store_clipdist_output(nir_builder *b, nir_variable *out, nir_ssa_def **val)
    store->const_index[0] = out->data.driver_location;
    store->src[0].ssa = nir_vec4(b, val[0], val[1], val[2], val[3]);
    store->src[0].is_ssa = true;
+   store->src[1] = nir_src_for_ssa(nir_imm_int(b, 0));
    nir_builder_instr_insert(b, &store->instr);
 }
 
@@ -85,6 +86,7 @@ load_clipdist_input(nir_builder *b, nir_variable *in, nir_ssa_def **val)
    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);
 
@@ -112,6 +114,7 @@ find_output_in_block(nir_block *block, void *void_state)
              intr->const_index[0] == state->drvloc) {
             assert(state->def == NULL);
             assert(intr->src[0].is_ssa);
+            assert(nir_src_as_const_value(intr->src[1]));
             state->def = intr->src[0].ssa;
 
 #if !defined(DEBUG)
-- 
2.5.0.400.gff86faf



More information about the mesa-dev mailing list