AMD GPU (RX 9070 XT): translator and binding fixes, plus findings on the bare tree canopies #138
Closed
AyyBeeDee20738 wants to merge 1 commit from
amd-fixes into main
pull from: amd-fixes
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!138
Loading…
Reference in a new issue
No description provided.
Delete branch "amd-fixes"
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?
Testing on an AMD card, as the README asks. This is a day of frame-dump debugging on an RX 9070 XT, most of it on
lighting-fix(da030c5). The fixes that are not yet inmainare in this PR, rebased onto4756836and build-checked there (the renderer alone,RX_VK_ONLY=1: 0 failures, links). Nothing from the game is included: no game files, keys, logs, frame dumps or shader dumps. Programs are named by their Hookshot keys only.Setup: AMD Radeon RX 9070 XT 16 GB, AMD Software: Adrenalin Edition 26.10.1 (Windows driver 32.0.32015.7029; Vulkan driver version 2.0.416, 0x8001a0, Vulkan 1.4), Ryzen 5 7600, Windows 11 25H2. Resolution 100%, Upscaling Off, 1440p.
In this PR (all missing from
mainas of4756836)ISETP+SELagainst a register aMOV32Iset, not anIMNMXindirect_branch_table_track.cpp,control_flow.cpp(the error now lists the opcodes before the jump)NMin/NMax), Lichii #432 / #437emit_spirv_floating_point.cpp,spirv_emit_context.cpp(the f16x2/f32x2 atomic min/max loops)collect_shader_info_pass.cpp,shader_info.h(frag_color_components),vk_draw.cpptarget_write_mask.RX_VK_ALL_COMPONENTS=1: offRED(0x98e) added to the opcodes whose bits 32-39 are a data register for the high-GPR rename (Lichii #149)lower_to_maxwell.hstage_cbuf_word, notdriver_bank_wordc1(the program's constants) read 0 from the driver banks and was bound to nothingvk_draw.cpp(both binding loops)vk_draw.cppsampler_for.RX_VK_DREF_FROM_SAMPLER=1: as beforevk_draw.cpp9dc98871eb7fc101kept by default (next to the TAAU)vk_shader.cppvk_draw.cpp:RX_VK_LOG_MESH_PROGS=1(each mesh program's draws and indirect arguments); in a frame dump,dump-reachlines (each dispatch's storage/uniform buffers and translated bindings) andmesh indirectbuffers (indirect mesh arguments read back from the GPU)Found independently, already fixed in
main(no action needed)da030c5the volume lighting passee7764a6b1ef459cgot 0 from all 101 of its global loads (its inputs sit behind pointers in a 64-byte storage buffer). Result: no sky ambient, dark characters, black canopies, a white haze. I fixed it with a compute pointer table;ffcdb71/52cebb1fix it more generally with the page table. Confirmed that this was the main cause of the dark characters.ffcdb71.4756836caps the texture cache.Still open: findings for you
A. Tree canopies are missing everywhere (Kokiri Forest, the Deku Tree's crown)
Compared with Switch 2 footage of the same spot, every tree is bare branches; near ferns and grass draw. What I measured:
f0fed2bbccae7bdc,cb2e06ddfb9d7d27,44511d69b52282ad,4247f1b4c3ce6cf3, …) have those argument buffers bound and store to memory.f0fed2bbccae7bdcthe instance counts are atomic adds/max atc0[0x90]+c1[0]+ small constants.c1[0]is 12 here. Storage tracking takesc1+0as the buffer: the biased search fails because compute descriptors start at c0+0x40, and the unbiased search accepts the first cbuf read. So the atomics target a "buffer" at address 12.c1inTrack(my experiment, not in this PR) makes the atomics target the right buffer (c0+0x90). The counts were still 0, and other programs started flashing white, so I backed it out. The tracking is still worth a look, but the culling also rejects everything for another reason: its inputs (frustum, visibility/HiZ, instance records).B. Fog far too thick with
RX_VK_OOT_VISUAL=0(onda030c5)Once the sky ambient worked, turning the workaround off made the fog-apply pass (
1a7482c0ec9991ea) raise the scene's mean from about 0.5 to 2.7. Lichii's fog at the same spot is much lighter. The missing canopies (A) probably account for part of it.C. Brightness pulses only while the window has focus
RX_VK_SUBMIT_DELAY_US=1000helps a lot, which fits your notes on the race with the game's threads.D. Small things
prepare_run's progress callback, so "Preparing shaders: 0 of 42537" looks hung. All workers had finished; the main thread was waiting inWriteFile. Esc resumes it. Turning QuickEdit off on that console would avoid it:SetConsoleMode(GetStdHandle(STD_INPUT_HANDLE), ENABLE_EXTENDED_FLAGS)withoutENABLE_QUICK_EDIT_MODE.9dc98871eb7fc101left out made Auto resolution black on AMD (#8 above); 100% resolution worked around it.Tried with no visible effect (kept here so nobody repeats them)
mainhasRX_VK_NO_F16.53509044401d78d2that is skipped by default (RX_VK_SKIP_PROG=-).Happy to test anything on this card. All of it can be reproduced with the switches above and the dump trigger (
RX_VK_DUMP_FILE).🤖 Generated with Claude Code
Thank you! Applied by hand to the current code (it had moved on, so it couldn't merge directly), credited in the commit, and shipped in https://github.com/NotRexed/Hookshot/releases/tag/less-stutter.