AtlatestRepositorysigil-graphics
1;;; test-shader-limits — the measured proof for sigil-graphics v0.11.3's
2;;; shader additions, on native and on the web build.
3;;;
4;;; One scene, two shells (the (crash main) seam): a Game of Life stepped
5;;; entirely on the GPU by render-target ping-pong with a shader bound
6;;; inside with-render-target, a palette drawn from `vec4 palette[8]` and
7;;; `float levels[4]` uniform arrays, and a 4x4 texture made from pixels
8;;; and refilled with update-texture. verify.mjs reads the presented frame
9;;; on both targets and asserts every cell, strip and texel.
10;;;
11;;; sigil deps install --redirects dev-redirects.sgl
12;;; sigil build --redirects dev-redirects.sgl native
13;;; sigil build --redirects dev-redirects.sgl --config web browser
14;;; node verify.mjs --native | --web (see README)
16(define sigil-repo "codeberg:sigil/sigil")
18(package
19 name: "test-shader-limits"
20 version: "0.0.1"
21 sigil: "0.22"
22 description: "Proof: uniform arrays, pixel textures, GPU ping-pong automaton on native and web"
23 license: "BSD-3-Clause"
24 authors: (list "David Wilson <[email protected]>")
26 entry: '(test-shader-limits main)
27 bundle-name: "test-shader-limits"
29 configs: (list
30 (config
31 name: 'dev
32 output-dir: "build/dev"
33 debug?: #t
34 optimize: 0
35 bundle?: #t)
36 ;; The browser build: wasm32-wasi through zig, native codegen, the
37 ;; shape of crash-the-stack's web config.
38 (config
39 name: 'web
40 output-dir: "build/web"
41 toolchain: 'zig
42 target: "wasm32-wasi"
43 backend: 'native
44 debug?: #f
45 optimize: 2
46 bundle?: #t
47 features: '(web wasm graphics)))
49 dependencies: (list
50 ;; Windowing, native only (GLFW cannot build for wasm).
51 (from-git url: "codeberg:sigil/sigil-app" name: "sigil-desktop" version: "^0.10.0" configs: '(dev))
52 ;; The package under test; dev-redirects.sgl points it at ../..
53 (from-git url: "codeberg:sigil/sigil-graphics" version: "^0.11.2")
54 ;; Web only: the wasm runtime (loader + entry ABI) and the raw-WebGL2
55 ;; binding sigil-graphics' sokol backend draws through.
56 (from-git url: sigil-repo package: "sigil-wasm-runtime" version: ">=0.22" configs: '(web))
57 (from-git url: sigil-repo package: "sigil-wasm-gles3" version: ">=0.22" configs: '(web)))
59 ;; The web build's task; the dev config takes sigil-build's default.
60 tasks: (list
61 (task
62 name: 'build
63 configs: '(web)
64 description: "Compile the scene and link the browser app"
65 steps: (list
66 (compile-sigil-modules sources: "src/**/*.sgl")
67 (link-web-application name: "test-shader-limits" html-mount-id: "status")))))