Repository navigation
fix(gpu): refuse mesh pipelines over Metal's 32 KiB under Wine, by the aligned layout too (#172) - #282
Merged
Conversation
…e aligned layout too (pragyaangaur#172) Under D3DMetal an over-limit mesh pipeline is made, draws nothing and its submission never completes: the world-entry hang after the "Vice City, two years ago" card. Linking mesh outputs (pragyaangaur#161) is now on by default under Wine, and a pipeline still over 32 KiB after it is refused. The size is the larger of MeshOutputs::bytes and the aligned layout Metal allocates, which puts ~20 world mesh shaders of 1.0.2.1 at 34,816-38,400 bytes where the packed count puts them under the limit.
This was referenced Nov 26, 2026
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.
Fixes the world-entry hang of #172 on current main with D3DMetal 4.0 beta 3.
What happens. Right after the "Vice City, two years ago" card a submission holding the title's indirect mesh draws never completes, and the run waits on the host GPU for good. Linking mesh and pixel outputs (#161) is off unless
VICTORY_LINK_MESH_OUTPUTSis set, and nothing refuses a mesh pipeline that is still over Metal's 32 KiB, so the oversized pipelines are made. With a log line naming the hung submission's pipelines, two independent hangs shared the same mesh pipelines, among themmesh b68376181e9c8b2f.Why it was not caught. Two counts of a mesh shader's outputs disagree.
MeshOutputs::bytescounts 4 bytes per declared component. The layout Metal allocates (the oldermetal_mesh_bytes, which #172's report used) puts clip and cull distances first, then the position, then each other output aligned to its own size, and the same for primitives, times the declared maxima. For 1.0.2.1 the packed count puts every world mesh shader at or under 32,768 bytes, while the aligned layout puts about 20 of them at 34,816 to 38,400 bytes.b68376181e9c8b2fis 34,816.Change (only under Wine; Windows is unchanged):
VICTORY_LINK_MESH_OUTPUTS=0turns it off.VICTORY_MESH_OVER_LIMIT=1makes it anyway.docs/macos.mdhas a section on this, and a row in the switch table.Tested on an M5 Max, macOS 26, D3DMetal 4.0 beta 3, Series X profile, with fault tracking on (and #262):
🤖 Generated with Claude Code