Somewhere on the way from iOS 8.x to 9.x it would appear the online/offline compiler have diverted significantly and became a little .. unstable?
With both iOS 9.0.2/Xcode 7.01 and 9.1/Xcode 7.1 some shaders will compile at runtime but not offline or the other way round. For example they disagree if [[ buffer/texture(..) ]] attributes are required (documentation says no, online works without, offline requires it), they disagree on which math functions are available (sinpi for example, documentation says yes, online compiler/SDK yes, offline compiler/SDK no), and the online compiler is very easy to crash where the offline compiler reports errors in some of those cases and in others compiles just fine.
I'm further observing differences in which data types are compatible with which pixel format on texture attributes, depending on the device type I run on! On iPad Air half works fine to read from R16 whereas on iPad Air 2 float is listed as the only compatible format (both are on same iOS version 9.0.2). According to the documentation iPad Air would be correct. On a side note it would be useful if the compatible formats could be inspected form the API rather than finding out about these things by trial and error.
For context: I'm working on a live-coding environment for Metal which means I must compile online. The compiler differences mentioned above are observed by writing out the shader code right before passing it to newLibraryWithSource (there are no pre-processor macros) and pasting that into a .metal file in Xcode for hopes of more insights into what may be going wrong.
Any suggestions?
Thanks!