Merge branch 'RC65' of https://github.com/highfidelity/hifi into new-master

This commit is contained in:
Atlante45 2018-03-06 15:33:12 -08:00
commit edeed95ccc
7 changed files with 18 additions and 50 deletions

View file

@ -257,11 +257,7 @@ Item {
id: octreeCol id: octreeCol
spacing: 4; x: 4; y: 4; spacing: 4; x: 4; y: 4;
StatText { StatText {
text: "Render Engine: " + root.engineFrameTime.toFixed(1) + " ms" text: "Engine: " + root.engineFrameTime.toFixed(1) + " ms"
}
StatText {
visible: root.expanded
text: root.renderEngineStats
} }
StatText { StatText {
text: "Batch: " + root.batchFrameTime.toFixed(1) + " ms" text: "Batch: " + root.batchFrameTime.toFixed(1) + " ms"

View file

@ -482,7 +482,7 @@ void Stats::updateStats(bool force) {
float dt = (float)itr.value().getMovingAverage() / (float)USECS_PER_MSEC; float dt = (float)itr.value().getMovingAverage() / (float)USECS_PER_MSEC;
_gameUpdateStats = QString("/idle/update = %1 ms").arg(dt); _gameUpdateStats = QString("/idle/update = %1 ms").arg(dt);
QVector<QString> categories = { "devices", "physics", "otherAvatars", "MyAvatar", "pickManager", "postUpdateLambdas", "misc" }; QVector<QString> categories = { "devices", "physics", "otherAvatars", "MyAvatar", "misc" };
for (int32_t j = 0; j < categories.size(); ++j) { for (int32_t j = 0; j < categories.size(); ++j) {
QString recordKey = "/idle/update/" + categories[j]; QString recordKey = "/idle/update/" + categories[j];
itr = allRecords.find(recordKey); itr = allRecords.find(recordKey);
@ -502,39 +502,10 @@ void Stats::updateStats(bool force) {
_gameUpdateStats = ""; _gameUpdateStats = "";
emit gameUpdateStatsChanged(); emit gameUpdateStatsChanged();
} }
itr = allRecords.find("/paintGL/display/EngineRun/Engine");
std::priority_queue<SortableStat> renderEngineStats;
if (itr != allRecords.end()) {
float dt = (float)itr.value().getMovingAverage() / (float)USECS_PER_MSEC;
_renderEngineStats = QString("/render = %1 ms").arg(dt);
QVector<QString> categories = { "RenderMainView", "SecondaryCameraJob", "UpdateScene"};
for (int32_t j = 0; j < categories.size(); ++j) {
QString recordKey = "/paintGL/display/EngineRun/Engine/" + categories[j];
itr = allRecords.find(recordKey);
if (itr != allRecords.end()) {
float dt = (float)itr.value().getMovingAverage() / (float)USECS_PER_MSEC;
QString message = QString("\n %1 = %2").arg(categories[j]).arg(dt);
renderEngineStats.push(SortableStat(message, dt));
}
}
while (!renderEngineStats.empty()) {
SortableStat stat = renderEngineStats.top();
_renderEngineStats += stat.message;
renderEngineStats.pop();
}
emit renderEngineStatsChanged();
} else if (_renderEngineStats != "") {
_renderEngineStats = "";
emit renderEngineStatsChanged();
}
} else if (_showGameUpdateStats) { } else if (_showGameUpdateStats) {
_showGameUpdateStats = false; _showGameUpdateStats = false;
_gameUpdateStats = ""; _gameUpdateStats = "";
_renderEngineStats = "";
emit gameUpdateStatsChanged(); emit gameUpdateStatsChanged();
emit renderEngineStatsChanged();
} }
} }

View file

@ -106,7 +106,6 @@ class Stats : public QQuickItem {
STATS_PROPERTY(QString, lodStatus, QString()) STATS_PROPERTY(QString, lodStatus, QString())
STATS_PROPERTY(QString, timingStats, QString()) STATS_PROPERTY(QString, timingStats, QString())
STATS_PROPERTY(QString, gameUpdateStats, QString()) STATS_PROPERTY(QString, gameUpdateStats, QString())
STATS_PROPERTY(QString, renderEngineStats, QString())
STATS_PROPERTY(int, serverElements, 0) STATS_PROPERTY(int, serverElements, 0)
STATS_PROPERTY(int, serverInternal, 0) STATS_PROPERTY(int, serverInternal, 0)
STATS_PROPERTY(int, serverLeaves, 0) STATS_PROPERTY(int, serverLeaves, 0)
@ -240,7 +239,6 @@ signals:
void localLeavesChanged(); void localLeavesChanged();
void timingStatsChanged(); void timingStatsChanged();
void gameUpdateStatsChanged(); void gameUpdateStatsChanged();
void renderEngineStatsChanged();
void glContextSwapchainMemoryChanged(); void glContextSwapchainMemoryChanged();
void qmlTextureMemoryChanged(); void qmlTextureMemoryChanged();
void texturePendingTransfersChanged(); void texturePendingTransfersChanged();

View file

@ -1778,7 +1778,7 @@ bool Octree::writeToFile(const char* fileName, const OctreeElementPointer& eleme
return success; return success;
} }
bool Octree::toJSON(QJsonDocument* doc, const OctreeElementPointer& element) { bool Octree::toJSONDocument(QJsonDocument* doc, const OctreeElementPointer& element) {
QVariantMap entityDescription; QVariantMap entityDescription;
OctreeElementPointer top; OctreeElementPointer top;
@ -1804,18 +1804,22 @@ bool Octree::toJSON(QJsonDocument* doc, const OctreeElementPointer& element) {
return true; return true;
} }
bool Octree::toGzippedJSON(QByteArray* data, const OctreeElementPointer& element) { bool Octree::toJSON(QByteArray* data, const OctreeElementPointer& element, bool doGzip) {
QJsonDocument doc; QJsonDocument doc;
if (!toJSON(&doc, element)) { if (!toJSONDocument(&doc, element)) {
qCritical("Failed to convert Entities to QVariantMap while converting to json."); qCritical("Failed to convert Entities to QVariantMap while converting to json.");
return false; return false;
} }
QByteArray jsonData = doc.toJson(); if (doGzip) {
QByteArray jsonData = doc.toJson();
if (!gzip(jsonData, *data, -1)) { if (!gzip(jsonData, *data, -1)) {
qCritical("Unable to gzip data while saving to json."); qCritical("Unable to gzip data while saving to json.");
return false; return false;
}
} else {
*data = doc.toJson();
} }
return true; return true;
@ -1825,7 +1829,7 @@ bool Octree::writeToJSONFile(const char* fileName, const OctreeElementPointer& e
qCDebug(octree, "Saving JSON SVO to file %s...", fileName); qCDebug(octree, "Saving JSON SVO to file %s...", fileName);
QByteArray jsonDataForFile; QByteArray jsonDataForFile;
if (!toGzippedJSON(&jsonDataForFile)) { if (!toJSON(&jsonDataForFile, element, doGzip)) {
return false; return false;
} }
@ -1837,7 +1841,6 @@ bool Octree::writeToJSONFile(const char* fileName, const OctreeElementPointer& e
qCritical("Could not write to JSON description of entities."); qCritical("Could not write to JSON description of entities.");
} }
return success; return success;
} }

View file

@ -284,8 +284,8 @@ public:
void loadOctreeFile(const char* fileName); void loadOctreeFile(const char* fileName);
// Octree exporters // Octree exporters
bool toJSON(QJsonDocument* doc, const OctreeElementPointer& element = nullptr); bool toJSONDocument(QJsonDocument* doc, const OctreeElementPointer& element = nullptr);
bool toGzippedJSON(QByteArray* data, const OctreeElementPointer& element = nullptr); bool toJSON(QByteArray* data, const OctreeElementPointer& element = nullptr, bool doGzip = false);
bool writeToFile(const char* filename, const OctreeElementPointer& element = nullptr, QString persistAsFileType = "json.gz"); bool writeToFile(const char* filename, const OctreeElementPointer& element = nullptr, QString persistAsFileType = "json.gz");
bool writeToJSONFile(const char* filename, const OctreeElementPointer& element = nullptr, bool doGzip = false); bool writeToJSONFile(const char* filename, const OctreeElementPointer& element = nullptr, bool doGzip = false);
virtual bool writeToMap(QVariantMap& entityDescription, OctreeElementPointer element, bool skipDefaultValues, virtual bool writeToMap(QVariantMap& entityDescription, OctreeElementPointer element, bool skipDefaultValues,

View file

@ -341,7 +341,7 @@ void OctreePersistThread::sendLatestEntityDataToDS() {
const DomainHandler& domainHandler = nodeList->getDomainHandler(); const DomainHandler& domainHandler = nodeList->getDomainHandler();
QByteArray data; QByteArray data;
if (_tree->toGzippedJSON(&data)) { if (_tree->toJSON(&data, nullptr, true)) {
auto message = NLPacketList::create(PacketType::OctreeDataPersist, QByteArray(), true, true); auto message = NLPacketList::create(PacketType::OctreeDataPersist, QByteArray(), true, true);
message->write(data); message->write(data);
nodeList->sendPacketList(std::move(message), domainHandler.getSockAddr()); nodeList->sendPacketList(std::move(message), domainHandler.getSockAddr());

View file

@ -1278,7 +1278,7 @@ function loaded() {
if (elCloneable.checked) { if (elCloneable.checked) {
elGrabbable.checked = false; elGrabbable.checked = false;
} }
userDataChanger("grabbableKey", "grabbable", elGrabbable, elUserData, properties.dynamic); userDataChanger("grabbableKey", "grabbable", elGrabbable, elUserData, true);
}); });
elCloneableDynamic.addEventListener('change', function(event) { elCloneableDynamic.addEventListener('change', function(event) {
userDataChanger("grabbableKey", "cloneDynamic", event.target, elUserData, -1); userDataChanger("grabbableKey", "cloneDynamic", event.target, elUserData, -1);