Not enough OpenGL? Why develop Vulkan?

I believe that many friends have the same questions as me. 既然已经有广泛应用的OpenGL图形接口,为什么Khronos还要花费精力重新开发一套Vulkan图形API接口呢?After inquiring about relevant information, I summed it up in one sentence 为了更高的性能、更低的驱动程序开销.

For many graphics developers, OpenGL is a very familiar and widely used graphics API interface. However, with the increasing demand for computer graphics processing, OpenGL has gradually revealed some shortcomings, such as high driver overhead and insufficient multi-thread support. In order to solve these problems and better meet the needs of modern computer graphics processing, a new generation of graphics API interface Vulkan came into being.

  • Introduction to Vulkan
  • Key advantages of Vulkan
  • Advantages and disadvantages of Vulkan compared to OpenGL

1. Introduction to Vulkan

VulkanA suite of applications Khronos Groupmaintained by developers . It was first proposed at the Game Developers Conference (GDC) in 2015, and was subsequently released in and .高性能、低开销、跨平台图形API接口2016年2月16日1.0版本规范开源软件开发工具包(SDK)

Vulkan is based on a build developed by AMD Mantle(Mantle is a type developed by AMD 低级别的图形API接口to provide 更好的性能、更低的CPU开销), and later AMD donated its Mantle API to Khronos, which became the 底层图形API接口Vulkanbasis of .

Vulkan is designed for full-platform real-time 3D graphics programs (such as video games and interactive media), and the design goal is to 为现代GPU提供更直接的硬件访问接口better utilize the powerful computing power of multi-core CPUs and modern GPUs, resulting in higher rendering performance and lower CPU overhead( 提供高性能和更均衡的CPU与GPU占用).

Different from traditional graphics API interfaces such as OpenGL, Vulkan基于命令缓冲区,通过发送命令缓冲区中的命令来控制GPU的渲染和计算操作, provides advantages such as 更详细的硬件控制, 更高效的内存管理, 更灵活的管线状态管理and , so that多线程支持开发人员能够更好地控制图形渲染流程和优化应用程序性能

2. Advantages of Vulkan

Key benefits of Vulkan include:

  • 更低的驱动程序开销:
    Vulkan has lower driver overhead, which means less CPU time is spent on graphics calls, improving performance.
  • 更详细的硬件控制:
    Vulkan provides more detailed control over graphics hardware, allowing developers to better optimize application performance.
  • 更高效的内存管理:
    Vulkan provides a more efficient memory management mechanism, enabling graphics developers to more easily control the graphics rendering process and optimize memory usage.
  • 更灵活的管线状态管理:
    Vulkan provides a more flexible pipeline state management mechanism, enabling developers to better control the graphics rendering process.
  • 多线程支持:
    Vulkan was designed with multithreading in mind, making it easier for developers to distribute work across multiple CPU cores.
  • 跨平台支持:
    Vulkan aims to be a set of cross-platform graphics API, and the supported operating systems include Windows, Linux, and Android. In addition, on Apple macOS and iOS operating systems, MoltenVK developed by Molten runs Apple Metal API to provide Vulkan support.

3. Vulkan vs. OpenGL

Both Vulkan and OpenGL are graphics APIs developed by Khronos. As a new generation of graphics API, Vulkan abstracts graphics hardware more directly than its predecessor, OpenGL, with less driver overhead and higher performance, but with these advantages comes 更高的学习难度.

3.1 Advantages and disadvantages of Vulkan

Advantages of Vulkan :

  • There is lower driver overhead, which means less CPU time is spent on graphics calls, helping to improve performance;
  • Designed with multithreading in mind, it makes it easier for developers to distribute work across multiple CPU cores. .
  • More detailed control over graphics hardware enables developers to better optimize application performance.

Vulkan falls short :

  • Relatively new, it may lack support on some platforms or old hardware (such as hardware devices with versions below Android 7.0);
  • Lack of learning tutorials and learning resources relative to OpenGL;
  • The learning curve is steep and may be difficult for beginners;

3.2 Advantages and disadvantages of OpenGL

Advantages of OpenGL :

  • It has extensive support on many platforms and old devices, such as hardware devices with versions below Android 7.0;
  • There are a large number of existing tutorials and learning resources to study and refer to;
  • The learning curve is relatively gentle, which is easier for beginners;

OpenGL falls short :

  • High driver overhead, especially under high load, can become a performance bottleneck;
  • Lack of direct control over the underlying hardware, which may affect performance optimization;
  • Insufficient multi-thread support makes it difficult to fully utilize multi-core CPUs;

3.3 Suggestions for the selection of graphics API

VulkanDesigned for better parallel processing on modern multi-core CPUs and GPUs, with less CPU overhead and better scalability. In addition, Vulkan also provides better debugging tools and better error handling mechanisms, which makes it easier to develop and debug.
OpenGLStill a very popular graphics API interface, it has been around for a long time and is widely used. It is a cross-platform API that can run on a variety of operating systems and hardware. The main strength of OpenGL is its wide support and mature ecosystem, with many developers and tools supporting it. However, the main disadvantage of OpenGL is that it is limited in performance because it is a high-level API with less control over the hardware, and the way it does it is not very efficient.

In short, both Vulkan and OpenGL have their own advantages and disadvantages, and they have their own uses in different scenarios.

  • 对于需要高性能和更底层控制的应用程序开发,更建议选择Vulkan
  • 对于需要更成熟的生态系统支持,或面向设备为较旧的硬件设备(比如Android7.0以下版本硬件设备),或是图形学的初学者,OpenGL仍然是一个非常好的选择

reference

百科Volcano:
https://en.wikipedia.org/wiki/Volcano

= THE END =

The article was first published on the official account "CODING Technology Pavilion". If the article is helpful to you, please pay attention to my official account.

Supongo que te gusta

Origin blog.csdn.net/aiwusheng/article/details/131474402
Recomendado
Clasificación