Adds typing to cache keys to avoid clashes.
Bug: dawn:549 Change-Id: Ic3c737e62ae3bfcd1b20d923373a66f380d96149 Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/86401 Reviewed-by: Shrek Shao <shrekshao@google.com> Reviewed-by: Austin Eng <enga@chromium.org> Commit-Queue: Loko Kung <lokokung@google.com> Kokoro: Kokoro <noreply+kokoro@google.com>
This commit is contained in:
parent
65426d9325
commit
cf078766c2
|
@ -46,6 +46,8 @@ namespace dawn::native {
|
|||
public:
|
||||
using std::vector<uint8_t>::vector;
|
||||
|
||||
enum class Type { ComputePipeline, RenderPipeline };
|
||||
|
||||
template <typename T>
|
||||
CacheKey& Record(const T& t) {
|
||||
CacheKeySerializer<T>::Serialize(this, t);
|
||||
|
|
|
@ -48,6 +48,9 @@ namespace dawn::native {
|
|||
descriptor->compute.constants}}) {
|
||||
SetContentHash(ComputeContentHash());
|
||||
TrackInDevice();
|
||||
|
||||
// Initialize the cache key to include the cache type and device information.
|
||||
GetCacheKey()->Record(CacheKey::Type::ComputePipeline, device->GetCacheKey());
|
||||
}
|
||||
|
||||
ComputePipelineBase::ComputePipelineBase(DeviceBase* device) : PipelineBase(device) {
|
||||
|
|
|
@ -629,6 +629,9 @@ namespace dawn::native {
|
|||
|
||||
SetContentHash(ComputeContentHash());
|
||||
TrackInDevice();
|
||||
|
||||
// Initialize the cache key to include the cache type and device information.
|
||||
GetCacheKey()->Record(CacheKey::Type::RenderPipeline, device->GetCacheKey());
|
||||
}
|
||||
|
||||
RenderPipelineBase::RenderPipelineBase(DeviceBase* device) : PipelineBase(device) {
|
||||
|
|
Loading…
Reference in New Issue