summaryrefslogtreecommitdiff
path: root/Source/Core/VideoBackends/OGL/OGLNativeVertexFormat.cpp
diff options
context:
space:
mode:
authorJMC47 <JMC4789@gmail.com>2021-12-20 14:27:14 -0500
committerGitHub <noreply@github.com>2021-12-20 14:27:14 -0500
commit32fed91b0d35f06c46281f55c9f0fa4694c5334a (patch)
tree6e47451f525329e5ba57fc615c491b0ca06088d8 /Source/Core/VideoBackends/OGL/OGLNativeVertexFormat.cpp
parent1714dc64bb1cc01aee9d9b52763f20aa6a44a674 (diff)
parentffa512f5e7d24d9d9e93366bb596b9473d26d61b (diff)
Merge pull request #9718 from Pokechu22/better-fifo-analyzer-part-3
Fifo analyzer improvements, part 3
Diffstat (limited to 'Source/Core/VideoBackends/OGL/OGLNativeVertexFormat.cpp')
-rw-r--r--Source/Core/VideoBackends/OGL/OGLNativeVertexFormat.cpp8
1 files changed, 5 insertions, 3 deletions
diff --git a/Source/Core/VideoBackends/OGL/OGLNativeVertexFormat.cpp b/Source/Core/VideoBackends/OGL/OGLNativeVertexFormat.cpp
index 9a6e568c8d..d21a40ebc1 100644
--- a/Source/Core/VideoBackends/OGL/OGLNativeVertexFormat.cpp
+++ b/Source/Core/VideoBackends/OGL/OGLNativeVertexFormat.cpp
@@ -2,6 +2,7 @@
// SPDX-License-Identifier: GPL-2.0-or-later
#include "Common/CommonTypes.h"
+#include "Common/EnumMap.h"
#include "Common/GL/GLUtil.h"
#include "Common/MsgHandler.h"
@@ -23,10 +24,11 @@ Renderer::CreateNativeVertexFormat(const PortableVertexDeclaration& vtx_decl)
return std::make_unique<GLVertexFormat>(vtx_decl);
}
-static inline GLuint VarToGL(VarType t)
+static inline GLuint VarToGL(ComponentFormat t)
{
- static const GLuint lookup[5] = {GL_UNSIGNED_BYTE, GL_BYTE, GL_UNSIGNED_SHORT, GL_SHORT,
- GL_FLOAT};
+ static constexpr Common::EnumMap<GLuint, ComponentFormat::Float> lookup = {
+ GL_UNSIGNED_BYTE, GL_BYTE, GL_UNSIGNED_SHORT, GL_SHORT, GL_FLOAT,
+ };
return lookup[t];
}