mirror of
https://github.com/yuzu-emu/yuzu-android.git
synced 2024-12-29 20:05:36 +00:00
vk_buffer_cache: Handle null texture buffers
Fixes a crash on Age of Calamity cutscenes.
This commit is contained in:
parent
8f099af6a8
commit
b02c78b276
|
@ -97,6 +97,10 @@ Buffer::Buffer(BufferCacheRuntime& runtime, VideoCore::RasterizerInterface& rast
|
||||||
}
|
}
|
||||||
|
|
||||||
VkBufferView Buffer::View(u32 offset, u32 size, VideoCore::Surface::PixelFormat format) {
|
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) {
|
const auto it{std::ranges::find_if(views, [offset, size, format](const BufferView& view) {
|
||||||
return offset == view.offset && size == view.size && format == view.format;
|
return offset == view.offset && size == view.size && format == view.format;
|
||||||
})};
|
})};
|
||||||
|
|
Loading…
Reference in a new issue