Axmol 3.0.0-89d6d9a
Loading...
Searching...
No Matches
VertexInputBinding Class Reference

Defines a binding between the vertex layout of a Mesh and the vertex input attributes of a vertex shader (Effect). More...

#include <VertexInputBinding.h>

Inherits Object.

Public Member Functions

uint32_t getVertexAttribsFlags () const
 Binds this vertex array object.
Public Member Functions inherited from Object
void retain ()
 Retains the ownership.
void release ()
 Releases the ownership immediately.
Object * autorelease ()
 Releases the ownership sometime soon automatically.
unsigned int getReferenceCount () const
 Returns the Object's current reference count.
uint64_t getObjectID () const noexcept
 Returns the process-local diagnostic identifier assigned at construction.
virtual ~Object ()
 Destructor.

Static Public Member Functions

static VertexInputBinding * fetch (MeshIndexData *meshIndexData, Pass *pass, MeshCommand *, bool instancing)
 Gets a cached VertexInputBinding.

Detailed Description

Defines a binding between the vertex layout of a Mesh and the vertex input attributes of a vertex shader (Effect).

In a perfect world, this class would always be a binding directly between a unique VertexElementType and an Effect, where the VertexElementType is simply the definition of the layout of any anonymous vertex buffer. However, the OpenGL mechanism for setting up these bindings is Vertex Array Objects (VAOs). OpenGL requires a separate VAO per vertex buffer object (VBO), rather than per vertex layout definition. Therefore, although we would like to define this binding between a VertexElementType and Effect, we are specifying the binding between a Mesh and Effect to satisfy the OpenGL requirement of one VAO per VBO.

Note that this class still does provide a binding between a VertexElementType and an Effect, however this binding is actually a client-side binding and should only be used when writing custom code that use client-side vertex arrays, since it is slower than the server-side VAOs used by OpenGL (when creating a VertexInputBinding between a Mesh and Effect).

Member Function Documentation

◆ fetch()

VertexInputBinding * fetch ( MeshIndexData * meshIndexData,
Pass * pass,
MeshCommand * ,
bool instancing )
static

Gets a cached VertexInputBinding.

If a VertexInputBinding matching the specified MeshVertexData and ProgramState already exists, it will be returned. Otherwise, a new VertexInputBinding will be returned. If OpenGL VAOs are enabled, the a new VAO will be created and stored in the returned VertexInputBinding, otherwise a client-side array of vertex attribute bindings will be stored.

Parameters
meshThe mesh.
effectThe effect.
Returns
A VertexInputBinding for the requested parameters.

◆ getVertexAttribsFlags()

uint32_t getVertexAttribsFlags ( ) const

Binds this vertex array object.

Unbinds this vertex array object. Returns the vertex attrib flags


The documentation for this class was generated from the following file:
  • VertexInputBinding.h