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

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

Issue 1765523002: Add a cache of GrVkSamplers in GrVkResourceProvider. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: nits Created 4 years, 10 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/GrVkProgram.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 38d6c401879f8c9bf2f149be3932dd77c0785ca4..a769a652d40b5b802b1c59b31845c4c4111c5d2e 100644
--- a/src/gpu/vk/GrVkResourceProvider.h
+++ b/src/gpu/vk/GrVkResourceProvider.h
@@ -12,16 +12,19 @@
#include "GrVkResource.h"
#include "GrVkUtil.h"
#include "SkTArray.h"
+#include "SkTDynamicHash.h"
#include "vulkan/vulkan.h"
class GrPipeline;
class GrPrimitiveProcessor;
+class GrTextureParams;
class GrVkCommandBuffer;
class GrVkGpu;
class GrVkPipeline;
class GrVkRenderPass;
class GrVkRenderTarget;
+class GrVkSampler;
class GrVkResourceProvider {
public:
@@ -55,6 +58,10 @@ public:
GrVkDescriptorPool* findOrCreateCompatibleDescriptorPool(
const GrVkDescriptorPool::DescriptorTypeCounts& typeCounts);
+ // Finds or creates a compatible GrVkSampler based on the GrTextureParams.
+ // The refcount is incremented and a pointer returned.
+ GrVkSampler* findOrCreateCompatibleSampler(const GrTextureParams&);
+
// 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
@@ -78,6 +85,10 @@ private:
// Array of CommandBuffers that are currently in flight
SkSTArray<4, GrVkCommandBuffer*> fActiveCommandBuffers;
+
+ // Stores GrVkSampler objects that we've already created so we can reuse them across multiple
+ // programs
+ SkTDynamicHash<GrVkSampler, uint8_t> fSamplers;
};
#endif
« no previous file with comments | « src/gpu/vk/GrVkProgram.cpp ('k') | src/gpu/vk/GrVkResourceProvider.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698