From 8e0cff56f310977e1c881a1ca882c6ea40dffe90 Mon Sep 17 00:00:00 2001 From: Qiang Yu Date: Sat, 22 Jul 2023 22:40:52 +0800 Subject: [PATCH] radeonsi: remove separate_prolog arg from prolog/epilog build MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit It's always true. Reviewed-by: Marek Olšák Signed-off-by: Qiang Yu Part-of: --- src/gallium/drivers/radeonsi/si_shader_internal.h | 12 ++++-------- src/gallium/drivers/radeonsi/si_shader_llvm.c | 4 ++-- src/gallium/drivers/radeonsi/si_shader_llvm_ps.c | 12 +++++------- src/gallium/drivers/radeonsi/si_shader_llvm_tess.c | 3 +-- src/gallium/drivers/radeonsi/si_shader_llvm_vs.c | 3 +-- 5 files changed, 13 insertions(+), 21 deletions(-) diff --git a/src/gallium/drivers/radeonsi/si_shader_internal.h b/src/gallium/drivers/radeonsi/si_shader_internal.h index 7c7228e..0d033c1 100644 --- a/src/gallium/drivers/radeonsi/si_shader_internal.h +++ b/src/gallium/drivers/radeonsi/si_shader_internal.h @@ -199,21 +199,17 @@ void si_llvm_gs_build_end(struct si_shader_context *ctx); /* si_shader_llvm_tess.c */ LLVMValueRef si_get_rel_patch_id(struct si_shader_context *ctx); void si_llvm_ls_build_end(struct si_shader_context *ctx); -void si_llvm_build_tcs_epilog(struct si_shader_context *ctx, union si_shader_part_key *key, - bool separate_epilog); +void si_llvm_build_tcs_epilog(struct si_shader_context *ctx, union si_shader_part_key *key); void si_llvm_tcs_build_end(struct si_shader_context *ctx); void si_llvm_init_tcs_callbacks(struct si_shader_context *ctx); /* si_shader_llvm_ps.c */ -void si_llvm_build_ps_prolog(struct si_shader_context *ctx, union si_shader_part_key *key, - bool separate_prolog); -void si_llvm_build_ps_epilog(struct si_shader_context *ctx, union si_shader_part_key *key, - bool separate_epilog); +void si_llvm_build_ps_prolog(struct si_shader_context *ctx, union si_shader_part_key *key); +void si_llvm_build_ps_epilog(struct si_shader_context *ctx, union si_shader_part_key *key); void si_llvm_ps_build_end(struct si_shader_context *ctx); /* si_shader_llvm_vs.c */ -void si_llvm_build_vs_prolog(struct si_shader_context *ctx, union si_shader_part_key *key, - bool separate_prolog); +void si_llvm_build_vs_prolog(struct si_shader_context *ctx, union si_shader_part_key *key); /* si_shader_aco.c */ bool si_aco_compile_shader(struct si_shader *shader, diff --git a/src/gallium/drivers/radeonsi/si_shader_llvm.c b/src/gallium/drivers/radeonsi/si_shader_llvm.c index 9850687..7e496a8 100644 --- a/src/gallium/drivers/radeonsi/si_shader_llvm.c +++ b/src/gallium/drivers/radeonsi/si_shader_llvm.c @@ -956,7 +956,7 @@ bool si_llvm_build_shader_part(struct si_screen *sscreen, gl_shader_stage stage, struct si_shader_args args; ctx.args = &args; - void (*build)(struct si_shader_context *, union si_shader_part_key *, bool); + void (*build)(struct si_shader_context *, union si_shader_part_key *); switch (stage) { case MESA_SHADER_VERTEX: @@ -972,7 +972,7 @@ bool si_llvm_build_shader_part(struct si_screen *sscreen, gl_shader_stage stage, unreachable("bad shader part"); } - build(&ctx, key, true); + build(&ctx, key); /* Compile. */ si_llvm_optimize_module(&ctx); diff --git a/src/gallium/drivers/radeonsi/si_shader_llvm_ps.c b/src/gallium/drivers/radeonsi/si_shader_llvm_ps.c index 6bbe7c2..2874d17 100644 --- a/src/gallium/drivers/radeonsi/si_shader_llvm_ps.c +++ b/src/gallium/drivers/radeonsi/si_shader_llvm_ps.c @@ -466,8 +466,7 @@ static void si_llvm_emit_polygon_stipple(struct si_shader_context *ctx, * overridden by other states. (e.g. per-sample interpolation) * Interpolated colors are stored after the preloaded VGPRs. */ -void si_llvm_build_ps_prolog(struct si_shader_context *ctx, union si_shader_part_key *key, - bool separate_prolog) +void si_llvm_build_ps_prolog(struct si_shader_context *ctx, union si_shader_part_key *key) { LLVMValueRef ret, func; int num_returns, i, num_color_channels; @@ -591,13 +590,13 @@ void si_llvm_build_ps_prolog(struct si_shader_context *ctx, union si_shader_part /* Read LINEAR_SAMPLE. */ for (i = 0; i < 2; i++) - linear_sample[i] = LLVMGetParam(func, base + (separate_prolog ? 6 : 9) + i); + linear_sample[i] = LLVMGetParam(func, base + 6 + i); /* Overwrite LINEAR_CENTER. */ for (i = 0; i < 2; i++) - ret = LLVMBuildInsertValue(ctx->ac.builder, ret, linear_sample[i], base + (separate_prolog ? 8 : 11) + i, ""); + ret = LLVMBuildInsertValue(ctx->ac.builder, ret, linear_sample[i], base + 8 + i, ""); /* Overwrite LINEAR_CENTROID. */ for (i = 0; i < 2; i++) - ret = LLVMBuildInsertValue(ctx->ac.builder, ret, linear_sample[i], base + (separate_prolog ? 10 : 13) + i, ""); + ret = LLVMBuildInsertValue(ctx->ac.builder, ret, linear_sample[i], base + 10 + i, ""); } /* Force center interpolation. */ @@ -715,8 +714,7 @@ void si_llvm_build_ps_prolog(struct si_shader_context *ctx, union si_shader_part * Build the pixel shader epilog function. This handles everything that must be * emulated for pixel shader exports. (alpha-test, format conversions, etc) */ -void si_llvm_build_ps_epilog(struct si_shader_context *ctx, union si_shader_part_key *key, - UNUSED bool separate_epilog) +void si_llvm_build_ps_epilog(struct si_shader_context *ctx, union si_shader_part_key *key) { int i; struct si_ps_exports exp = {}; diff --git a/src/gallium/drivers/radeonsi/si_shader_llvm_tess.c b/src/gallium/drivers/radeonsi/si_shader_llvm_tess.c index 00a341f..d86a8b6 100644 --- a/src/gallium/drivers/radeonsi/si_shader_llvm_tess.c +++ b/src/gallium/drivers/radeonsi/si_shader_llvm_tess.c @@ -530,8 +530,7 @@ void si_llvm_ls_build_end(struct si_shader_context *ctx) * Compile the TCS epilog function. This writes tessellation factors to memory * based on the output primitive type of the tessellator (determined by TES). */ -void si_llvm_build_tcs_epilog(struct si_shader_context *ctx, union si_shader_part_key *key, - UNUSED bool separate_epilog) +void si_llvm_build_tcs_epilog(struct si_shader_context *ctx, union si_shader_part_key *key) { memset(ctx->args, 0, sizeof(*ctx->args)); diff --git a/src/gallium/drivers/radeonsi/si_shader_llvm_vs.c b/src/gallium/drivers/radeonsi/si_shader_llvm_vs.c index b1783b5..c278602 100644 --- a/src/gallium/drivers/radeonsi/si_shader_llvm_vs.c +++ b/src/gallium/drivers/radeonsi/si_shader_llvm_vs.c @@ -73,8 +73,7 @@ static LLVMValueRef get_vertex_index(struct si_shader_context *ctx, * (InstanceID + StartInstance), * (InstanceID / 2 + StartInstance) */ -void si_llvm_build_vs_prolog(struct si_shader_context *ctx, union si_shader_part_key *key, - UNUSED bool separate_prolog) +void si_llvm_build_vs_prolog(struct si_shader_context *ctx, union si_shader_part_key *key) { LLVMTypeRef *returns; LLVMValueRef ret, func; -- 2.7.4