Gx2VertexFormat class
Vertex layout description of the GX2 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. On GX2 a layout becomes a fetch shader (GX2InitFetchShaderEx() over GX2AttribStreams), which the program builds from this description on first use and caches by fingerprint (Gx2ShaderProgram::GetFetchShader()).
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
Public functions
-
auto GetAttributeCount() const -> std::
uint32_t - auto GetIbo() const -> const Gx2BufferObject*
- void SetIbo(const Gx2BufferObject* 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 by
RenderVaoPoolto reuse a vertex array. -
auto operator[](std::
uint32_t index) -> Attribute& -
auto operator[](std::
uint32_t index) const -> const Attribute& - auto operator==(const Gx2VertexFormat& other) const -> bool
- auto operator!=(const Gx2VertexFormat& other) const -> bool
Function documentation
std:: uint64_t nCine:: RHI:: GX2:: Gx2VertexFormat:: CalculateFingerprint() const
Returns a value identifying this layout, used by RenderVaoPool to reuse a vertex array.
The fetch shader cache will key on this too, and the shared RenderVaoPool keys on this digest across every backend, so it is provided with the same meaning it has elsewhere: 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, so two draws out of different ring-buffer regions match.