xcode - Manually Compile Metal Shaders -
i'm interested in moving away xcode , manually compiling metal shaders in project mixed-language application. i have no idea how this, though. xcode hides details of shader compilation , subsequent loading application @ runtime (you call device.newdefaultlibrary() ). possible, or have use runtime shader compilation purposes? generally, have 3 ways load shader library in metal: use runtime shader compilation shader source code via mtldevice newlibrarywithsource:options:error: or newlibrarywithsource:options:completionhandler: methods. although purists may shy away runtime compilation, option has minimal practical overhead, , viable. primary practical reason avoiding option might avoid making shader source code available part of application, protect ip. load compiled binary libraries using mtllibrary newlibrarywithfile:error: or newlibrarywithdata:error: methods. follow instructions in using command line utilities build library create these individual binary l...