From 33981e6a21ef20091b39445f4a694401956d4ced Mon Sep 17 00:00:00 2001 From: Jeff Date: Sun, 26 Jan 2025 19:43:52 +0000 Subject: [PATCH] [dxvk] Store AMD overalloc info in DxvkDeviceFeatures --- src/dxvk/dxvk_adapter.cpp | 6 +++--- src/dxvk/dxvk_device_info.h | 1 + 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/dxvk/dxvk_adapter.cpp b/src/dxvk/dxvk_adapter.cpp index 1285c4eeb..efe66cfd9 100644 --- a/src/dxvk/dxvk_adapter.cpp +++ b/src/dxvk/dxvk_adapter.cpp @@ -453,8 +453,8 @@ namespace dxvk { this->logFeatures(enabledFeatures); // Report the desired overallocation behaviour to the driver - VkDeviceMemoryOverallocationCreateInfoAMD overallocInfo = { VK_STRUCTURE_TYPE_DEVICE_MEMORY_OVERALLOCATION_CREATE_INFO_AMD }; - overallocInfo.overallocationBehavior = VK_MEMORY_OVERALLOCATION_BEHAVIOR_ALLOWED_AMD; + enabledFeatures.amdOverallocation = { VK_STRUCTURE_TYPE_DEVICE_MEMORY_OVERALLOCATION_CREATE_INFO_AMD }; + enabledFeatures.amdOverallocation.overallocationBehavior = VK_MEMORY_OVERALLOCATION_BEHAVIOR_ALLOWED_AMD; // Create the requested queues float queuePriority = 1.0f; @@ -487,7 +487,7 @@ namespace dxvk { info.pEnabledFeatures = &enabledFeatures.core.features; if (devExtensions.amdMemoryOverallocationBehaviour) - overallocInfo.pNext = std::exchange(info.pNext, &overallocInfo); + enabledFeatures.amdOverallocation.pNext = std::exchange(info.pNext, &enabledFeatures.amdOverallocation); VkDevice device = VK_NULL_HANDLE; VkResult vr = m_vki->vkCreateDevice(m_handle, &info, nullptr, &device); diff --git a/src/dxvk/dxvk_device_info.h b/src/dxvk/dxvk_device_info.h index 87f444a9d..16747b2e1 100644 --- a/src/dxvk/dxvk_device_info.h +++ b/src/dxvk/dxvk_device_info.h @@ -77,6 +77,7 @@ namespace dxvk { VkBool32 nvxBinaryImport; VkBool32 nvxImageViewHandle; VkBool32 khrWin32KeyedMutex; + VkDeviceMemoryOverallocationCreateInfoAMD amdOverallocation; }; } \ No newline at end of file