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>
This commit is contained in:
@@ -9851,7 +9851,10 @@ static void create_vs_exports(isel_context *ctx)
|
||||
|
||||
if (outinfo->export_prim_id && !(ctx->stage & hw_ngg_gs)) {
|
||||
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) {
|
||||
|
@@ -2012,8 +2012,12 @@ handle_vs_outputs_post(struct radv_shader_context *ctx,
|
||||
outputs[noutput].slot_name = VARYING_SLOT_PRIMITIVE_ID;
|
||||
outputs[noutput].slot_index = 0;
|
||||
outputs[noutput].usage_mask = 0x1;
|
||||
outputs[noutput].values[0] =
|
||||
ac_get_arg(&ctx->ac, ctx->args->vs_prim_id);
|
||||
if (ctx->stage == MESA_SHADER_TESS_EVAL)
|
||||
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++)
|
||||
outputs[noutput].values[j] = ctx->ac.f32_0;
|
||||
noutput++;
|
||||
|
Reference in New Issue
Block a user