Mesh shader dispatch API

namespace d3d

Functions

void dispatch_mesh(uint32_t thread_group_x, uint32_t thread_group_y, uint32_t thread_group_z)

Dispatches a mesh shader with the specified thread group dimensions.

Max value for each direction is 64k, product of all dimensions can not exceed 2^22

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

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

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

void dispatch_mesh_indirect(Sbuffer *args, uint32_t dispatch_count, uint32_t stride_bytes, uint32_t byte_offset = 0)

Dispatches a mesh shader indirectly using the provided arguments.

Parameters:
  • args – The buffer containing the dispatch arguments. Buffer should contain structures of the following layout: struct DispatchArgs { uint32_t thread_group_x; uint32_t thread_group_y; uint32_t thread_group_z; };

  • dispatch_count – The number of dispatches to execute.

  • stride_bytes – The stride between dispatch arguments in bytes.

  • byte_offset – The byte offset into the buffer where the dispatch arguments start (default = 0).

void dispatch_mesh_indirect_count(Sbuffer *args, uint32_t args_stride_bytes, uint32_t args_byte_offset, Sbuffer *count, uint32_t count_byte_offset, uint32_t max_count)

Dispatches a mesh shader indirectly using the provided arguments and a count buffer.

Variant of dispatch_mesh_indirect where ‘dispatch_count’ is read by the GPU from ‘count’ buffer at ‘count_offset’ (as uint32_t), this value can not exceed ‘max_count’.

Parameters:
  • args – The buffer containing the dispatch arguments.

  • args_stride_bytes – The stride between dispatch arguments in bytes.

  • args_byte_offset – The byte offset into the buffer where the dispatch arguments start.

  • count – The buffer containing the dispatch count.

  • count_byte_offset – The byte offset into the count buffer where the dispatch count starts.

  • max_count – The maximum value that the dispatch count can have.