From 89dd2b1278f9e457d9d343742a51de27502ebca1 Mon Sep 17 00:00:00 2001 From: Anders Leino Date: Mon, 30 Dec 2024 11:42:25 +0200 Subject: Add a basic WebGPU example (#5923) * Add a basic WebGPU example This helps to address #5656. * Use serial await rather than Promise.all --- examples/wgpu-html5/build.py | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100755 examples/wgpu-html5/build.py (limited to 'examples/wgpu-html5/build.py') 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!') -- cgit v1.2.3