When we want to use a given buffer as a uniform texel buffer or as a storage texel buffer, we need to create a buffer view for it.
Creating a buffer view
How to do it...
- Take the handle of a logical device from which a given buffer was created. Store it in a variable of type VkDevice named logical_device.
- Take the handle of a created buffer and store it in a variable of type VkBuffer named buffer.
- Choose a format for a buffer view (how the buffer's contents should be interpreted) and use it to initialize a variable of type VkFormat named format.
- Select the part of a buffer's memory for which a view should be created. Set the starting point of this memory (offset from the beginning of the buffer's memory) in a variable of type VkDeviceSize named memory_offset...