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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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