mirror of
https://github.com/overte-org/overte.git
synced 2025-08-08 06:57:37 +02:00
debugging and fixing the problem to get Config for complex path
This commit is contained in:
parent
d2a66b9e7d
commit
2eec5b01fa
4 changed files with 31 additions and 21 deletions
|
@ -4444,7 +4444,7 @@ void Application::idle() {
|
||||||
PROFILE_COUNTER_IF_CHANGED(app, "pendingProcessing", int, DependencyManager::get<StatTracker>()->getStat("PendingProcessing").toInt());
|
PROFILE_COUNTER_IF_CHANGED(app, "pendingProcessing", int, DependencyManager::get<StatTracker>()->getStat("PendingProcessing").toInt());
|
||||||
auto renderConfig = _graphicsEngine.getRenderEngine()->getConfiguration();
|
auto renderConfig = _graphicsEngine.getRenderEngine()->getConfiguration();
|
||||||
PROFILE_COUNTER_IF_CHANGED(render, "gpuTime", float, (float)_graphicsEngine.getGPUContext()->getFrameTimerGPUAverage());
|
PROFILE_COUNTER_IF_CHANGED(render, "gpuTime", float, (float)_graphicsEngine.getGPUContext()->getFrameTimerGPUAverage());
|
||||||
auto opaqueRangeTimer = renderConfig->getConfig("OpaqueRangeTimer");
|
/* auto opaqueRangeTimer = renderConfig->getConfig("OpaqueRangeTimer");
|
||||||
auto linearDepth = renderConfig->getConfig("LinearDepth");
|
auto linearDepth = renderConfig->getConfig("LinearDepth");
|
||||||
auto surfaceGeometry = renderConfig->getConfig("SurfaceGeometry");
|
auto surfaceGeometry = renderConfig->getConfig("SurfaceGeometry");
|
||||||
auto renderDeferred = renderConfig->getConfig("RenderDeferred");
|
auto renderDeferred = renderConfig->getConfig("RenderDeferred");
|
||||||
|
@ -4456,7 +4456,7 @@ void Application::idle() {
|
||||||
{ "SurfaceGeometry", surfaceGeometry ? surfaceGeometry->property("gpuRunTime") : 0 },
|
{ "SurfaceGeometry", surfaceGeometry ? surfaceGeometry->property("gpuRunTime") : 0 },
|
||||||
{ "RenderDeferred", renderDeferred ? renderDeferred->property("gpuRunTime") : 0 },
|
{ "RenderDeferred", renderDeferred ? renderDeferred->property("gpuRunTime") : 0 },
|
||||||
{ "ToneAndPostRangeTimer", toneAndPostRangeTimer ? toneAndPostRangeTimer->property("gpuRunTime") : 0 }
|
{ "ToneAndPostRangeTimer", toneAndPostRangeTimer ? toneAndPostRangeTimer->property("gpuRunTime") : 0 }
|
||||||
});
|
});*/
|
||||||
|
|
||||||
PROFILE_RANGE(app, __FUNCTION__);
|
PROFILE_RANGE(app, __FUNCTION__);
|
||||||
|
|
||||||
|
@ -5759,7 +5759,7 @@ void Application::update(float deltaTime) {
|
||||||
// TODO: Fix this by modeling the way the secondary camera works on how the main camera works
|
// TODO: Fix this by modeling the way the secondary camera works on how the main camera works
|
||||||
// ie. Use a camera object stored in the game logic and informs the Engine on where the secondary
|
// ie. Use a camera object stored in the game logic and informs the Engine on where the secondary
|
||||||
// camera should be.
|
// camera should be.
|
||||||
updateSecondaryCameraViewFrustum();
|
// updateSecondaryCameraViewFrustum();
|
||||||
}
|
}
|
||||||
|
|
||||||
quint64 now = usecTimestampNow();
|
quint64 now = usecTimestampNow();
|
||||||
|
|
|
@ -219,30 +219,41 @@ public:
|
||||||
// optional sub_parent_names and finally from there looking for the job_name (assuming every job in the path were found)
|
// optional sub_parent_names and finally from there looking for the job_name (assuming every job in the path were found)
|
||||||
//
|
//
|
||||||
// getter for qml integration, prefer the templated getter
|
// getter for qml integration, prefer the templated getter
|
||||||
|
#pragma optimize("", off)
|
||||||
Q_INVOKABLE QObject* getConfig(const QString& name) { return getConfig<TConfigProxy>(name.toStdString()); }
|
Q_INVOKABLE QObject* getConfig(const QString& name) { return getConfig<TConfigProxy>(name.toStdString()); }
|
||||||
// getter for cpp (strictly typed), prefer this getter
|
// getter for cpp (strictly typed), prefer this getter
|
||||||
template <class T> typename T::Config* getConfig(std::string job = "") const {
|
template <class T> typename T::Config* getConfig(std::string job = "") const {
|
||||||
const TaskConfig* root = this;
|
const TaskConfig* root = this;
|
||||||
QString path = (job.empty() ? QString() : QString(job.c_str())); // an empty string is not a null string
|
std::string jobPath = (job);
|
||||||
auto tokens = path.split('.', QString::SkipEmptyParts);
|
//QString path = (job.empty() ? QString() : QString(job.c_str())); // an empty string is not a null string
|
||||||
|
//auto tokens = path.split('.', QString::SkipEmptyParts);
|
||||||
|
std::list<std::string> tokens;
|
||||||
|
std::size_t pos = 0, found;
|
||||||
|
while ((found = jobPath.find_first_of('.', pos)) != std::string::npos) {
|
||||||
|
tokens.push_back(jobPath.substr(pos, found - pos));
|
||||||
|
pos = found + 1;
|
||||||
|
}
|
||||||
|
tokens.push_back(jobPath.substr(pos));
|
||||||
|
|
||||||
|
QString jobToken;
|
||||||
if (tokens.empty()) {
|
if (tokens.empty()) {
|
||||||
// return dynamic_cast<typename T::Config*>(const_cast<TaskConfig*> (root));
|
// return dynamic_cast<typename T::Config*>(const_cast<TaskConfig*> (root));
|
||||||
tokens.push_back(QString());
|
//tokens.push_back(std::string());
|
||||||
} else {
|
} else {
|
||||||
while (tokens.size() > 1) {
|
while (tokens.size() > 1) {
|
||||||
auto name = tokens.front();
|
auto name = tokens.front();
|
||||||
tokens.pop_front();
|
tokens.pop_front();
|
||||||
root = QObject::findChild<TaskConfig*>(name);
|
root = root->findChild<TaskConfig*>((name.empty() ? QString() : QString(name.c_str())));
|
||||||
if (!root) {
|
if (!root) {
|
||||||
return nullptr;
|
return nullptr;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
jobToken = QString(tokens.front().c_str());
|
||||||
}
|
}
|
||||||
|
|
||||||
return root->findChild<typename T::Config*>(tokens.front());
|
return root->findChild<typename T::Config*>(jobToken);
|
||||||
}
|
}
|
||||||
|
#pragma optimize("", on)
|
||||||
Q_INVOKABLE bool isTask() const override { return true; }
|
Q_INVOKABLE bool isTask() const override { return true; }
|
||||||
Q_INVOKABLE QObjectList getSubConfigs() const override {
|
Q_INVOKABLE QObjectList getSubConfigs() const override {
|
||||||
auto list = findChildren<JobConfig*>(QRegExp(".*"), Qt::FindDirectChildrenOnly);
|
auto list = findChildren<JobConfig*>(QRegExp(".*"), Qt::FindDirectChildrenOnly);
|
||||||
|
|
|
@ -27,29 +27,29 @@ Rectangle {
|
||||||
|
|
||||||
Component.onCompleted: {
|
Component.onCompleted: {
|
||||||
//var functor = Jet.job_tree_model_functor(jobsModel)
|
//var functor = Jet.job_tree_model_functor(jobsModel)
|
||||||
/* var functor = Jet.job_tree_model_functor(jobsModel, 1, function(node) {
|
var functor = Jet.job_tree_model_functor(jobsModel, 3, function(node) {
|
||||||
node["cpuT"] = 0.0
|
node["cpuT"] = 0.0
|
||||||
})
|
})
|
||||||
Jet.task_traverseTree(rootConfig, functor);
|
Jet.task_traverseTree(rootConfig, functor);
|
||||||
|
|
||||||
*/
|
|
||||||
|
|
||||||
var tfunctor = Jet.job_tree_model_array_functor(jobsModel.engineJobItemModel, function(node) {
|
|
||||||
|
/* var tfunctor = Jet.job_tree_model_array_functor(jobsModel.engineJobItemModel, function(node) {
|
||||||
node["init"] = (node.level < 3)
|
node["init"] = (node.level < 3)
|
||||||
node["fullpath"] = (node.path + "." + node.name)
|
node["fullpath"] = (node.path + "." + node.name)
|
||||||
node["cpuT"] = 0.0
|
node["cpuT"] = 0.0
|
||||||
})
|
})
|
||||||
|
|
||||||
Jet.task_traverseTree(rootConfig, tfunctor);
|
Jet.task_traverseTree(rootConfig, tfunctor);
|
||||||
|
*/
|
||||||
// var currentParentStach = []
|
// var currentParentStach = []
|
||||||
// currentParentStach.push(jobsModel);
|
// currentParentStach.push(jobsModel);
|
||||||
|
|
||||||
|
|
||||||
Jet.job_traverseTreeNodeRoot(jobsModel.engineJobItemModel[0], function(node, depth, index) {
|
/* Jet.job_traverseTreeNodeRoot(jobsModel.engineJobItemModel[0], function(node, depth, index) {
|
||||||
print(node.name + depth + " - " + index)
|
print(node.name + depth + " - " + index)
|
||||||
return true
|
return true
|
||||||
})
|
})*/
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -64,7 +64,6 @@ Rectangle {
|
||||||
id: objRecursiveColumn
|
id: objRecursiveColumn
|
||||||
clip: true
|
clip: true
|
||||||
visible: model.init
|
visible: model.init
|
||||||
// visible: (node.level < 2)
|
|
||||||
|
|
||||||
function switchFold() {
|
function switchFold() {
|
||||||
for(var i = 1; i < children.length - 1; ++i) {
|
for(var i = 1; i < children.length - 1; ++i) {
|
||||||
|
|
|
@ -24,13 +24,13 @@ Item {
|
||||||
property var mainViewTask: Render.getConfig("RenderMainView")
|
property var mainViewTask: Render.getConfig("RenderMainView")
|
||||||
|
|
||||||
|
|
||||||
Jet.TaskTimeFrameView {
|
/* Jet.TaskTimeFrameView {
|
||||||
rootConfig: Render
|
|
||||||
anchors.fill: render
|
|
||||||
}
|
|
||||||
/* Jet.TaskListView {
|
|
||||||
rootConfig: Render
|
rootConfig: Render
|
||||||
anchors.fill: render
|
anchors.fill: render
|
||||||
}*/
|
}*/
|
||||||
|
Jet.TaskListView {
|
||||||
|
rootConfig: Render
|
||||||
|
anchors.fill: render
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
Loading…
Reference in a new issue