mirror of
https://github.com/doitsujin/dxvk.git
synced 2025-02-20 19:54:19 +01:00
[dxvk] Remove optional memory property flags one by one
We don't always want to remove HOST_CACHED if no DEVICE_LOCAL type exists, so iterate over the bits one by one.
This commit is contained in:
parent
346197c8c1
commit
48777c8fcf
@ -200,9 +200,14 @@ namespace dxvk {
|
||||
// If that still didn't work, probe slower memory types as well
|
||||
VkMemoryPropertyFlags optFlags = VK_MEMORY_PROPERTY_DEVICE_LOCAL_BIT
|
||||
| VK_MEMORY_PROPERTY_HOST_CACHED_BIT;
|
||||
VkMemoryPropertyFlags remFlags = 0;
|
||||
|
||||
if (!result && (flags & optFlags))
|
||||
result = this->tryAlloc(req, dedAllocPtr, flags & ~optFlags, priority);
|
||||
while (!result && (flags & optFlags)) {
|
||||
remFlags |= optFlags & -optFlags;
|
||||
optFlags &= ~remFlags;
|
||||
|
||||
result = this->tryAlloc(req, dedAllocPtr, flags & ~remFlags, priority);
|
||||
}
|
||||
|
||||
if (!result) {
|
||||
DxvkAdapterMemoryInfo memHeapInfo = m_device->adapter()->getMemoryHeapInfo();
|
||||
|
Loading…
x
Reference in New Issue
Block a user