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

Unified Diff: src/gpu/vk/GrVkSampler.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/GrVkResourceProvider.cpp ('k') | src/gpu/vk/GrVkSampler.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/gpu/vk/GrVkSampler.h
diff --git a/src/gpu/vk/GrVkSampler.h b/src/gpu/vk/GrVkSampler.h
index d3212cbc538dec45596f3b75c223251896c8d547..72181354eba259275f50306b15af65fbf9d98d0f 100644
--- a/src/gpu/vk/GrVkSampler.h
+++ b/src/gpu/vk/GrVkSampler.h
@@ -13,23 +13,31 @@
#include "vulkan/vulkan.h"
class GrTextureAccess;
+class GrTextureParams;
class GrVkGpu;
class GrVkSampler : public GrVkResource {
public:
- static GrVkSampler* Create(const GrVkGpu* gpu, const GrTextureAccess& textureAccess);
+ static GrVkSampler* Create(const GrVkGpu* gpu, const GrTextureParams&);
VkSampler sampler() const { return fSampler; }
+ // Helpers for hashing GrVkSampler
+ static uint8_t GenerateKey(const GrTextureParams&);
+
+ static const uint8_t& GetKey(const GrVkSampler& sampler) { return sampler.fKey; }
+ static uint32_t Hash(const uint8_t& key) { return key; }
private:
- GrVkSampler(VkSampler sampler) : INHERITED(), fSampler(sampler) {}
+ GrVkSampler(VkSampler sampler, uint8_t key) : INHERITED(), fSampler(sampler), fKey(key) {}
void freeGPUData(const GrVkGpu* gpu) const override;
VkSampler fSampler;
+ uint8_t fKey;
typedef GrVkResource INHERITED;
};
-#endif
+#endif
+
« no previous file with comments | « src/gpu/vk/GrVkResourceProvider.cpp ('k') | src/gpu/vk/GrVkSampler.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698