Metal support is currently highly experimental and very work in progress.
- Animation
- Blend
- Color
- Blend
- Dither (not fully vetted / just spot checked)
- Palette
- Levels
- Space
- Tonemap
- Distort
- Draw - (not fully vetted / just spot checked)
- Filters
- Gaussian Blur
- Box 2d
- Generative (not fully vetted / just spot checked)
- Geometry
- Lighting
- Math - (not fully vetted / just spot checked)
- Morphological
- Sample
- Sampler
- SDF - (not fully vetted / just spot checked)
- Space
- dupe
*.glsl
files-> and rename them to*.msl
- find replace
.glsl
->.msl
and ensure you repeat the above for imports - find replace
vec2
->float2
- find replace
vec3
->float3
- find replace
vec4
->float4
- find replace
matN
->matrix<float, n, n>
- find replace
in
function argument keyword -> `` as metal doesn't have the in function keyword - find
inout
and determine which thread local memory keyword should replace it, and make it a reference - ensure
const
is only used within functions,constant
must be used for global scoped constants
- Metal does not have the same basic math functions signatures as GLSL. We are adding all the polyfill functions in the
math/
folder. - Texture precision and filtering.
- Added
SAMPLER_TYPE
which specifies the texture precisions. Defaults totexture2d<float>
- This means your texture definition must match the default
float
precision, or you will need to overrideSAMPLER_TYPE
- Added
SAMPLER
which specifies the Metal sampler object. Defaults tosampler( min_filter::linear, mag_filter::linear )
- Added
gl_FragCoord
compatibilty. Not sure if there is a nice way to make this work without end users annotating their root Metal shader entry point.- For now, use the function definitions which pass the [[position]] coords from your main shader.
atan
/atan2
compatibility. Need to see if there is a nice way to override the function signatures to match.