Lably
Skip to content

Vulkan

Cross-platform 3D graphics API and open standard

  • 12 min read
  • 5 chapters

Related on Lably

Through Multi-core processor

Vulkan is intended to offer higher performance and more efficient CPU and GPU usage compared to the older OpenGL and Direct3D 11 APIs, by providing a considerably lower-level API that more closely resembles how modern GPUs work. Vulkan is comparable to Apple's Metal API and Microsoft's Direct3D 12. In addition to its lower CPU usage, Vulkan is designed to allow developers to better distribute work among multiple CPU cores.

Vulkan was first announced by the non-profit Khronos Group at GDC 2015. The Vulkan API was initially referred to as the "next generation OpenGL initiative", or "OpenGL next" by Khronos, but use of those names was discontinued when "Vulkan" was announced.

Vulkan is derived from and built upon components of AMD's Mantle API, which was donated by AMD to Khronos with the intent of giving Khronos a foundation on which to begin developing a low-level API that they could standardize across the industry.

Features

Vulkan is intended to provide a variety of advantages over other APIs as well as over its predecessor, OpenGL. Vulkan offers lower overhead, more direct control over the GPU, and lower CPU usage. Its overall concept and feature set are similar to those of Mantle. They were later adopted by Microsoft with Direct3D 12 and by Apple with Metal.

Intended advantages of Vulkan over previous-generation APIs include the following:

Cross-platform

Vulkan is available on multiple modern operating systems and architectures, and provides a single API for both desktop and mobile graphics devices, whereas previously these were split between OpenGL and OpenGL ES respectively. Like OpenGL, and in contrast to Direct3D 12, the Vulkan API is not locked to a single OS or device form factor. Vulkan runs natively on at least Android, Linux, BSD Unix, QNX, Haiku, Nintendo Switch, Raspberry Pi, Stadia, Fuchsia, Tizen, and Windows 7, 8, 10, and 11. MoltenVK provides freely licensed third-party support for macOS, iOS and tvOS by wrapping over Apple's Metal API.

Lower CPU usage

Vulkan reduces load on CPUs through the use of batching and other low-level optimizations, thereby reducing CPU workloads and leaving the CPU free to do more computation or rendering than would otherwise be possible.

Multi-threading friendly design

Direct3D 11 and OpenGL 4 were initially designed for use with single-core CPUs and only received augmentation to be executed on multi-cores. Even when application developers use the augmentations, these APIs regularly do not scale well on multi-cores. Vulkan offers improved scalability on multi-core CPUs due to the modernized threading architecture.

Pre-compiled shaders

OpenGL uses the high-level language GLSL for writing shaders, which forces each OpenGL driver to implement its own compiler for GLSL. This then executes at application runtime to translate the program's shaders into the GPU's machine code. In contrast, Vulkan drivers are supposed to ingest shaders already translated into an intermediate binary format called SPIR-V (Standard Portable Intermediate Representation), analogous to the binary format that HLSL shaders are compiled into in Direct3D. By allowing shader pre-compilation, application initialization speed is improved and a larger variety of shaders can be used per scene. A Vulkan driver only needs to perform GPU specific optimization and code generation, resulting in easier driver maintenance, and potentially smaller driver packages. The developers of applications now can also more easily obfuscate proprietary shader code, due to shaders not being stored directly as source code. However, tools are provided that can decompile SPIR-V to human-readable high-level code.

Others

  • Vulkan provides unified management of compute kernels and graphical shaders, eliminating the need to use a separate compute API in conjunction with a graphics API.
  • Ray tracing is provided in a set of cross-vendor extensions, which together are analogous to the OptiX and DirectX Raytracing APIs. No such functionality is exposed in OpenGL.
  • Video acceleration is provided for decoding and encoding, such as H.264 and H.265.

OpenGL versus Vulkan

AMD states that "Vulkan supports close-to-metal control, enabling faster performance and better image quality across Windows 7, Windows 8.1, Windows 10, and Linux. No other graphics API offers the same powerful combination of OS compatibility, rendering features, and hardware efficiency."

In 2016, AMD's GPU manufacturing competitor NVIDIA stated that "OpenGL is still a great option for a lot of use cases, as it comes at a much lower complexity and maintenance burden than Vulkan, while in many cases still providing great overall performance."

Sign in to keep reading

4 more chapters are free with a Lably account.

More in Computing and communication