From b45c54ff8d21b9e9dcfee7980b1837350be27708 Mon Sep 17 00:00:00 2001 From: Connor Abbott Date: Mon, 11 Nov 2019 18:27:25 +0100 Subject: [PATCH] aco: Use radv_shader_args in aco_compile_shader() MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Reviewed-by: Daniel Schürmann --- src/amd/compiler/aco_interface.cpp | 21 +++++++++++---------- src/amd/compiler/aco_interface.h | 3 +-- src/amd/vulkan/radv_shader.c | 2 +- 3 files changed, 13 insertions(+), 13 deletions(-) diff --git a/src/amd/compiler/aco_interface.cpp b/src/amd/compiler/aco_interface.cpp index ad18101eb8e..fe22b964725 100644 --- a/src/amd/compiler/aco_interface.cpp +++ b/src/amd/compiler/aco_interface.cpp @@ -24,6 +24,7 @@ #include "aco_interface.h" #include "aco_ir.h" #include "vulkan/radv_shader.h" +#include "vulkan/radv_shader_args.h" #include "c11/threads.h" #include "util/debug.h" @@ -56,8 +57,7 @@ static void init() void aco_compile_shader(unsigned shader_count, struct nir_shader *const *shaders, struct radv_shader_binary **binary, - struct radv_shader_info *info, - struct radv_nir_compiler_options *options) + struct radv_shader_args *args) { call_once(&aco::init_once_flag, aco::init); @@ -65,8 +65,9 @@ void aco_compile_shader(unsigned shader_count, std::unique_ptr program{new aco::Program}; /* Instruction Selection */ - aco::select_program(program.get(), shader_count, shaders, &config, info, options); - if (options->dump_preoptir) { + aco::select_program(program.get(), shader_count, shaders, &config, + args->shader_info, args->options); + if (args->options->dump_preoptir) { std::cerr << "After Instruction Selection:\n"; aco_print_program(program.get(), stderr); } @@ -88,15 +89,15 @@ void aco_compile_shader(unsigned shader_count, aco::insert_exec_mask(program.get()); aco::validate(program.get(), stderr); - aco::live live_vars = aco::live_var_analysis(program.get(), options); - aco::spill(program.get(), live_vars, options); + aco::live live_vars = aco::live_var_analysis(program.get(), args->options); + aco::spill(program.get(), live_vars, args->options); //std::cerr << "Before Schedule:\n"; //aco_print_program(program.get(), stderr); aco::schedule_program(program.get(), live_vars); std::string llvm_ir; - if (options->record_ir) { + if (args->options->record_ir) { char *data = NULL; size_t size = 0; FILE *f = open_memstream(&data, &size); @@ -112,12 +113,12 @@ void aco_compile_shader(unsigned shader_count, /* Register Allocation */ aco::register_allocation(program.get(), live_vars.live_out); - if (options->dump_shader) { + if (args->options->dump_shader) { std::cerr << "After RA:\n"; aco_print_program(program.get(), stderr); } - if (aco::validate_ra(program.get(), options, stderr)) { + if (aco::validate_ra(program.get(), args->options, stderr)) { std::cerr << "Program after RA validation failure:\n"; aco_print_program(program.get(), stderr); abort(); @@ -140,7 +141,7 @@ void aco_compile_shader(unsigned shader_count, std::vector code; unsigned exec_size = aco::emit_program(program.get(), code); - bool get_disasm = options->dump_shader || options->record_ir; + bool get_disasm = args->options->dump_shader || args->options->record_ir; size_t size = llvm_ir.size(); diff --git a/src/amd/compiler/aco_interface.h b/src/amd/compiler/aco_interface.h index 1425a0997a0..12139378feb 100644 --- a/src/amd/compiler/aco_interface.h +++ b/src/amd/compiler/aco_interface.h @@ -35,8 +35,7 @@ struct ac_shader_config; void aco_compile_shader(unsigned shader_count, struct nir_shader *const *shaders, struct radv_shader_binary** binary, - struct radv_shader_info *info, - struct radv_nir_compiler_options *options); + struct radv_shader_args *args); #ifdef __cplusplus } diff --git a/src/amd/vulkan/radv_shader.c b/src/amd/vulkan/radv_shader.c index 8ba83ff77c7..81526c7eca0 100644 --- a/src/amd/vulkan/radv_shader.c +++ b/src/amd/vulkan/radv_shader.c @@ -1111,7 +1111,7 @@ shader_variant_compile(struct radv_device *device, ac_init_llvm_once(); if (use_aco) { - aco_compile_shader(shader_count, shaders, &binary, info, options); + aco_compile_shader(shader_count, shaders, &binary, &args); binary->info = *info; } else { enum ac_target_machine_options tm_options = 0; -- 2.30.2