Storage()
new Storage()
Storage is a container for storage buffer related data and actions.
- Source:
- Storage.js, line 3
Members
buffer
For internal use mostly. The actual GPUBuffer with the data.
- Source:
- Storage.js, line 138
bufferRead
Buffer for reading back For internal use mostly. The actual GPUBufferRead with the data.
- Source:
- Storage.js, line 151
mapped
- Source:
- Storage.js, line 85
name
The name that the Storage will have on the WGSL side.
- Source:
- Storage.js, line 70
Example
myStorage.name = 'myStorageName'; // wgsl myStorageName = 13.1;js
readable
If data is read back in JS from WGSL, then set to true.
- Source:
- Storage.js, line 126
shaderStage
Tells WebGPU to which shader it can only be used.
- Source:
- Storage.js, line 113
stream
updated is set to true in data updates, but this is not true in
something like audio, where the data streams and needs to be updated
constantly, so if the storage map needs to be updated constantly then
stream needs to be set to true.
- Source:
- Storage.js, line 182
type
- Source:
- Storage.js, line 99
Example
myStorage.type = 'u32'
updated
Mostly internal. Set to true if a value has been updated.
- Source:
- Storage.js, line 194
value
- Source:
- Storage.js, line 213
Methods
setReadable(value) → Storage
if this is going to be used to read data back set to true
Parameters:
| Name | Type | Description |
|---|---|---|
value
|
bool |
- Source:
- Storage.js, line 246
Returns:
- Type:
- Storage
setShaderStage(value) → Storage
Tells WebGPU to which shader it can only be used.
Parameters:
| Name | Type | Description |
|---|---|---|
value
|
GPUShaderStage |
- Source:
- Storage.js, line 257
Returns:
- Type:
- Storage
setType(value) → Storage
Parameters:
| Name | Type | Description |
|---|---|---|
value
|
String | WGSL data type of the Storage. |
- Source:
- Storage.js, line 269
Returns:
- Type:
- Storage
Example
myStorage.setType('u32');
setValue(value) → Storage
Parameters:
| Name | Type | Description |
|---|---|---|
value
|
|
data to send to the shader |
- Source:
- Storage.js, line 228
Returns:
- Type:
- Storage