Make sure the 0 VAO gets properly frame referenced

This commit is contained in:
baldurk
2016-07-13 10:35:59 +02:00
parent 23665b6e05
commit d5fd26f267
4 changed files with 10 additions and 10 deletions
+1
View File
@@ -2451,6 +2451,7 @@ void WrappedOpenGL::StartFrameCapture(void *dev, void *wnd)
GetResourceManager()->ClearReferencedResources();
GetResourceManager()->MarkResourceFrameReferenced(m_DeviceResourceID, eFrameRef_Write);
GetResourceManager()->MarkResourceFrameReferenced(m_FakeVAOID, eFrameRef_Write);
GetResourceManager()->PrepareInitialContents();
FreeCaptureData();
+2 -2
View File
@@ -187,11 +187,11 @@ void Serialiser::Serialise(const char *name, TextureStateInitialData &el)
Serialise("texBufSize", el.texBufSize);
}
void GLResourceManager::MarkVAOReferenced(GLResource res, FrameRefType ref)
void GLResourceManager::MarkVAOReferenced(GLResource res, FrameRefType ref, bool allowFake0)
{
const GLHookSet &gl = m_GL->m_Real;
if(res.name)
if(res.name || allowFake0)
{
MarkResourceFrameReferenced(res, ref == eFrameRef_Unknown ? eFrameRef_Unknown : eFrameRef_Read);
+5 -7
View File
@@ -198,13 +198,11 @@ public:
GLsync GetSync(GLuint name) { return m_CurrentSyncs[name]; }
ResourceId GetSyncID(GLsync sync) { return m_SyncIDs[sync]; }
// we need to find all the children bound to VAOs/FBOs and mark them referenced. The reason for
// this
// is that say a VAO became high traffic and we stopped serialising buffer binds, but then it is
// never
// modified in a frame and none of the buffers are ever referenced. They would be eliminated from
// the log and the VAO initial state that tries to bind them would fail.
// Normally this would be handled by record parenting, but that would be a nightmare to track.
void MarkVAOReferenced(GLResource res, FrameRefType ref);
// this is that say a VAO became high traffic and we stopped serialising buffer binds, but then it
// is never modified in a frame and none of the buffers are ever referenced. They would be
// eliminated from the log and the VAO initial state that tries to bind them would fail. Normally
// this would be handled by record parenting, but that would be a nightmare to track.
void MarkVAOReferenced(GLResource res, FrameRefType ref, bool allowFake0 = false);
void MarkFBOReferenced(GLResource res, FrameRefType ref);
bool Prepare_InitialState(GLResource res, byte *blob);
+2 -1
View File
@@ -332,7 +332,8 @@ void GLRenderState::MarkReferenced(WrappedOpenGL *gl, bool initial) const
gl->AddMissingTrack(manager->GetID(TextureRes(ctx, Images[i].name)));
}
manager->MarkVAOReferenced(VertexArrayRes(ctx, VAO), initial ? eFrameRef_Unknown : eFrameRef_Read);
manager->MarkVAOReferenced(VertexArrayRes(ctx, VAO), initial ? eFrameRef_Unknown : eFrameRef_Read,
true);
manager->MarkResourceFrameReferenced(FeedbackRes(ctx, FeedbackObj),
initial ? eFrameRef_Unknown : eFrameRef_Read);