[Mesa-dev] [PATCH 3/4] ac: remove nir_to_llvm_context from ac_nir_translate()

Samuel Pitoiset samuel.pitoiset at gmail.com
Mon Feb 12 11:57:32 UTC 2018


Signed-off-by: Samuel Pitoiset <samuel.pitoiset at gmail.com>
---
 src/amd/common/ac_nir_to_llvm.c              | 4 ++--
 src/amd/common/ac_nir_to_llvm.h              | 3 +--
 src/gallium/drivers/radeonsi/si_shader_nir.c | 2 +-
 3 files changed, 4 insertions(+), 5 deletions(-)

diff --git a/src/amd/common/ac_nir_to_llvm.c b/src/amd/common/ac_nir_to_llvm.c
index 8e0da8ab23..fea38596cb 100644
--- a/src/amd/common/ac_nir_to_llvm.c
+++ b/src/amd/common/ac_nir_to_llvm.c
@@ -6663,7 +6663,7 @@ static void prepare_gs_input_vgprs(struct nir_to_llvm_context *ctx)
 }
 
 void ac_nir_translate(struct ac_llvm_context *ac, struct ac_shader_abi *abi,
-		      struct nir_shader *nir, struct nir_to_llvm_context *nctx)
+		      struct nir_shader *nir)
 {
 	struct ac_nir_context ctx = {};
 	struct nir_function *func;
@@ -6843,7 +6843,7 @@ LLVMModuleRef ac_translate_nir_to_llvm(LLVMTargetMachineRef tm,
 		nir_foreach_variable(variable, &shaders[i]->outputs)
 			scan_shader_output_decl(&ctx, variable, shaders[i], shaders[i]->info.stage);
 
-		ac_nir_translate(&ctx.ac, &ctx.abi, shaders[i], &ctx);
+		ac_nir_translate(&ctx.ac, &ctx.abi, shaders[i]);
 
 		if (shader_count >= 2) {
 			LLVMBuildBr(ctx.ac.builder, merge_block);
diff --git a/src/amd/common/ac_nir_to_llvm.h b/src/amd/common/ac_nir_to_llvm.h
index 8c925141a0..07cf9656f5 100644
--- a/src/amd/common/ac_nir_to_llvm.h
+++ b/src/amd/common/ac_nir_to_llvm.h
@@ -232,8 +232,7 @@ void ac_create_gs_copy_shader(LLVMTargetMachineRef tm,
 			      const struct ac_nir_compiler_options *options,
 			      bool dump_shader);
 
-struct nir_to_llvm_context;
 void ac_nir_translate(struct ac_llvm_context *ac, struct ac_shader_abi *abi,
-		      struct nir_shader *nir, struct nir_to_llvm_context *nctx);
+		      struct nir_shader *nir);
 
 #endif /* AC_NIR_TO_LLVM_H */
diff --git a/src/gallium/drivers/radeonsi/si_shader_nir.c b/src/gallium/drivers/radeonsi/si_shader_nir.c
index f467ce282a..9751610c63 100644
--- a/src/gallium/drivers/radeonsi/si_shader_nir.c
+++ b/src/gallium/drivers/radeonsi/si_shader_nir.c
@@ -857,7 +857,7 @@ bool si_nir_build_llvm(struct si_shader_context *ctx, struct nir_shader *nir)
 	ctx->num_samplers = util_last_bit(info->samplers_declared);
 	ctx->num_images = util_last_bit(info->images_declared);
 
-	ac_nir_translate(&ctx->ac, &ctx->abi, nir, NULL);
+	ac_nir_translate(&ctx->ac, &ctx->abi, nir);
 
 	return true;
 }
-- 
2.16.1



More information about the mesa-dev mailing list