Added VMA

This commit is contained in:
2026-09-30 01:31:59 -07:00
parent fc70475538
commit 97ff85ea8a
9 changed files with 118 additions and 119 deletions
+7 -4
View File
@@ -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;