mirror of
https://github.com/storytold/wgpu.git
synced 2026-11-19 05:51:03 +01:00
style: reformat hello_workgroups' README with prettier (#10071)
This commit is contained in:
1 parent
38f03fdf5c
commit
5a3b2230ae
1 file changed
+5
-4
@@ -31,10 +31,11 @@ cargo run --bin wgpu-examples hello_workgroups
|
||||
### Introduction
|
||||
|
||||
When you call `ComputePass::dispatch_workgroups`, the function dispatches multiple workgroups in a 3d grid defined by the `x`, `y`, and `z` parameters you pass to the function. For example, `dispatch_workgroups(5, 2, 1)` would create a dispatch grid like
|
||||
||||||
|
||||
|---|---|---|---|---|
|
||||
| W | W | W | W | W |
|
||||
| W | W | W | W | W |
|
||||
|
||||
| | | | | |
|
||||
| --- | --- | --- | --- | --- |
|
||||
| W | W | W | W | W |
|
||||
| W | W | W | W | W |
|
||||
|
||||
Where each W is a workgroup. If you want your shader to consider what workgroup within the dispatch the current invocation is in, add a function argument with type `vec3<u32>` and with the attribute `@builtin(workgroup_id)`.
|
||||
|
||||
|
||||
Reference in new issue
Block a user