From c88b309fd5ad77c3fce64993285ebd9eada33d0e Mon Sep 17 00:00:00 2001 From: =?utf8?q?Marek=20Ol=C5=A1=C3=A1k?= Date: Sat, 30 Jul 2016 16:32:32 +0200 Subject: [PATCH] radeonsi: don't set the last parameter component of llvm.AMDGPU.cube MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit LLVM doesn't use it. Reviewed-by: Nicolai Hähnle --- src/gallium/drivers/radeon/radeon_setup_tgsi_llvm.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/gallium/drivers/radeon/radeon_setup_tgsi_llvm.c b/src/gallium/drivers/radeon/radeon_setup_tgsi_llvm.c index e7354dec3d2..d75311ea7e5 100644 --- a/src/gallium/drivers/radeon/radeon_setup_tgsi_llvm.c +++ b/src/gallium/drivers/radeon/radeon_setup_tgsi_llvm.c @@ -902,7 +902,7 @@ static void kil_emit(const struct lp_build_tgsi_action *action, } static LLVMValueRef build_cube_intrinsic(struct gallivm_state *gallivm, - LLVMValueRef in[4]) + LLVMValueRef in[3]) { if (HAVE_LLVM >= 0x0309) { LLVMTypeRef f32 = LLVMTypeOf(in[0]); @@ -919,7 +919,13 @@ static LLVMValueRef build_cube_intrinsic(struct gallivm_state *gallivm, return lp_build_gather_values(gallivm, out, 4); } else { - LLVMValueRef vec = lp_build_gather_values(gallivm, in, 4); + LLVMValueRef c[4] = { + in[0], + in[1], + in[2], + LLVMGetUndef(LLVMTypeOf(in[0])) + }; + LLVMValueRef vec = lp_build_gather_values(gallivm, c, 4); return lp_build_intrinsic(gallivm->builder, "llvm.AMDGPU.cube", LLVMTypeOf(vec), &vec, 1, -- 2.30.2