From 11774308d305537677454c5acddd7a5928a1275d Mon Sep 17 00:00:00 2001 From: ReinUsesLisp Date: Tue, 31 Mar 2020 20:59:28 -0300 Subject: [PATCH] renderer_vulkan/wrapper: Add swapchain handle --- src/video_core/renderer_vulkan/wrapper.cpp | 8 ++++++++ src/video_core/renderer_vulkan/wrapper.h | 7 +++++++ 2 files changed, 15 insertions(+) diff --git a/src/video_core/renderer_vulkan/wrapper.cpp b/src/video_core/renderer_vulkan/wrapper.cpp index d6fea3711a..decb34a4c2 100644 --- a/src/video_core/renderer_vulkan/wrapper.cpp +++ b/src/video_core/renderer_vulkan/wrapper.cpp @@ -460,4 +460,12 @@ CommandBuffers CommandPool::Allocate(std::size_t num_buffers, VkCommandBufferLev } } +std::vector SwapchainKHR::GetImages() const { + u32 num; + Check(dld->vkGetSwapchainImagesKHR(owner, handle, &num, nullptr)); + std::vector images(num); + Check(dld->vkGetSwapchainImagesKHR(owner, handle, &num, images.data())); + return images; +} + } // namespace Vulkan::vk diff --git a/src/video_core/renderer_vulkan/wrapper.h b/src/video_core/renderer_vulkan/wrapper.h index 96f498c132..d8976f3b0d 100644 --- a/src/video_core/renderer_vulkan/wrapper.h +++ b/src/video_core/renderer_vulkan/wrapper.h @@ -647,4 +647,11 @@ public: VkCommandBufferLevel level = VK_COMMAND_BUFFER_LEVEL_PRIMARY) const; }; +class SwapchainKHR : public Handle { + using Handle::Handle; + +public: + std::vector GetImages() const; +}; + } // namespace Vulkan::vk