@@ -92,7 +92,8 @@ void swap(ImageSampler& lhs, ImageSampler& rhs) noexcept {
9292//
9393
9494VulkanImage::VulkanImage ()
95- : image_properties_{},
95+ : device_{VK_NULL_HANDLE},
96+ image_properties_{},
9697 view_properties_{},
9798 sampler_properties_{},
9899 allocator_ (VK_NULL_HANDLE),
@@ -108,15 +109,17 @@ VulkanImage::VulkanImage()
108109 layout_{} {}
109110
110111VulkanImage::VulkanImage (
112+ VkDevice device,
111113 VmaAllocator vma_allocator,
112114 const VmaAllocationCreateInfo& allocation_create_info,
113115 const ImageProperties& image_props,
114116 const ViewProperties& view_props,
115117 const SamplerProperties& sampler_props,
116- const VkImageLayout layout,
117118 VkSampler sampler,
119+ const VkImageLayout layout,
118120 const bool allocate_memory)
119- : image_properties_(image_props),
121+ : device_{device},
122+ image_properties_ (image_props),
120123 view_properties_ (view_props),
121124 sampler_properties_ (sampler_props),
122125 allocator_ (vma_allocator),
@@ -178,8 +181,31 @@ VulkanImage::VulkanImage(
178181 }
179182}
180183
184+ VulkanImage::VulkanImage (
185+ VkDevice device,
186+ const ImageProperties& image_props,
187+ VkImage image,
188+ VkImageView image_view,
189+ VkSampler sampler,
190+ const VkImageLayout layout)
191+ : device_{device},
192+ image_properties_{image_props},
193+ view_properties_{},
194+ sampler_properties_{},
195+ allocator_ (VK_NULL_HANDLE),
196+ memory_{},
197+ owns_memory_ (false ),
198+ is_copy_ (false ),
199+ handles_{
200+ image,
201+ image_view,
202+ sampler,
203+ },
204+ layout_{layout} {}
205+
181206VulkanImage::VulkanImage (const VulkanImage& other) noexcept
182- : image_properties_(other.image_properties_),
207+ : device_(other.device_),
208+ image_properties_ (other.image_properties_),
183209 view_properties_(other.view_properties_),
184210 sampler_properties_(other.sampler_properties_),
185211 allocator_(other.allocator_),
@@ -191,7 +217,8 @@ VulkanImage::VulkanImage(const VulkanImage& other) noexcept
191217 layout_ (other.layout_) {}
192218
193219VulkanImage::VulkanImage (VulkanImage&& other) noexcept
194- : image_properties_(other.image_properties_),
220+ : device_(other.device_),
221+ image_properties_ (other.image_properties_),
195222 view_properties_(other.view_properties_),
196223 sampler_properties_(other.sampler_properties_),
197224 allocator_(other.allocator_),
@@ -212,6 +239,7 @@ VulkanImage& VulkanImage::operator=(VulkanImage&& other) noexcept {
212239 VkImageView tmp_image_view = handles_.image_view ;
213240 bool tmp_owns_memory = owns_memory_;
214241
242+ device_ = other.device_ ;
215243 image_properties_ = other.image_properties_ ;
216244 view_properties_ = other.view_properties_ ;
217245 sampler_properties_ = other.sampler_properties_ ;
0 commit comments