Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(340)

Unified Diff: src/gpu/vk/GrVkBuffer.cpp

Issue 1835813003: Use NV glsl shader compiler for Vulkan (Closed) Base URL: https://skia.googlesource.com/skia.git@cacheHash
Patch Set: Created 4 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | src/gpu/vk/GrVkCaps.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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);
« no previous file with comments | « no previous file | src/gpu/vk/GrVkCaps.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698