Merge pull request #7 from danteruiz/interstitialMerged

Interstitial merged
This commit is contained in:
Wayne Chen 2018-10-04 17:10:27 -07:00 committed by GitHub
commit 89e2cf7153
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
9 changed files with 40 additions and 13 deletions

View file

@ -6597,6 +6597,7 @@ bool Application::gpuTextureMemSizeStable() {
qint64 textureResourceGPUMemSize = renderStats->textureResourceGPUMemSize;
qint64 texturePopulatedGPUMemSize = renderStats->textureResourcePopulatedGPUMemSize;
qint64 textureTransferSize = renderStats->texturePendingGPUTransferSize;
if (_gpuTextureMemSizeAtLastCheck == textureResourceGPUMemSize) {
_gpuTextureMemSizeStabilityCount++;
@ -6606,8 +6607,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

@ -583,7 +583,7 @@ private:
QElapsedTimer _lastTimeUpdated;
QElapsedTimer _lastTimeRendered;
int _minimumGPUTextureMemSizeStabilityCount { 15 };
int _minimumGPUTextureMemSizeStabilityCount { 30 };
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,10 @@ bool SafeLanding::isSequenceNumbersComplete() {
(startIter != _sequenceNumbers.end()
&& endIter != _sequenceNumbers.end()
&& distance(startIter, endIter) == sequenceSize - 1)) {
_trackingEntities = false; // Don't track anything else that comes in.
bool enableInterstitial = DependencyManager::get<NodeList>()->getDomainHandler().getInterstitialModeEnabled();
if (!enableInterstitial) {
_trackingEntities = false; // Don't track anything else that comes in.
}
return true;
}
}
@ -188,7 +190,14 @@ bool SafeLanding::isEntityLoadingComplete() {
bool isVisuallyReady = true;
if (enableInterstitial) {
isVisuallyReady = (entity->isVisuallyReady() || !entityTree->renderableForEntityId(entityMapIter->first));
bool hasRenderable = true;
auto entityRenderable = entityTree->renderableForEntityId(entityMapIter->first);
if (!entityRenderable) {
hasRenderable = false;
entityTree->addingEntity(entityMapIter->first);
}
qDebug() << EntityTypes::getEntityTypeName(entity->getType()) << entity->isVisuallyReady() << hasRenderable << entity->isParentPathComplete();
isVisuallyReady = entity->isVisuallyReady() || (!entityRenderable && !entity->isParentPathComplete());
}
if (isEntityPhysicsReady(entity) && isVisuallyReady) {
@ -202,6 +211,10 @@ bool SafeLanding::isEntityLoadingComplete() {
}
}
if (!_trackedEntities.empty()) {
qDebug() << "\n";
}
if (enableInterstitial) {
_trackedEntityStabilityCount++;
}

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

@ -40,8 +40,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));