<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 11, 2017 at 5:25 PM, Timothy Arceri <span dir="ltr"><<a href="mailto:timothy.arceri@collabora.com" target="_blank">timothy.arceri@collabora.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class="">On Wed, 2017-01-11 at 16:09 -0800, Kenneth Graunke wrote:<br>
> When multiple shader stages exist in the same SPIR-V module, we<br>
> compile<br>
> all entry points and their inputs/outputs, then dead code eliminate<br>
> the<br>
> ones not related to the specific entry point later.<br>
><br>
> nir_lower_wpos_center was being run prior to eliminating those random<br>
> other variables, which made it trip up, thinking it found<br>
> gl_FragCoord<br>
> when it actually found something else like gl_PerVertex[3].<br>
><br>
> Fixes dEQP-VK.spirv_assembly.<wbr>instruction.graphics.module.<wbr>same_module.<br>
><br>
> Signed-off-by: Kenneth Graunke <<a href="mailto:kenneth@whitecape.org">kenneth@whitecape.org</a>><br>
<br>
</span>Reviewed-by: Timothy Arceri <<a href="mailto:timothy.arceri@collabora.com">timothy.arceri@collabora.com</a>><br>
<div class="HOEnZb"><div class="h5"><br>
> ---<br>
> src/intel/vulkan/anv_<wbr>pipeline.c | 6 +++---<br>
> 1 file changed, 3 insertions(+), 3 deletions(-)<br>
><br>
> diff --git a/src/intel/vulkan/anv_<wbr>pipeline.c<br>
> b/src/intel/vulkan/anv_<wbr>pipeline.c<br>
> index 6c939b071da..7d939ebabe9 100644<br>
> --- a/src/intel/vulkan/anv_<wbr>pipeline.c<br>
> +++ b/src/intel/vulkan/anv_<wbr>pipeline.c<br>
> @@ -139,9 +139,6 @@ anv_shader_compile_to_nir(<wbr>struct anv_device<br>
> *device,<br>
> <br>
> free(spec_entries);<br>
> <br>
> - if (stage == MESA_SHADER_FRAGMENT)<br>
> - NIR_PASS_V(nir, nir_lower_wpos_center);<br>
> -<br>
> /* We have to lower away local constant initializers right before<br>
> we<br>
> * inline functions. That way they get properly initialized at<br>
> the top<br>
> * of the function and not at the top of its caller.<br>
> @@ -161,6 +158,9 @@ anv_shader_compile_to_nir(<wbr>struct anv_device<br>
> *device,<br>
> NIR_PASS_V(nir, nir_remove_dead_variables,<br>
> nir_var_shader_<wbr>in | nir_var_shader_out |<br>
> nir_var_system_value);<br>
> <br>
> + if (stage == MESA_SHADER_FRAGMENT)<br>
> + NIR_PASS_V(nir, nir_lower_wpos_center);<br>
> +<br>
> /* Now that we've deleted all but the main function, we can go<br>
> ahead and<br>
> * lower the rest of the constant initializers.<br>
> */<br>
</div></div><div class="HOEnZb"><div class="h5">______________________________<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>
</div></div></blockquote></div><br></div>