Make the game's upscale dispatch addressable by an upscaler backend #821
Closed
notquiteog wants to merge 5 commits from
feat/upscale-descriptor-order into main
pull from: feat/upscale-descriptor-order
merge into: MagicBeanDev:main
MagicBeanDev:main
MagicBeanDev:github/pr/2893
MagicBeanDev:github/pr/2890
MagicBeanDev:github/pr/2887
MagicBeanDev:github/pr/2878
MagicBeanDev:github/pr/2875
MagicBeanDev:github/pr/2874
MagicBeanDev:github/pr/2873
MagicBeanDev:github/pr/2871
MagicBeanDev:github/pr/2756
MagicBeanDev:github/pr/2897
MagicBeanDev:github/pr/2896
MagicBeanDev:github/pr/2718
MagicBeanDev:github/pr/2842
MagicBeanDev:github/pr/2691
MagicBeanDev:github/pr/2895
MagicBeanDev:github/pr/2743
MagicBeanDev:github/pr/2765
MagicBeanDev:github/pr/2708
MagicBeanDev:github/pr/2732
MagicBeanDev:github/pr/2755
MagicBeanDev:github/pr/2817
MagicBeanDev:github/pr/2876
MagicBeanDev:release-please--branches--main
MagicBeanDev:release-please--branches--main--release-notes
MagicBeanDev:github/pr/2778
MagicBeanDev:github/pr/2888
MagicBeanDev:github/pr/2866
MagicBeanDev:github/pr/2877
MagicBeanDev:github/pr/2800
MagicBeanDev:github/pr/2829
MagicBeanDev:github/pr/2850
MagicBeanDev:github/pr/2889
MagicBeanDev:github/pr/2882
MagicBeanDev:github/pr/2860
MagicBeanDev:github/pr/2849
MagicBeanDev:github/pr/2886
MagicBeanDev:github/pr/2794
MagicBeanDev:github/pr/2840
MagicBeanDev:github/pr/2830
MagicBeanDev:github/pr/2834
MagicBeanDev:github/pr/2719
MagicBeanDev:github/pr/2742
MagicBeanDev:github/pr/2741
MagicBeanDev:github/pr/2820
MagicBeanDev:github/pr/2771
MagicBeanDev:github/pr/2859
MagicBeanDev:github/pr/2858
MagicBeanDev:github/pr/2823
MagicBeanDev:github/pr/2757
MagicBeanDev:github/pr/2769
MagicBeanDev:github/pr/2844
MagicBeanDev:github/pr/2843
MagicBeanDev:github/pr/2673
MagicBeanDev:github/pr/2855
MagicBeanDev:github/pr/2739
MagicBeanDev:github/pr/2807
MagicBeanDev:github/pr/2851
MagicBeanDev:github/pr/2789
MagicBeanDev:github/pr/2814
MagicBeanDev:github/pr/2818
MagicBeanDev:github/pr/2774
MagicBeanDev:github/pr/2772
MagicBeanDev:github/pr/2750
MagicBeanDev:github/pr/2786
MagicBeanDev:github/pr/2785
MagicBeanDev:github/pr/2782
MagicBeanDev:github/pr/2779
MagicBeanDev:github/pr/2775
MagicBeanDev:github/pr/2706
MagicBeanDev:github/pr/2766
MagicBeanDev:github/pr/2747
MagicBeanDev:github/pr/2759
MagicBeanDev:github/pr/2745
MagicBeanDev:github/pr/2740
MagicBeanDev:github/pr/2733
MagicBeanDev:github/pr/2725
MagicBeanDev:github/pr/2727
MagicBeanDev:github/pr/2728
MagicBeanDev:github/pr/2729
MagicBeanDev:github/pr/2721
MagicBeanDev:github/pr/2722
MagicBeanDev:github/pr/2715
MagicBeanDev:github/pr/2714
MagicBeanDev:github/pr/2707
MagicBeanDev:github/pr/2703
MagicBeanDev:github/pr/2705
MagicBeanDev:github/pr/2697
MagicBeanDev:github/pr/2679
MagicBeanDev:github/pr/2676
MagicBeanDev:github/pr/2669
MagicBeanDev:docs/what-hookshot-connects-to
MagicBeanDev:fix/hdr-encode-test
MagicBeanDev:fix/main-tests
MagicBeanDev:fix/play-cache-files
MagicBeanDev:perf/game-barrier-order
MagicBeanDev:feat/heap-lazy
MagicBeanDev:feat/texture-detail
MagicBeanDev:perf/astc-opaque-bc1
MagicBeanDev:fix/fs-dir-lock
MagicBeanDev:fix/framegen-native-kept
MagicBeanDev:fix/update-no-downgrade
MagicBeanDev:port/k10-gcn-f16-mirrors
MagicBeanDev:fix/framegen-mult-cap
MagicBeanDev:chore/release-as-2.1.1
MagicBeanDev:perf/pcache-load-switch
MagicBeanDev:fix/prepare-progress-log
MagicBeanDev:fix/update-closes-stale-game
MagicBeanDev:fix/hdr-scaled-sampled
MagicBeanDev:perf/first-start-preset
MagicBeanDev:perf/zero-upload
MagicBeanDev:fix/vcore-escape-2s
MagicBeanDev:test/fake-gh-atomic
MagicBeanDev:perf/batch-idle-flush
MagicBeanDev:test/finish-stub-a
MagicBeanDev:chore/record-2.1.0
MagicBeanDev:fix/main-red-tests
MagicBeanDev:fix/test-display-startup-driver-cache
MagicBeanDev:feat/mesh-shader-mode
MagicBeanDev:fix/menu-probes-at-startup
MagicBeanDev:fix/fps-counter-classic
MagicBeanDev:fix/test-log-batch-flake
MagicBeanDev:fix/narrow-screen-hud
MagicBeanDev:ci/prereleases
MagicBeanDev:release/v2.0.15
MagicBeanDev:hotfix/v2.0.15
MagicBeanDev:fix/present-ahead-replay
MagicBeanDev:release/v2.0.13
MagicBeanDev:fix/bracket-paths-2013
MagicBeanDev:fix/hdr-overlays-2013
MagicBeanDev:fix/fps-counter-scale-2013
MagicBeanDev:fix/stick-seen-at-rest
MagicBeanDev:hotfix/menu-fits-screen
MagicBeanDev:fix/f1-always-opens-menu
MagicBeanDev:fix/ini-keep-lines
MagicBeanDev:claude/cranky-pike-7cf247
MagicBeanDev:perf/texture-answer-flat
MagicBeanDev:fix/stamp-test-modules
MagicBeanDev:fix/appimage-fonts
MagicBeanDev:fix/display-awake
MagicBeanDev:release/v2.0.12
MagicBeanDev:fix/discord-windows
MagicBeanDev:rc/v2.0.12-tests
MagicBeanDev:fix/dlss-keep-feature
MagicBeanDev:rc/v2.0.12
MagicBeanDev:button-icons
No reviewers
Labels
Clear labels
accessibility
Barrier affecting people with disabilities
autorelease: pending
autorelease: tagged
bug
Something isn't working
dependencies
Pull requests that update a dependency file
documentation
Improvements or additions to documentation
duplicate
This issue or pull request already exists
enhancement
New feature or request
github_actions
Pull requests that update GitHub Actions code
good first issue
Good for newcomers
help wanted
Extra attention is needed
invalid
This doesn't seem right
question
Further information is requested
testing wanted
wontfix
This will not be worked on
No labels
accessibility
autorelease: pending
autorelease: tagged
bug
dependencies
documentation
duplicate
enhancement
github_actions
good first issue
help wanted
invalid
question
testing wanted
wontfix
Milestone
Clear milestone
No items
No milestone
Assignees
Clear assignees
No assignees
1 participant
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".
No due date set.
Dependencies
No dependencies set
Reference
MagicBeanDev/Hookshot!821
Loading…
Reference in a new issue
No description provided.
Delete branch "feat/upscale-descriptor-order"
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?
Several open requests ask for DLSS, FSR or "a proper upscaling technique" (#744, #691, #687, #672). This does not add a backend. It does the groundwork a backend needs, and writes down where one belongs, so that the interesting part can be reviewed on its own afterwards.
The finding this is built on
OoT evaluates its own neural TAAU network (program
fd029a317a9a4b94), andtaau_stand_iningpu/vk/vk_draw.cppalready recognizes that dispatch and substitutes a compute resolve where the device has no hardware f16 matrix multiply. So the game already renders the 3D at a reduced internal resolution and resolves it temporally — a vendor upscaler takes that dispatch's place.The composited window image, where the
upscalefilter and the frame interpolator work, is the wrong place for one: no depth, no motion, and the HUD already in the history. That is why the existing interpolator block-matches quarter-size luma.What is in here
gpu/vk/upscale_contract.h— which sampled binding is colour, motion and depth, and the sets it must refuse rather than guess. No Vulkan include, nothing from guest memory.gpu/vk/upscale_format.h— the one place that decides what aVkFormatmeans to that contract. Separate so it is testable: which formats count as motion is the part most likely to be wrong, and a wrong answer there is handed to an upscaler as motion.gpu/vk/upscale_seam.h— a recognized dispatch resolved once into anupscale::Request,choose()to pick a backend, andtemporal_possible()as the gate one must pass.docs/upscaling.md— the integration point, the input contract, what each vendor runtime permits, and the order the rest can land in.No behaviour change. The stand-in is still the only backend; it is a spatial resolve that needs none of the contract, and
choose()returns it under exactly the condition the old first guard tested.tests/upscale_seam_test.cpppins that: making the stand-in require the contract fails the test.The bug this caught on the way
The contract first read
draw_sampled, which is the obvious list and the wrong one. It records a sampled texture only where the GPU has written it and records every storage image too, so its indexiis notdw.imgs[i]. A backend wired to that would upscale whichever texture happened to be bound first and ghost, and the ghosting would be filed as a renderer bug.upscale_bindingsnow resolves the texture descriptors the waybuild_descriptorsdoes — same view type, sameViewUse::Sample, samehandle_is_storage_pointerguard for the cased603d98bbfixed — so an index is a descriptor slot.Tested
RX_VK_ONLY=1(nx2/build.py --standalone), 0 warnings, and a full game build from a v131072 dump (builde0f3ccfa) succeeded in 8m20s.no upscaler inputs, correctly, since they sample one 1920x1080 texture and nothing else. The gameplay TAAU dispatch was not reached in that run, so the seam has not fired on it yet and the PR does not claim it has.RX_VK_PRECOMPILE=0so every pipeline compiled on demand; it is not a performance measurement.python -I -B tests/run_all.py: 89 passed. The 14 failures and 7 skips are identical on pristinemainin this environment (87 passed there; the +2 are the two tests added here), and are a missingclang++plus pre-existing SPIR-V and BC-level failures.Not in here
No DLSS, no FSR, no frame generation, no change to the internal resolution, no new runtime dependency and no vendored runtime. Every new switch is off or neutral unless asked for.
AI assistance: recorded in the commit trailers.
Correction, from a warmed run that reached gameplay. The premise in the description above is wrong, and the log that this PR adds is what shows it:
One sampled texture, one written image, nothing else — no motion, no depth. All eleven cooperative-matrix networks in the game are that shape: at most two sampled textures, never a motion or depth target among them. So OoT's upscaler is a single-image neural upscaler, not a motion-vector temporal one, and a temporal upscaler cannot take that dispatch's place: it is never handed what one needs.
temporal_possible()refuses there and will keep refusing however a backend is wired.Two things follow, and I would rather say them here than have a reviewer find them.
The integration point in
docs/upscaling.mdis superseded, and #577's — at the final resolve, with depth carried from the scene passes and motion derived from the camera — is the right one for this game. The doc in the branch now says that above the section it contradicts. The inputs have to be assembled, not taken.What stands: the contract and the gate did their job, refusing rather than handing an upscaler whichever texture happened to be bound first, which is the failure the descriptor-order commit is about. The per-network log is what produced this answer. The census is unaffected.
The run also confirms the opportunity is real: the network's input is 1536x864 against a 2048x1152 scene, so the game already renders the 3D at 75% and upscales.
Happy for this to be judged on the contract, the log and the descriptor-order fix alone — the "a vendor upscaler takes that dispatch's place" framing should not be read as a claim any more. Tested on Linux, RTX 5060 Ti, driver 615.71.09, a full build from a v131072 dump.
Thank you, and thanks for the honest follow-up! As your own comment shows, OoT's upscale network takes a single image, so a temporal upscaler can't take that dispatch's place as described; #850 takes another route (motion from depth and the camera). Closing to keep the queue clear; a smaller PR with the parts that still apply would be welcome.