radv: drop the module reference in radv_can_dump_shader_stats()

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15766>
This commit is contained in:
Samuel Pitoiset
2022-04-06 12:54:37 +02:00
parent a434097453
commit 0411bb1297
3 changed files with 6 additions and 7 deletions

View File

@@ -4539,11 +4539,11 @@ radv_create_shaders(struct radv_pipeline *pipeline, struct radv_pipeline_layout
for (int i = 0; i < MESA_VULKAN_SHADER_STAGES; ++i) {
free(binaries[i]);
if (nir[i]) {
ralloc_free(nir[i]);
if (radv_can_dump_shader_stats(device, modules[i])) {
if (radv_can_dump_shader_stats(device, nir[i]) && pipeline->shaders[i]) {
radv_dump_shader_stats(device, pipeline, i, stderr);
}
ralloc_free(nir[i]);
}
}

View File

@@ -136,11 +136,10 @@ radv_can_dump_shader(struct radv_device *device, nir_shader *nir, bool meta_shad
}
bool
radv_can_dump_shader_stats(struct radv_device *device, struct vk_shader_module *module)
radv_can_dump_shader_stats(struct radv_device *device, nir_shader *nir)
{
/* Only dump non-meta shader stats. */
return device->instance->debug_flags & RADV_DEBUG_DUMP_SHADER_STATS && module &&
!is_meta_shader(module->nir);
return device->instance->debug_flags & RADV_DEBUG_DUMP_SHADER_STATS && !is_meta_shader(nir);
}
void

View File

@@ -581,7 +581,7 @@ unsigned radv_compute_spi_ps_input(const struct radv_device *device,
bool radv_can_dump_shader(struct radv_device *device, nir_shader *nir, bool meta_shader);
bool radv_can_dump_shader_stats(struct radv_device *device, struct vk_shader_module *module);
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);