From: uazo Date: Mon, 1 May 2023 12:07:49 +0000 Subject: Disable WebGPU License: GPL-2.0-or-later - https://spdx.org/licenses/GPL-2.0-or-later.html --- content/child/runtime_features.cc | 2 ++ gpu/config/gpu_finch_features.cc | 2 +- third_party/blink/renderer/modules/webgpu/gpu.cc | 3 +++ 3 files changed, 6 insertions(+), 1 deletion(-) diff --git a/content/child/runtime_features.cc b/content/child/runtime_features.cc --- a/content/child/runtime_features.cc +++ b/content/child/runtime_features.cc @@ -531,6 +531,8 @@ void SetCustomizedRuntimeFeaturesFromCombinedArgs( WebRuntimeFeatures::EnableRemotePlayback(false); + WebRuntimeFeatures::EnableFeatureFromString("WebGpu", false); + WebRuntimeFeatures::EnableBackForwardCache( content::IsBackForwardCacheEnabled()); diff --git a/gpu/config/gpu_finch_features.cc b/gpu/config/gpu_finch_features.cc --- a/gpu/config/gpu_finch_features.cc +++ b/gpu/config/gpu_finch_features.cc @@ -215,7 +215,7 @@ BASE_FEATURE(kEnableDrDc, // enabled by default on supported platforms. #if BUILDFLAG(IS_APPLE) || BUILDFLAG(IS_WIN) || BUILDFLAG(IS_CHROMEOS) || \ BUILDFLAG(IS_ANDROID) || BUILDFLAG(USE_WEBGPU_ON_VULKAN_VIA_GL_INTEROP) -#define WEBGPU_ENABLED base::FEATURE_ENABLED_BY_DEFAULT +#define WEBGPU_ENABLED base::FEATURE_DISABLED_BY_DEFAULT #else #define WEBGPU_ENABLED base::FEATURE_DISABLED_BY_DEFAULT #endif diff --git a/third_party/blink/renderer/modules/webgpu/gpu.cc b/third_party/blink/renderer/modules/webgpu/gpu.cc --- a/third_party/blink/renderer/modules/webgpu/gpu.cc +++ b/third_party/blink/renderer/modules/webgpu/gpu.cc @@ -157,6 +157,8 @@ GPU::GPU(NavigatorBase& navigator) GPU::~GPU() = default; WGSLLanguageFeatures* GPU::wgslLanguageFeatures() const { + if (!base::FeatureList::IsEnabled(features::kWebGPUService)) + return nullptr; return wgsl_language_features_.Get(); } @@ -412,6 +414,7 @@ ScriptPromise> GPU::requestAdapter( "WebGPU is experimental on this platform. See " "https://github.com/gpuweb/gpuweb/wiki/" "Implementation-Status#implementation-status")); + //(UAZO) add site setting } auto* resolver = --