summaryrefslogtreecommitdiff
path: root/examples/wgpu-html5/build.py
diff options
context:
space:
mode:
authorAnders Leino <aleino@nvidia.com>2024-12-30 11:42:25 +0200
committerGitHub <noreply@github.com>2024-12-30 11:42:25 +0200
commit89dd2b1278f9e457d9d343742a51de27502ebca1 (patch)
tree22899e27c4131d86f395d2c501d92a694eb6a137 /examples/wgpu-html5/build.py
parentb2d51adc4b433c44298d35bb19637496c99ce44b (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-xexamples/wgpu-html5/build.py19
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!')