nCine::RHI::GXM::GxmVertexFormat class

Vertex layout description of the sceGxm backend (aliased as RHI::VertexFormat).

Records the set of vertex attributes (component count, type, stride, offset and source buffer) the way the OpenGL backend does, so the pipeline's attribute setup code compiles unchanged. The backend translates the recorded layout into the SceGxmVertexAttribute / SceGxmVertexStream arrays that a patched SceGxmVertexProgram is created from (see GxmShaderProgram::GetVertexProgram()).

Public types

class Attribute
A single vertex attribute within a vertex format.

Public static variables

static std::uint32_t MaxAttributes constexpr
The maximum number of vertex attributes.

Constructors, destructors, conversion operators

GxmVertexFormat()

Public functions

auto GetAttributeCount() const -> std::uint32_t
auto GetIbo() const -> const GxmBufferObject*
void SetIbo(const GxmBufferObject* ibo)
void Define()
Applies the vertex format (no-op; the recorded layout is consumed at input-layout creation).
void Reset()
Disables all attributes and clears the index buffer.
auto CalculateFingerprint() const -> std::uint64_t
Returns a value identifying this layout, used as the key of the patched-vertex-program cache.
auto operator[](std::uint32_t index) -> Attribute&
auto operator[](std::uint32_t index) const -> const Attribute&
auto operator==(const GxmVertexFormat& other) const -> bool
auto operator!=(const GxmVertexFormat& other) const -> bool

Function documentation

std::uint64_t nCine::RHI::GXM::GxmVertexFormat::CalculateFingerprint() const

Returns a value identifying this layout, used as the key of the patched-vertex-program cache.

A patched SceGxmVertexProgram bakes the layout in, so it may only be reused for an identical one. The digest covers everything that ends up in the SceGxmVertexAttribute / SceGxmVertexStream arrays - which attribute slots are enabled, and each one's component count, component type, normalization, within-vertex offset and stream stride. The source buffer and its base offset are deliberately left out: they are passed to the draw call as an address, not compiled into the program, so two draws out of different ring-buffer regions share one patched program.