radeonsi: restructure code that declares merged VS-GS and TES-GS SGPRs
no change in the SGPR layout Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13829>
This commit is contained in:
@@ -533,27 +533,26 @@ void si_init_shader_args(struct si_shader_context *ctx, bool ngg_cull_shader)
|
|||||||
ctx, (ctx->stage == MESA_SHADER_VERTEX || ctx->stage == MESA_SHADER_TESS_EVAL));
|
ctx, (ctx->stage == MESA_SHADER_VERTEX || ctx->stage == MESA_SHADER_TESS_EVAL));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (ctx->stage == MESA_SHADER_VERTEX) {
|
if (ctx->stage == MESA_SHADER_VERTEX && shader->selector->info.base.vs.blit_sgprs_amd) {
|
||||||
if (shader->selector->info.base.vs.blit_sgprs_amd) {
|
|
||||||
declare_vs_blit_inputs(ctx, shader->selector->info.base.vs.blit_sgprs_amd);
|
declare_vs_blit_inputs(ctx, shader->selector->info.base.vs.blit_sgprs_amd);
|
||||||
} else {
|
} else {
|
||||||
ac_add_arg(&ctx->args, AC_ARG_SGPR, 1, AC_ARG_INT, &ctx->vs_state_bits);
|
ac_add_arg(&ctx->args, AC_ARG_SGPR, 1, AC_ARG_INT, &ctx->vs_state_bits);
|
||||||
|
|
||||||
|
if (ctx->stage == MESA_SHADER_VERTEX) {
|
||||||
ac_add_arg(&ctx->args, AC_ARG_SGPR, 1, AC_ARG_INT, &ctx->args.base_vertex);
|
ac_add_arg(&ctx->args, AC_ARG_SGPR, 1, AC_ARG_INT, &ctx->args.base_vertex);
|
||||||
ac_add_arg(&ctx->args, AC_ARG_SGPR, 1, AC_ARG_INT, &ctx->args.draw_id);
|
ac_add_arg(&ctx->args, AC_ARG_SGPR, 1, AC_ARG_INT, &ctx->args.draw_id);
|
||||||
ac_add_arg(&ctx->args, AC_ARG_SGPR, 1, AC_ARG_INT, &ctx->args.start_instance);
|
ac_add_arg(&ctx->args, AC_ARG_SGPR, 1, AC_ARG_INT, &ctx->args.start_instance);
|
||||||
ac_add_arg(&ctx->args, AC_ARG_SGPR, 1, AC_ARG_CONST_DESC_PTR, &ctx->small_prim_cull_info);
|
} else if (ctx->stage == MESA_SHADER_TESS_EVAL) {
|
||||||
declare_vb_descriptor_input_sgprs(ctx);
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
/* TES or GS */
|
|
||||||
ac_add_arg(&ctx->args, AC_ARG_SGPR, 1, AC_ARG_INT, &ctx->vs_state_bits);
|
|
||||||
|
|
||||||
if (ctx->stage == MESA_SHADER_TESS_EVAL) {
|
|
||||||
ac_add_arg(&ctx->args, AC_ARG_SGPR, 1, AC_ARG_INT, &ctx->tcs_offchip_layout);
|
ac_add_arg(&ctx->args, AC_ARG_SGPR, 1, AC_ARG_INT, &ctx->tcs_offchip_layout);
|
||||||
ac_add_arg(&ctx->args, AC_ARG_SGPR, 1, AC_ARG_INT, &ctx->tes_offchip_addr);
|
ac_add_arg(&ctx->args, AC_ARG_SGPR, 1, AC_ARG_INT, &ctx->tes_offchip_addr);
|
||||||
ac_add_arg(&ctx->args, AC_ARG_SGPR, 1, AC_ARG_INT, NULL); /* unused */
|
ac_add_arg(&ctx->args, AC_ARG_SGPR, 1, AC_ARG_INT, NULL); /* unused */
|
||||||
ac_add_arg(&ctx->args, AC_ARG_SGPR, 1, AC_ARG_CONST_DESC_PTR, &ctx->small_prim_cull_info);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (ctx->stage != MESA_SHADER_GEOMETRY)
|
||||||
|
ac_add_arg(&ctx->args, AC_ARG_SGPR, 1, AC_ARG_CONST_DESC_PTR, &ctx->small_prim_cull_info);
|
||||||
|
|
||||||
|
if (ctx->stage == MESA_SHADER_VERTEX)
|
||||||
|
declare_vb_descriptor_input_sgprs(ctx);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* VGPRs (first GS, then VS/TES) */
|
/* VGPRs (first GS, then VS/TES) */
|
||||||
|
Reference in New Issue
Block a user