Native host: shaders that need the view-address table (t1) are refused; the D3D12 path binds it #306

Open
opened 2026-11-27 10:54:21 +00:00 by github-bot · 3 comments
Owner

@⁠Olima34 on GitHub · 2026-11-27 10:49 UTC · original

The native host refuses every shader whose translation needs the view-address table (native/shaders.rs, unsupported(): "needs view addresses or write marks"). That table is root SRV t1 in MEMORY_SPACE ("View addresses" in emit/mod.rs), with four dwords per heap index:

  • for a buffer view, its title address;
  • for a texture view, its width, height, first and last level, and type;
  • zeros for anything else.

The D3D12 path already builds and binds it: descriptor/host.rs view_addresses() / note_address() / write_address, bound in draw.rs. The native host has nothing equivalent.

What it costs. In a boot-time dump of refused compute (M5 Pro, Series S, main + #304), 7 compute shaders are refused for this alone. All 7 need view addresses, and none needs write marks.

  • 6 of them (0c748826, 48828947, 550d92da, a2d0209f, c3873dc0, fcd8ef10) read a buffer view's title address as a number, then walk title memory at computed addresses through the page table. That shape looks like BVH traversal.
  • 00bc6a9b reads a heap view's address or a texture view's sizes.

Plan. Follow the pattern of #264's per-heap stride table:

  • a table per resource heap, made on first use;
  • kept up to date in NativeHost::mirror with the existing write_address;
  • bound wherever the shader takes t1;
  • then view_addresses comes out of unsupported().

It'll come with a Metal test: a compute reads a heap view's address, then reads memory at it. It costs 16 bytes per heap index, and we'll report the size for 16 GB Macs.

**@⁠Olima34** on GitHub · 2026-11-27 10:49 UTC · [original](https://github.com/LakshanSivakumar/Native-Victory-macOS/issues/306) The native host refuses every shader whose translation needs the view-address table (`native/shaders.rs`, `unsupported()`: "needs view addresses or write marks"). That table is root SRV `t1` in `MEMORY_SPACE` ("View addresses" in `emit/mod.rs`), with four dwords per heap index: - for a buffer view, its title address; - for a texture view, its width, height, first and last level, and type; - zeros for anything else. The D3D12 path already builds and binds it: `descriptor/host.rs` `view_addresses()` / `note_address()` / `write_address`, bound in `draw.rs`. The native host has nothing equivalent. **What it costs.** In a boot-time dump of refused compute (M5 Pro, Series S, main + #304), 7 compute shaders are refused for this alone. All 7 need view addresses, and none needs write marks. - 6 of them (`0c748826`, `48828947`, `550d92da`, `a2d0209f`, `c3873dc0`, `fcd8ef10`) read a buffer view's title address as a number, then walk title memory at computed addresses through the page table. That shape looks like BVH traversal. - `00bc6a9b` reads a heap view's address or a texture view's sizes. **Plan.** Follow the pattern of #264's per-heap stride table: - a table per resource heap, made on first use; - kept up to date in `NativeHost::mirror` with the existing `write_address`; - bound wherever the shader takes `t1`; - then `view_addresses` comes out of `unsupported()`. It'll come with a Metal test: a compute reads a heap view's address, then reads memory at it. It costs 16 bytes per heap index, and we'll report the size for 16 GB Macs.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-27 10:54:21 +00:00
Author
Owner

@⁠Olima34 on GitHub · 2026-11-27 10:49 UTC · original

/claim

**@⁠Olima34** on GitHub · 2026-11-27 10:49 UTC · [original](https://github.com/LakshanSivakumar/Native-Victory-macOS/issues/306#issuecomment-7216357782) /claim
Author
Owner

@⁠github-actions[bot] on GitHub · 2026-11-27 10:50 UTC · original

Claimed by @⁠Olima34. Open a draft pull request with Refs #306 in its description within 24 hours, or the claim expires.

**@⁠github-actions[bot]** on GitHub · 2026-11-27 10:50 UTC · [original](https://github.com/LakshanSivakumar/Native-Victory-macOS/issues/306#issuecomment-7216361356) Claimed by @⁠Olima34. Open a draft pull request with `Refs #306` in its description within 24 hours, or the claim expires.
Author
Owner

@⁠Olima34 on GitHub · 2026-11-27 16:21 UTC · original

/release

Done: #311 is merged (the view-address table, with the zero-field refusal and its tests). This can be closed.

**@⁠Olima34** on GitHub · 2026-11-27 16:21 UTC · [original](https://github.com/LakshanSivakumar/Native-Victory-macOS/issues/306#issuecomment-7223160388) /release Done: #311 is merged (the view-address table, with the zero-field refusal and its tests). This can be closed.
This discussion has been locked. Commenting is limited to contributors.
No description provided.