From 070fb25b80669919a3557982190b8ee37dae6e86 Mon Sep 17 00:00:00 2001 From: Brad Davis Date: Thu, 7 Feb 2019 13:33:11 -0800 Subject: [PATCH] Cleaning up differnces from master --- CMakeLists.txt | 9 ++++ cmake/ports/hifi-client-deps/CONTROL | 2 +- interface/src/LODManager.cpp | 1 - interface/src/ui/LoginDialog.cpp | 2 +- .../animation/src/AnimInverseKinematics.cpp | 2 +- .../display-plugins/OpenGLDisplayPlugin.cpp | 1 - .../src/display-plugins/OpenGLDisplayPlugin.h | 3 -- .../display-plugins/hmd/HmdDisplayPlugin.h | 1 - libraries/gl/src/gl/Context.cpp | 3 -- libraries/gl/src/gl/ContextQt.cpp | 1 - libraries/gl/src/gl/OffscreenGLCanvas.cpp | 2 - libraries/gl/src/gl/QOpenGLContextWrapper.cpp | 1 + .../gpu-gl-common/src/gpu/gl/GLBackend.cpp | 6 +-- .../gpu-gl-common/src/gpu/gl/GLBackend.h | 2 +- .../src/gpu/gl45/GL45BackendTexture.cpp | 3 -- scripts/system/goto.js | 51 +++++++++++++++---- scripts/system/html/js/miniTablet.js | 24 ++++----- scripts/system/miniTablet.js | 5 +- tools/CMakeLists.txt | 1 - tools/gpu-frame-player/CMakeLists.txt | 3 +- .../DomainContent/Toybox/pistol/pistol.js | 2 +- 21 files changed, 72 insertions(+), 53 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 4d616e1f3a..bb26afad75 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -81,6 +81,15 @@ if (ANDROID) set(GLES_OPTION ON) set(PLATFORM_QT_COMPONENTS AndroidExtras WebView) add_definitions(-DHIFI_ANDROID_APP=\"${HIFI_ANDROID_APP}\") + if (${HIFI_ANDROID_APP} STREQUAL "questInterface") + # We know the quest hardware has this extension, so we can force the use of instanced stereo + add_definitions(-DHAVE_EXT_clip_cull_distance) + # We can also use multiview stereo techniques + add_definitions(-DHAVE_OVR_multiview2) + add_definitions(-DHAVE_OVR_multiview) + # We can also use our own foveated textures + add_definitions(-DHAVE_QCOM_texture_foveated) + endif() else () set(PLATFORM_QT_COMPONENTS WebEngine) endif () diff --git a/cmake/ports/hifi-client-deps/CONTROL b/cmake/ports/hifi-client-deps/CONTROL index 7887930b6b..7d4727b364 100644 --- a/cmake/ports/hifi-client-deps/CONTROL +++ b/cmake/ports/hifi-client-deps/CONTROL @@ -1,4 +1,4 @@ Source: hifi-client-deps Version: 0 Description: Collected dependencies for High Fidelity applications -Build-Depends: hifi-deps, glslang, nlohmann-json, openvr (windows), sdl2, shaderc, spirv-cross, spirv-tools, vulkanmemoryallocator +Build-Depends: hifi-deps, glslang, nlohmann-json, openvr (windows), sdl2 (!android), spirv-cross (!android), spirv-tools (!android), vulkanmemoryallocator diff --git a/interface/src/LODManager.cpp b/interface/src/LODManager.cpp index 282fe3e2eb..b6fffbb4bd 100644 --- a/interface/src/LODManager.cpp +++ b/interface/src/LODManager.cpp @@ -240,7 +240,6 @@ void LODManager::setAutomaticLODAdjust(bool value) { } bool LODManager::shouldRender(const RenderArgs* args, const AABox& bounds) { - return true; // To decide if the bound should be rendered or not at the specified Args->lodAngle, // we need to compute the apparent angle of the bound from the frustum origin, // and compare it against the lodAngle, if it is greater or equal we should render the content of that bound. diff --git a/interface/src/ui/LoginDialog.cpp b/interface/src/ui/LoginDialog.cpp index a8e234d791..4359318833 100644 --- a/interface/src/ui/LoginDialog.cpp +++ b/interface/src/ui/LoginDialog.cpp @@ -138,7 +138,7 @@ void LoginDialog::login(const QString& username, const QString& password) const void LoginDialog::loginThroughOculus() { qDebug() << "Attempting to login through Oculus"; if (auto oculusPlatformPlugin = PluginManager::getInstance()->getOculusPlatformPlugin()) { - oculusPlatformPlugin->requestNonceAndUserID([] (QString nonce, QString oculusID) { + oculusPlatformPlugin->requestNonceAndUserID([this] (QString nonce, QString oculusID) { DependencyManager::get()->requestAccessTokenWithOculus(nonce, oculusID); }); } diff --git a/libraries/animation/src/AnimInverseKinematics.cpp b/libraries/animation/src/AnimInverseKinematics.cpp index f24ae73855..a1809f3438 100644 --- a/libraries/animation/src/AnimInverseKinematics.cpp +++ b/libraries/animation/src/AnimInverseKinematics.cpp @@ -867,7 +867,7 @@ const AnimPoseVec& AnimInverseKinematics::evaluate(const AnimVariantMap& animVar const AnimPoseVec& AnimInverseKinematics::overlay(const AnimVariantMap& animVars, const AnimContext& context, float dt, AnimVariantMap& triggersOut, const AnimPoseVec& underPoses) { #ifdef Q_OS_ANDROID // disable IK on android - // return underPoses; + return underPoses; #endif // allows solutionSource to be overridden by an animVar diff --git a/libraries/display-plugins/src/display-plugins/OpenGLDisplayPlugin.cpp b/libraries/display-plugins/src/display-plugins/OpenGLDisplayPlugin.cpp index 60b9e2fd32..5b202429ab 100644 --- a/libraries/display-plugins/src/display-plugins/OpenGLDisplayPlugin.cpp +++ b/libraries/display-plugins/src/display-plugins/OpenGLDisplayPlugin.cpp @@ -269,7 +269,6 @@ bool OpenGLDisplayPlugin::activate() { if (!widget->context()->makeCurrent()) { throw std::runtime_error("Failed to make context current"); } - //_nativeContext = QOpenGLContextWrapper::currentContextWrapper()->getNativeContext(); CHECK_GL_ERROR(); widget->context()->doneCurrent(); diff --git a/libraries/display-plugins/src/display-plugins/OpenGLDisplayPlugin.h b/libraries/display-plugins/src/display-plugins/OpenGLDisplayPlugin.h index a14957d1b4..5c653f8a0a 100644 --- a/libraries/display-plugins/src/display-plugins/OpenGLDisplayPlugin.h +++ b/libraries/display-plugins/src/display-plugins/OpenGLDisplayPlugin.h @@ -22,7 +22,6 @@ #include #include -#include namespace gpu { namespace gl { @@ -34,7 +33,6 @@ class OpenGLDisplayPlugin : public DisplayPlugin { Q_OBJECT Q_PROPERTY(float hudAlpha MEMBER _hudAlpha) using Parent = DisplayPlugin; - using NativeContextPointer = QOpenGLContextWrapper::NativeContextPointer; protected: using Mutex = std::mutex; using Lock = std::unique_lock; @@ -177,7 +175,6 @@ protected: } gpu::gl::GLBackend* getGLBackend(); - //NativeContextPointer _nativeContext; // Any resource shared by the main thread and the presentation thread must // be serialized through this mutex diff --git a/libraries/display-plugins/src/display-plugins/hmd/HmdDisplayPlugin.h b/libraries/display-plugins/src/display-plugins/hmd/HmdDisplayPlugin.h index e608621b86..d8c0ce8e1d 100644 --- a/libraries/display-plugins/src/display-plugins/hmd/HmdDisplayPlugin.h +++ b/libraries/display-plugins/src/display-plugins/hmd/HmdDisplayPlugin.h @@ -77,7 +77,6 @@ protected: float _ipd { 0.064f }; struct FrameInfo { - uint32_t frameId{ 0 }; mat4 renderPose; mat4 presentPose; double sensorSampleTime { 0 }; diff --git a/libraries/gl/src/gl/Context.cpp b/libraries/gl/src/gl/Context.cpp index bd31e9463c..a0d52ee223 100644 --- a/libraries/gl/src/gl/Context.cpp +++ b/libraries/gl/src/gl/Context.cpp @@ -26,9 +26,6 @@ #include "Config.h" #include "GLHelpers.h" #include "QOpenGLContextWrapper.h" -#if defined(GL_CUSTOM_CONTEXT) -#include -#endif using namespace gl; diff --git a/libraries/gl/src/gl/ContextQt.cpp b/libraries/gl/src/gl/ContextQt.cpp index af2e7df6a6..24ae29e4ca 100644 --- a/libraries/gl/src/gl/ContextQt.cpp +++ b/libraries/gl/src/gl/ContextQt.cpp @@ -63,7 +63,6 @@ void Context::debugMessageHandler(const QOpenGLDebugMessage& debugMessage) { case QOpenGLDebugMessage::LowSeverity: qCDebug(glLogging) << debugMessage; return; - default: qCWarning(glLogging) << debugMessage; break; diff --git a/libraries/gl/src/gl/OffscreenGLCanvas.cpp b/libraries/gl/src/gl/OffscreenGLCanvas.cpp index 533ed1a5f4..69b41da821 100644 --- a/libraries/gl/src/gl/OffscreenGLCanvas.cpp +++ b/libraries/gl/src/gl/OffscreenGLCanvas.cpp @@ -19,7 +19,6 @@ #include #include #include -#include #include #include #include @@ -60,7 +59,6 @@ bool OffscreenGLCanvas::create(QOpenGLContext* sharedContext) { sharedContext->doneCurrent(); _context->setShareContext(sharedContext); } - if (!_context->create()) { qFatal("Failed to create OffscreenGLCanvas context"); } diff --git a/libraries/gl/src/gl/QOpenGLContextWrapper.cpp b/libraries/gl/src/gl/QOpenGLContextWrapper.cpp index eecdb14c7a..842c7abd08 100644 --- a/libraries/gl/src/gl/QOpenGLContextWrapper.cpp +++ b/libraries/gl/src/gl/QOpenGLContextWrapper.cpp @@ -12,6 +12,7 @@ #include "QOpenGLContextWrapper.h" #include + #ifdef Q_OS_WIN #include #endif diff --git a/libraries/gpu-gl-common/src/gpu/gl/GLBackend.cpp b/libraries/gpu-gl-common/src/gpu/gl/GLBackend.cpp index 8693cf7c61..fef458f536 100644 --- a/libraries/gpu-gl-common/src/gpu/gl/GLBackend.cpp +++ b/libraries/gpu-gl-common/src/gpu/gl/GLBackend.cpp @@ -418,7 +418,7 @@ public: #endif }; -#ifndef GL_CLIP_DISTANCE0 +#if defined(GPU_STEREO_DRAWCALL_INSTANCED) && !defined(GL_CLIP_DISTANCE0) #define GL_CLIP_DISTANCE0 GL_CLIP_DISTANCE0_EXT #endif @@ -426,10 +426,6 @@ public: PROFILE_RANGE(category, name); \ GlDuration glProfileRangeThis(name); -#ifndef GL_CLIP_DISTANCE0 -#define GL_CLIP_DISTANCE0 GL_CLIP_DISTANCE0_EXT -#endif - void GLBackend::render(const Batch& batch) { GL_PROFILE_RANGE(render_gpu_gl, batch.getName().c_str()); diff --git a/libraries/gpu-gl-common/src/gpu/gl/GLBackend.h b/libraries/gpu-gl-common/src/gpu/gl/GLBackend.h index 18d5243fc3..ffd0466b79 100644 --- a/libraries/gpu-gl-common/src/gpu/gl/GLBackend.h +++ b/libraries/gpu-gl-common/src/gpu/gl/GLBackend.h @@ -32,7 +32,7 @@ // Different versions for the stereo drawcall // Current preferred is "instanced" which draw the shape twice but instanced and rely on clipping plane to draw left/right side only -#if defined(USE_GLES) && 0 +#if defined(USE_GLES) && !defined(HAVE_EXT_clip_cull_distance) #define GPU_STEREO_TECHNIQUE_DOUBLED_SIMPLE #else //#define GPU_STEREO_TECHNIQUE_DOUBLED_SMARTER diff --git a/libraries/gpu-gl/src/gpu/gl45/GL45BackendTexture.cpp b/libraries/gpu-gl/src/gpu/gl45/GL45BackendTexture.cpp index 8f0d5f0632..a8b5ec85e8 100644 --- a/libraries/gpu-gl/src/gpu/gl45/GL45BackendTexture.cpp +++ b/libraries/gpu-gl/src/gpu/gl45/GL45BackendTexture.cpp @@ -36,9 +36,6 @@ using namespace gpu::gl45; #define ENABLE_SPARSE_TEXTURE 0 bool GL45Backend::supportedTextureFormat(const gpu::Element& format) { - if (FORCE_MOBILE_TEXTURES) { - } else { - } switch (format.getSemantic()) { // ETC textures are actually required by the OpenGL spec as of 4.3, but aren't always supported by hardware // They'll be recompressed by OpenGL, which will be slow or have poor quality, so disable them for now diff --git a/scripts/system/goto.js b/scripts/system/goto.js index 04562bab8d..5cc5bad844 100644 --- a/scripts/system/goto.js +++ b/scripts/system/goto.js @@ -14,23 +14,52 @@ (function() { // BEGIN LOCAL_SCOPE -function addGotoButton(destination) { +var button; +var buttonName = "GOTO"; +var toolBar = null; +var tablet = null; +var onGotoScreen = false; +function onAddressBarShown(visible) { + button.editProperties({isActive: visible}); +} + +function onClicked(){ + DialogsManager.toggleAddressBar(); + onGotoScreen = !onGotoScreen; +} + +if (Settings.getValue("HUDUIEnabled")) { + toolBar = Toolbars.getToolbar("com.highfidelity.interface.toolbar.system"); + button = toolBar.addButton({ + objectName: buttonName, + imageURL: Script.resolvePath("assets/images/tools/directory.svg"), + visible: true, + alpha: 0.9 + }); +} else { tablet = Tablet.getTablet("com.highfidelity.interface.tablet.system"); button = tablet.addButton({ icon: "icons/tablet-icons/goto-i.svg", activeIcon: "icons/tablet-icons/goto-a.svg", - text: destination - }); - var buttonDestination = destination; - button.clicked.connect(function() { - Window.location = "hifi://" + buttonDestination; - }); - Script.scriptEnding.connect(function () { - tablet.removeButton(button); + text: buttonName }); } -addGotoButton("hell") -addGotoButton("dev-mobile") +button.clicked.connect(onClicked); +DialogsManager.addressBarShown.connect(onAddressBarShown); + +Script.scriptEnding.connect(function () { + if (onGotoScreen) { + DialogsManager.toggleAddressBar(); + } + button.clicked.disconnect(onClicked); + if (tablet) { + tablet.removeButton(button); + } + if (toolBar) { + toolBar.removeButton(buttonName); + } + DialogsManager.addressBarShown.disconnect(onAddressBarShown); +}); }()); // END LOCAL_SCOPE diff --git a/scripts/system/html/js/miniTablet.js b/scripts/system/html/js/miniTablet.js index 21ad3138cd..c48201cef5 100644 --- a/scripts/system/html/js/miniTablet.js +++ b/scripts/system/html/js/miniTablet.js @@ -135,18 +135,18 @@ gotoImage = document.getElementById("goto-img"); expandButton = document.getElementById("expand"); - connectEventBridge(); - - document.body.addEventListener("mouseenter", onBodyHover, false); - document.body.addEventListener("mouseleave", onBodyUnhover, false); - - muteButton.addEventListener("mouseenter", onButtonHover, false); - gotoButton.addEventListener("mouseenter", onButtonHover, false); - expandButton.addEventListener("mouseenter", onButtonHover, false); - muteButton.addEventListener("click", onMuteButtonClick, true); - gotoButton.addEventListener("click", onGotoButtonClick, true); - expandButton.addEventListener("click", onExpandButtonClick, true); - + connectEventBridge(); + + document.body.addEventListener("mouseenter", onBodyHover, false); + document.body.addEventListener("mouseleave", onBodyUnhover, false); + + muteButton.addEventListener("mouseenter", onButtonHover, false); + gotoButton.addEventListener("mouseenter", onButtonHover, false); + expandButton.addEventListener("mouseenter", onButtonHover, false); + muteButton.addEventListener("click", onMuteButtonClick, true); + gotoButton.addEventListener("click", onGotoButtonClick, true); + expandButton.addEventListener("click", onExpandButtonClick, true); + document.body.onunload = function () { onUnload(); }; diff --git a/scripts/system/miniTablet.js b/scripts/system/miniTablet.js index 708b3c0c8d..780dacf85e 100644 --- a/scripts/system/miniTablet.js +++ b/scripts/system/miniTablet.js @@ -44,12 +44,11 @@ return; } print("DEBUG: " + message); - } function error(message) { print("ERROR: " + message); - } + } function handJointName(hand) { var jointName; @@ -127,7 +126,7 @@ miniOverlayObject = null, // Button icons. - MUTE_ON_ICON =Script.resourcesPath() + "icons/tablet-icons/mic-mute-a.svg", + MUTE_ON_ICON = Script.resourcesPath() + "icons/tablet-icons/mic-mute-a.svg", MUTE_OFF_ICON = Script.resourcesPath() + "icons/tablet-icons/mic-unmute-i.svg", GOTO_ICON = Script.resourcesPath() + "icons/tablet-icons/goto-i.svg", diff --git a/tools/CMakeLists.txt b/tools/CMakeLists.txt index 3b5c7c2b38..886f15ded4 100644 --- a/tools/CMakeLists.txt +++ b/tools/CMakeLists.txt @@ -31,7 +31,6 @@ if (BUILD_TOOLS) atp-client oven nitpick - webview ) foreach(TOOL ${ALL_TOOLS}) diff --git a/tools/gpu-frame-player/CMakeLists.txt b/tools/gpu-frame-player/CMakeLists.txt index 5914999757..bd50839f9c 100644 --- a/tools/gpu-frame-player/CMakeLists.txt +++ b/tools/gpu-frame-player/CMakeLists.txt @@ -4,9 +4,10 @@ set(TARGET_NAME gpu-frame-player) setup_memory_debugger() setup_hifi_project(Gui Widgets) + # link in the shared libraries link_hifi_libraries( - shared ktx shaders gpu + shared ktx shaders gpu # vk gpu-vk gl ${PLATFORM_GL_BACKEND} ) diff --git a/unpublishedScripts/DomainContent/Toybox/pistol/pistol.js b/unpublishedScripts/DomainContent/Toybox/pistol/pistol.js index b408e4f464..038c53054c 100644 --- a/unpublishedScripts/DomainContent/Toybox/pistol/pistol.js +++ b/unpublishedScripts/DomainContent/Toybox/pistol/pistol.js @@ -137,7 +137,7 @@ direction: this.firingDirection }; this.createGunFireEffect(this.barrelPoint) - var intersection = Entities.findRayIntersectionBlocking(pickRay, true); + var intersection = Entities.findRayIntersection(pickRay, true); if (intersection.intersects) { this.createEntityHitEffect(intersection.intersection); if (Math.random() < this.playRichochetSoundChance) {