MayaFlux 0.1.0
Digital-First Multimedia Processing Framework
Loading...
Searching...
No Matches

◆ dispatch()

void MayaFlux::Core::VKComputePipeline::dispatch ( vk::CommandBuffer  cmd,
uint32_t  group_count_x,
uint32_t  group_count_y,
uint32_t  group_count_z 
) const

Dispatch compute workgroups.

Parameters
cmdCommand buffer
group_count_xNumber of workgroups in X dimension
group_count_yNumber of workgroups in Y dimension
group_count_zNumber of workgroups in Z dimension

Executes the compute shader with the specified number of workgroups. Total invocations = group_count * local_size (from shader).

Example: // Shader: layout(local_size_x = 256) in; // Process 1M elements: 1,000,000 / 256 = 3,907 workgroups pipeline.dispatch(cmd, 3907, 1, 1);

Must be called after bind() and bind_descriptor_sets().

Definition at line 261 of file VKComputePipeline.cpp.

266{
267 if (!m_pipeline) {
269 "Cannot dispatch invalid compute pipeline");
270 return;
271 }
272
273 if (group_count_x == 0 || group_count_y == 0 || group_count_z == 0) {
275 "Dispatching with zero workgroups ({}x{}x{})",
276 group_count_x, group_count_y, group_count_z);
277 return;
278 }
279
280 cmd.dispatch(group_count_x, group_count_y, group_count_z);
281}
#define MF_ERROR(comp, ctx,...)
#define MF_WARN(comp, ctx,...)
@ GraphicsBackend
Graphics/visual rendering backend (Vulkan, OpenGL)
@ Core
Core engine, backend, subsystems.

References MayaFlux::Journal::Core, MayaFlux::Journal::GraphicsBackend, m_pipeline, MF_ERROR, and MF_WARN.

Referenced by dispatch_1d(), dispatch_2d(), and dispatch_3d().

+ Here is the caller graph for this function: