framegen: frame generation without the proxy swap chain (opt-in) #253
No reviewers
Labels
No labels
accessibility
bug
documentation
duplicate
enhancement
good first issue
help wanted
invalid
question
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/lobomfz--VIctory-xmem!253
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-253"
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?
@coil111 on GitHub · 2026-12-02 21:47 UTC · original
coil111:fidelityfx-framegen-direct→main· +1799 −125 · 6 files · 2 commits · merged 2026-12-02 22:44 UTCFollow-up to the reports that FidelityFX frame generation costs a lot of real frames (up to about half) on RADV. This adds an opt-in path,
VICTORY_FIDELITYFX_FRAMEGEN_DIRECT=1, that generates and presents the frames ourselves instead of going through AMD's proxy swap chain. On my machine it takes frame generation from costing ~25% of the real frame rate to ~8%, with the generated and real frames evenly spaced. The proxy stays the default for now; I'd like a few people with other hardware to try it before we change that.What goes wrong with the proxy
RADV exposes a single graphics queue. The proxy swap chain composes the interface and presents on a DIRECT queue of its own at high priority, and vkd3d-proton maps that onto the same Vulkan queue as ours. To let the proxy's mid-frame work in, vkd3d-proton "staggers" our queue: it submits it in small pieces, each one only after the previous one has completed on the GPU (
d3d12_command_queue_needs_staggered_submissionsinlibs/vkd3d/command.c; the comment there names FSR3 frame generation on single-graphics-queue drivers as the reason). Every piece is a CPU↔GPU round trip, so the GPU keeps going idle.Things checked along the way:
VKD3D_QUEUE_PROFILE) shows the proxy's queue as a second DIRECT queue at priority 100 on the same Vulkan queue, and our work arriving in ~950 small submissions per second with frame generation on.VKD3D_CONFIG=no_staggered_submitmakes it worse: the proxy's present then waits behind a whole frame (Presentblocked ~31 ms median).Presentfrom a separate thread, andallowAsyncWorkloadsmade no difference.What this does
With
VICTORY_FIDELITYFX_FRAMEGEN_DIRECT=1(plusVICTORY_FIDELITYFX_FRAMEGEN=1):NO_SWAPCHAIN_CONTEXT_NOTIFYand dispatched into the present's own command list, after the scene and the interface plane are copied into our textures. The interface is composed over both frames afterwards, so it is never interpolated (same idea as #161, and pillarbox works the same way).Presentis called doesn't decide when the GPU gets to it; where it sits in the stream does. So it goes in after a share of the next frame's submissions, learned from when lists land on the GPU, behind a copy into the current back buffer. When the GPU is idle (CPU-bound frames) a timer takes over, and the title's next present is a hard limit. Nothing waits on the GPU for this.VKD3D_SWAPCHAIN_LATENCY_FRAMESis set to 6 if it isn't set, because two presents per frame would otherwise hit vkd3d-proton's limit of 3 outstanding presents.The first commit is a small, separate helper:
VICTORY_FIDELITYFX_FRAMEGEN_DEBUGpasses AMD's debug flags through (1 tear lines, 2 reset indicators, 4 debug view, 16 pacing lines, proxy only), and counts upscale inputs that are replaced or missing.Numbers
RX 9070 XT, Ryzen 7 9800X3D, Gentoo (kernel 7.3.4), Wine 11.22, Mesa 26.3.1 +
mesa.patch, 2560x1440 at 280 Hz without VRR. Same spot in the world, a couple of minutes each, medians of the 5 sstats: frameblocks in gameplay. 1440p output, FSR 4 Performance,VICTORY_BVH_BUILDER=0 VICTORY_CARD_PULL=0 VICTORY_PAGES_SEEN=1(the settings from the earlier reports):On the direct path the real frame lands 1.02× half a frame after the generated one (median; p10–p90 0.98–1.10),
Presentnever takes more than ~0.5 ms, and the next-frame trigger places ~97% of the real frames.At 4K output with ray tracing on, the base rate is ~20 fps, CPU-bound. The proxy already cost nothing there, and the direct path is the same: 20–24 fps, real frames at 1.01–1.03× half a frame.
Trying it
It's also in the F1 menu. To compare, run the same thing without
VICTORY_FIDELITYFX_FRAMEGEN_DIRECT=1and once without frame generation at all, at the same spot. Things to look for in the log:FidelityFX frame generation (direct): on, without the proxy swap chain ...(or a warning that the DLL refused it)stats: fg_direct:realandgenshould match;gap_msshould sit close tohalf_ms;present_msshould stay well under 1 ms;fg_interp_msis the interpolation's GPU timestats: framefpscounts real frames only on this pathI could only test RDNA4 at 280 Hz. I'd especially like to hear about:
VICTORY_UI_PLANE=3840x2160with a smaller output (the HUD should stay sharp when panning) andVICTORY_PILLARBOX=1(the bars should stay black)Known limits
@joaowtrdev on GitHub · 2026-12-02 22:35 UTC · original
Tested #253 (
f35459c) on my machine: Ryzen 7 5700X3D, RX 9070 XT, CachyOS, system Wine 11.22, KDE Wayland (XWayland), 210 Hz, VRR off. 4K output, FSR 4 Performance, RT off,VICTORY_CARD_PULL=0 VICTORY_PAGES_SEEN=1, lsfg-vk off. Three runs back-to-back from the same save: 1 min standing at the start, then ~3 min driving the same route.Medians / p90 over the 5 s blocks in the world:
VICTORY_FIDELITYFX_FRAMEGEN_DIRECT=1gpu_wait_msbusy_mstitle_present_msPresentblocked (frames > 20 ms)stats: fg_directin the direct run: generated = real (26.4 / 33.1 per second),fg_interp_ms1.0,present_ms0.0,gap_ms19.4 againsthalf_ms19.0, so the real frame lands close to half a frame after the generated one.So on this machine the direct path takes frame generation from about half the real frame rate to about −5% standing, and the difference while driving is within route noise. The GPU waits again and the sender is no busier than without FG. No crash, and the HUD stays clean. The ghosting behind the car is still there, which I take to be interpolation at a ~26 fps base.
Thanks, this makes FSR FG usable here.
github-bot referenced this pull request2026-12-02 23:34:43 +00:00