diff options
author | GPUCode <geoster3d@gmail.com> | 2023-05-24 21:39:58 +0200 |
---|---|---|
committer | GPUCode <geoster3d@gmail.com> | 2023-06-18 11:45:18 +0200 |
commit | 48e39756f1ec6e6b0ef48f2444ce38a4e861e898 (patch) | |
tree | 223a51e03aa6da0df85d3a698630ae37315db257 /src/video_core/vulkan_common/vulkan_wrapper.cpp | |
parent | memory_allocator: Remove OpenGL interop (diff) | |
download | yuzu-48e39756f1ec6e6b0ef48f2444ce38a4e861e898.tar yuzu-48e39756f1ec6e6b0ef48f2444ce38a4e861e898.tar.gz yuzu-48e39756f1ec6e6b0ef48f2444ce38a4e861e898.tar.bz2 yuzu-48e39756f1ec6e6b0ef48f2444ce38a4e861e898.tar.lz yuzu-48e39756f1ec6e6b0ef48f2444ce38a4e861e898.tar.xz yuzu-48e39756f1ec6e6b0ef48f2444ce38a4e861e898.tar.zst yuzu-48e39756f1ec6e6b0ef48f2444ce38a4e861e898.zip |
Diffstat (limited to 'src/video_core/vulkan_common/vulkan_wrapper.cpp')
-rw-r--r-- | src/video_core/vulkan_common/vulkan_wrapper.cpp | 28 |
1 files changed, 14 insertions, 14 deletions
diff --git a/src/video_core/vulkan_common/vulkan_wrapper.cpp b/src/video_core/vulkan_common/vulkan_wrapper.cpp index 336f53700..5d088dc58 100644 --- a/src/video_core/vulkan_common/vulkan_wrapper.cpp +++ b/src/video_core/vulkan_common/vulkan_wrapper.cpp @@ -12,6 +12,10 @@ #include "video_core/vulkan_common/vulkan_wrapper.h" +#define VMA_STATIC_VULKAN_FUNCTIONS 0 +#define VMA_DYNAMIC_VULKAN_FUNCTIONS 1 +#include <vk_mem_alloc.h> + namespace Vulkan::vk { namespace { @@ -547,6 +551,16 @@ DebugUtilsMessenger Instance::CreateDebugUtilsMessenger( return DebugUtilsMessenger(object, handle, *dld); } +void Image::SetObjectNameEXT(const char* name) const { + SetObjectName(dld, owner, handle, VK_OBJECT_TYPE_IMAGE, name); +} + +void Image::Release() const noexcept { + if (handle) { + vmaDestroyImage(allocator, handle, allocation); + } +} + void Buffer::BindMemory(VkDeviceMemory memory, VkDeviceSize offset) const { Check(dld->vkBindBufferMemory(owner, handle, memory, offset)); } @@ -559,14 +573,6 @@ void BufferView::SetObjectNameEXT(const char* name) const { SetObjectName(dld, owner, handle, VK_OBJECT_TYPE_BUFFER_VIEW, name); } -void Image::BindMemory(VkDeviceMemory memory, VkDeviceSize offset) const { - Check(dld->vkBindImageMemory(owner, handle, memory, offset)); -} - -void Image::SetObjectNameEXT(const char* name) const { - SetObjectName(dld, owner, handle, VK_OBJECT_TYPE_IMAGE, name); -} - void ImageView::SetObjectNameEXT(const char* name) const { SetObjectName(dld, owner, handle, VK_OBJECT_TYPE_IMAGE_VIEW, name); } @@ -713,12 +719,6 @@ BufferView Device::CreateBufferView(const VkBufferViewCreateInfo& ci) const { return BufferView(object, handle, *dld); } -Image Device::CreateImage(const VkImageCreateInfo& ci) const { - VkImage object; - Check(dld->vkCreateImage(handle, &ci, nullptr, &object)); - return Image(object, handle, *dld); -} - ImageView Device::CreateImageView(const VkImageViewCreateInfo& ci) const { VkImageView object; Check(dld->vkCreateImageView(handle, &ci, nullptr, &object)); |