diff options
| author | Mai <mathew1800@gmail.com> | 2022-11-23 22:40:03 +0000 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2022-11-23 22:40:03 +0000 |
| commit | d6437b7e461af0ef457c05be996d6fb30d7922ac (patch) | |
| tree | 4a73b4b6ecb4fe3f172c7bbbdc729ddf0cde56d6 /Source/Core/VideoBackends/OGL/OGLNativeVertexFormat.cpp | |
| parent | ddf63bacb9fec7bdc9cc2df3601cddce2bc8f7af (diff) | |
| parent | f5d11c1e388768043516fdb54e71b72c26c3c22d (diff) | |
Merge pull request #11123 from Pokechu22/fmt-9.1.0
Externals: Update fmt to 9.1.0
Diffstat (limited to 'Source/Core/VideoBackends/OGL/OGLNativeVertexFormat.cpp')
| -rw-r--r-- | Source/Core/VideoBackends/OGL/OGLNativeVertexFormat.cpp | 28 |
1 files changed, 14 insertions, 14 deletions
diff --git a/Source/Core/VideoBackends/OGL/OGLNativeVertexFormat.cpp b/Source/Core/VideoBackends/OGL/OGLNativeVertexFormat.cpp index 1913b6dcd3..16bcabab4b 100644 --- a/Source/Core/VideoBackends/OGL/OGLNativeVertexFormat.cpp +++ b/Source/Core/VideoBackends/OGL/OGLNativeVertexFormat.cpp @@ -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() |
