Working fallback mesh shaders (AMD RDNA1) and various performance and accuracy fixes #1023
Closed
rakefire-impala wants to merge 18 commits from
working_fallback_mesh_shaders_RDNA1 into main
pull from: working_fallback_mesh_shaders_RDNA1
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!1023
Loading…
Reference in a new issue
No description provided.
Delete branch "working_fallback_mesh_shaders_RDNA1"
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?
Mesh shader fallback for GPUs without mesh shaders (RDNA1 and older), and fixes for AMD
This brings back #640 and makes it work. On an AMD RX 5500M (RDNA1, no
VK_EXT_mesh_shader), the foliage, the floor grass, the ivy and the door of Link's house now draw. It also fixes what is likely the cause of the RTX 4060 Ti device loss that got #640 reverted (806c566), two AMD rendering bugs, and several texture problems on low-VRAM cards.The full write-up, covering what was broken, how it was fixed and how it behaves, is in
docs/mesh_fallback_rdna1.md.Screenshots
Both are from an AMD RX 5500M laptop (4 GB of VRAM, no mesh shaders), with the fallback on Auto, 50% resolution, the handheld profile and frame generation 2x.
Kokiri Forest: the foliage, ground cover, trees and textures all draw, and the minimap is correct.
House: the floor grass, the ivy, the door and the lighting are correct. Without the fallback, the floor here is flat moss with no grass and the door does not render. On this card, before the AMD fixes, the lighting came out dark and a basket glowed white.
Status
Tested on: a low-VRAM laptop
All of this was tested on one laptop: an AMD Radeon RX 5500M (RDNA1) with 4 GB of VRAM, on Windows 11 with AMD's driver. Vulkan lets Hookshot use only about 3.1 to 3.4 GB of that, which is well below the 8 GB the readme recommends. Several of the bugs below only showed up because of the low VRAM: the lock-up, the white distant foliage, the texture noise, the slow resume and the black hearts. The Minimum (4GB) preset is the one to use on a card like this.
These frame rates come from the logs. They are not a controlled benchmark.
How it behaves
RX_VK_NO_MESH_FALLBACK=1still works and has the same effect as Off.What was broken, and the fixes
#640's shader translation
These were found with a new offline validator,
scripts/validate_spirv.py. At first, almost every one of the ~1,350 fallback programs failedspirv-val. Now all 1,347 pass.Aligned: device-address loads and stores had noAligned, which Vulkan requires.boolwas stored into au32.#640's draw side
DrawMeshTasksIndirect, where the task count lives in GPU memory. The mesh stage was launched with the CPU's copy of that count, which is 0, so no mesh workgroup ever ran for indirect task draws. Task threads now count the mesh work on the GPU, and the mesh stage is launched from that count.GPUs with mesh shaders: the #640 regression
build_graphics(which builds every graphics pipeline) to drop all TASK and MESH stages for every program. Fallback stages are compute stages, so in practice this only ever hit native mesh programs: on a GPU with mesh shaders, every native mesh pipeline was built with only a fragment stage. That is very likely the RTX 4060 Ti device loss, which happened with the fallback off.build_graphicsnow skips only a fallback program's compute stages.main's size when the fallback is off.main's.AMD lighting and bloom (not specific to the fallback)
Texture noise after alt-tab (working, but further testing needed)
This one is a bug in Hookshot's own texture code, unrelated to the fallback:
Now the buffer falls back to system memory, and a failed BC3 upload is retried 30 frames later. Each failure is logged as
vk: BC3 texture ... its upload failed (...). This was only tested briefly.New: slow resume after pause or alt-tab, black hearts, broken minimap cone (working, further testing needed)
Pausing and resuming, including after the game loses focus, is now fast. Before, unpausing could hang for a long time on a 4 GB card.
The cause was a texture budget that ratcheted down:
The same squeeze broke the HUD. The hearts and the minimap's view cone are small textures the GPU draws once and the game samples again about 60 frames later. Their pixels exist only in the GPU image. Once evicted, they came back over memory that never got those pixels, as black glyphs, until an area change made the game redraw them.
Fix: the 97% squeeze no longer runs while the allocator's blocks hold at least an eighth of the allowance free. New textures go into that space without the driver's count growing. The other rule, which judges pressure after taking that free space off, still evicts when memory is really short. The VRAM log line says
not squeezedwhen this applies, andRX_VK_SQUEEZE_ALWAYS=1restores the old behaviour. The log also now names each small GPU-drawn texture evicted with its pixels lost.New: glowing "radioactive" stems and flowers (fixed by upstream PR #759)
In Kokiri Forest, stems glowed cyan, petals bloomed white and bushes had coloured streaks. Upstream had the same report on GPUs with mesh shaders (#757 on an RTX 5080, #874, #986), so this was not the fallback.
deaf4ff), cherry-picked with its author kept. Its regression test fails on this branch's base without the fix and passes with it. In game, the stems and flowers look right.New: black patch on the Deku Tree's floor, and terrain stutters on AMD (fixed by upstream v2.0.6 commits)
Inside the Deku Tree, a large stepped region of the floor sometimes turned black. It stayed with every fallback draw hidden, so the fallback doesn't draw it. This branch still had two AMD texture paths that upstream fixed in v2.0.6 (tracking issue #1006):
Both upstream commits are cherry-picked:
dc2f4dc(the resize is opt-in again,RX_VK_UNEVEN_BC=0turns it on) andec89f92(#956, one layer per run). In game, the black patch did not come back, walking is smoother, the frame rate rose (table above), and VRAM is no longer pinned at the limit. The thin grid lines at terrain seams that upstream names as the trade-off were not seen.New: debugging tools
A live switch file,
hookshot_fallback_debug.txtin the game folder, is read again within half a second of a change, with no restart and no shader preparation:offhides every fallback draw, and a key's hex prefix hides that program.listlogs each fallback program drawn.read <prefix>copies a program's fallback records back to the CPU, all in one frame, then logs each value's range, NaNs and infinities, and saves them to a.binfile.info <prefix>logs a draw's render targets and formats, write masks, blending and depth test.RX_VK_WARP64=0|1andRX_VK_FRAG_SHUFFLE_FALLBACK=0|1force the AMD warp settings for A/B tests.Commits
5918e80Re-apply PR #640 (undoes806c566and449382e)dc61d57tools: offline SPIR-V validator (scripts/validate_spirv.py)b17e373AMD: 64-lane graphics warps, Lichii #2736b5e629vk: GPUs with mesh shaders draw asmainagain (#640's broken native mesh pipelines)cb0d3efmenu: Mesh shader fallback (Auto / Off / On), and the launch warning text4e36b5dmesh fallback: shader translation, draw side, memory, floor grass, startup precompile353bd4atextures: retry failed BC3 uploads, with a system-memory fallback for the scratch buffer (working, further testing needed)214096bdocs:docs/mesh_fallback_rdna1.mdand readme updatesNew in this update:
5c2004fmesh fallback: zeroed vertex-stage outputs, butterfly shuffles through the AMD workaround, the live debug switch55b7ee5docs: glowing stems and flowers, as a known issue at the time9218be7mesh fallback debug:read(records readback) andinfo(draw state) in the live switch46e8c3acherry-pick of upstream PR #759 (deaf4ff): register markers never alias an original operand (glowing stems)f8c00a4docs: the cause of the glowing stems and flowers (item 11)5ff934ftextures: no driver's-limit squeeze while the allocator's blocks hold room (fast resume, HUD fixed); log lost GPU-drawn textures2709765docs: the squeeze fix (item 12)a35cbf7cherry-pick of upstreamec89f92(#956): BC3 re-encode of ASTC arrays one layer per runa34f6f6cherry-pick of upstreamdc2f4dc: the AMD uneven-BC3 resize (#705) opt-in again16229efdocs: the Deku Tree black patch and terrain stutters (item 13)Testing
spirv-val: 1,347 fallback programs, 0 failures (run with--uniform-buffer-standard-layout --scalar-block-layout).tests/test_mesh_fallback.py,tests/test_amd_fragment_warp.py,tests/test_bc_upload_retry.py(now also checks the squeeze rule),tests/test_validate_spirv.pytests/test_lower_register_markers.py, 89 cases, 0 failures. It fails on this branch's base without the fix.test_mesh_point_topology,test_mesh_stage_buffer_zero,test_program_cache_reader,test_bc_levels,nx2/test_mesh_dynamic_stateand the menu teststest_mesh_fallback.pywas removed; it was passing only because the same text appears on an unrelated linetest_fps_overlay_orderfails the same way onmain: its fixture is missing<initializer_list>.Needs testing / review notes
RX_VK_MARKERS_V205=1, is onmain, not on this branch). None were seen on the RX 5500M.232eecb, andmainhas moved on since, so it will need a rebase. Commits 12, 16 and 17 are cherry-picks of commits already onmain, so a rebase should drop them as duplicates.Known limits
Credits
#640 (shayder) for the fallback this builds on. Lichii (zortos293 and contributors) for the fallback design (#569), the AMD fixes (#273), the AMD hang finding (#814), and their notes on how the game draws its foliage. Upstream PR #759 for the register-marker fix, YunaraDebugs for #956, and NotRexed for making the AMD resize opt-in. The reporters of #757, #874, #986 and #1006, whose reports pointed to the upstream fixes.
Hi! This PR has merge conflicts with
mainnow (a lot has landed today). Could you mergemainin or rebase and resolve them? Happy to give it a proper review once it's up to date.Thanks for this, and for the detailed write-up. The indirect-task fix and the shared, allocated records are real wins over what's on main. But main has moved a long way since
232eecb, and a good part of this branch is now already there. So here's what's duplicated, what's still new, and how I'd suggest landing the rest.Already on main (drop these when you rebase)
07773ab+aec016f).emit_spirv.cppis byte-identical to main.aec016fon main (p.fallback && (COMPUTE|TASK|MESH)), which does the same thing. Thevertex_infoearly return is a no-op next to it.Aligned 4on PhysicalStorageBuffer accesses, the started word as a u32 / spirv-val-cleanStrided(main unrolls the loop, you used a Private var; either is fine, keep main's), and the mesh workgroup's index within its task.ec89f92,dc2f4dc): already on main, as you said.git cherrymarks them as such. The depth-compare-is-never-integer half of commit 3 is on main too (46c5be8, #834).dw().prog != &pinfallback_recordand insame_desc). It has to survive the rebase: with the shared buffers, a dispatch between two fallback draws still clobbers the pushed compute descriptors.Still new, and the part worth landing (one PR: "mesh fallback: indirect task draws, shared allocated records, async compile")
VkDispatchIndirectCommand, and the mesh pass runsvkCmdDispatchIndirectfrom it. Main still dispatchesgroups * threadsfrom the CPU, which is 0 forDrawMeshTasksIndirect, so the floor grass never draws on main. That's the most valuable piece here.vkCmdDrawIndirect, and capacity 1024 → 16384.compute_state, plus the precompile pass. Note that #1317 (still open, not merged) solves "a failed pipeline is retried every draw" another way. Your state-2-with-empty-fallback_computecovers that case too, so only one of them should land. Worth coordinating with CiLiBi18.I read through the new SPIR-V and the dispatch carefully, and the core logic holds up:
vertexCountonly covers written records, andtakenis a multiple ofcorners.INDIRECT_BUFFER_BIT.full_barrieris ALL_COMMANDS / MEMORY_READ|WRITE, so it covers the indirect reads.vkCmdFillBufferandvkCmdDispatchIndirectboth bumpwork_epoch, so the dedupe can't drop the barrier after the fills.MeshFallbackEpiloguesit at top level and correctly broadcastbasethroughmesh_primitive_count.Things to watch in the rebase are inline: main's
EmitIsbeReadand runtime_info changes collide with yours.Unrelated, so please split out (separate PRs, separate testing)
RX_VK_WARP64/RX_VK_FRAG_SHUFFLE_FALLBACKswitches). This changes the SPIR-V of every graphics program on every AMD GPU whose graphics stages can't be pinned, including RDNA2/3 and RADV/Steam Deck players who use native mesh shaders. It also changes the cache stamp, so they all re-translate on first start. It may well be right, but it needs its own PR and testing on RDNA2+ (both drivers), not just the 5500M.3e66cf9BC3 scratch kept, the v2.0.11 iGPU caps, #840 batched eviction writebacks merged today), so it will conflict anyway.vk_main.cpp.scripts/validate_spirv.py+ its test. It's handy, but it's tooling, and main now hasRX_VK_DUMP_MESH_SPVfor the same job. It can stand on its own.hookshot_fallback_debug.txt, read/info). See the inline comment: I'd gate it behind an env var or leave it out of the core PR.docs/mesh_fallback_rdna1.mdis a lot to keep in sync. Most of it is PR history. I'd keep a short "how the fallback works / switches" section and leave the narrative in the PR description.Suggested path
Start a fresh branch from current main. Cherry-pick only the fallback parts of commits 4e36b5d/5c2004f (the dispatch map, allocator, indirect draw, shared buffers, async build + precompile, zeroed outputs), resolving against #1314's code as noted inline. Drop commits 1, 4, 12, 16, 17 and the parts of commit 6 that #1314 already covers. Then open the warp/shuffle change and the texture changes as two more PRs. That also makes the "needs a mesh-shader GPU to confirm" question easy: the core PR doesn't touch native mesh paths at all once commit 4 is dropped.
CI hasn't run here (the branch conflicts), so nothing to report there yet.
Rebase hazard: main (#1314,
14e0865) already rewritesworkgrouphere asgl_WorkGroupID.x % task_threads. With your map,gl_WorkGroupID.xis the dispatch index, not the slot, so main's version would be wrong on top of your TaskEpilogue. Keep yours (FallbackSlot % threads) and drop main's, or the meshlet index will be garbage again. The same goes forPayloadWord: it has to use the slot from the map (FallbackSlot / threads), not main'sWorkgroupId.@ -108,2 +108,4 @@/// (hookshot) the fallback's record slots: mesh workgroups past this one write nothingu32 mesh_fallback_capacity{};/// (hookshot) the task program's threads: a fallback mesh workgroup is the slot task workgroup * threads + its index in the tasku32 mesh_fallback_task_threads{1};Main added this field too (#1314), defaulting to
{}(0) and set totask_t ? workgroup_size[0] : 0. Main guards itsOpUModwith&& mesh_fallback_task_threads; yours always emitsOpUMod/OpUDivbyConst(threads). When you merge, keep the default of 1 (and the? : 1invk_shader.cpp), or a 0 will turn into a mod/div by zero in the generated SPIR-V.@ -4527,0 +4647,4 @@/// range and mean, and how many were NaN, infinite, zero, or denormal (an integer seen as a float: word 0, the written flag, is)void fallback_read_report(const FallbackDebug::Slot& slot, uint32_t i) {invalidate_mapped(fdbg.mem, kFallbackReadBytes * kFallbackReadSlots);const uint32_t* w = fdbg.mapped + i * (kFallbackReadBytes / 4);Looks right to me: buffers per thread,
full_barrierat the top offallback_recordordering against the previous fallback draw's vertex reads, and pipeline barriers covering earlier command buffers on the same queue. One thing to double-check: how many recording threads you get at most. At ~72 MB each, a machine with many parallel-replay threads can still add up on a 4 GB card. A log line with the thread count next to the existingbuffer pairs, N MBline would make that visible.@ -4527,0 +4714,4 @@else if (line.rfind("info ", 0) == 0) fdbg.infos.push_back(line.substr(line.find_first_not_of(" \t", 5)));else fdbg.prefixes.push_back(line);}logf("vk: fallback debug: %s%s, %zu program prefixes left out, %zu read",This overlaps #1317 (open), which remembers a failed (key, variant) in a set under the old mutex. Your state 2 with an empty
fallback_computealready stops the retry storm, so if this lands, #1317 isn't needed (or the other way round). Also, on rebase, keep main'sdw().prog != &pcheck above the call infallback_record(#1314,1b41593).This runs on every fallback draw on every recording thread. It takes a global mutex, and every 500 ms one of those draws
fopens a file in the game folder (on Windows with AV, that can be milliseconds on the recording thread). It's a nice tool, but I'd rather it cost nothing by default: gate the whole thing behind e.g.RX_VK_FALLBACK_DEBUG=1, read once into a static, and keep it out of the core fallback PR.@ -502,0 +501,4 @@// (vk_main.cpp). The translator then keeps each 32-lane guest warp to its half of the host's, as Eden does on AMD; the// long path is right at 32 lanes too. The ballots and shuffles of the game's fragment shaders ran across both halvesp.warp_size_potentially_larger_than_guest =dev.subgroup_size > 32 && (dev.sg32_stages & VK_SHADER_STAGE_ALL_GRAPHICS) != VK_SHADER_STAGE_ALL_GRAPHICS;This flips the warp path for every graphics program on any AMD GPU that can't pin graphics stages to 32 lanes, including RDNA2/3 on both AMD's driver and RADV, where native mesh shaders are used and this PR's fallback isn't involved. With the stamp change, those players all re-translate on their first start. Please move it (and the fragment-shuffle workaround below) into its own PR with testing on an RDNA2+ card, so a regression there doesn't hold up the fallback work.
This is a VRAM policy change for every GPU, not just the fallback: at the driver's limit with 1/8 free in the blocks, we now stop evicting and rely on the driver not paging. It may be the right trade-off, but it belongs in a separate texture PR with testing on a couple of low-VRAM cards. This area also changed on main today (#840 batched eviction writebacks), so it will conflict.
Thanks for all the work on the RDNA1 fallback. The fallback itself is on main, the v2.0.12 branch carries its crash fixes (#1314, #1317), and #1383 is next. This branch conflicts with main in 10 files and mixes many changes. Closing; any fix not covered by those would be very welcome as a small PR of its own.
Thanks, that makes sense. I've split what main doesn't already cover into small PRs, each fixing one thing, all on current main:
scripts/validate_spirv.py: an offlinespirv-valpass over the program cacheThey merge cleanly with main and with each other. #1505–#1507 were tested on an RX 5500M (RDNA1, 4 GB, no mesh shaders). #1507 changes the graphics translation on AMD cards that can't pin graphics subgroups, so an RDNA2+ tester would help before merging it.
Tested on a GTX 1070 (Pascal, no mesh shaders) and it brings the missing geometry back.
Setup: this PR's head (
16229ef) built as-is on Linux, GTX 1070 8 GB / NVIDIA 580.178.04, i7-7700HQ, output 1920x1080 at 75%. The comparison is v2.0.11 + #1314 + #1317, played through the same part of the game the night before.driver faulted, 0 failed fallback pipelines. The only failed programs are the 10 movie-upscaler networks, which are left out on purpose on this card.draw. One fallback compute pipeline took 101 s to compile on a worker:fallback: the compute pipeline of 55d1da3fea1603d4 stage 1: SLOW compile, 101648 ms (on a worker). The 9.8 s stall came right after it. This was a fresh game folder with an empty pipeline cache (precompile: ... 0 graphics), so part of this is first-time compiling. After those two minutes, I saw no more stalls.One more data point: the
storage buffer NOT bound (reads zeros)lines for the far-foliage programs (68642bb810ee3e7c,51183fe750d5d0c8,d905f52b7517c681…, atc5+0x60/c5+0x1d0) still show up here and reach the log's cap of 40. So they weren't what hid the geometry on this card.Happy to run anything else on Pascal if it helps get this merged.
Thanks for testing this on Pascal. It's the first report from a second GPU vendor, and the Deku Tree result is exactly the kind of thing this needed.
#1023 was closed so its fixes could go in as small PRs. The parts you tested are now:
55d1da3fea1603d4and the 1.7-9.8 s stalls in a new area's first minutes is worth checking on a second start.All of them merge cleanly with main and with each other. If you could run main + #1509-#1513 (and #1581 if you like) on the GTX 1070 and post what you see on #1510 or #1511, that would be the strongest case for merging them.
Thanks for splitting it up. I'll build main (
88b554e) + #1509–#1513 + #1581 as they are on the GTX 1070 (they merge cleanly here too) and report on #1510. I'll check:55d1da3fea1603d4and the submit times in the first minutes of a new area.