Expand description
Backend for MSL (Metal Shading Language).
This backend does not support the SHADER_INT64_ATOMIC_ALL_OPS
capability.
Binding model
Metal’s bindings are flat per resource. Since there isn’t an obvious mapping from SPIR-V’s descriptor sets, we require a separate mapping provided in the options. This mapping may have one or more resource end points for each descriptor set + index pair.
Entry points
Even though MSL and our IR appear to be similar in that the entry points in both can
accept arguments and return values, the restrictions are different.
MSL allows the varyings to be either in separate arguments, or inside a single
[[stage_in]]
struct. We gather input varyings and form this artificial structure.
We also add all the (non-Private) globals into the arguments.
At the beginning of the entry point, we assign the local constants and re-compose the arguments as they are declared on IR side, so that the rest of the logic can pretend that MSL doesn’t have all the restrictions it has.
For the result type, if it’s a structure, we re-compose it with a temporary value holding the result.
Modules
Structs
- A mapping of vertex buffers and their attributes to shader locations.
- A subset of options that are meant to be changed per pipeline.
- Information about a translated module that is required for the use of the result.
- A description of a vertex buffer with all the information we need to address the attributes within it.
Enums
- Corresponds to WebGPU
GPUVertexFormat
.