Skip to content

Metal: skip draws whose render pipeline failed to compile - #119

Closed
yorgunkral31 wants to merge 1 commit into
renderbag:mainfrom
yorgunkral31:metal-skip-null-pso-draws
Closed

yorgunkral31 wants to merge 1 commit into
renderbag:mainfrom
yorgunkral31:metal-skip-null-pso-draws

Conversation

@yorgunkral31

Copy link
Copy Markdown

Encoding a draw with a null MTLRenderPipelineState is undefined behavior. I hit this on iOS, where the OS rejects a vertex attribute conversion that macOS accepts — the failed pipeline's draws encoded garbage geometry. This guards the draw calls and the state-cache bind so a failed pipeline can't take the frame down on any platform. (Found while testing hedge-dev/UnleashedRecomp#1767 on device.)

Encoding a draw with a null MTLRenderPipelineState is undefined
behavior; when newRenderPipelineState fails (for example on a vertex
attribute/shader type mismatch that only some OS versions reject), the
failed pipeline's draws now get skipped instead of encoding garbage,
and the state cache no longer binds a null pipeline.
@DarioSamo

Copy link
Copy Markdown
Contributor

If the pipeline fails to be generated, you shouldn't be drawing anything in the first place. You're failing to understand where the problem needs to be solved completely. The application will not work if it straight up does not draw something as it should.

Closing, as per the contribution guidelines that state, AI-generated pull requests are not allowed.

@DarioSamo DarioSamo closed this Sep 24, 2026
@renderbag renderbag locked as spam and limited conversation to collaborators Sep 24, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants