Add explicit FLOAT32, INT32, and UINT32 to MSLShaderVariableFormat#2639
Open
alexdremov wants to merge 1 commit into
Open
Add explicit FLOAT32, INT32, and UINT32 to MSLShaderVariableFormat#2639alexdremov wants to merge 1 commit into
alexdremov wants to merge 1 commit into
Conversation
alexdremov
commented
Jun 6, 2026
| } | ||
|
|
||
| if (capture_output_to_buffer && storage == StorageClassOutput) | ||
| if (storage == StorageClassOutput && get_entry_point().model != ExecutionModelFragment) |
Author
There was a problem hiding this comment.
maybe is_vertex_like_shader() can be used here, I am not sure
Contributor
|
This seems awfully familiar... |
Author
Hey! Seems like you have linked this PR. Perhaps you meant something else. |
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.
This PR addresses failures in MoltenVK:
MSLShaderVariableFormat previously only supported
ANY32, forcing to default to UInt. This causes a Metal compiler crash (invalid return type or mismatching type) if the fragment shader actually expects a float input. By introducing explicit 32-bit types, MoltenVK can instruct SPIRV-Cross on the exact data type to use.get_entry_point().model != ExecutionModelFragment. This ensures that dummy output generation safely applies to all standard Vertex, Geometry, and Tessellation stages to satisfy downstream Metal linkers, while strictly preventing generic [[user(locn)]] variables from being illegally injected into the return structs of Fragment shaders.AI use disclosure:
I am not a computer graphics expert and AI was used to help debug and prepare fixes for this issue. I confirm that I have manually tested this and a scene that was crashing before in "Detroit: Become Human" is not crashing after this fix.