radeonsi: make nir->info and si_shader_info::base identical

so that we can use nir->info instead of the latter.

Reviewed-by: Qiang Yu <yuq825@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/32713>
This commit is contained in:
Marek Olšák 2024-12-02 21:23:36 -05:00 committed by Marge Bot
parent 6a1bdf2f78
commit 110b308841
3 changed files with 16 additions and 12 deletions

View file

@ -239,6 +239,8 @@ static void *si_create_compute_state(struct pipe_context *ctx, const struct pipe
sel->nir = (struct nir_shader *)cso->prog;
}
sel->nir->info.shared_size = cso->static_shared_mem;
if (si_can_dump_shader(sscreen, sel->stage, SI_DUMP_INIT_NIR))
nir_print_shader(sel->nir, stderr);

View file

@ -1081,7 +1081,7 @@ unsigned si_get_shader_prefetch_size(struct si_shader *shader);
unsigned si_get_shader_binary_size(struct si_screen *screen, struct si_shader *shader);
/* si_shader_info.c */
void si_nir_scan_shader(struct si_screen *sscreen, const struct nir_shader *nir,
void si_nir_scan_shader(struct si_screen *sscreen, struct nir_shader *nir,
struct si_shader_info *info);
/* si_shader_nir.c */

View file

@ -523,23 +523,28 @@ static void scan_instruction(const struct nir_shader *nir, struct si_shader_info
}
}
void si_nir_scan_shader(struct si_screen *sscreen, const struct nir_shader *nir,
void si_nir_scan_shader(struct si_screen *sscreen, struct nir_shader *nir,
struct si_shader_info *info)
{
memset(info, 0, sizeof(*info));
info->base = nir->info;
bool force_use_aco = false;
if (sscreen->force_shader_use_aco) {
if (!memcmp(sscreen->use_aco_shader_blake, info->base.source_blake3,
if (!memcmp(sscreen->use_aco_shader_blake, nir->info.source_blake3,
sizeof(sscreen->use_aco_shader_blake))) {
force_use_aco = true;
}
}
info->base.use_aco_amd = aco_is_gpu_supported(&sscreen->info) &&
(sscreen->use_aco || nir->info.use_aco_amd || force_use_aco) &&
sscreen->info.has_image_opcodes;
nir->info.use_aco_amd = aco_is_gpu_supported(&sscreen->info) &&
(sscreen->use_aco || nir->info.use_aco_amd || force_use_aco) &&
sscreen->info.has_image_opcodes;
if (nir->info.stage == MESA_SHADER_FRAGMENT) {
/* post_depth_coverage implies early_fragment_tests */
nir->info.fs.early_fragment_tests |= nir->info.fs.post_depth_coverage;
}
memset(info, 0, sizeof(*info));
info->base = nir->info;
/* Get options from shader profiles. */
for (unsigned i = 0; i < ARRAY_SIZE(si_shader_profiles); i++) {
@ -550,9 +555,6 @@ void si_nir_scan_shader(struct si_screen *sscreen, const struct nir_shader *nir,
}
if (nir->info.stage == MESA_SHADER_FRAGMENT) {
/* post_depth_coverage implies early_fragment_tests */
info->base.fs.early_fragment_tests |= info->base.fs.post_depth_coverage;
info->color_interpolate[0] = nir->info.fs.color0_interp;
info->color_interpolate[1] = nir->info.fs.color1_interp;
for (unsigned i = 0; i < 2; i++) {