Very early draft of an Effects interface for Metal. It's mostly copy-pasted from mojoshader_opengl.c with a few significant changes:
mtlCompileEffect concatenates all the MojoShader shader output into a single string, then compiles that conglomerate into a MTLLibrary. One Effect <=> One Metal Library.
Since Metal has no concept of a "shader program" like GL does, we store pointers to the MTLLibrary, the vertex MTLFunction, and the fragment MTLFunction associated with each effect pass.
mtlDeleteEffect is a total no-op currently. Putting this off since we'll have to deal with Objective C's funky memory management...
Very early draft of an Effects interface for Metal. It's mostly copy-pasted from
mojoshader_opengl.c
with a few significant changes:mtlCompileEffect
concatenates all the MojoShader shader output into a single string, then compiles that conglomerate into a MTLLibrary. One Effect <=> One Metal Library.mtlDeleteEffect
is a total no-op currently. Putting this off since we'll have to deal with Objective C's funky memory management...