aco, radv: Move is_trap_handler_shader to aco info.
v2 by Timur Kristóf: - Rebase this patch on latest main. Signed-off-by: Qiang Yu <yuq825@gmail.com> Reviewed-by: Timur Kristóf <timur.kristof@gmail.com> Reviewed-by: Daniel Schürmann <daniel@schuermann.dev> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21696>
This commit is contained in:
@@ -113,7 +113,7 @@ get_disasm_string(aco::Program* program, std::vector<uint32_t>& code,
|
||||
|
||||
static std::string
|
||||
aco_postprocess_shader(const struct aco_compiler_options* options,
|
||||
const struct radv_shader_args *args,
|
||||
const struct aco_shader_info *info,
|
||||
std::unique_ptr<aco::Program>& program)
|
||||
{
|
||||
std::string llvm_ir;
|
||||
@@ -122,7 +122,7 @@ aco_postprocess_shader(const struct aco_compiler_options* options,
|
||||
aco_print_program(program.get(), stderr);
|
||||
|
||||
aco::live live_vars;
|
||||
if (!args->is_trap_handler_shader) {
|
||||
if (!info->is_trap_handler_shader) {
|
||||
/* Phi lowering */
|
||||
aco::lower_phis(program.get());
|
||||
aco::dominator_tree(program.get());
|
||||
@@ -167,7 +167,7 @@ aco_postprocess_shader(const struct aco_compiler_options* options,
|
||||
if ((aco::debug_flags & aco::DEBUG_LIVE_INFO) && options->dump_shader)
|
||||
aco_print_program(program.get(), stderr, live_vars, aco::print_live_vars | aco::print_kill);
|
||||
|
||||
if (!args->is_trap_handler_shader) {
|
||||
if (!info->is_trap_handler_shader) {
|
||||
if (!options->key.optimisations_disabled && !(aco::debug_flags & aco::DEBUG_NO_SCHED))
|
||||
aco::schedule_program(program.get(), live_vars);
|
||||
validate(program.get());
|
||||
@@ -230,12 +230,12 @@ aco_compile_shader(const struct aco_compiler_options* options,
|
||||
program->debug.private_data = options->debug.private_data;
|
||||
|
||||
/* Instruction Selection */
|
||||
if (args->is_trap_handler_shader)
|
||||
if (info->is_trap_handler_shader)
|
||||
aco::select_trap_handler_shader(program.get(), shaders[0], &config, options, info, args);
|
||||
else
|
||||
aco::select_program(program.get(), shader_count, shaders, &config, options, info, args);
|
||||
|
||||
std::string llvm_ir = aco_postprocess_shader(options, args, program);
|
||||
std::string llvm_ir = aco_postprocess_shader(options, info, program);
|
||||
|
||||
/* assembly */
|
||||
std::vector<uint32_t> code;
|
||||
@@ -337,7 +337,7 @@ aco_compile_ps_epilog(const struct aco_compiler_options* options,
|
||||
/* Instruction selection */
|
||||
aco::select_ps_epilog(program.get(), key, &config, options, info, args);
|
||||
|
||||
aco_postprocess_shader(options, args, program);
|
||||
aco_postprocess_shader(options, info, program);
|
||||
|
||||
/* assembly */
|
||||
std::vector<uint32_t> code;
|
||||
|
||||
@@ -121,6 +121,9 @@ struct aco_shader_info {
|
||||
} cs;
|
||||
|
||||
uint32_t gfx9_gs_ring_lds_size;
|
||||
|
||||
bool is_gs_copy_shader;
|
||||
bool is_trap_handler_shader;
|
||||
};
|
||||
|
||||
enum aco_compiler_debug_level {
|
||||
|
||||
@@ -57,7 +57,8 @@ radv_aco_convert_shader_vp_info(struct aco_vp_output_info *aco_info,
|
||||
|
||||
static inline void
|
||||
radv_aco_convert_shader_info(struct aco_shader_info *aco_info,
|
||||
const struct radv_shader_info *radv)
|
||||
const struct radv_shader_info *radv,
|
||||
const struct radv_shader_args *radv_args)
|
||||
{
|
||||
ASSIGN_FIELD(wave_size);
|
||||
ASSIGN_FIELD(is_ngg);
|
||||
@@ -89,6 +90,7 @@ radv_aco_convert_shader_info(struct aco_shader_info *aco_info,
|
||||
ASSIGN_FIELD(cs.subgroup_size);
|
||||
ASSIGN_FIELD(cs.uses_full_subgroups);
|
||||
aco_info->gfx9_gs_ring_lds_size = radv->gs_ring_info.lds_size;
|
||||
aco_info->is_trap_handler_shader = radv_args->is_trap_handler_shader;
|
||||
}
|
||||
|
||||
#define ASSIGN_VS_STATE_FIELD(x) aco_info->state.x = radv->state->x
|
||||
|
||||
@@ -2388,7 +2388,7 @@ shader_compile(struct radv_device *device, struct nir_shader *const *shaders, in
|
||||
struct aco_shader_info ac_info;
|
||||
struct aco_compiler_options ac_opts;
|
||||
radv_aco_convert_opts(&ac_opts, &options, args);
|
||||
radv_aco_convert_shader_info(&ac_info, info);
|
||||
radv_aco_convert_shader_info(&ac_info, info, args);
|
||||
aco_compile_shader(&ac_opts, &ac_info, shader_count, shaders, args, &radv_aco_build_shader_binary, (void **)&binary);
|
||||
}
|
||||
|
||||
@@ -2542,7 +2542,7 @@ radv_create_vs_prolog(struct radv_device *device, const struct radv_vs_prolog_ke
|
||||
struct aco_shader_info ac_info;
|
||||
struct aco_vs_prolog_key ac_key;
|
||||
struct aco_compiler_options ac_opts;
|
||||
radv_aco_convert_shader_info(&ac_info, &info);
|
||||
radv_aco_convert_shader_info(&ac_info, &info, &args);
|
||||
radv_aco_convert_opts(&ac_opts, &options, &args);
|
||||
radv_aco_convert_vs_prolog_key(&ac_key, key);
|
||||
aco_compile_vs_prolog(&ac_opts, &ac_info, &ac_key, &args, &radv_aco_build_shader_part,
|
||||
@@ -2607,7 +2607,7 @@ radv_create_ps_epilog(struct radv_device *device, const struct radv_ps_epilog_ke
|
||||
struct aco_shader_info ac_info;
|
||||
struct aco_ps_epilog_key ac_key;
|
||||
struct aco_compiler_options ac_opts;
|
||||
radv_aco_convert_shader_info(&ac_info, &info);
|
||||
radv_aco_convert_shader_info(&ac_info, &info, &args);
|
||||
radv_aco_convert_opts(&ac_opts, &options, &args);
|
||||
radv_aco_convert_ps_epilog_key(&ac_key, key);
|
||||
aco_compile_ps_epilog(&ac_opts, &ac_info, &ac_key, &args, &radv_aco_build_shader_part,
|
||||
|
||||
Reference in New Issue
Block a user