simvx.graphics.renderer.mesh_registry¶
Mesh registry: manages uploaded GPU mesh buffers and returns handles.
One GPU buffer per vertex stream (vertex stream split, D5): positions,
normal+uv shading, optional extras (tangent/colour/uv2), optional skin
(joints/weights), plus the index buffer. See vertex_layouts.py for the
matching pipeline binding layouts.
Module Contents¶
Classes¶
The GPU buffers of one registered mesh, per vertex stream. |
|
Upload meshes to GPU, return handles for efficient referencing. |
Data¶
API¶
- simvx.graphics.renderer.mesh_registry.log¶
‘getLogger(…)’
- simvx.graphics.renderer.mesh_registry.__all__¶
[‘MeshBuffers’, ‘MeshRegistry’]
- class simvx.graphics.renderer.mesh_registry.MeshBuffers[source]¶
Bases:
typing.NamedTupleThe GPU buffers of one registered mesh, per vertex stream.
extras/skinareNonewhen the mesh has no such stream. Fields order-match the Vulkan binding numbers (0..3) plus the index buffer.- position: Any¶
None
- shading: Any¶
None
- extras: Any | None¶
None
- skin: Any | None¶
None
- index: Any¶
None
- class simvx.graphics.renderer.mesh_registry.MeshRegistry(device: Any, physical_device: Any, *, retain_geometry: bool = False)[source]¶
Upload meshes to GPU, return handles for efficient referencing.
Initialization
- register(streams: simvx.graphics.types.VertexStreams, indices: numpy.ndarray) simvx.graphics.types.MeshHandle[source]¶
Upload the mesh’s vertex streams + indices to GPU, return a handle.
- get_buffers(handle: simvx.graphics.types.MeshHandle) simvx.graphics.renderer.mesh_registry.MeshBuffers[source]¶
Get the per-stream :class:
MeshBuffersfor a mesh handle.
- get_geometry(mesh_id: int) tuple[simvx.graphics.types.VertexStreams, numpy.ndarray] | None[source]¶
Return the retained source
(streams, indices)for a mesh id, orNone.Only populated when the registry was created with
retain_geometry=True(the D8 multi-GPU path).Noneon the default single-GPU path (nothing is retained) and for any mesh id never registered. The arrays are the same device-independent CPU data the primary uploaded; the offload coordinator re-uploads them into a secondary device’s ownMeshRegistryto make the offloaded SRU’s geometry resident there (aVkBuffercannot cross devices).