Add suffix to monolithic pipeline cache key This is a workaround so that Chrome can identify the entry and handle it specially, eg. record histograms about the size and not save it to the memory cache. Bug: 450577968, 508178495 Change-Id: I9e020f4046507f71b2474187a9d910c7150f49d7 Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/306055 Reviewed-by: Brandon Jones <bajones@chromium.org> Commit-Queue: Kyle Charbonneau <kylechar@google.com>
diff --git a/src/dawn/native/vulkan/DeviceVk.cpp b/src/dawn/native/vulkan/DeviceVk.cpp index 4dd4a96..5062c31 100644 --- a/src/dawn/native/vulkan/DeviceVk.cpp +++ b/src/dawn/native/vulkan/DeviceVk.cpp
@@ -277,7 +277,11 @@ // the serialized VkPipelineCache is no longer valid. auto& deviceProperties = GetDeviceInfo().properties; StreamIn(&cacheKey, deviceProperties.pipelineCacheUUID); - + // A fixed string is added to the end of monolithic pipeline cache key in order to make + // it identifiable in the BlobCache storage implementation. + // TODO(crbug.com/508178495): Change the BlobCache API so that additional metadata about + // the cache entry can be included and remove this workaround. + StreamIn(&cacheKey, std::string_view("MonolithicVkPipelineCache")); mMonolithicPipelineCache = PipelineCache::CreateMonolithic(this, cacheKey); });