summaryrefslogtreecommitdiffstats
path: root/src/video_core
diff options
context:
space:
mode:
authorReinUsesLisp <reinuseslisp@airmail.cc>2021-06-02 23:50:01 +0200
committerameerj <52414509+ameerj@users.noreply.github.com>2021-07-23 03:51:34 +0200
commitb02c78b276f449318bdc787a35d123df01c0bc6d (patch)
treeef3eb259f27e24cdac8565d8f8bfe08565756e8a /src/video_core
parentnsight_aftermath_tracker: Fix SPIR-V module writes (diff)
downloadyuzu-b02c78b276f449318bdc787a35d123df01c0bc6d.tar
yuzu-b02c78b276f449318bdc787a35d123df01c0bc6d.tar.gz
yuzu-b02c78b276f449318bdc787a35d123df01c0bc6d.tar.bz2
yuzu-b02c78b276f449318bdc787a35d123df01c0bc6d.tar.lz
yuzu-b02c78b276f449318bdc787a35d123df01c0bc6d.tar.xz
yuzu-b02c78b276f449318bdc787a35d123df01c0bc6d.tar.zst
yuzu-b02c78b276f449318bdc787a35d123df01c0bc6d.zip
Diffstat (limited to 'src/video_core')
-rw-r--r--src/video_core/renderer_vulkan/vk_buffer_cache.cpp4
1 files changed, 4 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 2da3de6de..f4b3ee95c 100644
--- a/src/video_core/renderer_vulkan/vk_buffer_cache.cpp
+++ b/src/video_core/renderer_vulkan/vk_buffer_cache.cpp
@@ -97,6 +97,10 @@ Buffer::Buffer(BufferCacheRuntime& runtime, VideoCore::RasterizerInterface& rast
}
VkBufferView Buffer::View(u32 offset, u32 size, VideoCore::Surface::PixelFormat format) {
+ if (!device) {
+ // Null buffer, return a null descriptor
+ return VK_NULL_HANDLE;
+ }
const auto it{std::ranges::find_if(views, [offset, size, format](const BufferView& view) {
return offset == view.offset && size == view.size && format == view.format;
})};