From 3b006f4fe28006d320c60fd2b4393fd3f27eacd7 Mon Sep 17 00:00:00 2001 From: ReinUsesLisp Date: Tue, 27 Jul 2021 19:15:32 -0300 Subject: renderer_vulkan: Add setting to log pipeline statistics Use VK_KHR_pipeline_executable_properties when enabled and available to log statistics about the pipeline cache in a game. For example, this is on Turing GPUs when generating a pipeline cache from Super Smash Bros. Ultimate: Average pipeline statistics ========================================== Code size: 6433.167 Register count: 32.939 More advanced results could be presented, at the moment it's just an average of all 3D and compute pipelines. --- src/video_core/vulkan_common/vulkan_wrapper.h | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'src/video_core/vulkan_common/vulkan_wrapper.h') diff --git a/src/video_core/vulkan_common/vulkan_wrapper.h b/src/video_core/vulkan_common/vulkan_wrapper.h index d76bb4324..b7ae01c6c 100644 --- a/src/video_core/vulkan_common/vulkan_wrapper.h +++ b/src/video_core/vulkan_common/vulkan_wrapper.h @@ -295,6 +295,8 @@ struct DeviceDispatch : InstanceDispatch { #ifdef _WIN32 PFN_vkGetMemoryWin32HandleKHR vkGetMemoryWin32HandleKHR{}; #endif + PFN_vkGetPipelineExecutablePropertiesKHR vkGetPipelineExecutablePropertiesKHR{}; + PFN_vkGetPipelineExecutableStatisticsKHR vkGetPipelineExecutableStatisticsKHR{}; PFN_vkGetQueryPoolResults vkGetQueryPoolResults{}; PFN_vkGetSemaphoreCounterValueKHR vkGetSemaphoreCounterValueKHR{}; PFN_vkMapMemory vkMapMemory{}; @@ -879,6 +881,12 @@ public: VkMemoryRequirements GetImageMemoryRequirements(VkImage image) const noexcept; + std::vector GetPipelineExecutablePropertiesKHR( + VkPipeline pipeline) const; + + std::vector GetPipelineExecutableStatisticsKHR( + VkPipeline pipeline, u32 executable_index) const; + void UpdateDescriptorSets(Span writes, Span copies) const noexcept; -- cgit v1.2.3