summaryrefslogtreecommitdiff
path: root/Source/Plugins/Plugin_VideoOGL/Src/NativeVertexFormat.cpp
diff options
context:
space:
mode:
authorRyan Houdek <Sonicadvance1@gmail.com>2011-12-11 06:18:01 -0600
committerRyan Houdek <Sonicadvance1@gmail.com>2011-12-11 06:18:01 -0600
commitad13f2d23d8dd809e5f5246a7ea45bbcb0b3fc70 (patch)
tree2440e1a9971afbe9118c1600a8f68a788edeed49 /Source/Plugins/Plugin_VideoOGL/Src/NativeVertexFormat.cpp
parentc908e1173d9a1d54645249f8a942d18203cd7244 (diff)
Instead of querying the vertex attribute location. Let's bind it to where CG expects it to be as well. Was causing problems when we were trying to activate the components below and they weren't available. This fixes cubivore with GLSL shader. Also any other game that uses 3 normal pointers.
Diffstat (limited to 'Source/Plugins/Plugin_VideoOGL/Src/NativeVertexFormat.cpp')
-rw-r--r--Source/Plugins/Plugin_VideoOGL/Src/NativeVertexFormat.cpp17
1 files changed, 3 insertions, 14 deletions
diff --git a/Source/Plugins/Plugin_VideoOGL/Src/NativeVertexFormat.cpp b/Source/Plugins/Plugin_VideoOGL/Src/NativeVertexFormat.cpp
index c83c976fb2..d42b2a7222 100644
--- a/Source/Plugins/Plugin_VideoOGL/Src/NativeVertexFormat.cpp
+++ b/Source/Plugins/Plugin_VideoOGL/Src/NativeVertexFormat.cpp
@@ -192,15 +192,8 @@ void GLVertexFormat::SetupVertexPointers() {
if (vtx_decl.num_normals >= 1) {
glNormalPointer(VarToGL(vtx_decl.normal_gl_type), vtx_decl.stride, (void *)(VertexManager::s_pBaseBufferPointer + vtx_decl.normal_offset[0]));
if (vtx_decl.num_normals == 3) {
- GLint varLocation1 = SHADER_NORM1_ATTRIB, varLocation2 = SHADER_NORM2_ATTRIB;
- if(g_ActiveConfig.bUseGLSL){
- varLocation1 = OGL::ProgramShaderCache::GetAttr(0);
- varLocation2 = OGL::ProgramShaderCache::GetAttr(1);
- }
- if(varLocation1 > 0)
- glVertexAttribPointer(varLocation1, vtx_decl.normal_gl_size, VarToGL(vtx_decl.normal_gl_type), GL_TRUE, vtx_decl.stride, (void *)(VertexManager::s_pBaseBufferPointer + vtx_decl.normal_offset[1]));
- if(varLocation2 > 0)
- glVertexAttribPointer(varLocation2, vtx_decl.normal_gl_size, VarToGL(vtx_decl.normal_gl_type), GL_TRUE, vtx_decl.stride, (void *)(VertexManager::s_pBaseBufferPointer + vtx_decl.normal_offset[2]));
+ glVertexAttribPointer(SHADER_NORM1_ATTRIB, vtx_decl.normal_gl_size, VarToGL(vtx_decl.normal_gl_type), GL_TRUE, vtx_decl.stride, (void *)(VertexManager::s_pBaseBufferPointer + vtx_decl.normal_offset[1]));
+ glVertexAttribPointer(SHADER_NORM2_ATTRIB, vtx_decl.normal_gl_size, VarToGL(vtx_decl.normal_gl_type), GL_TRUE, vtx_decl.stride, (void *)(VertexManager::s_pBaseBufferPointer + vtx_decl.normal_offset[2]));
}
}
@@ -224,11 +217,7 @@ void GLVertexFormat::SetupVertexPointers() {
}
if (vtx_decl.posmtx_offset != -1) {
- GLint varLocation = SHADER_POSMTX_ATTRIB;
- if(g_ActiveConfig.bUseGLSL)
- varLocation = OGL::ProgramShaderCache::GetAttr(2);
- if(varLocation > 0)
- glVertexAttribPointer(varLocation, 4, GL_UNSIGNED_BYTE, GL_FALSE, vtx_decl.stride, (void *)(VertexManager::s_pBaseBufferPointer + vtx_decl.posmtx_offset));
+ glVertexAttribPointer(SHADER_POSMTX_ATTRIB, 4, GL_UNSIGNED_BYTE, GL_FALSE, vtx_decl.stride, (void *)(VertexManager::s_pBaseBufferPointer + vtx_decl.posmtx_offset));
}
#endif
}