diff options
author | Liam <liamwhite@users.noreply.github.com> | 2022-12-07 03:43:14 +0100 |
---|---|---|
committer | Liam <byteslice@airmail.cc> | 2023-01-05 04:14:01 +0100 |
commit | 66ae79de133bfe4d6f02451136aa87aef52efc80 (patch) | |
tree | 85347da97ffd6e114e291f2d26a273afa4451742 /src/video_core/renderer_vulkan/vk_buffer_cache.cpp | |
parent | Merge pull request #9501 from FernandoS27/yfc-rel-2 (diff) | |
download | yuzu-66ae79de133bfe4d6f02451136aa87aef52efc80.tar yuzu-66ae79de133bfe4d6f02451136aa87aef52efc80.tar.gz yuzu-66ae79de133bfe4d6f02451136aa87aef52efc80.tar.bz2 yuzu-66ae79de133bfe4d6f02451136aa87aef52efc80.tar.lz yuzu-66ae79de133bfe4d6f02451136aa87aef52efc80.tar.xz yuzu-66ae79de133bfe4d6f02451136aa87aef52efc80.tar.zst yuzu-66ae79de133bfe4d6f02451136aa87aef52efc80.zip |
Diffstat (limited to 'src/video_core/renderer_vulkan/vk_buffer_cache.cpp')
-rw-r--r-- | src/video_core/renderer_vulkan/vk_buffer_cache.cpp | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/src/video_core/renderer_vulkan/vk_buffer_cache.cpp b/src/video_core/renderer_vulkan/vk_buffer_cache.cpp index 487d8b416..b0153a502 100644 --- a/src/video_core/renderer_vulkan/vk_buffer_cache.cpp +++ b/src/video_core/renderer_vulkan/vk_buffer_cache.cpp @@ -336,6 +336,9 @@ void BufferCacheRuntime::Finish() { void BufferCacheRuntime::CopyBuffer(VkBuffer dst_buffer, VkBuffer src_buffer, std::span<const VideoCommon::BufferCopy> copies, bool barrier) { + if (dst_buffer == VK_NULL_HANDLE || src_buffer == VK_NULL_HANDLE) { + return; + } static constexpr VkMemoryBarrier READ_BARRIER{ .sType = VK_STRUCTURE_TYPE_MEMORY_BARRIER, .pNext = nullptr, @@ -394,6 +397,9 @@ void BufferCacheRuntime::PostCopyBarrier() { } void BufferCacheRuntime::ClearBuffer(VkBuffer dest_buffer, u32 offset, size_t size, u32 value) { + if (dest_buffer == VK_NULL_HANDLE) { + return; + } static constexpr VkMemoryBarrier READ_BARRIER{ .sType = VK_STRUCTURE_TYPE_MEMORY_BARRIER, .pNext = nullptr, @@ -473,6 +479,11 @@ void BufferCacheRuntime::BindVertexBuffer(u32 index, VkBuffer buffer, u32 offset cmdbuf.BindVertexBuffers2EXT(index, 1, &buffer, &vk_offset, &vk_size, &vk_stride); }); } else { + if (!device.HasNullDescriptor() && buffer == VK_NULL_HANDLE) { + ReserveNullBuffer(); + buffer = *null_buffer; + offset = 0; + } scheduler.Record([index, buffer, offset](vk::CommandBuffer cmdbuf) { cmdbuf.BindVertexBuffer(index, buffer, offset); }); |