Metal: Upgrade metal-cpp#119582
Draft
stuartcarnie wants to merge 1 commit into
Draft
Conversation
Member
This might be incompatible with OSXCross, at least was in the past. We use custom build of MoltenVK built with |
# Code-size reduction This commit upgrade metal-cpp to an improved, generated version that utilises compiler and linker optimisations introduced in Xcode 14 to resolve selectors at link time. One of those optimisations reduces code size by generating stubs to Objective-C selectors. Call sites now perform direct branches to the stub. # Patching We no longer have to patch metal-cpp, as we can customise what APIs are generated in the `config.yaml`. # API availability Finally, the generator has the option to enable API availability, which pulls availability attributes from SDK headers. This ensures compiler warnings are generated when using APIs that may not be available on older OS releases, avoiding runtime bugs.
dd60f27 to
2a3779f
Compare
Contributor
Author
Interesting, as we don't compile Godot with that flag? I'm also replacing the compiler tool-chain in this PR, which uses a new lld, so that shouldn't be a problem there either. I'll test it with my local build-container setup to verify. |
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.
Code-size reduction
This commit upgrade metal-cpp to an improved, generated version that utilises compiler and linker optimisations introduced in Xcode 14 to resolve selectors at link time. One of those optimisations reduces code size by generating stubs to Objective-C selectors. Call sites now perform direct branches to the stub.
Compilation
The previous version was template heavy, so this should compile a little faster, but it was not measured to verify.
Patching
We no longer have to patch metal-cpp, as we can customise what APIs are generated in the
config.yaml.API availability
The generator includes API availability attributes on types and members, which is pulled from the official SDK headers. This ensures compiler warnings are generated when using APIs that may not be available on other OS releases, avoiding runtime bugs.
🤖 AI disclosure
I used API to assist with writing the
generate.pycode generator.