665 words
3 minutes
API_of_Vulkan_drawio
2024-08-25

link#

그림 출처#

Image

vulkan의 핵심 개념#

  • OpenGL은 함수마다 Command Buffer를 작성하고 Queue에 제출하는 방식을 사용하는데, Queue에 제출을 할 때 시간이 조금 걸린다. Vulkan은 일일이 Command Buffer를 작성할 때마다 Queue에 제출하지 않고, Command Buffer를 따로 다 작성 후 마지막에 한번에 다 제출하는 방식을 쓴다. 이 때문에 싱글스레드로 사용하여 멀티코어를 활용하는 병렬 처리가 아니더라도 성능은 OpenGL보다 뛰어나다.
  • https://namu.wiki/w/Vulkan(API)
Image

Graphics pipeline basics#

Image

Compute Shader#

Introduction#

  • In this bonus chapter, we’ll take a look at compute shaders. Up until now, all previous chapters dealt with the traditional graphics part of the Vulkan pipeline. But unlike older APIs like OpenGL, compute shader support in Vulkan is mandatory. This means that you can use compute shaders on every Vulkan implementation available, no matter if it’s a high-end desktop GPU or a low-powered embedded device.

  • This opens up the world of general purpose computing on graphics processor units (GPGPU), no matter where your application is running. GPGPU means that you can do general computations on your GPU, something that has traditionally been a domain of CPUs. But with GPUs having become more and more powerful and more flexible, many workloads that would require the general purpose capabilities of a CPU can now be done on the GPU in realtime.

    • 이로 인해 애플리케이션이 어디서 실행되든 그래픽 처리 장치(GPGPU)에서 범용 컴퓨팅이 가능해집니다. GPGPU는 전통적으로 CPU의 영역이었던 일반 계산을 GPU에서 수행할 수 있다는 뜻입니다. 하지만 GPU가 점점 더 강력하고 유연해지면서, CPU의 범용 기능이 필요한 많은 작업을 이제는 GPU에서 실시간으로 처리할 수 있게 되었습니다.
  • A few examples of where the compute capabilities of a GPU can be used are image manipulation, visibility testing, post-processing, advanced lighting calculations, animations, physics, (e.g., for a particle system) and much more. And it’s even possible to use compute for non-visual computational only work that does not require any graphics output, e.g., number crunching or AI related things. This is called “headless compute”.

Advantages#

  • Doing computationally expensive calculations on the GPU has several advantages. The most obvious one is offloading work from the CPU. Another one is not requiring moving data between the CPU’s main memory and the GPU’s memory. All the data can stay on the GPU without having to wait for slow transfers from the main memory.

  • Aside from these, GPUs are heavily parallelized with some of them having tens of thousands of small compute units. This often makes them a better fit for highly parallel workflows than a CPU with a few large compute units. The Vulkan pipeline

The Vulkan pipeline#

Image

Advanced Vulkan Compute: The Power of Parallelism#

AI-Assisted Vulkan Development#

API_of_Vulkan_drawio
https://younghakim7.github.io/blog/posts/api_of_vulkan_drawio/
Author
YoungHa
Published at
2024-08-25