diff --git a/src/dawn/native/Device.cpp b/src/dawn/native/Device.cpp index a4e2e1746c..be870c6d20 100644 --- a/src/dawn/native/Device.cpp +++ b/src/dawn/native/Device.cpp @@ -618,7 +618,7 @@ BlobCache* DeviceBase::GetBlobCache() { // 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 ebee065e05..20e44f506b 100644 --- a/src/dawn/native/Toggles.cpp +++ b/src/dawn/native/Toggles.cpp @@ -261,6 +261,12 @@ static constexpr ToggleEnumAndInfoList kToggleNameAndInfoList = {{ "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 5a29de3955..3dde2e4186 100644 --- a/src/dawn/native/Toggles.h +++ b/src/dawn/native/Toggles.h @@ -72,6 +72,7 @@ enum class Toggle { VulkanUseZeroInitializeWorkgroupMemoryExtension, D3D12SplitBufferTextureCopyForRowsPerImagePaddings, MetalRenderR8RG8UnormSmallMipToTempTexture, + DisableBlobCache, EnableBlobCache, D3D12ForceClearCopyableDepthStencilTextureOnCreation, D3D12DontSetClearValueOnDepthTextureCreation,