mirror of
https://github.com/overte-org/overte.git
synced 2025-08-09 12:08:54 +02:00
Add profiling in COntext batch execution and shortcuts for trace names
This commit is contained in:
parent
39070fe0d1
commit
8c7ec8b0c5
2 changed files with 10 additions and 0 deletions
|
@ -81,6 +81,7 @@ FramePointer Context::endFrame() {
|
||||||
}
|
}
|
||||||
|
|
||||||
void Context::executeBatch(Batch& batch) const {
|
void Context::executeBatch(Batch& batch) const {
|
||||||
|
PROFILE_RANGE(render_gpu, __FUNCTION__);
|
||||||
batch.flush();
|
batch.flush();
|
||||||
_backend->render(batch);
|
_backend->render(batch);
|
||||||
}
|
}
|
||||||
|
@ -94,6 +95,8 @@ void Context::consumeFrameUpdates(const FramePointer& frame) const {
|
||||||
}
|
}
|
||||||
|
|
||||||
void Context::executeFrame(const FramePointer& frame) const {
|
void Context::executeFrame(const FramePointer& frame) const {
|
||||||
|
PROFILE_RANGE(render_gpu, __FUNCTION__);
|
||||||
|
|
||||||
// Grab the stats at the around the frame and delta to have a consistent sampling
|
// Grab the stats at the around the frame and delta to have a consistent sampling
|
||||||
ContextStats beginStats;
|
ContextStats beginStats;
|
||||||
getStats(beginStats);
|
getStats(beginStats);
|
||||||
|
|
|
@ -16,6 +16,7 @@
|
||||||
#include <QtCore/QFileInfo>
|
#include <QtCore/QFileInfo>
|
||||||
#include <QtCore/QDir>
|
#include <QtCore/QDir>
|
||||||
#include <QtCore/QStandardPaths>
|
#include <QtCore/QStandardPaths>
|
||||||
|
#include <QtCore/QDateTime>
|
||||||
|
|
||||||
#include <QtCore/QFile>
|
#include <QtCore/QFile>
|
||||||
#include <QtCore/QFileInfo>
|
#include <QtCore/QFileInfo>
|
||||||
|
@ -107,6 +108,12 @@ void Tracer::serialize(const QString& originalPath) {
|
||||||
|
|
||||||
QString path = originalPath;
|
QString path = originalPath;
|
||||||
|
|
||||||
|
// Filter for specific tokens potentially present in the path:
|
||||||
|
auto now = QDateTime::currentDateTime();
|
||||||
|
|
||||||
|
path = path.replace("{DATE}", now.date().toString("yyyyMMdd"));
|
||||||
|
path = path.replace("{TIME}", now.time().toString("HHmm"));
|
||||||
|
|
||||||
// If the filename is relative, turn it into an absolute path relative to the document directory.
|
// If the filename is relative, turn it into an absolute path relative to the document directory.
|
||||||
QFileInfo originalFileInfo(path);
|
QFileInfo originalFileInfo(path);
|
||||||
if (originalFileInfo.isRelative()) {
|
if (originalFileInfo.isRelative()) {
|
||||||
|
|
Loading…
Reference in a new issue