shader: pass the bits of 16-bit typed accesses through integer table views #65
No reviewers
Labels
No labels
accessibility
amd
bug
crash
device-removed
documentation
duplicate
enhancement
feature-request
good first issue
help wanted
input
invalid
launcher
memory
needs-logs
nvidia
off-topic
performance
question
shaders
stutter
visuals
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/VGLALALA--ReVictory-RDNA3!65
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-65"
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?
@Kal0s-design on GitHub · 2026-12-05 19:54 UTC · original
Kal0s-design:pr/d16-integer-table-views→main· +150 −35 · 7 files · 1 commits · merged 2026-12-05 22:28 UTCA real translation bug, also present upstream. A d16 load or store (16-bit typed access) through a table view of a UINT or SINT format read and wrote zeros on hosts whose shader compiler doesn't happen to fuse two instructions, which includes WARP and NVIDIA cards.
The translation keeps a float handle for typed buffer views and picks the integer path by the view's format kind, which it reads from the host's table by heap slot (VIEW_INTEGER). It did that only for views a program picks from the heap. For a view in a table it went the float way, where the integer's bits read as a float are a denormal and the f32-to-f16 conversion gives 0. Recent AMD compilers join the float load and the conversion into one d16 load and pass the bits anyway, which is why it looked fine there. The repo's own tests show it. d16_accesses_of_an_integer_table_view_move_integers_on_warp was marked ignored as known to fail, and the hardware variant fails on NVIDIA. A comment in typed_half_tests.rs ties these views to the face network's halves and tables, but I can only show the test results, not an in-game difference.
What changes. The translation now reads the kind of a view in a table the same way, by its heap slot, the table's place plus the entry, exactly as sizes of views in tables are already read. Strides of views in tables still come from their used-resource entries, so only the kind lookup reaches tables. On the GPU side the title's slots already entered the kind together with the stride, but the dynamic slots most tables are made in entered only their size, so size_is now also enters the kind there, with a mirror per slot like the one for sizes so unchanged slots skip the write. Before writing it I checked the mechanism by forcing the integer path for table views, and both integer tests passed on WARP and on NVIDIA.
Two costs to be aware of. A shader with such an access now reads the table of strides, so the host readies the heap's buffer views once per list for it, as it already does for shaders that read the size of a view in a table. And the translation of those shaders changes, so TRANSLATOR_VERSION goes from 19 to 20 and everyone retranslates once. #38 and #78 also changed translations without a bump, so this bump covers those too.
Tests. The typed-half harness now binds the table when a shader reads it, the WARP integer test is no longer ignored, and both integer tests pass on WARP and on one NVIDIA desktop card, where they read 0 before. victory-gpu gets dynamic_slots_enter_their_views_format_kind, which checks that a dynamic slot enters its view's kind and clears it, and that a title slot is left alone. The float-view d16 test still fails on NVIDIA because the card drops the sign of a 16-bit NaN, which is a separate matter. On top of main as of #37, victory-shader and victory-gpu pass apart from the hardware cases explained in #48. Rebased on current main, clippy -D warnings reports nothing in either of the Lint workflow's two runs.
AI-assisted: yes
🤖 Generated with Claude Code