Added Script command to test if GPU memory size is stable.

This commit is contained in:
NissimHadar 2019-03-29 15:46:43 -07:00
parent f926298020
commit 303dabd93c
3 changed files with 15 additions and 1 deletions

View file

@ -468,6 +468,8 @@ public slots:
QString getGraphicsCardType();
bool gpuTextureMemSizeStable();
private slots:
void onDesktopRootItemCreated(QQuickItem* qmlContext);
void onDesktopRootContextCreated(QQmlContext* qmlContext);
@ -562,7 +564,6 @@ private:
bool importFromZIP(const QString& filePath);
bool importImage(const QString& urlString);
bool gpuTextureMemSizeStable();
int processOctreeStats(ReceivedMessage& message, SharedNodePointer sendingNode);
void trackIncomingOctreePacket(ReceivedMessage& message, SharedNodePointer sendingNode, bool wasStatsPacket);

View file

@ -1026,6 +1026,12 @@ bool EntityScriptingInterface::isLoaded(const QUuid& id) {
return toReturn;
}
bool EntityScriptingInterface::isTextureLoadingComplete() {
bool result;
QMetaObject::invokeMethod(qApp, "gpuTextureMemSizeStable", Qt::DirectConnection, Q_RETURN_ARG(bool, result));
return result;
}
bool EntityScriptingInterface::isAddedEntity(const QUuid& id) {
bool toReturn = false;
_entityTree->withReadLock([&] {

View file

@ -395,6 +395,13 @@ public slots:
*/
Q_INVOKABLE bool isLoaded(const QUuid& id);
/**jsdoc
* Check whether all textures have been loaded.
* @function Entities.areTexturesLoaded
* @returns {boolean} <code>true</code> texture memory usage is not increasing <code>false</code>.
*/
Q_INVOKABLE bool isTextureLoadingComplete();
/**jsdoc
* Check if there is an object of a given ID.
* @function Entities.isAddedEntity