|
|
@ -623,9 +623,10 @@ public: |
|
|
|
|
|
|
|
|
class Image { |
|
|
class Image { |
|
|
public: |
|
|
public: |
|
|
explicit Image(VkImage handle_, VkDevice owner_, VmaAllocator allocator_, |
|
|
|
|
|
VmaAllocation allocation_, const DeviceDispatch& dld_) noexcept |
|
|
|
|
|
: handle{handle_}, owner{owner_}, allocator{allocator_}, |
|
|
|
|
|
|
|
|
explicit Image(VkImage handle_, VkImageUsageFlags usage_, VkDevice owner_, |
|
|
|
|
|
VmaAllocator allocator_, VmaAllocation allocation_, |
|
|
|
|
|
const DeviceDispatch& dld_) noexcept |
|
|
|
|
|
: handle{handle_}, usage{usage_}, owner{owner_}, allocator{allocator_}, |
|
|
allocation{allocation_}, dld{&dld_} {} |
|
|
allocation{allocation_}, dld{&dld_} {} |
|
|
Image() = default; |
|
|
Image() = default; |
|
|
|
|
|
|
|
|
@ -633,12 +634,13 @@ public: |
|
|
Image& operator=(const Image&) = delete; |
|
|
Image& operator=(const Image&) = delete; |
|
|
|
|
|
|
|
|
Image(Image&& rhs) noexcept |
|
|
Image(Image&& rhs) noexcept |
|
|
: handle{std::exchange(rhs.handle, nullptr)}, owner{rhs.owner}, allocator{rhs.allocator}, |
|
|
|
|
|
allocation{rhs.allocation}, dld{rhs.dld} {} |
|
|
|
|
|
|
|
|
: handle{std::exchange(rhs.handle, nullptr)}, usage{rhs.usage}, owner{rhs.owner}, |
|
|
|
|
|
allocator{rhs.allocator}, allocation{rhs.allocation}, dld{rhs.dld} {} |
|
|
|
|
|
|
|
|
Image& operator=(Image&& rhs) noexcept { |
|
|
Image& operator=(Image&& rhs) noexcept { |
|
|
Release(); |
|
|
Release(); |
|
|
handle = std::exchange(rhs.handle, nullptr); |
|
|
handle = std::exchange(rhs.handle, nullptr); |
|
|
|
|
|
usage = rhs.usage; |
|
|
owner = rhs.owner; |
|
|
owner = rhs.owner; |
|
|
allocator = rhs.allocator; |
|
|
allocator = rhs.allocator; |
|
|
allocation = rhs.allocation; |
|
|
allocation = rhs.allocation; |
|
|
@ -665,10 +667,15 @@ public: |
|
|
|
|
|
|
|
|
void SetObjectNameEXT(const char* name) const; |
|
|
void SetObjectNameEXT(const char* name) const; |
|
|
|
|
|
|
|
|
|
|
|
[[nodiscard]] VkImageUsageFlags UsageFlags() const noexcept { |
|
|
|
|
|
return usage; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
private: |
|
|
private: |
|
|
void Release() const noexcept; |
|
|
void Release() const noexcept; |
|
|
|
|
|
|
|
|
VkImage handle = nullptr; |
|
|
VkImage handle = nullptr; |
|
|
|
|
|
VkImageUsageFlags usage{}; |
|
|
VkDevice owner = nullptr; |
|
|
VkDevice owner = nullptr; |
|
|
VmaAllocator allocator = nullptr; |
|
|
VmaAllocator allocator = nullptr; |
|
|
VmaAllocation allocation = nullptr; |
|
|
VmaAllocation allocation = nullptr; |
|
|
|