Repository navigation
feat: record fast3d capture sequences from renderer reset - #37
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Supersedes #33, which no longer applies: main has since taken fast3d's fallible memory API, and the capture hook now has to record a sequence rather than a directory of single frames. This is #33's behaviour ported onto main deliberately rather than rebased.
The per-frame mode is unchanged in spirit —
FAST3D_CAPTURE_DIRplusFAST3D_CAPTURE_FRAMESwrites selected renderer serials asframe-%06d.f3dcap. Two fixes while porting: selection is now one-based so it matches the filenames it produces (#33's selection 120 wroteframe-000121.f3dcap), and an empty element in the serial list no longer aborts capture entirely. That last one is easy to hit, because BSDseq -s,emits a trailing comma and the old behaviour was to log once and then run the game as if capture had never been asked for.New is
FAST3D_CAPTURE_SEQUENCE, withFAST3D_CAPTURE_WARMUP_FRAMESandFAST3D_CAPTURE_PRESENTATIONS. It wraps the renderer infast3d::capture::CaptureSequencefrom the first graphics task, so the recording starts at a renderer reset and retains every serial through the endpoint with no gaps, which is what fast3d's container requires — it rejects a cropped or intermittent recording rather than renumbering it. Recording stops and writes at the largest requested presentation. Renderer resizes are deferred while a sequence is active and applied afterwards.Output is published atomically: bytes are synced to
<output>.<pid>-<id>.partialand hard-linked into place, so an existing recording is never overwritten and a.partialon its own is never mistaken for a finished one. SIGINT, SIGTERM and SIGHUP save the completed prefix;kill -9cannot. If the signal handler can't be installed the run logs a warning and carries on, since the endpoint save is how a completed run finishes anyway — worth noting because launching the game as a background job leaves SIGINT ignored, andctrlcrefuses to register over any non-default disposition.With no capture variable set, nothing changes: no reset, no depth-policy change, no wrapper, no signal handler.
fast3d is pinned to
509cf9b, which is retrofoundry/fast3d-rs#64 on main.Used to record three sm64 attract-mode sequences of 1400-1600 frames each and replay them under fast3d's depth-discard controls. The recordings are deterministic across separate game launches and across fast3d builds: the same presentation serials hash identically every time.