mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-04 22:49:13 +02:00
aco: add aco compile interface for radeonsi vs prolog
Radeonsi prolog does not need s_endpgm. 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/24712>
This commit is contained in:
parent
a2ba50aee6
commit
9cce7ce80a
2 changed files with 22 additions and 3 deletions
|
|
@ -348,7 +348,8 @@ static void
|
|||
aco_compile_shader_part(const struct aco_compiler_options* options,
|
||||
const struct aco_shader_info* info, const struct ac_shader_args* args,
|
||||
select_shader_part_callback select_shader_part, void* pinfo,
|
||||
aco_shader_part_callback* build_epilog, void** binary)
|
||||
aco_shader_part_callback* build_binary, void** binary,
|
||||
bool is_prolog = false)
|
||||
{
|
||||
aco::init();
|
||||
|
||||
|
|
@ -369,7 +370,8 @@ aco_compile_shader_part(const struct aco_compiler_options* options,
|
|||
|
||||
/* assembly */
|
||||
std::vector<uint32_t> code;
|
||||
unsigned exec_size = aco::emit_program(program.get(), code);
|
||||
bool append_endpgm = !(options->is_opengl && is_prolog);
|
||||
unsigned exec_size = aco::emit_program(program.get(), code, NULL, append_endpgm);
|
||||
|
||||
bool get_disasm = options->dump_shader || options->record_ir;
|
||||
|
||||
|
|
@ -377,7 +379,7 @@ aco_compile_shader_part(const struct aco_compiler_options* options,
|
|||
if (get_disasm)
|
||||
disasm = get_disasm_string(program.get(), code, exec_size);
|
||||
|
||||
(*build_epilog)(binary, config.num_sgprs, config.num_vgprs, code.data(), code.size(),
|
||||
(*build_binary)(binary, config.num_sgprs, config.num_vgprs, code.data(), code.size(),
|
||||
disasm.data(), disasm.size());
|
||||
}
|
||||
|
||||
|
|
@ -400,3 +402,14 @@ aco_compile_tcs_epilog(const struct aco_compiler_options* options,
|
|||
aco_compile_shader_part(options, info, args, aco::select_tcs_epilog, (void*)pinfo, build_epilog,
|
||||
binary);
|
||||
}
|
||||
|
||||
void
|
||||
aco_compile_gl_vs_prolog(const struct aco_compiler_options* options,
|
||||
const struct aco_shader_info* info,
|
||||
const struct aco_gl_vs_prolog_info* pinfo,
|
||||
const struct ac_shader_args* args, aco_shader_part_callback* build_prolog,
|
||||
void** binary)
|
||||
{
|
||||
aco_compile_shader_part(options, info, args, aco::select_gl_vs_prolog, (void*)pinfo,
|
||||
build_prolog, binary, true);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -83,6 +83,12 @@ void aco_compile_tcs_epilog(const struct aco_compiler_options* options,
|
|||
const struct ac_shader_args* args,
|
||||
aco_shader_part_callback* build_epilog, void** binary);
|
||||
|
||||
void aco_compile_gl_vs_prolog(const struct aco_compiler_options* options,
|
||||
const struct aco_shader_info* info,
|
||||
const struct aco_gl_vs_prolog_info* pinfo,
|
||||
const struct ac_shader_args* args,
|
||||
aco_shader_part_callback* build_prolog, void** binary);
|
||||
|
||||
uint64_t aco_get_codegen_flags();
|
||||
|
||||
#ifdef __cplusplus
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue