diff options
| author | 2020-09-25 17:42:59 -0400 | |
|---|---|---|
| committer | 2020-09-25 17:42:59 -0400 | |
| commit | ca26fd0f4297bc5cdf495c5304ed0bd9737f40b2 (patch) | |
| tree | 9663ee60c06345e55d242fa71bdf204ecf8c4346 /src | |
| parent | Merge pull request #4717 from lioncash/debug (diff) | |
| download | yuzu-ca26fd0f4297bc5cdf495c5304ed0bd9737f40b2.tar.gz yuzu-ca26fd0f4297bc5cdf495c5304ed0bd9737f40b2.tar.xz yuzu-ca26fd0f4297bc5cdf495c5304ed0bd9737f40b2.zip | |
vk_stream_buffer: Fix initializing Vulkan with NVIDIA on Linux
The previous fix only partially solved the issue, as only certain GPUs that needed 9 or less MiB subtracted would work (i.e. GTX 980 Ti, GT 730). This takes from DXVK's example to divide `heap_size` by 2 to determine `allocable_size`. Additionally tested on my Quadro K4200, which previously required setting it to 12 to boot.
Diffstat (limited to '')
| -rw-r--r-- | src/video_core/renderer_vulkan/vk_stream_buffer.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/video_core/renderer_vulkan/vk_stream_buffer.cpp b/src/video_core/renderer_vulkan/vk_stream_buffer.cpp index 5218c875b..1b59612b9 100644 --- a/src/video_core/renderer_vulkan/vk_stream_buffer.cpp +++ b/src/video_core/renderer_vulkan/vk_stream_buffer.cpp | |||
| @@ -120,7 +120,8 @@ void VKStreamBuffer::CreateBuffers(VkBufferUsageFlags usage) { | |||
| 120 | 120 | ||
| 121 | // Substract from the preferred heap size some bytes to avoid getting out of memory. | 121 | // Substract from the preferred heap size some bytes to avoid getting out of memory. |
| 122 | const VkDeviceSize heap_size = memory_properties.memoryHeaps[preferred_heap].size; | 122 | const VkDeviceSize heap_size = memory_properties.memoryHeaps[preferred_heap].size; |
| 123 | const VkDeviceSize allocable_size = heap_size - 9 * 1024 * 1024; | 123 | // As per DXVK's example, using `heap_size / 2` |
| 124 | const VkDeviceSize allocable_size = heap_size / 2; | ||
| 124 | buffer = device.GetLogical().CreateBuffer({ | 125 | buffer = device.GetLogical().CreateBuffer({ |
| 125 | .sType = VK_STRUCTURE_TYPE_BUFFER_CREATE_INFO, | 126 | .sType = VK_STRUCTURE_TYPE_BUFFER_CREATE_INFO, |
| 126 | .pNext = nullptr, | 127 | .pNext = nullptr, |