Repository navigation
OoT: use a null fragment for depth-only mesh pipelines - #3
Merged
Merged
Conversation
Owner
|
Not tested but build runs. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
OoT's shadow/prepass draws are mesh pipelines with only a depth attachment (
cfmt=0×8,dfmt=0xfc). Their fragment stage is still the program's colour fragment, which readsuser(locn5); the position-only shadow mesh does not write it, so Metal rejects the whole mesh pipeline:It is retried every frame. With async shaders the failed prepass is skipped intermittently (flicker); without async it floods the log and is skipped every frame. The object's colour pass is a different pair, so it renders throughout.
A depth-only pass has no colour output, so its fragment cannot affect the result; Metal only needs a fragment function that validates. Use an empty
fragment voidfor mesh pipelines whose pass has no colour attachments; colour passes keep the program's fragment unchanged.Tested on M3 Max 48 GB, Hateno save: before, 1,878
user(locn5)lines per pair and intermittent flicker; after, zero lines, stable, shadows correct. Runtime-only change; no shader retranslation.