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