From bd1a2aa5a12e3a95c836f069de2adab779fb6e83 Mon Sep 17 00:00:00 2001 From: Robin Kertels Date: Sat, 12 Mar 2022 23:38:22 +0100 Subject: [PATCH] [dxvk] Force dedicated allocation for exportable images The Nvidia driver does not set prefers-/requiresDedicatedAllocation for exportable images on its own. This makes DXVK ignore the dedicated allocation struct ptr which also contains VkExportMemoryAllocateInfo or VkImportMemoryWin32HandleInfoKHR. --- src/dxvk/dxvk_image.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/dxvk/dxvk_image.cpp b/src/dxvk/dxvk_image.cpp index ab0e07c4..851bbc53 100644 --- a/src/dxvk/dxvk_image.cpp +++ b/src/dxvk/dxvk_image.cpp @@ -140,6 +140,11 @@ namespace dxvk { if (isGpuWritable) hints.set(DxvkMemoryFlag::GpuWritable); + if (m_shared) { + dedicatedRequirements.prefersDedicatedAllocation = VK_TRUE; + dedicatedRequirements.requiresDedicatedAllocation = VK_TRUE; + } + // Ask driver whether we should be using a dedicated allocation m_image.memory = memAlloc.alloc(&memReq.memoryRequirements, dedicatedRequirements, dedMemoryAllocInfo, memFlags, hints);