Don't set program I/O bindings on GL unless it has a vertex/pixel shader

* For separable programs we'll query out I/O bindings for e.g. only the geometry
  pipeline, but we shouldn't try to set those outputs with
  glBindFragDataLocation. Normally we'd expect these bindings to be queried as
  -1 at capture time, but just be sure.
This commit is contained in:
baldurk
2020-11-10 13:02:08 +00:00
parent 5f6f00d175
commit b402dfeeb5
+5 -2
View File
@@ -1365,6 +1365,9 @@ bool SerialiseProgramBindings(SerialiserType &ser, CaptureState state,
for(size_t i = 0; i < 6; i++)
IsProgramSPIRV |= stages.refls[i] && stages.refls[i]->encoding == ShaderEncoding::SPIRV;
const bool hasVert = stages.refls[0] != NULL;
const bool hasFrag = stages.refls[5] != NULL;
if(ser.IsWriting() && !IsProgramSPIRV)
{
char buf[128] = {};
@@ -1435,11 +1438,11 @@ bool SerialiseProgramBindings(SerialiserType &ser, CaptureState state,
if(bind.Name.beginsWith("gl_"))
continue;
if(sigType == 0)
if(sigType == 0 && hasVert)
{
GL.glBindAttribLocation(prog, (GLuint)bind.Binding, bind.Name.c_str());
}
else
else if(sigType == 1 && hasFrag)
{
// glBindFragDataLocation is not core GLES. However when it's not available that means
// the user must have explicitly specified locations so we don't need to set them.