diff options
| author | Anders Leino <aleino@nvidia.com> | 2024-12-30 11:42:25 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-12-30 11:42:25 +0200 |
| commit | 89dd2b1278f9e457d9d343742a51de27502ebca1 (patch) | |
| tree | 22899e27c4131d86f395d2c501d92a694eb6a137 /examples/wgpu-html5/build.py | |
| parent | b2d51adc4b433c44298d35bb19637496c99ce44b (diff) | |
Add a basic WebGPU example (#5923)
* Add a basic WebGPU example
This helps to address #5656.
* Use serial await rather than Promise.all
Diffstat (limited to 'examples/wgpu-html5/build.py')
| -rwxr-xr-x | examples/wgpu-html5/build.py | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/examples/wgpu-html5/build.py b/examples/wgpu-html5/build.py new file mode 100755 index 000000000..2b23dadab --- /dev/null +++ b/examples/wgpu-html5/build.py @@ -0,0 +1,19 @@ +#!/usr/bin/env python3 + +import subprocess +import sys + +for args in [['slangc', + '-target', 'wgsl', + '-stage', '{}'.format(stage), + '-entry', '{}Main'.format(stage), + '-o', 'shader.{}.wgsl'.format(stage), + 'shader.slang'] + for stage in ['vertex', 'fragment']]: + print("Running '{}'...".format(' '.join(args))) + result = subprocess.run(args) + if result.returncode != 0: + print('Failed!') + sys.exit(1) + else: + print('Succeeded!') |
