Dealing with buffers in Vulkan
Buffers in Vulkan are essentially memory regions that store data for GPU access. More specifically, a Vulkan buffer refers to a VkBuffer
object that is associated with memory regions allocated through VkDeviceMemory
. To render a 3D scene with Vulkan, we must convert the scene data into a format the GPU can process. In this recipe, we’ll explain how to create GPU buffers and upload vertex data into them. We’ll use the open-source asset-loading library Assimp https://github.com/assimp/assimp to load a 3D model from an .obj
file and render it using LightweightVK and Vulkan. Additionally, this recipe includes a basic introduction to using the Vulkan Memory Allocator (VMA) library.
Getting ready
In Vulkan, uploading data to GPU buffers is done using command buffers, similar to many other Vulkan operations. This requires a command queue that supports transfer operations. The process of creating and using command buffers was covered in...