Don't replay glDetachShader so programs can be relinked

* We need to relink programs to update attrib bindings, which means the
  shaders need to be still attached. There doesn't seem to be any harm
  in leaving a shader attached to a program that should be detached -
  it can still be used just fine in other programs.
This commit is contained in:
baldurk
2017-04-25 18:58:15 +01:00
parent 58ac90e831
commit 0da47c8102
@@ -347,6 +347,10 @@ bool WrappedOpenGL::Serialise_glDetachShader(GLuint program, GLuint shader)
ResourceId liveProgId = GetResourceManager()->GetLiveID(progid);
ResourceId liveShadId = GetResourceManager()->GetLiveID(shadid);
// in order to be able to relink programs, we don't replay detaches. This should be valid as
// it's legal to have a shader attached to multiple programs, so even if it's attached again
// that doesn't affect the attach here.
/*
if(!m_Programs[liveProgId].linked)
{
for(auto it = m_Programs[liveProgId].shaders.begin();
@@ -362,6 +366,7 @@ bool WrappedOpenGL::Serialise_glDetachShader(GLuint program, GLuint shader)
m_Real.glDetachShader(GetResourceManager()->GetLiveResource(progid).name,
GetResourceManager()->GetLiveResource(shadid).name);
*/
}
return true;