radv: remove radv_nir_compiler_options::info

Passing radeon_info is bad.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/40375>
This commit is contained in:
Samuel Pitoiset 2026-03-12 17:38:20 +01:00 committed by Marge Bot
parent c8499885cb
commit 1f20feacaa
4 changed files with 23 additions and 18 deletions

View file

@ -124,12 +124,12 @@ radv_aco_convert_opts(struct aco_compiler_options *aco_info, const struct radv_n
ASSIGN_FIELD(wgp_mode);
ASSIGN_FIELD(debug.func);
ASSIGN_FIELD(debug.private_data);
aco_info->compiler_info = &radv->info->compiler_info;
aco_info->compiler_info = radv->compiler_info;
aco_info->is_opengl = false;
aco_info->optimisations_disabled = stage_key->optimisations_disabled;
aco_info->gfx_level = radv->info->gfx_level;
aco_info->family = radv->info->family;
aco_info->address32_hi = radv->info->address32_hi;
aco_info->gfx_level = radv->gfx_level;
aco_info->family = radv->family;
aco_info->address32_hi = radv->address32_hi;
}
#undef ASSIGN_VS_STATE_FIELD
#undef ASSIGN_VS_STATE_FIELD_CP

View file

@ -51,9 +51,9 @@ create_llvm_function(struct ac_llvm_context *ctx, LLVMModuleRef module, LLVMBuil
{
struct ac_llvm_pointer main_function = ac_build_main(args, ctx, convention, "main", ctx->voidt, module);
if (options->info->address32_hi) {
if (options->address32_hi) {
ac_llvm_add_target_dep_function_attr(main_function.value, "amdgpu-32bit-address-high-bits",
options->info->address32_hi);
options->address32_hi);
}
ac_llvm_set_workgroup_size(main_function.value, max_workgroup_size);
@ -206,8 +206,8 @@ ac_translate_nir_to_llvm(struct ac_llvm_compiler *ac_llvm, const struct radv_nir
exports_color_null = !exports_mrtz || (shaders[0]->info.outputs_written & (0xffu << FRAG_RESULT_DATA0));
}
ac_llvm_context_init(&ctx.ac, ac_llvm, &options->info->compiler_info, float_mode, info->wave_size,
exports_color_null, exports_mrtz);
ac_llvm_context_init(&ctx.ac, ac_llvm, options->compiler_info, float_mode, info->wave_size, exports_color_null,
exports_mrtz);
uint32_t length = 1;
for (uint32_t i = 0; i < shader_count; i++)
@ -425,7 +425,7 @@ llvm_compile_shader(const struct radv_nir_compiler_options *options, const struc
if (options->check_ir)
tm_options |= AC_TM_CHECK_IR;
radv_init_llvm_compiler(&ac_llvm, options->info->family, tm_options, info->wave_size);
radv_init_llvm_compiler(&ac_llvm, options->family, tm_options, info->wave_size);
radv_compile_nir_shader(&ac_llvm, options, info, binary, args, shaders, shader_count);
}

View file

@ -3273,11 +3273,14 @@ radv_fill_nir_compiler_options(struct radv_nir_compiler_options *options, struct
const struct radv_physical_device *pdev = radv_device_physical(device);
const struct radv_instance *instance = radv_physical_device_instance(pdev);
options->compiler_info = &pdev->info.compiler_info;
options->gfx_level = pdev->info.gfx_level;
options->family = pdev->info.family;
options->address32_hi = pdev->info.address32_hi;
/* robust_buffer_access_llvm here used by LLVM only, pipeline robustness is not exposed there. */
options->robust_buffer_access_llvm =
(device->vk.enabled_features.robustBufferAccess2 || device->vk.enabled_features.robustBufferAccess);
options->wgp_mode = should_use_wgp;
options->info = &pdev->info;
options->dump_shader = can_dump_shader;
options->dump_ir = options->dump_shader && (instance->debug_flags & RADV_DEBUG_DUMP_BACKEND_IR);
options->dump_preoptir = options->dump_shader && (instance->debug_flags & RADV_DEBUG_DUMP_PREOPT_IR);
@ -3307,6 +3310,7 @@ shader_compile(struct radv_device *device, struct nir_shader *const *shaders, in
const struct radv_shader_info *info, const struct radv_shader_args *args,
const struct radv_shader_stage_key *stage_key, struct radv_nir_compiler_options *options)
{
const struct radv_physical_device *pdev = radv_device_physical(device);
struct radv_shader_debug_data debug_data = {
.device = device,
.object = NULL,
@ -3317,8 +3321,6 @@ shader_compile(struct radv_device *device, struct nir_shader *const *shaders, in
struct radv_shader_binary *binary = NULL;
#if AMD_LLVM_AVAILABLE
const struct radv_physical_device *pdev = radv_device_physical(device);
if (radv_use_llvm_for_stage(pdev, stage) || options->dump_shader || options->record_ir)
ac_init_llvm_once();
@ -3331,7 +3333,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, stage_key);
radv_aco_convert_shader_info(&ac_info, info, args, &device->cache_key, options->info->gfx_level);
radv_aco_convert_shader_info(&ac_info, info, args, &device->cache_key, pdev->info.gfx_level);
aco_compile_shader(&ac_opts, &ac_info, shader_count, shaders, &args->ac, &radv_aco_build_shader_binary,
(void **)&binary);
}
@ -3420,7 +3422,7 @@ radv_create_trap_handler_shader(struct radv_device *device)
struct aco_compiler_options ac_opts;
struct aco_shader_info ac_info;
radv_aco_convert_shader_info(&ac_info, &info, &args, &device->cache_key, options.info->gfx_level);
radv_aco_convert_shader_info(&ac_info, &info, &args, &device->cache_key, pdev->info.gfx_level);
radv_aco_convert_opts(&ac_opts, &options, &args, &stage_key);
aco_compile_trap_handler(&ac_opts, &ac_info, &args.ac, &radv_aco_build_shader_binary, (void **)&binary);
@ -3504,7 +3506,7 @@ radv_create_rt_prolog(struct radv_device *device, unsigned raygen_param_count, n
struct radv_shader_stage_key stage_key = {0};
struct aco_shader_info ac_info;
struct aco_compiler_options ac_opts;
radv_aco_convert_shader_info(&ac_info, &info, &in_args, &device->cache_key, options.info->gfx_level);
radv_aco_convert_shader_info(&ac_info, &info, &in_args, &device->cache_key, pdev->info.gfx_level);
radv_aco_convert_opts(&ac_opts, &options, &in_args, &stage_key);
aco_compile_rt_prolog(&ac_opts, &ac_info, &in_args.ac, &in_args.descriptors[0], raygen_param_count, raygen_params,
&radv_aco_build_shader_binary, (void **)&binary);
@ -3566,7 +3568,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_info ac_prolog_info;
struct aco_compiler_options ac_opts;
radv_aco_convert_shader_info(&ac_info, &info, &args, &device->cache_key, options.info->gfx_level);
radv_aco_convert_shader_info(&ac_info, &info, &args, &device->cache_key, pdev->info.gfx_level);
radv_aco_convert_opts(&ac_opts, &options, &args, &stage_key);
radv_aco_convert_vs_prolog_key(&ac_prolog_info, key, &args);
aco_compile_vs_prolog(&ac_opts, &ac_info, &ac_prolog_info, &args.ac, &radv_aco_build_shader_part, (void **)&binary);
@ -3621,7 +3623,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_info ac_epilog_info = {0};
struct aco_compiler_options ac_opts;
radv_aco_convert_shader_info(&ac_info, &info, &args, &device->cache_key, options.info->gfx_level);
radv_aco_convert_shader_info(&ac_info, &info, &args, &device->cache_key, pdev->info.gfx_level);
radv_aco_convert_opts(&ac_opts, &options, &args, &stage_key);
radv_aco_convert_ps_epilog_key(&ac_epilog_info, key, &args);
aco_compile_ps_epilog(&ac_opts, &ac_info, &ac_epilog_info, &args.ac, &radv_aco_build_shader_part, (void **)&binary);

View file

@ -187,6 +187,10 @@ struct radv_graphics_pipeline_key {
};
struct radv_nir_compiler_options {
const struct ac_compiler_info *compiler_info;
enum amd_gfx_level gfx_level;
enum radeon_family family;
uint32_t address32_hi;
bool robust_buffer_access_llvm;
bool dump_shader;
bool dump_ir;
@ -197,7 +201,6 @@ struct radv_nir_compiler_options {
bool check_ir;
uint8_t enable_mrt_output_nan_fixup;
bool wgp_mode;
const struct radeon_info *info;
struct {
void (*func)(void *private_data, enum aco_compiler_debug_level level, const char *message);