mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-21 05:09:34 -06:00
Fix build errors related to formatting non-scoped enums
This commit is contained in:
@ -32,18 +32,18 @@ static inline GLuint VarToGL(ComponentFormat t)
|
||||
return lookup[t];
|
||||
}
|
||||
|
||||
static void SetPointer(u32 attrib, u32 stride, const AttributeFormat& format)
|
||||
static void SetPointer(ShaderAttrib attrib, u32 stride, const AttributeFormat& format)
|
||||
{
|
||||
if (!format.enable)
|
||||
return;
|
||||
|
||||
glEnableVertexAttribArray(attrib);
|
||||
glEnableVertexAttribArray(static_cast<GLuint>(attrib));
|
||||
if (format.integer)
|
||||
glVertexAttribIPointer(attrib, format.components, VarToGL(format.type), stride,
|
||||
(u8*)nullptr + format.offset);
|
||||
glVertexAttribIPointer(static_cast<GLuint>(attrib), format.components, VarToGL(format.type),
|
||||
stride, (u8*)nullptr + format.offset);
|
||||
else
|
||||
glVertexAttribPointer(attrib, format.components, VarToGL(format.type), true, stride,
|
||||
(u8*)nullptr + format.offset);
|
||||
glVertexAttribPointer(static_cast<GLuint>(attrib), format.components, VarToGL(format.type),
|
||||
true, stride, (u8*)nullptr + format.offset);
|
||||
}
|
||||
|
||||
GLVertexFormat::GLVertexFormat(const PortableVertexDeclaration& vtx_decl)
|
||||
@ -65,18 +65,18 @@ GLVertexFormat::GLVertexFormat(const PortableVertexDeclaration& vtx_decl)
|
||||
glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, vm->GetIndexBufferHandle());
|
||||
glBindBuffer(GL_ARRAY_BUFFER, vm->GetVertexBufferHandle());
|
||||
|
||||
SetPointer(SHADER_POSITION_ATTRIB, vertex_stride, vtx_decl.position);
|
||||
SetPointer(ShaderAttrib::Position, vertex_stride, vtx_decl.position);
|
||||
|
||||
for (int i = 0; i < 3; i++)
|
||||
SetPointer(SHADER_NORMAL_ATTRIB + i, vertex_stride, vtx_decl.normals[i]);
|
||||
for (u32 i = 0; i < 3; i++)
|
||||
SetPointer(ShaderAttrib::Normal + i, vertex_stride, vtx_decl.normals[i]);
|
||||
|
||||
for (int i = 0; i < 2; i++)
|
||||
SetPointer(SHADER_COLOR0_ATTRIB + i, vertex_stride, vtx_decl.colors[i]);
|
||||
for (u32 i = 0; i < 2; i++)
|
||||
SetPointer(ShaderAttrib::Color0 + i, vertex_stride, vtx_decl.colors[i]);
|
||||
|
||||
for (int i = 0; i < 8; i++)
|
||||
SetPointer(SHADER_TEXTURE0_ATTRIB + i, vertex_stride, vtx_decl.texcoords[i]);
|
||||
for (u32 i = 0; i < 8; i++)
|
||||
SetPointer(ShaderAttrib::TexCoord0 + i, vertex_stride, vtx_decl.texcoords[i]);
|
||||
|
||||
SetPointer(SHADER_POSMTX_ATTRIB, vertex_stride, vtx_decl.posmtx);
|
||||
SetPointer(ShaderAttrib::PositionMatrix, vertex_stride, vtx_decl.posmtx);
|
||||
}
|
||||
|
||||
GLVertexFormat::~GLVertexFormat()
|
||||
|
Reference in New Issue
Block a user