AtlatestRepositorysigil-graphics
sigil-graphics / tree / test / test-shader-limitspackage.sgl
1
;;; test-shader-limits — the measured proof for sigil-graphics v0.11.3's2
;;; shader additions, on native and on the web build.3
;;;4
;;; One scene, two shells (the (crash main) seam): a Game of Life stepped5
;;; entirely on the GPU by render-target ping-pong with a shader bound6
;;; inside with-render-target, a palette drawn from `vec4 palette[8]` and7
;;; `float levels[4]` uniform arrays, and a 4x4 texture made from pixels8
;;; and refilled with update-texture. verify.mjs reads the presented frame9
;;; on both targets and asserts every cell, strip and texel.10
;;;11
;;; sigil deps install --redirects dev-redirects.sgl12
;;; sigil build --redirects dev-redirects.sgl native13
;;; sigil build --redirects dev-redirects.sgl --config web browser14
;;; node verify.mjs --native | --web (see README)16
(define sigil-repo "codeberg:sigil/sigil")18
(package19
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: (list30
(config31
name: 'dev32
output-dir: "build/dev"33
debug?: #t34
optimize: 035
bundle?: #t)36
;; The browser build: wasm32-wasi through zig, native codegen, the37
;; shape of crash-the-stack's web config.38
(config39
name: 'web40
output-dir: "build/web"41
toolchain: 'zig42
target: "wasm32-wasi"43
backend: 'native44
debug?: #f45
optimize: 246
bundle?: #t47
features: '(web wasm graphics)))49
dependencies: (list50
;; 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-WebGL255
;; 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: (list61
(task62
name: 'build63
configs: '(web)64
description: "Compile the scene and link the browser app"65
steps: (list66
(compile-sigil-modules sources: "src/**/*.sgl")67
(link-web-application name: "test-shader-limits" html-mount-id: "status")))))