Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

🦹‍♂️ Add missing functions to set minimum OS and GPU targets on IRCompiler #23

Merged
merged 1 commit into from
Jul 23, 2024

Conversation

MarijnS95
Copy link
Member

By setting the minimum targets that emitted Metal shaders should support, we may not only be opting out of potential optimizations that are only supported on newer OS versions or GPUs (i.e. per the feature tables at) https://developer.apple.com/metal/Metal-Feature-Set-Tables.pdf) but also receive adequate errors when features used in shaders are not supported by the given minimum target, such as:

IRError { code: UnsupportedInstruction, payload: "IR contains unsupported instruction: \"dx.op.atomicBinOp.i32\". Target minimum OS build version does not support texture atomics" }

(This happens when setting the deployment target to MacOS 13, as texture atomics are only supported on MacOS 14 onwards)

Unfortunately the compiler also throws a related error on one of our shaders regardless of the deployment target we set, as if there's a (broken) requirement to not set minimumDeploymentTarget higher than the machine that metal_irconverter is running on?

IRError { code: UnableToLinkModule, payload: "Error linking metallib. Please verify that the minimumDeploymentTarget is equal or lower than your operating system version." }

…mpiler`

By setting the minimum targets that emitted Metal shaders should support,
we may not only be opting out of potential optimizations that are only
supported on newer OS versions or GPUs (i.e. per the feature tables at)
https://developer.apple.com/metal/Metal-Feature-Set-Tables.pdf) but also
receive adequate errors when features used in shaders are not supported
by the given minimum target, such as:

    IRError { code: UnsupportedInstruction, payload: "IR contains unsupported instruction: \"dx.op.atomicBinOp.i32\". Target minimum OS build version does not support texture atomics" }

(This happens when setting the deployment target to MacOS 13, as texture
 atomics are only supported on MacOS 14 onwards)

Unfortunately the compiler also throws a related error on one of our
shaders regardless of the deployment target we set, as if there's a
(broken) requirement to not set `minimumDeploymentTarget` higher than
the machine that `metal_irconverter` is running on?

    IRError { code: UnableToLinkModule, payload: "Error linking metallib. Please verify that the minimumDeploymentTarget is equal or lower than your operating system version." }
@MarijnS95 MarijnS95 added this pull request to the merge queue Jul 23, 2024
Merged via the queue into main with commit bd661d4 Jul 23, 2024
4 checks passed
@tosti007 tosti007 deleted the minimum-target-apis branch July 23, 2024 07:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants