Abstract Class: VertexArray
Defined in: modules/core/src/adapter/resources/vertex-array.ts:28
Stores attribute bindings. Makes it easy to share a render pipeline and use separate vertex arrays.
Note
Backend-specific attribute accessor metadata is no longer stored in the shared base class. WebGL derives and caches that information in its own implementation, while WebGPU only tracks the logical buffer bindings it needs to rebind at draw time.
Extends
Constructors
Constructor
new VertexArray(
device,props):VertexArray
Defined in: modules/core/src/adapter/resources/vertex-array.ts:52
Creates a backend-agnostic vertex-array container.
Parameters
device
The device that owns the vertex array.
props
Vertex-array initialization properties.
Returns
VertexArray
Overrides
Properties
attributes
attributes: (
Buffer|TypedArray|null)[]
Defined in: modules/core/src/adapter/resources/vertex-array.ts:45
Buffers or constants indexed by backend-defined buffer slot or attribute location.
destroyed
destroyed:
boolean=false
Defined in: modules/core/src/adapter/resources/resource.ts:131
Whether this resource has been destroyed
Inherited from
device
abstractreadonlydevice:Device
Defined in: modules/core/src/adapter/resources/resource.ts:124
The device that this resource is associated with
Inherited from
handle
abstractreadonlyhandle:unknown
Defined in: modules/core/src/adapter/resources/resource.ts:126
The handle for the underlying resource, e.g. WebGL object or WebGPU handle
Inherited from
id
id:
string
Defined in: modules/core/src/adapter/resources/resource.ts:118
props.id, for debugging.
Inherited from
indexBuffer
indexBuffer:
Buffer|null=null
Defined in: modules/core/src/adapter/resources/vertex-array.ts:43
Index buffer
maxVertexAttributes
readonlymaxVertexAttributes:number
Defined in: modules/core/src/adapter/resources/vertex-array.ts:40
Max number of vertex attributes
props
readonlyprops:Required<Props>
Defined in: modules/core/src/adapter/resources/resource.ts:120
The props that this resource was created with
Inherited from
userData
readonlyuserData:Record<string,unknown> ={}
Defined in: modules/core/src/adapter/resources/resource.ts:122
User data object, reserved for the application
Inherited from
defaultProps
staticdefaultProps:Required<VertexArrayProps>
Defined in: modules/core/src/adapter/resources/vertex-array.ts:29
Default properties for resource
Overrides
Accessors
[toStringTag]
Get Signature
get [toStringTag]():
string
Defined in: modules/core/src/adapter/resources/vertex-array.ts:35
Returns
string
Overrides
isHandleBorrowed
Get Signature
get isHandleBorrowed():
boolean
Defined in: modules/core/src/adapter/resources/resource.ts:147
Whether luma.gl may only reference the opaque externally owned resource handle.
Returns
boolean
Inherited from
ownsHandle
Get Signature
get ownsHandle():
boolean
Defined in: modules/core/src/adapter/resources/resource.ts:140
Whether luma.gl created and owns the underlying resource handle.
Returns
boolean
Inherited from
Methods
attachResource()
attachResource(
resource):void
Defined in: modules/core/src/adapter/resources/resource.ts:200
Attaches a resource. Attached resources are auto destroyed when this resource is destroyed Called automatically when sub resources are auto created but can be called by application
Parameters
resource
Returns
void
Inherited from
bindBeforeRender()
abstractbindBeforeRender(renderPass):void
Defined in: modules/core/src/adapter/resources/vertex-array.ts:64
Applies any backend-specific bindings required before a draw call.
Parameters
renderPass
Returns
void
delete()
delete():
this
Defined in: modules/core/src/adapter/resources/resource.ts:181
Returns
this
Deprecated
Use destroy()
Inherited from
destroy()
destroy():
void
Defined in: modules/core/src/adapter/resources/resource.ts:173
destroy can be called on any resource to release it before it is garbage collected.
Returns
void
Inherited from
destroyAttachedResource()
destroyAttachedResource(
resource):void
Defined in: modules/core/src/adapter/resources/resource.ts:214
Destroys a resource (only if owned), and removes from the owned (auto-destroy) list for this resource.
Parameters
resource
Returns
void
Inherited from
Resource.destroyAttachedResource
destroyAttachedResources()
destroyAttachedResources():
void
Defined in: modules/core/src/adapter/resources/resource.ts:221
Destroy all owned resources. Make sure the resources are no longer needed before calling.
Returns
void
Inherited from
Resource.destroyAttachedResources
detachResource()
detachResource(
resource):void
Defined in: modules/core/src/adapter/resources/resource.ts:207
Detach an attached resource. The resource will no longer be auto-destroyed when this resource is destroyed.
Parameters
resource
Returns
void
Inherited from
getBufferSlot()
getBufferSlot(
bufferName):number|null
Defined in: modules/core/src/adapter/resources/vertex-array.ts:69
Returns the backend-defined slot for a logical buffer name, if known.
Parameters
bufferName
string
Returns
number | null
getDrawValidationError()
getDrawValidationError():
string|null
Defined in: modules/core/src/adapter/resources/vertex-array.ts:74
Returns a draw-blocking validation error, or null if this vertex array can be drawn.
Returns
string | null
getProps()
getProps():
object
Defined in: modules/core/src/adapter/resources/resource.ts:190
Combines a map of user props and default props, only including props from defaultProps
Returns
object
returns a map of overridden default props
Inherited from
setBuffer()
abstractsetBuffer(bufferSlot,buffer):void
Defined in: modules/core/src/adapter/resources/vertex-array.ts:61
Sets one backend-defined buffer slot or attribute location.
Parameters
bufferSlot
number
buffer
Buffer | null
Returns
void
setConstantWebGL()
setConstantWebGL(
location,value):void
Defined in: modules/core/src/adapter/resources/vertex-array.ts:81
Parameters
location
number
value
TypedArray | null
Returns
void
Deprecated
Set constant attributes (WebGL only)
setIndexBuffer()
abstractsetIndexBuffer(indices):void
Defined in: modules/core/src/adapter/resources/vertex-array.ts:59
Sets the index buffer used for indexed rendering.
Parameters
indices
Buffer | null
Returns
void
toJSON()
toJSON():
string
Defined in: modules/core/src/adapter/resources/resource.ts:113
Compact serialization for assertion diffs and structured debug logs.
Returns
string
Inherited from
toString()
toString():
string
Defined in: modules/core/src/adapter/resources/resource.ts:108
Returns
string
Inherited from
unbindAfterRender()
abstractunbindAfterRender(renderPass):void
Defined in: modules/core/src/adapter/resources/vertex-array.ts:66
Clears any backend-specific bindings after a draw call.
Parameters
renderPass
Returns
void