KDGpu::BindGroup¶
Module: Public API
Represents a set of shader resource bindings (descriptor set) More...
#include <KDGpu/bind_group.h>
Public Functions¶
| Name | |
|---|---|
| BindGroup() | |
| ~BindGroup() | |
| BindGroup(BindGroup && other) | |
| BindGroup & | operator=(BindGroup && other) |
| BindGroup(const BindGroup & ) =delete | |
| BindGroup & | operator=(const BindGroup & ) =delete |
| const Handle< BindGroup_t > & | handle() const |
| bool | isValid() const |
| operator Handle< BindGroup_t >() const | |
| void | update(const BindGroupEntry & entry) |
Friends¶
| Name | |
|---|---|
| class | Device |
| KDGPU_EXPORT bool | operator==(const BindGroup & a, const BindGroup & b) |
Detailed Description¶
1 | |
Represents a set of shader resource bindings (descriptor set)
Vulkan equivalent:VkDescriptorSet
BindGroup (also known as descriptor set in Vulkan) groups together shader resources like buffers, textures, and samplers. Shaders declare what resources they need, and bind groups provide the actual resources.
Key features:
- Group multiple resources for efficient binding
- Update individual bindings dynamically
- Allocate from descriptor pools
- Match shader layout declarations
Lifetime: BindGroups are allocated from a BindGroupPool and must remain valid while referenced by command buffers. They use RAII and clean up automatically.
Note that KDGpu uses a default internal BindGroupPool if you do not specify one, so you can create bind groups without managing pools directly.
Available BindingResource bindings:
- TextureViewSamplerBinding
- TextureViewBinding
- InputAttachmentBinding
- SamplerBinding
- ImageBinding
- UniformBufferBinding
- StorageBufferBinding
- DynamicUniformBufferBinding
- AccelerationStructureBinding
¶
Usage¶
Creating a simple bind group:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 | |
Filename: kdgpu_doc_snippets.cpp
Using bind groups in rendering:
1 2 3 4 5 6 7 8 9 10 11 12 13 | |
Filename: kdgpu_doc_snippets.cpp
Updating bind groups:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 | |
Filename: kdgpu_doc_snippets.cpp
In some cases, you might need to create the BindGroup without binding it to a resource immediately:
1 2 3 4 5 6 7 8 9 10 11 | |
Filename: kdgpu_doc_snippets.cpp
Multiple uniform buffers:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 | |
Filename: kdgpu_doc_snippets.cpp
Multiple bind groups (different sets):
1 2 3 4 5 6 7 8 9 10 11 12 | |
Filename: kdgpu_doc_snippets.cpp
Dynamic offset binding:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 | |
Filename: kdgpu_doc_snippets.cpp
Storage buffer binding:
1 2 3 4 5 6 7 8 9 10 11 | |
Filename: kdgpu_doc_snippets.cpp
Separate TextureView and Sampler binding:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 | |
Filename: kdgpu_doc_snippets.cpp
¶
Vulkan mapping:¶
- BindGroup creation->vkAllocateDescriptorSets()
- BindGroup::update()->vkUpdateDescriptorSets()
- RenderPassCommandRecorder::setBindGroup()->vkCmdBindDescriptorSets()
¶
See also:¶
BindGroupLayout, BindGroupOptions, BindGroupPool, Device, PipelineLayout, BindingResource, BindGroupEntry
Public Functions Documentation¶
function BindGroup¶
1 | |
function ~BindGroup¶
1 | |
function BindGroup¶
1 2 3 | |
function operator=¶
1 2 3 | |
function BindGroup¶
1 2 3 | |
function operator=¶
1 2 3 | |
function handle¶
1 | |
function isValid¶
1 | |
function operator Handle< BindGroup_t >¶
1 | |
function update¶
1 2 3 | |
Friends¶
friend Device¶
1 2 3 | |
friend operator==¶
1 2 3 4 5 | |
Updated on 2026-03-31 at 00:02:07 +0000