If program with initial contents doesn't link, try again as separable

* We can't just link ALL programs as separable to be safe, since this
  hits the same problem of some shaders not being valid as separable :(.
* This should fix the case where a separable program with initial state
  was failing to link before, without breaking non-separable programs.
This commit is contained in:
baldurk
2015-02-24 22:59:54 +00:00
parent c57c6b4bf8
commit 8f10523b7e
+12
View File
@@ -628,6 +628,18 @@ bool GLResourceManager::Serialise_InitialState(GLResource res)
GLint status = 0;
gl.glGetProgramiv(initProg, eGL_LINK_STATUS, &status);
// if it failed to link, try again as a separable program.
// we can't do this by default because of the silly rules meaning
// shaders need fixup to be separable-compatible.
if(status == 0)
{
gl.glProgramParameteri(initProg, eGL_PROGRAM_SEPARABLE, 1);
gl.glLinkProgram(initProg);
gl.glGetProgramiv(initProg, eGL_LINK_STATUS, &status);
}
if(status == 0)
{
if(details.shaders.size() == 0)