mirror of
https://github.com/HifiExperiments/overte.git
synced 2025-08-04 20:43:08 +02:00
Introducing the SCeneUpdtate job to the engine to take care of performing transactions and introducing the stages
This commit is contained in:
parent
15a5464bab
commit
d8380923f0
7 changed files with 134 additions and 4 deletions
|
@ -5140,10 +5140,7 @@ void Application::displaySide(RenderArgs* renderArgs, Camera& theCamera, bool se
|
|||
}
|
||||
|
||||
{
|
||||
PerformanceTimer perfTimer("SceneProcessTransaction");
|
||||
_main3DScene->enqueueTransaction(transaction);
|
||||
|
||||
_main3DScene->processTransactionQueue();
|
||||
}
|
||||
|
||||
// For now every frame pass the renderContext
|
||||
|
|
|
@ -18,6 +18,8 @@
|
|||
#include <gpu/Context.h>
|
||||
|
||||
#include "EngineStats.h"
|
||||
#include "SceneTask.h"
|
||||
|
||||
#include "Logging.h"
|
||||
|
||||
using namespace render;
|
||||
|
@ -31,6 +33,7 @@ public:
|
|||
|
||||
void build(JobModel& task, const Varying& in, Varying& out) {
|
||||
task.addJob<EngineStats>("Stats");
|
||||
task.addJob<PerformSceneTransaction>("PerformSceneTransaction");
|
||||
}
|
||||
};
|
||||
|
||||
|
|
|
@ -128,7 +128,6 @@ protected:
|
|||
void removeItems(const ItemIDs& ids);
|
||||
void updateItems(const ItemIDs& ids, UpdateFunctors& functors);
|
||||
|
||||
|
||||
// The Selection map
|
||||
mutable std::mutex _selectionsMutex; // mutable so it can be used in the thread safe getSelection const method
|
||||
SelectionMap _selections;
|
||||
|
@ -139,6 +138,11 @@ protected:
|
|||
// void appendToSelection(const Selection& selection);
|
||||
// void mergeWithSelection(const Selection& selection);
|
||||
|
||||
// The Stages
|
||||
StageMap _stages;
|
||||
|
||||
|
||||
|
||||
friend class Engine;
|
||||
};
|
||||
|
||||
|
|
21
libraries/render/src/render/SceneTask.cpp
Normal file
21
libraries/render/src/render/SceneTask.cpp
Normal file
|
@ -0,0 +1,21 @@
|
|||
//
|
||||
// SceneTask.cpp
|
||||
// render/src/render
|
||||
//
|
||||
// Created by Sam Gateau on 6/14/2017.
|
||||
// Copyright 2017 High Fidelity, Inc.
|
||||
//
|
||||
// Distributed under the Apache License, Version 2.0.
|
||||
// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html
|
||||
//
|
||||
#include "SceneTask.h"
|
||||
|
||||
|
||||
using namespace render;
|
||||
|
||||
void PerformSceneTransaction::configure(const Config& config) {
|
||||
}
|
||||
|
||||
void PerformSceneTransaction::run(const RenderContextPointer& renderContext) {
|
||||
renderContext->_scene->processTransactionQueue();
|
||||
}
|
41
libraries/render/src/render/SceneTask.h
Normal file
41
libraries/render/src/render/SceneTask.h
Normal file
|
@ -0,0 +1,41 @@
|
|||
//
|
||||
// SceneTask.h
|
||||
// render/src/render
|
||||
//
|
||||
// Created by Sam Gateau on 6/14/2017.
|
||||
// Copyright 2017 High Fidelity, Inc.
|
||||
//
|
||||
// Distributed under the Apache License, Version 2.0.
|
||||
// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html
|
||||
//
|
||||
|
||||
#ifndef hifi_render_SceneTask_h
|
||||
#define hifi_render_SceneTask_h
|
||||
|
||||
#include "Engine.h"
|
||||
|
||||
namespace render {
|
||||
|
||||
class PerformSceneTransactionConfig : public Job::Config {
|
||||
Q_OBJECT
|
||||
public:
|
||||
signals:
|
||||
void dirty();
|
||||
|
||||
protected:
|
||||
};
|
||||
|
||||
class PerformSceneTransaction {
|
||||
public:
|
||||
using Config = PerformSceneTransactionConfig;
|
||||
using JobModel = Job::Model<PerformSceneTransaction, Config>;
|
||||
|
||||
void configure(const Config& config);
|
||||
void run(const RenderContextPointer& renderContext);
|
||||
protected:
|
||||
};
|
||||
|
||||
|
||||
}
|
||||
|
||||
#endif // hifi_render_SceneTask_h
|
26
libraries/render/src/render/Stage.cpp
Normal file
26
libraries/render/src/render/Stage.cpp
Normal file
|
@ -0,0 +1,26 @@
|
|||
//
|
||||
// Stage.cpp
|
||||
// render/src/render
|
||||
//
|
||||
// Created by Sam Gateau on 6/14/2017.
|
||||
// Copyright 2017 High Fidelity, Inc.
|
||||
//
|
||||
// Distributed under the Apache License, Version 2.0.
|
||||
// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html
|
||||
//
|
||||
#include "Stage.h"
|
||||
|
||||
|
||||
using namespace render;
|
||||
|
||||
|
||||
|
||||
Stage::~Stage() {
|
||||
|
||||
}
|
||||
|
||||
Stage::Stage() :
|
||||
_name()
|
||||
{
|
||||
}
|
||||
|
38
libraries/render/src/render/Stage.h
Normal file
38
libraries/render/src/render/Stage.h
Normal file
|
@ -0,0 +1,38 @@
|
|||
//
|
||||
// Stage.h
|
||||
// render/src/render
|
||||
//
|
||||
// Created by Sam Gateau on 6/14/2017.
|
||||
// Copyright 2017 High Fidelity, Inc.
|
||||
//
|
||||
// Distributed under the Apache License, Version 2.0.
|
||||
// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html
|
||||
//
|
||||
|
||||
#ifndef hifi_render_Stage_h
|
||||
#define hifi_render_Stage_h
|
||||
|
||||
#include <memory>
|
||||
#include <map>
|
||||
#include <string>
|
||||
|
||||
namespace render {
|
||||
|
||||
class Stage {
|
||||
public:
|
||||
using Name = std::string;
|
||||
|
||||
Stage();
|
||||
virtual ~Stage();
|
||||
|
||||
protected:
|
||||
Name _name;
|
||||
};
|
||||
|
||||
using StagePointer = std::shared_ptr<Stage>;
|
||||
|
||||
using StageMap = std::map<const Stage::Name, StagePointer>;
|
||||
|
||||
}
|
||||
|
||||
#endif // hifi_render_Stage_h
|
Loading…
Reference in a new issue