Skip to content

Commit 804205c

Browse files
committed
dxvk: log VkResult from vkAllocateMemory on allocation failure
1 parent d89150c commit 804205c

1 file changed

Lines changed: 7 additions & 2 deletions

File tree

src/dxvk/dxvk_memory.cpp

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1329,11 +1329,16 @@ namespace dxvk {
13291329
DxvkDeviceMemory result = { };
13301330
result.size = size;
13311331

1332-
if (vk->vkAllocateMemory(vk->device(), &memoryInfo, nullptr, &result.memory)) {
1332+
if (VkResult vr = vk->vkAllocateMemory(vk->device(), &memoryInfo, nullptr, &result.memory)) {
13331333
freeEmptyChunksInHeap(*type.heap, VkDeviceSize(-1), high_resolution_clock::time_point());
13341334

1335-
if (vk->vkAllocateMemory(vk->device(), &memoryInfo, nullptr, &result.memory))
1335+
if ((vr = vk->vkAllocateMemory(vk->device(), &memoryInfo, nullptr, &result.memory))) {
1336+
Logger::warn(str::format("DxvkMemoryAllocator: vkAllocateMemory failed",
1337+
"\n size: ", std::dec, size,
1338+
"\n type: ", type.index,
1339+
"\n result: ", vr));
13361340
return DxvkDeviceMemory();
1341+
}
13371342
}
13381343

13391344
// Technically redundant if EXT_memory_priority is also supported, but this shouldn't hurt

0 commit comments

Comments
 (0)