From 26ed914707f62181c54f851ce821a2da580a133a Mon Sep 17 00:00:00 2001 From: Philip Rebohle Date: Tue, 4 Mar 2025 02:05:34 +0100 Subject: [PATCH] [dxvk] Add flag to avoid creating dedicated allocations --- src/dxvk/dxvk_memory.cpp | 3 +++ src/dxvk/dxvk_memory.h | 2 ++ 2 files changed, 5 insertions(+) diff --git a/src/dxvk/dxvk_memory.cpp b/src/dxvk/dxvk_memory.cpp index c31dafb83..b6a61c6d5 100644 --- a/src/dxvk/dxvk_memory.cpp +++ b/src/dxvk/dxvk_memory.cpp @@ -932,6 +932,9 @@ namespace dxvk { dedicatedRequirements.prefersDedicatedAllocation = VK_TRUE; } + if (!dedicatedRequirements.requiresDedicatedAllocation && allocationInfo.mode.test(DxvkAllocationMode::NoDedicated)) + dedicatedRequirements.prefersDedicatedAllocation = VK_FALSE; + Rc allocation; if (!(createInfo.flags & VK_IMAGE_CREATE_SPARSE_BINDING_BIT)) { diff --git a/src/dxvk/dxvk_memory.h b/src/dxvk/dxvk_memory.h index bd7f685d1..c432df0f2 100644 --- a/src/dxvk/dxvk_memory.h +++ b/src/dxvk/dxvk_memory.h @@ -959,6 +959,8 @@ namespace dxvk { /// If set, the allocation will only succeed if it /// can be suballocated from an existing chunk. NoAllocation = 1, + /// Avoid using a dedicated allocation for this resource + NoDedicated = 2, eFlagEnum };