4 ms·
Agreed, C++ for the shading language was a very strange choice, I'd have preferred regular C with language extensions (I guess we're lucky it's not Objective-C
by flohofwoe 6y ago
Agreed, C++ for the shading language was a very strange choice, I'd have preferred regular C with language extensions (I guess we're lucky it's not Objective-C or Swift, really dodged a bullet there). I don't write Metal shader code though, instead I write GLSL and cross-compile to MSL via SPIRVTool + SPIRVCross (HLSL to MSL would work too, but I don't know if that's as well supported as GLSL to MSL).
Ideally I'd want to see shader compilers merged into regular compilers, so that "CPU code" and "GPU code" can be mixed in the same source file and share the same data structures (at least their declarations). Actually, the latter (sharing struct declarations via shared headers) works in Metal + MSL though.
- pjmlp 6y agoOptix 7 is based on CUDA (with its C++17 support). What you are looking for is basically CUDA's model, and what Khronos is trying to catch up with SYSCL.