[Mesa-dev] [PATCH 1/2] radv/gfx10: fix exporting the subpass view index for GS

Bas Nieuwenhuizen bas at basnieuwenhuizen.nl
Thu Jul 11 22:24:47 UTC 2019


R-b

On Thu, Jul 11, 2019, 5:02 PM Samuel Pitoiset <samuel.pitoiset at gmail.com>
wrote:

> This fixes dEQP-VK.multiview.*geometry*.
>
> Signed-off-by: Samuel Pitoiset <samuel.pitoiset at gmail.com>
> ---
>  src/amd/vulkan/radv_nir_to_llvm.c | 16 +++++++++++++++-
>  1 file changed, 15 insertions(+), 1 deletion(-)
>
> diff --git a/src/amd/vulkan/radv_nir_to_llvm.c
> b/src/amd/vulkan/radv_nir_to_llvm.c
> index 11498bc27aa..7da061f7f33 100644
> --- a/src/amd/vulkan/radv_nir_to_llvm.c
> +++ b/src/amd/vulkan/radv_nir_to_llvm.c
> @@ -3583,11 +3583,12 @@ static void gfx10_ngg_gs_emit_epilogue_2(struct
> radv_shader_context *ctx)
>         ac_build_ifcc(&ctx->ac, tmp, 5145);
>         {
>                 struct radv_vs_output_info *outinfo =
> &ctx->shader_info->vs.outinfo;
> +               bool export_view_index =
> ctx->options->key.has_multiview_view_index;
>                 struct radv_shader_output_values *outputs;
>                 unsigned noutput = 0;
>
>                 /* Allocate a temporary array for the output values. */
> -               unsigned num_outputs = util_bitcount64(ctx->output_mask);
> +               unsigned num_outputs = util_bitcount64(ctx->output_mask) +
> export_view_index;
>                 outputs = calloc(num_outputs, sizeof(outputs[0]));
>
>                 memset(outinfo->vs_output_param_offset,
> AC_EXP_PARAM_UNDEFINED,
> @@ -3642,6 +3643,19 @@ static void gfx10_ngg_gs_emit_epilogue_2(struct
> radv_shader_context *ctx)
>                         noutput++;
>                 }
>
> +               /* Export ViewIndex. */
> +               if (export_view_index) {
> +                       outinfo->writes_layer = true;
> +
> +                       outputs[noutput].slot_name = VARYING_SLOT_LAYER;
> +                       outputs[noutput].slot_index = 0;
> +                       outputs[noutput].usage_mask = 0x1;
> +                       outputs[noutput].values[0] = ac_to_float(&ctx->ac,
> ctx->abi.view_index);
> +                       for (unsigned j = 1; j < 4; j++)
> +                               outputs[noutput].values[j] = ctx->ac.f32_0;
> +                       noutput++;
> +               }
> +
>                 radv_llvm_export_vs(ctx, outputs, noutput, outinfo, false);
>                 FREE(outputs);
>         }
> --
> 2.22.0
>
> _______________________________________________
> 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/20190712/8a76e028/attachment-0001.html>


More information about the mesa-dev mailing list