2
1
Fork 0
mirror of https://github.com/yuzu-emu/yuzu.git synced 2024-07-04 23:31:19 +01:00

renderer_vulkan/wrapper: Add swapchain handle

This commit is contained in:
ReinUsesLisp 2020-03-31 20:59:28 -03:00
parent 7fe52ef77f
commit 11774308d3
2 changed files with 15 additions and 0 deletions

View file

@ -460,4 +460,12 @@ CommandBuffers CommandPool::Allocate(std::size_t num_buffers, VkCommandBufferLev
} }
} }
std::vector<VkImage> SwapchainKHR::GetImages() const {
u32 num;
Check(dld->vkGetSwapchainImagesKHR(owner, handle, &num, nullptr));
std::vector<VkImage> images(num);
Check(dld->vkGetSwapchainImagesKHR(owner, handle, &num, images.data()));
return images;
}
} // namespace Vulkan::vk } // namespace Vulkan::vk

View file

@ -647,4 +647,11 @@ public:
VkCommandBufferLevel level = VK_COMMAND_BUFFER_LEVEL_PRIMARY) const; VkCommandBufferLevel level = VK_COMMAND_BUFFER_LEVEL_PRIMARY) const;
}; };
class SwapchainKHR : public Handle<VkSwapchainKHR, VkDevice, DeviceDispatch> {
using Handle<VkSwapchainKHR, VkDevice, DeviceDispatch>::Handle;
public:
std::vector<VkImage> GetImages() const;
};
} // namespace Vulkan::vk } // namespace Vulkan::vk