Vulkan: Make device objects take a device handle at creation

Former-commit-id: 985b9f5b04aef4d6de55ee6d360a2da92bed8940 [formerly e31d84225897da96b0438d49dbdf6473a7873a17]
Former-commit-id: 82ed4eeccde614312fff717ab1f469335c861292
This commit is contained in:
Lynix
2016-06-08 12:57:06 +02:00
parent c45cb6bb12
commit f3f46b71fb
13 changed files with 65 additions and 85 deletions

View File

@@ -19,14 +19,14 @@ namespace Nz
friend DeviceObject;
public:
inline Swapchain(Device& instance);
Swapchain() = default;
Swapchain(const Swapchain&) = delete;
Swapchain(Swapchain&&) = default;
~Swapchain() = default;
inline bool AcquireNextImage(Nz::UInt64 timeout, VkSemaphore semaphore, VkFence fence, UInt32* imageIndex);
inline bool Create(const VkSwapchainCreateInfoKHR& createInfo, const VkAllocationCallbacks* allocator = nullptr);
inline bool Create(const DeviceHandle& device, const VkSwapchainCreateInfoKHR& createInfo, const VkAllocationCallbacks* allocator = nullptr);
inline VkImage GetImage(UInt32 index) const;
inline const std::vector<VkImage>& GetImages() const;
@@ -38,8 +38,8 @@ namespace Nz
Swapchain& operator=(Swapchain&&) = delete;
private:
static VkResult CreateHelper(Device& device, const VkSwapchainCreateInfoKHR* createInfo, const VkAllocationCallbacks* allocator, VkSwapchainKHR* handle);
static void DestroyHelper(Device& device, VkSwapchainKHR handle, const VkAllocationCallbacks* allocator);
static VkResult CreateHelper(const DeviceHandle& device, const VkSwapchainCreateInfoKHR* createInfo, const VkAllocationCallbacks* allocator, VkSwapchainKHR* handle);
static void DestroyHelper(const DeviceHandle& device, VkSwapchainKHR handle, const VkAllocationCallbacks* allocator);
std::vector<VkImage> m_images;
};