Skip to content

Commit 2ddae10

Browse files
authored
book: add section for workgroup memory (#713)
1 parent 12c09cb commit 2ddae10

File tree

2 files changed

+12
-1
lines changed

2 files changed

+12
-1
lines changed

docs/src/attributes.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,3 +89,14 @@ Example:
8989
#[spirv(vertex)]
9090
fn main(#[spirv(invariant)] var: &mut f32) { }
9191
```
92+
93+
## Workgroup shared memory
94+
95+
The `workgroup` attribute defines shared memory, which can be accessed by all invocations within the same workgroup. This corresponds to `groupshared` memory in hlsl or `shared` memory in glsl.
96+
97+
Example:
98+
99+
```rust
100+
#[spirv(compute(threads(32)))]
101+
fn main(#[spirv(workgroup)] var: &mut [Vec4; 4]) { }
102+
```

tests/ui/glam/mat3_vec3_multiply.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Tests muiltplying a `Mat3` by a `Vec3`.
1+
// Tests multiplying a `Mat3` by a `Vec3`.
22
// build-pass
33

44
use spirv_std as _;

0 commit comments

Comments
 (0)