feat: disable WebGPU release block checks and related platform
restrictions
This commit is contained in:
@@ -22,9 +22,9 @@
|
|||||||
#include "nsString.h"
|
#include "nsString.h"
|
||||||
#include "nsStringFwd.h"
|
#include "nsStringFwd.h"
|
||||||
|
|
||||||
#ifndef EARLY_BETA_OR_EARLIER
|
// #ifndef EARLY_BETA_OR_EARLIER
|
||||||
# include "mozilla/dom/WorkerPrivate.h"
|
// # include "mozilla/dom/WorkerPrivate.h"
|
||||||
#endif
|
// #endif
|
||||||
|
|
||||||
#include <optional>
|
#include <optional>
|
||||||
#include <string_view>
|
#include <string_view>
|
||||||
@@ -113,22 +113,22 @@ already_AddRefed<dom::Promise> Instance::RequestAdapter(
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
#ifndef EARLY_BETA_OR_EARLIER
|
// #ifndef EARLY_BETA_OR_EARLIER
|
||||||
rejectIf(true, "WebGPU is not yet available in Release or late Beta builds.");
|
// rejectIf(true, "WebGPU is not yet available in Release or late Beta builds.");
|
||||||
|
|
||||||
// NOTE: Deliberately left after the above check so that we only enter
|
// // NOTE: Deliberately left after the above check so that we only enter
|
||||||
// here if it's removed. Above is a more informative diagnostic, while the
|
// // here if it's removed. Above is a more informative diagnostic, while the
|
||||||
// check is still present.
|
// // check is still present.
|
||||||
//
|
// //
|
||||||
// Follow-up to remove this check:
|
// // Follow-up to remove this check:
|
||||||
// <https://bugzilla.mozilla.org/show_bug.cgi?id=1942431>
|
// // <https://bugzilla.mozilla.org/show_bug.cgi?id=1942431>
|
||||||
if (dom::WorkerPrivate* wp = dom::GetCurrentThreadWorkerPrivate()) {
|
// if (dom::WorkerPrivate* wp = dom::GetCurrentThreadWorkerPrivate()) {
|
||||||
rejectIf(wp->IsServiceWorker(),
|
// rejectIf(wp->IsServiceWorker(),
|
||||||
"WebGPU in service workers is not yet available in Release or "
|
// "WebGPU in service workers is not yet available in Release or "
|
||||||
"late Beta builds; see "
|
// "late Beta builds; see "
|
||||||
"<https://bugzilla.mozilla.org/show_bug.cgi?id=1942431>.");
|
// "<https://bugzilla.mozilla.org/show_bug.cgi?id=1942431>.");
|
||||||
}
|
// }
|
||||||
#endif
|
// #endif
|
||||||
rejectIf(!gfx::gfxVars::AllowWebGPU(), "WebGPU is disabled by blocklist.");
|
rejectIf(!gfx::gfxVars::AllowWebGPU(), "WebGPU is disabled by blocklist.");
|
||||||
rejectIf(!StaticPrefs::dom_webgpu_enabled(),
|
rejectIf(!StaticPrefs::dom_webgpu_enabled(),
|
||||||
"WebGPU is disabled because the `dom.webgpu.enabled` pref. is set "
|
"WebGPU is disabled because the `dom.webgpu.enabled` pref. is set "
|
||||||
|
|||||||
@@ -3223,13 +3223,13 @@ void gfxPlatform::InitWebGPUConfig() {
|
|||||||
|
|
||||||
// When this condition changes, be sure to update the `run-if`
|
// When this condition changes, be sure to update the `run-if`
|
||||||
// conditions in `dom/webgpu/tests/mochitest/*.toml` accordingly.
|
// conditions in `dom/webgpu/tests/mochitest/*.toml` accordingly.
|
||||||
#if !(defined(NIGHTLY_BUILD) || \
|
// #if !(defined(NIGHTLY_BUILD) || \
|
||||||
(defined(XP_WIN) && defined(EARLY_BETA_OR_EARLIER)))
|
// (defined(XP_WIN) && defined(EARLY_BETA_OR_EARLIER)))
|
||||||
feature.ForceDisable(
|
// feature.ForceDisable(
|
||||||
FeatureStatus::Blocked,
|
// FeatureStatus::Blocked,
|
||||||
"WebGPU cannot be enabled unless in Nightly, or Early Beta on Windows.",
|
// "WebGPU cannot be enabled unless in Nightly, or Early Beta on Windows.",
|
||||||
"WEBGPU_DISABLE_RELEASE_OR_NON_WINDOWS_EARLY_BETA"_ns);
|
// "WEBGPU_DISABLE_RELEASE_OR_NON_WINDOWS_EARLY_BETA"_ns);
|
||||||
#endif
|
// #endif
|
||||||
|
|
||||||
gfxVars::SetAllowWebGPU(feature.IsEnabled());
|
gfxVars::SetAllowWebGPU(feature.IsEnabled());
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user