summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNicolai Hähnle <nicolai.haehnle@amd.com>2017-06-24 20:08:30 +0200
committerNicolai Hähnle <nicolai.haehnle@amd.com>2017-06-26 15:37:08 +0200
commita7baded2e928e156b7bf7830cceae766edd1b560 (patch)
tree20766354fac81f9809ed5ba52c17154e55107382
parenta6b8c347737f703fe5af0e80c8dad9caf16087af (diff)
radeonsi: make get_indirect_index globally visible
-rw-r--r--src/gallium/drivers/radeonsi/si_shader.c20
-rw-r--r--src/gallium/drivers/radeonsi/si_shader_internal.h3
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 24f1cd5488..6d0598bcc0 100644
--- a/src/gallium/drivers/radeonsi/si_shader.c
+++ b/src/gallium/drivers/radeonsi/si_shader.c
@@ -587,9 +587,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;
@@ -602,14 +602,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);
}
@@ -649,7 +649,7 @@ static LLVMValueRef get_dw_address(struct si_shader_context *ctx,
LLVMValueRef index;
if (reg.Dimension.Indirect)
- index = get_indirect_index(ctx, &reg.DimIndirect,
+ index = si_get_indirect_index(ctx, &reg.DimIndirect,
reg.Dimension.Index);
else
index = LLVMConstInt(ctx->i32, reg.Dimension.Index, 0);
@@ -682,7 +682,7 @@ static LLVMValueRef get_dw_address(struct si_shader_context *ctx,
else
first = reg.Register.Index;
- ind_index = get_indirect_index(ctx, &reg.Indirect,
+ ind_index = si_get_indirect_index(ctx, &reg.Indirect,
reg.Register.Index - first);
base_addr = LLVMBuildAdd(gallivm->builder, base_addr,
@@ -785,7 +785,7 @@ static LLVMValueRef get_tcs_tes_buffer_address_from_reg(
if (reg.Register.Dimension) {
if (reg.Dimension.Indirect)
- vertex_index = get_indirect_index(ctx, &reg.DimIndirect,
+ vertex_index = si_get_indirect_index(ctx, &reg.DimIndirect,
reg.Dimension.Index);
else
vertex_index = LLVMConstInt(ctx->i32, reg.Dimension.Index, 0);
@@ -811,7 +811,7 @@ static LLVMValueRef get_tcs_tes_buffer_address_from_reg(
else
param_base = reg.Register.Index;
- param_index = get_indirect_index(ctx, &reg.Indirect,
+ param_index = si_get_indirect_index(ctx, &reg.Indirect,
reg.Register.Index - param_base);
} else {
@@ -3597,7 +3597,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);