aco: Fix multiview view index for mesh shaders.

Signed-off-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15034>
This commit is contained in:
Timur Kristóf 2022-01-21 19:23:15 +01:00 committed by Marge Bot
parent 082b691141
commit 9cc9cf77a8

View file

@ -10747,8 +10747,8 @@ create_vs_exports(isel_context* ctx)
get_arg(ctx, ctx->args->ac.vs_prim_id);
}
if (ctx->options->key.has_multiview_view_index) {
assert(!outinfo->writes_layer_per_primitive);
if (ctx->options->key.has_multiview_view_index &&
!outinfo->writes_layer_per_primitive) {
ctx->outputs.mask[VARYING_SLOT_LAYER] |= 0x1;
ctx->outputs.temps[VARYING_SLOT_LAYER * 4u] =
as_vgpr(ctx, get_arg(ctx, ctx->args->ac.view_index));
@ -10802,6 +10802,13 @@ create_primitive_exports(isel_context *ctx, Temp prim_ch1)
Builder bld(ctx->program, ctx->block);
if (ctx->options->key.has_multiview_view_index &&
outinfo->writes_layer_per_primitive) {
ctx->outputs.mask[VARYING_SLOT_LAYER] |= 0x1;
ctx->outputs.temps[VARYING_SLOT_LAYER * 4u] =
as_vgpr(ctx, get_arg(ctx, ctx->args->ac.view_index));
}
/* Use zeroes if the shader doesn't write these but they are needed by eg. PS. */
if (outinfo->writes_layer_per_primitive && !ctx->outputs.mask[VARYING_SLOT_LAYER])
ctx->outputs.temps[VARYING_SLOT_LAYER * 4u] = bld.copy(bld.def(v1), Operand::c32(0));