diff options
| author | xbzk <xbzk@eden-emu.dev> | 2026-06-03 05:02:13 +0200 |
|---|---|---|
| committer | crueter <crueter@eden-emu.dev> | 2026-06-03 05:02:13 +0200 |
| commit | ec2b9b04001ebea637f01273ac8e6c17b2cc8390 (patch) | |
| tree | 672949aeedfba37367021e74ce6b06d3175347f5 /src | |
| parent | 5027aecf772988279bf112442b9070a0ae554c2a (diff) | |
[vk, renderdoc] fixed zero-sized streambuffer bug on old heap-absent GPUs (#4052)
This fix a bug in which eden crashes when renderdoc is attached to vulkan.
that kept me away from renderdoc for around a year now.
the bug:
in video_core\renderer_vulkan\vk_staging_buffer_pool.cpp
in GetStreamBufferSize(...)
if device.HasDebuggingToolAttached()
but heap is empty/unavailable <-- Case in my old nvidia kepler gpu
the original method returns size 0, right?
the change honors same original behavior, while covers my case properly, returning MAX_STREAM_BUFFER_SIZE.
addl some log tip and some minimal doc. fully safe. let it rip.
Reviewed-on: https://git.eden-emu.dev/eden-emu/eden/pulls/4052
Reviewed-by: MaranBr <maranbr@eden-emu.dev>
Reviewed-by: Lizzie <lizzie@eden-emu.dev>
Diffstat (limited to 'src')
| -rw-r--r-- | src/video_core/renderer_vulkan/vk_staging_buffer_pool.cpp | 17 | ||||
| -rw-r--r-- | src/video_core/vulkan_common/vulkan_device.cpp | 6 |
2 files changed, 18 insertions, 5 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 08513d1534..633b202290 100644 --- a/src/video_core/renderer_vulkan/vk_staging_buffer_pool.cpp +++ b/src/video_core/renderer_vulkan/vk_staging_buffer_pool.cpp @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: Copyright 2025 Eden Emulator Project +// SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project // SPDX-License-Identifier: GPL-3.0-or-later // SPDX-FileCopyrightText: Copyright 2022 yuzu Emulator Project @@ -31,11 +31,18 @@ constexpr VkDeviceSize MAX_ALIGNMENT = 256; constexpr VkDeviceSize MAX_STREAM_BUFFER_SIZE = 128_MiB; size_t GetStreamBufferSize(const Device& device) { + if (!device.HasDebuggingToolAttached()) { + return MAX_STREAM_BUFFER_SIZE; + } + VkDeviceSize size{0}; - if (device.HasDebuggingToolAttached()) { - ForEachDeviceLocalHostVisibleHeap(device, [&size](size_t index, VkMemoryHeap& heap) { - size = (std::max)(size, heap.size); - }); + bool has_device_local_host_visible_heap{}; + ForEachDeviceLocalHostVisibleHeap(device, [&size, &has_device_local_host_visible_heap]( + size_t index, VkMemoryHeap& heap) { + has_device_local_host_visible_heap = true; + size = (std::max)(size, heap.size); + }); + if (has_device_local_host_visible_heap) { // If rebar is not supported, cut the max heap size to 40%. This will allow 2 captures to be // loaded at the same time in RenderDoc. If rebar is supported, this shouldn't be an issue // as the heap will be much larger. diff --git a/src/video_core/vulkan_common/vulkan_device.cpp b/src/video_core/vulkan_common/vulkan_device.cpp index 3435c4d88f..59985067db 100644 --- a/src/video_core/vulkan_common/vulkan_device.cpp +++ b/src/video_core/vulkan_common/vulkan_device.cpp @@ -1481,6 +1481,12 @@ void Device::CollectToolingInfo() { has_nsight_graphics = has_nsight_graphics || name == "NVIDIA Nsight Graphics"; has_radeon_gpu_profiler = has_radeon_gpu_profiler || name == "Radeon GPU Profiler"; } +#ifdef _WIN32 + if (has_renderdoc) { + LOG_INFO(Render_Vulkan, + "Windows default RenderDoc output folder: %LOCALAPPDATA%\\Temp\\RenderDoc"); + } +#endif } std::vector<VkDeviceQueueCreateInfo> Device::GetDeviceQueueCreateInfos() const { |
