You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The current Metal shader generator is highly derived from the Glsl shader generator. We then use a function (`MetalizeGeneratedShader`) to string process the GLSL source to convert it to legal Metal shader source.
Currently there is still a lot of GLSL syntax left, and we rely on `#define` statements and the Metal compiler preprocessor to create correct syntax.
This PR does the following:
* Adds more string processing to `MetalizeGeneratedShader` replacing the preprocessor defines.
* Correct some incorrect Syntax registrations, that were still emitting Glsl types.
* Fix `mx_math.metal` to be legal Metal syntax, and not rely on the `MetalizeGeneratedShader` function.
* Register token substitutions for `T_TEX_SAMPLER_SAMPLER2D` and `T_TEX_SAMPLER_SIGNATURE` specific to the required Metal syntax.
Ideally all metal source files should be legal metal syntax.
This work is a pre-cursor to other work to improve Metal support, and it would be helpful to get this piece merged and tested to make that work easier moving forwards.
0 commit comments