pan: refactor shader info setting

Move the update of pan_shader_info into its own function. For now this
does nothing, but it will allow us to update the info before printing
stats, which will be useful in the future.

Reviewed-by: Christoph Pillmayer <christoph.pillmayer@arm.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/38961>
This commit is contained in:
Eric R. Smith
2025-12-07 15:33:36 -04:00
committed by Marge Bot
parent a25561b496
commit 158be3dc1d
2 changed files with 24 additions and 12 deletions

View File

@@ -163,21 +163,11 @@ pan_lookup_pushed_ubo(struct pan_ubo_push *push, unsigned ubo, unsigned offs)
}
void
pan_shader_compile(nir_shader *s, struct pan_compile_inputs *inputs,
struct util_dynarray *binary, struct pan_shader_info *info)
pan_shader_update_info(struct pan_shader_info *info, nir_shader *s,
struct pan_compile_inputs *inputs)
{
unsigned arch = pan_arch(inputs->gpu_id);
memset(info, 0, sizeof(*info));
NIR_PASS(_, s, nir_inline_sysval, nir_intrinsic_load_printf_buffer_size,
PAN_PRINTF_BUFFER_SIZE - 8);
if (arch >= 6)
bifrost_compile_shader_nir(s, inputs, binary, info);
else
midgard_compile_shader_nir(s, inputs, binary, info);
info->stage = s->info.stage;
info->contains_barrier =
s->info.uses_memory_barrier || s->info.uses_control_barrier;
@@ -305,6 +295,25 @@ pan_shader_compile(nir_shader *s, struct pan_compile_inputs *inputs,
}
}
void
pan_shader_compile(nir_shader *s, struct pan_compile_inputs *inputs,
struct util_dynarray *binary, struct pan_shader_info *info)
{
unsigned arch = pan_arch(inputs->gpu_id);
memset(info, 0, sizeof(*info));
NIR_PASS(_, s, nir_inline_sysval, nir_intrinsic_load_printf_buffer_size,
PAN_PRINTF_BUFFER_SIZE - 8);
if (arch >= 6)
bifrost_compile_shader_nir(s, inputs, binary, info);
else
midgard_compile_shader_nir(s, inputs, binary, info);
pan_shader_update_info(info, s, inputs);
}
void
pan_disassemble(FILE *fp, const void *code, size_t size,
unsigned gpu_id, bool verbose)

View File

@@ -366,6 +366,9 @@ struct pan_shader_info {
};
};
void pan_shader_update_info(struct pan_shader_info *info, nir_shader *s,
struct pan_compile_inputs *inputs);
void pan_shader_compile(nir_shader *nir, struct pan_compile_inputs *inputs,
struct util_dynarray *binary,
struct pan_shader_info *info);