From dfbb8ea2845de0524ca7022f1b76d1dc2509a296 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Nicolai=20H=C3=A4hnle?= Date: Mon, 8 Aug 2016 22:50:05 +0200 Subject: [PATCH] gallium/radeon: pass indirect register info into get_alloca_for_array MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit To have the same signature as get_array_range. Reviewed-by: Marek Olšák --- src/gallium/drivers/radeon/radeon_setup_tgsi_llvm.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/src/gallium/drivers/radeon/radeon_setup_tgsi_llvm.c b/src/gallium/drivers/radeon/radeon_setup_tgsi_llvm.c index 994c7da0627..531a8fefc7e 100644 --- a/src/gallium/drivers/radeon/radeon_setup_tgsi_llvm.c +++ b/src/gallium/drivers/radeon/radeon_setup_tgsi_llvm.c @@ -158,14 +158,15 @@ get_array_range(struct lp_build_tgsi_context *bld_base, static LLVMValueRef get_alloca_for_array(struct lp_build_tgsi_context *bld_base, unsigned file, - unsigned index) + unsigned index, + const struct tgsi_ind_register *reg) { const struct radeon_llvm_array *array; if (file != TGSI_FILE_TEMPORARY) return NULL; - array = get_temp_array(bld_base, index, NULL); + array = get_temp_array(bld_base, index, reg); if (!array) return NULL; @@ -247,7 +248,7 @@ load_value_from_array(struct lp_build_tgsi_context *bld_base, LLVMBuilderRef builder = gallivm->builder; struct tgsi_declaration_range range = get_array_range(bld_base, file, reg_index, reg_indirect); LLVMValueRef index = emit_array_index(bld, reg_indirect, reg_index - range.First); - LLVMValueRef array = get_alloca_for_array(bld_base, file, reg_index); + LLVMValueRef array = get_alloca_for_array(bld_base, file, reg_index, reg_indirect); LLVMValueRef ptr, val, indices[2]; if (!array) { @@ -287,7 +288,7 @@ store_value_to_array(struct lp_build_tgsi_context *bld_base, LLVMBuilderRef builder = gallivm->builder; struct tgsi_declaration_range range = get_array_range(bld_base, file, reg_index, reg_indirect); LLVMValueRef index = emit_array_index(bld, reg_indirect, reg_index - range.First); - LLVMValueRef array = get_alloca_for_array(bld_base, file, reg_index); + LLVMValueRef array = get_alloca_for_array(bld_base, file, reg_index, reg_indirect); if (array) { LLVMValueRef indices[2]; @@ -624,7 +625,7 @@ void radeon_llvm_emit_store(struct lp_build_tgsi_context *bld_base, unsigned reg_index = reg->Register.Index; LLVMValueRef array = store_value_to_array(bld_base, value, file, chan_index, reg_index, ®->Indirect); - if (get_alloca_for_array(bld_base, file, reg_index)) { + if (get_alloca_for_array(bld_base, file, reg_index, ®->Indirect)) { continue; } for (i = 0; i < size; ++i) { -- 2.30.2