WIP: fix(vk): the full-size network's stand-in draws at 100% Render resolution, so GTX 10 cards show the 3D there #718
No reviewers
Labels
No labels
area/accessibility
area/audio
area/input
area/install
area/menu
area/renderer
area/saves
area/upscaling
beanstalk: approved @ 1697603
beanstalk: approved @ 2c5a62e
beanstalk: approved @ 4fd82b7
beanstalk: approved @ 64d6d09
beanstalk: approved @ 6f91fae
beanstalk: approved @ 70a78f9
beanstalk: approved @ 8d361dc
beanstalk: approved @ 9d8356e
beanstalk: approved @ abf2227
beanstalk: approved @ d82f202
beanstalk: approved @ e5f1e40
beanstalk: approved @ ee8ab5f
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
status
blocked
status
confirmed
status
duplicate
status
invalid
status
needs-info
status
wontfix
testing wanted
ci: approved
No milestone
No project
No assignees
3 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
MagicBeanDev/Longshot!718
Loading…
Reference in a new issue
No description provided.
Delete branch "llun/Longshot:fix/full-size-network-stand-in"
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?
Type: fix · Risk: low · Tested on: Windows 11, RTX 5080 (the GTX 10 path forced with
RX_VK_FORCE_UPSCALE_STUB=2) · Needs: Windows, a GTX 10 card (or an RX 400/500 on Linux)Why
On a GTX 10 card (a player's GTX 1080 Ti, nightly-170) the game is black under the HUD when Render resolution is 100%,
whatever the resolution or the upscaler, and the picture comes back at once at 92% or lower. These cards have no f16
shaders, so since https://github.com/NotRexed/Hookshot/pull/2343 (which Longshot carries) every one of the game's
upscale networks is left out on them, the two gameplay ones too, and a stand-in draws their output instead. At 100%
the game runs its full-size pass,
9dc98871eb7fc101, which reads the 3D at the output's own size; the stand-in onlytook passes whose output is bigger than their input, so at 100% nothing drew the picture. Polaris cards on RADV (RX
400/500, also without f16 shaders) take the same path.
It is not the mesh fallback: the 3D is drawn (about 2,000 draws a frame in the player's log), only the last step that
puts it into the picture was missing.
See #687 (an opt-in FXAA stand-in for the same full-size network
where it translates; it doesn't reach these cards, where the network is left out before it).
How to reproduce
Seen on: Windows 10, GTX 1080 Ti (Pascal), driver 572.70, nightly-170 (
6c9edffe); here on Windows 11, RTX 5080, 621.24, maine090cc48, with the GTX 10 path forcedSettings and switches: Render resolution 100%, any upscaler (Off, the game's own or AMD FSR 3.1); on a card with f16 shaders,
RX_VK_FORCE_UPSCALE_STUB=2inlongshot_env.txtsends the gameplay networks to the stand-in, as on a GTX 10Steps: load any save and look at the game in play
Expected: the 3D under the HUD
Actual: black under the HUD; 92% or lower shows the picture. The player's log has
program 9dc98871eb7fc101 not translated: a network left out on this card, then the pass dispatched with a 2560x1440 input and a 2560x1440 output, and no stand-in line for it until the scale is loweredWhat changed
upscale_stubnow also takes a pass of the two gameplay networks whose output is its input's size, so the full-sizepass is drawn at 100% on cards that leave the network out. It goes through the typed RGB9E5 fallback the 3/4 network
already takes there, so its colours decode right. Cards that run the network (every RTX card without the switch) are
unchanged.
upscale_stubingpu/vk/vk_draw.cpp: an output of the input's size is taken forgameplay_network()keys only(another program's pass of that shape is still no upscale and is left as before); a smaller output still isn't.
log line once,
vk: the full-size network 9dc98871eb7fc101 is drawn by the typed fallback (WxH -> WxH), and theexisting "unavailable" warning covers it. At a fixed share below 100% the full-size pass now also takes the typed
fallback where its input is RGB9E5, instead of a plain blit of those bits.
tests/test_upscale_fallback.py: the same-size pass of both gameplay networks is drawn (typed, or the blit whenits input isn't RGB9E5, with the warning when the typed path can't run), another program's same-size pass and a
smaller output are not, and the full-size network takes the typed fallback at a fixed share. The blit stub checks the
sizes it is given rather than one fixed pair.
docs/tested/2026-11-15-full-size-stand-in-llun-*.md, the six runs below.Measurements
Verdict: fixes it. With the GTX 10 path forced at 100%, main's picture is black in both runs (mean luma 0.6, 99.4%
of the pixels near black) and this PR's shows the 3D in both (33.4-32.7, under 3% near black). Without the switch both
builds draw the same.
Hardware: Windows 11 Pro (26300), RTX 5080 16 GB, driver 621.24, Ryzen 9 9900X3D, 64 GB
Scene: Kokiri Forest, Link's house (the repository save
kokiri-start), 1920x1080 output, Render resolution 100%, Upscaler Off, no frame generation, uncapped, headlessMethod:
longshot_ctl.py launch --profile test --headless --repo-save kokiri-start; 300 presents after play began, one screenshot through the control bridge (1280x720); its mean luma (0-255) and the share of pixels under 8, sampled every 4th pixel each way; the log lines for9dc98871eb7fc101. Runs alternated main, PR, main, PR, then one each without the switchHow to reproduce: the settings above with
RX_VK_FORCE_UPSCALE_STUB=2Baseline: one game folder of main
25726217(a copy; same game binary in every run), withlongshot_vk.dllbuilt alone (RX_VK_ONLY, release, llvm-mingw, NVIDIA DLSS SDK, same flags) from maine090cc48and from this PR, swapped between runs.MKWVK_API_VERSIONis 22 in both, and no shader-translator file differs from 25726217's, so the caches stayed valide090cc4832e088a7RX_VK_FORCE_UPSCALE_STUB=2, run 1: mean luma, near-blackRX_VK_FORCE_UPSCALE_STUB=2, run 2The frame rate wasn't compared: the change only adds a pass where nothing was drawn before, on cards that leave the
network out.
Flags and settings
None.
Screenshots
Same spot, 100%, Upscaler Off,
RX_VK_FORCE_UPSCALE_STUB=2, in#718 (comment):
Before: main @
e090cc48(black under the HUD) | After: this PR @32e088a7(the 3D, right colours).Testing
Tested: game-free:
tests/test_upscale_fallback.pywith clang 23 (llvm-mingw): its new same-size cases fail onmain's
upscale_stub(RED: 9dc-same: upscale_stub turned the pass away, its output never written, the same forsame-fd,9dc-same-r11,9dc-same-no-storage;9dcasserts on the blit) and all 38 cases pass here.python -I -B tests/run_all.py(Windows) on this PR @cc73b1fd, rebased on main609889f2: 497 passed, 21 failed, 80 skipped: test_longshot_ctl (a timing check, it failed while three suites ran at once and passes alone, twice) andthe same 20 as main
609889f2on this PC (test_appimage_player_build, test_bake_portability, test_cpp_preflight, test_crash_dialog, test_env_on, test_fpx_sticky, test_lift_cache, test_lift_cleanup_error, test_linux_preflight, test_make_game_cache, test_make_game_prepare, test_missing_nup, test_oot_state_tap, test_options_budget_once, test_readback_late, test_spawn_emit, test_tested_configurations, test_vk_occlusion_queries, test_vk_pgo, test_walk_key);test_taau_typed_dispatch,test_drawn_page_mapandtest_upscaler_rows,which also read this function, pass. In the game: the runs in Measurements (Windows 11, RTX 5080, 621.24, headless).
Not tested: a real card without f16 shaders: this PC has none, so the path was forced with
RX_VK_FORCE_UPSCALE_STUB=2, which sends the same networks through the same function; what it can't show is aPascal driver's own behaviour. Not run: 2560x1440 or other outputs, Native HDR with PsychoV35 (that path is unchanged:
it stays the 3/4 network's alone), Linux.
Must be tested:
AMD FSR 3.1, in play, expecting the 3D under the HUD each time and
vk: the full-size network 9dc98871eb7fc101 is drawn by the typed fallbackonce inlongshot_log.txt, and 92% and 75% as before (by hand: a GTX 10 owner, through atest request)
Risks
What could break: only the stand-in, which runs where the gameplay networks are left out (GTX 10, RX 400/500 on
RADV,
RX_VK_NO_F16,RX_VK_FORCE_UPSCALE_STUB). There, a same-size pass of the two gameplay networks is now drawninstead of skipped, and the full-size network at a fixed share takes the typed fallback instead of a blit when its
input is RGB9E5. Other programs, and every card that runs the networks, take the same path as before. At 100% FSR 3.1
does not take the pass on these cards (it turns away a same-size input it doesn't know), so the picture there is the
typed fallback's, without anti-aliasing, as the 3/4 network's stand-in already is.
Turning it off: revert the commit (
RX_VK_NO_UPSCALE_STUB=1turns off the whole stand-in, the black screen with it).Compatibility: Nothing changes: no option, cache, save or
MKWVK_API_VERSIONchange.Checklist
Everyone
type(scope): description) of the status line's type.main.python -I -B tests/run_all.pypasses (any failure that also fails onmainis named).third_party/untouched (a new folder with aPROVENANCE.mdinstead).When it applies
Assisted-by:/Co-Authored-By:trailers.docs/tested/for each new measured run (format indocs/tested-configurations.md).mainand passing here.tests/that reads changed source updated in this PR, not weakened.llvm-mingw. Linux: the Test Farm built this PR @
9d8356e1on Ubuntu 26.04, RTX 4070, report rp_bca2d31bcc9a4c8a, andthe game started; the change since is a rebase.)
🤖 Generated with Claude Code
Screenshots for the description: the same spot (Kokiri Forest, Link's house,
kokiri-start), 1920x1080 output, Render resolution 100%, Upscaler Off,RX_VK_FORCE_UPSCALE_STUB=2(the GTX 10 path), RTX 5080, Windows 11. Screenshots through the control bridge, 1280x720.Before: main @
e090cc48: black under the HUD (run main1: mean luma 0.6, 99.4% near black).After: this PR @
32e088a7: the 3D, right colours (run fix1: mean luma 32.7, 2.9% near black).Description: the screenshots linked (comment 23295); Must be tested gains the Test Farm's Linux build, with an expected result on each item; the Linux build box is added, unticked until that build reports (no Linux compiler on this PC).
Description: the Linux build item says what to expect.
@Beanstalk linux, build this PR and start it into play (kokiri-start), Render resolution 100%, Upscaler Off: expecting the build to finish and the 3D under the HUD in play
Beanstalk test farm
Commit
5c98eef· tier untrusted · approved by nobody yet · dashboardA member of
BigBeanscan review this commit and comment@Beanstalkto test it.9d8356e1b367fb71be59Rebased onto main
c9fbb0d6(67fb71be, no code change); full suite on Windows 494 passed, 20 failed = main c9fbb0d6's own 20. Linux-build box ticked: the Test Farm's run (report rp_bca2d31bcc9a4c8a, Ubuntu 26.04, RTX 4070) built this PR and main and started both; both then timed out at 'the game did not read the controller', a farm step, so play on Linux is still to be shown and the PR stays WIP.67fb71be59cc73b1fd59Rebased onto main
609889f2(13 new commits, clean): headcc73b1fd. Full suite: the same 20 failures as main609889f2on this PC, plus test_longshot_ctl (a timing check that failed with three suites running at once; it passes alone, twice; this PR doesn't touch it). Still WIP for a Linux play run and a GTX 10 tester (T-42YH).cc73b1fd595c98eeffadRebased onto
main@bbe6fdf2. No tests were run here; the test boxes stay yours. No conflicts.View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.