From efd4a162d30ddfa15d84703ebfa5375549a83f2b Mon Sep 17 00:00:00 2001 From: Lionel Landwerlin Date: Fri, 9 Jun 2023 16:52:17 +0300 Subject: [PATCH] anv: always report all pipeline stats regardless of stages Tools like the scripts in shader-db expect all the fields to be there, as the stats are put into a CSV file. So just report 0 if a stage doesn't support workgroup memory size. Signed-off-by: Lionel Landwerlin Acked-by: Emma Anholt Part-of: --- src/intel/vulkan/anv_pipeline.c | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/src/intel/vulkan/anv_pipeline.c b/src/intel/vulkan/anv_pipeline.c index 8fe21e4e586..575ee285aaf 100644 --- a/src/intel/vulkan/anv_pipeline.c +++ b/src/intel/vulkan/anv_pipeline.c @@ -4239,15 +4239,16 @@ VkResult anv_GetPipelineExecutableStatisticsKHR( stat->value.u64 = exe->stats.max_live_registers; } - if (gl_shader_stage_uses_workgroup(exe->stage)) { - vk_outarray_append_typed(VkPipelineExecutableStatisticKHR, &out, stat) { - WRITE_STR(stat->name, "Workgroup Memory Size"); - WRITE_STR(stat->description, - "Number of bytes of workgroup shared memory used by this " - "shader including any padding."); - stat->format = VK_PIPELINE_EXECUTABLE_STATISTIC_FORMAT_UINT64_KHR; + vk_outarray_append_typed(VkPipelineExecutableStatisticKHR, &out, stat) { + WRITE_STR(stat->name, "Workgroup Memory Size"); + WRITE_STR(stat->description, + "Number of bytes of workgroup shared memory used by this " + "shader including any padding."); + stat->format = VK_PIPELINE_EXECUTABLE_STATISTIC_FORMAT_UINT64_KHR; + if (gl_shader_stage_uses_workgroup(exe->stage)) stat->value.u64 = prog_data->total_shared; - } + else + stat->value.u64 = 0; } return vk_outarray_status(&out);