Mesa (main): radv: drop the module reference in radv_can_dump_shader_stats()

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Fri Apr 8 09:56:43 UTC 2022


Module: Mesa
Branch: main
Commit: 0411bb12978e762284397e668885ddd65aee15c8
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=0411bb12978e762284397e668885ddd65aee15c8

Author: Samuel Pitoiset <samuel.pitoiset at gmail.com>
Date:   Wed Apr  6 12:54:37 2022 +0200

radv: drop the module reference in radv_can_dump_shader_stats()

Signed-off-by: Samuel Pitoiset <samuel.pitoiset at gmail.com>
Reviewed-by: Timur Kristóf <timur.kristof at gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15766>

---

 src/amd/vulkan/radv_pipeline.c | 6 +++---
 src/amd/vulkan/radv_shader.c   | 5 ++---
 src/amd/vulkan/radv_shader.h   | 2 +-
 3 files changed, 6 insertions(+), 7 deletions(-)

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);



More information about the mesa-commit mailing list