<div dir="ltr">Reviewed-by: Bas Nieuwenhuizen <<a href="mailto:bas@basnieuwenhuizen.nl">bas@basnieuwenhuizen.nl</a>></div><div class="gmail_extra"><br><div class="gmail_quote">On Wed, Jan 31, 2018 at 11:40 AM, Samuel Pitoiset <span dir="ltr"><<a href="mailto:samuel.pitoiset@gmail.com" target="_blank">samuel.pitoiset@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">That's quite useless and that pollutes the output.<br>
<br>
Signed-off-by: Samuel Pitoiset <<a href="mailto:samuel.pitoiset@gmail.com">samuel.pitoiset@gmail.com</a>><br>
---<br>
 src/amd/vulkan/radv_pipeline.c | 30 +++++++++---------------------<br>
 src/amd/vulkan/radv_shader.h   |  9 +++++++++<br>
 2 files changed, 18 insertions(+), 21 deletions(-)<br>
<br>
diff --git a/src/amd/vulkan/radv_<wbr>pipeline.c b/src/amd/vulkan/radv_<wbr>pipeline.c<br>
index 785c216b4a..6547637338 100644<br>
--- a/src/amd/vulkan/radv_<wbr>pipeline.c<br>
+++ b/src/amd/vulkan/radv_<wbr>pipeline.c<br>
@@ -110,18 +110,6 @@ void radv_DestroyPipeline(<br>
        radv_pipeline_destroy(device, pipeline, pAllocator);<br>
 }<br>
<br>
-static void radv_dump_pipeline_stats(<wbr>struct radv_device *device, struct radv_pipeline *pipeline)<br>
-{<br>
-       int i;<br>
-<br>
-       for (i = 0; i < MESA_SHADER_STAGES; i++) {<br>
-               if (!pipeline->shaders[i])<br>
-                       continue;<br>
-<br>
-               radv_shader_dump_stats(device, pipeline->shaders[i], i, stderr);<br>
-       }<br>
-}<br>
-<br>
 static uint32_t get_hash_flags(struct radv_device *device)<br>
 {<br>
        uint32_t hash_flags = 0;<br>
@@ -1861,8 +1849,15 @@ void radv_create_shaders(struct radv_pipeline *pipeline,<br>
<br>
        for (int i = 0; i < MESA_SHADER_STAGES; ++i) {<br>
                free(codes[i]);<br>
-               if (modules[i] && !pipeline->device->keep_<wbr>shader_info)<br>
-                       ralloc_free(nir[i]);<br>
+               if (modules[i]) {<br>
+                       if (!pipeline->device->keep_<wbr>shader_info)<br>
+                               ralloc_free(nir[i]);<br>
+<br>
+                       if (radv_can_dump_shader_stats(<wbr>device, modules[i]))<br>
+                               radv_shader_dump_stats(device,<br>
+                                                      pipeline->shaders[i],<br>
+                                                      i, stderr);<br>
+               }<br>
        }<br>
<br>
        if (fs_m.nir)<br>
@@ -3233,10 +3228,6 @@ radv_pipeline_init(struct radv_pipeline *pipeline,<br>
                        pipeline->graphics.vtx_emit_<wbr>num = 2;<br>
        }<br>
<br>
-       if (device->instance->debug_flags & RADV_DEBUG_DUMP_SHADER_STATS) {<br>
-               radv_dump_pipeline_stats(<wbr>device, pipeline);<br>
-       }<br>
-<br>
        result = radv_pipeline_scratch_init(<wbr>device, pipeline);<br>
        radv_pipeline_generate_pm4(<wbr>pipeline, pCreateInfo, extra, &blend, &tess, &gs, prim, gs_out);<br>
<br>
@@ -3400,9 +3391,6 @@ static VkResult radv_compute_pipeline_create(<br>
<br>
        *pPipeline = radv_pipeline_to_handle(<wbr>pipeline);<br>
<br>
-       if (device->instance->debug_flags & RADV_DEBUG_DUMP_SHADER_STATS) {<br>
-               radv_dump_pipeline_stats(<wbr>device, pipeline);<br>
-       }<br>
        return VK_SUCCESS;<br>
 }<br>
<br>
diff --git a/src/amd/vulkan/radv_shader.h b/src/amd/vulkan/radv_shader.h<br>
index f6486863f8..b07f8a89e7 100644<br>
--- a/src/amd/vulkan/radv_shader.h<br>
+++ b/src/amd/vulkan/radv_shader.h<br>
@@ -122,4 +122,13 @@ radv_can_dump_shader(struct radv_device *device,<br>
               module && !module->nir;<br>
 }<br>
<br>
+static inline bool<br>
+radv_can_dump_shader_stats(<wbr>struct radv_device *device,<br>
+                          struct radv_shader_module *module)<br>
+{<br>
+       /* Only dump non-meta shader stats. */<br>
+       return device->instance->debug_flags & RADV_DEBUG_DUMP_SHADER_STATS &&<br>
+              module && !module->nir;<br>
+}<br>
+<br>
 #endif<br>
<span class="HOEnZb"><font color="#888888">--<br>
2.16.1<br>
<br>
______________________________<wbr>_________________<br>
mesa-dev mailing list<br>
<a href="mailto:mesa-dev@lists.freedesktop.org">mesa-dev@lists.freedesktop.org</a><br>
<a href="https://lists.freedesktop.org/mailman/listinfo/mesa-dev" rel="noreferrer" target="_blank">https://lists.freedesktop.org/<wbr>mailman/listinfo/mesa-dev</a><br>
</font></span></blockquote></div><br></div>