3 ms·
Metal is very close to that "perfect layer" in my opinion. I would love to see a portable Metal built on top of Vulkan, rather than the MoltenVK we're getting (
by Jasper_ 8y ago
Metal is very close to that "perfect layer" in my opinion. I would love to see a portable Metal built on top of Vulkan, rather than the MoltenVK we're getting (an insane idea, in my opinion). Perhaps the Dash/NXT thing that Google is building would be an OK substitute?
- pjmlp 8y agoNot by Khronos given the C++ usage on Metal, as they still keep being too C focused.
- Jasper_ 8y ago? There's no C++ in Metal, it's Objective-C. You can build C or C++ bindings for Metal if you want ( as has been done by https://github.com/recp/cmt https://github.com/recp/cmt ), the binding language is not really a concern.
- jcelerier 8y ago> There's no C++ in Metal, it's Objective-C. ... did you use Metal ? Metal shaders are written in ≈C++14. Says so right here in the first example: https://developer.apple.com/documentation/metal/hello_triangle https://developer.apple.com/documentation/metal/hello_triang...
- Jasper_ 8y agoOh, sure, the shader language. That part doesn't really matter to me, it all gets compiled to some GPU-specific machine code in the end. Write it in GLSL, HLSL, SPIR-V, C++, who cares really. And shader cross-compilers are already incredibly common in the industry (most write in HLSL, then translate with HLSLParser, or glsl-optimizer, or spirv-cross, etc.). When I talk about "good APIs", I'm mostly talking about the driver and CPU side of things, since that's the common bottleneck we're looking to replace with an OpenGL replacement. GPU compiler is already pretty highly optimized.
- pjmlp 8y agoWhich proves you never wrote a single line of Metal. Metal Shaders are written in C++14 with a couple of language extensions.
- atq2119 8y agoShaders are not the API. If there's truly a need for it, people could come up with a more C++-style frontend for generating SPIRV for Vulkan.
- pjmlp 8y agoShaders are part of the API, they define what the GPU is supposed to do with a bunch of points and textures. History proves that alternatives to official APIs always follow the CoffeeScript path, the only difference is how fast they eventually die after the initial hype.
- atq2119 8y agoConsidering that there are already multiple frontend languages for Vulkan shaders - both GLSL and HLSL are supported, and not via cross-compilation - you're quite likely to be proven wrong. (Let's not even go into the various experimental frontends that target SPIR-V directly. Those likely aren't going anywhere, like most experimental languages.) Here's the key difference: Vulkan doesn't specify a high-level shader language at all, even though Khronos obviously has a GLSL bias. It specifies SPIR-V, which means that WebAssembly is a better analogy in CPU space than JavaScript/CoffeeScript.
- pjmlp 8y agoHLSL support is a kind of Google driven effort without being part of official Vulkan specification, due to many devs stating them they wouldn't care about Vulkan without such support, given their amount of DirectX shaders. Google naturally has a vested interest in making Vulkan being adopted on Android, since it drives sales, as its proper support requires recent flaghship models. By not being part of Vulkan standard and certification tests, basically if a driver does not handle the SPIR-V as generated by HLSL compiler, good luck with the vendor's support channels.
- de_watcher 8y agoThe purpose of Metal is the lock-in by the vendor of the OS. We may start thinking about other things after we properly overcome this by having Vulkan or GL over it.