Skip to content

Commit 595792c

Browse files
committed
Roll Emdawnwebgpu and repoint USE_WEBGPU tests at Emdawnwebgpu
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. DO NOT SUBMIT: Needs Emdawnwebgpu roll in order to pass
1 parent bce7571 commit 595792c

File tree

7 files changed

+115
-280
lines changed

7 files changed

+115
-280
lines changed

src/jsifier.mjs

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

test/test_browser.py

Lines changed: 4 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -4450,24 +4450,16 @@ def test_webgl_simple_extensions(self, webgl_version, simple_enable_extensions):
44504450
'closure': (['-sASSERTIONS', '--closure=1'],),
44514451
'closure_advanced': (['-sASSERTIONS', '--closure=1', '-O3'],),
44524452
'main_module': (['-sMAIN_MODULE=1'],),
4453+
'pthreads': (['-pthread', '-sOFFSCREENCANVAS_SUPPORT'],),
44534454
})
44544455
@requires_webgpu
44554456
def test_webgpu_basic_rendering(self, args):
4456-
self.btest_exit('webgpu_basic_rendering.cpp', cflags=['-Wno-error=deprecated', '-sUSE_WEBGPU'] + args)
4457+
self.btest_exit('webgpu_basic_rendering.cpp', cflags=['--use-port=emdawnwebgpu', '-sEXIT_RUNTIME'] + args)
44574458

44584459
@requires_webgpu
44594460
def test_webgpu_required_limits(self):
4460-
self.btest_exit('webgpu_required_limits.c', cflags=['-Wno-error=deprecated', '-sUSE_WEBGPU', '-sASYNCIFY'])
4461-
4462-
@requires_webgpu
4463-
def test_webgpu_basic_rendering_pthreads(self):
4464-
self.btest_exit('webgpu_basic_rendering.cpp', cflags=['-Wno-error=deprecated', '-sUSE_WEBGPU', '-pthread', '-sOFFSCREENCANVAS_SUPPORT'])
4465-
4466-
def test_webgpu_get_device(self):
4467-
self.btest_exit('webgpu_get_device.cpp', cflags=['-Wno-error=deprecated', '-sUSE_WEBGPU', '-sASSERTIONS', '--closure=1'])
4468-
4469-
def test_webgpu_get_device_pthreads(self):
4470-
self.btest_exit('webgpu_get_device.cpp', cflags=['-Wno-error=deprecated', '-sUSE_WEBGPU', '-pthread'])
4461+
self.set_setting('NO_DEFAULT_TO_CXX', 0) # emdawnwebgpu uses C++ internally
4462+
self.btest_exit('webgpu_required_limits.c', cflags=['--use-port=emdawnwebgpu', '-sEXIT_RUNTIME'])
44714463

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

test/test_other.py

Lines changed: 4 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -2586,6 +2586,7 @@ def test_contrib_ports(self):
25862586

25872587
@requires_network
25882588
def test_remote_ports(self):
2589+
self.set_setting('NO_DEFAULT_TO_CXX', 0) # emdawnwebgpu uses C++ internally
25892590
self.emcc(test_file('hello_world.c'), ['--use-port=emdawnwebgpu'])
25902591

25912592
@crossplatform
@@ -9585,13 +9586,12 @@ def test_closure_full_js_library(self, args):
95859586

95869587
@also_with_wasm64
95879588
def test_closure_webgpu(self):
9588-
# This test can be removed if USE_WEBGPU is later included in INCLUDE_FULL_LIBRARY.
9589+
self.set_setting('NO_DEFAULT_TO_CXX', 0) # emdawnwebgpu uses C++ internally
95899590
self.build('hello_world.c', cflags=[
95909591
'--closure=1',
95919592
'-Werror=closure',
9592-
'-Wno-error=deprecated',
95939593
'-sINCLUDE_FULL_LIBRARY',
9594-
'-sUSE_WEBGPU',
9594+
'--use-port=emdawnwebgpu',
95959595
])
95969596

95979597
# Tests --closure-args command line flag
@@ -12230,15 +12230,6 @@ def test_standalone_syscalls(self):
1223012230
for engine in config.WASM_ENGINES:
1223112231
self.assertContained(expected, self.run_js('test.wasm', engine))
1223212232

12233-
@parameterized({
12234-
'': ([],),
12235-
'assertions': (['-sASSERTIONS'],),
12236-
'closure': (['-sASSERTIONS', '--closure=1'],),
12237-
'dylink': (['-sMAIN_MODULE'],),
12238-
})
12239-
def test_webgpu_compiletest(self, args):
12240-
self.run_process([EMXX, test_file('webgpu_jsvalstore.cpp'), '-Wno-error=deprecated', '-sUSE_WEBGPU', '-sASYNCIFY'] + args)
12241-
1224212233
@flaky('https://github.com/emscripten-core/emscripten/issues/25343')
1224312234
@also_with_wasm64
1224412235
@parameterized({
@@ -12247,7 +12238,7 @@ def test_webgpu_compiletest(self, args):
1224712238
'closure_assertions': (['--closure=1', '-Werror=closure', '-sASSERTIONS'],),
1224812239
})
1224912240
def test_emdawnwebgpu_link_test(self, args):
12250-
self.run_process([EMXX, test_file('test_emdawnwebgpu_link_test.cpp'), '--use-port=emdawnwebgpu', '-sASYNCIFY'] + args)
12241+
self.emcc(test_file('test_emdawnwebgpu_link_test.cpp'), ['--use-port=emdawnwebgpu', '-sASYNCIFY'] + args)
1225112242

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

0 commit comments

Comments
 (0)