<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 Wed, Jan 17, 2018 at 12:08 AM, Iago Toral Quiroga <span dir="ltr"><<a href="mailto:itoral@igalia.com" target="_blank">itoral@igalia.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">If a shader only writes to an output via a constant initializer we<br>
need to lower it before we call nir_remove_dead_variables so that<br>
this pass sees the stores from the initializer and doesn't kill the<br>
output.<br>
<br>
Fixes test failures in new work-in-progress CTS tests:<br>
dEQP-VK.spirv_assembly.<wbr>instruction.graphics.variable_<wbr>init.output_vert<br>
dEQP-VK.spirv_assembly.<wbr>instruction.graphics.variable_<wbr>init.output_frag<br>
---<br>
src/intel/vulkan/anv_pipeline.<wbr>c | 5 +++++<br>
1 file changed, 5 insertions(+)<br>
<br>
diff --git a/src/intel/vulkan/anv_<wbr>pipeline.c b/src/intel/vulkan/anv_<wbr>pipeline.c<br>
index 4e66f8665f..fe0a3fc30a 100644<br>
--- a/src/intel/vulkan/anv_<wbr>pipeline.c<br>
+++ b/src/intel/vulkan/anv_<wbr>pipeline.c<br>
@@ -179,6 +179,11 @@ anv_shader_compile_to_nir(<wbr>struct anv_pipeline *pipeline,<br>
assert(exec_list_length(&nir-><wbr>functions) == 1);<br>
entry_point->name = ralloc_strdup(entry_point, "main");<br>
<br>
+ /* Make sure we lower constant initializers on output variables so that<br>
+ * nir_remove_dead_variables below sees the corresponding stores<br>
+ */<br>
+ NIR_PASS_V(nir, nir_lower_constant_<wbr>initializers, nir_var_shader_out);<br>
+<br>
NIR_PASS_V(nir, nir_remove_dead_variables,<br>
nir_var_shader_in | nir_var_shader_out | nir_var_system_value);<br>
<span class="HOEnZb"><font color="#888888"><br>
--<br>
2.14.1<br>
<br>
______________________________<wbr>_________________<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/<wbr>mailman/listinfo/mesa-dev</a><br>
</font></span></blockquote></div><br></div>