Hide blob caching behind a toggle on the device for now.

Bug: dawn:549
Change-Id: If704e528166938ff9beb2b7f9f222b75fde8ec08
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/88465
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:
Loko Kung 2022-05-03 07:06:33 +00:00 committed by Dawn LUCI CQ
parent 0e74918b68
commit 3b2b34f0ff
5 changed files with 102 additions and 106 deletions

View File

@ -568,8 +568,11 @@ bool DeviceBase::APIPopErrorScope(wgpu::ErrorCallback callback, void* userdata)
} }
BlobCache* DeviceBase::GetBlobCache() { BlobCache* DeviceBase::GetBlobCache() {
if (IsToggleEnabled(Toggle::EnableBlobCache)) {
return mInstance->GetBlobCache(); return mInstance->GetBlobCache();
} }
return nullptr;
}
MaybeError DeviceBase::ValidateObject(const ApiObjectBase* object) const { MaybeError DeviceBase::ValidateObject(const ApiObjectBase* object) const {
ASSERT(object != nullptr); ASSERT(object != nullptr);

View File

@ -21,7 +21,7 @@ PipelineCacheBase::PipelineCacheBase(BlobCache* cache, const CacheKey& key)
CachedBlob PipelineCacheBase::Initialize() { CachedBlob PipelineCacheBase::Initialize() {
ASSERT(!mInitialized); ASSERT(!mInitialized);
CachedBlob blob = mCache->Load(mKey); CachedBlob blob = mCache != nullptr ? mCache->Load(mKey) : CachedBlob();
mCacheHit = !blob.Empty(); mCacheHit = !blob.Empty();
mInitialized = true; mInitialized = true;
return blob; return blob;
@ -33,6 +33,9 @@ bool PipelineCacheBase::CacheHit() const {
} }
MaybeError PipelineCacheBase::Flush() { MaybeError PipelineCacheBase::Flush() {
if (mCache == nullptr) {
return {};
}
// Try to write the data out to the persistent cache. // Try to write the data out to the persistent cache.
CachedBlob blob; CachedBlob blob;
DAWN_TRY_ASSIGN(blob, SerializeToBlobImpl()); DAWN_TRY_ASSIGN(blob, SerializeToBlobImpl());

View File

@ -31,97 +31,91 @@ using ToggleEnumAndInfoList = std::array<ToggleEnumAndInfo, static_cast<size_t>(
static constexpr ToggleEnumAndInfoList kToggleNameAndInfoList = {{ static constexpr ToggleEnumAndInfoList kToggleNameAndInfoList = {{
{Toggle::EmulateStoreAndMSAAResolve, {Toggle::EmulateStoreAndMSAAResolve,
{"emulate_store_and_msaa_resolve", {"emulate_store_and_msaa_resolve",
"Emulate storing into multisampled color attachments and doing MSAA resolve " "Emulate storing into multisampled color attachments and doing MSAA resolve simultaneously. "
"simultaneously. This workaround is enabled by default on the Metal drivers that do " "This workaround is enabled by default on the Metal drivers that do not support "
"not support MTLStoreActionStoreAndMultisampleResolve. To support StoreOp::Store on " "MTLStoreActionStoreAndMultisampleResolve. To support StoreOp::Store on those platforms, we "
"those platforms, we should do MSAA resolve in another render pass after ending the " "should do MSAA resolve in another render pass after ending the previous one.",
"previous one.",
"https://crbug.com/dawn/56"}}, "https://crbug.com/dawn/56"}},
{Toggle::NonzeroClearResourcesOnCreationForTesting, {Toggle::NonzeroClearResourcesOnCreationForTesting,
{"nonzero_clear_resources_on_creation_for_testing", {"nonzero_clear_resources_on_creation_for_testing",
"Clears texture to full 1 bits as soon as they are created, but doesn't update " "Clears texture to full 1 bits as soon as they are created, but doesn't update the tracking "
"the tracking state of the texture. This way we can test the logic of clearing " "state of the texture. This way we can test the logic of clearing textures that use recycled "
"textures that use recycled memory.", "memory.",
"https://crbug.com/dawn/145"}}, "https://crbug.com/dawn/145"}},
{Toggle::AlwaysResolveIntoZeroLevelAndLayer, {Toggle::AlwaysResolveIntoZeroLevelAndLayer,
{"always_resolve_into_zero_level_and_layer", {"always_resolve_into_zero_level_and_layer",
"When the resolve target is a texture view that is created on the non-zero level or " "When the resolve target is a texture view that is created on the non-zero level or layer of "
"layer of a texture, we first resolve into a temporarily 2D texture with only one " "a texture, we first resolve into a temporarily 2D texture with only one mipmap level and "
"mipmap level and one array layer, and copy the result of MSAA resolve into the " "one array layer, and copy the result of MSAA resolve into the true resolve target. This "
"true resolve target. This workaround is enabled by default on the Metal drivers " "workaround is enabled by default on the Metal drivers that have bugs when setting non-zero "
"that have bugs when setting non-zero resolveLevel or resolveSlice.", "resolveLevel or resolveSlice.",
"https://crbug.com/dawn/56"}}, "https://crbug.com/dawn/56"}},
{Toggle::LazyClearResourceOnFirstUse, {Toggle::LazyClearResourceOnFirstUse,
{"lazy_clear_resource_on_first_use", {"lazy_clear_resource_on_first_use",
"Clears resource to zero on first usage. This initializes the resource " "Clears resource to zero on first usage. This initializes the resource so that no dirty bits "
"so that no dirty bits from recycled memory is present in the new resource.", "from recycled memory is present in the new resource.",
"https://crbug.com/dawn/145"}}, "https://crbug.com/dawn/145"}},
{Toggle::TurnOffVsync, {Toggle::TurnOffVsync,
{"turn_off_vsync", {"turn_off_vsync",
"Turn off vsync when rendering. In order to do performance test or run perf tests, " "Turn off vsync when rendering. In order to do performance test or run perf tests, turn off "
"turn off vsync so that the fps can exeed 60.", "vsync so that the fps can exeed 60.",
"https://crbug.com/dawn/237"}}, "https://crbug.com/dawn/237"}},
{Toggle::UseTemporaryBufferInCompressedTextureToTextureCopy, {Toggle::UseTemporaryBufferInCompressedTextureToTextureCopy,
{"use_temporary_buffer_in_texture_to_texture_copy", {"use_temporary_buffer_in_texture_to_texture_copy",
"Split texture-to-texture copy into two copies: copy from source texture into a " "Split texture-to-texture copy into two copies: copy from source texture into a temporary "
"temporary buffer, and copy from the temporary buffer into the destination texture " "buffer, and copy from the temporary buffer into the destination texture when copying "
"when copying between compressed textures that don't have block-aligned sizes. This " "between compressed textures that don't have block-aligned sizes. This workaround is enabled "
"workaround is enabled by default on all Vulkan drivers to solve an issue in the " "by default on all Vulkan drivers to solve an issue in the Vulkan SPEC about the "
"Vulkan SPEC about the texture-to-texture copies with compressed formats. See #1005 " "texture-to-texture copies with compressed formats. See #1005 "
"(https://github.com/KhronosGroup/Vulkan-Docs/issues/1005) for more details.", "(https://github.com/KhronosGroup/Vulkan-Docs/issues/1005) for more details.",
"https://crbug.com/dawn/42"}}, "https://crbug.com/dawn/42"}},
{Toggle::UseD3D12ResourceHeapTier2, {Toggle::UseD3D12ResourceHeapTier2,
{"use_d3d12_resource_heap_tier2", {"use_d3d12_resource_heap_tier2",
"Enable support for resource heap tier 2. Resource heap tier 2 allows mixing of " "Enable support for resource heap tier 2. Resource heap tier 2 allows mixing of texture and "
"texture and buffers in the same heap. This allows better heap re-use and reduces " "buffers in the same heap. This allows better heap re-use and reduces fragmentation.",
"fragmentation.",
"https://crbug.com/dawn/27"}}, "https://crbug.com/dawn/27"}},
{Toggle::UseD3D12RenderPass, {Toggle::UseD3D12RenderPass,
{"use_d3d12_render_pass", {"use_d3d12_render_pass",
"Use the D3D12 render pass API introduced in Windows build 1809 by default. On " "Use the D3D12 render pass API introduced in Windows build 1809 by default. On versions of "
"versions of Windows prior to build 1809, or when this toggle is turned off, Dawn " "Windows prior to build 1809, or when this toggle is turned off, Dawn will emulate a render "
"will emulate a render pass.", "pass.",
"https://crbug.com/dawn/36"}}, "https://crbug.com/dawn/36"}},
{Toggle::UseD3D12ResidencyManagement, {Toggle::UseD3D12ResidencyManagement,
{"use_d3d12_residency_management", {"use_d3d12_residency_management",
"Enable residency management. This allows page-in and page-out of resource heaps in " "Enable residency management. This allows page-in and page-out of resource heaps in GPU "
"GPU memory. This component improves overcommitted performance by keeping the most " "memory. This component improves overcommitted performance by keeping the most recently used "
"recently used resources local to the GPU. Turning this component off can cause " "resources local to the GPU. Turning this component off can cause allocation failures when "
"allocation failures when application memory exceeds physical device memory.", "application memory exceeds physical device memory.",
"https://crbug.com/dawn/193"}}, "https://crbug.com/dawn/193"}},
{Toggle::DisableResourceSuballocation, {Toggle::DisableResourceSuballocation,
{"disable_resource_suballocation", {"disable_resource_suballocation",
"Force the backends to not perform resource suballocation. This may expose " "Force the backends to not perform resource suballocation. This may expose allocation "
"allocation " "patterns which would otherwise only occur with large or specific types of resources.",
"patterns which would otherwise only occur with large or specific types of "
"resources.",
"https://crbug.com/1313172"}}, "https://crbug.com/1313172"}},
{Toggle::SkipValidation, {Toggle::SkipValidation,
{"skip_validation", "Skip expensive validation of Dawn commands.", {"skip_validation", "Skip expensive validation of Dawn commands.",
"https://crbug.com/dawn/271"}}, "https://crbug.com/dawn/271"}},
{Toggle::VulkanUseD32S8, {Toggle::VulkanUseD32S8,
{"vulkan_use_d32s8", {"vulkan_use_d32s8",
"Vulkan mandates support of either D32_FLOAT_S8 or D24_UNORM_S8. When available the " "Vulkan mandates support of either D32_FLOAT_S8 or D24_UNORM_S8. When available the backend "
"backend will use D32S8 (toggle to on) but setting the toggle to off will make it " "will use D32S8 (toggle to on) but setting the toggle to off will make it use the D24S8 "
"use the D24S8 format when possible.", "format when possible.",
"https://crbug.com/dawn/286"}}, "https://crbug.com/dawn/286"}},
{Toggle::VulkanUseS8, {Toggle::VulkanUseS8,
{"vulkan_use_s8", {"vulkan_use_s8",
"Vulkan has a pure stencil8 format but it is not universally available. When this " "Vulkan has a pure stencil8 format but it is not universally available. When this toggle is "
"toggle is on, the backend will use S8 for the stencil8 format, otherwise it will " "on, the backend will use S8 for the stencil8 format, otherwise it will fallback to D32S8 or "
"fallback to D32S8 or D24S8.", "D24S8.",
"https://crbug.com/dawn/666"}}, "https://crbug.com/dawn/666"}},
{Toggle::MetalDisableSamplerCompare, {Toggle::MetalDisableSamplerCompare,
{"metal_disable_sampler_compare", {"metal_disable_sampler_compare",
"Disables the use of sampler compare on Metal. This is unsupported before A9 " "Disables the use of sampler compare on Metal. This is unsupported before A9 processors.",
"processors.",
"https://crbug.com/dawn/342"}}, "https://crbug.com/dawn/342"}},
{Toggle::MetalUseSharedModeForCounterSampleBuffer, {Toggle::MetalUseSharedModeForCounterSampleBuffer,
{"metal_use_shared_mode_for_counter_sample_buffer", {"metal_use_shared_mode_for_counter_sample_buffer",
"The query set on Metal need to create MTLCounterSampleBuffer which storage mode " "The query set on Metal need to create MTLCounterSampleBuffer which storage mode must be "
"must be either MTLStorageModeShared or MTLStorageModePrivate. But the private mode " "either MTLStorageModeShared or MTLStorageModePrivate. But the private mode does not work "
"does not work properly on Intel platforms. The workaround is use shared mode " "properly on Intel platforms. The workaround is use shared mode instead.",
"instead.",
"https://crbug.com/dawn/434"}}, "https://crbug.com/dawn/434"}},
{Toggle::DisableBaseVertex, {Toggle::DisableBaseVertex,
{"disable_base_vertex", {"disable_base_vertex",
@ -129,13 +123,11 @@ static constexpr ToggleEnumAndInfoList kToggleNameAndInfoList = {{
"https://crbug.com/dawn/343"}}, "https://crbug.com/dawn/343"}},
{Toggle::DisableBaseInstance, {Toggle::DisableBaseInstance,
{"disable_base_instance", {"disable_base_instance",
"Disables the use of non-zero base instance which is unsupported on some " "Disables the use of non-zero base instance which is unsupported on some platforms.",
"platforms.",
"https://crbug.com/dawn/343"}}, "https://crbug.com/dawn/343"}},
{Toggle::DisableIndexedDrawBuffers, {Toggle::DisableIndexedDrawBuffers,
{"disable_indexed_draw_buffers", {"disable_indexed_draw_buffers",
"Disables the use of indexed draw buffer state which is unsupported on some " "Disables the use of indexed draw buffer state which is unsupported on some platforms.",
"platforms.",
"https://crbug.com/dawn/582"}}, "https://crbug.com/dawn/582"}},
{Toggle::DisableSnormRead, {Toggle::DisableSnormRead,
{"disable_snorm_read", {"disable_snorm_read",
@ -151,8 +143,7 @@ static constexpr ToggleEnumAndInfoList kToggleNameAndInfoList = {{
"https://crbug.com/dawn/667"}}, "https://crbug.com/dawn/667"}},
{Toggle::DisableDepthStencilRead, {Toggle::DisableDepthStencilRead,
{"disable_depth_stencil_read", {"disable_depth_stencil_read",
"Disables reading from depth/stencil textures which is unsupported on some " "Disables reading from depth/stencil textures which is unsupported on some platforms.",
"platforms.",
"https://crbug.com/dawn/667"}}, "https://crbug.com/dawn/667"}},
{Toggle::DisableBGRARead, {Toggle::DisableBGRARead,
{"disable_bgra_read", {"disable_bgra_read",
@ -160,18 +151,17 @@ static constexpr ToggleEnumAndInfoList kToggleNameAndInfoList = {{
"https://crbug.com/dawn/1393"}}, "https://crbug.com/dawn/1393"}},
{Toggle::DisableSampleVariables, {Toggle::DisableSampleVariables,
{"disable_sample_variables", {"disable_sample_variables",
"Disables gl_SampleMask and related functionality which is unsupported on some " "Disables gl_SampleMask and related functionality which is unsupported on some platforms.",
"platforms.",
"https://crbug.com/dawn/673"}}, "https://crbug.com/dawn/673"}},
{Toggle::UseD3D12SmallShaderVisibleHeapForTesting, {Toggle::UseD3D12SmallShaderVisibleHeapForTesting,
{"use_d3d12_small_shader_visible_heap", {"use_d3d12_small_shader_visible_heap",
"Enable use of a small D3D12 shader visible heap, instead of using a large one by " "Enable use of a small D3D12 shader visible heap, instead of using a large one by default. "
"default. This setting is used to test bindgroup encoding.", "This setting is used to test bindgroup encoding.",
"https://crbug.com/dawn/155"}}, "https://crbug.com/dawn/155"}},
{Toggle::UseDXC, {Toggle::UseDXC,
{"use_dxc", {"use_dxc",
"Use DXC instead of FXC for compiling HLSL when both dxcompiler.dll and dxil.dll " "Use DXC instead of FXC for compiling HLSL when both dxcompiler.dll and dxil.dll is "
"is available.", "available.",
"https://crbug.com/dawn/402"}}, "https://crbug.com/dawn/402"}},
{Toggle::DisableRobustness, {Toggle::DisableRobustness,
{"disable_robustness", "Disable robust buffer access", "https://crbug.com/dawn/480"}}, {"disable_robustness", "Disable robust buffer access", "https://crbug.com/dawn/480"}},
@ -180,48 +170,46 @@ static constexpr ToggleEnumAndInfoList kToggleNameAndInfoList = {{
"https://crbug.com/dawn/480"}}, "https://crbug.com/dawn/480"}},
{Toggle::DisallowUnsafeAPIs, {Toggle::DisallowUnsafeAPIs,
{"disallow_unsafe_apis", {"disallow_unsafe_apis",
"Produces validation errors on API entry points or parameter combinations that " "Produces validation errors on API entry points or parameter combinations that aren't "
"aren't considered secure yet.", "considered secure yet.",
"http://crbug.com/1138528"}}, "http://crbug.com/1138528"}},
{Toggle::FlushBeforeClientWaitSync, {Toggle::FlushBeforeClientWaitSync,
{"flush_before_client_wait_sync", {"flush_before_client_wait_sync",
"Call glFlush before glClientWaitSync to work around bugs in the latter", "Call glFlush before glClientWaitSync to work around bugs in the latter",
"https://crbug.com/dawn/633"}}, "https://crbug.com/dawn/633"}},
{Toggle::UseTempBufferInSmallFormatTextureToTextureCopyFromGreaterToLessMipLevel, {Toggle::UseTempBufferInSmallFormatTextureToTextureCopyFromGreaterToLessMipLevel,
{"use_temp_buffer_in_small_format_texture_to_texture_copy_from_greater_to_less_mip_" {"use_temp_buffer_in_small_format_texture_to_texture_copy_from_greater_to_less_mip_level",
"level", "Split texture-to-texture copy into two copies: copy from source texture into a temporary "
"Split texture-to-texture copy into two copies: copy from source texture into a " "buffer, and copy from the temporary buffer into the destination texture under specific "
"temporary buffer, and copy from the temporary buffer into the destination texture " "situations. This workaround is by default enabled on some Intel GPUs which have a driver "
"under specific situations. This workaround is by default enabled on some Intel " "bug "
"GPUs which have a driver bug in the execution of CopyTextureRegion() when we copy " "in the execution of CopyTextureRegion() when we copy with the formats whose texel block "
"with the formats whose texel block sizes are less than 4 bytes from a greater mip " "sizes are less than 4 bytes from a greater mip level to a smaller mip level on D3D12 "
"level to a smaller mip level on D3D12 backends.", "backends.",
"https://crbug.com/1161355"}}, "https://crbug.com/1161355"}},
{Toggle::EmitHLSLDebugSymbols, {Toggle::EmitHLSLDebugSymbols,
{"emit_hlsl_debug_symbols", {"emit_hlsl_debug_symbols",
"Sets the D3DCOMPILE_SKIP_OPTIMIZATION and D3DCOMPILE_DEBUG compilation flags when " "Sets the D3DCOMPILE_SKIP_OPTIMIZATION and D3DCOMPILE_DEBUG compilation flags when compiling "
"compiling HLSL code. Enables better shader debugging with external graphics " "HLSL code. Enables better shader debugging with external graphics debugging tools.",
"debugging tools.",
"https://crbug.com/dawn/776"}}, "https://crbug.com/dawn/776"}},
{Toggle::DisallowSpirv, {Toggle::DisallowSpirv,
{"disallow_spirv", {"disallow_spirv",
"Disallow usage of SPIR-V completely so that only WGSL is used for shader modules. " "Disallow usage of SPIR-V completely so that only WGSL is used for shader modules. This is "
"This is useful to prevent a Chromium renderer process from successfully sending " "useful to prevent a Chromium renderer process from successfully sending SPIR-V code to be "
"SPIR-V code to be compiled in the GPU process.", "compiled in the GPU process.",
"https://crbug.com/1214923"}}, "https://crbug.com/1214923"}},
{Toggle::DumpShaders, {Toggle::DumpShaders,
{"dump_shaders", {"dump_shaders",
"Dump shaders for debugging purposes. Dumped shaders will be log via " "Dump shaders for debugging purposes. Dumped shaders will be log via EmitLog, thus printed "
"EmitLog, thus printed in Chrome console or consumed by user-defined callback " "in Chrome console or consumed by user-defined callback function.",
"function.",
"https://crbug.com/dawn/792"}}, "https://crbug.com/dawn/792"}},
{Toggle::DEPRECATED_DumpTranslatedShaders, {Toggle::DEPRECATED_DumpTranslatedShaders,
{"dump_translated_shaders", "Deprecated. Use dump_shaders", "https://crbug.com/dawn/792"}}, {"dump_translated_shaders", "Deprecated. Use dump_shaders", "https://crbug.com/dawn/792"}},
{Toggle::ForceWGSLStep, {Toggle::ForceWGSLStep,
{"force_wgsl_step", {"force_wgsl_step",
"When ingesting SPIR-V shaders, force a first conversion to WGSL. This allows " "When ingesting SPIR-V shaders, force a first conversion to WGSL. This allows testing Tint's "
"testing Tint's SPIRV->WGSL translation on real content to be sure that it will " "SPIRV->WGSL translation on real content to be sure that it will work when the same "
"work when the same translation runs in a WASM module in the page.", "translation runs in a WASM module in the page.",
"https://crbug.com/dawn/960"}}, "https://crbug.com/dawn/960"}},
{Toggle::DisableWorkgroupInit, {Toggle::DisableWorkgroupInit,
{"disable_workgroup_init", {"disable_workgroup_init",
@ -232,26 +220,25 @@ static constexpr ToggleEnumAndInfoList kToggleNameAndInfoList = {{
"https://crbug.com/dawn/1016"}}, "https://crbug.com/dawn/1016"}},
{Toggle::UseUserDefinedLabelsInBackend, {Toggle::UseUserDefinedLabelsInBackend,
{"use_user_defined_labels_in_backend", {"use_user_defined_labels_in_backend",
"Enables calls to SetLabel to be forwarded to backend-specific APIs that label " "Enables calls to SetLabel to be forwarded to backend-specific APIs that label objects.",
"objects.",
"https://crbug.com/dawn/840"}}, "https://crbug.com/dawn/840"}},
{Toggle::UsePlaceholderFragmentInVertexOnlyPipeline, {Toggle::UsePlaceholderFragmentInVertexOnlyPipeline,
{"use_placeholder_fragment_in_vertex_only_pipeline", {"use_placeholder_fragment_in_vertex_only_pipeline",
"Use a placeholder empty fragment shader in vertex only render pipeline. This toggle " "Use a placeholder empty fragment shader in vertex only render pipeline. This toggle must be "
"must be enabled for OpenGL ES backend, and serves as a workaround by default " "enabled for OpenGL ES backend, and serves as a workaround by default enabled on some Metal "
"enabled on some Metal devices with Intel GPU to ensure the depth result is correct.", "devices with Intel GPU to ensure the depth result is correct.",
"https://crbug.com/dawn/136"}}, "https://crbug.com/dawn/136"}},
{Toggle::FxcOptimizations, {Toggle::FxcOptimizations,
{"fxc_optimizations", {"fxc_optimizations",
"Enable optimizations when compiling with FXC. Disabled by default because FXC " "Enable optimizations when compiling with FXC. Disabled by default because FXC miscompiles "
"miscompiles in many cases when optimizations are enabled.", "in many cases when optimizations are enabled.",
"https://crbug.com/dawn/1203"}}, "https://crbug.com/dawn/1203"}},
{Toggle::RecordDetailedTimingInTraceEvents, {Toggle::RecordDetailedTimingInTraceEvents,
{"record_detailed_timing_in_trace_events", {"record_detailed_timing_in_trace_events",
"Record detailed timing information in trace events at certain point. Currently the " "Record detailed timing information in trace events at certain point. Currently the timing "
"timing information is recorded right before calling ExecuteCommandLists on a D3D12 " "information is recorded right before calling ExecuteCommandLists on a D3D12 command queue, "
"command queue, and the information includes system time, CPU timestamp, GPU " "and the information includes system time, CPU timestamp, GPU timestamp, and their "
"timestamp, and their frequency.", "frequency.",
"https://crbug.com/dawn/1264"}}, "https://crbug.com/dawn/1264"}},
{Toggle::DisableTimestampQueryConversion, {Toggle::DisableTimestampQueryConversion,
{"disable_timestamp_query_conversion", {"disable_timestamp_query_conversion",
@ -265,20 +252,22 @@ static constexpr ToggleEnumAndInfoList kToggleNameAndInfoList = {{
{Toggle::D3D12SplitBufferTextureCopyForRowsPerImagePaddings, {Toggle::D3D12SplitBufferTextureCopyForRowsPerImagePaddings,
{"d3d12_split_buffer_texture_copy_for_rows_per_image_paddings", {"d3d12_split_buffer_texture_copy_for_rows_per_image_paddings",
"D3D12 requires more buffer storage than it should when rowsPerImage is greater than " "D3D12 requires more buffer storage than it should when rowsPerImage is greater than "
"copyHeight, which means there are pure padding row(s) on each image. In this " "copyHeight, which means there are pure padding row(s) on each image. In this situation, "
"situation, the buffer used for B2T/T2B copy might be big enough according to " "the buffer used for B2T/T2B copy might be big enough according to WebGPU's spec but it "
"WebGPU's spec but it doesn't meet D3D12's requirement, then we need to workaround " "doesn't meet D3D12's requirement, then we need to workaround it via split the copy "
"it via split the copy operation into two copies, in order to make B2T/T2B copy " "operation into two copies, in order to make B2T/T2B copy being done correctly on D3D12.",
"being done correctly on D3D12.",
"https://crbug.com/dawn/1289"}}, "https://crbug.com/dawn/1289"}},
{Toggle::MetalRenderR8RG8UnormSmallMipToTempTexture, {Toggle::MetalRenderR8RG8UnormSmallMipToTempTexture,
{"metal_render_r8_rg8_unorm_small_mip_to_temp_texture", {"metal_render_r8_rg8_unorm_small_mip_to_temp_texture",
"Metal Intel devices have issues with r8unorm and rg8unorm textures where rendering " "Metal Intel devices have issues with r8unorm and rg8unorm textures where rendering to small "
"to small mips (level >= 2) doesn't work correctly. Workaround this issue by " "mips (level >= 2) doesn't work correctly. Workaround this issue by detecting this case and "
"detecting this case and rendering to a temporary texture instead (with copies " "rendering to a temporary texture instead (with copies before and after if needed).",
"before "
"and after if needed).",
"https://crbug.com/dawn/1071"}}, "https://crbug.com/dawn/1071"}},
{Toggle::EnableBlobCache,
{"enable_blob_cache",
"Enables usage of the blob cache (backed by the platform cache if set/passed). Necessary for "
"any persistent caching capabilities, i.e. pipeline caching.",
"https://crbug.com/dawn/549"}},
// Comment to separate the }} so it is clearer what to copy-paste to add a toggle. // Comment to separate the }} so it is clearer what to copy-paste to add a toggle.
}}; }};
} // anonymous namespace } // anonymous namespace

View File

@ -71,6 +71,7 @@ enum class Toggle {
VulkanUseZeroInitializeWorkgroupMemoryExtension, VulkanUseZeroInitializeWorkgroupMemoryExtension,
D3D12SplitBufferTextureCopyForRowsPerImagePaddings, D3D12SplitBufferTextureCopyForRowsPerImagePaddings,
MetalRenderR8RG8UnormSmallMipToTempTexture, MetalRenderR8RG8UnormSmallMipToTempTexture,
EnableBlobCache,
EnumCount, EnumCount,
InvalidEnum = EnumCount, InvalidEnum = EnumCount,

View File

@ -264,6 +264,6 @@ TEST_P(SinglePipelineCachingTests, RenderPipelineBlobCacheIsolationKey) {
EXPECT_EQ(mMockCache.GetNumEntries(), 2u); EXPECT_EQ(mMockCache.GetNumEntries(), 2u);
} }
DAWN_INSTANTIATE_TEST(SinglePipelineCachingTests, VulkanBackend()); DAWN_INSTANTIATE_TEST(SinglePipelineCachingTests, VulkanBackend({"enable_blob_cache"}));
} // namespace } // namespace