yuzu-emu
/
yuzu-android
Archived
1
0
Fork 0

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