diff options
author | Qiang Yu <yuq825@gmail.com> | 2023-04-25 20:50:48 +0800 |
---|---|---|
committer | Qiang Yu <yuq825@gmail.com> | 2023-04-28 11:33:28 +0800 |
commit | 360176b671fc7ec30a75eb45557bd2c1fc019fec (patch) | |
tree | 3fb756c71f6c0ef5a2a7704c5b5dd0d43028b093 /src/amd/compiler/aco_interface.cpp | |
parent | 3fc4ddd6283fbe07c9942ffc08c8f909f9468ffc (diff) | |
download | mesa-360176b671fc7ec30a75eb45557bd2c1fc019fec.tar.gz |
aco,radv: support symbol relocation in aco
Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Signed-off-by: Qiang Yu <yuq825@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22727>
Diffstat (limited to 'src/amd/compiler/aco_interface.cpp')
-rw-r--r-- | src/amd/compiler/aco_interface.cpp | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/src/amd/compiler/aco_interface.cpp b/src/amd/compiler/aco_interface.cpp index 41f8b0db75e..f011072289e 100644 --- a/src/amd/compiler/aco_interface.cpp +++ b/src/amd/compiler/aco_interface.cpp @@ -236,7 +236,8 @@ aco_compile_shader(const struct aco_compiler_options* options, /* assembly */ std::vector<uint32_t> code; - unsigned exec_size = aco::emit_program(program.get(), code); + std::vector<struct aco_symbol> symbols; + unsigned exec_size = aco::emit_program(program.get(), code, &symbols); if (program->collect_statistics) aco::collect_postasm_stats(program.get(), code); @@ -252,7 +253,8 @@ aco_compile_shader(const struct aco_compiler_options* options, stats_size = aco_num_statistics * sizeof(uint32_t); (*build_binary)(binary, &config, llvm_ir.c_str(), llvm_ir.size(), disasm.c_str(), disasm.size(), - program->statistics, stats_size, exec_size, code.data(), code.size()); + program->statistics, stats_size, exec_size, code.data(), code.size(), + symbols.data(), symbols.size()); } void @@ -282,7 +284,7 @@ aco_compile_rt_prolog(const struct aco_compiler_options* options, /* assembly */ std::vector<uint32_t> code; code.reserve(align(program->blocks[0].instructions.size() * 2, 16)); - unsigned exec_size = aco::emit_program(program.get(), code); + unsigned exec_size = aco::emit_program(program.get(), code, NULL); bool get_disasm = options->dump_shader || options->record_ir; @@ -291,7 +293,7 @@ aco_compile_rt_prolog(const struct aco_compiler_options* options, disasm = get_disasm_string(program.get(), code, exec_size); (*build_prolog)(binary, &config, NULL, 0, disasm.c_str(), disasm.size(), program->statistics, 0, - exec_size, code.data(), code.size()); + exec_size, code.data(), code.size(), NULL, 0); } void @@ -319,7 +321,7 @@ aco_compile_vs_prolog(const struct aco_compiler_options* options, /* assembly */ std::vector<uint32_t> code; code.reserve(align(program->blocks[0].instructions.size() * 2, 16)); - unsigned exec_size = aco::emit_program(program.get(), code); + unsigned exec_size = aco::emit_program(program.get(), code, NULL); bool get_disasm = options->dump_shader || options->record_ir; @@ -361,7 +363,7 @@ aco_compile_ps_epilog(const struct aco_compiler_options* options, /* assembly */ std::vector<uint32_t> code; - unsigned exec_size = aco::emit_program(program.get(), code); + unsigned exec_size = aco::emit_program(program.get(), code, NULL); bool get_disasm = options->dump_shader || options->record_ir; |