diff --git a/src/dxvk/dxvk_memory.cpp b/src/dxvk/dxvk_memory.cpp index 520021ea8..d01159deb 100644 --- a/src/dxvk/dxvk_memory.cpp +++ b/src/dxvk/dxvk_memory.cpp @@ -276,6 +276,12 @@ namespace dxvk { if (req.dedicated.requiresDedicatedAllocation && (info.flags & VK_MEMORY_PROPERTY_DEVICE_LOCAL_BIT)) { allocation = allocateDedicatedMemory(req.core.memoryRequirements, info.flags & ~VK_MEMORY_PROPERTY_DEVICE_LOCAL_BIT, &info.dedicated); + + if (unlikely(!allocation)) { + logMemoryError(req.core.memoryRequirements); + logMemoryStats(); + } + return DxvkMemory(std::move(allocation)); } } @@ -286,6 +292,11 @@ namespace dxvk { if (unlikely(!allocation) && (info.flags & VK_MEMORY_PROPERTY_DEVICE_LOCAL_BIT)) { allocation = allocateMemory(req.core.memoryRequirements, info.flags & ~VK_MEMORY_PROPERTY_DEVICE_LOCAL_BIT); + + if (unlikely(!allocation)) { + logMemoryError(req.core.memoryRequirements); + logMemoryStats(); + } } return DxvkMemory(std::move(allocation)); @@ -379,9 +390,6 @@ namespace dxvk { } } - logMemoryError(requirements); - logMemoryStats(); - return nullptr; }