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:
@@ -57,7 +57,7 @@ struct ac_llvm_flow {
|
|||||||
*/
|
*/
|
||||||
void ac_llvm_context_init(struct ac_llvm_context *ctx, struct ac_llvm_compiler *compiler,
|
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,
|
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,
|
enum ac_float_mode float_mode, unsigned wave_size,
|
||||||
unsigned ballot_mask_bits)
|
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->gfx_level = gfx_level;
|
||||||
ctx->family = family;
|
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->wave_size = wave_size;
|
||||||
ctx->ballot_mask_bits = ballot_mask_bits;
|
ctx->ballot_mask_bits = ballot_mask_bits;
|
||||||
ctx->float_mode = float_mode;
|
ctx->float_mode = float_mode;
|
||||||
|
@@ -134,7 +134,7 @@ struct ac_llvm_context {
|
|||||||
|
|
||||||
enum amd_gfx_level gfx_level;
|
enum amd_gfx_level gfx_level;
|
||||||
enum radeon_family family;
|
enum radeon_family family;
|
||||||
const struct radeon_info *info;
|
bool has_3d_cube_border_color_mipmap;
|
||||||
|
|
||||||
unsigned wave_size;
|
unsigned wave_size;
|
||||||
unsigned ballot_mask_bits;
|
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,
|
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,
|
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,
|
enum ac_float_mode float_mode, unsigned wave_size,
|
||||||
unsigned ballot_mask_bits);
|
unsigned ballot_mask_bits);
|
||||||
|
|
||||||
|
@@ -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. */
|
/* 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;
|
args->level_zero = false;
|
||||||
|
|
||||||
if (instr->op == nir_texop_tg4 && ctx->ac.gfx_level <= GFX8 &&
|
if (instr->op == nir_texop_tg4 && ctx->ac.gfx_level <= GFX8 &&
|
||||||
|
@@ -2041,7 +2041,8 @@ ac_translate_nir_to_llvm(struct ac_llvm_compiler *ac_llvm,
|
|||||||
float_mode = AC_FLOAT_MODE_DENORM_FLUSH_TO_ZERO;
|
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);
|
float_mode, info->wave_size, info->ballot_bit_size);
|
||||||
ctx.context = ctx.ac.context;
|
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);
|
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);
|
AC_FLOAT_MODE_DEFAULT, 64, 64);
|
||||||
ctx.context = ctx.ac.context;
|
ctx.context = ctx.ac.context;
|
||||||
|
|
||||||
|
@@ -1987,7 +1987,7 @@ shader_compile(struct radv_device *device, struct nir_shader *const *shaders, in
|
|||||||
|
|
||||||
options->family = chip_family;
|
options->family = chip_family;
|
||||||
options->gfx_level = device->physical_device->rad_info.gfx_level;
|
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_shader = radv_can_dump_shader(device, shaders[0], gs_copy_shader || trap_handler_shader);
|
||||||
options->dump_preoptir =
|
options->dump_preoptir =
|
||||||
options->dump_shader && device->instance->debug_flags & RADV_DEBUG_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};
|
struct radv_nir_compiler_options options = {0};
|
||||||
options.family = device->physical_device->rad_info.family;
|
options.family = device->physical_device->rad_info.family;
|
||||||
options.gfx_level = device->physical_device->rad_info.gfx_level;
|
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.address32_hi = device->physical_device->rad_info.address32_hi;
|
||||||
options.dump_shader = device->instance->debug_flags & RADV_DEBUG_DUMP_PROLOGS;
|
options.dump_shader = device->instance->debug_flags & RADV_DEBUG_DUMP_PROLOGS;
|
||||||
options.record_ir = device->instance->debug_flags & RADV_DEBUG_HANG;
|
options.record_ir = device->instance->debug_flags & RADV_DEBUG_HANG;
|
||||||
|
@@ -130,8 +130,8 @@ struct radv_nir_compiler_options {
|
|||||||
bool wgp_mode;
|
bool wgp_mode;
|
||||||
enum radeon_family family;
|
enum radeon_family family;
|
||||||
enum amd_gfx_level gfx_level;
|
enum amd_gfx_level gfx_level;
|
||||||
const struct radeon_info *info;
|
|
||||||
uint32_t address32_hi;
|
uint32_t address32_hi;
|
||||||
|
bool has_3d_cube_border_color_mipmap;
|
||||||
|
|
||||||
struct {
|
struct {
|
||||||
void (*func)(void *private_data, enum radv_compiler_debug_level level, const char *message);
|
void (*func)(void *private_data, enum radv_compiler_debug_level level, const char *message);
|
||||||
|
@@ -133,7 +133,7 @@ void si_llvm_context_init(struct si_shader_context *ctx, struct si_screen *sscre
|
|||||||
ctx->compiler = compiler;
|
ctx->compiler = compiler;
|
||||||
|
|
||||||
ac_llvm_context_init(&ctx->ac, compiler, sscreen->info.gfx_level, sscreen->info.family,
|
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,
|
void si_llvm_create_func(struct si_shader_context *ctx, const char *name, LLVMTypeRef *return_types,
|
||||||
|
Reference in New Issue
Block a user