mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-30 01:29:42 -06:00
PortableVertexFormat: add a struct which hold all needed information for every vertex and use this for position
atm, position attribute is hardcoded both in VertexLoader and in backends. v2: fix coding style + cleanup lookup table
This commit is contained in:
@ -72,10 +72,21 @@ enum VarType
|
||||
VAR_FLOAT, // GX_F32 = 4
|
||||
};
|
||||
|
||||
struct AttributeFormat
|
||||
{
|
||||
VarType type;
|
||||
int components;
|
||||
int offset;
|
||||
bool enable;
|
||||
bool integer;
|
||||
};
|
||||
|
||||
struct PortableVertexDeclaration
|
||||
{
|
||||
int stride;
|
||||
|
||||
AttributeFormat position;
|
||||
|
||||
int num_normals;
|
||||
int normal_offset[3];
|
||||
VarType normal_gl_type;
|
||||
|
@ -587,6 +587,11 @@ void VertexLoader::CompileVertexTranslator()
|
||||
}
|
||||
m_VertexSize += VertexLoader_Position::GetSize(m_VtxDesc.Position, m_VtxAttr.PosFormat, m_VtxAttr.PosElements);
|
||||
nat_offset += 12;
|
||||
vtx_decl.position.components = 3;
|
||||
vtx_decl.position.enable = true;
|
||||
vtx_decl.position.offset = 0;
|
||||
vtx_decl.position.type = VAR_FLOAT;
|
||||
vtx_decl.position.integer = false;
|
||||
|
||||
// Normals
|
||||
vtx_decl.num_normals = 0;
|
||||
|
Reference in New Issue
Block a user