perf(vk): cut 2880x1800 temporal and cropped-present GPU time -0.71 ms (+2.0-2.5% FPS) via 32-bit SDR targets and direct crop UVs #2706
No reviewers
Labels
No labels
area/accessibility
area/audio
area/input
area/install
area/menu
area/mods
area/renderer
area/saves
area/tooling
area/upscaling
beanstalk: approved
beanstalk: failed
beanstalk: needs approval
beanstalk: running
beanstalk: tested
ci: approved
good first issue
gpu/amd
gpu/igpu
gpu/intel
gpu/nvidia
help wanted
kind
bug
kind
chore
kind
docs
kind
feature
kind
performance
kind
question
needs measurements
platform/linux
platform/macos
platform/steam-deck
platform/windows
preview
priority
critical
priority
high
priority
low
regression
risk
high
risk
low
risk
medium
status
blocked
status
confirmed
status
duplicate
status
invalid
status
needs-info
status
wontfix
ci: approved
No milestone
No project
No assignees
4 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
MagicBeanDev/Longshot!2706
Loading…
Reference in a new issue
No description provided.
Delete branch "Jer9/Longshot:perf/vk-temporal-present-bandwidth"
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?
Summary
What a player notices:
2880x1800(-0.71 mstotal GPU,-0.329 msm fsr3,+2.0%Mean FPS,+2.9%1% low at50% render scaleFSR 3.1) and+2.5%Mean FPS at1920x120067% render scalewith Auto FG by using 32-bitB10G11R11_UFLOATfor SDR FSR 3.1 temporal targets, sampling cropped presents directly infg_scale.comp, and using 32-bitR8G8B8A8_UNORMfor SDR FSR 3.1 FIhud.layer.hdr=1) and DLSS/DLAA/FSR 4/XeSS paths preserve 64-bitR16G16B16A16_SFLOAT.Three bandwidth reductions:
B10G11R11_UFLOAT(gpu/vk/vk_temporal.cpp,gpu/vk/vk_fsr3.cpp,gpu/vk/shaders/dlss_prep.comp): Whenmode == ur::FSR3in SDR (!chain_hdr(),!pre_bloom,dev.features.shaderStorageImageExtendedFormats),s.colorands.outputuse 32-bitVK_FORMAT_B10G11R11_UFLOAT_PACK32instead ofR16G16B16A16_SFLOAT(withDLSS_PREP_PACKED_COMP_SPVclamping>= 0).gpu/vk/shaders/fg_scale.comp,gpu/vk/vk_framegen.cpp):fg_scale.compsamplessrcdirectly using scalarcrop_x/y/w/hpush constants (36 Bstd430-clean), eliminating the full-ressrc -> scale.croppedcopy + barrier.hud.layerR8G8B8A8_UNORM(gpu/vk/vk_framegen.cpp,gpu/vk/shaders/fg_hud_layer.comp,gpu/vk/shaders/fg_hud_composite.comp): SDR FSR 3.1 FI HUD overlay uses 32-bitRGBA8withsqrt(B)+ quantizedTpack/unpack (preservingRGBA16Fin HDR).Files to read first:
gpu/vk/vk_temporal.cpp,gpu/vk/vk_framegen.cpp,gpu/vk/shaders/fg_scale.comp, andtests/test_temporal_present_bandwidth.py.Testing
Tested:
26.10.1 (LLPC).market-entrance, walk5 s0:LUP/5000to fountain) at2880x180050% render scaleFSR 3.1 Lanczos2 (FG Off) and1920x120067% render scaleFSR 3.1 + Built-in Auto FG (3-round interleavedRX_VK_PASS_TIMING=2,RX_VK_ANTILAG=0).16:9-in-16:10(1382x864 -> 1920x1200Lanczos2 + sharpness 30) visual parity (crop_16x9_in_16x10_after_v2.png) andRX_VK_FSR_FG=1(frame_generation=2,frame_generation_by=2) SDR HUDRGBA8live dispatches (77made frames,fsr3fi_hud_rgba8_smoke.png).python -I -B tests/test_temporal_present_bandwidth.py --headers <Vulkan-Headers/include>: failed onforge/main(86b3b9e4) and passes on bothg++andclang++ond3343c3e(including SPIR-VOpMemberDecorate Offsetpush-constant layout check).python -I -B scripts/shaders.py all --check: passes (CRT: 4,fsr3: 28,host: 4).python -I -B tests/run_all.py --strict(8 targeted checks includingtest_fg_scale_sharpen.py,test_fsr3fi_hud_layer.py,test_fsr3fi_hud_mask.py,test_guide_screenshots.py):8 passed, 0 failed, 0 skipped.python -I -B tests/run_all.py --changed forge/main:57 passed, 0 failed, 3 skipped(Linux-only).Still to test:
hdr=1on an HDR-capable display): verifyRGBA16Fhud.layerand HDRfg_scale_pqparity (@Beanstalk/ HDR monitor).@Beanstalkafter push).Measurements
Verdict: At
2880x180050% render scaleFSR 3.1, total GPU time dropped -0.71 ms (-2.7%) andm fsr3dropped -0.329 ms (-5.3%), lifting Market Mean FPS +2.0% (3/3rounds) and 1% low +2.9% (3/3rounds);1920x120067% render scale+ Auto FG lifted Mean FPS +2.5% (3/3rounds), with clean cropped present andRX_VK_FSR_FG=1RGBA8HUD parity.Setup: Windows 11, AMD Radeon 860M (
26.10.1 LLPC),RX_VK_PASS_TIMING=2,RX_VK_ANTILAG=0,RX_VK_PRECOMPILE=0, Market (market-entrance,0:LUP/5000to fountain,12.5 ssettle), 3-round interleaved medians (5cedfc85for A/B,7cdcfa25/d3343c3eforfg_scale.compscalar push-constant fix +RX_VK_FSR_FG=1smoke).Where it makes a difference:
86b3b9e4d3343c3e2880x180050% render scaleFSR 3.1 Total GPU ms2880x180050% render scalem fsr3GPU ms2880x180050% render scaleFSR 3.1 Mean FPS2880x180050% render scaleFSR 3.1 1% low FPS1920x120067% render scaleFSR 3.1 + Auto FG Mean FPSWhere it does NOT make a difference (within run-to-run variance):
86b3b9e4d3343c3e1920x120067% render scale+ Auto FG 1% low FPS2880x180050% render scaleVRAM (last sample)Risks
B10G11R11_UFLOATis gated onmode == ur::FSR3,!chain_hdr(),!pre_bloom, anddev.features.shaderStorageImageExtendedFormats; HDR10 preservesRGBA16F.fg_scale*_comp_spv.h,fg_hud_*_comp_spv.h,dlss_prep_packed_comp_spv.h) are covered byscripts/shaders.py all --checkandtests/test_temporal_present_bandwidth.py. Reverting the PR is clean; nothing changes in saves,longshot_options.ini, or shader caches.Checklist
Ready for review
main; the title is a Conventional Commit.mise run testpasses (python -I -B tests/run_all.py:745 passed, 14 failed, 102 skipped; all 14 are pre-existing Windows-env failures — 13 shared across cleanmain+ 16-waytest_sampler_admission.pyflake).main, or Measurements says why there is nothing to measure.third_party/untouched; nothing GPL-incompatible.When it applies
mainand passes here.tests/that reads changed source is updated, not weakened.Assisted-by:/Co-Authored-By:trailers.Ready to merge
main, measured again or a comment says why the numbers still hold.Tested in game: Windows 11 Radeon 860M (26.10.1 LLPC): 3-round interleaved A/B at 2880x1800 50% FSR 3.1 (-0.71 ms GPU, -5.3% m fsr3, +2.0% FPS, +2.9% 1% low) and 1920x1200 67% Auto FG (+2.5% FPS), plus cropped 16:9-in-16:10 and RX_VK_FSR_FG=1 RGBA8 HUD live smoke (77 made frames), 0 DEVICE_LOST
@Beanstalk Please test live HDR10 swapchain (
hdr=1on an HDR-capable display) forRGBA16Fhud.layerand HDRfg_scale_pqparity, plus NVIDIA DLSS/HDR and AMD RDNA 4 A/B.@Jer9 only members of
BigBeanscan start the farm.One of them can approve this request by reacting 👍 to it or to this comment.This request was ford3343c3, and the PR has changed since (dbfcea8), so a 👍 no longer approves it. Comment@Beanstalkagain to ask for the new commit.@rebase
I rebased this pull request onto
main(20bedc6da1): the new head isdbfcea8d28.Conflicts resolved
Nothing was built or run: read the resolution before merging.
Automated rebase by BeanBot (gpt-6.1-terra), asked for by HumanBean. Nothing was run; a maintainer decides.
d3343c3ededbfcea8d28Recommendation: Approve. The new test inherits renderer switches and can fail on a correctly working checkout. The reported performance runs also predate this rebased head, and the affected Tier 1 hardware and HDR paths still need testing. Nothing blocking is left: what remains is for the author before merging (below). Recommend approval; not approved on the forge.
The change reduces temporal and HUD target sizes and removes a cropped-present copy, at the cost of lower colour precision and new shader variants. The reported 860M runs are promising, but their results are not established for this head.
Should fix (2): not blocking, but worth doing before merging.
tests/test_temporal_present_bandwidth.py:68: The compiled fixtures inherit the caller's renderer switches, so this test's result depends on the developer's environment. (more on the line) Do: Run the fixtures with those renderer variables removed or explicitly set to the values required by the test.Testing before merging (2) (runs on the systems it can change; it doesn't hold the recommendation)
gpu/vk/shaders/fg_scale.comp:23: The changed presentation and temporal paths need the Tier 1 and HDR coverage identified in the PR before merge. (more on the line) Do: Run cropped presentation and relevant temporal/frame-generation paths on Tier 1 NVIDIA and AMD hardware, Linux/Steam Deck, and a live HDR10 swapchain; compare visual output and performance with the base.@fixcan do L1 and L2.Checks: Still running:
PR description / Title and description (pull_request_target).More: does it help, other systems, switches, what was read
Does it help: Unproven for this head: the PR reports three interleaved runs on a Windows Radeon 860M, with 26.73 to 26.02 ms GPU time and 29.06 to 29.64 mean FPS at 2880x1800; those runs compare
86b3b9e4with earlier PR commits, not base20bedc6dwith headdbfcea8d. Auto FG's reported 1% low fell from 13.14 to 12.63 FPS.Other systems: The crop shader also runs for other upscalers, GPUs and HDR presentation; the HUD format affects FSR frame interpolation, and the packed temporal input also affects game upscaling with FSR frame interpolation. The supplied live evidence covers Windows Radeon 860M SDR; HDR, NVIDIA, AMD discrete GPUs, Linux and Steam Deck remain unverified.
Switches: No switches added, changed or removed.
Reviewed:
dbfcea8d28against20bedc6da1: Read the repository rules and PR template, commit log, source diffs, changed shader sources, affected temporal and frame-generation paths, and portions of the changed tests and their runner. Skimmed generated SPIR-V headers; the full changed C++ files and test fixtures were not read in full. docs/review-checklist.md is absent; Tooling's rules were unavailable in the closed network.; nothing run (a code review).Checked and fine:
Testing: No code, tests, builds or project scripts were run, as requested. The author reports SDR game runs and automated checks; HDR and Tier 1 runs remain outstanding.
Overlaps and merge order: Not checked; the network is closed.
Automated code review by BeanBot (gpt-6.1-terra), asked for by BeanBot, after its rebase. Nothing was run; a maintainer decides.
@ -21,1 +21,3 @@layout(push_constant) uniform P { int mode; float sharp; float x0; float x1; int side; } pc;layout(push_constant) uniform P { int mode; float sharp; float x0; float x1; int side; int crop_x; int crop_y; int crop_w; int crop_h; } pc;// Map crop-normalized UVs [0, 1] into full-texture UVs clamped strictly to the crop's texel centers so// bilinear sampling never bleeds across padding outside the crop rectangle.L4 (should fix): The changed presentation and temporal paths need the Tier 1 and HDR coverage identified in the PR before merge.
When: Direct crop sampling now runs across GPU vendors and operating systems, including native HDR, while only an SDR Windows 860M run is reported.
Do: Run cropped presentation and relevant temporal/frame-generation paths on Tier 1 NVIDIA and AMD hardware, Linux/Steam Deck, and a live HDR10 swapchain; compare visual output and performance with the base.
@ -0,0 +65,4 @@"-Wno-missing-field-initializers", "-Wno-unused-function", "-Wno-unused-parameter",*extra_flags, str(cpp), "-o", str(exe)], check=True)r = subprocess.run([str(exe)], capture_output=True, text=True)if r.returncode:L1 (should fix): The compiled fixtures inherit the caller's renderer switches, so this test's result depends on the developer's environment.
When: With RX_VK_FSR_FG_HUDLESS=0 or RX_VK_FSR_FG_HUD_LAYER=0, the copied production functions disable the HUD layer; the SDR fixture then fails its expected RGBA8 allocation even though the implementation works.
Do: Run the fixtures with those renderer variables removed or explicitly set to the values required by the test.
@fix
dbfcea8d2894c751cf00Recommendation: Approve. The code is ready: only testing is left. The fixture environment fix preserves the bandwidth changes, and the standalone test command now includes its required headers argument. The reported performance comparison and Tier 1 and HDR coverage still need to be completed. Recommend approval; not approved on the forge.
What
@fixchangedI changed this pull request: the new head is
94c751cf00. I rebased it ontomain(aefc2383a6). I edited its description to match the change.Changed
Nothing was built or run: the checks run again on the new head.
The pull request reduces temporal and HUD target bandwidth and removes a cropped-present copy, at the cost of additional format-specific shaders and rendering paths. The fixture change isolates the checks from three renderer environment switches.
Testing before merging (2) (runs on the systems it can change; it doesn't hold the recommendation)
gpu/vk/shaders/fg_scale.comp:23: The changed presentation and temporal paths need the Tier 1 and HDR coverage identified in the PR before merge. When: Direct crop sampling now runs across GPU vendors and operating systems, including native HDR, while only an SDR Windows 860M run is reported. Do: Run cropped presentation and relevant temporal/frame-generation paths on Tier 1 NVIDIA and AMD hardware, Linux/Steam Deck, and a live HDR10 swapchain; compare visual output and performance with the base.Checks: they run again on this head (
CI / Third-party parts and guide screenshots (pull_request)failed on the last one); a failure shows on the pull request.More: does it help, other systems, switches, what was read
Does it help: Unproven for this base and head. The PR reports a 0.71 ms total GPU reduction and a 2.0% mean FPS increase at 2880x1800 on a Radeon 860M across three interleaved rounds, but those measurements used different commits; the Auto FG result also reports a 3.9% lower 1% low.
Other systems: The direct crop path also affects HDR presentation and other upscalers; the packed temporal path is gated by format support and rendering mode. Live HDR and the requested Tier 1 hardware results remain outstanding.
Switches: The fixture clears RX_VK_FRAMEGEN, RX_VK_FSR_FG_HUDLESS and RX_VK_FSR_FG_HUD_LAYER only in its child environment, restoring their default behavior for the checks. The base-to-head diff also adds LONGSHOT_CHECK_CACHE, enabled by default with a shared cache directory and disabled by setting it to 0.
Reviewed:
94c751cf00againstaefc2383a6: Read AGENTS.md, CONTRIBUTING.md, the fix diff, the temporal bandwidth test and relevant rendering diffs. Skimmed generated headers and the broader base-to-head changes; the full changed code was not read.; nothing run (a code review).Checked and fine:
Testing: No commands from the project or tests were run. The author reports Windows Radeon 860M gameplay and fixture checks; CI has not run on this head.
Overlaps and merge order: Not checked; the network is closed.
Automated code review by BeanBot (gpt-6.1-terra), asked for by BeanBot, after its fix. Nothing was run; a maintainer decides.
94c751cf00563e64fe1d