Explore tens of thousands of sets crafted by our community.
Graphics APIs Comparison
20
Flashcards
0/20
Coordinate Systems
OpenGL uses a right-handed coordinate system, while DirectX uses a left-handed system. Vulkan offers flexibility through its configurable coordinate system.
Shader Languages
OpenGL uses GLSL while DirectX uses HLSL. Vulkan uses SPIR-V, which is an intermediate language that any shading language can be compiled into.
Rendering Pipeline
DirectX 12 and Vulkan are both explicit APIs with similar stages in the rendering pipeline, but they manage memory and synchronization differently. OpenGL has a more fixed-function pipeline approach.
Texture Compression
OpenGL and DirectX both support various texture compression formats, but the specific supported formats can vary. Vulkan supports ASTC and additional formats through extensions.
Swap Chain
Vulkan and DirectX 12 allow for more control over the swap chain, while OpenGL handles swap chains more implicitly through the windowing system.
Multithreading
Vulkan and DirectX 12 are designed to better utilize multithreading, while OpenGL's support is more limited and less efficient due to its older design.
Graphics Command Recording
Vulkan and DirectX 12 allow pre-recording of command lists/buffers which can then be executed multiple times, offering performance benefits. In OpenGL, command recording is less explicit and more state-based.
Synchronization Primitives
Vulkan uses explicit synchronization mechanisms like fences, semaphores, and barriers. DirectX 12 uses similar concepts. OpenGL has implicit synchronization, which can be less fine-grained.
API Overhead
Vulkan and DirectX 12 aim to reduce driver overhead compared to OpenGL by providing lower-level access to the hardware.
Memory Management
Vulkan provides explicit memory management, while OpenGL manages memory behind the scenes. DirectX 12 also allows for explicit control but is different in terms of how memory allocation and deallocation is handled.
Resource Binding
DirectX 12 uses Descriptor Heaps and Tables for resource binding, Vulkan uses Descriptor Sets, while OpenGL uses context-bound objects, which are less flexible.
Pipeline State Objects (PSO)
Vulkan and DirectX 12 use PSOs to encapsulate all states required for rendering. OpenGL uses separate state calls, leading to potentially more draw calls and overhead.
Error Handling
Vulkan provides verbose error information through return codes and validation layers. DirectX 12 also offers extensive debugging capabilities. OpenGL's error handling is more limited in scope and detail.
Tessellation
OpenGL and DirectX use similar tessellation stages within the pipeline; however, there are differences in control over tessellation factors. Vulkan also supports tessellation but requires explicit activation via pipeline states.
Compute Shaders
All three APIs support compute shaders, with similar capabilities. The main differences lie in how compute resources are managed and dispatched.
Extension Mechanisms
OpenGL embraces extensions broadly for functionality augmentation. Vulkan has a core set of features and additional explicitly enabled extensions. DirectX typically integrates new features in major releases, rather than via extensions.
Anisotropic Filtering
Anisotropic filtering is supported across OpenGL, DirectX, and Vulkan. The APIs differ in the way anisotropic filtering is enabled and controlled.
Fullscreen Exclusive Mode
DirectX has explicit support for fullscreen exclusive mode, which can increase performance. OpenGL relies on the windowing system, and Vulkan offers a similar mode through extensions.
Adaptive Sync
Adaptive sync (such as V-Sync) is implemented in OpenGL via extensions, while DirectX 12 has integrated support for tearing control. Vulkan also supports adaptive sync mechanisms.
High-Dynamic-Range Rendering (HDR)
HDR is supported in DirectX and Vulkan, both offering more modern approaches to HDR rendering. OpenGL can support HDR via extensions but is generally less straightforward.
© Hypatia.Tech. 2024 All rights reserved.