From a0cf26e5b3b83c4ce273648a37cc0a18c6ff5306 Mon Sep 17 00:00:00 2001 From: Rye Date: Mon, 11 Nov 2024 13:19:51 -0500 Subject: [PATCH 01/23] Fix VLC plugin build on linux Clean up dead autobuild packages dbus_glib fontconfig gstreamer libuuid and related build system portions Fix call to cmake with CMAKE_COMMAND --- .github/workflows/build.yaml | 2 +- autobuild.xml | 118 ------------------ indra/cmake/CMakeLists.txt | 27 +++- indra/cmake/DBusGlib.cmake | 14 --- indra/cmake/FindSCP.cmake | 40 ------ indra/cmake/GStreamer010Plugin.cmake | 12 -- indra/cmake/LibVLCPlugin.cmake | 8 ++ indra/cmake/Prebuilt.cmake | 3 - indra/cmake/PulseAudio.cmake | 4 - indra/llwindow/CMakeLists.txt | 9 -- indra/media_plugins/CMakeLists.txt | 17 +-- .../media_plugins/gstreamer10/CMakeLists.txt | 1 - .../gstreamer10/llmediaimplgstreamer.h | 53 -------- indra/newview/CMakeLists.txt | 6 +- indra/newview/ViewerInstall.cmake | 2 +- indra/newview/llappviewer.cpp | 6 - indra/newview/viewer_manifest.py | 5 +- indra/test/CMakeLists.txt | 14 +-- 18 files changed, 46 insertions(+), 295 deletions(-) delete mode 100644 indra/cmake/DBusGlib.cmake delete mode 100644 indra/cmake/FindSCP.cmake delete mode 100644 indra/cmake/GStreamer010Plugin.cmake delete mode 100644 indra/cmake/PulseAudio.cmake delete mode 100644 indra/media_plugins/gstreamer10/llmediaimplgstreamer.h diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index 6c6aa0e247..b8c2c269c2 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -137,7 +137,7 @@ jobs: libgl1-mesa-dev libglu1-mesa-dev libxinerama-dev \ libxcursor-dev libxfixes-dev libgstreamer1.0-dev \ libgstreamer-plugins-base1.0-dev ninja-build libxft-dev \ - llvm mold libpipewire-0.3-dev libdbus-1-dev + llvm mold libpipewire-0.3-dev libdbus-1-dev libvlc-dev sudo locale-gen en_US.UTF-8 sudo locale-gen en_GB.UTF-8 sudo locale-gen fr_FR.UTF-8 diff --git a/autobuild.xml b/autobuild.xml index 60a2453520..04838268e2 100644 --- a/autobuild.xml +++ b/autobuild.xml @@ -409,36 +409,6 @@ description Library for transferring data specified with URL syntax - dbus_glib - - platforms - - linux64 - - archive - - hash - 7ee7b9aed3c0c8c09e7bf26bba7af8e1 - url - http://automated-builds-secondlife-com.s3.amazonaws.com/hg/repo/p64_3p-dbus-glib/rev/314266/arch/Linux/installer/dbus_glib-0.76-linux64-314266.tar.bz2 - - name - linux64 - - - license - Academic Free License v. 2.1 - license_file - LICENSES/dbus-glib.txt - copyright - Copyright (C) Red Hat Inc. - version - 0.76 - name - dbus_glib - description - D-Bus bindings for glib - dictionaries platforms @@ -625,36 +595,6 @@ description Expat is an XML parser library written in C - fontconfig - - platforms - - linux64 - - archive - - hash - e2419d56960c160670051fbb055fb729 - url - http://automated-builds-secondlife-com.s3.amazonaws.com/hg/repo/p64_3p-fontconfig/rev/314281/arch/Linux/installer/fontconfig-2.11.0-linux64-314281.tar.bz2 - - name - linux64 - - - license - bsd - license_file - LICENSES/fontconfig.txt - copyright - Copyright (C) 2000,2001,2002,2003,2004,2006,2007 Keith Packard, 2005 Patrick Lam, 2009 Roozbeh Pournader, 2008,2009 Red Hat, Inc., 2008 Danilo Ĺ egan, 2012 Google, Inc. - version - 2.11.0 - name - fontconfig - description - Fontconfig is a library for configuring and customizing font access. - freetype copyright @@ -821,34 +761,6 @@ source_type git - gstreamer - - platforms - - linux64 - - archive - - hash - 7c9d7cc88add7831a6afeedc20cad2fe - url - http://automated-builds-secondlife-com.s3.amazonaws.com/hg/repo/p64_3p-gstreamer/rev/314267/arch/Linux/installer/gstreamer-0.10.6.314267-linux64-314267.tar.bz2 - - name - linux64 - - - license - LGPL - license_file - LICENSES/gstreamer.txt - copyright - Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/> - version - 0.10.6.314267 - name - gstreamer - havok-source platforms @@ -1267,36 +1179,6 @@ description PNG Reference library - libuuid - - platforms - - linux64 - - archive - - hash - fb89f1281dd54d8b99b339fc5b712b27 - url - http://automated-builds-secondlife-com.s3.amazonaws.com/hg/repo/p64_3p-libuuid/rev/314269/arch/Linux/installer/libuuid-1.6.2-linux64-314269.tar.bz2 - - name - linux64 - - - license - UUID - license_file - LICENSES/uuid.txt - copyright - Copyright (c) 2004-2008 The OSSP Project <http://www.ossp.org/> - version - 1.6.2 - name - libuuid - description - OSSP uuid is a ISO-C:1999 application programming interface (API) and corresponding command line interface (CLI) for the generation of DCE 1.1, ISO/IEC 11578:1996 and RFC 4122 compliant Universally Unique Identifier (UUID). - libxml2 platforms diff --git a/indra/cmake/CMakeLists.txt b/indra/cmake/CMakeLists.txt index 1083d7f2c4..4447064d90 100644 --- a/indra/cmake/CMakeLists.txt +++ b/indra/cmake/CMakeLists.txt @@ -11,50 +11,64 @@ set(cmake_SOURCE_FILES Audio.cmake Boost.cmake bugsplat.cmake + BuildPackagesInfo.cmake BuildVersion.cmake CEFPlugin.cmake - CEFPlugin.cmake CMakeCopyIfDifferent.cmake - CURL.cmake Copy3rdPartyLibs.cmake - DBusGlib.cmake + CubemapToEquirectangularJS.cmake + CURL.cmake DeploySharedLibs.cmake DragDrop.cmake EXPAT.cmake FindAutobuild.cmake + FindPipeWire.cmake FreeType.cmake GLEXT.cmake GLH.cmake + GLIB.cmake GLM.cmake + GStreamer10Plugin.cmake Havok.cmake Hunspell.cmake + JPEG.cmake + JPEGEncoderBasic.cmake + LibVLCPlugin.cmake + Linker.cmake + Linking.cmake LLAddBuildTest.cmake LLAppearance.cmake + LLAppearanceUtility.cmake LLAudio.cmake LLCommon.cmake + LLCoreHttp.cmake LLImage.cmake LLKDU.cmake + LLMath.cmake LLPhysicsExtensions.cmake LLPrimitive.cmake LLSharedLibs.cmake LLTestCommand.cmake LLWindow.cmake - Linking.cmake Lualibs.cmake Meshoptimizer.cmake + Mikktspace.cmake NDOF.cmake NFDE.cmake + NGHTTP2.cmake + NVAPI.cmake OPENAL.cmake OpenGL.cmake OpenJPEG.cmake OpenSSL.cmake + OpenXR.cmake PNG.cmake PluginAPI.cmake Prebuilt.cmake - PulseAudio.cmake Python.cmake SDL2.cmake TemplateCheck.cmake + ThreeJS.cmake TinyEXR.cmake TinyGLTF.cmake Tracy.cmake @@ -62,9 +76,10 @@ set(cmake_SOURCE_FILES UI.cmake UnixInstall.cmake Variables.cmake + ViewerManager.cmake ViewerMiscLibs.cmake VisualLeakDetector.cmake - LibVLCPlugin.cmake + VulkanGltf.cmake WebRTC.cmake xxHash.cmake ZLIBNG.cmake diff --git a/indra/cmake/DBusGlib.cmake b/indra/cmake/DBusGlib.cmake deleted file mode 100644 index c9b727ca9d..0000000000 --- a/indra/cmake/DBusGlib.cmake +++ /dev/null @@ -1,14 +0,0 @@ -# -*- cmake -*- -include(Prebuilt) - -add_library( ll::dbus INTERFACE IMPORTED) - -if( LINUX ) - # Only define this when not using the prebuild 3ps, lls prebuild is broken - if( NOT USE_AUTOBUILD_3P ) - target_compile_definitions( ll::dbus INTERFACE LL_DBUS_ENABLED ) - endif() - use_system_binary(dbus) - - use_prebuilt_binary(dbus_glib) -endif() diff --git a/indra/cmake/FindSCP.cmake b/indra/cmake/FindSCP.cmake deleted file mode 100644 index ea02102908..0000000000 --- a/indra/cmake/FindSCP.cmake +++ /dev/null @@ -1,40 +0,0 @@ -# -*- cmake -*- -# -# Find the OpenSSH scp ("secure copy") or Putty pscp command. -# -# Input variables: -# SCP_FIND_REQUIRED - set this if configuration should fail without scp -# -# Output variables: -# -# SCP_FOUND - set if scp was found -# SCP_EXECUTABLE - path to scp or pscp executable -# SCP_BATCH_FLAG - how to put scp/pscp into batch mode - -SET(SCP_EXECUTABLE) -IF (WINDOWS) - FIND_PROGRAM(SCP_EXECUTABLE NAMES pscp pscp.exe) -ELSE (WINDOWS) - FIND_PROGRAM(SCP_EXECUTABLE NAMES scp scp.exe) -ENDIF (WINDOWS) - -IF (SCP_EXECUTABLE) - SET(SCP_FOUND ON) -ELSE (SCP_EXECUTABLE) - SET(SCP_FOUND OFF) -ENDIF (SCP_EXECUTABLE) - -IF (SCP_FOUND) - GET_FILENAME_COMPONENT(_scp_name ${SCP_EXECUTABLE} NAME_WE) - IF (_scp_name STREQUAL scp) - SET(SCP_BATCH_FLAG -B) - ELSE (_scp_name STREQUAL scp) - SET(SCP_BATCH_FLAG -batch) - ENDIF (_scp_name STREQUAL scp) -ELSE (SCP_FOUND) - IF (SCP_FIND_REQUIRED) - MESSAGE(FATAL_ERROR "Could not find scp or pscp executable") - ENDIF (SCP_FIND_REQUIRED) -ENDIF (SCP_FOUND) - -MARK_AS_ADVANCED(SCP_EXECUTABLE SCP_FOUND SCP_BATCH_FLAG) diff --git a/indra/cmake/GStreamer010Plugin.cmake b/indra/cmake/GStreamer010Plugin.cmake deleted file mode 100644 index 61f6f74033..0000000000 --- a/indra/cmake/GStreamer010Plugin.cmake +++ /dev/null @@ -1,12 +0,0 @@ -# -*- cmake -*- -include(Prebuilt) -if (NOT LINUX) - return() -endif() - -add_library( ll::gstreamer INTERFACE IMPORTED ) -target_compile_definitions( ll::gstreamer INTERFACE LL_GSTREAMER010_ENABLED=1) -use_system_binary(gstreamer) - -use_prebuilt_binary(gstreamer) - diff --git a/indra/cmake/LibVLCPlugin.cmake b/indra/cmake/LibVLCPlugin.cmake index 599ce02844..312fb81a73 100644 --- a/indra/cmake/LibVLCPlugin.cmake +++ b/indra/cmake/LibVLCPlugin.cmake @@ -5,6 +5,14 @@ include(Prebuilt) include_guard() add_library( ll::libvlc INTERFACE IMPORTED ) +if(LINUX) + find_package(PkgConfig REQUIRED) + + pkg_check_modules(libvlc REQUIRED IMPORTED_TARGET libvlc) + target_link_libraries( ll::libvlc INTERFACE PkgConfig::libvlc) + return() +endif() + use_prebuilt_binary(vlc-bin) set(LIBVLCPLUGIN ON CACHE BOOL "LIBVLCPLUGIN support for the llplugin/llmedia test apps.") diff --git a/indra/cmake/Prebuilt.cmake b/indra/cmake/Prebuilt.cmake index c040090ea3..4a003f6140 100644 --- a/indra/cmake/Prebuilt.cmake +++ b/indra/cmake/Prebuilt.cmake @@ -2,9 +2,6 @@ include_guard() include(FindAutobuild) -if(INSTALL_PROPRIETARY) - include(FindSCP) -endif(INSTALL_PROPRIETARY) set(PREBUILD_TRACKING_DIR ${AUTOBUILD_INSTALL_DIR}/cmake_tracking) # For the library installation process; diff --git a/indra/cmake/PulseAudio.cmake b/indra/cmake/PulseAudio.cmake deleted file mode 100644 index 303db97db6..0000000000 --- a/indra/cmake/PulseAudio.cmake +++ /dev/null @@ -1,4 +0,0 @@ -# -*- cmake -*- -include(Prebuilt) - -message( FATAL_ERROR "Pulseaudio cmake file is broken" ) diff --git a/indra/llwindow/CMakeLists.txt b/indra/llwindow/CMakeLists.txt index e86ef2d578..606d71a316 100644 --- a/indra/llwindow/CMakeLists.txt +++ b/indra/llwindow/CMakeLists.txt @@ -141,15 +141,6 @@ if (WINDOWS) ) endif (WINDOWS) -if (SOLARIS) - list(APPEND llwindow_SOURCE_FILES - llwindowsolaris.cpp - ) - list(APPEND llwindow_HEADER_FILES - llwindowsolaris.h - ) -endif (SOLARIS) - if (BUILD_HEADLESS) set(llwindowheadless_SOURCE_FILES llwindowmesaheadless.cpp diff --git a/indra/media_plugins/CMakeLists.txt b/indra/media_plugins/CMakeLists.txt index 86c46cb476..600db532d2 100644 --- a/indra/media_plugins/CMakeLists.txt +++ b/indra/media_plugins/CMakeLists.txt @@ -1,21 +1,10 @@ # -*- cmake -*- add_subdirectory(base) +add_subdirectory(cef) +add_subdirectory(libvlc) +add_subdirectory(example) if (LINUX) - add_subdirectory(cef) - add_subdirectory(example) add_subdirectory(gstreamer10) endif (LINUX) - -if (DARWIN) - add_subdirectory(cef) - add_subdirectory(libvlc) - add_subdirectory(example) -endif (DARWIN) - -if (WINDOWS) - add_subdirectory(cef) - add_subdirectory(libvlc) - add_subdirectory(example) -endif (WINDOWS) diff --git a/indra/media_plugins/gstreamer10/CMakeLists.txt b/indra/media_plugins/gstreamer10/CMakeLists.txt index 14ce5bfaa1..279e07b226 100644 --- a/indra/media_plugins/gstreamer10/CMakeLists.txt +++ b/indra/media_plugins/gstreamer10/CMakeLists.txt @@ -22,7 +22,6 @@ set(media_plugin_gstreamer10_SOURCE_FILES set(media_plugin_gstreamer10_HEADER_FILES llmediaimplgstreamer_syms.h - llmediaimplgstreamertriviallogging.h ) add_library(media_plugin_gstreamer10 diff --git a/indra/media_plugins/gstreamer10/llmediaimplgstreamer.h b/indra/media_plugins/gstreamer10/llmediaimplgstreamer.h deleted file mode 100644 index cae11a5cb3..0000000000 --- a/indra/media_plugins/gstreamer10/llmediaimplgstreamer.h +++ /dev/null @@ -1,53 +0,0 @@ -/** - * @file llmediaimplgstreamer.h - * @author Tofu Linden - * @brief implementation that supports media playback via GStreamer. - * - * @cond - * $LicenseInfo:firstyear=2007&license=viewerlgpl$ - * Second Life Viewer Source Code - * Copyright (C) 2010, Linden Research, Inc. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; - * version 2.1 of the License only. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA - * $/LicenseInfo$ - * @endcond - */ - -// header guard -#ifndef llmediaimplgstreamer_h -#define llmediaimplgstreamer_h - -#if LL_GSTREAMER010_ENABLED - -extern "C" { -#include -#include - -#include "apr_pools.h" -#include "apr_dso.h" -} - - -extern "C" { -gboolean llmediaimplgstreamer_bus_callback (GstBus *bus, - GstMessage *message, - gpointer data); -} - -#endif // LL_GSTREAMER010_ENABLED - -#endif // llmediaimplgstreamer_h diff --git a/indra/newview/CMakeLists.txt b/indra/newview/CMakeLists.txt index d5b864ca88..4286d57f71 100644 --- a/indra/newview/CMakeLists.txt +++ b/indra/newview/CMakeLists.txt @@ -13,7 +13,6 @@ include(BuildPackagesInfo) include(BuildVersion) include(CMakeCopyIfDifferent) include(CubemapToEquirectangularJS) -include(DBusGlib) include(DragDrop) include(EXPAT) include(Hunspell) @@ -2043,8 +2042,9 @@ if (LINUX) set(COPY_INPUT_DEPENDENCIES ${VIEWER_BINARY_NAME} SLPlugin - #media_plugin_gstreamer010 - llcommon + media_plugin_gstreamer10 + media_plugin_libvlc + llwebrtc ) #if (NOT USE_BUGSPLAT) diff --git a/indra/newview/ViewerInstall.cmake b/indra/newview/ViewerInstall.cmake index ac2247c815..7fd146bbc8 100644 --- a/indra/newview/ViewerInstall.cmake +++ b/indra/newview/ViewerInstall.cmake @@ -19,7 +19,7 @@ else (IS_ARTWORK_PRESENT) message(STATUS "WARNING: Artwork is not present, and will not be installed") endif (IS_ARTWORK_PRESENT) -install(FILES featuretable_linux.txt featuretable_solaris.txt +install(FILES featuretable_linux.txt DESTINATION ${APP_SHARE_DIR} ) diff --git a/indra/newview/llappviewer.cpp b/indra/newview/llappviewer.cpp index 586196fb25..ff2500d24f 100644 --- a/indra/newview/llappviewer.cpp +++ b/indra/newview/llappviewer.cpp @@ -139,9 +139,7 @@ #include "llcoros.h" #include "llexception.h" #include "cef/dullahan_version.h" -#if !LL_LINUX #include "vlc/libvlc_version.h" -#endif // LL_LINUX #if LL_DARWIN #include "llwindowmacosx.h" @@ -3537,7 +3535,6 @@ LLSD LLAppViewer::getViewerInfo() const info["LIBCEF_VERSION"] = cef_ver_codec.str(); -#if !LL_LINUX std::ostringstream vlc_ver_codec; vlc_ver_codec << LIBVLC_VERSION_MAJOR; vlc_ver_codec << "."; @@ -3545,9 +3542,6 @@ LLSD LLAppViewer::getViewerInfo() const vlc_ver_codec << "."; vlc_ver_codec << LIBVLC_VERSION_REVISION; info["LIBVLC_VERSION"] = vlc_ver_codec.str(); -#else - info["LIBVLC_VERSION"] = "Undefined"; -#endif S32 packets_in = (S32)LLViewerStats::instance().getRecording().getSum(LLStatViewer::PACKETS_IN); if (packets_in > 0) diff --git a/indra/newview/viewer_manifest.py b/indra/newview/viewer_manifest.py index 6acd0ae3e1..5fc1f70ef9 100755 --- a/indra/newview/viewer_manifest.py +++ b/indra/newview/viewer_manifest.py @@ -1254,12 +1254,11 @@ def construct(self): # plugins with self.prefix(src=os.path.join(self.args['build'], os.pardir, 'media_plugins'), dst="bin/llplugin"): self.path("gstreamer10/libmedia_plugin_gstreamer10.so", "libmedia_plugin_gstreamer.so") - - with self.prefix(src=os.path.join(self.args['build'], os.pardir, 'media_plugins'), dst="bin/llplugin"): + self.path("libvlc/libmedia_plugin_libvlc.so", "libmedia_plugin_libvlc.so") self.path("cef/libmedia_plugin_cef.so", "libmedia_plugin_cef.so" ) + with self.prefix(src=os.path.join(pkgdir, 'lib', 'release'), dst="lib"): self.path( "libcef.so" ) - self.path( "libEGL*" ) self.path( "libvulkan*" ) self.path( "libvk_swiftshader*" ) diff --git a/indra/test/CMakeLists.txt b/indra/test/CMakeLists.txt index 745c0eedf8..a0aceda990 100644 --- a/indra/test/CMakeLists.txt +++ b/indra/test/CMakeLists.txt @@ -68,7 +68,7 @@ target_link_libraries(lltest if (WINDOWS) set_target_properties(lltest - PROPERTIES + PROPERTIES LINK_FLAGS "/NODEFAULTLIB:LIBCMT" LINK_FLAGS_DEBUG "/NODEFAULTLIB:\"LIBCMT;LIBCMTD;MSVCRT\"" RUNTIME_OUTPUT_DIRECTORY "${EXE_STAGING_DIR}" @@ -86,10 +86,10 @@ set(TEST_EXE $) SET_TEST_PATH(LD_LIBRARY_PATH) -LL_TEST_COMMAND(command +LL_TEST_COMMAND(command "${LD_LIBRARY_PATH}" "${TEST_EXE}" - "--output=${CMAKE_CURRENT_BINARY_DIR}/cpp_test_results.txt" + "--output=${CMAKE_CURRENT_BINARY_DIR}/cpp_test_results.txt" "--touch=${CMAKE_CURRENT_BINARY_DIR}/cpp_tests_ok.txt") ADD_CUSTOM_COMMAND( @@ -102,11 +102,11 @@ ADD_CUSTOM_COMMAND( set(test_results ${CMAKE_CURRENT_BINARY_DIR}/cpp_tests_ok.txt) -# This should cause the test executable to be built, but not +# This should cause the test executable to be built, but not # run if LL_TESTS is disabled. This will hopefully keep the -# tests up to date with any code changes changes even if +# tests up to date with any code changes changes even if # developers choose to disable LL_TESTS. -if (LL_TESTS) +if (LL_TESTS) add_custom_target(tests_ok ALL DEPENDS ${test_results}) if(DARWIN) # Support our "@executable_path/../Resources" load path for our test @@ -114,7 +114,7 @@ if (LL_TESTS) # but the CMake $ generator expression isn't evaluated by # CREATE_LINK, so fudge it. add_custom_command( TARGET lltest POST_BUILD - COMMAND cmake -E create_symlink ${SHARED_LIB_STAGING_DIR} ${CMAKE_BINARY_DIR}/test/Resources + COMMAND ${CMAKE_COMMAND} -E create_symlink ${SHARED_LIB_STAGING_DIR} ${CMAKE_BINARY_DIR}/test/Resources ) endif() endif (LL_TESTS) From 8b7245c608efc046f9126f799863e1bf3c3a5ecc Mon Sep 17 00:00:00 2001 From: Rye Date: Mon, 11 Nov 2024 13:19:24 -0500 Subject: [PATCH 02/23] Further cleanup of SDL windowing backend and isolation of Wayland and X specific code in #if --- indra/cmake/UI.cmake | 12 +-- indra/llwindow/llwindowsdl.cpp | 139 ++++++++++----------------------- indra/llwindow/llwindowsdl.h | 33 +------- 3 files changed, 47 insertions(+), 137 deletions(-) diff --git a/indra/cmake/UI.cmake b/indra/cmake/UI.cmake index 595f394af4..0f76a728aa 100644 --- a/indra/cmake/UI.cmake +++ b/indra/cmake/UI.cmake @@ -3,16 +3,15 @@ include(Prebuilt) include(FreeType) include(GLIB) +include_guard() add_library( ll::uilibraries INTERFACE IMPORTED ) if (LINUX) - target_compile_definitions(ll::uilibraries INTERFACE LL_X11=1 ) - if( USE_CONAN ) return() endif() - include(FindPkgConfig) + find_package(PkgConfig REQUIRED) pkg_check_modules(WAYLAND_CLIENT wayland-client) if( WAYLAND_CLIENT_FOUND ) @@ -22,13 +21,6 @@ if (LINUX) endif() target_link_libraries( ll::uilibraries INTERFACE - Xrender - Xcursor - Xfixes - Xext - Xft - Xinerama - X11 ll::fontconfig ll::freetype ll::SDL2 diff --git a/indra/llwindow/llwindowsdl.cpp b/indra/llwindow/llwindowsdl.cpp index 68704e65bb..b9ea7a16f6 100644 --- a/indra/llwindow/llwindowsdl.cpp +++ b/indra/llwindow/llwindowsdl.cpp @@ -64,41 +64,12 @@ const S32 MAX_NUM_RESOLUTIONS = 200; // LLWindowSDL // -#include - // TOFU HACK -- (*exactly* the same hack as LLWindowMacOSX for a similar // set of reasons): Stash a pointer to the LLWindowSDL object here and // maintain in the constructor and destructor. This assumes that there will // be only one object of this class at any time. Currently this is true. static LLWindowSDL *gWindowImplementation = nullptr; -void maybe_lock_display(void) -{ - if (gWindowImplementation && gWindowImplementation->Lock_Display) - gWindowImplementation->Lock_Display(); -} - -void maybe_unlock_display(void) -{ - if (gWindowImplementation && gWindowImplementation->Unlock_Display) - gWindowImplementation->Unlock_Display(); -} - - -Window LLWindowSDL::get_SDL_XWindowID(void) -{ - if (gWindowImplementation) - return gWindowImplementation->mX11Data.mXWindowID; - return None; -} - -Display* LLWindowSDL::get_SDL_Display(void) -{ - if (gWindowImplementation) - return gWindowImplementation->mX11Data.mDisplay; - return nullptr; -} - /* * In wayland a window does not have a state of "minimized" or gets messages that it got minimized [1] * There's two ways to approach this challenge: @@ -238,8 +209,7 @@ LLWindowSDL::LLWindowSDL(LLWindowCallbacks* callbacks, bool enable_vsync, bool use_gl, bool ignore_pixel_depth, U32 fsaa_samples) : LLWindow(callbacks, fullscreen, flags), - Lock_Display(nullptr), - Unlock_Display(nullptr), mGamma(1.0f) + mGamma(1.0f) { // Initialize the keyboard gKeyboard = new LLKeyboardSDL(); @@ -377,6 +347,14 @@ bool LLWindowSDL::createContext(int x, int y, int width, int height, int bits, b SDL_GL_SetAttribute(SDL_GL_DOUBLEBUFFER, 1); + if(LLRender::sGLCoreProfile) + { + SDL_GL_SetAttribute(SDL_GL_CONTEXT_MAJOR_VERSION, 3); + SDL_GL_SetAttribute(SDL_GL_CONTEXT_MINOR_VERSION, 2); + + SDL_GL_SetAttribute(SDL_GL_CONTEXT_PROFILE_MASK, SDL_GL_CONTEXT_PROFILE_CORE); + } + U32 context_flags = 0; if (gDebugGL) { @@ -416,36 +394,18 @@ bool LLWindowSDL::createContext(int x, int y, int width, int height, int bits, b setupFailure("GL Context failed to set current failure", "Error", OSMB_OK); } - mSurface = SDL_GetWindowSurface(mWindow); if(mFullscreen) { - if (mSurface) - { - mFullscreen = true; - mFullscreenWidth = mSurface->w; - mFullscreenHeight = mSurface->h; - mFullscreenBits = mSurface->format->BitsPerPixel; - mFullscreenRefresh = -1; - - LL_INFOS() << "Running at " << mFullscreenWidth - << "x" << mFullscreenHeight - << "x" << mFullscreenBits - << " @ " << mFullscreenRefresh - << LL_ENDL; - } - else - { - LL_WARNS() << "createContext: fullscreen creation failure. SDL: " << SDL_GetError() << LL_ENDL; - - mFullscreen = false; - mFullscreenWidth = -1; - mFullscreenHeight = -1; - mFullscreenBits = -1; - mFullscreenRefresh = -1; + mFullscreen = true; + SDL_GetWindowSize(mWindow, &mFullscreenWidth, &mFullscreenHeight); + mFullscreenBits = 32; + mFullscreenRefresh = -1; - std::string error = llformat("Unable to run fullscreen at %d x %d.\nRunning in window.", width, height); - setupFailure( error, "Error", OSMB_OK ); - } + LL_INFOS() << "Running at " << mFullscreenWidth + << "x" << mFullscreenHeight + << "x" << mFullscreenBits + << " @ " << mFullscreenRefresh + << LL_ENDL; } SDL_GL_GetAttribute(SDL_GL_RED_SIZE, &redBits); @@ -499,25 +459,23 @@ bool LLWindowSDL::createContext(int x, int y, int width, int height, int bits, b /* Save the information for later use */ if (info.subsystem == SDL_SYSWM_X11) { - mX11Data.mDisplay = info.info.x11.display; - mX11Data.mXWindowID = info.info.x11.window; mServerProtocol = X11; LL_INFOS() << "Running under X11" << LL_ENDL; } else if (info.subsystem == SDL_SYSWM_WAYLAND) { + mServerProtocol = Wayland; + #ifdef LL_WAYLAND + mWaylandData.mSurface = info.info.wl.surface; mWaylandLoaded = loadWaylandClient(); if(!mWaylandLoaded) { LL_WARNS() << "Failed to load wayland-client.so or grab required functions" << LL_ENDL; } -#endif - - mWaylandData.mSurface = info.info.wl.surface; - mServerProtocol = Wayland; setupWaylandFrameCallback(); +#endif // If set (XWayland) remove DISPLAY, this will prompt dullahan to also use Wayland if( getenv("DISPLAY") ) @@ -537,8 +495,6 @@ bool LLWindowSDL::createContext(int x, int y, int width, int height, int bits, b } SDL_StartTextInput(); - //make sure multisampling is disabled by default - glDisable(GL_MULTISAMPLE_ARB); // Don't need to get the current gamma, since there's a call that restores it to the system defaults. return true; @@ -620,10 +576,9 @@ void LLWindowSDL::destroyContext() LL_INFOS() << "shutdownGL begins" << LL_ENDL; gGLManager.shutdownGL(); - mX11Data.mDisplay = nullptr; - mX11Data.mXWindowID = None; - Lock_Display = nullptr; - Unlock_Display = nullptr; +#ifdef LL_WAYLAND + mWaylandData.mSurface = nullptr; +#endif mServerProtocol = Unknown; LL_INFOS() << "Destroying SDL cursors" << LL_ENDL; @@ -651,9 +606,6 @@ void LLWindowSDL::destroyContext() LL_INFOS() << "SDL Window already destroyed" << LL_ENDL; } LL_INFOS() << "destroyContext end" << LL_ENDL; - - LL_INFOS() << "SDL_QuitSS/VID begins" << LL_ENDL; - SDL_QuitSubSystem(SDL_INIT_VIDEO); // *FIX: this might be risky... } LLWindowSDL::~LLWindowSDL() @@ -730,8 +682,10 @@ bool LLWindowSDL::getVisible() const bool LLWindowSDL::getMinimized() const { +#if LL_WAYLAND if( isWaylandWindowNotDrawing() ) return true; +#endif bool result = false; if (mWindow) @@ -782,10 +736,9 @@ bool LLWindowSDL::getPosition(LLCoordScreen *position) const bool LLWindowSDL::getSize(LLCoordScreen *size) const { - if (mSurface) + if (mWindow) { - size->mX = mSurface->w; - size->mY = mSurface->h; + SDL_GetWindowSize(mWindow, &size->mX, &size->mY); return true; } @@ -794,10 +747,9 @@ bool LLWindowSDL::getSize(LLCoordScreen *size) const bool LLWindowSDL::getSize(LLCoordWindow *size) const { - if (mSurface) + if (mWindow) { - size->mX = mSurface->w; - size->mY = mSurface->h; + SDL_GetWindowSize(mWindow, &size->mX, &size->mY); return true; } @@ -1001,25 +953,12 @@ void LLWindowSDL::beforeDialog() if (mFullscreen && mWindow ) SDL_SetWindowFullscreen( mWindow, 0 ); } - - if (mServerProtocol == X11 && mX11Data.mDisplay) - { - // Everything that we/SDL asked for should happen before we - // potentially hand control over to GTK. - maybe_lock_display(); - XSync(mX11Data.mDisplay, False); - maybe_unlock_display(); - } - - maybe_lock_display(); } void LLWindowSDL::afterDialog() { LL_INFOS() << "LLWindowSDL::afterDialog()" << LL_ENDL; - maybe_unlock_display(); - if (mFullscreen && mWindow ) SDL_SetWindowFullscreen( mWindow, 0 ); } @@ -1106,7 +1045,6 @@ LLWindow::LLWindowResolution* LLWindowSDL::getSupportedResolutions(S32 &num_reso mSupportedResolutions = new LLWindowResolution[MAX_NUM_RESOLUTIONS]; mNumSupportedResolutions = 0; - // Use display no from mWindow/mSurface here? int max = SDL_GetNumDisplayModes(0); max = llclamp( max, 0, MAX_NUM_RESOLUTIONS ); @@ -1142,8 +1080,13 @@ bool LLWindowSDL::convertCoords(LLCoordGL from, LLCoordWindow *to) const if (!to) return false; + if (!mWindow) + return false; + S32 height; + SDL_GetWindowSize(mWindow, nullptr, &height); + to->mX = from.mX; - to->mY = mSurface->h - from.mY - 1; + to->mY = height - from.mY - 1; return true; } @@ -1153,8 +1096,13 @@ bool LLWindowSDL::convertCoords(LLCoordWindow from, LLCoordGL* to) const if (!to) return false; + if (!mWindow) + return false; + S32 height; + SDL_GetWindowSize(mWindow, nullptr, &height); + to->mX = from.mX; - to->mY = mSurface->h - from.mY - 1; + to->mY = height - from.mY - 1; return true; } @@ -1520,7 +1468,6 @@ void LLWindowSDL::gatherInput(bool app_has_focus) S32 width = llmax(event.window.data1, (S32)mMinWindowWidth); S32 height = llmax(event.window.data2, (S32)mMinWindowHeight); - mSurface = SDL_GetWindowSurface(mWindow); mCallbacks->handleResize(this, width, height); break; } diff --git a/indra/llwindow/llwindowsdl.h b/indra/llwindow/llwindowsdl.h index 88e2221f16..f3a5a752a5 100644 --- a/indra/llwindow/llwindowsdl.h +++ b/indra/llwindow/llwindowsdl.h @@ -38,12 +38,6 @@ // get X11-specific headers for use in low-level stuff like copy-and-paste support #include "SDL2/SDL_syswm.h" -// AssertMacros.h does bad things. -#include "fix_macros.h" -#undef verify -#undef require - - class LLWindowSDL : public LLWindow { public: void show() override; @@ -162,12 +156,6 @@ class LLWindowSDL : public LLWindow { static std::vector getDynamicFallbackFontList(); - void (*Lock_Display)(void) = nullptr; - void (*Unlock_Display)(void) = nullptr; - - static Window get_SDL_XWindowID(void); - static Display *get_SDL_Display(void); - void *createSharedContext() override; void makeContextCurrent(void *context) override; void destroySharedContext(void *context) override; @@ -190,14 +178,6 @@ class LLWindowSDL : public LLWindow { void moveWindow(const LLCoordScreen &position, const LLCoordScreen &size); - // Changes display resolution. Returns true if successful - bool setDisplayResolution(S32 width, S32 height, S32 bits, S32 refresh); - - // Go back to last fullscreen display resolution. - bool setFullscreenResolution(); - - bool shouldPostQuit() { return mPostQuit; } - protected: // // Platform specific methods @@ -219,20 +199,15 @@ class LLWindowSDL : public LLWindow { U32 mGrabbyKeyFlags = 0; SDL_Window *mWindow = nullptr; - SDL_Surface *mSurface; SDL_GLContext mContext; SDL_Cursor *mSDLCursors[UI_CURSOR_COUNT]; std::string mWindowTitle; double mOriginalAspectRatio = 1.0f; - bool mNeedsResize = false; // Constructor figured out the window is too big, it needs a resize. - LLCoordScreen mNeedsResizeSize; F32 mOverrideAspectRatio = 0.0f; F32 mGamma = 0.0f; U32 mFSAASamples = 0; - int mHaveInputFocus = -1; /* 0=no, 1=yes, else unknown */ - friend class LLWindowManager; private: @@ -244,11 +219,7 @@ class LLWindowSDL : public LLWindow { enum EServerProtocol{ X11, Wayland, Unknown }; EServerProtocol mServerProtocol = Unknown; - struct { - Window mXWindowID = None; - Display *mDisplay = nullptr; - } mX11Data; - +#if LL_WAYLAND // Wayland struct { wl_surface *mSurface = nullptr; @@ -261,7 +232,7 @@ class LLWindowSDL : public LLWindow { void setupWaylandFrameCallback(); static void waylandFrameDoneCB(void *data, struct wl_callback *cb, uint32_t time); - // +#endif private: void tryFindFullscreenSize(int &aWidth, int &aHeight); From 39c2b060e5e975722bfa32e59c669692a81a11df Mon Sep 17 00:00:00 2001 From: Rye Date: Mon, 11 Nov 2024 13:16:42 -0500 Subject: [PATCH 03/23] Clean up cmake linker flags and introduce support for Sanitizers under linux Fix test failing on clang-19 --- indra/cmake/00-Common.cmake | 87 +++++++++++++--------- indra/cmake/CMakeLists.txt | 1 - indra/cmake/LLAddBuildTest.cmake | 5 +- indra/cmake/Linker.cmake | 11 --- indra/linux_crash_logger/CMakeLists.txt | 2 - indra/llmath/tests/llquaternion_test.cpp | 6 +- indra/llprimitive/CMakeLists.txt | 2 +- indra/media_plugins/cef/CMakeLists.txt | 27 +++---- indra/media_plugins/example/CMakeLists.txt | 8 -- indra/media_plugins/libvlc/CMakeLists.txt | 8 -- indra/newview/CMakeLists.txt | 2 - indra/newview/viewer_manifest.py | 1 + 12 files changed, 68 insertions(+), 92 deletions(-) delete mode 100644 indra/cmake/Linker.cmake diff --git a/indra/cmake/00-Common.cmake b/indra/cmake/00-Common.cmake index 1b138eaeaa..445ac3cef9 100644 --- a/indra/cmake/00-Common.cmake +++ b/indra/cmake/00-Common.cmake @@ -15,7 +15,6 @@ include_guard() include(Variables) -include(Linker) # We go to some trouble to set LL_BUILD to the set of relevant compiler flags. set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} $ENV{LL_BUILD}") @@ -70,9 +69,12 @@ if (WINDOWS) # http://www.cmake.org/pipermail/cmake/2009-September/032143.html string(REPLACE "/Zm1000" " " CMAKE_CXX_FLAGS ${CMAKE_CXX_FLAGS}) - add_link_options(/LARGEADDRESSAWARE - /NODEFAULTLIB:LIBCMT - /IGNORE:4099) + add_link_options( + /LARGEADDRESSAWARE + /NODEFAULTLIB:LIBCMT + /IGNORE:4099 + /MANIFEST:NO + ) add_compile_definitions( WIN32_LEAN_AND_MEAN @@ -120,7 +122,6 @@ endif (WINDOWS) if (LINUX) set( CMAKE_BUILD_WITH_INSTALL_RPATH TRUE ) set( CMAKE_INSTALL_RPATH $ORIGIN $ORIGIN/../lib ) - set(CMAKE_EXE_LINKER_FLAGS "-Wl,--exclude-libs,ALL") find_program(CCACHE_EXE ccache) if(CCACHE_EXE AND NOT DISABLE_CCACHE) @@ -139,43 +140,60 @@ if (LINUX) LL_IGNORE_SIGCHLD ) - if( ENABLE_ASAN ) - add_compile_options(-U_FORTIFY_SOURCE - -fsanitize=address - --param asan-stack=0 - ) - add_link_options(-fsanitize=address) - else() - add_compile_definitions( _FORTIFY_SOURCE=2 ) - endif() + if (USE_ASAN) + add_compile_options(-fsanitize=address -fsanitize-recover=address) + add_link_options(-fsanitize=address -fsanitize-recover=address) + elseif (USE_LEAKSAN) + add_compile_options(-fsanitize=leak) + add_link_options(-fsanitize=leak) + elseif (USE_UBSAN) + add_compile_options(-fsanitize=undefined -fno-sanitize=vptr) + add_link_options(-fsanitize=undefined -fno-sanitize=vptr) + elseif (USE_THREAD_SAN) + add_compile_options(-fsanitize=thread) + add_link_options(-fsanitize=thread) + else () + add_compile_definitions(_FORTIFY_SOURCE=2) + endif () add_compile_options( -fexceptions -fno-math-errno -fno-strict-aliasing + -fno-omit-frame-pointer -fsigned-char -msse2 -mfpmath=sse -pthread -fvisibility=hidden + -fstack-protector ) add_link_options( - -Wl,--no-keep-memory - -Wl,--build-id - -Wl,--no-undefined + "LINKER:--build-id" + "LINKER:--as-needed" + "LINKER:-z,relro" + "LINKER:-z,now" ) - # this stops us requiring a really recent glibc at runtime - add_compile_options(-fno-stack-protector) + if(LINK_WITH_MOLD) + find_program(MOLD_BIN mold) + if(MOLD_BIN) + message(STATUS "Mold linker found: ${MOLD_BIN}. Enabling mold as active linker.") + add_link_options(-fuse-ld=mold) + else() + set(LINK_WITH_MOLD OFF) + message(STATUS "Mold linker not found. Using default linker.") + endif() + endif() - if (CMAKE_CXX_COMPILER_ID STREQUAL "Clang") - # ND: clang is a bit more picky than GCC, the latter seems to auto include -lstdc++ and -lm. The former not so and thus fails to link - add_link_options( - -lstdc++ - -lm - ) + if(NOT LINK_WITH_MOLD) + # Use LLD for proper clang support under Linux + if (CMAKE_CXX_COMPILER_ID STREQUAL "Clang") + add_link_options(-fuse-ld=lld) # Use LLD for proper clang support + endif() endif() + endif (LINUX) if (DARWIN) @@ -183,32 +201,31 @@ if (DARWIN) set(CLANG_DISABLE_FATAL_WARNINGS OFF) set(CMAKE_CXX_LINK_FLAGS "-Wl,-headerpad_max_install_names,-search_paths_first") set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_CXX_LINK_FLAGS}") - set(DARWIN_extra_cstar_flags "-Wno-deprecated-declarations") # Ensure that CMAKE_CXX_FLAGS has the correct -g debug information format -- # see Variables.cmake. string(REPLACE "-gdwarf-2" "-g${CMAKE_XCODE_ATTRIBUTE_DEBUG_INFORMATION_FORMAT}" CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}") - set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${DARWIN_extra_cstar_flags}") - set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${DARWIN_extra_cstar_flags}") # NOTE: it's critical that the optimization flag is put in front. # NOTE: it's critical to have both CXX_FLAGS and C_FLAGS covered. ## Really?? On developer machines too? ##set(ENABLE_SIGNING TRUE) ##set(SIGNING_IDENTITY "Developer ID Application: Linden Research, Inc.") - - # required for clang-15/xcode-15 since our boost package still uses deprecated std::unary_function/binary_function - # see https://developer.apple.com/documentation/xcode-release-notes/xcode-15-release-notes#C++-Standard-Library - add_compile_definitions(_LIBCPP_ENABLE_CXX17_REMOVED_UNARY_BINARY_FUNCTION) endif(DARWIN) if(LINUX OR DARWIN) - add_compile_options(-Wall -Wno-sign-compare -Wno-trigraphs -Wno-reorder -Wno-unused-but-set-variable -Wno-unused-variable -Wno-unused-local-typedef) + add_compile_options(-Wall -Wno-sign-compare -Wno-trigraphs -Wno-reorder -Wno-unused-but-set-variable -Wno-unused-variable) + + if (CMAKE_CXX_COMPILER_ID STREQUAL "Clang" OR CMAKE_CXX_COMPILER_ID STREQUAL "AppleClang") + # libstdc++ headers contain deprecated declarations that fail on clang + # macOS currently has many deprecated calls + add_compile_options(-Wno-unused-local-typedef -Wno-deprecated-declarations) + endif() if (CMAKE_CXX_COMPILER_ID STREQUAL "GNU") - add_compile_options(-Wno-stringop-truncation -Wno-parentheses -Wno-c++20-compat) + add_compile_options(-Wno-stringop-truncation -Wno-parentheses) endif() - if (NOT GCC_DISABLE_FATAL_WARNINGS) + if (NOT GCC_DISABLE_FATAL_WARNINGS AND NOT CLANG_DISABLE_FATAL_WARNINGS) add_compile_options(-Werror) endif () diff --git a/indra/cmake/CMakeLists.txt b/indra/cmake/CMakeLists.txt index 4447064d90..7c688c24be 100644 --- a/indra/cmake/CMakeLists.txt +++ b/indra/cmake/CMakeLists.txt @@ -34,7 +34,6 @@ set(cmake_SOURCE_FILES JPEG.cmake JPEGEncoderBasic.cmake LibVLCPlugin.cmake - Linker.cmake Linking.cmake LLAddBuildTest.cmake LLAppearance.cmake diff --git a/indra/cmake/LLAddBuildTest.cmake b/indra/cmake/LLAddBuildTest.cmake index 5d96a4398f..ee578a5a55 100644 --- a/indra/cmake/LLAddBuildTest.cmake +++ b/indra/cmake/LLAddBuildTest.cmake @@ -222,10 +222,7 @@ FUNCTION(LL_ADD_INTEGRATION_TEST # The following was copied to llcorehttp/CMakeLists.txt's texture_load target. # Any changes made here should be replicated there. if (WINDOWS) - set_target_properties(INTEGRATION_TEST_${testname} - PROPERTIES - LINK_FLAGS "/debug /NODEFAULTLIB:LIBCMT /SUBSYSTEM:CONSOLE" - ) + target_link_options(INTEGRATION_TEST_${testname} PRIVATE /debug /NODEFAULTLIB:LIBCMT /SUBSYSTEM:CONSOLE) endif () if (DARWIN) diff --git a/indra/cmake/Linker.cmake b/indra/cmake/Linker.cmake deleted file mode 100644 index 8016842192..0000000000 --- a/indra/cmake/Linker.cmake +++ /dev/null @@ -1,11 +0,0 @@ -include_guard(GLOBAL) - -if( LINK_WITH_MOLD ) - find_program(MOLD_BIN mold) - if(MOLD_BIN) - message(STATUS "Mold linker found: ${MOLD_BIN}. Enabling mold as active linker.") - add_link_options("-fuse-ld=${MOLD_BIN}") - else() - message(STATUS "Mold linker not found. Using default linker.") - endif() -endif() diff --git a/indra/linux_crash_logger/CMakeLists.txt b/indra/linux_crash_logger/CMakeLists.txt index 1793aa82b9..dbac7e7ddc 100644 --- a/indra/linux_crash_logger/CMakeLists.txt +++ b/indra/linux_crash_logger/CMakeLists.txt @@ -49,8 +49,6 @@ list(APPEND linux_crash_logger_SOURCE_FILES ${linux_crash_logger_HEADER_FILES} ) -set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -Wl,--as-needed") - add_executable(linux-crash-logger ${linux_crash_logger_SOURCE_FILES}) # llcommon uses `clock_gettime' which is provided by librt on linux. diff --git a/indra/llmath/tests/llquaternion_test.cpp b/indra/llmath/tests/llquaternion_test.cpp index aa3c0ad843..ba18d54d55 100644 --- a/indra/llmath/tests/llquaternion_test.cpp +++ b/indra/llmath/tests/llquaternion_test.cpp @@ -349,9 +349,9 @@ namespace tut ensure( "2. LLVector4 operator*(const LLVector4 &a, const LLQuaternion &rot) failed", is_approx_equal(-58153.5390f, result.mV[0]) && - (183787.8125f == result.mV[1]) && - (116864.164063f == result.mV[2]) && - (78.099998f == result.mV[3])); + is_approx_equal(183787.8125f, result.mV[1]) && + is_approx_equal(116864.164063f, result.mV[2]) && + is_approx_equal(78.099998f, result.mV[3])); } //test case for LLVector3 operator*(const LLVector3 &a, const LLQuaternion &rot) fn. diff --git a/indra/llprimitive/CMakeLists.txt b/indra/llprimitive/CMakeLists.txt index 3d8e02cb16..856330c6aa 100644 --- a/indra/llprimitive/CMakeLists.txt +++ b/indra/llprimitive/CMakeLists.txt @@ -81,6 +81,6 @@ if (LL_TESTS) llgltfmaterial.cpp ) - set_property(SOURCE llprimitive.cpp PROPERTY LL_TEST_ADDITIONAL_LIBRARIES llmessage) + set_property(SOURCE llprimitive.cpp PROPERTY LL_TEST_ADDITIONAL_LIBRARIES llmessage llfilesystem) LL_ADD_PROJECT_UNIT_TESTS(llprimitive "${llprimitive_TEST_SOURCE_FILES}") endif (LL_TESTS) diff --git a/indra/media_plugins/cef/CMakeLists.txt b/indra/media_plugins/cef/CMakeLists.txt index 28e5f64132..09b7a80503 100644 --- a/indra/media_plugins/cef/CMakeLists.txt +++ b/indra/media_plugins/cef/CMakeLists.txt @@ -50,16 +50,8 @@ if (LINUX) ) list(APPEND media_plugin_cef_SOURCE_FILES ${LINUX_VOLUME_CATCHER}) - set(CMAKE_SHARED_LINKER_FLAGS "-Wl,--build-id -Wl,-rpath,'$ORIGIN:$ORIGIN/../../lib'") - list(APPEND media_plugin_cef_LINK_LIBRARIES llwindow ) elseif (DARWIN) list(APPEND media_plugin_cef_SOURCE_FILES volume_catcher_null.cpp) - find_library(CORESERVICES_LIBRARY CoreServices) - find_library(AUDIOUNIT_LIBRARY AudioUnit) - set( media_plugin_cef_LINK_LIBRARIES - ${CORESERVICES_LIBRARY} # for Component Manager calls - ${AUDIOUNIT_LIBRARY} # for AudioUnit calls - ) elseif (WINDOWS) list(APPEND media_plugin_cef_SOURCE_FILES windows_volume_catcher.cpp) endif (LINUX) @@ -81,15 +73,15 @@ target_link_libraries(media_plugin_cef ll::glib_headers ) -if (WINDOWS) - set_target_properties( - media_plugin_cef - PROPERTIES - LINK_FLAGS "/MANIFEST:NO /NODEFAULTLIB:LIBCMT /IGNORE:4099" +if (DARWIN) + find_library(CORESERVICES_LIBRARY CoreServices) + find_library(AUDIOUNIT_LIBRARY AudioUnit) + + target_link_libraries(media_plugin_cef + ${CORESERVICES_LIBRARY} # for Component Manager calls + ${AUDIOUNIT_LIBRARY} # for AudioUnit calls ) -endif (WINDOWS) -if (DARWIN) # Don't prepend 'lib' to the executable name, and don't embed a full path in the library's install name set_target_properties( media_plugin_cef @@ -107,5 +99,6 @@ if (DARWIN) VERBATIM COMMENT "Fixing path to CEF Framework" ) - -endif (DARWIN) +elseif (LINUX) + target_link_options(media_plugin_cef PRIVATE "LINKER:--build-id" "LINKER:-rpath,'$ORIGIN:$ORIGIN/../../lib'") +endif () diff --git a/indra/media_plugins/example/CMakeLists.txt b/indra/media_plugins/example/CMakeLists.txt index 71343d5f85..62bc9de028 100644 --- a/indra/media_plugins/example/CMakeLists.txt +++ b/indra/media_plugins/example/CMakeLists.txt @@ -24,14 +24,6 @@ add_library(media_plugin_example target_link_libraries(media_plugin_example media_plugin_base ) -if (WINDOWS) - set_target_properties( - media_plugin_example - PROPERTIES - LINK_FLAGS "/MANIFEST:NO /NODEFAULTLIB:LIBCMT" - ) -endif (WINDOWS) - if (DARWIN) # Don't prepend 'lib' to the executable name, and don't embed a full path in the library's install name set_target_properties( diff --git a/indra/media_plugins/libvlc/CMakeLists.txt b/indra/media_plugins/libvlc/CMakeLists.txt index 863b4617e9..384ebff235 100644 --- a/indra/media_plugins/libvlc/CMakeLists.txt +++ b/indra/media_plugins/libvlc/CMakeLists.txt @@ -28,14 +28,6 @@ target_link_libraries(media_plugin_libvlc ll::libvlc ) -if (WINDOWS) - set_target_properties( - media_plugin_libvlc - PROPERTIES - LINK_FLAGS "/MANIFEST:NO /NODEFAULTLIB:LIBCMT" - ) -endif (WINDOWS) - if (DARWIN) # Don't prepend 'lib' to the executable name, and don't embed a full path in the library's install name set_target_properties( diff --git a/indra/newview/CMakeLists.txt b/indra/newview/CMakeLists.txt index 4286d57f71..234b3c6b5f 100644 --- a/indra/newview/CMakeLists.txt +++ b/indra/newview/CMakeLists.txt @@ -1490,8 +1490,6 @@ if (LINUX) PROPERTIES COMPILE_DEFINITIONS "${VIEWER_CHANNEL_VERSION_DEFINES}" ) - SET(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -Wl,--as-needed") - endif (LINUX) if (WINDOWS) diff --git a/indra/newview/viewer_manifest.py b/indra/newview/viewer_manifest.py index 5fc1f70ef9..3a1b6054e1 100755 --- a/indra/newview/viewer_manifest.py +++ b/indra/newview/viewer_manifest.py @@ -1407,6 +1407,7 @@ def strip_binaries(self): '!', '-name', '*.crt', '!', '-name', '*.dll', '!', '-name', '*.lib', + '!', '-name', '*.json', '!', '-name', 'update_install', '-exec', 'strip', '-S', '{}', ';']) class Linux_x86_64_Manifest(LinuxManifest): From 8ce93b65bb47a32b03c79fe153a51cf657e2980c Mon Sep 17 00:00:00 2001 From: Rye Date: Tue, 5 Nov 2024 23:05:26 -0500 Subject: [PATCH 04/23] Fix SLPlugin bundle needlessly linking in SDL2 --- indra/cmake/PluginAPI.cmake | 2 ++ indra/llplugin/CMakeLists.txt | 2 +- indra/llplugin/llpluginclassmedia.h | 7 +++---- indra/media_plugins/base/CMakeLists.txt | 2 +- indra/newview/viewer_manifest.py | 6 ------ 5 files changed, 7 insertions(+), 12 deletions(-) diff --git a/indra/cmake/PluginAPI.cmake b/indra/cmake/PluginAPI.cmake index 114415e514..522bca37d2 100644 --- a/indra/cmake/PluginAPI.cmake +++ b/indra/cmake/PluginAPI.cmake @@ -13,4 +13,6 @@ if (WINDOWS) ) endif (WINDOWS) +target_include_directories( ll::pluginlibraries INTERFACE ${CMAKE_SOURCE_DIR}/llimage ${CMAKE_SOURCE_DIR}/llrender) + diff --git a/indra/llplugin/CMakeLists.txt b/indra/llplugin/CMakeLists.txt index 005426acde..bdfeca61d8 100644 --- a/indra/llplugin/CMakeLists.txt +++ b/indra/llplugin/CMakeLists.txt @@ -35,6 +35,6 @@ list(APPEND llplugin_SOURCE_FILES ${llplugin_HEADER_FILES}) add_library (llplugin ${llplugin_SOURCE_FILES}) target_include_directories( llplugin INTERFACE ${CMAKE_CURRENT_SOURCE_DIR}) -target_link_libraries( llplugin llcommon llmath llrender llmessage ) +target_link_libraries( llplugin llcommon llmath llmessage llxml) add_subdirectory(slplugin) diff --git a/indra/llplugin/llpluginclassmedia.h b/indra/llplugin/llpluginclassmedia.h index 5d2f3bbb79..0374906405 100644 --- a/indra/llplugin/llpluginclassmedia.h +++ b/indra/llplugin/llpluginclassmedia.h @@ -29,7 +29,6 @@ #ifndef LL_LLPLUGINCLASSMEDIA_H #define LL_LLPLUGINCLASSMEDIA_H -#include "llgltypes.h" #include "llpluginprocessparent.h" #include "llrect.h" #include "llpluginclassmediaowner.h" @@ -355,9 +354,9 @@ class LLPluginClassMedia : public LLPluginProcessParentOwner bool mTextureParamsReceived; // the mRequestedTexture* fields are only valid when this is true S32 mRequestedTextureDepth; - LLGLenum mRequestedTextureInternalFormat; - LLGLenum mRequestedTextureFormat; - LLGLenum mRequestedTextureType; + U32 mRequestedTextureInternalFormat; + U32 mRequestedTextureFormat; + U32 mRequestedTextureType; bool mRequestedTextureSwapBytes; bool mRequestedTextureCoordsOpenGL; diff --git a/indra/media_plugins/base/CMakeLists.txt b/indra/media_plugins/base/CMakeLists.txt index 5e635c6ca3..b6748abd47 100644 --- a/indra/media_plugins/base/CMakeLists.txt +++ b/indra/media_plugins/base/CMakeLists.txt @@ -27,5 +27,5 @@ add_library(media_plugin_base ${media_plugin_base_SOURCE_FILES} ) -target_link_libraries( media_plugin_base llplugin ) +target_link_libraries( media_plugin_base llplugin ll::pluginlibraries) target_include_directories( media_plugin_base INTERFACE ${CMAKE_CURRENT_SOURCE_DIR}) diff --git a/indra/newview/viewer_manifest.py b/indra/newview/viewer_manifest.py index 3a1b6054e1..40fc002ae7 100755 --- a/indra/newview/viewer_manifest.py +++ b/indra/newview/viewer_manifest.py @@ -1036,12 +1036,6 @@ def path_optional(src, dst): ): dylibs += path_optional(os.path.join(relpkgdir, libfile), libfile) - # SDL2 - for libfile in ( - 'libSDL2-2.0.dylib', - ): - dylibs += path_optional(os.path.join(relpkgdir, libfile), libfile) - # our apps executable_path = {} embedded_apps = [ (os.path.join("llplugin", "slplugin"), "SLPlugin.app") ] From 6feed6e0033959356421d9603e5ebbe511926da7 Mon Sep 17 00:00:00 2001 From: Rye Date: Sun, 10 Nov 2024 01:19:33 -0500 Subject: [PATCH 05/23] Fix ASAN complaints about load alignment and leaks as well as dead code --- indra/llrender/llrender.cpp | 59 ++++++---------------- indra/llrender/llrender.h | 14 +++-- indra/newview/llhudrender.cpp | 2 +- indra/newview/llpanelprimmediacontrols.cpp | 2 +- indra/newview/llreflectionmap.cpp | 2 +- indra/newview/llsettingsvo.cpp | 4 +- indra/newview/llviewercamera.cpp | 4 +- indra/newview/llvoavatar.cpp | 4 +- indra/newview/pipeline.cpp | 10 ++-- 9 files changed, 40 insertions(+), 61 deletions(-) diff --git a/indra/llrender/llrender.cpp b/indra/llrender/llrender.cpp index 37791c5c6e..82bf4d2244 100644 --- a/indra/llrender/llrender.cpp +++ b/indra/llrender/llrender.cpp @@ -71,15 +71,6 @@ bool LLRender::sGLCoreProfile = false; bool LLRender::sNsightDebugSupport = false; LLVector2 LLRender::sUIGLScaleFactor = LLVector2(1.f, 1.f); -struct LLVBCache -{ - LLPointer vb; - std::chrono::steady_clock::time_point touched; -}; - -static std::unordered_map sVBCache; -static thread_local std::list *sBufferDataList = nullptr; - static const GLenum sGLTextureType[] = { GL_TEXTURE_2D, @@ -117,7 +108,7 @@ static const GLenum sGLBlendFactor[] = LLTexUnit::LLTexUnit(S32 index) : mCurrTexType(TT_NONE), - mCurrColorScale(1), mCurrAlphaScale(1), mCurrTexture(0), + mCurrTexture(0), mHasMipMaps(false), mIndex(index) { @@ -615,26 +606,6 @@ GLint LLTexUnit::getTextureSourceType(eTextureBlendSrc src, bool isAlpha) } } -void LLTexUnit::setColorScale(S32 scale) -{ - if (mCurrColorScale != scale || gGL.mDirty) - { - mCurrColorScale = scale; - gGL.flush(); - glTexEnvi(GL_TEXTURE_ENV, GL_RGB_SCALE, scale); - } -} - -void LLTexUnit::setAlphaScale(S32 scale) -{ - if (mCurrAlphaScale != scale || gGL.mDirty) - { - mCurrAlphaScale = scale; - gGL.flush(); - glTexEnvi(GL_TEXTURE_ENV, GL_ALPHA_SCALE, scale); - } -} - // Useful for debugging that you've manually assigned a texture operation to the correct // texture unit based on the currently set active texture in opengl. void LLTexUnit::debugTextureUnit(void) @@ -810,7 +781,7 @@ void LLLightState::setSpotDirection(const LLVector3& direction) ++gGL.mLightHash; //transform direction by current modelview matrix - glm::vec3 dir(glm::make_vec3(direction.mV)); + glm::vec3 dir(direction.mV[VX], direction.mV[VY], direction.mV[VZ]); const glm::mat3 mat(gGL.getModelviewMatrix()); dir = mat * dir; @@ -921,7 +892,9 @@ void LLRender::initVertexBuffer() void LLRender::resetVertexBuffer() { - mBuffer = NULL; + mBuffer = nullptr; + mBufferDataList = nullptr; + mVBCache.clear(); } void LLRender::shutdown() @@ -1504,22 +1477,22 @@ void LLRender::clearErrors() void LLRender::beginList(std::list *list) { - if (sBufferDataList) + if (mBufferDataList) { LL_ERRS() << "beginList called while another list is open." << LL_ENDL; } llassert(LLGLSLShader::sCurBoundShaderPtr == &gUIProgram); flush(); - sBufferDataList = list; + mBufferDataList = list; } void LLRender::endList() { - if (sBufferDataList) + if (mBufferDataList) { flush(); - sBufferDataList = nullptr; + mBufferDataList = nullptr; } else { @@ -1606,10 +1579,10 @@ void LLRender::flush() U32 attribute_mask = LLGLSLShader::sCurBoundShaderPtr->mAttributeMask; - if (sBufferDataList) + if (mBufferDataList) { vb = genBuffer(attribute_mask, count); - sBufferDataList->emplace_back( + mBufferDataList->emplace_back( vb, mMode, count, @@ -1669,9 +1642,9 @@ LLVertexBuffer* LLRender::bufferfromCache(U32 attribute_mask, U32 count) // To leverage this, we maintain a running hash of the vertex stream being // built up before a flush, and then check that hash against a VB // cache just before creating a vertex buffer in VRAM - std::unordered_map::iterator cache = sVBCache.find(vhash); + std::unordered_map::iterator cache = mVBCache.find(vhash); - if (cache != sVBCache.end()) + if (cache != mVBCache.end()) { LL_PROFILE_ZONE_NAMED_CATEGORY_VERTEX("vb cache hit"); // cache hit, just use the cached buffer @@ -1683,7 +1656,7 @@ LLVertexBuffer* LLRender::bufferfromCache(U32 attribute_mask, U32 count) LL_PROFILE_ZONE_NAMED_CATEGORY_VERTEX("vb cache miss"); vb = genBuffer(attribute_mask, count); - sVBCache[vhash] = { vb , std::chrono::steady_clock::now() }; + mVBCache[vhash] = { vb , std::chrono::steady_clock::now() }; static U32 miss_count = 0; miss_count++; @@ -1695,11 +1668,11 @@ LLVertexBuffer* LLRender::bufferfromCache(U32 attribute_mask, U32 count) using namespace std::chrono_literals; // every 1024 misses, clean the cache of any VBs that haven't been touched in the last second - for (std::unordered_map::iterator iter = sVBCache.begin(); iter != sVBCache.end(); ) + for (std::unordered_map::iterator iter = mVBCache.begin(); iter != mVBCache.end(); ) { if (now - iter->second.touched > 1s) { - iter = sVBCache.erase(iter); + iter = mVBCache.erase(iter); } else { diff --git a/indra/llrender/llrender.h b/indra/llrender/llrender.h index 8c7126420e..5a77465fdd 100644 --- a/indra/llrender/llrender.h +++ b/indra/llrender/llrender.h @@ -45,6 +45,7 @@ #include "glm/mat4x4.hpp" #include +#include #include #include @@ -228,13 +229,9 @@ class LLTexUnit S32 mIndex; U32 mCurrTexture; eTextureType mCurrTexType; - S32 mCurrColorScale; - S32 mCurrAlphaScale; bool mHasMipMaps; void debugTextureUnit(void); - void setColorScale(S32 scale); - void setAlphaScale(S32 scale); GLint getTextureSource(eTextureBlendSrc src); GLint getTextureSourceType(eTextureBlendSrc src, bool isAlpha = false); }; @@ -535,6 +532,15 @@ class LLRender std::vector mUIOffset; std::vector mUIScale; + + struct LLVBCache + { + LLPointer vb; + std::chrono::steady_clock::time_point touched; + }; + + std::unordered_map mVBCache; + std::list* mBufferDataList = nullptr; }; extern F32 gGLModelView[16]; diff --git a/indra/newview/llhudrender.cpp b/indra/newview/llhudrender.cpp index 2255eb236f..760d2f3bda 100644 --- a/indra/newview/llhudrender.cpp +++ b/indra/newview/llhudrender.cpp @@ -109,7 +109,7 @@ void hud_render_text(const LLWString &wstr, const LLVector3 &pos_agent, LLRect world_view_rect = gViewerWindow->getWorldViewRectRaw(); glm::ivec4 viewport(world_view_rect.mLeft, world_view_rect.mBottom, world_view_rect.getWidth(), world_view_rect.getHeight()); - glm::vec3 win_coord = glm::project(glm::make_vec3(LLVector4(render_pos).mV), get_current_modelview(), get_current_projection(), viewport); + glm::vec3 win_coord = glm::project(glm::vec3(render_pos.mV[VX], render_pos.mV[VY], render_pos.mV[VZ]), get_current_modelview(), get_current_projection(), viewport); //fonts all render orthographically, set up projection`` gGL.matrixMode(LLRender::MM_PROJECTION); diff --git a/indra/newview/llpanelprimmediacontrols.cpp b/indra/newview/llpanelprimmediacontrols.cpp index 955b5e7730..799c6e7a4b 100644 --- a/indra/newview/llpanelprimmediacontrols.cpp +++ b/indra/newview/llpanelprimmediacontrols.cpp @@ -660,7 +660,7 @@ void LLPanelPrimMediaControls::updateShape() for(; vert_it != vert_end; ++vert_it) { // project silhouette vertices into screen space - glm::vec3 screen_vert(glm::make_vec3(vert_it->mV)); + glm::vec3 screen_vert(vert_it->mV[VX], vert_it->mV[VY], vert_it->mV[VZ]); screen_vert = mul_mat4_vec3(mat, screen_vert); // add to screenspace bounding box diff --git a/indra/newview/llreflectionmap.cpp b/indra/newview/llreflectionmap.cpp index 07e2c39379..96fea13f9e 100644 --- a/indra/newview/llreflectionmap.cpp +++ b/indra/newview/llreflectionmap.cpp @@ -256,7 +256,7 @@ bool LLReflectionMap::getBox(LLMatrix4& box) glm::mat4 mv(get_current_modelview()); LLVector3 s = mViewerObject->getScale().scaledVec(LLVector3(0.5f, 0.5f, 0.5f)); mRadius = s.magVec(); - glm::mat4 scale = glm::scale(glm::make_vec3(LLVector4(s).mV)); + glm::mat4 scale = glm::scale(glm::vec3(s.mV[VX], s.mV[VY], s.mV[VZ])); if (mViewerObject->mDrawable != nullptr) { // object to agent space (no scale) diff --git a/indra/newview/llsettingsvo.cpp b/indra/newview/llsettingsvo.cpp index c33d5ef7cc..511f6abd37 100644 --- a/indra/newview/llsettingsvo.cpp +++ b/indra/newview/llsettingsvo.cpp @@ -1091,8 +1091,8 @@ void LLSettingsVOWater::applySpecial(void *ptarget, bool force) LLVector4 waterPlane(enorm.x, enorm.y, enorm.z, -glm::dot(ep, enorm)); - norm = glm::make_vec3(gPipeline.mHeroProbeManager.mMirrorNormal.mV); - p = glm::make_vec3(gPipeline.mHeroProbeManager.mMirrorPosition.mV); + norm = glm::vec3(gPipeline.mHeroProbeManager.mMirrorNormal.mV[VZ], gPipeline.mHeroProbeManager.mMirrorNormal.mV[VY], gPipeline.mHeroProbeManager.mMirrorNormal.mV[VZ]); + p = glm::vec3(gPipeline.mHeroProbeManager.mMirrorPosition.mV[VX], gPipeline.mHeroProbeManager.mMirrorPosition.mV[VY], gPipeline.mHeroProbeManager.mMirrorPosition.mV[VZ]); enorm = mul_mat4_vec3(invtrans, norm); enorm = glm::normalize(enorm); ep = mul_mat4_vec3(mat, p); diff --git a/indra/newview/llviewercamera.cpp b/indra/newview/llviewercamera.cpp index aa43b2dbad..170d7f5c4a 100644 --- a/indra/newview/llviewercamera.cpp +++ b/indra/newview/llviewercamera.cpp @@ -420,7 +420,7 @@ bool LLViewerCamera::projectPosAgentToScreen(const LLVector3 &pos_agent, LLCoord LLRect world_view_rect = gViewerWindow->getWorldViewRectRaw(); glm::ivec4 viewport(world_view_rect.mLeft, world_view_rect.mBottom, world_view_rect.getWidth(), world_view_rect.getHeight()); - glm::vec3 win_coord = glm::project(glm::make_vec3(pos_agent.mV), get_current_modelview(), get_current_projection(), viewport); + glm::vec3 win_coord = glm::project(glm::vec3(pos_agent.mV[VX], pos_agent.mV[VY], pos_agent.mV[VZ]), get_current_modelview(), get_current_projection(), viewport); { // convert screen coordinates to virtual UI coordinates @@ -514,7 +514,7 @@ bool LLViewerCamera::projectPosAgentToScreenEdge(const LLVector3 &pos_agent, LLRect world_view_rect = gViewerWindow->getWorldViewRectRaw(); glm::ivec4 viewport(world_view_rect.mLeft, world_view_rect.mBottom, world_view_rect.getWidth(), world_view_rect.getHeight()); - glm::vec3 win_coord = glm::project(glm::make_vec3(pos_agent.mV), get_current_modelview(), get_current_projection(), viewport); + glm::vec3 win_coord = glm::project(glm::vec3(pos_agent.mV[VX], pos_agent.mV[VY], pos_agent.mV[VZ]), get_current_modelview(), get_current_projection(), viewport); { win_coord.x /= gViewerWindow->getDisplayScale().mV[VX]; diff --git a/indra/newview/llvoavatar.cpp b/indra/newview/llvoavatar.cpp index 31be509b0b..d2b82937c9 100644 --- a/indra/newview/llvoavatar.cpp +++ b/indra/newview/llvoavatar.cpp @@ -1939,10 +1939,10 @@ bool LLVOAvatar::lineSegmentIntersect(const LLVector4a& start, const LLVector4a& if (linesegment_sphere(LLVector3(glm::value_ptr(p1)), LLVector3(glm::value_ptr(p2)), LLVector3(0,0,0), 1.f, position, norm)) { - glm::vec3 res_pos(glm::make_vec3(LLVector4(position).mV)); + glm::vec3 res_pos(position.mV[VX], position.mV[VY], position.mV[VZ]); res_pos = mul_mat4_vec3(mat, res_pos); - glm::vec3 res_norm(glm::make_vec3(LLVector4(norm).mV)); + glm::vec3 res_norm(norm.mV[VX], norm.mV[VY], norm.mV[VZ]); res_norm = glm::normalize(res_norm); res_norm = glm::mat3(norm_mat) * res_norm; diff --git a/indra/newview/pipeline.cpp b/indra/newview/pipeline.cpp index 40cb32f611..ed6298c108 100644 --- a/indra/newview/pipeline.cpp +++ b/indra/newview/pipeline.cpp @@ -8699,7 +8699,7 @@ void LLPipeline::renderDeferredLighting() sVisibleLightCount++; - glm::vec3 tc(glm::make_vec3(LLVector4(center).mV)); + glm::vec3 tc(center.mV[VX], center.mV[VY], center.mV[VZ]); tc = mul_mat4_vec3(mat, tc); setupSpotLight(gDeferredMultiSpotLightProgram, drawablep); @@ -9832,7 +9832,7 @@ void LLPipeline::generateSunShadow(LLCamera& camera) LLVector3 lightDir = -caster_dir; lightDir.normVec(); - glm::vec3 light_dir(glm::make_vec3(lightDir.mV)); + glm::vec3 light_dir(lightDir.mV[VX], lightDir.mV[VY], lightDir.mV[VZ]); //create light space camera matrix @@ -9887,7 +9887,7 @@ void LLPipeline::generateSunShadow(LLCamera& camera) //get good split distances for frustum for (U32 i = 0; i < fp.size(); ++i) { - glm::vec3 v(glm::make_vec3(fp[i].mV)); + glm::vec3 v(fp[i].mV[VX], fp[i].mV[VY], fp[i].mV[VZ]); v = mul_mat4_vec3(saved_view, v); fp[i].setVec(glm::value_ptr(v)); } @@ -10038,7 +10038,7 @@ void LLPipeline::generateSunShadow(LLCamera& camera) for (U32 i = 0; i < fp.size(); i++) { - glm::vec3 p = glm::make_vec3(fp[i].mV); + glm::vec3 p(fp[i].mV[VX], fp[i].mV[VY], fp[i].mV[VZ]); p = mul_mat4_vec3(view[j], p); wpf.push_back(LLVector3(glm::value_ptr(p))); } @@ -10241,7 +10241,7 @@ void LLPipeline::generateSunShadow(LLCamera& camera) view[j] = glm::inverse(view[j]); //llassert(origin.isFinite()); - glm::vec3 origin_agent(glm::make_vec3(LLVector4(origin).mV)); + glm::vec3 origin_agent(origin.mV[VX], origin.mV[VY], origin.mV[VZ]); //translate view to origin origin_agent = mul_mat4_vec3(view[j], origin_agent); From 4e5071e80314dffd67abac327be82ecb2d87f77e Mon Sep 17 00:00:00 2001 From: Rye Date: Mon, 11 Nov 2024 08:21:55 -0500 Subject: [PATCH 06/23] Increase MSVC to Ob3 for inlining comparable to clang and gcc --- indra/cmake/00-Common.cmake | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/indra/cmake/00-Common.cmake b/indra/cmake/00-Common.cmake index 445ac3cef9..545b138bdf 100644 --- a/indra/cmake/00-Common.cmake +++ b/indra/cmake/00-Common.cmake @@ -97,10 +97,10 @@ if (WINDOWS) /permissive- ) - # Nicky: x64 implies SSE2 - if( ADDRESS_SIZE EQUAL 32 ) - add_compile_options( /arch:SSE2 ) - endif() + # We want aggressive inlining on MSVC to better match clang/gcc at O3 + string(REPLACE "/Ob2" "/Ob3" CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}") + string(REPLACE "/Ob2" "/Ob3" CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE}") + string(REPLACE "/Ob2" "/Ob3" CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE}") # Are we using the crummy Visual Studio KDU build workaround? if (NOT VS_DISABLE_FATAL_WARNINGS) From b6a42963af27b3fc646fe2dfebe84b26c0af0b31 Mon Sep 17 00:00:00 2001 From: Rye Date: Mon, 11 Nov 2024 08:25:38 -0500 Subject: [PATCH 07/23] Restore various llmath types to trivially copyable/movable and restore SIMD types to trivial --- indra/llmath/llbbox.h | 4 ++++ indra/llmath/llbboxlocal.h | 5 ++++- indra/llmath/llline.h | 4 +++- indra/llmath/llmatrix3a.h | 9 +++++++-- indra/llmath/llmatrix4a.h | 7 +++---- indra/llmath/llplane.h | 3 ++- indra/llmath/llquaternion.h | 4 ++++ indra/llmath/llquaternion2.h | 4 +++- indra/llmath/llrect.h | 8 ++++---- indra/llmath/llsimdtypes.h | 12 ++++++++---- indra/llmath/llvector4a.h | 13 ++++--------- indra/llmath/llvector4a.inl | 12 ------------ indra/llmath/llvector4logical.h | 6 ++++-- indra/llmath/m3math.h | 4 ++++ indra/llmath/m4math.cpp | 10 ---------- indra/llmath/m4math.h | 7 ++++--- indra/llmath/v2math.h | 3 +++ indra/llmath/v3color.h | 4 ++++ indra/llmath/v3dmath.h | 4 ++++ indra/llmath/v3math.h | 4 ++++ indra/llmath/v4color.h | 4 ++++ indra/llmath/v4coloru.h | 4 ++++ indra/llmath/v4math.h | 4 ++++ indra/newview/llcontrolavatar.cpp | 2 +- indra/newview/llface.cpp | 5 ----- indra/newview/llmodelpreview.cpp | 2 +- 26 files changed, 87 insertions(+), 61 deletions(-) diff --git a/indra/llmath/llbbox.h b/indra/llmath/llbbox.h index 5617eaebde..3a4e09a598 100644 --- a/indra/llmath/llbbox.h +++ b/indra/llmath/llbbox.h @@ -95,6 +95,10 @@ class LLBBox bool mEmpty; // Nothing has been added to this bbox yet }; +static_assert(std::is_trivially_copyable::value, "LLBBox must be trivial copy"); +static_assert(std::is_trivially_move_assignable::value, "LLBBox must be trivial move"); +static_assert(std::is_standard_layout::value, "LLBBox must be a standard layout type"); + //LLBBox operator*(const LLBBox &a, const LLMatrix4 &b); diff --git a/indra/llmath/llbboxlocal.h b/indra/llmath/llbboxlocal.h index e215e55460..afe757c8d5 100644 --- a/indra/llmath/llbboxlocal.h +++ b/indra/llmath/llbboxlocal.h @@ -34,7 +34,7 @@ class LLMatrix4; class LLBBoxLocal { public: - LLBBoxLocal() {} + LLBBoxLocal() = default; LLBBoxLocal( const LLVector3& min, const LLVector3& max ) : mMin( min ), mMax( max ) {} // Default copy constructor is OK. @@ -61,5 +61,8 @@ class LLBBoxLocal LLBBoxLocal operator*(const LLBBoxLocal &a, const LLMatrix4 &b); +static_assert(std::is_trivially_copyable::value, "LLBBoxLocal must be trivial copy"); +static_assert(std::is_trivially_move_assignable::value, "LLBBoxLocal must be trivial move"); +static_assert(std::is_standard_layout::value, "LLBBoxLocal must be a standard layout type"); #endif // LL_BBOXLOCAL_H diff --git a/indra/llmath/llline.h b/indra/llmath/llline.h index e98e173d1f..37e73e7600 100644 --- a/indra/llmath/llline.h +++ b/indra/llmath/llline.h @@ -40,7 +40,6 @@ class LLLine public: LLLine(); LLLine( const LLVector3& first_point, const LLVector3& second_point ); - virtual ~LLLine() {}; void setPointDirection( const LLVector3& first_point, const LLVector3& second_point ); void setPoints( const LLVector3& first_point, const LLVector3& second_point ); @@ -76,5 +75,8 @@ class LLLine LLVector3 mDirection; }; +static_assert(std::is_trivially_copyable::value, "LLLine must be trivial copy"); +static_assert(std::is_trivially_move_assignable::value, "LLLine must be trivial move"); +static_assert(std::is_standard_layout::value, "LLLine must be a standard layout type"); #endif diff --git a/indra/llmath/llmatrix3a.h b/indra/llmath/llmatrix3a.h index dff6604ae5..3b9c6569af 100644 --- a/indra/llmath/llmatrix3a.h +++ b/indra/llmath/llmatrix3a.h @@ -56,7 +56,7 @@ class LLMatrix3a ////////////////////////// // Ctor - LLMatrix3a() {} + LLMatrix3a() = default; // Ctor for setting by columns inline LLMatrix3a( const LLVector4a& c0, const LLVector4a& c1, const LLVector4a& c2 ); @@ -115,14 +115,19 @@ class LLMatrix3a }; +static_assert(std::is_trivial::value, "LLMatrix3a must be a trivial type"); + class LLRotation : public LLMatrix3a { public: - LLRotation() {} + LLRotation() = default; // Returns true if this rotation is orthonormal with det ~= 1 inline bool isOkRotation() const; }; +static_assert(std::is_trivial::value, "LLRotation must be a trivial type"); + + #endif diff --git a/indra/llmath/llmatrix4a.h b/indra/llmath/llmatrix4a.h index 3b423f783a..377203098e 100644 --- a/indra/llmath/llmatrix4a.h +++ b/indra/llmath/llmatrix4a.h @@ -36,10 +36,7 @@ class LLMatrix4a public: LL_ALIGN_16(LLVector4a mMatrix[4]); - LLMatrix4a() - { - - } + LLMatrix4a() = default; explicit LLMatrix4a(const LLMatrix4& val) { @@ -228,6 +225,8 @@ class LLMatrix4a const LLVector4a& getTranslation() const { return mMatrix[3]; } }; +static_assert(std::is_trivial::value, "LLMatrix4a must be a trivial type"); + inline LLVector4a rowMul(const LLVector4a &row, const LLMatrix4a &mat) { LLVector4a result; diff --git a/indra/llmath/llplane.h b/indra/llmath/llplane.h index 4e8546e32b..19bc0cebe9 100644 --- a/indra/llmath/llplane.h +++ b/indra/llmath/llplane.h @@ -43,7 +43,7 @@ class LLPlane public: // Constructors - LLPlane() {}; // no default constructor + LLPlane() = default; // no default constructor LLPlane(const LLVector3 &p0, F32 d) { setVec(p0, d); } LLPlane(const LLVector3 &p0, const LLVector3 &n) { setVec(p0, n); } inline void setVec(const LLVector3 &p0, F32 d) { mV.set(p0[0], p0[1], p0[2], d); } @@ -104,6 +104,7 @@ class LLPlane LLVector4a mV; } LL_ALIGN_POSTFIX(16); +static_assert(std::is_trivial::value, "LLPlane must be a trivial type"); #endif // LL_LLPLANE_H diff --git a/indra/llmath/llquaternion.h b/indra/llmath/llquaternion.h index 762d13eded..472d7ca62d 100644 --- a/indra/llmath/llquaternion.h +++ b/indra/llmath/llquaternion.h @@ -174,6 +174,10 @@ class LLQuaternion //static U32 mMultCount; }; +static_assert(std::is_trivially_copyable::value, "LLQuaternion must be trivial copy"); +static_assert(std::is_trivially_move_assignable::value, "LLQuaternion must be trivial move"); +static_assert(std::is_standard_layout::value, "LLQuaternion must be a standard layout type"); + inline LLSD LLQuaternion::getValue() const { LLSD ret; diff --git a/indra/llmath/llquaternion2.h b/indra/llmath/llquaternion2.h index 902bfb7134..c9dcc4573f 100644 --- a/indra/llmath/llquaternion2.h +++ b/indra/llmath/llquaternion2.h @@ -49,7 +49,7 @@ class LLQuaternion2 ////////////////////////// // Ctor - LLQuaternion2() {} + LLQuaternion2() = default; // Ctor from LLQuaternion explicit LLQuaternion2( const class LLQuaternion& quat ); @@ -102,4 +102,6 @@ class LLQuaternion2 }; +static_assert(std::is_trivial::value, "LLQuaternion2 must be a trivial type"); + #endif diff --git a/indra/llmath/llrect.h b/indra/llmath/llrect.h index 317578da06..0a3da2fee0 100644 --- a/indra/llmath/llrect.h +++ b/indra/llmath/llrect.h @@ -51,10 +51,6 @@ template class LLRectBase LLRectBase(): mLeft(0), mTop(0), mRight(0), mBottom(0) {} - LLRectBase(const LLRectBase &r): - mLeft(r.mLeft), mTop(r.mTop), mRight(r.mRight), mBottom(r.mBottom) - {} - LLRectBase(Type left, Type top, Type right, Type bottom): mLeft(left), mTop(top), mRight(right), mBottom(bottom) {} @@ -295,4 +291,8 @@ template LLRectBase LLRectBase::null(0,0,0,0); typedef LLRectBase LLRect; typedef LLRectBase LLRectf; +static_assert(std::is_trivially_copyable::value, "LLRect must be trivial copy"); +static_assert(std::is_trivially_move_assignable::value, "LLRect must be trivial move"); +static_assert(std::is_standard_layout::value, "LLRect must be a standard layout type"); + #endif diff --git a/indra/llmath/llsimdtypes.h b/indra/llmath/llsimdtypes.h index a407f51029..6c4f55b0c0 100644 --- a/indra/llmath/llsimdtypes.h +++ b/indra/llmath/llsimdtypes.h @@ -36,7 +36,7 @@ typedef __m128 LLQuad; class LLBool32 { public: - inline LLBool32() {} + inline LLBool32() = default; inline LLBool32(int rhs) : m_bool(rhs) {} inline LLBool32(unsigned int rhs) : m_bool(rhs) {} inline LLBool32(bool rhs) { m_bool = static_cast(rhs); } @@ -46,13 +46,15 @@ class LLBool32 inline operator bool() const { return static_cast(m_bool); } private: - int m_bool{ 0 }; + int m_bool; }; +static_assert(std::is_trivial::value, "LLBool32 must be a standard layout type"); + class LLSimdScalar { public: - inline LLSimdScalar() {} + inline LLSimdScalar() = default; inline LLSimdScalar(LLQuad q) { mQ = q; @@ -100,7 +102,9 @@ class LLSimdScalar } private: - LLQuad mQ{}; + LLQuad mQ; }; +static_assert(std::is_trivial::value, "LLSimdScalar must be a standard layout type"); + #endif //LL_SIMD_TYPES_H diff --git a/indra/llmath/llvector4a.h b/indra/llmath/llvector4a.h index 8ef560dadf..0fc55da12d 100644 --- a/indra/llmath/llvector4a.h +++ b/indra/llmath/llvector4a.h @@ -92,10 +92,7 @@ class alignas(16) LLVector4a //////////////////////////////////// //LLVector4a is plain data which should never have a default constructor or destructor(malloc&free won't trigger it) - LLVector4a() - { //DO NOT INITIALIZE -- The overhead is completely unnecessary - ll_assert_aligned(this,16); - } + LLVector4a() = default; LLVector4a(F32 x, F32 y, F32 z, F32 w = 0.f) { @@ -358,16 +355,14 @@ class alignas(16) LLVector4a //////////////////////////////////// // Do NOT add aditional operators without consulting someone with SSE experience - inline const LLVector4a& operator= ( const LLVector4a& rhs ); - - inline const LLVector4a& operator= ( const LLQuad& rhs ); - inline operator LLQuad() const; private: - LLQuad mQ{}; + LLQuad mQ; }; +static_assert(std::is_trivial::value, "LLVector4a must be a trivial type"); + inline void update_min_max(LLVector4a& min, LLVector4a& max, const LLVector4a& p) { min.setMin(min, p); diff --git a/indra/llmath/llvector4a.inl b/indra/llmath/llvector4a.inl index 36dbec078c..ddd7c72fb2 100644 --- a/indra/llmath/llvector4a.inl +++ b/indra/llmath/llvector4a.inl @@ -593,18 +593,6 @@ inline bool LLVector4a::equals3(const LLVector4a& rhs, F32 tolerance ) const //////////////////////////////////// // Do NOT add aditional operators without consulting someone with SSE experience -inline const LLVector4a& LLVector4a::operator= ( const LLVector4a& rhs ) -{ - mQ = rhs.mQ; - return *this; -} - -inline const LLVector4a& LLVector4a::operator= ( const LLQuad& rhs ) -{ - mQ = rhs; - return *this; -} - inline LLVector4a::operator LLQuad() const { return mQ; diff --git a/indra/llmath/llvector4logical.h b/indra/llmath/llvector4logical.h index 70759eef5c..77cb5862e5 100644 --- a/indra/llmath/llvector4logical.h +++ b/indra/llmath/llvector4logical.h @@ -61,7 +61,7 @@ class LLVector4Logical }; // Empty default ctor - LLVector4Logical() {} + LLVector4Logical() = default; LLVector4Logical( const LLQuad& quad ) { @@ -120,7 +120,9 @@ class LLVector4Logical private: - LLQuad mQ{}; + LLQuad mQ; }; +static_assert(std::is_trivial::value, "LLVector4Logical must be a standard layout type"); + #endif //LL_VECTOR4ALOGICAL_H diff --git a/indra/llmath/m3math.h b/indra/llmath/m3math.h index 22b11d13b1..fba506510d 100644 --- a/indra/llmath/m3math.h +++ b/indra/llmath/m3math.h @@ -141,6 +141,10 @@ class LLMatrix3 friend std::ostream& operator<<(std::ostream& s, const LLMatrix3 &a); // Stream a }; +static_assert(std::is_trivially_copyable::value, "LLMatrix3 must be trivial copy"); +static_assert(std::is_trivially_move_assignable::value, "LLMatrix3 must be trivial move"); +static_assert(std::is_standard_layout::value, "LLMatrix3 must be a standard layout type"); + inline LLMatrix3::LLMatrix3(void) { mMatrix[0][0] = 1.f; diff --git a/indra/llmath/m4math.cpp b/indra/llmath/m4math.cpp index a9853fe7e9..2a55ef5f86 100644 --- a/indra/llmath/m4math.cpp +++ b/indra/llmath/m4math.cpp @@ -113,12 +113,6 @@ LLMatrix4::LLMatrix4(const LLQuaternion &q) *this = initRotation(q); } -LLMatrix4::LLMatrix4(const LLMatrix4a& mat) - : LLMatrix4(mat.getF32ptr()) -{ - -} - LLMatrix4::LLMatrix4(const LLQuaternion &q, const LLVector4 &pos) { *this = initRotTrans(q, pos); @@ -156,10 +150,6 @@ LLMatrix4::LLMatrix4(const F32 roll, const F32 pitch, const F32 yaw) mMatrix[3][3] = 1.f; } -LLMatrix4::~LLMatrix4(void) -{ -} - // Clear and Assignment Functions const LLMatrix4& LLMatrix4::setZero() diff --git a/indra/llmath/m4math.h b/indra/llmath/m4math.h index b0f8c90cdf..e1ca0bbdcb 100644 --- a/indra/llmath/m4math.h +++ b/indra/llmath/m4math.h @@ -105,7 +105,6 @@ class LLMatrix4 explicit LLMatrix4(const F32 *mat); // Initializes Matrix to values in mat explicit LLMatrix4(const LLMatrix3 &mat); // Initializes Matrix to values in mat and sets position to (0,0,0) explicit LLMatrix4(const LLQuaternion &q); // Initializes Matrix with rotation q and sets position to (0,0,0) - explicit LLMatrix4(const LLMatrix4a& mat); LLMatrix4(const LLMatrix3 &mat, const LLVector4 &pos); // Initializes Matrix to values in mat and pos @@ -119,8 +118,6 @@ class LLMatrix4 const LLVector4 &pos); // Initializes Matrix with Euler angles LLMatrix4(const F32 roll, const F32 pitch, const F32 yaw); // Initializes Matrix with Euler angles - ~LLMatrix4(void); // Destructor - LLSD getValue() const; void setValue(const LLSD&); @@ -242,6 +239,10 @@ class LLMatrix4 friend std::ostream& operator<<(std::ostream& s, const LLMatrix4 &a); // Stream a }; +static_assert(std::is_trivially_copyable::value, "LLMatrix4 must be trivial copy"); +static_assert(std::is_trivially_move_assignable::value, "LLMatrix4 must be trivial move"); +static_assert(std::is_standard_layout::value, "LLMatrix4 must be a standard layout type"); + inline const LLMatrix4& LLMatrix4::setIdentity() { mMatrix[0][0] = 1.f; diff --git a/indra/llmath/v2math.h b/indra/llmath/v2math.h index a0ba3ec505..0d24369823 100644 --- a/indra/llmath/v2math.h +++ b/indra/llmath/v2math.h @@ -110,6 +110,9 @@ class LLVector2 friend std::ostream& operator<<(std::ostream& s, const LLVector2 &a); // Stream a }; +static_assert(std::is_trivially_copyable::value, "LLVector2 must be trivial copy"); +static_assert(std::is_trivially_move_assignable::value, "LLVector2 must be trivial move"); +static_assert(std::is_standard_layout::value, "LLVector2 must be a standard layout type"); // Non-member functions diff --git a/indra/llmath/v3color.h b/indra/llmath/v3color.h index 3763fc6725..122aaf6e7d 100644 --- a/indra/llmath/v3color.h +++ b/indra/llmath/v3color.h @@ -144,6 +144,10 @@ class LLColor3 inline void exp(); // Do an exponential on the color }; +static_assert(std::is_trivially_copyable::value, "LLColor3 must be trivial copy"); +static_assert(std::is_trivially_move_assignable::value, "LLColor3 must be trivial move"); +static_assert(std::is_standard_layout::value, "LLColor3 must be a standard layout type"); + LLColor3 lerp(const LLColor3& a, const LLColor3& b, F32 u); void LLColor3::clamp() diff --git a/indra/llmath/v3dmath.h b/indra/llmath/v3dmath.h index 7c94ebdf9b..2906be9294 100644 --- a/indra/llmath/v3dmath.h +++ b/indra/llmath/v3dmath.h @@ -130,6 +130,10 @@ class LLVector3d }; +static_assert(std::is_trivially_copyable::value, "LLVector3d must be trivial copy"); +static_assert(std::is_trivially_move_assignable::value, "LLVector3d must be trivial move"); +static_assert(std::is_standard_layout::value, "LLVector3d must be a standard layout type"); + typedef LLVector3d LLGlobalVec; inline const LLVector3d &LLVector3d::set(const LLVector3 &vec) diff --git a/indra/llmath/v3math.h b/indra/llmath/v3math.h index 53491533c2..bc08a382f7 100644 --- a/indra/llmath/v3math.h +++ b/indra/llmath/v3math.h @@ -152,6 +152,10 @@ class LLVector3 static bool parseVector3(const std::string& buf, LLVector3* value); }; +static_assert(std::is_trivially_copyable::value, "LLVector3 must be trivial copy"); +static_assert(std::is_trivially_move_assignable::value, "LLVector3 must be trivial move"); +static_assert(std::is_standard_layout::value, "LLVector3 must be a standard layout type"); + typedef LLVector3 LLSimLocalVec; // Non-member functions diff --git a/indra/llmath/v4color.h b/indra/llmath/v4color.h index a26db0428b..e127cf8337 100644 --- a/indra/llmath/v4color.h +++ b/indra/llmath/v4color.h @@ -231,6 +231,10 @@ class LLColor4 inline void clamp(); }; +static_assert(std::is_trivially_copyable::value, "LLColor4 must be trivial copy"); +static_assert(std::is_trivially_move_assignable::value, "LLColor4 must be trivial move"); +static_assert(std::is_standard_layout::value, "LLColor4 must be a standard layout type"); + // Non-member functions F32 distVec(const LLColor4& a, const LLColor4& b); // Returns distance between a and b F32 distVec_squared(const LLColor4& a, const LLColor4& b); // Returns distance squared between a and b diff --git a/indra/llmath/v4coloru.h b/indra/llmath/v4coloru.h index e1a0206461..1d19994dd6 100644 --- a/indra/llmath/v4coloru.h +++ b/indra/llmath/v4coloru.h @@ -123,6 +123,10 @@ class LLColor4U static LLColor4U blue; }; +static_assert(std::is_trivially_copyable::value, "LLColor4U must be trivial copy"); +static_assert(std::is_trivially_move_assignable::value, "LLColor4U must be trivial move"); +static_assert(std::is_standard_layout::value, "LLColor4U must be a standard layout type"); + // Non-member functions F32 distVec(const LLColor4U& a, const LLColor4U& b); // Returns distance between a and b F32 distVec_squared(const LLColor4U& a, const LLColor4U& b); // Returns distance squared between a and b diff --git a/indra/llmath/v4math.h b/indra/llmath/v4math.h index e2092d1277..cfa737f1dc 100644 --- a/indra/llmath/v4math.h +++ b/indra/llmath/v4math.h @@ -135,6 +135,10 @@ class LLVector4 friend LLVector4 operator-(const LLVector4 &a); // Return vector -a }; +static_assert(std::is_trivially_copyable::value, "LLVector4 must be trivial copy"); +static_assert(std::is_trivially_move_assignable::value, "LLVector4 must be trivial move"); +static_assert(std::is_standard_layout::value, "LLVector4 must be a standard layout type"); + // Non-member functions F32 angle_between(const LLVector4 &a, const LLVector4 &b); // Returns angle (radians) between a and b bool are_parallel(const LLVector4 &a, const LLVector4 &b, F32 epsilon = F_APPROXIMATELY_ZERO); // Returns true if a and b are very close to parallel diff --git a/indra/newview/llcontrolavatar.cpp b/indra/newview/llcontrolavatar.cpp index 9201241856..4b7cbfb440 100644 --- a/indra/newview/llcontrolavatar.cpp +++ b/indra/newview/llcontrolavatar.cpp @@ -232,7 +232,7 @@ void LLControlAvatar::matchVolumeTransform() if (skin_info) { LL_DEBUGS("BindShape") << getFullname() << " bind shape " << skin_info->mBindShapeMatrix << LL_ENDL; - bind_rot = LLSkinningUtil::getUnscaledQuaternion(LLMatrix4(skin_info->mBindShapeMatrix)); + bind_rot = LLSkinningUtil::getUnscaledQuaternion(LLMatrix4(skin_info->mBindShapeMatrix.getF32ptr())); } #endif setRotation(bind_rot*obj_rot); diff --git a/indra/newview/llface.cpp b/indra/newview/llface.cpp index 308dd17473..96829ed0ce 100644 --- a/indra/newview/llface.cpp +++ b/indra/newview/llface.cpp @@ -761,9 +761,6 @@ static void xform4a(LLVector4a &tex_coord, const LLVector4a& trans, const LLVect // Texture transforms are done about the center of the face. st.setAdd(tex_coord, trans); - // Handle rotation - LLVector4a rot_st; - // LLVector4a s0; s0.splat(st, 0); @@ -2233,8 +2230,6 @@ bool LLFace::calcPixelArea(F32& cos_angle_to_view_dir, F32& radius) if (joint) { - LLVector4a jointPos; - LLMatrix4a worldMat; worldMat.loadu((F32*)&joint->getWorldMatrix().mMatrix[0][0]); diff --git a/indra/newview/llmodelpreview.cpp b/indra/newview/llmodelpreview.cpp index b6cfdef598..6c844cd745 100644 --- a/indra/newview/llmodelpreview.cpp +++ b/indra/newview/llmodelpreview.cpp @@ -520,7 +520,7 @@ void LLModelPreview::rebuildUploadData() bool upload_skinweights = fmp && fmp->childGetValue("upload_skin").asBoolean(); if (upload_skinweights && high_lod_model->mSkinInfo.mJointNames.size() > 0) { - LLQuaternion bind_rot = LLSkinningUtil::getUnscaledQuaternion(LLMatrix4(high_lod_model->mSkinInfo.mBindShapeMatrix)); + LLQuaternion bind_rot = LLSkinningUtil::getUnscaledQuaternion(LLMatrix4(high_lod_model->mSkinInfo.mBindShapeMatrix.getF32ptr())); LLQuaternion identity; if (!bind_rot.isEqualEps(identity, 0.01)) { From 21b22dd70cc8db071188b39f554739fbc0810d97 Mon Sep 17 00:00:00 2001 From: Rye Date: Tue, 10 Dec 2024 02:31:05 -0500 Subject: [PATCH 08/23] Fix mesa failing to link shaders due to missing vertex shader outputs --- indra/llrender/llshadermgr.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/indra/llrender/llshadermgr.cpp b/indra/llrender/llshadermgr.cpp index cd01eb79da..cf37db7ee8 100644 --- a/indra/llrender/llshadermgr.cpp +++ b/indra/llrender/llshadermgr.cpp @@ -79,7 +79,7 @@ bool LLShaderMgr::attachShaderFeatures(LLGLSLShader * shader) ////////////////////////////////////// // NOTE order of shader object attaching is VERY IMPORTANT!!! - if (features->calculatesAtmospherics) + if (features->calculatesAtmospherics || features->hasGamma || features->isDeferred) { if (!shader->attachVertexObject("windlight/atmosphericsVarsV.glsl")) { From 68728a6982a3044890f8e8b344285e779604657b Mon Sep 17 00:00:00 2001 From: Rye Date: Fri, 15 Nov 2024 23:11:57 -0500 Subject: [PATCH 09/23] Clean up cmake linking to avoid implicit link to system libraries --- indra/cmake/00-Common.cmake | 14 +++------ indra/cmake/Audio.cmake | 7 ++++- indra/cmake/Boost.cmake | 48 ++++++++++++++---------------- indra/cmake/Copy3rdPartyLibs.cmake | 1 - indra/cmake/LLKDU.cmake | 6 ++-- indra/cmake/LLPrimitive.cmake | 4 +-- indra/cmake/LibVLCPlugin.cmake | 10 ++----- indra/cmake/Linking.cmake | 14 +-------- indra/cmake/Meshoptimizer.cmake | 6 ++-- indra/cmake/NDOF.cmake | 8 +++-- indra/cmake/OPENAL.cmake | 4 +-- indra/cmake/OpenJPEG.cmake | 4 +++ indra/cmake/OpenSSL.cmake | 9 ++++-- indra/cmake/Variables.cmake | 29 +++++++----------- indra/cmake/WebRTC.cmake | 6 ++-- indra/llwindow/CMakeLists.txt | 3 +- 16 files changed, 75 insertions(+), 98 deletions(-) diff --git a/indra/cmake/00-Common.cmake b/indra/cmake/00-Common.cmake index 545b138bdf..cd33ab27cf 100644 --- a/indra/cmake/00-Common.cmake +++ b/indra/cmake/00-Common.cmake @@ -170,7 +170,7 @@ if (LINUX) ) add_link_options( - "LINKER:--build-id" + "LINKER:--build-id" "LINKER:--as-needed" "LINKER:-z,relro" "LINKER:-z,now" @@ -201,15 +201,9 @@ if (DARWIN) set(CLANG_DISABLE_FATAL_WARNINGS OFF) set(CMAKE_CXX_LINK_FLAGS "-Wl,-headerpad_max_install_names,-search_paths_first") set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_CXX_LINK_FLAGS}") - # Ensure that CMAKE_CXX_FLAGS has the correct -g debug information format -- - # see Variables.cmake. - string(REPLACE "-gdwarf-2" "-g${CMAKE_XCODE_ATTRIBUTE_DEBUG_INFORMATION_FORMAT}" - CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}") - # NOTE: it's critical that the optimization flag is put in front. - # NOTE: it's critical to have both CXX_FLAGS and C_FLAGS covered. - ## Really?? On developer machines too? - ##set(ENABLE_SIGNING TRUE) - ##set(SIGNING_IDENTITY "Developer ID Application: Linden Research, Inc.") + + # Ensure debug symbols are always generated + add_compile_options(-g --debug) # --debug is a clang synonym for -g that bypasses cmake behaviors endif(DARWIN) if(LINUX OR DARWIN) diff --git a/indra/cmake/Audio.cmake b/indra/cmake/Audio.cmake index 6de33af314..bb6d675ebf 100644 --- a/indra/cmake/Audio.cmake +++ b/indra/cmake/Audio.cmake @@ -21,6 +21,11 @@ if (WINDOWS) debug ${ARCH_PREBUILT_DIRS_DEBUG}/libvorbis.lib ) else (WINDOWS) - target_link_libraries(ll::vorbis INTERFACE vorbisfile vorbis ogg vorbisenc ) + target_link_libraries(ll::vorbis INTERFACE + ${ARCH_PREBUILT_DIRS_RELEASE}/libvorbisfile.a + ${ARCH_PREBUILT_DIRS_RELEASE}/libvorbis.a + ${ARCH_PREBUILT_DIRS_RELEASE}/libvorbisenc.a + ${ARCH_PREBUILT_DIRS_RELEASE}/libogg.a + ) endif (WINDOWS) diff --git a/indra/cmake/Boost.cmake b/indra/cmake/Boost.cmake index 57f44dae59..250d6cd923 100644 --- a/indra/cmake/Boost.cmake +++ b/indra/cmake/Boost.cmake @@ -25,31 +25,29 @@ if (WINDOWS) libboost_regex-mt${addrsfx} libboost_system-mt${addrsfx} libboost_thread-mt${addrsfx} - libboost_url-mt${addrsfx}) -elseif (LINUX) - target_link_libraries( ll::boost INTERFACE - boost_fiber-mt${addrsfx} - boost_context-mt${addrsfx} - boost_filesystem-mt${addrsfx} - boost_program_options-mt${addrsfx} - boost_regex-mt${addrsfx} - boost_system-mt${addrsfx} - boost_thread-mt${addrsfx} - boost_url-mt${addrsfx}) + libboost_url-mt${addrsfx} + ) elseif (DARWIN) target_link_libraries( ll::boost INTERFACE - boost_context-mt${addrsfx} - boost_fiber-mt${addrsfx} - boost_filesystem-mt${addrsfx} - boost_program_options-mt${addrsfx} - boost_regex-mt${addrsfx} - boost_system-mt${addrsfx} - boost_thread-mt${addrsfx} - boost_url-mt${addrsfx}) -endif (WINDOWS) - -if (LINUX) - set(BOOST_SYSTEM_LIBRARY ${BOOST_SYSTEM_LIBRARY} rt) - set(BOOST_THREAD_LIBRARY ${BOOST_THREAD_LIBRARY} rt) -endif (LINUX) + ${ARCH_PREBUILT_DIRS_RELEASE}/libboost_context-mt.a + ${ARCH_PREBUILT_DIRS_RELEASE}/libboost_fiber-mt.a + ${ARCH_PREBUILT_DIRS_RELEASE}/libboost_filesystem-mt.a + ${ARCH_PREBUILT_DIRS_RELEASE}/libboost_program_options-mt.a + ${ARCH_PREBUILT_DIRS_RELEASE}/libboost_regex-mt.a + ${ARCH_PREBUILT_DIRS_RELEASE}/libboost_system-mt.a + ${ARCH_PREBUILT_DIRS_RELEASE}/libboost_thread-mt.a + ${ARCH_PREBUILT_DIRS_RELEASE}/libboost_url-mt.a + ) +else () + target_link_libraries( ll::boost INTERFACE + ${ARCH_PREBUILT_DIRS_RELEASE}/libboost_context-mt${addrsfx}.a + ${ARCH_PREBUILT_DIRS_RELEASE}/libboost_fiber-mt${addrsfx}.a + ${ARCH_PREBUILT_DIRS_RELEASE}/libboost_filesystem-mt${addrsfx}.a + ${ARCH_PREBUILT_DIRS_RELEASE}/libboost_program_options-mt${addrsfx}.a + ${ARCH_PREBUILT_DIRS_RELEASE}/libboost_regex-mt${addrsfx}.a + ${ARCH_PREBUILT_DIRS_RELEASE}/libboost_system-mt${addrsfx}.a + ${ARCH_PREBUILT_DIRS_RELEASE}/libboost_thread-mt${addrsfx}.a + ${ARCH_PREBUILT_DIRS_RELEASE}/libboost_url-mt${addrsfx}.a + ) +endif () diff --git a/indra/cmake/Copy3rdPartyLibs.cmake b/indra/cmake/Copy3rdPartyLibs.cmake index bae3dc5d94..a52e17ac8e 100644 --- a/indra/cmake/Copy3rdPartyLibs.cmake +++ b/indra/cmake/Copy3rdPartyLibs.cmake @@ -171,7 +171,6 @@ elseif(DARWIN) set(release_files libndofdev.dylib libSDL2.dylib - libSDL2-2.0.dylib ) if(LLCOMMON_LINK_SHARED) diff --git a/indra/cmake/LLKDU.cmake b/indra/cmake/LLKDU.cmake index 6d27dcc286..2dafc7989f 100644 --- a/indra/cmake/LLKDU.cmake +++ b/indra/cmake/LLKDU.cmake @@ -14,14 +14,14 @@ if (USE_KDU) include(Prebuilt) use_prebuilt_binary(kdu) if (WINDOWS) - target_link_libraries( ll::kdu INTERFACE kdu.lib) + target_link_libraries( ll::kdu INTERFACE ${ARCH_PREBUILT_DIRS_RELEASE}/kdu.lib) else (WINDOWS) - target_link_libraries( ll::kdu INTERFACE libkdu.a) + target_link_libraries( ll::kdu INTERFACE ${ARCH_PREBUILT_DIRS_RELEASE}/libkdu.a) endif (WINDOWS) target_include_directories( ll::kdu SYSTEM INTERFACE ${AUTOBUILD_INSTALL_DIR}/include/kdu ${LIBS_OPEN_DIR}/llkdu ) - target_compile_definitions(ll::kdu INTERFACE KDU_X86_INTRINSICS=1 KDU_NO_THREADS=1) + target_compile_definitions(ll::kdu INTERFACE KDU_NO_THREADS=1) endif (USE_KDU) diff --git a/indra/cmake/LLPrimitive.cmake b/indra/cmake/LLPrimitive.cmake index d0a52ffb63..2476f17b19 100644 --- a/indra/cmake/LLPrimitive.cmake +++ b/indra/cmake/LLPrimitive.cmake @@ -43,7 +43,7 @@ target_include_directories( ll::colladadom SYSTEM INTERFACE if (WINDOWS) target_link_libraries(ll::colladadom INTERFACE ${ARCH_PREBUILT_DIRS_RELEASE}/libcollada14dom23-s.lib ll::libxml ll::minizip-ng ) elseif (DARWIN) - target_link_libraries(ll::colladadom INTERFACE collada14dom ll::boost ll::libxml ll::minizip-ng) + target_link_libraries(ll::colladadom INTERFACE ${ARCH_PREBUILT_DIRS_RELEASE}/libcollada14dom.a ll::boost ll::libxml ll::minizip-ng) elseif (LINUX) - target_link_libraries(ll::colladadom INTERFACE collada14dom ll::boost ll::libxml ll::minizip-ng) + target_link_libraries(ll::colladadom INTERFACE ${ARCH_PREBUILT_DIRS_RELEASE}/libcollada14dom.a ll::boost ll::libxml ll::minizip-ng) endif() diff --git a/indra/cmake/LibVLCPlugin.cmake b/indra/cmake/LibVLCPlugin.cmake index 312fb81a73..4a1028d005 100644 --- a/indra/cmake/LibVLCPlugin.cmake +++ b/indra/cmake/LibVLCPlugin.cmake @@ -24,13 +24,7 @@ if (WINDOWS) ) elseif (DARWIN) target_link_libraries( ll::libvlc INTERFACE - libvlc.dylib - libvlccore.dylib - ) -elseif (LINUX) - # Specify a full path to make sure we get a static link - target_link_libraries( ll::libvlc INTERFACE - ${LIBS_PREBUILT_DIR}/lib/libvlc.a - ${LIBS_PREBUILT_DIR}/lib/libvlccore.a + ${ARCH_PREBUILT_DIRS_RELEASE}/libvlc.dylib + ${ARCH_PREBUILT_DIRS_RELEASE}/libvlccore.dylib ) endif (WINDOWS) diff --git a/indra/cmake/Linking.cmake b/indra/cmake/Linking.cmake index 2bdf0a8aa1..8f32f29cb1 100644 --- a/indra/cmake/Linking.cmake +++ b/indra/cmake/Linking.cmake @@ -8,7 +8,7 @@ set(ARCH_PREBUILT_DIRS_PLUGINS ${AUTOBUILD_INSTALL_DIR}/plugins) set(ARCH_PREBUILT_DIRS_RELEASE ${AUTOBUILD_INSTALL_DIR}/lib/release) set(ARCH_PREBUILT_DIRS_DEBUG ${AUTOBUILD_INSTALL_DIR}/lib/debug) -if (WINDOWS OR DARWIN ) +if (WINDOWS OR DARWIN) # Kludge for older cmake versions, 3.20+ is needed to use a genex in add_custom_command( OUTPUT ... ) # Using this will work okay-ish, as Debug is not supported anyway. But for property multi config and also # ninja support the genex version is preferred. @@ -32,17 +32,6 @@ elseif (LINUX) set(EXE_STAGING_DIR ${CMAKE_BINARY_DIR}/sharedlibs/bin) endif () -# Autobuild packages must provide 'release' versions of libraries, but may provide versions for -# specific build types. AUTOBUILD_LIBS_INSTALL_DIRS lists first the build type directory and then -# the 'release' directory (as a default fallback). -# *NOTE - we have to take special care to use CMAKE_CFG_INTDIR on IDE generators (like mac and -# windows) and CMAKE_BUILD_TYPE on Makefile based generators (like linux). The reason for this is -# that CMAKE_BUILD_TYPE is essentially meaningless at configuration time for IDE generators and -# CMAKE_CFG_INTDIR is meaningless at build time for Makefile generators - -link_directories(${AUTOBUILD_INSTALL_DIR}/lib/$>) -link_directories(${AUTOBUILD_INSTALL_DIR}/lib/release) - add_library( ll::oslibraries INTERFACE IMPORTED ) if (LINUX) @@ -68,7 +57,6 @@ elseif (WINDOWS) legacy_stdio_definitions ) else() - include(CMakeFindFrameworks) find_library(COREFOUNDATION_LIBRARY CoreFoundation) find_library(CARBON_LIBRARY Carbon) find_library(COCOA_LIBRARY Cocoa) diff --git a/indra/cmake/Meshoptimizer.cmake b/indra/cmake/Meshoptimizer.cmake index 6983a5895a..31a59719a3 100644 --- a/indra/cmake/Meshoptimizer.cmake +++ b/indra/cmake/Meshoptimizer.cmake @@ -10,11 +10,11 @@ use_system_binary(meshoptimizer) use_prebuilt_binary(meshoptimizer) if (WINDOWS) - target_link_libraries( ll::meshoptimizer INTERFACE meshoptimizer.lib) + target_link_libraries( ll::meshoptimizer INTERFACE ${ARCH_PREBUILT_DIRS_RELEASE}/meshoptimizer.lib) elseif (LINUX) - target_link_libraries( ll::meshoptimizer INTERFACE libmeshoptimizer.a) + target_link_libraries( ll::meshoptimizer INTERFACE ${ARCH_PREBUILT_DIRS_RELEASE}/libmeshoptimizer.a) elseif (DARWIN) - target_link_libraries( ll::meshoptimizer INTERFACE libmeshoptimizer.a) + target_link_libraries( ll::meshoptimizer INTERFACE ${ARCH_PREBUILT_DIRS_RELEASE}/libmeshoptimizer.a) endif (WINDOWS) target_include_directories( ll::meshoptimizer SYSTEM INTERFACE ${LIBS_PREBUILT_DIR}/include/meshoptimizer) diff --git a/indra/cmake/NDOF.cmake b/indra/cmake/NDOF.cmake index db9c8b1780..4669f79647 100644 --- a/indra/cmake/NDOF.cmake +++ b/indra/cmake/NDOF.cmake @@ -14,9 +14,11 @@ if (NDOF) endif (WINDOWS OR DARWIN) if (WINDOWS) - target_link_libraries( ll::ndof INTERFACE libndofdev) - elseif (DARWIN OR LINUX) - target_link_libraries( ll::ndof INTERFACE ndofdev) + target_link_libraries( ll::ndof INTERFACE ${ARCH_PREBUILT_DIRS_RELEASE}/libndofdev.lib) + elseif (DARWIN) + target_link_libraries( ll::ndof INTERFACE ${ARCH_PREBUILT_DIRS_RELEASE}/libndofdev.dylib) + elseif (LINUX) + target_link_libraries( ll::ndof INTERFACE ${ARCH_PREBUILT_DIRS_RELEASE}/libndofdev.a) endif (WINDOWS) target_compile_definitions( ll::ndof INTERFACE LIB_NDOF=1) else() diff --git a/indra/cmake/OPENAL.cmake b/indra/cmake/OPENAL.cmake index 355907bcf5..1d6eca4439 100644 --- a/indra/cmake/OPENAL.cmake +++ b/indra/cmake/OPENAL.cmake @@ -30,8 +30,8 @@ if (USE_OPENAL) ) else() target_link_libraries( ll::openal INTERFACE - openal - alut + ${ARCH_PREBUILT_DIRS_RELEASE}/libopenal.dylib + ${ARCH_PREBUILT_DIRS_RELEASE}/libalut.dylib ) endif() endif () diff --git a/indra/cmake/OpenJPEG.cmake b/indra/cmake/OpenJPEG.cmake index c4aab2e9e5..07591d7785 100644 --- a/indra/cmake/OpenJPEG.cmake +++ b/indra/cmake/OpenJPEG.cmake @@ -7,5 +7,9 @@ add_library( ll::openjpeg INTERFACE IMPORTED ) use_system_binary(openjpeg) use_prebuilt_binary(openjpeg) +if(DARWIN) +target_link_libraries(ll::openjpeg INTERFACE ${ARCH_PREBUILT_DIRS_RELEASE}/libopenjp2.a ) +else() target_link_libraries(ll::openjpeg INTERFACE openjp2 ) +endif() target_include_directories( ll::openjpeg SYSTEM INTERFACE ${LIBS_PREBUILT_DIR}/include/openjpeg) diff --git a/indra/cmake/OpenSSL.cmake b/indra/cmake/OpenSSL.cmake index 67a84e14af..e58d8fb834 100644 --- a/indra/cmake/OpenSSL.cmake +++ b/indra/cmake/OpenSSL.cmake @@ -9,10 +9,13 @@ use_system_binary(openssl) use_prebuilt_binary(openssl) if (WINDOWS) target_link_libraries(ll::openssl INTERFACE ${ARCH_PREBUILT_DIRS_RELEASE}/libssl.lib ${ARCH_PREBUILT_DIRS_RELEASE}/libcrypto.lib Crypt32.lib) -elseif (LINUX) - target_link_libraries(ll::openssl INTERFACE ${ARCH_PREBUILT_DIRS_RELEASE}/libssl.a ${ARCH_PREBUILT_DIRS_RELEASE}/libcrypto.a dl) else() - target_link_libraries(ll::openssl INTERFACE ssl crypto) + target_link_libraries(ll::openssl INTERFACE ${ARCH_PREBUILT_DIRS_RELEASE}/libssl.a ${ARCH_PREBUILT_DIRS_RELEASE}/libcrypto.a) endif (WINDOWS) + +if(LINUX) + target_link_libraries(ll::openssl INTERFACE dl) +endif() + target_include_directories( ll::openssl SYSTEM INTERFACE ${LIBS_PREBUILT_DIR}/include) diff --git a/indra/cmake/Variables.cmake b/indra/cmake/Variables.cmake index 5dfad25577..778ce8934a 100644 --- a/indra/cmake/Variables.cmake +++ b/indra/cmake/Variables.cmake @@ -149,24 +149,6 @@ if (${CMAKE_SYSTEM_NAME} MATCHES "Darwin") set(CMAKE_XCODE_ATTRIBUTE_CLANG_CXX_LIBRARY "${CMAKE_MATCH_1}") message(STATUS "CMAKE_XCODE_ATTRIBUTE_CLANG_CXX_LIBRARY = '${CMAKE_XCODE_ATTRIBUTE_CLANG_CXX_LIBRARY}'") - string(REGEX MATCH " -g([^ ]*)" scratch "$ENV{LL_BUILD}") - set(CMAKE_XCODE_ATTRIBUTE_DEBUG_INFORMATION_FORMAT "${CMAKE_MATCH_1}") - # -gdwarf-2 is passed in LL_BUILD according to 00-COMPILE-LINK-RUN.txt. - # However, when CMake 3.9.2 sees -gdwarf-2, it silently deletes the whole -g - # switch, producing no symbols at all! The same thing happens if we specify - # plain -g ourselves, i.e. CMAKE_XCODE_ATTRIBUTE_DEBUG_INFORMATION_FORMAT is - # the empty string. Specifying -gdwarf-with-dsym or just -gdwarf drives a - # different CMake behavior: it substitutes plain -g. As of 2017-09-19, - # viewer-build-variables/variables still passes -gdwarf-2, which is the - # no-symbols case. Set -gdwarf, triggering CMake to substitute plain -g -- - # at least that way we should get symbols, albeit mangled ones. It Would Be - # Nice if CMake's behavior could be predicted from a consistent mental - # model, instead of only observed experimentally. - string(REPLACE "dwarf-2" "dwarf" - CMAKE_XCODE_ATTRIBUTE_DEBUG_INFORMATION_FORMAT - "${CMAKE_XCODE_ATTRIBUTE_DEBUG_INFORMATION_FORMAT}") - message(STATUS "CMAKE_XCODE_ATTRIBUTE_DEBUG_INFORMATION_FORMAT = '${CMAKE_XCODE_ATTRIBUTE_DEBUG_INFORMATION_FORMAT}'") - string(REGEX MATCH "-O([^ ]*)" scratch "$ENV{LL_BUILD}") set(CMAKE_XCODE_ATTRIBUTE_GCC_OPTIMIZATION_LEVEL "${CMAKE_MATCH_1}") message(STATUS "CMAKE_XCODE_ATTRIBUTE_GCC_OPTIMIZATION_LEVEL = '${CMAKE_XCODE_ATTRIBUTE_GCC_OPTIMIZATION_LEVEL}'") @@ -184,10 +166,18 @@ if (${CMAKE_SYSTEM_NAME} MATCHES "Darwin") endif() message(STATUS "CMAKE_OSX_SYSROOT = '${CMAKE_OSX_SYSROOT}'") + # Force debug symbol generation under xcode generator + set(CMAKE_XCODE_ATTRIBUTE_GCC_GENERATE_DEBUGGING_SYMBOLS YES) + set(CMAKE_XCODE_ATTRIBUTE_DEBUG_INFORMATION_FORMAT dwarf-with-dsym) + message(STATUS "CMAKE_XCODE_ATTRIBUTE_DEBUG_INFORMATION_FORMAT = '${CMAKE_XCODE_ATTRIBUTE_DEBUG_INFORMATION_FORMAT}'") + + # Strip dead code + set(CMAKE_XCODE_ATTRIBUTE_DEAD_CODE_STRIPPING YES) + set(CMAKE_XCODE_ATTRIBUTE_GCC_VERSION "com.apple.compilers.llvm.clang.1_0") set(CMAKE_XCODE_ATTRIBUTE_GCC_STRICT_ALIASING NO) set(CMAKE_XCODE_ATTRIBUTE_GCC_FAST_MATH NO) - set(CMAKE_XCODE_ATTRIBUTE_CLANG_X86_VECTOR_INSTRUCTIONS ssse3) + set(CMAKE_XCODE_ATTRIBUTE_CLANG_X86_VECTOR_INSTRUCTIONS sse4.2) # we must hard code this to off for now. xcode's built in signing does not # handle embedded app bundles such as CEF and others. Any signing for local # development must be done after the build as we do in viewer_manifest.py for @@ -200,6 +190,7 @@ if (${CMAKE_SYSTEM_NAME} MATCHES "Darwin") # "-" represents "Sign to Run Locally" and empty string represents "Do Not Sign" set(CMAKE_XCODE_ATTRIBUTE_CODE_SIGN_IDENTITY "") set(CMAKE_XCODE_ATTRIBUTE_CODE_SIGN_ENTITLEMENTS "") + set(CMAKE_XCODE_ATTRIBUTE_LD_WARN_DUPLICATE_LIBRARIES NO) set(CMAKE_XCODE_ATTRIBUTE_DISABLE_MANUAL_TARGET_ORDER_BUILD_WARNING YES) set(CMAKE_XCODE_ATTRIBUTE_GCC_WARN_64_TO_32_BIT_CONVERSION NO) set(CMAKE_OSX_ARCHITECTURES "${ARCH}") diff --git a/indra/cmake/WebRTC.cmake b/indra/cmake/WebRTC.cmake index 230522a40a..066bde109a 100644 --- a/indra/cmake/WebRTC.cmake +++ b/indra/cmake/WebRTC.cmake @@ -9,7 +9,7 @@ target_include_directories( ll::webrtc SYSTEM INTERFACE "${LIBS_PREBUILT_DIR}/in use_prebuilt_binary(webrtc) if (WINDOWS) - target_link_libraries( ll::webrtc INTERFACE webrtc.lib ) + target_link_libraries( ll::webrtc INTERFACE ${ARCH_PREBUILT_DIRS_RELEASE}/webrtc.lib ) elseif (DARWIN) FIND_LIBRARY(COREAUDIO_LIBRARY CoreAudio) FIND_LIBRARY(COREGRAPHICS_LIBRARY CoreGraphics) @@ -18,7 +18,7 @@ elseif (DARWIN) FIND_LIBRARY(COCOA_LIBRARY Cocoa) target_link_libraries( ll::webrtc INTERFACE - libwebrtc.a + ${ARCH_PREBUILT_DIRS_RELEASE}/libwebrtc.a ${COREAUDIO_LIBRARY} ${AUDIOTOOLBOX_LIBRARY} ${COREGRAPHICS_LIBRARY} @@ -26,7 +26,7 @@ elseif (DARWIN) ${COCOA_LIBRARY} ) elseif (LINUX) - target_link_libraries( ll::webrtc INTERFACE libwebrtc.a X11 ) + target_link_libraries( ll::webrtc INTERFACE ${ARCH_PREBUILT_DIRS_RELEASE}/libwebrtc.a X11 ) endif (WINDOWS) diff --git a/indra/llwindow/CMakeLists.txt b/indra/llwindow/CMakeLists.txt index 606d71a316..17a4f02695 100644 --- a/indra/llwindow/CMakeLists.txt +++ b/indra/llwindow/CMakeLists.txt @@ -12,6 +12,7 @@ project(llwindow) include(00-Common) include(DragDrop) +include(Linking) include(LLCommon) include(LLImage) include(LLWindow) @@ -181,7 +182,5 @@ endif (SDL2_FOUND) target_include_directories(llwindow INTERFACE ${CMAKE_CURRENT_SOURCE_DIR}) if (DARWIN) - include(CMakeFindFrameworks) - find_library(CARBON_LIBRARY Carbon) target_link_libraries(llwindow ${CARBON_LIBRARY}) endif (DARWIN) From fda95c737d54536b57c0c8acfa7c890835b6f48c Mon Sep 17 00:00:00 2001 From: Rye Date: Fri, 15 Nov 2024 23:14:36 -0500 Subject: [PATCH 10/23] Clean up old __GNUC__ compiler hacks --- indra/llaudio/llvorbisencode.cpp | 32 ----------------------------- indra/llcommon/lldate.cpp | 4 ---- indra/llcommon/llsdserialize.cpp | 4 ---- indra/llcommon/llstl.h | 10 --------- indra/llmessage/llbufferstream.cpp | 11 ---------- indra/llmessage/llbufferstream.h | 9 -------- indra/llrender/llgl.cpp | 11 ---------- indra/newview/llviewerjointmesh.cpp | 6 ------ 8 files changed, 87 deletions(-) diff --git a/indra/llaudio/llvorbisencode.cpp b/indra/llaudio/llvorbisencode.cpp index 83e7fad92f..d115dc309d 100644 --- a/indra/llaudio/llvorbisencode.cpp +++ b/indra/llaudio/llvorbisencode.cpp @@ -34,38 +34,6 @@ #include "llmath.h" #include "llapr.h" -//#if LL_DARWIN -// MBW -- XXX -- Getting rid of SecondLifeVorbis for now -#if 0 -#include "VorbisFramework.h" - -#define vorbis_analysis mac_vorbis_analysis -#define vorbis_analysis_headerout mac_vorbis_analysis_headerout -#define vorbis_analysis_init mac_vorbis_analysis_init -#define vorbis_encode_ctl mac_vorbis_encode_ctl -#define vorbis_encode_setup_init mac_vorbis_encode_setup_init -#define vorbis_encode_setup_managed mac_vorbis_encode_setup_managed - -#define vorbis_info_init mac_vorbis_info_init -#define vorbis_info_clear mac_vorbis_info_clear -#define vorbis_comment_init mac_vorbis_comment_init -#define vorbis_comment_clear mac_vorbis_comment_clear -#define vorbis_block_init mac_vorbis_block_init -#define vorbis_block_clear mac_vorbis_block_clear -#define vorbis_dsp_clear mac_vorbis_dsp_clear -#define vorbis_analysis_buffer mac_vorbis_analysis_buffer -#define vorbis_analysis_wrote mac_vorbis_analysis_wrote -#define vorbis_analysis_blockout mac_vorbis_analysis_blockout - -#define ogg_stream_packetin mac_ogg_stream_packetin -#define ogg_stream_init mac_ogg_stream_init -#define ogg_stream_flush mac_ogg_stream_flush -#define ogg_stream_pageout mac_ogg_stream_pageout -#define ogg_page_eos mac_ogg_page_eos -#define ogg_stream_clear mac_ogg_stream_clear - -#endif - S32 check_for_invalid_wav_formats(const std::string& in_fname, std::string& error_msg) { U16 num_channels = 0; diff --git a/indra/llcommon/lldate.cpp b/indra/llcommon/lldate.cpp index 5f51f40232..7c8911cb36 100644 --- a/indra/llcommon/lldate.cpp +++ b/indra/llcommon/lldate.cpp @@ -124,11 +124,7 @@ void LLDate::toStream(std::ostream& s) const } s << std::dec << std::setfill('0'); -#if( LL_WINDOWS || __GNUC__ > 2) s << std::right; -#else - s.setf(ios::right); -#endif s << std::setw(4) << (exp_time.tm_year + 1900) << '-' << std::setw(2) << (exp_time.tm_mon + 1) << '-' << std::setw(2) << (exp_time.tm_mday) diff --git a/indra/llcommon/llsdserialize.cpp b/indra/llcommon/llsdserialize.cpp index 37af366a20..71b88190dd 100644 --- a/indra/llcommon/llsdserialize.cpp +++ b/indra/llcommon/llsdserialize.cpp @@ -1424,11 +1424,7 @@ S32 LLSDNotationFormatter::format_impl(const LLSD& data, std::ostream& ostr, case LLSD::TypeBoolean: if(mBoolAlpha || -#if( LL_WINDOWS || __GNUC__ > 2) (ostr.flags() & std::ios::boolalpha) -#else - (ostr.flags() & 0x0100) -#endif ) { ostr << (data.asBoolean() diff --git a/indra/llcommon/llstl.h b/indra/llcommon/llstl.h index 7d41c42ba7..fb387a7b52 100644 --- a/indra/llcommon/llstl.h +++ b/indra/llcommon/llstl.h @@ -522,18 +522,8 @@ llbind2nd(const _Operation& __oper, const _Tp& __x) inline bool before(const std::type_info* lhs, const std::type_info* rhs) { -#if LL_LINUX && defined(__GNUC__) && ((__GNUC__ < 4) || (__GNUC__ == 4 && __GNUC_MINOR__ < 4)) - // If we're building on Linux with gcc, and it's either gcc 3.x or - // 4.{0,1,2,3}, then we have to use a workaround. Note that we use gcc on - // Mac too, and some people build with gcc on Windows (cygwin or mingw). - // On Linux, different load modules may produce different type_info* - // pointers for the same type. Have to compare name strings to get good - // results. - return strcmp(lhs->name(), rhs->name()) < 0; -#else // not Linux, or gcc 4.4+ // Just use before(), as we normally would return lhs->before(*rhs); -#endif } /** diff --git a/indra/llmessage/llbufferstream.cpp b/indra/llmessage/llbufferstream.cpp index 2c745f6fe4..cb5a4c1824 100644 --- a/indra/llmessage/llbufferstream.cpp +++ b/indra/llmessage/llbufferstream.cpp @@ -234,17 +234,10 @@ int LLBufferStreamBuf::sync() } // virtual -#if( LL_WINDOWS || __GNUC__ > 2) LLBufferStreamBuf::pos_type LLBufferStreamBuf::seekoff( LLBufferStreamBuf::off_type off, std::ios::seekdir way, std::ios::openmode which) -#else -streampos LLBufferStreamBuf::seekoff( - streamoff off, - std::ios::seekdir way, - std::ios::openmode which) -#endif { if(!mBuffer || ((way == std::ios::beg) && (off < 0)) @@ -319,12 +312,8 @@ streampos LLBufferStreamBuf::seekoff( } } -#if( LL_WINDOWS || __GNUC__ > 2 ) S32 rv = (S32)(intptr_t)address; return (pos_type)rv; -#else - return (streampos)address; -#endif } diff --git a/indra/llmessage/llbufferstream.h b/indra/llmessage/llbufferstream.h index ac1aa49e81..e0a7d8c642 100644 --- a/indra/llmessage/llbufferstream.h +++ b/indra/llmessage/llbufferstream.h @@ -48,10 +48,8 @@ class LLBufferStreamBuf : public std::streambuf virtual ~LLBufferStreamBuf(); protected: -#if( LL_WINDOWS || __GNUC__ > 2 ) typedef std::streambuf::pos_type pos_type; typedef std::streambuf::off_type off_type; -#endif /* @name streambuf vrtual implementations */ @@ -87,17 +85,10 @@ class LLBufferStreamBuf : public std::streambuf * or both masked together. * @return Returns the new position or an invalid position on failure. */ -#if( LL_WINDOWS || __GNUC__ > 2) virtual pos_type seekoff( off_type off, std::ios::seekdir way, std::ios::openmode which); -#else - virtual streampos seekoff( - streamoff off, - std::ios::seekdir way, - std::ios::openmode which); -#endif /* * @brief Get s sequence of characters from the input diff --git a/indra/llrender/llgl.cpp b/indra/llrender/llgl.cpp index efa27dcda7..779fde6d56 100644 --- a/indra/llrender/llgl.cpp +++ b/indra/llrender/llgl.cpp @@ -1116,17 +1116,6 @@ bool LLGLManager::initGL() if (mGLVersion >= 2.f) { parse_glsl_version(mGLSLVersionMajor, mGLSLVersionMinor); - -#if 0 && LL_DARWIN - // TODO maybe switch to using a core profile for GL 3.2? - // https://stackoverflow.com/a/19868861 - //never use GLSL greater than 1.20 on OSX - if (mGLSLVersionMajor > 1 || mGLSLVersionMinor > 30) - { - mGLSLVersionMajor = 1; - mGLSLVersionMinor = 30; - } -#endif } if (mGLVersion >= 2.1f && LLImageGL::sCompressTextures) diff --git a/indra/newview/llviewerjointmesh.cpp b/indra/newview/llviewerjointmesh.cpp index da7ad71336..270b12109c 100644 --- a/indra/newview/llviewerjointmesh.cpp +++ b/indra/newview/llviewerjointmesh.cpp @@ -56,12 +56,6 @@ #include "llmatrix4a.h" #include "llperfstats.h" -#if !LL_DARWIN && !LL_LINUX -extern PFNGLWEIGHTPOINTERARBPROC glWeightPointerARB; -extern PFNGLWEIGHTFVARBPROC glWeightfvARB; -extern PFNGLVERTEXBLENDARBPROC glVertexBlendARB; -#endif - //----------------------------------------------------------------------------- //----------------------------------------------------------------------------- // LLViewerJointMesh From 09334683af2ad1609a87660c6ef24b02d5667500 Mon Sep 17 00:00:00 2001 From: Rye Date: Thu, 12 Dec 2024 09:23:52 -0800 Subject: [PATCH 11/23] Introduce basic ARM64 build support for apple silicon with libraries updated and rebuilt with universal support --- autobuild.xml | 366 ++++++++++-------- indra/cmake/00-Common.cmake | 8 +- indra/cmake/APR.cmake | 21 +- indra/cmake/CMakeLists.txt | 1 + indra/cmake/Copy3rdPartyLibs.cmake | 28 -- indra/cmake/LLAddBuildTest.cmake | 14 +- indra/cmake/SSE2NEON.cmake | 12 + indra/cmake/Variables.cmake | 41 +- indra/llcommon/CMakeLists.txt | 9 +- indra/llcommon/llfasttimer.cpp | 2 +- indra/llcommon/llfasttimer.h | 66 ++-- indra/llcommon/llmemory.h | 10 +- indra/llcommon/llpreprocessor.h | 15 +- indra/llcommon/llprocessor.h | 13 +- indra/llkdu/CMakeLists.txt | 8 - indra/llkdu/llimagej2ckdu.cpp | 10 + indra/llkdu/llimagej2ckdu.h | 10 + indra/llkdu/llkdumem.h | 10 + indra/llmath/CMakeLists.txt | 4 +- indra/llmath/llsimdmath.h | 6 +- indra/llplugin/slplugin/CMakeLists.txt | 30 +- indra/llwebrtc/CMakeLists.txt | 6 +- .../media_plugins/base/media_plugin_base.cpp | 4 +- indra/media_plugins/cef/CMakeLists.txt | 13 +- indra/media_plugins/example/CMakeLists.txt | 1 + indra/media_plugins/libvlc/CMakeLists.txt | 1 + indra/newview/CMakeLists.txt | 40 +- indra/newview/llappviewer.cpp | 10 +- indra/newview/pipeline.cpp | 2 +- indra/newview/viewer_manifest.py | 49 +-- 30 files changed, 452 insertions(+), 358 deletions(-) create mode 100644 indra/cmake/SSE2NEON.cmake diff --git a/autobuild.xml b/autobuild.xml index 04838268e2..41ec8d45a7 100644 --- a/autobuild.xml +++ b/autobuild.xml @@ -26,11 +26,11 @@ archive hash - 3f2f65cb135cd9d4704371eaf6d973517c372161 + a6aa829c1e7f193b624f05415588e4d727454c8f hash_algorithm sha1 url - https://github.com/secondlife/3p-sdl2/releases/download/v2.30.8-r1/SDL2-2.30.8-darwin64-11540565100.tar.zst + https://github.com/secondlife/3p-sdl2/releases/download/v2.30.9-r1/SDL2-2.30.9-r1-darwin64-11943333704.tar.zst name darwin64 @@ -40,11 +40,11 @@ archive hash - 27a431140f6f3f12f00b6a38f741fab43caa7708 + ad1b738a7cef16d5cec63ab99b1c80146626f47b hash_algorithm sha1 url - https://github.com/secondlife/3p-sdl2/releases/download/v2.30.8-r1/SDL2-2.30.8-linux64-11540565100.tar.zst + https://github.com/secondlife/3p-sdl2/releases/download/v2.30.9-r1/SDL2-2.30.9-r1-linux64-11943333704.tar.zst name linux64 @@ -54,18 +54,18 @@ archive hash - f3485e4a02a7e8ba899e17cdc9ff0aaad661fcc1 + 97153f9d302f964142df971b57680724824f458f hash_algorithm sha1 url - https://github.com/secondlife/3p-sdl2/releases/download/v2.30.8-r1/SDL2-2.30.8-windows64-11540565100.tar.zst + https://github.com/secondlife/3p-sdl2/releases/download/v2.30.9-r1/SDL2-2.30.9-r1-windows64-11943333704.tar.zst name windows64 version - 2.30.8 + 2.30.9-r1 apr_suite @@ -76,11 +76,11 @@ archive hash - 579a46d77802e301856c93792d39d43bbf939987 + a21487f4e3a68721fd97edef117795a1b7212a77 hash_algorithm sha1 url - https://github.com/secondlife/3p-apr_suite/releases/download/v1.7.4-r2/apr_suite-1.7.4-10338381102-darwin64-10338381102.tar.zst + https://github.com/secondlife/3p-apr_suite/releases/download/v1.7.5-r1/apr_suite-1.7.5-12259255574-darwin64-12259255574.tar.zst name darwin64 @@ -90,11 +90,11 @@ archive hash - 2e5cf11f8774023408402df860d3d1f4a6668500 + 45baf82d3366734e542a2a3749f495b64f5513b4 hash_algorithm sha1 url - https://github.com/secondlife/3p-apr_suite/releases/download/v1.7.4-r2/apr_suite-1.7.4-10338381102-linux64-10338381102.tar.zst + https://github.com/secondlife/3p-apr_suite/releases/download/v1.7.5-r1/apr_suite-1.7.5-12259255574-linux64-12259255574.tar.zst name linux64 @@ -104,11 +104,11 @@ archive hash - 7eb6b8f294c4563a07fec3578be2d04af17a60cb + bdd35d3b9580d3cdcb98afae639936aaa40e24c4 hash_algorithm sha1 url - https://github.com/secondlife/3p-apr_suite/releases/download/v1.7.4-r2/apr_suite-1.7.4-10338381102-windows64-10338381102.tar.zst + https://github.com/secondlife/3p-apr_suite/releases/download/v1.7.5-r1/apr_suite-1.7.5-12259255574-windows64-12259255574.tar.zst name windows64 @@ -121,7 +121,7 @@ copyright Copyright © 2012 The Apache Software Foundation, Licensed under the Apache License, Version 2.0. version - 1.7.4-10338381102 + 1.7.5-12259255574 name apr_suite description @@ -146,11 +146,11 @@ archive hash - 6bf5f4afddf87d48c069d781b5ef2d44d6ddf2d5 + 320a8b76b1d30e5c1e7095c0c8315e8d0b68cbc5 hash_algorithm sha1 url - https://github.com/secondlife/3p-boost/releases/download/v1.86.0-e2bee1e/boost-1.86-darwin64-10475904468.tar.zst + https://github.com/secondlife/3p-boost/releases/download/v1.86.0-dfe318c/boost-1.86-darwin64-11977000894.tar.zst name darwin64 @@ -160,11 +160,11 @@ archive hash - 3c0ba2a87e78d76c81da95fa87579bf4964242e1 + 589a3577448190f87dc1c3bb8149ff57780772d8 hash_algorithm sha1 url - https://github.com/secondlife/3p-boost/releases/download/v1.86.0-e2bee1e/boost-1.86-linux64-10475904468.tar.zst + https://github.com/secondlife/3p-boost/releases/download/v1.86.0-dfe318c/boost-1.86-linux64-11977000894.tar.zst name linux64 @@ -174,11 +174,11 @@ archive hash - d1dd5d629b254d1b361c5a0fa210b5f3283e8a20 + 28a268d88e26f081bc2341400ca6a5bc72ac78a8 hash_algorithm sha1 url - https://github.com/secondlife/3p-boost/releases/download/v1.86.0-e2bee1e/boost-1.86-windows64-10475904468.tar.zst + https://github.com/secondlife/3p-boost/releases/download/v1.86.0-dfe318c/boost-1.86-windows64-11977000894.tar.zst name windows64 @@ -250,11 +250,11 @@ archive hash - 18b46ce8ebb5ae6ef6527b4e95408433e29ad3f4 + 3a8de0ed0611279bd393df1cb224dfd3bbb907b7 hash_algorithm sha1 url - https://github.com/secondlife/3p-colladadom/releases/download/v2.3-r8/colladadom-2.3.0-r8-darwin64-10476582237.tar.zst + https://github.com/secondlife/3p-colladadom/releases/download/v2.3-r9/colladadom-2.3.0-r9-darwin64-12258978859.tar.zst name darwin64 @@ -264,11 +264,11 @@ archive hash - c088fe0be9ce7e42983c3c7708abe4ac8bd5a894 + c2cc015c86536cb4a77d909af1644e54a031ee6f hash_algorithm sha1 url - https://github.com/secondlife/3p-colladadom/releases/download/v2.3-r8/colladadom-2.3.0-r8-linux64-10476582237.tar.zst + https://github.com/secondlife/3p-colladadom/releases/download/v2.3-r9/colladadom-2.3.0-r9-linux64-12258978859.tar.zst name linux64 @@ -278,18 +278,18 @@ archive hash - 8bfa9f1a78d077f3bd422f14ae360150b98c82f9 + c4807fd3352e6c175f7a28128e0269e524b051cb hash_algorithm sha1 url - https://github.com/secondlife/3p-colladadom/releases/download/v2.3-r8/colladadom-2.3.0-r8-windows64-10476582237.tar.zst + https://github.com/secondlife/3p-colladadom/releases/download/v2.3-r9/colladadom-2.3.0-r9-windows64-12258978859.tar.zst name windows64 version - 2.3.0-r8 + 2.3.0-r9 cubemaptoequirectangular @@ -358,11 +358,11 @@ archive hash - 9c74adfd217fcc04869ef574078bc56a4a1380f3 + 4f2f5ea4de2891d2ffcc707f984729ddb523d5e1 hash_algorithm sha1 url - https://github.com/secondlife/3p-curl/releases/download/v7.54.1-r1/curl-7.54.1-10342910827-darwin64-10342910827.tar.zst + https://github.com/secondlife/3p-curl/releases/download/v7.54.1-r2/curl-7.54.1-12258966289-darwin64-12258966289.tar.zst name darwin64 @@ -372,11 +372,11 @@ archive hash - 325ad581a1ba99fbc1e74d48481e07546eaf1e0e + a4d6303c59f9c9760c5243b6d4d7b7b199ba9356 hash_algorithm sha1 url - https://github.com/secondlife/3p-curl/releases/download/v7.54.1-r1/curl-7.54.1-10342910827-linux64-10342910827.tar.zst + https://github.com/secondlife/3p-curl/releases/download/v7.54.1-r2/curl-7.54.1-12258966289-linux64-12258966289.tar.zst name linux64 @@ -386,11 +386,11 @@ archive hash - 794480208e72a928552760cd048438b90aa1c80d + ec0d4717e4b841107b19cab7bd705f327a89f397 hash_algorithm sha1 url - https://github.com/secondlife/3p-curl/releases/download/v7.54.1-r1/curl-7.54.1-10342910827-windows64-10342910827.tar.zst + https://github.com/secondlife/3p-curl/releases/download/v7.54.1-r2/curl-7.54.1-12258966289-windows64-12258966289.tar.zst name windows64 @@ -403,7 +403,7 @@ copyright Copyright (c) 1996 - 2014, Daniel Stenberg, (daniel@haxx.se). version - 7.54.1-10342910827 + 7.54.1-12258966289 name curl description @@ -544,11 +544,11 @@ archive hash - 8cc4f38fd809d9ff5d8ca617d7e068eb236f4162 + e0ba69946f2203c03faf89c1f6d5bbc48d88d2a9 hash_algorithm sha1 url - https://github.com/secondlife/3p-expat/releases/download/v2.6.2-r5/expat-2.6.2-r5-darwin64-10337781902.tar.zst + https://github.com/secondlife/3p-expat/releases/download/v2.6.4-r1/expat-2.6.4-r1-darwin64-11943227858.tar.zst name darwin64 @@ -558,11 +558,11 @@ archive hash - d7f3bbfd65fce365c3cd5be9ab72072580408dec + 13483477c1f8b4bad9055fba561c64137453c3da hash_algorithm sha1 url - https://github.com/secondlife/3p-expat/releases/download/v2.6.2-r5/expat-2.6.2-r5-linux64-10337781902.tar.zst + https://github.com/secondlife/3p-expat/releases/download/v2.6.4-r1/expat-2.6.4-r1-linux64-11943227858.tar.zst name linux64 @@ -572,11 +572,11 @@ archive hash - f11d91205bb753d7389a73e629627b200219c62f + 542af7d8bb8de3297c80c23a771bbcb513a630b7 hash_algorithm sha1 url - https://github.com/secondlife/3p-expat/releases/download/v2.6.2-r5/expat-2.6.2-r5-windows64-10337781902.tar.zst + https://github.com/secondlife/3p-expat/releases/download/v2.6.4-r1/expat-2.6.4-r1-windows64-11943227858.tar.zst name windows64 @@ -589,7 +589,7 @@ copyright Copyright (c) 1998-2000 Thai Open Source Software Center Ltd and Clark Cooper - Copyright (c) 2001-2022 Expat maintainers. version - 2.6.2-r5 + 2.6.4-r1 name expat description @@ -614,11 +614,11 @@ archive hash - 51ad743c8943602913eedd2b6e2309abf46849d8 + e079a1b6f47d02ed63ca5cffec79ac75532f6eaf hash_algorithm sha1 url - https://github.com/secondlife/3p-freetype/releases/download/v2.13.3-cb2e120/freetype-2.13.3-cb2e120-darwin64-10475886095.tar.zst + https://github.com/secondlife/3p-freetype/releases/download/v2.13.3-r2/freetype-2.13.3-r2-darwin64-12259007838.tar.zst name darwin64 @@ -628,11 +628,11 @@ archive hash - bc27e272e004dc2fc573550e8c1cd8b4ad07f5b2 + 6e33a17fb9360a670dfbac51efbe5f4c2bb88c81 hash_algorithm sha1 url - https://github.com/secondlife/3p-freetype/releases/download/v2.13.3-cb2e120/freetype-2.13.3-cb2e120-linux64-10475886095.tar.zst + https://github.com/secondlife/3p-freetype/releases/download/v2.13.3-r2/freetype-2.13.3-r2-linux64-12259007838.tar.zst name linux64 @@ -642,18 +642,18 @@ archive hash - 01971b998122a17c97e3616c428cc77077a0c39a + 6a543ab76d8e2095f811e46cf4e8a2f454934f77 hash_algorithm sha1 url - https://github.com/secondlife/3p-freetype/releases/download/v2.13.3-cb2e120/freetype-2.13.3-cb2e120-windows64-10475886095.tar.zst + https://github.com/secondlife/3p-freetype/releases/download/v2.13.3-r2/freetype-2.13.3-r2-windows64-12259007838.tar.zst name windows64 version - 2.13.3-cb2e120 + 2.13.3-r2 glext @@ -894,11 +894,11 @@ archive hash - 34cf4fdbbc999e67b0528f7ca3c7f31f35267ecf + 10f14875ce5c7f5028217c8b7468733190fd333d hash_algorithm sha1 url - https://github.com/secondlife/3p-libjpeg-turbo/releases/download/v3.0.3-r2/libjpeg_turbo-3.0.3-r2-windows64-10341191820.tar.zst + https://github.com/secondlife/3p-libjpeg-turbo/releases/download/v3.0.4-r1/libjpeg_turbo-3.0.4-r1-windows64-11968659895.tar.zst name windows64 @@ -908,11 +908,11 @@ archive hash - 5ff05a0e5ed0aba1514b84d3c2edaf70c18738b5 + d3b1b0fde28c8cf0c33fed167dba87bba5c6cc64 hash_algorithm sha1 url - https://github.com/secondlife/3p-libjpeg-turbo/releases/download/v3.0.3-r2/libjpeg_turbo-3.0.3-r2-linux64-10341191820.tar.zst + https://github.com/secondlife/3p-libjpeg-turbo/releases/download/v3.0.4-r1/libjpeg_turbo-3.0.4-r1-linux64-11968659895.tar.zst name linux64 @@ -922,11 +922,11 @@ archive hash - 7c38eabc050b4a6bdb183a1d7a38da885341049c + 79e78cbaaec9a99c0ae4a5cdd4a98535c8fa3c6d hash_algorithm sha1 url - https://github.com/secondlife/3p-libjpeg-turbo/releases/download/v3.0.3-r2/libjpeg_turbo-3.0.3-r2-darwin64-10341191820.tar.zst + https://github.com/secondlife/3p-libjpeg-turbo/releases/download/v3.0.4-r1/libjpeg_turbo-3.0.4-r1-darwin64-11968659895.tar.zst name darwin64 @@ -939,7 +939,7 @@ copyright Copyright (C)2009-2024 D. R. Commander. All Rights Reserved. Copyright (C)2015 Viktor Szathmáry. All Rights Reserved. version - 3.0.3-r2 + 3.0.4-r1 name libjpeg-turbo canonical_repo @@ -958,11 +958,11 @@ creds github hash - 243709fbbb58a91dca81d16df650e9c6ff910d0d + da318f0813e4126d90e35b22a8dce235e908707a hash_algorithm sha1 url - https://api.github.com/repos/secondlife/3p-kdu/releases/assets/202118207 + https://api.github.com/repos/secondlife/3p-kdu/releases/assets/208381808 name darwin64 @@ -974,11 +974,11 @@ creds github hash - 7fd0a7ee71a4e76b49e31b75f8622852324d58a4 + 1ba58cf884726dfdf02a7662d52f1befe3f16d44 hash_algorithm sha1 url - https://api.github.com/repos/secondlife/3p-kdu/releases/assets/202118208 + https://api.github.com/repos/secondlife/3p-kdu/releases/assets/208381812 name linux64 @@ -990,11 +990,11 @@ creds github hash - 8c475dd9616c7e0e3029cc38aefc1e0ab34d2e73 + e8d693089b9ecd15b6644f13ada7ae7c317944df hash_algorithm sha1 url - https://api.github.com/repos/secondlife/3p-kdu/releases/assets/202118209 + https://api.github.com/repos/secondlife/3p-kdu/releases/assets/208381814 name windows64 @@ -1007,7 +1007,7 @@ copyright Kakadu software version - 8.4.1.11540433907 + 8.4.1.11976899217 name kdu description @@ -1022,11 +1022,11 @@ archive hash - e71ae7a645603fe967a69aa5beb5b3009185e177 + 91acd05f450162b07ca2f68094778c483d28128d hash_algorithm sha1 url - https://github.com/secondlife/3p-libhunspell/releases/download/v1.7.2-r1/libhunspell-1.7.2.10207243663-darwin64-10207243663.tar.zst + https://github.com/secondlife/3p-libhunspell/releases/download/v1.7.2-r2/libhunspell-1.7.2.11968900321-darwin64-11968900321.tar.zst name darwin64 @@ -1036,11 +1036,11 @@ archive hash - 275ffb7f60064d8008aed8406f80f34229f651fc + 10e5b5d793c3c5cb5335dea89734302bda5a9f59 hash_algorithm sha1 url - https://github.com/secondlife/3p-libhunspell/releases/download/v1.7.2-r1/libhunspell-1.7.2.10207243663-linux64-10207243663.tar.zst + https://github.com/secondlife/3p-libhunspell/releases/download/v1.7.2-r2/libhunspell-1.7.2.11968900321-linux64-11968900321.tar.zst name linux64 @@ -1050,11 +1050,11 @@ archive hash - 89ff24e93eaeca7949ccdb5cc368f938f5b1f307 + 0f7b9c46dc4e81a6296e4836467f5fe52aa5761d hash_algorithm sha1 url - https://github.com/secondlife/3p-libhunspell/releases/download/v1.7.2-r1/libhunspell-1.7.2.10207243663-windows64-10207243663.tar.zst + https://github.com/secondlife/3p-libhunspell/releases/download/v1.7.2-r2/libhunspell-1.7.2.11968900321-windows64-11968900321.tar.zst name windows64 @@ -1067,7 +1067,7 @@ copyright LGPL 2.1 version - 1.7.2.10207243663 + 1.7.2.11968900321 name libhunspell description @@ -1082,11 +1082,11 @@ archive hash - e3dd320c90e67e0c80caf4d4df23257b0196dfb6 + d1638886671b31935ea7e3c824e015ea1a45b12e hash_algorithm sha1 url - https://github.com/secondlife/3p-libndofdev/releases/download/v0.1.8e9edc7/libndofdev-0.1.8e9edc7-darwin64-8e9edc7.tar.zst + https://github.com/secondlife/3p-libndofdev/releases/download/v0.1.a0b7d99/libndofdev-0.1.11968678219-darwin64-11968678219.tar.zst name darwin64 @@ -1096,11 +1096,11 @@ archive hash - ae9d554e8839f42230b8ed6c850445d54654a38f + 7b3e504885c4c0cc75db298e682f408c4f2e95f7 hash_algorithm sha1 url - https://github.com/secondlife/3p-libndofdev/releases/download/v0.1.8e9edc7/libndofdev-0.1.8e9edc7-windows64-8e9edc7.tar.zst + https://github.com/secondlife/3p-libndofdev/releases/download/v0.1.a0b7d99/libndofdev-0.1.11968678219-windows64-11968678219.tar.zst name windows64 @@ -1113,7 +1113,7 @@ copyright Copyright (c) 2007, 3Dconnexion, Inc. - All rights reserved. version - 0.1.8e9edc7 + 0.1.11968678219 name libndofdev description @@ -1128,11 +1128,11 @@ archive hash - 6fe46ed1e2e40616abdacf7115e510645d5f62e7 + 75ff1513c5527a541bac0b685a90a49afb086156 hash_algorithm sha1 url - https://github.com/secondlife/3p-libpng/releases/download/v1.6.43-r2/libpng-1.6.43-r2-darwin64-10329429325.tar.zst + https://github.com/secondlife/3p-libpng/releases/download/v1.6.44-r1/libpng-1.6.44-r1-darwin64-11965237099.tar.zst name darwin64 @@ -1142,11 +1142,11 @@ archive hash - b54a4710d9c3ddfa044e1d29f9c38974e9fc645d + 23967758d45afc1e2243c3669ca045945de588a7 hash_algorithm sha1 url - https://github.com/secondlife/3p-libpng/releases/download/v1.6.43-r2/libpng-1.6.43-r2-linux64-10329429325.tar.zst + https://github.com/secondlife/3p-libpng/releases/download/v1.6.44-r1/libpng-1.6.44-r1-linux64-11965237099.tar.zst name linux64 @@ -1156,11 +1156,11 @@ archive hash - eddb96c73c8916bf71eaa5d0edb812d20e72c255 + 19ac0a301438a0cbe8cb65179ce9e130f5fd827a hash_algorithm sha1 url - https://github.com/secondlife/3p-libpng/releases/download/v1.6.43-r2/libpng-1.6.43-r2-windows64-10329429325.tar.zst + https://github.com/secondlife/3p-libpng/releases/download/v1.6.44-r1/libpng-1.6.44-r1-windows64-11965237099.tar.zst name windows64 @@ -1173,7 +1173,7 @@ copyright Copyright (c) 2004, 2006-2013 Glenn Randers-Pehrson version - 1.6.43-r2 + 1.6.44-r1 name libpng description @@ -1188,11 +1188,11 @@ archive hash - b2bf9adc84841b6fcf48d4c00787b221607cdea3 + a7062e4feef42461b9acb4bfcef99bea5c89945e hash_algorithm sha1 url - https://github.com/secondlife/3p-libxml2/releases/download/v2.13.3-r1/libxml2-2.13.3-r1-darwin64-10329675166.tar.zst + https://github.com/secondlife/3p-libxml2/releases/download/v2.13.5-r1/libxml2-2.13.5-r1-darwin64-11967192668.tar.zst name darwin64 @@ -1202,11 +1202,11 @@ archive hash - 6ab8108ea0a42e0bd462568c495e5ce5c4cdc0ff + 991aad5931d5f05e43b8750ad81ae59ac6013e59 hash_algorithm sha1 url - https://github.com/secondlife/3p-libxml2/releases/download/v2.13.3-r1/libxml2-2.13.3-r1-linux64-10329675166.tar.zst + https://github.com/secondlife/3p-libxml2/releases/download/v2.13.5-r1/libxml2-2.13.5-r1-linux64-11967192668.tar.zst name linux64 @@ -1216,11 +1216,11 @@ archive hash - 5181bd267de3ad4466227f91c7e2cbed7e8b85d9 + 4c00019229adc761673808567b8dcd64c7ba4a85 hash_algorithm sha1 url - https://github.com/secondlife/3p-libxml2/releases/download/v2.13.3-r1/libxml2-2.13.3-r1-windows64-10329675166.tar.zst + https://github.com/secondlife/3p-libxml2/releases/download/v2.13.5-r1/libxml2-2.13.5-r1-windows64-11967192668.tar.zst name windows64 @@ -1233,7 +1233,7 @@ copyright Copyright (C) 1998-2012 Daniel Veillard. All Rights Reserved. version - 2.13.3-r1 + 2.13.5-r1 name libxml2 description @@ -1477,11 +1477,11 @@ archive hash - e48f291e2eeb1dbab39f26db5ac9b4c2b2d1c57d + 6aa836b031acb58b840b0ae5906703540f77c648 hash_algorithm sha1 url - https://github.com/secondlife/3p-luau/releases/download/v0.638-r2/luau-0.638.0-r2-darwin64-10356321602.tar.zst + https://github.com/secondlife/3p-luau/releases/download/v0.652-r1/luau-0.652.0-r1-darwin64-11968938038.tar.zst name darwin64 @@ -1491,11 +1491,11 @@ archive hash - 3a797d8dae685b25ca787111a370b99d9e57d77c + 8687e1a5926205e27bc22100f95eeff84d36ac0b hash_algorithm sha1 url - https://github.com/secondlife/3p-luau/releases/download/v0.638-r2/luau-0.638.0-r2-linux64-10356321602.tar.zst + https://github.com/secondlife/3p-luau/releases/download/v0.652-r1/luau-0.652.0-r1-linux64-11968938038.tar.zst name linux64 @@ -1505,11 +1505,11 @@ archive hash - a8857313496622134b00899141bbe6542f754164 + c651f6ee6a6a896fa4f5e1a37cc57830bb448a5a hash_algorithm sha1 url - https://github.com/secondlife/3p-luau/releases/download/v0.638-r2/luau-0.638.0-r2-windows64-10356321602.tar.zst + https://github.com/secondlife/3p-luau/releases/download/v0.652-r1/luau-0.652.0-r1-windows64-11968938038.tar.zst name windows64 @@ -1522,7 +1522,7 @@ copyright Copyright (c) 2019-2023 Roblox Corporation, Copyright (c) 1994–2019 Lua.org, PUC-Rio. version - 0.638.0-r2 + 0.652.0-r1 name luau description @@ -1563,11 +1563,11 @@ archive hash - d79631d845e2b5e4a9e6f6b660310795fd49023e + 874a7d2bc843554aa4facd03b3a6d681f2b5150c hash_algorithm sha1 url - https://github.com/secondlife/3p-meshoptimizer/releases/download/v210-r2/meshoptimizer-210.0.0-r2-darwin64-10341021290.tar.zst + https://github.com/secondlife/3p-meshoptimizer/releases/download/v220-r1/meshoptimizer-220.0.0-r1-darwin64-11968851109.tar.zst name darwin64 @@ -1577,11 +1577,11 @@ archive hash - c947107c0aca46e94e22f66328a3cbbd01d99b36 + 31a537f1a3d38ef85443214315111dd56a534d9a hash_algorithm sha1 url - https://github.com/secondlife/3p-meshoptimizer/releases/download/v210-r2/meshoptimizer-210.0.0-r2-linux64-10341021290.tar.zst + https://github.com/secondlife/3p-meshoptimizer/releases/download/v220-r1/meshoptimizer-220.0.0-r1-linux64-11968851109.tar.zst name linux64 @@ -1591,11 +1591,11 @@ archive hash - 024ce689a6f13e66d0c7e431ac34071434e2365a + 6fd727a9ccb3e7a6c6b4ffef8179e266c032eb3e hash_algorithm sha1 url - https://github.com/secondlife/3p-meshoptimizer/releases/download/v210-r2/meshoptimizer-210.0.0-r2-windows64-10341021290.tar.zst + https://github.com/secondlife/3p-meshoptimizer/releases/download/v220-r1/meshoptimizer-220.0.0-r1-windows64-11968851109.tar.zst name windows64 @@ -1608,7 +1608,7 @@ copyright Copyright (c) 2016-2021 Arseny Kapoulkine version - 210.0.0-r2 + 220.0.0-r1 name meshoptimizer canonical_repo @@ -1687,11 +1687,11 @@ archive hash - 6bedaa9d770ef0ae6147f49a26fc3209fde9cb80 + 40ef787f43a47acb18fd06cb9605f2f1ec6273fd hash_algorithm sha1 url - https://github.com/secondlife/3p-minizip-ng/releases/download/v4.0.7-r1/minizip_ng-4.0.7-r1-darwin64-10324657515.tar.zst + https://github.com/secondlife/3p-minizip-ng/releases/download/v4.0.7-r2/minizip_ng-4.0.7-r2-darwin64-11967198844.tar.zst name darwin64 @@ -1701,11 +1701,11 @@ archive hash - ce2c91b8c4f89af252ce1b6a96af6985fe54f509 + 2c403efb5c59e7189b5e86a9001bb4f9e0647f6e hash_algorithm sha1 url - https://github.com/secondlife/3p-minizip-ng/releases/download/v4.0.7-r1/minizip_ng-4.0.7-r1-linux64-10324657515.tar.zst + https://github.com/secondlife/3p-minizip-ng/releases/download/v4.0.7-r2/minizip_ng-4.0.7-r2-linux64-11967198844.tar.zst name linux64 @@ -1715,11 +1715,11 @@ archive hash - 9cee9d85f9a7c6fb051125775f0122a926da5cc9 + 18a3d4adf09074f4ed97f7d086b30ce828d3508b hash_algorithm sha1 url - https://github.com/secondlife/3p-minizip-ng/releases/download/v4.0.7-r1/minizip_ng-4.0.7-r1-windows64-10324657515.tar.zst + https://github.com/secondlife/3p-minizip-ng/releases/download/v4.0.7-r2/minizip_ng-4.0.7-r2-windows64-11967198844.tar.zst name windows64 @@ -1732,7 +1732,7 @@ copyright This project uses the zlib license. Copyright (C) 1995-2013 Jean-loup Gailly and Mark Adler version - 4.0.7-r1 + 4.0.7-r2 name minizip-ng canonical_repo @@ -1867,11 +1867,11 @@ archive hash - 3f3374a5d97803bf78acf20847c2900c7d68ce2b + dd0c79ac49e5e81cd153d44061c044d1db950fdc hash_algorithm sha1 url - https://github.com/secondlife/3p-nghttp2/releases/download/v1.62.1/nghttp2-1.62.1-darwin64-10329456052.tar.zst + https://github.com/secondlife/3p-nghttp2/releases/download/v1.64.0-r1/nghttp2-1.64.0-r1-darwin64-11965382595.tar.zst name darwin64 @@ -1881,11 +1881,11 @@ archive hash - bd9c211f9f53c04821f0ab0e1268a691926331b6 + 0ba810156e0f1ceee8fcc9f9115b91111323fabd hash_algorithm sha1 url - https://github.com/secondlife/3p-nghttp2/releases/download/v1.62.1/nghttp2-1.62.1-linux64-10329456052.tar.zst + https://github.com/secondlife/3p-nghttp2/releases/download/v1.64.0-r1/nghttp2-1.64.0-r1-linux64-11965382595.tar.zst name linux64 @@ -1895,11 +1895,11 @@ archive hash - c23e25a7c47f5233f543a90f1a9ccf4da9282379 + 182e03f4ef36eff082c571c33b13111d4cd6c8dd hash_algorithm sha1 url - https://github.com/secondlife/3p-nghttp2/releases/download/v1.62.1/nghttp2-1.62.1-windows64-10329456052.tar.zst + https://github.com/secondlife/3p-nghttp2/releases/download/v1.64.0-r1/nghttp2-1.64.0-r1-windows64-11965382595.tar.zst name windows64 @@ -1913,7 +1913,7 @@ Copyright (c) 2012, 2014, 2015, 2016 Tatsuhiro Tsujikawa Copyright (c) 2012, 2014, 2015, 2016 nghttp2 contributors version - 1.62.1 + 1.64.0-r1 name nghttp2 description @@ -1962,11 +1962,11 @@ Copyright (c) 2012, 2014, 2015, 2016 nghttp2 contributors archive hash - 3abb5d21655aeca9d6a4de37704e8475821c28d9 + 68657c5c161c3fe8ff64eac3787172fcb06da972 hash_algorithm sha1 url - https://github.com/secondlife/3p-ogg_vorbis/releases/download/v1.3.5-1.3.7-r1/ogg_vorbis-1.3.5-1.3.7.10341271136-darwin64-10341271136.tar.zst + https://github.com/secondlife/3p-ogg_vorbis/releases/download/v1.3.5-1.3.7-r2/ogg_vorbis-1.3.5-1.3.7.11968798109-darwin64-11968798109.tar.zst name darwin64 @@ -1976,11 +1976,11 @@ Copyright (c) 2012, 2014, 2015, 2016 nghttp2 contributors archive hash - d89dff615c51b46ebdb3d42ac6bd9e0faae5ddf1 + 9a6ffad7b4186a158c019c5a5a5d7b8badb441da hash_algorithm sha1 url - https://github.com/secondlife/3p-ogg_vorbis/releases/download/v1.3.5-1.3.7-r1/ogg_vorbis-1.3.5-1.3.7.10341271136-linux64-10341271136.tar.zst + https://github.com/secondlife/3p-ogg_vorbis/releases/download/v1.3.5-1.3.7-r2/ogg_vorbis-1.3.5-1.3.7.11968798109-linux64-11968798109.tar.zst name linux64 @@ -1990,11 +1990,11 @@ Copyright (c) 2012, 2014, 2015, 2016 nghttp2 contributors archive hash - 0dc0f5334d1c882d5d7bce6d2cfaecf2f7ab1ae6 + 5f4cbb928ebfe774a9c07d3f2c255fd38bd6b4d6 hash_algorithm sha1 url - https://github.com/secondlife/3p-ogg_vorbis/releases/download/v1.3.5-1.3.7-r1/ogg_vorbis-1.3.5-1.3.7.10341271136-windows64-10341271136.tar.zst + https://github.com/secondlife/3p-ogg_vorbis/releases/download/v1.3.5-1.3.7-r2/ogg_vorbis-1.3.5-1.3.7.11968798109-windows64-11968798109.tar.zst name windows64 @@ -2007,7 +2007,7 @@ Copyright (c) 2012, 2014, 2015, 2016 nghttp2 contributors copyright Copyright (c) 2002, Xiph.org Foundation version - 1.3.5-1.3.7.10341271136 + 1.3.5-1.3.7.11968798109 name ogg_vorbis description @@ -2022,11 +2022,11 @@ Copyright (c) 2012, 2014, 2015, 2016 nghttp2 contributors archive hash - cbbcf3c5341e4ff4f956c0de960dc238faf20d54 + a93b63fc4e5aa3e226b819fb02ce9a05b00dfea1 hash_algorithm sha1 url - https://github.com/secondlife/3p-open-libndofdev/releases/download/v1.14-r4/open_libndofdev-0.14.11545940352-linux64-11545940352.tar.zst + https://github.com/secondlife/3p-open-libndofdev/releases/download/v1.14-r5/open_libndofdev-0.14.11968684513-linux64-11968684513.tar.zst name linux64 @@ -2039,7 +2039,7 @@ Copyright (c) 2012, 2014, 2015, 2016 nghttp2 contributors copyright Copyright (c) 2008, Jan Ciger (jan.ciger (at) gmail.com) version - 0.14.11545940352 + 0.14.11968684513 name open-libndofdev description @@ -2054,11 +2054,11 @@ Copyright (c) 2012, 2014, 2015, 2016 nghttp2 contributors archive hash - 32371131845ad85bf35e89f7a8ec073b89eeb3f1 + 9250e12d4d88f0a437e49be2b32d107f6b4270d0 hash_algorithm sha1 url - https://github.com/secondlife/3p-openal-soft/releases/download/v1.23.1-0247dd8/openal-1.23.1-darwin64-11115781501.tar.zst + https://github.com/secondlife/3p-openal-soft/releases/download/v1.24.0-r1/openal-1.24.0-r1-darwin64-11968917548.tar.zst name darwin64 @@ -2068,11 +2068,11 @@ Copyright (c) 2012, 2014, 2015, 2016 nghttp2 contributors archive hash - 14856fb33e205138731865b2d1bb680104f83dd3 + 1e50db24586fba434a2be62f94fdc687569379ca hash_algorithm sha1 url - https://github.com/secondlife/3p-openal-soft/releases/download/v1.23.1-0247dd8/openal-1.23.1-linux64-11115781501.tar.zst + https://github.com/secondlife/3p-openal-soft/releases/download/v1.24.0-r1/openal-1.24.0-r1-linux64-11968917548.tar.zst name linux64 @@ -2082,11 +2082,11 @@ Copyright (c) 2012, 2014, 2015, 2016 nghttp2 contributors archive hash - c84665726c23fa6f5d25c7a46f5e9d0153834a2a + 2ec7b2b1f4c37e5bd1b473e4a26935ec374ee208 hash_algorithm sha1 url - https://github.com/secondlife/3p-openal-soft/releases/download/v1.23.1-0247dd8/openal-1.23.1-windows64-11115781501.tar.zst + https://github.com/secondlife/3p-openal-soft/releases/download/v1.24.0-r1/openal-1.24.0-r1-windows64-11968917548.tar.zst name windows64 @@ -2099,7 +2099,7 @@ Copyright (c) 2012, 2014, 2015, 2016 nghttp2 contributors copyright Copyright (C) 1999-2007 by authors. version - 1.23.1 + 1.24.0-r1 name openal description @@ -2114,11 +2114,11 @@ Copyright (c) 2012, 2014, 2015, 2016 nghttp2 contributors archive hash - 76444e37be0cfccdbb5921370ba150ded2bf3c59 + 39007a526bffffd0bde691f616491b70cf284496 hash_algorithm sha1 url - https://github.com/secondlife/3p-openjpeg/releases/download/v2.5.2-r1/openjpeg-2.5.2.10604495243-darwin64-10604495243.tar.zst + https://github.com/secondlife/3p-openjpeg/releases/download/v2.5.2-r2/openjpeg-2.5.2.11968808495-darwin64-11968808495.tar.zst name darwin64 @@ -2128,11 +2128,11 @@ Copyright (c) 2012, 2014, 2015, 2016 nghttp2 contributors archive hash - 6bd289a9c4564b80369ce40ecbb24a213c2732ff + 066e7b1ee58d5aff8efe065d598d56226c249a94 hash_algorithm sha1 url - https://github.com/secondlife/3p-openjpeg/releases/download/v2.5.2-r1/openjpeg-2.5.2.10604495243-linux64-10604495243.tar.zst + https://github.com/secondlife/3p-openjpeg/releases/download/v2.5.2-r2/openjpeg-2.5.2.11968808495-linux64-11968808495.tar.zst name linux64 @@ -2142,11 +2142,11 @@ Copyright (c) 2012, 2014, 2015, 2016 nghttp2 contributors archive hash - 5e6e0180adc01e07438cb98daec96543b5d85019 + fe98fc9f4f3d94399c3078cad1bdcfdb37ce397b hash_algorithm sha1 url - https://github.com/secondlife/3p-openjpeg/releases/download/v2.5.2-r1/openjpeg-2.5.2.10604495243-windows64-10604495243.tar.zst + https://github.com/secondlife/3p-openjpeg/releases/download/v2.5.2-r2/openjpeg-2.5.2.11968808495-windows64-11968808495.tar.zst name windows64 @@ -2159,7 +2159,7 @@ Copyright (c) 2012, 2014, 2015, 2016 nghttp2 contributors copyright Copyright (c) 2002-2007, Communications and Remote Sensing Laboratory, Universite catholique de Louvain (UCL), Belgium; Copyright (c) 2002-2007, Professor Benoit Macq; Copyright (c) 2001-2003, David Janssens; Copyright (c) 2002-2003, Yannick Verschueren; Copyright (c) 2003-2007, Francois-Olivier Devaux and Antonin Descampe; Copyright (c) 2005, Herve Drolon, FreeImage Team; Copyright (c) 2006-2007, Parvatha Elangovan; Copyright (c) 2008, Jerome Fimes, Communications & Systemes <jerome.fimes@c-s.fr>; Copyright (c) 2010-2011, Kaori Hagihara; Copyright (c) 2011-2012, Centre National d'Etudes Spatiales (CNES), France; Copyright (c) 2012, CS Systemes d'Information, France; version - 2.5.0.ea12248 + 2.5.2.11968808495 name openjpeg description @@ -2174,11 +2174,11 @@ Copyright (c) 2012, 2014, 2015, 2016 nghttp2 contributors archive hash - a20277991043a4a00fb8280a27a41fbd87c4b840 + f6fdad42168b30932384310866642b072465af11 hash_algorithm sha1 url - https://github.com/secondlife/3p-openssl/releases/download/v1.1.1w-r1/openssl-1.1.1w-darwin64-10329796904.tar.zst + https://github.com/secondlife/3p-openssl/releases/download/v1.1.1w-r2/openssl-1.1.1w-r2-darwin64-11965633361.tar.zst name darwin64 @@ -2188,11 +2188,11 @@ Copyright (c) 2012, 2014, 2015, 2016 nghttp2 contributors archive hash - 0f2cd519431b11cacf85971c66c49e5b4d26c56f + 7a5048c806b053768c461d6dbac854324a597ee0 hash_algorithm sha1 url - https://github.com/secondlife/3p-openssl/releases/download/v1.1.1w-r1/openssl-1.1.1w-linux64-10329796904.tar.zst + https://github.com/secondlife/3p-openssl/releases/download/v1.1.1w-r2/openssl-1.1.1w-r2-linux64-11965633361.tar.zst name linux64 @@ -2202,11 +2202,11 @@ Copyright (c) 2012, 2014, 2015, 2016 nghttp2 contributors archive hash - 5e396eedf1492d18126b7281367123c1d64b89aa + 3d16fa02ca44a6a1eeeb7c83d62af2dc8ef2e7e9 hash_algorithm sha1 url - https://github.com/secondlife/3p-openssl/releases/download/v1.1.1w-r1/openssl-1.1.1w-windows64-10329796904.tar.zst + https://github.com/secondlife/3p-openssl/releases/download/v1.1.1w-r2/openssl-1.1.1w-r2-windows64-11965633361.tar.zst name windows64 @@ -2219,7 +2219,7 @@ Copyright (c) 2012, 2014, 2015, 2016 nghttp2 contributors copyright Copyright (c) 1998-2011 The OpenSSL Project. All rights reserved; Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) version - 1.1.1w + 1.1.1w-r2 name openssl description @@ -2345,6 +2345,40 @@ Copyright (c) 2012, 2014, 2015, 2016 nghttp2 contributors description Vivox SDK components + sse2neon + + platforms + + common + + archive + + hash + c578c2a7f4355197d0ce8544310bc5e785531018 + hash_algorithm + sha1 + url + https://github.com/secondlife/3p-sse2neon/releases/download/v1.7.0-r2/sse2neon-1.7.0-dev0.gc8ad5f1.d20241212-common-12287325635.tar.zst + + name + common + + + license + MIT + license_file + LICENSES/sse2neon.txt + copyright + Copyright (c) 2015-2024 SSE2NEON Contributors. + version + 1.7.0-dev0.gc8ad5f1.d20241212 + name + sse2neon + canonical_repo + https://github.com/secondlife/3p-sse2neon + description + A translator from Intel SSE intrinsics to Arm/Aarch64 NEON implementation + threejs platforms @@ -2652,11 +2686,11 @@ Copyright (c) 2012, 2014, 2015, 2016 nghttp2 contributors archive hash - f13c82042ef8311e57dd75a3b2bda02d70f711b5 + 6d72afd5cc21446c65899615909b1f09f155585d hash_algorithm sha1 url - https://github.com/secondlife/3p-vlc-bin/releases/download/v3.0.21.e60ee26/vlc_bin-3.0.21.10218721728-darwin64-10218721728.tar.zst + https://github.com/secondlife/3p-vlc-bin/releases/download/v3.0.21.296d9f4/vlc_bin-3.0.21.11968962952-darwin64-11968962952.tar.zst name darwin64 @@ -2666,18 +2700,18 @@ Copyright (c) 2012, 2014, 2015, 2016 nghttp2 contributors archive hash - bd995441c1a229ed1432ddd837d7d1663b8c5548 + f986e6e93acf8a32a8be5b638f0bd0e2e07d7507 hash_algorithm sha1 url - https://github.com/secondlife/3p-vlc-bin/releases/download/v3.0.21.e60ee26/vlc_bin-3.0.21.10218721728-windows64-10218721728.tar.zst + https://github.com/secondlife/3p-vlc-bin/releases/download/v3.0.21.296d9f4/vlc_bin-3.0.21.11968962952-windows64-11968962952.tar.zst name windows64 version - 3.0.21.10218721728 + 3.0.21.11968962952 vulkan_gltf @@ -2722,11 +2756,11 @@ Copyright (c) 2012, 2014, 2015, 2016 nghttp2 contributors archive hash - 3570b6442d472cd97bad8622c2ec2571d72218a0 + 6314fdcee81a3538a7d960178ade66301c2fa002 hash_algorithm sha1 url - https://github.com/secondlife/3p-webrtc-build/releases/download/m114.5735.08.72-test/webrtc-m114.5735.08.72-test.10444682919-darwin64-10444682919.tar.zst + https://github.com/secondlife/3p-webrtc-build/releases/download/m114.5735.08.73-alpha/webrtc-m114.5735.08.73-alpha.11958809572-darwin64-11958809572.tar.zst name darwin64 @@ -2736,11 +2770,11 @@ Copyright (c) 2012, 2014, 2015, 2016 nghttp2 contributors archive hash - eadf6aa99313940ded11801d42c11375669f1628 + 95d7730a3d6955697e043f3fdf20ebdcc0c71fc0 hash_algorithm sha1 url - https://github.com/secondlife/3p-webrtc-build/releases/download/m114.5735.08.72-test/webrtc-m114.5735.08.72-test.10444682919-linux64-10444682919.tar.zst + https://github.com/secondlife/3p-webrtc-build/releases/download/m114.5735.08.73-alpha/webrtc-m114.5735.08.73-alpha.11958809572-linux64-11958809572.tar.zst name linux64 @@ -2750,11 +2784,11 @@ Copyright (c) 2012, 2014, 2015, 2016 nghttp2 contributors archive hash - 0081fd35290adbc8e66dd366535fb6cd8a966f1e + c7b329d6409576af6eb5b80655b007f52639c43b hash_algorithm sha1 url - https://github.com/secondlife/3p-webrtc-build/releases/download/m114.5735.08.72-test/webrtc-m114.5735.08.72-test.10444682919-windows64-10444682919.tar.zst + https://github.com/secondlife/3p-webrtc-build/releases/download/m114.5735.08.73-alpha/webrtc-m114.5735.08.73-alpha.11958809572-windows64-11958809572.tar.zst name windows64 @@ -2767,7 +2801,7 @@ Copyright (c) 2012, 2014, 2015, 2016 nghttp2 contributors copyright Copyright (c) 2011, The WebRTC project authors. All rights reserved. version - m114.5735.08.72-test.10444682919 + m114.5735.08.73-alpha.11958809572 name webrtc vcs_branch @@ -2820,11 +2854,11 @@ Copyright (c) 2012, 2014, 2015, 2016 nghttp2 contributors archive hash - 3a6593c71c59ace76d1349483759fcde4b719a76 + 4d437afc7fc3988cf0c78ed05853a211cc6bf8b8 hash_algorithm sha1 url - https://github.com/secondlife/3p-zlib-ng/releases/download/v2.2.1-r2/zlib_ng-2.2.1-r2-darwin64-10324415171.tar.zst + https://github.com/secondlife/3p-zlib-ng/releases/download/v2.2.2-r1/zlib_ng-2.2.2-dev0.gcaa101e.d20241120-darwin64-11943461931.tar.zst name darwin64 @@ -2834,11 +2868,11 @@ Copyright (c) 2012, 2014, 2015, 2016 nghttp2 contributors archive hash - fbadeb0b8c771cb06c0055c9fab6d40c6764dacd + 70c1d8728b85481bd42904c1213ed50264e77be1 hash_algorithm sha1 url - https://github.com/secondlife/3p-zlib-ng/releases/download/v2.2.1-r2/zlib_ng-2.2.1-r2-linux64-10324415171.tar.zst + https://github.com/secondlife/3p-zlib-ng/releases/download/v2.2.2-r1/zlib_ng-2.2.2-dev0.gcaa101e.d20241120-linux64-11943461931.tar.zst name linux64 @@ -2848,11 +2882,11 @@ Copyright (c) 2012, 2014, 2015, 2016 nghttp2 contributors archive hash - 0094031715662be626f5106ff6c814f4fc3dacfa + f98c30b20120511ecceab8bf1b5eba048b10aade hash_algorithm sha1 url - https://github.com/secondlife/3p-zlib-ng/releases/download/v2.2.1-r2/zlib_ng-2.2.1-r2-windows64-10324415171.tar.zst + https://github.com/secondlife/3p-zlib-ng/releases/download/v2.2.2-r1/zlib_ng-2.2.2-dev0.gcaa101e.d20241120-windows64-11943461931.tar.zst name windows64 @@ -2865,7 +2899,7 @@ Copyright (c) 2012, 2014, 2015, 2016 nghttp2 contributors copyright Copyright (C) 1995-2013 Jean-loup Gailly and Mark Adler version - 2.2.1-r2 + 2.2.2-dev0.gcaa101e.d20241120 name zlib-ng canonical_repo diff --git a/indra/cmake/00-Common.cmake b/indra/cmake/00-Common.cmake index cd33ab27cf..940b60fb8b 100644 --- a/indra/cmake/00-Common.cmake +++ b/indra/cmake/00-Common.cmake @@ -34,7 +34,7 @@ add_compile_definitions(BOOST_BIND_GLOBAL_PLACEHOLDERS) # Force enable SSE2 instructions in GLM per the manual # https://github.com/g-truc/glm/blob/master/manual.md#section2_10 -add_compile_definitions(GLM_FORCE_DEFAULT_ALIGNED_GENTYPES=1 GLM_FORCE_SSE2=1 GLM_ENABLE_EXPERIMENTAL=1) +add_compile_definitions(GLM_FORCE_DEFAULT_ALIGNED_GENTYPES=1 GLM_ENABLE_EXPERIMENTAL=1) # Configure crash reporting set(RELEASE_CRASH_REPORTING OFF CACHE BOOL "Enable use of crash reporting in release builds") @@ -197,6 +197,9 @@ if (LINUX) endif (LINUX) if (DARWIN) + # Use rpath loading on macos + set(CMAKE_MACOSX_RPATH TRUE) + # Warnings should be fatal -- thanks, Nicky Perian, for spotting reversed default set(CLANG_DISABLE_FATAL_WARNINGS OFF) set(CMAKE_CXX_LINK_FLAGS "-Wl,-headerpad_max_install_names,-search_paths_first") @@ -204,6 +207,9 @@ if (DARWIN) # Ensure debug symbols are always generated add_compile_options(-g --debug) # --debug is a clang synonym for -g that bypasses cmake behaviors + + # Silence GL deprecation warnings + add_compile_definitions(GL_SILENCE_DEPRECATION=1) endif(DARWIN) if(LINUX OR DARWIN) diff --git a/indra/cmake/APR.cmake b/indra/cmake/APR.cmake index 97b316c4c7..0797d6d9e7 100644 --- a/indra/cmake/APR.cmake +++ b/indra/cmake/APR.cmake @@ -9,28 +9,15 @@ use_system_binary( apr apr-util ) use_prebuilt_binary(apr_suite) if (WINDOWS) - if (LLCOMMON_LINK_SHARED) - set(APR_selector "lib") - else (LLCOMMON_LINK_SHARED) - set(APR_selector "") - endif (LLCOMMON_LINK_SHARED) target_link_libraries( ll::apr INTERFACE - ${ARCH_PREBUILT_DIRS_RELEASE}/${APR_selector}apr-1.lib - ${ARCH_PREBUILT_DIRS_RELEASE}/${APR_selector}aprutil-1.lib + ${ARCH_PREBUILT_DIRS_RELEASE}/apr-1.lib + ${ARCH_PREBUILT_DIRS_RELEASE}/aprutil-1.lib ) target_compile_definitions( ll::apr INTERFACE APR_DECLARE_STATIC=1 APU_DECLARE_STATIC=1 API_DECLARE_STATIC=1) elseif (DARWIN) - if (LLCOMMON_LINK_SHARED) - set(APR_selector "0.dylib") - set(APRUTIL_selector "0.dylib") - else (LLCOMMON_LINK_SHARED) - set(APR_selector "a") - set(APRUTIL_selector "a") - endif (LLCOMMON_LINK_SHARED) - target_link_libraries( ll::apr INTERFACE - ${ARCH_PREBUILT_DIRS_RELEASE}/libapr-1.${APR_selector} - ${ARCH_PREBUILT_DIRS_RELEASE}/libaprutil-1.${APR_selector} + ${ARCH_PREBUILT_DIRS_RELEASE}/libapr-1.a + ${ARCH_PREBUILT_DIRS_RELEASE}/libaprutil-1.a iconv ) else() diff --git a/indra/cmake/CMakeLists.txt b/indra/cmake/CMakeLists.txt index 7c688c24be..142ea75b64 100644 --- a/indra/cmake/CMakeLists.txt +++ b/indra/cmake/CMakeLists.txt @@ -66,6 +66,7 @@ set(cmake_SOURCE_FILES Prebuilt.cmake Python.cmake SDL2.cmake + SSE2NEON.cmake TemplateCheck.cmake ThreeJS.cmake TinyEXR.cmake diff --git a/indra/cmake/Copy3rdPartyLibs.cmake b/indra/cmake/Copy3rdPartyLibs.cmake index a52e17ac8e..5667d39f97 100644 --- a/indra/cmake/Copy3rdPartyLibs.cmake +++ b/indra/cmake/Copy3rdPartyLibs.cmake @@ -57,11 +57,6 @@ if(WINDOWS) SDL2.dll ) - if(LLCOMMON_LINK_SHARED) - set(release_files ${release_files} libapr-1.dll) - set(release_files ${release_files} libaprutil-1.dll) - endif() - # Filenames are different for 32/64 bit BugSplat file and we don't # have any control over them so need to branch. if (USE_BUGSPLAT) @@ -173,15 +168,6 @@ elseif(DARWIN) libSDL2.dylib ) - if(LLCOMMON_LINK_SHARED) - set(release_files ${release_files} - libapr-1.0.dylib - libapr-1.dylib - libaprutil-1.0.dylib - libaprutil-1.dylib - ) - endif() - if (TARGET ll::openal) list(APPEND release_files libalut.dylib libopenal.dylib) endif () @@ -215,20 +201,6 @@ elseif(LINUX) libSDL2-2.0.so.0 ) - if( USE_AUTOBUILD_3P ) - list( APPEND release_files - libapr-1.so.0 - libaprutil-1.so.0 - ) - - if(LLCOMMON_LINK_SHARED) - set(release_files ${release_files} - libapr-1.so.0 - libaprutil-1.so.0 - ) - endif() - endif() - else(WINDOWS) message(STATUS "WARNING: unrecognized platform for staging 3rd party libs, skipping...") set(vivox_lib_dir "${CMAKE_SOURCE_DIR}/newview/vivox-runtime/i686-linux") diff --git a/indra/cmake/LLAddBuildTest.cmake b/indra/cmake/LLAddBuildTest.cmake index ee578a5a55..3c1ac7c2f4 100644 --- a/indra/cmake/LLAddBuildTest.cmake +++ b/indra/cmake/LLAddBuildTest.cmake @@ -99,6 +99,13 @@ MACRO(LL_ADD_PROJECT_UNIT_TESTS project sources) target_include_directories (PROJECT_${project}_TEST_${name} PRIVATE ${LIBS_OPEN_DIR}/test ) set_target_properties(PROJECT_${project}_TEST_${name} PROPERTIES RUNTIME_OUTPUT_DIRECTORY "${EXE_STAGING_DIR}") + if (DARWIN) + set_target_properties(PROJECT_${project}_TEST_${name} + PROPERTIES + BUILD_WITH_INSTALL_RPATH 1 + INSTALL_RPATH "@executable_path/Resources" + ) + endif(DARWIN) # # Per-codefile additional / external project dep and lib dep property extraction @@ -229,8 +236,11 @@ FUNCTION(LL_ADD_INTEGRATION_TEST # test binaries always need to be signed for local development set_target_properties(INTEGRATION_TEST_${testname} PROPERTIES - XCODE_ATTRIBUTE_CODE_SIGN_IDENTITY "-") - endif () + XCODE_ATTRIBUTE_CODE_SIGN_IDENTITY "-" + BUILD_WITH_INSTALL_RPATH 1 + INSTALL_RPATH "@executable_path/Resources" + ) + endif(DARWIN) # Add link deps to the executable if(TEST_DEBUG) diff --git a/indra/cmake/SSE2NEON.cmake b/indra/cmake/SSE2NEON.cmake new file mode 100644 index 0000000000..797f2af80e --- /dev/null +++ b/indra/cmake/SSE2NEON.cmake @@ -0,0 +1,12 @@ +# -*- cmake -*- + +include(Prebuilt) + +add_library(ll::sse2neon INTERFACE IMPORTED) + +if (DARWIN) + use_system_binary(sse2neon) + use_prebuilt_binary(sse2neon) + + target_include_directories( ll::sse2neon SYSTEM INTERFACE ${LIBS_PREBUILT_DIR}/include/sse2neon) +endif() diff --git a/indra/cmake/Variables.cmake b/indra/cmake/Variables.cmake index 778ce8934a..c83a4dc9db 100644 --- a/indra/cmake/Variables.cmake +++ b/indra/cmake/Variables.cmake @@ -145,30 +145,26 @@ if (${CMAKE_SYSTEM_NAME} MATCHES "Darwin") set(CMAKE_OSX_DEPLOYMENT_TARGET "${CMAKE_MATCH_1}") message(STATUS "CMAKE_OSX_DEPLOYMENT_TARGET = '${CMAKE_OSX_DEPLOYMENT_TARGET}'") - string(REGEX MATCH "-stdlib=([^ ]+)" scratch "$ENV{LL_BUILD}") - set(CMAKE_XCODE_ATTRIBUTE_CLANG_CXX_LIBRARY "${CMAKE_MATCH_1}") - message(STATUS "CMAKE_XCODE_ATTRIBUTE_CLANG_CXX_LIBRARY = '${CMAKE_XCODE_ATTRIBUTE_CLANG_CXX_LIBRARY}'") - string(REGEX MATCH "-O([^ ]*)" scratch "$ENV{LL_BUILD}") set(CMAKE_XCODE_ATTRIBUTE_GCC_OPTIMIZATION_LEVEL "${CMAKE_MATCH_1}") message(STATUS "CMAKE_XCODE_ATTRIBUTE_GCC_OPTIMIZATION_LEVEL = '${CMAKE_XCODE_ATTRIBUTE_GCC_OPTIMIZATION_LEVEL}'") # allow disabling this check by setting LL_SKIP_REQUIRE_SYSROOT either ON as cmake cache var or non-empty as environment var - set(LL_SKIP_REQUIRE_SYSROOT OFF CACHE BOOL "Skip requirement to set toolchain sysroot ahead of time. Not skipped by default for consistency, but skipping can be useful for selecting alternative xcode versions side by side") - if("$ENV{LL_SKIP_REQUIRE_SYSROOT}" STREQUAL "" AND NOT ${LL_SKIP_REQUIRE_SYSROOT}) - string(REGEX MATCHALL "[^ ]+" LL_BUILD_LIST "$ENV{LL_BUILD}") - list(FIND LL_BUILD_LIST "-iwithsysroot" sysroot_idx) - if ("${sysroot_idx}" LESS 0) - message(FATAL_ERROR "Environment variable LL_BUILD must contain '-iwithsysroot'") - endif () - math(EXPR sysroot_idx "${sysroot_idx} + 1") - list(GET LL_BUILD_LIST "${sysroot_idx}" CMAKE_OSX_SYSROOT) - endif() - message(STATUS "CMAKE_OSX_SYSROOT = '${CMAKE_OSX_SYSROOT}'") + # set(LL_SKIP_REQUIRE_SYSROOT OFF CACHE BOOL "Skip requirement to set toolchain sysroot ahead of time. Not skipped by default for consistency, but skipping can be useful for selecting alternative xcode versions side by side") + # if("$ENV{LL_SKIP_REQUIRE_SYSROOT}" STREQUAL "" AND NOT ${LL_SKIP_REQUIRE_SYSROOT}) + # string(REGEX MATCHALL "[^ ]+" LL_BUILD_LIST "$ENV{LL_BUILD}") + # list(FIND LL_BUILD_LIST "-iwithsysroot" sysroot_idx) + # if ("${sysroot_idx}" LESS 0) + # message(FATAL_ERROR "Environment variable LL_BUILD must contain '-iwithsysroot'") + # endif () + # math(EXPR sysroot_idx "${sysroot_idx} + 1") + # list(GET LL_BUILD_LIST "${sysroot_idx}" CMAKE_OSX_SYSROOT) + # endif() + # message(STATUS "CMAKE_OSX_SYSROOT = '${CMAKE_OSX_SYSROOT}'") # Force debug symbol generation under xcode generator set(CMAKE_XCODE_ATTRIBUTE_GCC_GENERATE_DEBUGGING_SYMBOLS YES) - set(CMAKE_XCODE_ATTRIBUTE_DEBUG_INFORMATION_FORMAT dwarf-with-dsym) + set(CMAKE_XCODE_ATTRIBUTE_DEBUG_INFORMATION_FORMAT dwarf) message(STATUS "CMAKE_XCODE_ATTRIBUTE_DEBUG_INFORMATION_FORMAT = '${CMAKE_XCODE_ATTRIBUTE_DEBUG_INFORMATION_FORMAT}'") # Strip dead code @@ -193,9 +189,16 @@ if (${CMAKE_SYSTEM_NAME} MATCHES "Darwin") set(CMAKE_XCODE_ATTRIBUTE_LD_WARN_DUPLICATE_LIBRARIES NO) set(CMAKE_XCODE_ATTRIBUTE_DISABLE_MANUAL_TARGET_ORDER_BUILD_WARNING YES) set(CMAKE_XCODE_ATTRIBUTE_GCC_WARN_64_TO_32_BIT_CONVERSION NO) - set(CMAKE_OSX_ARCHITECTURES "${ARCH}") - string(REPLACE "i686" "i386" CMAKE_OSX_ARCHITECTURES "${CMAKE_OSX_ARCHITECTURES}") - string(REPLACE "AMD64" "x86_64" CMAKE_OSX_ARCHITECTURES "${CMAKE_OSX_ARCHITECTURES}") + + option(BUILD_UNIVERSAL "Build macOS universal binaries" ON) + option(BUILD_ARM64 "Build for arm64 on macos" ON) + if(BUILD_UNIVERSAL) + set(CMAKE_OSX_ARCHITECTURES "x86_64;arm64") + elseif(BUILD_ARM64) + set(CMAKE_OSX_ARCHITECTURES "arm64") + else() + set(CMAKE_OSX_ARCHITECTURES "x86_64") + endif() endif (${CMAKE_SYSTEM_NAME} MATCHES "Darwin") # Default deploy grid diff --git a/indra/llcommon/CMakeLists.txt b/indra/llcommon/CMakeLists.txt index aa8810f00b..50f6ed31a7 100644 --- a/indra/llcommon/CMakeLists.txt +++ b/indra/llcommon/CMakeLists.txt @@ -11,7 +11,7 @@ include(LLSharedLibs) include(Copy3rdPartyLibs) include(ZLIBNG) include(Tracy) - +include(SSE2NEON) set(llcommon_SOURCE_FILES apply.cpp @@ -75,7 +75,7 @@ set(llcommon_SOURCE_FILES llprocess.cpp llprocessor.cpp llprocinfo.cpp - llptrto.cpp + llptrto.cpp llqueuedthread.cpp llrand.cpp llrefcount.cpp @@ -116,7 +116,7 @@ set(llcommon_SOURCE_FILES workqueue.cpp StackWalker.cpp ) - + set(llcommon_HEADER_FILES CMakeLists.txt @@ -272,7 +272,7 @@ set(llcommon_HEADER_FILES workqueue.h StackWalker.h ) - + if (DARWIN) list(APPEND llcommon_HEADER_FILES llsys_objc.h) list(APPEND llcommon_SOURCE_FILES llsys_objc.mm) @@ -294,6 +294,7 @@ target_link_libraries( ll::boost ll::oslibraries ll::tracy + ll::sse2neon ) target_include_directories(llcommon INTERFACE ${CMAKE_CURRENT_SOURCE_DIR}) diff --git a/indra/llcommon/llfasttimer.cpp b/indra/llcommon/llfasttimer.cpp index 722743f453..bff01dc86d 100644 --- a/indra/llcommon/llfasttimer.cpp +++ b/indra/llcommon/llfasttimer.cpp @@ -64,7 +64,7 @@ bool BlockTimer::sLog = false; std::string BlockTimer::sLogName = ""; bool BlockTimer::sMetricLog = false; -#if LL_LINUX +#if LL_LINUX || LL_DARWIN U64 BlockTimer::sClockResolution = 1000000000; // Nanosecond resolution #else U64 BlockTimer::sClockResolution = 1000000; // Microsecond resolution diff --git a/indra/llcommon/llfasttimer.h b/indra/llcommon/llfasttimer.h index 09fcf8a1af..c1c8644833 100644 --- a/indra/llcommon/llfasttimer.h +++ b/indra/llcommon/llfasttimer.h @@ -30,9 +30,14 @@ #include "llinstancetracker.h" #include "lltrace.h" #include "lltreeiterators.h" +#include "llprocessor.h" +#if LL_X86 || LL_X86_64 #if LL_WINDOWS #include +#else +#include +#endif #endif #define LL_FAST_TIMER_ON 1 @@ -68,35 +73,10 @@ class BlockTimer // // Windows implementation of CPU clock // - - // - // NOTE: put back in when we aren't using platform sdk anymore - // - // because MS has different signatures for these functions in winnt.h - // need to rename them to avoid conflicts - //#define _interlockedbittestandset _renamed_interlockedbittestandset - //#define _interlockedbittestandreset _renamed_interlockedbittestandreset - //#include - //#undef _interlockedbittestandset - //#undef _interlockedbittestandreset - - //inline U32 getCPUClockCount32() - //{ - // U64 time_stamp = __rdtsc(); - // return (U32)(time_stamp >> 8); - //} - // - //// return full timer value, *not* shifted by 8 bits - //inline U64 getCPUClockCount64() - //{ - // return __rdtsc(); - //} - - +#if LL_FASTTIMER_USE_RDTSC // shift off lower 8 bits for lower resolution but longer term timing // on 1Ghz machine, a 32-bit word will hold ~1000 seconds of timing -#if LL_FASTTIMER_USE_RDTSC static U32 getCPUClockCount32() { unsigned __int64 val = __rdtsc(); @@ -128,7 +108,7 @@ class BlockTimer #endif -#if (LL_LINUX) && !(defined(__i386__) || defined(__amd64__)) +#if LL_LINUX && !(defined(__i386__) || defined(__amd64__)) // // Linux implementation of CPU clock - non-x86. // This is accurate but SLOW! Only use out of desperation. @@ -159,9 +139,37 @@ class BlockTimer #endif // (LL_LINUX) && !(defined(__i386__) || defined(__amd64__)) -#if (LL_LINUX || LL_DARWIN) && (defined(__i386__) || defined(__amd64__)) +#if LL_DARWIN && LL_ARM64 + // + // Mac implementation of CPU clock - non-x86. + // + static U64 getCPUClockCount64() + { + return clock_gettime_nsec_np(CLOCK_UPTIME_RAW); + } + + static U32 getCPUClockCount32() + { + return (U32)(getCPUClockCount64() >> 8); + } +#endif // LL_DARWIN && LL_ARM64 + +#if (LL_LINUX || LL_DARWIN) && (LL_X86 || LL_X86_64) // // Mac+Linux FAST x86 implementation of CPU clock + // +#if LL_FASTTIMER_USE_RDTSC + static U32 getCPUClockCount32() + { + U64 time_stamp = __rdtsc() >> 8U; + return static_cast(time_stamp); + } + + static U64 getCPUClockCount64() + { + return static_cast(__rdtsc()); + } +#else static U32 getCPUClockCount32() { U32 low(0),high(0); @@ -175,7 +183,7 @@ class BlockTimer __asm__ volatile (".byte 0x0f, 0x31": "=a"(low), "=d"(high) ); return (U64)low | ( ((U64)high) << 32); } - +#endif #endif static BlockTimerStatHandle& getRootTimeBlock(); diff --git a/indra/llcommon/llmemory.h b/indra/llcommon/llmemory.h index 72aec57080..6bfda3795e 100644 --- a/indra/llcommon/llmemory.h +++ b/indra/llcommon/llmemory.h @@ -27,6 +27,7 @@ #define LLMEMORY_H #include "linden_common.h" +#include "llprocessor.h" #include "llunits.h" #include "stdtypes.h" #if !LL_WINDOWS @@ -71,7 +72,11 @@ LL_COMMON_API void ll_assert_aligned_func(uintptr_t ptr,U32 alignment); #define ll_assert_aligned(ptr,alignment) #endif +#if LL_ARM64 +#include "sse2neon.h" +#else #include +#endif template T* LL_NEXT_ALIGNED_ADDRESS(T* address) { @@ -345,7 +350,9 @@ inline void ll_memcpy_nonaliased_aligned_16(char* __restrict dst, const char* __ assert((bytes % sizeof(F32))== 0); ll_assert_aligned(src,16); ll_assert_aligned(dst,16); - +#if defined(LL_ARM64) + memcpy(dst, src, bytes); +#else assert((src < dst) ? ((src + bytes) <= dst) : ((dst + bytes) <= src)); assert(bytes%16==0); @@ -404,6 +411,7 @@ inline void ll_memcpy_nonaliased_aligned_16(char* __restrict dst, const char* __ dst += 16; src += 16; } +#endif } #ifndef __DEBUG_PRIVATE_MEM__ diff --git a/indra/llcommon/llpreprocessor.h b/indra/llcommon/llpreprocessor.h index b499a9ce10..02d541d33f 100644 --- a/indra/llcommon/llpreprocessor.h +++ b/indra/llcommon/llpreprocessor.h @@ -63,7 +63,14 @@ // Figure out differences between compilers -#if defined(__GNUC__) +#if defined(__clang__) + #define CLANG_VERSION (__clang_major__ * 10000 \ + + __clang_minor__ * 100 \ + + __clang_patchlevel__) + #ifndef LL_CLANG + #define LL_CLANG 1 + #endif +#elif defined(__GNUC__) #define GCC_VERSION (__GNUC__ * 10000 \ + __GNUC_MINOR__ * 100 \ + __GNUC_PATCHLEVEL__) @@ -187,4 +194,10 @@ #define LL_PRETTY_FUNCTION __PRETTY_FUNCTION__ #endif +#if defined(_M_ARM64) || defined(__arm64__) || defined(__aarch64__) +#define GLM_FORCE_NEON 1 +#else +#define GLM_FORCE_SSE2 1 +#endif + #endif // not LL_LINDEN_PREPROCESSOR_H diff --git a/indra/llcommon/llprocessor.h b/indra/llcommon/llprocessor.h index f8ccf686c8..9b16fbd098 100644 --- a/indra/llcommon/llprocessor.h +++ b/indra/llcommon/llprocessor.h @@ -28,19 +28,22 @@ #ifndef LLPROCESSOR_H #define LLPROCESSOR_H #include "llunits.h" +#include "llpreprocessor.h" -#if LL_MSVC && _M_X64 +#if LL_MSVC && defined(_M_ARM64) +# define LL_ARM64 1 +#elif (LL_GNUC || LL_CLANG) && (defined(__arm64__) || defined(__aarch64__)) +# define LL_ARM64 1 +#elif LL_MSVC && _M_X64 # define LL_X86_64 1 # define LL_X86 1 #elif LL_MSVC && _M_IX86 # define LL_X86 1 -#elif LL_GNUC && ( defined(__amd64__) || defined(__x86_64__) ) +#elif (LL_GNUC || LL_CLANG) && ( defined(__amd64__) || defined(__x86_64__) ) # define LL_X86_64 1 # define LL_X86 1 -#elif LL_GNUC && ( defined(__i386__) ) +#elif (LL_GNUC || LL_CLANG) && ( defined(__i386__) ) # define LL_X86 1 -#elif LL_GNUC && ( defined(__powerpc__) || defined(__ppc__) ) -# define LL_PPC 1 #endif class LLProcessorInfoImpl; diff --git a/indra/llkdu/CMakeLists.txt b/indra/llkdu/CMakeLists.txt index 230803a630..411fff34ae 100644 --- a/indra/llkdu/CMakeLists.txt +++ b/indra/llkdu/CMakeLists.txt @@ -27,14 +27,6 @@ set(llkdu_HEADER_FILES list(APPEND llkdu_SOURCE_FILES ${llkdu_HEADER_FILES}) -# Our KDU package is built with KDU_X86_INTRINSICS in its .vcxproj file. -# Unless that macro is also set for every consumer build, KDU freaks out, -# spamming the viewer log with alignment FUD. -set_source_files_properties(${llkdu_SOURCE_FILES} - PROPERTIES - COMPILE_DEFINITIONS - "KDU_X86_INTRINSICS") - if (USE_KDU) add_library (llkdu ${llkdu_SOURCE_FILES}) diff --git a/indra/llkdu/llimagej2ckdu.cpp b/indra/llkdu/llimagej2ckdu.cpp index 8e2bd5b2d9..e7c29e08f9 100644 --- a/indra/llkdu/llimagej2ckdu.cpp +++ b/indra/llkdu/llimagej2ckdu.cpp @@ -26,6 +26,16 @@ #include "linden_common.h" +#if defined(_M_ARM64) || defined(__arm64__) || defined(__aarch64__) +#ifndef KDU_NEON_INTRINSICS +#define KDU_NEON_INTRINSICS 1 +#endif +#else +#ifndef KDU_X86_INTRINSICS +#define KDU_X86_INTRINSICS 1 +#endif +#endif + #include "llimagej2ckdu.h" #include "lltimer.h" diff --git a/indra/llkdu/llimagej2ckdu.h b/indra/llkdu/llimagej2ckdu.h index 8481201cbc..1289318521 100644 --- a/indra/llkdu/llimagej2ckdu.h +++ b/indra/llkdu/llimagej2ckdu.h @@ -29,6 +29,16 @@ #include "llimagej2c.h" +#if defined(_M_ARM64) || defined(__arm64__) || defined(__aarch64__) +#ifndef KDU_NEON_INTRINSICS +#define KDU_NEON_INTRINSICS 1 +#endif +#else +#ifndef KDU_X86_INTRINSICS +#define KDU_X86_INTRINSICS 1 +#endif +#endif + // // KDU core header files // diff --git a/indra/llkdu/llkdumem.h b/indra/llkdu/llkdumem.h index 0ad67a3f92..02d895b3d0 100644 --- a/indra/llkdu/llkdumem.h +++ b/indra/llkdu/llkdumem.h @@ -27,6 +27,16 @@ #ifndef LL_LLKDUMEM_H #define LL_LLKDUMEM_H +#if defined(_M_ARM64) || defined(__arm64__) || defined(__aarch64__) +#ifndef KDU_NEON_INTRINSICS +#define KDU_NEON_INTRINSICS 1 +#endif +#else +#ifndef KDU_X86_INTRINSICS +#define KDU_X86_INTRINSICS 1 +#endif +#endif + // Support classes for reading and writing from memory buffers in KDU #define kdu_xxxx "kdu_image.h" #include "include_kdu_xxxx.h" diff --git a/indra/llmath/CMakeLists.txt b/indra/llmath/CMakeLists.txt index 801d3fe63e..ef781fa94a 100644 --- a/indra/llmath/CMakeLists.txt +++ b/indra/llmath/CMakeLists.txt @@ -6,6 +6,7 @@ include(00-Common) include(LLCommon) include(bugsplat) include(Boost) +include(SSE2NEON) set(llmath_SOURCE_FILES llbbox.cpp @@ -57,6 +58,7 @@ set(llmath_HEADER_FILES llmath.h llmatrix3a.h llmatrix3a.inl + llmatrix4a.h llmodularmath.h lloctree.h llperlin.h @@ -97,7 +99,7 @@ list(APPEND llmath_SOURCE_FILES ${llmath_HEADER_FILES}) add_library (llmath ${llmath_SOURCE_FILES}) -target_link_libraries(llmath llcommon llmeshoptimizer) +target_link_libraries(llmath llcommon llmeshoptimizer ll::sse2neon) target_include_directories( llmath INTERFACE ${CMAKE_CURRENT_SOURCE_DIR}) # Add tests diff --git a/indra/llmath/llsimdmath.h b/indra/llmath/llsimdmath.h index 592bb124c2..7d87385cfd 100644 --- a/indra/llmath/llsimdmath.h +++ b/indra/llmath/llsimdmath.h @@ -35,7 +35,7 @@ // because some versions of VS complain about '__SSE2__' //#if ( ( LL_DARWIN || LL_LINUX ) && !(__SSE2__) ) || ( LL_WINDOWS && ( _M_IX86_FP < 2 && ADDRESS_SIZE == 32 ) ) #if ( ( LL_DARWIN || LL_LINUX ) ) - #if !(__SSE2__) + #if !(__SSE2__) && !(__arm64__) && !(__aarch64__) #error SSE2 not enabled. LLVector4a and related class will not compile. #endif #elif ( LL_WINDOWS && ( _M_IX86_FP < 2 && ADDRESS_SIZE == 32 ) ) @@ -46,8 +46,12 @@ #include #endif +#if defined(__arm64__) || defined(__aarch64__) +#include "sse2neon.h" +#else #include #include +#endif #include "llmemory.h" #include "llsimdtypes.h" diff --git a/indra/llplugin/slplugin/CMakeLists.txt b/indra/llplugin/slplugin/CMakeLists.txt index 0ea6495eac..a45e52d3a1 100644 --- a/indra/llplugin/slplugin/CMakeLists.txt +++ b/indra/llplugin/slplugin/CMakeLists.txt @@ -30,18 +30,6 @@ add_executable(SLPlugin ${SLPlugin_SOURCE_FILES} ) -if (WINDOWS) -set_target_properties(SLPlugin - PROPERTIES - LINK_FLAGS_DEBUG "/NODEFAULTLIB:\"LIBCMTD\"" - ) -else () -set_target_properties(SLPlugin - PROPERTIES - MACOSX_BUNDLE_INFO_PLIST ${CMAKE_CURRENT_SOURCE_DIR}/slplugin_info.plist - ) -endif () - target_link_libraries(SLPlugin llplugin llmessage @@ -49,7 +37,21 @@ target_link_libraries(SLPlugin ll::pluginlibraries ) -if (DARWIN) +if (WINDOWS) + set_target_properties(SLPlugin + PROPERTIES + LINK_FLAGS_DEBUG "/NODEFAULTLIB:\"LIBCMTD\"" + ) +elseif (DARWIN) + set_target_properties(SLPlugin + PROPERTIES + OSX_ARCHITECTURES "x86_64" + BUILD_WITH_INSTALL_RPATH 1 + INSTALL_RPATH "@executable_path/../../../../Frameworks;@executable_path/../Frameworks;@executable_path/../Frameworks/plugins" + MACOSX_BUNDLE_INFO_PLIST ${CMAKE_CURRENT_SOURCE_DIR}/slplugin_info.plist + XCODE_ATTRIBUTE_DEBUG_INFORMATION_FORMAT "dwarf-with-dsym" + ) + # Make sure the app bundle has a Resources directory (it will get populated by viewer-manifest.py later) add_custom_command( TARGET SLPlugin POST_BUILD @@ -58,7 +60,7 @@ if (DARWIN) -p ${CMAKE_CURRENT_BINARY_DIR}/$,$,>/SLPlugin.app/Contents/Resources ) -endif (DARWIN) +endif () if (LL_TESTS) ll_deploy_sharedlibs_command(SLPlugin) diff --git a/indra/llwebrtc/CMakeLists.txt b/indra/llwebrtc/CMakeLists.txt index a18b716003..4fde489942 100644 --- a/indra/llwebrtc/CMakeLists.txt +++ b/indra/llwebrtc/CMakeLists.txt @@ -10,10 +10,6 @@ include(WebRTC) project(llwebrtc) -if (LINUX) - add_compile_options(-Wno-deprecated-declarations) # webrtc::CreateAudioDeviceWithDataObserver is deprecated -endif (LINUX) - set(llwebrtc_SOURCE_FILES llwebrtc.cpp ) @@ -65,6 +61,8 @@ target_include_directories( llwebrtc INTERFACE ${CMAKE_CURRENT_SOURCE_DIR}) if (WINDOWS) set_property(TARGET llwebrtc PROPERTY MSVC_RUNTIME_LIBRARY "MultiThreadedDebug") +else() + target_compile_options(llwebrtc PRIVATE -Wno-deprecated-declarations) # webrtc::CreateAudioDeviceWithDataObserver is deprecated endif (WINDOWS) ADD_CUSTOM_COMMAND(TARGET llwebrtc POST_BUILD diff --git a/indra/media_plugins/base/media_plugin_base.cpp b/indra/media_plugins/base/media_plugin_base.cpp index f31708c4d7..2e1e43d9e8 100644 --- a/indra/media_plugins/base/media_plugin_base.cpp +++ b/indra/media_plugins/base/media_plugin_base.cpp @@ -219,10 +219,8 @@ void SymbolGrabber::ungrabSymbols() #if LL_WINDOWS # define LLSYMEXPORT __declspec(dllexport) -#elif LL_LINUX -# define LLSYMEXPORT __attribute__ ((visibility("default"))) #else -# define LLSYMEXPORT /**/ +# define LLSYMEXPORT __attribute__ ((visibility("default"))) #endif extern "C" diff --git a/indra/media_plugins/cef/CMakeLists.txt b/indra/media_plugins/cef/CMakeLists.txt index 09b7a80503..75a14aeb1d 100644 --- a/indra/media_plugins/cef/CMakeLists.txt +++ b/indra/media_plugins/cef/CMakeLists.txt @@ -33,20 +33,20 @@ if (LINUX) message( "Looking for ${PULSE_FILE} ... found") endif() endforeach() - + include(FindPipeWire) include_directories(SYSTEM ${PIPEWIRE_INCLUDE_DIRS} ${SPA_INCLUDE_DIRS}) - + message( "Building with Linux volume catcher for PipeWire and PulseAudio" ) list(APPEND media_plugin_cef_HEADER_FILES linux/volume_catcher_linux.h ) - set(LINUX_VOLUME_CATCHER - linux/volume_catcher_linux.cpp + set(LINUX_VOLUME_CATCHER + linux/volume_catcher_linux.cpp linux/volume_catcher_pulseaudio.cpp - linux/volume_catcher_pipewire.cpp + linux/volume_catcher_pipewire.cpp ) list(APPEND media_plugin_cef_SOURCE_FILES ${LINUX_VOLUME_CATCHER}) @@ -76,7 +76,7 @@ target_link_libraries(media_plugin_cef if (DARWIN) find_library(CORESERVICES_LIBRARY CoreServices) find_library(AUDIOUNIT_LIBRARY AudioUnit) - + target_link_libraries(media_plugin_cef ${CORESERVICES_LIBRARY} # for Component Manager calls ${AUDIOUNIT_LIBRARY} # for AudioUnit calls @@ -87,6 +87,7 @@ if (DARWIN) media_plugin_cef PROPERTIES PREFIX "" + OSX_ARCHITECTURES "x86_64" BUILD_WITH_INSTALL_RPATH 1 INSTALL_NAME_DIR "@executable_path" LINK_FLAGS "-exported_symbols_list ${CMAKE_CURRENT_SOURCE_DIR}/../base/media_plugin_base.exp" diff --git a/indra/media_plugins/example/CMakeLists.txt b/indra/media_plugins/example/CMakeLists.txt index 62bc9de028..600fa05683 100644 --- a/indra/media_plugins/example/CMakeLists.txt +++ b/indra/media_plugins/example/CMakeLists.txt @@ -30,6 +30,7 @@ if (DARWIN) media_plugin_example PROPERTIES PREFIX "" + OSX_ARCHITECTURES "x86_64" BUILD_WITH_INSTALL_RPATH 1 INSTALL_NAME_DIR "@executable_path" LINK_FLAGS "-exported_symbols_list ${CMAKE_CURRENT_SOURCE_DIR}/../base/media_plugin_base.exp" diff --git a/indra/media_plugins/libvlc/CMakeLists.txt b/indra/media_plugins/libvlc/CMakeLists.txt index 384ebff235..752d7a9b25 100644 --- a/indra/media_plugins/libvlc/CMakeLists.txt +++ b/indra/media_plugins/libvlc/CMakeLists.txt @@ -34,6 +34,7 @@ if (DARWIN) media_plugin_libvlc PROPERTIES PREFIX "" + OSX_ARCHITECTURES "x86_64" BUILD_WITH_INSTALL_RPATH 1 INSTALL_NAME_DIR "@executable_path" LINK_FLAGS "-exported_symbols_list ${CMAKE_CURRENT_SOURCE_DIR}/../base/media_plugin_base.exp" diff --git a/indra/newview/CMakeLists.txt b/indra/newview/CMakeLists.txt index 234b3c6b5f..5e9bf94003 100644 --- a/indra/newview/CMakeLists.txt +++ b/indra/newview/CMakeLists.txt @@ -1426,7 +1426,7 @@ file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/viewer_version.txt" "${VIEWER_SHORT_VERSION}.${VIEWER_VERSION_REVISION}\n") set_source_files_properties( - llversioninfo.cpp tests/llversioninfo_test.cpp + llversioninfo.cpp tests/llversioninfo_test.cpp PROPERTIES COMPILE_DEFINITIONS "${VIEWER_CHANNEL_VERSION_DEFINES}" # see BuildVersion.cmake ) @@ -1637,7 +1637,7 @@ endif (WINDOWS) file(GLOB_RECURSE viewer_XUI_FILES LIST_DIRECTORIES FALSE ${CMAKE_CURRENT_SOURCE_DIR}/skins/*.xml) source_group(TREE ${CMAKE_CURRENT_SOURCE_DIR}/skins PREFIX "XUI Files" FILES ${viewer_XUI_FILES}) -set_source_files_properties(${viewer_XUI_FILES} +set_source_files_properties(${viewer_XUI_FILES} PROPERTIES HEADER_FILE_ONLY TRUE) list(APPEND viewer_SOURCE_FILES ${viewer_XUI_FILES}) @@ -1645,7 +1645,7 @@ list(APPEND viewer_SOURCE_FILES ${viewer_XUI_FILES}) file(GLOB_RECURSE viewer_SHADER_FILES LIST_DIRECTORIES FALSE ${CMAKE_CURRENT_SOURCE_DIR}/app_settings/shaders/*.glsl) source_group(TREE ${CMAKE_CURRENT_SOURCE_DIR}/app_settings/shaders PREFIX "Shaders" FILES ${viewer_SHADER_FILES}) -set_source_files_properties(${viewer_SHADER_FILES} +set_source_files_properties(${viewer_SHADER_FILES} PROPERTIES HEADER_FILE_ONLY TRUE) list(APPEND viewer_SOURCE_FILES ${viewer_SHADER_FILES}) @@ -1653,7 +1653,7 @@ list(APPEND viewer_SOURCE_FILES ${viewer_SHADER_FILES}) file(GLOB_RECURSE viewer_LUA_SCRIPT_FILES LIST_DIRECTORIES FALSE ${CMAKE_CURRENT_SOURCE_DIR}/scripts/lua/*.lua) source_group(TREE ${CMAKE_CURRENT_SOURCE_DIR}/scripts/lua PREFIX "LUA Scripts" FILES ${viewer_LUA_SCRIPT_FILES}) -set_source_files_properties(${viewer_LUA_SCRIPT_FILES} +set_source_files_properties(${viewer_LUA_SCRIPT_FILES} PROPERTIES HEADER_FILE_ONLY TRUE) list(APPEND viewer_SOURCE_FILES ${viewer_LUA_SCRIPT_FILES}) @@ -1707,6 +1707,15 @@ set_source_files_properties(${viewer_CHARACTER_FILES} PROPERTIES HEADER_FILE_ONLY TRUE) list(APPEND viewer_SOURCE_FILES ${viewer_CHARACTER_FILES}) +set(viewer_MISC_FILES + viewer_manifest.py + ) + +set_source_files_properties(${viewer_MISC_FILES} + PROPERTIES HEADER_FILE_ONLY TRUE) + +list(APPEND viewer_SOURCE_FILES ${viewer_MISC_FILES}) + if (WINDOWS) file(GLOB viewer_INSTALLER_FILES installers/windows/*.nsi) @@ -1932,7 +1941,8 @@ if (WINDOWS) elseif (DARWIN) set_target_properties(${VIEWER_BINARY_NAME} PROPERTIES - LINK_FLAGS_RELEASE "${LINK_FLAGS_RELEASE} -Xlinker -dead_strip -Xlinker -map -Xlinker ${CMAKE_CURRENT_BINARY_DIR}/${VIEWER_BINARY_NAME}.MAP" + XCODE_ATTRIBUTE_LD_GENERATE_MAP_FILE YES + LINK_FLAGS_RELEASE "${LINK_FLAGS_RELEASE} -Xlinker -dead_strip" # -Xlinker -map -Xlinker ${CMAKE_CURRENT_BINARY_DIR}/${VIEWER_BINARY_NAME}.MAP" ) else (WINDOWS) # Linux @@ -1955,7 +1965,7 @@ endif (WINDOWS) # one of these being libz where you can find four or more versions in play # at once. On Linux, libz can be found at link and run time via a number # of paths: -# +# # => -lfreetype # => libz.so.1 (on install machine, not build) # => -lSDL @@ -2029,7 +2039,7 @@ foreach(elem ${country_codes}) set(emoji_mapping_src_file "${emoji_mapping_src_folder}/${elem}/emoji_characters.xml") set(emoji_mapping_dst_file - "${emoji_mapping_dst_folder}/${elem}/emoji_characters.xml") + "${emoji_mapping_dst_folder}/${elem}/emoji_characters.xml") configure_file(${emoji_mapping_src_file} ${emoji_mapping_dst_file} COPYONLY) endforeach() @@ -2130,16 +2140,14 @@ if (DARWIN) # https://blog.kitware.com/upcoming-in-cmake-2-8-12-osx-rpath-support/ set(CMAKE_MACOSX_RPATH 1) - + set_target_properties( ${VIEWER_BINARY_NAME} PROPERTIES OUTPUT_NAME "${product}" # From Contents/MacOS/SecondLife, look in Contents/Frameworks - INSTALL_RPATH "@loader_path/../Frameworks" - # SIGH, as of 2018-05-24 (cmake 3.11.1) the INSTALL_RPATH property simply - # does not work. Try this: - LINK_FLAGS "-rpath @loader_path/../Frameworks" + BUILD_WITH_INSTALL_RPATH 1 + INSTALL_RPATH "@executable_path/../Frameworks" MACOSX_BUNDLE_INFO_PLIST "${CMAKE_CURRENT_SOURCE_DIR}/Info-SecondLife.plist" XCODE_ATTRIBUTE_PRODUCT_BUNDLE_IDENTIFIER "${MACOSX_BUNDLE_GUI_IDENTIFIER}" ) @@ -2249,7 +2257,7 @@ if (PACKAGE AND (RELEASE_CRASH_REPORTING OR NON_RELEASE_CRASH_REPORTING) AND VIE PROPERTIES XCODE_ATTRIBUTE_DEBUG_INFORMATION_FORMAT "dwarf-with-dsym" XCODE_ATTRIBUTE_DWARF_DSYM_FOLDER_PATH "${SYMBOLS_STAGING_DIR}/dSYMs") - + add_custom_command(OUTPUT "${VIEWER_APP_XCARCHIVE}" COMMAND "zip" ARGS @@ -2284,7 +2292,7 @@ if (LL_TESTS) # llremoteparcelrequest.cpp llviewerhelputil.cpp llversioninfo.cpp -# llvocache.cpp +# llvocache.cpp llworldmap.cpp llworldmipmap.cpp ) @@ -2293,7 +2301,7 @@ if (LL_TESTS) llworldmap.cpp llworldmipmap.cpp PROPERTIES - LL_TEST_ADDITIONAL_SOURCE_FILES + LL_TEST_ADDITIONAL_SOURCE_FILES tests/llviewertexture_stub.cpp #llviewertexturelist.cpp ) @@ -2328,7 +2336,7 @@ if (LL_TESTS) llworldmap.cpp llworldmipmap.cpp PROPERTIES - LL_TEST_ADDITIONAL_SOURCE_FILES + LL_TEST_ADDITIONAL_SOURCE_FILES tests/llviewertexture_stub.cpp ) diff --git a/indra/newview/llappviewer.cpp b/indra/newview/llappviewer.cpp index ff2500d24f..061c57addd 100644 --- a/indra/newview/llappviewer.cpp +++ b/indra/newview/llappviewer.cpp @@ -983,6 +983,7 @@ bool LLAppViewer::init() return false; } +#if defined(LL_X86) || defined(LL_X86_64) // Without SSE2 support we will crash almost immediately, warn here. if (!gSysCPU.hasSSE2()) { @@ -994,6 +995,7 @@ bool LLAppViewer::init() // quit immediately return false; } +#endif // alert the user if they are using unsupported hardware if (!gSavedSettings.getBOOL("AlertedUnsupportedHardware")) @@ -1376,7 +1378,7 @@ void LLAppViewer::initMaxHeapSize() //------------------------------------------------------------------------------------------ //currently SL is built under 32-bit setting, we set its max heap size no more than 1.6 GB. - #ifndef LL_X86_64 + #if !defined(LL_X86_64) && !defined(LL_ARM64) F32Gigabytes max_heap_size_gb = (F32Gigabytes)gSavedSettings.getF32("MaxHeapSize") ; #else F32Gigabytes max_heap_size_gb = (F32Gigabytes)gSavedSettings.getF32("MaxHeapSize64"); @@ -3381,7 +3383,11 @@ LLSD LLAppViewer::getViewerInfo() const versionInfo.getPatch(), stringize(versionInfo.getBuild())); info["VIEWER_VERSION_STR"] = versionInfo.getVersion(); info["CHANNEL"] = versionInfo.getChannel(); +#if LL_ARM64 + info["ADDRESS_SIZE"] = "ARM64"; +#else info["ADDRESS_SIZE"] = ADDRESS_SIZE; +#endif std::string build_config = versionInfo.getBuildConfig(); if (build_config != "Release") { @@ -5616,7 +5622,9 @@ void LLAppViewer::forceErrorBreakpoint() #ifdef LL_WINDOWS DebugBreak(); #else +#if defined(LL_X86) || defined(LL_X86_64) asm ("int $3"); +#endif #endif return; } diff --git a/indra/newview/pipeline.cpp b/indra/newview/pipeline.cpp index ed6298c108..99fe21f1c2 100644 --- a/indra/newview/pipeline.cpp +++ b/indra/newview/pipeline.cpp @@ -126,7 +126,7 @@ #define A_GCC 1 #pragma GCC diagnostic ignored "-Wunused-function" #pragma GCC diagnostic ignored "-Wunused-variable" -#if LL_LINUX && defined(__GNUC__) && !defined(__clang__) +#if LL_LINUX && LL_GNUC #pragma GCC diagnostic ignored "-Wrestrict" #endif #endif diff --git a/indra/newview/viewer_manifest.py b/indra/newview/viewer_manifest.py index 40fc002ae7..a9a7b9c5d8 100755 --- a/indra/newview/viewer_manifest.py +++ b/indra/newview/viewer_manifest.py @@ -867,7 +867,10 @@ def construct(self): # CEF framework goes inside Contents/Frameworks. # Remember where we parked this car. - with self.prefix(src="", dst="Frameworks"): + with self.prefix(src=relpkgdir, dst="Frameworks"): + self.path("libndofdev.dylib") + self.path("libSDL2.dylib") + CEF_framework = "Chromium Embedded Framework.framework" self.path2basename(relpkgdir, CEF_framework) CEF_framework = self.dst_path_of(CEF_framework) @@ -875,6 +878,22 @@ def construct(self): if self.args.get('bugsplat'): self.path2basename(relpkgdir, "BugsplatMac.framework") + # OpenAL dylibs + if self.args['openal'] == 'ON': + for libfile in ( + "libopenal.dylib", + "libalut.dylib", + ): + self.path(libfile) + + # WebRTC libraries + with self.prefix(src=os.path.join(self.args['build'], os.pardir, + 'sharedlibs', self.args['buildtype'], 'Resources')): + for libfile in ( + 'libllwebrtc.dylib', + ): + self.path(libfile) + with self.prefix(dst="MacOS"): executable = self.dst_path_of(self.channel()) if self.args.get('bugsplat'): @@ -934,10 +953,6 @@ def construct(self): self.path("*.png") self.path("*.gif") - with self.prefix(src=relpkgdir, dst=""): - self.path("libndofdev.dylib") - self.path("libSDL2-*.dylib") - with self.prefix(src_dst="cursors_mac"): self.path("*.tif") @@ -997,20 +1012,6 @@ def path_optional(src, dst): print("Skipping %s" % dst) return added - # WebRTC libraries - with self.prefix(src=os.path.join(self.args['build'], os.pardir, - 'sharedlibs', self.args['buildtype'], 'Resources')): - for libfile in ( - 'libllwebrtc.dylib', - ): - self.path(libfile) - - oldpath = os.path.join("@rpath", libfile) - self.run_command( - ['install_name_tool', '-change', oldpath, - '@executable_path/../Resources/%s' % libfile, - executable]) - # dylibs is a list of all the .dylib files we expect to need # in our bundled sub-apps. For each of these we'll create a # symlink from sub-app/Contents/Resources to the real .dylib. @@ -1028,14 +1029,6 @@ def path_optional(src, dst): ): self.path2basename(relpkgdir, libfile) - # OpenAL dylibs - if self.args['openal'] == 'ON': - for libfile in ( - "libopenal.dylib", - "libalut.dylib", - ): - dylibs += path_optional(os.path.join(relpkgdir, libfile), libfile) - # our apps executable_path = {} embedded_apps = [ (os.path.join("llplugin", "slplugin"), "SLPlugin.app") ] @@ -1418,8 +1411,6 @@ def construct(self): #debpkgdir = os.path.join(pkgdir, "lib", "debug") with self.prefix(src=relpkgdir, dst="lib"): - self.path("libapr-1.so*") - self.path("libaprutil-1.so*") self.path_optional("libSDL*.so.*") self.path_optional("libjemalloc*.so") From 13b62d8d1e2cd846c9ff8a2d5c865b3943657fba Mon Sep 17 00:00:00 2001 From: Rye Date: Sat, 16 Nov 2024 01:28:30 -0500 Subject: [PATCH 12/23] Clean up deprecated and dead code for macOS --- indra/llwindow/llopenglview-objc.h | 4 -- indra/llwindow/llopenglview-objc.mm | 54 +++++++++---------------- indra/llwindow/llwindow.h | 1 - indra/llwindow/llwindowmacosx-objc.h | 1 - indra/llwindow/llwindowmacosx-objc.mm | 7 +--- indra/llwindow/llwindowmacosx.h | 3 -- indra/newview/llappdelegate-objc.mm | 2 +- indra/newview/llappviewer.cpp | 11 ----- indra/newview/llappviewermacosx-objc.h | 3 -- indra/newview/llappviewermacosx-objc.mm | 39 ------------------ indra/newview/llfilepicker_mac.mm | 6 +-- 11 files changed, 23 insertions(+), 108 deletions(-) diff --git a/indra/llwindow/llopenglview-objc.h b/indra/llwindow/llopenglview-objc.h index 97f4125484..85cd53407c 100644 --- a/indra/llwindow/llopenglview-objc.h +++ b/indra/llwindow/llopenglview-objc.h @@ -42,7 +42,6 @@ unsigned int mMarkedTextLength; bool mMarkedTextAllowed; bool mSimulatedRightClick; - bool mOldResize; } - (id) initWithSamples:(NSUInteger)samples; - (id) initWithSamples:(NSUInteger)samples andVsync:(BOOL)vsync; @@ -50,8 +49,6 @@ - (void)commitCurrentPreedit; -- (void) setOldResize:(bool)oldresize; - // rebuildContext // Destroys and recreates a context with the view's internal format set via setPixelFormat; // Use this in event of needing to rebuild a context for whatever reason, without needing to assign a new pixel format. @@ -68,7 +65,6 @@ - (unsigned long) getVramSize; - (void) allowMarkedTextInput:(bool)allowed; -- (void) viewDidEndLiveResize; @end diff --git a/indra/llwindow/llopenglview-objc.mm b/indra/llwindow/llopenglview-objc.mm index 0bd4e506a2..9d60751f70 100644 --- a/indra/llwindow/llopenglview-objc.mm +++ b/indra/llwindow/llopenglview-objc.mm @@ -123,16 +123,6 @@ - (NSPoint)flipPoint:(NSPoint)aPoint @implementation LLOpenGLView -// Force a high quality update after live resizing -- (void) viewDidEndLiveResize -{ - if (mOldResize) //Maint-3135 - { - NSSize size = [self frame].size; - callResize(size.width, size.height); - } -} - - (unsigned long)getVramSize { CGLRendererInfoObj info = 0; @@ -187,14 +177,8 @@ - (void)viewDidMoveToWindow } } -- (void)setOldResize:(bool)oldresize -{ - mOldResize = oldresize; -} - - (void)windowResized:(NSNotification *)notification; { - if (!mOldResize) //Maint-3288 { NSSize dev_sz = gHiDPISupport ? [self convertSizeToBacking:[self frame].size] : [self frame].size; callResize(dev_sz.width, dev_sz.height); @@ -244,7 +228,7 @@ - (id) initWithSamples:(NSUInteger)samples andVsync:(BOOL)vsync - (id) initWithFrame:(NSRect)frame withSamples:(NSUInteger)samples andVsync:(BOOL)vsync { - [self registerForDraggedTypes:[NSArray arrayWithObject:NSURLPboardType]]; + [self registerForDraggedTypes:[NSArray arrayWithObject:NSPasteboardTypeURL]]; [self initWithFrame:frame]; // Initialize with a default "safe" pixel format that will work with versions dating back to OS X 10.6. @@ -295,16 +279,14 @@ - (id) initWithFrame:(NSRect)frame withSamples:(NSUInteger)samples andVsync:(BOO if (vsync) { GLint value = 1; - [glContext setValues:&value forParameter:NSOpenGLCPSwapInterval]; + [glContext setValues:&value forParameter:NSOpenGLContextParameterSwapInterval]; } else { // supress this error after move to Xcode 7: // error: null passed to a callee that requires a non-null argument [-Werror,-Wnonnull] // Tried using ObjC 'nonnull' keyword as per SO article but didn't build GLint swapInterval=0; - [glContext setValues:&swapInterval forParameter:NSOpenGLCPSwapInterval]; + [glContext setValues:&swapInterval forParameter:NSOpenGLContextParameterSwapInterval]; } - - mOldResize = false; return self; } @@ -355,13 +337,13 @@ - (void) mouseDown:(NSEvent *)theEvent mMousePos[1] = mPoint.y; // Apparently people still use this? - if ([theEvent modifierFlags] & NSCommandKeyMask && - !([theEvent modifierFlags] & NSControlKeyMask) && - !([theEvent modifierFlags] & NSShiftKeyMask) && - !([theEvent modifierFlags] & NSAlternateKeyMask) && - !([theEvent modifierFlags] & NSAlphaShiftKeyMask) && - !([theEvent modifierFlags] & NSFunctionKeyMask) && - !([theEvent modifierFlags] & NSHelpKeyMask)) + if ([theEvent modifierFlags] & NSEventModifierFlagCommand && + !([theEvent modifierFlags] & NSEventModifierFlagControl) && + !([theEvent modifierFlags] & NSEventModifierFlagShift) && + !([theEvent modifierFlags] & NSEventModifierFlagOption) && + !([theEvent modifierFlags] & NSEventModifierFlagCapsLock) && + !([theEvent modifierFlags] & NSEventModifierFlagFunction) && + !([theEvent modifierFlags] & NSEventModifierFlagHelp)) { callRightMouseDown(mMousePos, [theEvent modifierFlags]); mSimulatedRightClick = true; @@ -511,7 +493,7 @@ - (void) keyDown:(NSEvent *)theEvent if (acceptsText && !mMarkedTextAllowed && - !(mModifiers & (NSControlKeyMask | NSCommandKeyMask)) && // commands don't invoke InputWindow + !(mModifiers & (NSEventModifierFlagControl | NSEventModifierFlagCommand)) && // commands don't invoke InputWindow ![(LLAppDelegate*)[NSApp delegate] romanScript] && ch > ' ' && ch != NSDeleteCharacter && @@ -535,13 +517,13 @@ - (void)flagsChanged:(NSEvent *)theEvent switch([theEvent keyCode]) { case 56: - mask = NSShiftKeyMask; + mask = NSEventModifierFlagShift; break; case 58: - mask = NSAlternateKeyMask; + mask = NSEventModifierFlagOption; break; case 59: - mask = NSControlKeyMask; + mask = NSEventModifierFlagControl; break; default: return; @@ -582,7 +564,7 @@ - (NSDragOperation) draggingEntered:(id)sender pboard = [sender draggingPasteboard]; - if ([[pboard types] containsObject:NSURLPboardType]) + if ([[pboard types] containsObject:NSPasteboardTypeURL]) { if (sourceDragMask & NSDragOperationLink) { NSURL *fileUrl = [[pboard readObjectsForClasses:[NSArray arrayWithObject:[NSURL class]] options:[NSDictionary dictionary]] objectAtIndex:0]; @@ -783,9 +765,9 @@ - (void)insertText:(id)aString replacementRange:(NSRange)replacementRange - (void) insertNewline:(id)sender { - if (!(mModifiers & NSCommandKeyMask) && - !(mModifiers & NSShiftKeyMask) && - !(mModifiers & NSAlternateKeyMask)) + if (!(mModifiers & NSEventModifierFlagCommand) && + !(mModifiers & NSEventModifierFlagShift) && + !(mModifiers & NSEventModifierFlagOption)) { callUnicodeCallback(13, 0); } else { diff --git a/indra/llwindow/llwindow.h b/indra/llwindow/llwindow.h index 24debf339d..0d4e2dfdfc 100644 --- a/indra/llwindow/llwindow.h +++ b/indra/llwindow/llwindow.h @@ -148,7 +148,6 @@ class LLWindow : public LLInstanceTracker virtual void swapBuffers() = 0; virtual void bringToFront() = 0; virtual void focusClient() { }; // this may not have meaning or be required on other platforms, therefore, it's not abstract - virtual void setOldResize(bool oldresize) { }; // handy coordinate space conversion routines // NB: screen to window and vice verse won't work on width/height coordinate pairs, // as the conversion must take into account left AND right border widths, etc. diff --git a/indra/llwindow/llwindowmacosx-objc.h b/indra/llwindow/llwindowmacosx-objc.h index 620bbc8876..fd4a2df298 100644 --- a/indra/llwindow/llwindowmacosx-objc.h +++ b/indra/llwindow/llwindowmacosx-objc.h @@ -100,7 +100,6 @@ bool isCGCursorVisible(); void hideNSCursorTillMove(bool hide); void requestUserAttention(); long showAlert(std::string title, std::string text, int type); -void setResizeMode(bool oldresize, void* glview); NSWindowRef createNSWindow(int x, int y, int width, int height); diff --git a/indra/llwindow/llwindowmacosx-objc.mm b/indra/llwindow/llwindowmacosx-objc.mm index 01feac7885..6b856103d9 100644 --- a/indra/llwindow/llwindowmacosx-objc.mm +++ b/indra/llwindow/llwindowmacosx-objc.mm @@ -213,7 +213,7 @@ OSErr setImageCursor(CursorRef ref) NSWindowRef createNSWindow(int x, int y, int width, int height) { LLNSWindow *window = [[LLNSWindow alloc]initWithContentRect:NSMakeRect(x, y, width, height) - styleMask:NSTitledWindowMask | NSResizableWindowMask | NSClosableWindowMask | NSMiniaturizableWindowMask | NSTexturedBackgroundWindowMask backing:NSBackingStoreBuffered defer:NO]; + styleMask:NSWindowStyleMaskTitled | NSWindowStyleMaskResizable | NSWindowStyleMaskClosable | NSWindowStyleMaskMiniaturizable backing:NSBackingStoreBuffered defer:NO]; [window makeKeyAndOrderFront:nil]; [window setAcceptsMouseMovedEvents:TRUE]; [window setRestorable:FALSE]; // Viewer manages state from own settings @@ -227,11 +227,6 @@ GLViewRef createOpenGLView(NSWindowRef window, unsigned int samples, bool vsync) return glview; } -void setResizeMode(bool oldresize, void* glview) -{ - [(LLOpenGLView *)glview setOldResize:oldresize]; -} - void glSwapBuffers(void* context) { [(NSOpenGLContext*)context flushBuffer]; diff --git a/indra/llwindow/llwindowmacosx.h b/indra/llwindow/llwindowmacosx.h index 7500fb275b..5b7d09f66d 100644 --- a/indra/llwindow/llwindowmacosx.h +++ b/indra/llwindow/llwindowmacosx.h @@ -172,9 +172,6 @@ class LLWindowMacOSX : public LLWindow bool shouldPostQuit() { return mPostQuit; } - //Satisfy MAINT-3135 and MAINT-3288 with a flag. - /*virtual */ void setOldResize(bool oldresize) override {setResizeMode(oldresize, mGLView); } - private: void restoreGLContext(); diff --git a/indra/newview/llappdelegate-objc.mm b/indra/newview/llappdelegate-objc.mm index 1090888c1c..d7127c5392 100644 --- a/indra/newview/llappdelegate-objc.mm +++ b/indra/newview/llappdelegate-objc.mm @@ -371,7 +371,7 @@ @implementation LLApplication - (void)sendEvent:(NSEvent *)event { [super sendEvent:event]; - if ([event type] == NSKeyUp && ([event modifierFlags] & NSCommandKeyMask)) + if ([event type] == NSEventTypeKeyUp && ([event modifierFlags] & NSEventModifierFlagCommand)) { [[self keyWindow] sendEvent:event]; } diff --git a/indra/newview/llappviewer.cpp b/indra/newview/llappviewer.cpp index 061c57addd..c2b3d520e4 100644 --- a/indra/newview/llappviewer.cpp +++ b/indra/newview/llappviewer.cpp @@ -3259,17 +3259,6 @@ bool LLAppViewer::initWindow() LLNotificationsUI::LLNotificationManager::getInstance(); - -#ifdef LL_DARWIN - //Satisfy both MAINT-3135 (OSX 10.6 and earlier) MAINT-3288 (OSX 10.7 and later) - LLOSInfo& os_info = LLOSInfo::instance(); - if (os_info.mMajorVer == 10 && os_info.mMinorVer < 7) - { - if ( os_info.mMinorVer == 6 && os_info.mBuild < 8 ) - gViewerWindow->getWindow()->setOldResize(true); - } -#endif - if (gSavedSettings.getBOOL("WindowMaximized")) { gViewerWindow->getWindow()->maximize(); diff --git a/indra/newview/llappviewermacosx-objc.h b/indra/newview/llappviewermacosx-objc.h index d0ae0a7fc2..3fbf4202f1 100644 --- a/indra/newview/llappviewermacosx-objc.h +++ b/indra/newview/llappviewermacosx-objc.h @@ -30,9 +30,6 @@ #include #include -//Why? Because BOOL -void launchApplication(const std::string* app_name, const std::vector* args); - void force_ns_sxeption(); #endif // LL_LLAPPVIEWERMACOSX_OBJC_H diff --git a/indra/newview/llappviewermacosx-objc.mm b/indra/newview/llappviewermacosx-objc.mm index 9b6bfe621b..2ea3f2f171 100644 --- a/indra/newview/llappviewermacosx-objc.mm +++ b/indra/newview/llappviewermacosx-objc.mm @@ -33,45 +33,6 @@ #include "llappviewermacosx-objc.h" -void launchApplication(const std::string* app_name, const std::vector* args) -{ - - NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init]; - - if (app_name->empty()) return; - - NSMutableString* app_name_ns = [NSMutableString stringWithString:[[NSBundle mainBundle] resourcePath]]; //Path to resource dir - [app_name_ns appendFormat:@"/%@", [NSString stringWithCString:app_name->c_str() - encoding:[NSString defaultCStringEncoding]]]; - - NSMutableArray *args_ns = nil; - args_ns = [[NSMutableArray alloc] init]; - - for (int i=0; i < args->size(); ++i) - { - NSLog(@"Adding string %s", (*args)[i].c_str()); - [args_ns addObject: - [NSString stringWithCString:(*args)[i].c_str() - encoding:[NSString defaultCStringEncoding]]]; - } - - NSTask *task = [[NSTask alloc] init]; - NSBundle *bundle = [NSBundle bundleWithPath:[[NSWorkspace sharedWorkspace] fullPathForApplication:app_name_ns]]; - [task setLaunchPath:[bundle executablePath]]; - [task setArguments:args_ns]; - [task launch]; - -// NSWorkspace *workspace = [NSWorkspace sharedWorkspace]; -// NSURL *url = [NSURL fileURLWithPath:[workspace fullPathForApplication:app_name_ns]]; -// -// NSError *error = nil; -// [workspace launchApplicationAtURL:url options:0 configuration:[NSDictionary dictionaryWithObject:args_ns forKey:NSWorkspaceLaunchConfigurationArguments] error:&error]; - //TODO Handle error - - [pool release]; - return; -} - void force_ns_sxeption() { NSException *exception = [NSException exceptionWithName:@"Forced NSException" reason:nullptr userInfo:nullptr]; diff --git a/indra/newview/llfilepicker_mac.mm b/indra/newview/llfilepicker_mac.mm index b21bc724fb..978069457c 100644 --- a/indra/newview/llfilepicker_mac.mm +++ b/indra/newview/llfilepicker_mac.mm @@ -86,7 +86,7 @@ result = [panel runModal]; - if (result == NSOKButton) + if (result == NSModalResponseOK) { NSArray *filesToOpen = [panel URLs]; int i, count = [filesToOpen count]; @@ -173,7 +173,7 @@ void doLoadDialogModeless(const std::vector* allowed_types, [panel setNameFieldStringValue: fileName]; [panel setDirectoryURL: url]; if([panel runModal] == - NSFileHandlingPanelOKButton) + NSModalResponseOK) { NSURL* url = [panel URL]; NSString* p = [url path]; @@ -211,7 +211,7 @@ void doSaveDialogModeless(const std::string* file, [panel beginWithCompletionHandler:^(NSModalResponse result) { - if (result == NSOKButton) + if (result == NSModalResponseOK) { NSURL* url = [panel URL]; NSString* p = [url path]; From 6e94e1081d40330008e90525e77408835134f39a Mon Sep 17 00:00:00 2001 From: Rye Date: Fri, 15 Nov 2024 23:24:21 -0500 Subject: [PATCH 13/23] Explicitly disable multisample buffers for macos ogl context --- indra/llwindow/llopenglview-objc.mm | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/indra/llwindow/llopenglview-objc.mm b/indra/llwindow/llopenglview-objc.mm index 9d60751f70..25c6a9b233 100644 --- a/indra/llwindow/llopenglview-objc.mm +++ b/indra/llwindow/llopenglview-objc.mm @@ -231,16 +231,13 @@ - (id) initWithFrame:(NSRect)frame withSamples:(NSUInteger)samples andVsync:(BOO [self registerForDraggedTypes:[NSArray arrayWithObject:NSPasteboardTypeURL]]; [self initWithFrame:frame]; - // Initialize with a default "safe" pixel format that will work with versions dating back to OS X 10.6. - // Any specialized pixel formats, i.e. a core profile pixel format, should be initialized through rebuildContextWithFormat. - // 10.7 and 10.8 don't really care if we're defining a profile or not. If we don't explicitly request a core or legacy profile, it'll always assume a legacy profile (for compatibility reasons). NSOpenGLPixelFormatAttribute attrs[] = { NSOpenGLPFANoRecovery, NSOpenGLPFADoubleBuffer, NSOpenGLPFAClosestPolicy, NSOpenGLPFAAccelerated, - NSOpenGLPFASampleBuffers, static_cast(samples > 0 ? 1 : 0), - NSOpenGLPFASamples, static_cast(samples), + NSOpenGLPFASampleBuffers, 0, + NSOpenGLPFASamples, 0, NSOpenGLPFAStencilSize, 8, NSOpenGLPFADepthSize, 24, NSOpenGLPFAAlphaSize, 8, From 041224e0f2a96d9b08b42317fcf4812db6f0e140 Mon Sep 17 00:00:00 2001 From: Rye Date: Fri, 15 Nov 2024 23:27:58 -0500 Subject: [PATCH 14/23] Clean up LLAppleVBOPool leak --- indra/llrender/llvertexbuffer.cpp | 6 ------ 1 file changed, 6 deletions(-) diff --git a/indra/llrender/llvertexbuffer.cpp b/indra/llrender/llvertexbuffer.cpp index 1f0c424188..6974c087f2 100644 --- a/indra/llrender/llvertexbuffer.cpp +++ b/indra/llrender/llvertexbuffer.cpp @@ -787,12 +787,6 @@ void LLVertexBuffer::drawElements(U32 mode, const LLVector4a* pos, const LLVecto gGL.syncMatrices(); - U32 mask = LLVertexBuffer::MAP_VERTEX; - if (tc) - { - mask = mask | LLVertexBuffer::MAP_TEXCOORD0; - } - unbind(); gGL.begin(mode); From 197475b82e119da5ab36547ce08c9586eed722be Mon Sep 17 00:00:00 2001 From: Rye Date: Sat, 16 Nov 2024 03:51:33 -0500 Subject: [PATCH 15/23] Restore support for anistropic filtering on macos --- indra/llrender/llgl.cpp | 7 ++++++- indra/llrender/llrender.cpp | 2 +- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/indra/llrender/llgl.cpp b/indra/llrender/llgl.cpp index 779fde6d56..5740328a45 100644 --- a/indra/llrender/llgl.cpp +++ b/indra/llrender/llgl.cpp @@ -1254,7 +1254,7 @@ bool LLGLManager::initGL() // there's some implementation that reports a crazy value mMaxUniformBlockSize = llmin(mMaxUniformBlockSize, 65536); - if (mGLVersion >= 4.59f) + if (mHasAnisotropic) { glGetFloatv(GL_MAX_TEXTURE_MAX_ANISOTROPY, &mMaxAnisotropy); } @@ -1421,6 +1421,11 @@ void LLGLManager::initExtensions() mHasCubeMapArray = mGLVersion >= 3.99f; mHasTransformFeedback = mGLVersion >= 3.99f; mHasDebugOutput = mGLVersion >= 4.29f; + mHasAnisotropic = mGLVersion >= 4.59f; + if(!mHasAnisotropic && gGLHExts.mSysExts) + { + mHasAnisotropic = ExtensionExists("GL_EXT_texture_filter_anisotropic", gGLHExts.mSysExts); + } #if LL_WINDOWS || LL_LINUX if( gGLHExts.mSysExts ) diff --git a/indra/llrender/llrender.cpp b/indra/llrender/llrender.cpp index 82bf4d2244..4e38b02a3d 100644 --- a/indra/llrender/llrender.cpp +++ b/indra/llrender/llrender.cpp @@ -517,7 +517,7 @@ void LLTexUnit::setTextureFilteringOption(LLTexUnit::eTextureFilterOptions optio } } - if (gGLManager.mGLVersion >= 4.59f) + if (gGLManager.mHasAnisotropic) { if (LLImageGL::sGlobalUseAnisotropic && option == TFO_ANISOTROPIC) { From 82c3cc6ffe617fa44630c6a0b6df9f37783b4610 Mon Sep 17 00:00:00 2001 From: Rye Date: Sat, 16 Nov 2024 05:49:34 -0500 Subject: [PATCH 16/23] Build macos nib file from xib file as part of build process --- indra/newview/CMakeLists.txt | 3 +- indra/newview/SecondLife.nib | Bin 12345 -> 0 bytes indra/newview/SecondLife.xib | 1327 +++++------------------------- indra/newview/viewer_manifest.py | 1 - 4 files changed, 194 insertions(+), 1137 deletions(-) delete mode 100644 indra/newview/SecondLife.nib diff --git a/indra/newview/CMakeLists.txt b/indra/newview/CMakeLists.txt index 5e9bf94003..7cc1979a0e 100644 --- a/indra/newview/CMakeLists.txt +++ b/indra/newview/CMakeLists.txt @@ -1470,7 +1470,7 @@ if (DARWIN) set(viewer_RESOURCE_FILES secondlife.icns Info-SecondLife.plist - SecondLife.xib/ + SecondLife.xib # CMake doesn't seem to support Xcode language variants well just yet English.lproj/InfoPlist.strings English.lproj/language.txt @@ -1941,6 +1941,7 @@ if (WINDOWS) elseif (DARWIN) set_target_properties(${VIEWER_BINARY_NAME} PROPERTIES + RESOURCE SecondLife.xib XCODE_ATTRIBUTE_LD_GENERATE_MAP_FILE YES LINK_FLAGS_RELEASE "${LINK_FLAGS_RELEASE} -Xlinker -dead_strip" # -Xlinker -map -Xlinker ${CMAKE_CURRENT_BINARY_DIR}/${VIEWER_BINARY_NAME}.MAP" ) diff --git a/indra/newview/SecondLife.nib b/indra/newview/SecondLife.nib deleted file mode 100644 index c4ddca50dc15061906b29abb4e547aa17d039b45..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 12345 zcmcI~2Ygf2+y5E2O#^9@n{;IFAhUxF4pylYTPSTQt5QN6Akro!Nr74`CtART>?ON^ zfQSg{4*`*-AVW3?vP6~$B8s?`_qq4BwT#!#@ALnE-h`BU&v?!=zt3~dy+ccjy}?j& z@-c)FK@@Q)0!4B^a6k5Uj`jqCUcaxu(?9eXPhluH!08SYj_^Wrt~2B>RUf~KOG=nb?Etw-;n zPths#B|44HptI;4I*-0W7tq(}BD#bwqbukt`UYJ?-=gd2Z!E(q9EWw-gdO-1+zcn- z?)WL(3-`krxIcE|p|}ta!y|Dq_TvD44p-vm@eBAR{4!3(lkikL4bQ~0@I1T{uflKP z)p#BL0Pn#E@lkvXAID$f)A(zA1z*QE@Q?U5{ssSr|HO9*Aq|OwL=&E2zVe$fb zk-S7ElPP2>nL%cfS>z2;O_q{nWF=Wk-X-hE2jnBNg?vnQkUivca)2BphsZHl}@9x=^Jz&T}W5Zcj-F1iEgGJ(OvX&dVn6JC+P+HHN8l$)1T-a`X~L1 z{>?SxMslmUx4AXkJKS3CU2Yw>o_mjbpZkFO54VB)klV;@;x=<1aa*{LxvktbZacSw z+sS>xeah|Pc5|O`d$_&aK5jqvId_0N$Q|Mib4R$N+%fJrcY^zZJIS5mzT{4GXSlQ6 zIqp376?cLAn!Ctd;x2PnxU1YZ+;#3|U#G9ExcD@ZqXwuUQlMxQgOo^xc%()e6pP|e zJW4=Xq(gf68IcK@^LpiE`~9J(d*yWV`+VTU;LpMQUOBzJMZr9GahWGrpi;uEUYZ7-byr z-K7+wxzH_0c?7voBlHMrJW!(TgHipZOHXhxOf3tB{3Vj0)iAC}|5~w+pk}Z@bCd|| zB-Vuf64Zi4GWB_t5+$P))DpEqtx+4)7PW(+?NJBR5j~0?Lyw~;P$$$Gb%Ad;l#05e zH1s6ufzqM%DU<<6Mcf00Fv`h5SMHXpbN=h$|7x^@fT)b)@sWo-qZg*xJtYV73PY4YDiTCsb0u#U8-U(mBaRJ<-w@wKyZLgmGtOm}c( zfl6Q7*3DmBEIChr@Wg$UtT>=4j`BF3(4M9!%fs+ZhgX%FVO({f05N(2{mZC!BK}}%QI%Wz~@f8)x z&8^9Th%MW+h0B!IDeWsO3si#0^*_*4|2DZ&BJV}d6sREFYHaQ)DJ^z~Jk`jHnn(kR zQ3)8hhUFYjXela2KGdWysKFDGBrHYwYgKAA3I$LQg-{t9jmDs{s2n|uD$sMN58P73^j9I-AbsutjVsTftVdb?iTEGuy^KWr|~HJeq(ef+b?n%jgyK zDkwL{Ulu47oHG^t&g&Cn5tNqU9_lHEppIh+Oe=-(BxGmt5Vjc^5VonFV$X08sDDw- zg(TE8G+lJ&Uf!X-%fQV;b(pafO+zzK6R;BW)wTY^(aUHynuA`21@$bKY0p8-&O`Ij z0<;j=T?81C3vRR++-M1^MoZB$v>d&OR-lz=6?zM;hQFQAJ7_I>S9Gjga4c9OSbf z_Mp9JAKH&TM+eYBbO;@W$UBOTq2uTT`hr=QmD!k`Ihd2VSR?ibYs{LkrmPuj&RVcU zmc-OTGV=7#wGIPYSWDf(kY}jh9VoJfKyv~N34MXGVo%`y&Vi+6Lm@LHmIaCnRE}=` zfG4YNHdt@8KOiXInmo2`YTLB7Y3i>BhW5?Q2=?=aMu;eX z44LimX}wUu|O0X#qu?G z;lp4X0p6eQ=yVHu;By?^#Ry|ekQ!6qZZ?jt?rj$9%-Vz-0)j)!z|ka11uF2_F84Kx=z^Un ze+gO!kSQf@+!!}`P=D39DSAk=#9(vW;z5kB#)&mE?os4voQzX&OVCU!+#0vRZE-u? z9(RCT(Fs3>AIDFiO}I1eg1f?fs>pSwJ228yRL8qedkYlPpj!3>1b7wdEzx2bUf;-n z#)*ZNP?!x5_{)4nV!Vjpn*;f=5HwSND3k^1KBy#xy0>N|RE#3$BRpblC#Dv$Hc#~o zbC(r|vfSVa0e9&Lv5XT-xU7I@m?r>v?H>lkPH+~ajzmdUSs#|p9%E0iCsoj-f{kMu zeiC%i1E=Gjf=iF^hJ+$hWFe;%D%!3oNJZJ>lA<$kCJYigt8oTuauoL#Ds7yFb8sH? zB#wl-zZ&|102Inos*|-dk zW}R72_S8~57MJ5^Sq95wS*!DF-pbN!sZMw!^@#< z1?vZHK8E#Y1LbTq<3%iAChSuNfTvp^aw;lXwrdGowreYt@U^+9GCy75$0}9jVDyX( zX-fxP0+uDKVDy^d$M>1vEH^&*QJ~1#oO}lnAiGF^H!$ z$cok6HiTFa8!0V+5no<{FEI~$M!LU>FIVGl@HIA!4QJ1&B97wkfbLB&+b#Tq08vBT zK@X@fG2nqZ2u=dQh+a0LKvg;nO2v*zNyUDsAVxrOlq3{qH98L_^)K`nc@n{klWOb} zOp>BQtggrS10#b;sd>3ic|(cAgnhoyk_4MaaW5ryr4RMEOQdK^g!6%6Qpo*;??7-v z1z3%L7PoqEDfXZt_}6M-zgmkqzYCa?3J_3-I)CB6Yc*Mo|Ek$V5=5|2=oEWP1s7UI zkhGUQ1!aOzZS?_Xyaj%I1FElI2?uqSP+@^LqaR5FD1!V^Lh%FNQmBr^&-W1b6%`#? zwyH60N?WmrtIRJb^4EG*N0Da|LzJ*~ZR2vdS4pb_E(v-AuPsn%D=J#R1{rV({tCX* zz8z2&chYe}m(U@)P-_^|x^<-lCnT1{fk#NRCCOrIXxGK^|IZ$MkO)gs#Mc8R)Pk5q zV2WhVGHu=%@r>*!?3!WEOl-tX9PBwZk-hW<+`333@(5{6nvkZX8EH;hkVKM1l1U0U zZ>Gmr2Em=_^OX2~-ogxjA*iIcPjqll8SKEik1F$y27A^X24#B3dWxhlnZPR5`DO~OR zYSIlnwjS{wOrSPi94fFVN|h6WEr>+sDUt!=*D_yCo)U{THyqIThI`U|BDXcp)th9A zdphZ~K=37SDd9xaA6QCylRgg|CDfWJhvb5pUSX5iODDlZF47NVuQgN)Fw_7rS0c$L zPm>g}QmM5@roTuy9s}*e87*QHK>x3?S6Nm6Os~&d0!LAOp!(22VjJcUln8C^P+0() zJJvZ6DMYcv1FKJllapx=a}#fkn-r52SYV21;;HwVxD<6E0kG#GID$J540ag`+Z$`W zqcu2)^ar4B5VZx$^%cRES{#+-_IZjs)+%B&83U}$V6z{t2ycxdD#`P}%oI`HS!^b& z0_*kg7J2F~*=I!G5ztgm(ke2ZOaSt8*?hL}-xqj|OsZR89(zMvpii0i9+~=#63>{( zG&o~gaR1TpKsawL5ss!jb+XMSb71kstonajdcJ7nO0rm3S`CNnl0j#&C9GW- z2zXuuARxWWbPu>IS zE7@BQqh5020kyZ;yARjO&KisFBD;a&8qwlw z**mQ2D4_ZT~o4>TYPhsCe_^*!GcjP7z`-pA* zcVa)0J9Wf9W?NWQU-3|>&*(hyXsV9fALLIUx1D|RujDA9w2s_Pwu4m-l=gap;rqA; zO4|vzuBA)mv;olF#r8a$ZgUzVI4$L=8t4KF#nw3OXKc3+G<(${*D13cJ?mlTrGWI3s#jcF6w zls2QyX$zW2X47PvLUxj^v^8x*4wLibJMsq{6t_U#pkiMPWy5T=0`Gu`-^adTmFxy2 z!87j>ZnND3rjc*IZwq(A}z-^T&pQS2bA8XT0`rE{km z6+VsfSCc|ekD#RHv@s}cHdzjessdpTi(;Mtac6*#%Rtn*0vC{Q1TN@E(wG*DwLuHe zH*kScNs{m*DNq=s2Xj27u%m}$Ce*#bRBupta8V?|u$+y9f2`_Z>8l2{X*qosoJ2zH zW9%raDuyT60eFlt41U7@KCxU1S{wCg{$Fu*@6r!ZCx}s_PH>h<^!2*s$AO{0U?&CG z6VA`!$>V+6tZ&*GFm)D~_Dh&@S~BPy@i`7u9e z{1-;KSNwcnMZjy1z{f*$QO~t@lD+gp&_%67tpWV}8gQz6kvDXo9wc$Mp!^m0hS+_< zp?H|xYp|Q{rTbtp3A?Yb%dk+k2Y`Cu!}YTBUeA-})w}oaB)805SkK01PVu8U&E|U*e+qecV+FFpjQCI`d@)UB>W^m6t-j1 z{+4SlaQ!$GmH!7Yj{cj+isb(U?EjmGl{FeD7B#??a6Zn@m2#uF02ky!Tp2f-8w1a! z%eiN{3hp_sl6#&T$1yI8bz5x1CI!c}uixn~0vNFvej_!kC6J7sl|)Lu44s!Z<37eV|6d3u_sXLx#+r{{Qjo~K{&^a4-6=IKSAUgGIxo?hYURi1vs(`!8amZ#TwdV{Cm z@$@E7zvt;Kp8mkoA9;G4r$6!Z4o`pP=`SKKa@T4e=R>q|H}K`fLJU9x;J)W>!Im|> ztMuxJ@C>(_`@ZI|AGU6AvR?C&*J189_tVqqU2EO}DT0vleUq-DZ_~9@c++SX{S07Nc*p1l zy~A;woKtfKt`XM+-Z5&y6@w4X1)tdnZw(!Tw|;(&Xb=$_VUI|R=o(QF;f^Sb@I(xc z@J5V`D30(<u(1#zd4yR76xpjEk5Tu_9u9#O{bw5tkxvMf?`=N5o$dcO!8m7a1KH z6RC>SMK+F1ifk9zEixlACvsrqu*h+d)sd?sKaSiPxj*t$%i7A?%R0&)lV!^CWJR)KnNLOL(eo=){zNo6GDN)m+W<<@3niKU#)cmN0 zQH!INMlFw85w$96b<~=uolys(?#ktIjoc)6$rI(>)b@_zCG z@@Dw-%-E7~gBD>^E= zDY`4t6g?C@6*-E&ihhbAiZVr|VxnT2Vwqx%Vy$AG;yuM@iX)24irb1iieD7JDgIFW z72P0O6CD?w5Uq>0M>mg7j82MfAKf#$PxQd(!st=a&qlu#y)1fT^p5CHqjyK|i9Qm2 zDf(LUA2D1^e2gKcMa;k$f6Q|+RWY+;R>$m!IUaLe8KJZ*oytbaX37@IBxQ=Sm9mYp zow9@SQDqNhmhx%k5am#1k+MWtrhHa8Q8`&TLpe)1N4Y?`NV!D0RJlR9UwKk_MR`+s zOZlVnC*{w|UzK-NCRI~adsRnOZ&e>vj;gP!pK7FPtg1p)shXggu9~A-u6kSbj_O_2 zdeuhNX4MweR@HXZUeyWJMb$OcE!B^zyS##r=e4|^H}X!t1>cr`luzX|`6AxSGkzLB zkAI6_%WvfO^85J%{2~5`TBeq(8>*w#N;R)mt7FyiYKz*YcBozIPU;Nx5Ouk_LJj9s z>ahAn^=sZ$7K>iz03)!(cC(5N(aO`;}Q(?-)y(?Rp7CRLNB>7nVV$YHJdaaX+G9$)9luq)Lhow(A?DA*4)wjBBbru zh*(*yDmE@QAyyY_h&9DFjcpnGL~Q5SuCb}H8)CP`?uy+PdpP#X*z>VBVt2KEsJ|6Zcp5WxNqZriAV7b z;vMm6@!9c(@t*kM@!t56@qzep@!|Lvy>}6kRJ_8(p5Rziyx|UpH7c zL^o7drW>QH)V;2oqMN3hp_`@Kpxdb1tlOg7s@tyHsXL)Nsk@-NsJpDYt@~TwP#>*V z>Un)jeQSLO{iFKF^_}!x^xgEm^&|9U`Z4-)eT9CG{tf+n{X+d>eYJj>evN*Y{;2-A z{tNvn{m=Se^}p-?)cxlq0rzl3^x=T ze1?!AY^B@R95Ng++&0`X{9^dc@Q2|q z!(Ah1j5I2YI-|j8GFptCja`kY#x!FOV^3p-G257H9Aq3}e8yO8^cg1`ry8dlXBuZ4 z=Nji3-!!f?zGvKK++qC0xXXCec+Ggzc+2>s@h9WY#$QbeQ;f-OYG!)DRAriAddc*P z={3{qrYWXrrWvMLra7iJO!G|(O^Z#{re&r#O)E`rncg zJ~nML?J#{}+GYC8wAZxXbij1Tbi{Pbbi#Dfbj@_#^quK@(+{RU%$zyetTgjxjXBPo zV1CS;X6|9`Y0fbBGH02y&AH}0v&ZZ+k2g;=zifWhJjp!SJk>niJkvbeJl8zWyuiG} ze8_y(eBOM)e9?T#e8qg#e9e5_qOinRR2H=*))H^gT2d^nEd4D5E%}zgmI900GSpIJ z8D@FaGRZR8GSxEOGSf2KGS@QCvdr?H0)}`m}Yhb%@n%Ewp;90qbn*T<8#MB$6?1&$8pCOj#G})j9j?0d#j%$t|oqp#iXV6*Z9OEo^ zRyZr2zwa9H#j#rw>Y;s zcRF`D_c-@E4?2%Hk2_B~Pdm>!FE}qbuR6bVe&@X9yzTti`J3}k=Uo?ZMYy6|4P7xV z-WBUgaOqt}m&Ijwxm=B1&0LAD6jy6kJ6A{7+0_sjl?%*GsNfU9Y>Qx@Nd$yWVgua4mK%b-n3Y<$Bw- z*0tXCf$KxpX4l8A?XFK;yIp%-pSupZj=Ijc&brRKzHwc1U3dM|h&GC9q;F(t)Ixfe SN#F^X@Zs)A|JVL)l=MG=s0yn9 diff --git a/indra/newview/SecondLife.xib b/indra/newview/SecondLife.xib index fbff8fe307..b44528a842 100644 --- a/indra/newview/SecondLife.xib +++ b/indra/newview/SecondLife.xib @@ -1,1136 +1,193 @@ - - - 1060 - 12E55 - 4457.6 - 1187.39 - 626.00 - - com.apple.InterfaceBuilder.CocoaPlugin - 4457.6 - - - NSCustomObject - NSMenu - NSMenuItem - NSScrollView - NSScroller - NSTextView - NSView - NSWindowTemplate - - - com.apple.InterfaceBuilder.CocoaPlugin - - - PluginDependencyRecalculationVersion - - - - - NSApplication - - - FirstResponder - - - NSApplication - - - Main Menu - - - - Second Life - - 2147483647 - - NSImage - NSMenuCheckmark - - - NSImage - NSMenuMixedState - - submenuAction: - - Second Life - - - - About Second Life - - 2147483647 - - - - - - YES - YES - - - 2147483647 - - - - - - Preferences… - , - 1048576 - 2147483647 - - - - - - YES - YES - - - 2147483647 - - - - - - Services - - 2147483647 - - - submenuAction: - - Services - - _NSServicesMenu - - - - - YES - YES - - - 2147483647 - - - - - - Hide Second Life - h - 1048576 - 2147483647 - - - - - - Hide Others - h - 1572864 - 2147483647 - - - - - - Show All - - 2147483647 - - - - - - YES - YES - - - 2147483647 - - - - - - Quit Second Life - q - 1048576 - 2147483647 - - - - - _NSAppleMenu - - - - - Edit - - 2147483647 - - - submenuAction: - - Edit - - - - Undo - z - 1048576 - 2147483647 - - - - - - Redo - Z - 1048576 - 2147483647 - - - - - - YES - YES - - - 2147483647 - - - - - - Cut - x - 1048576 - 2147483647 - - - - - - Copy - c - 1048576 - 2147483647 - - - - - - Paste - v - 1048576 - 2147483647 - - - - - - Select All - a - 1048576 - 2147483647 - - - - - - - - - Window - - 2147483647 - - - submenuAction: - - Window - - - - Minimize - m - 1048576 - 2147483647 - - - - - - Zoom - - 2147483647 - - - - - - Enter Full Screen - f - 1310720 - 2147483647 - - - - - - YES - YES - - - 2147483647 - - - - - - Bring All to Front - - 2147483647 - - - - - _NSWindowsMenu - - - - - Help - - 2147483647 - - - - - _NSMainMenu - - - LLAppDelegate - - - 15 - 2 - {{196, 240}, {1024, 600}} - 74974208 - Second Life - LLNSWindow - - - - - 256 - - {1024, 600} - - - _NS:20 - - {{0, 0}, {2560, 1418}} - {10000000000000, 10000000000000} - Second Life - 128 - NO - - - 31 - 2 - {{272, 176}, {938, 42}} - -1535638528 - Input Window - LLUserInputWindow - - - - - 256 - - - - 256 - - - - 2322 - - - - 2322 - - Apple HTML pasteboard type - Apple PDF pasteboard type - Apple PICT pasteboard type - Apple PNG pasteboard type - Apple URL pasteboard type - CorePasteboardFlavorType 0x6D6F6F76 - NSColor pasteboard type - NSFilenamesPboardType - NSStringPboardType - NeXT Encapsulated PostScript v1.2 pasteboard type - NeXT RTFD pasteboard type - NeXT Rich Text Format v1.0 pasteboard type - NeXT TIFF v4.0 pasteboard type - NeXT font pasteboard type - NeXT ruler pasteboard type - WebURLsWithTitlesPboardType - public.url - - {938, 42} - - - - _NS:13 - - - - - - - - - - - - 166 - - - - 938 - 1 - - - 67121127 - 0 - - - 3 - MQA - - - - 6 - System - selectedTextBackgroundColor - - 3 - MC42NjY2NjY2NjY3AA - - - - 6 - System - selectedTextColor - - 3 - MAA - - - - - - - 1 - MCAwIDEAA - - - {8, -8} - 13 - - - - - - 1 - - 6 - {939, 10000000} - - - - {{1, 1}, {938, 42}} - - - - _NS:11 - - - - {4, 5} - - 79691776 - - - - - - file://localhost/Applications/Xcode.app/Contents/SharedFrameworks/DVTKit.framework/Resources/DVTIbeamCursor.tiff - - - - - 3 - MCAwAA - - - - 4 - - - - 256 - {{923, 1}, {16, 42}} - - - - _NS:83 - NO - - _doScroller: - 0.96666666666666667 - - - - -2147483392 - {{-100, -100}, {87, 18}} - - - - _NS:33 - NO - 1 - - _doScroller: - 1 - 0.94565218687057495 - - - {{-1, -1}, {940, 44}} - - - - _NS:9 - 133138 - - - - 0.25 - 4 - 1 - - - {938, 42} - - - - _NS:21 - - {{0, 0}, {2560, 1418}} - {10000000000000, 10000000000000} - YES - - - - - - - terminate: - - - - 823 - - - - orderFrontStandardAboutPanel: - - - - 142 - - - - delegate - - - - 845 - - - - performMiniaturize: - - - - 37 - - - - arrangeInFront: - - - - 39 - - - - performZoom: - - - - 240 - - - - hide: - - - - 369 - - - - hideOtherApplications: - - - - 370 - - - - unhideAllApplications: - - - - 372 - - - - cut: - - - - 768 - - - - paste: - - - - 769 - - - - undo: - - - - 776 - - - - copy: - - - - 782 - - - - selectAll: - - - - 785 - - - - toggleFullScreen: - - - - 842 - - - - window - - - - 850 - - - - inputWindow - - - - 953 - - - - inputView - - - - 954 - - - - - - 0 - - - - - - -2 - - - File's Owner - - - -1 - - - First Responder - - - -3 - - - Application - - - 29 - - - - - - - - - Main Menu - - - 19 - - - - - - - - 56 - - - - - - - - 103 - - - - - - 57 - - - - - - - - - - - - - - - - - - 58 - - - - - 134 - - - - - 150 - - - - - 136 - - - - - 144 - - - - - 129 - - - - - 143 - - - - - 236 - - - - - 131 - - - - - - - - 149 - - - - - 145 - - - - - 130 - - - - - 24 - - - - - - - - - - - - 92 - - - - - 5 - - - - - 239 - - - - - 23 - - - - - 711 - - - - - - - - 712 - - - - - - - - - - - - - - 716 - - - - - 717 - - - - - 718 - - - - - 721 - - - - - 824 - - - - - 841 - - - - - 828 - - - - - - - - 829 - - - - - - 713 - - - - - 714 - - - - - 715 - - - - - 941 - - - - - - - - 942 - - - - - - - - 943 - - - - - - - - - - 944 - - - - - 945 - - - - - 946 - - - - - - - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - - - com.apple.InterfaceBuilder.CocoaPlugin - - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - LLNonInlineTextView - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - - - - - - 954 - - - - - LLAppDelegate - NSObject - - LLNonInlineTextView - NSWindow - LLNSWindow - - - - inputView - LLNonInlineTextView - - - inputWindow - NSWindow - - - window - LLNSWindow - - - - IBProjectSource - ./Classes/LLAppDelegate.h - - - - LLNSWindow - NSWindow - - IBProjectSource - ./Classes/LLNSWindow.h - - - - LLNonInlineTextView - NSTextView - - IBProjectSource - ./Classes/LLNonInlineTextView.h - - - - LLUserInputWindow - NSPanel - - IBProjectSource - ./Classes/LLUserInputWindow.h - - - - NSTextView - - id - id - - - - orderFrontSharingServicePicker: - id - - - toggleQuickLookPreviewPanel: - id - - - - IBProjectSource - ./Classes/NSTextView.h - - - - - 0 - IBCocoaFramework - - com.apple.InterfaceBuilder.CocoaPlugin.macosx - - - - com.apple.InterfaceBuilder.CocoaPlugin.InterfaceBuilder3 - - - YES - 3 - - {11, 11} - {10, 3} - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/indra/newview/viewer_manifest.py b/indra/newview/viewer_manifest.py index a9a7b9c5d8..b6e86f3445 100755 --- a/indra/newview/viewer_manifest.py +++ b/indra/newview/viewer_manifest.py @@ -959,7 +959,6 @@ def construct(self): self.path("licenses-mac.txt", dst="licenses.txt") self.path("featuretable_mac.txt") self.path("cube.dae") - self.path("SecondLife.nib") with self.prefix(src=pkgdir,dst=""): self.path("ca-bundle.crt") From b2421455887e575706172e7bba271b430d895610 Mon Sep 17 00:00:00 2001 From: Rye Date: Fri, 13 Dec 2024 02:48:40 -0500 Subject: [PATCH 17/23] Fix getting cpu frequency on apple silicon --- indra/llcommon/llprocessor.cpp | 57 ++++++++++++++++++++++++++++++++-- 1 file changed, 54 insertions(+), 3 deletions(-) diff --git a/indra/llcommon/llprocessor.cpp b/indra/llcommon/llprocessor.cpp index ac2d2147ed..297a12d36f 100644 --- a/indra/llcommon/llprocessor.cpp +++ b/indra/llcommon/llprocessor.cpp @@ -628,6 +628,8 @@ class LLProcessorInfoWindowsImpl : public LLProcessorInfoImpl #elif LL_DARWIN +#include +#include #include #include @@ -638,17 +640,58 @@ class LLProcessorInfoDarwinImpl : public LLProcessorInfoImpl { getCPUIDInfo(); uint64_t frequency = getSysctlInt64("hw.cpufrequency"); + if(frequency == 0) // Attempt to query IO Services for pcore frequency + { + CFMutableDictionaryRef arm_io_matching = IOServiceMatching("AppleARMIODevice"); + io_iterator_t iter; + kern_return_t ret = IOServiceGetMatchingServices(kIOMasterPortDefault, arm_io_matching, &iter); + if(ret == KERN_SUCCESS) + { + io_object_t obj; + while ((obj = IOIteratorNext(iter))) + { + io_name_t obj_class; + ret = IOObjectGetClass(obj, obj_class); + if(ret == KERN_SUCCESS) + { + io_name_t obj_name; + ret = IORegistryEntryGetName(obj, obj_name); + if(ret == KERN_SUCCESS) + { + if (strncmp(obj_name, "pmgr", sizeof(obj_name)) == 0) + { + CFTypeRef cfData = IORegistryEntryCreateCFProperty(obj, CFSTR("voltage-states5-sram"), kCFAllocatorDefault, 0); // pcore frequency + if(cfData) + { + CFIndex size = CFDataGetLength((CFDataRef)cfData); + std::vector databuf(size); + CFDataGetBytes((CFDataRef)cfData, CFRangeMake(0, size), databuf.data()); + + frequency = 0x00000000FFFFFFFF & ((databuf[size-5] << 24) | (databuf[size-6] << 16) | (databuf[size-7] << 8) | (databuf[size-8])); + CFRelease(cfData); + } + break; + } + } + } + } + } + } + if (frequency == 0) // fallback to clockrate and tbfrequency + { + frequency = getSysctlClockrate() * getSysctlInt64("hw.tbfrequency"); + } setInfo(eFrequency, (F64)frequency / (F64)1000000); } - virtual ~LLProcessorInfoDarwinImpl() {} + virtual ~LLProcessorInfoDarwinImpl() = default; private: int getSysctlInt(const char* name) { int result = 0; size_t len = sizeof(int); - int error = sysctlbyname(name, (void*)&result, &len, NULL, 0); + int error = sysctlbyname(name, (void*)&result, &len, nullptr, 0); return error == -1 ? 0 : result; } @@ -656,7 +699,7 @@ class LLProcessorInfoDarwinImpl : public LLProcessorInfoImpl { uint64_t value = 0; size_t size = sizeof(value); - int result = sysctlbyname(name, (void*)&value, &size, NULL, 0); + int result = sysctlbyname(name, (void*)&value, &size, nullptr, 0); if ( result == 0 ) { if ( size == sizeof( uint64_t ) ) @@ -676,6 +719,14 @@ class LLProcessorInfoDarwinImpl : public LLProcessorInfoImpl return result == -1 ? 0 : value; } + uint64_t getSysctlClockrate() + { + struct clockinfo clockrate{}; + size_t size = sizeof(clockrate); + int error = sysctlbyname("kern.clockrate", &clockrate, &size, nullptr, 0); + return error == -1 ? 0 : clockrate.hz; + } + void getCPUIDInfo() { size_t len = 0; From 5cd941bd3c9fccf12832b650b4febc3f9c730eb2 Mon Sep 17 00:00:00 2001 From: Rye Date: Tue, 10 Dec 2024 10:42:18 -0500 Subject: [PATCH 18/23] Fix internal openjpeg headers being used to set logging function --- indra/llimagej2coj/llimagej2coj.cpp | 79 +++++++++++------------------ 1 file changed, 31 insertions(+), 48 deletions(-) diff --git a/indra/llimagej2coj/llimagej2coj.cpp b/indra/llimagej2coj/llimagej2coj.cpp index d8f17561b3..81a189188f 100644 --- a/indra/llimagej2coj/llimagej2coj.cpp +++ b/indra/llimagej2coj/llimagej2coj.cpp @@ -29,11 +29,12 @@ // this is defined so that we get static linking. #include "openjpeg.h" -#include "event.h" -#include "cio.h" #include "owning_ptr.h" #include + +#define WANT_VERBOSE_OPJ_SPAM LL_DEBUG + #define MAX_ENCODED_DISCARD_LEVELS 5 // Factory function: see declaration in llimagej2c.cpp @@ -52,6 +53,7 @@ std::string LLImageJ2COJ::getEngineInfo() const #endif } +#if WANT_VERBOSE_OPJ_SPAM // Return string from message, eliminating final \n if present static std::string chomp(const char* msg) { @@ -67,27 +69,34 @@ static std::string chomp(const char* msg) } return message; } +#endif /** sample error callback expecting a LLFILE* client object */ void error_callback(const char* msg, void*) { - LL_DEBUGS() << "LLImageJ2COJ: " << chomp(msg) << LL_ENDL; +#if WANT_VERBOSE_OPJ_SPAM + LL_WARNS() << "LLImageJ2COJ: " << chomp(msg) << LL_ENDL; +#endif } /** sample warning callback expecting a LLFILE* client object */ void warning_callback(const char* msg, void*) { - LL_DEBUGS() << "LLImageJ2COJ: " << chomp(msg) << LL_ENDL; +#if WANT_VERBOSE_OPJ_SPAM + LL_WARNS() << "LLImageJ2COJ: " << chomp(msg) << LL_ENDL; +#endif } /** sample debug callback expecting no client object */ void info_callback(const char* msg, void*) { - LL_DEBUGS() << "LLImageJ2COJ: " << chomp(msg) << LL_ENDL; +#if WANT_VERBOSE_OPJ_SPAM + LL_INFOS() << "LLImageJ2COJ: " << chomp(msg) << LL_ENDL; +#endif } // Divide a by 2 to the power of b and round upwards @@ -99,39 +108,13 @@ int ceildivpow2(int a, int b) class JPEG2KBase { public: - JPEG2KBase() {} + JPEG2KBase() = default; U8* buffer = nullptr; OPJ_SIZE_T size = 0; OPJ_OFF_T offset = 0; }; -#define WANT_VERBOSE_OPJ_SPAM LL_DEBUG - -static void opj_info(const char* msg, void* user_data) -{ - llassert(user_data); -#if WANT_VERBOSE_OPJ_SPAM - LL_INFOS("OpenJPEG") << msg << LL_ENDL; -#endif -} - -static void opj_warn(const char* msg, void* user_data) -{ - llassert(user_data); -#if WANT_VERBOSE_OPJ_SPAM - LL_WARNS("OpenJPEG") << msg << LL_ENDL; -#endif -} - -static void opj_error(const char* msg, void* user_data) -{ - llassert(user_data); -#if WANT_VERBOSE_OPJ_SPAM - LL_WARNS("OpenJPEG") << msg << LL_ENDL; -#endif -} - static OPJ_SIZE_T opj_read(void * buffer, OPJ_SIZE_T bytes, void* user_data) { llassert(user_data); @@ -224,11 +207,7 @@ class JPEG2KDecode : public JPEG2KBase JPEG2KDecode(S8 discardLevel) { - memset(&event_mgr, 0, sizeof(opj_event_mgr_t)); memset(¶meters, 0, sizeof(opj_dparameters_t)); - event_mgr.error_handler = error_callback; - event_mgr.warning_handler = warning_callback; - event_mgr.info_handler = info_callback; opj_set_default_decoder_parameters(¶meters); parameters.cp_reduce = discardLevel; } @@ -245,6 +224,11 @@ class JPEG2KDecode : public JPEG2KBase decoder = opj_create_decompress(OPJ_CODEC_J2K); + /* catch events using our callbacks and give a local context */ + opj_set_error_handler(decoder, error_callback, nullptr); + opj_set_warning_handler(decoder, warning_callback, nullptr); + opj_set_info_handler(decoder, info_callback, nullptr); + if (!opj_setup_decoder(decoder, ¶meters)) { return false; @@ -311,9 +295,9 @@ class JPEG2KDecode : public JPEG2KBase decoder = opj_create_decompress(OPJ_CODEC_J2K); opj_setup_decoder(decoder, ¶meters); - opj_set_info_handler(decoder, opj_info, this); - opj_set_warning_handler(decoder, opj_warn, this); - opj_set_error_handler(decoder, opj_error, this); + opj_set_info_handler(decoder, info_callback, this); + opj_set_warning_handler(decoder, warning_callback, this); + opj_set_error_handler(decoder, error_callback, this); stream = opj_stream_create(dataSize, true); if (!stream) @@ -366,7 +350,6 @@ class JPEG2KDecode : public JPEG2KBase private: opj_dparameters_t parameters; - opj_event_mgr_t event_mgr; owning_ptr codestream_info{ nullptr, // opj_destroy_cstr_info(opj_codestream_info_v2_t**) requires a @@ -389,10 +372,6 @@ class JPEG2KEncode : public JPEG2KBase JPEG2KEncode(const char* comment_text_in, bool reversible) { memset(¶meters, 0, sizeof(opj_cparameters_t)); - memset(&event_mgr, 0, sizeof(opj_event_mgr_t)); - event_mgr.error_handler = error_callback; - event_mgr.warning_handler = warning_callback; - event_mgr.info_handler = info_callback; opj_set_default_encoder_parameters(¶meters); parameters.cod_format = OPJ_CODEC_J2K; @@ -435,6 +414,11 @@ class JPEG2KEncode : public JPEG2KBase encoder = opj_create_compress(OPJ_CODEC_J2K); + /* catch events using our callbacks and give a local context */ + opj_set_error_handler(encoder, error_callback, nullptr); + opj_set_warning_handler(encoder, warning_callback, nullptr); + opj_set_info_handler(encoder, info_callback, nullptr); + parameters.tcp_mct = (image->numcomps >= 3) ? 1 : 0; parameters.cod_format = OPJ_CODEC_J2K; parameters.prog_order = OPJ_RLCP; @@ -489,9 +473,9 @@ class JPEG2KEncode : public JPEG2KBase return false; } - opj_set_info_handler(encoder, opj_info, this); - opj_set_warning_handler(encoder, opj_warn, this); - opj_set_error_handler(encoder, opj_error, this); + opj_set_info_handler(encoder, info_callback, this); + opj_set_warning_handler(encoder, warning_callback, this); + opj_set_error_handler(encoder, error_callback, this); U32 tile_count = (rawImageIn.getWidth() >> 6) * (rawImageIn.getHeight() >> 6); U32 data_size_guess = tile_count * TILE_SIZE; @@ -681,7 +665,6 @@ class JPEG2KEncode : public JPEG2KBase private: std::string comment_text; opj_cparameters_t parameters; - opj_event_mgr_t event_mgr; owning_ptr stream{ nullptr, opj_stream_destroy }; owning_ptr image{ nullptr, opj_image_destroy }; owning_ptr encoder{ nullptr, opj_destroy_codec }; From 638ecbe7be546484a4ae1785b3c2f8876f682308 Mon Sep 17 00:00:00 2001 From: Rye Date: Fri, 22 Nov 2024 11:08:37 -0500 Subject: [PATCH 19/23] Disable setjmp based error handling in llimagejpeg to work around crash on ARM --- indra/llimage/llimagejpeg.cpp | 13 +++++++++++-- indra/llimage/llimagejpeg.h | 2 ++ 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/indra/llimage/llimagejpeg.cpp b/indra/llimage/llimagejpeg.cpp index 0e7ec365d4..50536a2798 100644 --- a/indra/llimage/llimagejpeg.cpp +++ b/indra/llimage/llimagejpeg.cpp @@ -31,7 +31,9 @@ #include "llerror.h" #include "llexception.h" +#if !LL_ARM64 jmp_buf LLImageJPEG::sSetjmpBuffer ; +#endif LLImageJPEG::LLImageJPEG(S32 quality) : LLImageFormatted(IMG_CODEC_JPEG), mOutputBuffer( NULL ), @@ -78,12 +80,15 @@ bool LLImageJPEG::updateData() // //try/catch will crash on Mac and Linux if LLImageJPEG::errorExit throws an error //so as instead, we use setjmp/longjmp to avoid this crash, which is the best we can get. --bao + //except in the case of AARCH64/ARM64 where setjmp will crash // +#if !LL_ARM64 if(setjmp(sSetjmpBuffer)) { jpeg_destroy_decompress(&cinfo); return false; } +#endif try { // Now we can initialize the JPEG decompression object. @@ -223,11 +228,13 @@ bool LLImageJPEG::decode(LLImageRaw* raw_image, F32 decode_time) //try/catch will crash on Mac and Linux if LLImageJPEG::errorExit throws an error //so as instead, we use setjmp/longjmp to avoid this crash, which is the best we can get. --bao // +#if !LL_ARM64 if(setjmp(sSetjmpBuffer)) { jpeg_destroy_decompress(&cinfo); return true; // done } +#endif try { // Now we can initialize the JPEG decompression object. @@ -431,9 +438,10 @@ void LLImageJPEG::errorExit( j_common_ptr cinfo ) // Let the memory manager delete any temp files jpeg_destroy(cinfo); - +#if !LL_ARM64 // Return control to the setjmp point longjmp(sSetjmpBuffer, 1) ; +#endif } // Decide whether to emit a trace or warning message. @@ -545,6 +553,7 @@ bool LLImageJPEG::encode( const LLImageRaw* raw_image, F32 encode_time ) //try/catch will crash on Mac and Linux if LLImageJPEG::errorExit throws an error //so as instead, we use setjmp/longjmp to avoid this crash, which is the best we can get. --bao // +#if !LL_ARM64 if( setjmp(sSetjmpBuffer) ) { // If we get here, the JPEG code has signaled an error. @@ -555,7 +564,7 @@ bool LLImageJPEG::encode( const LLImageRaw* raw_image, F32 encode_time ) mOutputBufferSize = 0; return false; } - +#endif try { diff --git a/indra/llimage/llimagejpeg.h b/indra/llimage/llimagejpeg.h index 012b87a42d..ee0a8815e8 100644 --- a/indra/llimage/llimagejpeg.h +++ b/indra/llimage/llimagejpeg.h @@ -78,7 +78,9 @@ class LLImageJPEG : public LLImageFormatted S32 mEncodeQuality; // on a scale from 1 to 100 private: +#if !LL_ARM64 static jmp_buf sSetjmpBuffer; // To allow the library to abort. +#endif }; #endif // LL_LLIMAGEJPEG_H From 3a92b884344e2caf14f6cba7b99778cf1928ff63 Mon Sep 17 00:00:00 2001 From: Rye Date: Tue, 10 Dec 2024 10:34:35 -0500 Subject: [PATCH 20/23] Disable old mac opengl hacks on apple silicon --- indra/llrender/llglslshader.cpp | 7 +++++-- indra/llrender/llshadermgr.cpp | 2 +- indra/newview/pipeline.cpp | 9 ++++++--- 3 files changed, 12 insertions(+), 6 deletions(-) diff --git a/indra/llrender/llglslshader.cpp b/indra/llrender/llglslshader.cpp index 595270ee89..1055ac246b 100644 --- a/indra/llrender/llglslshader.cpp +++ b/indra/llrender/llglslshader.cpp @@ -421,8 +421,11 @@ bool LLGLSLShader::createShader() llassert_always(!mShaderFiles.empty()); #if LL_DARWIN - // work-around missing mix(vec3,vec3,bvec3) - mDefines["OLD_SELECT"] = "1"; + if(!gGLManager.mIsApple) + { + // work-around missing mix(vec3,vec3,bvec3) + mDefines["OLD_SELECT"] = "1"; + } #endif mShaderHash = hash(); diff --git a/indra/llrender/llshadermgr.cpp b/indra/llrender/llshadermgr.cpp index cf37db7ee8..dbe4f94f1a 100644 --- a/indra/llrender/llshadermgr.cpp +++ b/indra/llrender/llshadermgr.cpp @@ -450,7 +450,7 @@ GLuint LLShaderMgr::loadShaderFile(const std::string& filename, S32 & shader_lev // endsure work-around for missing GLSL funcs gets propogated to feature shader files (e.g. srgbF.glsl) #if LL_DARWIN - if (defines) + if (defines && !gGLManager.mIsApple) { (*defines)["OLD_SELECT"] = "1"; } diff --git a/indra/newview/pipeline.cpp b/indra/newview/pipeline.cpp index 99fe21f1c2..f5b6eb4408 100644 --- a/indra/newview/pipeline.cpp +++ b/indra/newview/pipeline.cpp @@ -1423,9 +1423,12 @@ void LLPipeline::createLUTBuffers() U32 pix_format = GL_R16F; #if LL_DARWIN - // Need to work around limited precision with 10.6.8 and older drivers - // - pix_format = GL_R32F; + if(!gGLManager.mIsApple) + { + // Need to work around limited precision with 10.6.8 and older drivers + // + pix_format = GL_R32F; + } #endif LLImageGL::generateTextures(1, &mLightFunc); gGL.getTexUnit(0)->bindManual(LLTexUnit::TT_TEXTURE, mLightFunc); From f05c685ea8f54ce4505205c28be31e61cb7afa0d Mon Sep 17 00:00:00 2001 From: Rye Date: Thu, 12 Dec 2024 09:26:02 -0800 Subject: [PATCH 21/23] Disable Havok in macOS builds temporarily --- build.sh | 2 ++ 1 file changed, 2 insertions(+) diff --git a/build.sh b/build.sh index f2376e706b..b7a3a3e9e1 100755 --- a/build.sh +++ b/build.sh @@ -160,6 +160,8 @@ pre_build() then SIGNING=("-DENABLE_SIGNING:BOOL=YES" \ "-DSIGNING_IDENTITY:STRING=Developer ID Application: Linden Research, Inc.") + + HAVOK=OFF fi fi From 902f3889472551220d081ddd6fd41496a1b00dd4 Mon Sep 17 00:00:00 2001 From: Rye Date: Fri, 13 Dec 2024 01:09:59 -0800 Subject: [PATCH 22/23] Fix build on windows due to deprecation and linking issues and linux due to warnings after macos changes --- indra/cmake/00-Common.cmake | 4 +++- indra/cmake/Audio.cmake | 2 +- indra/cmake/Boost.cmake | 16 ++++++++-------- indra/cmake/CEFPlugin.cmake | 12 ++++++------ indra/cmake/LibVLCPlugin.cmake | 8 ++++---- indra/cmake/NVAPI.cmake | 2 +- indra/cmake/OPENAL.cmake | 8 ++++---- indra/cmake/OpenJPEG.cmake | 8 ++++---- indra/llcommon/llsys.cpp | 5 +++++ indra/llmath/llcalcparser.h | 11 +++++++++++ indra/newview/llface.cpp | 5 +++-- indra/newview/llinventorygallerymenu.cpp | 4 ++-- indra/newview/llvoicevivox.cpp | 2 +- indra/newview/llxmlrpclistener.cpp | 9 +++++++++ 14 files changed, 62 insertions(+), 34 deletions(-) diff --git a/indra/cmake/00-Common.cmake b/indra/cmake/00-Common.cmake index 940b60fb8b..7983054fe8 100644 --- a/indra/cmake/00-Common.cmake +++ b/indra/cmake/00-Common.cmake @@ -81,6 +81,8 @@ if (WINDOWS) NOMINMAX # DOM_DYNAMIC # For shared library colladadom _CRT_SECURE_NO_WARNINGS # Allow use of sprintf etc + _CRT_NONSTDC_NO_DEPRECATE # Allow use of sprintf etc + _CRT_OBSOLETE_NO_WARNINGS _WINSOCK_DEPRECATED_NO_WARNINGS # Disable deprecated WinSock API warnings ) add_compile_options( @@ -222,7 +224,7 @@ if(LINUX OR DARWIN) endif() if (CMAKE_CXX_COMPILER_ID STREQUAL "GNU") - add_compile_options(-Wno-stringop-truncation -Wno-parentheses) + add_compile_options(-Wno-stringop-truncation -Wno-parentheses -Wno-maybe-uninitialized) endif() if (NOT GCC_DISABLE_FATAL_WARNINGS AND NOT CLANG_DISABLE_FATAL_WARNINGS) diff --git a/indra/cmake/Audio.cmake b/indra/cmake/Audio.cmake index bb6d675ebf..72944254ec 100644 --- a/indra/cmake/Audio.cmake +++ b/indra/cmake/Audio.cmake @@ -21,7 +21,7 @@ if (WINDOWS) debug ${ARCH_PREBUILT_DIRS_DEBUG}/libvorbis.lib ) else (WINDOWS) - target_link_libraries(ll::vorbis INTERFACE + target_link_libraries(ll::vorbis INTERFACE ${ARCH_PREBUILT_DIRS_RELEASE}/libvorbisfile.a ${ARCH_PREBUILT_DIRS_RELEASE}/libvorbis.a ${ARCH_PREBUILT_DIRS_RELEASE}/libvorbisenc.a diff --git a/indra/cmake/Boost.cmake b/indra/cmake/Boost.cmake index 250d6cd923..7c305ad965 100644 --- a/indra/cmake/Boost.cmake +++ b/indra/cmake/Boost.cmake @@ -18,14 +18,14 @@ set(addrsfx "-x${ADDRESS_SIZE}") if (WINDOWS) target_link_libraries( ll::boost INTERFACE - libboost_context-mt${addrsfx} - libboost_fiber-mt${addrsfx} - libboost_filesystem-mt${addrsfx} - libboost_program_options-mt${addrsfx} - libboost_regex-mt${addrsfx} - libboost_system-mt${addrsfx} - libboost_thread-mt${addrsfx} - libboost_url-mt${addrsfx} + ${ARCH_PREBUILT_DIRS_RELEASE}/libboost_context-mt${addrsfx}.lib + ${ARCH_PREBUILT_DIRS_RELEASE}/libboost_fiber-mt${addrsfx}.lib + ${ARCH_PREBUILT_DIRS_RELEASE}/libboost_filesystem-mt${addrsfx}.lib + ${ARCH_PREBUILT_DIRS_RELEASE}/libboost_program_options-mt${addrsfx}.lib + ${ARCH_PREBUILT_DIRS_RELEASE}/libboost_regex-mt${addrsfx}.lib + ${ARCH_PREBUILT_DIRS_RELEASE}/libboost_system-mt${addrsfx}.lib + ${ARCH_PREBUILT_DIRS_RELEASE}/libboost_thread-mt${addrsfx}.lib + ${ARCH_PREBUILT_DIRS_RELEASE}/libboost_url-mt${addrsfx}.lib ) elseif (DARWIN) target_link_libraries( ll::boost INTERFACE diff --git a/indra/cmake/CEFPlugin.cmake b/indra/cmake/CEFPlugin.cmake index 555d2aebbf..08c5356a3a 100644 --- a/indra/cmake/CEFPlugin.cmake +++ b/indra/cmake/CEFPlugin.cmake @@ -10,9 +10,9 @@ target_include_directories( ll::cef SYSTEM INTERFACE ${LIBS_PREBUILT_DIR}/inclu if (WINDOWS) target_link_libraries( ll::cef INTERFACE - libcef.lib - libcef_dll_wrapper.lib - dullahan.lib + ${ARCH_PREBUILT_DIRS_RELEASE}/libcef.lib + ${ARCH_PREBUILT_DIRS_RELEASE}/libcef_dll_wrapper.lib + ${ARCH_PREBUILT_DIRS_RELEASE}/dullahan.lib ) elseif (DARWIN) FIND_LIBRARY(APPKIT_LIBRARY AppKit) @@ -34,8 +34,8 @@ elseif (DARWIN) elseif (LINUX) target_link_libraries( ll::cef INTERFACE - libdullahan.a - cef - cef_dll_wrapper.a + ${ARCH_PREBUILT_DIRS_RELEASE}/libdullahan.a + ${ARCH_PREBUILT_DIRS_RELEASE}/libcef.so + ${ARCH_PREBUILT_DIRS_RELEASE}/libcef_dll_wrapper.a ) endif (WINDOWS) diff --git a/indra/cmake/LibVLCPlugin.cmake b/indra/cmake/LibVLCPlugin.cmake index 4a1028d005..2029cbf7c9 100644 --- a/indra/cmake/LibVLCPlugin.cmake +++ b/indra/cmake/LibVLCPlugin.cmake @@ -19,12 +19,12 @@ set(LIBVLCPLUGIN ON CACHE BOOL if (WINDOWS) target_link_libraries( ll::libvlc INTERFACE - libvlc.lib - libvlccore.lib + ${ARCH_PREBUILT_DIRS_RELEASE}/libvlc.lib + ${ARCH_PREBUILT_DIRS_RELEASE}/libvlccore.lib ) elseif (DARWIN) target_link_libraries( ll::libvlc INTERFACE - ${ARCH_PREBUILT_DIRS_RELEASE}/libvlc.dylib - ${ARCH_PREBUILT_DIRS_RELEASE}/libvlccore.dylib + ${ARCH_PREBUILT_DIRS_RELEASE}/libvlc.dylib + ${ARCH_PREBUILT_DIRS_RELEASE}/libvlccore.dylib ) endif (WINDOWS) diff --git a/indra/cmake/NVAPI.cmake b/indra/cmake/NVAPI.cmake index ff5a5428e0..844e6518cb 100644 --- a/indra/cmake/NVAPI.cmake +++ b/indra/cmake/NVAPI.cmake @@ -6,7 +6,7 @@ set(NVAPI ON CACHE BOOL "Use NVAPI.") if (NVAPI) if (WINDOWS) add_library( ll::nvapi INTERFACE IMPORTED ) - target_link_libraries( ll::nvapi INTERFACE nvapi) + target_link_libraries( ll::nvapi INTERFACE ${ARCH_PREBUILT_DIRS_RELEASE}/nvapi.lib) use_prebuilt_binary(nvapi) endif (WINDOWS) endif (NVAPI) diff --git a/indra/cmake/OPENAL.cmake b/indra/cmake/OPENAL.cmake index 1d6eca4439..17f631655e 100644 --- a/indra/cmake/OPENAL.cmake +++ b/indra/cmake/OPENAL.cmake @@ -20,13 +20,13 @@ if (USE_OPENAL) if(WINDOWS) target_link_libraries( ll::openal INTERFACE - OpenAL32 - alut + ${ARCH_PREBUILT_DIRS_RELEASE}/OpenAL32.lib + ${ARCH_PREBUILT_DIRS_RELEASE}/alut.lib ) elseif(LINUX) target_link_libraries( ll::openal INTERFACE - openal - alut + ${ARCH_PREBUILT_DIRS_RELEASE}/libopenal.so + ${ARCH_PREBUILT_DIRS_RELEASE}/libalut.so ) else() target_link_libraries( ll::openal INTERFACE diff --git a/indra/cmake/OpenJPEG.cmake b/indra/cmake/OpenJPEG.cmake index 07591d7785..180ac0a87d 100644 --- a/indra/cmake/OpenJPEG.cmake +++ b/indra/cmake/OpenJPEG.cmake @@ -7,9 +7,9 @@ add_library( ll::openjpeg INTERFACE IMPORTED ) use_system_binary(openjpeg) use_prebuilt_binary(openjpeg) -if(DARWIN) -target_link_libraries(ll::openjpeg INTERFACE ${ARCH_PREBUILT_DIRS_RELEASE}/libopenjp2.a ) +if(WINDOWS) + target_link_libraries(ll::openjpeg INTERFACE ${ARCH_PREBUILT_DIRS_RELEASE}/openjp2.lib) else() -target_link_libraries(ll::openjpeg INTERFACE openjp2 ) + target_link_libraries(ll::openjpeg INTERFACE ${ARCH_PREBUILT_DIRS_RELEASE}/libopenjp2.a) endif() -target_include_directories( ll::openjpeg SYSTEM INTERFACE ${LIBS_PREBUILT_DIR}/include/openjpeg) +target_include_directories(ll::openjpeg SYSTEM INTERFACE ${LIBS_PREBUILT_DIR}/include/openjpeg) diff --git a/indra/llcommon/llsys.cpp b/indra/llcommon/llsys.cpp index 7e69ddf6fc..4e2a432103 100644 --- a/indra/llcommon/llsys.cpp +++ b/indra/llcommon/llsys.cpp @@ -192,6 +192,9 @@ LLOSInfo::LLOSInfo() : GetSystemInfo(&si); //if it fails get regular system info //(Warning: If GetSystemInfo it may result in incorrect information in a WOW64 machine, if the kernel fails to load) +#pragma warning(push) +#pragma warning(disable : 4996) // ignore 'deprecated.' GetVersionEx is deprecated + // Try calling GetVersionEx using the OSVERSIONINFOEX structure. OSVERSIONINFOEX osvi; ZeroMemory(&osvi, sizeof(OSVERSIONINFOEX)); @@ -210,6 +213,8 @@ LLOSInfo::LLOSInfo() : } } +#pragma warning(pop) + S32 ubr = 0; // Windows 10 Update Build Revision, can be retrieved from a registry if (mMajorVer == 10) { diff --git a/indra/llmath/llcalcparser.h b/indra/llmath/llcalcparser.h index b7f84a6546..fe4e6bb1a4 100644 --- a/indra/llmath/llcalcparser.h +++ b/indra/llmath/llcalcparser.h @@ -27,6 +27,13 @@ #ifndef LL_CALCPARSER_H #define LL_CALCPARSER_H +#include "llpreprocessor.h" + +#if defined(LL_GNUC) && GCC_VERSION >= 130000 +# pragma GCC diagnostic push +# pragma GCC diagnostic ignored "-Wdangling-pointer" +#endif + #include #include #include @@ -35,6 +42,10 @@ #include using namespace boost::spirit::classic; +#if defined(LL_GNUC) && GCC_VERSION >= 130000 +# pragma GCC diagnostic pop +#endif + #include "llcalc.h" #include "llmath.h" diff --git a/indra/newview/llface.cpp b/indra/newview/llface.cpp index 96829ed0ce..eaaf1def4f 100644 --- a/indra/newview/llface.cpp +++ b/indra/newview/llface.cpp @@ -1450,8 +1450,8 @@ bool LLFace::getGeometryVolume(const LLVolume& volume, } const LLMeshSkinInfo* skin = nullptr; - LLMatrix4a mat_vert; - LLMatrix4a mat_normal; + LLMatrix4a mat_vert = LLMatrix4a::identity(); + LLMatrix4a mat_normal = LLMatrix4a::identity(); // prepare mat_vert if (rebuild_pos) @@ -1921,6 +1921,7 @@ bool LLFace::getGeometryVolume(const LLVolume& volume, LLVector4a res0; //,res1,res2,res3; + res0.clear(); LLVector4a texIdx; diff --git a/indra/newview/llinventorygallerymenu.cpp b/indra/newview/llinventorygallerymenu.cpp index 340ecfcbbc..2f75c2ec5b 100644 --- a/indra/newview/llinventorygallerymenu.cpp +++ b/indra/newview/llinventorygallerymenu.cpp @@ -322,11 +322,11 @@ void LLInventoryGalleryContextMenu::doToSelected(const LLSD& userdata) } else if ("copy_slurl" == action) { - boost::function copy_slurl_cb = [](LLLandmark* landmark) + auto copy_slurl_cb = [](LLLandmark* landmark) { LLVector3d global_pos; landmark->getGlobalPos(global_pos); - boost::function copy_slurl_to_clipboard_cb = [](const std::string& slurl) + auto copy_slurl_to_clipboard_cb = [](const std::string& slurl) { gViewerWindow->getWindow()->copyTextToClipboard(utf8str_to_wstring(slurl)); LLSD args; diff --git a/indra/newview/llvoicevivox.cpp b/indra/newview/llvoicevivox.cpp index 87196b7a85..8ba9649d4f 100644 --- a/indra/newview/llvoicevivox.cpp +++ b/indra/newview/llvoicevivox.cpp @@ -1351,7 +1351,7 @@ bool LLVivoxVoiceClient::breakVoiceConnection(bool corowait) // At this point message system is already down so we can't wait for // the message, yet we need to receive "connector shutdown response". // Either wait a bit and emulate it or check gMessageSystem for specific message - _sleep(1000); + Sleep(1000); if (sConnected) { sConnected = false; diff --git a/indra/newview/llxmlrpclistener.cpp b/indra/newview/llxmlrpclistener.cpp index 92e6c88752..e28ada24e2 100644 --- a/indra/newview/llxmlrpclistener.cpp +++ b/indra/newview/llxmlrpclistener.cpp @@ -349,6 +349,11 @@ class Poller LLXMLRPCTransaction::EStatus mPreviousStatus; // To detect state changes. }; +#if defined(LL_GNUC) +# pragma GCC diagnostic push +# pragma GCC diagnostic ignored "-Wuninitialized" +#endif + LLXMLRPCListener::LLXMLRPCListener(const std::string& pumpname) : mBoundListener(LLEventPumps::instance().obtain(pumpname).listen ( @@ -364,3 +369,7 @@ LLXMLRPCListener::LLXMLRPCListener(const std::string& pumpname) )) { } + +#if defined(LL_GNUC) +# pragma GCC diagnostic pop +#endif From 8ed262ac7fd13e77473565cdd3a82ba41a6357d8 Mon Sep 17 00:00:00 2001 From: Rye Date: Wed, 11 Dec 2024 18:31:03 -0500 Subject: [PATCH 23/23] Temporary revert to restore mesh loading --- indra/newview/llmeshrepository.cpp | 297 ++++++++--------------------- indra/newview/llmeshrepository.h | 102 ++-------- 2 files changed, 98 insertions(+), 301 deletions(-) diff --git a/indra/newview/llmeshrepository.cpp b/indra/newview/llmeshrepository.cpp index 827555d697..e4e70b02f9 100644 --- a/indra/newview/llmeshrepository.cpp +++ b/indra/newview/llmeshrepository.cpp @@ -550,7 +550,6 @@ LLViewerFetchedTexture* LLMeshUploadThread::FindViewerTexture(const LLImportMate std::atomic LLMeshRepoThread::sActiveHeaderRequests = 0; std::atomic LLMeshRepoThread::sActiveLODRequests = 0; -std::atomic LLMeshRepoThread::sActiveSkinRequests = 0; U32 LLMeshRepoThread::sMaxConcurrentRequests = 1; S32 LLMeshRepoThread::sRequestLowWater = REQUEST2_LOW_WATER_MIN; S32 LLMeshRepoThread::sRequestHighWater = REQUEST2_HIGH_WATER_MIN; @@ -675,9 +674,7 @@ class LLMeshSkinInfoHandler : public LLMeshHandlerBase LLMeshSkinInfoHandler(const LLUUID& id, U32 offset, U32 requested_bytes) : LLMeshHandlerBase(offset, requested_bytes), mMeshID(id) - { - LLMeshRepoThread::incActiveSkinRequests(); - } + {} virtual ~LLMeshSkinInfoHandler(); protected: @@ -928,55 +925,11 @@ void LLMeshRepoThread::run() } sRequestWaterLevel = static_cast(mHttpRequestSet.size()); // Stats data update - // NOTE: order of queue processing intentionally favors LOD and Skin requests over header requests + // NOTE: order of queue processing intentionally favors LOD requests over header requests // Todo: we are processing mLODReqQ, mHeaderReqQ, mSkinRequests, mDecompositionRequests and mPhysicsShapeRequests // in relatively similar manners, remake code to simplify/unify the process, // like processRequests(&requestQ, fetchFunction); which does same thing for each element - if (mHttpRequestSet.size() < sRequestHighWater - && !mSkinRequests.empty()) - { - if (!mSkinRequests.empty()) - { - std::list incomplete; - while (!mSkinRequests.empty() && mHttpRequestSet.size() < sRequestHighWater) - { - - mMutex->lock(); - auto req = mSkinRequests.front(); - mSkinRequests.pop_front(); - mMutex->unlock(); - if (req.isDelayed()) - { - incomplete.emplace_back(req); - } - else if (!fetchMeshSkinInfo(req.mId, req.canRetry())) - { - if (req.canRetry()) - { - req.updateTime(); - incomplete.emplace_back(req); - } - else - { - LLMutexLock locker(mMutex); - mSkinUnavailableQ.push_back(req); - LL_DEBUGS() << "mSkinReqQ failed: " << req.mId << LL_ENDL; - } - } - } - - if (!incomplete.empty()) - { - LLMutexLock locker(mMutex); - for (const auto& req : incomplete) - { - mSkinRequests.push_back(req); - } - } - } - } - if (!mLODReqQ.empty() && mHttpRequestSet.size() < sRequestHighWater) { std::list incomplete; @@ -1075,13 +1028,54 @@ void LLMeshRepoThread::run() // performing long-duration actions. if (mHttpRequestSet.size() < sRequestHighWater - && (!mDecompositionRequests.empty() + && (!mSkinRequests.empty() + || !mDecompositionRequests.empty() || !mPhysicsShapeRequests.empty())) { // Something to do probably, lock and double-check. We don't want // to hold the lock long here. That will stall main thread activities // so we bounce it. + if (!mSkinRequests.empty()) + { + std::list incomplete; + while (!mSkinRequests.empty() && mHttpRequestSet.size() < sRequestHighWater) + { + + mMutex->lock(); + auto req = mSkinRequests.front(); + mSkinRequests.pop_front(); + mMutex->unlock(); + if (req.isDelayed()) + { + incomplete.emplace_back(req); + } + else if (!fetchMeshSkinInfo(req.mId, req.canRetry())) + { + if (req.canRetry()) + { + req.updateTime(); + incomplete.emplace_back(req); + } + else + { + LLMutexLock locker(mMutex); + mSkinUnavailableQ.push_back(req); + LL_DEBUGS() << "mSkinReqQ failed: " << req.mId << LL_ENDL; + } + } + } + + if (!incomplete.empty()) + { + LLMutexLock locker(mMutex); + for (const auto& req : incomplete) + { + mSkinRequests.push_back(req); + } + } + } + // holding lock, try next list // *TODO: For UI/debug-oriented lists, we might drop the fine- // grained locking as there's a lowered expectation of smoothness @@ -1109,7 +1103,7 @@ void LLMeshRepoThread::run() } else { - LL_DEBUGS(LOG_MESH) << "mDecompositionRequests failed: " << req.mId << LL_ENDL; + LL_DEBUGS() << "mDecompositionRequests failed: " << req.mId << LL_ENDL; } } } @@ -1145,7 +1139,7 @@ void LLMeshRepoThread::run() } else { - LL_DEBUGS(LOG_MESH) << "mPhysicsShapeRequests failed: " << req.mId << LL_ENDL; + LL_DEBUGS() << "mPhysicsShapeRequests failed: " << req.mId << LL_ENDL; } } } @@ -1201,30 +1195,12 @@ void LLMeshRepoThread::lockAndLoadMeshLOD(const LLVolumeParams& mesh_params, S32 } } + void LLMeshRepoThread::loadMeshLOD(const LLVolumeParams& mesh_params, S32 lod) { //could be called from any thread const LLUUID& mesh_id = mesh_params.getSculptID(); LLMutexLock lock(mMutex); LLMutexLock header_lock(mHeaderMutex); - loadMeshLOD(mesh_id, mesh_params, lod); -} - -void LLMeshRepoThread::loadMeshLODs(const lod_list_t& list) -{ //could be called from any thread - LLMutexLock lock(mMutex); - LLMutexLock header_lock(mHeaderMutex); - for (auto lod_pair : list) - { - const LLVolumeParams& mesh_params = lod_pair.first; - const LLUUID& mesh_id = mesh_params.getSculptID(); - S32 lod = lod_pair.second; - loadMeshLOD(mesh_id, mesh_params, lod); - } -} - -void LLMeshRepoThread::loadMeshLOD(const LLUUID& mesh_id, const LLVolumeParams& mesh_params, S32 lod) -{ - // must be mutex locked by caller mesh_header_map::iterator iter = mMeshHeader.find(mesh_id); if (iter != mMeshHeader.end()) { //if we have the header, request LOD byte range @@ -1241,25 +1217,14 @@ void LLMeshRepoThread::loadMeshLOD(const LLUUID& mesh_id, const LLVolumeParams& pending_lod_map::iterator pending = mPendingLOD.find(mesh_id); if (pending != mPendingLOD.end()) - { - //append this lod request to existing header request - if (lod < LLModel::NUM_LODS && lod >= 0) - { - pending->second[lod]++; - } - else - { - LL_WARNS(LOG_MESH) << "Invalid LOD request: " << lod << "for mesh" << mesh_id << LL_ENDL; - } - llassert_msg(lod < LLModel::NUM_LODS, "Requested lod is out of bounds"); + { //append this lod request to existing header request + pending->second.push_back(lod); + llassert(pending->second.size() <= LLModel::NUM_LODS); } else - { - //if no header request is pending, fetch header + { //if no header request is pending, fetch header mHeaderReqQ.push(req); - auto& array = mPendingLOD[mesh_id]; - std::fill(array.begin(), array.end(), 0); - array[lod]++; + mPendingLOD[mesh_id].push_back(lod); } } } @@ -1734,20 +1699,6 @@ void LLMeshRepoThread::decActiveHeaderRequests() --LLMeshRepoThread::sActiveHeaderRequests; } -//static -void LLMeshRepoThread::incActiveSkinRequests() -{ - LLMutexLock lock(gMeshRepo.mThread->mMutex); - ++LLMeshRepoThread::sActiveSkinRequests; -} - -//static -void LLMeshRepoThread::decActiveSkinRequests() -{ - LLMutexLock lock(gMeshRepo.mThread->mMutex); - --LLMeshRepoThread::sActiveSkinRequests; -} - //return false if failed to get header bool LLMeshRepoThread::fetchMeshHeader(const LLVolumeParams& mesh_params, bool can_retry) { @@ -2018,27 +1969,11 @@ EMeshProcessingResult LLMeshRepoThread::headerReceived(const LLVolumeParams& mes pending_lod_map::iterator iter = mPendingLOD.find(mesh_id); if (iter != mPendingLOD.end()) { - for (S32 i = 0; i < iter->second.size(); ++i) + for (U32 i = 0; i < iter->second.size(); ++i) { - if (iter->second[i] > 1) - { - // mLoadingMeshes should be protecting from dupplciates, but looks - // like this is possible if object rezzes, unregisterMesh, then - // rezzes again before first request completes. - // mLoadingMeshes might need to change a bit to not rerequest if - // mesh is already pending. - // - // Todo: Improve mLoadingMeshes and once done turn this into an assert. - // Low priority since such situation should be relatively rare - LL_INFOS(LOG_MESH) << "Multiple dupplicate requests for mesd ID: " << mesh_id << " LOD: " << i - << LL_ENDL; - } - if (iter->second[i] > 0) - { - LODRequest req(mesh_params, i); - mLODReqQ.push(req); - LLMeshRepository::sLODProcessing++; - } + LODRequest req(mesh_params, iter->second[i]); + mLODReqQ.push(req); + LLMeshRepository::sLODProcessing++; } mPendingLOD.erase(iter); } @@ -3511,7 +3446,6 @@ LLMeshSkinInfoHandler::~LLMeshSkinInfoHandler() { LL_WARNS(LOG_MESH) << "deleting unprocessed request handler (may be ok on exit)" << LL_ENDL; } - LLMeshRepoThread::decActiveSkinRequests(); } void LLMeshSkinInfoHandler::processFailure(LLCore::HttpStatus status) @@ -3847,7 +3781,7 @@ S32 LLMeshRepository::loadMesh(LLVOVolume* vobj, const LLVolumeParams& mesh_para { //first request for this mesh mLoadingMeshes[detail][mesh_id].push_back(vobj); - mPendingRequests.emplace_back(new PendingRequestLOD(mesh_params, detail)); + mPendingRequests.push_back(LLMeshRepoThread::LODRequest(mesh_params, detail)); LLMeshRepository::sLODPending++; } } @@ -3906,44 +3840,6 @@ S32 LLMeshRepository::loadMesh(LLVOVolume* vobj, const LLVolumeParams& mesh_para return detail; } -F32 calculate_score(LLVOVolume* object) -{ - if (!object) - { - return -1.f; - } - LLDrawable* drawable = object->mDrawable; - if (!drawable) - { - return -1; - } - if (drawable->isState(LLDrawable::RIGGED) || object->isAttachment()) - { - LLVOAvatar* avatar = object->getAvatar(); - LLDrawable* av_drawable = avatar ? avatar->mDrawable : nullptr; - if (avatar && av_drawable) - { - // See LLVOVolume::calcLOD() - F32 radius; - if (avatar->isControlAvatar()) - { - const LLVector3* box = avatar->getLastAnimExtents(); - LLVector3 diag = box[1] - box[0]; - radius = diag.magVec() * 0.5f; - } - else - { - // Volume in a rigged mesh attached to a regular avatar. - const LLVector3* box = avatar->getLastAnimExtents(); - LLVector3 diag = box[1] - box[0]; - radius = diag.magVec(); - } - return radius / llmax(av_drawable->mDistanceWRTCamera, 1.f); - } - } - return drawable->getRadius() / llmax(drawable->mDistanceWRTCamera, 1.f); -} - void LLMeshRepository::notifyLoadedMeshes() { //called from main thread LL_PROFILE_ZONE_SCOPED_CATEGORY_NETWORK; //LL_RECORD_BLOCK_TIME(FTM_MESH_FETCH); @@ -4121,12 +4017,8 @@ void LLMeshRepository::notifyLoadedMeshes() mUploadErrorQ.pop(); } - // mPendingRequests go into queues, queues go into active http requests. - // Checking sRequestHighWater to keep queues at least somewhat populated - // for faster transition into http - S32 active_count = LLMeshRepoThread::sActiveHeaderRequests + LLMeshRepoThread::sActiveLODRequests + LLMeshRepoThread::sActiveSkinRequests; - active_count += (S32)(mThread->mLODReqQ.size() + mThread->mHeaderReqQ.size() + mThread->mSkinInfoQ.size()); - if (active_count < LLMeshRepoThread::sRequestHighWater) + S32 active_count = LLMeshRepoThread::sActiveHeaderRequests + LLMeshRepoThread::sActiveLODRequests; + if (active_count < LLMeshRepoThread::sRequestLowWater) { S32 push_count = LLMeshRepoThread::sRequestHighWater - active_count; @@ -4147,73 +4039,48 @@ void LLMeshRepository::notifyLoadedMeshes() F32 max_score = 0.f; for (auto obj_iter = iter->second.begin(); obj_iter != iter->second.end(); ++obj_iter) { - F32 cur_score = calculate_score(*obj_iter); - if (cur_score >= 0.f) + LLVOVolume* object = *obj_iter; + if (object) { - max_score = llmax(max_score, cur_score); + LLDrawable* drawable = object->mDrawable; + if (drawable) + { + F32 cur_score = drawable->getRadius()/llmax(drawable->mDistanceWRTCamera, 1.f); + max_score = llmax(max_score, cur_score); + } } } score_map[iter->first] = max_score; } } - for (mesh_load_map::iterator iter = mLoadingSkins.begin(); iter != mLoadingSkins.end(); ++iter) - { - F32 max_score = 0.f; - for (auto obj_iter = iter->second.begin(); obj_iter != iter->second.end(); ++obj_iter) - { - F32 cur_score = calculate_score(*obj_iter); - if (cur_score >= 0.f) - { - max_score = llmax(max_score, cur_score); - } - } - - score_map[iter->first] = max_score; - } //set "score" for pending requests - for (std::unique_ptr& req_p : mPendingRequests) + for (std::vector::iterator iter = mPendingRequests.begin(); iter != mPendingRequests.end(); ++iter) { - req_p->setScore(score_map[req_p->getId()]); + iter->mScore = score_map[iter->mMeshParams.getSculptID()]; } //sort by "score" std::partial_sort(mPendingRequests.begin(), mPendingRequests.begin() + push_count, - mPendingRequests.end(), PendingRequestBase::CompareScoreGreater()); + mPendingRequests.end(), LLMeshRepoThread::CompareScoreGreater()); } - LLMeshRepoThread::lod_list_t pending_lods; // to avoid locking on each operation, make a list beforehand - pending_lods.reserve(push_count); + while (!mPendingRequests.empty() && push_count > 0) { - std::unique_ptr& req_p = mPendingRequests.front(); - switch (req_p->getRequestType()) - { - case MESH_REQUEST_LOD: - { - PendingRequestLOD* lod = (PendingRequestLOD*)req_p.get(); - pending_lods.emplace_back(lod->mMeshParams, lod->mLOD); - LLMeshRepository::sLODPending--; - break; - } - case MESH_REQUEST_SKIN: - { - PendingRequestUUID* skin = (PendingRequestUUID*)req_p.get(); - mThread->loadMeshSkinInfo(skin->getId()); - break; - } - - default: - LL_ERRS() << "Unknown request type in LLMeshRepository::notifyLoadedMeshes" << LL_ENDL; - break; - } + LLMeshRepoThread::LODRequest& request = mPendingRequests.front(); + mThread->loadMeshLOD(request.mMeshParams, request.mLOD); mPendingRequests.erase(mPendingRequests.begin()); + LLMeshRepository::sLODPending--; push_count--; } - if (!pending_lods.empty()) - { - mThread->loadMeshLODs(pending_lods); - } + } + + //send skin info requests + while (!mPendingSkinRequests.empty()) + { + mThread->loadMeshSkinInfo(mPendingSkinRequests.front()); + mPendingSkinRequests.pop(); } //send decomposition requests @@ -4407,7 +4274,7 @@ const LLMeshSkinInfo* LLMeshRepository::getSkinInfo(const LLUUID& mesh_id, LLVOV { //first request for this mesh mLoadingSkins[mesh_id].push_back(requesting_obj); - mPendingRequests.emplace_back(new PendingRequestUUID(mesh_id, MESH_REQUEST_SKIN)); + mPendingSkinRequests.push(mesh_id); } } } diff --git a/indra/newview/llmeshrepository.h b/indra/newview/llmeshrepository.h index ba33f19c3e..c7572c9cbf 100644 --- a/indra/newview/llmeshrepository.h +++ b/indra/newview/llmeshrepository.h @@ -63,16 +63,6 @@ typedef enum e_mesh_processing_result_enum MESH_UNKNOWN } EMeshProcessingResult; -typedef enum e_mesh_request_type_enum -{ - MESH_REQUEST_HEADER, - MESH_REQUEST_LOD, - MESH_REQUEST_SKIN, - MESH_REQUEST_DECOMPOSITION, - MESH_REQUEST_PHYSICS, - MESH_REQUEST_UKNOWN -} EMeshRequestType; - class LLMeshUploadData { public: @@ -193,8 +183,7 @@ class LLPhysicsDecomp : public LLThread class RequestStats { public: - - RequestStats() :mRetries(0) {}; + RequestStats() : mRetries(0) {}; void updateTime(); bool canRetry() const; @@ -206,67 +195,6 @@ class RequestStats LLFrameTimer mTimer; }; - -class PendingRequestBase -{ -public: - struct CompareScoreGreater - { - bool operator()(const std::unique_ptr& lhs, const std::unique_ptr& rhs) - { - return lhs->mScore > rhs->mScore; // greatest = first - } - }; - - PendingRequestBase() : mScore(0.f) {}; - virtual ~PendingRequestBase() {} - - bool operator<(const PendingRequestBase& rhs) const - { - return mId < rhs.mId; - } - - void setScore(F32 score) { mScore = score; } - F32 getScore() const { return mScore; } - LLUUID getId() const { return mId; } - virtual EMeshRequestType getRequestType() const = 0; - -protected: - F32 mScore; - LLUUID mId; -}; - -class PendingRequestLOD : public PendingRequestBase -{ -public: - LLVolumeParams mMeshParams; - S32 mLOD; - - PendingRequestLOD(const LLVolumeParams& mesh_params, S32 lod) - : PendingRequestBase(), mMeshParams(mesh_params), mLOD(lod) - { - mId = mMeshParams.getSculptID(); - } - - EMeshRequestType getRequestType() const override { return MESH_REQUEST_LOD; } -}; - -class PendingRequestUUID : public PendingRequestBase -{ -public: - - PendingRequestUUID(const LLUUID& id, EMeshRequestType type) - : PendingRequestBase(), mRequestType(type) - { - mId = id; - } - - EMeshRequestType getRequestType() const override { return mRequestType; } - -private: - EMeshRequestType mRequestType; -}; - class LLMeshHeader { public: @@ -330,7 +258,6 @@ class LLMeshRepoThread : public LLThread static std::atomic sActiveHeaderRequests; static std::atomic sActiveLODRequests; - static std::atomic sActiveSkinRequests; static U32 sMaxConcurrentRequests; static S32 sRequestLowWater; static S32 sRequestHighWater; @@ -365,13 +292,22 @@ class LLMeshRepoThread : public LLThread public: LLVolumeParams mMeshParams; S32 mLOD; + F32 mScore; LODRequest(const LLVolumeParams& mesh_params, S32 lod) - : RequestStats(), mMeshParams(mesh_params), mLOD(lod) + : RequestStats(), mMeshParams(mesh_params), mLOD(lod), mScore(0.f) { } }; + struct CompareScoreGreater + { + bool operator()(const LODRequest& lhs, const LODRequest& rhs) + { + return lhs.mScore > rhs.mScore; // greatest = first + } + }; + class UUIDBasedRequest : public RequestStats { public: @@ -433,7 +369,7 @@ class LLMeshRepoThread : public LLThread std::deque mLoadedQ; //map of pending header requests and currently desired LODs - typedef std::unordered_map > pending_lod_map; + typedef std::unordered_map > pending_lod_map; pending_lod_map mPendingLOD; // map of mesh ID to skin info (mirrors LLMeshRepository::mSkinMap) @@ -466,9 +402,6 @@ class LLMeshRepoThread : public LLThread void lockAndLoadMeshLOD(const LLVolumeParams& mesh_params, S32 lod); void loadMeshLOD(const LLVolumeParams& mesh_params, S32 lod); - typedef std::vector > lod_list_t; - void loadMeshLODs(const lod_list_t& mesh_vect); - bool fetchMeshHeader(const LLVolumeParams& mesh_params, bool can_retry = true); bool fetchMeshLOD(const LLVolumeParams& mesh_params, S32 lod, bool can_retry = true); EMeshProcessingResult headerReceived(const LLVolumeParams& mesh_params, U8* data, S32 data_size); @@ -503,8 +436,6 @@ class LLMeshRepoThread : public LLThread static void decActiveLODRequests(); static void incActiveHeaderRequests(); static void decActiveHeaderRequests(); - static void incActiveSkinRequests(); - static void decActiveSkinRequests(); // Set the caps strings and preferred version for constructing // mesh fetch URLs. @@ -525,9 +456,6 @@ class LLMeshRepoThread : public LLThread LLCore::HttpHandle getByteRange(const std::string & url, size_t offset, size_t len, const LLCore::HttpHandler::ptr_t &handler); - - // Mutex: mMutex must be alerady locked when calling - void loadMeshLOD(const LLUUID &mesh_id, const LLVolumeParams& mesh_params, S32 lod); }; @@ -769,13 +697,15 @@ class LLMeshRepository LLMutex* mMeshMutex; - typedef std::vector > pending_requests_vec; - pending_requests_vec mPendingRequests; + std::vector mPendingRequests; //list of mesh ids awaiting skin info typedef boost::unordered_map > skin_load_map; skin_load_map mLoadingSkins; + //list of mesh ids that need to send skin info fetch requests + std::queue mPendingSkinRequests; + //list of mesh ids awaiting decompositions std::unordered_set mLoadingDecompositions;