WebGPU pixel look: GPU colours the world, CPU only rare cells (t88 phase 2a)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
+22
-1
@@ -110,6 +110,15 @@ python3 tools/shot.py shots/silo.png --setup tools/scenes/clear-sky.js \
|
||||
`tools/scenes/clear-sky.js` clears a flat work area and sets `FLOOR`, `BX`, `BY` and `CAM`. Set
|
||||
`CAM = [x, y]` to frame the shot.
|
||||
- The HUD and the cursor previews are hidden unless you pass `--hud` or `--previews`.
|
||||
- `--renderer webgpu|legacy` selects the pixel renderer (default WebGPU). WebGPU screenshots
|
||||
fail clearly when no device is available; Smooth still uses WebGL2.
|
||||
- `test/t_gpu.py` compares the rendered composite against Legacy for ordinary cells, built pieces,
|
||||
ghosts, fog and all thermal palettes, and checks world replacement, resize, timing and device loss.
|
||||
World-pixel tests use `worldPixelContext()` to read both stacked canvases. The helper
|
||||
presents the retained GPU result again before copying, because canvas textures expire after
|
||||
presentation ([WebGPU specification](https://gpuweb.github.io/gpuweb/#abstract-opdef-expire-the-current-texture),
|
||||
[Mozilla implementation notes](https://bugzilla.mozilla.org/show_bug.cgi?id=1965377)). Tests that change
|
||||
static `noiseB` in place set `GPU.world = null` before drawing to upload their new fixture.
|
||||
- `--look smooth` for the smooth look. Test in the pixel look unless you are checking graphics.
|
||||
- `--freeze` draws the last frame at a fixed time and frame count, so animations are caught at
|
||||
the same moment. Two shots of the same scene then match pixel for pixel, and a before / after
|
||||
@@ -193,7 +202,7 @@ python3 tools/shot.py shots/silo.png --setup tools/scenes/clear-sky.js \
|
||||
simulation work per frame and number of ticks. p50/p95/p99 use interpolated sorted samples;
|
||||
five warm-up frames are excluded. Zero-tick frames correctly have zero simulation time.
|
||||
JSON also records the smooth renderer's adaptive resolution scale: compare it as well as time.
|
||||
Comparisons require identical options, print all timing changes, and mark >10% regressions;
|
||||
Comparisons accept subsets of the baseline scenes, looks and zooms, with identical world/viewport dimensions and run duration, print all timing changes, and mark >10% regressions;
|
||||
tiny timings and tails can be noisy, and a zero baseline has no meaningful percent change.
|
||||
|
||||
Performance runs launch Chromium with
|
||||
@@ -212,3 +221,15 @@ python3 tools/shot.py shots/silo.png --setup tools/scenes/clear-sky.js \
|
||||
- `tools/experiments/factory_cost.js`: what running factories cost the simulation.
|
||||
- `tools/experiments/flow.js`: belt and screw conveyor throughput in grains a second.
|
||||
- `tools/experiments/worldgen.js`: material counts and timings of world generation.
|
||||
|
||||
WebGPU Phase 2a: Colour measures the CPU override fill (including loose objects and ghosts).
|
||||
`frame_ms` is the complete paused-frame CPU call (including overlays and UI).
|
||||
Upload measures strided visible-array writes and the override/light uploads, and Blit measures
|
||||
GPU command submission. `override_cells` records the selected CPU cells; GPU timing is a
|
||||
completed timestamp sample for that configuration across colour, bloom and drawing when `timestamp-query` is
|
||||
available. The timestamp excludes uploads and the CPU lighting pass. Lighting remains on the
|
||||
CPU. The GPU canvas draws the world; the transparent game canvas holds the existing overlays.
|
||||
|
||||
The comparison fixture is `tools/scenes/t88-renderer.js`. Capture with `--freeze --zoom 12`
|
||||
(and 6 or 2), `--viewport 1920x1080`, and each `--renderer`. It includes terrain, water, fire,
|
||||
magma, fog, a tree, flat/slope belts, screws, pipe, mold, bar and blueprint ghost.
|
||||
|
||||
Reference in New Issue
Block a user