Advanced
Create a new Buffer Resource.
The options for the buffer resource
The underlying buffer that this resource is using
Optional
offset?: numberThe offset of the buffer this resource is using. If not provided, then it will use the offset of the buffer.
Optional
size?: numberThe size of the buffer this resource is using. If not provided, then it will use the size of the buffer.
the underlying buffer that this resource is using
Readonly
destroyedHas the Buffer resource been destroyed?
Readonly
offsetthe offset of the buffer this resource is using. If not provided, then it will use the offset of the buffer.
Readonly
sizethe size of the buffer this resource is using. If not provided, then it will use the size of the buffer.
Readonly
uida unique id for this uniform group used through the renderer
A resource that can be bound to a bind group and used in a shader. Whilst a buffer can be used as a resource, this class allows you to specify an offset and size of the buffer to use. This is useful if you have a large buffer and only part of it is used in a shader.
This resource, will listen for changes on the underlying buffer and emit a itself if the buffer changes shape.
Example