Compute shader dispatch API

namespace d3d

Functions

bool dispatch(uint32_t thread_group_x, uint32_t thread_group_y, uint32_t thread_group_z, GpuPipeline gpu_pipeline = GpuPipeline::GRAPHICS)

Dispatches a compute shader with the specified thread group dimensions.

Warning

gpu_pipeline argument doesn’t work currently.

Parameters:
  • thread_group_x – The number of thread groups in the X dimension.

  • thread_group_y – The number of thread groups in the Y dimension.

  • thread_group_z – The number of thread groups in the Z dimension.

  • gpu_pipeline – The GPU pipeline to use for dispatching (default: GpuPipeline::GRAPHICS).

Returns:

True if the dispatch was successful, false otherwise.

bool dispatch_indirect(Sbuffer *args, uint32_t byte_offset = 0, GpuPipeline gpu_pipeline = GpuPipeline::GRAPHICS)

Dispatches a compute shader indirectly using the specified argument buffer.

Warning

gpu_pipeline argument doesn’t work currently.

Parameters:
  • args – The argument buffer containing the dispatch parameters. The buffer must be created with the d3d::buffers::create_indirect or d3d::buffers::create_ua_indirect methods and Indirect::Dispatch argument. The buffer should contain the following data: uint32_t thread_group_x, uint32_t thread_group_y, uint32_t thread_group_z.

  • byte_offset – The byte offset within the argument buffer (default: 0).

  • gpu_pipeline – The GPU pipeline to use for dispatching (default: GpuPipeline::GRAPHICS).

Returns:

True if the dispatch was successful, false otherwise.