diff --git a/src/dawn_native/vulkan/MemoryAllocator.cpp b/src/dawn_native/vulkan/MemoryAllocator.cpp index 3ab6c26d47..e71adcb319 100644 --- a/src/dawn_native/vulkan/MemoryAllocator.cpp +++ b/src/dawn_native/vulkan/MemoryAllocator.cpp @@ -80,8 +80,7 @@ namespace dawn_native { namespace vulkan { // All things equal favor the memory in the biggest heap VkDeviceSize bestTypeHeapSize = info.memoryHeaps[info.memoryTypes[bestType].heapIndex].size; - VkDeviceSize candidateHeapSize = - info.memoryHeaps[info.memoryTypes[bestType].heapIndex].size; + VkDeviceSize candidateHeapSize = info.memoryHeaps[info.memoryTypes[i].heapIndex].size; if (candidateHeapSize > bestTypeHeapSize) { bestType = static_cast(i); continue;