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

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: Update values 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 | « src/gpu/vk/GrVkPipelineState.cpp ('k') | src/gpu/vk/GrVkResourceProvider.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/gpu/vk/GrVkResourceProvider.h
diff --git a/src/gpu/vk/GrVkResourceProvider.h b/src/gpu/vk/GrVkResourceProvider.h
index cd0411b83b96a2b953b3a4f53438034502f25b2a..0660e91436d9304521b7f84797c94eec3e23e8a5 100644
--- a/src/gpu/vk/GrVkResourceProvider.h
+++ b/src/gpu/vk/GrVkResourceProvider.h
@@ -128,6 +128,14 @@ public:
void recycleDescriptorSet(const GrVkDescriptorSet* descSet,
const GrVkDescriptorSetManager::Handle&);
+ // Creates or finds free uniform buffer resources of size GrVkUniformBuffer::kStandardSize.
+ // Anything larger will need to be created and released by the client.
+ const GrVkResource* findOrCreateStandardUniformBufferResource();
+
+ // Signals that the resource passed to it (which should be a uniform buffer resource)
+ // can be reused by the next uniform buffer resource request.
+ void recycleStandardUniformBufferResource(const GrVkResource*);
+
// 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
@@ -226,6 +234,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;
« no previous file with comments | « src/gpu/vk/GrVkPipelineState.cpp ('k') | src/gpu/vk/GrVkResourceProvider.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698