Skip to content

OoT: use a null fragment for depth-only mesh pipelines - #3

Merged
Kolkka merged 1 commit into
Kolkka:feat/ootfrom
MD5Visual:fix/oot-mesh-depth-only
Nov 8, 2026
Merged

Kolkka merged 1 commit into
Kolkka:feat/ootfrom
MD5Visual:fix/oot-mesh-depth-only

Conversation

@MD5Visual

Copy link
Copy Markdown

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 reads user(locn5); the position-only shadow mesh does not write it, so Metal rejects the whole mesh pipeline:

[mesh] [RED] pipeline task - mesh a203347b… fragment cd609edc…: Fragment input(s) `user(locn5)` mismatching mesh shader output type(s) or not written by mesh shader

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 void for 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.

@Kolkka

Kolkka commented Nov 8, 2026

Copy link
Copy Markdown
Owner

Not tested but build runs.

@Kolkka
Kolkka merged commit d11d925 into Kolkka:feat/oot Nov 8, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants