ac: remove nir_to_llvm_context from ac_nir_translate()
authorSamuel Pitoiset <samuel.pitoiset@gmail.com>
Mon, 12 Feb 2018 11:31:59 +0000 (12:31 +0100)
committerSamuel Pitoiset <samuel.pitoiset@gmail.com>
Wed, 14 Feb 2018 10:53:14 +0000 (11:53 +0100)
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
src/amd/common/ac_nir_to_llvm.c
src/amd/common/ac_nir_to_llvm.h
src/gallium/drivers/radeonsi/si_shader_nir.c

index 1001c80dc6c29566771c05f1e3961ba5fe8430c0..4767b869510aa5ef35526b3e1e76e3e38fa432b1 100644 (file)
@@ -6744,7 +6744,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;
@@ -6924,7 +6924,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);
index 8c925141a09b2f118324b4acbeceb06683c0bc73..07cf9656f59a5cfeef121190a566877b28c59f78 100644 (file)
@@ -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 */
index f46e5c6aac41a135562675148463ca4cd2cbbbb8..ba4a66fabbc7528ce41055e955da69910e1b81d3 100644 (file)
@@ -861,7 +861,7 @@ bool si_nir_build_llvm(struct si_shader_context *ctx, struct nir_shader *nir)
                assert(nir->info.stage == MESA_SHADER_COMPUTE);
                si_declare_compute_memory(ctx);
        }
-       ac_nir_translate(&ctx->ac, &ctx->abi, nir, NULL);
+       ac_nir_translate(&ctx->ac, &ctx->abi, nir);
 
        return true;
 }