[16/26] radeonsi: make functions for creating LLVM functions non-static

Submitted by Marek Olšák on Feb. 13, 2019, 5:16 a.m.

Details

Message ID 20190213051621.6235-17-maraeo@gmail.com
State Accepted
Commit 43aa2f4f7c3736a200349af254bc8e9ec1a0bf2f
Headers show
Series "RadeonSI: Primitive culling with async compute" ( rev: 1 ) in Mesa

Not browsing as part of any series.

Commit Message

Marek Olšák Feb. 13, 2019, 5:16 a.m.
From: Marek Olšák <marek.olsak@amd.com>

---
 src/gallium/drivers/radeonsi/si_shader.c      | 30 +++++--------------
 .../drivers/radeonsi/si_shader_internal.h     | 25 ++++++++++++++++
 2 files changed, 32 insertions(+), 23 deletions(-)

Patch hide | download patch | download mbox

diff --git a/src/gallium/drivers/radeonsi/si_shader.c b/src/gallium/drivers/radeonsi/si_shader.c
index b376a14a2fc..6e3019a9f6c 100644
--- a/src/gallium/drivers/radeonsi/si_shader.c
+++ b/src/gallium/drivers/radeonsi/si_shader.c
@@ -51,22 +51,6 @@  struct si_shader_output_values
 	ubyte vertex_stream[4];
 };
 
-/**
- * Used to collect types and other info about arguments of the LLVM function
- * before the function is created.
- */
-struct si_function_info {
-	LLVMTypeRef types[100];
-	LLVMValueRef *assign[100];
-	unsigned num_sgpr_params;
-	unsigned num_params;
-};
-
-enum si_arg_regfile {
-	ARG_SGPR,
-	ARG_VGPR
-};
-
 static void si_init_shader_ctx(struct si_shader_context *ctx,
 			       struct si_screen *sscreen,
 			       struct ac_llvm_compiler *compiler);
@@ -114,13 +98,13 @@  static bool is_merged_shader(struct si_shader_context *ctx)
 	       ctx->type == PIPE_SHADER_GEOMETRY;
 }
 
-static void si_init_function_info(struct si_function_info *fninfo)
+void si_init_function_info(struct si_function_info *fninfo)
 {
 	fninfo->num_params = 0;
 	fninfo->num_sgpr_params = 0;
 }
 
-static unsigned add_arg_assign(struct si_function_info *fninfo,
+unsigned add_arg_assign(struct si_function_info *fninfo,
 			enum si_arg_regfile regfile, LLVMTypeRef type,
 			LLVMValueRef *assign)
 {
@@ -4352,11 +4336,11 @@  static void si_llvm_emit_barrier(const struct lp_build_tgsi_action *action,
 	ac_build_s_barrier(&ctx->ac);
 }
 
-static void si_create_function(struct si_shader_context *ctx,
-			       const char *name,
-			       LLVMTypeRef *returns, unsigned num_returns,
-			       struct si_function_info *fninfo,
-			       unsigned max_workgroup_size)
+void si_create_function(struct si_shader_context *ctx,
+			const char *name,
+			LLVMTypeRef *returns, unsigned num_returns,
+			struct si_function_info *fninfo,
+			unsigned max_workgroup_size)
 {
 	int i;
 
diff --git a/src/gallium/drivers/radeonsi/si_shader_internal.h b/src/gallium/drivers/radeonsi/si_shader_internal.h
index 235c46ecf92..6e21bc7c26b 100644
--- a/src/gallium/drivers/radeonsi/si_shader_internal.h
+++ b/src/gallium/drivers/radeonsi/si_shader_internal.h
@@ -45,6 +45,22 @@  struct ac_shader_binary;
 #define RADEON_LLVM_MAX_SYSTEM_VALUES 11
 #define RADEON_LLVM_MAX_ADDRS 16
 
+enum si_arg_regfile {
+	ARG_SGPR,
+	ARG_VGPR
+};
+
+/**
+ * Used to collect types and other info about arguments of the LLVM function
+ * before the function is created.
+ */
+struct si_function_info {
+	LLVMTypeRef types[100];
+	LLVMValueRef *assign[100];
+	unsigned num_sgpr_params;
+	unsigned num_params;
+};
+
 struct si_shader_context {
 	struct lp_build_tgsi_context bld_base;
 	struct gallivm_state gallivm;
@@ -218,6 +234,15 @@  si_shader_context_from_abi(struct ac_shader_abi *abi)
 	return container_of(abi, ctx, abi);
 }
 
+void si_init_function_info(struct si_function_info *fninfo);
+unsigned add_arg_assign(struct si_function_info *fninfo,
+			enum si_arg_regfile regfile, LLVMTypeRef type,
+			LLVMValueRef *assign);
+void si_create_function(struct si_shader_context *ctx,
+			const char *name,
+			LLVMTypeRef *returns, unsigned num_returns,
+			struct si_function_info *fninfo,
+			unsigned max_workgroup_size);
 unsigned si_llvm_compile(LLVMModuleRef M, struct ac_shader_binary *binary,
 			 struct ac_llvm_compiler *compiler,
 			 struct pipe_debug_callback *debug,