[pr-fix][frame-generation] FSR frame generation without the line of submissions #139
Loading…
Reference in a new issue
No description provided.
Delete branch "dutchmega/Darner:fsr-framegen-without-line"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Contributor role (optional)
What it changes
FSR frame generation only ran with the line of submissions (
queue::line_on()), which needsDARNER_RELAY>=1. On AMD the loss guard setsDARNER_RELAY=0unless the player sets it, so with the PC FidelityFX upscaler (DARNER_PC_FSR=1) frame generation stayed off. Without the line, the states of depth and motion vectors at the present are not known.With this change, when the line is off, the PC FidelityFX upscaling copies depth and motion vectors at the upscaling (the existing
FgSnapshotpath), and frame generation reads those copies. The host list that runs frame generation keeps the copies until it has run. With the line on, nothing changes.streamline.rs:Inputscarries the snapshot;record_host_upscaleasks for a snapshot when the line is off.streamline/fsr.rs:before_presenttakes theHostList, runs frame generation without the line when the inputs are snapshots, and keeps the snapshot on that list.host.rs: passes theHostListtobefore_present.How it was tested
4f7aa954f7aa95):cargo clippy --workspace --all-targets --locked -- -D warnings: passes.cargo clippy --workspace --all-targets --all-features --locked -- -D warnings: passes.cargo test --workspace --locked:darner-gpu --libexits withSTATUS_ACCESS_VIOLATION(0xc0000005). The same happens onmain(57dea7f), so it is not from this change. The other crates' tests pass.DARNER_RELAY=0,DARNER_PC_FSR=1, FSR 4 upscaler, FSR frame generation 2x. Over 10 s windows: 105–110 presents with a generated frame, and 0 failed prepares. Before this change frame generation did not run with these settings.DARNER_RELAY>=1(that path is unchanged). The base frame rate with relay 0 was about 10 fps, far below what frame generation is meant for.Checklist
main.docs/asset-policy.md.Checked for overlap
streamline/fsr.rs, the swap-chain format check; another part of the file), #48 and #47 (streamline.rs, XeSS).I reproduced a snapshot lifetime problem on
4f7aa95d33with an RTX 4060 8 GB, NVIDIA driver 621.40, Windows 11 build 26300, and Rust 1.98.1. The test ran withDARNER_RELAY=0 DARNER_ASYNC_SUBMIT=0 DARNER_THIN=0 DARNER_FG_RECT=auto DARNER_FG_BARS_CLEAR=0.The automatic bar detector records its depth and motion copies in
live.bars.before_preparebefore FidelityFX reports the prepare result. The present command list keeps theFgSnapshotonly when prepare succeeds. If prepare fails, a later submitted upscale can replace the source inSUBMITTEDand recycle the slot before that command list is submitted.I ran the following sequence with synthetic textures and the real D3D12 queue. Fill the first snapshot with 0x1b and record
before_presentwithout submitting it. Replace the submitted upscale and queue a fill of 0xb7 from a subsequent snapshot acquisition. Then submit the older present list and map the actual motion readback from the bar detector. The fixture keeps independent COM references to the original resources, so the readback isolates reuse of the slot's contents.Moving the existing
if let Some(snapshot) = &inputs.snapshot { host_list.keep_fg_snapshot(snapshot.clone()); }immediately abovelive.bars.before_prepare(...)fixed the error case. The list then owns the snapshot as soon as it records a copy from it. The existing FSR, auto bar detector, and submitted snapshot tests also passed (18 tests) withcargo test --locked -p darner-gpu --liband their respective filters.The fixture injected the SDK prepare result. Snapshot allocation, the bar detector, command submission, and the mapped readback ran on hardware. The observed failure was incorrect synthetic readback data.
Confirmed by reading
before_present: the bar detector records copies from the snapshot before the prepare result is known, and the list only kept the snapshot on success. Your move (keep the snapshot right abovelive.bars.before_prepare, drop it from the success branch) is applied on our side.