NIR validation will failing without this once we start using
glsl_to_nir() for functions other than main. i.e. once we stop
lowering all functions in GLSL IR.
---
src/compiler/glsl/glsl_to_nir.cpp | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/src/compiler/glsl/glsl_to_nir.cpp
b/src/compiler/glsl/glsl_to_nir.cpp
index c4b3b4315d4..5a36963607e 100644
--- a/src/compiler/glsl/glsl_to_nir.cpp
+++ b/src/compiler/glsl/glsl_to_nir.cpp
@@ -213,8 +213,7 @@ nir_deref_var *
nir_visitor::evaluate_deref(nir_instr *mem_ctx, ir_instruction *ir)
{
ir->accept(this);
- ralloc_steal(mem_ctx, this->deref_head);
- return this->deref_head;
+ return nir_deref_var_clone(this->deref_head, mem_ctx);
}
static nir_constant *
--
2.17.0
_______________________________________________
mesa-dev mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/mesa-dev