radv: pass radv_shader to radv_dump_shader_stats()

Preliminary work for moving the shaders array outside of radv_pipeline.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21878>
This commit is contained in:
Samuel Pitoiset
2023-03-13 13:32:23 +01:00
committed by Marge Bot
parent 0514c015e6
commit 444c5887c2
5 changed files with 8 additions and 7 deletions

View File

@@ -452,7 +452,7 @@ radv_dump_shader(struct radv_pipeline *pipeline, struct radv_shader *shader,
shader->ir_string);
fprintf(f, "DISASM:\n%s\n", shader->disasm_string);
radv_dump_shader_stats(pipeline->device, pipeline, stage, f);
radv_dump_shader_stats(pipeline->device, pipeline, shader, stage, f);
}
static void

View File

@@ -3552,7 +3552,7 @@ radv_graphics_pipeline_compile(struct radv_graphics_pipeline *pipeline,
free(binaries[i]);
if (stages[i].nir) {
if (radv_can_dump_shader_stats(device, stages[i].nir) && pipeline->base.shaders[i]) {
radv_dump_shader_stats(device, &pipeline->base, i, stderr);
radv_dump_shader_stats(device, &pipeline->base, pipeline->base.shaders[i], i, stderr);
}
ralloc_free(stages[i].nir);
@@ -5412,7 +5412,8 @@ radv_compute_pipeline_compile(struct radv_compute_pipeline *pipeline,
free(binaries[MESA_SHADER_COMPUTE]);
if (radv_can_dump_shader_stats(device, cs_stage.nir)) {
radv_dump_shader_stats(device, &pipeline->base, MESA_SHADER_COMPUTE, stderr);
radv_dump_shader_stats(device, &pipeline->base, pipeline->base.shaders[MESA_SHADER_COMPUTE],
MESA_SHADER_COMPUTE, stderr);
}
ralloc_free(cs_stage.nir);

View File

@@ -311,7 +311,8 @@ radv_rt_pipeline_compile(struct radv_pipeline *pipeline,
free(binaries[rt_stage.stage]);
if (radv_can_dump_shader_stats(device, rt_stage.nir)) {
radv_dump_shader_stats(device, pipeline, rt_stage.stage, stderr);
radv_dump_shader_stats(device, pipeline, pipeline->shaders[rt_stage.stage], rt_stage.stage,
stderr);
}
ralloc_free(rt_stage.nir);

View File

@@ -3230,9 +3230,8 @@ radv_compute_spi_ps_input(const struct radv_pipeline_key *pipeline_key,
VkResult
radv_dump_shader_stats(struct radv_device *device, struct radv_pipeline *pipeline,
gl_shader_stage stage, FILE *output)
struct radv_shader *shader, gl_shader_stage stage, FILE *output)
{
struct radv_shader *shader = pipeline->shaders[stage];
VkPipelineExecutablePropertiesKHR *props = NULL;
uint32_t prop_count = 0;
VkResult result;

View File

@@ -650,7 +650,7 @@ bool radv_can_dump_shader(struct radv_device *device, nir_shader *nir, bool meta
bool radv_can_dump_shader_stats(struct radv_device *device, nir_shader *nir);
VkResult radv_dump_shader_stats(struct radv_device *device, struct radv_pipeline *pipeline,
gl_shader_stage stage, FILE *output);
struct radv_shader *shader, gl_shader_stage stage, FILE *output);
static inline struct radv_shader *
radv_shader_ref(struct radv_shader *shader)