bind locations _before_ link program, fix dest alpha

This commit is contained in:
degasus 2012-12-31 02:34:27 +01:00
parent ba6564b0b5
commit c2898748ac
2 changed files with 12 additions and 1 deletions

View File

@ -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);

View File

@ -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