}
void
-select_ps_epilog(Program* program, const struct aco_ps_epilog_info* einfo, ac_shader_config* config,
+select_ps_epilog(Program* program, void* pinfo, ac_shader_config* config,
const struct aco_compiler_options* options, const struct aco_shader_info* info,
const struct ac_shader_args* args)
{
+ const struct aco_ps_epilog_info* einfo = (const struct aco_ps_epilog_info*)pinfo;
isel_context ctx = setup_isel_context(program, 0, NULL, config, options, info, args, true);
ctx.block->fp_mode = program->next_fp_mode;
disasm.data(), disasm.size());
}
-void
-aco_compile_ps_epilog(const struct aco_compiler_options* options,
- const struct aco_shader_info* info, const struct aco_ps_epilog_info* pinfo,
- const struct ac_shader_args* args, aco_shader_part_callback* build_epilog,
- void** binary)
+typedef void(select_shader_part_callback)(aco::Program* program, void* pinfo,
+ ac_shader_config* config,
+ const struct aco_compiler_options* options,
+ const struct aco_shader_info* info,
+ const struct ac_shader_args* args);
+
+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::init();
program->debug.private_data = options->debug.private_data;
/* Instruction selection */
- aco::select_ps_epilog(program.get(), pinfo, &config, options, info, args);
+ select_shader_part(program.get(), pinfo, &config, options, info, args);
aco_postprocess_shader(options, info, program);
(*build_epilog)(binary, config.num_sgprs, config.num_vgprs, code.data(), code.size(),
disasm.data(), disasm.size());
}
+
+void
+aco_compile_ps_epilog(const struct aco_compiler_options* options,
+ const struct aco_shader_info* info, const struct aco_ps_epilog_info* pinfo,
+ const struct ac_shader_args* args, aco_shader_part_callback* build_epilog,
+ void** binary)
+{
+ aco_compile_shader_part(options, info, args, aco::select_ps_epilog, (void*)pinfo, build_epilog,
+ binary);
+}
ac_shader_config* config, const struct aco_compiler_options* options,
const struct aco_shader_info* info, const struct ac_shader_args* args);
-void select_ps_epilog(Program* program, const struct aco_ps_epilog_info* epilog_info,
- ac_shader_config* config, const struct aco_compiler_options* options,
+void select_ps_epilog(Program* program, void* pinfo, ac_shader_config* config,
+ const struct aco_compiler_options* options,
const struct aco_shader_info* info, const struct ac_shader_args* args);
void lower_phis(Program* program);