From 96de531b5a99cb182c25ae8a953ccf8b46bab041 Mon Sep 17 00:00:00 2001 From: Caio Oliveira Date: Thu, 30 Jan 2025 14:52:33 -0800 Subject: [PATCH] anv: Add statistic for 'GRF registers' for Xe3+ For Xe3+ the registers are tightly packed to make better use of GRF space, so add a statistic to keep track of how many registers were used. For previous versions this is not useful since the code is spreading the registers among the whole space. Reviewed-by: Lionel Landwerlin Part-of: --- src/intel/vulkan/anv_pipeline.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/intel/vulkan/anv_pipeline.c b/src/intel/vulkan/anv_pipeline.c index ce35d55edf1..f532f2db6a6 100644 --- a/src/intel/vulkan/anv_pipeline.c +++ b/src/intel/vulkan/anv_pipeline.c @@ -4309,6 +4309,16 @@ VkResult anv_GetPipelineExecutableStatisticsKHR( stat->value.u64 = prog_data->total_scratch; } + if (pipeline->device->info->ver >= 30) { + vk_outarray_append_typed(VkPipelineExecutableStatisticKHR, &out, stat) { + WRITE_STR(stat->name, "GRF registers"); + WRITE_STR(stat->description, + "Number of GRF registers required by the shader."); + stat->format = VK_PIPELINE_EXECUTABLE_STATISTIC_FORMAT_UINT64_KHR; + stat->value.u64 = prog_data->grf_used; + } + } + vk_outarray_append_typed(VkPipelineExecutableStatisticKHR, &out, stat) { WRITE_STR(stat->name, "Max dispatch width"); WRITE_STR(stat->description,