improved renderer reliability

The renderer backend can now distinguish between jobs. Previously if two jobs
of the same frame were started (which is legal if the user made a change while
frames were still being rendered), an earlier job in some situations could
finish AFTER a later job, and the backend would have no way of distinguishing
between them. This meant a frame could be erroneously set to an old value
rather than the newest. This commit introduces job identification so that old
jobs are automatically discarded.
This commit is contained in:
itsmattkc
2020-01-02 03:21:38 +11:00
parent 62e94ca2cb
commit e8fddc2d5b
12 changed files with 147 additions and 160 deletions
+6 -4
View File
@@ -32,13 +32,15 @@ void RenderWorker::Close()
started_ = false;
}
void RenderWorker::Render(NodeDependency path)
void RenderWorker::Render(NodeDependency path, qint64 job_time)
{
emit CompletedCache(path, RenderInternal(path));
emit CompletedCache(path, RenderInternal(path, job_time), job_time);
}
NodeValueTable RenderWorker::RenderInternal(const NodeDependency &path)
NodeValueTable RenderWorker::RenderInternal(const NodeDependency &path, const qint64 &job_time)
{
Q_UNUSED(job_time)
return ProcessNode(path);
}
@@ -114,7 +116,7 @@ NodeValueTable RenderWorker::ProcessInput(const NodeInput *input, const TimeRang
}
}
NodeValueDatabase RenderWorker::GenerateDatabase(const Node* node, const TimeRange& range)
NodeValueDatabase RenderWorker::GenerateDatabase(const Node* node, const TimeRange &range)
{
NodeValueDatabase database;