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

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

Issue 2159333002: Recycle small uniform buffers. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: 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
Index: src/gpu/vk/GrVkResourceProvider.h
diff --git a/src/gpu/vk/GrVkResourceProvider.h b/src/gpu/vk/GrVkResourceProvider.h
index 3891539b0cada8101a6cf40a85c0d74f0d7d1e21..e85c2a57d951811b0e36bbacf46600de51c2555b 100644
--- a/src/gpu/vk/GrVkResourceProvider.h
+++ b/src/gpu/vk/GrVkResourceProvider.h
@@ -112,6 +112,11 @@ public:
// when the caller needs the layout to create a VkPipelineLayout.
VkDescriptorSetLayout getUniDSLayout() const { return fUniformDescLayout; }
+ // Creates or finds uniform buffer resources of size GrVkUniformBuffer::kStandardSize
+ // Anything larger will need to be created and released by the client
+ const GrVkResource* findOrCreateStandardUniformBufferResource();
+ void recycleStandardUniformBufferResource(const GrVkResource*);
egdaniel 2016/07/19 20:48:38 comment for recycle function
+
// Destroy any cached resources. To be called before destroying the VkDevice.
// The assumption is that all queues are idle and all command buffers are finished.
// For resource tracing to work properly, this should be called after unrefing all other
@@ -211,6 +216,9 @@ private:
// Array of available secondary command buffers
SkSTArray<16, GrVkSecondaryCommandBuffer*> fAvailableSecondaryCommandBuffers;
+ // Array of available uniform buffer resources
+ SkSTArray<16, const GrVkResource*> fAvailableUniformBufferResources;
+
// Stores GrVkSampler objects that we've already created so we can reuse them across multiple
// GrVkPipelineStates
SkTDynamicHash<GrVkSampler, uint16_t> fSamplers;

Powered by Google App Engine
This is Rietveld 408576698