Shaders: a formatted load converts only the fields its DST_SEL reads #33
No reviewers
Labels
No labels
accessibility
bug
documentation
duplicate
enhancement
good first issue
help wanted
invalid
question
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/ThatRecompDev--five-star-recomp!33
Loading…
Reference in a new issue
No description provided.
Delete branch "gh-pr/33/head"
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?
@Sr-0w on GitHub · 2026-11-25 13:55 UTC · original
Sr-0w:shaders/format-load-swizzle→main· +47 −22 · 5 files · 1 commits · merged 2026-11-25 14:02 UTCUntil now,
FmtLoadconverted all four fields of an element, andfmt_swizzlepicked among them afterwards. Every component's conversion (int-to-float, two divides, f16 widening and the format selects) therefore stayed live, even when the program reads onlyx.FmtLoadnow takes V# dword3. Each result component converts only the one field its selector names, so unread components fold away. Results are unchanged bit for bit.fmt_swizzleandfmt_selectare gone, andprobe_FmtLoadgets the extra argument.A retail game's 122k-dword compute program has 3,281 format loads. Its DXIL backend output shrinks as follows:
fdivThe driver compile scales with that size. That program is the one that stays a stand-in for the longest.
Tests: the new
cs_buffer_rule_format_selectcase loads an 8_8_8_8_UINT element through DST_SEL z,y,x,1 and w,0. It fails when the selectors are ignored. The full suite is green.🤖 Generated with Claude Code
@ThatRecompDev on GitHub · 2026-11-25 14:02 UTC · original
41% fewer instructions on the biggest compute program with identical results is a great win, especially since that's the one stuck as a stand-in longest. merged, thanks!