ac: remove needless parameters from ac_shader_abi::emit_outputs
Reviewed-by: Timur Kristóf <timur.kristof@gmail.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12570>
This commit is contained in:
@@ -5244,7 +5244,7 @@ void ac_nir_translate(struct ac_llvm_context *ac, struct ac_shader_abi *abi,
|
||||
ac_build_kill_if_false(&ctx.ac, LLVMBuildLoad(ctx.ac.builder, ctx.ac.postponed_kill, ""));
|
||||
|
||||
if (!gl_shader_stage_is_compute(nir->info.stage))
|
||||
ctx.abi->emit_outputs(ctx.abi, AC_LLVM_MAX_OUTPUTS, ctx.abi->outputs);
|
||||
ctx.abi->emit_outputs(ctx.abi);
|
||||
|
||||
free(ctx.ssa_defs);
|
||||
ralloc_free(ctx.defs);
|
||||
|
@@ -70,7 +70,7 @@ struct ac_shader_abi {
|
||||
|
||||
void (*export_vertex)(struct ac_shader_abi *abi);
|
||||
|
||||
void (*emit_outputs)(struct ac_shader_abi *abi, unsigned max_outputs, LLVMValueRef *addrs);
|
||||
void (*emit_outputs)(struct ac_shader_abi *abi);
|
||||
|
||||
void (*emit_vertex)(struct ac_shader_abi *abi, unsigned stream, LLVMValueRef *addrs);
|
||||
|
||||
|
@@ -2234,7 +2234,7 @@ emit_gs_epilogue(struct radv_shader_context *ctx)
|
||||
}
|
||||
|
||||
static void
|
||||
handle_shader_outputs_post(struct ac_shader_abi *abi, unsigned max_outputs, LLVMValueRef *addrs)
|
||||
handle_shader_outputs_post(struct ac_shader_abi *abi)
|
||||
{
|
||||
struct radv_shader_context *ctx = radv_shader_context_from_abi(abi);
|
||||
|
||||
|
@@ -810,14 +810,14 @@ static void gfx10_build_primitive_accepted(struct ac_llvm_context *ac, LLVMValue
|
||||
* Also return the position, which is passed to the shader as an input,
|
||||
* so that we don't compute it twice.
|
||||
*/
|
||||
void gfx10_emit_ngg_culling_epilogue(struct ac_shader_abi *abi, unsigned max_outputs,
|
||||
LLVMValueRef *addrs)
|
||||
void gfx10_emit_ngg_culling_epilogue(struct ac_shader_abi *abi)
|
||||
{
|
||||
struct si_shader_context *ctx = si_shader_context_from_abi(abi);
|
||||
struct si_shader *shader = ctx->shader;
|
||||
struct si_shader_selector *sel = shader->selector;
|
||||
struct si_shader_info *info = &sel->info;
|
||||
LLVMBuilderRef builder = ctx->ac.builder;
|
||||
LLVMValueRef *addrs = abi->outputs;
|
||||
unsigned max_waves = DIV_ROUND_UP(ctx->screen->ngg_subgroup_size, ctx->ac.wave_size);
|
||||
|
||||
assert(shader->key.opt.ngg_culling);
|
||||
@@ -1277,17 +1277,18 @@ void gfx10_emit_ngg_culling_epilogue(struct ac_shader_abi *abi, unsigned max_out
|
||||
/**
|
||||
* Emit the epilogue of an API VS or TES shader compiled as ESGS shader.
|
||||
*/
|
||||
void gfx10_emit_ngg_epilogue(struct ac_shader_abi *abi, unsigned max_outputs, LLVMValueRef *addrs)
|
||||
void gfx10_emit_ngg_epilogue(struct ac_shader_abi *abi)
|
||||
{
|
||||
struct si_shader_context *ctx = si_shader_context_from_abi(abi);
|
||||
struct si_shader_selector *sel = ctx->shader->selector;
|
||||
struct si_shader_info *info = &sel->info;
|
||||
struct si_shader_output_values outputs[PIPE_MAX_SHADER_OUTPUTS];
|
||||
LLVMBuilderRef builder = ctx->ac.builder;
|
||||
LLVMValueRef *addrs = abi->outputs;
|
||||
LLVMValueRef tmp, tmp2;
|
||||
|
||||
assert(!ctx->shader->is_gs_copy_shader);
|
||||
assert(info->num_outputs <= max_outputs);
|
||||
assert(info->num_outputs <= AC_LLVM_MAX_OUTPUTS);
|
||||
|
||||
LLVMValueRef vertex_ptr = NULL;
|
||||
|
||||
|
@@ -190,9 +190,8 @@ bool gfx10_ngg_export_prim_early(struct si_shader *shader);
|
||||
void gfx10_ngg_build_sendmsg_gs_alloc_req(struct si_shader_context *ctx);
|
||||
void gfx10_ngg_build_export_prim(struct si_shader_context *ctx, LLVMValueRef user_edgeflags[3],
|
||||
LLVMValueRef prim_passthrough);
|
||||
void gfx10_emit_ngg_culling_epilogue(struct ac_shader_abi *abi, unsigned max_outputs,
|
||||
LLVMValueRef *addrs);
|
||||
void gfx10_emit_ngg_epilogue(struct ac_shader_abi *abi, unsigned max_outputs, LLVMValueRef *addrs);
|
||||
void gfx10_emit_ngg_culling_epilogue(struct ac_shader_abi *abi);
|
||||
void gfx10_emit_ngg_epilogue(struct ac_shader_abi *abi);
|
||||
void gfx10_ngg_gs_emit_vertex(struct si_shader_context *ctx, unsigned stream, LLVMValueRef *addrs);
|
||||
void gfx10_ngg_gs_emit_prologue(struct si_shader_context *ctx);
|
||||
void gfx10_ngg_gs_emit_epilogue(struct si_shader_context *ctx);
|
||||
@@ -238,7 +237,7 @@ bool si_llvm_compile_shader(struct si_screen *sscreen, struct ac_llvm_compiler *
|
||||
/* si_shader_llvm_gs.c */
|
||||
LLVMValueRef si_is_es_thread(struct si_shader_context *ctx);
|
||||
LLVMValueRef si_is_gs_thread(struct si_shader_context *ctx);
|
||||
void si_llvm_emit_es_epilogue(struct ac_shader_abi *abi, unsigned max_outputs, LLVMValueRef *addrs);
|
||||
void si_llvm_emit_es_epilogue(struct ac_shader_abi *abi);
|
||||
void si_preload_esgs_ring(struct si_shader_context *ctx);
|
||||
void si_preload_gs_rings(struct si_shader_context *ctx);
|
||||
void si_llvm_build_gs_prolog(struct si_shader_context *ctx, union si_shader_part_key *key);
|
||||
@@ -246,7 +245,7 @@ void si_llvm_init_gs_callbacks(struct si_shader_context *ctx);
|
||||
|
||||
/* si_shader_llvm_tess.c */
|
||||
void si_llvm_preload_tes_rings(struct si_shader_context *ctx);
|
||||
void si_llvm_emit_ls_epilogue(struct ac_shader_abi *abi, unsigned max_outputs, LLVMValueRef *addrs);
|
||||
void si_llvm_emit_ls_epilogue(struct ac_shader_abi *abi);
|
||||
void si_llvm_build_tcs_epilog(struct si_shader_context *ctx, union si_shader_part_key *key);
|
||||
void si_llvm_init_tcs_callbacks(struct si_shader_context *ctx);
|
||||
void si_llvm_init_tes_callbacks(struct si_shader_context *ctx, bool ngg_cull_shader);
|
||||
@@ -271,7 +270,7 @@ void si_llvm_emit_streamout(struct si_shader_context *ctx, struct si_shader_outp
|
||||
unsigned noutput, unsigned stream);
|
||||
void si_llvm_build_vs_exports(struct si_shader_context *ctx,
|
||||
struct si_shader_output_values *outputs, unsigned noutput);
|
||||
void si_llvm_emit_vs_epilogue(struct ac_shader_abi *abi, unsigned max_outputs, LLVMValueRef *addrs);
|
||||
void si_llvm_emit_vs_epilogue(struct ac_shader_abi *abi);
|
||||
void si_llvm_build_vs_prolog(struct si_shader_context *ctx, union si_shader_part_key *key);
|
||||
void si_llvm_init_vs_callbacks(struct si_shader_context *ctx, bool ngg_cull_shader);
|
||||
|
||||
|
@@ -132,11 +132,12 @@ static void si_set_es_return_value_for_gs(struct si_shader_context *ctx)
|
||||
ctx->return_value = ret;
|
||||
}
|
||||
|
||||
void si_llvm_emit_es_epilogue(struct ac_shader_abi *abi, unsigned max_outputs, LLVMValueRef *addrs)
|
||||
void si_llvm_emit_es_epilogue(struct ac_shader_abi *abi)
|
||||
{
|
||||
struct si_shader_context *ctx = si_shader_context_from_abi(abi);
|
||||
struct si_shader *es = ctx->shader;
|
||||
struct si_shader_info *info = &es->selector->info;
|
||||
LLVMValueRef *addrs = abi->outputs;
|
||||
LLVMValueRef lds_base = NULL;
|
||||
unsigned chan;
|
||||
int i;
|
||||
@@ -212,13 +213,12 @@ static void emit_gs_epilogue(struct si_shader_context *ctx)
|
||||
ac_build_endif(&ctx->ac, ctx->merged_wrap_if_label);
|
||||
}
|
||||
|
||||
static void si_llvm_emit_gs_epilogue(struct ac_shader_abi *abi, unsigned max_outputs,
|
||||
LLVMValueRef *addrs)
|
||||
static void si_llvm_emit_gs_epilogue(struct ac_shader_abi *abi)
|
||||
{
|
||||
struct si_shader_context *ctx = si_shader_context_from_abi(abi);
|
||||
struct si_shader_info UNUSED *info = &ctx->shader->selector->info;
|
||||
|
||||
assert(info->num_outputs <= max_outputs);
|
||||
assert(info->num_outputs <= AC_LLVM_MAX_OUTPUTS);
|
||||
|
||||
emit_gs_epilogue(ctx);
|
||||
}
|
||||
|
@@ -486,14 +486,14 @@ static bool si_export_mrt_color(struct si_shader_context *ctx, LLVMValueRef *col
|
||||
*
|
||||
* The alpha-ref SGPR is returned via its original location.
|
||||
*/
|
||||
static void si_llvm_return_fs_outputs(struct ac_shader_abi *abi, unsigned max_outputs,
|
||||
LLVMValueRef *addrs)
|
||||
static void si_llvm_return_fs_outputs(struct ac_shader_abi *abi)
|
||||
{
|
||||
struct si_shader_context *ctx = si_shader_context_from_abi(abi);
|
||||
struct si_shader *shader = ctx->shader;
|
||||
struct si_shader_info *info = &shader->selector->info;
|
||||
LLVMBuilderRef builder = ctx->ac.builder;
|
||||
unsigned i, j, first_vgpr, vgpr;
|
||||
LLVMValueRef *addrs = abi->outputs;
|
||||
|
||||
LLVMValueRef color[8][4] = {};
|
||||
LLVMValueRef depth = NULL, stencil = NULL, samplemask = NULL;
|
||||
|
@@ -824,8 +824,7 @@ static void si_write_tess_factors(struct si_shader_context *ctx, LLVMValueRef re
|
||||
}
|
||||
|
||||
/* This only writes the tessellation factor levels. */
|
||||
static void si_llvm_emit_tcs_epilogue(struct ac_shader_abi *abi, unsigned max_outputs,
|
||||
LLVMValueRef *addrs)
|
||||
static void si_llvm_emit_tcs_epilogue(struct ac_shader_abi *abi)
|
||||
{
|
||||
struct si_shader_context *ctx = si_shader_context_from_abi(abi);
|
||||
LLVMBuilderRef builder = ctx->ac.builder;
|
||||
@@ -939,7 +938,7 @@ static void si_set_ls_return_value_for_tcs(struct si_shader_context *ctx)
|
||||
ctx->return_value = ret;
|
||||
}
|
||||
|
||||
void si_llvm_emit_ls_epilogue(struct ac_shader_abi *abi, unsigned max_outputs, LLVMValueRef *addrs)
|
||||
void si_llvm_emit_ls_epilogue(struct ac_shader_abi *abi)
|
||||
{
|
||||
struct si_shader_context *ctx = si_shader_context_from_abi(abi);
|
||||
struct si_shader *shader = ctx->shader;
|
||||
@@ -948,6 +947,7 @@ void si_llvm_emit_ls_epilogue(struct ac_shader_abi *abi, unsigned max_outputs, L
|
||||
LLVMValueRef vertex_id = ac_get_arg(&ctx->ac, ctx->args.vs_rel_patch_id);
|
||||
LLVMValueRef vertex_dw_stride = get_tcs_in_vertex_dw_stride(ctx);
|
||||
LLVMValueRef base_dw_addr = LLVMBuildMul(ctx->ac.builder, vertex_id, vertex_dw_stride, "");
|
||||
LLVMValueRef *addrs = abi->outputs;
|
||||
unsigned ret_offset = 8 + GFX9_TCS_NUM_USER_SGPR + 2;
|
||||
|
||||
/* Write outputs to LDS. The next shader (TCS aka HS) will read
|
||||
|
@@ -752,15 +752,16 @@ void si_llvm_build_vs_exports(struct si_shader_context *ctx,
|
||||
ac_build_export(&ctx->ac, ¶m_exports[i]);
|
||||
}
|
||||
|
||||
void si_llvm_emit_vs_epilogue(struct ac_shader_abi *abi, unsigned max_outputs, LLVMValueRef *addrs)
|
||||
void si_llvm_emit_vs_epilogue(struct ac_shader_abi *abi)
|
||||
{
|
||||
struct si_shader_context *ctx = si_shader_context_from_abi(abi);
|
||||
struct si_shader_info *info = &ctx->shader->selector->info;
|
||||
struct si_shader_output_values *outputs = NULL;
|
||||
LLVMValueRef *addrs = abi->outputs;
|
||||
int i, j;
|
||||
|
||||
assert(!ctx->shader->is_gs_copy_shader);
|
||||
assert(info->num_outputs <= max_outputs);
|
||||
assert(info->num_outputs <= AC_LLVM_MAX_OUTPUTS);
|
||||
|
||||
outputs = MALLOC((info->num_outputs + 1) * sizeof(outputs[0]));
|
||||
|
||||
@@ -791,14 +792,14 @@ void si_llvm_emit_vs_epilogue(struct ac_shader_abi *abi, unsigned max_outputs, L
|
||||
FREE(outputs);
|
||||
}
|
||||
|
||||
static void si_llvm_emit_prim_discard_cs_epilogue(struct ac_shader_abi *abi, unsigned max_outputs,
|
||||
LLVMValueRef *addrs)
|
||||
static void si_llvm_emit_prim_discard_cs_epilogue(struct ac_shader_abi *abi)
|
||||
{
|
||||
struct si_shader_context *ctx = si_shader_context_from_abi(abi);
|
||||
struct si_shader_info *info = &ctx->shader->selector->info;
|
||||
LLVMValueRef *addrs = abi->outputs;
|
||||
LLVMValueRef pos[4] = {};
|
||||
|
||||
assert(info->num_outputs <= max_outputs);
|
||||
assert(info->num_outputs <= AC_LLVM_MAX_OUTPUTS);
|
||||
|
||||
for (unsigned i = 0; i < info->num_outputs; i++) {
|
||||
if (info->output_semantic[i] != VARYING_SLOT_POS)
|
||||
|
Reference in New Issue
Block a user