summaryrefslogtreecommitdiffstats
path: root/src/video_core/vulkan_common/vulkan_wrapper.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/video_core/vulkan_common/vulkan_wrapper.cpp')
-rw-r--r--src/video_core/vulkan_common/vulkan_wrapper.cpp24
1 files changed, 16 insertions, 8 deletions
diff --git a/src/video_core/vulkan_common/vulkan_wrapper.cpp b/src/video_core/vulkan_common/vulkan_wrapper.cpp
index 5d088dc58..c01a9478e 100644
--- a/src/video_core/vulkan_common/vulkan_wrapper.cpp
+++ b/src/video_core/vulkan_common/vulkan_wrapper.cpp
@@ -561,14 +561,28 @@ void Image::Release() const noexcept {
}
}
-void Buffer::BindMemory(VkDeviceMemory memory, VkDeviceSize offset) const {
- Check(dld->vkBindBufferMemory(owner, handle, memory, offset));
+void Buffer::Flush() const {
+ if (!is_coherent) {
+ vmaFlushAllocation(allocator, allocation, 0, VK_WHOLE_SIZE);
+ }
+}
+
+void Buffer::Invalidate() const {
+ if (!is_coherent) {
+ vmaInvalidateAllocation(allocator, allocation, 0, VK_WHOLE_SIZE);
+ }
}
void Buffer::SetObjectNameEXT(const char* name) const {
SetObjectName(dld, owner, handle, VK_OBJECT_TYPE_BUFFER, name);
}
+void Buffer::Release() const noexcept {
+ if (handle) {
+ vmaDestroyBuffer(allocator, handle, allocation);
+ }
+}
+
void BufferView::SetObjectNameEXT(const char* name) const {
SetObjectName(dld, owner, handle, VK_OBJECT_TYPE_BUFFER_VIEW, name);
}
@@ -707,12 +721,6 @@ Queue Device::GetQueue(u32 family_index) const noexcept {
return Queue(queue, *dld);
}
-Buffer Device::CreateBuffer(const VkBufferCreateInfo& ci) const {
- VkBuffer object;
- Check(dld->vkCreateBuffer(handle, &ci, nullptr, &object));
- return Buffer(object, handle, *dld);
-}
-
BufferView Device::CreateBufferView(const VkBufferViewCreateInfo& ci) const {
VkBufferView object;
Check(dld->vkCreateBufferView(handle, &ci, nullptr, &object));