fix(vk): the fixed shares' fallback upscale is FSR 1, not a plain stretch #3220
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
3 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
MagicBeanDev/Longshot!3220
Loading…
Reference in a new issue
No description provided.
Delete branch "HumanBean/Longshot:fix/fsr1-fixed-share-fallback"
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
With the Game's own upscaler at Render resolution 67% or 50%, many GPUs that are not NVIDIA's (the Steam Deck's among them, where Minimum and Auto pick 50%) cannot run the game's network for that size. Its fallback stretched the small picture linearly, so edges showed as 2-pixel stair-steps. It now enlarges it with AMD's FSR 1 EASU, in one compute pass.
This revives #1552 by zeldaootr, closed as stale, on current
main; their commits are kept. One change from it: the FXAA stage is dropped. The game runs its own morphological anti-aliasing before the upscale (programs26fe0c70,685adb41,6637ac1d, seen in frame dumps), so this input is already anti-aliased, and #1552's description ("no anti-aliasing at all") was not right. With FXAA on top I saw no better edges than FSR 1 alone, and softer brick texture at 67%.Read:
fixed_share_upscaleingpu/vk/vk_draw.cpp,gpu/vk/shaders/fixed_share_upscale.comp.gen-shadersgainsffx = trueso a built-in shader can include AMD's headers.See #275.
Testing
Tested: Linux (CachyOS), RTX 3090, with the fallback forced (
RX_VK_FORCE_UPSCALE_STUB=1, since this GPU runs the networks), Market, 2560x1440: the log saysfixed shares' upscale: FSR 1 EASUat 67% and 50%;RX_VK_FIXED_SHARE_EASU=0givesmain'styped upscale helperpath.dev.py smokepasses.vk_draw.cpppasses an llvm-mingw-fsyntax-onlycompile.mise run test: 888 passed, 12 failed, 13 skipped. The same 12 fail onmain@f359e2621:test_dlssg,test_lifter,test_no_game_title,test_no_map_reload,test_present_acquire_ahead,test_present_geometry_trace,test_present_held_image,test_present_image_free,test_sync_watch_event,test_turf_budget,test_ui_renderer,test_vk_draw_overhead_lean.test_fixed_share_upscale.pyand the new cases oftest_upscale_fallback.pyfail onmain.Since that run and suite: rebased onto
main@3a0f7d8f(#3202, DLSS frame generation, which does not touch this path, so the numbers hold), and a failed descriptor-layout, pipeline-layout or sampler creation now leaves the pass out (checked bytest_fixed_share_upscale.py; Linux and llvm-mingw syntax compiles pass).Still to test:
main, no new shimmer, and the log line (@Beanstalk).Measurements
Verdict: edges are cleaner than
main's stretch; the pass costs about 0.13 ms of GPU time a frame at 1440p on an RTX 3090. Frame rate was not measured.Setup: Linux, RTX 3090, forced fallback, Market from the
market-entrancesave, 2560x1440, camera still; GPU time fromRX_VK_PASS_TIMING=1; screenshots below.f359e26249b0611c#1552's Steam Deck and Test Farm numbers were taken with the FXAA stage and an older
main, so they are not carried over.RX_VK_FIXED_SHARE_EASUis new and on by default.Risks
With the RGBA16F scene (Native HDR with PsychoV35) a fixed share does not reach this pass and is blitted as on
main; the docs say so. Found by reading the code, not run.The picture changes at 67% and 50% (and where a temporal upscaler fails at those shares or 58%) on GPUs that leave those networks out, and on NVIDIA only if the slow-network rule trips. EASU costs more GPU time than a linear stretch; on the Deck that cost is not yet measured.
RX_VK_FIXED_SHARE_EASU=0restoresmain's path. A pipeline that cannot be made falls back to the stretch. No saves, settings or shader caches change.Checklist
Ready for review
main; the title is a Conventional Commit.mise run testpasses (any failure that also fails onmainis named).main, or Measurements says why there is nothing to measure.third_party/untouched; nothing GPL-incompatible.When it applies
mainand passes here.gpu/vk/switches.def.tests/that reads changed source is updated, not weakened.mainand here, for a change that shows on screen.Assisted-by:/Co-Authored-By:trailers.Ready to merge
main, measured again or a comment says why the numbers still hold.🤖 Generated with Claude Code
https://claude.ai/code/session_017vw8e16e9JsGLrugow9vJQ
Tested in game: Linux (CachyOS), RTX 3090, the Market at 2560x1440, Game's own upscaler at 50% and 67% with the fallback forced (RX_VK_FORCE_UPSCALE_STUB=1): FSR 1 EASU draws both, cleaner edges than the plain stretch; smoke run from kokiri-start passed. Not yet run on a GPU that takes this path by itself.
Screenshots, Market, RTX 3090 with the fallback forced, a roof at 4x. Left:
main's stretch (RX_VK_FIXED_SHARE_EASU=0). Right: this PR.@Beanstalk steamdeck, windows amd and windows intel: this PR against main with the game's own upscaler at Render resolution 50% and 67%, Kokiri Forest and Hyrule Field, turning the camera, screenshots of edges, frame times, and the log's
fixed shares' upscalelinePossibly related, for context:
WIP: fix(vk): the fixed shares' fallback upscale is FSR 1, not a plain stretchto fix(vk): the fixed shares' fallback upscale is FSR 1, not a plain stretchBeanstalk test farm · an earlier run: commit
d8e9a35(the newer results are in a comment below)Commit
d8e9a35· approved by HumanBean (reviewed) · dashboard⚠️ Note: The screenshots and camera turns do not automatically establish cleaner edges or measure temporal shimmer; screenshot comparison only detects large picture changes.
⚠️ Note: The fallback log may be absent when a device runs the network instead, leaving the EASU path unjudged; Vulkan validation is not enabled by this plan.
Started at 02:27 UTC.
steamdeckwindows+amdwindows+intelfixed-share-edges· frame time p99 (ms), main → PR at each levelresolution=4(reference)resolution=2steamdeckwindows+amdwindows+intelWhat was tested
What will be tested · AI plan (
gpt-6.1-terra)Compare the PR with main on Steam Deck, Windows AMD and Windows Intel using the game's own upscaler at 50% and 67% render resolution. Each of three starts per side visits Kokiri Forest and Hyrule Field, captures stationary edge screenshots, turns the camera, and measures frame and GPU times for 20 seconds per place and resolution. The run records the fixed-shares upscale log line; a crash, a large screenshot difference, a pipeline failure, or a frame-time or GPU-time regression beyond the thresholds fails the PR. A missing EASU log line is reported as unjudged because a device may run the network instead of reaching the fallback.
4or2.kokiri-start(settings dlss=0, vsync=2, frame_rate_cap=6, quality_preset=0; switchesHOS_OUTPUT_RES=gpu,RX_VK_AUTO_TUNE=0), then teleport to Kokiri Forest, take the picture forest-edges to compare with main, move the stick, take the picture forest-turned, measure forest for 20 s (after 10 s warm-up), teleport to Hyrule Field, take the picture field-edges to compare with main, take the picture field-turned, measure field for 20 s (after 10 s warm-up); 3 runs on each side for each of 2 cells (1 game start a run).Recommendation: Approve. The new fallback can submit invalid Vulkan objects when initialization fails, instead of reliably returning to the linear path. Its image quality and frame-time cost also need verification on the hardware that normally uses it. Nothing blocking is left: what remains is for the author before merging (below). Recommend approval; not approved on the forge.
The fixed-resolution fallback uses FSR 1 EASU to produce cleaner edges in place of a linear stretch. It adds a compute pass and pipeline setup; the reported RTX 3090 pass time is about 0.12–0.15 ms at 1440p.
Should fix (1): not blocking, but worth doing before merging.
gpu/vk/vk_draw.cpp:12420: Initialization ignores descriptor-layout, pipeline-layout and sampler creation failures, but only checks the pipeline handle before dispatching. (more on the line) Do: Check each creation result before using its output, clean up any partially created objects, and return false so typed_upscale can take over. Add failure cases to the Vulkan-spy test.Testing before merging (2) (runs on the systems it can change; it doesn't hold the recommendation)
gpu/vk/vk_draw.cpp:12294: The default-on pass has not been measured or viewed on Steam Deck, a primary system that naturally takes this fallback. (more on the line) Do: Run interleaved main and PR comparisons on Steam Deck at both shares in the requested scenes, including camera motion, screenshots, average and 1% low FPS and frame times.gpu/vk/shaders/fixed_share_upscale.comp:29: The new shader has not been exercised on the affected AMD desktop and Intel drivers, or under Vulkan validation. (more on the line) Do: Run the requested Windows AMD and Intel comparisons and a Linux AMD RADV run at 50% and 67%, including motion, frame times and a validation-layer run.@fixcan do L1.Checks: Still running: 11 checks.
More: does it help, other systems, switches, what was read
Does it help: Unproven on the intended hardware. The author reports cleaner edges at 50% and 67% in a forced-fallback RTX 3090 comparison, but no run has exercised the path naturally on AMD, Intel or Steam Deck. No before-and-after frame-rate or frame-time measurements are reported.
Other systems: The path can run on AMD and Intel GPUs, Steam Deck, and NVIDIA when a network is skipped or a temporal upscale fails. The new shader and pipeline can affect image quality, GPU time and Vulkan compatibility on those systems; only forced fallback on Linux NVIDIA is reported. Other programs retain the existing typed fallback, and the 33% case returns to it when the scale exceeds the limit. No saves or renderer API structures change.
Switches: RX_VK_FIXED_SHARE_EASU is new, defaults on, and has a kill-switch row; 0 restores the linear fallback. The default's quality and performance are not yet measured on the systems that normally take the path.
Reviewed:
d8e9a3576dagainstf359e26213: Read the repository rules, contribution guide, standards and PR template; the diff, commit messages, changed shader, tests, generator changes, documentation changes, and the relevant vk_draw.cpp fallback and dispatch code. Skimmed the rest of the large renderer and shader recipe files and related replay locking. The full vk_draw.cpp and generator file were not read in full; generated shader headers and recorded runs were not available in the checkout. docs/review-checklist.md and the neighboring Tooling AGENTS.md were absent.; nothing run (a code review).Checked and fine:
Testing: Read-only review; no builds, tests or project scripts were run. The author reports a forced-fallback Linux RTX 3090 game run and game-free checks; CI is still running.
Overlaps and merge order: The description identifies #1552 as the earlier stale pull request whose commits are revived here; no other overlap was established.
Automated code review by BeanBot (gpt-6.1-terra), asked for by BeanBot, as HumanBean took it out of WIP. Nothing was run; a maintainer decides.
@ -0,0 +26,4 @@if (any(greaterThanEqual(g, pc.size))) return;const vec3 lin = textureLod(src, (vec2(g) + 0.5) / vec2(pc.size), 0.0).rgb;vec3 s = lin;ffxFsrEasuFloat(s, uvec2(g), pc.con0, pc.con1, pc.con2, pc.con3);L3 (should fix): The new shader has not been exercised on the affected AMD desktop and Intel drivers, or under Vulkan validation.
When: These GPUs normally omit the fixed-share networks and therefore execute this shader, unlike the tested RTX 3090's normal path; output and driver compatibility remain unverified.
Do: Run the requested Windows AMD and Intel comparisons and a Linux AMD RADV run at 50% and 67%, including motion, frame times and a validation-layer run.
@ -12282,3 +12292,3 @@if (input_view && output_view && input_format == VK_FORMAT_E5B9G9R9_UFLOAT_PACK32 &&output_format == VK_FORMAT_B10G11R11_UFLOAT_PACK32 &&typed_upscale(cmd, input_view, output_view, dst, 0, key, "generic RGB9E5 fallback", false)) {((fixed_share_network(key) && fixed_share_upscale(cmd, input_view, output_view, src, dst)) ||L2 (should fix): The default-on pass has not been measured or viewed on Steam Deck, a primary system that naturally takes this fallback.
When: At the Deck's 50% and 67% render settings, EASU replaces every linear fallback frame; its effect on camera-motion shimmer, frame times and 1% lows is unknown.
Do: Run interleaved main and PR comparisons on Steam Deck at both shares in the requested scenes, including camera motion, screenshots, average and 1% low FPS and frame times.
@ -12354,0 +12417,4 @@si.magFilter = si.minFilter = VK_FILTER_LINEAR;si.addressModeU = si.addressModeV = si.addressModeW = VK_SAMPLER_ADDRESS_MODE_CLAMP_TO_EDGE;si.maxLod = 0.25f;vkCreateSampler(dev.device, &si, nullptr, &linear);L1 (should fix): Initialization ignores descriptor-layout, pipeline-layout and sampler creation failures, but only checks the pipeline handle before dispatching.
When: If sampler creation fails after the pipeline succeeds, the code pushes a combined image sampler with a null sampler and dispatches it instead of taking the promised linear fallback. If descriptor or pipeline layout creation fails, subsequent Vulkan creation calls receive invalid handles.
Do: Check each creation result before using its output, clean up any partially created objects, and return false so typed_upscale can take over. Add failure cases to the Vulkan-spy test.
d8e9a3576d12e1d7c55bPushed
12e1d7c5, rebased onto main @3a0f7d8f. BeanBot's L1 is fixed: if the descriptor layout, pipeline layout or sampler is not made, nothing is dispatched and the plain stretch draws it, with a failing-creation case for each in the spy test.@Beanstalk steamdeck, windows amd and windows intel: this PR against main with the game's own upscaler at Render resolution 50% (resolution=4) and 67% (resolution=3, not 2: 2 is 75%, which does not take this path), Kokiri Forest and Hyrule Field, turning the camera, screenshots, frame times, and the log line
fixed shares' upscale: FSR 1 EASUBeanstalk test farm · an earlier run: commit
12e1d7c(the newer results are in a comment below)Commit
12e1d7c· approved by HumanBean (reviewed) · dashboard⚠️ Note: The screenshots and turns do not automatically establish cleaner edges or measure motion shimmer; the frame-time segments begin after the turns.
⚠️ Note: The EASU initialization log is printed once per process, so it cannot independently prove that both live-switched render resolutions used the pass.
⚠️ Note: Vulkan validation and the isolated EASU pass cost are not measured; GPU total time is recorded instead.
Started at 02:44 UTC.
steamdeckwindows+amdwindows+intelfixed-share-scenes· frame time p99 (ms), main → PR at each levelresolution=4(reference)resolution=3steamdeckwindows+amdwindows+intelWhat was tested
What will be tested · AI plan (
gpt-6.1-terra)The PR will be compared with main on Steam Deck, Windows AMD, and Windows Intel using the game's own upscaler at 50% and 67% render resolution. Three starts per side will capture still screenshots and measure uncapped frame times and GPU time in Kokiri Forest and Hyrule Field, with camera turns at each location. The run fails for a crash, a missing successful EASU log line, excessive screenshot differences, or frame-time or GPU-time regressions over 20%.
4or3.kokiri-start(settings dlss=0, vsync=2, frame_rate_cap=6, quality_preset=0; switchesHOS_OUTPUT_RES=gpu,RX_VK_AUTO_TUNE=0), then teleport to Kokiri Forest, take the picture forest-still to compare with main, move the stick, take the picture forest-turned, measure forest for 30 s (after 10 s warm-up), teleport to Hyrule Field, take the picture field-still to compare with main, take the picture field-turned, measure field for 30 s (after 10 s warm-up); 3 runs on each side for each of 2 cells (1 game start a run).Pushed
49b0611cafter a second cold review of the branch: rewritten to read test, then fix (zeldaootr's two commits, with the follow-ups folded in; the renderer and shader are as in12e1d7c5). New: a failed-pipeline case in the spy test, the docs say the RGBA16F scene does not reach this pass (as on main), and two long doc lines are wrapped.The farm's windows+amd jobs on
12e1d7c5did not run this PR: their prefetch failed withModuleNotFoundError: No module named 'renhdrum'(jb_d73278ed6142659e, jb_da4c5b14b1c82fc3), a module main does not have underscripts/.12e1d7c55b49b0611cd4Beanstalk test farm
Commit
49b0611· approved by nobody yet · dashboardA member of
BigBeanscan review this commit and comment@Beanstalkto test it.@review
Recommendation: Approve. The code is ready: only testing is left. The initialization failure paths now fall back to the existing stretch. The default-on shader still needs quality, performance and compatibility results on the AMD and Intel systems it is intended to help. Recommend approval; not approved on the forge.
The fixed-share fallback uses FSR 1 EASU instead of a linear stretch for supported upscale ratios, improving the reported edges at the cost of an extra compute pass. Failed initialization leaves the existing stretch in place.
Testing before merging (2) (runs on the systems it can change; it doesn't hold the recommendation)
gpu/vk/vk_draw.cpp:12294: The default-on pass has not been measured or viewed on Steam Deck, a primary system that naturally takes this fallback. When: At the Deck's 50% and 67% render settings, EASU replaces every linear fallback frame; its effect on camera-motion shimmer, frame times and 1% lows is unknown. Do: Run interleaved main and PR comparisons on Steam Deck at both shares in the requested scenes, including camera motion, screenshots, average and 1% low FPS and frame times.gpu/vk/shaders/fixed_share_upscale.comp:29: The new shader has not been exercised on the affected AMD desktop and Intel drivers, or under Vulkan validation. When: These GPUs normally omit the fixed-share networks and therefore execute this shader, unlike the tested RTX 3090's normal path; output and driver compatibility remain unverified. Do: Run the requested Windows AMD and Intel comparisons and a Linux AMD RADV run at 50% and 67%, including motion, frame times and a validation-layer run.Since the last review (on
d8e9a3576d)Resolved: L1 (Initialization ignores descriptor-layout, pipeline-layout and sampler creation failures, b…)
Still open: L2 (The default-on pass has not been measured or viewed on Steam Deck, a primary system that n…); L3 (The new shader has not been exercised on the affected AMD desktop and Intel drivers, or un…)
Checks: Still running: 11 checks.
More: does it help, other systems, switches, what was read
Does it help: Unproven on the primary affected systems. The author reports cleaner edges on a forced RTX 3090 fallback and 0.12–0.15 ms for the EASU pass at 1440p; there is no comparable stretch timing or frame-rate measurement.
Other systems: Steam Deck, Windows AMD and Windows Intel naturally taking the fallback remain untested. Vulkan validation is also outstanding. The RGBA16F path remains on the existing blit, and other networks retain their existing fallback.
Switches: RX_VK_FIXED_SHARE_EASU is new and defaults on; setting it to 0 restores the linear stretch. Its default remains to be assessed on the Steam Deck and other affected hardware.
Reviewed:
49b0611cd4against3a0f7d8f7f: Read the current fixed-share initialization and dispatch, the supplied range diff, ledger, description and comments, and the repository contribution rules and pull request template. Skimmed the overall diff and tests; the full changed code files and dependent paths were not all read in full.; nothing run (a code review).Checked and fine:
Testing: No commands from the project or tests were run. The author reports an in-game forced-fallback run on Linux with an RTX 3090, game-free tests and Linux and Windows syntax checks; CI is still running.
Overlaps and merge order: Not established from the supplied information.
Automated code review by BeanBot (gpt-6.1-terra), asked for by HumanBean. Nothing was run; a maintainer decides.
On the measured main: the numbers are from main @
f359e262;3a0f7d8fadds #3202 (DLSS frame generation through Streamline), which does not touch the fixed shares' fallback, so they hold.