mirror of
https://github.com/overte-org/overte.git
synced 2025-04-08 17:54:20 +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 {
|
||||
PROFILE_RANGE(render_gpu, __FUNCTION__);
|
||||
batch.flush();
|
||||
_backend->render(batch);
|
||||
}
|
||||
|
@ -94,6 +95,8 @@ void Context::consumeFrameUpdates(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
|
||||
ContextStats beginStats;
|
||||
getStats(beginStats);
|
||||
|
|
|
@ -16,6 +16,7 @@
|
|||
#include <QtCore/QFileInfo>
|
||||
#include <QtCore/QDir>
|
||||
#include <QtCore/QStandardPaths>
|
||||
#include <QtCore/QDateTime>
|
||||
|
||||
#include <QtCore/QFile>
|
||||
#include <QtCore/QFileInfo>
|
||||
|
@ -107,6 +108,12 @@ void Tracer::serialize(const QString& 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.
|
||||
QFileInfo originalFileInfo(path);
|
||||
if (originalFileInfo.isRelative()) {
|
||||
|
|
Loading…
Reference in a new issue