| Index: src/gpu/vk/GrVkCommandBuffer.h
|
| diff --git a/src/gpu/vk/GrVkCommandBuffer.h b/src/gpu/vk/GrVkCommandBuffer.h
|
| index c8bac336d5775fd4e3d344aa4fcbd1c898f22524..f439b276133afcc410d83173bc4680c829ee796d 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 that will be tracked and released when this command buffer finishes
|
| + // execution. When it is released, it will signal that the resource can be recycled for reuse.
|
| + 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;
|
|
|