From 239fd6876e5e91007c91e6b97d5e4d2f1cca5c14 Mon Sep 17 00:00:00 2001 From: Carmelo Messina Date: Tue, 28 Jan 2025 14:22:37 +0100 Subject: [PATCH] Disable WebGPU: remove navigator.gpu.wgslLanguageFeatures (#1676) --- build/patches/Disable-WebGPU.patch | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/build/patches/Disable-WebGPU.patch b/build/patches/Disable-WebGPU.patch index 023d38b5..45786826 100644 --- a/build/patches/Disable-WebGPU.patch +++ b/build/patches/Disable-WebGPU.patch @@ -6,8 +6,8 @@ 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 | 1 + - 3 files changed, 4 insertions(+), 1 deletion(-) + 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 @@ -36,7 +36,16 @@ diff --git a/gpu/config/gpu_finch_features.cc b/gpu/config/gpu_finch_features.cc 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 -@@ -401,6 +401,7 @@ ScriptPromise> GPU::requestAdapter( +@@ -143,6 +143,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(); + } + +@@ -401,6 +403,7 @@ ScriptPromise> GPU::requestAdapter( "WebGPU is experimental on this platform. See " "https://github.com/gpuweb/gpuweb/wiki/" "Implementation-Status#implementation-status"));