From 5bd4fee1dcd696c5cf5e9624d0405c2443c1e1af Mon Sep 17 00:00:00 2001 From: lizzie Date: Mon, 22 Jun 2026 20:26:18 +0000 Subject: [PATCH] [vk] Prevent OOM due to increased staging buffer on *nix Signed-off-by: lizzie --- .../renderer_vulkan/vk_staging_buffer_pool.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/video_core/renderer_vulkan/vk_staging_buffer_pool.cpp b/src/video_core/renderer_vulkan/vk_staging_buffer_pool.cpp index 9637bace49..e3ec62c9fd 100644 --- a/src/video_core/renderer_vulkan/vk_staging_buffer_pool.cpp +++ b/src/video_core/renderer_vulkan/vk_staging_buffer_pool.cpp @@ -27,8 +27,17 @@ using namespace Common::Literals; // Maximum potential alignment of a Vulkan buffer constexpr VkDeviceSize MAX_ALIGNMENT = 256; + // Stream buffer size in bytes +// *NIX drivers are more sensitive to increased buffers for streaming. +// Windows ones however, can intake bigger buffers and generally do not OOM. +// - GTX 960 on Windows will not OOM with 256mib +// - GT 1030 on ^NIX will OOM with 256mib +#ifdef _WIN32 constexpr VkDeviceSize MAX_STREAM_BUFFER_SIZE = 256_MiB; +#else +constexpr VkDeviceSize MAX_STREAM_BUFFER_SIZE = 128_MiB; +#endif size_t GetStreamBufferSize(const Device& device) { if (!device.HasDebuggingToolAttached()) {