diff options
Diffstat (limited to 'chromium/third_party/dawn/src/dawn_native/vulkan/MemoryAllocator.cpp')
-rw-r--r-- | chromium/third_party/dawn/src/dawn_native/vulkan/MemoryAllocator.cpp | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/chromium/third_party/dawn/src/dawn_native/vulkan/MemoryAllocator.cpp b/chromium/third_party/dawn/src/dawn_native/vulkan/MemoryAllocator.cpp index 66a779e6f47..abd53da6f16 100644 --- a/chromium/third_party/dawn/src/dawn_native/vulkan/MemoryAllocator.cpp +++ b/chromium/third_party/dawn/src/dawn_native/vulkan/MemoryAllocator.cpp @@ -41,9 +41,7 @@ namespace dawn_native { namespace vulkan { MemoryAllocator::~MemoryAllocator() { } - bool MemoryAllocator::Allocate(VkMemoryRequirements requirements, - bool mappable, - DeviceMemoryAllocation* allocation) { + int MemoryAllocator::FindBestTypeIndex(VkMemoryRequirements requirements, bool mappable) { const VulkanDeviceInfo& info = mDevice->GetDeviceInfo(); // Find a suitable memory type for this allocation @@ -93,6 +91,14 @@ namespace dawn_native { namespace vulkan { } } + return bestType; + } + + bool MemoryAllocator::Allocate(VkMemoryRequirements requirements, + bool mappable, + DeviceMemoryAllocation* allocation) { + int bestType = FindBestTypeIndex(requirements, mappable); + // TODO(cwallez@chromium.org): I think the Vulkan spec guarantees this should never happen if (bestType == -1) { ASSERT(false); |