Vulkan: Fix finding of the largest candidate heap.
BUG=dawn:98
Change-Id: Ibcae3a760b9feb2cbba47d40c3eeea9e63481682
Reviewed-on: https://dawn-review.googlesource.com/c/4340
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
diff --git a/src/dawn_native/vulkan/MemoryAllocator.cpp b/src/dawn_native/vulkan/MemoryAllocator.cpp
index 3ab6c26..e71adcb 100644
--- a/src/dawn_native/vulkan/MemoryAllocator.cpp
+++ b/src/dawn_native/vulkan/MemoryAllocator.cpp
@@ -80,8 +80,7 @@
// 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<int>(i);
continue;