Skip to content

GpuWorkgroupArray

1 min read

Import: import system.gpu;

This reference lists the public declarations for this part of the library. See Reading API signatures for parameter and result notation. Shader-only declarations can be used only inside @compute, @vertex, @fragment, inferred helpers and ray tracing shader functions; using them elsewhere is a compile error.

GpuWorkgroupArray

Fast memory shared by the threads of one compute workgroup, created with workgroup_array<T>(length). Threads exchange values through it; call workgroup_barrier() between writing and reading another thread's elements.

public struct GpuWorkgroupArray<T>

length

The number of elements.

public extern fun length(): int

this

Reads element index.

public extern fun this[index: int]: T

this

Writes element index.

public extern fun this[index: int] = value: T