[Mesa-dev] [PATCH 04/10] glsl: always clone deref in evaluate_deref()

Timothy Arceri tarceri at itsqueeze.com
Tue Apr 10 04:34:29 UTC 2018


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



More information about the mesa-dev mailing list