gpu(native): bind 2D stencil SRVs to the Metal stencil aspect #661

Open
fruvs wants to merge 1 commit from upstream-pr/661 into main
fruvs commented 2026-11-30 02:21:25 +00:00 (Migrated from github.com)

Imported from LakshanSivakumar/Native-Victory-macOS. Originally posted by fruvs on 2026-11-30T02:21:25Z.


Refs #660

This binds 2D read-only stencil SRVs to an X32_Stencil8 view of the existing Metal depth-stencil allocation. The view routes Metal's stencil component from red to green for the translated shader. It shares the parent's storage and follows the current backing texture. Depth-plane views and writable views keep their existing paths.

Verification

  • The ARM64 Metal regression writes two different stencil patterns and checks that a shader gathers the exact bytes through the same view.
  • Descriptor recognition and six native host tests passed locally. The Windows all-target workspace Clippy check and asset-policy check passed.
  • I replayed a live Series S upscaler dispatch on an M5 Pro with the original inputs. The corrected binding reduced packed-radiance differences against an independently translated replay from 196,341 to 8,157 of 409,440 texels and eliminated all 23,182 differences in the secondary output. This checks the affected pass. The overall lighting is still under investigation.
  • The wider ARM64 GPU unit suite passed 449 tests and failed one existing command-table function-pointer assertion. I reproduced that assertion on the unmodified upstream base.

The contribution contains only implementation, documentation and synthetic tests.

<!-- greyfinch-sync:LakshanSivakumar/Native-Victory-macOS:issue:5557826265 --> Imported from [LakshanSivakumar/Native-Victory-macOS](https://github.com/LakshanSivakumar/Native-Victory-macOS/pull/661). Originally posted by [fruvs](https://github.com/fruvs) on 2026-11-30T02:21:25Z. --- Refs #660 This binds 2D read-only stencil SRVs to an X32_Stencil8 view of the existing Metal depth-stencil allocation. The view routes Metal's stencil component from red to green for the translated shader. It shares the parent's storage and follows the current backing texture. Depth-plane views and writable views keep their existing paths. ### Verification - The ARM64 Metal regression writes two different stencil patterns and checks that a shader gathers the exact bytes through the same view. - Descriptor recognition and six native host tests passed locally. The Windows all-target workspace Clippy check and asset-policy check passed. - I replayed a live Series S upscaler dispatch on an M5 Pro with the original inputs. The corrected binding reduced packed-radiance differences against an independently translated replay from 196,341 to 8,157 of 409,440 texels and eliminated all 23,182 differences in the secondary output. This checks the affected pass. The overall lighting is still under investigation. - The wider ARM64 GPU unit suite passed 449 tests and failed one existing command-table function-pointer assertion. I reproduced that assertion on the unmodified upstream base. The contribution contains only implementation, documentation and synthetic tests.
This pull request cannot be merged automatically due to conflicts.
Merge manually to resolve the conflicts.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin 'upstream-pr/661:upstream-pr/661'
git switch 'upstream-pr/661'

Merge

Merge the changes and update on Forgejo.

Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.

git switch 'main'
git merge --no-ff 'upstream-pr/661'
git switch 'upstream-pr/661'
git rebase 'main'
git switch 'main'
git merge --ff-only 'upstream-pr/661'
git switch 'upstream-pr/661'
git rebase 'main'
git switch 'main'
git merge --no-ff 'upstream-pr/661'
git switch 'main'
git merge --squash 'upstream-pr/661'
git switch 'main'
git merge --ff-only 'upstream-pr/661'
git switch 'main'
git merge 'upstream-pr/661'
git push origin 'main'
Sign in to join this conversation.
No reviewers
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!661
No description provided.