fix loading progress

This commit is contained in:
Dante Ruiz 2018-10-04 15:01:16 -07:00
parent f875bfd0d8
commit bda9735b5d
9 changed files with 29 additions and 15 deletions

View file

@ -6575,6 +6575,7 @@ bool Application::gpuTextureMemSizeStable() {
qint64 textureResourceGPUMemSize = renderStats->textureResourceGPUMemSize;
qint64 texturePopulatedGPUMemSize = renderStats->textureResourcePopulatedGPUMemSize;
qint64 textureTransferSize = renderStats->texturePendingGPUTransferSize;
if (_gpuTextureMemSizeAtLastCheck == textureResourceGPUMemSize) {
_gpuTextureMemSizeStabilityCount++;
@ -6584,8 +6585,10 @@ bool Application::gpuTextureMemSizeStable() {
_gpuTextureMemSizeAtLastCheck = textureResourceGPUMemSize;
if (_gpuTextureMemSizeStabilityCount >= _minimumGPUTextureMemSizeStabilityCount) {
return (textureResourceGPUMemSize == texturePopulatedGPUMemSize);
qDebug() << "GPU checking";
return (textureResourceGPUMemSize == texturePopulatedGPUMemSize) && (textureTransferSize == 0);
}
qDebug() << "GPU not ready";
return false;
}

View file

@ -587,7 +587,7 @@ private:
QElapsedTimer _lastTimeUpdated;
QElapsedTimer _lastTimeRendered;
int _minimumGPUTextureMemSizeStabilityCount { 15 };
int _minimumGPUTextureMemSizeStabilityCount { 20 };
ShapeManager _shapeManager;
PhysicalEntitySimulationPointer _entitySimulation;

View file

@ -83,8 +83,6 @@ void SafeLanding::addTrackedEntity(const EntityItemID& entityID) {
}
qCDebug(interfaceapp) << "Safe Landing: Tracking entity " << entity->getItemName();
}
} else {
qCDebug(interfaceapp) << "Safe Landing: Null Entity: " << entityID;
}
}
@ -109,12 +107,13 @@ void SafeLanding::noteReceivedsequenceNumber(int sequenceNumber) {
}
bool SafeLanding::isLoadSequenceComplete() {
qDebug() << "is sequence complete" << isSequenceNumbersComplete();
if (isEntityLoadingComplete() && isSequenceNumbersComplete()) {
Locker lock(_lock);
_trackedEntities.clear();
_initialStart = INVALID_SEQUENCE;
_initialEnd = INVALID_SEQUENCE;
_entityTree = nullptr;
_trackingEntities = false; // Don't track anything else that comes in.
EntityTreeRenderer::setEntityLoadingPriorityFunction(StandardPriority);
}
@ -148,7 +147,6 @@ bool SafeLanding::isSequenceNumbersComplete() {
(startIter != _sequenceNumbers.end()
&& endIter != _sequenceNumbers.end()
&& distance(startIter, endIter) == sequenceSize - 1)) {
_trackingEntities = false; // Don't track anything else that comes in.
return true;
}
}
@ -187,10 +185,12 @@ bool SafeLanding::isEntityLoadingComplete() {
bool isVisuallyReady = true;
bool enableInterstitial = DependencyManager::get<NodeList>()->getDomainHandler().getInterstitialModeEnabled();
if (enableInterstitial) {
isVisuallyReady = (entity->isVisuallyReady() || !entityTree->renderableForEntityId(entityMapIter->first));
auto entityRenderable = entityTree->renderableForEntityId(entityMapIter->first);
if (!entityRenderable) {
entityTree->addingEntity(entityMapIter->first);
}
isVisuallyReady = entity->isVisuallyReady() || (!entityRenderable && !entity->isParentPathComplete());
}
if (isEntityPhysicsReady(entity) && isVisuallyReady) {

View file

@ -310,10 +310,10 @@ void EntityTreeRenderer::addPendingEntities(const render::ScenePointer& scene, r
}
auto entityID = entity->getEntityItemID();
processedIds.insert(entityID);
auto renderable = EntityRenderer::addToScene(*this, entity, scene, transaction);
if (renderable) {
_entitiesInScene.insert({ entityID, renderable });
processedIds.insert(entityID);
}
}

View file

@ -104,6 +104,10 @@ void ParticleEffectEntityRenderer::doRenderUpdateSynchronousTyped(const ScenePoi
_networkTexture.reset();
});
}
withWriteLock([&] {
entity->setVisuallyReady(true);
});
} else {
bool textureNeedsUpdate = resultWithReadLock<bool>([&]{
return !_networkTexture || _networkTexture->getURL() != QUrl(_particleProperties.textures);
@ -113,6 +117,12 @@ void ParticleEffectEntityRenderer::doRenderUpdateSynchronousTyped(const ScenePoi
_networkTexture = DependencyManager::get<TextureCache>()->getTexture(_particleProperties.textures);
});
}
if (_networkTexture) {
withWriteLock([&] {
entity->setVisuallyReady(_networkTexture->isFailed() || _networkTexture->isLoaded());
});
}
}
void* key = (void*)this;

View file

@ -166,6 +166,7 @@ ParticleEffectEntityItem::ParticleEffectEntityItem(const EntityItemID& entityIte
{
_type = EntityTypes::ParticleEffect;
setColor(DEFAULT_COLOR);
_visuallyReady = false;
}
void ParticleEffectEntityItem::setAlpha(float alpha) {
@ -777,4 +778,4 @@ particle::Properties ParticleEffectEntityItem::getParticleProperties() const {
}
return result;
}
}

View file

@ -231,7 +231,7 @@ private:
QString _pendingPath;
QTimer _settingsTimer;
mutable ReadWriteLockable _interstitialModeSettingLock;
Setting::Handle<bool> _enableInterstitialMode{ "enableInterstitialMode", false };
Setting::Handle<bool> _enableInterstitialMode{ "enableInterstitialMode", true };
QSet<QString> _domainConnectionRefusals;
bool _hasCheckedForAccessToken { false };

View file

@ -39,8 +39,8 @@ var DEFAULT_SCRIPTS_SEPARATE = [
];
if (Window.interstitialModeEnabled) {
DEFAULT_SCRIPTS_SEPARATE.push("system/interstitialPage.js");
DEFAULT_SCRIPTS_SEPARATE.push("system/redirectOverlays.js");
DEFAULT_SCRIPTS_COMBINED.push("system/interstitialPage.js");
DEFAULT_SCRIPTS_COMBINED.push("system/redirectOverlays.js");
}
// add a menu item for debugging

View file

@ -472,7 +472,7 @@
textureMemSizeAtLastCheck = textureResourceGPUMemSize;
if (textureMemSizeStabilityCount >= 15) {
if (textureMemSizeStabilityCount >= 20) {
if (textureResourceGPUMemSize > 0) {
print((texturePopulatedGPUMemSize / textureResourceGPUMemSize));