summaryrefslogtreecommitdiff
path: root/Source/Plugins/Plugin_VideoOGL/Src/ProgramShaderCache.cpp
diff options
context:
space:
mode:
authordegasus <wickmarkus@web.de>2012-12-31 02:34:27 +0100
committerdegasus <wickmarkus@web.de>2012-12-31 02:34:27 +0100
commitc2898748ac210305185d0b7db0ac48001329453c (patch)
treeca5d58293a2acd18510c70179956cf4ddd6998b2 /Source/Plugins/Plugin_VideoOGL/Src/ProgramShaderCache.cpp
parentba6564b0b59a9b72c79aad1cf4048610e2852e92 (diff)
bind locations _before_ link program, fix dest alpha
Diffstat (limited to 'Source/Plugins/Plugin_VideoOGL/Src/ProgramShaderCache.cpp')
-rw-r--r--Source/Plugins/Plugin_VideoOGL/Src/ProgramShaderCache.cpp12
1 files changed, 11 insertions, 1 deletions
diff --git a/Source/Plugins/Plugin_VideoOGL/Src/ProgramShaderCache.cpp b/Source/Plugins/Plugin_VideoOGL/Src/ProgramShaderCache.cpp
index 3c22a107fe..1131b65309 100644
--- a/Source/Plugins/Plugin_VideoOGL/Src/ProgramShaderCache.cpp
+++ b/Source/Plugins/Plugin_VideoOGL/Src/ProgramShaderCache.cpp
@@ -93,6 +93,13 @@ void ProgramShaderCache::SetProgramVariables(PCacheEntry &entry)
if (entry.UniformLocations[a] != -1)
glUniform1i(entry.UniformLocations[a], a);
}
+ }
+}
+
+void ProgramShaderCache::SetProgramBindings ( ProgramShaderCache::PCacheEntry& entry )
+{
+ if (!g_ActiveConfig.backend_info.bSupportsGLSLBinding)
+ {
if (g_ActiveConfig.backend_info.bSupportsGLSLBlend)
{
// So we don't support binding, but we do support extended blending
@@ -103,7 +110,7 @@ void ProgramShaderCache::SetProgramVariables(PCacheEntry &entry)
}
}
- // Need to get some attribute locations
+ // Need to set some attribute locations
if (entry.vsid != 0 && !g_ActiveConfig.backend_info.bSupportsGLSLATTRBind)
{
// We have no vertex Shader
@@ -113,6 +120,7 @@ void ProgramShaderCache::SetProgramVariables(PCacheEntry &entry)
}
}
+
void ProgramShaderCache::SetBothShaders(GLuint PS, GLuint VS)
{
CurrentFShader = PS;
@@ -151,6 +159,8 @@ void ProgramShaderCache::SetBothShaders(GLuint PS, GLuint VS)
if (g_ActiveConfig.backend_info.bSupportsGLSLCache)
glProgramParameteri(entry.prog_id, GL_PROGRAM_BINARY_RETRIEVABLE_HINT, GL_TRUE);
+ SetProgramBindings(entry);
+
glLinkProgram(entry.prog_id);
glUseProgram(entry.prog_id);