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

◆ dispatch_2d()

void MayaFlux::Core::VKComputePipeline::dispatch_2d ( vk::CommandBuffer  cmd,
uint32_t  width_elements,
uint32_t  height_elements,
uint32_t  local_size_x,
uint32_t  local_size_y 
) const

Dispatch compute workgroups in 2D with automatic calculation.

Parameters
cmdCommand buffer
width_elementsWidth in elements
height_elementsHeight in elements
local_size_xWorkgroup width (shader local_size_x)
local_size_yWorkgroup height (shader local_size_y)

Convenience for 2D operations (image processing, etc.)

Example: // Process 1920x1080 image with 16x16 workgroups pipeline.dispatch_2d(cmd, 1920, 1080, 16, 16);

Definition at line 298 of file VKComputePipeline.cpp.

304{
305 if (local_size_x == 0 || local_size_y == 0) {
307 "Invalid workgroup size: {}x{}", local_size_x, local_size_y);
308 return;
309 }
310
311 uint32_t workgroups_x = calculate_workgroups(width_elements, local_size_x);
312 uint32_t workgroups_y = calculate_workgroups(height_elements, local_size_y);
313 dispatch(cmd, workgroups_x, workgroups_y, 1);
314}
#define MF_ERROR(comp, ctx,...)
static uint32_t calculate_workgroups(uint32_t element_count, uint32_t workgroup_size)
Calculate number of workgroups needed.
void dispatch(vk::CommandBuffer cmd, uint32_t group_count_x, uint32_t group_count_y, uint32_t group_count_z) const
Dispatch compute workgroups.
@ GraphicsBackend
Graphics/visual rendering backend (Vulkan, OpenGL)
@ Core
Core engine, backend, subsystems.

References calculate_workgroups(), MayaFlux::Journal::Core, dispatch(), MayaFlux::Journal::GraphicsBackend, and MF_ERROR.

+ Here is the call graph for this function: