Use serialised program initial states to translate uniform locations

* If you're capturing and replaying on the same driver it's insanely
  unlikely that this translation will be anything other than the identity
  map, although it wouldn't be illegal to renumber locations. However this
  should allow moving captures between vendors/driver versions/platforms,
  which in the past wasn't possible because locations would change (quite
  validly) when the programs were recompiled. There might be other issues,
  but at least this one is fixed.
This commit is contained in:
baldurk committed 2014-11-30 16:05:01 +00:00
1 parent c4f73c2b58
commit 9748813eb1
6 files changed
+82 -49

No files matched your search

+2 -2
View File
@@ -156,7 +156,7 @@ bool GLResourceManager::Prepare_InitialState(GLResource res)
m_pSerialiser->Serialise("Id", Id);
SerialiseProgramUniforms(gl, m_pSerialiser, res.name, true);
SerialiseProgramUniforms(gl, m_pSerialiser, res.name, NULL, true);
SetInitialChunk(Id, scope.Get());
}
@@ -356,7 +356,7 @@ bool GLResourceManager::Serialise_InitialState(GLResource res)
gl.glLinkProgram(initProg);
SerialiseProgramUniforms(gl, m_pSerialiser, initProg, false);
SerialiseProgramUniforms(gl, m_pSerialiser, initProg, &details.locationTranslate, false);
SetInitialContents(Id, InitialContentData(ProgramRes(m_GL->GetCtx(), initProg), 0, NULL));
}