Skip to content

Commit 3b36064

Browse files
authored
Roll Emdawnwebgpu and repoint USE_WEBGPU tests at Emdawnwebgpu (#25397)
In preparation to remove USE_WEBGPU entirely (#24265). Ideally these tests would live in Dawn, but we don't have a way to automate tests in the browser yet, so for the moment we'll keep them in Emscripten. Emdawnwebgpu roll includes: - `` bb3dc45 [emscripten] Use Emscripten `diagnostics.error` instead of `raise` `` - ``a3650c0 [emscripten] Error on LINK_AS_CXX=0 in emdawnwebgpu.port.py``
1 parent 292321d commit 3b36064

File tree

8 files changed

+164
-295
lines changed

8 files changed

+164
-295
lines changed

src/jsifier.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -288,7 +288,7 @@ function handleI64Signatures(symbol, snippet, sig, i53abi) {
288288
const newArgs = [];
289289
let argConversions = '';
290290
if (sig.length > argNames.length + 1) {
291-
error(`handleI64Signatures: signature too long for ${symbol}`);
291+
error(`handleI64Signatures: signature '${sig}' too long for ${symbol}(${argNames.join(', ')})`);
292292
return snippet;
293293
}
294294
for (let i = 0; i < argNames.length; i++) {

test/test_browser.py

Lines changed: 4 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -4511,26 +4511,16 @@ def test_webgl_simple_extensions(self, webgl_version, simple_enable_extensions):
45114511
'closure': (['-sASSERTIONS', '--closure=1'],),
45124512
'closure_advanced': (['-sASSERTIONS', '--closure=1', '-O3'],),
45134513
'main_module': (['-sMAIN_MODULE=1'],),
4514+
'pthreads': (['-pthread', '-sOFFSCREENCANVAS_SUPPORT'],),
45144515
})
45154516
@requires_webgpu
45164517
def test_webgpu_basic_rendering(self, args):
4517-
self.btest_exit('webgpu_basic_rendering.cpp', cflags=['-Wno-error=deprecated', '-sUSE_WEBGPU'] + args)
4518+
self.btest_exit('webgpu_basic_rendering.cpp', cflags=['--use-port=emdawnwebgpu', '-sEXIT_RUNTIME'] + args)
45184519

45194520
@requires_webgpu
45204521
def test_webgpu_required_limits(self):
4521-
self.btest_exit('webgpu_required_limits.c', cflags=['-Wno-error=deprecated', '-sUSE_WEBGPU', '-sASYNCIFY'])
4522-
4523-
@requires_webgpu
4524-
def test_webgpu_basic_rendering_pthreads(self):
4525-
self.btest_exit('webgpu_basic_rendering.cpp', cflags=['-Wno-error=deprecated', '-sUSE_WEBGPU', '-pthread', '-sOFFSCREENCANVAS_SUPPORT'])
4526-
4527-
@requires_webgpu
4528-
def test_webgpu_get_device(self):
4529-
self.btest_exit('webgpu_get_device.cpp', cflags=['-Wno-error=deprecated', '-sUSE_WEBGPU', '-sASSERTIONS', '--closure=1'])
4530-
4531-
@requires_webgpu
4532-
def test_webgpu_get_device_pthreads(self):
4533-
self.btest_exit('webgpu_get_device.cpp', cflags=['-Wno-error=deprecated', '-sUSE_WEBGPU', '-pthread'])
4522+
self.set_setting('DEFAULT_TO_CXX') # emdawnwebgpu uses C++ internally
4523+
self.btest_exit('webgpu_required_limits.c', cflags=['--use-port=emdawnwebgpu'])
45344524

45354525
# Tests the feature that shell html page can preallocate the typed array and place it
45364526
# to Module.buffer before loading the script page.

test/test_other.py

Lines changed: 13 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -2598,7 +2598,8 @@ def test_contrib_ports(self):
25982598

25992599
@requires_network
26002600
def test_remote_ports(self):
2601-
self.emcc('hello_world.c', ['--use-port=emdawnwebgpu'])
2601+
# Emdawnwebgpu uses C++ internally, so we use a cpp file here so emcc defaults to linking C++.
2602+
self.emcc('hello_world.cpp', ['--use-port=emdawnwebgpu'])
26022603

26032604
@crossplatform
26042605
def test_external_ports_simple(self):
@@ -9680,13 +9681,15 @@ def test_closure_full_js_library(self, args):
96809681

96819682
@also_with_wasm64
96829683
def test_closure_webgpu(self):
9683-
# This test can be removed if USE_WEBGPU is later included in INCLUDE_FULL_LIBRARY.
9684-
self.build('hello_world.c', cflags=[
9684+
if config.FROZEN_CACHE and self.get_setting('MEMORY64'):
9685+
# CI configuration doesn't run `embuilder` with wasm64 on ports
9686+
self.skipTest("test doesn't work with frozen cache")
9687+
# Emdawnwebgpu uses C++ internally, so we use a cpp file here so emcc defaults to linking C++.
9688+
self.build('hello_world.cpp', cflags=[
96859689
'--closure=1',
96869690
'-Werror=closure',
9687-
'-Wno-error=deprecated',
96889691
'-sINCLUDE_FULL_LIBRARY',
9689-
'-sUSE_WEBGPU',
9692+
'--use-port=emdawnwebgpu',
96909693
])
96919694

96929695
# Tests --closure-args command line flag
@@ -12317,24 +12320,19 @@ def test_standalone_syscalls(self):
1231712320
for engine in config.WASM_ENGINES:
1231812321
self.assertContained(expected, self.run_js('test.wasm', engine))
1231912322

12320-
@parameterized({
12321-
'': ([],),
12322-
'assertions': (['-sASSERTIONS'],),
12323-
'closure': (['-sASSERTIONS', '--closure=1'],),
12324-
'dylink': (['-sMAIN_MODULE'],),
12325-
})
12326-
def test_webgpu_compiletest(self, args):
12327-
self.run_process([EMXX, test_file('webgpu_jsvalstore.cpp'), '-Wno-error=deprecated', '-sUSE_WEBGPU', '-sASYNCIFY'] + args)
12328-
1232912323
@flaky('https://github.com/emscripten-core/emscripten/issues/25343')
12324+
@crossplatform
1233012325
@also_with_wasm64
1233112326
@parameterized({
1233212327
'': ([],),
1233312328
'closure': (['--closure=1', '-Werror=closure'],),
1233412329
'closure_assertions': (['--closure=1', '-Werror=closure', '-sASSERTIONS'],),
1233512330
})
1233612331
def test_emdawnwebgpu_link_test(self, args):
12337-
self.run_process([EMXX, test_file('test_emdawnwebgpu_link_test.cpp'), '--use-port=emdawnwebgpu', '-sASYNCIFY'] + args)
12332+
if config.FROZEN_CACHE and self.get_setting('MEMORY64'):
12333+
# CI configuration doesn't run `embuilder` with wasm64 on ports
12334+
self.skipTest("test doesn't work with frozen cache")
12335+
self.emcc(test_file('test_emdawnwebgpu_link_test.cpp'), ['--use-port=emdawnwebgpu', '-sASYNCIFY'] + args)
1233812336

1233912337
def test_signature_mismatch(self):
1234012338
create_file('a.c', 'void foo(); int main() { foo(); return 0; }')

0 commit comments

Comments
 (0)