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); diff --git a/Source/Plugins/Plugin_VideoOGL/Src/ProgramShaderCache.h b/Source/Plugins/Plugin_VideoOGL/Src/ProgramShaderCache.h index 07e77e3eae..cba467fc89 100644 --- a/Source/Plugins/Plugin_VideoOGL/Src/ProgramShaderCache.h +++ b/Source/Plugins/Plugin_VideoOGL/Src/ProgramShaderCache.h @@ -155,6 +155,7 @@ private: static GLuint s_ps_vs_ubo; static GLintptr s_vs_data_offset; static void SetProgramVariables(PCacheEntry &entry); + static void SetProgramBindings(PCacheEntry &entry); }; } // namespace OGL