diff options
author | Nicolai Hähnle <nicolai.haehnle@amd.com> | 2017-06-24 20:08:30 +0200 |
---|---|---|
committer | Nicolai Hähnle <nicolai.haehnle@amd.com> | 2017-07-05 12:33:57 +0200 |
commit | 60f75aece52ec175f13ae36cac284570a160f748 (patch) | |
tree | 330bced20432c06bb121dde91e494f7612a19fe2 | |
parent | c48e386042e4cc10cca93fc5e520b667969d2155 (diff) |
radeonsi: make get_indirect_index globally visible
-rw-r--r-- | src/gallium/drivers/radeonsi/si_shader.c | 20 | ||||
-rw-r--r-- | src/gallium/drivers/radeonsi/si_shader_internal.h | 3 |
2 files changed, 13 insertions, 10 deletions
diff --git a/src/gallium/drivers/radeonsi/si_shader.c b/src/gallium/drivers/radeonsi/si_shader.c index 8e16abfe0f..514d7e169b 100644 --- a/src/gallium/drivers/radeonsi/si_shader.c +++ b/src/gallium/drivers/radeonsi/si_shader.c @@ -638,9 +638,9 @@ static LLVMValueRef get_primitive_id(struct si_shader_context *ctx, * Return the value of tgsi_ind_register for indexing. * This is the indirect index with the constant offset added to it. */ -static LLVMValueRef get_indirect_index(struct si_shader_context *ctx, - const struct tgsi_ind_register *ind, - int rel_index) +LLVMValueRef si_get_indirect_index(struct si_shader_context *ctx, + const struct tgsi_ind_register *ind, + int rel_index) { struct gallivm_state *gallivm = &ctx->gallivm; LLVMValueRef result; @@ -653,14 +653,14 @@ static LLVMValueRef get_indirect_index(struct si_shader_context *ctx, } /** - * Like get_indirect_index, but restricts the return value to a (possibly + * Like si_get_indirect_index, but restricts the return value to a (possibly * undefined) value inside [0..num). */ LLVMValueRef si_get_bounded_indirect_index(struct si_shader_context *ctx, const struct tgsi_ind_register *ind, int rel_index, unsigned num) { - LLVMValueRef result = get_indirect_index(ctx, ind, rel_index); + LLVMValueRef result = si_get_indirect_index(ctx, ind, rel_index); return si_llvm_bound_index(ctx, result, num); } @@ -700,7 +700,7 @@ static LLVMValueRef get_dw_address(struct si_shader_context *ctx, LLVMValueRef index; if (reg.Dimension.Indirect) - index = get_indirect_index(ctx, ®.DimIndirect, + index = si_get_indirect_index(ctx, ®.DimIndirect, reg.Dimension.Index); else index = LLVMConstInt(ctx->i32, reg.Dimension.Index, 0); @@ -733,7 +733,7 @@ static LLVMValueRef get_dw_address(struct si_shader_context *ctx, else first = reg.Register.Index; - ind_index = get_indirect_index(ctx, ®.Indirect, + ind_index = si_get_indirect_index(ctx, ®.Indirect, reg.Register.Index - first); base_addr = LLVMBuildAdd(gallivm->builder, base_addr, @@ -836,7 +836,7 @@ static LLVMValueRef get_tcs_tes_buffer_address_from_reg( if (reg.Register.Dimension) { if (reg.Dimension.Indirect) - vertex_index = get_indirect_index(ctx, ®.DimIndirect, + vertex_index = si_get_indirect_index(ctx, ®.DimIndirect, reg.Dimension.Index); else vertex_index = LLVMConstInt(ctx->i32, reg.Dimension.Index, 0); @@ -862,7 +862,7 @@ static LLVMValueRef get_tcs_tes_buffer_address_from_reg( else param_base = reg.Register.Index; - param_index = get_indirect_index(ctx, ®.Indirect, + param_index = si_get_indirect_index(ctx, ®.Indirect, reg.Register.Index - param_base); } else { @@ -3642,7 +3642,7 @@ static void build_interp_intrinsic(const struct lp_build_tgsi_action *action, input_array_size = info->num_inputs - input_base; } - array_idx = get_indirect_index(ctx, &input->Indirect, + array_idx = si_get_indirect_index(ctx, &input->Indirect, input->Register.Index - input_base); } else { input_base = inst->Src[0].Register.Index; diff --git a/src/gallium/drivers/radeonsi/si_shader_internal.h b/src/gallium/drivers/radeonsi/si_shader_internal.h index feaa82da8d..d2eb957ffd 100644 --- a/src/gallium/drivers/radeonsi/si_shader_internal.h +++ b/src/gallium/drivers/radeonsi/si_shader_internal.h @@ -304,6 +304,9 @@ void si_llvm_emit_store(struct lp_build_tgsi_context *bld_base, void si_emit_waitcnt(struct si_shader_context *ctx, unsigned simm16); +LLVMValueRef si_get_indirect_index(struct si_shader_context *ctx, + const struct tgsi_ind_register *ind, + int rel_index); LLVMValueRef si_get_bounded_indirect_index(struct si_shader_context *ctx, const struct tgsi_ind_register *ind, int rel_index, unsigned num); |