Handle cases where fragdata or attrib location idx is -1

* This can happen when we're copying from a source program to a dest
  program where the source is non-separable and had an attribute
  optimised out entirely, but the destination is separable and so still
  wants that attribute. In this case it'll come out in the wash and
  we can just skip it.
This commit is contained in:
baldurk committed 2015-02-25 17:28:06 +00:00
1 parent 75f58d19e8
commit 0796e5fbdf
1 file changed
+4 -2
+4 -2
View File
@@ -1576,7 +1576,8 @@ void CopyProgramAttribBindings(const GLHookSet &gl, GLuint progsrc, GLuint progd
continue;
GLint idx = gl.glGetAttribLocation(progsrc, refl->InputSig[i].varName.elems);
gl.glBindAttribLocation(progdst, (GLuint)idx, refl->InputSig[i].varName.elems);
if(idx >= 0)
gl.glBindAttribLocation(progdst, (GLuint)idx, refl->InputSig[i].varName.elems);
}
}
@@ -1590,7 +1591,8 @@ void CopyProgramFragDataBindings(const GLHookSet &gl, GLuint progsrc, GLuint pro
continue;
GLint idx = gl.glGetFragDataLocation(progsrc, refl->OutputSig[i].varName.elems);
gl.glBindFragDataLocation(progdst, (GLuint)idx, refl->OutputSig[i].varName.elems);
if(idx >= 0)
gl.glBindFragDataLocation(progdst, (GLuint)idx, refl->OutputSig[i].varName.elems);
}
}