radv: export implicit primitive ID in NIR for legacy VS or TES
It's implicit for VS or TES, while it's required for GS or MS. Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com> Reviewed-by: Timur Kristóf <timur.kristof@gmail.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16404>
This commit is contained in:

committed by
Marge Bot

parent
d711e9813c
commit
95d4e5435b
@@ -1046,7 +1046,7 @@ handle_vs_outputs_post(struct radv_shader_context *ctx, bool export_prim_id, boo
|
||||
}
|
||||
|
||||
/* Allocate a temporary array for the output values. */
|
||||
unsigned num_outputs = util_bitcount64(ctx->output_mask) + export_prim_id;
|
||||
unsigned num_outputs = util_bitcount64(ctx->output_mask);
|
||||
outputs = malloc(num_outputs * sizeof(outputs[0]));
|
||||
|
||||
for (unsigned i = 0; i < AC_LLVM_MAX_OUTPUTS; ++i) {
|
||||
@@ -1072,20 +1072,6 @@ handle_vs_outputs_post(struct radv_shader_context *ctx, bool export_prim_id, boo
|
||||
noutput++;
|
||||
}
|
||||
|
||||
/* Export PrimitiveID. */
|
||||
if (export_prim_id) {
|
||||
outputs[noutput].slot_name = VARYING_SLOT_PRIMITIVE_ID;
|
||||
outputs[noutput].slot_index = 0;
|
||||
outputs[noutput].usage_mask = 0x1;
|
||||
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->ac.vs_prim_id);
|
||||
for (unsigned j = 1; j < 4; j++)
|
||||
outputs[noutput].values[j] = ctx->ac.f32_0;
|
||||
noutput++;
|
||||
}
|
||||
|
||||
radv_llvm_export_vs(ctx, outputs, noutput, outinfo, export_clip_dists);
|
||||
|
||||
free(outputs);
|
||||
|
Reference in New Issue
Block a user