picogl.gpu.buffers.attributes

Attribute and layout specification handling module.

This module defines data structures for specifying attributes and layout descriptors in a graphical or geometrical context. These structures are used to describe how data is stored, accessed, and organized for rendering or processing purposes.

Classes

AttributeSpec

Attribute specification.

LayoutDescriptor

Layout descriptor.

CanonicalVertexAttrs

Canonical Vertex Attrs

VBOAttrs

VBO Attrs

Functions

legacy_attribute_spec(→ AttributeSpec)

Build an AttributeSpec with aligned legacy role, vbo_type, and name.

Module Contents

class picogl.gpu.buffers.attributes.AttributeSpec[source]

Attribute specification.

name: str[source]
index: int[source]
size: int[source]
type: picogl.backend.gl.enums.GLNumeric[source]
normalized: bool[source]
stride: int[source]
offset: int[source]
vbo_type: picogl.gpu.buffers.vertex.vbo.vbo_class.VBOType[source]
role: picogl.gpu.buffers.vertex.aliases.VertexBufferRole[source]
picogl.gpu.buffers.attributes.legacy_attribute_spec(role: picogl.gpu.buffers.vertex.aliases.VertexBufferRole, index: int, *, size: int = 3, name: str | picogl.gpu.buffers.vertex.aliases.VertexBufferRole | None = None, type: picogl.backend.gl.enums.GLNumeric, normalized: bool = False, stride: int = 0, offset: int = 0) AttributeSpec[source]

Build an AttributeSpec with aligned legacy role, vbo_type, and name.

class picogl.gpu.buffers.attributes.LayoutDescriptor[source]

Layout descriptor.

attributes: List[AttributeSpec][source]
_cache: dict[picogl.gpu.buffers.vertex.vbo.vbo_class.VBOType, AttributeSpec] | None = None[source]
__getitem__(vbo_type: picogl.gpu.buffers.vertex.vbo.vbo_class.VBOType) AttributeSpec[source]
get_attr(vbo_type: picogl.gpu.buffers.vertex.vbo.vbo_class.VBOType) AttributeSpec[source]
has_attr(vbo_type: picogl.gpu.buffers.vertex.vbo.vbo_class.VBOType) bool[source]
as_dict() dict[picogl.gpu.buffers.vertex.vbo.vbo_class.VBOType, AttributeSpec][source]
property attr_dict: dict[picogl.gpu.buffers.vertex.vbo.vbo_class.VBOType, AttributeSpec][source]

dict

class picogl.gpu.buffers.attributes.CanonicalVertexAttrs[source]

Bases: picogl.utils.strenum.StrEnum

Canonical Vertex Attrs

POSITIONS = 'positions'[source]
COLORS = 'colors'[source]
NORMALS = 'normals'[source]
INDICES = 'indices'[source]
class picogl.gpu.buffers.attributes.VBOAttrs[source]

VBO Attrs

VBO[source]
NBO[source]
CBO[source]
EBO[source]
ALL[source]