ac/radv: drop info pointer from the ac and radv shader structs

This was being used for one bool, just pass the bool.

Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16521>
This commit is contained in:
Dave Airlie
2022-05-16 14:35:07 +10:00
committed by Marge Bot
parent 55845409f2
commit 8198900071
7 changed files with 13 additions and 11 deletions

View File

@@ -57,7 +57,7 @@ struct ac_llvm_flow {
*/
void ac_llvm_context_init(struct ac_llvm_context *ctx, struct ac_llvm_compiler *compiler,
enum amd_gfx_level gfx_level, enum radeon_family family,
const struct radeon_info *info,
bool has_3d_cube_border_color_mipmap,
enum ac_float_mode float_mode, unsigned wave_size,
unsigned ballot_mask_bits)
{
@@ -65,7 +65,7 @@ void ac_llvm_context_init(struct ac_llvm_context *ctx, struct ac_llvm_compiler *
ctx->gfx_level = gfx_level;
ctx->family = family;
ctx->info = info;
ctx->has_3d_cube_border_color_mipmap = has_3d_cube_border_color_mipmap;
ctx->wave_size = wave_size;
ctx->ballot_mask_bits = ballot_mask_bits;
ctx->float_mode = float_mode;

View File

@@ -134,7 +134,7 @@ struct ac_llvm_context {
enum amd_gfx_level gfx_level;
enum radeon_family family;
const struct radeon_info *info;
bool has_3d_cube_border_color_mipmap;
unsigned wave_size;
unsigned ballot_mask_bits;
@@ -146,7 +146,7 @@ struct ac_llvm_context {
void ac_llvm_context_init(struct ac_llvm_context *ctx, struct ac_llvm_compiler *compiler,
enum amd_gfx_level gfx_level, enum radeon_family family,
const struct radeon_info *info,
bool has_3d_cube_border_color_mipmap,
enum ac_float_mode float_mode, unsigned wave_size,
unsigned ballot_mask_bits);

View File

@@ -1608,7 +1608,7 @@ static LLVMValueRef build_tex_intrinsic(struct ac_nir_context *ctx, const nir_te
}
/* Aldebaran doesn't have image_sample_lz, but image_sample behaves like lz. */
if (!ctx->ac.info->has_3d_cube_border_color_mipmap)
if (!ctx->ac.has_3d_cube_border_color_mipmap)
args->level_zero = false;
if (instr->op == nir_texop_tg4 && ctx->ac.gfx_level <= GFX8 &&

View File

@@ -2041,7 +2041,8 @@ ac_translate_nir_to_llvm(struct ac_llvm_compiler *ac_llvm,
float_mode = AC_FLOAT_MODE_DENORM_FLUSH_TO_ZERO;
}
ac_llvm_context_init(&ctx.ac, ac_llvm, options->gfx_level, options->family, options->info,
ac_llvm_context_init(&ctx.ac, ac_llvm, options->gfx_level, options->family,
options->has_3d_cube_border_color_mipmap,
float_mode, info->wave_size, info->ballot_bit_size);
ctx.context = ctx.ac.context;
@@ -2426,7 +2427,8 @@ radv_compile_gs_copy_shader(struct ac_llvm_compiler *ac_llvm,
assert(args->is_gs_copy_shader);
ac_llvm_context_init(&ctx.ac, ac_llvm, options->gfx_level, options->family, options->info,
ac_llvm_context_init(&ctx.ac, ac_llvm, options->gfx_level, options->family,
options->has_3d_cube_border_color_mipmap,
AC_FLOAT_MODE_DEFAULT, 64, 64);
ctx.context = ctx.ac.context;

View File

@@ -1987,7 +1987,7 @@ shader_compile(struct radv_device *device, struct nir_shader *const *shaders, in
options->family = chip_family;
options->gfx_level = device->physical_device->rad_info.gfx_level;
options->info = &device->physical_device->rad_info;
options->has_3d_cube_border_color_mipmap = device->physical_device->rad_info.has_3d_cube_border_color_mipmap;
options->dump_shader = radv_can_dump_shader(device, shaders[0], gs_copy_shader || trap_handler_shader);
options->dump_preoptir =
options->dump_shader && device->instance->debug_flags & RADV_DEBUG_PREOPTIR;
@@ -2175,7 +2175,7 @@ radv_create_vs_prolog(struct radv_device *device, const struct radv_vs_prolog_ke
struct radv_nir_compiler_options options = {0};
options.family = device->physical_device->rad_info.family;
options.gfx_level = device->physical_device->rad_info.gfx_level;
options.info = &device->physical_device->rad_info;
options.has_3d_cube_border_color_mipmap = device->physical_device->rad_info.has_3d_cube_border_color_mipmap;
options.address32_hi = device->physical_device->rad_info.address32_hi;
options.dump_shader = device->instance->debug_flags & RADV_DEBUG_DUMP_PROLOGS;
options.record_ir = device->instance->debug_flags & RADV_DEBUG_HANG;

View File

@@ -130,8 +130,8 @@ struct radv_nir_compiler_options {
bool wgp_mode;
enum radeon_family family;
enum amd_gfx_level gfx_level;
const struct radeon_info *info;
uint32_t address32_hi;
bool has_3d_cube_border_color_mipmap;
struct {
void (*func)(void *private_data, enum radv_compiler_debug_level level, const char *message);

View File

@@ -133,7 +133,7 @@ void si_llvm_context_init(struct si_shader_context *ctx, struct si_screen *sscre
ctx->compiler = compiler;
ac_llvm_context_init(&ctx->ac, compiler, sscreen->info.gfx_level, sscreen->info.family,
&sscreen->info, AC_FLOAT_MODE_DEFAULT_OPENGL, wave_size, 64);
sscreen->info.has_3d_cube_border_color_mipmap, AC_FLOAT_MODE_DEFAULT_OPENGL, wave_size, 64);
}
void si_llvm_create_func(struct si_shader_context *ctx, const char *name, LLVMTypeRef *return_types,