It's currently used when LS store output to LDS.
The LS/HS bug fix seems does not affect this case.
But we'd better treat it as other fixed args.
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Signed-off-by: Qiang Yu <yuq825@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22045>
ac_unpack_param(&ctx->ac, ac_get_arg(&ctx->ac, ctx->args->tcs_wave_id), 0, 3),
LLVMConstInt(ctx->ac.i32, ctx->ac.wave_size, 0),
ac_get_thread_id(&ctx->ac));
- } else if (ctx->args->vs_rel_patch_id.used) {
- return ac_get_arg(&ctx->ac, ctx->args->vs_rel_patch_id);
+ } else if (ctx->abi->vs_rel_patch_id) {
+ return ctx->abi->vs_rel_patch_id;
} else if (ctx->args->merged_wave_info.used) {
/* Thread ID in threadgroup in merged ESGS. */
LLVMValueRef wave_id = ac_unpack_param(&ctx->ac, ac_get_arg(&ctx->ac, ctx->args->merged_wave_info), 24, 4);
/* These input registers sometimes need to be fixed up. */
LLVMValueRef vertex_id;
+ LLVMValueRef vs_rel_patch_id;
LLVMValueRef instance_id;
LLVMValueRef persp_centroid, linear_centroid;
LLVMValueRef color0, color1;
LLVMValueRef descriptor_sets[MAX_SETS];
- LLVMValueRef vs_rel_patch_id;
-
LLVMValueRef gs_wave_id;
uint64_t output_mask;
ctx->abi.instance_id =
LLVMBuildSelect(ctx->ac.builder, hs_empty, ac_get_arg(&ctx->ac, ctx->args->ac.vertex_id),
ctx->abi.instance_id, "");
- ctx->vs_rel_patch_id =
+ ctx->abi.vs_rel_patch_id =
LLVMBuildSelect(ctx->ac.builder, hs_empty, ac_get_arg(&ctx->ac, ctx->args->ac.tcs_rel_ids),
- ctx->vs_rel_patch_id, "");
+ ctx->abi.vs_rel_patch_id, "");
ctx->abi.vertex_id =
LLVMBuildSelect(ctx->ac.builder, hs_empty, ac_get_arg(&ctx->ac, ctx->args->ac.tcs_patch_id),
ctx->abi.vertex_id, "");
if (args->ac.vertex_id.used)
ctx.abi.vertex_id = ac_get_arg(&ctx.ac, args->ac.vertex_id);
if (args->ac.vs_rel_patch_id.used)
- ctx.vs_rel_patch_id = ac_get_arg(&ctx.ac, args->ac.vs_rel_patch_id);
+ ctx.abi.vs_rel_patch_id = ac_get_arg(&ctx.ac, args->ac.vs_rel_patch_id);
if (args->ac.instance_id.used)
ctx.abi.instance_id = ac_get_arg(&ctx.ac, args->ac.instance_id);
if (ctx->stage == MESA_SHADER_VERTEX) {
ctx->abi.vertex_id = ac_get_arg(&ctx->ac, ctx->args->ac.vertex_id);
ctx->abi.instance_id = ac_get_arg(&ctx->ac, ctx->args->ac.instance_id);
+ if (ctx->args->ac.vs_rel_patch_id.used)
+ ctx->abi.vs_rel_patch_id = ac_get_arg(&ctx->ac, ctx->args->ac.vs_rel_patch_id);
} else if (ctx->stage == MESA_SHADER_FRAGMENT) {
ctx->abi.persp_centroid = ac_get_arg(&ctx->ac, ctx->args->ac.persp_centroid);
ctx->abi.linear_centroid = ac_get_arg(&ctx->ac, ctx->args->ac.linear_centroid);