summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSamuel Pitoiset <[email protected]>2018-02-09 13:54:24 +0100
committerSamuel Pitoiset <[email protected]>2018-02-12 11:54:15 +0100
commit1e69db003da22c9068e5fd08bcf217442da5712c (patch)
treea6307a4ddb0caf31e75e324607c6b6778a8ac460
parented179fbdf37192cba5f3ff1c335d8ac09323ea81 (diff)
ac/nir: remove useless bitcast in load_tess_coord()
nir_intrinsic_load_tess_coord always returns a v3i32. Signed-off-by: Samuel Pitoiset <[email protected]> Reviewed-by: Bas Nieuwenhuizen <[email protected]>
-rw-r--r--src/amd/common/ac_nir_to_llvm.c11
1 files changed, 3 insertions, 8 deletions
diff --git a/src/amd/common/ac_nir_to_llvm.c b/src/amd/common/ac_nir_to_llvm.c
index f99c9d3d692..dff9fd2ee34 100644
--- a/src/amd/common/ac_nir_to_llvm.c
+++ b/src/amd/common/ac_nir_to_llvm.c
@@ -4243,8 +4243,7 @@ load_tess_coord(struct ac_shader_abi *abi, LLVMTypeRef type,
coord[2] = LLVMBuildFSub(ctx->builder, ctx->ac.f32_1,
LLVMBuildFAdd(ctx->builder, coord[0], coord[1], ""), "");
- LLVMValueRef result = ac_build_gather_values(&ctx->ac, coord, num_components);
- return LLVMBuildBitCast(ctx->builder, result, type, "");
+ return ac_build_gather_values(&ctx->ac, coord, 3);
}
static LLVMValueRef
@@ -4487,13 +4486,9 @@ static void visit_intrinsic(struct ac_nir_context *ctx,
case nir_intrinsic_end_primitive:
ctx->abi->emit_primitive(ctx->abi, nir_intrinsic_stream_id(instr));
break;
- case nir_intrinsic_load_tess_coord: {
- LLVMTypeRef type = ctx->nctx ?
- get_def_type(ctx->nctx->nir, &instr->dest.ssa) :
- NULL;
- result = ctx->abi->load_tess_coord(ctx->abi, type, instr->num_components);
+ case nir_intrinsic_load_tess_coord:
+ result = ctx->abi->load_tess_coord(ctx->abi, NULL, 0);
break;
- }
case nir_intrinsic_load_tess_level_outer:
result = ctx->abi->load_tess_level(ctx->abi, VARYING_SLOT_TESS_LEVEL_OUTER);
break;