dispatch method

void dispatch(
  1. KernelInputs inputs,
  2. int x, [
  3. int y = 1,
  4. int z = 1,
])

Runs a dispatch of x × y × z workgroups over inputs.

Implementation

void dispatch(KernelInputs inputs, int x, [int y = 1, int z = 1]) {
  final resources = _resources(inputs);
  for (var gz = 0; gz < z; gz++) {
    for (var gy = 0; gy < y; gy++) {
      for (var gx = 0; gx < x; gx++) {
        _compiled.runWorkgroup(gx, gy, gz, resources);
      }
    }
  }
}