Bug 1992430 - Disable WebGPU if the GPU process is disabled on platforms with a GPU process. a=RyanVM
Original Revision: https://phabricator.services.mozilla.com/D267425 Differential Revision: https://phabricator.services.mozilla.com/D267861
This commit is contained in:
committed by
rvandermeulen@mozilla.com
parent
3bca077f3b
commit
14de960c73
@@ -3205,6 +3205,13 @@ void gfxPlatform::InitWebGPUConfig() {
|
||||
feature.Disable(FeatureStatus::Blocklisted, message.get(), failureId);
|
||||
}
|
||||
|
||||
if (!gfxConfig::IsEnabled(Feature::GPU_PROCESS) &&
|
||||
!StaticPrefs::dom_webgpu_allow_in_parent_AtStartup()) {
|
||||
feature.Disable(FeatureStatus::UnavailableNoGpuProcess,
|
||||
"Disabled without GPU process",
|
||||
"FEATURE_WEBGPU_NO_GPU_PROCESS"_ns);
|
||||
}
|
||||
|
||||
// When this condition changes, be sure to update the `run-if`
|
||||
// conditions in `dom/webgpu/tests/mochitest/*.toml` accordingly.
|
||||
#if !(defined(NIGHTLY_BUILD) || \
|
||||
@@ -3966,6 +3973,14 @@ bool gfxPlatform::FallbackFromAcceleration(FeatureStatus aStatus,
|
||||
|
||||
/* static */
|
||||
void gfxPlatform::DisableGPUProcess() {
|
||||
if (gfxVars::AllowWebGPU() &&
|
||||
!StaticPrefs::dom_webgpu_allow_in_parent_AtStartup()) {
|
||||
gfxConfig::Disable(Feature::WEBGPU, FeatureStatus::UnavailableNoGpuProcess,
|
||||
"Disabled by GPU process disabled",
|
||||
"FEATURE_WEBGPU_DISABLED_BY_GPU_PROCESS_DISABLED"_ns);
|
||||
gfxVars::SetAllowWebGPU(false);
|
||||
}
|
||||
|
||||
if (gfxVars::RemoteCanvasEnabled() &&
|
||||
!StaticPrefs::gfx_canvas_remote_allow_in_parent_AtStartup()) {
|
||||
gfxConfig::Disable(
|
||||
|
||||
@@ -5441,6 +5441,17 @@
|
||||
value: @IS_EARLY_BETA_OR_EARLIER@
|
||||
mirror: always
|
||||
|
||||
# Is WebGPU allowed to run in the parent process? This should be false if
|
||||
# on a platform that supports the GPU process, else true.
|
||||
- name: dom.webgpu.allow-in-parent
|
||||
type: bool
|
||||
#if defined(XP_WIN) || defined(ANDROID)
|
||||
value: false
|
||||
#else
|
||||
value: true
|
||||
#endif
|
||||
mirror: once
|
||||
|
||||
# Comma-separated list of wgpu backend names to permit in WebGPU adapters.
|
||||
#
|
||||
# If non-empty, this is parsed by `wgpu_core::instance::parse_backends_from_comma_list` to
|
||||
|
||||
Reference in New Issue
Block a user