A generic, reusable Vulkan compute pipeline wrapper.
More...
|
| void | addPushConstantRange (uint04 size) |
| | Declare a push constant range accessible from the compute stage.
|
| void | addStorageBuffer (uint04 binding) |
| | Declare an SSBO binding in the descriptor set layout.
|
| void | bindBuffer (uint04 binding, VkBuffer vk_buffer, VkDeviceSize size) |
| | Update a descriptor set binding to point to the given buffer.
|
|
void | cleanup () |
| | Free all Vulkan resources.
|
| void | create (const VulkanShader &shader) |
| | Create the descriptor set layout, pipeline layout, descriptor pool, descriptor set, and compute pipeline from the given SPIR-V shader module.
|
| void | dispatch (VkCommandBuffer cmd, uint04 gx, uint04 gy, uint04 gz) const |
| | Record a pipeline bind + dispatch into a command buffer.
|
| void | pushConstants (VkCommandBuffer cmd, const void *data, uint04 size) const |
| | Record push constants into a command buffer.
|
|
|
static void | computeBarrier (VkCommandBuffer cmd) |
| | Insert a compute-to-compute memory barrier (SSBO write → read).
|
A generic, reusable Vulkan compute pipeline wrapper.
Manages a descriptor set layout, descriptor pool, descriptor set, push constant range, pipeline layout, and VkComputePipeline. Call addStorageBuffer() / addPushConstantRange() before create(), then bind buffers and dispatch.
Definition at line 47 of file VulkanComputePipeline.h.
◆ addPushConstantRange()
| void VulkanComputePipeline::addPushConstantRange |
( |
uint04 | size | ) |
|
Declare a push constant range accessible from the compute stage.
- Parameters
-
| size | Size in bytes of the push constant block |
◆ addStorageBuffer()
| void VulkanComputePipeline::addStorageBuffer |
( |
uint04 | binding | ) |
|
Declare an SSBO binding in the descriptor set layout.
- Parameters
-
| binding | The binding index in the shader (layout(binding = N)) |
◆ bindBuffer()
| void VulkanComputePipeline::bindBuffer |
( |
uint04 | binding, |
|
|
VkBuffer | vk_buffer, |
|
|
VkDeviceSize | size ) |
Update a descriptor set binding to point to the given buffer.
- Parameters
-
| binding | The SSBO binding index |
| vk_buffer | The VkBuffer to bind |
| size | Size in bytes of the buffer region |
◆ create()
| void VulkanComputePipeline::create |
( |
const VulkanShader & | shader | ) |
|
Create the descriptor set layout, pipeline layout, descriptor pool, descriptor set, and compute pipeline from the given SPIR-V shader module.
- Parameters
-
| shader | A VulkanShader loaded with a compute shader SPIR-V module |
◆ dispatch()
| void VulkanComputePipeline::dispatch |
( |
VkCommandBuffer | cmd, |
|
|
uint04 | gx, |
|
|
uint04 | gy, |
|
|
uint04 | gz ) const |
Record a pipeline bind + dispatch into a command buffer.
- Parameters
-
| cmd | The command buffer |
| gx | Number of workgroups in X |
| gy | Number of workgroups in Y |
| gz | Number of workgroups in Z |
◆ pushConstants()
| void VulkanComputePipeline::pushConstants |
( |
VkCommandBuffer | cmd, |
|
|
const void * | data, |
|
|
uint04 | size ) const |
Record push constants into a command buffer.
- Parameters
-
| cmd | The command buffer |
| data | Pointer to the push constant data |
| size | Size in bytes (must match addPushConstantRange) |
The documentation for this class was generated from the following file: