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

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

Issue 2029763002: Create free list heap for suballocation (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Address comments; clean up debug code Created 4 years, 6 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 | « src/gpu/vk/GrVkBuffer.h ('k') | src/gpu/vk/GrVkGpu.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 12925db008d06f10b7e72df0e957164a199a40f6..1c7c4d0e25358f03631a9a6ed290cadff4ee9c6d 100644
--- a/src/gpu/vk/GrVkBuffer.cpp
+++ b/src/gpu/vk/GrVkBuffer.cpp
@@ -56,37 +56,23 @@ const GrVkBuffer::Resource* GrVkBuffer::Create(const GrVkGpu* gpu, const Desc& d
return nullptr;
}
- VkMemoryPropertyFlags requiredMemProps = VK_MEMORY_PROPERTY_HOST_VISIBLE_BIT |
- VK_MEMORY_PROPERTY_HOST_COHERENT_BIT |
- VK_MEMORY_PROPERTY_HOST_CACHED_BIT;
-
if (!GrVkMemory::AllocAndBindBufferMemory(gpu,
buffer,
- requiredMemProps,
+ desc.fType,
&alloc)) {
- // 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;
- }
+ return nullptr;
}
- const GrVkBuffer::Resource* resource = new GrVkBuffer::Resource(buffer, alloc);
+ const GrVkBuffer::Resource* resource = new GrVkBuffer::Resource(buffer, alloc, desc.fType);
if (!resource) {
VK_CALL(gpu, DestroyBuffer(gpu->device(), buffer, nullptr));
- GrVkMemory::FreeBufferMemory(gpu, alloc);
+ GrVkMemory::FreeBufferMemory(gpu, desc.fType, alloc);
return nullptr;
}
return resource;
}
-
void GrVkBuffer::addMemoryBarrier(const GrVkGpu* gpu,
VkAccessFlags srcAccessMask,
VkAccessFlags dstAccesMask,
@@ -113,7 +99,7 @@ void GrVkBuffer::Resource::freeGPUData(const GrVkGpu* gpu) const {
SkASSERT(fBuffer);
SkASSERT(fAlloc.fMemory);
VK_CALL(gpu, DestroyBuffer(gpu->device(), fBuffer, nullptr));
- GrVkMemory::FreeBufferMemory(gpu, fAlloc);
+ GrVkMemory::FreeBufferMemory(gpu, fType, fAlloc);
}
void GrVkBuffer::vkRelease(const GrVkGpu* gpu) {
« no previous file with comments | « src/gpu/vk/GrVkBuffer.h ('k') | src/gpu/vk/GrVkGpu.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698