|
|
|
|
|
by rwbt
3353 days ago
|
|
> He seems to just hand-wave and says "well just use C you idiots". He criticizes Metal for using a version of C++14 that doesn't allow recursion, but offers no alternate solutions I don't think the author suggested anything like that. He recommended using C with some extensions, so it would be easy to write shaders in many different languages. Also, he criticized the poor implementation of Metal's shading language which requires a custom fork of Clang (which is apparently buggy), not necessarily the choice of using C++14. > The reason GLSL isn't C is because you can't do everything C does on a low end cellphone GPU - so obviously you have to restrict the language. That may be true in the early days of OpenGL, but now that's probably no longer the case. |
|
looking at the metal language I'm not sure I'd personally call that C++ given all the restrictions
https://developer.apple.com/metal/metal-shading-language-spe...
I'd be curious if you can create static arrays, strings or static strings, do string compares etc. not that I'd want to do any of that on a GPU but rather if you tell me the language is C++ there are a ton of things I'd expect to be able to do that I'm pretty sure don't translate to GPUs
maybe I want to declare a local static array and modify it. maybe I want to create static arrays of colors and search for the closest match. I feel like having a more common language would just lead people to bang their heads against the impossible or implement horribly inefficient algos not really understanding what's going on under the hood