diff --git a/src/amd/vulkan/radv_pipeline.c b/src/amd/vulkan/radv_pipeline.c index ddfcbc3ddeb..f1761eafa7b 100644 --- a/src/amd/vulkan/radv_pipeline.c +++ b/src/amd/vulkan/radv_pipeline.c @@ -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]); } } diff --git a/src/amd/vulkan/radv_shader.c b/src/amd/vulkan/radv_shader.c index 95a82c72c1c..60511631a2a 100644 --- a/src/amd/vulkan/radv_shader.c +++ b/src/amd/vulkan/radv_shader.c @@ -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 diff --git a/src/amd/vulkan/radv_shader.h b/src/amd/vulkan/radv_shader.h index 52b4cf9343c..d7f4668ba36 100644 --- a/src/amd/vulkan/radv_shader.h +++ b/src/amd/vulkan/radv_shader.h @@ -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);