<div dir="ltr">Reviewed-by: Jason Ekstrand <<a href="mailto:jason@jlekstrand.net">jason@jlekstrand.net</a>><br></div><div class="gmail_extra"><br><div class="gmail_quote">On Sat, Mar 26, 2016 at 2:02 PM, Rob Clark <span dir="ltr"><<a href="mailto:robdclark@gmail.com" target="_blank">robdclark@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">From: Rob Clark <<a href="mailto:robclark@freedesktop.org">robclark@freedesktop.org</a>><br>
<br>
Going to convert this pass to parameterized lower_io_to_temporaries, and<br>
we want the user to be able to specify whether to lower outputs or<br>
inputs or both. The restriction of running this pass before validate<br>
to avoid output reads no longer applies.<br>
<br>
Signed-off-by: Rob Clark <<a href="mailto:robclark@freedesktop.org">robclark@freedesktop.org</a>><br>
---<br>
src/compiler/nir/glsl_to_nir.cpp | 2 --<br>
src/compiler/nir/nir_lower_outputs_to_temporaries.c | 4 ----<br>
src/mesa/drivers/dri/i965/brw_nir.c | 1 +<br>
3 files changed, 1 insertion(+), 6 deletions(-)<br>
<br>
diff --git a/src/compiler/nir/glsl_to_nir.cpp b/src/compiler/nir/glsl_to_nir.cpp<br>
index f6e1a17..c9e0479 100644<br>
--- a/src/compiler/nir/glsl_to_nir.cpp<br>
+++ b/src/compiler/nir/glsl_to_nir.cpp<br>
@@ -143,8 +143,6 @@ glsl_to_nir(const struct gl_shader_program *shader_prog,<br>
v2.run(sh->ir);<br>
visit_exec_list(sh->ir, &v1);<br>
<br>
- nir_lower_outputs_to_temporaries(shader);<br>
-<br>
shader-><a href="http://info.name" rel="noreferrer" target="_blank">info.name</a> = ralloc_asprintf(shader, "GLSL%d", shader_prog->Name);<br>
if (shader_prog->Label)<br>
shader->info.label = ralloc_strdup(shader, shader_prog->Label);<br>
diff --git a/src/compiler/nir/nir_lower_outputs_to_temporaries.c b/src/compiler/nir/nir_lower_outputs_to_temporaries.c<br>
index 71b06b8..0e518cd 100644<br>
--- a/src/compiler/nir/nir_lower_outputs_to_temporaries.c<br>
+++ b/src/compiler/nir/nir_lower_outputs_to_temporaries.c<br>
@@ -25,10 +25,6 @@<br>
* Implements a pass that lowers output variables to a temporary plus an<br>
* output variable with a single copy at each exit point of the shader.<br>
* This way the output variable is only ever written.<br>
- *<br>
- * Because valid NIR requires that output variables are never read, this<br>
- * pass is more of a helper for NIR producers and must be run before the<br>
- * shader is ever validated.<br>
*/<br>
<br>
#include "nir.h"<br>
diff --git a/src/mesa/drivers/dri/i965/brw_nir.c b/src/mesa/drivers/dri/i965/brw_nir.c<br>
index c62840a..e0c9465 100644<br>
--- a/src/mesa/drivers/dri/i965/brw_nir.c<br>
+++ b/src/mesa/drivers/dri/i965/brw_nir.c<br>
@@ -560,6 +560,7 @@ brw_create_nir(struct brw_context *brw,<br>
/* First, lower the GLSL IR or Mesa IR to NIR */<br>
if (shader_prog) {<br>
nir = glsl_to_nir(shader_prog, stage, options);<br>
+ nir_lower_outputs_to_temporaries(nir);<br>
} else {<br>
nir = prog_to_nir(prog, options);<br>
OPT_V(nir_convert_to_ssa); /* turn registers into SSA */<br>
<span class="HOEnZb"><font color="#888888">--<br>
2.5.5<br>
<br>
_______________________________________________<br>
mesa-dev mailing list<br>
<a href="mailto:mesa-dev@lists.freedesktop.org">mesa-dev@lists.freedesktop.org</a><br>
<a href="https://lists.freedesktop.org/mailman/listinfo/mesa-dev" rel="noreferrer" target="_blank">https://lists.freedesktop.org/mailman/listinfo/mesa-dev</a><br>
</font></span></blockquote></div><br></div>