summaryrefslogtreecommitdiffstats
path: root/src/glsl
diff options
context:
space:
mode:
authorConnor Abbott <[email protected]>2015-10-30 23:47:46 -0400
committerConnor Abbott <[email protected]>2015-11-10 13:55:54 -0500
commita60e990dd25e2fb45799a7a5cfa58abc9abf7665 (patch)
tree1c9a9bd623ef253e52b7618e32fbca28a02ea575 /src/glsl
parent30fe8eaa8e65e656d2bc95f499791eebea7d7dc9 (diff)
nir/glsl: convert nir_visitor::result to a nir_ssa_def *
Its only user now returns a nir_ssa_def *, and we'll need this since the builder returns a nir_ssa_def *. Signed-off-by: Connor Abbott <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
Diffstat (limited to 'src/glsl')
-rw-r--r--src/glsl/nir/glsl_to_nir.cpp13
1 files changed, 7 insertions, 6 deletions
diff --git a/src/glsl/nir/glsl_to_nir.cpp b/src/glsl/nir/glsl_to_nir.cpp
index 3b8fb00abcf..10faa370ad1 100644
--- a/src/glsl/nir/glsl_to_nir.cpp
+++ b/src/glsl/nir/glsl_to_nir.cpp
@@ -87,7 +87,7 @@ private:
nir_shader *shader;
nir_function_impl *impl;
exec_list *cf_node_list;
- nir_instr *result; /* result of the expression tree last visited */
+ nir_ssa_def *result; /* result of the expression tree last visited */
nir_deref_var *evaluate_deref(nir_instr *mem_ctx, ir_instruction *ir);
@@ -1174,7 +1174,11 @@ nir_visitor::add_instr(nir_instr *instr, unsigned num_components)
nir_ssa_dest_init(instr, dest, num_components, NULL);
nir_instr_insert_after_cf_list(this->cf_node_list, instr);
- this->result = instr;
+
+ if (dest) {
+ assert(dest->is_ssa);
+ this->result = &dest->ssa;
+ }
}
nir_ssa_def *
@@ -1195,10 +1199,7 @@ nir_visitor::evaluate_rvalue(ir_rvalue* ir)
add_instr(&load_instr->instr, ir->type->vector_elements);
}
- nir_dest *dest = get_instr_dest(this->result);
- assert(dest->is_ssa);
-
- return &dest->ssa;
+ return this->result;
}
nir_alu_instr *