[Mesa-dev] [PATCH] anv/pipeline: lower constant initializers on output variables earlier

Jason Ekstrand jason at jlekstrand.net
Mon Jan 29 22:47:05 UTC 2018


Reviewed-by: Jason Ekstrand <jason at jlekstrand.net>

On Wed, Jan 17, 2018 at 12:08 AM, Iago Toral Quiroga <itoral at igalia.com>
wrote:

> If a shader only writes to an output via a constant initializer we
> need to lower it before we call nir_remove_dead_variables so that
> this pass sees the stores from the initializer and doesn't kill the
> output.
>
> Fixes test failures in new work-in-progress CTS tests:
> dEQP-VK.spirv_assembly.instruction.graphics.variable_init.output_vert
> dEQP-VK.spirv_assembly.instruction.graphics.variable_init.output_frag
> ---
>  src/intel/vulkan/anv_pipeline.c | 5 +++++
>  1 file changed, 5 insertions(+)
>
> diff --git a/src/intel/vulkan/anv_pipeline.c b/src/intel/vulkan/anv_
> pipeline.c
> index 4e66f8665f..fe0a3fc30a 100644
> --- a/src/intel/vulkan/anv_pipeline.c
> +++ b/src/intel/vulkan/anv_pipeline.c
> @@ -179,6 +179,11 @@ anv_shader_compile_to_nir(struct anv_pipeline
> *pipeline,
>     assert(exec_list_length(&nir->functions) == 1);
>     entry_point->name = ralloc_strdup(entry_point, "main");
>
> +   /* Make sure we lower constant initializers on output variables so that
> +    * nir_remove_dead_variables below sees the corresponding stores
> +    */
> +   NIR_PASS_V(nir, nir_lower_constant_initializers, nir_var_shader_out);
> +
>     NIR_PASS_V(nir, nir_remove_dead_variables,
>                nir_var_shader_in | nir_var_shader_out |
> nir_var_system_value);
>
> --
> 2.14.1
>
> _______________________________________________
> mesa-dev mailing list
> mesa-dev at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/mesa-dev
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/mesa-dev/attachments/20180129/5665cded/attachment.html>


More information about the mesa-dev mailing list