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>
This commit is contained in:
Loko Kung 2022-11-21 21:46:18 +00:00 committed by Dawn LUCI CQ
parent a32b6b4a0f
commit aa527ba348
3 changed files with 8 additions and 1 deletions

View File

@ -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

View File

@ -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 "

View File

@ -72,6 +72,7 @@ enum class Toggle {
VulkanUseZeroInitializeWorkgroupMemoryExtension,
D3D12SplitBufferTextureCopyForRowsPerImagePaddings,
MetalRenderR8RG8UnormSmallMipToTempTexture,
DisableBlobCache,
EnableBlobCache,
D3D12ForceClearCopyableDepthStencilTextureOnCreation,
D3D12DontSetClearValueOnDepthTextureCreation,