Move GL context sync to render Engine (from Task)

This commit is contained in:
Zach Pomerantz 2016-01-13 17:53:15 -08:00
parent 70cc7d87e4
commit 5c9c34377e
2 changed files with 5 additions and 3 deletions

View file

@ -186,8 +186,6 @@ void RenderDeferredTask::run(const SceneContextPointer& sceneContext, const Rend
setToneMappingExposure(renderContext->getTone().exposure);
setToneMappingToneCurve(renderContext->getTone().toneCurve);
renderContext->getArgs()->_context->syncCache();
for (auto job : _jobs) {
job.run(sceneContext, renderContext);
}

View file

@ -9,6 +9,8 @@
// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html
//
#include <gpu/Context.h>
#include "Engine.h"
using namespace render;
@ -34,7 +36,9 @@ void Engine::addTask(const TaskPointer& task) {
}
void Engine::run() {
// TODO: Tasks will need to be specified such that their data can feed into each other
// Sync GPU state before beginning to render
_renderContext->getArgs()->_context->syncCache();
for (auto task : _tasks) {
task->run(_sceneContext, _renderContext);
}