diff options
| author | Takoroka <137927095+Takoroka@users.noreply.github.com> | 2026-11-01 13:26:06 -0500 |
|---|---|---|
| committer | Takoroka <137927095+Takoroka@users.noreply.github.com> | 2026-11-01 13:26:06 -0500 |
| commit | 7e8d458f35008c6c959e1af0957b7ee57b9055e7 (patch) | |
| tree | 27f99c68e3f6d5b76b14890773c2a8f9e12c3088 /src | |
| parent | 825aa639186f8d4d218266888c9e7ed47dc53d36 (diff) | |
| parent | 9c8af5b2128884d0ef9644286d3ab08ee8e5df20 (diff) | |
Merge remote-tracking branch 'origin/fix/nx2-igpu-stream-buffer' into test/linux-all-prs
Diffstat (limited to 'src')
| -rw-r--r-- | src/video_core/renderer_vulkan/vk_staging_buffer_pool.cpp | 13 | ||||
| -rw-r--r-- | src/video_core/vulkan_common/vulkan_device.h | 5 |
2 files changed, 18 insertions, 0 deletions
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 7b6571d33d..95fa67c92a 100644 --- a/src/video_core/renderer_vulkan/vk_staging_buffer_pool.cpp +++ b/src/video_core/renderer_vulkan/vk_staging_buffer_pool.cpp @@ -41,6 +41,19 @@ constexpr VkDeviceSize MAX_STREAM_BUFFER_SIZE = 256_MiB; size_t GetStreamBufferSize(const Device& device) { if (!device.HasDebuggingToolAttached()) { + if (device.IsIntegrated()) { + // An integrated GPU's device-local host-visible heap can be no bigger than the stream + // buffer (Radeon 780M: 256 MiB, 243 MiB budget), which then sat over that budget. + // Leave a quarter of it free. + VkDeviceSize heap_size = 0; + ForEachDeviceLocalHostVisibleHeap( + device, [&heap_size](size_t, VkMemoryHeap& heap) { + heap_size = (std::max)(heap_size, heap.size); + }); + if (heap_size != 0 && heap_size <= MAX_STREAM_BUFFER_SIZE) { + return Common::AlignUp(heap_size * 3 / 4, MAX_ALIGNMENT); + } + } return MAX_STREAM_BUFFER_SIZE; } diff --git a/src/video_core/vulkan_common/vulkan_device.h b/src/video_core/vulkan_common/vulkan_device.h index 299792b5bb..f7f77bf197 100644 --- a/src/video_core/vulkan_common/vulkan_device.h +++ b/src/video_core/vulkan_common/vulkan_device.h @@ -958,6 +958,11 @@ FN_MAX_LIMIT_LIST return 0x00010300U; } + /// Returns true for an integrated GPU (its device-local memory is system memory). + bool IsIntegrated() const { + return is_integrated; + } + /// Returns true when a known debugging tool is attached. bool HasDebuggingToolAttached() const { return has_renderdoc || has_nsight_graphics || has_radeon_gpu_profiler; |
