From 0df69b8e15a97c28682d8015182f35c7374fdb6e Mon Sep 17 00:00:00 2001 From: samcake Date: Mon, 3 Oct 2016 10:06:58 -0700 Subject: [PATCH 1/3] Protecting the usage of the defaultSkyboxTexture in case its creation has failed to avoid crash on the first usage, removing an uncorrect assert in GL45BackendTexture that would trigger in debug --- interface/src/Application.cpp | 8 ++++++-- libraries/gpu-gl/src/gpu/gl45/GL45BackendTexture.cpp | 2 -- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/interface/src/Application.cpp b/interface/src/Application.cpp index 3890eae4c3..894471a251 100644 --- a/interface/src/Application.cpp +++ b/interface/src/Application.cpp @@ -4361,8 +4361,12 @@ namespace render { auto scene = DependencyManager::get()->getStage(); auto sceneKeyLight = scene->getKeyLight(); auto defaultSkyboxAmbientTexture = qApp->getDefaultSkyboxAmbientTexture(); - sceneKeyLight->setAmbientSphere(defaultSkyboxAmbientTexture->getIrradiance()); - sceneKeyLight->setAmbientMap(defaultSkyboxAmbientTexture); + if (defaultSkyboxAmbientTexture) { + sceneKeyLight->setAmbientSphere(defaultSkyboxAmbientTexture->getIrradiance()); + sceneKeyLight->setAmbientMap(defaultSkyboxAmbientTexture); + } else { + qWarning() << "Failed to get a valid Default SKybox Ambient Texture ? probably because it couldn't be find during initialization step"; + } // fall through: render defaults skybox } else { break; diff --git a/libraries/gpu-gl/src/gpu/gl45/GL45BackendTexture.cpp b/libraries/gpu-gl/src/gpu/gl45/GL45BackendTexture.cpp index 3e6e53ffc3..36b7b4886f 100644 --- a/libraries/gpu-gl/src/gpu/gl45/GL45BackendTexture.cpp +++ b/libraries/gpu-gl/src/gpu/gl45/GL45BackendTexture.cpp @@ -511,9 +511,7 @@ void GL45Texture::stripToMip(uint16_t newMinMip) { _minMip = newMinMip; // Re-sync the sampler to force access to the new mip level syncSampler(); - size_t oldSize = _size; updateSize(); - Q_ASSERT(_size > oldSize); // Re-insert into the texture-by-mips map if appropriate From 5adedbbb8bfaec1177b406bb0b477a0eb9759534 Mon Sep 17 00:00:00 2001 From: samcake Date: Mon, 3 Oct 2016 11:27:15 -0700 Subject: [PATCH 2/3] replace the simple log by a unique log --- interface/src/Application.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/interface/src/Application.cpp b/interface/src/Application.cpp index 894471a251..e11f5159d8 100644 --- a/interface/src/Application.cpp +++ b/interface/src/Application.cpp @@ -4365,7 +4365,9 @@ namespace render { sceneKeyLight->setAmbientSphere(defaultSkyboxAmbientTexture->getIrradiance()); sceneKeyLight->setAmbientMap(defaultSkyboxAmbientTexture); } else { - qWarning() << "Failed to get a valid Default SKybox Ambient Texture ? probably because it couldn't be find during initialization step"; + static QString repeatedMessage + = LogHandler::getInstance().addRepeatedMessageRegex( + "Failed to get a valid Default Skybox Ambient Texture ? probably because it couldn't be find during initialization step"); } // fall through: render defaults skybox } else { From 0189e3aea7a08e66be47103472f8dfcf62f95012 Mon Sep 17 00:00:00 2001 From: samcake Date: Mon, 3 Oct 2016 11:29:17 -0700 Subject: [PATCH 3/3] Github is borked ? --- interface/src/Application.cpp | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/interface/src/Application.cpp b/interface/src/Application.cpp index e11f5159d8..ec452cb260 100644 --- a/interface/src/Application.cpp +++ b/interface/src/Application.cpp @@ -2170,7 +2170,7 @@ bool Application::event(QEvent* event) { // handle custom URL if (event->type() == QEvent::FileOpen) { - QFileOpenEvent* fileEvent = static_cast(event); + QFileOpenEvent* fileEvent = static_cast(event); QUrl url = fileEvent->url(); @@ -4365,8 +4365,7 @@ namespace render { sceneKeyLight->setAmbientSphere(defaultSkyboxAmbientTexture->getIrradiance()); sceneKeyLight->setAmbientMap(defaultSkyboxAmbientTexture); } else { - static QString repeatedMessage - = LogHandler::getInstance().addRepeatedMessageRegex( + static QString repeatedMessage = LogHandler::getInstance().addRepeatedMessageRegex( "Failed to get a valid Default Skybox Ambient Texture ? probably because it couldn't be find during initialization step"); } // fall through: render defaults skybox