shader: lower partial-channel typed and _d16_hi buffer stores #238

Closed
github-bot wants to merge 0 commits from github-bot/gh-238 into main AGit
Owner

@⁠Texbirds on GitHub · 2026-12-01 00:15 UTC · original
Texbirds:pr/typed-buffer-stores → main · +528 −14 · 3 files · 47 commits · closed without merging

Port of Marvisak/VIctory#3377 adapted to FoxHound's raw-view structured buffer lowering.

Summary

  • Lowers partial-channel typed buffer stores (buffer_store_format_{x,xy,xyz}, buffer_store_format_d16_{x,xy,xyz}, buffer_store_format_d16_hi_x) via guarded load-modify-store (bufferLoad + bufferStore with mask 0xF and TYPED_UAV_LOADS).
  • Branches on VIEW_INTEGER (self.integer_view(src)?) to use an integer handle (10 | u, 0x405) for integer views and float handle (10 | u, 0x409) for float views so untouched channels are preserved bit-exact (including NaN-shaped integer bit patterns).
  • Adds _d16_hi high-half extraction for buffer_store_byte_d16_hi, buffer_store_short_d16_hi, and buffer_store_format_d16_hi_x, and refuses non-zero soffset / base offsets on typed stores.
  • Keeps FoxHound's existing structured-to-raw folding and dword-straddling narrow path untouched.

Testing

  • cargo run --locked -p xtask -- policy (291 files ok)
  • cargo clippy --locked -p victory-shader --tests -- -D warnings (0 warnings)
  • cargo test --locked -p victory-shader -- buffer_store: 4/4 passed (DXIL validation + RTX 3080 Ti & D3D12 WARP execution covering float/uint partial typed stores, d16_hi_x, and dword-straddling short_d16_hi)
**@⁠Texbirds** on GitHub · 2026-12-01 00:15 UTC · [original](https://github.com/readmet3xt-lab/foxhound/pull/238) `Texbirds:pr/typed-buffer-stores` → `main` · +528 −14 · 3 files · 47 commits · closed without merging Port of Marvisak/VIctory#3377 adapted to FoxHound's raw-view structured buffer lowering. ### Summary - Lowers partial-channel typed buffer stores (`buffer_store_format_{x,xy,xyz}`, `buffer_store_format_d16_{x,xy,xyz}`, `buffer_store_format_d16_hi_x`) via guarded load-modify-store (`bufferLoad` + `bufferStore` with mask `0xF` and `TYPED_UAV_LOADS`). - Branches on `VIEW_INTEGER` (`self.integer_view(src)?`) to use an integer handle `(10 | u, 0x405)` for integer views and float handle `(10 | u, 0x409)` for float views so untouched channels are preserved bit-exact (including NaN-shaped integer bit patterns). - Adds `_d16_hi` high-half extraction for `buffer_store_byte_d16_hi`, `buffer_store_short_d16_hi`, and `buffer_store_format_d16_hi_x`, and refuses non-zero `soffset` / base offsets on typed stores. - Keeps FoxHound's existing structured-to-raw folding and dword-straddling `narrow` path untouched. ### Testing - `cargo run --locked -p xtask -- policy` (291 files ok) - `cargo clippy --locked -p victory-shader --tests -- -D warnings` (0 warnings) - `cargo test --locked -p victory-shader -- buffer_store`: 4/4 passed (DXIL validation + RTX 3080 Ti & D3D12 WARP execution covering float/uint partial typed stores, `d16_hi_x`, and dword-straddling `short_d16_hi`)
github-bot locked as GitHub sync and limited conversation to collaborators 2026-12-01 00:17:11 +00:00
github-bot closed this pull request 2026-12-01 01:10:16 +00:00
Author
Owner

@⁠readmet3xt-lab on GitHub · 2026-12-01 01:34 UTC · original

Thanks. This is on hold, not rejected. What it needs before it can go in:

  1. a rebase onto the current main (see below; emit/lower.rs has also changed);
  2. the translator census before and after: shaders translated and failing, and either no change in the output of shaders that already translated or the list of those that change and why;
  3. one check in the game of a pass these stores are used in.

Every translator change makes all users translate their shaders again once, so we collect translator PRs into one release; the next one is being tested now, and this would be for the one after. In code and comments, please name title shaders by their 16-digit hash, not by name.

Main's history was rewritten on 2026-12-01 (text-only changes; every commit hash changed), so a follow-up has to start from the current main, or this branch be rebased onto it.

**@⁠readmet3xt-lab** on GitHub · 2026-12-01 01:34 UTC · [original](https://github.com/readmet3xt-lab/foxhound/pull/238#issuecomment-7297654382) Thanks. This is on hold, not rejected. What it needs before it can go in: 1. a rebase onto the current main (see below; `emit/lower.rs` has also changed); 2. the translator census before and after: shaders translated and failing, and either no change in the output of shaders that already translated or the list of those that change and why; 3. one check in the game of a pass these stores are used in. Every translator change makes all users translate their shaders again once, so we collect translator PRs into one release; the next one is being tested now, and this would be for the one after. In code and comments, please name title shaders by their 16-digit hash, not by name. Main's history was rewritten on 2026-12-01 (text-only changes; every commit hash changed), so a follow-up has to start from the current main, or this branch be rebased onto it.
Author
Owner

@⁠readmet3xt-lab on GitHub · 2026-12-01 01:35 UTC · original

One more note: GitHub closed this pull request by itself when main's history was rewritten, and it cannot be reopened. That is not a rejection. The points above still apply; please open a new pull request from the current main when you have them.

**@⁠readmet3xt-lab** on GitHub · 2026-12-01 01:35 UTC · [original](https://github.com/readmet3xt-lab/foxhound/pull/238#issuecomment-7297683149) One more note: GitHub closed this pull request by itself when main's history was rewritten, and it cannot be reopened. That is not a rejection. The points above still apply; please open a new pull request from the current main when you have them.

Pull request closed

This discussion has been locked. Commenting is limited to contributors.
No description provided.