Added VMA
This commit is contained in:
@@ -1,5 +1,7 @@
|
||||
#pragma once
|
||||
|
||||
#include <vk_mem_alloc.h>
|
||||
|
||||
#include <memory>
|
||||
#include <sophia/types.hpp>
|
||||
#include <vulkan/vulkan.hpp>
|
||||
@@ -16,11 +18,12 @@ class Image {
|
||||
|
||||
Image(const Image&) = delete;
|
||||
Image& operator=(const Image&) = delete;
|
||||
Image(Image&&) = default;
|
||||
Image(Image&& other) noexcept;
|
||||
Image& operator=(Image&&) = delete;
|
||||
~Image();
|
||||
|
||||
vk::Image get() const {
|
||||
return this->image ? this->image.get() : this->externalImage;
|
||||
return this->image ? this->image : this->externalImage;
|
||||
}
|
||||
vk::ImageView getView() const { return this->view.get(); }
|
||||
vk::Sampler getSampler() const { return this->sampler.get(); }
|
||||
@@ -56,8 +59,8 @@ class Image {
|
||||
Device& device;
|
||||
|
||||
vk::Image externalImage;
|
||||
vk::UniqueImage image;
|
||||
vk::UniqueDeviceMemory memory;
|
||||
vk::Image image;
|
||||
VmaAllocation allocation = VK_NULL_HANDLE;
|
||||
vk::UniqueImageView view;
|
||||
vk::UniqueSampler sampler;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user