mirror of
https://github.com/shinyobjectz/raea.git
synced 2026-12-01 12:44:11 -10:00
Sincea3db7b6db, `raea render X.tsx --at N` refused every TSX composition ("no two readbacks with its tag agreed in 240 updates"). That commit gave every camera on the Engine's target a w x h Viewport above the tag row. The frame tag, a 16 x 1 UI node in that row, was laid out under the scene's camera (UiTargetCamera), so bevy_ui clipped it to the viewport and no readback ever carried a tag. Full renders and HTML stills don't wait on the tag and kept working. The tag now has a camera of its own (raea-sys-frame spawn_tag, called where load.rs spawned the node): a Camera2d on the same target, ordered last, on no render layer (so it draws no sprite or mesh), with no tone mapping, dither or MSAA. Its texture is cleared to transparent and alpha-blended over the target, so every pixel but the tag's is left as the frame's cameras drew it. tag_row_view leaves it out of the viewport it gives the rest. bench/at-0/check.sh renders a one-colour composition with --at 0 and checks the frame is 160 x 160, one colour, and #246 in its last row. It refused ona3db7b6dband passes now. bench/at-3d still passes (its four frames are pixel-identical to the frozen render's), an mp4 render works, and the whole bevy-parity suite was rerun with the change.
18 lines
1.3 KiB
Bash
Executable File
18 lines
1.3 KiB
Bash
Executable File
#!/bin/bash
|
|
# A TSX composition drawn with --at 0 (the still a harness or a bench asks for): fill.tsx, one #246 fill, must write
|
|
# frame-00000.png at 160 x 160 with every pixel #246, its last row too. The frame tag below the frame is drawn by its
|
|
# own camera (raea-sys-frame spawn_tag): when the frame's camera drew it and that camera was given a w x h Viewport,
|
|
# the tag was clipped and --at refused every frame ("no two readbacks with its tag agreed"). Exits 1 on a failure.
|
|
# bench/at-0/check.sh (RAEA_BIN: the raea to run, default target/release/raea)
|
|
cd "$(dirname "$0")/../.." || exit 2
|
|
BIN=${RAEA_BIN:-$PWD/target/release/raea}
|
|
export RAEA_SIGN=0 RAEA_MARK=0 RAEA_EXPORT_CACHE=0
|
|
OUT=$(mktemp -d "${TMPDIR:-/tmp}/raea-at-0.XXXXXX")
|
|
trap 'rm -rf "$OUT"' EXIT
|
|
"$BIN" render bench/at-0/fill.tsx --at 0 -o "$OUT/at" > "$OUT/at.log" 2>&1 || { echo "FAIL: the --at 0 render failed"; grep -v WARN "$OUT/at.log" | tail -3; exit 1; }
|
|
f="$OUT/at/frame-00000.png"
|
|
[ -f "$f" ] || { echo "FAIL: no frame-00000.png"; exit 1; }
|
|
got=$(magick "$f" -format "%wx%h %k %[pixel:p{0,159}]" info:)
|
|
[ "$got" = "160x160 1 srgba(34,68,102,1)" ] || { echo "FAIL: frame 0 is '$got', not 160x160 1 srgba(34,68,102,1) (size, colours, last row)"; exit 1; }
|
|
echo "PASS: --at 0 drew frame 0, every pixel #246"
|