What it does
ComputeBufferReadAsync takes bufferID (an integer), and answers an integer. That is the first of 2 forms. bufferID is the id of a Buffer object, obtained elsewhere in the Compute family.
Syntax
1
ComputeBufferReadAsync(bufferID integer) → integer2
ComputeBufferReadAsync(bufferID integer, memblockID integer) → integerParameters
| Name | Type | In forms |
|---|---|---|
| bufferID | integer | all |
| memblockID | integer | 2 |
Every form returns
integer
Example · generated
Form 1, the short one
buffer = CreateComputeBuffer(10, "value")DO Print(ComputeBufferReadAsync(buffer)) Sync()LOOPForm 2, with every argument
buffer = CreateComputeBuffer(10, "value")DO Print(ComputeBufferReadAsync(buffer, 1)) Sync()LOOPCreateComputeBuffer is there to give the call something to act on; ComputeBufferReadAsync is the line that matters. The DO … LOOP is not decoration: a classic BASIC program ends the moment it runs out of lines, and Sync() is what draws the frame.