| Index: src/gpu/vk/GrVkBuffer.cpp
|
| diff --git a/src/gpu/vk/GrVkBuffer.cpp b/src/gpu/vk/GrVkBuffer.cpp
|
| index 0718fa5e929af16a232dcf9685bb7bf74c32734c..24a593a9a713d3eefef17f4d7df7f0464702da6e 100644
|
| --- a/src/gpu/vk/GrVkBuffer.cpp
|
| +++ b/src/gpu/vk/GrVkBuffer.cpp
|
| @@ -57,14 +57,23 @@ const GrVkBuffer::Resource* GrVkBuffer::Create(const GrVkGpu* gpu, const Desc& d
|
| }
|
|
|
| VkMemoryPropertyFlags requiredMemProps = VK_MEMORY_PROPERTY_HOST_VISIBLE_BIT |
|
| - VK_MEMORY_PROPERTY_HOST_COHERENT_BIT;
|
| + VK_MEMORY_PROPERTY_HOST_COHERENT_BIT |
|
| + VK_MEMORY_PROPERTY_HOST_CACHED_BIT;
|
|
|
| if (!GrVkMemory::AllocAndBindBufferMemory(gpu,
|
| buffer,
|
| requiredMemProps,
|
| &alloc)) {
|
| - VK_CALL(gpu, DestroyBuffer(gpu->device(), buffer, nullptr));
|
| - return nullptr;
|
| + // Try again without requiring host cached memory
|
| + requiredMemProps = VK_MEMORY_PROPERTY_HOST_VISIBLE_BIT |
|
| + VK_MEMORY_PROPERTY_HOST_COHERENT_BIT;
|
| + if (!GrVkMemory::AllocAndBindBufferMemory(gpu,
|
| + buffer,
|
| + requiredMemProps,
|
| + &alloc)) {
|
| + VK_CALL(gpu, DestroyBuffer(gpu->device(), buffer, nullptr));
|
| + return nullptr;
|
| + }
|
| }
|
|
|
| const GrVkBuffer::Resource* resource = new GrVkBuffer::Resource(buffer, alloc);
|
|
|