Native Metal 2D stencil SRVs bind the depth aspect #664

Open
opened 2026-11-30 02:25:22 +00:00 by github-bot · 2 comments
Owner

@⁠fruvs on GitHub · 2026-11-30 02:20 UTC · original

What went wrong

The native Metal backend binds the depth aspect when a 2D shader resource view requests the stencil aspect of a D32FloatS8 texture. A shader gathering the logical green component therefore cannot read the stored stencil bytes.

Steps to reproduce

Create a combined depth-stencil texture, seed distinct stencil values, and sample its stencil SRV with a green-component gather. Repeat with a second stencil pattern on the same texture. The synthetic regression checks both patterns against the original integer values.

The proposed fix binds an X32_Stencil8 view of the current backing texture and routes Metal's red stencil component to green. The view shares storage with the parent and tracks later stencil writes.

Mac, macOS version and commit

M5 Pro, macOS 27.2.1 (26B8132), upstream base 268172850870.

**@⁠fruvs** on GitHub · 2026-11-30 02:20 UTC · [original](https://github.com/LakshanSivakumar/Native-Victory-macOS/issues/660) ### What went wrong The native Metal backend binds the depth aspect when a 2D shader resource view requests the stencil aspect of a D32FloatS8 texture. A shader gathering the logical green component therefore cannot read the stored stencil bytes. ### Steps to reproduce Create a combined depth-stencil texture, seed distinct stencil values, and sample its stencil SRV with a green-component gather. Repeat with a second stencil pattern on the same texture. The synthetic regression checks both patterns against the original integer values. The proposed fix binds an X32_Stencil8 view of the current backing texture and routes Metal's red stencil component to green. The view shares storage with the parent and tracks later stencil writes. ### Mac, macOS version and commit M5 Pro, macOS 27.2.1 (26B8132), upstream base `268172850870`.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-30 02:25:22 +00:00
Author
Owner

@⁠fruvs on GitHub · 2026-11-30 02:21 UTC · original

/claim

**@⁠fruvs** on GitHub · 2026-11-30 02:21 UTC · [original](https://github.com/LakshanSivakumar/Native-Victory-macOS/issues/660#issuecomment-7266930961) /claim
Author
Owner

@⁠github-actions[bot] on GitHub · 2026-11-30 02:21 UTC · original

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

**@⁠github-actions[bot]** on GitHub · 2026-11-30 02:21 UTC · [original](https://github.com/LakshanSivakumar/Native-Victory-macOS/issues/660#issuecomment-7266933415) Claimed by @⁠fruvs. Open a draft pull request with `Refs #660` in its description within 24 hours, or the claim expires.
This discussion has been locked. Commenting is limited to contributors.
No description provided.