renderer_vulkan/wrapper: Add swapchain handle

merge-requests/60/head
ReinUsesLisp 2020-03-31 20:59:28 +07:00
parent 7fe52ef77f
commit 11774308d3
2 changed files with 15 additions and 0 deletions

@ -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

@ -647,4 +647,11 @@ public:
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