summaryrefslogtreecommitdiff
path: root/Source/Plugins/Plugin_VideoOGL/Src/ProgramShaderCache.cpp
diff options
context:
space:
mode:
authorRyan Houdek <Sonicadvance1@gmail.com>2011-12-11 06:18:01 -0600
committerSonicadvance1 <sonicadvance1@RH-Live.(none)>2012-10-09 23:41:48 -0500
commitba12c0b4f51aafd814d9d400869586d204cf43df (patch)
tree00f3ed3a81a8f1f075435e85c5844b44dee0de8b /Source/Plugins/Plugin_VideoOGL/Src/ProgramShaderCache.cpp
parentd70726b035cc9d3dc7c342018f5e84efffe04bf1 (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/ProgramShaderCache.cpp')
-rw-r--r--Source/Plugins/Plugin_VideoOGL/Src/ProgramShaderCache.cpp18
1 files changed, 3 insertions, 15 deletions
diff --git a/Source/Plugins/Plugin_VideoOGL/Src/ProgramShaderCache.cpp b/Source/Plugins/Plugin_VideoOGL/Src/ProgramShaderCache.cpp
index 10c15aae36..2f6aa691de 100644
--- a/Source/Plugins/Plugin_VideoOGL/Src/ProgramShaderCache.cpp
+++ b/Source/Plugins/Plugin_VideoOGL/Src/ProgramShaderCache.cpp
@@ -121,18 +121,10 @@ namespace OGL
// Need to get some attribute locations
if(uid.uid.vsid != 0) // We have no vertex Shader
{
- entry.program.attrLoc[0] = glGetAttribLocation(entry.program.glprogid, "rawnorm1");
- entry.program.attrLoc[1] = glGetAttribLocation(entry.program.glprogid, "rawnorm2");
- entry.program.attrLoc[2] = glGetAttribLocation(entry.program.glprogid, "fposmtx");
- if(entry.program.attrLoc[0] > 0)
- glEnableVertexAttribArray(entry.program.attrLoc[0]);
- if(entry.program.attrLoc[1] > 0)
- glEnableVertexAttribArray(entry.program.attrLoc[1]);
- if(entry.program.attrLoc[2] > 0)
- glEnableVertexAttribArray(entry.program.attrLoc[2]);
+ glBindAttribLocation(entry.program.glprogid, SHADER_NORM1_ATTRIB, "rawnorm1");
+ glBindAttribLocation(entry.program.glprogid, SHADER_NORM2_ATTRIB, "rawnorm2");
+ glBindAttribLocation(entry.program.glprogid, SHADER_POSMTX_ATTRIB, "fposmtx");
}
- else
- entry.program.attrLoc[0] = entry.program.attrLoc[1] = entry.program.attrLoc[2] = 0;
pshaders[ShaderPair] = entry;
@@ -154,10 +146,6 @@ namespace OGL
GLuint ProgramShaderCache::GetCurrentProgram(void) { return CurrentProgram; }
- GLint ProgramShaderCache::GetAttr(int num)
- {
- return pshaders[CurrentShaderProgram].program.attrLoc[num];
- }
PROGRAMSHADER ProgramShaderCache::GetShaderProgram(void)
{
return pshaders[CurrentShaderProgram].program;