summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorNicolai Hähnle <[email protected]>2016-10-28 22:09:26 +0200
committerNicolai Hähnle <[email protected]>2016-11-03 10:07:29 +0100
commit611510038a203dc528515dcbbdd72f01c6f326a2 (patch)
treea6b89963d169c33524ead7cf425ace7e3de5d0c4 /src
parent3f4439b6bab14016b40dd08cf2dc2585645cd076 (diff)
radeonsi: get rid of get_interp_param
Replace by a simple LLVMGetParam, since ctx->no_prolog is always false. Reviewed-by: Marek Olšák <[email protected]>
Diffstat (limited to 'src')
-rw-r--r--src/gallium/drivers/radeonsi/si_shader.c54
1 files changed, 2 insertions, 52 deletions
diff --git a/src/gallium/drivers/radeonsi/si_shader.c b/src/gallium/drivers/radeonsi/si_shader.c
index 8bd8c8077db..f3b94d7ff76 100644
--- a/src/gallium/drivers/radeonsi/si_shader.c
+++ b/src/gallium/drivers/radeonsi/si_shader.c
@@ -1300,56 +1300,6 @@ static void interp_fs_input(struct si_shader_context *ctx,
}
}
-/* LLVMGetParam with bc_optimize resolved. */
-static LLVMValueRef get_interp_param(struct si_shader_context *ctx,
- int interp_param_idx)
-{
- LLVMBuilderRef builder = ctx->gallivm.builder;
- LLVMValueRef main_fn = ctx->main_fn;
- LLVMValueRef param = NULL;
-
- /* Handle PRIM_MASK[31] (bc_optimize). */
- if (ctx->no_prolog &&
- ((ctx->shader->key.ps.prolog.bc_optimize_for_persp &&
- interp_param_idx == SI_PARAM_PERSP_CENTROID) ||
- (ctx->shader->key.ps.prolog.bc_optimize_for_linear &&
- interp_param_idx == SI_PARAM_LINEAR_CENTROID))) {
- /* The shader should do: if (PRIM_MASK[31]) CENTROID = CENTER;
- * The hw doesn't compute CENTROID if the whole wave only
- * contains fully-covered quads.
- */
- LLVMValueRef bc_optimize =
- LLVMGetParam(main_fn, SI_PARAM_PRIM_MASK);
- bc_optimize = LLVMBuildLShr(builder,
- bc_optimize,
- LLVMConstInt(ctx->i32, 31, 0), "");
- bc_optimize = LLVMBuildTrunc(builder, bc_optimize, ctx->i1, "");
-
- if (ctx->shader->key.ps.prolog.bc_optimize_for_persp &&
- interp_param_idx == SI_PARAM_PERSP_CENTROID) {
- param = LLVMBuildSelect(builder, bc_optimize,
- LLVMGetParam(main_fn,
- SI_PARAM_PERSP_CENTER),
- LLVMGetParam(main_fn,
- SI_PARAM_PERSP_CENTROID),
- "");
- }
- if (ctx->shader->key.ps.prolog.bc_optimize_for_linear &&
- interp_param_idx == SI_PARAM_LINEAR_CENTROID) {
- param = LLVMBuildSelect(builder, bc_optimize,
- LLVMGetParam(main_fn,
- SI_PARAM_LINEAR_CENTER),
- LLVMGetParam(main_fn,
- SI_PARAM_LINEAR_CENTROID),
- "");
- }
- }
-
- if (!param)
- param = LLVMGetParam(main_fn, interp_param_idx);
- return param;
-}
-
static void declare_input_fs(
struct si_shader_context *radeon_bld,
unsigned input_index,
@@ -1385,7 +1335,7 @@ static void declare_input_fs(
if (interp_param_idx == -1)
return;
else if (interp_param_idx) {
- interp_param = get_interp_param(ctx, interp_param_idx);
+ interp_param = LLVMGetParam(ctx->main_fn, interp_param_idx);
}
if (decl->Semantic.Name == TGSI_SEMANTIC_COLOR &&
@@ -5131,7 +5081,7 @@ static void build_interp_intrinsic(const struct lp_build_tgsi_action *action,
if (interp_param_idx == -1)
return;
else if (interp_param_idx)
- interp_param = get_interp_param(ctx, interp_param_idx);
+ interp_param = LLVMGetParam(ctx->main_fn, interp_param_idx);
else
interp_param = NULL;