diff options
Diffstat (limited to 'Ryujinx.Ava/Ui/Backend/Vulkan/VulkanImage.cs')
-rw-r--r-- | Ryujinx.Ava/Ui/Backend/Vulkan/VulkanImage.cs | 22 |
1 files changed, 10 insertions, 12 deletions
diff --git a/Ryujinx.Ava/Ui/Backend/Vulkan/VulkanImage.cs b/Ryujinx.Ava/Ui/Backend/Vulkan/VulkanImage.cs index 343ba760..3fbb8665 100644 --- a/Ryujinx.Ava/Ui/Backend/Vulkan/VulkanImage.cs +++ b/Ryujinx.Ava/Ui/Backend/Vulkan/VulkanImage.cs @@ -148,20 +148,18 @@ namespace Ryujinx.Ava.Ui.Vulkan _currentAccessFlags = destinationAccessFlags; } - public void TransitionLayout(uint destinationLayout, uint destinationAccessFlags) + public void Dispose() { - TransitionLayout((ImageLayout)destinationLayout, (AccessFlags)destinationAccessFlags); - } - - public unsafe void Dispose() - { - _device.Api.DestroyImageView(_device.InternalHandle, _imageView.Value, null); - _device.Api.DestroyImage(_device.InternalHandle, InternalHandle.Value, null); - _device.Api.FreeMemory(_device.InternalHandle, _imageMemory, null); + if (InternalHandle != null) + { + _device.Api.DestroyImageView(_device.InternalHandle, _imageView.Value, Span<AllocationCallbacks>.Empty); + _device.Api.DestroyImage(_device.InternalHandle, InternalHandle.Value, Span<AllocationCallbacks>.Empty); + _device.Api.FreeMemory(_device.InternalHandle, _imageMemory, Span<AllocationCallbacks>.Empty); - _imageView = default; - InternalHandle = default; - _imageMemory = default; + _imageView = default; + InternalHandle = null; + _imageMemory = default; + } } } } |