summaryrefslogtreecommitdiff
path: root/examples/wgpu-html5/build.py
diff options
context:
space:
mode:
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!')