Vixen
dd8b0a81
csharp
public readonly record struct WorkgroupSize

The number of invocations in one compute workgroup, from [ComputeShader(x, y, z)].

Read the guide page for this →

Remarks

Declared rather than defaulted. A compute dispatch is a count of workgroups, so the size is what turns that count into a number of invocations — a shader written for 64 and dispatched as if it were 1 reads out of bounds, and nothing downstream could detect it. Both targets require it: GLSL as layout(local_size_x = …) in;, SPIR-V as the LocalSize execution mode.

Three dimensions always, with the ones not written set to 1, so every consumer sees the same shape and nothing has to decide what an absent dimension means.

Fields and properties (6)

  • public int X

    Invocations along x.

  • public int Y

    Invocations along y.

  • public int Z

    Invocations along z.

  • public static WorkgroupSize Invalid

    A size that was written but could not be read — a non-literal, a non-positive value, or more than three dimensions.

  • public bool IsInvalid

    True when this is Invalid.

  • public int Total

    Total invocations per workgroup.

Methods (2)

  • public WorkgroupSize(int X, int Y, int Z)

    The number of invocations in one compute workgroup, from [ComputeShader(x, y, z)].

  • public override string ToString()

Used by (10)

  • ComputeTestsVixen.Raven.Tests
  • DeclarationFactsVixen.Raven
  • GlslEmitterVixen.Raven
  • IrEntryPointVixen.Raven
  • IrVerifierVixen.Raven
  • LibraryReflectionTestsVixen.Raven.Tests
  • MethodSymbolVixen.Raven
  • SourceMethodSymbolVixen.Raven
  • SourceNamedTypeSymbolVixen.Raven
  • SpirvEmitterVixen.Raven