Skip to content

Descriptors and Descriptor Sets

Carsten Rudolph edited this page Jun 27, 2021 · 3 revisions

You can imagine descriptors as GPU-pointers that are used by shaders to access buffer memory (constant buffers, textures, etc.). They are grouped into descriptor sets. Defining a descriptor does not yet allocate memory for it (similar to how pointers work in normal programming). You have to make sure to properly setup backing memory for each descriptor, as described in the next page.

Descriptors and Descriptor Sets

Descriptor Types

Currently LiteFX supports four descriptor types: constant/uniform buffers, storage buffers, textures (and input attachment views) and samplers. Each of them needs to be treated slightly differently.

Constant/Uniform and Storage Buffers

Constant (or uniform) buffers are the most simple form of passing data from the CPU to the GPU. A constant buffer can hold a single, read-only (hence the name) element that can be viewed from a shader. Typically constant buffers are short-lived, Write once/Read once objects with frequent changes between draw calls.

Buffer Arrays

Textures

Input Attachments
Texture Arrays

Samplers

Descriptor Sets

Nuances in Descriptor Handling between DirectX 12 and Vulkan

There are some differences in how descriptors are handled in Vulkan and DirectX 12. LiteFX abstracts those away, so typically you do not have to worry about them at all. They are, however, nice to know and also might help understand problems with descriptor bindings.