3 ms·
Could it make sense for Metal to be ported to other platforms? Vulkan has never clicked for me. I can cut and paste code to get something running but I don't r
by criddell 5y ago
Could it make sense for Metal to be ported to other platforms?
Vulkan has never clicked for me. I can cut and paste code to get something running but I don't really understand it. When you say Metal is high level, that's very appealing to me.
> Metal is a high-level language, Vulkan is low-level.
Wikipedia says Metal is low-level. What do you think accounts for the different description?
- gjsman-1000 5y agoProbably differing definitions of "low level," levels being relative to what you are talking about. In terms of making a game it's "low level" but it's still a much "higher level" than Vulkan. An interesting discussion worth reading: https://developer.apple.com/forums/thread/38469 https://developer.apple.com/forums/thread/38469
- raphlinus 5y agoI totally get where you're coming from, Metal is much easier to program than raw Vulkan. I think a Metal-like API over "modern" APIs could be a good thing. There are things like the Vulkan Memory Allocator that help, but among other things that makes integration of different modules harder; this is especially nice on Metal because you can just allocate your own stuff off MTLDevice. That said, there would be challenges, and big ones, the more you tried to make it actually Metal compatible. You'd need a C++ compiler for the shaders, and certain idioms (pointers, scalar types other than 32 bits) would be difficult to translate portably. And as adamnemecek points out, the role of a friendly cross-platform GPU layer is largely being occupied by WebGPU (wgpu in particular in Rust-land). That'll be very comfortable for people used to Metal, as there's been lots of input from Apple folks. However, WGSL is much lower level than Metal Shading Language, and there are lots of important capabilities (subgroups, etc) missing that Metal and other advanced (>DX11) APIs can do.
- lucian1900 5y agoThey are both low-level APIs relative to OpenGL. The difference is mostly that Metal doesn't expose GPU vendor details. Metal has sort of been ported to other platforms, WebGPU is almost a subset of it (albeit somewhat higher level). There's even wgpu to use it outside of a browser.