From acb10043cbb5698e2a02612930d08598b9245085 Mon Sep 17 00:00:00 2001 From: Alyssa Rosenzweig Date: Sat, 13 Jul 2024 09:00:13 -0400 Subject: [PATCH] nvk: add instruction count exec property useful for shader-db, this isn't as simple as dividing the code size so it's worth reporting. Signed-off-by: Alyssa Rosenzweig Reviewed-by: M Henning Part-of: --- src/nouveau/vulkan/nvk_shader.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/nouveau/vulkan/nvk_shader.c b/src/nouveau/vulkan/nvk_shader.c index 310a90d523d..26c8c1c7e97 100644 --- a/src/nouveau/vulkan/nvk_shader.c +++ b/src/nouveau/vulkan/nvk_shader.c @@ -914,6 +914,13 @@ nvk_shader_get_executable_statistics( assert(executable_index == 0); + vk_outarray_append_typed(VkPipelineExecutableStatisticKHR, &out, stat) { + WRITE_STR(stat->name, "Instruction count"); + WRITE_STR(stat->description, "Number of instructions used by this shader"); + stat->format = VK_PIPELINE_EXECUTABLE_STATISTIC_FORMAT_UINT64_KHR; + stat->value.u64 = shader->info.num_instrs; + } + vk_outarray_append_typed(VkPipelineExecutableStatisticKHR, &out, stat) { WRITE_STR(stat->name, "Code Size"); WRITE_STR(stat->description,