Set the minimum required Metal version #9425
Open
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.
Apple's documentation says that the language version will be set to the most recent version if it's not specified, but this is flat out false in some environments. On Apple Silicon I believe it is true, but I recently ported my app to run as a universal binary, and I have an Intel Mac where in some contexts, Filament's shader compilation fails with errors like:
My app works when running as a standalone executable, but this issue comes up when running as a plugin (dynamically loaded object) inside another application. It appears that the host application can somehow cause the Metal API to assume a different Metal version than the latest.
Setting this explicitly to the minimum version that Filament requires fixes the problem. It also seems like a good idea, because it makes the version requirement explicit -- if a new Filament version is going to use newer Metal API features, it will be clear to everyone what version of Metal is being targeted.