Mesa (master): freedreno/ir3: don't ignore local vars

Rob Clark robclark at kemper.freedesktop.org
Sat Jan 30 17:30:37 UTC 2016


Module: Mesa
Branch: master
Commit: f20cf22b54dfda13324aa714debe55a8f093640d
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=f20cf22b54dfda13324aa714debe55a8f093640d

Author: Rob Clark <robclark at freedesktop.org>
Date:   Sat Nov  7 08:46:02 2015 -0500

freedreno/ir3: don't ignore local vars

With glsl_to_nir we end up with local variables, instead of global, for
arrays.

Note that we'll eventually have to do something more clever, I think,
when we support multiple functions, but that will probably take some
work in a few places.

Signed-off-by: Rob Clark <robclark at freedesktop.org>

---

 src/gallium/drivers/freedreno/ir3/ir3_compiler_nir.c | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/src/gallium/drivers/freedreno/ir3/ir3_compiler_nir.c b/src/gallium/drivers/freedreno/ir3/ir3_compiler_nir.c
index 2ab46d2..b564c4a 100644
--- a/src/gallium/drivers/freedreno/ir3/ir3_compiler_nir.c
+++ b/src/gallium/drivers/freedreno/ir3/ir3_compiler_nir.c
@@ -2163,11 +2163,17 @@ emit_instructions(struct ir3_compile *ctx)
 		setup_output(ctx, var);
 	}
 
-	/* Setup variables (which should only be arrays): */
+	/* Setup global variables (which should only be arrays): */
 	nir_foreach_variable(var, &ctx->s->globals) {
 		declare_var(ctx, var);
 	}
 
+	/* Setup local variables (which should only be arrays): */
+	/* NOTE: need to do something more clever when we support >1 fxn */
+	nir_foreach_variable(var, &fxn->locals) {
+		declare_var(ctx, var);
+	}
+
 	/* And emit the body: */
 	ctx->impl = fxn;
 	emit_function(ctx, fxn);




More information about the mesa-commit mailing list