diff options
author | Samuel Pitoiset <[email protected]> | 2019-04-10 17:16:50 +0200 |
---|---|---|
committer | Samuel Pitoiset <[email protected]> | 2019-04-12 17:30:55 +0200 |
commit | 590a4c898191ba6af3b31caa8688536a5e19d2cf (patch) | |
tree | 70fa99576f156ce496475fcbb5e81dfd277745af /src/gallium/drivers/radeonsi | |
parent | 4cb13e946284a569a242af0213f01e84aea4a4af (diff) |
ac: add ac_build_ddxy_interp() helper
Signed-off-by: Samuel Pitoiset <[email protected]>
Reviewed-by: Marek Olšák <[email protected]>
Diffstat (limited to 'src/gallium/drivers/radeonsi')
-rw-r--r-- | src/gallium/drivers/radeonsi/si_shader.c | 27 |
1 files changed, 1 insertions, 26 deletions
diff --git a/src/gallium/drivers/radeonsi/si_shader.c b/src/gallium/drivers/radeonsi/si_shader.c index efae02ee91c..8ebc8d39e99 100644 --- a/src/gallium/drivers/radeonsi/si_shader.c +++ b/src/gallium/drivers/radeonsi/si_shader.c @@ -3924,31 +3924,6 @@ static void si_llvm_emit_ddxy( emit_data->output[emit_data->chan] = val; } -/* - * this takes an I,J coordinate pair, - * and works out the X and Y derivatives. - * it returns DDX(I), DDX(J), DDY(I), DDY(J). - */ -static LLVMValueRef si_llvm_emit_ddxy_interp( - struct lp_build_tgsi_context *bld_base, - LLVMValueRef interp_ij) -{ - struct si_shader_context *ctx = si_shader_context(bld_base); - LLVMValueRef result[4], a; - unsigned i; - - for (i = 0; i < 2; i++) { - a = LLVMBuildExtractElement(ctx->ac.builder, interp_ij, - LLVMConstInt(ctx->i32, i, 0), ""); - result[i] = ac_build_ddxy(&ctx->ac, AC_TID_MASK_TOP_LEFT, 1, - ac_to_integer(&ctx->ac, a)); /* DDX */ - result[2+i] = ac_build_ddxy(&ctx->ac, AC_TID_MASK_TOP_LEFT, 2, - ac_to_integer(&ctx->ac, a)); /* DDY */ - } - - return ac_build_gather_values(&ctx->ac, result, 4); -} - static void build_interp_intrinsic(const struct lp_build_tgsi_action *action, struct lp_build_tgsi_context *bld_base, struct lp_build_emit_data *emit_data) @@ -4062,7 +4037,7 @@ static void build_interp_intrinsic(const struct lp_build_tgsi_action *action, if (inst->Instruction.Opcode == TGSI_OPCODE_INTERP_OFFSET || inst->Instruction.Opcode == TGSI_OPCODE_INTERP_SAMPLE) { LLVMValueRef ij_out[2]; - LLVMValueRef ddxy_out = si_llvm_emit_ddxy_interp(bld_base, interp_param); + LLVMValueRef ddxy_out = ac_build_ddxy_interp(&ctx->ac, interp_param); /* * take the I then J parameters, and the DDX/Y for it, and |