From 6befbdafe96ee823e24085c4c2d2cedd116a824b Mon Sep 17 00:00:00 2001 From: Simon Walton Date: Fri, 17 May 2019 15:31:21 -0700 Subject: [PATCH 01/32] Logging for DomainList reception & timebox overruns --- libraries/networking/src/NodeList.cpp | 7 +++++++ libraries/networking/src/udt/Socket.cpp | 5 +++++ 2 files changed, 12 insertions(+) diff --git a/libraries/networking/src/NodeList.cpp b/libraries/networking/src/NodeList.cpp index 3a80745115..7d5a60c52b 100644 --- a/libraries/networking/src/NodeList.cpp +++ b/libraries/networking/src/NodeList.cpp @@ -622,6 +622,13 @@ void NodeList::processDomainServerList(QSharedPointer message) // refuse to process this packet if we aren't currently connected to the DS return; } +#ifdef DEBUG_EVENT_QUEUE + { + int nodeListQueueSize = ::hifi::qt::getEventQueueSize(thread()); + qCDebug(networking) << "DomainList received, pending count =" << _domainHandler.getCheckInPacketsSinceLastReply() + << "NodeList thread event queue size =" << nodeListQueueSize; + } +#endif // this is a packet from the domain server, reset the count of un-replied check-ins _domainHandler.clearPendingCheckins(); diff --git a/libraries/networking/src/udt/Socket.cpp b/libraries/networking/src/udt/Socket.cpp index 7829e3727c..2130d5bc6f 100644 --- a/libraries/networking/src/udt/Socket.cpp +++ b/libraries/networking/src/udt/Socket.cpp @@ -334,6 +334,11 @@ void Socket::readPendingDatagrams() { if (system_clock::now() > abortTime) { // We've been running for too long, stop processing packets for now // Once we've processed the event queue, we'll come back to packet processing +#ifdef DEBUG_EVENT_QUEUE + int nodeListQueueSize = ::hifi::qt::getEventQueueSize(thread()); + qCDebug(networking) << "Overran timebox by" << duration_cast(system_clock::now() - abortTime).count() + << "ms; NodeList thread event queue size =" << nodeListQueueSize; +#endif break; } From 916ff31cf6bbe79ba39937a02ad4bf9d884e0449 Mon Sep 17 00:00:00 2001 From: Sam Gateau Date: Thu, 30 May 2019 17:51:21 -0700 Subject: [PATCH 02/32] adjust the preset options --- interface/src/PerformanceManager.cpp | 2 ++ interface/src/PerformanceManager.h | 3 ++- interface/src/scripting/PerformanceScriptingInterface.cpp | 2 +- interface/src/scripting/PerformanceScriptingInterface.h | 1 + 4 files changed, 6 insertions(+), 2 deletions(-) diff --git a/interface/src/PerformanceManager.cpp b/interface/src/PerformanceManager.cpp index 9e96763ff6..fc601fdf8a 100644 --- a/interface/src/PerformanceManager.cpp +++ b/interface/src/PerformanceManager.cpp @@ -57,7 +57,9 @@ void PerformanceManager::applyPerformancePreset(PerformanceManager::PerformanceP qApp->getRefreshRateManager().setRefreshRateProfile(RefreshRateManager::RefreshRateProfile::ECO); break; + case PerformancePreset::UNKNOWN: default: + // Do nothing anymore break; } } diff --git a/interface/src/PerformanceManager.h b/interface/src/PerformanceManager.h index 14742626c3..adbc5804b1 100644 --- a/interface/src/PerformanceManager.h +++ b/interface/src/PerformanceManager.h @@ -20,7 +20,8 @@ class PerformanceManager { public: enum PerformancePreset { - LOW = 0, + UNKNOWN = 0, // Matching the platform Tier profiles enumeration for coherence + LOW, MID, HIGH, PROFILE_COUNT diff --git a/interface/src/scripting/PerformanceScriptingInterface.cpp b/interface/src/scripting/PerformanceScriptingInterface.cpp index 4f7c2b0fda..a571e305d9 100644 --- a/interface/src/scripting/PerformanceScriptingInterface.cpp +++ b/interface/src/scripting/PerformanceScriptingInterface.cpp @@ -28,7 +28,7 @@ PerformanceScriptingInterface::PerformancePreset PerformanceScriptingInterface:: } QStringList PerformanceScriptingInterface::getPerformancePresetNames() const { - static const QStringList performancePresetNames = { "Low", "Mid", "High" }; + static const QStringList performancePresetNames = { "Unknown", "Low", "Mid", "High" }; return performancePresetNames; } diff --git a/interface/src/scripting/PerformanceScriptingInterface.h b/interface/src/scripting/PerformanceScriptingInterface.h index 3dbcd620fa..c416b23b56 100644 --- a/interface/src/scripting/PerformanceScriptingInterface.h +++ b/interface/src/scripting/PerformanceScriptingInterface.h @@ -27,6 +27,7 @@ public: LOW = PerformanceManager::PerformancePreset::LOW, MID = PerformanceManager::PerformancePreset::MID, HIGH = PerformanceManager::PerformancePreset::HIGH, + UNKNOWN = PerformanceManager::PerformancePreset::UNKNOWN, }; Q_ENUM(PerformancePreset) From 4e2480d032321f905f84908f3b36e8dfa0392871 Mon Sep 17 00:00:00 2001 From: Sam Gateau Date: Fri, 31 May 2019 00:00:44 -0700 Subject: [PATCH 03/32] cleaning up case of enum names and aligning the PerformancePreset with the PlatformTier --- .../src/scripting/PerformanceScriptingInterface.cpp | 4 ++-- .../src/scripting/PerformanceScriptingInterface.h | 2 +- .../src/scripting/PlatformInfoScriptingInterface.h | 8 ++++---- interface/src/scripting/RenderScriptingInterface.cpp | 9 ++++++--- interface/src/scripting/RenderScriptingInterface.h | 11 +++++++---- 5 files changed, 20 insertions(+), 14 deletions(-) diff --git a/interface/src/scripting/PerformanceScriptingInterface.cpp b/interface/src/scripting/PerformanceScriptingInterface.cpp index a571e305d9..81f1fcd3ad 100644 --- a/interface/src/scripting/PerformanceScriptingInterface.cpp +++ b/interface/src/scripting/PerformanceScriptingInterface.cpp @@ -28,7 +28,7 @@ PerformanceScriptingInterface::PerformancePreset PerformanceScriptingInterface:: } QStringList PerformanceScriptingInterface::getPerformancePresetNames() const { - static const QStringList performancePresetNames = { "Unknown", "Low", "Mid", "High" }; + static const QStringList performancePresetNames = { "UNKNOWN", "LOW", "MID", "HIGH" }; return performancePresetNames; } @@ -41,7 +41,7 @@ PerformanceScriptingInterface::RefreshRateProfile PerformanceScriptingInterface: } QStringList PerformanceScriptingInterface::getRefreshRateProfileNames() const { - static const QStringList refreshRateProfileNames = { "Eco", "Interactive", "Realtime" }; + static const QStringList refreshRateProfileNames = { "ECO", "INTERACTIVE", "REALTIME" }; return refreshRateProfileNames; } diff --git a/interface/src/scripting/PerformanceScriptingInterface.h b/interface/src/scripting/PerformanceScriptingInterface.h index c416b23b56..bf76261691 100644 --- a/interface/src/scripting/PerformanceScriptingInterface.h +++ b/interface/src/scripting/PerformanceScriptingInterface.h @@ -24,10 +24,10 @@ public: // PerformanceManager PerformancePreset tri state level enums enum PerformancePreset { + UNKNOWN = PerformanceManager::PerformancePreset::UNKNOWN, LOW = PerformanceManager::PerformancePreset::LOW, MID = PerformanceManager::PerformancePreset::MID, HIGH = PerformanceManager::PerformancePreset::HIGH, - UNKNOWN = PerformanceManager::PerformancePreset::UNKNOWN, }; Q_ENUM(PerformancePreset) diff --git a/interface/src/scripting/PlatformInfoScriptingInterface.h b/interface/src/scripting/PlatformInfoScriptingInterface.h index 0ca9dbff1a..476c5c5788 100644 --- a/interface/src/scripting/PlatformInfoScriptingInterface.h +++ b/interface/src/scripting/PlatformInfoScriptingInterface.h @@ -186,8 +186,8 @@ public slots: /**jsdoc * Get the Platform TIer profiled on startup of the Computer - * Platform Tier is an ineger/enum value: - * LOW = 0, MID = 1, HIGH = 2 + * Platform Tier is an integer/enum value: + * UNKNOWN = 0, LOW = 1, MID = 2, HIGH = 3 * @function PlatformInfo.getTierProfiled * @returns {number} The Platform Tier profiled on startup. */ @@ -195,8 +195,8 @@ public slots: /**jsdoc * Get the Platform Tier possible Names as an array of strings - * Platform Tier is an ineger/enum value: - * LOW = 0, MID = 1, HIGH = 2 + * Platform Tier names are: + * [ "UNKNOWN", "LOW", "MID", "HIGH" ] * @function PlatformInfo.getPlatformTierNames * @returns {string} The array of names matching the number returned from PlatformInfo.getTierProfiled */ diff --git a/interface/src/scripting/RenderScriptingInterface.cpp b/interface/src/scripting/RenderScriptingInterface.cpp index 085606179d..3d761a2bb7 100644 --- a/interface/src/scripting/RenderScriptingInterface.cpp +++ b/interface/src/scripting/RenderScriptingInterface.cpp @@ -10,8 +10,6 @@ #include "LightingModel.h" #include "AntialiasingEffect.h" -const QString DEFERRED = "deferred"; -const QString FORWARD = "forward"; RenderScriptingInterface* RenderScriptingInterface::getInstance() { static RenderScriptingInterface sharedInstance; @@ -45,11 +43,12 @@ void RenderScriptingInterface::setRenderMethod(RenderScriptingInterface::RenderM _renderMethodSetting.set(newMethod); config->setBranch(newMethod); emit config->dirtyEnabled(); + emit settingsChanged(); } } QStringList RenderScriptingInterface::getRenderMethodNames() const { - static const QStringList refrenderMethodNames = { "Deferred", "Forward" }; + static const QStringList refrenderMethodNames = { "DEFERRED", "FORWARD" }; return refrenderMethodNames; } @@ -72,6 +71,7 @@ void RenderScriptingInterface::setShadowsEnabled(bool enabled) { Menu::getInstance()->setIsOptionChecked(MenuOption::Shadows, enabled); _shadowsEnabledSetting.set(enabled); lightingModelConfig->setShadow(enabled); + emit settingsChanged(); } } @@ -94,6 +94,7 @@ void RenderScriptingInterface::setAmbientOcclusionEnabled(bool enabled) { Menu::getInstance()->setIsOptionChecked(MenuOption::AmbientOcclusion, enabled); _ambientOcclusionEnabledSetting.set(enabled); lightingModelConfig->setAmbientOcclusion(enabled); + emit settingsChanged(); } } @@ -123,5 +124,7 @@ void RenderScriptingInterface::setAntialiasingEnabled(bool enabled) { mainViewJitterCamConfig->none(); mainViewAntialiasingConfig->setDebugFXAA(true); } + + emit settingsChanged(); } } diff --git a/interface/src/scripting/RenderScriptingInterface.h b/interface/src/scripting/RenderScriptingInterface.h index 16608a7cb4..e2ae8bbff5 100644 --- a/interface/src/scripting/RenderScriptingInterface.h +++ b/interface/src/scripting/RenderScriptingInterface.h @@ -25,10 +25,10 @@ */ class RenderScriptingInterface : public QObject { Q_OBJECT - Q_PROPERTY(RenderMethod renderMethod READ getRenderMethod WRITE setRenderMethod) - Q_PROPERTY(bool shadowsEnabled READ getShadowsEnabled WRITE setShadowsEnabled) - Q_PROPERTY(bool ambientOcclusionEnabled READ getAmbientOcclusionEnabled WRITE setAmbientOcclusionEnabled) - Q_PROPERTY(bool antialiasingEnabled READ getAntialiasingEnabled WRITE setAntialiasingEnabled) + Q_PROPERTY(RenderMethod renderMethod READ getRenderMethod WRITE setRenderMethod NOTIFY settingsChanged) + Q_PROPERTY(bool shadowsEnabled READ getShadowsEnabled WRITE setShadowsEnabled NOTIFY settingsChanged) + Q_PROPERTY(bool ambientOcclusionEnabled READ getAmbientOcclusionEnabled WRITE setAmbientOcclusionEnabled NOTIFY settingsChanged) + Q_PROPERTY(bool antialiasingEnabled READ getAntialiasingEnabled WRITE setAntialiasingEnabled NOTIFY settingsChanged) public: RenderScriptingInterface(); @@ -132,6 +132,9 @@ public slots: */ // void setViewportResolutionScale(float resolutionScale); +signals: + void settingsChanged(); + private: Setting::Handle _renderMethodSetting { "renderMethod", RENDER_FORWARD ? render::Args::RenderMethod::FORWARD : render::Args::RenderMethod::DEFERRED }; Setting::Handle _shadowsEnabledSetting { "shadowsEnabled", true }; From 54d1705f06a3b95b93ebe0470e021d92faab05ca Mon Sep 17 00:00:00 2001 From: Sam Gateau Date: Fri, 31 May 2019 18:42:26 -0700 Subject: [PATCH 04/32] Testing a different approach --- interface/src/Application.cpp | 22 ++--------- interface/src/PerformanceManager.cpp | 26 ++++++++++++- interface/src/PerformanceManager.h | 6 ++- .../scripting/RenderScriptingInterface.cpp | 37 ++++++++++--------- .../src/scripting/RenderScriptingInterface.h | 17 ++++++--- 5 files changed, 64 insertions(+), 44 deletions(-) diff --git a/interface/src/Application.cpp b/interface/src/Application.cpp index ae226598d1..b8a9df72d6 100644 --- a/interface/src/Application.cpp +++ b/interface/src/Application.cpp @@ -5361,25 +5361,9 @@ void Application::loadSettings() { } } - if (_firstRun.get()) { - // If this is our first run, evalute the Platform Tier and assign the matching Performance profile by default. - // A bunch of Performance, Simulation and Render settings will be set to a matching default value from this - - // Here is the mapping between pelatformTIer and performance profile - const std::array platformToPerformancePresetMap = {{ - PerformanceManager::PerformancePreset::MID, // platform::Profiler::UNKNOWN - PerformanceManager::PerformancePreset::LOW, // platform::Profiler::LOW - PerformanceManager::PerformancePreset::MID, // platform::Profiler::MID - PerformanceManager::PerformancePreset::HIGH // platform::Profiler::HIGH - }}; - - // What is our profile? - auto platformTier = platform::Profiler::profilePlatform(); - - // Then let's assign the performance preset setting from it - getPerformanceManager().setPerformancePreset(platformToPerformancePresetMap[platformTier]); - - } + // Setup the PerformanceManager which will enforce the several settings to match the Preset + // On the first run, the Preset is evaluated from the + getPerformanceManager().setupPerformancePresetSettings(_firstRun.get()); // finish initializing the camera, based on everything we checked above. Third person camera will be used if no settings // dictated that we should be in first person diff --git a/interface/src/PerformanceManager.cpp b/interface/src/PerformanceManager.cpp index fc601fdf8a..19bfcd41c7 100644 --- a/interface/src/PerformanceManager.cpp +++ b/interface/src/PerformanceManager.cpp @@ -10,10 +10,34 @@ // #include "PerformanceManager.h" +#include + #include "scripting/RenderScriptingInterface.h" PerformanceManager::PerformanceManager() { + setPerformancePreset((PerformancePreset) _performancePresetSetting.get()); +} + +void PerformanceManager::setupPerformancePresetSettings(bool evaluatePlatformTier) { + if (evaluatePlatformTier || (getPerformancePreset() == UNKNOWN)) { + // If evaluatePlatformTier, evalute the Platform Tier and assign the matching Performance profile by default. + // A bunch of Performance, Simulation and Render settings will be set to a matching default value from this + + // Here is the mapping between pelatformTIer and performance profile + const std::array platformToPerformancePresetMap = { { + PerformanceManager::PerformancePreset::MID, // platform::Profiler::UNKNOWN + PerformanceManager::PerformancePreset::LOW, // platform::Profiler::LOW + PerformanceManager::PerformancePreset::MID, // platform::Profiler::MID + PerformanceManager::PerformancePreset::HIGH // platform::Profiler::HIGH + } }; + + // What is our profile? + auto platformTier = platform::Profiler::profilePlatform(); + + // Then let's assign the performance preset setting from it + setPerformancePreset(platformToPerformancePresetMap[platformTier]); + } } void PerformanceManager::setPerformancePreset(PerformanceManager::PerformancePreset preset) { @@ -27,7 +51,7 @@ void PerformanceManager::setPerformancePreset(PerformanceManager::PerformancePre } PerformanceManager::PerformancePreset PerformanceManager::getPerformancePreset() const { - PerformancePreset preset = PerformancePreset::MID; + PerformancePreset preset = PerformancePreset::UNKNOWN; preset = (PerformancePreset) _performancePresetSettingLock.resultWithReadLock([&] { return _performancePresetSetting.get(); diff --git a/interface/src/PerformanceManager.h b/interface/src/PerformanceManager.h index adbc5804b1..2931d1f17b 100644 --- a/interface/src/PerformanceManager.h +++ b/interface/src/PerformanceManager.h @@ -30,12 +30,16 @@ public: PerformanceManager(); ~PerformanceManager() = default; + // Setup the PerformanceManager which will enforce the several settings to match the Preset + // If evaluatePlatformTier is true, the Preset is evaluated from the Platform::Profiler::profilePlatform() + void setupPerformancePresetSettings(bool evaluatePlatformTier); + void setPerformancePreset(PerformancePreset performancePreset); PerformancePreset getPerformancePreset() const; private: mutable ReadWriteLockable _performancePresetSettingLock; - Setting::Handle _performancePresetSetting { "performancePreset", PerformanceManager::PerformancePreset::MID }; + Setting::Handle _performancePresetSetting { "performancePreset", PerformanceManager::PerformancePreset::UNKNOWN }; // The concrete performance preset changes void applyPerformancePreset(PerformanceManager::PerformancePreset performancePreset); diff --git a/interface/src/scripting/RenderScriptingInterface.cpp b/interface/src/scripting/RenderScriptingInterface.cpp index 3d761a2bb7..af8af131a0 100644 --- a/interface/src/scripting/RenderScriptingInterface.cpp +++ b/interface/src/scripting/RenderScriptingInterface.cpp @@ -10,6 +10,7 @@ #include "LightingModel.h" #include "AntialiasingEffect.h" +std::once_flag RenderScriptingInterface::registry_flag; RenderScriptingInterface* RenderScriptingInterface::getInstance() { static RenderScriptingInterface sharedInstance; @@ -17,32 +18,34 @@ RenderScriptingInterface* RenderScriptingInterface::getInstance() { } RenderScriptingInterface::RenderScriptingInterface() { - setRenderMethod((RenderMethod)_renderMethodSetting.get() == RenderMethod::DEFERRED ? RenderMethod::DEFERRED : RenderMethod::FORWARD); + std::call_once(registry_flag, [] { + qmlRegisterType("RenderEnums", 1, 0, "RenderEnums"); + }); + + setRenderMethod((RenderMethod)_renderMethodSettingLock.resultWithReadLock([&] { + return _renderMethodSetting.get(); + })); setShadowsEnabled(_shadowsEnabledSetting.get()); setAmbientOcclusionEnabled(_ambientOcclusionEnabledSetting.get()); setAntialiasingEnabled(_antialiasingEnabledSetting.get()); } RenderScriptingInterface::RenderMethod RenderScriptingInterface::getRenderMethod() { - return (RenderMethod)_renderMethodSetting.get() == RenderMethod::DEFERRED ? RenderMethod::DEFERRED : RenderMethod::FORWARD; + return (RenderMethod) _renderMethod; } -void RenderScriptingInterface::setRenderMethod(RenderScriptingInterface::RenderMethod renderMethod) { - RenderMethod newMethod = renderMethod == RenderMethod::FORWARD ? RenderMethod::FORWARD : RenderMethod::DEFERRED; - if (_renderMethodSetting.get() == newMethod) { - return; - } +void RenderScriptingInterface::setRenderMethod(RenderMethod renderMethod) { + if (_renderMethod != (int) renderMethod) { + _renderMethodSettingLock.withWriteLock([&] { + _renderMethod = (int)renderMethod; + _renderMethodSetting.set((int)renderMethod); - if (QThread::currentThread() != thread()) { - QMetaObject::invokeMethod(this, "setRenderMethod", Q_ARG(RenderScriptingInterface::RenderMethod, renderMethod)); - return; - } - - auto config = dynamic_cast(qApp->getRenderEngine()->getConfiguration()->getConfig("RenderMainView.DeferredForwardSwitch")); - if (config) { - _renderMethodSetting.set(newMethod); - config->setBranch(newMethod); - emit config->dirtyEnabled(); + auto config = dynamic_cast(qApp->getRenderEngine()->getConfiguration()->getConfig("RenderMainView.DeferredForwardSwitch")); + if (config) { + _renderMethodSetting.set((int)renderMethod); + config->setBranch((int)renderMethod); + } + }); emit settingsChanged(); } } diff --git a/interface/src/scripting/RenderScriptingInterface.h b/interface/src/scripting/RenderScriptingInterface.h index e2ae8bbff5..3a7d2169b4 100644 --- a/interface/src/scripting/RenderScriptingInterface.h +++ b/interface/src/scripting/RenderScriptingInterface.h @@ -25,10 +25,10 @@ */ class RenderScriptingInterface : public QObject { Q_OBJECT - Q_PROPERTY(RenderMethod renderMethod READ getRenderMethod WRITE setRenderMethod NOTIFY settingsChanged) - Q_PROPERTY(bool shadowsEnabled READ getShadowsEnabled WRITE setShadowsEnabled NOTIFY settingsChanged) - Q_PROPERTY(bool ambientOcclusionEnabled READ getAmbientOcclusionEnabled WRITE setAmbientOcclusionEnabled NOTIFY settingsChanged) - Q_PROPERTY(bool antialiasingEnabled READ getAntialiasingEnabled WRITE setAntialiasingEnabled NOTIFY settingsChanged) + // Q_PROPERTY(RenderMethod renderMethod READ getRenderMethod WRITE setRenderMethod NOTIFY settingsChanged) + // Q_PROPERTY(bool shadowsEnabled READ getShadowsEnabled WRITE setShadowsEnabled NOTIFY settingsChanged) + // Q_PROPERTY(bool ambientOcclusionEnabled READ getAmbientOcclusionEnabled WRITE setAmbientOcclusionEnabled NOTIFY settingsChanged) + // Q_PROPERTY(bool antialiasingEnabled READ getAntialiasingEnabled WRITE setAntialiasingEnabled NOTIFY settingsChanged) public: RenderScriptingInterface(); @@ -36,11 +36,11 @@ public: static RenderScriptingInterface* getInstance(); // RenderMethod enum type - enum RenderMethod { + enum class RenderMethod { DEFERRED = render::Args::RenderMethod::DEFERRED, FORWARD = render::Args::RenderMethod::FORWARD, }; - Q_ENUM(RenderMethod); + Q_ENUM(RenderMethod) public slots: /**jsdoc @@ -136,11 +136,16 @@ signals: void settingsChanged(); private: + int _renderMethod { -1 }; + mutable ReadWriteLockable _renderMethodSettingLock; Setting::Handle _renderMethodSetting { "renderMethod", RENDER_FORWARD ? render::Args::RenderMethod::FORWARD : render::Args::RenderMethod::DEFERRED }; + Setting::Handle _shadowsEnabledSetting { "shadowsEnabled", true }; Setting::Handle _ambientOcclusionEnabledSetting { "ambientOcclusionEnabled", false }; Setting::Handle _antialiasingEnabledSetting { "antialiasingEnabled", true }; Setting::Handle _viewportResolutionScaleSetting{ "viewportResolutionScale", 1.0f }; + + static std::once_flag registry_flag; }; #endif // hifi_RenderScriptingInterface_h From a84692281474a72ab92894fc4f90200c6091f624 Mon Sep 17 00:00:00 2001 From: Preston Bezos Date: Mon, 3 Jun 2019 15:16:27 -0700 Subject: [PATCH 05/32] Updated build guide to include a VCPKG environment variable step and fixed step numbering issues --- BUILD_WIN.md | 23 ++++++++++++++++------- 1 file changed, 16 insertions(+), 7 deletions(-) diff --git a/BUILD_WIN.md b/BUILD_WIN.md index 8f8a64a428..eaeb5aba49 100644 --- a/BUILD_WIN.md +++ b/BUILD_WIN.md @@ -34,7 +34,16 @@ If you do not wish to use the Python installation bundled with Visual Studio, yo Download and install the latest version of CMake 3.9. Download the file named win64-x64 Installer from the [CMake Website](https://cmake.org/download/). You can access the installer on this [3.9 Version page](https://cmake.org/files/v3.9/). During installation, make sure to check "Add CMake to system PATH for all users" when prompted. -### Step 5. Running CMake to Generate Build Files + +### Step 3. Create VCPKG environment variable + +* Naviagte to 'Edit the System Environment Variables' Through the start menu. +* Click on 'Environment Variables' +* Select 'New' +* Set "Variable name" to HIFI_VCPKG_BASE +* Set "Variable value" to the same directory you created your build directory in. + +### Step 4. Running CMake to Generate Build Files Run Command Prompt from Start and run the following commands: `cd "%HIFI_DIR%"` @@ -49,21 +58,21 @@ Run `cmake .. -G "Visual Studio 16 2019" -A x64`. Where `%HIFI_DIR%` is the directory for the highfidelity repository. -### Step 6. Making a Build +### Step 5. Making a Build Open `%HIFI_DIR%\build\hifi.sln` using Visual Studio. Change the Solution Configuration (menu ribbon under the menu bar, next to the green play button) from "Debug" to "Release" for best performance. -Create another environment variable (see Step #4) +Create another environment variable (see Step #3) * Set "Variable name": `PreferredToolArchitecture` * Set "Variable value": `x64` Run from the menu bar `Build > Build Solution`. -### Step 7. Testing Interface +### Step 6. Testing Interface -Create another environment variable (see Step #4) +Create another environment variable (see Step #3) * Set "Variable name": `_NO_DEBUG_HEAP` * Set "Variable value": `1` @@ -75,11 +84,11 @@ Note: You can also run Interface by launching it from command line or File Explo ## Troubleshooting -For any problems after Step #7, first try this: +For any problems after Step #6, first try this: * Delete your locally cloned copy of the highfidelity repository * Restart your computer * Redownload the [repository](https://github.com/highfidelity/hifi) -* Restart directions from Step #7 +* Restart directions from Step #6 #### CMake gives you the same error message repeatedly after the build fails From 2a4d0cfaece3aeaf0e1a27a0bb1c9502bc7bee91 Mon Sep 17 00:00:00 2001 From: Sam Gateau Date: Mon, 3 Jun 2019 18:06:28 -0700 Subject: [PATCH 06/32] Addressing the initialization bug not applying REnderMethod properly, Adjusting RefrehRateProfile to Realtime in High performancePreset --- interface/src/Application.cpp | 4 + interface/src/PerformanceManager.cpp | 2 +- .../PerformanceScriptingInterface.cpp | 2 + .../scripting/PerformanceScriptingInterface.h | 6 + .../scripting/RenderScriptingInterface.cpp | 154 ++++++++++-------- .../src/scripting/RenderScriptingInterface.h | 34 +++- .../utilities/lib/jet/qml/TaskPropView.qml | 7 +- .../developer/utilities/lib/prop/PropEnum.qml | 2 +- .../utilities/lib/prop/style/Global.qml | 1 + .../utilities/lib/prop/style/PiCanvasIcon.qml | 22 ++- .../utilities/lib/prop/style/PiCheckBox.qml | 46 +++++- .../utilities/lib/prop/style/PiComboBox.qml | 15 +- .../lib/prop/style/PiFolderPanel.qml | 7 +- .../render/luci/PerformanceSettings.qml | 11 +- .../utilities/render/luci/Platform.qml | 3 +- .../utilities/render/performanceSetup.qml | 53 +++--- 16 files changed, 232 insertions(+), 137 deletions(-) diff --git a/interface/src/Application.cpp b/interface/src/Application.cpp index d1b3d46dfc..34af465485 100644 --- a/interface/src/Application.cpp +++ b/interface/src/Application.cpp @@ -5375,6 +5375,10 @@ void Application::loadSettings() { } } + // Load settings of the RenderScritpingInterface + // Do that explicitely before being used + RenderScriptingInterface::getInstance()->loadSettings(); + // Setup the PerformanceManager which will enforce the several settings to match the Preset // On the first run, the Preset is evaluated from the getPerformanceManager().setupPerformancePresetSettings(_firstRun.get()); diff --git a/interface/src/PerformanceManager.cpp b/interface/src/PerformanceManager.cpp index 19bfcd41c7..e7591e8b57 100644 --- a/interface/src/PerformanceManager.cpp +++ b/interface/src/PerformanceManager.cpp @@ -66,7 +66,7 @@ void PerformanceManager::applyPerformancePreset(PerformanceManager::PerformanceP case PerformancePreset::HIGH: RenderScriptingInterface::getInstance()->setRenderMethod(RenderScriptingInterface::RenderMethod::DEFERRED); RenderScriptingInterface::getInstance()->setShadowsEnabled(true); - qApp->getRefreshRateManager().setRefreshRateProfile(RefreshRateManager::RefreshRateProfile::INTERACTIVE); + qApp->getRefreshRateManager().setRefreshRateProfile(RefreshRateManager::RefreshRateProfile::REALTIME); break; case PerformancePreset::MID: diff --git a/interface/src/scripting/PerformanceScriptingInterface.cpp b/interface/src/scripting/PerformanceScriptingInterface.cpp index bdd0dd2451..33ad9a3f95 100644 --- a/interface/src/scripting/PerformanceScriptingInterface.cpp +++ b/interface/src/scripting/PerformanceScriptingInterface.cpp @@ -21,6 +21,7 @@ PerformanceScriptingInterface::PerformanceScriptingInterface() { void PerformanceScriptingInterface::setPerformancePreset(PerformancePreset performancePreset) { qApp->getPerformanceManager().setPerformancePreset((PerformanceManager::PerformancePreset)performancePreset); + emit settingsChanged(); } PerformanceScriptingInterface::PerformancePreset PerformanceScriptingInterface::getPerformancePreset() const { @@ -34,6 +35,7 @@ QStringList PerformanceScriptingInterface::getPerformancePresetNames() const { void PerformanceScriptingInterface::setRefreshRateProfile(RefreshRateProfile refreshRateProfile) { qApp->getRefreshRateManager().setRefreshRateProfile((RefreshRateManager::RefreshRateProfile)refreshRateProfile); + emit settingsChanged(); } PerformanceScriptingInterface::RefreshRateProfile PerformanceScriptingInterface::getRefreshRateProfile() const { diff --git a/interface/src/scripting/PerformanceScriptingInterface.h b/interface/src/scripting/PerformanceScriptingInterface.h index bf76261691..92d4273dfb 100644 --- a/interface/src/scripting/PerformanceScriptingInterface.h +++ b/interface/src/scripting/PerformanceScriptingInterface.h @@ -20,6 +20,9 @@ class PerformanceScriptingInterface : public QObject { Q_OBJECT + Q_PROPERTY(PerformancePreset performancePreset READ getPerformancePreset WRITE setPerformancePreset NOTIFY settingsChanged) + Q_PROPERTY(RefreshRateProfile refreshRateProfile READ getRefreshRateProfile WRITE setRefreshRateProfile NOTIFY settingsChanged) + public: // PerformanceManager PerformancePreset tri state level enums @@ -56,6 +59,9 @@ public slots: RefreshRateManager::UXMode getUXMode() const; RefreshRateManager::RefreshRateRegime getRefreshRateRegime() const; +signals: + void settingsChanged(); + private: static std::once_flag registry_flag; }; diff --git a/interface/src/scripting/RenderScriptingInterface.cpp b/interface/src/scripting/RenderScriptingInterface.cpp index af8af131a0..4418ff6e46 100644 --- a/interface/src/scripting/RenderScriptingInterface.cpp +++ b/interface/src/scripting/RenderScriptingInterface.cpp @@ -21,34 +21,43 @@ RenderScriptingInterface::RenderScriptingInterface() { std::call_once(registry_flag, [] { qmlRegisterType("RenderEnums", 1, 0, "RenderEnums"); }); +} - setRenderMethod((RenderMethod)_renderMethodSettingLock.resultWithReadLock([&] { - return _renderMethodSetting.get(); - })); - setShadowsEnabled(_shadowsEnabledSetting.get()); - setAmbientOcclusionEnabled(_ambientOcclusionEnabledSetting.get()); - setAntialiasingEnabled(_antialiasingEnabledSetting.get()); +void RenderScriptingInterface::loadSettings() { + _renderSettingLock.withReadLock([&] { + _renderMethod.store(_renderMethodSetting.get()); + _shadowsEnabled.store(_shadowsEnabledSetting.get()); + _ambientOcclusionEnabled.store(_ambientOcclusionEnabledSetting.get()); + _antialiasingEnabled.store(_antialiasingEnabledSetting.get()); + }); + forceRenderMethod((RenderMethod)_renderMethod.load()); + forceShadowsEnabled(_shadowsEnabled.load()); + forceAmbientOcclusionEnabled(_ambientOcclusionEnabled.load()); + forceAntialiasingEnabled(_antialiasingEnabled.load()); } RenderScriptingInterface::RenderMethod RenderScriptingInterface::getRenderMethod() { - return (RenderMethod) _renderMethod; + return (RenderMethod) _renderMethod.load(); } void RenderScriptingInterface::setRenderMethod(RenderMethod renderMethod) { if (_renderMethod != (int) renderMethod) { - _renderMethodSettingLock.withWriteLock([&] { - _renderMethod = (int)renderMethod; - _renderMethodSetting.set((int)renderMethod); - - auto config = dynamic_cast(qApp->getRenderEngine()->getConfiguration()->getConfig("RenderMainView.DeferredForwardSwitch")); - if (config) { - _renderMethodSetting.set((int)renderMethod); - config->setBranch((int)renderMethod); - } - }); + forceRenderMethod(renderMethod); emit settingsChanged(); } } +void RenderScriptingInterface::forceRenderMethod(RenderMethod renderMethod) { + _renderSettingLock.withWriteLock([&] { + _renderMethod = (int)renderMethod; + _renderMethodSetting.set((int)renderMethod); + + auto config = dynamic_cast(qApp->getRenderEngine()->getConfiguration()->getConfig("RenderMainView.DeferredForwardSwitch")); + if (config) { + _renderMethodSetting.set((int)renderMethod); + config->setBranch((int)renderMethod); + } + }); +} QStringList RenderScriptingInterface::getRenderMethodNames() const { static const QStringList refrenderMethodNames = { "DEFERRED", "FORWARD" }; @@ -56,78 +65,83 @@ QStringList RenderScriptingInterface::getRenderMethodNames() const { } bool RenderScriptingInterface::getShadowsEnabled() { - return _shadowsEnabledSetting.get(); + return _shadowsEnabled.load(); } void RenderScriptingInterface::setShadowsEnabled(bool enabled) { - if (_shadowsEnabledSetting.get() == enabled) { - return; - } - - if (QThread::currentThread() != thread()) { - QMetaObject::invokeMethod(this, "setShadowsEnabled", Q_ARG(bool, enabled)); - return; - } - - auto lightingModelConfig = qApp->getRenderEngine()->getConfiguration()->getConfig("RenderMainView.LightingModel"); - if (lightingModelConfig) { - Menu::getInstance()->setIsOptionChecked(MenuOption::Shadows, enabled); - _shadowsEnabledSetting.set(enabled); - lightingModelConfig->setShadow(enabled); + if (_shadowsEnabled != enabled) { + forceShadowsEnabled(enabled); emit settingsChanged(); } } +void RenderScriptingInterface::forceShadowsEnabled(bool enabled) { + _renderSettingLock.withWriteLock([&] { + _shadowsEnabled.store(enabled); + _shadowsEnabledSetting.set(enabled); + + auto lightingModelConfig = qApp->getRenderEngine()->getConfiguration()->getConfig("RenderMainView.LightingModel"); + if (lightingModelConfig) { + Menu::getInstance()->setIsOptionChecked(MenuOption::Shadows, enabled); + lightingModelConfig->setShadow(enabled); + } + }); +} + bool RenderScriptingInterface::getAmbientOcclusionEnabled() { - return _ambientOcclusionEnabledSetting.get(); + return _ambientOcclusionEnabled.load(); } void RenderScriptingInterface::setAmbientOcclusionEnabled(bool enabled) { - if (_ambientOcclusionEnabledSetting.get() == enabled) { - return; - } - - if (QThread::currentThread() != thread()) { - QMetaObject::invokeMethod(this, "setAmbientOcclusionEnabled", Q_ARG(bool, enabled)); - return; - } - - auto lightingModelConfig = qApp->getRenderEngine()->getConfiguration()->getConfig("RenderMainView.LightingModel"); - if (lightingModelConfig) { - Menu::getInstance()->setIsOptionChecked(MenuOption::AmbientOcclusion, enabled); - _ambientOcclusionEnabledSetting.set(enabled); - lightingModelConfig->setAmbientOcclusion(enabled); + if (_ambientOcclusionEnabled.load() != enabled) { + forceAmbientOcclusionEnabled(enabled); emit settingsChanged(); } } +void RenderScriptingInterface::forceAmbientOcclusionEnabled(bool enabled) { + _renderSettingLock.withWriteLock([&] { + _ambientOcclusionEnabled.store(enabled); + _ambientOcclusionEnabledSetting.set(enabled); + + auto lightingModelConfig = qApp->getRenderEngine()->getConfiguration()->getConfig("RenderMainView.LightingModel"); + if (lightingModelConfig) { + Menu::getInstance()->setIsOptionChecked(MenuOption::AmbientOcclusion, enabled); + lightingModelConfig->setAmbientOcclusion(enabled); + } + }); +} + bool RenderScriptingInterface::getAntialiasingEnabled() { - return _antialiasingEnabledSetting.get(); + return _antialiasingEnabled.load(); } void RenderScriptingInterface::setAntialiasingEnabled(bool enabled) { - if (_antialiasingEnabledSetting.get() == enabled) { - return; - } - - if (QThread::currentThread() != thread()) { - QMetaObject::invokeMethod(this, "setAntialiasingEnabled", Q_ARG(bool, enabled)); - return; - } - - auto mainViewJitterCamConfig = qApp->getRenderEngine()->getConfiguration()->getConfig("RenderMainView.JitterCam"); - auto mainViewAntialiasingConfig = qApp->getRenderEngine()->getConfiguration()->getConfig("RenderMainView.Antialiasing"); - if (mainViewJitterCamConfig && mainViewAntialiasingConfig) { - Menu::getInstance()->setIsOptionChecked(MenuOption::AntiAliasing, enabled); - _antialiasingEnabledSetting.set(enabled); - if (enabled) { - mainViewJitterCamConfig->play(); - mainViewAntialiasingConfig->setDebugFXAA(false); - } else { - mainViewJitterCamConfig->none(); - mainViewAntialiasingConfig->setDebugFXAA(true); - } - + if (_antialiasingEnabled.load() != enabled) { + forceAntialiasingEnabled(enabled); emit settingsChanged(); } } + +void RenderScriptingInterface::forceAntialiasingEnabled(bool enabled) { + _renderSettingLock.withWriteLock([&] { + _antialiasingEnabled.store(enabled); + _antialiasingEnabledSetting.set(enabled); + + auto mainViewJitterCamConfig = qApp->getRenderEngine()->getConfiguration()->getConfig("RenderMainView.JitterCam"); + auto mainViewAntialiasingConfig = qApp->getRenderEngine()->getConfiguration()->getConfig("RenderMainView.Antialiasing"); + if (mainViewJitterCamConfig && mainViewAntialiasingConfig) { + Menu::getInstance()->setIsOptionChecked(MenuOption::AntiAliasing, enabled); + if (enabled) { + mainViewJitterCamConfig->play(); + mainViewAntialiasingConfig->setDebugFXAA(false); + } + else { + mainViewJitterCamConfig->none(); + mainViewAntialiasingConfig->setDebugFXAA(true); + } + } + }); +} + + diff --git a/interface/src/scripting/RenderScriptingInterface.h b/interface/src/scripting/RenderScriptingInterface.h index 3a7d2169b4..abfff67f20 100644 --- a/interface/src/scripting/RenderScriptingInterface.h +++ b/interface/src/scripting/RenderScriptingInterface.h @@ -25,10 +25,10 @@ */ class RenderScriptingInterface : public QObject { Q_OBJECT - // Q_PROPERTY(RenderMethod renderMethod READ getRenderMethod WRITE setRenderMethod NOTIFY settingsChanged) - // Q_PROPERTY(bool shadowsEnabled READ getShadowsEnabled WRITE setShadowsEnabled NOTIFY settingsChanged) - // Q_PROPERTY(bool ambientOcclusionEnabled READ getAmbientOcclusionEnabled WRITE setAmbientOcclusionEnabled NOTIFY settingsChanged) - // Q_PROPERTY(bool antialiasingEnabled READ getAntialiasingEnabled WRITE setAntialiasingEnabled NOTIFY settingsChanged) + Q_PROPERTY(RenderMethod renderMethod READ getRenderMethod WRITE setRenderMethod NOTIFY settingsChanged) + Q_PROPERTY(bool shadowsEnabled READ getShadowsEnabled WRITE setShadowsEnabled NOTIFY settingsChanged) + Q_PROPERTY(bool ambientOcclusionEnabled READ getAmbientOcclusionEnabled WRITE setAmbientOcclusionEnabled NOTIFY settingsChanged) + Q_PROPERTY(bool antialiasingEnabled READ getAntialiasingEnabled WRITE setAntialiasingEnabled NOTIFY settingsChanged) public: RenderScriptingInterface(); @@ -42,6 +42,12 @@ public: }; Q_ENUM(RenderMethod) + + // Load Settings + // Synchronize the runtime value to the actual setting + // Need to be called on start up to re-initialize the runtime to the saved setting states + void loadSettings(); + public slots: /**jsdoc * Get a config for a job by name @@ -136,14 +142,26 @@ signals: void settingsChanged(); private: - int _renderMethod { -1 }; - mutable ReadWriteLockable _renderMethodSettingLock; - Setting::Handle _renderMethodSetting { "renderMethod", RENDER_FORWARD ? render::Args::RenderMethod::FORWARD : render::Args::RenderMethod::DEFERRED }; + // One lock to serialize and access safely all the settings + mutable ReadWriteLockable _renderSettingLock; + // Runtime atomic value of each settings + std::atomic_int _renderMethod{ render::Args::RenderMethod::DEFERRED }; + std::atomic_bool _shadowsEnabled{ true }; + std::atomic_bool _ambientOcclusionEnabled{ false }; + std::atomic_bool _antialiasingEnabled { true }; + + // Actual settings saved on disk + Setting::Handle _renderMethodSetting { "renderMethod", RENDER_FORWARD ? render::Args::RenderMethod::FORWARD : render::Args::RenderMethod::DEFERRED }; Setting::Handle _shadowsEnabledSetting { "shadowsEnabled", true }; Setting::Handle _ambientOcclusionEnabledSetting { "ambientOcclusionEnabled", false }; Setting::Handle _antialiasingEnabledSetting { "antialiasingEnabled", true }; - Setting::Handle _viewportResolutionScaleSetting{ "viewportResolutionScale", 1.0f }; + + // Force assign both setting AND runtime value to the parameter value + void forceRenderMethod(RenderMethod renderMethod); + void forceShadowsEnabled(bool enabled); + void forceAmbientOcclusionEnabled(bool enabled); + void forceAntialiasingEnabled(bool enabled); static std::once_flag registry_flag; }; diff --git a/scripts/developer/utilities/lib/jet/qml/TaskPropView.qml b/scripts/developer/utilities/lib/jet/qml/TaskPropView.qml index 165edcf2e1..0dd978be63 100644 --- a/scripts/developer/utilities/lib/jet/qml/TaskPropView.qml +++ b/scripts/developer/utilities/lib/jet/qml/TaskPropView.qml @@ -75,7 +75,12 @@ Prop.PropGroup { filled: root.jobEnabled fillColor: (root.jobEnabled ? global.colorGreenHighlight : global.colorOrangeAccent) icon: 5 - iconMouseArea.onClicked: { toggleJobActivation() } + + MouseArea{ + id: mousearea + anchors.fill: parent + onClicked: { root.toggleJobActivation() } + } } } diff --git a/scripts/developer/utilities/lib/prop/PropEnum.qml b/scripts/developer/utilities/lib/prop/PropEnum.qml index 87c2845c90..c7869050ba 100644 --- a/scripts/developer/utilities/lib/prop/PropEnum.qml +++ b/scripts/developer/utilities/lib/prop/PropEnum.qml @@ -19,7 +19,7 @@ PropItem { property alias enums : valueCombo.model Component.onCompleted: { - // valueVar = root.valueVarGetter(); + valueVar = root.valueVarGetter(); } PropComboBox { diff --git a/scripts/developer/utilities/lib/prop/style/Global.qml b/scripts/developer/utilities/lib/prop/style/Global.qml index bbc8acfa0b..2330d9876c 100644 --- a/scripts/developer/utilities/lib/prop/style/Global.qml +++ b/scripts/developer/utilities/lib/prop/style/Global.qml @@ -29,6 +29,7 @@ Item { readonly property color colorBackHighlight: hifi.colors.baseGrayHighlight readonly property color colorBorderLight: hifi.colors.lightGray readonly property color colorBorderHighight: hifi.colors.blueHighlight + readonly property color colorBorderLighter: hifi.colors.faintGray readonly property color colorOrangeAccent: "#FF6309" readonly property color colorRedAccent: "#C62147" diff --git a/scripts/developer/utilities/lib/prop/style/PiCanvasIcon.qml b/scripts/developer/utilities/lib/prop/style/PiCanvasIcon.qml index 2fc3ed10ec..985ecfdac6 100644 --- a/scripts/developer/utilities/lib/prop/style/PiCanvasIcon.qml +++ b/scripts/developer/utilities/lib/prop/style/PiCanvasIcon.qml @@ -29,11 +29,19 @@ Canvas { } property var fillColor: global.colorBorderHighight - onFillColorChanged: function () { //console.log("fillColor changed to: " + filled ); + onFillColorChanged: function () { //console.log("fillColor changed to: " + fillColor ); requestPaint() } - property alias iconMouseArea: mousearea + property var stroked: true + onStrokedChanged: function () { //console.log("Stroked changed to: " + stroked ); + requestPaint() + } + + property var strokeColor: global.colorBorderLight + onStrokeColorChanged: function () { //console.log("strokeColor changed to: " + strokeColor ); + requestPaint() + } contextType: "2d" onPaint: { @@ -86,14 +94,10 @@ Canvas { if (filled) { context.fillStyle = fillColor; context.fill(); - } else { - context.strokeStyle = fillColor; + } + if (stroked) { + context.strokeStyle = strokeColor; context.stroke(); } } - - MouseArea{ - id: mousearea - anchors.fill: parent - } } \ No newline at end of file diff --git a/scripts/developer/utilities/lib/prop/style/PiCheckBox.qml b/scripts/developer/utilities/lib/prop/style/PiCheckBox.qml index 1e1f03669b..83d9ebd591 100644 --- a/scripts/developer/utilities/lib/prop/style/PiCheckBox.qml +++ b/scripts/developer/utilities/lib/prop/style/PiCheckBox.qml @@ -9,15 +9,47 @@ // import QtQuick 2.7 -import controlsUit 1.0 as HifiControls +import QtQuick.Controls 2.2 -HifiControls.CheckBox { +CheckBox { Global { id: global } - - color: global.fontColor + id: control + text: "" + checked: true + spacing: 0 - //anchors.left: root.splitter.right - //anchors.verticalCenter: root.verticalCenter - //width: root.width * global.valueAreaWidthScale + indicator: Rectangle { + color: global.colorBack + border.color: control.down ? global.colorBorderLighter : global.colorBorderLight + border.width: global.valueBorderWidth + radius: global.valueBorderRadius / 2 + + anchors.left: parent.left + anchors.verticalCenter: parent.verticalCenter + implicitWidth: global.iconWidth + implicitHeight: global.iconWidth + + Rectangle { + visible: control.checked + + color: global.colorBorderHighight + radius: global.valueBorderRadius / 4 + + anchors.horizontalCenter: parent.horizontalCenter + anchors.verticalCenter: parent.verticalCenter + + implicitWidth: global.iconWidth - 2 + implicitHeight: global.iconHeight - 2 + } + } + + contentItem: PiText { + text: control.text + anchors.verticalCenter: parent.verticalCenter + horizontalAlignment: Text.AlignHLeft + anchors.left: control.indicator.right + leftPadding: global.horizontalMargin + } + height: global.slimHeight } \ No newline at end of file diff --git a/scripts/developer/utilities/lib/prop/style/PiComboBox.qml b/scripts/developer/utilities/lib/prop/style/PiComboBox.qml index d9e029b702..92164fefc5 100644 --- a/scripts/developer/utilities/lib/prop/style/PiComboBox.qml +++ b/scripts/developer/utilities/lib/prop/style/PiComboBox.qml @@ -28,7 +28,7 @@ ComboBox { horizontalAlignment: global.valueTextAlign } background: Rectangle { - color:highlighted?global.colorBackHighlight:global.color; + color:highlighted ? global.colorBackHighlight : global.colorBack; } highlighted: valueCombo.highlightedIndex === index } @@ -38,11 +38,8 @@ ComboBox { x: valueCombo.width - width - valueCombo.rightPadding y: valueCombo.topPadding + (valueCombo.availableHeight - height) / 2 - icon: 1 - /*Connections { - target: valueCombo - onPressedChanged: { canvas.icon = control.down + 1 } - }*/ + strokeColor: (valueCombo.down ? global.colorBorderLighter : global.colorBorderLight ) + icon: 1 + valueCombo.down } contentItem: PiText { @@ -56,8 +53,8 @@ ComboBox { background: Rectangle { implicitWidth: 120 implicitHeight: 40 - color: global.color - border.color: valueCombo.popup.visible ? global.colorBorderHighight : global.colorBorderLight + color: global.colorBack + border.color: valueCombo.popup.visible ? global.colorBorderLighter : global.colorBorderLight border.width: global.valueBorderWidth radius: global.valueBorderRadius } @@ -78,7 +75,7 @@ ComboBox { } background: Rectangle { - color: global.color + color: global.colorBack border.color: global.colorBorderHighight radius: global.valueBorderRadius } diff --git a/scripts/developer/utilities/lib/prop/style/PiFolderPanel.qml b/scripts/developer/utilities/lib/prop/style/PiFolderPanel.qml index d66c0708d3..1f476cab75 100644 --- a/scripts/developer/utilities/lib/prop/style/PiFolderPanel.qml +++ b/scripts/developer/utilities/lib/prop/style/PiFolderPanel.qml @@ -72,7 +72,12 @@ Item { anchors.horizontalCenter: parent.horizontalCenter anchors.verticalCenter: parent.verticalCenter fillColor: global.colorOrangeAccent - iconMouseArea.onClicked: { root.isUnfold = !root.isUnfold } + + MouseArea{ + id: mousearea + anchors.fill: parent + onClicked: { root.isUnfold = !root.isUnfold } + } } } diff --git a/scripts/developer/utilities/render/luci/PerformanceSettings.qml b/scripts/developer/utilities/render/luci/PerformanceSettings.qml index 7bb923a25e..ba3ecada9d 100644 --- a/scripts/developer/utilities/render/luci/PerformanceSettings.qml +++ b/scripts/developer/utilities/render/luci/PerformanceSettings.qml @@ -19,7 +19,6 @@ Column { Prop.PropString { label: "Platform Tier" - //object: Performance valueVarSetter: function (v) {} valueVarGetter: function () { return PlatformInfo.getPlatformTierNames()[PlatformInfo.getTierProfiled()]; } @@ -27,17 +26,15 @@ Column { Prop.PropEnum { label: "Performance Preset" - //object: Performance - valueVarSetter: Performance.setPerformancePreset - valueVarGetter: Performance.getPerformancePreset + object: Performance + property: "performancePreset" enums: Performance.getPerformancePresetNames() } Prop.PropEnum { label: "Refresh Rate Profile" - //object: Performance - valueVarSetter: Performance.setRefreshRateProfile - valueVarGetter: Performance.getRefreshRateProfile + object: Performance + property: "refreshRateProfile" enums: Performance.getRefreshRateProfileNames() } } diff --git a/scripts/developer/utilities/render/luci/Platform.qml b/scripts/developer/utilities/render/luci/Platform.qml index 78a32b1749..9c5ffda070 100644 --- a/scripts/developer/utilities/render/luci/Platform.qml +++ b/scripts/developer/utilities/render/luci/Platform.qml @@ -16,7 +16,8 @@ import controlsUit 1.0 as HifiControls import "../../lib/prop" as Prop Column { - width: parent.width + anchors.left: parent.left + anchors.right: parent.right Prop.PropGroup { id: computer diff --git a/scripts/developer/utilities/render/performanceSetup.qml b/scripts/developer/utilities/render/performanceSetup.qml index db7c5619a3..416c074e0f 100644 --- a/scripts/developer/utilities/render/performanceSetup.qml +++ b/scripts/developer/utilities/render/performanceSetup.qml @@ -24,33 +24,42 @@ Rectangle { color: global.colorBack ScrollView { - anchors.fill: parent + anchors.fill: parent clip: true - Column { - anchors.left: parent.left - anchors.right: parent.right + Column { + anchors.left: parent.left + anchors.right: parent.right - Prop.PropFolderPanel { - label: "Performance Settings" - isUnfold: true - panelFrameData: Component { - PerformanceSettings {} + Prop.PropFolderPanel { + label: "Performance Settings" + isUnfold: true + panelFrameData: Component { + PerformanceSettings { + anchors.left: parent.left + anchors.right: parent.right + } + } } - } - Prop.PropFolderPanel { - label: "Render Settings" - isUnfold: true - panelFrameData: Component { - RenderSettings {} + Prop.PropFolderPanel { + label: "Render Settings" + isUnfold: true + panelFrameData: Component { + RenderSettings { + anchors.left: parent.left + anchors.right: parent.right + } + } } + /* Prop.PropFolderPanel { + label: "Platform" + panelFrameData: Component { + Platform { + anchors.left: parent.left + anchors.right: parent.right + } + } + }*/ } - Prop.PropFolderPanel { - label: "Platform" - panelFrameData: Component { - Platform {} - } - } - } } } From c92a68813050df81dd6ccc7db1b4f557336b625d Mon Sep 17 00:00:00 2001 From: Simon Walton Date: Mon, 3 Jun 2019 18:14:49 -0700 Subject: [PATCH 07/32] Don't send AvatarIdentity from mixer if socket not yet active --- assignment-client/src/avatars/AvatarMixer.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/assignment-client/src/avatars/AvatarMixer.cpp b/assignment-client/src/avatars/AvatarMixer.cpp index 2b0df4a9d6..2174d7ff05 100644 --- a/assignment-client/src/avatars/AvatarMixer.cpp +++ b/assignment-client/src/avatars/AvatarMixer.cpp @@ -365,7 +365,7 @@ void AvatarMixer::manageIdentityData(const SharedNodePointer& node) { // there is no need to manage identity data we haven't received yet // so bail early if we've never received an identity packet for this avatar - if (!nodeData || !nodeData->getAvatar().hasProcessedFirstIdentity()) { + if (!nodeData || !nodeData->getAvatar().hasProcessedFirstIdentity() || !node->getActiveSocket()) { return; } From c09ffd23b40841209a21ef0c0f098d60001c2a12 Mon Sep 17 00:00:00 2001 From: Preston Bezos Date: Tue, 4 Jun 2019 09:19:47 -0700 Subject: [PATCH 08/32] made more edits to the build guide to better explain the reasons for certain steps and corrected a couple of errors in previous edits --- BUILD_WIN.md | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/BUILD_WIN.md b/BUILD_WIN.md index eaeb5aba49..04ae6346f7 100644 --- a/BUILD_WIN.md +++ b/BUILD_WIN.md @@ -36,12 +36,14 @@ Download and install the latest version of CMake 3.9. Download the file named win64-x64 Installer from the [CMake Website](https://cmake.org/download/). You can access the installer on this [3.9 Version page](https://cmake.org/files/v3.9/). During installation, make sure to check "Add CMake to system PATH for all users" when prompted. ### Step 3. Create VCPKG environment variable +In the next step you will be using CMake to build hifi, but first it is recommended that you create an environment variable linked to a directory somewhere on your machine you have control over. The directory will hold all temporary files and, in the event of a failed build, will ensure that any dependencies that generated prior to the failure will not need to be generated again. +To create this variable: * Naviagte to 'Edit the System Environment Variables' Through the start menu. * Click on 'Environment Variables' * Select 'New' * Set "Variable name" to HIFI_VCPKG_BASE -* Set "Variable value" to the same directory you created your build directory in. +* Set "Variable value" to any directory that you have control over. ### Step 4. Running CMake to Generate Build Files @@ -68,6 +70,8 @@ Create another environment variable (see Step #3) * Set "Variable name": `PreferredToolArchitecture` * Set "Variable value": `x64` +Restart Visual Studio for the new variable to take affect. + Run from the menu bar `Build > Build Solution`. ### Step 6. Testing Interface @@ -76,6 +80,8 @@ Create another environment variable (see Step #3) * Set "Variable name": `_NO_DEBUG_HEAP` * Set "Variable value": `1` +Restart Visual Studio again. + In Visual Studio, right+click "interface" under the Apps folder in Solution Explorer and select "Set as Startup Project". Run from the menu bar `Debug > Start Debugging`. Now, you should have a full build of High Fidelity and be able to run the Interface using Visual Studio. Please check our [Docs](https://wiki.highfidelity.com/wiki/Main_Page) for more information regarding the programming workflow. From f51e491d853c806ef052c123df10ca125e7e3e93 Mon Sep 17 00:00:00 2001 From: Sam Gateau Date: Tue, 4 Jun 2019 10:11:12 -0700 Subject: [PATCH 09/32] Removing the atomics and fixing mistakes pointed out inreview --- .../scripting/RenderScriptingInterface.cpp | 38 +++++++++---------- .../src/scripting/RenderScriptingInterface.h | 10 ++--- 2 files changed, 24 insertions(+), 24 deletions(-) diff --git a/interface/src/scripting/RenderScriptingInterface.cpp b/interface/src/scripting/RenderScriptingInterface.cpp index 4418ff6e46..730fef3966 100644 --- a/interface/src/scripting/RenderScriptingInterface.cpp +++ b/interface/src/scripting/RenderScriptingInterface.cpp @@ -10,13 +10,14 @@ #include "LightingModel.h" #include "AntialiasingEffect.h" -std::once_flag RenderScriptingInterface::registry_flag; RenderScriptingInterface* RenderScriptingInterface::getInstance() { static RenderScriptingInterface sharedInstance; return &sharedInstance; } +std::once_flag RenderScriptingInterface::registry_flag; + RenderScriptingInterface::RenderScriptingInterface() { std::call_once(registry_flag, [] { qmlRegisterType("RenderEnums", 1, 0, "RenderEnums"); @@ -25,19 +26,19 @@ RenderScriptingInterface::RenderScriptingInterface() { void RenderScriptingInterface::loadSettings() { _renderSettingLock.withReadLock([&] { - _renderMethod.store(_renderMethodSetting.get()); - _shadowsEnabled.store(_shadowsEnabledSetting.get()); - _ambientOcclusionEnabled.store(_ambientOcclusionEnabledSetting.get()); - _antialiasingEnabled.store(_antialiasingEnabledSetting.get()); + _renderMethod = (_renderMethodSetting.get()); + _shadowsEnabled = (_shadowsEnabledSetting.get()); + _ambientOcclusionEnabled = (_ambientOcclusionEnabledSetting.get()); + _antialiasingEnabled = (_antialiasingEnabledSetting.get()); }); - forceRenderMethod((RenderMethod)_renderMethod.load()); - forceShadowsEnabled(_shadowsEnabled.load()); - forceAmbientOcclusionEnabled(_ambientOcclusionEnabled.load()); - forceAntialiasingEnabled(_antialiasingEnabled.load()); + forceRenderMethod((RenderMethod)_renderMethod); + forceShadowsEnabled(_shadowsEnabled); + forceAmbientOcclusionEnabled(_ambientOcclusionEnabled); + forceAntialiasingEnabled(_antialiasingEnabled); } RenderScriptingInterface::RenderMethod RenderScriptingInterface::getRenderMethod() { - return (RenderMethod) _renderMethod.load(); + return (RenderMethod) _renderMethod; } void RenderScriptingInterface::setRenderMethod(RenderMethod renderMethod) { @@ -53,7 +54,6 @@ void RenderScriptingInterface::forceRenderMethod(RenderMethod renderMethod) { auto config = dynamic_cast(qApp->getRenderEngine()->getConfiguration()->getConfig("RenderMainView.DeferredForwardSwitch")); if (config) { - _renderMethodSetting.set((int)renderMethod); config->setBranch((int)renderMethod); } }); @@ -65,7 +65,7 @@ QStringList RenderScriptingInterface::getRenderMethodNames() const { } bool RenderScriptingInterface::getShadowsEnabled() { - return _shadowsEnabled.load(); + return _shadowsEnabled; } void RenderScriptingInterface::setShadowsEnabled(bool enabled) { @@ -77,7 +77,7 @@ void RenderScriptingInterface::setShadowsEnabled(bool enabled) { void RenderScriptingInterface::forceShadowsEnabled(bool enabled) { _renderSettingLock.withWriteLock([&] { - _shadowsEnabled.store(enabled); + _shadowsEnabled = (enabled); _shadowsEnabledSetting.set(enabled); auto lightingModelConfig = qApp->getRenderEngine()->getConfiguration()->getConfig("RenderMainView.LightingModel"); @@ -89,11 +89,11 @@ void RenderScriptingInterface::forceShadowsEnabled(bool enabled) { } bool RenderScriptingInterface::getAmbientOcclusionEnabled() { - return _ambientOcclusionEnabled.load(); + return _ambientOcclusionEnabled; } void RenderScriptingInterface::setAmbientOcclusionEnabled(bool enabled) { - if (_ambientOcclusionEnabled.load() != enabled) { + if (_ambientOcclusionEnabled != enabled) { forceAmbientOcclusionEnabled(enabled); emit settingsChanged(); } @@ -101,7 +101,7 @@ void RenderScriptingInterface::setAmbientOcclusionEnabled(bool enabled) { void RenderScriptingInterface::forceAmbientOcclusionEnabled(bool enabled) { _renderSettingLock.withWriteLock([&] { - _ambientOcclusionEnabled.store(enabled); + _ambientOcclusionEnabled = (enabled); _ambientOcclusionEnabledSetting.set(enabled); auto lightingModelConfig = qApp->getRenderEngine()->getConfiguration()->getConfig("RenderMainView.LightingModel"); @@ -113,11 +113,11 @@ void RenderScriptingInterface::forceAmbientOcclusionEnabled(bool enabled) { } bool RenderScriptingInterface::getAntialiasingEnabled() { - return _antialiasingEnabled.load(); + return _antialiasingEnabled; } void RenderScriptingInterface::setAntialiasingEnabled(bool enabled) { - if (_antialiasingEnabled.load() != enabled) { + if (_antialiasingEnabled != enabled) { forceAntialiasingEnabled(enabled); emit settingsChanged(); } @@ -125,7 +125,7 @@ void RenderScriptingInterface::setAntialiasingEnabled(bool enabled) { void RenderScriptingInterface::forceAntialiasingEnabled(bool enabled) { _renderSettingLock.withWriteLock([&] { - _antialiasingEnabled.store(enabled); + _antialiasingEnabled = (enabled); _antialiasingEnabledSetting.set(enabled); auto mainViewJitterCamConfig = qApp->getRenderEngine()->getConfiguration()->getConfig("RenderMainView.JitterCam"); diff --git a/interface/src/scripting/RenderScriptingInterface.h b/interface/src/scripting/RenderScriptingInterface.h index abfff67f20..df2e138b08 100644 --- a/interface/src/scripting/RenderScriptingInterface.h +++ b/interface/src/scripting/RenderScriptingInterface.h @@ -145,11 +145,11 @@ private: // One lock to serialize and access safely all the settings mutable ReadWriteLockable _renderSettingLock; - // Runtime atomic value of each settings - std::atomic_int _renderMethod{ render::Args::RenderMethod::DEFERRED }; - std::atomic_bool _shadowsEnabled{ true }; - std::atomic_bool _ambientOcclusionEnabled{ false }; - std::atomic_bool _antialiasingEnabled { true }; + // Runtime value of each settings + int _renderMethod{ RENDER_FORWARD ? render::Args::RenderMethod::FORWARD : render::Args::RenderMethod::DEFERRED }; + bool _shadowsEnabled{ true }; + bool _ambientOcclusionEnabled{ false }; + bool _antialiasingEnabled { true }; // Actual settings saved on disk Setting::Handle _renderMethodSetting { "renderMethod", RENDER_FORWARD ? render::Args::RenderMethod::FORWARD : render::Args::RenderMethod::DEFERRED }; From 1c5740e5e83d81e15ef64c8861c56d2d51e70e7e Mon Sep 17 00:00:00 2001 From: Preston Bezos Date: Tue, 4 Jun 2019 11:02:09 -0700 Subject: [PATCH 10/32] increased clarity of description for step 3 and fixed typo --- BUILD_WIN.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/BUILD_WIN.md b/BUILD_WIN.md index 04ae6346f7..965cb70ec6 100644 --- a/BUILD_WIN.md +++ b/BUILD_WIN.md @@ -36,7 +36,7 @@ Download and install the latest version of CMake 3.9. Download the file named win64-x64 Installer from the [CMake Website](https://cmake.org/download/). You can access the installer on this [3.9 Version page](https://cmake.org/files/v3.9/). During installation, make sure to check "Add CMake to system PATH for all users" when prompted. ### Step 3. Create VCPKG environment variable -In the next step you will be using CMake to build hifi, but first it is recommended that you create an environment variable linked to a directory somewhere on your machine you have control over. The directory will hold all temporary files and, in the event of a failed build, will ensure that any dependencies that generated prior to the failure will not need to be generated again. +In the next step, you will use CMake to build High Fidelity. By default, the CMake process builds dependency files in Windows' `%TEMP%` directory, which is periodically cleared by the operating system. To prevent you from having to re-build the dependencies in the event that Windows clears that directory, we recommend that you create a `HIFI_VCPKG_BASE` environment variable linked to a directory somewhere on your machine. That directory will contain all dependency files until you manually remove them. To create this variable: * Naviagte to 'Edit the System Environment Variables' Through the start menu. @@ -70,7 +70,7 @@ Create another environment variable (see Step #3) * Set "Variable name": `PreferredToolArchitecture` * Set "Variable value": `x64` -Restart Visual Studio for the new variable to take affect. +Restart Visual Studio for the new variable to take effect. Run from the menu bar `Build > Build Solution`. From 06436e6a7d97bca388aeb2f444f73abe127a1276 Mon Sep 17 00:00:00 2001 From: Seth Alves Date: Tue, 4 Jun 2019 12:52:09 -0700 Subject: [PATCH 11/32] quiet build warning --- interface/src/Application.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/interface/src/Application.cpp b/interface/src/Application.cpp index 34af465485..4a0bce5103 100644 --- a/interface/src/Application.cpp +++ b/interface/src/Application.cpp @@ -1311,12 +1311,12 @@ Application::Application(int& argc, char** argv, QElapsedTimer& startupTimer, bo accountManager->setAuthURL(NetworkingConstants::METAVERSE_SERVER_URL()); // use our MyAvatar position and quat for address manager path - addressManager->setPositionGetter([this] { + addressManager->setPositionGetter([] { auto avatarManager = DependencyManager::get(); auto myAvatar = avatarManager ? avatarManager->getMyAvatar() : nullptr; return myAvatar ? myAvatar->getWorldFeetPosition() : Vectors::ZERO; }); - addressManager->setOrientationGetter([this] { + addressManager->setOrientationGetter([] { auto avatarManager = DependencyManager::get(); auto myAvatar = avatarManager ? avatarManager->getMyAvatar() : nullptr; return myAvatar ? myAvatar->getWorldOrientation() : glm::quat(); From c5eb9c03d5a4c37eabfbf5ba47491ec26b9dbfb8 Mon Sep 17 00:00:00 2001 From: Seth Alves Date: Tue, 4 Jun 2019 12:52:28 -0700 Subject: [PATCH 12/32] fix uninitialized read --- interface/src/avatar/MyAvatar.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) mode change 100755 => 100644 interface/src/avatar/MyAvatar.h diff --git a/interface/src/avatar/MyAvatar.h b/interface/src/avatar/MyAvatar.h old mode 100755 new mode 100644 index 058603f320..9fb6c85a78 --- a/interface/src/avatar/MyAvatar.h +++ b/interface/src/avatar/MyAvatar.h @@ -2603,7 +2603,7 @@ private: bool _enableDebugDrawIKChains { false }; bool _enableDebugDrawDetailedCollision { false }; - mutable bool _cauterizationNeedsUpdate; // do we need to scan children and update their "cauterized" state? + mutable bool _cauterizationNeedsUpdate { false }; // do we need to scan children and update their "cauterized" state? AudioListenerMode _audioListenerMode; glm::vec3 _customListenPosition; From d1824c4d6db983f6c1aed77ba0081bf57b7b3125 Mon Sep 17 00:00:00 2001 From: Seth Alves Date: Tue, 4 Jun 2019 12:52:56 -0700 Subject: [PATCH 13/32] remove spammy log --- libraries/animation/src/AnimationCache.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/libraries/animation/src/AnimationCache.cpp b/libraries/animation/src/AnimationCache.cpp index 237fd3da02..e4afbd06e4 100644 --- a/libraries/animation/src/AnimationCache.cpp +++ b/libraries/animation/src/AnimationCache.cpp @@ -136,7 +136,6 @@ void Animation::downloadFinished(const QByteArray& data) { } void Animation::animationParseSuccess(HFMModel::Pointer hfmModel) { - qCDebug(animation) << "Animation parse success"; _hfmModel = hfmModel; finishedLoading(true); } From 426f97fb35bcb5eda693c816613ebd34374e9843 Mon Sep 17 00:00:00 2001 From: Seth Alves Date: Tue, 4 Jun 2019 12:53:12 -0700 Subject: [PATCH 14/32] avoid div by zero --- libraries/avatars-renderer/src/avatars-renderer/Head.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/libraries/avatars-renderer/src/avatars-renderer/Head.cpp b/libraries/avatars-renderer/src/avatars-renderer/Head.cpp index 9cf034863e..2e8bedbb36 100644 --- a/libraries/avatars-renderer/src/avatars-renderer/Head.cpp +++ b/libraries/avatars-renderer/src/avatars-renderer/Head.cpp @@ -230,7 +230,11 @@ void Head::applyEyelidOffset(glm::quat headOrientation) { const float OPEN_DOWN_MULTIPLIER = 0.3f; const float BROW_UP_MULTIPLIER = 0.5f; - glm::vec3 lookAt = glm::normalize(getLookAtPosition() - _eyePosition); + glm::vec3 lookAtVector = getLookAtPosition() - _eyePosition; + if (glm::length2(lookAtVector) == 0.0f) { + return; + } + glm::vec3 lookAt = glm::normalize(lookAtVector); glm::vec3 headUp = headOrientation * Vectors::UNIT_Y; float eyePitch = (PI / 2.0f) - acos(glm::dot(lookAt, headUp)); float eyelidOffset = glm::clamp(abs(eyePitch * EYE_PITCH_TO_COEFFICIENT), 0.0f, MAX_EYELID_OFFSET); From 50e99cc1fdcec772d6f9687b29ba6cfd231ce898 Mon Sep 17 00:00:00 2001 From: Seth Alves Date: Tue, 4 Jun 2019 12:55:04 -0700 Subject: [PATCH 15/32] fix uninitialized read --- libraries/entities-renderer/src/RenderableGizmoEntityItem.h | 2 +- libraries/shared/src/GizmoType.h | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/libraries/entities-renderer/src/RenderableGizmoEntityItem.h b/libraries/entities-renderer/src/RenderableGizmoEntityItem.h index 2061bb0bca..ba59fdc728 100644 --- a/libraries/entities-renderer/src/RenderableGizmoEntityItem.h +++ b/libraries/entities-renderer/src/RenderableGizmoEntityItem.h @@ -33,7 +33,7 @@ private: virtual void doRenderUpdateAsynchronousTyped(const TypedEntityPointer& entity) override; virtual void doRender(RenderArgs* args) override; - GizmoType _gizmoType; + GizmoType _gizmoType { UNSET_GIZMO_TYPE }; RingGizmoPropertyGroup _ringProperties; PrimitiveMode _prevPrimitiveMode; diff --git a/libraries/shared/src/GizmoType.h b/libraries/shared/src/GizmoType.h index ce57fe97c2..464fef087d 100644 --- a/libraries/shared/src/GizmoType.h +++ b/libraries/shared/src/GizmoType.h @@ -26,6 +26,7 @@ enum GizmoType { RING = 0, + UNSET_GIZMO_TYPE }; class GizmoTypeHelpers { From 8a9f3b9508dc6c748bd831944d7d070f9253c508 Mon Sep 17 00:00:00 2001 From: Seth Alves Date: Tue, 4 Jun 2019 12:56:08 -0700 Subject: [PATCH 16/32] fix uninitialized read --- .../entities-renderer/src/RenderableMaterialEntityItem.h | 4 ++-- libraries/shared/src/MaterialMappingMode.h | 3 ++- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/libraries/entities-renderer/src/RenderableMaterialEntityItem.h b/libraries/entities-renderer/src/RenderableMaterialEntityItem.h index d714727c7a..0c347155e0 100644 --- a/libraries/entities-renderer/src/RenderableMaterialEntityItem.h +++ b/libraries/entities-renderer/src/RenderableMaterialEntityItem.h @@ -41,8 +41,8 @@ private: quint16 _priority; QUuid _parentID; - MaterialMappingMode _materialMappingMode; - bool _materialRepeat; + MaterialMappingMode _materialMappingMode { UNSET_MATERIAL_MAPPING_MODE }; + bool _materialRepeat { false }; glm::vec2 _materialMappingPos; glm::vec2 _materialMappingScale; float _materialMappingRot; diff --git a/libraries/shared/src/MaterialMappingMode.h b/libraries/shared/src/MaterialMappingMode.h index 848c2aa28c..190c0603b2 100644 --- a/libraries/shared/src/MaterialMappingMode.h +++ b/libraries/shared/src/MaterialMappingMode.h @@ -13,7 +13,8 @@ enum MaterialMappingMode { UV = 0, - PROJECTED + PROJECTED, + UNSET_MATERIAL_MAPPING_MODE }; class MaterialMappingModeHelpers { From 766a5c7f81ba6fb8a594aa152d8398e114817f53 Mon Sep 17 00:00:00 2001 From: Seth Alves Date: Tue, 4 Jun 2019 12:56:29 -0700 Subject: [PATCH 17/32] avoid div by zero --- .../entities-renderer/src/RenderablePolyLineEntityItem.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/libraries/entities-renderer/src/RenderablePolyLineEntityItem.cpp b/libraries/entities-renderer/src/RenderablePolyLineEntityItem.cpp index d7246f9ba5..6cdc25d7b3 100644 --- a/libraries/entities-renderer/src/RenderablePolyLineEntityItem.cpp +++ b/libraries/entities-renderer/src/RenderablePolyLineEntityItem.cpp @@ -177,6 +177,9 @@ void PolyLineEntityRenderer::doRenderUpdateSynchronousTyped(const ScenePointer& void PolyLineEntityRenderer::updateGeometry() { int maxNumVertices = std::min(_points.length(), _normals.length()); + if (maxNumVertices < 1) { + return; + } bool doesStrokeWidthVary = false; if (_widths.size() > 0) { float prevWidth = _widths[0]; From 7ee64258ec0430745e1139f82a6b110ab578372d Mon Sep 17 00:00:00 2001 From: Seth Alves Date: Tue, 4 Jun 2019 12:57:20 -0700 Subject: [PATCH 18/32] fix uninitialized read --- .../entities-renderer/src/RenderablePolyLineEntityItem.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/libraries/entities-renderer/src/RenderablePolyLineEntityItem.h b/libraries/entities-renderer/src/RenderablePolyLineEntityItem.h index adb30362da..fa6fff98d7 100644 --- a/libraries/entities-renderer/src/RenderablePolyLineEntityItem.h +++ b/libraries/entities-renderer/src/RenderablePolyLineEntityItem.h @@ -51,9 +51,9 @@ protected: float _textureAspectRatio { 1.0f }; bool _textureLoaded { false }; - bool _isUVModeStretch; - bool _faceCamera; - bool _glow; + bool _isUVModeStretch { false }; + bool _faceCamera { false }; + bool _glow { false }; size_t _numVertices; gpu::BufferPointer _polylineDataBuffer; From 8a32d230a880c930f010d7f498ce1003d9d26eba Mon Sep 17 00:00:00 2001 From: Seth Alves Date: Tue, 4 Jun 2019 12:57:36 -0700 Subject: [PATCH 19/32] avoid div by zero --- libraries/entities/src/EntityTree.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/libraries/entities/src/EntityTree.cpp b/libraries/entities/src/EntityTree.cpp index 652266bd48..dbc347631d 100644 --- a/libraries/entities/src/EntityTree.cpp +++ b/libraries/entities/src/EntityTree.cpp @@ -827,7 +827,12 @@ EntityItemID EntityTree::evalRayIntersection(const glm::vec3& origin, const glm: PickFilter searchFilter, OctreeElementPointer& element, float& distance, BoxFace& face, glm::vec3& surfaceNormal, QVariantMap& extraInfo, Octree::lockType lockType, bool* accurateResult) { - RayArgs args = { origin, direction, 1.0f / direction, entityIdsToInclude, entityIdsToDiscard, + + // calculate dirReciprocal like this rather than with glm's scalar / vec3 template to avoid NaNs. + vec3 dirReciprocal = glm::vec3(direction.x == 0.0f ? 0.0f : 1.0f / direction.x, + direction.y == 0.0f ? 0.0f : 1.0f / direction.y, + direction.z == 0.0f ? 0.0f : 1.0f / direction.z); + RayArgs args = { origin, direction, dirReciprocal, entityIdsToInclude, entityIdsToDiscard, searchFilter, element, distance, face, surfaceNormal, extraInfo, EntityItemID() }; distance = FLT_MAX; From 32de196a2ce43cc579a528ce4ac7ae83d60fd109 Mon Sep 17 00:00:00 2001 From: Seth Alves Date: Tue, 4 Jun 2019 12:57:55 -0700 Subject: [PATCH 20/32] remove some spammy logging --- libraries/fbx/src/FBXSerializer_Node.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/libraries/fbx/src/FBXSerializer_Node.cpp b/libraries/fbx/src/FBXSerializer_Node.cpp index 717bc113dd..a2772d02d7 100644 --- a/libraries/fbx/src/FBXSerializer_Node.cpp +++ b/libraries/fbx/src/FBXSerializer_Node.cpp @@ -385,7 +385,6 @@ FBXNode FBXSerializer::parseFBX(QIODevice* device) { quint32 fileVersion; in >> fileVersion; position += sizeof(fileVersion); - qCDebug(modelformat) << "fileVersion:" << fileVersion; bool has64BitPositions = (fileVersion >= FBX_VERSION_2016); // parse the top-level node From 16d259f54fdbc44d88b899532a3c2b69972496aa Mon Sep 17 00:00:00 2001 From: Seth Alves Date: Tue, 4 Jun 2019 12:58:15 -0700 Subject: [PATCH 21/32] fix uninitialized read --- libraries/image/src/image/Image.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libraries/image/src/image/Image.h b/libraries/image/src/image/Image.h index 129061900f..dd39383dfb 100644 --- a/libraries/image/src/image/Image.h +++ b/libraries/image/src/image/Image.h @@ -128,7 +128,7 @@ namespace image { QImage _packedData; FloatPixels _floatData; glm::ivec2 _dims; - Format _format; + Format _format { Format_Invalid }; }; } // namespace image From 0d2bc23a63cf649cb74ab67344ad66fc07daeb49 Mon Sep 17 00:00:00 2001 From: Seth Alves Date: Tue, 4 Jun 2019 12:58:33 -0700 Subject: [PATCH 22/32] avoid crash on shutdown --- libraries/networking/src/LimitedNodeList.cpp | 9 --------- libraries/networking/src/LimitedNodeList.h | 11 +++++++++-- 2 files changed, 9 insertions(+), 11 deletions(-) diff --git a/libraries/networking/src/LimitedNodeList.cpp b/libraries/networking/src/LimitedNodeList.cpp index 0eda2ee2e0..4ab1843ec3 100644 --- a/libraries/networking/src/LimitedNodeList.cpp +++ b/libraries/networking/src/LimitedNodeList.cpp @@ -43,15 +43,6 @@ static Setting::Handle LIMITED_NODELIST_LOCAL_PORT("LimitedNodeList.Loc using namespace std::chrono_literals; static const std::chrono::milliseconds CONNECTION_RATE_INTERVAL_MS = 1s; -const std::set SOLO_NODE_TYPES = { - NodeType::AvatarMixer, - NodeType::AudioMixer, - NodeType::AssetServer, - NodeType::EntityServer, - NodeType::MessagesMixer, - NodeType::EntityScriptServer -}; - LimitedNodeList::LimitedNodeList(int socketListenPort, int dtlsListenPort) : _nodeSocket(this), _packetReceiver(new PacketReceiver(this)) diff --git a/libraries/networking/src/LimitedNodeList.h b/libraries/networking/src/LimitedNodeList.h index 9f4a0177f5..f7ea0ec2ad 100644 --- a/libraries/networking/src/LimitedNodeList.h +++ b/libraries/networking/src/LimitedNodeList.h @@ -53,8 +53,6 @@ const quint64 NODE_SILENCE_THRESHOLD_MSECS = 10 * 1000; static const size_t DEFAULT_MAX_CONNECTION_RATE { std::numeric_limits::max() }; -extern const std::set SOLO_NODE_TYPES; - const char DEFAULT_ASSIGNMENT_SERVER_HOSTNAME[] = "localhost"; const char STUN_SERVER_HOSTNAME[] = "stun.highfidelity.io"; @@ -330,6 +328,15 @@ public: float getInboundKbps() const { return _inboundKbps; } float getOutboundKbps() const { return _outboundKbps; } + const std::set SOLO_NODE_TYPES = { + NodeType::AvatarMixer, + NodeType::AudioMixer, + NodeType::AssetServer, + NodeType::EntityServer, + NodeType::MessagesMixer, + NodeType::EntityScriptServer + }; + public slots: void reset(); void eraseAllNodes(); From 55daef837a8bad4b91fe779fbd55dbbdad27c019 Mon Sep 17 00:00:00 2001 From: Seth Alves Date: Tue, 4 Jun 2019 12:58:50 -0700 Subject: [PATCH 23/32] fix uninitialized read --- .../material-networking/src/material-networking/TextureCache.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libraries/material-networking/src/material-networking/TextureCache.h b/libraries/material-networking/src/material-networking/TextureCache.h index a328622885..754263566b 100644 --- a/libraries/material-networking/src/material-networking/TextureCache.h +++ b/libraries/material-networking/src/material-networking/TextureCache.h @@ -96,7 +96,7 @@ private: friend class KTXReader; friend class ImageReader; - image::TextureUsage::Type _type; + image::TextureUsage::Type _type { image::TextureUsage::UNUSED_TEXTURE }; image::ColorChannel _sourceChannel; enum class ResourceType { From 8018a84e8b47f1d64e4a8bb6fdc2a12fb0460e7b Mon Sep 17 00:00:00 2001 From: Seth Alves Date: Tue, 4 Jun 2019 12:59:03 -0700 Subject: [PATCH 24/32] avoid div by zero --- libraries/render-utils/src/AmbientOcclusionEffect.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/libraries/render-utils/src/AmbientOcclusionEffect.cpp b/libraries/render-utils/src/AmbientOcclusionEffect.cpp index ee53347158..fd0d2c2522 100644 --- a/libraries/render-utils/src/AmbientOcclusionEffect.cpp +++ b/libraries/render-utils/src/AmbientOcclusionEffect.cpp @@ -474,6 +474,10 @@ void AmbientOcclusionEffect::updateBlurParameters() { } const auto occlusionSize = frameSize >> resolutionLevel; + if (occlusionSize.x == 0 || occlusionSize.y == 0) { + return; + } + // Occlusion UV limit hblur._blurAxis.z = occlusionSize.x / float(frameSize.x); hblur._blurAxis.w = occlusionSize.y / float(frameSize.y); From 19b2d35b876bfc4e6c93d0a9cd2ea4210a6eb2fa Mon Sep 17 00:00:00 2001 From: Zach Fox Date: Tue, 4 Jun 2019 13:25:03 -0700 Subject: [PATCH 25/32] Resolve DEV-99: Remove all menus from top bar --- scripts/simplifiedUI/ui/simplifiedUI.js | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/scripts/simplifiedUI/ui/simplifiedUI.js b/scripts/simplifiedUI/ui/simplifiedUI.js index 38d1059da7..295e252ca3 100644 --- a/scripts/simplifiedUI/ui/simplifiedUI.js +++ b/scripts/simplifiedUI/ui/simplifiedUI.js @@ -42,11 +42,7 @@ function runNewDefaultsTogether() { } -// Uncomment this out once the work is actually complete. -// Until then, users are required to access some functionality from the top menu bar. -//var MENU_NAMES = ["File", "Edit", "Display", "View", "Navigate", "Settings", "Developer", "Help"]; -var MENU_NAMES = ["File", "Edit", "Display", "View", "Navigate", "Help", - "Settings > General...", "Settings > Controls...", "Settings > Audio...", "Settings > Graphics...", "Settings > Security..."]; +var MENU_NAMES = ["File", "Edit", "Display", "View", "Navigate", "Settings", "Developer", "Help"]; var keepMenusSetting = Settings.getValue("simplifiedUI/keepMenus", false); function maybeRemoveDesktopMenu() { if (!keepMenusSetting) { From 07c2d80b0ce1231a11ae98270c4ea9a93b20db22 Mon Sep 17 00:00:00 2001 From: Seth Alves Date: Tue, 4 Jun 2019 13:29:16 -0700 Subject: [PATCH 26/32] fix ubuntu debian patch to track changes to Qt library handling --- debian/patches/hifi_use_system_qt.diff | 76 +++++++++++++------------- 1 file changed, 37 insertions(+), 39 deletions(-) diff --git a/debian/patches/hifi_use_system_qt.diff b/debian/patches/hifi_use_system_qt.diff index 2bd7009928..7f42e3e610 100644 --- a/debian/patches/hifi_use_system_qt.diff +++ b/debian/patches/hifi_use_system_qt.diff @@ -1,43 +1,41 @@ -Index: hifi-interface-84/cmake/macros/SetupQt.cmake +Index: hifi/cmake/macros/SetupQt.cmake =================================================================== ---- hifi-interface-84.orig/cmake/macros/SetupQt.cmake -+++ hifi-interface-84/cmake/macros/SetupQt.cmake -@@ -18,19 +18,19 @@ function(calculate_default_qt_dir _QT_VE - elseif(WIN32) - set(QT_DEFAULT_ARCH "msvc2017_64") - else() -- set(QT_DEFAULT_ARCH "gcc_64") -+ set(QT_DEFAULT_ARCH "x86_64-linux-gnu") - endif() +--- hifi.orig/cmake/macros/SetupQt.cmake ++++ hifi/cmake/macros/SetupQt.cmake +@@ -27,7 +27,7 @@ function(calculate_qt5_version result _Q + set(_QT_CORE_DIR "${_QT_DIR}/include/QtCore") + endif() + if(NOT EXISTS "${_QT_CORE_DIR}") +- message(FATAL_ERROR "Could not find 'include/QtCore' in '${_QT_DIR}'") ++ message("Could not find 'include/QtCore' in '${_QT_DIR}'") + endif() + set(subdirs "") + get_sub_directories(subdirs ${_QT_CORE_DIR}) +@@ -71,13 +71,13 @@ macro(setup_qt) - if (WIN32 OR (ANDROID AND ("${CMAKE_HOST_SYSTEM_NAME}" STREQUAL "Windows"))) - set(QT_DEFAULT_ROOT "c:/Qt") - else() -- set(QT_DEFAULT_ROOT "$ENV{HOME}/Qt") -+ set(QT_DEFAULT_ROOT "/usr/lib") - endif() + message("QT_CMAKE_PREFIX_PATH = " ${QT_CMAKE_PREFIX_PATH}) - set_from_env(QT_ROOT QT_ROOT ${QT_DEFAULT_ROOT}) - set_from_env(QT_ARCH QT_ARCH ${QT_DEFAULT_ARCH}) +- # figure out where the qt dir is +- get_filename_component(QT_DIR "${QT_CMAKE_PREFIX_PATH}/../../" ABSOLUTE) +- set(QT_VERSION "unknown") +- calculate_qt5_version(QT_VERSION "${QT_DIR}") +- if (QT_VERSION STREQUAL "unknown") +- message(FATAL_ERROR "Could not determine QT_VERSION") +- endif() ++ # # figure out where the qt dir is ++ # get_filename_component(QT_DIR "${QT_CMAKE_PREFIX_PATH}/../../" ABSOLUTE) ++ # set(QT_VERSION "unknown") ++ # calculate_qt5_version(QT_VERSION "${QT_DIR}") ++ # if (QT_VERSION STREQUAL "unknown") ++ # message(FATAL_ERROR "Could not determine QT_VERSION") ++ # endif() -- set(${_RESULT_NAME} "${QT_ROOT}/${_QT_VERSION}/${QT_ARCH}" PARENT_SCOPE) -+ set(${_RESULT_NAME} "${QT_ROOT}/${QT_ARCH}" PARENT_SCOPE) - endfunction() - - # Sets the QT_CMAKE_PREFIX_PATH and QT_DIR variables -@@ -44,7 +44,7 @@ macro(setup_qt) - endif() - if (("QT_CMAKE_PREFIX_PATH" STREQUAL "") OR (NOT EXISTS "${QT_CMAKE_PREFIX_PATH}")) - calculate_default_qt_dir(${QT_VERSION} QT_DIR) -- set(QT_CMAKE_PREFIX_PATH "${QT_DIR}/lib/cmake") -+ set(QT_CMAKE_PREFIX_PATH "${QT_DIR}/cmake") - else() - # figure out where the qt dir is - get_filename_component(QT_DIR "${QT_CMAKE_PREFIX_PATH}/../../" ABSOLUTE) -Index: hifi-interface-84/interface/CMakeLists.txt + if(WIN32) + # windows shell does not like backslashes expanded on the command line, +Index: hifi/interface/CMakeLists.txt =================================================================== ---- hifi-interface-84.orig/interface/CMakeLists.txt -+++ hifi-interface-84/interface/CMakeLists.txt +--- hifi.orig/interface/CMakeLists.txt ++++ hifi/interface/CMakeLists.txt @@ -35,7 +35,7 @@ else () add_custom_command( OUTPUT ${RESOURCES_RCC} @@ -60,11 +58,11 @@ Index: hifi-interface-84/interface/CMakeLists.txt + endif() - if (SCRIPTS_INSTALL_DIR) -Index: hifi-interface-84/tools/nitpick/CMakeLists.txt + if (DEV_BUILD AND (APPLE OR UNIX)) +Index: hifi/tools/nitpick/CMakeLists.txt =================================================================== ---- hifi-interface-84.orig/tools/nitpick/CMakeLists.txt -+++ hifi-interface-84/tools/nitpick/CMakeLists.txt +--- hifi.orig/tools/nitpick/CMakeLists.txt ++++ hifi/tools/nitpick/CMakeLists.txt @@ -12,7 +12,7 @@ generate_qrc(OUTPUT ${RESOURCES_QRC} PAT add_custom_command( OUTPUT ${RESOURCES_RCC} From 9150cd288f067cda3e0477630ebec0bdafa72755 Mon Sep 17 00:00:00 2001 From: Zach Fox Date: Tue, 4 Jun 2019 13:36:00 -0700 Subject: [PATCH 27/32] Add some logging instead of a scary popup --- scripts/simplifiedUI/ui/simplifiedUI.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/simplifiedUI/ui/simplifiedUI.js b/scripts/simplifiedUI/ui/simplifiedUI.js index 295e252ca3..cdf6a9591a 100644 --- a/scripts/simplifiedUI/ui/simplifiedUI.js +++ b/scripts/simplifiedUI/ui/simplifiedUI.js @@ -531,7 +531,7 @@ function shutdown() { restoreScripts(); if (!keepExistingUIAndScriptsSetting) { - Window.confirm("You'll have to restart Interface to get full functionality back. Clicking yes or no will dismiss this dialog."); + console.log("The Simplified UI script has been shut down. If you notice any strangeness with user interface, please restart this application."); if (!HMD.active) { var toolbar = Toolbars.getToolbar(TOOLBAR_NAME); From 02ff4ea2f524a51d22fb9e9471a68784447d4b46 Mon Sep 17 00:00:00 2001 From: Seth Alves Date: Tue, 4 Jun 2019 15:45:33 -0700 Subject: [PATCH 28/32] add some comments to help future devs --- libraries/shared/src/GizmoType.h | 1 + libraries/shared/src/MaterialMappingMode.h | 1 + 2 files changed, 2 insertions(+) diff --git a/libraries/shared/src/GizmoType.h b/libraries/shared/src/GizmoType.h index 464fef087d..fc047b257d 100644 --- a/libraries/shared/src/GizmoType.h +++ b/libraries/shared/src/GizmoType.h @@ -26,6 +26,7 @@ enum GizmoType { RING = 0, + // put new gizmo-types before this line. UNSET_GIZMO_TYPE }; diff --git a/libraries/shared/src/MaterialMappingMode.h b/libraries/shared/src/MaterialMappingMode.h index 190c0603b2..d95fbb339e 100644 --- a/libraries/shared/src/MaterialMappingMode.h +++ b/libraries/shared/src/MaterialMappingMode.h @@ -14,6 +14,7 @@ enum MaterialMappingMode { UV = 0, PROJECTED, + // put new mapping-modes before this line. UNSET_MATERIAL_MAPPING_MODE }; From 6299d38673b1aa964de664a6462dd09e9bad8e58 Mon Sep 17 00:00:00 2001 From: David Rowe Date: Wed, 5 Jun 2019 14:39:05 +1200 Subject: [PATCH 29/32] Distinguish between Uuid API and Uuid type in JSDoc --- interface/src/ui/overlays/Overlays.h | 8 ++++---- .../src/avatars-renderer/Avatar.h | 4 ++-- .../src/controllers/ScriptingInterface.h | 2 +- libraries/entities/src/EntityItemProperties.cpp | 16 ++++++++-------- .../entities/src/EntityScriptingInterface.h | 10 +++++----- libraries/networking/src/AddressManager.h | 2 +- libraries/script-engine/src/ScriptEngine.h | 2 +- libraries/script-engine/src/ScriptUUID.h | 17 ++++++++--------- libraries/shared/src/RegisteredMetaTypes.h | 6 ++++++ 9 files changed, 36 insertions(+), 31 deletions(-) diff --git a/interface/src/ui/overlays/Overlays.h b/interface/src/ui/overlays/Overlays.h index 0b2994b872..6eaf481efe 100644 --- a/interface/src/ui/overlays/Overlays.h +++ b/interface/src/ui/overlays/Overlays.h @@ -77,7 +77,7 @@ public: * @hifi-avatar * * @property {Uuid} keyboardFocusOverlay - Get or set the {@link Entities.EntityTypes|Web} entity that has keyboard focus. - * If no entity has keyboard focus, get returns null; set to null or {@link Uuid|Uuid.NULL} to + * If no entity has keyboard focus, get returns null; set to null or {@link Uuid(0)|Uuid.NULL} to * clear keyboard focus. */ @@ -122,7 +122,7 @@ public slots: * @function Overlays.addOverlay * @param {Overlays.OverlayType} type - The type of the overlay to add. * @param {Overlays.OverlayProperties} properties - The properties of the overlay to add. - * @returns {Uuid} The ID of the newly created overlay if successful, otherwise {@link Uuid|Uuid.NULL}. + * @returns {Uuid} The ID of the newly created overlay if successful, otherwise {@link Uuid(0)|Uuid.NULL}. * @example Add a cube overlay in front of your avatar. * var overlay = Overlays.addOverlay("cube", { * position: Vec3.sum(MyAvatar.position, Vec3.multiplyQbyV(MyAvatar.orientation, { x: 0, y: 0, z: -3 })), @@ -137,7 +137,7 @@ public slots: * Create a clone of an existing entity (or 2D overlay). * @function Overlays.cloneOverlay * @param {Uuid} id - The ID of the entity/2D overlay to clone. - * @returns {Uuid} The ID of the new object if successful, otherwise {@link Uuid|Uuid.NULL}. + * @returns {Uuid} The ID of the new object if successful, otherwise {@link Uuid(0)|Uuid.NULL}. */ QUuid cloneOverlay(const QUuid& id); @@ -562,7 +562,7 @@ public slots: * Set the Web3D entity that has keyboard focus. * @function Overlays.setKeyboardFocusOverlay * @param {Uuid} id - The ID of the {@link Entities.EntityTypes|Web} entity to set keyboard focus to. Use - * null or {@link Uuid|Uuid.NULL} to unset keyboard focus from an overlay. + * null or {@link Uuid(0)|Uuid.NULL} to unset keyboard focus from an overlay. */ void setKeyboardFocusOverlay(const QUuid& id) { DependencyManager::get()->setKeyboardFocusEntity(id); } diff --git a/libraries/avatars-renderer/src/avatars-renderer/Avatar.h b/libraries/avatars-renderer/src/avatars-renderer/Avatar.h index adafca1d1f..ee0fb6f433 100644 --- a/libraries/avatars-renderer/src/avatars-renderer/Avatar.h +++ b/libraries/avatars-renderer/src/avatars-renderer/Avatar.h @@ -441,7 +441,7 @@ public: /**jsdoc * Gets the ID of the entity of avatar that the avatar is parented to. * @function MyAvatar.getParentID - * @returns {Uuid} The ID of the entity or avatar that the avatar is parented to. {@link Uuid|Uuid.NULL} if not parented. + * @returns {Uuid} The ID of the entity or avatar that the avatar is parented to. {@link Uuid(0)|Uuid.NULL} if not parented. */ // This calls through to the SpatiallyNestable versions, but is here to expose these to JavaScript. Q_INVOKABLE virtual const QUuid getParentID() const override { return SpatiallyNestable::getParentID(); } @@ -450,7 +450,7 @@ public: * Sets the ID of the entity of avatar that the avatar is parented to. * @function MyAvatar.setParentID * @param {Uuid} parentID - The ID of the entity or avatar that the avatar should be parented to. Set to - * {@link Uuid|Uuid.NULL} to unparent. + * {@link Uuid(0)|Uuid.NULL} to unparent. */ // This calls through to the SpatiallyNestable versions, but is here to expose these to JavaScript. Q_INVOKABLE virtual void setParentID(const QUuid& parentID) override; diff --git a/libraries/controllers/src/controllers/ScriptingInterface.h b/libraries/controllers/src/controllers/ScriptingInterface.h index 84396fc8be..6a9a5c9dbb 100644 --- a/libraries/controllers/src/controllers/ScriptingInterface.h +++ b/libraries/controllers/src/controllers/ScriptingInterface.h @@ -263,7 +263,7 @@ namespace controller { * methods. The mapping can then be enabled using {@link Controller.enableMapping|enableMapping} for it to take effect. * @function Controller.newMapping * @param {string} [mappingName=Uuid.generate()] - A unique name for the mapping. If not specified a new UUID generated - * by {@link Uuid.generate} is used. + * by {@link Uuid(0).generate} is used. * @returns {MappingObject} A controller mapping object. * @example Create a simple mapping that makes the right trigger move your avatar up. * var MAPPING_NAME = "com.highfidelity.controllers.example.newMapping"; diff --git a/libraries/entities/src/EntityItemProperties.cpp b/libraries/entities/src/EntityItemProperties.cpp index e5205e86e8..805eabc877 100644 --- a/libraries/entities/src/EntityItemProperties.cpp +++ b/libraries/entities/src/EntityItemProperties.cpp @@ -630,7 +630,7 @@ EntityPropertyFlags EntityItemProperties::getChangedProperties() const { * The value can only be set at entity creation by using the entityHostType parameter in * {@link Entities.addEntity}. Read-only. * @property {Uuid} owningAvatarID=Uuid.NULL - The session ID of the owning avatar if avatarEntity is - * true, otherwise {@link Uuid|Uuid.NULL}. Read-only. + * true, otherwise {@link Uuid(0)|Uuid.NULL}. Read-only. * * @property {string} created - The UTC date and time that the entity was created, in ISO 8601 format as * yyyy-MM-ddTHH:mm:ssZ. Read-only. @@ -728,7 +728,7 @@ EntityPropertyFlags EntityItemProperties::getChangedProperties() const { * button beside the "script URL" field in properties tab of the Create app works. * @property {string} serverScripts="" - The URL of the server entity script, if any, that is attached to the entity. * - * @property {Uuid} parentID=Uuid.NULL - The ID of the entity or avatar that this entity is parented to. {@link Uuid|Uuid.NULL} + * @property {Uuid} parentID=Uuid.NULL - The ID of the entity or avatar that this entity is parented to. {@link Uuid(0)|Uuid.NULL} * if the entity is not parented. * @property {number} parentJointIndex=65535 - The joint of the entity or avatar that this entity is parented to. Use * 65535 or -1 to parent to the entity or avatar's position and orientation rather than a joint. @@ -1174,17 +1174,17 @@ EntityPropertyFlags EntityItemProperties::getChangedProperties() const { * @property {string} zTextureURL="" - URL of the texture to map to surfaces perpendicular to the entity's local z-axis. JPG or * PNG format. If no texture is specified the surfaces display white. * @property {Uuid} xNNeighborID=Uuid.NULL - ID of the neighboring PolyVox entity in the entity's -ve local x-axis direction, - * if you want them joined. Set to {@link Uuid|Uuid.NULL} if there is none or you don't want to join them. + * if you want them joined. Set to {@link Uuid(0)|Uuid.NULL} if there is none or you don't want to join them. * @property {Uuid} yNNeighborID=Uuid.NULL - ID of the neighboring PolyVox entity in the entity's -ve local y-axis direction, - * if you want them joined. Set to {@link Uuid|Uuid.NULL} if there is none or you don't want to join them. + * if you want them joined. Set to {@link Uuid(0)|Uuid.NULL} if there is none or you don't want to join them. * @property {Uuid} zNNeighborID=Uuid.NULL - ID of the neighboring PolyVox entity in the entity's -ve local z-axis direction, - * if you want them joined. Set to {@link Uuid|Uuid.NULL} if there is none or you don't want to join them. + * if you want them joined. Set to {@link Uuid(0)|Uuid.NULL} if there is none or you don't want to join them. * @property {Uuid} xPNeighborID=Uuid.NULL - ID of the neighboring PolyVox entity in the entity's +ve local x-axis direction, - * if you want them joined. Set to {@link Uuid|Uuid.NULL} if there is none or you don't want to join them. + * if you want them joined. Set to {@link Uuid(0)|Uuid.NULL} if there is none or you don't want to join them. * @property {Uuid} yPNeighborID=Uuid.NULL - ID of the neighboring PolyVox entity in the entity's +ve local y-axis direction, - * if you want them joined. Set to {@link Uuid|Uuid.NULL} if there is none or you don't want to join them. + * if you want them joined. Set to {@link Uuid(0)|Uuid.NULL} if there is none or you don't want to join them. * @property {Uuid} zPNeighborID=Uuid.NULL - ID of the neighboring PolyVox entity in the entity's +ve local z-axis direction, - * if you want them joined. Set to {@link Uuid|Uuid.NULL} if there is none or you don't want to join them. + * if you want them joined. Set to {@link Uuid(0)|Uuid.NULL} if there is none or you don't want to join them. * @example Create a textured PolyVox sphere. * var position = Vec3.sum(MyAvatar.position, Vec3.multiplyQbyV(MyAvatar.orientation, { x: 0, y: 0.5, z: -8 })); * var texture = "http://public.highfidelity.com/cozza13/tuscany/Concrete2.jpg"; diff --git a/libraries/entities/src/EntityScriptingInterface.h b/libraries/entities/src/EntityScriptingInterface.h index 39700bfc31..c3b0371029 100644 --- a/libraries/entities/src/EntityScriptingInterface.h +++ b/libraries/entities/src/EntityScriptingInterface.h @@ -114,7 +114,7 @@ public: * @hifi-assignment-client * * @property {Uuid} keyboardFocusEntity - Get or set the {@link Entities.EntityType|Web} entity that has keyboard focus. - * If no entity has keyboard focus, get returns null; set to null or {@link Uuid|Uuid.NULL} to + * If no entity has keyboard focus, get returns null; set to null or {@link Uuid(0)|Uuid.NULL} to * clear keyboard focus. */ /// handles scripting of Entity commands from JS passed to assigned clients @@ -267,7 +267,7 @@ public slots: * follows you to each domain you visit, rendering at the same world coordinates unless it's parented to your avatar. * If "local", the entity is created as a local entity, which will only render for you and isn't sent over the wire. * Otherwise it is created as a normal entity and sent over the entity server. - * @returns {Uuid} The ID of the entity if successfully created, otherwise {@link Uuid|Uuid.NULL}. + * @returns {Uuid} The ID of the entity if successfully created, otherwise {@link Uuid(0)|Uuid.NULL}. * @example Create a box entity in front of your avatar. * var entityID = Entities.addEntity({ * type: "Box", @@ -294,7 +294,7 @@ public slots: * @function Entities.addEntity * @param {Entities.EntityProperties} properties - The properties of the entity to create. * @param {boolean} [avatarEntity=false] - Whether to create an avatar entity or a domain entity - * @returns {Uuid} The ID of the entity if successfully created, otherwise {@link Uuid|Uuid.NULL}. + * @returns {Uuid} The ID of the entity if successfully created, otherwise {@link Uuid(0)|Uuid.NULL}. */ Q_INVOKABLE QUuid addEntity(const EntityItemProperties& properties, bool avatarEntity = false) { entity::HostType entityHostType = avatarEntity ? entity::HostType::AVATAR : entity::HostType::DOMAIN; @@ -312,7 +312,7 @@ public slots: * properties set per its clone related-properties, and its clone-related properties are set to defaults. * @function Entities.cloneEntity * @param {Uuid} entityID - The ID of the entity to clone. - * @returns {Uuid} The ID of the new entity if successfully cloned, otherwise {@link Uuid|Uuid.NULL}. + * @returns {Uuid} The ID of the new entity if successfully cloned, otherwise {@link Uuid(0)|Uuid.NULL}. */ Q_INVOKABLE QUuid cloneEntity(const QUuid& entityID); @@ -1446,7 +1446,7 @@ public slots: * Set the {@link Entities.EntityType|Web} entity that has keyboard focus. * @function Entities.setKeyboardFocusEntity * @param {Uuid} id - The ID of the {@link Entities.EntityType|Web} entity to set keyboard focus to. Use - * null or {@link Uuid|Uuid.NULL} to unset keyboard focus from an entity. + * null or {@link Uuid(0)|Uuid.NULL} to unset keyboard focus from an entity. */ Q_INVOKABLE void setKeyboardFocusEntity(const QUuid& id); diff --git a/libraries/networking/src/AddressManager.h b/libraries/networking/src/AddressManager.h index 3cf5637c5f..8187c23f71 100644 --- a/libraries/networking/src/AddressManager.h +++ b/libraries/networking/src/AddressManager.h @@ -46,7 +46,7 @@ const QString GET_PLACE = "/api/v1/places/%1"; * @hifi-avatar * @hifi-assignment-client * - * @property {Uuid} domainID - A UUID uniquely identifying the domain you're visiting. Is {@link Uuid|Uuid.NULL} if you're not + * @property {Uuid} domainID - A UUID uniquely identifying the domain you're visiting. Is {@link Uuid(0)|Uuid.NULL} if you're not * connected to the domain or are in a serverless domain. * Read-only. * @property {string} hostname - The name of the domain for your current metaverse address (e.g., "AvatarIsland", diff --git a/libraries/script-engine/src/ScriptEngine.h b/libraries/script-engine/src/ScriptEngine.h index e58609f01d..a2b16ed178 100644 --- a/libraries/script-engine/src/ScriptEngine.h +++ b/libraries/script-engine/src/ScriptEngine.h @@ -623,7 +623,7 @@ public: /**jsdoc * @function Script.generateUUID * @returns {Uuid} A new UUID. - * @deprecated This function is deprecated and will be removed. Use {@link Uuid.generate} instead. + * @deprecated This function is deprecated and will be removed. Use {@link Uuid(0).generate|Uuid.generate} instead. */ Q_INVOKABLE QUuid generateUUID() { return QUuid::createUuid(); } diff --git a/libraries/script-engine/src/ScriptUUID.h b/libraries/script-engine/src/ScriptUUID.h index 548bc6a6c8..4f0dfd10b6 100644 --- a/libraries/script-engine/src/ScriptUUID.h +++ b/libraries/script-engine/src/ScriptUUID.h @@ -19,11 +19,10 @@ #include /**jsdoc - * A UUID (Universally Unique IDentifier) is used to uniquely identify entities, avatars, and the like. It is - * represented in JavaScript as a string in the format, {nnnnnnnn-nnnn-nnnn-nnnn-nnnnnnnnnnnn}, where the "n"s are - * hexadecimal digits. + * The Uuid API provides facilities for working with UUIDs. * * @namespace Uuid + * @variation 0 * * @hifi-interface * @hifi-client-entity @@ -42,7 +41,7 @@ class ScriptUUID : public QObject, protected QScriptable { public slots: /**jsdoc * Generates a UUID from a string representation of the UUID. - * @function Uuid.fromString + * @function Uuid(0).fromString * @param {string} string - A string representation of a UUID. The curly braces are optional. * @returns {Uuid} A UUID if the given string is valid, null otherwise. * @example Valid and invalid parameters. @@ -60,7 +59,7 @@ public slots: /**jsdoc * Generates a string representation of a UUID. However, because UUIDs are represented in JavaScript as strings, this is in * effect a no-op. - * @function Uuid.toString + * @function Uuid(0).toString * @param {Uuid} id - The UUID to generate a string from. * @returns {string} - A string representation of the UUID. */ @@ -68,7 +67,7 @@ public slots: /**jsdoc * Generate a new UUID. - * @function Uuid.generate + * @function Uuid(0).generate * @returns {Uuid} A new UUID. * @example Generate a new UUID and reports its JavaScript type. * var uuid = Uuid.generate(); @@ -79,7 +78,7 @@ public slots: /**jsdoc * Test whether two given UUIDs are equal. - * @function Uuid.isEqual + * @function Uuid(0).isEqual * @param {Uuid} idA - The first UUID to compare. * @param {Uuid} idB - The second UUID to compare. * @returns {boolean} true if the two UUIDs are equal, otherwise false. @@ -94,7 +93,7 @@ public slots: /**jsdoc * Test whether a given UUID is null. - * @function Uuid.isNull + * @function Uuid(0).isNull * @param {Uuid} id - The UUID to test. * @returns {boolean} true if the UUID equals Uuid.NULL or is null, otherwise false. * @example Demonstrate true and false cases. @@ -111,7 +110,7 @@ public slots: /**jsdoc * Print to the program log a text label followed by the UUID value. - * @function Uuid.print + * @function Uuid(0).print * @param {string} label - The label to print. * @param {Uuid} id - The UUID to print. * @example Two ways of printing a label plus UUID. diff --git a/libraries/shared/src/RegisteredMetaTypes.h b/libraries/shared/src/RegisteredMetaTypes.h index be10f09da9..3e73ab6177 100644 --- a/libraries/shared/src/RegisteredMetaTypes.h +++ b/libraries/shared/src/RegisteredMetaTypes.h @@ -640,6 +640,12 @@ Q_DECLARE_METATYPE(Collision) QScriptValue collisionToScriptValue(QScriptEngine* engine, const Collision& collision); void collisionFromScriptValue(const QScriptValue &object, Collision& collision); +/**jsdoc + * UUIDs (Universally Unique IDentifiers) are used to uniquely identify entities, avatars, and the like. They are represented + * in JavaScript as strings in the format, "{nnnnnnnn-nnnn-nnnn-nnnn-nnnnnnnnnnnn}", where the "n"s are + * hexadecimal digits. + * @typedef {string} Uuid + */ //Q_DECLARE_METATYPE(QUuid) // don't need to do this for QUuid since it's already a meta type QScriptValue quuidToScriptValue(QScriptEngine* engine, const QUuid& uuid); void quuidFromScriptValue(const QScriptValue& object, QUuid& uuid); From ef56cba71b7f53c42bbe8cb1f2a001fa52394137 Mon Sep 17 00:00:00 2001 From: David Rowe Date: Wed, 5 Jun 2019 14:39:27 +1200 Subject: [PATCH 30/32] Polish Uuid API JSDoc --- libraries/script-engine/src/ScriptUUID.h | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/libraries/script-engine/src/ScriptUUID.h b/libraries/script-engine/src/ScriptUUID.h index 4f0dfd10b6..b667447aaa 100644 --- a/libraries/script-engine/src/ScriptUUID.h +++ b/libraries/script-engine/src/ScriptUUID.h @@ -30,7 +30,7 @@ * @hifi-server-entity * @hifi-assignment-client * - * @property {Uuid} NULL - The null UUID, {00000000-0000-0000-0000-000000000000}. + * @property {Uuid} NULL - The null UUID, "{00000000-0000-0000-0000-000000000000}". */ /// Scriptable interface for a UUID helper class object. Used exclusively in the JavaScript API @@ -66,7 +66,7 @@ public slots: QString toString(const QUuid& id); /**jsdoc - * Generate a new UUID. + * Generates a new UUID. * @function Uuid(0).generate * @returns {Uuid} A new UUID. * @example Generate a new UUID and reports its JavaScript type. @@ -77,7 +77,7 @@ public slots: QUuid generate(); /**jsdoc - * Test whether two given UUIDs are equal. + * Tests whether two UUIDs are equal. * @function Uuid(0).isEqual * @param {Uuid} idA - The first UUID to compare. * @param {Uuid} idB - The second UUID to compare. @@ -92,10 +92,11 @@ public slots: bool isEqual(const QUuid& idA, const QUuid& idB); /**jsdoc - * Test whether a given UUID is null. + * Tests whether a UUID is null. * @function Uuid(0).isNull * @param {Uuid} id - The UUID to test. - * @returns {boolean} true if the UUID equals Uuid.NULL or is null, otherwise false. + * @returns {boolean} true if the UUID equals Uuid.NULL or is null, otherwise + * false. * @example Demonstrate true and false cases. * var uuid; // undefined * print(Uuid.isNull(uuid)); // false @@ -109,7 +110,7 @@ public slots: bool isNull(const QUuid& id); /**jsdoc - * Print to the program log a text label followed by the UUID value. + * Prints a UUID to the program log, as a text label followed by the UUID value. * @function Uuid(0).print * @param {string} label - The label to print. * @param {Uuid} id - The UUID to print. From 42c0362303f832ed0c75c07bf377396947e81e9d Mon Sep 17 00:00:00 2001 From: David Rowe Date: Wed, 5 Jun 2019 15:14:05 +1200 Subject: [PATCH 31/32] Fix link --- libraries/controllers/src/controllers/ScriptingInterface.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libraries/controllers/src/controllers/ScriptingInterface.h b/libraries/controllers/src/controllers/ScriptingInterface.h index 6a9a5c9dbb..05e246deaa 100644 --- a/libraries/controllers/src/controllers/ScriptingInterface.h +++ b/libraries/controllers/src/controllers/ScriptingInterface.h @@ -263,7 +263,7 @@ namespace controller { * methods. The mapping can then be enabled using {@link Controller.enableMapping|enableMapping} for it to take effect. * @function Controller.newMapping * @param {string} [mappingName=Uuid.generate()] - A unique name for the mapping. If not specified a new UUID generated - * by {@link Uuid(0).generate} is used. + * by {@link Uuid(0).generate|Uuid.generate} is used. * @returns {MappingObject} A controller mapping object. * @example Create a simple mapping that makes the right trigger move your avatar up. * var MAPPING_NAME = "com.highfidelity.controllers.example.newMapping"; From a132dad4862af455e8388e2107faabaf65a6da83 Mon Sep 17 00:00:00 2001 From: Ken Cooke Date: Wed, 5 Jun 2019 07:03:18 -0700 Subject: [PATCH 32/32] On platforms where nativeFormatForAudioDevice() is reliable, do not enumerate formats --- libraries/audio-client/src/AudioClient.cpp | 28 ++++++++++++---------- 1 file changed, 15 insertions(+), 13 deletions(-) diff --git a/libraries/audio-client/src/AudioClient.cpp b/libraries/audio-client/src/AudioClient.cpp index 8797b90860..41396811f0 100644 --- a/libraries/audio-client/src/AudioClient.cpp +++ b/libraries/audio-client/src/AudioClient.cpp @@ -616,23 +616,25 @@ bool adjustedFormatForAudioDevice(const QAudioDeviceInfo& audioDevice, qCDebug(audioclient) << "The desired format for audio I/O is" << desiredAudioFormat; -#if defined(Q_OS_ANDROID) || defined(Q_OS_OSX) - // As of Qt5.6, Android returns the native OpenSLES sample rate when possible, else 48000 - // Mac OSX returns the preferred CoreAudio format - if (nativeFormatForAudioDevice(audioDevice, adjustedAudioFormat)) { - return true; - } -#endif - #if defined(Q_OS_WIN) if (IsWindows8OrGreater()) { // On Windows using WASAPI shared-mode, returns the internal mix format - if (nativeFormatForAudioDevice(audioDevice, adjustedAudioFormat)) { - return true; - } - } + return nativeFormatForAudioDevice(audioDevice, adjustedAudioFormat); + } // else enumerate formats #endif - + +#if defined(Q_OS_MAC) + // Mac OSX returns the preferred CoreAudio format + return nativeFormatForAudioDevice(audioDevice, adjustedAudioFormat); +#endif + +#if defined(Q_OS_ANDROID) + // As of Qt5.6, Android returns the native OpenSLES sample rate when possible, else 48000 + if (nativeFormatForAudioDevice(audioDevice, adjustedAudioFormat)) { + return true; + } // else enumerate formats +#endif + adjustedAudioFormat = desiredAudioFormat; //