Add dawn version hash to cache keys.

Motivation is to simplify cache evicting by reusing the LRU to evict stale entries from older Dawn versions since there isn't already a simple cache busting solution. The dawn version will just be pushed into the cache keys instead so old version entries will eventually be retired.

- Removes the fingerprint from the GetCachingInterface API on DawnNative.
- Adds the "fingerprint", which was just the hash, to the device;s cache key directly instead.

Bug: dawn:549
Change-Id: I573aa03a2bb96dfe044293b1176d3a7746725572
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/94140
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: Loko Kung <lokokung@google.com>
This commit is contained in:
Loko Kung
2022-06-24 23:39:49 +00:00
committed by Dawn LUCI CQ
parent b4ff8c859a
commit 7289bca018
11 changed files with 46 additions and 18 deletions

View File

@@ -93,10 +93,10 @@ class DAWN_PLATFORM_EXPORT Platform {
const uint64_t* argValues,
unsigned char flags);
// The |fingerprint| is provided by Dawn to inform the client to discard the Dawn caches
// when the fingerprint changes. The returned CachingInterface is expected to outlive the
// device which uses it to persistently cache objects.
virtual CachingInterface* GetCachingInterface(const void* fingerprint, size_t fingerprintSize);
// The returned CachingInterface is expected to outlive the device which uses it to persistently
// cache objects.
virtual CachingInterface* GetCachingInterface();
virtual std::unique_ptr<WorkerTaskPool> CreateWorkerTaskPool();
private: