Bug 1853952 - Add a pref to assert that wgpu tests run on hardware. r=webgpu-reviewers,ErichDonGubler

Differential Revision: https://phabricator.services.mozilla.com/D188726
This commit is contained in:
Nicolas Silva 2023-09-25 08:51:28 +00:00
Родитель 0ad2a767f4
Коммит 83a0c48e36
4 изменённых файлов: 17 добавлений и 2 удалений

Просмотреть файл

@ -160,6 +160,14 @@ pub unsafe extern "C" fn wgpu_server_adapter_pack_info(
backend,
} = gfx_select!(id => global.adapter_get_info(id)).unwrap();
if static_prefs::pref!("dom.webgpu.testing.assert-hardware-adapter") {
let is_hardware = match device_type {
wgt::DeviceType::IntegratedGpu | wgt::DeviceType::DiscreteGpu => true,
_ => false,
};
assert!(is_hardware, "Expected a hardware gpu adapter, got {:?}", device_type);
}
let info = AdapterInformation {
id,
limits: restrict_limits(gfx_select!(id => global.adapter_limits(id)).unwrap()),

Просмотреть файл

@ -4531,6 +4531,13 @@
mirror: always
rust: true
# For testing purposes, crash if we don't get a hardware adapter.
- name: dom.webgpu.testing.assert-hardware-adapter
type: RelaxedAtomicBool
value: false
mirror: always
rust: true
# Is support for HTMLInputElement.webkitEntries enabled?
- name: dom.webkitBlink.filesystem.enabled
type: bool

Просмотреть файл

@ -1,3 +1,3 @@
prefs: [dom.webgpu.enabled:true]
prefs: [dom.webgpu.enabled:true, dom.webgpu.testing.assert-hardware-adapter:true]
lsan-allowed: [Alloc, mozilla::net::nsServerSocket::CreateClientTransport]
leak-threshold: [default:51200]

Просмотреть файл

@ -1,4 +1,4 @@
prefs: [dom.webgpu.enabled:true]
prefs: [dom.webgpu.enabled:true, dom.webgpu.testing.assert-hardware-adapter:true]
tags: [webgpu]
disabled:
if release_or_beta: https://mozilla-hub.atlassian.net/browse/FFXP-223