Delete old sync objects before re-syncing in glFenceSync

This commit is contained in:
baldurk
2017-12-22 16:00:34 +00:00
parent f224375790
commit 98c267cee6
@@ -59,6 +59,18 @@ bool WrappedOpenGL::Serialise_glFenceSync(SerialiserType &ser, GLsync real, GLen
if(IsReplayingAndReading())
{
// if we've already sync'd, delete the old one
if(GetResourceManager()->HasLiveResource(sync))
{
GLResource res = GetResourceManager()->GetLiveResource(sync);
GLsync oldSyncObj = GetResourceManager()->GetSync(res.name);
m_Real.glDeleteSync(oldSyncObj);
GetResourceManager()->UnregisterResource(res);
GetResourceManager()->EraseLiveResource(sync);
}
real = m_Real.glFenceSync(condition, flags);
GLuint name = 0;