Adds toggle to disable blob cache.
- The disable toggle will supercede the enable one once Chromium side
deprecates usage of the enable one.
Bug: dawn:549
Change-Id: I5c5bd60161917fe2654cfce55a6f29e8a7e79962
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/110728
Commit-Queue: Loko Kung <lokokung@google.com>
Reviewed-by: Austin Eng <enga@chromium.org>
Kokoro: Kokoro <noreply+kokoro@google.com>
diff --git a/src/dawn/native/Device.cpp b/src/dawn/native/Device.cpp
index a4e2e17..be870c6 100644
--- a/src/dawn/native/Device.cpp
+++ b/src/dawn/native/Device.cpp
@@ -618,7 +618,7 @@
// TODO(crbug.com/dawn/1481): Shader caching currently has a dependency on the WGSL writer to
// generate cache keys. We can lift the dependency once we also cache frontend parsing,
// transformations, and reflection.
- if (IsToggleEnabled(Toggle::EnableBlobCache)) {
+ if (IsToggleEnabled(Toggle::EnableBlobCache) && !IsToggleEnabled(Toggle::DisableBlobCache)) {
return mAdapter->GetInstance()->GetBlobCache();
}
#endif
diff --git a/src/dawn/native/Toggles.cpp b/src/dawn/native/Toggles.cpp
index ebee065..20e44f5 100644
--- a/src/dawn/native/Toggles.cpp
+++ b/src/dawn/native/Toggles.cpp
@@ -261,6 +261,12 @@
"mips (level >= 2) doesn't work correctly. Workaround this issue by detecting this case and "
"rendering to a temporary texture instead (with copies before and after if needed).",
"https://crbug.com/dawn/1071"}},
+ {Toggle::DisableBlobCache,
+ {"disable_blob_cache",
+ "Disables usage of the blob cache (backed by the platform cache if set/passed). Prevents any "
+ "persistent caching capabilities, i.e. pipeline caching.",
+ "https://crbug.com/dawn/549"}},
+ // TODO(dawn:549) Remove after deprecating usage on the Chromium side.
{Toggle::EnableBlobCache,
{"enable_blob_cache",
"Enables usage of the blob cache (backed by the platform cache if set/passed). Necessary for "
diff --git a/src/dawn/native/Toggles.h b/src/dawn/native/Toggles.h
index 5a29de3..3dde2e4 100644
--- a/src/dawn/native/Toggles.h
+++ b/src/dawn/native/Toggles.h
@@ -72,6 +72,7 @@
VulkanUseZeroInitializeWorkgroupMemoryExtension,
D3D12SplitBufferTextureCopyForRowsPerImagePaddings,
MetalRenderR8RG8UnormSmallMipToTempTexture,
+ DisableBlobCache,
EnableBlobCache,
D3D12ForceClearCopyableDepthStencilTextureOnCreation,
D3D12DontSetClearValueOnDepthTextureCreation,