<p>Metal and Vulkan are low-level 3D graphics APIs, in much the same way that OpenGL and Direct3D are 3D graphics APIs. Metal is Apple's API, usable on iOS and MacOS. Vulkan was developed by the Khronos Group, who also oversees the various forms of OpenGL. Vulkan is directly usable on all non-Apple platforms, and there is the MoltenVK project which provides a translation layer from Vulkan to Metal (since the APIs are not <em>that</em> different), thus allowing Vulkan applications to run even on Apple platforms.</p>

<p>Metal, Vulkan, and Direct3D v12 represent a dramatic departure API-wise from prior low-level graphics APIs. They use a command-buffer-based interface, where you record rendering commands into a command buffer object, then execute those commands at some later period. The more immediate style of APIs like OpenGL and D3D-pre-12 have no intermediary command buffer. When you call a rendering function, it is given to the GPU "right then" and that's the end of it.</p>

<p>These styles of API are important because they allow threaded creation of rendering commands. In the immediate APIs, you can only effectively have one thread issuing rendering commands. In command-buffer APIs, multiple threads can build multiple CBs simultaneously, and then one thread submits them all as a single bunch of work. This allows better utilization of CPU resources for CPUs with lots of cores.</p>

CC BY-SA 4.0
2018-10-24T20:38:23.210Z
"When you call a rendering function, it is given to the GPU "right then" and that's the end of it."

Or more specifically, given to the driver, to give to the GPU at some point between _now_ and _never_.
Jherico
CC BY-SA 4.0
2018-10-24T18:54:13.723Z
2018-10-24T18:54:13.723Z
Nicol Bolas
<p>I keep coming across the terms 'Metal' and 'Vulkan' on this site.
Guessing this to be some CG software, I'm interested to know what these are exactly and what the intended and most common usage is.</p>

<p>A quick search shows me a video about why metal in CG looks fake: <a href="https://www.youtube.com/watch?v=NjbLYFXrfFU" rel="noreferrer">https://www.youtube.com/watch?v=NjbLYFXrfFU</a></p>

<p>Obviously not the answer, most answers talk about compute kernels. I'm familiar with kernel inversion in machine learning but not like Android kernels and the such. Hope you can help me out. Your input would be most valuable.</p>

CC BY-SA 4.0
2018-10-26T14:40:01.330Z
Regarding the second part, 'kernel' in graphics has a couple of meanings which are distinct from other uses (OS kernel etc.). A 'convolution kernel' is a 2D array of weights which describes how neighbouring pixels affect the current pixel, for doing blur, edge detection etc. A 'compute kernel' is just a chunk of code to be executed by a compute shader on GPU, using each shader instance to process a different data point. You can think of it as being the body of a parallel-for loop.
russ
<vulkan><metal>
What are Metal and Vulkan?
MisterGeeky
# What are Metal and Vulkan?

(Asked by: username_0 on 2018-10-24)

I keep coming across the terms 'Metal' and 'Vulkan' on this site.
Guessing this to be some CG software, I'm interested to know what these are exactly and what the intended and most common usage is.

A quick search shows me a video about why metal in CG looks fake: <https://www.youtube.com/watch?v=NjbLYFXrfFU>

Obviously not the answer, most answers talk about compute kernels. I'm familiar with kernel inversion in machine learning but not like Android kernels and the such. Hope you can help me out. Your input would be most valuable.

**Tags:** vulkan, metal

> **Comments:**
> **username_1**: Regarding the second part, 'kernel' in graphics has a couple of meanings which are distinct from other uses (OS kernel etc.). A 'convolution kernel' is a 2D array of weights which describes how neighbouring pixels affect the current pixel, for doing blur, edge detection etc. A 'compute kernel' is just a chunk of code to be executed by a compute shader on GPU, using each shader instance to process a different data point. You can think of it as being the body of a parallel-for loop.  

---

## 1 answers

### Answer by username_2 on 2018-10-24. Score: 24

Metal and Vulkan are low-level 3D graphics APIs, in much the same way that OpenGL and Direct3D are 3D graphics APIs. Metal is Apple's API, usable on iOS and MacOS. Vulkan was developed by the Khronos Group, who also oversees the various forms of OpenGL. Vulkan is directly usable on all non-Apple platforms, and there is the MoltenVK project which provides a translation layer from Vulkan to Metal (since the APIs are not *that* different), thus allowing Vulkan applications to run even on Apple platforms.

Metal, Vulkan, and Direct3D v12 represent a dramatic departure API-wise from prior low-level graphics APIs. They use a command-buffer-based interface, where you record rendering commands into a command buffer object, then execute those commands at some later period. The more immediate style of APIs like OpenGL and D3D-pre-12 have no intermediary command buffer. When you call a rendering function, it is given to the GPU "right then" and that's the end of it.

These styles of API are important because they allow threaded creation of rendering commands. In the immediate APIs, you can only effectively have one thread issuing rendering commands. In command-buffer APIs, multiple threads can build multiple CBs simultaneously, and then one thread submits them all as a single bunch of work. This allows better utilization of CPU resources for CPUs with lots of cores.

> **Comments:**
> **username_3**: "When you call a rendering function, it is given to the GPU "right then" and that's the end of it."  Or more specifically, given to the driver, to give to the GPU at some point between _now_ and _never_.  

---

