pub struct IndirectStorageBufferAttribute {
pub item_size: usize,
/* private fields */
}Expand description
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, 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.
Fields§
§item_size: usizeBufferAttribute.itemSize.