mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2025-12-23 13:20:14 +01:00
radv/gfx10: fix exporting the subpass view index for GS
This fixes dEQP-VK.multiview.*geometry*. Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com> Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
This commit is contained in:
parent
3043908ccb
commit
edcd2bc833
1 changed files with 15 additions and 1 deletions
|
|
@ -3583,11 +3583,12 @@ static void gfx10_ngg_gs_emit_epilogue_2(struct radv_shader_context *ctx)
|
||||||
ac_build_ifcc(&ctx->ac, tmp, 5145);
|
ac_build_ifcc(&ctx->ac, tmp, 5145);
|
||||||
{
|
{
|
||||||
struct radv_vs_output_info *outinfo = &ctx->shader_info->vs.outinfo;
|
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;
|
struct radv_shader_output_values *outputs;
|
||||||
unsigned noutput = 0;
|
unsigned noutput = 0;
|
||||||
|
|
||||||
/* Allocate a temporary array for the output values. */
|
/* 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]));
|
outputs = calloc(num_outputs, sizeof(outputs[0]));
|
||||||
|
|
||||||
memset(outinfo->vs_output_param_offset, AC_EXP_PARAM_UNDEFINED,
|
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++;
|
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);
|
radv_llvm_export_vs(ctx, outputs, noutput, outinfo, false);
|
||||||
FREE(outputs);
|
FREE(outputs);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue