Merge pull request #1467 from ctrlaltdavid/fix/ssl-websocket-crash

Fix SSL WebSocket Domain server crash.
This commit is contained in:
Kalila 2021-11-23 12:45:29 -05:00 committed by GitHub
commit 8764e6f030
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
37 changed files with 463 additions and 188 deletions

View file

@ -56,7 +56,7 @@ jobs:
echo "PYTHON_EXEC=python3" >> $GITHUB_ENV echo "PYTHON_EXEC=python3" >> $GITHUB_ENV
echo "INSTALLER_EXT=tgz" >> $GITHUB_ENV echo "INSTALLER_EXT=tgz" >> $GITHUB_ENV
echo "CMAKE_BUILD_EXTRA=-- -j3" >> $GITHUB_ENV echo "CMAKE_BUILD_EXTRA=-- -j3" >> $GITHUB_ENV
echo "CMAKE_EXTRA=-DBUILD_TOOLS:BOOLEAN=FALSE -DHIFI_PYTHON_EXEC:FILEPATH=$(which python3)" >> $GITHUB_ENV echo "CMAKE_EXTRA=-DVIRCADIA_CPU_ARCHITECTURE= -DBUILD_TOOLS:BOOLEAN=FALSE -DHIFI_PYTHON_EXEC:FILEPATH=$(which python3)" >> $GITHUB_ENV
fi fi
# Mac build variables # Mac build variables
if [ "${{ matrix.os }}" = "macOS-10.15" ]; then if [ "${{ matrix.os }}" = "macOS-10.15" ]; then
@ -64,7 +64,7 @@ jobs:
echo "ZIP_COMMAND=zip" >> $GITHUB_ENV echo "ZIP_COMMAND=zip" >> $GITHUB_ENV
echo "ZIP_ARGS=-r" >> $GITHUB_ENV echo "ZIP_ARGS=-r" >> $GITHUB_ENV
echo "INSTALLER_EXT=dmg" >> $GITHUB_ENV echo "INSTALLER_EXT=dmg" >> $GITHUB_ENV
echo "CMAKE_EXTRA=-DCMAKE_XCODE_ATTRIBUTE_CODE_SIGNING_REQUIRED=OFF -DOPENSSL_ROOT_DIR=/usr/local/opt/openssl -DOPENSSL_LIBRARIES=/usr/local/opt/openssl/lib -G Xcode" >> $GITHUB_ENV echo "CMAKE_EXTRA=-DVIRCADIA_CPU_ARCHITECTURE= -DCMAKE_XCODE_ATTRIBUTE_CODE_SIGNING_REQUIRED=OFF -DOPENSSL_ROOT_DIR=/usr/local/opt/openssl -DOPENSSL_LIBRARIES=/usr/local/opt/openssl/lib -G Xcode" >> $GITHUB_ENV
echo "::set-output name=symbols_archive::${BUILD_NUMBER}-${{ matrix.build_type }}-mac-symbols.zip" echo "::set-output name=symbols_archive::${BUILD_NUMBER}-${{ matrix.build_type }}-mac-symbols.zip"
echo "APP_TARGET_NAME=Vircadia" >> $GITHUB_ENV echo "APP_TARGET_NAME=Vircadia" >> $GITHUB_ENV
fi fi

View file

@ -75,9 +75,9 @@ jobs:
echo "VCPKG_FORCE_SYSTEM_BINARIES=true" >> $GITHUB_ENV echo "VCPKG_FORCE_SYSTEM_BINARIES=true" >> $GITHUB_ENV
fi fi
if [ "${{ matrix.build_type }}" = "full" ]; then if [ "${{ matrix.build_type }}" = "full" ]; then
echo "CMAKE_EXTRA=-DBUILD_TOOLS:BOOLEAN=FALSE -DHIFI_PYTHON_EXEC:FILEPATH=$(which python3)" >> $GITHUB_ENV echo "CMAKE_EXTRA=-DVIRCADIA_CPU_ARCHITECTURE= -DBUILD_TOOLS:BOOLEAN=FALSE -DHIFI_PYTHON_EXEC:FILEPATH=$(which python3)" >> $GITHUB_ENV
else else
echo "CMAKE_EXTRA=-DCLIENT_ONLY=1 -DBUILD_TOOLS:BOOLEAN=FALSE -DHIFI_PYTHON_EXEC:FILEPATH=$(which python3)" >> $GITHUB_ENV echo "CMAKE_EXTRA=-DVIRCADIA_CPU_ARCHITECTURE= -DCLIENT_ONLY=1 -DBUILD_TOOLS:BOOLEAN=FALSE -DHIFI_PYTHON_EXEC:FILEPATH=$(which python3)" >> $GITHUB_ENV
fi fi
fi fi
# Mac build variables # Mac build variables
@ -85,9 +85,9 @@ jobs:
echo "PYTHON_EXEC=python3" >> $GITHUB_ENV echo "PYTHON_EXEC=python3" >> $GITHUB_ENV
echo "INSTALLER_EXT=dmg" >> $GITHUB_ENV echo "INSTALLER_EXT=dmg" >> $GITHUB_ENV
if [ "${{ matrix.build_type }}" = "full" ]; then if [ "${{ matrix.build_type }}" = "full" ]; then
echo "CMAKE_EXTRA=-DCMAKE_XCODE_ATTRIBUTE_CODE_SIGNING_REQUIRED=OFF -DOPENSSL_ROOT_DIR=/usr/local/opt/openssl -DOPENSSL_LIBRARIES=/usr/local/opt/openssl/lib -G Xcode" >> $GITHUB_ENV echo "CMAKE_EXTRA=-DVIRCADIA_CPU_ARCHITECTURE= -DCMAKE_XCODE_ATTRIBUTE_CODE_SIGNING_REQUIRED=OFF -DOPENSSL_ROOT_DIR=/usr/local/opt/openssl -DOPENSSL_LIBRARIES=/usr/local/opt/openssl/lib -G Xcode" >> $GITHUB_ENV
else else
echo "CMAKE_EXTRA=-DCLIENT_ONLY=1 -DCMAKE_XCODE_ATTRIBUTE_CODE_SIGNING_REQUIRED=OFF -DOPENSSL_ROOT_DIR=/usr/local/opt/openssl -DOPENSSL_LIBRARIES=/usr/local/opt/openssl/lib -G Xcode" >> $GITHUB_ENV echo "CMAKE_EXTRA=-DVIRCADIA_CPU_ARCHITECTURE= -DCLIENT_ONLY=1 -DCMAKE_XCODE_ATTRIBUTE_CODE_SIGNING_REQUIRED=OFF -DOPENSSL_ROOT_DIR=/usr/local/opt/openssl -DOPENSSL_LIBRARIES=/usr/local/opt/openssl/lib -G Xcode" >> $GITHUB_ENV
fi fi
echo "APP_TARGET_NAME=Vircadia" >> $GITHUB_ENV echo "APP_TARGET_NAME=Vircadia" >> $GITHUB_ENV
fi fi

View file

@ -192,6 +192,13 @@ The following build options can be used when running CMake
* CLIENT_ONLY // Will package only the Interface * CLIENT_ONLY // Will package only the Interface
* SERVER_ONLY // Will package only the Server * SERVER_ONLY // Will package only the Server
### Optimization build options
* VIRCADIA_OPTIMIZE - This variable defaults to 1 if not set and enables compiler optimization flags on Linux and MacOS. Setting it to 0 will result in unoptimized build.
* VIRCADIA_CPU_ARCHITECTURE - This variable contains architecture specific compiler flags which are used if `VIRCADIA_OPTIMIZE` is true. If it is not set, it defaults to `-march=native -mtune=native`, which helps yield more performance for locally used build, but for packaging it needs to be set to different value for portability, for example `-msse3`. Setting `VIRCADIA_CPU_ARCHITECTURE` to empty string will use default compiler settings and yield
maximum compatibility.
### Developer Build Options ### Developer Build Options
* USE_GLES * USE_GLES

View file

@ -171,3 +171,11 @@ If your goal is to set up a development environment, it is desirable to set the
directory that vcpkg builds into with the `HIFI_VCPKG_BASE` environment variable. directory that vcpkg builds into with the `HIFI_VCPKG_BASE` environment variable.
For example, you might set `HIFI_VCPKG_BASE` to `/home/$USER/vcpkg`. For example, you might set `HIFI_VCPKG_BASE` to `/home/$USER/vcpkg`.
By default, vcpkg will build in the system `/tmp` directory. By default, vcpkg will build in the system `/tmp` directory.
If build is intended for packaging or creation of AppImage, `VIRCADIA_CPU_ARCHITECTURE`
CMake variable needs to be set to architecture specific value.
It defaults to `-march=native -mtune=native`, which yields builds optimized for particular
machine, but builds will not work on machines lacking same CPU instructions.
For packaging and AppImage it is recommended to set it to different value, for example `-msse3`.
Setting `VIRCADIA_CPU_ARCHITECTURE` to empty string will use default compiler settings and yield
maximum compatibility.

View file

@ -1,63 +1,84 @@
# Build OSX # Build MacOS
*Last Updated on January 16, 2021* *Last Updated on October 19, 2021*
Please read the [general build guide](BUILD.md) for information on dependencies required for all platforms. Only macOS specific instructions are found in this document. Please read the [general build guide](BUILD.md) for information on dependencies required for all platforms. This will include the necessary environment variables to customize your build. Only macOS specific instructions are found in this document.
## Homebrew ## Prerequisites
[Homebrew](https://brew.sh/) is an excellent package manager for macOS. It makes install of some Vircadia dependencies very simple. ### CMake, OpenSSL, and NPM
[Homebrew](https://brew.sh/) is an excellent package manager for macOS. It makes the installation of some Vircadia dependencies very simple.
```bash ```bash
brew install cmake openssl npm brew install cmake openssl npm
``` ```
Note: cmake versions > 3.18.x have known problems building Vircadia, so alternatively you can download cmake 3.18.4 (or earlier versions) from [Github](https://github.com/Kitware/CMake/releases). **Note:** You can also download alternative CMake versions from [Github](https://github.com/Kitware/CMake/releases) if needed.
## Python 3 ### Python 3
Download an install Python 3.6.6 or higher from [here](https://www.python.org/downloads/). Download an install Python 3.6.6 or higher from [here](https://www.python.org/downloads/).
Execute the `Update Shell Profile.command` script that is provided with the installer. Execute the `Update Shell Profile.command` script that is provided with the installer.
## OSX SDK ### MacOS SDK
You will need version `10.12` of the OSX SDK for building, otherwise you may have crashing or other unintended issues due to the deprecation of OpenGL on OSX. You can get that SDK from [here](https://github.com/phracker/MacOSX-SDKs). You must copy it in to your Xcode SDK directory, e.g. You will need version `10.12` of the macOS SDK for building, otherwise you may have crashing or other unintended issues due to the deprecation of OpenGL on macOS. You can get that SDK from [here](https://github.com/phracker/MacOSX-SDKs). You must copy it in to your Xcode SDK directory, e.g.
```bash ```bash
cp -rp ~/Downloads/MacOSX10.12.sdk /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/ cp -rp ~/Downloads/MacOSX10.12.sdk /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/
``` ```
## OpenSSL ### OpenSSL
Assuming you've installed OpenSSL using the homebrew instructions above, you'll need to set OPENSSL_ROOT_DIR so CMake can find your installations. Assuming you've installed OpenSSL using the homebrew instructions above, you'll need to set `OPENSSL_ROOT_DIR` so CMake can find your installations.
For OpenSSL installed via homebrew, set OPENSSL_ROOT_DIR via For OpenSSL installed via homebrew, set `OPENSSL_ROOT_DIR` via `export OPENSSL_ROOT_DIR=/usr/local/opt/openssl` or by appending `-DOPENSSL_ROOT_DIR=/usr/local/opt/openssl` to `cmake`.
`export OPENSSL_ROOT_DIR=/usr/local/opt/openssl`
or by appending `-DOPENSSL_ROOT_DIR=/usr/local/opt/openssl` to `cmake`
## Xcode ## Generate and Build
You can choose to use either Unix Makefiles or Xcode.
### Xcode
You can ask CMake to generate Xcode project files instead of Unix Makefiles using the `-G Xcode` parameter after CMake. You will need to select the Xcode installation in the terminal first if you have not done so already. You can ask CMake to generate Xcode project files instead of Unix Makefiles using the `-G Xcode` parameter after CMake. You will need to select the Xcode installation in the terminal first if you have not done so already.
```bash ```bash
sudo xcode-select --switch /Applications/Xcode.app/Contents/Developer sudo xcode-select --switch /Applications/Xcode.app/Contents/Developer
cmake ../ -DCMAKE_OSX_SYSROOT="/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.12.sdk" -DCMAKE_OSX_DEPLOYMENT_TARGET=10.12 -DOPENSSL_ROOT_DIR=/usr/local/opt/openssl -DOSX_SDK=10.12 .. cmake ../ -DCMAKE_OSX_SYSROOT="/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.12.sdk" -DCMAKE_OSX_DEPLOYMENT_TARGET=10.12 -DOPENSSL_ROOT_DIR=/usr/local/opt/openssl -G Xcode -DOSX_SDK=10.12 ..
``` ```
If `cmake` complains about Python 3 being missing, you may need to update your CMake binary with command `brew upgrade cmake`, or by downloading and running the latest CMake installer, depending on how you originally installed CMake. After running CMake, you will have the make files or Xcode project file necessary to build all of the components. Open the `vircadia.xcodeproj` file, choose `ALL_BUILD` from the Product > Scheme menu (or target drop down), and click Run.
After running CMake, you will have the make files or Xcode project file necessary to build all of the components. Open the hifi.xcodeproj file, choose ALL_BUILD from the Product > Scheme menu (or target drop down), and click Run.
If the build completes successfully, you will have built targets for all components located in the `build/${target_name}/Debug` directories. If the build completes successfully, you will have built targets for all components located in the `build/${target_name}/Debug` directories.
## make ### make
If you build with make rather than Xcode, you can append `-j4` for assigning more threads. The number indicates the number of threads, e.g. 4. Run CMake.
```bash
cmake -DCMAKE_OSX_SYSROOT="/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.12.sdk" -DCMAKE_OSX_DEPLOYMENT_TARGET=10.12 -DOPENSSL_ROOT_DIR=/usr/local/opt/openssl -DOSX_SDK=10.12 ..
```
You can append `-j4` to assign more threads to build with. The number indicates the number of threads, e.g. 4.
To package the installation, you can simply run `make package` afterwards. To package the installation, you can simply run `make package` afterwards.
## Notes
If build is intended for packaging or creation of AppImage, `VIRCADIA_CPU_ARCHITECTURE`
CMake variable needs to be set to architecture specific value.
It defaults to `-march=native -mtune=native`, which yields builds optimized for particular
machine, but builds will not work on machines lacking same CPU instructions.
For packaging and AppImage it is recommended to set it to different value, for example `-msse3`.
Setting `VIRCADIA_CPU_ARCHITECTURE` to empty string will use default compiler settings and yield
maximum compatibility.
## FAQ ## FAQ
1. **Problem:** Running the scheme `interface.app` from Xcode causes a crash for Interface related to `libgl` 1. **Problem:** Running the scheme `interface.app` from Xcode causes a crash for Interface related to `libgl`.
1. **Cause:** The target `gl` generates a binary called `libgl`. A macOS `libGL.framework` item gets loaded instead by Xcode. 1. **Cause:** The target `gl` generates a binary called `libgl`. A macOS `libGL.framework` item gets loaded instead by Xcode.
1. **Solution:** In the Xcode target settings for `libgl`, set the version to 1.0.0 2. **Solution:** In the Xcode target settings for `libgl`, set the version to `1.0.0`.
2. **Problem:** CMake complains about Python 3 being missing.
1. **Cause:** CMake might be out of date.
2. **Solution:** Try updating your CMake binary with command `brew upgrade cmake`, or by downloading and running a newer CMake installer, depending on how you originally installed CMake. Please keep in mind the recommended CMake versions noted above.

View file

@ -74,6 +74,67 @@ if ((NOT "${RELEASE_TYPE}" STREQUAL "PRODUCTION") AND (NOT "${RELEASE_TYPE}" STR
set(RELEASE_TYPE "DEV") set(RELEASE_TYPE "DEV")
endif() endif()
# VIRCADIA_OPTIMIZE
# Variable determining vircadia optimization. If not set, it defaults to true.
# It's used to determine build flags for main codebase and for VCPKG dependencies.
# Should be set to false to get completely unoptimized build for easier line-by-line debugging
if( NOT WIN32 )
if(NOT DEFINED VIRCADIA_OPTIMIZE)
message("Enabling code optimization for Vircadia and compiled dependencies")
set(VIRCADIA_OPTIMIZE true CACHE BOOL "Enable code optimization for Vircadia and compiled dependencies")
endif()
#compiler needs to be detected before building VCPKG dependencies
set(CMAKE_PLATFORM_INFO_DIR "${CMAKE_CURRENT_BINARY_DIR}")
include(CMakeDetermineCXXCompiler)
set(VIRCADIA_OPTIMIZE_FLAGS "")
if(VIRCADIA_OPTIMIZE)
file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/_env/VIRCADIA_OPTIMIZE.txt" "${VIRCADIA_OPTIMIZE}")
if (CMAKE_CXX_COMPILER_ID MATCHES "Clang")
message("Clang compiler detected, adding -O3 -fPIC -g flags")
set(VIRCADIA_OPTIMIZE_FLAGS "-O3 -fPIC -g")
elseif (CMAKE_CXX_COMPILER_ID MATCHES "GNU")
message("GCC compiler detected, adding -O3 -fPIC -ggdb flags")
set(VIRCADIA_OPTIMIZE_FLAGS "-O3 -fPIC -ggdb")
else()
message("No predefined optimization flags for compiler ${CMAKE_CXX_COMPILER_ID}")
endif()
endif()
MESSAGE(STATUS "VIRCADIA_OPTIMIZE: ${VIRCADIA_OPTIMIZE}")
# VIRCADIA_CPU_ARCHITECTURE
# Variable determining CPU architecture for which Vircadia will be built.
# If defined, it's appended to CXXFLAGS and CFLAGS for both Vircadia and VCPKG dependencies
#Assume -march=native for compilers that allow it if architecture is not specified
if(NOT DEFINED VIRCADIA_CPU_ARCHITECTURE)
if(VIRCADIA_OPTIMIZE AND ( (CMAKE_CXX_COMPILER_ID MATCHES "Clang") OR (CMAKE_CXX_COMPILER_ID MATCHES "GNU") ) )
message("Optimization is enabled, but architecture is not specified. Assuming native build")
set(VIRCADIA_CPU_ARCHITECTURE "-march=native -mtune=native" CACHE STRING "Specify architecture dependent compiler flags here")
endif()
endif()
if(DEFINED VIRCADIA_CPU_ARCHITECTURE)
file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/_env/VIRCADIA_CPU_ARCHITECTURE.txt" "${VIRCADIA_CPU_ARCHITECTURE}")
set(VIRCADIA_OPTIMIZE_FLAGS "${VIRCADIA_OPTIMIZE_FLAGS} ${VIRCADIA_CPU_ARCHITECTURE}")
message("Adding CPU architecture flags: ${VIRCADIA_CPU_ARCHITECTURE}")
MESSAGE(STATUS "VIRCADIA_CPU_ARCHITECTURE: ${VIRCADIA_CPU_ARCHITECTURE}")
endif()
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${VIRCADIA_OPTIMIZE_FLAGS}")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${VIRCADIA_OPTIMIZE_FLAGS}")
set(ENV{CXXFLAGS} "$ENV{CXXFLAGS} ${VIRCADIA_OPTIMIZE_FLAGS}")
set(ENV{CFLAGS} "$ENV{CFLAGS} ${VIRCADIA_OPTIMIZE_FLAGS}")
message($ENV{CXXFLAGS})
endif()
if (HIFI_ANDROID) if (HIFI_ANDROID)
execute_process( execute_process(
COMMAND ${HIFI_PYTHON_EXEC} ${CMAKE_CURRENT_SOURCE_DIR}/prebuild.py --release-type ${RELEASE_TYPE} --android ${HIFI_ANDROID_APP} --build-root ${CMAKE_BINARY_DIR} COMMAND ${HIFI_PYTHON_EXEC} ${CMAKE_CURRENT_SOURCE_DIR}/prebuild.py --release-type ${RELEASE_TYPE} --android ${HIFI_ANDROID_APP} --build-root ${CMAKE_BINARY_DIR}

View file

@ -1,8 +1,17 @@
<p align="center"><a href="https://vircadia.com/"><img src="interface/resources/images/vircadia-banner.svg" alt="Vircadia - Codename Athena" width="350"/></a></p> <p align="center"><a href="https://vircadia.com/"><img src="interface/resources/images/vircadia-banner.svg" alt="Vircadia - Codename Athena" width="350"/></a></p>
<h3 align="center"><a href="https://vircadia.com/">Website</a> | <a href="https://discordapp.com/invite/Pvx2vke">Discord</a> | <a href="https://vircadia.com/download-vircadia/">Download</a></h3> <h3 align="center"><a href="https://vircadia.com/">Website</a> | <a href="https://discordapp.com/invite/Pvx2vke">Discord</a> | <a href="https://vircadia.com/download-vircadia/">Download</a></h3>
<p align="center"><a href="CONTRIBUTING.md"><img alt="GitHub contributors" src="https://img.shields.io/github/contributors/vircadia/vircadia"></a> <a href="https://github.com/vircadia/vircadia/stargazers"><img alt="GitHub stars" src="https://img.shields.io/github/stars/vircadia/vircadia"></a> <a href="https://github.com/vircadia/vircadia/network"><img alt="GitHub forks" src="https://img.shields.io/github/forks/vircadia/vircadia"></a> <a href="https://www.apache.org/licenses/LICENSE-2.0"><img alt="Apache 2.0" src="https://img.shields.io/badge/license-Apache--2.0-%230A7BBB?style=flat"></a> <a href="https://discordapp.com/invite/Pvx2vke"><img alt="Discord" src="https://img.shields.io/discord/564926326025224212?style=flat"></a></p> <p align="center">
<a href="https://vircadia.com/contribute"><img alt="GitHub contributors" src="https://img.shields.io/github/contributors/vircadia/vircadia"></a>
<a href="https://github.com/sponsors/digisomni"><img alt="GitHub sponsors" src="https://img.shields.io/github/sponsors/digisomni?style=flat&label=github%20sponsors"></a>
<a href="https://github.com/vircadia/vircadia/stargazers"><img alt="GitHub stars" src="https://img.shields.io/github/stars/vircadia/vircadia"></a>
<a href="https://github.com/vircadia/vircadia/network"><img alt="GitHub forks" src="https://img.shields.io/github/forks/vircadia/vircadia"></a>
<a href="https://www.apache.org/licenses/LICENSE-2.0"><img alt="Apache 2.0" src="https://img.shields.io/badge/license-Apache--2.0-%230A7BBB?style=flat"></a>
<a href="https://discordapp.com/invite/Pvx2vke"><img alt="Discord" src="https://img.shields.io/discord/564926326025224212?style=flat"></a>
</p>
<h3 align="center">Build Status</h3> <h3 align="center">Build Status</h3>
<p align="center"><a href="https://github.com/vircadia/vircadia/actions/workflows/master_build.yml"><img alt="Master CI Build" src="https://github.com/vircadia/vircadia/actions/workflows/master_build.yml/badge.svg"></a></p> <p align="center">
<a href="https://github.com/vircadia/vircadia/actions/workflows/master_build.yml"><img alt="Master CI Build" src="https://github.com/vircadia/vircadia/actions/workflows/master_build.yml/badge.svg"></a>
</p>
### What is this? ### What is this?
@ -50,7 +59,7 @@ Vircadia™ is a 3D social software project seeking to incrementally bring about
### Boot to Metaverse: [The Goal](https://vircadia.com/vision/) ### Boot to Metaverse: [The Goal](https://vircadia.com/vision/)
Having a place to experience adventure, a place to relax with calm breath, that's a world to live in. An engine to support infinite combinations and possibilities of worlds without censorship and interruption, that's a metaverse. Finding a way to make infinite realities our reality is the dream. Having a place to experience adventure, a place to relax with calm breath, that's a world to live in. An engine to support infinite combinations and possibilities of worlds without censorship and interruption, that's metaverse. Finding a way to make infinite realities our reality is the dream.
### Boot to Metaverse: The Technicals ### Boot to Metaverse: The Technicals
@ -64,14 +73,16 @@ Vircadia consists of many projects and codebases with its unifying structure's g
- [The Metaverse Server Dashboard (Codename Iamus)](https://github.com/vircadia/project-iamus-dashboard/) - [The Metaverse Server Dashboard (Codename Iamus)](https://github.com/vircadia/project-iamus-dashboard/)
- [The Launcher (Codename Pantheon)](https://github.com/vircadia/pantheon-launcher/) - Currently Windows only. - [The Launcher (Codename Pantheon)](https://github.com/vircadia/pantheon-launcher/) - Currently Windows only.
#### Child Projects #### Tools
- [Vircadia Builder for Linux](https://github.com/vircadia/vircadia-builder/) - [Vircadia Builder for Linux](https://github.com/vircadia/vircadia-builder/)
#### Documentation
- [User Documentation](https://github.com/vircadia/vircadia-docs-sphinx/) - [User Documentation](https://github.com/vircadia/vircadia-docs-sphinx/)
- [Developer Documentation](https://github.com/vircadia/vircadia-dev-docs/) - [Developer Documentation](https://github.com/vircadia/vircadia-dev-docs/)
### Contribution ### Contribution
There are many contributors to Vircadia. Code writers, reviewers, testers, documentation writers, modelers, and general supporters of the project are all integral to its development and success towards its goals. Find out how you can [contribute](CONTRIBUTING.md)! There are many contributors to Vircadia. Code writers, reviewers, testers, documentation writers, modelers, and general supporters of the project are all integral to its development and success towards its goals. Find out how you can [contribute](https://vircadia.com/contribute)!
### Support ### Support
@ -83,6 +94,6 @@ Keep in mind that Vircadia consists of multiple smaller projects that might have
#### Supporters of the Vircadia Project #### Supporters of the Vircadia Project
| [Karol Suprynowicz - 74hc595](https://github.com/ksuprynowicz) | | [ksuprynowicz (74hc595)](https://github.com/ksuprynowicz) |
| --- | | --- |
| <p align="center">[<img src="https://vircadia.com/wp-content/uploads/2021/07/74hc595_profile_2-1.png" width="80" alt="ksuprynowicz" />](https://github.com/ksuprynowicz)</p> | <p align="center">[<img src="https://vircadia.com/wp-content/uploads/2021/07/74hc595_profile_2-1.png" width="80" alt="ksuprynowicz" />](https://github.com/ksuprynowicz)</p>

View file

@ -110,3 +110,5 @@ if (APPLE)
set(CMAKE_OSX_SYSROOT ${_OSX_DESIRED_SDK_PATH}/MacOSX${OSX_SDK}.sdk) set(CMAKE_OSX_SYSROOT ${_OSX_DESIRED_SDK_PATH}/MacOSX${OSX_SDK}.sdk)
endif () endif ()
endif () endif ()
message("CXXFLAGS: ${CXXFLAGS}")

View file

@ -12,7 +12,7 @@ macro(TARGET_OPENSSL)
set(OPENSSL_LIBRARIES "${OPENSSL_INSTALL_DIR}/lib/libcrypto.a;${OPENSSL_INSTALL_DIR}/lib/libssl.a" CACHE STRING INTERNAL) set(OPENSSL_LIBRARIES "${OPENSSL_INSTALL_DIR}/lib/libcrypto.a;${OPENSSL_INSTALL_DIR}/lib/libssl.a" CACHE STRING INTERNAL)
else() else()
# using VCPKG for OpenSSL # using VCPKG for OpenSSL
find_package(OpenSSL REQUIRED) find_package(OpenSSL 1.1.0 REQUIRED)
endif() endif()
include_directories(SYSTEM "${OPENSSL_INCLUDE_DIR}") include_directories(SYSTEM "${OPENSSL_INCLUDE_DIR}")

View file

@ -15,6 +15,7 @@
include(vcpkg_common_functions) include(vcpkg_common_functions)
if (VCPKG_LIBRARY_LINKAGE STREQUAL dynamic) if (VCPKG_LIBRARY_LINKAGE STREQUAL dynamic)
message(WARNING "Dynamic not supported, building static") message(WARNING "Dynamic not supported, building static")
set(VCPKG_LIBRARY_LINKAGE static) set(VCPKG_LIBRARY_LINKAGE static)
@ -30,6 +31,32 @@ vcpkg_from_github(
PATCHES "bullet-git-fix-build-clang-8.patch" PATCHES "bullet-git-fix-build-clang-8.patch"
) )
if(WIN32)
set(VIRCADIA_BULLET_OPTIONS "")
else()
if(EXISTS "${VCPKG_ROOT_DIR}/_env/VIRCADIA_OPTIMIZE.txt")
file(READ "${VCPKG_ROOT_DIR}/_env/VIRCADIA_OPTIMIZE.txt" VIRCADIA_OPTIMIZE)
endif()
if(EXISTS "${VCPKG_ROOT_DIR}/_env/VIRCADIA_CPU_ARCHITECTURE.txt")
file(READ "${VCPKG_ROOT_DIR}/_env/VIRCADIA_CPU_ARCHITECTURE.txt" VIRCADIA_CPU_ARCHITECTURE)
endif()
if(VIRCADIA_OPTIMIZE)
set(VIRCADIA_BULLET_OPTIONS "-DCMAKE_BUILD_TYPE=Release")
else()
set(VIRCADIA_BULLET_OPTIONS "-DCMAKE_BUILD_TYPE=RelWithDebInfo")
endif()
set(VIRCADIA_BULLET_OPTIONS "${VIRCADIA_BULLET_OPTIONS}")
if(DEFINED VIRCADIA_CPU_ARCHITECTURE)
set(VIRCADIA_BULLET_OPTIONS "${VIRCADIA_BULLET_OPTIONS} -DCMAKE_CXX_FLAGS=\"${VIRCADIA_CPU_ARCHITECTURE}\" -DCMAKE_C_FLAGS=\"${VIRCADIA_CPU_ARCHITECTURE}\" ")
endif()
endif()
message("Optimization options for Bullet: ${VIRCADIA_BULLET_OPTIONS}")
vcpkg_configure_cmake( vcpkg_configure_cmake(
SOURCE_PATH ${SOURCE_PATH} SOURCE_PATH ${SOURCE_PATH}
OPTIONS OPTIONS
@ -46,6 +73,7 @@ vcpkg_configure_cmake(
-DBUILD_UNIT_TESTS=OFF -DBUILD_UNIT_TESTS=OFF
-DBUILD_SHARED_LIBS=ON -DBUILD_SHARED_LIBS=ON
-DINSTALL_LIBS=ON -DINSTALL_LIBS=ON
${VIRCADIA_BULLET_OPTIONS}
) )
vcpkg_install_cmake() vcpkg_install_cmake()
@ -58,4 +86,4 @@ file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/include/bullet/BulletInverseDynamics
vcpkg_copy_pdbs() vcpkg_copy_pdbs()
# Handle copyright # Handle copyright
file(INSTALL ${SOURCE_PATH}/LICENSE.txt DESTINATION ${CURRENT_PACKAGES_DIR}/share/bullet3 RENAME copyright) file(INSTALL ${SOURCE_PATH}/LICENSE.txt DESTINATION ${CURRENT_PACKAGES_DIR}/share/bullet3 RENAME copyright)

View file

@ -12,7 +12,37 @@ vcpkg_from_github(
HEAD_REF HEAD_REF
master) master)
vcpkg_configure_cmake(SOURCE_PATH ${SOURCE_PATH} PREFER_NINJA) if(WIN32)
set(VIRCADIA_OPUS_OPTIONS "")
else()
if(EXISTS "${VCPKG_ROOT_DIR}/_env/VIRCADIA_OPTIMIZE.txt")
file(READ "${VCPKG_ROOT_DIR}/_env/VIRCADIA_OPTIMIZE.txt" VIRCADIA_OPTIMIZE)
endif()
if(EXISTS "${VCPKG_ROOT_DIR}/_env/VIRCADIA_CPU_ARCHITECTURE.txt")
file(READ "${VCPKG_ROOT_DIR}/_env/VIRCADIA_CPU_ARCHITECTURE.txt" VIRCADIA_CPU_ARCHITECTURE)
endif()
if(VIRCADIA_OPTIMIZE)
set(VIRCADIA_OPUS_OPTIONS "-DCMAKE_BUILD_TYPE=Release")
else()
set(VIRCADIA_OPUS_OPTIONS "-DCMAKE_BUILD_TYPE=RelWithDebInfo")
endif()
set(VIRCADIA_OPUS_OPTIONS "${VIRCADIA_OPUS_OPTIONS}")
if(DEFINED VIRCADIA_CPU_ARCHITECTURE)
set(VIRCADIA_OPUS_OPTIONS "${VIRCADIA_OPUS_OPTIONS} -DCMAKE_CXX_FLAGS=\"${VIRCADIA_CPU_ARCHITECTURE}\" -DCMAKE_C_FLAGS=\"${VIRCADIA_CPU_ARCHITECTURE}\" ")
endif()
endif()
message("Optimization options for Opus: ${VIRCADIA_OPUS_OPTIONS}")
vcpkg_configure_cmake(
SOURCE_PATH ${SOURCE_PATH}
PREFER_NINJA
OPTIONS ${VIRCADIA_OPUS_OPTIONS}
)
vcpkg_install_cmake() vcpkg_install_cmake()
vcpkg_fixup_cmake_targets(CONFIG_PATH lib/cmake/Opus) vcpkg_fixup_cmake_targets(CONFIG_PATH lib/cmake/Opus)
vcpkg_copy_pdbs() vcpkg_copy_pdbs()

View file

@ -8,7 +8,7 @@ link_hifi_libraries(embedded-webserver networking shared)
package_libraries_for_deployment() package_libraries_for_deployment()
# find OpenSSL # find OpenSSL
find_package(OpenSSL REQUIRED) find_package(OpenSSL 1.1.0 REQUIRED)
if (APPLE AND ${OPENSSL_INCLUDE_DIR} STREQUAL "/usr/include") if (APPLE AND ${OPENSSL_INCLUDE_DIR} STREQUAL "/usr/include")
# this is a user on OS X using system OpenSSL, which is going to throw warnings since they're deprecating for their common crypto # this is a user on OS X using system OpenSSL, which is going to throw warnings since they're deprecating for their common crypto

View file

@ -52,6 +52,20 @@ Item {
Layout.preferredWidth: parent.width Layout.preferredWidth: parent.width
spacing: 0 spacing: 0
HifiControlsUit.RadioButton {
id: performanceLowPower
colorScheme: hifi.colorSchemes.dark
height: 18
fontSize: 16
leftPadding: 0
text: "Low Power"
checked: Performance.getPerformancePreset() === PerformanceEnums.LOW_POWER
onClicked: {
Performance.setPerformancePreset(PerformanceEnums.LOW_POWER);
root.refreshAllDropdowns();
}
}
HifiControlsUit.RadioButton { HifiControlsUit.RadioButton {
id: performanceLow id: performanceLow
colorScheme: hifi.colorSchemes.dark colorScheme: hifi.colorSchemes.dark
@ -358,6 +372,68 @@ Item {
} }
} }
} }
ColumnLayout {
Layout.topMargin: 20
Layout.preferredWidth: parent.width
spacing: 0
Item {
Layout.preferredWidth: parent.width
Layout.preferredHeight: 35
HifiStylesUit.RalewayRegular {
id: antialiasingHeader
text: "Anti-aliasing"
anchors.left: parent.left
anchors.top: parent.top
width: 130
height: parent.height
size: 16
color: "#FFFFFF"
}
ListModel {
id: antialiasingModel
// Maintain same order as "AntialiasingConfig::Mode".
ListElement {
text: "None"
}
ListElement {
text: "TAA"
}
ListElement {
text: "FXAA"
}
}
HifiControlsUit.ComboBox {
id: antialiasingDropdown
anchors.left: antialiasingHeader.right
anchors.leftMargin: 20
anchors.top: parent.top
width: 280
height: parent.height
colorScheme: hifi.colorSchemes.dark
model: antialiasingModel
currentIndex: -1
function refreshAntialiasingDropdown() {
antialiasingDropdown.currentIndex = Render.antialiasingMode;
}
Component.onCompleted: {
antialiasingDropdown.refreshAntialiasingDropdown();
}
onCurrentIndexChanged: {
Render.antialiasingMode = currentIndex;
antialiasingDropdown.displayText = model.get(currentIndex).text;
}
}
}
}
} }
} }
@ -365,5 +441,6 @@ Item {
worldDetailDropdown.refreshWorldDetailDropdown(); worldDetailDropdown.refreshWorldDetailDropdown();
renderingEffectsDropdown.refreshRenderingEffectsDropdownDisplay(); renderingEffectsDropdown.refreshRenderingEffectsDropdownDisplay();
refreshRateDropdown.refreshRefreshRateDropdownDisplay(); refreshRateDropdown.refreshRefreshRateDropdownDisplay();
antialiasingDropdown.refreshAntialiasingDropdown();
} }
} }

View file

@ -174,6 +174,15 @@ Flickable {
Layout.topMargin: simplifiedUI.margins.settings.settingsGroupTopMargin Layout.topMargin: simplifiedUI.margins.settings.settingsGroupTopMargin
spacing: simplifiedUI.margins.settings.spacingBetweenRadiobuttons spacing: simplifiedUI.margins.settings.spacingBetweenRadiobuttons
SimplifiedControls.RadioButton {
id: performanceLow
text: "Low Power Quality" + (PlatformInfo.getTierProfiled() === PerformanceEnums.LOW_POWER ? " (Recommended)" : "")
checked: Performance.getPerformancePreset() === PerformanceEnums.LOW_POWER
onClicked: {
Performance.setPerformancePreset(PerformanceEnums.LOW_POWER);
}
}
SimplifiedControls.RadioButton { SimplifiedControls.RadioButton {
id: performanceLow id: performanceLow
text: "Low Quality" + (PlatformInfo.getTierProfiled() === PerformanceEnums.LOW ? " (Recommended)" : "") text: "Low Quality" + (PlatformInfo.getTierProfiled() === PerformanceEnums.LOW ? " (Recommended)" : "")

View file

@ -386,6 +386,8 @@ bool startCrashHandler(std::string appPath) {
} else { } else {
qCDebug(crash_handler) << "Locating own directory by argv[0]"; qCDebug(crash_handler) << "Locating own directory by argv[0]";
interfaceDir.setPath(QString::fromStdString(appPath)); interfaceDir.setPath(QString::fromStdString(appPath));
// argv[0] gets us the path including the binary file
interfaceDir.cdUp();
} }
if (!interfaceDir.exists(CRASHPAD_HANDLER_NAME)) { if (!interfaceDir.exists(CRASHPAD_HANDLER_NAME)) {

View file

@ -405,9 +405,6 @@ Menu::Menu() {
// Developer > Render >>> // Developer > Render >>>
MenuWrapper* renderOptionsMenu = developerMenu->addMenu("Render"); MenuWrapper* renderOptionsMenu = developerMenu->addMenu("Render");
addCheckableActionToQMenuAndActionHash(renderOptionsMenu, MenuOption::AntiAliasing, 0, RenderScriptingInterface::getInstance()->getAntialiasingEnabled(),
RenderScriptingInterface::getInstance(), SLOT(setAntialiasingEnabled(bool)));
addCheckableActionToQMenuAndActionHash(renderOptionsMenu, MenuOption::Shadows, 0, RenderScriptingInterface::getInstance()->getShadowsEnabled(), addCheckableActionToQMenuAndActionHash(renderOptionsMenu, MenuOption::Shadows, 0, RenderScriptingInterface::getInstance()->getShadowsEnabled(),
RenderScriptingInterface::getInstance(), SLOT(setShadowsEnabled(bool))); RenderScriptingInterface::getInstance(), SLOT(setShadowsEnabled(bool)));

View file

@ -224,7 +224,6 @@ namespace MenuOption {
const QString DesktopTabletToToolbar = "Desktop Tablet Becomes Toolbar"; const QString DesktopTabletToToolbar = "Desktop Tablet Becomes Toolbar";
const QString HMDTabletToToolbar = "HMD Tablet Becomes Toolbar"; const QString HMDTabletToToolbar = "HMD Tablet Becomes Toolbar";
const QString Shadows = "Shadows"; const QString Shadows = "Shadows";
const QString AntiAliasing = "Temporal Antialiasing (FXAA if disabled)";
const QString AmbientOcclusion = "Ambient Occlusion"; const QString AmbientOcclusion = "Ambient Occlusion";
const QString NotificationSounds = "play_notification_sounds"; const QString NotificationSounds = "play_notification_sounds";
const QString NotificationSoundsSnapshot = "play_notification_sounds_snapshot"; const QString NotificationSoundsSnapshot = "play_notification_sounds_snapshot";

View file

@ -29,10 +29,11 @@ void PerformanceManager::setupPerformancePresetSettings(bool evaluatePlatformTie
// Here is the mapping between platformTier and performance profile // Here is the mapping between platformTier and performance profile
const std::array<PerformanceManager::PerformancePreset, platform::Profiler::NumTiers> platformToPerformancePresetMap = { { const std::array<PerformanceManager::PerformancePreset, platform::Profiler::NumTiers> platformToPerformancePresetMap = { {
PerformanceManager::PerformancePreset::MID, // platform::Profiler::UNKNOWN PerformanceManager::PerformancePreset::MID, // platform::Profiler::UNKNOWN
PerformanceManager::PerformancePreset::LOW, // platform::Profiler::LOW PerformanceManager::PerformancePreset::LOW_POWER, // platform::Profiler::LOW_POWER
PerformanceManager::PerformancePreset::MID, // platform::Profiler::MID PerformanceManager::PerformancePreset::LOW, // platform::Profiler::LOW
PerformanceManager::PerformancePreset::HIGH // platform::Profiler::HIGH PerformanceManager::PerformancePreset::MID, // platform::Profiler::MID
PerformanceManager::PerformancePreset::HIGH // platform::Profiler::HIGH
} }; } };
// What is our profile? // What is our profile?
@ -69,15 +70,15 @@ void PerformanceManager::applyPerformancePreset(PerformanceManager::PerformanceP
bool isDeferredCapable = platform::Profiler::isRenderMethodDeferredCapable(); bool isDeferredCapable = platform::Profiler::isRenderMethodDeferredCapable();
auto masterDisplay = platform::getDisplay(platform::getMasterDisplay()); auto masterDisplay = platform::getDisplay(platform::getMasterDisplay());
// eval recommanded PPI and Scale // eval recommended PPI and Scale
float recommandedPpiScale = 1.0f; float recommendedPpiScale = 1.0f;
const float RECOMMANDED_PPI[] = { 200.0f, 120.f, 160.f, 250.f}; const float RECOMMENDED_PPI[] = { 200.0f, 200.0f, 120.f, 160.f, 250.f};
if (!masterDisplay.empty() && masterDisplay.count(platform::keys::display::ppi)) { if (!masterDisplay.empty() && masterDisplay.count(platform::keys::display::ppi)) {
float ppi = masterDisplay[platform::keys::display::ppi]; float ppi = masterDisplay[platform::keys::display::ppi];
// only scale if the actual ppi is higher than the recommended ppi // only scale if the actual ppi is higher than the recommended ppi
if (ppi > RECOMMANDED_PPI[preset]) { if (ppi > RECOMMENDED_PPI[preset]) {
// make sure the scale is no less than a quarter // make sure the scale is no less than a quarter
recommandedPpiScale = std::max(0.25f, RECOMMANDED_PPI[preset] / (float) ppi); recommendedPpiScale = std::max(0.25f, RECOMMENDED_PPI[preset] / (float) ppi);
} }
} }
@ -87,39 +88,50 @@ void PerformanceManager::applyPerformancePreset(PerformanceManager::PerformanceP
RenderScriptingInterface::RenderMethod::DEFERRED : RenderScriptingInterface::RenderMethod::DEFERRED :
RenderScriptingInterface::RenderMethod::FORWARD ) ); RenderScriptingInterface::RenderMethod::FORWARD ) );
RenderScriptingInterface::getInstance()->setViewportResolutionScale(recommandedPpiScale); RenderScriptingInterface::getInstance()->setViewportResolutionScale(recommendedPpiScale);
RenderScriptingInterface::getInstance()->setShadowsEnabled(true); RenderScriptingInterface::getInstance()->setShadowsEnabled(true);
qApp->getRefreshRateManager().setRefreshRateProfile(RefreshRateManager::RefreshRateProfile::REALTIME); qApp->getRefreshRateManager().setRefreshRateProfile(RefreshRateManager::RefreshRateProfile::REALTIME);
DependencyManager::get<LODManager>()->setWorldDetailQuality(WORLD_DETAIL_HIGH); DependencyManager::get<LODManager>()->setWorldDetailQuality(WORLD_DETAIL_HIGH);
break; break;
case PerformancePreset::MID: case PerformancePreset::MID:
RenderScriptingInterface::getInstance()->setRenderMethod((isDeferredCapable ? RenderScriptingInterface::getInstance()->setRenderMethod((isDeferredCapable ?
RenderScriptingInterface::RenderMethod::DEFERRED : RenderScriptingInterface::RenderMethod::DEFERRED :
RenderScriptingInterface::RenderMethod::FORWARD)); RenderScriptingInterface::RenderMethod::FORWARD));
RenderScriptingInterface::getInstance()->setViewportResolutionScale(recommandedPpiScale); RenderScriptingInterface::getInstance()->setViewportResolutionScale(recommendedPpiScale);
RenderScriptingInterface::getInstance()->setShadowsEnabled(false); RenderScriptingInterface::getInstance()->setShadowsEnabled(false);
qApp->getRefreshRateManager().setRefreshRateProfile(RefreshRateManager::RefreshRateProfile::INTERACTIVE); qApp->getRefreshRateManager().setRefreshRateProfile(RefreshRateManager::RefreshRateProfile::REALTIME);
DependencyManager::get<LODManager>()->setWorldDetailQuality(WORLD_DETAIL_MEDIUM); DependencyManager::get<LODManager>()->setWorldDetailQuality(WORLD_DETAIL_MEDIUM);
break; break;
case PerformancePreset::LOW: case PerformancePreset::LOW:
RenderScriptingInterface::getInstance()->setRenderMethod(RenderScriptingInterface::RenderMethod::FORWARD);
RenderScriptingInterface::getInstance()->setShadowsEnabled(false);
qApp->getRefreshRateManager().setRefreshRateProfile(RefreshRateManager::RefreshRateProfile::REALTIME);
RenderScriptingInterface::getInstance()->setViewportResolutionScale(recommendedPpiScale);
DependencyManager::get<LODManager>()->setWorldDetailQuality(WORLD_DETAIL_LOW);
break;
case PerformancePreset::LOW_POWER:
RenderScriptingInterface::getInstance()->setRenderMethod(RenderScriptingInterface::RenderMethod::FORWARD); RenderScriptingInterface::getInstance()->setRenderMethod(RenderScriptingInterface::RenderMethod::FORWARD);
RenderScriptingInterface::getInstance()->setShadowsEnabled(false); RenderScriptingInterface::getInstance()->setShadowsEnabled(false);
qApp->getRefreshRateManager().setRefreshRateProfile(RefreshRateManager::RefreshRateProfile::ECO); qApp->getRefreshRateManager().setRefreshRateProfile(RefreshRateManager::RefreshRateProfile::ECO);
RenderScriptingInterface::getInstance()->setViewportResolutionScale(recommandedPpiScale); RenderScriptingInterface::getInstance()->setViewportResolutionScale(recommendedPpiScale);
DependencyManager::get<LODManager>()->setWorldDetailQuality(WORLD_DETAIL_LOW); DependencyManager::get<LODManager>()->setWorldDetailQuality(WORLD_DETAIL_LOW);
break; break;
case PerformancePreset::UNKNOWN: case PerformancePreset::UNKNOWN:
// Intentionally unbroken.
default: default:
// Do nothing anymore // Do nothing.
break; break;
} }
} }

View file

@ -21,6 +21,7 @@ class PerformanceManager {
public: public:
enum PerformancePreset { enum PerformancePreset {
UNKNOWN = 0, // Matching the platform Tier profiles enumeration for coherence UNKNOWN = 0, // Matching the platform Tier profiles enumeration for coherence
LOW_POWER,
LOW, LOW,
MID, MID,
HIGH, HIGH,

View file

@ -29,7 +29,7 @@ PerformanceScriptingInterface::PerformancePreset PerformanceScriptingInterface::
} }
QStringList PerformanceScriptingInterface::getPerformancePresetNames() const { QStringList PerformanceScriptingInterface::getPerformancePresetNames() const {
static const QStringList performancePresetNames = { "UNKNOWN", "LOW", "MID", "HIGH" }; static const QStringList performancePresetNames = { "UNKNOWN", "LOW_POWER", "LOW", "MID", "HIGH" };
return performancePresetNames; return performancePresetNames;
} }

View file

@ -57,6 +57,7 @@ public:
// PerformanceManager PerformancePreset tri state level enums // PerformanceManager PerformancePreset tri state level enums
enum PerformancePreset { enum PerformancePreset {
UNKNOWN = PerformanceManager::PerformancePreset::UNKNOWN, UNKNOWN = PerformanceManager::PerformancePreset::UNKNOWN,
LOW_POWER = PerformanceManager::PerformancePreset::LOW_POWER,
LOW = PerformanceManager::PerformancePreset::LOW, LOW = PerformanceManager::PerformancePreset::LOW,
MID = PerformanceManager::PerformancePreset::MID, MID = PerformanceManager::PerformancePreset::MID,
HIGH = PerformanceManager::PerformancePreset::HIGH, HIGH = PerformanceManager::PerformancePreset::HIGH,

View file

@ -8,7 +8,6 @@
#include "RenderScriptingInterface.h" #include "RenderScriptingInterface.h"
#include "LightingModel.h" #include "LightingModel.h"
#include "AntialiasingEffect.h"
RenderScriptingInterface* RenderScriptingInterface::getInstance() { RenderScriptingInterface* RenderScriptingInterface::getInstance() {
@ -29,13 +28,14 @@ void RenderScriptingInterface::loadSettings() {
_renderMethod = (_renderMethodSetting.get()); _renderMethod = (_renderMethodSetting.get());
_shadowsEnabled = (_shadowsEnabledSetting.get()); _shadowsEnabled = (_shadowsEnabledSetting.get());
_ambientOcclusionEnabled = (_ambientOcclusionEnabledSetting.get()); _ambientOcclusionEnabled = (_ambientOcclusionEnabledSetting.get());
_antialiasingEnabled = (_antialiasingEnabledSetting.get()); //_antialiasingMode = (_antialiasingModeSetting.get());
_antialiasingMode = static_cast<AntialiasingConfig::Mode>(_antialiasingModeSetting.get());
_viewportResolutionScale = (_viewportResolutionScaleSetting.get()); _viewportResolutionScale = (_viewportResolutionScaleSetting.get());
}); });
forceRenderMethod((RenderMethod)_renderMethod); forceRenderMethod((RenderMethod)_renderMethod);
forceShadowsEnabled(_shadowsEnabled); forceShadowsEnabled(_shadowsEnabled);
forceAmbientOcclusionEnabled(_ambientOcclusionEnabled); forceAmbientOcclusionEnabled(_ambientOcclusionEnabled);
forceAntialiasingEnabled(_antialiasingEnabled); forceAntialiasingMode(_antialiasingMode);
forceViewportResolutionScale(_viewportResolutionScale); forceViewportResolutionScale(_viewportResolutionScale);
} }
@ -121,35 +121,50 @@ void RenderScriptingInterface::forceAmbientOcclusionEnabled(bool enabled) {
}); });
} }
bool RenderScriptingInterface::getAntialiasingEnabled() const { AntialiasingConfig::Mode RenderScriptingInterface::getAntialiasingMode() const {
return _antialiasingEnabled; return _antialiasingMode;
} }
void RenderScriptingInterface::setAntialiasingEnabled(bool enabled) { void RenderScriptingInterface::setAntialiasingMode(AntialiasingConfig::Mode mode) {
if (_antialiasingEnabled != enabled) { if (_antialiasingMode != mode) {
forceAntialiasingEnabled(enabled); forceAntialiasingMode(mode);
emit settingsChanged(); emit settingsChanged();
} }
} }
void RenderScriptingInterface::forceAntialiasingEnabled(bool enabled) { void RenderScriptingInterface::forceAntialiasingMode(AntialiasingConfig::Mode mode) {
_renderSettingLock.withWriteLock([&] { _renderSettingLock.withWriteLock([&] {
_antialiasingEnabled = (enabled); _antialiasingMode = mode;
_antialiasingEnabledSetting.set(enabled);
auto mainViewJitterCamConfig = qApp->getRenderEngine()->getConfiguration()->getConfig<JitterSample>("RenderMainView.JitterCam"); auto mainViewJitterCamConfig = qApp->getRenderEngine()->getConfiguration()->getConfig<JitterSample>("RenderMainView.JitterCam");
auto mainViewAntialiasingConfig = qApp->getRenderEngine()->getConfiguration()->getConfig<Antialiasing>("RenderMainView.Antialiasing"); auto mainViewAntialiasingConfig = qApp->getRenderEngine()->getConfiguration()->getConfig<Antialiasing>("RenderMainView.Antialiasing");
if (mainViewJitterCamConfig && mainViewAntialiasingConfig) { if (mainViewJitterCamConfig && mainViewAntialiasingConfig) {
Menu::getInstance()->setIsOptionChecked(MenuOption::AntiAliasing, enabled); switch (mode) {
if (enabled) { case AntialiasingConfig::Mode::NONE:
mainViewJitterCamConfig->play(); mainViewJitterCamConfig->none();
mainViewAntialiasingConfig->setDebugFXAA(false); mainViewAntialiasingConfig->blend = 1;
} mainViewAntialiasingConfig->setDebugFXAA(false);
else { break;
mainViewJitterCamConfig->none(); case AntialiasingConfig::Mode::TAA:
mainViewAntialiasingConfig->setDebugFXAA(true); mainViewJitterCamConfig->play();
mainViewAntialiasingConfig->blend = 0.25;
mainViewAntialiasingConfig->setDebugFXAA(false);
break;
case AntialiasingConfig::Mode::FXAA:
mainViewJitterCamConfig->none();
mainViewAntialiasingConfig->blend = 0.25;
mainViewAntialiasingConfig->setDebugFXAA(true);
break;
default:
_antialiasingMode = AntialiasingConfig::Mode::NONE;
mainViewJitterCamConfig->none();
mainViewAntialiasingConfig->blend = 1;
mainViewAntialiasingConfig->setDebugFXAA(false);
break;
} }
} }
_antialiasingModeSetting.set(_antialiasingMode);
}); });
} }

View file

@ -13,6 +13,8 @@
#include "Application.h" #include "Application.h"
#include "RenderForward.h" #include "RenderForward.h"
#include "AntialiasingEffect.h"
/*@jsdoc /*@jsdoc
* The <code>Render</code> API enables you to configure the graphics engine. * The <code>Render</code> API enables you to configure the graphics engine.
@ -27,7 +29,7 @@
* @property {boolean} shadowsEnabled - <code>true</code> if shadows are enabled, <code>false</code> if they're disabled. * @property {boolean} shadowsEnabled - <code>true</code> if shadows are enabled, <code>false</code> if they're disabled.
* @property {boolean} ambientOcclusionEnabled - <code>true</code> if ambient occlusion is enabled, <code>false</code> if it's * @property {boolean} ambientOcclusionEnabled - <code>true</code> if ambient occlusion is enabled, <code>false</code> if it's
* disabled. * disabled.
* @property {boolean} antialiasingEnabled - <code>true</code> if anti-aliasing is enabled, <code>false</code> if it's disabled. * @property {integer} antialiasingMode - The active anti-aliasing mode.
* @property {number} viewportResolutionScale - The view port resolution scale, <code>&gt; 0.0</code>. * @property {number} viewportResolutionScale - The view port resolution scale, <code>&gt; 0.0</code>.
*/ */
class RenderScriptingInterface : public QObject { class RenderScriptingInterface : public QObject {
@ -35,7 +37,7 @@ class RenderScriptingInterface : public QObject {
Q_PROPERTY(RenderMethod renderMethod READ getRenderMethod WRITE setRenderMethod 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 shadowsEnabled READ getShadowsEnabled WRITE setShadowsEnabled NOTIFY settingsChanged)
Q_PROPERTY(bool ambientOcclusionEnabled READ getAmbientOcclusionEnabled WRITE setAmbientOcclusionEnabled NOTIFY settingsChanged) Q_PROPERTY(bool ambientOcclusionEnabled READ getAmbientOcclusionEnabled WRITE setAmbientOcclusionEnabled NOTIFY settingsChanged)
Q_PROPERTY(bool antialiasingEnabled READ getAntialiasingEnabled WRITE setAntialiasingEnabled NOTIFY settingsChanged) Q_PROPERTY(AntialiasingConfig::Mode antialiasingMode READ getAntialiasingMode WRITE setAntialiasingMode NOTIFY settingsChanged)
Q_PROPERTY(float viewportResolutionScale READ getViewportResolutionScale WRITE setViewportResolutionScale NOTIFY settingsChanged) Q_PROPERTY(float viewportResolutionScale READ getViewportResolutionScale WRITE setViewportResolutionScale NOTIFY settingsChanged)
public: public:
@ -143,18 +145,18 @@ public slots:
void setAmbientOcclusionEnabled(bool enabled); void setAmbientOcclusionEnabled(bool enabled);
/*@jsdoc /*@jsdoc
* Gets whether or not anti-aliasing is enabled. * Gets the active anti-aliasing mode.
* @function Render.getAntialiasingEnabled * @function Render.getAntialiasingMode
* @returns {boolean} <code>true</code> if anti-aliasing is enabled, <code>false</code> if it's disabled. * @returns {integer} the active anti-aliasing mode.
*/ */
bool getAntialiasingEnabled() const; AntialiasingConfig::Mode getAntialiasingMode() const;
/*@jsdoc /*@jsdoc
* Sets whether or not anti-aliasing is enabled. * Sets the active anti-aliasing mode.
* @function Render.setAntialiasingEnabled * @function Render.setAntialiasingMode
* @param {boolean} enabled - <code>true</code> to enable anti-aliasing, <code>false</code> to disable. * @param {integer} the active anti-aliasing mode.
*/ */
void setAntialiasingEnabled(bool enabled); void setAntialiasingMode(AntialiasingConfig::Mode mode);
/*@jsdoc /*@jsdoc
* Gets the view port resolution scale. * Gets the view port resolution scale.
@ -192,21 +194,22 @@ private:
int _renderMethod{ RENDER_FORWARD ? render::Args::RenderMethod::FORWARD : render::Args::RenderMethod::DEFERRED }; int _renderMethod{ RENDER_FORWARD ? render::Args::RenderMethod::FORWARD : render::Args::RenderMethod::DEFERRED };
bool _shadowsEnabled{ true }; bool _shadowsEnabled{ true };
bool _ambientOcclusionEnabled{ false }; bool _ambientOcclusionEnabled{ false };
bool _antialiasingEnabled{ true }; AntialiasingConfig::Mode _antialiasingMode{ AntialiasingConfig::Mode::TAA };
float _viewportResolutionScale{ 1.0f }; float _viewportResolutionScale{ 1.0f };
// Actual settings saved on disk // Actual settings saved on disk
Setting::Handle<int> _renderMethodSetting { "renderMethod", RENDER_FORWARD ? render::Args::RenderMethod::FORWARD : render::Args::RenderMethod::DEFERRED }; Setting::Handle<int> _renderMethodSetting { "renderMethod", RENDER_FORWARD ? render::Args::RenderMethod::FORWARD : render::Args::RenderMethod::DEFERRED };
Setting::Handle<bool> _shadowsEnabledSetting { "shadowsEnabled", true }; Setting::Handle<bool> _shadowsEnabledSetting { "shadowsEnabled", true };
Setting::Handle<bool> _ambientOcclusionEnabledSetting { "ambientOcclusionEnabled", false }; Setting::Handle<bool> _ambientOcclusionEnabledSetting { "ambientOcclusionEnabled", false };
Setting::Handle<bool> _antialiasingEnabledSetting { "antialiasingEnabled", true }; //Setting::Handle<AntialiasingConfig::Mode> _antialiasingModeSetting { "antialiasingMode", AntialiasingConfig::Mode::TAA };
Setting::Handle<int> _antialiasingModeSetting { "antialiasingMode", AntialiasingConfig::Mode::TAA };
Setting::Handle<float> _viewportResolutionScaleSetting { "viewportResolutionScale", 1.0f }; Setting::Handle<float> _viewportResolutionScaleSetting { "viewportResolutionScale", 1.0f };
// Force assign both setting AND runtime value to the parameter value // Force assign both setting AND runtime value to the parameter value
void forceRenderMethod(RenderMethod renderMethod); void forceRenderMethod(RenderMethod renderMethod);
void forceShadowsEnabled(bool enabled); void forceShadowsEnabled(bool enabled);
void forceAmbientOcclusionEnabled(bool enabled); void forceAmbientOcclusionEnabled(bool enabled);
void forceAntialiasingEnabled(bool enabled); void forceAntialiasingMode(AntialiasingConfig::Mode mode);
void forceViewportResolutionScale(float scale); void forceViewportResolutionScale(float scale);
static std::once_flag registry_flag; static std::once_flag registry_flag;

View file

@ -69,7 +69,7 @@ if (WIN32)
set(OPENSSL_ROOT_DIR ${SSL_DIR}) set(OPENSSL_ROOT_DIR ${SSL_DIR})
message("SSL dir is ${SSL_DIR}") message("SSL dir is ${SSL_DIR}")
set(OPENSSL_USE_STATIC_LIBS TRUE) set(OPENSSL_USE_STATIC_LIBS TRUE)
find_package(OpenSSL REQUIRED) find_package(OpenSSL 1.1.0 REQUIRED)
message("-- Found OpenSSL Libs ${OPENSSL_LIBRARIES}") message("-- Found OpenSSL Libs ${OPENSSL_LIBRARIES}")
@ -105,7 +105,7 @@ endif()
if (APPLE) if (APPLE)
set(OPENSSL_USE_STATIC_LIBS TRUE) set(OPENSSL_USE_STATIC_LIBS TRUE)
find_package(OpenSSL REQUIRED) find_package(OpenSSL 1.1.0 REQUIRED)
endif() endif()
find_package(Qt5 COMPONENTS Core Gui Qml Quick QuickControls2 Network REQUIRED) find_package(Qt5 COMPONENTS Core Gui Qml Quick QuickControls2 Network REQUIRED)

View file

@ -338,6 +338,7 @@ void HTTPConnection::readHeaders() {
QByteArray clength = requestHeader("Content-Length"); QByteArray clength = requestHeader("Content-Length");
if (clength.isEmpty()) { if (clength.isEmpty()) {
_requestContent = MemoryStorage::make(0);
_parentManager->handleHTTPRequest(this, _requestUrl); _parentManager->handleHTTPRequest(this, _requestUrl);
} else { } else {

View file

@ -31,7 +31,7 @@ HTTPManager::HTTPManager(const QHostAddress& listenAddress, quint16 port, const
_port(port) _port(port)
{ {
bindSocket(); bindSocket();
_isListeningTimer = new QTimer(this); _isListeningTimer = new QTimer(this);
connect(_isListeningTimer, &QTimer::timeout, this, &HTTPManager::isTcpServerListening); connect(_isListeningTimer, &QTimer::timeout, this, &HTTPManager::isTcpServerListening);
_isListeningTimer->start(SOCKET_CHECK_INTERVAL_IN_MS); _isListeningTimer->start(SOCKET_CHECK_INTERVAL_IN_MS);
@ -39,7 +39,7 @@ HTTPManager::HTTPManager(const QHostAddress& listenAddress, quint16 port, const
void HTTPManager::incomingConnection(qintptr socketDescriptor) { void HTTPManager::incomingConnection(qintptr socketDescriptor) {
QTcpSocket* socket = new QTcpSocket(this); QTcpSocket* socket = new QTcpSocket(this);
if (socket->setSocketDescriptor(socketDescriptor)) { if (socket->setSocketDescriptor(socketDescriptor)) {
new HTTPConnection(socket, this); new HTTPConnection(socket, this);
} else { } else {
@ -60,7 +60,7 @@ bool HTTPManager::handleHTTPRequest(HTTPConnection* connection, const QUrl& url,
// so we don't need to attempt to do so in the document root // so we don't need to attempt to do so in the document root
return true; return true;
} }
if (!_documentRoot.isEmpty()) { if (!_documentRoot.isEmpty()) {
// check to see if there is a file to serve from the document root for this path // check to see if there is a file to serve from the document root for this path
QString subPath = url.path(); QString subPath = url.path();
@ -88,22 +88,22 @@ bool HTTPManager::handleHTTPRequest(HTTPConnection* connection, const QUrl& url,
// this could be a directory with a trailing slash // this could be a directory with a trailing slash
// send a redirect to the path with a slash so we can // send a redirect to the path with a slash so we can
QString redirectLocation = '/' + subPath + '/'; QString redirectLocation = '/' + subPath + '/';
if (!url.query().isEmpty()) { if (!url.query().isEmpty()) {
redirectLocation += "?" + url.query(); redirectLocation += "?" + url.query();
} }
QHash<QByteArray, QByteArray> redirectHeader; QHash<QByteArray, QByteArray> redirectHeader;
redirectHeader.insert(QByteArray("Location"), redirectLocation.toUtf8()); redirectHeader.insert(QByteArray("Location"), redirectLocation.toUtf8());
connection->respond(HTTPConnection::StatusCode302, "", HTTPConnection::DefaultContentType, redirectHeader); connection->respond(HTTPConnection::StatusCode302, "", HTTPConnection::DefaultContentType, redirectHeader);
return true; return true;
} }
// if the last thing is a trailing slash then we want to look for index file // if the last thing is a trailing slash then we want to look for index file
if (subPath.endsWith('/') || subPath.size() == 0) { if (subPath.endsWith('/') || subPath.size() == 0) {
QStringList possibleIndexFiles = QStringList() << "index.html" << "index.shtml"; QStringList possibleIndexFiles = QStringList() << "index.html" << "index.shtml";
foreach (const QString& possibleIndexFilename, possibleIndexFiles) { foreach (const QString& possibleIndexFilename, possibleIndexFiles) {
if (QFileInfo(absoluteFilePath + possibleIndexFilename).exists()) { if (QFileInfo(absoluteFilePath + possibleIndexFilename).exists()) {
filePath = absoluteFilePath + possibleIndexFilename; filePath = absoluteFilePath + possibleIndexFilename;
@ -111,64 +111,65 @@ bool HTTPManager::handleHTTPRequest(HTTPConnection* connection, const QUrl& url,
} }
} }
} }
if (!filePath.isEmpty()) { if (!filePath.isEmpty()) {
// file exists, serve it // file exists, serve it
static QMimeDatabase mimeDatabase; static QMimeDatabase mimeDatabase;
auto localFile = std::unique_ptr<QFile>(new QFile(filePath)); auto localFile = std::unique_ptr<QFile>(new QFile(filePath));
localFile->open(QIODevice::ReadOnly); localFile->open(QIODevice::ReadOnly);
QByteArray localFileData; QByteArray localFileData;
QFileInfo localFileInfo(filePath); QFileInfo localFileInfo(filePath);
if (localFileInfo.completeSuffix() == "shtml") { if (localFileInfo.completeSuffix() == "shtml") {
localFileData = localFile->readAll(); localFileData = localFile->readAll();
// this is a file that may have some SSI statements // this is a file that may have some SSI statements
// the only thing we support is the include directive, but check the contents for that // the only thing we support is the include directive, but check the contents for that
// setup our static QRegExp that will catch <!--#include virtual ... --> and <!--#include file .. --> directives // setup our static QRegExp that will catch <!--#include virtual ... --> and <!--#include file .. --> directives
const QString includeRegExpString = "<!--\\s*#include\\s+(virtual|file)\\s?=\\s?\"(\\S+)\"\\s*-->"; const QString includeRegExpString = "<!--\\s*#include\\s+(virtual|file)\\s?=\\s?\"(\\S+)\"\\s*-->";
QRegExp includeRegExp(includeRegExpString); QRegExp includeRegExp(includeRegExpString);
int matchPosition = 0; int matchPosition = 0;
QString localFileString(localFileData); QString localFileString(localFileData);
while ((matchPosition = includeRegExp.indexIn(localFileString, matchPosition)) != -1) { while ((matchPosition = includeRegExp.indexIn(localFileString, matchPosition)) != -1) {
// check if this is a file or vitual include // check if this is a file or vitual include
bool isFileInclude = includeRegExp.cap(1) == "file"; bool isFileInclude = includeRegExp.cap(1) == "file";
// setup the correct file path for the included file // setup the correct file path for the included file
QString includeFilePath = isFileInclude QString includeFilePath = isFileInclude
? localFileInfo.canonicalPath() + "/" + includeRegExp.cap(2) ? localFileInfo.canonicalPath() + "/" + includeRegExp.cap(2)
: _documentRoot + includeRegExp.cap(2); : _documentRoot + includeRegExp.cap(2);
QString replacementString; QString replacementString;
if (QFileInfo(includeFilePath).isFile()) { if (QFileInfo(includeFilePath).isFile()) {
QFile includedFile(includeFilePath); QFile includedFile(includeFilePath);
includedFile.open(QIODevice::ReadOnly); includedFile.open(QIODevice::ReadOnly);
replacementString = QString(includedFile.readAll()); replacementString = QString(includedFile.readAll());
} else { } else {
qCDebug(embeddedwebserver) << "SSI include directive referenced a missing file:" << includeFilePath; qCDebug(embeddedwebserver) << "SSI include directive referenced a missing file:" << includeFilePath;
} }
// replace the match with the contents of the file, or an empty string if the file was not found // replace the match with the contents of the file, or an empty string if the file was not found
localFileString.replace(matchPosition, includeRegExp.matchedLength(), replacementString); localFileString.replace(matchPosition, includeRegExp.matchedLength(), replacementString);
// push the match position forward so we can check the next match // push the match position forward so we can check the next match
matchPosition += includeRegExp.matchedLength(); matchPosition += includeRegExp.matchedLength();
} }
localFileData = localFileString.toLocal8Bit(); localFileData = localFileString.toLocal8Bit();
} }
// if this is an shtml file just make the MIME type match HTML so browsers aren't confused // if this is an shtml, html or htm file just make the MIME type match HTML so browsers aren't confused
// otherwise use the mimeDatabase to look it up // otherwise use the mimeDatabase to look it up
auto mimeType = localFileInfo.suffix() == "shtml" auto suffix = localFileInfo.suffix();
auto mimeType = (suffix == "shtml" || suffix == "html" || suffix == "htm")
? QString { "text/html" } ? QString { "text/html" }
: mimeDatabase.mimeTypeForFile(filePath).name(); : mimeDatabase.mimeTypeForFile(filePath).name();
@ -181,10 +182,10 @@ bool HTTPManager::handleHTTPRequest(HTTPConnection* connection, const QUrl& url,
return true; return true;
} }
} }
// respond with a 404 // respond with a 404
connection->respond(HTTPConnection::StatusCode404, "Resource not found."); connection->respond(HTTPConnection::StatusCode404, "Resource not found.");
return true; return true;
} }
@ -201,10 +202,10 @@ void HTTPManager::isTcpServerListening() {
bool HTTPManager::bindSocket() { bool HTTPManager::bindSocket() {
qCDebug(embeddedwebserver) << "Attempting to bind TCP socket on port " << QString::number(_port); qCDebug(embeddedwebserver) << "Attempting to bind TCP socket on port " << QString::number(_port);
if (listen(_listenAddress, _port)) { if (listen(_listenAddress, _port)) {
qCDebug(embeddedwebserver) << "TCP socket is listening on" << serverAddress() << "and port" << serverPort(); qCDebug(embeddedwebserver) << "TCP socket is listening on" << serverAddress() << "and port" << serverPort();
return true; return true;
} else { } else {
QString errorMessage = "Failed to open HTTP server socket: " + errorString() + ", can't continue"; QString errorMessage = "Failed to open HTTP server socket: " + errorString() + ", can't continue";

View file

@ -151,13 +151,21 @@ void GLBackend::init() {
GPUIdent* gpu = GPUIdent::getInstance(vendor, renderer); GPUIdent* gpu = GPUIdent::getInstance(vendor, renderer);
unsigned int mem; unsigned int mem;
// Do not try to get texture memory information on unsupported systems.
#if defined(Q_OS_ANDROID) || defined(USE_GLES) || defined(Q_OS_DARWIN)
qCDebug(gpugllogging) << "Automatic texture memory not supported in this configuration";
_videoCard = Unknown;
_dedicatedMemory = gpu->getMemory() * BYTES_PER_MIB;
_totalMemory = _dedicatedMemory;
#endif
#if !defined(Q_OS_ANDROID) && !defined(USE_GLES) && !defined(Q_OS_DARWIN)
if (vendor.contains("NVIDIA") ) { if (vendor.contains("NVIDIA") ) {
qCDebug(gpugllogging) << "NVIDIA card detected"; qCDebug(gpugllogging) << "NVIDIA card detected";
#if !defined(Q_OS_ANDROID) && !defined(USE_GLES)
GL_GET_INTEGER(GPU_MEMORY_INFO_DEDICATED_VIDMEM_NVX); GL_GET_INTEGER(GPU_MEMORY_INFO_DEDICATED_VIDMEM_NVX);
GL_GET_INTEGER(GPU_MEMORY_INFO_TOTAL_AVAILABLE_MEMORY_NVX); GL_GET_INTEGER(GPU_MEMORY_INFO_TOTAL_AVAILABLE_MEMORY_NVX);
GL_GET_INTEGER(GPU_MEMORY_INFO_CURRENT_AVAILABLE_VIDMEM_NVX); GL_GET_INTEGER(GPU_MEMORY_INFO_CURRENT_AVAILABLE_VIDMEM_NVX);
#endif
qCDebug(gpugllogging) << "GPU_MEMORY_INFO_DEDICATED_VIDMEM_NVX: " << GPU_MEMORY_INFO_DEDICATED_VIDMEM_NVX; qCDebug(gpugllogging) << "GPU_MEMORY_INFO_DEDICATED_VIDMEM_NVX: " << GPU_MEMORY_INFO_DEDICATED_VIDMEM_NVX;
qCDebug(gpugllogging) << "GPU_MEMORY_INFO_TOTAL_AVAILABLE_MEMORY_NVX: " << GPU_MEMORY_INFO_TOTAL_AVAILABLE_MEMORY_NVX; qCDebug(gpugllogging) << "GPU_MEMORY_INFO_TOTAL_AVAILABLE_MEMORY_NVX: " << GPU_MEMORY_INFO_TOTAL_AVAILABLE_MEMORY_NVX;
@ -170,10 +178,10 @@ void GLBackend::init() {
} else if (vendor.contains("ATI")) { } else if (vendor.contains("ATI")) {
qCDebug(gpugllogging) << "ATI card detected"; qCDebug(gpugllogging) << "ATI card detected";
#if !defined(Q_OS_ANDROID) && !defined(USE_GLES)
GL_GET_INTEGER(TEXTURE_FREE_MEMORY_ATI);
#endif
GL_GET_INTEGER(TEXTURE_FREE_MEMORY_ATI);
// We are actually getting free memory instead of total memory
_totalMemory = TEXTURE_FREE_MEMORY_ATI * BYTES_PER_KIB; _totalMemory = TEXTURE_FREE_MEMORY_ATI * BYTES_PER_KIB;
_dedicatedMemory = _totalMemory; _dedicatedMemory = _totalMemory;
_videoCard = ATI; _videoCard = ATI;
@ -187,9 +195,10 @@ void GLBackend::init() {
} else { } else {
qCCritical(gpugllogging) << "Don't know how to get memory for OpenGL vendor " << vendor << "; renderer " << renderer << ", trying fallback"; qCCritical(gpugllogging) << "Don't know how to get memory for OpenGL vendor " << vendor << "; renderer " << renderer << ", trying fallback";
_videoCard = Unknown; _videoCard = Unknown;
_dedicatedMemory = gpu->getMemory(); _dedicatedMemory = gpu->getMemory() * BYTES_PER_MIB;
_totalMemory = _dedicatedMemory; _totalMemory = _dedicatedMemory;
} }
#endif
qCDebug(gpugllogging) << "dedicated: " << _dedicatedMemory; qCDebug(gpugllogging) << "dedicated: " << _dedicatedMemory;
qCDebug(gpugllogging) << "total: " << _totalMemory; qCDebug(gpugllogging) << "total: " << _totalMemory;

View file

@ -132,7 +132,6 @@ void WebRTCSignalingServer::webSocketDisconnected() {
if (source) { if (source) {
auto address = source->peerAddress().toString() + ":" + QString::number(source->peerPort()); auto address = source->peerAddress().toString() + ":" + QString::number(source->peerPort());
_webSockets.remove(address); _webSockets.remove(address);
source->abort();
source->deleteLater(); source->deleteLater();
} }
} }

View file

@ -16,7 +16,7 @@
using namespace platform; using namespace platform;
const std::array<const char*, Profiler::Tier::NumTiers> Profiler::TierNames = {{ "UNKNOWN", "LOW", "MID", "HIGH" }}; const std::array<const char*, Profiler::Tier::NumTiers> Profiler::TierNames = {{ "UNKNOWN", "LOW_POWER", "LOW", "MID", "HIGH" }};
bool filterOnComputer(const platform::json& computer, Profiler::Tier& tier); bool filterOnComputer(const platform::json& computer, Profiler::Tier& tier);

View file

@ -19,6 +19,7 @@ class Profiler {
public: public:
enum Tier { enum Tier {
UNKNOWN = 0, UNKNOWN = 0,
LOW_POWER,
LOW, LOW,
MID, MID,
HIGH, HIGH,

View file

@ -140,7 +140,7 @@ void Antialiasing::run(const render::RenderContextPointer& renderContext, const
#else #else
void AntialiasingConfig::setAAMode(int mode) { void AntialiasingConfig::setAAMode(int mode) {
_mode = std::min((int)AntialiasingConfig::MODE_COUNT, std::max(0, mode)); _mode = std::min((int)AntialiasingConfig::MODE_COUNT, std::max(0, mode)); // Just use unsigned?
emit dirty(); emit dirty();
} }

View file

@ -110,11 +110,12 @@ public:
AntialiasingConfig() : render::Job::Config(true) {} AntialiasingConfig() : render::Job::Config(true) {}
enum Mode { enum Mode {
OFF = 0, NONE = 0,
TAA, TAA,
FXAA, FXAA,
MODE_COUNT MODE_COUNT
}; };
Q_ENUM(Mode) // Stored as signed int.
void setAAMode(int mode); void setAAMode(int mode);
int getAAMode() const { return _mode; } int getAAMode() const { return _mode; }
@ -122,7 +123,7 @@ public:
void setDebugFXAA(bool debug) { debugFXAAX = (debug ? 0.0f : 1.0f); emit dirty();} void setDebugFXAA(bool debug) { debugFXAAX = (debug ? 0.0f : 1.0f); emit dirty();}
bool debugFXAA() const { return (debugFXAAX == 0.0f ? true : false); } bool debugFXAA() const { return (debugFXAAX == 0.0f ? true : false); }
int _mode{ TAA }; int _mode{ TAA }; // '_' prefix but not private?
float blend{ 0.25f }; float blend{ 0.25f };
float sharpen{ 0.05f }; float sharpen{ 0.05f };
@ -216,8 +217,8 @@ private:
}; };
#else #else // User setting for antialias mode will probably be broken.
class AntiAliasingConfig : public render::Job::Config { class AntiAliasingConfig : public render::Job::Config { // Not to be confused with AntialiasingConfig...
Q_OBJECT Q_OBJECT
Q_PROPERTY(bool enabled MEMBER enabled) Q_PROPERTY(bool enabled MEMBER enabled)
public: public:
@ -236,7 +237,7 @@ public:
const gpu::PipelinePointer& getAntialiasingPipeline(); const gpu::PipelinePointer& getAntialiasingPipeline();
const gpu::PipelinePointer& getBlendPipeline(); const gpu::PipelinePointer& getBlendPipeline();
private: private:
gpu::FramebufferPointer _antialiasingBuffer; gpu::FramebufferPointer _antialiasingBuffer;

View file

@ -58,22 +58,6 @@ class TrackableLogger(logging.Logger):
logging.setLoggerClass(TrackableLogger) logging.setLoggerClass(TrackableLogger)
logger = logging.getLogger('prebuild') logger = logging.getLogger('prebuild')
def headSha():
if shutil.which('git') is None:
logger.warn("Unable to find git executable, can't caclulate commit ID")
return '0xDEADBEEF'
repo_dir = os.path.dirname(os.path.abspath(__file__))
git = subprocess.Popen(
'git rev-parse --short HEAD',
stdout=subprocess.PIPE, stderr=subprocess.PIPE,
shell=True, cwd=repo_dir, universal_newlines=True,
)
stdout, _ = git.communicate()
sha = stdout.split('\n')[0]
if not sha:
raise RuntimeError("couldn't find git sha for repository {}".format(repo_dir))
return sha
@contextmanager @contextmanager
def timer(name): def timer(name):
''' Print the elapsed time a context's execution takes to execute ''' ''' Print the elapsed time a context's execution takes to execute '''
@ -120,7 +104,6 @@ def main():
if args.ci_build: if args.ci_build:
logging.basicConfig(datefmt='%H:%M:%S', format='%(asctime)s %(guid)s %(message)s', level=logging.INFO) logging.basicConfig(datefmt='%H:%M:%S', format='%(asctime)s %(guid)s %(message)s', level=logging.INFO)
logger.info('sha=%s' % headSha())
logger.info('start') logger.info('start')
# OS dependent information # OS dependent information

View file

@ -71,9 +71,9 @@
} }
}, },
"@types/node": { "@types/node": {
"version": "12.19.15", "version": "12.20.29",
"resolved": "https://registry.npmjs.org/@types/node/-/node-12.19.15.tgz", "resolved": "https://registry.npmjs.org/@types/node/-/node-12.20.29.tgz",
"integrity": "sha512-lowukE3GUI+VSYSu6VcBXl14d61Rp5hA1D+61r16qnwC0lYNSqdxcvRh0pswejorHfS+HgwBasM8jLXz0/aOsw==", "integrity": "sha512-dU2ypz+gO5va1OBvs0iT3BNHG5SgTqRvq8r+kU3e/LAseKapUJ8zTUE9Ve9fTpi27tN/7ahOAhCJwQWsffvsyw==",
"dev": true "dev": true
}, },
"ansi-styles": { "ansi-styles": {
@ -162,9 +162,9 @@
"dev": true "dev": true
}, },
"buffer-from": { "buffer-from": {
"version": "1.1.1", "version": "1.1.2",
"resolved": "https://registry.npmjs.org/buffer-from/-/buffer-from-1.1.1.tgz", "resolved": "https://registry.npmjs.org/buffer-from/-/buffer-from-1.1.2.tgz",
"integrity": "sha512-MQcXEUbCKtEo7bhqEs6560Hyd4XaovZlO/k9V3hjVUF/zwW7KBVdSK4gIt/bzwS9MbR5qob+F5jusZsb0YQK2A==", "integrity": "sha512-E+XQCRwSbaaiChtv6k6Dwgc+bx+Bs6vuKJHHl5kox/BaKbhiXzqQOwK4cO22yElGp2OCmjwVhT3HmxgyPGnJfQ==",
"dev": true "dev": true
}, },
"cacheable-request": { "cacheable-request": {
@ -298,9 +298,9 @@
} }
}, },
"core-util-is": { "core-util-is": {
"version": "1.0.2", "version": "1.0.3",
"resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.2.tgz", "resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.3.tgz",
"integrity": "sha1-tf1UIgqivFq1eqtxQMlAdUUDwac=", "integrity": "sha512-ZQBvi1DcpJ4GDqanjucZ2Hj3wEO5pZDS89BWbkcrvdxksJorwUDDZamX9ldFkp9aw2lmBDLgkObEA4DWNJ9FYQ==",
"dev": true "dev": true
}, },
"cross-zip": { "cross-zip": {
@ -365,9 +365,9 @@
"dev": true "dev": true
}, },
"electron": { "electron": {
"version": "9.4.0", "version": "11.5.0",
"resolved": "https://registry.npmjs.org/electron/-/electron-9.4.0.tgz", "resolved": "https://registry.npmjs.org/electron/-/electron-11.5.0.tgz",
"integrity": "sha512-hOC4q0jkb+UDYZRy8vrZ1IANnq+jznZnbkD62OEo06nU+hIbp2IrwDRBNuSLmQ3cwZMVir0WSIA1qEVK0PkzGA==", "integrity": "sha512-WjNDd6lGpxyiNjE3LhnFCAk/D9GIj1rU3GSDealVShhkkkPR3Vh4q8ErXGDl1OAO/faomVa10KoFPUN/pLbNxg==",
"dev": true, "dev": true,
"requires": { "requires": {
"@electron/get": "^1.0.1", "@electron/get": "^1.0.1",

View file

@ -18,7 +18,7 @@
}, },
"homepage": "https://github.com/highfidelity/hifi#readme", "homepage": "https://github.com/highfidelity/hifi#readme",
"devDependencies": { "devDependencies": {
"electron": "^9.4.0", "electron": "^11.5.0",
"electron-packager": "^14.0.6" "electron-packager": "^14.0.6"
}, },
"dependencies": { "dependencies": {

View file

@ -203,8 +203,8 @@ EntityListTool = function(shouldUseEditTabletApp) {
var cameraPosition = Camera.position; var cameraPosition = Camera.position;
PROFILE("getMultipleProperties", function () { PROFILE("getMultipleProperties", function () {
var multipleProperties = Entities.getMultipleEntityProperties(ids, ['position', 'name', 'type', 'locked', var multipleProperties = Entities.getMultipleEntityProperties(ids, ['position', 'name', 'type', 'locked',
'visible', 'renderInfo', 'modelURL', 'materialURL', 'imageURL', 'script', 'certificateID', 'visible', 'renderInfo', 'modelURL', 'materialURL', 'imageURL', 'script', 'serverScripts',
'skybox.url', 'ambientLight.url', 'created', 'lastEdited']); 'certificateID', 'skybox.url', 'ambientLight.url', 'created', 'lastEdited']);
for (var i = 0; i < multipleProperties.length; i++) { for (var i = 0; i < multipleProperties.length; i++) {
var properties = multipleProperties[i]; var properties = multipleProperties[i];
@ -247,7 +247,7 @@ EntityListTool = function(shouldUseEditTabletApp) {
isBaked: entityIsBaked(properties), isBaked: entityIsBaked(properties),
drawCalls: (properties.renderInfo !== undefined ? drawCalls: (properties.renderInfo !== undefined ?
valueIfDefined(properties.renderInfo.drawCalls) : ""), valueIfDefined(properties.renderInfo.drawCalls) : ""),
hasScript: properties.script !== "", hasScript: (properties.script !== "" || properties.serverScripts !== ""),
parentState: parentState, parentState: parentState,
created: formatToStringDateTime(properties.created), created: formatToStringDateTime(properties.created),
lastEdited: formatToStringDateTime(properties.lastEdited) lastEdited: formatToStringDateTime(properties.lastEdited)

View file

@ -9228,6 +9228,12 @@
"integrity": "sha1-Ywn04OX6kT7BxpMHrjZLSzd8nns=", "integrity": "sha1-Ywn04OX6kT7BxpMHrjZLSzd8nns=",
"dev": true "dev": true
}, },
"picocolors": {
"version": "0.2.1",
"resolved": "https://registry.npmjs.org/picocolors/-/picocolors-0.2.1.tgz",
"integrity": "sha512-cMlDqaLEqfSaW8Z7N5Jw+lyIW869EzT73/F5lhtY9cLGoVxSXznfgfXMO0Z5K0o0Q2TkTXq+0KFsdnSe3jDViA==",
"dev": true
},
"picomatch": { "picomatch": {
"version": "2.2.2", "version": "2.2.2",
"resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.2.2.tgz", "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.2.2.tgz",
@ -9302,14 +9308,13 @@
"dev": true "dev": true
}, },
"postcss": { "postcss": {
"version": "7.0.32", "version": "7.0.39",
"resolved": "https://registry.npmjs.org/postcss/-/postcss-7.0.32.tgz", "resolved": "https://registry.npmjs.org/postcss/-/postcss-7.0.39.tgz",
"integrity": "sha512-03eXong5NLnNCD05xscnGKGDZ98CyzoqPSMjOe6SuoQY7Z2hIj0Ld1g/O/UQRuOle2aRtiIRDg9tDcTGAkLfKw==", "integrity": "sha512-yioayjNbHn6z1/Bywyb2Y4s3yvDAeXGOyxqD+LnVOinq6Mdmd++SW2wUNVzavyyHxd6+DxzWGIuosg6P1Rj8uA==",
"dev": true, "dev": true,
"requires": { "requires": {
"chalk": "^2.4.2", "picocolors": "^0.2.1",
"source-map": "^0.6.1", "source-map": "^0.6.1"
"supports-color": "^6.1.0"
}, },
"dependencies": { "dependencies": {
"source-map": { "source-map": {
@ -9317,15 +9322,6 @@
"resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz",
"integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==",
"dev": true "dev": true
},
"supports-color": {
"version": "6.1.0",
"resolved": "https://registry.npmjs.org/supports-color/-/supports-color-6.1.0.tgz",
"integrity": "sha512-qe1jfm1Mg7Nq/NSh6XE24gPXROEVsWHxC1LIx//XNlD9iw7YZQGjZNjYN7xGaEG6iKdA8EtNFW6R0gjnVXp+wQ==",
"dev": true,
"requires": {
"has-flag": "^3.0.0"
}
} }
} }
}, },