From 2edc9c880e6c5b929b2f2337a5e49e838172e64d Mon Sep 17 00:00:00 2001 From: Philip Rebohle Date: Tue, 4 Mar 2025 02:09:26 +0100 Subject: [PATCH] [dxvk] Add flag to avoid dedicated allocations for short-lived images --- src/dxvk/dxvk_image.cpp | 3 +++ src/dxvk/dxvk_image.h | 3 +++ 2 files changed, 6 insertions(+) diff --git a/src/dxvk/dxvk_image.cpp b/src/dxvk/dxvk_image.cpp index e085ff570..25a330b2d 100644 --- a/src/dxvk/dxvk_image.cpp +++ b/src/dxvk/dxvk_image.cpp @@ -216,6 +216,9 @@ namespace dxvk { allocationInfo.properties = m_properties; allocationInfo.mode = mode; + if (m_info.transient) + allocationInfo.mode.set(DxvkAllocationMode::NoDedicated); + return m_allocator->createImageResource(imageInfo, allocationInfo, sharedMemoryInfo); } diff --git a/src/dxvk/dxvk_image.h b/src/dxvk/dxvk_image.h index 78b863868..b6126bdc7 100644 --- a/src/dxvk/dxvk_image.h +++ b/src/dxvk/dxvk_image.h @@ -63,6 +63,9 @@ namespace dxvk { // to be in its default layout after each submission VkBool32 shared = VK_FALSE; + // Image is likely to have a short lifetime + VkBool32 transient = VK_FALSE; + // Image view formats that can // be used with this image uint32_t viewFormatCount = 0;