-
Notifications
You must be signed in to change notification settings - Fork 7
Descriptors and Descriptor Sets
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.
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 (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.
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.
The contents of this Wiki, including text, images and other resources are licensed under a Creative Commons Attribution 4.0 International License.