1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
//! `IndirectStorageBufferAttribute` — `src/renderers/common/IndirectStorageBufferAttribute.js`.
use Rc;
use crateBufferId;
/// `new IndirectStorageBufferAttribute( new Uint32Array( n ), itemSize )`: a
/// `Uint32Array` that lives on the GPU as one buffer usable both as storage
/// (a compute kernel writes it through `storage( attribute, struct, count )`)
/// and as the argument buffer of `drawIndirect` / `drawIndexedIndirect` /
/// `dispatchWorkgroupsIndirect`.
///
/// A handle: clones are the same attribute, and the renderer keys the one GPU
/// buffer on [`id`](Self::id), which is also the id every storage node built
/// over it carries — so a kernel writing it and a draw reading it meet on the
/// same buffer, as they do in three through `backend.get( attribute )`.
///
/// The array is the buffer's initial contents only. It is uploaded once, when
/// the GPU buffer is first made; three.js never reads it back either, and a
/// kernel's writes are visible through `Renderer::read_indirect_buffer`.