mirror of
https://github.com/baldurk/renderdoc.git
synced 2026-08-22 06:26:30 +00:00
Make sure the 0 VAO gets properly frame referenced
This commit is contained in:
@@ -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();
|
||||
|
||||
@@ -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);
|
||||
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user