Class: GeometryVertexBuffer
Defined in: src/core/geometry/GeometryVertexBuffer.ts:15
Holds the vertex attribute data of a geometry and manages its backing GPU vertex buffer and attribute layout.
Constructors
Constructor
new GeometryVertexBuffer():
GeometryVertexBuffer
Defined in: src/core/geometry/GeometryVertexBuffer.ts:81
Returns
GeometryVertexBuffer
Properties
vertexCount
vertexCount:
number=0
Defined in: src/core/geometry/GeometryVertexBuffer.ts:17
vertexGPUBuffer
vertexGPUBuffer:
VertexGPUBuffer
Defined in: src/core/geometry/GeometryVertexBuffer.ts:18
geometryType
geometryType:
GeometryVertexType=GeometryVertexType.split
Defined in: src/core/geometry/GeometryVertexBuffer.ts:19
bufferChanged
bufferChanged:
boolean=false
Defined in: src/core/geometry/GeometryVertexBuffer.ts:28
Set to true whenever vertexGPUBuffer is replaced by a fresh allocation (first build or a packing-size change). Consumers that captured the GPU buffer handle — e.g. compute pipelines writing deformed/generated vertices — must observe this flag and rebind, otherwise they keep writing into an orphaned buffer while the renderer draws the new one. The owner resets it after handling.
positionVersion
positionVersion:
number=0
Defined in: src/core/geometry/GeometryVertexBuffer.ts:401
Bumped whenever position data is re-uploaded (position, or the packed all buffer), so CPU-side consumers such as MeshBVH can tell that the vertices moved. See GeometryBase.version.
Accessors
composeBinLayout
Get Signature
get composeBinLayout():
VertexAttribute[]
Defined in: src/core/geometry/GeometryVertexBuffer.ts:77
The interleave layout recorded by setComposeBinLayout, or null.
Returns
vertexBufferLayouts
Get Signature
get vertexBufferLayouts():
VertexBufferLayout[]
Defined in: src/core/geometry/GeometryVertexBuffer.ts:87
Returns
Methods
setComposeBinLayout()
setComposeBinLayout(
layout):void
Defined in: src/core/geometry/GeometryVertexBuffer.ts:69
Record the real interleave layout of a compose_bin geometry's packed vertex buffer (attribute name → byte offset within the stride), so each pass's VertexState can be derived independently of how many attributes that pass's shader declares.
Parameters
layout
Returns
void
getPipelineLayout()
getPipelineLayout(
shaderReflection):VertexBufferLayout[]
Defined in: src/core/geometry/GeometryVertexBuffer.ts:102
Vertex buffer layout for a specific pass's pipeline VertexState. For compose geometry this is derived per-pass from the pass's shader reflection: each attribute the pass declares is mapped to its own shaderLocation but the canonical (by-name) byte offset and the shared canonical arrayStride, so a pass simply strides over the attributes it does not read. For split / compose_bin it falls back to the shared layout (their per-pass decoupling is not done yet). Consumed by RenderShaderPass.createPipeline; draw-time binding still uses vertexBufferLayouts.
Parameters
shaderReflection
ShaderReflection
Returns
needsRebuild()
needsRebuild(
shaderReflection):boolean
Defined in: src/core/geometry/GeometryVertexBuffer.ts:168
Whether createVertexBuffer must run for this pass's reflection (on top of the geometry's own _onChange). For compose this is true only when the reflection introduces an attribute not yet in the canonical packing — after the union converges, repeated passes short-circuit so a compute-written buffer is not re-uploaded with rest-pose data. For split / compose_bin it preserves the legacy "a declared shader slot is missing from the layout" check.
Parameters
shaderReflection
ShaderReflection
Returns
boolean
createVertexBuffer()
createVertexBuffer(
vertexDataInfos,shaderReflection):void
Defined in: src/core/geometry/GeometryVertexBuffer.ts:190
Parameters
vertexDataInfos
Map<string, VertexAttributeData>
shaderReflection
ShaderReflection
Returns
void
upload()
upload(
attribute,vertexDataInfo):void
Defined in: src/core/geometry/GeometryVertexBuffer.ts:403
Parameters
attribute
string
vertexDataInfo
Returns
void
updateAttributes()
updateAttributes(
vertexDataInfos):void
Defined in: src/core/geometry/GeometryVertexBuffer.ts:433
Parameters
vertexDataInfos
Map<string, VertexAttributeData>
Returns
void
compute()
compute():
void
Defined in: src/core/geometry/GeometryVertexBuffer.ts:472
Returns
void
destroy()
destroy():
void
Defined in: src/core/geometry/GeometryVertexBuffer.ts:476
Returns
void

