Repository navigation
Conversation
…able The shader precompile translates with no program bound, so vk_bank.cpp's cs_layout had no control section to read and every compute program it prepared kept Maxwell's storage buffer table at 0x310, where NVN2's c0 holds nothing (3756 of the game's 3808 compute programs have storage buffers). Compute programs have no variants, so the program cache gave the game that translation from then on. OoT's foliage culling then left some of its draw lists empty: plants near Link had no leaves (issue 590). With RX_VK_NO_PROGRAM_CACHE=1, where every program is translated in play with the program bound, they had them. parse_code now reads the table from the compute stage's own control section (+0xa9, +0xb1, +0xb2, +0xb3, +0xb6, as cs_layout does; the sum matches the bank size at +0xba for all 3808), and the compute translation takes it when the state has no program bound. RX_VK_CS_TABLE_SEED=0: as before. Assisted-by: Claude Opus 5.5 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Tested this on an RTX 3070 8 GB (Windows 11, driver
So on this card, with the port off:
With the port on, |
|
Tested on Windows, RTX 4080 16 GB, i9-14900KF, 32 GB: this fixes the near-plant textures there.
v2.0.5's prepare-plus makes many more compute programs before the game, so without this fix more of them carry Maxwell's |
|
Closing to keep the queue clear — please rebase on current main and reopen; thanks! |
What
The shader precompile (
seed_program) translates every compute program with a blankNvnState. NVN2 compute keeps itsstorage buffer table in c0 after the push area and the uniform buffer table, and
vk_bank.cppcs_layoutfinds it fromthe bound program's control section. With nothing bound it says nothing, so
translate_intofell back to Maxwell's0x310, where NVN2's c0 holds nothing. 3756 of the game's 3808 compute programs have storage buffers.Compute programs have no variants, so the program cache handed the game that translation from then on. OoT's foliage
culling then left some of its draw lists empty: plants near Link lost their leaves (the bushes in Hyrule Field, the plants
by the rocks), while the far impostors were fine.
Fix
parse_codereads the table from the compute stage's own control section, the same bytescs_layoutreads(
+0xa9push words,+0xb1uniform buffers,+0xb2storage buffers,+0xb3textures,+0xb6images). For all 3808compute programs in the game the sum matches the bank size the control section stores at
+0xba. The compute translationuses it only when the state has no program bound, i.e. for the precompile.
RX_VK_CS_TABLE_SEED=0turns it off.Changing
vk_shader.cppchanges the shader stamp, so the caches are prepared again on the first start.Testing
RX_VK_NO_PROGRAM_CACHE=1was right, which is what pointed at the prepared translations. Retranslating the sevenfoliage mesh programs in play changed nothing (their prepared and in-play IR are identical).
this change draws them both near and far.
tests/test_compute_table_precompile.py(game-free, wired intosource-regressions.yml):parse_codeandcs_layoutread the same control bytes with the same arithmetic over 2000 random control sections, and the translationtakes the program's own table only when no program is bound, before the translator is told. It fails if the
!s.prog.nstagecondition is dropped.Addresses #590.
🤖 Generated with Claude Code