Mesa (master): ac/nir: make handle_shader_output_decl() non-static

Samuel Pitoiset hakzsam at kemper.freedesktop.org
Tue Mar 13 13:05:26 UTC 2018


Module: Mesa
Branch: master
Commit: 3a30b89353674650071c0dd6cd3bcde9d4d785ae
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=3a30b89353674650071c0dd6cd3bcde9d4d785ae

Author: Samuel Pitoiset <samuel.pitoiset at gmail.com>
Date:   Fri Mar  9 16:53:06 2018 +0100

ac/nir: make handle_shader_output_decl() non-static

Required in order to move all RADV specific code outside of ac/nir.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset at gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas at basnieuwenhuizen.nl>

---

 src/amd/common/ac_nir_to_llvm.c | 20 ++++++++++----------
 src/amd/common/ac_nir_to_llvm.h |  8 ++++++++
 2 files changed, 18 insertions(+), 10 deletions(-)

diff --git a/src/amd/common/ac_nir_to_llvm.c b/src/amd/common/ac_nir_to_llvm.c
index 9d791e6221..93cf2bdafa 100644
--- a/src/amd/common/ac_nir_to_llvm.c
+++ b/src/amd/common/ac_nir_to_llvm.c
@@ -5634,12 +5634,12 @@ scan_shader_output_decl(struct radv_shader_context *ctx,
 	ctx->output_mask |= mask_attribs;
 }
 
-static void
-handle_shader_output_decl(struct ac_llvm_context *ctx,
-			  struct ac_shader_abi *abi,
-			  struct nir_shader *nir,
-			  struct nir_variable *variable,
-			  gl_shader_stage stage)
+void
+ac_handle_shader_output_decl(struct ac_llvm_context *ctx,
+			     struct ac_shader_abi *abi,
+			     struct nir_shader *nir,
+			     struct nir_variable *variable,
+			     gl_shader_stage stage)
 {
 	unsigned output_loc = variable->data.driver_location / 4;
 	unsigned attrib_count = glsl_count_attribute_slots(variable->type, false);
@@ -6754,8 +6754,8 @@ void ac_nir_translate(struct ac_llvm_context *ac, struct ac_shader_abi *abi,
 	ctx.main_function = LLVMGetBasicBlockParent(LLVMGetInsertBlock(ctx.ac.builder));
 
 	nir_foreach_variable(variable, &nir->outputs)
-		handle_shader_output_decl(&ctx.ac, ctx.abi, nir, variable,
-					  ctx.stage);
+		ac_handle_shader_output_decl(&ctx.ac, ctx.abi, nir, variable,
+					     ctx.stage);
 
 	ctx.defs = _mesa_hash_table_create(NULL, _mesa_hash_pointer,
 	                                   _mesa_key_pointer_equal);
@@ -7250,8 +7250,8 @@ void ac_create_gs_copy_shader(LLVMTargetMachineRef tm,
 
 	nir_foreach_variable(variable, &geom_shader->outputs) {
 		scan_shader_output_decl(&ctx, variable, geom_shader, MESA_SHADER_VERTEX);
-		handle_shader_output_decl(&ctx.ac, &ctx.abi, geom_shader,
-					  variable, MESA_SHADER_VERTEX);
+		ac_handle_shader_output_decl(&ctx.ac, &ctx.abi, geom_shader,
+					     variable, MESA_SHADER_VERTEX);
 	}
 
 	ac_gs_copy_shader_emit(&ctx);
diff --git a/src/amd/common/ac_nir_to_llvm.h b/src/amd/common/ac_nir_to_llvm.h
index 983189eb93..7b64ad54fc 100644
--- a/src/amd/common/ac_nir_to_llvm.h
+++ b/src/amd/common/ac_nir_to_llvm.h
@@ -34,6 +34,7 @@
 struct ac_shader_binary;
 struct ac_shader_config;
 struct nir_shader;
+struct nir_variable;
 struct radv_pipeline_layout;
 
 struct ac_llvm_context;
@@ -235,6 +236,13 @@ void ac_lower_indirect_derefs(struct nir_shader *nir, enum chip_class);
 void ac_nir_translate(struct ac_llvm_context *ac, struct ac_shader_abi *abi,
 		      struct nir_shader *nir);
 
+void
+ac_handle_shader_output_decl(struct ac_llvm_context *ctx,
+			     struct ac_shader_abi *abi,
+			     struct nir_shader *nir,
+			     struct nir_variable *variable,
+			     gl_shader_stage stage);
+
 bool ac_lower_subgroups(struct nir_shader *shader);
 
 #endif /* AC_NIR_TO_LLVM_H */




More information about the mesa-commit mailing list