mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-08 15:38:09 +02:00
radv,aco: fix reading primitive ID in FS after TES
Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Cc: mesa-stable
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/3530
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6760>
(cherry picked from commit 2228835fb5)
This commit is contained in:
parent
0f61e68ede
commit
78df8e5e38
3 changed files with 11 additions and 4 deletions
|
|
@ -868,7 +868,7 @@
|
||||||
"description": "radv,aco: fix reading primitive ID in FS after TES",
|
"description": "radv,aco: fix reading primitive ID in FS after TES",
|
||||||
"nominated": true,
|
"nominated": true,
|
||||||
"nomination_type": 0,
|
"nomination_type": 0,
|
||||||
"resolution": 0,
|
"resolution": 1,
|
||||||
"master_sha": null,
|
"master_sha": null,
|
||||||
"because_sha": null
|
"because_sha": null
|
||||||
},
|
},
|
||||||
|
|
|
||||||
|
|
@ -9753,7 +9753,10 @@ static void create_vs_exports(isel_context *ctx)
|
||||||
|
|
||||||
if (outinfo->export_prim_id && !(ctx->stage & hw_ngg_gs)) {
|
if (outinfo->export_prim_id && !(ctx->stage & hw_ngg_gs)) {
|
||||||
ctx->outputs.mask[VARYING_SLOT_PRIMITIVE_ID] |= 0x1;
|
ctx->outputs.mask[VARYING_SLOT_PRIMITIVE_ID] |= 0x1;
|
||||||
ctx->outputs.temps[VARYING_SLOT_PRIMITIVE_ID * 4u] = get_arg(ctx, ctx->args->vs_prim_id);
|
if (ctx->stage & sw_tes)
|
||||||
|
ctx->outputs.temps[VARYING_SLOT_PRIMITIVE_ID * 4u] = get_arg(ctx, ctx->args->ac.tes_patch_id);
|
||||||
|
else
|
||||||
|
ctx->outputs.temps[VARYING_SLOT_PRIMITIVE_ID * 4u] = get_arg(ctx, ctx->args->vs_prim_id);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (ctx->options->key.has_multiview_view_index) {
|
if (ctx->options->key.has_multiview_view_index) {
|
||||||
|
|
|
||||||
|
|
@ -1987,8 +1987,12 @@ handle_vs_outputs_post(struct radv_shader_context *ctx,
|
||||||
outputs[noutput].slot_name = VARYING_SLOT_PRIMITIVE_ID;
|
outputs[noutput].slot_name = VARYING_SLOT_PRIMITIVE_ID;
|
||||||
outputs[noutput].slot_index = 0;
|
outputs[noutput].slot_index = 0;
|
||||||
outputs[noutput].usage_mask = 0x1;
|
outputs[noutput].usage_mask = 0x1;
|
||||||
outputs[noutput].values[0] =
|
if (ctx->stage == MESA_SHADER_TESS_EVAL)
|
||||||
ac_get_arg(&ctx->ac, ctx->args->vs_prim_id);
|
outputs[noutput].values[0] =
|
||||||
|
ac_get_arg(&ctx->ac, ctx->args->ac.tes_patch_id);
|
||||||
|
else
|
||||||
|
outputs[noutput].values[0] =
|
||||||
|
ac_get_arg(&ctx->ac, ctx->args->vs_prim_id);
|
||||||
for (unsigned j = 1; j < 4; j++)
|
for (unsigned j = 1; j < 4; j++)
|
||||||
outputs[noutput].values[j] = ctx->ac.f32_0;
|
outputs[noutput].values[j] = ctx->ac.f32_0;
|
||||||
noutput++;
|
noutput++;
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue