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

Open
opened 2026-11-27 10:49:54 +00:00 by Olima34 · 3 comments
Olima34 commented 2026-11-27 10:49:54 +00:00 (Migrated from github.com)
Contributor

Imported from LakshanSivakumar/Native-Victory-macOS. Originally posted by Olima34 on 2026-11-27T10:49:54Z.


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.

<!-- greyfinch-sync:LakshanSivakumar/Native-Victory-macOS:issue:6644935771 --> Imported from [LakshanSivakumar/Native-Victory-macOS](https://github.com/LakshanSivakumar/Native-Victory-macOS/issues/306). Originally posted by [Olima34](https://github.com/Olima34) on 2026-11-27T10:49:54Z. --- 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 commented 2026-11-27 10:49:56 +00:00 (Migrated from github.com)
Author
Contributor

Imported from LakshanSivakumar/Native-Victory-macOS. Originally posted by Olima34 on 2026-11-27T10:49:56Z.


/claim

<!-- greyfinch-sync:LakshanSivakumar/Native-Victory-macOS:comment:7216357782 --> Imported from [LakshanSivakumar/Native-Victory-macOS](https://github.com/LakshanSivakumar/Native-Victory-macOS/issues/306#issuecomment-7216357782). Originally posted by [Olima34](https://github.com/Olima34) on 2026-11-27T10:49:56Z. --- /claim
github-actions[bot] commented 2026-11-27 10:50:07 +00:00 (Migrated from github.com)
Author
Contributor

Imported from LakshanSivakumar/Native-Victory-macOS. Originally posted by github-actions[bot] on 2026-11-27T10:50:07Z.


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

<!-- greyfinch-sync:LakshanSivakumar/Native-Victory-macOS:comment:7216361356 --> Imported from [LakshanSivakumar/Native-Victory-macOS](https://github.com/LakshanSivakumar/Native-Victory-macOS/issues/306#issuecomment-7216361356). Originally posted by [github-actions[bot]](https://github.com/apps/github-actions) on 2026-11-27T10:50:07Z. --- Claimed by @Olima34. Open a draft pull request with `Refs #306` in its description within 24 hours, or the claim expires.
Olima34 commented 2026-11-27 16:21:17 +00:00 (Migrated from github.com)
Author
Contributor

Imported from LakshanSivakumar/Native-Victory-macOS. Originally posted by Olima34 on 2026-11-27T16:21:17Z.


/release

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

<!-- greyfinch-sync:LakshanSivakumar/Native-Victory-macOS:comment:7223160388 --> Imported from [LakshanSivakumar/Native-Victory-macOS](https://github.com/LakshanSivakumar/Native-Victory-macOS/issues/306#issuecomment-7223160388). Originally posted by [Olima34](https://github.com/Olima34) on 2026-11-27T16:21:17Z. --- /release Done: #311 is merged (the view-address table, with the zero-field refusal and its tests). This can be closed.
Sign in to join this conversation.
No labels
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
LakshanSivakumar/Native-Victory-macOS#306
No description provided.