Skip to content

Commit ef5a6da

Browse files
committed
Roll Emdawnwebgpu
1 parent d12517b commit ef5a6da

File tree

1 file changed

+39
-7
lines changed

1 file changed

+39
-7
lines changed

tools/ports/emdawnwebgpu.py

Lines changed: 39 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,10 @@
33
# University of Illinois/NCSA Open Source License. Both these licenses can be
44
# found in the LICENSE file.
55

6-
# https://dawn.googlesource.com/dawn/+/80062b708e44aa4d8c48e555ed0cc801396069f6/src/emdawnwebgpu/pkg/README.md
6+
# https://dawn.googlesource.com/dawn/+/faa7054b5b65c3ce3774151952a68aa7668aa20b/src/emdawnwebgpu/pkg/README.md
77
r"""
8-
The full README of Emdawnwebgpu follows.
8+
This "remote port" instructs Emscripten (4.0.10+) how to automatically download
9+
the actual port for Emdawnwebgpu. See README below for instructions.
910
1011
# Emdawnwebgpu
1112
@@ -84,6 +85,17 @@
8485
8586
--closure-args=--externs=path/to/emdawnwebgpu_pkg/webgpu/src/webgpu-externs.js
8687
88+
#### Without using a port file (**Unsupported!**)
89+
90+
It is possible to integrate the Emdawnwebgpu sources directly into your build
91+
process, which may be necessary for certain build systems, but this is not
92+
officially supported. Using a port file instead is strongly recommended.
93+
94+
If you do this, the port files or Dawn's GN or CMake files can serve as a
95+
reference for the steps needed. Note that in all cases, the sources include both
96+
C++ and JS code. While it is possible to precompile the C++ code to `.a`, the JS
97+
code cannot be precompiled and must be provided at the final link step.
98+
8799
### Cross-targeting Web/Native
88100
89101
#### Using CMake
@@ -132,17 +144,37 @@
132144
package zip).
133145
"""
134146

135-
TAG = 'v20250807.221415'
147+
import sys
148+
149+
if __name__ == '__main__':
150+
print('Please see documentation inside this file for details on how to use this port.')
151+
sys.exit(1)
152+
153+
_VERSION = 'v20250926.144300'
136154

137-
EXTERNAL_PORT = f'https://github.com/google/dawn/releases/download/{TAG}/emdawnwebgpu_pkg-{TAG}.zip'
138-
SHA512 = 'ab9f3af2536ef3a29c20bb9c69f45b5ee512b8e33fb559f8d0bf4529cd2c11e2fbfb919c3d936e3b32af0e92bd710af71a1700776b5e56c99297cfbc3b73ceec'
155+
# Remote-specific port information
156+
157+
# - Where to download the port
158+
EXTERNAL_PORT = f'https://github.com/google/dawn/releases/download/{_VERSION}/emdawnwebgpu_pkg-{_VERSION}.zip'
159+
# - Hash to verify the download integrity
160+
SHA512 = 'a186cf7f33266c9dfeca7d99ffac769a91b2129e34054f1e857cd82e8b033896da34cf758088bbdeeb128aa713df9953851f83ba6d677c438a929d245a789948'
161+
# - Path of the port inside the zip file
139162
PORT_FILE = 'emdawnwebgpu_pkg/emdawnwebgpu.port.py'
140163

141-
# Port information (required)
164+
# General port information
142165

143166
# - Visible in emcc --show-ports and emcc --use-port=emdawnwebgpu:help
144167
LICENSE = "Some files: BSD 3-Clause License. Other files: Emscripten's license (available under both MIT License and University of Illinois/NCSA Open Source License)"
145168

146169
# - Visible in emcc --use-port=emdawnwebgpu:help
147170
DESCRIPTION = "Emdawnwebgpu implements webgpu.h on WebGPU, replacing -sUSE_WEBGPU. **For info on usage and filing feedback, see link below.**"
148-
URL = 'https://dawn.googlesource.com/dawn/+/80062b708e44aa4d8c48e555ed0cc801396069f6/src/emdawnwebgpu/pkg/README.md'
171+
URL = 'https://dawn.googlesource.com/dawn/+/faa7054b5b65c3ce3774151952a68aa7668aa20b/src/emdawnwebgpu/pkg/README.md'
172+
173+
174+
# Emscripten <4.0.10 won't notice EXTERNAL_PORT and will try to use this.
175+
def get(ports, settings, shared):
176+
raise Exception('Remote ports require Emscripten 4.0.10+.')
177+
178+
179+
def clear(ports, settings, shared):
180+
pass

0 commit comments

Comments
 (0)