On to a full rendered pipeline

This commit is contained in:
Sam Gateau 2015-06-01 12:35:54 -07:00
parent 47e15345c3
commit c8e30ef39e
4 changed files with 16 additions and 7 deletions

View file

@ -34,5 +34,8 @@ bool Context::makeProgram(Shader& shader, const Shader::BindingSet& bindings) {
void Context::render(Batch& batch) {
_backend->render(batch);
// GLBackend::renderBatch(batch, true);
}
void Context::syncCache() {
_backend->syncCache();
}

View file

@ -33,6 +33,7 @@ public:
virtual~ Backend() {};
virtual void render(Batch& batch) = 0;
virtual void syncCache() = 0;
class TransformObject {
public:
@ -115,6 +116,7 @@ public:
void render(Batch& batch);
void syncCache();
protected:
Context(const Context& context);

View file

@ -30,6 +30,12 @@ public:
virtual void render(Batch& batch);
// This call synchronize the Full Backend cache with the current GLState
// THis is only intended to be used when mixing raw gl calls with the gpu api usage in order to sync
// the gpu::Backend state with the true gl state which has probably been messed up by these ugly naked gl calls
// Let's try to avoid to do that as much as possible!
virtual void syncCache();
// Render Batch create a local Context and execute the batch with it
// WARNING:
// if syncCache is true, then the gpu::GLBackend will synchornize
@ -195,12 +201,6 @@ public:
void do_setStateColorWriteMask(uint32 mask);
// This call synchronize the Full Backend cache with the current GLState
// THis is only intended to be used when mixing raw gl calls with the gpu api usage in order to sync
// the gpu::Backend state with the true gl state which has probably been messed up by these ugly naked gl calls
// Let's try to avoid to do that as much as possible!
void syncCache();
protected:
// Draw Stage

View file

@ -10,6 +10,8 @@
//
#include "RenderDeferredTask.h"
#include "gpu/Context.h"
using namespace render;
RenderDeferredTask::RenderDeferredTask() : Task() {
@ -34,6 +36,8 @@ void RenderDeferredTask::run(const SceneContextPointer& sceneContext, const Rend
return;
}
renderContext->args->_context->syncCache();
for (auto job : _jobs) {
job.run(sceneContext, renderContext);
}