![]() |
Vireo
0.0
Vireo 3D Rendering Hardware Interface
|
A descriptor set is a collection of shader resources bindings — think of it as a bundle that tells the GPU “here are all the buffers, images and samplers this shader will need.”
A descriptor set is created from a description of the resources in the form of a descriptor layout with vireo::Vireo::createDescriptorSet.
Before use, fill each set’s slots with actual buffer, image or sampler via vireo::DescriptorSet::update methods. This can be done at any time except inside a render pass.
For each resource added to the corresponding descriptor layout you need to call vireo::DescriptorSet::update with the same binding numbers and the same resource type.
When recording commands during a render pass, after binding the pipeline to the command list bind the descriptor sets with vireo::CommandList::bindDescriptor or vireo::CommandList::bindDescriptors
If you use dynamic uniform buffer vireo::CommandList::bindDescriptor let you change buffer offsets at bind time without reallocating sets.
Each descriptor set will the bound to a specific set/space number.
If you don't need dynamic uniform descriptor set you can bind the sets using one command :
The sets/spaces numbers will be calculated from the vector index.
In the shaders code each resource need to be bound to the corresponding binding and set/space numbers.
If you use the Slang shader language just use the HLSL register syntax, it will works for both Vulkan and Direct X :