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

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

Issue 2195713002: Properly recycle uniform buffers in vulkan (Closed) Base URL: https://skia.googlesource.com/skia.git@slownanobench
Patch Set: rebase Created 4 years, 5 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/GrVkBuffer.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/gpu/vk/GrVkBuffer.h
diff --git a/src/gpu/vk/GrVkBuffer.h b/src/gpu/vk/GrVkBuffer.h
index b400e09916f4580587d29097250e199daed8f30b..bb529b3f7366dda79a4ce34210ceca0bb9969fb4 100644
--- a/src/gpu/vk/GrVkBuffer.h
+++ b/src/gpu/vk/GrVkBuffer.h
@@ -25,11 +25,11 @@ public:
SkASSERT(!fResource);
}
- VkBuffer buffer() const { return fResource->fBuffer; }
- const GrVkAlloc& alloc() const { return fResource->fAlloc; }
- const GrVkResource* resource() const { return fResource; }
- size_t size() const { return fDesc.fSizeInBytes; }
- VkDeviceSize offset() const { return fOffset; }
+ VkBuffer buffer() const { return fResource->fBuffer; }
+ const GrVkAlloc& alloc() const { return fResource->fAlloc; }
+ const GrVkRecycledResource* resource() const { return fResource; }
+ size_t size() const { return fDesc.fSizeInBytes; }
+ VkDeviceSize offset() const { return fOffset; }
void addMemoryBarrier(const GrVkGpu* gpu,
VkAccessFlags srcAccessMask,
@@ -94,6 +94,11 @@ protected:
void vkRelease(const GrVkGpu* gpu);
private:
+ virtual const Resource* createResource(GrVkGpu* gpu,
+ const Desc& descriptor) {
+ return Create(gpu, descriptor);
+ }
+
void validate() const;
bool vkIsMapped() const;
« no previous file with comments | « no previous file | src/gpu/vk/GrVkBuffer.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698