3 ms·
I'm curious, how is metal simpler, and is it fair to say metal is simpler when it's only available for apple hardware?
by jokoon 3y ago
I'm curious, how is metal simpler, and is it fair to say metal is simpler when it's only available for apple hardware?
- flohofwoe 3y agoTL;DR: Metal has a more balanced approach to API design than both Vulkan or D3D12. In general, "programming ergonomics" seems to have been an important design goal, which is something that seems completely absent both in D3D12 and Vulkan (basically, if the Vulkan or D3D12 design teams had to decide between making an API feature more convenient to use for the programmer, or more explicit at the cost of less convenience, then the answer was always "make it explicit", while the Metal design team at least seems to have thought about the consequences for the API user before making a decision - at least that's what it looks like from the outside looking at the resulting APIs). Metal started with a programming model that looks a lot like what a hypothetical "D3D11 next" could have looked like (basically D3D11 minus the warts, and plus PSOs, command queues and render passes, but keeping the traditional and straightforward slot-based resource binding model). Later versions then gradually added optional lower-level, more explicit features which allow more control over resource management and accessing specific GPU features with less API overhead, but may also be less convenient to use (and it's not actually just "Apple GPUs", Metal supports Apple devices with Intel, AMD and NVIDIA(?) GPUs just fine - since there were Mac laptops which shipped with those GPUs). Apple also maintains higher level libraries like MetalKit and SceneKit. Because of this 'layered approach', a Metal application can just start with the higher level API features to get something running quickly, and then gradually switch to more recent and more explicit Metal features only when needed or desired. One could also simply say that the Metal team applied common sense, "taste" and a balanced approach to their API design, instead of just mechanically collecting hardware feature requirements from all GPU vendors and trying to cram those into a common low-level API at all cost.