I am creating a class that needs differently coded shaders due to varying inputs that are known at initialization. The goal would be that when the object is initialized the shader is also initialized and compiled into a library.
My problem is I have no clue how to write a .metal file to my apps directory like I see in XCode and frankly I am not sure iOS permissions will even let me do that. I think once I have the metal file in place it becomes easy but how?
The shader I hope to edit at compile time will have a variable amount of texture inputs based on the initialization parameters.