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

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

Issue 2167453003: Add GrVkRecycledResource subclass (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: pass gpu into recycle function 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/GrVkCommandBuffer.cpp » ('j') | src/gpu/vk/GrVkCommandBuffer.cpp » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/gpu/vk/GrVkCommandBuffer.h
diff --git a/src/gpu/vk/GrVkCommandBuffer.h b/src/gpu/vk/GrVkCommandBuffer.h
index c8bac336d5775fd4e3d344aa4fcbd1c898f22524..5faa9937c4947056e7add3a28cc3153eb7622409 100644
--- a/src/gpu/vk/GrVkCommandBuffer.h
+++ b/src/gpu/vk/GrVkCommandBuffer.h
@@ -117,11 +117,19 @@ public:
fTrackedResources.push_back(resource);
}
+ // Add ref-counted resource which can be recycled that will be tracked and released when this
jvanverth1 2016/07/20 14:08:47 Nit: This comment is a little hard to parse. Maybe
egdaniel 2016/07/20 14:48:39 Done.
+ // command buffer finishes execution
+ void addRecycledResource(const GrVkRecycledResource* resource) {
+ resource->ref();
+ fTrackedRecycledResources.push_back(resource);
+ }
+
void reset(GrVkGpu* gpu);
protected:
GrVkCommandBuffer(VkCommandBuffer cmdBuffer, const GrVkRenderPass* rp = VK_NULL_HANDLE)
: fTrackedResources(kInitialTrackedResourcesCount)
+ , fTrackedRecycledResources(kInitialTrackedResourcesCount)
, fIsActive(false)
, fActiveRenderPass(rp)
, fCmdBuffer(cmdBuffer)
@@ -129,7 +137,8 @@ protected:
, fBoundIndexBufferIsValid(false) {
this->invalidateState();
}
- SkTArray<const GrVkResource*, true> fTrackedResources;
+ SkTArray<const GrVkResource*, true> fTrackedResources;
+ SkTArray<const GrVkRecycledResource*, true> fTrackedRecycledResources;
// Tracks whether we are in the middle of a command buffer begin/end calls and thus can add
// new commands to the buffer;
« no previous file with comments | « no previous file | src/gpu/vk/GrVkCommandBuffer.cpp » ('j') | src/gpu/vk/GrVkCommandBuffer.cpp » ('J')

Powered by Google App Engine
This is Rietveld 408576698