Make sure to mark programs bound to pipelines as frame referenced

This commit is contained in:
baldurk
2015-07-11 18:57:22 +02:00
parent a0d0a637b5
commit 49836d5fcc
2 changed files with 12 additions and 0 deletions
+6
View File
@@ -105,6 +105,12 @@ struct ResourceRecord
mgr->MarkDirtyResource((*it)->GetResourceID());
}
void MarkParentsReferenced(ResourceRecordHandler *mgr, FrameRefType refType)
{
for(auto it = Parents.begin(); it != Parents.end(); ++it)
mgr->MarkResourceFrameReferenced((*it)->GetResourceID(), refType);
}
void FreeParents(ResourceRecordHandler *mgr)
{
for(auto it = Parents.begin(); it != Parents.end(); ++it)
+6
View File
@@ -347,6 +347,12 @@ void GLRenderState::MarkReferenced(WrappedOpenGL *gl, bool initial) const
manager->MarkResourceFrameReferenced(ProgramRes(ctx, Program), initial ? eFrameRef_Unknown : eFrameRef_Read);
manager->MarkResourceFrameReferenced(ProgramPipeRes(ctx, Pipeline), initial ? eFrameRef_Unknown : eFrameRef_Read);
// the pipeline correctly has program parents, but we must also mark the programs as frame referenced so that their
// initial contents will be serialised.
GLResourceRecord *record = manager->GetResourceRecord(ProgramPipeRes(ctx, Pipeline));
if(record)
record->MarkParentsReferenced(manager, initial ? eFrameRef_Unknown : eFrameRef_Read);
for(size_t i=0; i < ARRAY_COUNT(BufferBindings); i++)
manager->MarkResourceFrameReferenced(BufferRes(ctx, BufferBindings[i]), initial ? eFrameRef_Unknown : eFrameRef_Read);