diff options
author | ReinUsesLisp <reinuseslisp@airmail.cc> | 2021-07-28 00:15:32 +0200 |
---|---|---|
committer | ReinUsesLisp <reinuseslisp@airmail.cc> | 2021-07-28 02:29:24 +0200 |
commit | 3b006f4fe28006d320c60fd2b4393fd3f27eacd7 (patch) | |
tree | e8704a3796e766a764e2643a2621451a8fe4ea49 /src/video_core/vulkan_common/vulkan_wrapper.cpp | |
parent | Merge pull request #6748 from lioncash/engine-init (diff) | |
download | yuzu-3b006f4fe28006d320c60fd2b4393fd3f27eacd7.tar yuzu-3b006f4fe28006d320c60fd2b4393fd3f27eacd7.tar.gz yuzu-3b006f4fe28006d320c60fd2b4393fd3f27eacd7.tar.bz2 yuzu-3b006f4fe28006d320c60fd2b4393fd3f27eacd7.tar.lz yuzu-3b006f4fe28006d320c60fd2b4393fd3f27eacd7.tar.xz yuzu-3b006f4fe28006d320c60fd2b4393fd3f27eacd7.tar.zst yuzu-3b006f4fe28006d320c60fd2b4393fd3f27eacd7.zip |
Diffstat (limited to 'src/video_core/vulkan_common/vulkan_wrapper.cpp')
-rw-r--r-- | src/video_core/vulkan_common/vulkan_wrapper.cpp | 38 |
1 files changed, 38 insertions, 0 deletions
diff --git a/src/video_core/vulkan_common/vulkan_wrapper.cpp b/src/video_core/vulkan_common/vulkan_wrapper.cpp index 70898004a..a9faa4807 100644 --- a/src/video_core/vulkan_common/vulkan_wrapper.cpp +++ b/src/video_core/vulkan_common/vulkan_wrapper.cpp @@ -181,6 +181,8 @@ void Load(VkDevice device, DeviceDispatch& dld) noexcept { X(vkGetMemoryWin32HandleKHR); #endif X(vkGetQueryPoolResults); + X(vkGetPipelineExecutablePropertiesKHR); + X(vkGetPipelineExecutableStatisticsKHR); X(vkGetSemaphoreCounterValueKHR); X(vkMapMemory); X(vkQueueSubmit); @@ -809,6 +811,42 @@ VkMemoryRequirements Device::GetImageMemoryRequirements(VkImage image) const noe return requirements; } +std::vector<VkPipelineExecutablePropertiesKHR> Device::GetPipelineExecutablePropertiesKHR( + VkPipeline pipeline) const { + const VkPipelineInfoKHR info{ + .sType = VK_STRUCTURE_TYPE_PIPELINE_INFO_KHR, + .pNext = nullptr, + .pipeline = pipeline, + }; + u32 num{}; + dld->vkGetPipelineExecutablePropertiesKHR(handle, &info, &num, nullptr); + std::vector<VkPipelineExecutablePropertiesKHR> properties(num); + for (auto& property : properties) { + property.sType = VK_STRUCTURE_TYPE_PIPELINE_EXECUTABLE_PROPERTIES_KHR; + } + Check(dld->vkGetPipelineExecutablePropertiesKHR(handle, &info, &num, properties.data())); + return properties; +} + +std::vector<VkPipelineExecutableStatisticKHR> Device::GetPipelineExecutableStatisticsKHR( + VkPipeline pipeline, u32 executable_index) const { + const VkPipelineExecutableInfoKHR executable_info{ + .sType = VK_STRUCTURE_TYPE_PIPELINE_EXECUTABLE_INFO_KHR, + .pNext = nullptr, + .pipeline = pipeline, + .executableIndex = executable_index, + }; + u32 num{}; + dld->vkGetPipelineExecutableStatisticsKHR(handle, &executable_info, &num, nullptr); + std::vector<VkPipelineExecutableStatisticKHR> statistics(num); + for (auto& statistic : statistics) { + statistic.sType = VK_STRUCTURE_TYPE_PIPELINE_EXECUTABLE_STATISTIC_KHR; + } + Check(dld->vkGetPipelineExecutableStatisticsKHR(handle, &executable_info, &num, + statistics.data())); + return statistics; +} + void Device::UpdateDescriptorSets(Span<VkWriteDescriptorSet> writes, Span<VkCopyDescriptorSet> copies) const noexcept { dld->vkUpdateDescriptorSets(handle, writes.size(), writes.data(), copies.size(), copies.data()); |