Add profiling in COntext batch execution and shortcuts for trace names

This commit is contained in:
samcake 2017-01-09 18:05:02 -08:00
parent 39070fe0d1
commit 8c7ec8b0c5
2 changed files with 10 additions and 0 deletions

View file

@ -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);

View file

@ -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()) {