Most modern graphics hardware platforms render images using programmable pipeline. 3D graphics data, such as vertices and fragments/pixels, are processed in a series of steps called stages. Some stages always perform the same operations, which we can only configure to a certain extent. However, there are other stages that need to be programmed. Small programs that control the behavior of these stages are called shaders.
In Vulkan, there are five programmable graphics pipeline stages--vertex, tessellation control, evaluation, geometry, and fragment. We can also write compute shader programs for a compute pipeline. In the core Vulkan API, we control these stages with programs written in a SPIR-V. It is an intermediate language that allows us to process graphics data and perform mathematical calculation on vectors, matrices, images, buffers, or samplers. The low-level nature of this language improves compilation...