From ab3106d58e2abe9fc3a9e74ac20ada9ca46a7f46 Mon Sep 17 00:00:00 2001 From: Hecklezz Date: Wed, 22 Oct 2025 19:27:51 +1000 Subject: Updated APR library and removed hotfix patch in APR cmake --- autobuild.xml | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'autobuild.xml') diff --git a/autobuild.xml b/autobuild.xml index 2983307cbe..dbbe1981b6 100644 --- a/autobuild.xml +++ b/autobuild.xml @@ -46,11 +46,11 @@ archive hash - a21487f4e3a68721fd97edef117795a1b7212a77 + 3f8e58fe74e144b771858e89a5514bf354964c76 hash_algorithm sha1 url - https://github.com/secondlife/3p-apr_suite/releases/download/v1.7.5-r1/apr_suite-1.7.5-12259255574-darwin64-12259255574.tar.zst + https://github.com/secondlife/3p-apr_suite/releases/download/v1.7.5-r2/apr_suite-1.7.5-18696779749-darwin64-18696779749.tar.zst name darwin64 @@ -60,11 +60,11 @@ archive hash - 45baf82d3366734e542a2a3749f495b64f5513b4 + df36114eb8fb66fdcbb190011222a7d336791d98 hash_algorithm sha1 url - https://github.com/secondlife/3p-apr_suite/releases/download/v1.7.5-r1/apr_suite-1.7.5-12259255574-linux64-12259255574.tar.zst + https://github.com/secondlife/3p-apr_suite/releases/download/v1.7.5-r2/apr_suite-1.7.5-18696779749-linux64-18696779749.tar.zst name linux64 @@ -74,11 +74,11 @@ archive hash - bdd35d3b9580d3cdcb98afae639936aaa40e24c4 + 164705831819d247753c9fd608c2c1ac8dca1883 hash_algorithm sha1 url - https://github.com/secondlife/3p-apr_suite/releases/download/v1.7.5-r1/apr_suite-1.7.5-12259255574-windows64-12259255574.tar.zst + https://github.com/secondlife/3p-apr_suite/releases/download/v1.7.5-r2/apr_suite-1.7.5-18696779749-windows64-18696779749.tar.zst name windows64 @@ -91,7 +91,7 @@ copyright Copyright © 2012 The Apache Software Foundation, Licensed under the Apache License, Version 2.0. version - 1.7.5-12259255574 + 1.7.5-18696779749 name apr_suite description -- cgit v1.3 From 348974089c6f5f441deda9cec028210b5a298d50 Mon Sep 17 00:00:00 2001 From: Rye Date: Thu, 23 Oct 2025 05:47:55 -0400 Subject: Restore linux CEF build support including changes from archive/develop Fix various files missing linden_common Signed-off-by: Rye --- autobuild.xml | 14 +- indra/cmake/FindPipeWire.cmake | 100 +++++++ indra/cmake/LibVLCPlugin.cmake | 35 ++- indra/llcommon/llatomic.cpp | 2 + indra/llcommon/llcallbacklist.cpp | 2 + indra/llcommon/lldeadmantimer.cpp | 1 + indra/llcommon/llprocinfo.cpp | 1 + indra/llcommon/llprofiler.cpp | 2 +- indra/llcommon/llprofiler.h | 9 + indra/llfilesystem/lldiriterator.cpp | 2 + indra/llplugin/llpluginclassmedia.cpp | 9 + indra/llplugin/llpluginclassmedia.h | 4 + indra/media_plugins/cef/CMakeLists.txt | 63 ++-- .../cef/linux/volume_catcher_linux.cpp | 78 +++++ .../media_plugins/cef/linux/volume_catcher_linux.h | 149 +++++++++ .../cef/linux/volume_catcher_pipewire.cpp | 333 +++++++++++++++++++++ .../cef/linux/volume_catcher_pipewire_syms.inc | 26 ++ .../cef/linux/volume_catcher_pulseaudio.cpp | 322 ++++++++++++++++++++ .../linux/volume_catcher_pulseaudio_glib_syms.inc | 10 + .../cef/linux/volume_catcher_pulseaudio_syms.inc | 29 ++ .../media_plugins/cef/mac_volume_catcher_null.cpp | 95 ------ indra/media_plugins/cef/media_plugin_cef.cpp | 41 ++- indra/media_plugins/cef/volume_catcher.h | 10 +- indra/media_plugins/cef/volume_catcher_null.cpp | 59 ++++ indra/media_plugins/cef/windows_volume_catcher.cpp | 1 - indra/newview/app_settings/settings.xml | 11 + indra/newview/llviewermedia.cpp | 9 +- .../skins/default/xui/en/mime_types_linux.xml | 70 ++--- indra/newview/viewer_manifest.py | 62 +++- 29 files changed, 1359 insertions(+), 190 deletions(-) create mode 100644 indra/cmake/FindPipeWire.cmake create mode 100644 indra/media_plugins/cef/linux/volume_catcher_linux.cpp create mode 100644 indra/media_plugins/cef/linux/volume_catcher_linux.h create mode 100755 indra/media_plugins/cef/linux/volume_catcher_pipewire.cpp create mode 100644 indra/media_plugins/cef/linux/volume_catcher_pipewire_syms.inc create mode 100755 indra/media_plugins/cef/linux/volume_catcher_pulseaudio.cpp create mode 100755 indra/media_plugins/cef/linux/volume_catcher_pulseaudio_glib_syms.inc create mode 100755 indra/media_plugins/cef/linux/volume_catcher_pulseaudio_syms.inc delete mode 100644 indra/media_plugins/cef/mac_volume_catcher_null.cpp create mode 100644 indra/media_plugins/cef/volume_catcher_null.cpp (limited to 'autobuild.xml') diff --git a/autobuild.xml b/autobuild.xml index dbbe1981b6..ea46495671 100644 --- a/autobuild.xml +++ b/autobuild.xml @@ -450,11 +450,11 @@ archive hash - 126e0fa4c16dfd433c9fb7d1d242da98f213d933 + 2c81fa7aa03b427088ab54ce3b71088a0003126b hash_algorithm sha1 url - https://github.com/secondlife/dullahan/releases/download/v1.24.0-CEF_139.0.40/dullahan-1.24.0.202510081737_139.0.40_g465474a_chromium-139.0.7258.139-darwin64-18353103947.tar.zst + https://github.com/secondlife/dullahan/releases/download/v1.26.0-CEF_139.0.40/dullahan-1.26.0.202510161627_139.0.40_g465474a_chromium-139.0.7258.139-darwin64-18568015445.tar.zst name darwin64 @@ -464,11 +464,11 @@ archive hash - 209d031ae67bc66d8e8f8509c71d259014c65ceb + 8e06d060729250c5bfcb993c8f818f36ea17de16 hash_algorithm sha1 url - https://github.com/secondlife/dullahan/releases/download/v1.14.0-r3/dullahan-1.14.0.202408091637_118.4.1_g3dd6078_chromium-118.0.5993.54-linux64-10322607516.tar.zst + https://github.com/secondlife/dullahan/releases/download/v1.26.0-CEF_139.0.40/dullahan-1.26.0.202510161627_139.0.40_g465474a_chromium-139.0.7258.139-linux64-18568015445.tar.zst name linux64 @@ -478,11 +478,11 @@ archive hash - 20de62c9e57d9e6539c1e2437ec4b46c3ca237bc + 7ca6db37f019b47e230c0861607c546d45535367 hash_algorithm sha1 url - https://github.com/secondlife/dullahan/releases/download/v1.24.0-CEF_139.0.40/dullahan-1.24.0.202510081738_139.0.40_g465474a_chromium-139.0.7258.139-windows64-18353103947.tar.zst + https://github.com/secondlife/dullahan/releases/download/v1.26.0-CEF_139.0.40/dullahan-1.26.0.202510161628_139.0.40_g465474a_chromium-139.0.7258.139-windows64-18568015445.tar.zst name windows64 @@ -495,7 +495,7 @@ copyright Copyright (c) 2017, Linden Research, Inc. version - 1.24.0.202510081737_139.0.40_g465474a_chromium-139.0.7258.139 + 1.26.0.202510161627_139.0.40_g465474a_chromium-139.0.7258.139 name dullahan description diff --git a/indra/cmake/FindPipeWire.cmake b/indra/cmake/FindPipeWire.cmake new file mode 100644 index 0000000000..868acf5ec1 --- /dev/null +++ b/indra/cmake/FindPipeWire.cmake @@ -0,0 +1,100 @@ +# cmake-format: off +# .rst: FindPipeWire +# ------- +# +# Try to find PipeWire on a Unix system. +# +# This will define the following variables: +# +# ``PIPEWIRE_FOUND`` True if (the requested version of) PipeWire is available +# ``PIPEWIRE_VERSION`` The version of PipeWire ``PIPEWIRE_LIBRARIES`` This can +# be passed to target_link_libraries() instead of the ``PipeWire::PipeWire`` +# target ``PIPEWIRE_INCLUDE_DIRS`` This should be passed to +# target_include_directories() if the target is not used for linking +# ``PIPEWIRE_COMPILE_FLAGS`` This should be passed to target_compile_options() +# if the target is not used for linking +# +# If ``PIPEWIRE_FOUND`` is TRUE, it will also define the following imported +# target: +# +# ``PipeWire::PipeWire`` The PipeWire library +# +# In general we recommend using the imported target, as it is easier to use. +# Bear in mind, however, that if the target is in the link interface of an +# exported library, it must be made available by the package config file. + +# ============================================================================= +# Copyright 2014 Alex Merry Copyright 2014 Martin Gräßlin +# Copyright 2018-2020 Jan Grulich +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions are met: +# +# 1. Redistributions of source code must retain the copyright notice, this list +# of conditions and the following disclaimer. +# 2. Redistributions in binary form must reproduce the copyright notice, this +# list of conditions and the following disclaimer in the documentation and/or +# other materials provided with the distribution. +# 3. The name of the author may not be used to endorse or promote products +# derived from this software without specific prior written permission. +# +# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED +# WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF +# MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO +# EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, +# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR +# BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER +# IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +# POSSIBILITY OF SUCH DAMAGE. +# ============================================================================= +# cmake-format: on + +# Use pkg-config to get the directories and then use these values in the FIND_PATH() and FIND_LIBRARY() calls +find_package(PkgConfig QUIET) + +pkg_search_module(PKG_PIPEWIRE QUIET libpipewire-0.3) +pkg_search_module(PKG_SPA QUIET libspa-0.2) + +set(PIPEWIRE_COMPILE_FLAGS "${PKG_PIPEWIRE_CFLAGS}" "${PKG_SPA_CFLAGS}") +set(PIPEWIRE_VERSION "${PKG_PIPEWIRE_VERSION}") + +find_path( + PIPEWIRE_INCLUDE_DIRS + NAMES pipewire/pipewire.h + HINTS ${PKG_PIPEWIRE_INCLUDE_DIRS} ${PKG_PIPEWIRE_INCLUDE_DIRS}/pipewire-0.3) + +find_path( + SPA_INCLUDE_DIRS + NAMES spa/param/props.h + HINTS ${PKG_SPA_INCLUDE_DIRS} ${PKG_SPA_INCLUDE_DIRS}/spa-0.2) + +find_library( + PIPEWIRE_LIBRARIES + NAMES pipewire-0.3 + HINTS ${PKG_PIPEWIRE_LIBRARY_DIRS}) + +include(FindPackageHandleStandardArgs) +find_package_handle_standard_args( + PipeWire + FOUND_VAR PIPEWIRE_FOUND + REQUIRED_VARS PIPEWIRE_LIBRARIES PIPEWIRE_INCLUDE_DIRS SPA_INCLUDE_DIRS + VERSION_VAR PIPEWIRE_VERSION) + +if(PIPEWIRE_FOUND AND NOT TARGET PipeWire::PipeWire) + add_library(PipeWire::PipeWire UNKNOWN IMPORTED) + set_target_properties( + PipeWire::PipeWire + PROPERTIES IMPORTED_LOCATION "${PIPEWIRE_LIBRARIES}" + INTERFACE_COMPILE_OPTIONS "${PIPEWIRE_COMPILE_FLAGS}" + INTERFACE_INCLUDE_DIRECTORIES "${PIPEWIRE_INCLUDE_DIRS};${SPA_INCLUDE_DIRS}") +endif() + +mark_as_advanced(PIPEWIRE_LIBRARIES PIPEWIRE_INCLUDE_DIRS) + +include(FeatureSummary) +set_package_properties( + PipeWire PROPERTIES + URL "https://www.pipewire.org" + DESCRIPTION "PipeWire - multimedia processing") diff --git a/indra/cmake/LibVLCPlugin.cmake b/indra/cmake/LibVLCPlugin.cmake index 6361028c0c..a38c660a33 100644 --- a/indra/cmake/LibVLCPlugin.cmake +++ b/indra/cmake/LibVLCPlugin.cmake @@ -5,20 +5,31 @@ include(Prebuilt) include_guard() add_library( ll::libvlc INTERFACE IMPORTED ) -use_prebuilt_binary(vlc-bin) set(LIBVLCPLUGIN ON CACHE BOOL "LIBVLCPLUGIN support for the llplugin/llmedia test apps.") -find_library(VLC_LIBRARY - NAMES - libvlc.lib - libvlc.dylib - PATHS "${ARCH_PREBUILT_DIRS_RELEASE}" REQUIRED NO_DEFAULT_PATH) +if (LIBVLCPLUGIN) + if(LINUX) + find_package(PkgConfig REQUIRED) -find_library(VLCCORE_LIBRARY - NAMES - libvlccore.lib - libvlccore.dylib - PATHS "${ARCH_PREBUILT_DIRS_RELEASE}" REQUIRED NO_DEFAULT_PATH) + pkg_check_modules(libvlc REQUIRED IMPORTED_TARGET libvlc) + target_link_libraries( ll::libvlc INTERFACE PkgConfig::libvlc) + return() + endif() -target_link_libraries(ll::libvlc INTERFACE ${VLC_LIBRARY} ${VLCCORE_LIBRARY}) + use_prebuilt_binary(vlc-bin) + + find_library(VLC_LIBRARY + NAMES + libvlc.lib + libvlc.dylib + PATHS "${ARCH_PREBUILT_DIRS_RELEASE}" REQUIRED NO_DEFAULT_PATH) + + find_library(VLCCORE_LIBRARY + NAMES + libvlccore.lib + libvlccore.dylib + PATHS "${ARCH_PREBUILT_DIRS_RELEASE}" REQUIRED NO_DEFAULT_PATH) + + target_link_libraries(ll::libvlc INTERFACE ${VLC_LIBRARY} ${VLCCORE_LIBRARY}) +endif() diff --git a/indra/llcommon/llatomic.cpp b/indra/llcommon/llatomic.cpp index d200bb0406..cff5e01225 100644 --- a/indra/llcommon/llatomic.cpp +++ b/indra/llcommon/llatomic.cpp @@ -23,6 +23,8 @@ * $/LicenseInfo$ */ +#include "linden_common.h" + #include "llatomic.h" //============================================================================ diff --git a/indra/llcommon/llcallbacklist.cpp b/indra/llcommon/llcallbacklist.cpp index 3d5d30bd90..8fb7823f04 100644 --- a/indra/llcommon/llcallbacklist.cpp +++ b/indra/llcommon/llcallbacklist.cpp @@ -24,6 +24,8 @@ * $/LicenseInfo$ */ +#include "linden_common.h" + #include "llcallbacklist.h" #include "lleventtimer.h" #include "llerrorlegacy.h" diff --git a/indra/llcommon/lldeadmantimer.cpp b/indra/llcommon/lldeadmantimer.cpp index f9c14d7c24..45c01eb84a 100644 --- a/indra/llcommon/lldeadmantimer.cpp +++ b/indra/llcommon/lldeadmantimer.cpp @@ -25,6 +25,7 @@ * $/LicenseInfo$ */ +#include "linden_common.h" #include "lldeadmantimer.h" diff --git a/indra/llcommon/llprocinfo.cpp b/indra/llcommon/llprocinfo.cpp index 69be00e14a..9fe4af2103 100644 --- a/indra/llcommon/llprocinfo.cpp +++ b/indra/llcommon/llprocinfo.cpp @@ -25,6 +25,7 @@ * $/LicenseInfo$ */ +#include "linden_common.h" #include "llprocinfo.h" diff --git a/indra/llcommon/llprofiler.cpp b/indra/llcommon/llprofiler.cpp index bdddabf977..b2ac7723d4 100644 --- a/indra/llcommon/llprofiler.cpp +++ b/indra/llcommon/llprofiler.cpp @@ -25,6 +25,6 @@ * $/LicenseInfo$ */ -#include "linden_common.h" +#include "llpreprocessor.h" #include "TracyClient.cpp" diff --git a/indra/llcommon/llprofiler.h b/indra/llcommon/llprofiler.h index 5fb32d6280..7c77d94475 100644 --- a/indra/llcommon/llprofiler.h +++ b/indra/llcommon/llprofiler.h @@ -76,7 +76,16 @@ #if defined(LL_PROFILER_CONFIGURATION) && (LL_PROFILER_CONFIGURATION > LL_PROFILER_CONFIG_NONE) #if LL_PROFILER_CONFIGURATION == LL_PROFILER_CONFIG_TRACY || LL_PROFILER_CONFIGURATION == LL_PROFILER_CONFIG_TRACY_FAST_TIMER + #include "llpreprocessor.h" + +#if defined(LL_GNUC) && GCC_VERSION >= 130000 +# pragma GCC diagnostic push +# pragma GCC diagnostic ignored "-Wnonnull" +#endif #include "tracy/Tracy.hpp" +#if defined(LL_GNUC) && GCC_VERSION >= 130000 +# pragma GCC diagnostic push +#endif // Enable RenderDoc labeling //#define LL_PROFILER_ENABLE_RENDER_DOC 0 diff --git a/indra/llfilesystem/lldiriterator.cpp b/indra/llfilesystem/lldiriterator.cpp index e8c37389d2..b736a577bd 100644 --- a/indra/llfilesystem/lldiriterator.cpp +++ b/indra/llfilesystem/lldiriterator.cpp @@ -24,6 +24,8 @@ * $/LicenseInfo$ */ +#include "linden_common.h" + #include "lldiriterator.h" #include "fix_macros.h" diff --git a/indra/llplugin/llpluginclassmedia.cpp b/indra/llplugin/llpluginclassmedia.cpp index 77a4b08af5..68c8854a12 100644 --- a/indra/llplugin/llpluginclassmedia.cpp +++ b/indra/llplugin/llpluginclassmedia.cpp @@ -1015,6 +1015,15 @@ void LLPluginClassMedia::enableMediaPluginDebugging( bool enable ) sendMessage( message ); } +#if LL_LINUX +void LLPluginClassMedia::enablePipeWireVolumeCatcher( bool enable ) +{ + LLPluginMessage message(LLPLUGIN_MESSAGE_CLASS_MEDIA, "enable_pipewire_volume_catcher"); + message.setValueBoolean( "enable", enable ); + sendMessage( message ); +} +#endif + void LLPluginClassMedia::setTarget(const std::string &target) { mTarget = target; diff --git a/indra/llplugin/llpluginclassmedia.h b/indra/llplugin/llpluginclassmedia.h index 71522bcd7d..bfede4e9c1 100644 --- a/indra/llplugin/llpluginclassmedia.h +++ b/indra/llplugin/llpluginclassmedia.h @@ -134,6 +134,10 @@ public: // Text may be unicode (utf8 encoded) bool textInput(const std::string &text, MASK modifiers, LLSD native_key_data); +#if LL_LINUX + void enablePipeWireVolumeCatcher( bool enable ); +#endif + static std::string sOIDcookieUrl; static std::string sOIDcookieName; static std::string sOIDcookieValue; diff --git a/indra/media_plugins/cef/CMakeLists.txt b/indra/media_plugins/cef/CMakeLists.txt index dc2d82017d..3a91e398d5 100644 --- a/indra/media_plugins/cef/CMakeLists.txt +++ b/indra/media_plugins/cef/CMakeLists.txt @@ -10,7 +10,7 @@ include(Linking) include(PluginAPI) include(CEFPlugin) - +include(GLIB) ### media_plugin_cef @@ -23,20 +23,38 @@ set(media_plugin_cef_HEADER_FILES ) # Select which VolumeCatcher implementation to use -if (LINUX) - message(FATAL_ERROR "CEF plugin has been enabled for a Linux compile.\n" - " Please create a volume_catcher implementation for this platform.") -elseif (DARWIN) - list(APPEND media_plugin_cef_SOURCE_FILES mac_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 - ) +if (FALSE) # Disable linux volume catcher due to issues dlopening with CEF 139 + foreach( PULSE_FILE pulse/introspect.h pulse/context.h pulse/subscribe.h pulse/glib-mainloop.h ) + find_path( PULSE_FILE_${PULSE_FILE}_FOUND ${PULSE_FILE} NO_CACHE) + if( NOT PULSE_FILE_${PULSE_FILE}_FOUND ) + message( "Looking for ${PULSE_FILE} ... not found") + message( FATAL_ERROR "Pulse header not found" ) + else() + 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 + linux/volume_catcher_pulseaudio.cpp + linux/volume_catcher_pipewire.cpp + ) + + list(APPEND media_plugin_cef_SOURCE_FILES ${LINUX_VOLUME_CATCHER}) elseif (WINDOWS) list(APPEND media_plugin_cef_SOURCE_FILES windows_volume_catcher.cpp) -endif (LINUX) +else() + list(APPEND media_plugin_cef_SOURCE_FILES volume_catcher_null.cpp) +endif () list(APPEND media_plugin_cef_SOURCE_FILES ${media_plugin_cef_HEADER_FILES}) @@ -45,13 +63,10 @@ add_library(media_plugin_cef ${media_plugin_cef_SOURCE_FILES} ) -#add_dependencies(media_plugin_cef -# ${MEDIA_PLUGIN_BASE_LIBRARIES} -#) - target_link_libraries(media_plugin_cef media_plugin_base ll::cef + ll::glib_headers ) if (WINDOWS) @@ -60,9 +75,15 @@ if (WINDOWS) PROPERTIES LINK_FLAGS "/MANIFEST:NO /NODEFAULTLIB:LIBCMT /IGNORE:4099" ) -endif (WINDOWS) +elseif (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 + ) -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 @@ -73,4 +94,6 @@ if (DARWIN) LINK_FLAGS "-exported_symbols_list ${CMAKE_CURRENT_SOURCE_DIR}/../base/media_plugin_base.exp" ) -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/cef/linux/volume_catcher_linux.cpp b/indra/media_plugins/cef/linux/volume_catcher_linux.cpp new file mode 100644 index 0000000000..7d33242063 --- /dev/null +++ b/indra/media_plugins/cef/linux/volume_catcher_linux.cpp @@ -0,0 +1,78 @@ +/** + * @file volume_catcher.cpp + * @brief Linux volume catcher which will pick an implementation to use + * + * @cond + * $LicenseInfo:firstyear=2010&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 + */ + +#include "volume_catcher_linux.h" + +VolumeCatcher::VolumeCatcher() +{ +} + +void VolumeCatcher::onEnablePipeWireVolumeCatcher(bool enable) +{ + if (pimpl != nullptr) + return; + + if (enable) + { + LL_DEBUGS() << "volume catcher using pipewire" << LL_ENDL; + pimpl = new VolumeCatcherPipeWire(); + } + else + { + LL_DEBUGS() << "volume catcher using pulseaudio" << LL_ENDL; + pimpl = new VolumeCatcherPulseAudio(); + } +} + +VolumeCatcher::~VolumeCatcher() +{ + if (pimpl != nullptr) + { + delete pimpl; + pimpl = nullptr; + } +} + +void VolumeCatcher::setVolume(F32 volume) +{ + if (pimpl != nullptr) { + pimpl->setVolume(volume); + } +} + +void VolumeCatcher::setPan(F32 pan) +{ + if (pimpl != nullptr) + pimpl->setPan(pan); +} + +void VolumeCatcher::pump() +{ + if (pimpl != nullptr) + pimpl->pump(); +} diff --git a/indra/media_plugins/cef/linux/volume_catcher_linux.h b/indra/media_plugins/cef/linux/volume_catcher_linux.h new file mode 100644 index 0000000000..505f9ffb31 --- /dev/null +++ b/indra/media_plugins/cef/linux/volume_catcher_linux.h @@ -0,0 +1,149 @@ +/** + * @file volume_catcher_impl.h + * @brief + * + * @cond + * $LicenseInfo:firstyear=2010&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 + */ + +#ifndef VOLUME_CATCHER_LINUX_H +#define VOLUME_CATCHER_LINUX_H + +#include "linden_common.h" + +#include "../volume_catcher.h" + +#include +#include + +extern "C" { +// There's no special reason why we want the *glib* PA mainloop, but the generic polling implementation seems broken. +#include +#include + +#include + +#include "apr_pools.h" +#include "apr_dso.h" +} + +#include "media_plugin_base.h" + +class VolumeCatcherImpl +{ +public: + virtual ~VolumeCatcherImpl() = default; + + virtual void setVolume(F32 volume) = 0; // 0.0 - 1.0 + + // Set the left-right pan of audio sources + // where -1.0 = left, 0 = center, and 1.0 = right + virtual void setPan(F32 pan) = 0; + + virtual void pump() = 0; // call this at least a few times a second if you can - it affects how quickly we can 'catch' a new audio source and adjust its volume +}; + +class VolumeCatcherPulseAudio : public VolumeCatcherImpl +{ +public: + VolumeCatcherPulseAudio(); + ~VolumeCatcherPulseAudio(); + + void setVolume(F32 volume); + void setPan(F32 pan); + void pump(); + + // for internal use - can't be private because used from our C callbacks + + bool loadsyms(std::string pa_dso_name); + void init(); + void cleanup(); + + void update_all_volumes(F32 volume); + void update_index_volume(U32 index, F32 volume); + void connected_okay(); + + std::set mSinkInputIndices; + std::map mSinkInputNumChannels; + F32 mDesiredVolume; + pa_glib_mainloop *mMainloop; + pa_context *mPAContext; + bool mConnected; + bool mGotSyms; +}; + +class VolumeCatcherPipeWire : public VolumeCatcherImpl +{ +public: + VolumeCatcherPipeWire(); + ~VolumeCatcherPipeWire(); + + bool loadsyms(std::string pw_dso_name); + void init(); + void cleanup(); + + // some of these should be private + + void lock(); + void unlock(); + + void setVolume(F32 volume); + void setPan(F32 pan); + void pump(); + + void handleRegistryEventGlobal( + uint32_t id, uint32_t permissions, const char* type, + uint32_t version, const struct spa_dict* props + ); + + class ChildNode + { + public: + bool mActive = false; + + pw_proxy* mProxy = nullptr; + spa_hook mNodeListener {}; + spa_hook mProxyListener {}; + VolumeCatcherPipeWire* mImpl = nullptr; + + void updateVolume(); + void destroy(); + }; + + bool mGotSyms = false; + + F32 mVolume = 1.0f; // max by default + // F32 mPan = 0.0f; // center + + pw_thread_loop* mThreadLoop = nullptr; + pw_context* mContext = nullptr; + pw_core* mCore = nullptr; + pw_registry* mRegistry = nullptr; + spa_hook mRegistryListener; + + std::unordered_set mChildNodes; + std::mutex mChildNodesMutex; + std::mutex mCleanupMutex; +}; + +#endif // VOLUME_CATCHER_LINUX_H diff --git a/indra/media_plugins/cef/linux/volume_catcher_pipewire.cpp b/indra/media_plugins/cef/linux/volume_catcher_pipewire.cpp new file mode 100755 index 0000000000..73ef7fc18c --- /dev/null +++ b/indra/media_plugins/cef/linux/volume_catcher_pipewire.cpp @@ -0,0 +1,333 @@ +/** + * @file volume_catcher_pipewire.cpp + * @brief A Linux-specific, PipeWire-specific hack to detect and volume-adjust new audio sources + * + * @cond + * $LicenseInfo:firstyear=2010&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 + */ + +/* + The high-level design is as follows: + 1) Connect to the PipeWire daemon + 2) Find all existing and new audio nodes + 3) Examine PID and parent PID's to see if it belongs to our process + 4) If so, tell PipeWire to adjust the volume of that node + 5) Keep a list of all audio nodes and adjust when we setVolume() + */ + +#include "linden_common.h" + +#include "volume_catcher_linux.h" + +extern "C" { +#include +#include +} + +SymbolGrabber pwSymbolGrabber; + +#include "volume_catcher_pipewire_syms.inc" + +//////////////////////////////////////////////////// + +VolumeCatcherPipeWire::VolumeCatcherPipeWire() +{ + init(); +} + +VolumeCatcherPipeWire::~VolumeCatcherPipeWire() +{ + cleanup(); +} + +static void registryEventGlobal( + void *data, uint32_t id, uint32_t permissions, const char *type, + uint32_t version, const struct spa_dict *props) +{ + static_cast(data)->handleRegistryEventGlobal( + id, permissions, type, version, props + ); +} + +static const struct pw_registry_events REGISTRY_EVENTS = { + .version = PW_VERSION_REGISTRY_EVENTS, + .global = registryEventGlobal, +}; + +bool VolumeCatcherPipeWire::loadsyms(std::string pw_dso_name) +{ + return pwSymbolGrabber.grabSymbols({ pw_dso_name }); +} + +void VolumeCatcherPipeWire::init() +{ + LL_DEBUGS() << "init" << LL_ENDL; + + mGotSyms = loadsyms("libpipewire-0.3.so.0"); + + if (!mGotSyms) + return; + + LL_DEBUGS() << "successfully got symbols" << LL_ENDL; + + llpw_init(nullptr, nullptr); + + mThreadLoop = llpw_thread_loop_new("SL Plugin Volume Adjuster", nullptr); + + if (!mThreadLoop) + return; + + // i dont think we need to lock this early + // std::lock_guard pwLock(*this); + + mContext = llpw_context_new( + llpw_thread_loop_get_loop(mThreadLoop), nullptr, 0 + ); + + if (!mContext) + return; + + mCore = llpw_context_connect(mContext, nullptr, 0); + + if (!mCore) + return; + + mRegistry = pw_core_get_registry(mCore, PW_VERSION_REGISTRY, 0); + + LL_DEBUGS() << "pw_core_get_registry: " << (mRegistry?"success":"nullptr") << LL_ENDL; + + spa_zero(mRegistryListener); + + pw_registry_add_listener( + mRegistry, &mRegistryListener, ®ISTRY_EVENTS, this + ); + + llpw_thread_loop_start(mThreadLoop); + + LL_DEBUGS() << "thread loop started" << LL_ENDL; +} + +void VolumeCatcherPipeWire::cleanup() +{ + { + std::unique_lock childNodesLock(mChildNodesMutex); + for (auto *childNode: mChildNodes) + childNode->destroy(); + + mChildNodes.clear(); + } + + { + std::unique_lock pwLock(mCleanupMutex); + if (mRegistry) + llpw_proxy_destroy((struct pw_proxy *) mRegistry); + + spa_zero(mRegistryListener); + + if (mCore) + llpw_core_disconnect(mCore); + if (mContext) + llpw_context_destroy(mContext); + } + + if (!mThreadLoop) + return; + + llpw_thread_loop_stop(mThreadLoop); + llpw_thread_loop_destroy(mThreadLoop); + + LL_DEBUGS() << "cleanup done" << LL_ENDL; +} + +void VolumeCatcherPipeWire::lock() +{ + if (!mThreadLoop) + return; + + llpw_thread_loop_lock(mThreadLoop); +} + +void VolumeCatcherPipeWire::unlock() +{ + if (!mThreadLoop) + return; + + llpw_thread_loop_unlock(mThreadLoop); +} + +const uint32_t channels = 1; +const float resetVolumes[channels] = { 1.0f }; + +void VolumeCatcherPipeWire::ChildNode::updateVolume() +{ + if (!mActive) + return; + + F32 volume = std::clamp(mImpl->mVolume, 0.0f, 1.0f); + + const float volumes[channels] = { volume }; + + uint8_t buffer[512]; + + spa_pod_builder builder; + spa_pod_builder_init(&builder, buffer, sizeof(buffer)); + + spa_pod_frame frame; + spa_pod_builder_push_object(&builder, &frame, SPA_TYPE_OBJECT_Props, SPA_PARAM_Props); + + // resets system-wide memorized volume for chromium (not google chrome) to 100% + spa_pod_builder_prop(&builder, SPA_PROP_channelVolumes, 0); + spa_pod_builder_array(&builder, sizeof(float), SPA_TYPE_Float, channels, resetVolumes); + + // sets temporary volume + spa_pod_builder_prop(&builder, SPA_PROP_softVolumes, 0); + spa_pod_builder_array(&builder, sizeof(float), SPA_TYPE_Float, channels, volumes); + + spa_pod* pod = static_cast(spa_pod_builder_pop(&builder, &frame)); + + { + std::lock_guard pwLock(*mImpl); + pw_node_set_param((pw_node*)mProxy, SPA_PARAM_Props, 0, pod); + } +} + +void VolumeCatcherPipeWire::ChildNode::destroy() +{ + if (!mActive) + return; + + mActive = false; + + { + std::unique_lock childNodesLock(mImpl->mChildNodesMutex); + mImpl->mChildNodes.erase(this); + } + + spa_hook_remove(&mNodeListener); + spa_hook_remove(&mProxyListener); + + { + std::lock_guard pwLock(*mImpl); + llpw_proxy_destroy(mProxy); + } +} + +static void nodeEventInfo(void* data, const struct pw_node_info* info) +{ + const char* processId = spa_dict_lookup(info->props, PW_KEY_APP_PROCESS_ID); + + if (processId == nullptr) + return; + + pid_t pid = atoll(processId); + + if (!isPluginPid(pid)) + return; + + const char* appName = spa_dict_lookup(info->props, PW_KEY_APP_NAME); + LL_DEBUGS() << "got app: " << appName << LL_ENDL; + + auto* const childNode = static_cast(data); + LL_DEBUGS() << "init volume: " << childNode->mImpl->mVolume << LL_ENDL; + + childNode->updateVolume(); + + { + std::lock_guard childNodesLock(childNode->mImpl->mChildNodesMutex); + childNode->mImpl->mChildNodes.insert(childNode); + } +} + +static const struct pw_node_events NODE_EVENTS = { + .version = PW_VERSION_CLIENT_EVENTS, + .info = nodeEventInfo, +}; + +static void proxyEventDestroy(void* data) +{ + auto* const childNode = static_cast(data); + childNode->destroy(); +} + +static void proxyEventRemoved(void* data) +{ + auto* const childNode = static_cast(data); + childNode->destroy(); +} + +static const struct pw_proxy_events PROXY_EVENTS = { + .version = PW_VERSION_PROXY_EVENTS, + .destroy = proxyEventDestroy, + .removed = proxyEventRemoved, +}; + +void VolumeCatcherPipeWire::handleRegistryEventGlobal( + uint32_t id, uint32_t permissions, const char *type, uint32_t version, + const struct spa_dict *props) +{ + if (props == nullptr || type == nullptr || strcmp(type, PW_TYPE_INTERFACE_Node) != 0) + return; + + const char* mediaClass = spa_dict_lookup(props, PW_KEY_MEDIA_CLASS); + + if (mediaClass == nullptr || strcmp(mediaClass, "Stream/Output/Audio") != 0) + return; + + pw_proxy* proxy = static_cast( + pw_registry_bind(mRegistry, id, type, PW_VERSION_CLIENT, sizeof(ChildNode)) + ); + + auto* const childNode = static_cast(llpw_proxy_get_user_data(proxy)); + + childNode->mActive = true; + childNode->mProxy = proxy; + childNode->mImpl = this; + + pw_node_add_listener((pw_node*)proxy, &childNode->mNodeListener, &NODE_EVENTS, childNode); + llpw_proxy_add_listener(proxy, &childNode->mProxyListener, &PROXY_EVENTS, childNode); +} + +void VolumeCatcherPipeWire::setVolume(F32 volume) +{ + LL_DEBUGS() << "setting volume to: " << volume << LL_ENDL; + + mVolume = volume; + + { + std::unique_lock childNodeslock(mChildNodesMutex); + std::unordered_set copyOfChildNodes(mChildNodes); + + LL_DEBUGS() << "found " << copyOfChildNodes.size() << " child nodes" << LL_ENDL; + + for (auto* childNode : copyOfChildNodes) + childNode->updateVolume(); + } +} + +void VolumeCatcherPipeWire::setPan(F32 pan) +{ +} + +void VolumeCatcherPipeWire::pump() +{ +} diff --git a/indra/media_plugins/cef/linux/volume_catcher_pipewire_syms.inc b/indra/media_plugins/cef/linux/volume_catcher_pipewire_syms.inc new file mode 100644 index 0000000000..dbc0f5f169 --- /dev/null +++ b/indra/media_plugins/cef/linux/volume_catcher_pipewire_syms.inc @@ -0,0 +1,26 @@ +#define G pwSymbolGrabber + +// required symbols to grab +LL_GRAB_SYM(G, true, pw_init, void, int *argc, char **argv[]); +// LL_GRAB_SYM(G, true, pw_main_loop_new, struct pw_main_loop *, const struct spa_dict *props); +// LL_GRAB_SYM(G, true, pw_main_loop_get_loop, struct pw_loop *, struct pw_main_loop *loop); +// LL_GRAB_SYM(G, true, pw_main_loop_destroy, void, struct pw_main_loop *loop); +// LL_GRAB_SYM(G, true, pw_main_loop_run, void, struct pw_main_loop *loop); +LL_GRAB_SYM(G, true, pw_context_new, struct pw_context *, struct pw_loop *main_loop, struct pw_properties *props, size_t user_data_size); +LL_GRAB_SYM(G, true, pw_context_destroy, void, struct pw_context *context); +LL_GRAB_SYM(G, true, pw_context_connect, struct pw_core *, struct pw_context *context, struct pw_properties *properties, size_t user_data_size); +LL_GRAB_SYM(G, true, pw_thread_loop_new, struct pw_thread_loop *, const char *name, const struct spa_dict *props); +LL_GRAB_SYM(G, true, pw_thread_loop_destroy, void, struct pw_thread_loop *loop); +LL_GRAB_SYM(G, true, pw_thread_loop_get_loop, struct pw_loop *, struct pw_thread_loop *loop); +LL_GRAB_SYM(G, true, pw_thread_loop_start, int, struct pw_thread_loop *loop); +LL_GRAB_SYM(G, true, pw_thread_loop_stop, void, struct pw_thread_loop *loop); +LL_GRAB_SYM(G, true, pw_thread_loop_lock, void, struct pw_thread_loop *loop); +LL_GRAB_SYM(G, true, pw_thread_loop_unlock, void, struct pw_thread_loop *loop); +LL_GRAB_SYM(G, true, pw_proxy_add_listener, void, struct pw_proxy *proxy, struct spa_hook *listener, const struct pw_proxy_events *events, void *data); +LL_GRAB_SYM(G, true, pw_proxy_destroy, void, struct pw_proxy *proxy); +LL_GRAB_SYM(G, true, pw_proxy_get_user_data, void *, struct pw_proxy *proxy); +LL_GRAB_SYM(G, true, pw_core_disconnect, int, struct pw_core *core); + +// optional symbols to grab + +#undef G diff --git a/indra/media_plugins/cef/linux/volume_catcher_pulseaudio.cpp b/indra/media_plugins/cef/linux/volume_catcher_pulseaudio.cpp new file mode 100755 index 0000000000..f8a48a91fd --- /dev/null +++ b/indra/media_plugins/cef/linux/volume_catcher_pulseaudio.cpp @@ -0,0 +1,322 @@ +/** + * @file volume_catcher_pulseaudio.cpp + * @brief A Linux-specific, PulseAudio-specific hack to detect and volume-adjust new audio sources + * + * @cond + * $LicenseInfo:firstyear=2010&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 + */ + +/* + The high-level design is as follows: + 1) Connect to the PulseAudio daemon + 2) Watch for the creation of new audio players connecting to the daemon (this includes ALSA clients running on the PulseAudio emulation layer, such as Flash plugins) + 3) Examine any new audio player's PID to see if it belongs to our own process + 4) If so, tell PA to adjust the volume of that audio player ('sink input' in PA parlance) + 5) Keep a list of all living audio players that we care about, adjust the volumes of all of them when we get a new setVolume() call + */ + +#include "linden_common.h" + +#include "volume_catcher_linux.h" + +extern "C" { +#include +#include + +#include + +#include +} + +SymbolGrabber paSymbolGrabber; + +#include "volume_catcher_pulseaudio_syms.inc" +#include "volume_catcher_pulseaudio_glib_syms.inc" + +//////////////////////////////////////////////////// + +// PulseAudio requires a chain of callbacks with C linkage +extern "C" { + void callback_discovered_sinkinput(pa_context *context, const pa_sink_input_info *i, int eol, void *userdata); + void callback_subscription_alert(pa_context *context, pa_subscription_event_type_t t, uint32_t index, void *userdata); + void callback_context_state(pa_context *context, void *userdata); +} + +VolumeCatcherPulseAudio::VolumeCatcherPulseAudio() + : mDesiredVolume(0.0f), + mMainloop(nullptr), + mPAContext(nullptr), + mConnected(false), + mGotSyms(false) +{ + init(); +} + +VolumeCatcherPulseAudio::~VolumeCatcherPulseAudio() +{ + cleanup(); +} + +bool VolumeCatcherPulseAudio::loadsyms(std::string pulse_dso_name) +{ + return paSymbolGrabber.grabSymbols({ pulse_dso_name }); +} + +void VolumeCatcherPulseAudio::init() +{ + // try to be as defensive as possible because PA's interface is a + // bit fragile and (for our purposes) we'd rather simply not function + // than crash + + // we cheat and rely upon libpulse-mainloop-glib.so.0 to pull-in + // libpulse.so.0 - this isn't a great assumption, and the two DSOs should + // probably be loaded separately. Our Linux DSO framework needs refactoring, + // we do this sort of thing a lot with practically identical logic... + mGotSyms = loadsyms("libpulse-mainloop-glib.so.0"); + + if (!mGotSyms) + mGotSyms = loadsyms("libpulse.so.0"); + + if (!mGotSyms) + return; + + mMainloop = llpa_glib_mainloop_new(g_main_context_default()); + + if (mMainloop) + { + pa_mainloop_api *api = llpa_glib_mainloop_get_api(mMainloop); + + if (api) + { + pa_proplist *proplist = llpa_proplist_new(); + + if (proplist) + { + llpa_proplist_sets(proplist, PA_PROP_APPLICATION_ICON_NAME, "multimedia-player"); + llpa_proplist_sets(proplist, PA_PROP_APPLICATION_ID, "com.secondlife.viewer.mediaplugvoladjust"); + llpa_proplist_sets(proplist, PA_PROP_APPLICATION_NAME, "SL Plugin Volume Adjuster"); + llpa_proplist_sets(proplist, PA_PROP_APPLICATION_VERSION, "1"); + + // plain old pa_context_new() is broken! + mPAContext = llpa_context_new_with_proplist(api, nullptr, proplist); + + llpa_proplist_free(proplist); + } + } + } + + // Now we've set up a PA context and mainloop, try connecting the + // PA context to a PA daemon. + if (mPAContext) + { + llpa_context_set_state_callback(mPAContext, callback_context_state, this); + pa_context_flags_t cflags = (pa_context_flags)0; // maybe add PA_CONTEXT_NOAUTOSPAWN? + if (llpa_context_connect(mPAContext, nullptr, cflags, nullptr) >= 0) + { + // Okay! We haven't definitely connected, but we + // haven't definitely failed yet. + } + else + { + // Failed to connect to PA manager... we'll leave + // things like that. Perhaps we should try again later. + } + } +} + +void VolumeCatcherPulseAudio::cleanup() +{ + mConnected = false; + + if (mGotSyms && mPAContext) + { + llpa_context_disconnect(mPAContext); + llpa_context_unref(mPAContext); + } + + mPAContext = nullptr; + + if (mGotSyms && mMainloop) + llpa_glib_mainloop_free(mMainloop); + + mMainloop = nullptr; +} + +void VolumeCatcherPulseAudio::setVolume(F32 volume) +{ + mDesiredVolume = volume; + + if (!mGotSyms) + return; + + if (mConnected && mPAContext) + { + update_all_volumes(mDesiredVolume); + } + + pump(); +} + +void VolumeCatcherPulseAudio::setPan(F32 pan) +{ +} + +void VolumeCatcherPulseAudio::pump() +{ + gboolean may_block = FALSE; + g_main_context_iteration(g_main_context_default(), may_block); +} + +void VolumeCatcherPulseAudio::connected_okay() +{ + pa_operation *op; + + // fetch global list of existing sinkinputs + if ((op = llpa_context_get_sink_input_info_list(mPAContext, + callback_discovered_sinkinput, + this))) + { + llpa_operation_unref(op); + } + + // subscribe to future global sinkinput changes + llpa_context_set_subscribe_callback(mPAContext, + callback_subscription_alert, + this); + if ((op = llpa_context_subscribe(mPAContext, (pa_subscription_mask_t) + (PA_SUBSCRIPTION_MASK_SINK_INPUT), + nullptr, nullptr))) + { + llpa_operation_unref(op); + } +} + +void VolumeCatcherPulseAudio::update_all_volumes(F32 volume) +{ + for (std::set::iterator it = mSinkInputIndices.begin(); + it != mSinkInputIndices.end(); ++it) + { + update_index_volume(*it, volume); + } +} + +void VolumeCatcherPulseAudio::update_index_volume(U32 index, F32 volume) +{ + static pa_cvolume cvol; + llpa_cvolume_set(&cvol, mSinkInputNumChannels[index], + llpa_sw_volume_from_linear(volume)); + + pa_context *c = mPAContext; + uint32_t idx = index; + const pa_cvolume *cvolumep = &cvol; + pa_context_success_cb_t cb = nullptr; // okay as null + void *userdata = nullptr; // okay as null + + pa_operation *op; + if ((op = llpa_context_set_sink_input_volume(c, idx, cvolumep, cb, userdata))) + llpa_operation_unref(op); +} + +void callback_discovered_sinkinput(pa_context *context, const pa_sink_input_info *sii, int eol, void *userdata) +{ + VolumeCatcherPulseAudio *impl = dynamic_cast((VolumeCatcherPulseAudio*)userdata); + llassert(impl); + + if (0 == eol) + { + pa_proplist *proplist = sii->proplist; + pid_t sinkpid = atoll(llpa_proplist_gets(proplist, PA_PROP_APPLICATION_PROCESS_ID)); + + if (isPluginPid( sinkpid )) // does the discovered sinkinput belong to this process? + { + bool is_new = (impl->mSinkInputIndices.find(sii->index) == impl->mSinkInputIndices.end()); + + impl->mSinkInputIndices.insert(sii->index); + impl->mSinkInputNumChannels[sii->index] = sii->channel_map.channels; + + if (is_new) + { + // new! + impl->update_index_volume(sii->index, impl->mDesiredVolume); + } + else + { + // seen it already, do nothing. + } + } + } +} + +void callback_subscription_alert(pa_context *context, pa_subscription_event_type_t t, uint32_t index, void *userdata) +{ + VolumeCatcherPulseAudio *impl = dynamic_cast((VolumeCatcherPulseAudio*)userdata); + llassert(impl); + + switch (t & PA_SUBSCRIPTION_EVENT_FACILITY_MASK) + { + case PA_SUBSCRIPTION_EVENT_SINK_INPUT: + if ((t & PA_SUBSCRIPTION_EVENT_TYPE_MASK) == PA_SUBSCRIPTION_EVENT_REMOVE) + { + // forget this sinkinput, if we were caring about it + impl->mSinkInputIndices.erase(index); + impl->mSinkInputNumChannels.erase(index); + } + else if ((t & PA_SUBSCRIPTION_EVENT_TYPE_MASK) == PA_SUBSCRIPTION_EVENT_NEW) + { + // ask for more info about this new sinkinput + pa_operation *op; + if ((op = llpa_context_get_sink_input_info(impl->mPAContext, index, callback_discovered_sinkinput, impl))) + { + llpa_operation_unref(op); + } + } + else + { + // property change on this sinkinput - we don't care. + } + break; + + default:; + } +} + +void callback_context_state(pa_context *context, void *userdata) +{ + VolumeCatcherPulseAudio *impl = dynamic_cast((VolumeCatcherPulseAudio*)userdata); + llassert(impl); + + switch (llpa_context_get_state(context)) + { + case PA_CONTEXT_READY: + impl->mConnected = true; + impl->connected_okay(); + break; + case PA_CONTEXT_TERMINATED: + impl->mConnected = false; + break; + case PA_CONTEXT_FAILED: + impl->mConnected = false; + break; + default:; + } +} diff --git a/indra/media_plugins/cef/linux/volume_catcher_pulseaudio_glib_syms.inc b/indra/media_plugins/cef/linux/volume_catcher_pulseaudio_glib_syms.inc new file mode 100755 index 0000000000..e9b7196e51 --- /dev/null +++ b/indra/media_plugins/cef/linux/volume_catcher_pulseaudio_glib_syms.inc @@ -0,0 +1,10 @@ +#define G paSymbolGrabber + +// required symbols to grab +LL_GRAB_SYM(G, true, pa_glib_mainloop_free, void, pa_glib_mainloop* g) +LL_GRAB_SYM(G, true, pa_glib_mainloop_get_api, pa_mainloop_api*, pa_glib_mainloop* g) +LL_GRAB_SYM(G, true, pa_glib_mainloop_new, pa_glib_mainloop *, GMainContext *c) + +// optional symbols to grab + +#undef G diff --git a/indra/media_plugins/cef/linux/volume_catcher_pulseaudio_syms.inc b/indra/media_plugins/cef/linux/volume_catcher_pulseaudio_syms.inc new file mode 100755 index 0000000000..4859a34405 --- /dev/null +++ b/indra/media_plugins/cef/linux/volume_catcher_pulseaudio_syms.inc @@ -0,0 +1,29 @@ +#define G paSymbolGrabber + +// required symbols to grab +LL_GRAB_SYM(G, true, pa_context_connect, int, pa_context *c, const char *server, pa_context_flags_t flags, const pa_spawn_api *api) +LL_GRAB_SYM(G, true, pa_context_disconnect, void, pa_context *c) +LL_GRAB_SYM(G, true, pa_context_get_sink_input_info, pa_operation*, pa_context *c, uint32_t idx, pa_sink_input_info_cb_t cb, void *userdata) +LL_GRAB_SYM(G, true, pa_context_get_sink_input_info_list, pa_operation*, pa_context *c, pa_sink_input_info_cb_t cb, void *userdata) +LL_GRAB_SYM(G, true, pa_context_get_state, pa_context_state_t, pa_context *c) +LL_GRAB_SYM(G, true, pa_context_new_with_proplist, pa_context*, pa_mainloop_api *mainloop, const char *name, pa_proplist *proplist) +LL_GRAB_SYM(G, true, pa_context_set_sink_input_volume, pa_operation*, pa_context *c, uint32_t idx, const pa_cvolume *volume, pa_context_success_cb_t cb, void *userdata) +LL_GRAB_SYM(G, true, pa_context_set_state_callback, void, pa_context *c, pa_context_notify_cb_t cb, void *userdata) +LL_GRAB_SYM(G, true, pa_context_set_subscribe_callback, void, pa_context *c, pa_context_subscribe_cb_t cb, void *userdata) +LL_GRAB_SYM(G, true, pa_context_subscribe, pa_operation*, pa_context *c, pa_subscription_mask_t m, pa_context_success_cb_t cb, void *userdata) +LL_GRAB_SYM(G, true, pa_context_unref, void, pa_context *c) +LL_GRAB_SYM(G, true, pa_cvolume_set, pa_cvolume*, pa_cvolume *a, unsigned channels, pa_volume_t v) +LL_GRAB_SYM(G, true, pa_operation_unref, void, pa_operation *o) +LL_GRAB_SYM(G, true, pa_proplist_free, void, pa_proplist* p) +LL_GRAB_SYM(G, true, pa_proplist_gets, const char*, pa_proplist *p, const char *key) +LL_GRAB_SYM(G, true, pa_proplist_new, pa_proplist*, void) +LL_GRAB_SYM(G, true, pa_proplist_sets, int, pa_proplist *p, const char *key, const char *value) +LL_GRAB_SYM(G, true, pa_sw_volume_from_linear, pa_volume_t, double v) +// LL_GRAB_SYM(G, true, pa_mainloop_free, void, pa_mainloop *m) +// LL_GRAB_SYM(G, true, pa_mainloop_get_api, pa_mainloop_api *, pa_mainloop *m) +// LL_GRAB_SYM(G, true, pa_mainloop_iterate, int, pa_mainloop *m, int block, int *retval) +// LL_GRAB_SYM(G, true, pa_mainloop_new, pa_mainloop *, void) + +// optional symbols to grab + +#undef G diff --git a/indra/media_plugins/cef/mac_volume_catcher_null.cpp b/indra/media_plugins/cef/mac_volume_catcher_null.cpp deleted file mode 100644 index c479e24a95..0000000000 --- a/indra/media_plugins/cef/mac_volume_catcher_null.cpp +++ /dev/null @@ -1,95 +0,0 @@ -/** - * @file windows_volume_catcher.cpp - * @brief A null implementation of volume level control of all audio channels opened by a process. - * We are using this for the macOS version for now until we can understand how to make the - * exitising mac_volume_catcher.cpp work without the (now, non-existant) QuickTime dependency - * - * @cond - * $LicenseInfo:firstyear=2010&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 - */ - -#include "volume_catcher.h" -#include "llsingleton.h" -class VolumeCatcherImpl : public LLSingleton -{ - LLSINGLETON(VolumeCatcherImpl); - // This is a singleton class -- both callers and the component implementation should use getInstance() to find the instance. - ~VolumeCatcherImpl(); - -public: - - void setVolume(F32 volume); - void setPan(F32 pan); - -private: - F32 mVolume; - F32 mPan; - bool mSystemIsVistaOrHigher; -}; - -VolumeCatcherImpl::VolumeCatcherImpl() -: mVolume(1.0f), // default volume is max - mPan(0.f) // default pan is centered -{ -} - -VolumeCatcherImpl::~VolumeCatcherImpl() -{ -} - -void VolumeCatcherImpl::setVolume(F32 volume) -{ - mVolume = volume; -} - -void VolumeCatcherImpl::setPan(F32 pan) -{ // remember pan for calculating individual channel levels later - mPan = pan; -} - -///////////////////////////////////////////////////// - -VolumeCatcher::VolumeCatcher() -{ - pimpl = VolumeCatcherImpl::getInstance(); -} - -VolumeCatcher::~VolumeCatcher() -{ - // Let the instance persist until exit. -} - -void VolumeCatcher::setVolume(F32 volume) -{ - pimpl->setVolume(volume); -} - -void VolumeCatcher::setPan(F32 pan) -{ - pimpl->setPan(pan); -} - -void VolumeCatcher::pump() -{ - // No periodic tasks are necessary for this implementation. -} diff --git a/indra/media_plugins/cef/media_plugin_cef.cpp b/indra/media_plugins/cef/media_plugin_cef.cpp index caf804f915..5693420bb6 100644 --- a/indra/media_plugins/cef/media_plugin_cef.cpp +++ b/indra/media_plugins/cef/media_plugin_cef.cpp @@ -911,7 +911,7 @@ void MediaPluginCEF::receiveMessage(const char* message_string) keyEvent(key_event, native_key_data); -#elif LL_WINDOWS +#else std::string event = message_in.getValue("event"); LLSD native_key_data = message_in.getValueLLSD("native_key_data"); @@ -933,6 +933,13 @@ void MediaPluginCEF::receiveMessage(const char* message_string) { mEnableMediaPluginDebugging = message_in.getValueBoolean("enable"); } +#if LL_LINUX + else if (message_name == "enable_pipewire_volume_catcher") + { + bool enable = message_in.getValueBoolean("enable"); + mVolumeCatcher.onEnablePipeWireVolumeCatcher(enable); + } +#endif if (message_name == "pick_file_response") { LLSD file_list_llsd = message_in.getValueLLSD("file_list"); @@ -1095,6 +1102,28 @@ void MediaPluginCEF::keyEvent(dullahan::EKeyEvent key_event, LLSD native_key_dat mCEFLib->nativeKeyboardEventWin(msg, wparam, lparam); #endif + +#if LL_LINUX + + uint32_t native_virtual_key = (uint32_t)(native_key_data["virtual_key"].asInteger()); // this is actually the SDL event.key.keysym.sym; + uint32_t native_virtual_key_win = (uint32_t)(native_key_data["virtual_key_win"].asInteger()); + uint32_t native_modifiers = (uint32_t)(native_key_data["modifiers"].asInteger()); + + // only for non-printable keysyms, the actual text input is done in unicodeInput() below + if (native_virtual_key <= 0x1b || native_virtual_key >= 0x7f) + { + // set keypad flag, not sure if this even does anything + bool keypad = false; + if (native_virtual_key_win >= 0x60 && native_virtual_key_win <= 0x6f) + { + keypad = true; + } + + // yes, we send native_virtual_key_win twice because native_virtual_key breaks it + mCEFLib->nativeKeyboardEventSDL2(key_event, native_virtual_key, native_modifiers, keypad); + } + +#endif // LL_LINUX }; void MediaPluginCEF::unicodeInput(std::string event, LLSD native_key_data = LLSD::emptyMap()) @@ -1125,6 +1154,16 @@ void MediaPluginCEF::unicodeInput(std::string event, LLSD native_key_data = LLSD U64 lparam = ll_U32_from_sd(native_key_data["l_param"]); mCEFLib->nativeKeyboardEventWin(msg, wparam, lparam); #endif + +#if LL_LINUX + + uint32_t native_scan_code = (uint32_t)(native_key_data["sdl_sym"].asInteger()); + uint32_t native_virtual_key = (uint32_t)(native_key_data["virtual_key"].asInteger()); + uint32_t native_modifiers = (uint32_t)(native_key_data["modifiers"].asInteger()); + + mCEFLib->nativeKeyboardEvent(dullahan::KE_KEY_DOWN, native_scan_code, native_virtual_key, native_modifiers); + +#endif // LL_LINUX }; //////////////////////////////////////////////////////////////////////////////// diff --git a/indra/media_plugins/cef/volume_catcher.h b/indra/media_plugins/cef/volume_catcher.h index ea97a24947..806f2a008a 100644 --- a/indra/media_plugins/cef/volume_catcher.h +++ b/indra/media_plugins/cef/volume_catcher.h @@ -35,7 +35,7 @@ class VolumeCatcherImpl; class VolumeCatcher { - public: +public: VolumeCatcher(); ~VolumeCatcher(); @@ -47,8 +47,14 @@ class VolumeCatcher void pump(); // call this at least a few times a second if you can - it affects how quickly we can 'catch' a new audio source and adjust its volume - private: +#if LL_LINUX + void onEnablePipeWireVolumeCatcher(bool enable); +#endif + +private: +#if LL_LINUX || LL_WINDOWS VolumeCatcherImpl *pimpl; +#endif }; #endif // VOLUME_CATCHER_H diff --git a/indra/media_plugins/cef/volume_catcher_null.cpp b/indra/media_plugins/cef/volume_catcher_null.cpp new file mode 100644 index 0000000000..cd5eccca38 --- /dev/null +++ b/indra/media_plugins/cef/volume_catcher_null.cpp @@ -0,0 +1,59 @@ +/** + * @file volume_catcher_null.cpp + * @brief A null implementation of volume level control of all audio channels opened by a process. + * We are using this for the macOS version for now until we can understand how to make the + * exitising mac_volume_catcher.cpp work without the (now, non-existant) QuickTime dependency + * + * @cond + * $LicenseInfo:firstyear=2010&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 + */ + +#include "volume_catcher.h" + +///////////////////////////////////////////////////// + +VolumeCatcher::VolumeCatcher() +{ +} + +VolumeCatcher::~VolumeCatcher() +{ +} + +void VolumeCatcher::setVolume(F32 volume) +{ +} + +void VolumeCatcher::setPan(F32 pan) +{ +} + +void VolumeCatcher::pump() +{ +} + +#if LL_LINUX +void VolumeCatcher::onEnablePipeWireVolumeCatcher(bool enable) +{ +} +#endif diff --git a/indra/media_plugins/cef/windows_volume_catcher.cpp b/indra/media_plugins/cef/windows_volume_catcher.cpp index e7daeb5f74..1e52fee9de 100644 --- a/indra/media_plugins/cef/windows_volume_catcher.cpp +++ b/indra/media_plugins/cef/windows_volume_catcher.cpp @@ -44,7 +44,6 @@ public: private: F32 mVolume; F32 mPan; - bool mSystemIsVistaOrHigher; }; VolumeCatcherImpl::VolumeCatcherImpl() diff --git a/indra/newview/app_settings/settings.xml b/indra/newview/app_settings/settings.xml index d6a1fbd124..a7a52182c1 100644 --- a/indra/newview/app_settings/settings.xml +++ b/indra/newview/app_settings/settings.xml @@ -5053,6 +5053,17 @@ Value 0 + MediaPluginPipeWireVolumeCatcher + + Comment + Use PipeWire instead of PulseAudio for controlling web media volume. + Persist + 1 + Type + Boolean + Value + 1 + MediaControlFadeTime Comment diff --git a/indra/newview/llviewermedia.cpp b/indra/newview/llviewermedia.cpp index 89861d74bc..bb3ea74589 100644 --- a/indra/newview/llviewermedia.cpp +++ b/indra/newview/llviewermedia.cpp @@ -1749,9 +1749,7 @@ LLPluginClassMedia* LLViewerMediaImpl::newSourceFromMediaType(std::string media_ } else if(LLFile::stat(plugin_name, &s)) { -#if !LL_LINUX LL_WARNS_ONCE("Media") << "Couldn't find plugin at " << plugin_name << LL_ENDL; -#endif } else { @@ -1783,6 +1781,11 @@ LLPluginClassMedia* LLViewerMediaImpl::newSourceFromMediaType(std::string media_ bool media_plugin_debugging_enabled = gSavedSettings.getBOOL("MediaPluginDebugging"); media_source->enableMediaPluginDebugging( media_plugin_debugging_enabled || clean_browser); +#if LL_LINUX + bool media_plugin_pipewire_volume_catcher = gSavedSettings.getBOOL("MediaPluginPipeWireVolumeCatcher"); + media_source->enablePipeWireVolumeCatcher( media_plugin_pipewire_volume_catcher ); +#endif + // need to set agent string here before instance created media_source->setBrowserUserAgent(LLViewerMedia::getInstance()->getCurrentUserAgent()); @@ -1804,9 +1807,7 @@ LLPluginClassMedia* LLViewerMediaImpl::newSourceFromMediaType(std::string media_ } } } -#if !LL_LINUX LL_WARNS_ONCE("Plugin") << "plugin initialization failed for mime type: " << media_type << LL_ENDL; -#endif if(gAgent.isInitialized()) { diff --git a/indra/newview/skins/default/xui/en/mime_types_linux.xml b/indra/newview/skins/default/xui/en/mime_types_linux.xml index d0ecd0a11c..28e63c82f1 100644 --- a/indra/newview/skins/default/xui/en/mime_types_linux.xml +++ b/indra/newview/skins/default/xui/en/mime_types_linux.xml @@ -7,7 +7,7 @@ none - media_plugin_webkit + media_plugin_cef - 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 @@ -595,36 +565,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 platforms @@ -791,62 +731,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 - - gtk-atk-pango-glib - - platforms - - linux64 - - archive - - hash - de7bba8fd2275a11b077b124413065d0 - url - http://automated-builds-secondlife-com.s3.amazonaws.com/hg/repo/p64_3p-gtk-atk-pango-glib/rev/314220/arch/Linux/installer/gtk_atk_pango_glib-0.1-linux64-314220.tar.bz2 - - name - linux64 - - - license - lgpl - license_file - LICENSES/gtk-atk-pango-glib.txt - copyright - Copyright (various, see sources) - version - 0.1 - name - gtk-atk-pango-glib - havok-source platforms @@ -858,11 +742,11 @@ creds github hash - ae2c2a215b1bc2e3f37a67e301926dc405902d1a + 1648aeb68395cba38f9326c671609d6730cbcc28 hash_algorithm sha1 url - https://api.github.com/repos/secondlife/3p-havok-source/releases/assets/136778143 + https://api.github.com/repos/secondlife/3p-havok-source/releases/assets/196725921 name darwin64 @@ -871,10 +755,14 @@ archive + creds + github hash - 00d0333936a67059a43a6ec8ac38d564 + 702ad28b6dbace2a68260d69f6d1768d163b5a6f + hash_algorithm + sha1 url - http://s3-proxy.lindenlab.com/private-builds-secondlife-com/ct2/748/1563/havok_source-2012.1-2-linux64-500739.tar.bz2 + https://api.github.com/repos/secondlife/3p-havok-source/releases/assets/196725902 name linux64 @@ -886,11 +774,11 @@ creds github hash - 0393dd75c58f7046bed47e62a8884a78cb02a5c3 + ea980f372981fe7685f91a111da2785825d473ed hash_algorithm sha1 url - https://api.github.com/repos/secondlife/3p-havok-source/releases/assets/136778145 + https://api.github.com/repos/secondlife/3p-havok-source/releases/assets/196725911 name windows64 @@ -1081,22 +969,6 @@ name windows64 - linux - - archive - - creds - github - hash - 85e294becce8b2ac5d2e5e052b0e21ff865d1108 - hash_algorithm - sha1 - url - https://api.github.com/repos/secondlife/3p-kdu/releases/assets/208381806 - - name - linux - license Kakadu @@ -1277,36 +1149,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 @@ -1512,32 +1354,6 @@ name llphysicsextensions_tpv - mesa - - platforms - - linux - - archive - - hash - 22c50a5d362cad311b4f413cfcffbba2 - url - http://automated-builds-secondlife-com.s3.amazonaws.com/hg/repo/mesa_3p-update-mesa/rev/297294/arch/Linux/installer/mesa-7.11.1.297294-linux-297294.tar.bz2 - - name - linux - - - license - mesa - license_file - LICENSES/mesa.txt - version - 7.11.1.297294 - name - mesa - meshoptimizer platforms @@ -2542,7 +2358,7 @@ Copyright (c) 2012, 2014, 2015, 2016 nghttp2 contributors description Linden Lab Viewer Management Process suite. source - https://bitbucket.org/lindenlab/vmp-standalone + https://github.com/secondlife/viewer-manager source_type hg @@ -2633,11 +2449,11 @@ Copyright (c) 2012, 2014, 2015, 2016 nghttp2 contributors archive hash - 43c5f93517794aeade550e4266b959d1f0cfcb7f + a5e72a9d13b6c4646d1e02b5820f16560d204de7 hash_algorithm sha1 url - https://github.com/secondlife/3p-webrtc-build/releases/download/m137.7151.04.20-universal/webrtc-m137.7151.04.20-universal.17630578914-darwin64-17630578914.tar.zst + https://github.com/secondlife/3p-webrtc-build/releases/download/m137.7151.04.21/webrtc-m137.7151.04.21.18609120431-darwin64-18609120431.tar.zst name darwin64 @@ -2647,11 +2463,11 @@ Copyright (c) 2012, 2014, 2015, 2016 nghttp2 contributors archive hash - efc5b176d878cfc16b8f82445d82ddb96815b6ab + 1030e5086f401d738463223da3ed99c225340f39 hash_algorithm sha1 url - https://github.com/secondlife/3p-webrtc-build/releases/download/m137.7151.04.20-universal/webrtc-m137.7151.04.20-universal.17630578914-linux64-17630578914.tar.zst + https://github.com/secondlife/3p-webrtc-build/releases/download/m137.7151.04.21/webrtc-m137.7151.04.21.18609120431-linux64-18609120431.tar.zst name linux64 @@ -2661,11 +2477,11 @@ Copyright (c) 2012, 2014, 2015, 2016 nghttp2 contributors archive hash - 1e36f100de32c7c71325497a672fb1659b3f206d + d1cae9bc8866ca01aa9f5e72b36d12ef608b1998 hash_algorithm sha1 url - https://github.com/secondlife/3p-webrtc-build/releases/download/m137.7151.04.20-universal/webrtc-m137.7151.04.20-universal.17630578914-windows64-17630578914.tar.zst + https://github.com/secondlife/3p-webrtc-build/releases/download/m137.7151.04.21/webrtc-m137.7151.04.21.18609120431-windows64-18609120431.tar.zst name windows64 @@ -2678,7 +2494,7 @@ Copyright (c) 2012, 2014, 2015, 2016 nghttp2 contributors copyright Copyright (c) 2011, The WebRTC project authors. All rights reserved. version - m137.7151.04.20-universal.17630578914 + m137.7151.04.21.18609120431 name webrtc vcs_branch @@ -2891,11 +2707,11 @@ Copyright (c) 2012, 2014, 2015, 2016 nghttp2 contributors archive hash - 140d8fc952a10edb5f2d72ab405336019ef32cadfa64f0cfce76c9de4bc6268cbc87cc8cd89d3417fb78b531d441701afc8d016bafe4bd275df2707f7daf1387 + 49046b0b41310d2fb0d72853730b2faad35d3e36 hash_algorithm - blake2b + sha1 url - https://github.com/AlchemyViewer/3p-vhacd/releases/download/v4.1.0-r2/vhacd-4.1.0-r2-common-18166921729.tar.zst + https://github.com/secondlife/3p-vhacd/releases/download/v4.1.0-r1/vhacd-4.1.0-r1-common-18475951995.tar.zst name common @@ -2908,7 +2724,7 @@ Copyright (c) 2012, 2014, 2015, 2016 nghttp2 contributors copyright Copyright (c) 2011, Khaled Mamou version - 4.1.0-r2 + 4.1.0-r1 name vhacd description @@ -3143,15 +2959,14 @@ Copyright (c) 2012, 2014, 2015, 2016 nghttp2 contributors configurations - Release + RelWithDebInfo configure options -G - Ninja - -DLL_TESTS=Off + Unix Makefiles arguments @@ -3161,39 +2976,106 @@ Copyright (c) 2012, 2014, 2015, 2016 nghttp2 contributors build command - ninja + cmake + options + + --build + . + --config + Release + --parallel + $AUTOBUILD_CPU_COUNT + default True name - Release + RelWithDebInfo - ReleaseOS + RelWithDebInfoOS configure options -G - Ninja - -DLL_TESTS=Off + Unix Makefiles build command - ninja + cmake + options + + --build + . + --config + Release + --parallel + $AUTOBUILD_CPU_COUNT + name - ReleaseOS + RelWithDebInfoOS + + Release + + configure + + options + + -G + Unix Makefiles + + arguments + + ../indra + + + build + + command + cmake + options + + --build + . + --config + Release + --parallel + $AUTOBUILD_CPU_COUNT + + + name + Release - default + ReleaseOS + configure + + options + + -G + Unix Makefiles + + build + command + cmake + options + + --build + . + --config + Release + --parallel + $AUTOBUILD_CPU_COUNT + name - default + ReleaseOS build_directory @@ -3224,15 +3106,15 @@ Copyright (c) 2012, 2014, 2015, 2016 nghttp2 contributors build command - devenv + cmake options - /build - RelWithDebInfo|${AUTOBUILD_WIN_VSPLATFORM|NOTWIN} - - arguments - - SecondLife.sln + --build + . + --config + RelWithDebInfo + --parallel + $AUTOBUILD_CPU_COUNT default @@ -3299,15 +3181,15 @@ Copyright (c) 2012, 2014, 2015, 2016 nghttp2 contributors build command - devenv + cmake options - /build - Release|${AUTOBUILD_WIN_VSPLATFORM|NOTWIN} - - arguments - - SecondLife.sln + --build + . + --config + Release + --parallel + $AUTOBUILD_CPU_COUNT name diff --git a/indra/cmake/00-COMPILE-LINK-RUN.txt b/indra/cmake/00-COMPILE-LINK-RUN.txt index 1933072a6d..7b91b5a0d4 100644 --- a/indra/cmake/00-COMPILE-LINK-RUN.txt +++ b/indra/cmake/00-COMPILE-LINK-RUN.txt @@ -117,7 +117,7 @@ Compilation currently being generated with a link path of '@executable_path/../Resources/'. If we were to follow the recommendations in dyld's man page, we’d instead reference - '@loader_path/', use -rpath on the executable link + '@loader_path/', use -rpath on the executable link (pointing to the 'Resources' subdir of the main executable), and be able to avoid some symlinking in the .app tree. @@ -162,7 +162,7 @@ Linking * Update the autobuild.xml of ALL consumers of the library. In the case of zlib, that meant updating freetype, libpng, openssl, - libxml2, fontconfig, curl, Boost, SDL, llqtwebkit, google-mock and + libxml2, fontconfig, curl, Boost, SDL3, llqtwebkit, google-mock and colladadom. * Confirm by test and observation that the consumers actually use diff --git a/indra/cmake/00-Common.cmake b/indra/cmake/00-Common.cmake index 99ea22ab4b..c03b2d24ea 100644 --- a/indra/cmake/00-Common.cmake +++ b/indra/cmake/00-Common.cmake @@ -11,13 +11,20 @@ # # Also realize that CMAKE_CXX_FLAGS may already be partially populated on # entry to this file. +# +# Additionally CMAKE_C_FLAGS is prepended to CMAKE_CXX_FLAGS_RELEASE and +# CMAKE_CXX_FLAGS_RELWITHDEBINFO which risks having flags overriden by cmake +# inserting additional options that are part of the build config type. #***************************************************************************** include_guard() include(Variables) +include(Linking) # 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}") +set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} $ENV{LL_BUILD_RELEASE}") +set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "${CMAKE_CXX_FLAGS_RELWITHDEBINFO} $ENV{LL_BUILD_RELWITHDEBINFO}") + # Given that, all the flags you see added below are flags NOT present in # https://bitbucket.org/lindenlab/viewer-build-variables/src/tip/variables. # Before adding new ones here, it's important to ask: can this flag really be @@ -25,7 +32,7 @@ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} $ENV{LL_BUILD}") # as well? # Portable compilation flags. -add_compile_definitions( ADDRESS_SIZE=${ADDRESS_SIZE}) +add_compile_definitions(ADDRESS_SIZE=${ADDRESS_SIZE}) # Because older versions of Boost.Bind dumped placeholders _1, _2 et al. into # the global namespace, Boost now requires either BOOST_BIND_NO_PLACEHOLDERS # to avoid that or BOOST_BIND_GLOBAL_PLACEHOLDERS to state that we require it @@ -111,7 +118,7 @@ if (WINDOWS) #ND: When using something like buildcache (https://github.com/mbitsnbites/buildcache) # to make those wrappers work /Zi must be changed to /Z7, as /Zi due to it's nature is not compatible with caching - if(${CMAKE_CXX_COMPILER_LAUNCHER} MATCHES ".*cache.*") + if (${CMAKE_CXX_COMPILER_LAUNCHER} MATCHES ".*cache.*") add_compile_options( /Z7 ) string(REPLACE "/Zi" "/Z7" CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}") string(REPLACE "/Zi" "/Z7" CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE}") @@ -125,9 +132,6 @@ endif (WINDOWS) if (LINUX) set(CMAKE_SKIP_RPATH TRUE) - # EXTERNAL_TOS - # force this platform to accept TOS via external browser - # LL_IGNORE_SIGCHLD # don't catch SIGCHLD in our base application class for the viewer - some of # our 3rd party libs may need their *own* SIGCHLD handler to work. Sigh! The @@ -135,42 +139,45 @@ if (LINUX) add_compile_definitions( _REENTRANT - _FORTIFY_SOURCE=2 - EXTERNAL_TOS APPID=secondlife 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() + add_compile_options( + $<$,$>:-fstack-protector> -fexceptions -fno-math-errno -fno-strict-aliasing -fsigned-char + -g -msse2 - -mfpmath=sse -pthread - -Wno-parentheses - -Wno-deprecated -fvisibility=hidden ) - if (ADDRESS_SIZE EQUAL 32) - add_compile_options(-march=pentium4) - endif (ADDRESS_SIZE EQUAL 32) - - # this stops us requiring a really recent glibc at runtime - add_compile_options(-fno-stack-protector) - # linking can be very memory-hungry, especially the final viewer link - set(CMAKE_CXX_LINK_FLAGS "-Wl,--no-keep-memory") - - set(CMAKE_CXX_FLAGS_DEBUG "-fno-inline ${CMAKE_CXX_FLAGS_DEBUG}") + add_link_options( + "LINKER:-z,relro" + "LINKER:-z,now" + "LINKER:--build-id" + "LINKER:--as-needed" + "LINKER:--no-undefined" + ) 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") set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_CXX_LINK_FLAGS}") @@ -185,20 +192,17 @@ if (LINUX OR DARWIN) 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) endif() if (CMAKE_CXX_COMPILER_ID STREQUAL "GNU") - add_compile_options(-Wno-stringop-truncation -Wno-parentheses -Wno-maybe-uninitialized) - endif() + add_compile_options(-Wno-stringop-truncation -Wno-stringop-overflow -Wno-parentheses -Wno-maybe-uninitialized -Wno-unused-local-typedefs) + endif () if (NOT GCC_DISABLE_FATAL_WARNINGS AND NOT CLANG_DISABLE_FATAL_WARNINGS) add_compile_options(-Werror) endif () - add_compile_options(${GCC_WARNINGS}) add_compile_options(-m${ADDRESS_SIZE}) endif (LINUX OR DARWIN) diff --git a/indra/cmake/Boost.cmake b/indra/cmake/Boost.cmake index b57c33c3e0..610a4f6232 100644 --- a/indra/cmake/Boost.cmake +++ b/indra/cmake/Boost.cmake @@ -1,5 +1,6 @@ # -*- cmake -*- include(Prebuilt) +include(Linking) include_guard() @@ -16,107 +17,69 @@ use_prebuilt_binary(boost) # with the address size. set(addrsfx "-x${ADDRESS_SIZE}") -if (WINDOWS) - - find_library(BOOST_CONTEXT_LIBRARY - NAMES - libboost_context-mt - libboost_context-mt${addrsfx} - PATHS "${ARCH_PREBUILT_DIRS_RELEASE}" REQUIRED NO_DEFAULT_PATH) - - find_library(BOOST_FIBER_LIBRARY - NAMES - libboost_fiber-mt - libboost_fiber-mt${addrsfx} - PATHS "${ARCH_PREBUILT_DIRS_RELEASE}" REQUIRED NO_DEFAULT_PATH) - - find_library(BOOST_FILESYSTEM_LIBRARY - NAMES - libboost_filesystem-mt - libboost_filesystem-mt${addrsfx} - PATHS "${ARCH_PREBUILT_DIRS_RELEASE}" REQUIRED NO_DEFAULT_PATH) - - find_library(BOOST_PROGRAMOPTIONS_LIBRARY - NAMES - libboost_program_options-mt - libboost_program_options-mt${addrsfx} - PATHS "${ARCH_PREBUILT_DIRS_RELEASE}" REQUIRED NO_DEFAULT_PATH) - - find_library(BOOST_REGEX_LIBRARY - NAMES - libboost_regex-mt - libboost_regex-mt${addrsfx} - PATHS "${ARCH_PREBUILT_DIRS_RELEASE}" REQUIRED NO_DEFAULT_PATH) - - find_library(BOOST_SYSTEM_LIBRARY - NAMES - libboost_system-mt - libboost_system-mt${addrsfx} - PATHS "${ARCH_PREBUILT_DIRS_RELEASE}" REQUIRED NO_DEFAULT_PATH) - - find_library(BOOST_THREAD_LIBRARY - NAMES - libboost_thread-mt - libboost_thread-mt${addrsfx} - PATHS "${ARCH_PREBUILT_DIRS_RELEASE}" REQUIRED NO_DEFAULT_PATH) - - find_library(BOOST_URL_LIBRARY - NAMES - libboost_url-mt - libboost_url-mt${addrsfx} - PATHS "${ARCH_PREBUILT_DIRS_RELEASE}" REQUIRED NO_DEFAULT_PATH) - -else (WINDOWS) - - find_library(BOOST_CONTEXT_LIBRARY - NAMES - boost_context-mt - boost_context-mt${addrsfx} - PATHS "${ARCH_PREBUILT_DIRS_RELEASE}" REQUIRED NO_DEFAULT_PATH) - - find_library(BOOST_FIBER_LIBRARY - NAMES - boost_fiber-mt - boost_fiber-mt${addrsfx} - PATHS "${ARCH_PREBUILT_DIRS_RELEASE}" REQUIRED NO_DEFAULT_PATH) - - find_library(BOOST_FILESYSTEM_LIBRARY - NAMES - boost_filesystem-mt - boost_filesystem-mt${addrsfx} - PATHS "${ARCH_PREBUILT_DIRS_RELEASE}" REQUIRED NO_DEFAULT_PATH) - - find_library(BOOST_PROGRAMOPTIONS_LIBRARY - NAMES - boost_program_options-mt - boost_program_options-mt${addrsfx} - PATHS "${ARCH_PREBUILT_DIRS_RELEASE}" REQUIRED NO_DEFAULT_PATH) - - find_library(BOOST_REGEX_LIBRARY - NAMES - boost_regex-mt - boost_regex-mt${addrsfx} - PATHS "${ARCH_PREBUILT_DIRS_RELEASE}" REQUIRED NO_DEFAULT_PATH) - - find_library(BOOST_SYSTEM_LIBRARY - NAMES - boost_system-mt - boost_system-mt${addrsfx} - PATHS "${ARCH_PREBUILT_DIRS_RELEASE}" REQUIRED NO_DEFAULT_PATH) - - find_library(BOOST_THREAD_LIBRARY - NAMES - boost_thread-mt - boost_thread-mt${addrsfx} - PATHS "${ARCH_PREBUILT_DIRS_RELEASE}" REQUIRED NO_DEFAULT_PATH) - - find_library(BOOST_URL_LIBRARY - NAMES - boost_url-mt - boost_url-mt${addrsfx} - PATHS "${ARCH_PREBUILT_DIRS_RELEASE}" REQUIRED NO_DEFAULT_PATH) - -endif (WINDOWS) +find_library(BOOST_CONTEXT_LIBRARY + NAMES + libboost_context-mt + libboost_context-mt${addrsfx} + boost_context-mt + boost_context-mt${addrsfx} + PATHS "${ARCH_PREBUILT_DIRS_RELEASE}" REQUIRED NO_DEFAULT_PATH) + +find_library(BOOST_FIBER_LIBRARY + NAMES + libboost_fiber-mt + libboost_fiber-mt${addrsfx} + boost_fiber-mt + boost_fiber-mt${addrsfx} + PATHS "${ARCH_PREBUILT_DIRS_RELEASE}" REQUIRED NO_DEFAULT_PATH) + +find_library(BOOST_FILESYSTEM_LIBRARY + NAMES + libboost_filesystem-mt + libboost_filesystem-mt${addrsfx} + boost_filesystem-mt + boost_filesystem-mt${addrsfx} + PATHS "${ARCH_PREBUILT_DIRS_RELEASE}" REQUIRED NO_DEFAULT_PATH) + +find_library(BOOST_PROGRAMOPTIONS_LIBRARY + NAMES + libboost_program_options-mt + libboost_program_options-mt${addrsfx} + boost_program_options-mt + boost_program_options-mt${addrsfx} + PATHS "${ARCH_PREBUILT_DIRS_RELEASE}" REQUIRED NO_DEFAULT_PATH) + +find_library(BOOST_REGEX_LIBRARY + NAMES + libboost_regex-mt + libboost_regex-mt${addrsfx} + boost_regex-mt + boost_regex-mt${addrsfx} + PATHS "${ARCH_PREBUILT_DIRS_RELEASE}" REQUIRED NO_DEFAULT_PATH) + +find_library(BOOST_SYSTEM_LIBRARY + NAMES + libboost_system-mt + libboost_system-mt${addrsfx} + boost_system-mt + boost_system-mt${addrsfx} + PATHS "${ARCH_PREBUILT_DIRS_RELEASE}" REQUIRED NO_DEFAULT_PATH) + +find_library(BOOST_THREAD_LIBRARY + NAMES + libboost_thread-mt + libboost_thread-mt${addrsfx} + boost_thread-mt + boost_thread-mt${addrsfx} + PATHS "${ARCH_PREBUILT_DIRS_RELEASE}" REQUIRED NO_DEFAULT_PATH) + +find_library(BOOST_URL_LIBRARY + NAMES + libboost_url-mt + libboost_url-mt${addrsfx} + boost_url-mt + boost_url-mt${addrsfx} + PATHS "${ARCH_PREBUILT_DIRS_RELEASE}" REQUIRED NO_DEFAULT_PATH) target_link_libraries(ll::boost INTERFACE ${BOOST_FIBER_LIBRARY} diff --git a/indra/cmake/CEFPlugin.cmake b/indra/cmake/CEFPlugin.cmake index e27929fa08..5f5c55f0e9 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) @@ -32,4 +32,9 @@ elseif (DARWIN) ) elseif (LINUX) + target_link_libraries( ll::cef INTERFACE + ${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/CMakeLists.txt b/indra/cmake/CMakeLists.txt index 0aed268c29..5847553993 100644 --- a/indra/cmake/CMakeLists.txt +++ b/indra/cmake/CMakeLists.txt @@ -11,22 +11,23 @@ set(cmake_SOURCE_FILES Audio.cmake Boost.cmake bugsplat.cmake + BuildPackagesInfo.cmake BuildVersion.cmake CEFPlugin.cmake CEFPlugin.cmake CMakeCopyIfDifferent.cmake - ConfigurePkgConfig.cmake - CURL.cmake Copy3rdPartyLibs.cmake - DBusGlib.cmake + CURL.cmake DeploySharedLibs.cmake Discord.cmake DragDrop.cmake EXPAT.cmake FindAutobuild.cmake + FindPipeWire.cmake FreeType.cmake GLEXT.cmake GLH.cmake + GLIB.cmake GLM.cmake GStreamer10Plugin.cmake Havok.cmake @@ -54,6 +55,7 @@ set(cmake_SOURCE_FILES Prebuilt.cmake PulseAudio.cmake Python.cmake + SDL3.cmake SSE2NEON.cmake TemplateCheck.cmake TinyEXR.cmake diff --git a/indra/cmake/ConfigurePkgConfig.cmake b/indra/cmake/ConfigurePkgConfig.cmake deleted file mode 100644 index 9e798d663b..0000000000 --- a/indra/cmake/ConfigurePkgConfig.cmake +++ /dev/null @@ -1,74 +0,0 @@ -# -*- cmake -*- - -SET(DEBUG_PKG_CONFIG "YES") - -# Don't change this if manually set by user. -IF("$ENV{PKG_CONFIG_LIBDIR}" STREQUAL "") - - # Guess at architecture-specific system library paths. - if (ADDRESS_SIZE EQUAL 32) - SET(PKG_CONFIG_NO_MULTI_GUESS /usr/lib32 /usr/lib) - SET(PKG_CONFIG_NO_MULTI_LOCAL_GUESS /usr/local/lib32 /usr/local/lib) - SET(PKG_CONFIG_MULTI_GUESS /usr/lib/i386-linux-gnu) - SET(PKG_CONFIG_MULTI_LOCAL_GUESS /usr/local/lib/i386-linux-gnu) - else (ADDRESS_SIZE EQUAL 32) - SET(PKG_CONFIG_NO_MULTI_GUESS /usr/lib64 /usr/lib) - SET(PKG_CONFIG_NO_MULTI_LOCAL_GUESS /usr/local/lib64 /usr/local/lib) - SET(PKG_CONFIG_MULTI_GUESS /usr/local/lib/x86_64-linux-gnu) - SET(PKG_CONFIG_MULTI_LOCAL_GUESS /usr/local/lib/x86_64-linux-gnu) - endif (ADDRESS_SIZE EQUAL 32) - - # Use DPKG architecture, if available. - IF (${DPKG_ARCH}) - SET(PKG_CONFIG_MULTI_GUESS /usr/lib/${DPKG_ARCH}) - SET(PKG_CONFIG_MULTI_LOCAL_GUESS /usrlocal/lib/${DPKG_ARCH}) - ENDIF (${DPKG_ARCH}) - - # Explicitly include anything listed in PKG_CONFIG_PATH - string(REPLACE ":" ";" PKG_CONFIG_PATH_LIST "$ENV{PKG_CONFIG_PATH}") - FOREACH(PKG_CONFIG_DIR ${PKG_CONFIG_PATH_LIST}) - SET(VALID_PKG_LIBDIRS "${VALID_PKG_LIBDIRS}:${PKG_CONFIG_DIR}/pkgconfig") - ENDFOREACH(PKG_CONFIG_DIR) - - # Look for valid pkgconfig directories. - FIND_PATH(PKG_CONFIG_ENV pkgconfig ENV LD_LIBRARY_PATH) - FIND_PATH(PKG_CONFIG_MULTI pkgconfig HINT ${PKG_CONFIG_MULTI_GUESS}) - FIND_PATH(PKG_CONFIG_MULTI_LOCAL pkgconfig HINT ${PKG_CONFIG_MULTI_LOCAL_GUESS}) - FIND_PATH(PKG_CONFIG_NO_MULTI pkgconfig HINT ${PKG_CONFIG_NO_MULTI_GUESS}) - FIND_PATH(PKG_CONFIG_NO_MULTI_LOCAL pkgconfig HINT ${PKG_CONFIG_NO_MULTI_LOCAL_GUESS}) - - # Add anything we found to our list. - IF(NOT PKG_CONFIG_ENV STREQUAL PKG_CONFIG_ENV-NOTFOUND) - SET(VALID_PKG_LIBDIRS "${VALID_PKG_LIBDIRS}:${PKG_CONFIG_ENV}/pkgconfig") - ENDIF(NOT PKG_CONFIG_ENV STREQUAL PKG_CONFIG_ENV-NOTFOUND) - - IF(NOT PKG_CONFIG_MULTI STREQUAL PKG_CONFIG_MULTI-NOTFOUND) - SET(VALID_PKG_LIBDIRS "${VALID_PKG_LIBDIRS}:${PKG_CONFIG_MULTI}/pkgconfig") - ENDIF(NOT PKG_CONFIG_MULTI STREQUAL PKG_CONFIG_MULTI-NOTFOUND) - - IF(NOT PKG_CONFIG_MULTI_LOCAL STREQUAL PKG_CONFIG_MULTI_LOCAL-NOTFOUND) - SET(VALID_PKG_LIBDIRS "${VALID_PKG_LIBDIRS}:${PKG_CONFIG_MULTI_LOCAL}/pkgconfig") - ENDIF(NOT PKG_CONFIG_MULTI_LOCAL STREQUAL PKG_CONFIG_MULTI_LOCAL-NOTFOUND) - - IF(NOT PKG_CONFIG_NO_MULTI STREQUAL PKG_CONFIG_NO_MULTI-NOTFOUND) - SET(VALID_PKG_LIBDIRS "${VALID_PKG_LIBDIRS}:${PKG_CONFIG_NO_MULTI}/pkgconfig") - ENDIF(NOT PKG_CONFIG_NO_MULTI STREQUAL PKG_CONFIG_NO_MULTI-NOTFOUND) - - IF(NOT PKG_CONFIG_NO_MULTI_LOCAL STREQUAL PKG_CONFIG_NO_MULTI_LOCAL-NOTFOUND) - SET(VALID_PKG_LIBDIRS "${VALID_PKG_LIBDIRS}:${PKG_CONFIG_NO_MULTI_LOCAL}/pkgconfig") - ENDIF(NOT PKG_CONFIG_NO_MULTI_LOCAL STREQUAL PKG_CONFIG_NO_MULTI_LOCAL-NOTFOUND) - - # Also add some non-architecture specific package locations. - SET(VALID_PKG_LIBDIRS "${VALID_PKG_LIBDIRS}:/usr/share/pkgconfig:/usr/local/share/pkgconfig") - - # Remove first unwanted ':' - string(SUBSTRING ${VALID_PKG_LIBDIRS} 1 -1 VALID_PKG_LIBDIRS) - - # Set PKG_CONFIG_LIBDIR environment. - SET(ENV{PKG_CONFIG_LIBDIR} ${VALID_PKG_LIBDIRS}) -ENDIF("$ENV{PKG_CONFIG_LIBDIR}" STREQUAL "") - -IF(DEBUG_PKG_CONFIG) - MESSAGE(STATUS "Using PKG_CONFIG_LIBDIR=$ENV{PKG_CONFIG_LIBDIR}") -ENDIF(DEBUG_PKG_CONFIG) - diff --git a/indra/cmake/Copy3rdPartyLibs.cmake b/indra/cmake/Copy3rdPartyLibs.cmake index 680f2f3ac2..3e89118a4e 100644 --- a/indra/cmake/Copy3rdPartyLibs.cmake +++ b/indra/cmake/Copy3rdPartyLibs.cmake @@ -211,17 +211,10 @@ elseif(LINUX) if( USE_AUTOBUILD_3P ) list( APPEND release_files - libatk-1.0.so - libfreetype.so.6.6.2 - libfreetype.so.6 - libopenjp2.so - libuuid.so.16 - libuuid.so.16.0.22 - libfontconfig.so.1.8.0 - libfontconfig.so.1 - libgmodule-2.0.so - libgobject-2.0.so - ) + libSDL3.so + libSDL3.so.0 + libSDL3.so.0.2.22 + ) endif() else(WINDOWS) 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/Discord.cmake b/indra/cmake/Discord.cmake index 95cfaacf5b..0e63d05350 100644 --- a/indra/cmake/Discord.cmake +++ b/indra/cmake/Discord.cmake @@ -2,10 +2,23 @@ include(Prebuilt) include_guard() -add_library(ll::discord_sdk INTERFACE IMPORTED) -target_compile_definitions(ll::discord_sdk INTERFACE LL_DISCORD=1) +option(USE_DISCORD "Enable Discord SDK" OFF) -use_prebuilt_binary(discord_sdk) +if(USE_DISCORD) + add_library(ll::discord_sdk INTERFACE IMPORTED) -target_include_directories(ll::discord_sdk SYSTEM INTERFACE ${LIBS_PREBUILT_DIR}/include/discord_sdk) -target_link_libraries(ll::discord_sdk INTERFACE discord_partner_sdk) + target_compile_definitions(ll::discord_sdk INTERFACE LL_DISCORD=1) + + use_prebuilt_binary(discord_sdk) + + find_library(DISCORD_SDK_LIBRARY + NAMES + discord_partner_sdk + discord_partner_sdk.lib + libdiscord_partner_sdk.so + libdiscord_partner_sdk.dylib + PATHS "${ARCH_PREBUILT_DIRS_ARCH_RELEASE}" "${ARCH_PREBUILT_DIRS_RELEASE}" REQUIRED NO_DEFAULT_PATH) + + target_include_directories(ll::discord_sdk SYSTEM INTERFACE ${LIBS_PREBUILT_DIR}/include/discord_sdk) + target_link_libraries(ll::discord_sdk INTERFACE ${DISCORD_SDK_LIBRARY}) +endif() diff --git a/indra/cmake/FreeType.cmake b/indra/cmake/FreeType.cmake index 3c635e851b..eb018c09e9 100644 --- a/indra/cmake/FreeType.cmake +++ b/indra/cmake/FreeType.cmake @@ -1,6 +1,8 @@ # -*- cmake -*- include(Prebuilt) include(Linking) +include(PNG) +include(ZLIBNG) include_guard() add_library( ll::freetype INTERFACE IMPORTED ) @@ -15,4 +17,4 @@ find_library(FREETYPE_LIBRARY libfreetype.a PATHS "${ARCH_PREBUILT_DIRS_RELEASE}" REQUIRED NO_DEFAULT_PATH) -target_link_libraries(ll::freetype INTERFACE ${FREETYPE_LIBRARY}) +target_link_libraries(ll::freetype INTERFACE ${FREETYPE_LIBRARY} ll::libpng ll::zlib-ng) diff --git a/indra/cmake/Havok.cmake b/indra/cmake/Havok.cmake index c544440adc..64e33f6c83 100644 --- a/indra/cmake/Havok.cmake +++ b/indra/cmake/Havok.cmake @@ -27,26 +27,26 @@ else (LL_DEBUG_HAVOK) endif (LL_DEBUG_HAVOK) set(HAVOK_LIBS - hkBase - hkCompat + hkgpConvexDecomposition hkGeometryUtilities - hkInternal hkSerialize hkSceneData hkpCollide hkpUtilities hkpConstraintSolver hkpDynamics - hkpInternal - hkaiInternal hkaiPathfinding hkaiAiPhysicsBridge - hkcdInternal hkcdCollide hkpVehicle hkVisualize hkaiVisualize - hkgpConvexDecomposition + hkaiInternal + hkcdInternal + hkpInternal + hkInternal + hkCompat + hkBase ) unset(HK_DEBUG_LIBRARIES) @@ -60,16 +60,22 @@ if (DEBUG_PREBUILT) # but making it pretty is a lot more work message(STATUS "${ARGN}") endfunction(DEBUG_MESSAGE) + function(DEBUG_EXEC_FUNC) + execute_process(COMMAND ${ARGN}) + endfunction(DEBUG_EXEC_FUNC) else (DEBUG_PREBUILT) # without DEBUG_PREBUILT, DEBUG_MESSAGE() is a no-op function(DEBUG_MESSAGE) endfunction(DEBUG_MESSAGE) + function(DEBUG_EXEC_FUNC) + execute_process(COMMAND ${ARGN} OUTPUT_QUIET) + endfunction(DEBUG_EXEC_FUNC) endif (DEBUG_PREBUILT) # DEBUG_EXEC() reports each execute_process() before invoking function(DEBUG_EXEC) DEBUG_MESSAGE(${ARGN}) - execute_process(COMMAND ${ARGN}) + DEBUG_EXEC_FUNC(${ARGN}) endfunction(DEBUG_EXEC) # *TODO: Figure out why we need to extract like this... @@ -79,9 +85,7 @@ foreach(HAVOK_LIB ${HAVOK_LIBS}) find_library(HAVOK_RELWITHDEBINFO_LIB_${HAVOK_LIB} ${HAVOK_LIB} PATHS ${HAVOK_RELWITHDEBINFO_LIBRARY_PATH}) if(LINUX) - set(debug_dir "${HAVOK_DEBUG_LIBRARY_PATH}/${HAVOK_LIB}") set(release_dir "${HAVOK_RELEASE_LIBRARY_PATH}/${HAVOK_LIB}") - set(relwithdebinfo_dir "${HAVOK_RELWITHDEBINFO_LIBRARY_PATH}/${HAVOK_LIB}") # Try to avoid extracting havok library each time we run cmake. if("${havok_${HAVOK_LIB}_extracted}" STREQUAL "" AND EXISTS "${PREBUILD_TRACKING_DIR}/havok_${HAVOK_LIB}_extracted") @@ -92,8 +96,8 @@ foreach(HAVOK_LIB ${HAVOK_LIBS}) if(${PREBUILD_TRACKING_DIR}/havok_source_installed IS_NEWER_THAN ${PREBUILD_TRACKING_DIR}/havok_${HAVOK_LIB}_extracted OR NOT ${havok_${HAVOK_LIB}_extracted} EQUAL 0) DEBUG_MESSAGE("Extracting ${HAVOK_LIB}...") - foreach(lib ${debug_dir} ${release_dir} ${relwithdebinfo_dir}) - DEBUG_EXEC("mkdir" ${lib}) + foreach(lib ${release_dir}) + DEBUG_EXEC("mkdir" "-p" ${lib}) DEBUG_EXEC("ar" "-xv" "../lib${HAVOK_LIB}.a" WORKING_DIRECTORY ${lib}) endforeach(lib) @@ -104,17 +108,12 @@ foreach(HAVOK_LIB ${HAVOK_LIBS}) endif() - file(GLOB extracted_debug "${debug_dir}/*.o") file(GLOB extracted_release "${release_dir}/*.o") - file(GLOB extracted_relwithdebinfo "${relwithdebinfo_dir}/*.o") - - DEBUG_MESSAGE("extracted_debug ${debug_dir}/*.o") DEBUG_MESSAGE("extracted_release ${release_dir}/*.o") - DEBUG_MESSAGE("extracted_relwithdebinfo ${relwithdebinfo_dir}/*.o") - list(APPEND HK_DEBUG_LIBRARIES ${extracted_debug}) + list(APPEND HK_DEBUG_LIBRARIES ${extracted_release}) list(APPEND HK_RELEASE_LIBRARIES ${extracted_release}) - list(APPEND HK_RELWITHDEBINFO_LIBRARIES ${extracted_relwithdebinfo}) + list(APPEND HK_RELWITHDEBINFO_LIBRARIES ${extracted_release}) else(LINUX) # Win32 list(APPEND HK_DEBUG_LIBRARIES ${HAVOK_DEBUG_LIB_${HAVOK_LIB}}) diff --git a/indra/cmake/JPEG.cmake b/indra/cmake/JPEG.cmake index f864ca7f8d..49880e7f72 100644 --- a/indra/cmake/JPEG.cmake +++ b/indra/cmake/JPEG.cmake @@ -11,6 +11,9 @@ use_prebuilt_binary(libjpeg-turbo) find_library(JPEG_LIBRARY NAMES + jpeg + jpeg-static + jpeg-static.lib jpeg.lib libjpeg.a PATHS "${ARCH_PREBUILT_DIRS_RELEASE}" REQUIRED NO_DEFAULT_PATH) diff --git a/indra/cmake/LLKDU.cmake b/indra/cmake/LLKDU.cmake index 7680ab7b54..3009b4b9cc 100644 --- a/indra/cmake/LLKDU.cmake +++ b/indra/cmake/LLKDU.cmake @@ -14,19 +14,11 @@ if (USE_KDU) include(Prebuilt) use_prebuilt_binary(kdu) - if (WINDOWS) - find_library(KDU_LIBRARY - NAMES - kdu - PATHS "${ARCH_PREBUILT_DIRS_RELEASE}" REQUIRED NO_DEFAULT_PATH) - - else (WINDOWS) - find_library(KDU_LIBRARY - NAMES - libkdu.a - PATHS "${ARCH_PREBUILT_DIRS_RELEASE}" REQUIRED NO_DEFAULT_PATH) - - endif (WINDOWS) + find_library(KDU_LIBRARY + NAMES + kdu + libkdu.a + PATHS "${ARCH_PREBUILT_DIRS_RELEASE}" REQUIRED NO_DEFAULT_PATH) target_link_libraries(ll::kdu INTERFACE ${KDU_LIBRARY}) diff --git a/indra/cmake/LLWindow.cmake b/indra/cmake/LLWindow.cmake index 2e1b601b79..d5840379ac 100644 --- a/indra/cmake/LLWindow.cmake +++ b/indra/cmake/LLWindow.cmake @@ -3,20 +3,12 @@ include(Variables) include(GLEXT) include(Prebuilt) +include(SDL3) include_guard() -add_library( ll::SDL INTERFACE IMPORTED ) - if (LINUX) - #Must come first as use_system_binary can exit this file early - target_compile_definitions( ll::SDL INTERFACE LL_SDL=1) - - use_system_binary(SDL) - use_prebuilt_binary(SDL) - - target_include_directories( ll::SDL SYSTEM INTERFACE ${LIBS_PREBUILT_DIR}/include) - target_link_libraries( ll::SDL INTERFACE SDL directfb fusion direct X11) + set(USE_SDL_WINDOW ON CACHE BOOL "Build with SDL window backend") +else() + set(USE_SDL_WINDOW OFF CACHE BOOL "Build with SDL window backend") endif (LINUX) - - diff --git a/indra/cmake/NDOF.cmake b/indra/cmake/NDOF.cmake index a8f63f945b..60b29a57fe 100644 --- a/indra/cmake/NDOF.cmake +++ b/indra/cmake/NDOF.cmake @@ -19,7 +19,12 @@ if (NDOF) ndofdev PATHS "${ARCH_PREBUILT_DIRS_RELEASE}" REQUIRED NO_DEFAULT_PATH) - target_link_libraries(ll::ndof INTERFACE ${NDOF_LIBRARY}) + if (LINUX) + include(SDL3) + target_link_libraries(ll::ndof INTERFACE ${NDOF_LIBRARY} ll::SDL3) + else() + target_link_libraries(ll::ndof INTERFACE ${NDOF_LIBRARY}) + endif() target_compile_definitions(ll::ndof INTERFACE LIB_NDOF=1) endif (NDOF) diff --git a/indra/cmake/OPENAL.cmake b/indra/cmake/OPENAL.cmake index ab1604aa22..523a2d16f6 100644 --- a/indra/cmake/OPENAL.cmake +++ b/indra/cmake/OPENAL.cmake @@ -26,6 +26,7 @@ if (USE_OPENAL) NAMES OpenAL32 openal + OpenAL32.lib libopenal.dylib libopenal.so PATHS "${ARCH_PREBUILT_DIRS_RELEASE}" REQUIRED NO_DEFAULT_PATH) @@ -33,6 +34,7 @@ if (USE_OPENAL) find_library(ALUT_LIBRARY NAMES alut + alut.lib libalut.dylib libalut.so PATHS "${ARCH_PREBUILT_DIRS_RELEASE}" REQUIRED NO_DEFAULT_PATH) diff --git a/indra/cmake/PNG.cmake b/indra/cmake/PNG.cmake index 0c01e5ee78..6a66f40385 100644 --- a/indra/cmake/PNG.cmake +++ b/indra/cmake/PNG.cmake @@ -1,5 +1,7 @@ # -*- cmake -*- include(Prebuilt) +include(Linking) +include(ZLIBNG) include_guard() add_library( ll::libpng INTERFACE IMPORTED ) @@ -13,5 +15,5 @@ find_library(LIBPNG_LIBRARY libpng16.a PATHS "${ARCH_PREBUILT_DIRS_RELEASE}" REQUIRED NO_DEFAULT_PATH) -target_link_libraries(ll::libpng INTERFACE ${LIBPNG_LIBRARY}) +target_link_libraries(ll::libpng INTERFACE ${LIBPNG_LIBRARY} ll::zlib-ng) target_include_directories(ll::libpng SYSTEM INTERFACE ${LIBS_PREBUILT_DIR}/include/libpng16) diff --git a/indra/cmake/Prebuilt.cmake b/indra/cmake/Prebuilt.cmake index 634cc15c21..d0ab341d94 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; @@ -40,8 +37,10 @@ macro (use_prebuilt_binary _binary) --install-dir=${AUTOBUILD_INSTALL_DIR} ${_binary} ") endif(DEBUG_PREBUILT) + message(STATUS "Installing ${_binary}...") execute_process(COMMAND "${AUTOBUILD_EXECUTABLE}" install + --skip-source-environment --install-dir=${AUTOBUILD_INSTALL_DIR} ${_binary} WORKING_DIRECTORY "${CMAKE_SOURCE_DIR}" diff --git a/indra/cmake/Python.cmake b/indra/cmake/Python.cmake index 7cce190f6a..39fd21c33f 100644 --- a/indra/cmake/Python.cmake +++ b/indra/cmake/Python.cmake @@ -13,7 +13,7 @@ elseif (WINDOWS) foreach(hive HKEY_CURRENT_USER HKEY_LOCAL_MACHINE) # prefer more recent Python versions to older ones, if multiple versions # are installed - foreach(pyver 3.13 3.12 3.11 3.10 3.9 3.8 3.7) + foreach(pyver 3.14 3.13 3.12 3.11 3.10 3.9 3.8 3.7) list(APPEND regpaths "[${hive}\\SOFTWARE\\Python\\PythonCore\\${pyver}\\InstallPath]") endforeach() endforeach() diff --git a/indra/cmake/SDL3.cmake b/indra/cmake/SDL3.cmake new file mode 100644 index 0000000000..b37e1c64c2 --- /dev/null +++ b/indra/cmake/SDL3.cmake @@ -0,0 +1,19 @@ +# -*- cmake -*- +cmake_minimum_required( VERSION 3.13 FATAL_ERROR ) + +include(Linking) +include( Prebuilt ) +include_guard() + +add_library( ll::SDL3 INTERFACE IMPORTED ) + +use_system_binary( SDL3 ) +use_prebuilt_binary( SDL3 ) + +find_library( SDL3_LIBRARY + NAMES SDL3 SDL3.lib libSDL3.so libSDL3.dylib + PATHS "${LIBS_PREBUILT_DIR}/lib/release" REQUIRED) + +target_link_libraries( ll::SDL3 INTERFACE ${SDL3_LIBRARY}) +target_include_directories( ll::SDL3 SYSTEM INTERFACE "${LIBS_PREBUILT_DIR}/include/" ) + diff --git a/indra/cmake/UI.cmake b/indra/cmake/UI.cmake index 8f135676d6..afa1350ef0 100644 --- a/indra/cmake/UI.cmake +++ b/indra/cmake/UI.cmake @@ -1,35 +1,33 @@ # -*- cmake -*- include(Prebuilt) include(FreeType) +include(GLIB) +include_guard() add_library( ll::uilibraries INTERFACE IMPORTED ) if (LINUX) - target_compile_definitions(ll::uilibraries INTERFACE LL_GTK=1 LL_X11=1 ) - if( USE_CONAN ) - target_link_libraries( ll::uilibraries INTERFACE CONAN_PKG::gtk ) return() endif() - use_prebuilt_binary(gtk-atk-pango-glib) + + find_package(PkgConfig REQUIRED) + pkg_check_modules(WAYLAND_CLIENT wayland-client) + + if( WAYLAND_CLIENT_FOUND ) + target_compile_definitions( ll::uilibraries INTERFACE LL_WAYLAND=1) + else() + message("pkgconfig could not find wayland client, compiling without full wayland support") + endif() target_link_libraries( ll::uilibraries INTERFACE - atk-1.0 - gdk-x11-2.0 - gdk_pixbuf-2.0 - Xinerama - glib-2.0 - gmodule-2.0 - gobject-2.0 - gthread-2.0 - gtk-x11-2.0 - pango-1.0 - pangoft2-1.0 - pangox-1.0 - pangoxft-1.0 - Xinerama + ll::fontconfig ll::freetype - ) + ll::SDL3 + ll::glib + ll::gio + ) + endif (LINUX) if( WINDOWS ) target_link_libraries( ll::uilibraries INTERFACE diff --git a/indra/cmake/Variables.cmake b/indra/cmake/Variables.cmake index 22c2156bb8..2341d15a85 100644 --- a/indra/cmake/Variables.cmake +++ b/indra/cmake/Variables.cmake @@ -9,21 +9,51 @@ # LINUX - Linux # WINDOWS - Windows +include_guard() + # Switches set here and in 00-Common.cmake must agree with # https://bitbucket.org/lindenlab/viewer-build-variables/src/tip/variables # Reading $LL_BUILD is an attempt to directly use those switches. -if ("$ENV{LL_BUILD}" STREQUAL "" AND "${LL_BUILD_ENV}" STREQUAL "" ) - message(FATAL_ERROR "Environment variable LL_BUILD must be set") -elseif("$ENV{LL_BUILD}" STREQUAL "") - set( ENV{LL_BUILD} "${LL_BUILD_ENV}" ) - message( "Setting ENV{LL_BUILD} to cached variable ${LL_BUILD_ENV}" ) +if ("$ENV{AUTOBUILD_ADDRSIZE}" STREQUAL "" AND "${AUTOBUILD_ADDRSIZE_ENV}" STREQUAL "" ) + message(FATAL_ERROR "Environment variable AUTOBUILD_ADDRSIZE must be set") +elseif("$ENV{AUTOBUILD_ADDRSIZE}" STREQUAL "") + set( ENV{AUTOBUILD_ADDRSIZE} "${AUTOBUILD_ADDRSIZE_ENV}" ) + message( "Setting ENV{AUTOBUILD_ADDRSIZE} to cached variable ${AUTOBUILD_ADDRSIZE_ENV}" ) else() - set( LL_BUILD_ENV "$ENV{LL_BUILD}" CACHE STRING "Save environment" FORCE ) + set( AUTOBUILD_ADDRSIZE_ENV "$ENV{AUTOBUILD_ADDRSIZE}" CACHE STRING "Save environment AUTOBUILD_ADDRSIZE" FORCE ) endif () -include_guard() -# Relative and absolute paths to subtrees. +if ("$ENV{AUTOBUILD_PLATFORM}" STREQUAL "" AND "${AUTOBUILD_PLATFORM_ENV}" STREQUAL "" ) + message(FATAL_ERROR "Environment variable AUTOBUILD_PLATFORM must be set") +elseif("$ENV{AUTOBUILD_PLATFORM}" STREQUAL "") + set( ENV{AUTOBUILD_PLATFORM} "${AUTOBUILD_PLATFORM_ENV}" ) + message( "Setting ENV{AUTOBUILD_PLATFORM} to cached variable ${AUTOBUILD_PLATFORM_ENV}" ) +else() + set( AUTOBUILD_PLATFORM_ENV "$ENV{AUTOBUILD_PLATFORM}" CACHE STRING "Save environment AUTOBUILD_PLATFORM" FORCE ) +endif () +# Switches set here and in 00-Common.cmake must agree with +# https://bitbucket.org/lindenlab/viewer-build-variables/src/tip/variables +# Reading $LL_BUILD is an attempt to directly use those switches. +if ("$ENV{LL_BUILD_RELEASE}" STREQUAL "" AND "${LL_BUILD_RELEASE_ENV}" STREQUAL "" ) + message(FATAL_ERROR "Environment variable LL_BUILD_RELEASE must be set") +elseif("$ENV{LL_BUILD_RELEASE}" STREQUAL "") + set( ENV{LL_BUILD_RELEASE} "${LL_BUILD_RELEASE_ENV}" ) + message( "Setting ENV{LL_BUILD_RELEASE} to cached variable ${LL_BUILD_RELEASE_ENV}" ) +else() + set( LL_BUILD_RELEASE_ENV "$ENV{LL_BUILD_RELEASE}" CACHE STRING "Save environment RELEASE" FORCE ) +endif () + +if ("$ENV{LL_BUILD_RELWITHDEBINFO}" STREQUAL "" AND "${LL_BUILD_RELWITHDEBINFO_ENV}" STREQUAL "" ) + message(FATAL_ERROR "Environment variable LL_BUILD_RELWITHDEBINFO must be set") +elseif("$ENV{LL_BUILD_RELWITHDEBINFO}" STREQUAL "") + set( ENV{LL_BUILD_RELWITHDEBINFO} "${LL_BUILD_RELWITHDEBINFO_ENV}" ) + message( "Setting ENV{LL_BUILD_RELWITHDEBINFO} to cached variable ${LL_BUILD_RELWITHDEBINFO_ENV}" ) +else() + set( LL_BUILD_RELWITHDEBINFO_ENV "$ENV{LL_BUILD_RELWITHDEBINFO}" CACHE STRING "Save environment RELWITHDEBINFO" FORCE ) +endif () + +# Relative and absolute paths to subtrees. if(NOT DEFINED COMMON_CMAKE_DIR) set(COMMON_CMAKE_DIR "${CMAKE_SOURCE_DIR}/cmake") endif(NOT DEFINED COMMON_CMAKE_DIR) @@ -67,7 +97,7 @@ set(TEMPLATE_VERIFIER_MASTER_URL "https://github.com/secondlife/master-message-t if (NOT CMAKE_BUILD_TYPE) set(CMAKE_BUILD_TYPE RelWithDebInfo CACHE STRING - "Build type. One of: Debug Release RelWithDebInfo" FORCE) + "Build type. One of: Release RelWithDebInfo" FORCE) endif (NOT CMAKE_BUILD_TYPE) # If someone has specified an address size, use that to determine the @@ -127,16 +157,12 @@ if (${CMAKE_SYSTEM_NAME} MATCHES "Linux") set(CMAKE_SYSTEM_LIBRARY_PATH /usr/lib/${DPKG_ARCH} /usr/local/lib/${DPKG_ARCH} ${CMAKE_SYSTEM_LIBRARY_PATH}) endif (DPKG_RESULT EQUAL 0) - include(ConfigurePkgConfig) - - if (INSTALL_PROPRIETARY) - # Only turn on headless if we can find osmesa libraries. - include(FindPkgConfig) - #pkg_check_modules(OSMESA osmesa) - #if (OSMESA_FOUND) - # set(BUILD_HEADLESS ON CACHE BOOL "Build headless libraries.") - #endif (OSMESA_FOUND) - endif (INSTALL_PROPRIETARY) + # Only turn on headless if we can find osmesa libraries. + find_package(PkgConfig) + pkg_check_modules(OSMESA IMPORTED_TARGET GLOBAL osmesa) + if (OSMESA_FOUND) + set(BUILD_HEADLESS ON CACHE BOOL "Build headless libraries.") + endif (OSMESA_FOUND) endif (${CMAKE_SYSTEM_NAME} MATCHES "Linux") diff --git a/indra/cmake/ViewerMiscLibs.cmake b/indra/cmake/ViewerMiscLibs.cmake index cae68fbc11..23fd477ba8 100644 --- a/indra/cmake/ViewerMiscLibs.cmake +++ b/indra/cmake/ViewerMiscLibs.cmake @@ -5,11 +5,8 @@ if (LINUX) #use_prebuilt_binary(libuuid) add_library( ll::fontconfig INTERFACE IMPORTED ) - if( NOT USE_CONAN ) - use_prebuilt_binary(fontconfig) - else() - target_link_libraries( ll::fontconfig INTERFACE CONAN_PKG::fontconfig ) - endif() + find_package(Fontconfig REQUIRED) + target_link_libraries( ll::fontconfig INTERFACE Fontconfig::Fontconfig ) endif (LINUX) if( NOT USE_CONAN ) diff --git a/indra/cmake/ZLIBNG.cmake b/indra/cmake/ZLIBNG.cmake index a6d67489e7..9f8f12d973 100644 --- a/indra/cmake/ZLIBNG.cmake +++ b/indra/cmake/ZLIBNG.cmake @@ -1,6 +1,7 @@ # -*- cmake -*- include(Prebuilt) +include(Linking) include_guard() add_library( ll::zlib-ng INTERFACE IMPORTED ) diff --git a/indra/cmake/bugsplat.cmake b/indra/cmake/bugsplat.cmake index 509981d72c..8916cb282c 100644 --- a/indra/cmake/bugsplat.cmake +++ b/indra/cmake/bugsplat.cmake @@ -1,18 +1,19 @@ -if (INSTALL_PROPRIETARY) +if (INSTALL_PROPRIETARY AND NOT LINUX) # Note that viewer_manifest.py makes decision based on BUGSPLAT_DB and not USE_BUGSPLAT if (BUGSPLAT_DB) set(USE_BUGSPLAT ON CACHE BOOL "Use the BugSplat crash reporting system") else (BUGSPLAT_DB) set(USE_BUGSPLAT OFF CACHE BOOL "Use the BugSplat crash reporting system") endif (BUGSPLAT_DB) -else (INSTALL_PROPRIETARY) +else () set(USE_BUGSPLAT OFF CACHE BOOL "Use the BugSplat crash reporting system") -endif (INSTALL_PROPRIETARY) + set(BUGSPLAT_DB "" CACHE STRING "BugSplat crash database name") +endif () include_guard() add_library( ll::bugsplat INTERFACE IMPORTED ) -if (USE_BUGSPLAT) +if (USE_BUGSPLAT AND NOT LINUX) include(Prebuilt) use_prebuilt_binary(bugsplat) if (WINDOWS) @@ -36,6 +37,7 @@ if (USE_BUGSPLAT) set_property( TARGET ll::bugsplat APPEND PROPERTY INTERFACE_COMPILE_DEFINITIONS LL_BUGSPLAT) else() - set(BUGSPLAT_DB "" CACHE STRING "BugSplat crash database name") -endif (USE_BUGSPLAT) + set(USE_BUGSPLAT OFF CACHE BOOL "Use the BugSplat crash reporting system" FORCE) + set(BUGSPLAT_DB "" CACHE STRING "BugSplat crash database name" FORCE) +endif () diff --git a/indra/llappearance/CMakeLists.txt b/indra/llappearance/CMakeLists.txt index 6744c8d8a4..40a1036597 100644 --- a/indra/llappearance/CMakeLists.txt +++ b/indra/llappearance/CMakeLists.txt @@ -28,7 +28,7 @@ set(llappearance_SOURCE_FILES llviewervisualparam.cpp llavatarappearancedefines.cpp ) - + set(llappearance_HEADER_FILES CMakeLists.txt @@ -77,6 +77,7 @@ if (BUILD_HEADLESS) llcharacter llinventory llimage + llrenderheadless llfilesystem llmath llxml diff --git a/indra/llrender/CMakeLists.txt b/indra/llrender/CMakeLists.txt index 26a8ff070f..d0ae2d6b93 100644 --- a/indra/llrender/CMakeLists.txt +++ b/indra/llrender/CMakeLists.txt @@ -74,18 +74,17 @@ if (BUILD_HEADLESS) add_library (llrenderheadless ${llrender_SOURCE_FILES} ) - - set_property(TARGET llrenderheadless - PROPERTY COMPILE_DEFINITIONS LL_MESA=1 LL_MESA_HEADLESS=1 - ) + target_include_directories( llrenderheadless INTERFACE ${CMAKE_CURRENT_SOURCE_DIR}) target_link_libraries(llrenderheadless llcommon llimage llmath - llrender llxml llfilesystem + llwindowheadless + ll::freetype + OpenGL::GL ) endif (BUILD_HEADLESS) @@ -103,6 +102,5 @@ target_link_libraries(llrender llwindow ll::freetype OpenGL::GL - OpenGL::GLU ) diff --git a/indra/media_plugins/CMakeLists.txt b/indra/media_plugins/CMakeLists.txt index fe8fee5e7e..600db532d2 100644 --- a/indra/media_plugins/CMakeLists.txt +++ b/indra/media_plugins/CMakeLists.txt @@ -1,20 +1,10 @@ # -*- cmake -*- add_subdirectory(base) +add_subdirectory(cef) +add_subdirectory(libvlc) +add_subdirectory(example) if (LINUX) add_subdirectory(gstreamer10) - add_subdirectory(example) 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/newview/CMakeLists.txt b/indra/newview/CMakeLists.txt index 19b8ee3999..d580114099 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) if (USE_DISCORD) include(Discord) @@ -524,6 +523,7 @@ set(viewer_SOURCE_FILES llpathfindingobjectlist.cpp llpathfindingpathtool.cpp llpbrterrainfeatures.cpp + llperfstats.cpp llpersistentnotificationstorage.cpp llphysicsmotion.cpp llphysicsshapebuilderutil.cpp @@ -1185,6 +1185,7 @@ set(viewer_HEADER_FILES llpathfindingobject.h llpathfindingobjectlist.h llpathfindingpathtool.h + llperfstats.h llpbrterrainfeatures.h llpersistentnotificationstorage.h llphysicsmotion.h @@ -1414,9 +1415,6 @@ set(viewer_HEADER_FILES VorbisFramework.h ) - list(APPEND viewer_SOURCE_FILES llperfstats.cpp) - list(APPEND viewer_HEADER_FILES llperfstats.h) - source_group("CMake Rules" FILES ViewerInstall.cmake) #build_data.json creation moved to viewer_manifest.py MAINT-6413 @@ -1489,7 +1487,6 @@ if (LINUX) PROPERTIES COMPILE_DEFINITIONS "${VIEWER_CHANNEL_VERSION_DEFINES}" ) - LIST(APPEND viewer_SOURCE_FILES llappviewerlinux_api_dbus.cpp) SET(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -Wl,--as-needed") endif (LINUX) @@ -1678,6 +1675,7 @@ set(viewer_APPSETTINGS_FILES packages-info.txt featuretable.txt featuretable_mac.txt + featuretable_linux.txt ) source_group("App Settings" FILES ${viewer_APPSETTINGS_FILES}) @@ -1701,6 +1699,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) @@ -1975,11 +1982,13 @@ elseif (DARWIN) target_link_libraries(${VIEWER_BINARY_NAME} llphysicsextensionsos) endif() else (WINDOWS) - # Linux - set_target_properties(${VIEWER_BINARY_NAME} - PROPERTIES - LINK_FLAGS_RELEASE "${LINK_FLAGS_RELEASE} -Wl,--Map=${VIEWER_BINARY_NAME}.MAP" - ) + if (HAVOK OR HAVOK_TPV) + # Linux + set_target_properties(${VIEWER_BINARY_NAME} + PROPERTIES + LINK_FLAGS_RELEASE "${LINK_FLAGS_RELEASE} -no-pie -Wl,--Map=${VIEWER_BINARY_NAME}.MAP" + ) + endif () endif (WINDOWS) # *NOTE: - this list is very sensitive to ordering, test carefully on all @@ -2086,8 +2095,11 @@ if (LINUX) set(COPY_INPUT_DEPENDENCIES ${VIEWER_BINARY_NAME} SLPlugin - #media_plugin_gstreamer010 - llcommon + media_plugin_cef + media_plugin_gstreamer10 + media_plugin_libvlc + media_plugin_example + llwebrtc ) #if (NOT USE_BUGSPLAT) diff --git a/indra/newview/llappviewer.cpp b/indra/newview/llappviewer.cpp index b63e7c66b5..0d2491609b 100644 --- a/indra/newview/llappviewer.cpp +++ b/indra/newview/llappviewer.cpp @@ -263,10 +263,6 @@ using namespace LL; // define a self-registering event API object #include "llappviewerlistener.h" -#if LL_LINUX && LL_GTK -#include "glib.h" -#endif // (LL_LINUX) && LL_GTK - #ifdef LL_DISCORD #define DISCORDPP_IMPLEMENTATION #include diff --git a/indra/newview/llappviewerlinux.cpp b/indra/newview/llappviewerlinux.cpp index 89d19d180b..9366c6f46e 100644 --- a/indra/newview/llappviewerlinux.cpp +++ b/indra/newview/llappviewerlinux.cpp @@ -34,23 +34,54 @@ #include "llurldispatcher.h" // SLURL from other app instance #include "llviewernetwork.h" #include "llviewercontrol.h" -#include "llwindowsdl.h" #include "llmd5.h" #include "llfindlocale.h" #include +#ifdef LL_GLIB +#include +#endif +#include -#if LL_DBUS_ENABLED -# include "llappviewerlinux_api_dbus.h" - -// regrettable hacks to give us better runtime compatibility with older systems inside llappviewerlinux_api.h: -#define llg_return_if_fail(COND) do{if (!(COND)) return;}while(0) -#undef g_return_if_fail -#define g_return_if_fail(COND) llg_return_if_fail(COND) -// The generated API -# include "llappviewerlinux_api.h" +#if (__GLIBC__*1000 + __GLIBC_MINOR__) >= 2034 +extern "C" +{ + int __res_nquery(res_state statep, + const char *dname, int qclass, int type, + unsigned char *answer, int anslen) + { + return res_nquery( statep, dname, qclass, type, answer, anslen ); + } + + int __dn_expand(const unsigned char *msg, + const unsigned char *eomorig, + const unsigned char *comp_dn, char *exp_dn, + int length) + { + return dn_expand( msg,eomorig,comp_dn,exp_dn,length); + } +} #endif +#define VIEWERAPI_SERVICE "com.secondlife.ViewerAppAPIService" +#define VIEWERAPI_PATH "/com/secondlife/ViewerAppAPI" +#define VIEWERAPI_INTERFACE "com.secondlife.ViewerAppAPI" + +static const char * DBUS_SERVER = "\n" + " \n" + " \n" + " \n" + " \n" + " \n" + " \n" + " \n" + ""; + +typedef struct +{ + GObject parent; +} ViewerAppAPI; + namespace { int gArgC = 0; @@ -86,6 +117,8 @@ int main( int argc, char **argv ) // install unexpected exception handler gOldTerminateHandler = std::set_terminate(exceptionTerminateHandler); + unsetenv( "LD_PRELOAD" ); // Get rid of any preloading, we do not want this to happen during startup of plugins. + bool ok = viewer_app_ptr->init(); if(!ok) { @@ -93,7 +126,7 @@ int main( int argc, char **argv ) return -1; } - // Run the application main loop + // Run the application main loop while (! viewer_app_ptr->frame()) {} @@ -148,7 +181,7 @@ bool LLAppViewerLinux::restoreErrorTrap() } ///////////////////////////////////////// -#if LL_DBUS_ENABLED +#if LL_GLIB typedef struct { @@ -158,101 +191,77 @@ typedef struct static void viewerappapi_init(ViewerAppAPI *server); static void viewerappapi_class_init(ViewerAppAPIClass *klass); -/// - -// regrettable hacks to give us better runtime compatibility with older systems in general -static GType llg_type_register_static_simple_ONCE(GType parent_type, - const gchar *type_name, - guint class_size, - GClassInitFunc class_init, - guint instance_size, - GInstanceInitFunc instance_init, - GTypeFlags flags) -{ - static GTypeInfo type_info; - memset(&type_info, 0, sizeof(type_info)); - - type_info.class_size = class_size; - type_info.class_init = class_init; - type_info.instance_size = instance_size; - type_info.instance_init = instance_init; - - return g_type_register_static(parent_type, type_name, &type_info, flags); -} -#define llg_intern_static_string(S) (S) -#define g_intern_static_string(S) llg_intern_static_string(S) -#define g_type_register_static_simple(parent_type, type_name, class_size, class_init, instance_size, instance_init, flags) llg_type_register_static_simple_ONCE(parent_type, type_name, class_size, class_init, instance_size, instance_init, flags) - G_DEFINE_TYPE(ViewerAppAPI, viewerappapi, G_TYPE_OBJECT); void viewerappapi_class_init(ViewerAppAPIClass *klass) { } -static bool dbus_server_init = false; - -void viewerappapi_init(ViewerAppAPI *server) +static void dispatchSLURL(gchar const *slurl) { - // Connect to the default DBUS, register our service/API. - - if (!dbus_server_init) - { - GError *error = NULL; - - server->connection = lldbus_g_bus_get(DBUS_BUS_SESSION, &error); - if (server->connection) - { - lldbus_g_object_type_install_info(viewerappapi_get_type(), &dbus_glib_viewerapp_object_info); + LL_INFOS() << "Was asked to go to slurl: " << slurl << LL_ENDL; - lldbus_g_connection_register_g_object(server->connection, VIEWERAPI_PATH, G_OBJECT(server)); + std::string url = slurl; + LLMediaCtrl* web = NULL; + const bool trusted_browser = false; + LLURLDispatcher::dispatch(url, "", web, trusted_browser); +} - DBusGProxy *serverproxy = lldbus_g_proxy_new_for_name(server->connection, DBUS_SERVICE_DBUS, DBUS_PATH_DBUS, DBUS_INTERFACE_DBUS); +static void DoMethodeCall (GDBusConnection *connection, + const gchar *sender, + const gchar *object_path, + const gchar *interface_name, + const gchar *method_name, + GVariant *parameters, + GDBusMethodInvocation *invocation, + gpointer user_data) +{ + LL_INFOS() << "DBUS message " << method_name << " from: " << sender << " interface: " << interface_name << LL_ENDL; + const gchar *slurl; - guint request_name_ret_unused; - // akin to org_freedesktop_DBus_request_name - if (lldbus_g_proxy_call(serverproxy, "RequestName", &error, G_TYPE_STRING, VIEWERAPI_SERVICE, G_TYPE_UINT, 0, G_TYPE_INVALID, G_TYPE_UINT, &request_name_ret_unused, G_TYPE_INVALID)) - { - // total success. - dbus_server_init = true; - } - else - { - LL_WARNS() << "Unable to register service name: " << error->message << LL_ENDL; - } + g_variant_get (parameters, "(&s)", &slurl); + dispatchSLURL(slurl); +} - g_object_unref(serverproxy); - } - else +GDBusNodeInfo *gBusNodeInfo = nullptr; +static const GDBusInterfaceVTable interface_vtable = { - g_warning("Unable to connect to dbus: %s", error->message); - } - - if (error) - g_error_free(error); - } + DoMethodeCall + }; +static void busAcquired(GDBusConnection *connection, const gchar *name, gpointer user_data) +{ + auto id = g_dbus_connection_register_object(connection, + VIEWERAPI_PATH, + gBusNodeInfo->interfaces[0], + &interface_vtable, + NULL, /* user_data */ + NULL, /* user_data_free_func */ + NULL); /* GError** */ + g_assert (id > 0); } -gboolean viewer_app_api_GoSLURL(ViewerAppAPI *obj, gchar *slurl, gboolean **success_rtn, GError **error) +static void nameAcquired(GDBusConnection *connection, const gchar *name, gpointer user_data) { - bool success = false; - - LL_INFOS() << "Was asked to go to slurl: " << slurl << LL_ENDL; +} - std::string url = slurl; - LLMediaCtrl* web = NULL; - const bool trusted_browser = false; - if (LLURLDispatcher::dispatch(url, "", web, trusted_browser)) - { - // bring window to foreground, as it has just been "launched" from a URL - // todo: hmm, how to get there from here? - //xxx->mWindow->bringToFront(); - success = true; - } +static void nameLost(GDBusConnection *connection, const gchar *name, gpointer user_data) +{ - *success_rtn = g_new (gboolean, 1); - (*success_rtn)[0] = (gboolean)success; +} +void viewerappapi_init(ViewerAppAPI *server) +{ + gBusNodeInfo = g_dbus_node_info_new_for_xml (DBUS_SERVER, NULL); + g_assert (gBusNodeInfo != NULL); + + g_bus_own_name(G_BUS_TYPE_SESSION, + VIEWERAPI_SERVICE, + G_BUS_NAME_OWNER_FLAGS_NONE, + busAcquired, + nameAcquired, + nameLost, + NULL, + NULL); - return TRUE; // the invokation succeeded, even if the actual dispatch didn't. } /// @@ -260,13 +269,6 @@ gboolean viewer_app_api_GoSLURL(ViewerAppAPI *obj, gchar *slurl, gboolean **succ //virtual bool LLAppViewerLinux::initSLURLHandler() { - if (!grab_dbus_syms(DBUSGLIB_DYLIB_DEFAULT_NAME)) - { - return false; // failed - } - - g_type_init(); - //ViewerAppAPI *api_server = (ViewerAppAPI*) g_object_new(viewerappapi_get_type(), NULL); @@ -276,49 +278,49 @@ bool LLAppViewerLinux::initSLURLHandler() //virtual bool LLAppViewerLinux::sendURLToOtherInstance(const std::string& url) { - if (!grab_dbus_syms(DBUSGLIB_DYLIB_DEFAULT_NAME)) + auto *pBus = g_bus_get_sync(G_BUS_TYPE_SESSION, NULL, nullptr); + + if( !pBus ) { - return false; // failed + LL_WARNS() << "Getting dbus failed." << LL_ENDL; + return false; } - bool success = false; - DBusGConnection *bus; - GError *error = NULL; - - g_type_init(); + auto pProxy = g_dbus_proxy_new_sync(pBus, G_DBUS_PROXY_FLAGS_NONE, nullptr, + VIEWERAPI_SERVICE, VIEWERAPI_PATH, + VIEWERAPI_INTERFACE, nullptr, nullptr); - bus = lldbus_g_bus_get (DBUS_BUS_SESSION, &error); - if (bus) + if( !pProxy ) { - gboolean rtn = FALSE; - DBusGProxy *remote_object = - lldbus_g_proxy_new_for_name(bus, VIEWERAPI_SERVICE, VIEWERAPI_PATH, VIEWERAPI_INTERFACE); - - if (lldbus_g_proxy_call(remote_object, "GoSLURL", &error, - G_TYPE_STRING, url.c_str(), G_TYPE_INVALID, - G_TYPE_BOOLEAN, &rtn, G_TYPE_INVALID)) - { - success = rtn; - } - else - { - LL_INFOS() << "Call-out to other instance failed (perhaps not running): " << error->message << LL_ENDL; - } - - g_object_unref(G_OBJECT(remote_object)); + LL_WARNS() << "Cannot create new dbus proxy." << LL_ENDL; + g_object_unref( pBus ); + return false; } - else + + auto *pArgs = g_variant_new( "(s)", url.c_str() ); + if( !pArgs ) { - LL_WARNS() << "Couldn't connect to session bus: " << error->message << LL_ENDL; + LL_WARNS() << "Cannot create new variant." << LL_ENDL; + g_object_unref( pBus ); + return false; } - if (error) - g_error_free(error); + auto pRes = g_dbus_proxy_call_sync(pProxy, + "GoSLURL", + pArgs, + G_DBUS_CALL_FLAGS_NONE, + -1, nullptr, nullptr); - return success; + + + if( pRes ) + g_variant_unref( pRes ); + g_object_unref( pProxy ); + g_object_unref( pBus ); + return true; } -#else // LL_DBUS_ENABLED +#else // LL_GLIB bool LLAppViewerLinux::initSLURLHandler() { return false; // not implemented without dbus @@ -327,7 +329,7 @@ bool LLAppViewerLinux::sendURLToOtherInstance(const std::string& url) { return false; // not implemented without dbus } -#endif // LL_DBUS_ENABLED +#endif // LL_GLIB void LLAppViewerLinux::initCrashReporting(bool reportFreeze) { @@ -343,15 +345,18 @@ void LLAppViewerLinux::initCrashReporting(bool reportFreeze) pid_str << LLApp::getPid(); std::string logdir = gDirUtilp->getExpandedFilename(LL_PATH_DUMP, ""); std::string appname = gDirUtilp->getExecutableFilename(); + std::string grid{ LLGridManager::getInstance()->getGridId() }; + std::string title{ LLAppViewer::instance()->getSecondLifeTitle() }; + std::string pidstr{ pid_str.str() }; // launch the actual crash logger const char * cmdargv[] = {cmd.c_str(), "-user", - (char*)LLGridManager::getInstance()->getGridId().c_str(), + grid.c_str(), "-name", - LLAppViewer::instance()->getSecondLifeTitle().c_str(), + title.c_str(), "-pid", - pid_str.str().c_str(), + pidstr.c_str(), "-dumpdir", logdir.c_str(), "-procname", diff --git a/indra/newview/llappviewerlinux.h b/indra/newview/llappviewerlinux.h index dde223878d..460ca721f1 100644 --- a/indra/newview/llappviewerlinux.h +++ b/indra/newview/llappviewerlinux.h @@ -27,17 +27,6 @@ #ifndef LL_LLAPPVIEWERLINUX_H #define LL_LLAPPVIEWERLINUX_H -extern "C" { -# include -} - -#if LL_DBUS_ENABLED -extern "C" { -# include -# include -} -#endif - #ifndef LL_LLAPPVIEWER_H #include "llappviewer.h" #endif @@ -70,21 +59,4 @@ protected: virtual bool sendURLToOtherInstance(const std::string& url); }; -#if LL_DBUS_ENABLED -typedef struct -{ - GObject parent; - DBusGConnection *connection; -} ViewerAppAPI; - -extern "C" { - gboolean viewer_app_api_GoSLURL(ViewerAppAPI *obj, gchar *slurl, gboolean **success_rtn, GError **error); -} - -#define VIEWERAPI_SERVICE "com.secondlife.ViewerAppAPIService" -#define VIEWERAPI_PATH "/com/secondlife/ViewerAppAPI" -#define VIEWERAPI_INTERFACE "com.secondlife.ViewerAppAPI" - -#endif // LL_DBUS_ENABLED - #endif // LL_LLAPPVIEWERLINUX_H diff --git a/indra/newview/llappviewerlinux_api.h b/indra/newview/llappviewerlinux_api.h deleted file mode 100644 index 3d1324dd19..0000000000 --- a/indra/newview/llappviewerlinux_api.h +++ /dev/null @@ -1,143 +0,0 @@ -/* Generated by dbus-binding-tool; do not edit! */ -/** - * $LicenseInfo:firstyear=2008&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$ - */ - -#ifndef __dbus_glib_marshal_viewerapp_MARSHAL_H__ -#define __dbus_glib_marshal_viewerapp_MARSHAL_H__ - -#include - -G_BEGIN_DECLS - -#ifdef G_ENABLE_DEBUG -#define g_marshal_value_peek_boolean(v) g_value_get_boolean (v) -#define g_marshal_value_peek_char(v) g_value_get_char (v) -#define g_marshal_value_peek_uchar(v) g_value_get_uchar (v) -#define g_marshal_value_peek_int(v) g_value_get_int (v) -#define g_marshal_value_peek_uint(v) g_value_get_uint (v) -#define g_marshal_value_peek_long(v) g_value_get_long (v) -#define g_marshal_value_peek_ulong(v) g_value_get_ulong (v) -#define g_marshal_value_peek_int64(v) g_value_get_int64 (v) -#define g_marshal_value_peek_uint64(v) g_value_get_uint64 (v) -#define g_marshal_value_peek_enum(v) g_value_get_enum (v) -#define g_marshal_value_peek_flags(v) g_value_get_flags (v) -#define g_marshal_value_peek_float(v) g_value_get_float (v) -#define g_marshal_value_peek_double(v) g_value_get_double (v) -#define g_marshal_value_peek_string(v) (char*) g_value_get_string (v) -#define g_marshal_value_peek_param(v) g_value_get_param (v) -#define g_marshal_value_peek_boxed(v) g_value_get_boxed (v) -#define g_marshal_value_peek_pointer(v) g_value_get_pointer (v) -#define g_marshal_value_peek_object(v) g_value_get_object (v) -#else /* !G_ENABLE_DEBUG */ -/* WARNING: This code accesses GValues directly, which is UNSUPPORTED API. - * Do not access GValues directly in your code. Instead, use the - * g_value_get_*() functions - */ -#define g_marshal_value_peek_boolean(v) (v)->data[0].v_int -#define g_marshal_value_peek_char(v) (v)->data[0].v_int -#define g_marshal_value_peek_uchar(v) (v)->data[0].v_uint -#define g_marshal_value_peek_int(v) (v)->data[0].v_int -#define g_marshal_value_peek_uint(v) (v)->data[0].v_uint -#define g_marshal_value_peek_long(v) (v)->data[0].v_long -#define g_marshal_value_peek_ulong(v) (v)->data[0].v_ulong -#define g_marshal_value_peek_int64(v) (v)->data[0].v_int64 -#define g_marshal_value_peek_uint64(v) (v)->data[0].v_uint64 -#define g_marshal_value_peek_enum(v) (v)->data[0].v_long -#define g_marshal_value_peek_flags(v) (v)->data[0].v_ulong -#define g_marshal_value_peek_float(v) (v)->data[0].v_float -#define g_marshal_value_peek_double(v) (v)->data[0].v_double -#define g_marshal_value_peek_string(v) (v)->data[0].v_pointer -#define g_marshal_value_peek_param(v) (v)->data[0].v_pointer -#define g_marshal_value_peek_boxed(v) (v)->data[0].v_pointer -#define g_marshal_value_peek_pointer(v) (v)->data[0].v_pointer -#define g_marshal_value_peek_object(v) (v)->data[0].v_pointer -#endif /* !G_ENABLE_DEBUG */ - - -/* BOOLEAN:STRING,POINTER,POINTER (/tmp/dbus-binding-tool-c-marshallers.5XXD8T:1) */ -extern void dbus_glib_marshal_viewerapp_BOOLEAN__STRING_POINTER_POINTER (GClosure *closure, - GValue *return_value, - guint n_param_values, - const GValue *param_values, - gpointer invocation_hint, - gpointer marshal_data); -void -dbus_glib_marshal_viewerapp_BOOLEAN__STRING_POINTER_POINTER (GClosure *closure, - GValue *return_value, - guint n_param_values, - const GValue *param_values, - gpointer invocation_hint, - gpointer marshal_data) -{ - typedef gboolean (*GMarshalFunc_BOOLEAN__STRING_POINTER_POINTER) (gpointer data1, - gpointer arg_1, - gpointer arg_2, - gpointer arg_3, - gpointer data2); - register GMarshalFunc_BOOLEAN__STRING_POINTER_POINTER callback; - register GCClosure *cc = (GCClosure*) closure; - register gpointer data1, data2; - gboolean v_return; - - g_return_if_fail (return_value != NULL); - g_return_if_fail (n_param_values == 4); - - if (G_CCLOSURE_SWAP_DATA (closure)) - { - data1 = closure->data; - data2 = g_value_peek_pointer (param_values + 0); - } - else - { - data1 = g_value_peek_pointer (param_values + 0); - data2 = closure->data; - } - callback = (GMarshalFunc_BOOLEAN__STRING_POINTER_POINTER) (marshal_data ? marshal_data : cc->callback); - - v_return = callback (data1, - g_marshal_value_peek_string (param_values + 1), - g_marshal_value_peek_pointer (param_values + 2), - g_marshal_value_peek_pointer (param_values + 3), - data2); - - g_value_set_boolean (return_value, v_return); -} - -G_END_DECLS - -#endif /* __dbus_glib_marshal_viewerapp_MARSHAL_H__ */ - -#include -static const DBusGMethodInfo dbus_glib_viewerapp_methods[] = { - { (GCallback) viewer_app_api_GoSLURL, dbus_glib_marshal_viewerapp_BOOLEAN__STRING_POINTER_POINTER, 0 }, -}; - -const DBusGObjectInfo dbus_glib_viewerapp_object_info = { - 0, - dbus_glib_viewerapp_methods, - 1, -"com.secondlife.ViewerAppAPI\0GoSLURL\0S\0slurl\0I\0s\0success_ret\0O\0F\0N\0b\0\0\0", -"\0", -"\0" -}; - diff --git a/indra/newview/llappviewerlinux_api.xml b/indra/newview/llappviewerlinux_api.xml deleted file mode 100644 index fac35b7adc..0000000000 --- a/indra/newview/llappviewerlinux_api.xml +++ /dev/null @@ -1,14 +0,0 @@ - - - - - - - - - - - - - - diff --git a/indra/newview/llappviewerlinux_api_dbus.cpp b/indra/newview/llappviewerlinux_api_dbus.cpp deleted file mode 100644 index 9aed8a98d4..0000000000 --- a/indra/newview/llappviewerlinux_api_dbus.cpp +++ /dev/null @@ -1,126 +0,0 @@ -/** - * @file llappviewerlinux_api_dbus.cpp - * @brief dynamic DBus symbol-grabbing code - * - * $LicenseInfo:firstyear=2008&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$ - */ - -#if LL_DBUS_ENABLED - -#include "linden_common.h" - -extern "C" { -#include - -#include "apr_pools.h" -#include "apr_dso.h" -} - -#define DEBUGMSG(...) do { LL_DEBUGS() << llformat(__VA_ARGS__) << LL_ENDL; } while(0) -#define INFOMSG(...) do { LL_INFOS() << llformat(__VA_ARGS__) << LL_ENDL; } while(0) -#define WARNMSG(...) do { LL_WARNS() << llformat(__VA_ARGS__) << LL_ENDL; } while(0) - -#define LL_DBUS_SYM(REQUIRED, DBUSSYM, RTN, ...) RTN (*ll##DBUSSYM)(__VA_ARGS__) = NULL -#include "llappviewerlinux_api_dbus_syms_raw.inc" -#undef LL_DBUS_SYM - -static bool sSymsGrabbed = false; -static apr_pool_t *sSymDBUSDSOMemoryPool = NULL; -static apr_dso_handle_t *sSymDBUSDSOHandleG = NULL; - -bool grab_dbus_syms(std::string dbus_dso_name) -{ - if (sSymsGrabbed) - { - // already have grabbed good syms - return true; - } - - bool sym_error = false; - bool rtn = false; - apr_status_t rv; - apr_dso_handle_t *sSymDBUSDSOHandle = NULL; - -#define LL_DBUS_SYM(REQUIRED, DBUSSYM, RTN, ...) do{rv = apr_dso_sym((apr_dso_handle_sym_t*)&ll##DBUSSYM, sSymDBUSDSOHandle, #DBUSSYM); if (rv != APR_SUCCESS) {INFOMSG("Failed to grab symbol: %s", #DBUSSYM); if (REQUIRED) sym_error = true;} else DEBUGMSG("grabbed symbol: %s from %p", #DBUSSYM, (void*)ll##DBUSSYM);}while(0) - - //attempt to load the shared library - apr_pool_create(&sSymDBUSDSOMemoryPool, NULL); - - if ( APR_SUCCESS == (rv = apr_dso_load(&sSymDBUSDSOHandle, - dbus_dso_name.c_str(), - sSymDBUSDSOMemoryPool) )) - { - INFOMSG("Found DSO: %s", dbus_dso_name.c_str()); - -#include "llappviewerlinux_api_dbus_syms_raw.inc" - - if ( sSymDBUSDSOHandle ) - { - sSymDBUSDSOHandleG = sSymDBUSDSOHandle; - sSymDBUSDSOHandle = NULL; - } - - rtn = !sym_error; - } - else - { - INFOMSG("Couldn't load DSO: %s", dbus_dso_name.c_str()); - rtn = false; // failure - } - - if (sym_error) - { - WARNMSG("Failed to find necessary symbols in DBUS-GLIB libraries."); - } -#undef LL_DBUS_SYM - - sSymsGrabbed = rtn; - return rtn; -} - - -void ungrab_dbus_syms() -{ - // should be safe to call regardless of whether we've - // actually grabbed syms. - - if ( sSymDBUSDSOHandleG ) - { - apr_dso_unload(sSymDBUSDSOHandleG); - sSymDBUSDSOHandleG = NULL; - } - - if ( sSymDBUSDSOMemoryPool ) - { - apr_pool_destroy(sSymDBUSDSOMemoryPool); - sSymDBUSDSOMemoryPool = NULL; - } - - // NULL-out all of the symbols we'd grabbed -#define LL_DBUS_SYM(REQUIRED, DBUSSYM, RTN, ...) do{ll##DBUSSYM = NULL;}while(0) -#include "llappviewerlinux_api_dbus_syms_raw.inc" -#undef LL_DBUS_SYM - - sSymsGrabbed = false; -} - -#endif // LL_DBUS_ENABLED diff --git a/indra/newview/llappviewerlinux_api_dbus.h b/indra/newview/llappviewerlinux_api_dbus.h deleted file mode 100644 index 2f4492bd7a..0000000000 --- a/indra/newview/llappviewerlinux_api_dbus.h +++ /dev/null @@ -1,44 +0,0 @@ -/** - * @file llappviewerlinux_api_dbus.h - * @brief DBus-glib symbol handling - * - * $LicenseInfo:firstyear=2008&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$ - */ - -#include "linden_common.h" - -#if LL_DBUS_ENABLED - -extern "C" { -#include -} - -#define DBUSGLIB_DYLIB_DEFAULT_NAME "libdbus-glib-1.so.2" - -bool grab_dbus_syms(std::string dbus_dso_name); -void ungrab_dbus_syms(); - -#define LL_DBUS_SYM(REQUIRED, DBUSSYM, RTN, ...) extern RTN (*ll##DBUSSYM)(__VA_ARGS__) -#include "llappviewerlinux_api_dbus_syms_raw.inc" -#undef LL_DBUS_SYM - -#endif // LL_DBUS_ENABLED diff --git a/indra/newview/llappviewerlinux_api_dbus_syms_raw.inc b/indra/newview/llappviewerlinux_api_dbus_syms_raw.inc deleted file mode 100644 index c0548e2fba..0000000000 --- a/indra/newview/llappviewerlinux_api_dbus_syms_raw.inc +++ /dev/null @@ -1,9 +0,0 @@ - -// required symbols to grab -LL_DBUS_SYM(true, dbus_g_bus_get, DBusGConnection*, DBusBusType, GError**); -LL_DBUS_SYM(true, dbus_g_proxy_new_for_name, DBusGProxy*, DBusGConnection*, const char *, const char*, const char*); -LL_DBUS_SYM(true, dbus_g_proxy_call, gboolean, DBusGProxy*, const char*, GError**, GType, ...); -LL_DBUS_SYM(true, dbus_g_object_type_install_info, void, GType, const DBusGObjectInfo*); -LL_DBUS_SYM(true, dbus_g_connection_register_g_object, void, DBusGConnection*, const char*, GObject*); - -// optional symbols to grab -- cgit v1.3 From 134a13960831938514e444c84da323da37b443c0 Mon Sep 17 00:00:00 2001 From: Rye Date: Mon, 27 Oct 2025 02:48:36 -0400 Subject: Introduce SDL3 based windowing backend support and dir picker Signed-off-by: Rye --- autobuild.xml | 65 +- indra/cmake/Copy3rdPartyLibs.cmake | 2 +- indra/llwindow/CMakeLists.txt | 97 +- indra/llwindow/llkeyboard.cpp | 18 +- indra/llwindow/llkeyboard.h | 26 +- indra/llwindow/llkeyboardheadless.cpp | 21 +- indra/llwindow/llkeyboardheadless.h | 16 +- indra/llwindow/llkeyboardmacosx.cpp | 13 +- indra/llwindow/llkeyboardmacosx.h | 16 +- indra/llwindow/llkeyboardsdl.cpp | 446 +++- indra/llwindow/llkeyboardsdl.h | 27 +- indra/llwindow/llkeyboardwin32.cpp | 4 +- indra/llwindow/llkeyboardwin32.h | 19 +- indra/llwindow/llmousehandler.cpp | 2 + indra/llwindow/llsdl.cpp | 146 ++ indra/llwindow/llsdl.h | 34 + indra/llwindow/llwindow.cpp | 52 +- indra/llwindow/llwindow.h | 5 +- indra/llwindow/llwindowheadless.h | 2 +- indra/llwindow/llwindowmesaheadless.h | 120 +- indra/llwindow/llwindowsdl.cpp | 2568 +++++++------------- indra/llwindow/llwindowsdl.h | 289 +-- indra/newview/llappviewer.cpp | 7 +- indra/newview/llappviewerlinux.cpp | 250 +- indra/newview/llappviewerlinux.h | 21 +- indra/newview/lldirpicker.cpp | 176 +- indra/newview/lldirpicker.h | 8 + .../llfloaterpreferencesgraphicsadvanced.cpp | 2 +- indra/newview/llviewerwindow.cpp | 5 - indra/newview/llviewerwindow.h | 1 - indra/newview/viewer_manifest.py | 69 +- 31 files changed, 2284 insertions(+), 2243 deletions(-) create mode 100644 indra/llwindow/llsdl.cpp create mode 100644 indra/llwindow/llsdl.h (limited to 'autobuild.xml') diff --git a/autobuild.xml b/autobuild.xml index bbd75d9e5a..78b235fabb 100644 --- a/autobuild.xml +++ b/autobuild.xml @@ -7,33 +7,65 @@ autobuild installables - SDL + SDL3 platforms + windows64 + + archive + + hash + 121b209bbf8ffb2f7f668a74de0e654f4be7339f + hash_algorithm + sha1 + url + https://github.com/secondlife/3p-sdl3/releases/download/v3.2.24-r1/SDL3-3.2.24-r1-windows64-18539840462.tar.zst + + name + windows64 + linux64 archive hash - 7ea2df03bfc35c06acf23dd9e734adac + 06226c54c57afd601707c0f5f7a2e0736ab1f326 + hash_algorithm + sha1 url - http://automated-builds-secondlife-com.s3.amazonaws.com/ct2/1103/2554/SDL-1.2.15-linux64-501092.tar.bz2 + https://github.com/secondlife/3p-sdl3/releases/download/v3.2.24-r1/SDL3-3.2.24-r1-linux64-18539840462.tar.zst name linux64 + darwin64 + + archive + + hash + aff68fb5655629c698e198af1581835267588f77 + hash_algorithm + sha1 + url + https://github.com/secondlife/3p-sdl3/releases/download/v3.2.24-r1/SDL3-3.2.24-r1-darwin64-18539840462.tar.zst + + name + darwin64 + license lgpl license_file - LICENSES/SDL.txt + LICENSES/SDL3.txt copyright - Copyright (C) 1997-2012 Sam Lantinga + Copyright (C) 1997-2022 Sam Lantinga (slouken@libsdl.org) version - 1.2.15 + 3.2.24-r1 + use_scm_version + true name - SDL + SDL3 description Simple DirectMedia Layer is a cross-platform multimedia library designed to provide low level access to audio, keyboard, mouse, joystick, 3D hardware via OpenGL, and 2D video framebuffer. @@ -1753,6 +1785,23 @@ Copyright (c) 2012, 2014, 2015, 2016 nghttp2 contributors open-libndofdev + platforms + + linux64 + + archive + + hash + 795d1e60f3e1e9092788214a6750e6506391cac5 + hash_algorithm + sha1 + url + https://github.com/secondlife/3p-open-libndofdev/releases/download/v1.14-r6/open_libndofdev-0.14.18543500856-linux64-18543500856.tar.zst + + name + linux64 + + license BSD license_file @@ -1760,7 +1809,7 @@ Copyright (c) 2012, 2014, 2015, 2016 nghttp2 contributors copyright Copyright (c) 2008, Jan Ciger (jan.ciger (at) gmail.com) version - 0.14.11968684513 + 0.14.18543500856 name open-libndofdev description diff --git a/indra/cmake/Copy3rdPartyLibs.cmake b/indra/cmake/Copy3rdPartyLibs.cmake index 3e89118a4e..9760dc653c 100644 --- a/indra/cmake/Copy3rdPartyLibs.cmake +++ b/indra/cmake/Copy3rdPartyLibs.cmake @@ -213,7 +213,7 @@ elseif(LINUX) list( APPEND release_files libSDL3.so libSDL3.so.0 - libSDL3.so.0.2.22 + libSDL3.so.0.2.24 ) endif() diff --git a/indra/llwindow/CMakeLists.txt b/indra/llwindow/CMakeLists.txt index 08b3df87ab..fe45df4021 100644 --- a/indra/llwindow/CMakeLists.txt +++ b/indra/llwindow/CMakeLists.txt @@ -12,12 +12,14 @@ project(llwindow) include(00-Common) include(DragDrop) +include(Linking) include(LLCommon) include(LLImage) include(LLWindow) include(UI) include(ViewerMiscLibs) include(GLM) +include(SDL3) set(llwindow_SOURCE_FILES llcursortypes.cpp @@ -58,34 +60,24 @@ set(llwindow_LINK_LIBRARIES ll::glm ll::glext ll::uilibraries - ll::SDL ) -# Libraries on which this library depends, needed for Linux builds -# Sort by high-level to low-level -if (LINUX) + +if (USE_SDL_WINDOW) list(APPEND viewer_SOURCE_FILES + llsdl.cpp llkeyboardsdl.cpp llwindowsdl.cpp ) list(APPEND viewer_HEADER_FILES + llsdl.h llkeyboardsdl.h llwindowsdl.h ) - if (BUILD_HEADLESS) - set(llwindowheadless_LINK_LIBRARIES - ${LLCOMMON_LIBRARIES} - ${LLIMAGE_LIBRARIES} - ${LLMATH_LIBRARIES} - ${LLRENDER_HEADLESS_LIBRARIES} - ${LLFILESYSTEM_LIBRARIES} - ${LLWINDOW_HEADLESS_LIBRARIES} - ${LLXML_LIBRARIES} - fontconfig # For FCInit and other FC* functions. - ) - endif (BUILD_HEADLESS) - -endif (LINUX) + list(APPEND llwindow_LINK_LIBRARIES + ll::SDL3 + ) +endif () if (DARWIN) list(APPEND llwindow_SOURCE_FILES @@ -133,32 +125,51 @@ 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 - llmousehandler.cpp - ) + llcursortypes.cpp + llkeyboard.cpp + llkeyboardheadless.cpp + llwindowheadless.cpp + llwindowcallbacks.cpp + llwindow.cpp + llwindowmesaheadless.cpp + llmousehandler.cpp + ) + set(llwindowheadless_HEADER_FILES - llwindowmesaheadless.h - llmousehandler.h - ) + llcursortypes.h + llkeyboard.h + llkeyboardheadless.h + llwindowheadless.h + llwindowcallbacks.h + llwindowmesaheadless.h + llmousehandler.h + ) + add_library (llwindowheadless - ${llwindow_SOURCE_FILES} ${llwindowheadless_SOURCE_FILES} + ${llwindowheadless_HEADER_FILES} ) - set_property(TARGET llwindowheadless - PROPERTY COMPILE_DEFINITIONS LL_MESA=1 LL_MESA_HEADLESS=1 - ) - target_link_libraries (llwindowheadless ${llwindowheadless_LINK_LIBRARIES} dl) + + target_compile_definitions( llwindowheadless PUBLIC LL_MESA=1 LL_MESA_HEADLESS=1 ) + + target_link_libraries (llwindowheadless + llcommon + llimage + llmath + llrenderheadless + llfilesystem + llxml + ll::glm + ll::glext + ll::zlib-ng + PkgConfig::OSMESA + fontconfig + dl + ) + target_include_directories(llwindowheadless INTERFACE ${CMAKE_CURRENT_SOURCE_DIR}) endif (BUILD_HEADLESS) if (llwindow_HEADER_FILES) @@ -172,14 +183,12 @@ endif (llwindow_HEADER_FILES) ${viewer_SOURCE_FILES} ) -if (SDL_FOUND) - set_property(TARGET llwindow - PROPERTY COMPILE_DEFINITIONS LL_SDL=1 - ) -endif (SDL_FOUND) +target_link_libraries (llwindow ${llwindow_LINK_LIBRARIES}) +target_include_directories(llwindow INTERFACE ${CMAKE_CURRENT_SOURCE_DIR}) - target_link_libraries (llwindow ${llwindow_LINK_LIBRARIES}) - target_include_directories(llwindow INTERFACE ${CMAKE_CURRENT_SOURCE_DIR}) +if (USE_SDL_WINDOW) + target_compile_definitions( llwindow PUBLIC LL_SDL_WINDOW=1 ) +endif() if (DARWIN) target_link_libraries(llwindow ${CARBON_LIBRARY}) diff --git a/indra/llwindow/llkeyboard.cpp b/indra/llwindow/llkeyboard.cpp index 33eebdadd1..761b4a1870 100644 --- a/indra/llwindow/llkeyboard.cpp +++ b/indra/llwindow/llkeyboard.cpp @@ -41,7 +41,6 @@ std::map LLKeyboard::sKeysToNames; std::map LLKeyboard::sNamesToKeys; LLKeyStringTranslatorFunc* LLKeyboard::mStringTranslator = NULL; // Used for l10n + PC/Mac/Linux accelerator labeling - // // Class Implementation // @@ -162,6 +161,7 @@ void LLKeyboard::resetKeyDownAndHandle() mCallbacks->handleTranslatedKeyUp(i, mask); } } + mCurTranslatedKey = KEY_NONE; } // BUG this has to be called when an OS dialog is shown, otherwise modifier key state @@ -195,12 +195,10 @@ void LLKeyboard::resetKeys() } -bool LLKeyboard::translateKey(const U16 os_key, KEY *out_key) +bool LLKeyboard::translateKey(const NATIVE_KEY_TYPE os_key, KEY *out_key) { - std::map::iterator iter; - // Only translate keys in the map, ignore all other keys for now - iter = mTranslateKeyMap.find(os_key); + auto iter = mTranslateKeyMap.find(os_key); if (iter == mTranslateKeyMap.end()) { //LL_WARNS() << "Unknown virtual key " << os_key << LL_ENDL; @@ -214,11 +212,9 @@ bool LLKeyboard::translateKey(const U16 os_key, KEY *out_key) } } - -U16 LLKeyboard::inverseTranslateKey(const KEY translated_key) +LLKeyboard::NATIVE_KEY_TYPE LLKeyboard::inverseTranslateKey(const KEY translated_key) { - std::map::iterator iter; - iter = mInvTranslateKeyMap.find(translated_key); + auto iter = mInvTranslateKeyMap.find(translated_key); if (iter == mInvTranslateKeyMap.end()) { return 0; @@ -230,7 +226,7 @@ U16 LLKeyboard::inverseTranslateKey(const KEY translated_key) } -bool LLKeyboard::handleTranslatedKeyDown(KEY translated_key, U32 translated_mask) +bool LLKeyboard::handleTranslatedKeyDown(KEY translated_key, MASK translated_mask) { bool handled = false; bool repeated = false; @@ -258,7 +254,7 @@ bool LLKeyboard::handleTranslatedKeyDown(KEY translated_key, U32 translated_mask } -bool LLKeyboard::handleTranslatedKeyUp(KEY translated_key, U32 translated_mask) +bool LLKeyboard::handleTranslatedKeyUp(KEY translated_key, MASK translated_mask) { bool handled = false; if( mKeyLevel[translated_key] ) diff --git a/indra/llwindow/llkeyboard.h b/indra/llwindow/llkeyboard.h index 713eb7aec2..b4ab562cd5 100644 --- a/indra/llwindow/llkeyboard.h +++ b/indra/llwindow/llkeyboard.h @@ -55,6 +55,13 @@ class LLWindowCallbacks; class LLKeyboard { public: +#ifdef LL_SDL_WINDOW + // linux relies on SDL2 which uses U32 for its native key type + typedef U32 NATIVE_KEY_TYPE; +#else + // on non-linux platforms we can get by with a smaller native key type + typedef U16 NATIVE_KEY_TYPE; +#endif LLKeyboard(); virtual ~LLKeyboard(); @@ -67,16 +74,15 @@ public: bool getKeyDown(const KEY key) { return mKeyLevel[key]; } bool getKeyRepeated(const KEY key) { return mKeyRepeated[key]; } - bool translateKey(const U16 os_key, KEY *translated_key); - U16 inverseTranslateKey(const KEY translated_key); - bool handleTranslatedKeyUp(KEY translated_key, U32 translated_mask); // Translated into "Linden" keycodes - bool handleTranslatedKeyDown(KEY translated_key, U32 translated_mask); // Translated into "Linden" keycodes - + bool translateKey(const NATIVE_KEY_TYPE os_key, KEY *translated_key); + NATIVE_KEY_TYPE inverseTranslateKey(const KEY translated_key); + bool handleTranslatedKeyUp(KEY translated_key, MASK translated_mask); // Translated into "Linden" keycodes + bool handleTranslatedKeyDown(KEY translated_key, MASK translated_mask); // Translated into "Linden" keycodes - virtual bool handleKeyUp(const U16 key, MASK mask) = 0; - virtual bool handleKeyDown(const U16 key, MASK mask) = 0; + virtual bool handleKeyUp(const NATIVE_KEY_TYPE key, MASK mask) = 0; + virtual bool handleKeyDown(const NATIVE_KEY_TYPE key, MASK mask) = 0; -#ifdef LL_DARWIN +#if LL_DARWIN && !LL_SDL_WINDOW // We only actually use this for macOS. virtual void handleModifier(MASK mask) = 0; #endif // LL_DARWIN @@ -111,8 +117,8 @@ protected: void addKeyName(KEY key, const std::string& name); protected: - std::map mTranslateKeyMap; // Map of translations from OS keys to Linden KEYs - std::map mInvTranslateKeyMap; // Map of translations from Linden KEYs to OS keys + std::map mTranslateKeyMap; // Map of translations from OS keys to Linden KEYs + std::map mInvTranslateKeyMap; // Map of translations from Linden KEYs to OS keys LLWindowCallbacks *mCallbacks; LLTimer mKeyLevelTimer[KEY_COUNT]; // Time since level was set diff --git a/indra/llwindow/llkeyboardheadless.cpp b/indra/llwindow/llkeyboardheadless.cpp index 8669a5b41a..50d03aaf20 100644 --- a/indra/llwindow/llkeyboardheadless.cpp +++ b/indra/llwindow/llkeyboardheadless.cpp @@ -31,21 +31,23 @@ LLKeyboardHeadless::LLKeyboardHeadless() { } -void LLKeyboardHeadless::resetMaskKeys() -{ } - - -bool LLKeyboardHeadless::handleKeyDown(const U16 key, const U32 mask) -{ return false; } +bool LLKeyboardHeadless::handleKeyUp(const LLKeyboard::NATIVE_KEY_TYPE key, MASK mask) +{ + return false; +} +bool LLKeyboardHeadless::handleKeyDown(const LLKeyboard::NATIVE_KEY_TYPE key, MASK mask) +{ + return false; +} -bool LLKeyboardHeadless::handleKeyUp(const U16 key, const U32 mask) -{ return false; } +void LLKeyboardHeadless::resetMaskKeys() +{ } MASK LLKeyboardHeadless::currentMask(bool for_mouse_event) { return MASK_NONE; } -#ifdef LL_DARWIN +#if LL_DARWIN && !LL_SDL_WINDOW void LLKeyboardHeadless::handleModifier(MASK mask) { @@ -65,6 +67,7 @@ void LLKeyboardHeadless::scanKeyboard() mCallbacks->handleScanKey(key, mKeyDown[key], mKeyUp[key], mKeyLevel[key]); } } + mCurScanKey = KEY_NONE; // Reset edges for next frame for (S32 key = 0; key < KEY_COUNT; key++) diff --git a/indra/llwindow/llkeyboardheadless.h b/indra/llwindow/llkeyboardheadless.h index 2528f0e3f1..364fb03fe7 100644 --- a/indra/llwindow/llkeyboardheadless.h +++ b/indra/llwindow/llkeyboardheadless.h @@ -33,15 +33,15 @@ class LLKeyboardHeadless : public LLKeyboard { public: LLKeyboardHeadless(); - /*virtual*/ ~LLKeyboardHeadless() {}; + ~LLKeyboardHeadless() = default; - /*virtual*/ bool handleKeyUp(const U16 key, MASK mask); - /*virtual*/ bool handleKeyDown(const U16 key, MASK mask); - /*virtual*/ void resetMaskKeys(); - /*virtual*/ MASK currentMask(bool for_mouse_event); - /*virtual*/ void scanKeyboard(); -#ifdef LL_DARWIN - /*virtual*/ void handleModifier(MASK mask); + bool handleKeyUp(const LLKeyboard::NATIVE_KEY_TYPE key, MASK mask) override; + bool handleKeyDown(const LLKeyboard::NATIVE_KEY_TYPE key, MASK mask) override; + void resetMaskKeys() override; + MASK currentMask(bool for_mouse_event) override; + void scanKeyboard() override; +#if LL_DARWIN && !LL_SDL_WINDOW + void handleModifier(MASK mask) override; #endif }; diff --git a/indra/llwindow/llkeyboardmacosx.cpp b/indra/llwindow/llkeyboardmacosx.cpp index 89ff7c6d3f..1a403e5d94 100644 --- a/indra/llwindow/llkeyboardmacosx.cpp +++ b/indra/llwindow/llkeyboardmacosx.cpp @@ -162,7 +162,7 @@ LLKeyboardMacOSX::LLKeyboardMacOSX() void LLKeyboardMacOSX::resetMaskKeys() { - U32 mask = getModifiers(); + MASK mask = getModifiers(); // MBW -- XXX -- This mirrors the operation of the Windows version of resetMaskKeys(). // It looks a bit suspicious, as it won't correct for keys that have been released. @@ -187,7 +187,7 @@ void LLKeyboardMacOSX::resetMaskKeys() } /* -static bool translateKeyMac(const U16 key, const U32 mask, KEY &outKey, U32 &outMask) +static bool translateKeyMac(const U16 key, const MASK mask, KEY &outKey, U32 &outMask) { // Translate the virtual keycode into the keycodes the keyboard system expects. U16 virtualKey = (mask >> 24) & 0x0000007F; @@ -203,7 +203,7 @@ void LLKeyboardMacOSX::handleModifier(MASK mask) updateModifiers(mask); } -MASK LLKeyboardMacOSX::updateModifiers(const U32 mask) +MASK LLKeyboardMacOSX::updateModifiers(const MASK mask) { // translate the mask MASK out_mask = 0; @@ -226,7 +226,7 @@ MASK LLKeyboardMacOSX::updateModifiers(const U32 mask) return out_mask; } -bool LLKeyboardMacOSX::handleKeyDown(const U16 key, const U32 mask) +bool LLKeyboardMacOSX::handleKeyDown(const U16 key, MASK mask) { KEY translated_key = 0; U32 translated_mask = 0; @@ -243,7 +243,7 @@ bool LLKeyboardMacOSX::handleKeyDown(const U16 key, const U32 mask) } -bool LLKeyboardMacOSX::handleKeyUp(const U16 key, const U32 mask) +bool LLKeyboardMacOSX::handleKeyUp(const U16 key, MASK mask) { KEY translated_key = 0; U32 translated_mask = 0; @@ -262,7 +262,7 @@ bool LLKeyboardMacOSX::handleKeyUp(const U16 key, const U32 mask) MASK LLKeyboardMacOSX::currentMask(bool for_mouse_event) { MASK result = MASK_NONE; - U32 mask = getModifiers(); + MASK mask = getModifiers(); if (mask & MAC_SHIFT_KEY) result |= MASK_SHIFT; if (mask & MAC_CTRL_KEY) result |= MASK_CONTROL; @@ -291,6 +291,7 @@ void LLKeyboardMacOSX::scanKeyboard() mCallbacks->handleScanKey(key, mKeyDown[key], mKeyUp[key], mKeyLevel[key]); } } + mCurScanKey = KEY_NONE; // Reset edges for next frame for (key = 0; key < KEY_COUNT; key++) diff --git a/indra/llwindow/llkeyboardmacosx.h b/indra/llwindow/llkeyboardmacosx.h index 92ab5c9a85..c824e7b713 100644 --- a/indra/llwindow/llkeyboardmacosx.h +++ b/indra/llwindow/llkeyboardmacosx.h @@ -42,17 +42,17 @@ class LLKeyboardMacOSX : public LLKeyboard { public: LLKeyboardMacOSX(); - /*virtual*/ ~LLKeyboardMacOSX() {}; + ~LLKeyboardMacOSX() = default; - /*virtual*/ bool handleKeyUp(const U16 key, MASK mask); - /*virtual*/ bool handleKeyDown(const U16 key, MASK mask); - /*virtual*/ void resetMaskKeys(); - /*virtual*/ MASK currentMask(bool for_mouse_event); - /*virtual*/ void scanKeyboard(); - /*virtual*/ void handleModifier(MASK mask); + bool handleKeyUp(const NATIVE_KEY_TYPE key, MASK mask) override; + bool handleKeyDown(const NATIVE_KEY_TYPE key, MASK mask) override; + void resetMaskKeys() override; + MASK currentMask(bool for_mouse_event) override; + void scanKeyboard() override; + void handleModifier(MASK mask) override; protected: - MASK updateModifiers(const U32 mask); + MASK updateModifiers(const MASK mask); void setModifierKeyLevel( KEY key, bool new_state ); bool translateNumpadKey( const U16 os_key, KEY *translated_key ); U16 inverseTranslateNumpadKey(const KEY translated_key); diff --git a/indra/llwindow/llkeyboardsdl.cpp b/indra/llwindow/llkeyboardsdl.cpp index 97198f0cc0..803a5b8c23 100644 --- a/indra/llwindow/llkeyboardsdl.cpp +++ b/indra/llwindow/llkeyboardsdl.cpp @@ -24,12 +24,11 @@ * $/LicenseInfo$ */ -#if LL_SDL - #include "linden_common.h" #include "llkeyboardsdl.h" #include "llwindowcallbacks.h" -#include "SDL/SDL.h" + +#include "SDL3/SDL_keycode.h" LLKeyboardSDL::LLKeyboardSDL() { @@ -40,7 +39,7 @@ LLKeyboardSDL::LLKeyboardSDL() // Virtual key mappings from SDL_keysym.h ... // SDL maps the letter keys to the ASCII you'd expect, but it's lowercase... - U16 cur_char; + LLKeyboard::NATIVE_KEY_TYPE cur_char; for (cur_char = 'A'; cur_char <= 'Z'; cur_char++) { mTranslateKeyMap[cur_char] = cur_char; @@ -74,7 +73,6 @@ LLKeyboardSDL::LLKeyboardSDL() mTranslateKeyMap[SDLK_RIGHT] = KEY_RIGHT; mTranslateKeyMap[SDLK_UP] = KEY_UP; mTranslateKeyMap[SDLK_DOWN] = KEY_DOWN; - mTranslateKeyMap[SDLK_ESCAPE] = KEY_ESCAPE; mTranslateKeyMap[SDLK_KP_ENTER] = KEY_RETURN; mTranslateKeyMap[SDLK_ESCAPE] = KEY_ESCAPE; mTranslateKeyMap[SDLK_BACKSPACE] = KEY_BACKSPACE; @@ -115,36 +113,35 @@ LLKeyboardSDL::LLKeyboardSDL() mTranslateKeyMap[SDLK_COMMA] = ','; mTranslateKeyMap[SDLK_MINUS] = '-'; mTranslateKeyMap[SDLK_PERIOD] = '.'; - mTranslateKeyMap[SDLK_BACKQUOTE] = '`'; + mTranslateKeyMap[SDLK_GRAVE] = '`'; mTranslateKeyMap[SDLK_SLASH] = KEY_DIVIDE; mTranslateKeyMap[SDLK_SEMICOLON] = ';'; mTranslateKeyMap[SDLK_LEFTBRACKET] = '['; mTranslateKeyMap[SDLK_BACKSLASH] = '\\'; mTranslateKeyMap[SDLK_RIGHTBRACKET] = ']'; - mTranslateKeyMap[SDLK_QUOTE] = '\''; + mTranslateKeyMap[SDLK_APOSTROPHE] = '\''; // Build inverse map - std::map::iterator iter; - for (iter = mTranslateKeyMap.begin(); iter != mTranslateKeyMap.end(); iter++) + for (auto iter = mTranslateKeyMap.begin(); iter != mTranslateKeyMap.end(); iter++) { mInvTranslateKeyMap[iter->second] = iter->first; } // numpad map - mTranslateNumpadMap[SDLK_KP0] = KEY_PAD_INS; - mTranslateNumpadMap[SDLK_KP1] = KEY_PAD_END; - mTranslateNumpadMap[SDLK_KP2] = KEY_PAD_DOWN; - mTranslateNumpadMap[SDLK_KP3] = KEY_PAD_PGDN; - mTranslateNumpadMap[SDLK_KP4] = KEY_PAD_LEFT; - mTranslateNumpadMap[SDLK_KP5] = KEY_PAD_CENTER; - mTranslateNumpadMap[SDLK_KP6] = KEY_PAD_RIGHT; - mTranslateNumpadMap[SDLK_KP7] = KEY_PAD_HOME; - mTranslateNumpadMap[SDLK_KP8] = KEY_PAD_UP; - mTranslateNumpadMap[SDLK_KP9] = KEY_PAD_PGUP; + mTranslateNumpadMap[SDLK_KP_0] = KEY_PAD_INS; + mTranslateNumpadMap[SDLK_KP_1] = KEY_PAD_END; + mTranslateNumpadMap[SDLK_KP_2] = KEY_PAD_DOWN; + mTranslateNumpadMap[SDLK_KP_3] = KEY_PAD_PGDN; + mTranslateNumpadMap[SDLK_KP_4] = KEY_PAD_LEFT; + mTranslateNumpadMap[SDLK_KP_5] = KEY_PAD_CENTER; + mTranslateNumpadMap[SDLK_KP_6] = KEY_PAD_RIGHT; + mTranslateNumpadMap[SDLK_KP_7] = KEY_PAD_HOME; + mTranslateNumpadMap[SDLK_KP_8] = KEY_PAD_UP; + mTranslateNumpadMap[SDLK_KP_9] = KEY_PAD_PGUP; mTranslateNumpadMap[SDLK_KP_PERIOD] = KEY_PAD_DEL; // build inverse numpad map - for (iter = mTranslateNumpadMap.begin(); + for (auto iter = mTranslateNumpadMap.begin(); iter != mTranslateNumpadMap.end(); iter++) { @@ -154,45 +151,45 @@ LLKeyboardSDL::LLKeyboardSDL() void LLKeyboardSDL::resetMaskKeys() { - SDLMod mask = SDL_GetModState(); + SDL_Keymod mask = SDL_GetModState(); // MBW -- XXX -- This mirrors the operation of the Windows version of resetMaskKeys(). // It looks a bit suspicious, as it won't correct for keys that have been released. // Is this the way it's supposed to work? - if(mask & KMOD_SHIFT) + if(mask & SDL_KMOD_SHIFT) { mKeyLevel[KEY_SHIFT] = true; } - if(mask & KMOD_CTRL) + if(mask & SDL_KMOD_CTRL) { mKeyLevel[KEY_CONTROL] = true; } - if(mask & KMOD_ALT) + if(mask & SDL_KMOD_ALT) { mKeyLevel[KEY_ALT] = true; } } -MASK LLKeyboardSDL::updateModifiers(const U32 mask) +MASK LLKeyboardSDL::updateModifiers(const MASK mask) { // translate the mask MASK out_mask = MASK_NONE; - if(mask & KMOD_SHIFT) + if(mask & SDL_KMOD_SHIFT) { out_mask |= MASK_SHIFT; } - if(mask & KMOD_CTRL) + if(mask & SDL_KMOD_CTRL) { out_mask |= MASK_CONTROL; } - if(mask & KMOD_ALT) + if(mask & SDL_KMOD_ALT) { out_mask |= MASK_ALT; } @@ -201,37 +198,37 @@ MASK LLKeyboardSDL::updateModifiers(const U32 mask) } -static U16 adjustNativekeyFromUnhandledMask(const U16 key, const U32 mask) +LLKeyboard::NATIVE_KEY_TYPE adjustNativekeyFromUnhandledMask(const LLKeyboard::NATIVE_KEY_TYPE key, const MASK mask) { // SDL doesn't automatically adjust the keysym according to // whether NUMLOCK is engaged, so we massage the keysym manually. - U16 rtn = key; - if (!(mask & KMOD_NUM)) + LLKeyboard::NATIVE_KEY_TYPE rtn = key; + if (!(mask & SDL_KMOD_NUM)) { switch (key) { - case SDLK_KP_PERIOD: rtn = SDLK_DELETE; break; - case SDLK_KP0: rtn = SDLK_INSERT; break; - case SDLK_KP1: rtn = SDLK_END; break; - case SDLK_KP2: rtn = SDLK_DOWN; break; - case SDLK_KP3: rtn = SDLK_PAGEDOWN; break; - case SDLK_KP4: rtn = SDLK_LEFT; break; - case SDLK_KP6: rtn = SDLK_RIGHT; break; - case SDLK_KP7: rtn = SDLK_HOME; break; - case SDLK_KP8: rtn = SDLK_UP; break; - case SDLK_KP9: rtn = SDLK_PAGEUP; break; + case SDLK_KP_PERIOD: rtn = SDLK_DELETE; break; + case SDLK_KP_0: rtn = SDLK_INSERT; break; + case SDLK_KP_1: rtn = SDLK_END; break; + case SDLK_KP_2: rtn = SDLK_DOWN; break; + case SDLK_KP_3: rtn = SDLK_PAGEDOWN; break; + case SDLK_KP_4: rtn = SDLK_LEFT; break; + case SDLK_KP_6: rtn = SDLK_RIGHT; break; + case SDLK_KP_7: rtn = SDLK_HOME; break; + case SDLK_KP_8: rtn = SDLK_UP; break; + case SDLK_KP_9: rtn = SDLK_PAGEUP; break; } } return rtn; } -bool LLKeyboardSDL::handleKeyDown(const U16 key, const U32 mask) +bool LLKeyboardSDL::handleKeyDown(const LLKeyboard::NATIVE_KEY_TYPE key, const MASK mask) { - U16 adjusted_nativekey; + LLKeyboard::NATIVE_KEY_TYPE adjusted_nativekey; KEY translated_key = 0; - U32 translated_mask = MASK_NONE; - bool handled = false; + MASK translated_mask = MASK_NONE; + bool handled = false; adjusted_nativekey = adjustNativekeyFromUnhandledMask(key, mask); @@ -246,12 +243,12 @@ bool LLKeyboardSDL::handleKeyDown(const U16 key, const U32 mask) } -bool LLKeyboardSDL::handleKeyUp(const U16 key, const U32 mask) +bool LLKeyboardSDL::handleKeyUp(const LLKeyboard::NATIVE_KEY_TYPE key, const MASK mask) { - U16 adjusted_nativekey; + LLKeyboard::NATIVE_KEY_TYPE adjusted_nativekey; KEY translated_key = 0; U32 translated_mask = MASK_NONE; - bool handled = false; + bool handled = false; adjusted_nativekey = adjustNativekeyFromUnhandledMask(key, mask); @@ -268,16 +265,20 @@ bool LLKeyboardSDL::handleKeyUp(const U16 key, const U32 mask) MASK LLKeyboardSDL::currentMask(bool for_mouse_event) { MASK result = MASK_NONE; - SDLMod mask = SDL_GetModState(); + SDL_Keymod mask = SDL_GetModState(); - if (mask & KMOD_SHIFT) result |= MASK_SHIFT; - if (mask & KMOD_CTRL) result |= MASK_CONTROL; - if (mask & KMOD_ALT) result |= MASK_ALT; + if (mask & SDL_KMOD_SHIFT) + result |= MASK_SHIFT; + if (mask & SDL_KMOD_CTRL) + result |= MASK_CONTROL; + if (mask & SDL_KMOD_ALT) + result |= MASK_ALT; // For keyboard events, consider Meta keys equivalent to Control if (!for_mouse_event) { - if (mask & KMOD_META) result |= MASK_CONTROL; + if (mask & SDL_KMOD_GUI) + result |= MASK_CONTROL; } return result; @@ -296,6 +297,7 @@ void LLKeyboardSDL::scanKeyboard() mCallbacks->handleScanKey(key, mKeyDown[key], mKeyUp[key], mKeyLevel[key]); } } + mCurScanKey = KEY_NONE; // Reset edges for next frame for (S32 key = 0; key < KEY_COUNT; key++) @@ -310,15 +312,347 @@ void LLKeyboardSDL::scanKeyboard() } -bool LLKeyboardSDL::translateNumpadKey( const U16 os_key, KEY *translated_key) +bool LLKeyboardSDL::translateNumpadKey( const LLKeyboard::NATIVE_KEY_TYPE os_key, KEY *translated_key) { return translateKey(os_key, translated_key); } -U16 LLKeyboardSDL::inverseTranslateNumpadKey(const KEY translated_key) +LLKeyboard::NATIVE_KEY_TYPE LLKeyboardSDL::inverseTranslateNumpadKey(const KEY translated_key) { return inverseTranslateKey(translated_key); } -#endif +enum class WindowsVK : U32 +{ + LL_VK_UNKNOWN = 0, + LL_VK_CANCEL = 0x03, + LL_VK_BACK = 0x08, + LL_VK_TAB = 0x09, + LL_VK_CLEAR = 0x0C, + LL_VK_RETURN = 0x0D, + LL_VK_SHIFT = 0x10, + LL_VK_CONTROL = 0x11, + LL_VK_MENU = 0x12, + LL_VK_PAUSE = 0x13, + LL_VK_CAPITAL = 0x14, + LL_VK_KANA = 0x15, + LL_VK_HANGUL = 0x15, + LL_VK_JUNJA = 0x17, + LL_VK_FINAL = 0x18, + LL_VK_HANJA = 0x19, + LL_VK_KANJI = 0x19, + LL_VK_ESCAPE = 0x1B, + LL_VK_CONVERT = 0x1C, + LL_VK_NONCONVERT = 0x1D, + LL_VK_ACCEPT = 0x1E, + LL_VK_MODECHANGE = 0x1F, + LL_VK_SPACE = 0x20, + LL_VK_PRIOR = 0x21, + LL_VK_NEXT = 0x22, + LL_VK_END = 0x23, + LL_VK_HOME = 0x24, + LL_VK_LEFT = 0x25, + LL_VK_UP = 0x26, + LL_VK_RIGHT = 0x27, + LL_VK_DOWN = 0x28, + LL_VK_SELECT = 0x29, + LL_VK_PRINT = 0x2A, + LL_VK_EXECUTE = 0x2B, + LL_VK_SNAPSHOT = 0x2C, + LL_VK_INSERT = 0x2D, + LL_VK_DELETE = 0x2E, + LL_VK_HELP = 0x2F, + LL_VK_0 = 0x30, + LL_VK_1 = 0x31, + LL_VK_2 = 0x32, + LL_VK_3 = 0x33, + LL_VK_4 = 0x34, + LL_VK_5 = 0x35, + LL_VK_6 = 0x36, + LL_VK_7 = 0x37, + LL_VK_8 = 0x38, + LL_VK_9 = 0x39, + LL_VK_A = 0x41, + LL_VK_B = 0x42, + LL_VK_C = 0x43, + LL_VK_D = 0x44, + LL_VK_E = 0x45, + LL_VK_F = 0x46, + LL_VK_G = 0x47, + LL_VK_H = 0x48, + LL_VK_I = 0x49, + LL_VK_J = 0x4A, + LL_VK_K = 0x4B, + LL_VK_L = 0x4C, + LL_VK_M = 0x4D, + LL_VK_N = 0x4E, + LL_VK_O = 0x4F, + LL_VK_P = 0x50, + LL_VK_Q = 0x51, + LL_VK_R = 0x52, + LL_VK_S = 0x53, + LL_VK_T = 0x54, + LL_VK_U = 0x55, + LL_VK_V = 0x56, + LL_VK_W = 0x57, + LL_VK_X = 0x58, + LL_VK_Y = 0x59, + LL_VK_Z = 0x5A, + LL_VK_LWIN = 0x5B, + LL_VK_RWIN = 0x5C, + LL_VK_APPS = 0x5D, + LL_VK_SLEEP = 0x5F, + LL_VK_NUMPAD0 = 0x60, + LL_VK_NUMPAD1 = 0x61, + LL_VK_NUMPAD2 = 0x62, + LL_VK_NUMPAD3 = 0x63, + LL_VK_NUMPAD4 = 0x64, + LL_VK_NUMPAD5 = 0x65, + LL_VK_NUMPAD6 = 0x66, + LL_VK_NUMPAD7 = 0x67, + LL_VK_NUMPAD8 = 0x68, + LL_VK_NUMPAD9 = 0x69, + LL_VK_MULTIPLY = 0x6A, + LL_VK_ADD = 0x6B, + LL_VK_SEPARATOR = 0x6C, + LL_VK_SUBTRACT = 0x6D, + LL_VK_DECIMAL = 0x6E, + LL_VK_DIVIDE = 0x6F, + LL_VK_F1 = 0x70, + LL_VK_F2 = 0x71, + LL_VK_F3 = 0x72, + LL_VK_F4 = 0x73, + LL_VK_F5 = 0x74, + LL_VK_F6 = 0x75, + LL_VK_F7 = 0x76, + LL_VK_F8 = 0x77, + LL_VK_F9 = 0x78, + LL_VK_F10 = 0x79, + LL_VK_F11 = 0x7A, + LL_VK_F12 = 0x7B, + LL_VK_F13 = 0x7C, + LL_VK_F14 = 0x7D, + LL_VK_F15 = 0x7E, + LL_VK_F16 = 0x7F, + LL_VK_F17 = 0x80, + LL_VK_F18 = 0x81, + LL_VK_F19 = 0x82, + LL_VK_F20 = 0x83, + LL_VK_F21 = 0x84, + LL_VK_F22 = 0x85, + LL_VK_F23 = 0x86, + LL_VK_F24 = 0x87, + LL_VK_NUMLOCK = 0x90, + LL_VK_SCROLL = 0x91, + LL_VK_LSHIFT = 0xA0, + LL_VK_RSHIFT = 0xA1, + LL_VK_LCONTROL = 0xA2, + LL_VK_RCONTROL = 0xA3, + LL_VK_LMENU = 0xA4, + LL_VK_RMENU = 0xA5, + LL_VK_BROWSER_BACK = 0xA6, + LL_VK_BROWSER_FORWARD = 0xA7, + LL_VK_BROWSER_REFRESH = 0xA8, + LL_VK_BROWSER_STOP = 0xA9, + LL_VK_BROWSER_SEARCH = 0xAA, + LL_VK_BROWSER_FAVORITES = 0xAB, + LL_VK_BROWSER_HOME = 0xAC, + LL_VK_VOLUME_MUTE = 0xAD, + LL_VK_VOLUME_DOWN = 0xAE, + LL_VK_VOLUME_UP = 0xAF, + LL_VK_MEDIA_NEXT_TRACK = 0xB0, + LL_VK_MEDIA_PREV_TRACK = 0xB1, + LL_VK_MEDIA_STOP = 0xB2, + LL_VK_MEDIA_PLAY_PAUSE = 0xB3, + LL_VK_MEDIA_LAUNCH_MAIL = 0xB4, + LL_VK_MEDIA_LAUNCH_MEDIA_SELECT = 0xB5, + LL_VK_MEDIA_LAUNCH_APP1 = 0xB6, + LL_VK_MEDIA_LAUNCH_APP2 = 0xB7, + LL_VK_OEM_1 = 0xBA, + LL_VK_OEM_PLUS = 0xBB, + LL_VK_OEM_COMMA = 0xBC, + LL_VK_OEM_MINUS = 0xBD, + LL_VK_OEM_PERIOD = 0xBE, + LL_VK_OEM_2 = 0xBF, + LL_VK_OEM_3 = 0xC0, + LL_VK_OEM_4 = 0xDB, + LL_VK_OEM_5 = 0xDC, + LL_VK_OEM_6 = 0xDD, + LL_VK_OEM_7 = 0xDE, + LL_VK_OEM_8 = 0xDF, + LL_VK_OEM_102 = 0xE2, + LL_VK_PROCESSKEY = 0xE5, + LL_VK_PACKET = 0xE7, + LL_VK_ATTN = 0xF6, + LL_VK_CRSEL = 0xF7, + LL_VK_EXSEL = 0xF8, + LL_VK_EREOF = 0xF9, + LL_VK_PLAY = 0xFA, + LL_VK_ZOOM = 0xFB, + LL_VK_NONAME = 0xFC, + LL_VK_PA1 = 0xFD, + LL_VK_OEM_CLEAR = 0xFE, +}; + +std::map< U32, U32 > mSDL2_to_Win; + +U32 LLKeyboardSDL::mapSDL2toWin( U32 aSymbol ) +{ + // Map SDLK_ virtual keys to Windows LL_VK_ virtual keys. + // Text is handled via unicode input (SDL_TEXTINPUT event) and does not need to be translated into LL_VK_ values as those match already. + if( mSDL2_to_Win.empty() ) + { + + mSDL2_to_Win[ SDLK_BACKSPACE ] = (U32)WindowsVK::LL_VK_BACK; + mSDL2_to_Win[ SDLK_TAB ] = (U32)WindowsVK::LL_VK_TAB; + mSDL2_to_Win[ 12 ] = (U32)WindowsVK::LL_VK_CLEAR; + mSDL2_to_Win[ SDLK_RETURN ] = (U32)WindowsVK::LL_VK_RETURN; + mSDL2_to_Win[ 19 ] = (U32)WindowsVK::LL_VK_PAUSE; + mSDL2_to_Win[ SDLK_ESCAPE ] = (U32)WindowsVK::LL_VK_ESCAPE; + mSDL2_to_Win[ SDLK_SPACE ] = (U32)WindowsVK::LL_VK_SPACE; + mSDL2_to_Win[ SDLK_APOSTROPHE ] = (U32)WindowsVK::LL_VK_OEM_7; + mSDL2_to_Win[ SDLK_COMMA ] = (U32)WindowsVK::LL_VK_OEM_COMMA; + mSDL2_to_Win[ SDLK_MINUS ] = (U32)WindowsVK::LL_VK_OEM_MINUS; + mSDL2_to_Win[ SDLK_PERIOD ] = (U32)WindowsVK::LL_VK_OEM_PERIOD; + mSDL2_to_Win[ SDLK_SLASH ] = (U32)WindowsVK::LL_VK_OEM_2; + + mSDL2_to_Win[ SDLK_0 ] = (U32)WindowsVK::LL_VK_0; + mSDL2_to_Win[ SDLK_1 ] = (U32)WindowsVK::LL_VK_1; + mSDL2_to_Win[ SDLK_2 ] = (U32)WindowsVK::LL_VK_2; + mSDL2_to_Win[ SDLK_3 ] = (U32)WindowsVK::LL_VK_3; + mSDL2_to_Win[ SDLK_4 ] = (U32)WindowsVK::LL_VK_4; + mSDL2_to_Win[ SDLK_5 ] = (U32)WindowsVK::LL_VK_5; + mSDL2_to_Win[ SDLK_6 ] = (U32)WindowsVK::LL_VK_6; + mSDL2_to_Win[ SDLK_7 ] = (U32)WindowsVK::LL_VK_7; + mSDL2_to_Win[ SDLK_8 ] = (U32)WindowsVK::LL_VK_8; + mSDL2_to_Win[ SDLK_9 ] = (U32)WindowsVK::LL_VK_9; + + mSDL2_to_Win[ SDLK_SEMICOLON ] = (U32)WindowsVK::LL_VK_OEM_1; + mSDL2_to_Win[ SDLK_LESS ] = (U32)WindowsVK::LL_VK_OEM_102; + mSDL2_to_Win[ SDLK_EQUALS ] = (U32)WindowsVK::LL_VK_OEM_PLUS; + mSDL2_to_Win[ SDLK_KP_EQUALS ] = (U32)WindowsVK::LL_VK_OEM_PLUS; + + mSDL2_to_Win[ SDLK_LEFTBRACKET ] = (U32)WindowsVK::LL_VK_OEM_4; + mSDL2_to_Win[ SDLK_BACKSLASH ] = (U32)WindowsVK::LL_VK_OEM_5; + mSDL2_to_Win[ SDLK_RIGHTBRACKET ] = (U32)WindowsVK::LL_VK_OEM_6; + mSDL2_to_Win[ SDLK_GRAVE ] = (U32)WindowsVK::LL_VK_OEM_8; + + mSDL2_to_Win[ SDLK_A ] = (U32)WindowsVK::LL_VK_A; + mSDL2_to_Win[ SDLK_B ] = (U32)WindowsVK::LL_VK_B; + mSDL2_to_Win[ SDLK_C ] = (U32)WindowsVK::LL_VK_C; + mSDL2_to_Win[ SDLK_D ] = (U32)WindowsVK::LL_VK_D; + mSDL2_to_Win[ SDLK_E ] = (U32)WindowsVK::LL_VK_E; + mSDL2_to_Win[ SDLK_F ] = (U32)WindowsVK::LL_VK_F; + mSDL2_to_Win[ SDLK_G ] = (U32)WindowsVK::LL_VK_G; + mSDL2_to_Win[ SDLK_H ] = (U32)WindowsVK::LL_VK_H; + mSDL2_to_Win[ SDLK_I ] = (U32)WindowsVK::LL_VK_I; + mSDL2_to_Win[ SDLK_J ] = (U32)WindowsVK::LL_VK_J; + mSDL2_to_Win[ SDLK_K ] = (U32)WindowsVK::LL_VK_K; + mSDL2_to_Win[ SDLK_L ] = (U32)WindowsVK::LL_VK_L; + mSDL2_to_Win[ SDLK_M ] = (U32)WindowsVK::LL_VK_M; + mSDL2_to_Win[ SDLK_N ] = (U32)WindowsVK::LL_VK_N; + mSDL2_to_Win[ SDLK_O ] = (U32)WindowsVK::LL_VK_O; + mSDL2_to_Win[ SDLK_P ] = (U32)WindowsVK::LL_VK_P; + mSDL2_to_Win[ SDLK_Q ] = (U32)WindowsVK::LL_VK_Q; + mSDL2_to_Win[ SDLK_R ] = (U32)WindowsVK::LL_VK_R; + mSDL2_to_Win[ SDLK_S ] = (U32)WindowsVK::LL_VK_S; + mSDL2_to_Win[ SDLK_T ] = (U32)WindowsVK::LL_VK_T; + mSDL2_to_Win[ SDLK_Y ] = (U32)WindowsVK::LL_VK_U; + mSDL2_to_Win[ SDLK_V ] = (U32)WindowsVK::LL_VK_V; + mSDL2_to_Win[ SDLK_W ] = (U32)WindowsVK::LL_VK_W; + mSDL2_to_Win[ SDLK_X ] = (U32)WindowsVK::LL_VK_X; + mSDL2_to_Win[ SDLK_Y ] = (U32)WindowsVK::LL_VK_Y; + mSDL2_to_Win[ SDLK_Z ] = (U32)WindowsVK::LL_VK_Z; + + mSDL2_to_Win[ SDLK_DELETE ] = (U32)WindowsVK::LL_VK_DELETE; + + + mSDL2_to_Win[ SDLK_NUMLOCKCLEAR ] = (U32)WindowsVK::LL_VK_NUMLOCK; + mSDL2_to_Win[ SDLK_SCROLLLOCK ] = (U32)WindowsVK::LL_VK_SCROLL; + + mSDL2_to_Win[ SDLK_HELP ] = (U32)WindowsVK::LL_VK_HELP; + mSDL2_to_Win[ SDLK_PRINTSCREEN ] = (U32)WindowsVK::LL_VK_SNAPSHOT; + mSDL2_to_Win[ SDLK_CANCEL ] = (U32)WindowsVK::LL_VK_CANCEL; + mSDL2_to_Win[ SDLK_APPLICATION ] = (U32)WindowsVK::LL_VK_APPS; + + mSDL2_to_Win[ SDLK_UNKNOWN ] = (U32)WindowsVK::LL_VK_UNKNOWN; + mSDL2_to_Win[ SDLK_BACKSPACE ] = (U32)WindowsVK::LL_VK_BACK; + mSDL2_to_Win[ SDLK_TAB ] = (U32)WindowsVK::LL_VK_TAB; + mSDL2_to_Win[ SDLK_CLEAR ] = (U32)WindowsVK::LL_VK_CLEAR; + mSDL2_to_Win[ SDLK_RETURN ] = (U32)WindowsVK::LL_VK_RETURN; + mSDL2_to_Win[ SDLK_PAUSE ] = (U32)WindowsVK::LL_VK_PAUSE; + mSDL2_to_Win[ SDLK_ESCAPE ] = (U32)WindowsVK::LL_VK_ESCAPE; + mSDL2_to_Win[ SDLK_DELETE ] = (U32)WindowsVK::LL_VK_DELETE; + + mSDL2_to_Win[ SDLK_KP_PERIOD ] = (U32)WindowsVK::LL_VK_DELETE; // LL_VK_DECIMAL? + mSDL2_to_Win[ SDLK_KP_DIVIDE ] = (U32)WindowsVK::LL_VK_DIVIDE; + mSDL2_to_Win[ SDLK_KP_MULTIPLY] = (U32)WindowsVK::LL_VK_MULTIPLY; + mSDL2_to_Win[ SDLK_KP_MINUS ] = (U32)WindowsVK::LL_VK_OEM_MINUS; // LL_VK_SUBSTRACT? + mSDL2_to_Win[ SDLK_KP_PLUS ] = (U32)WindowsVK::LL_VK_OEM_PLUS; // LL_VK_ADD? + mSDL2_to_Win[ SDLK_KP_ENTER ] = (U32)WindowsVK::LL_VK_RETURN; + mSDL2_to_Win[ SDLK_KP_0 ] = (U32)WindowsVK::LL_VK_INSERT; + mSDL2_to_Win[ SDLK_KP_1 ] = (U32)WindowsVK::LL_VK_END; + mSDL2_to_Win[ SDLK_KP_2 ] = (U32)WindowsVK::LL_VK_DOWN; + mSDL2_to_Win[ SDLK_KP_3 ] = (U32)WindowsVK::LL_VK_NEXT; + mSDL2_to_Win[ SDLK_KP_4 ] = (U32)WindowsVK::LL_VK_LEFT; + mSDL2_to_Win[ SDLK_KP_5 ] = (U32)WindowsVK::LL_VK_NUMPAD5; + mSDL2_to_Win[ SDLK_KP_6 ] = (U32)WindowsVK::LL_VK_RIGHT; + mSDL2_to_Win[ SDLK_KP_7 ] = (U32)WindowsVK::LL_VK_HOME; + mSDL2_to_Win[ SDLK_KP_8 ] = (U32)WindowsVK::LL_VK_UP; + mSDL2_to_Win[ SDLK_KP_9 ] = (U32)WindowsVK::LL_VK_PRIOR; + + // ? + + mSDL2_to_Win[ SDLK_UP ] = (U32)WindowsVK::LL_VK_UP; + mSDL2_to_Win[ SDLK_DOWN ] = (U32)WindowsVK::LL_VK_DOWN; + mSDL2_to_Win[ SDLK_RIGHT ] = (U32)WindowsVK::LL_VK_RIGHT; + mSDL2_to_Win[ SDLK_LEFT ] = (U32)WindowsVK::LL_VK_LEFT; + mSDL2_to_Win[ SDLK_INSERT ] = (U32)WindowsVK::LL_VK_INSERT; + mSDL2_to_Win[ SDLK_HOME ] = (U32)WindowsVK::LL_VK_HOME; + mSDL2_to_Win[ SDLK_END ] = (U32)WindowsVK::LL_VK_END; + mSDL2_to_Win[ SDLK_PAGEUP ] = (U32)WindowsVK::LL_VK_PRIOR; + mSDL2_to_Win[ SDLK_PAGEDOWN ] = (U32)WindowsVK::LL_VK_NEXT; + mSDL2_to_Win[ SDLK_F1 ] = (U32)WindowsVK::LL_VK_F1; + mSDL2_to_Win[ SDLK_F2 ] = (U32)WindowsVK::LL_VK_F2; + mSDL2_to_Win[ SDLK_F3 ] = (U32)WindowsVK::LL_VK_F3; + mSDL2_to_Win[ SDLK_F4 ] = (U32)WindowsVK::LL_VK_F4; + mSDL2_to_Win[ SDLK_F5 ] = (U32)WindowsVK::LL_VK_F5; + mSDL2_to_Win[ SDLK_F6 ] = (U32)WindowsVK::LL_VK_F6; + mSDL2_to_Win[ SDLK_F7 ] = (U32)WindowsVK::LL_VK_F7; + mSDL2_to_Win[ SDLK_F8 ] = (U32)WindowsVK::LL_VK_F8; + mSDL2_to_Win[ SDLK_F9 ] = (U32)WindowsVK::LL_VK_F9; + mSDL2_to_Win[ SDLK_F10 ] = (U32)WindowsVK::LL_VK_F10; + mSDL2_to_Win[ SDLK_F11 ] = (U32)WindowsVK::LL_VK_F11; + mSDL2_to_Win[ SDLK_F12 ] = (U32)WindowsVK::LL_VK_F12; + mSDL2_to_Win[ SDLK_F13 ] = (U32)WindowsVK::LL_VK_F13; + mSDL2_to_Win[ SDLK_F14 ] = (U32)WindowsVK::LL_VK_F14; + mSDL2_to_Win[ SDLK_F15 ] = (U32)WindowsVK::LL_VK_F15; + mSDL2_to_Win[ SDLK_CAPSLOCK ] = (U32)WindowsVK::LL_VK_CAPITAL; + mSDL2_to_Win[ SDLK_RSHIFT ] = (U32)WindowsVK::LL_VK_SHIFT; + mSDL2_to_Win[ SDLK_LSHIFT ] = (U32)WindowsVK::LL_VK_SHIFT; + mSDL2_to_Win[ SDLK_RCTRL ] = (U32)WindowsVK::LL_VK_CONTROL; + mSDL2_to_Win[ SDLK_LCTRL ] = (U32)WindowsVK::LL_VK_CONTROL; + mSDL2_to_Win[ SDLK_RALT ] = (U32)WindowsVK::LL_VK_MENU; + mSDL2_to_Win[ SDLK_LALT ] = (U32)WindowsVK::LL_VK_MENU; + + mSDL2_to_Win[ SDLK_MENU ] = (U32)WindowsVK::LL_VK_MENU; + + // LL_VK_MODECHANGE ? + // mSDL2_to_Win[ SDLK_MODE ] = (U32)WindowsVK::LL_VK_MODE; + + // ? + // mSDL2_to_Win[ SDLK_SYSREQ ] = (U32)WindowsVK::LL_VK_SYSREQ; + // mSDL2_to_Win[ SDLK_POWER ] = (U32)WindowsVK::LL_VK_POWER; + // mSDL2_to_Win[ SDLK_UNDO ] = (U32)WindowsVK::LL_VK_UNDO; + // mSDL2_to_Win[ SDLK_KP_EQUALS ] = (U32)WindowsVK::LL_VK_EQUALS; + // mSDL2_to_Win[ 311 ] = (U32)WindowsVK::LL_VK_LWIN; + // mSDL2_to_Win[ 312 ] = (U32)WindowsVK::LL_VK_RWIN; + // mSDL2_to_Win[ SDLK_COLON ] = ? + } + auto itr = mSDL2_to_Win.find( aSymbol ); + if( itr != mSDL2_to_Win.end() ) + return itr->second; + + return aSymbol; +} diff --git a/indra/llwindow/llkeyboardsdl.h b/indra/llwindow/llkeyboardsdl.h index fd348b28f2..f23b4cca6c 100644 --- a/indra/llwindow/llkeyboardsdl.h +++ b/indra/llwindow/llkeyboardsdl.h @@ -28,28 +28,31 @@ #define LL_LLKEYBOARDSDL_H #include "llkeyboard.h" -#include "SDL/SDL.h" +#include "SDL3/SDL.h" class LLKeyboardSDL : public LLKeyboard { public: LLKeyboardSDL(); - /*virtual*/ ~LLKeyboardSDL() {}; + ~LLKeyboardSDL() = default; - /*virtual*/ bool handleKeyUp(const U16 key, MASK mask); - /*virtual*/ bool handleKeyDown(const U16 key, MASK mask); - /*virtual*/ void resetMaskKeys(); - /*virtual*/ MASK currentMask(bool for_mouse_event); - /*virtual*/ void scanKeyboard(); + bool handleKeyUp(const LLKeyboard::NATIVE_KEY_TYPE key, MASK mask) override; + bool handleKeyDown(const LLKeyboard::NATIVE_KEY_TYPE key, MASK mask) override; + void resetMaskKeys() override; + MASK currentMask(bool for_mouse_event) override; + void scanKeyboard() override; protected: - MASK updateModifiers(const U32 mask); + MASK updateModifiers(const MASK mask); void setModifierKeyLevel( KEY key, bool new_state ); - bool translateNumpadKey( const U16 os_key, KEY *translated_key ); - U16 inverseTranslateNumpadKey(const KEY translated_key); + bool translateNumpadKey( const LLKeyboard::NATIVE_KEY_TYPE os_key, KEY *translated_key ); + LLKeyboard::NATIVE_KEY_TYPE inverseTranslateNumpadKey(const KEY translated_key); private: - std::map mTranslateNumpadMap; // special map for translating OS keys to numpad keys - std::map mInvTranslateNumpadMap; // inverse of the above + std::map mTranslateNumpadMap; // special map for translating OS keys to numpad keys + std::map mInvTranslateNumpadMap; // inverse of the above + +public: + static U32 mapSDL2toWin( U32 ); }; #endif diff --git a/indra/llwindow/llkeyboardwin32.cpp b/indra/llwindow/llkeyboardwin32.cpp index 8d6b8d9b93..4ef0b493a5 100644 --- a/indra/llwindow/llkeyboardwin32.cpp +++ b/indra/llwindow/llkeyboardwin32.cpp @@ -197,7 +197,7 @@ MASK LLKeyboardWin32::updateModifiers() // mask is ignored, except for extended flag -- we poll the modifier keys for the other flags -bool LLKeyboardWin32::handleKeyDown(const U16 key, MASK mask) +bool LLKeyboardWin32::handleKeyDown(const LLKeyboard::NATIVE_KEY_TYPE key, MASK mask) { KEY translated_key; U32 translated_mask; @@ -214,7 +214,7 @@ bool LLKeyboardWin32::handleKeyDown(const U16 key, MASK mask) } // mask is ignored, except for extended flag -- we poll the modifier keys for the other flags -bool LLKeyboardWin32::handleKeyUp(const U16 key, MASK mask) +bool LLKeyboardWin32::handleKeyUp(const LLKeyboard::NATIVE_KEY_TYPE key, MASK mask) { KEY translated_key; U32 translated_mask; diff --git a/indra/llwindow/llkeyboardwin32.h b/indra/llwindow/llkeyboardwin32.h index d0dfc5cfdd..fa223a2904 100644 --- a/indra/llwindow/llkeyboardwin32.h +++ b/indra/llwindow/llkeyboardwin32.h @@ -37,15 +37,16 @@ class LLKeyboardWin32 : public LLKeyboard { public: LLKeyboardWin32(); - /*virtual*/ ~LLKeyboardWin32() {}; - - /*virtual*/ bool handleKeyUp(const U16 key, MASK mask); - /*virtual*/ bool handleKeyDown(const U16 key, MASK mask); - /*virtual*/ void resetMaskKeys(); - /*virtual*/ MASK currentMask(bool for_mouse_event); - /*virtual*/ void scanKeyboard(); - bool translateExtendedKey(const U16 os_key, const MASK mask, KEY *translated_key); - U16 inverseTranslateExtendedKey(const KEY translated_key); + ~LLKeyboardWin32() = default; + + bool handleKeyUp(const LLKeyboard::NATIVE_KEY_TYPE key, MASK mask) override; + bool handleKeyDown(const LLKeyboard::NATIVE_KEY_TYPE key, MASK mask) override; + void resetMaskKeys() override; + MASK currentMask(bool for_mouse_event) override; + void scanKeyboard() override; + + bool translateExtendedKey(const U16 os_key, const MASK mask, KEY *translated_key); + U16 inverseTranslateExtendedKey(const KEY translated_key); protected: MASK updateModifiers(); diff --git a/indra/llwindow/llmousehandler.cpp b/indra/llwindow/llmousehandler.cpp index eeceab502a..959dde70b4 100644 --- a/indra/llwindow/llmousehandler.cpp +++ b/indra/llwindow/llmousehandler.cpp @@ -24,6 +24,8 @@ * $/LicenseInfo$ */ +#include "linden_common.h" + #include "llmousehandler.h" //virtual diff --git a/indra/llwindow/llsdl.cpp b/indra/llwindow/llsdl.cpp new file mode 100644 index 0000000000..c97356ee80 --- /dev/null +++ b/indra/llwindow/llsdl.cpp @@ -0,0 +1,146 @@ +/** + * @file llsdl.cpp + * @brief SDL2 initialization + * + * $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$ + */ + +#include +#include + +#include "SDL3/SDL.h" + +#ifndef LL_SDL_APP +#define SDL_MAIN_HANDLED 1 +#include "SDL3/SDL_main.h" +#endif + +#include "llerror.h" +#include "llwindow.h" + +bool gSDLMainHandled = false; + +void sdl_logger(void *userdata, int category, SDL_LogPriority priority, const char *message) +{ + switch (priority) + { + case SDL_LOG_PRIORITY_TRACE: + case SDL_LOG_PRIORITY_VERBOSE: + case SDL_LOG_PRIORITY_DEBUG: + LL_DEBUGS("SDL") << "log='" << message << "'" << LL_ENDL; + break; + case SDL_LOG_PRIORITY_INFO: + LL_INFOS("SDL") << "log='" << message << "'" << LL_ENDL; + break; + case SDL_LOG_PRIORITY_WARN: + case SDL_LOG_PRIORITY_ERROR: + case SDL_LOG_PRIORITY_CRITICAL: + LL_WARNS("SDL") << "log='" << message << "'" << LL_ENDL; + break; + case SDL_LOG_PRIORITY_INVALID: + default: + break; + } +} + +void init_sdl(const std::string& app_name) +{ + if (!gSDLMainHandled) + { + SDL_SetMainReady(); + } + + SDL_SetLogOutputFunction(&sdl_logger, nullptr); + + const int c_sdl_version = SDL_VERSION; + LL_INFOS() << "Compiled against SDL " + << SDL_VERSIONNUM_MAJOR(c_sdl_version) << "." + << SDL_VERSIONNUM_MINOR(c_sdl_version) << "." + << SDL_VERSIONNUM_MICRO(c_sdl_version) << LL_ENDL; + const int r_sdl_version = SDL_GetVersion(); + LL_INFOS() << "Running with SDL " + << SDL_VERSIONNUM_MAJOR(r_sdl_version) << "." + << SDL_VERSIONNUM_MINOR(r_sdl_version) << "." + << SDL_VERSIONNUM_MICRO(r_sdl_version) << LL_ENDL; + +#if LL_WINDOWS && defined(LL_SDL_WINDOW) + Uint32 style = 0; +#if defined(CS_BYTEALIGNCLIENT) && defined(CS_OWNDC) + style = (CS_BYTEALIGNCLIENT | CS_OWNDC); +#endif + SDL_RegisterApp(app_name.c_str(), style, nullptr); +#endif + +#if LL_SDL_WINDOW + // For linux we SDL_INIT_VIDEO and _AUDIO + std::initializer_list > hintList = + { + {SDL_HINT_VIDEO_X11_NET_WM_BYPASS_COMPOSITOR,"0"}, + {SDL_HINT_MOUSE_FOCUS_CLICKTHROUGH,"1"}, + {SDL_HINT_MOUSE_EMULATE_WARP_WITH_RELATIVE,"0"}, + {SDL_HINT_KEYCODE_OPTIONS,"french_numbers,latin_letters"} + }; + + for (auto hint: hintList) + { + SDL_SetHint(std::get<0>(hint), std::get<1>(hint)); + } + + std::initializer_list> initList= + { + {SDL_INIT_VIDEO,"SDL_INIT_VIDEO", true}, + {SDL_INIT_JOYSTICK,"SDL_INIT_JOYSTICK", true}, + {SDL_INIT_GAMEPAD,"SDL_INIT_GAMEPAD", true}, + }; +#else + // For non-linux platforms we still SDL_INIT_VIDEO because it is a pre-requisite + // for SDL_INIT_GAMECONTROLLER. + std::initializer_list> initList= + { + {SDL_INIT_VIDEO,"SDL_INIT_VIDEO", false}, + }; +#endif // LL_LINUX + // We SDL_INIT_GAMECONTROLLER later in the startup process to make it + // more likely we'll catch initial SDL_CONTROLLERDEVICEADDED events. + + for (auto subSystem : initList) + { + if (!SDL_InitSubSystem(std::get<0>(subSystem))) + { + LL_WARNS() << "SDL_InitSubSystem for " << std::get<1>(subSystem) << " failed " << SDL_GetError() << LL_ENDL; + + if (std::get<2>(subSystem)) + { + OSMessageBox("SDL_Init() failure", "error", OSMB_OK); + return; + } + } + } +} + +void quit_sdl() +{ +#if LL_WINDOWS && defined(LL_SDL_WINDOW) + SDL_UnregisterApp(); +#endif + SDL_Quit(); +} diff --git a/indra/llwindow/llsdl.h b/indra/llwindow/llsdl.h new file mode 100644 index 0000000000..1a8a12c61c --- /dev/null +++ b/indra/llwindow/llsdl.h @@ -0,0 +1,34 @@ +/** + * @file llsdl.h + * @brief SDL2 initialization + * + * $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$ + */ + +#pragma once + +#include "llpreprocessor.h" + +extern bool gSDLMainHandled; + +void init_sdl(const std::string& app_name); +void quit_sdl(); diff --git a/indra/llwindow/llwindow.cpp b/indra/llwindow/llwindow.cpp index eb11a28360..2313aeda50 100644 --- a/indra/llwindow/llwindow.cpp +++ b/indra/llwindow/llwindow.cpp @@ -29,7 +29,7 @@ #if LL_MESA_HEADLESS #include "llwindowmesaheadless.h" -#elif LL_SDL +#elif LL_SDL_WINDOW #include "llwindowsdl.h" #elif LL_WINDOWS #include "llwindowwin32.h" @@ -39,6 +39,9 @@ #include "llerror.h" #include "llkeyboard.h" +#if LL_SDL_WINDOW && !defined(LL_MESA_HEADLESS) +#include "llsdl.h" +#endif #include "llwindowcallbacks.h" @@ -74,14 +77,15 @@ S32 OSMessageBox(const std::string& text, const std::string& caption, U32 type) LL_WARNS() << "OSMessageBox: " << text << LL_ENDL; #if LL_MESA_HEADLESS // !!! *FIX: (?) return OSBTN_OK; +#elif LL_SDL_WINDOW + result = OSMessageBoxSDL(text, caption, type); #elif LL_WINDOWS result = OSMessageBoxWin32(text, caption, type); #elif LL_DARWIN result = OSMessageBoxMacOSX(text, caption, type); -#elif LL_SDL - result = OSMessageBoxSDL(text, caption, type); #else -#error("OSMessageBox not implemented for this platform!") + LL_WARNS() << "OSMessageBox not implemented for this platform!" << LL_ENDL; + return OSBTN_OK; #endif if (was_visible) @@ -182,12 +186,6 @@ bool LLWindow::dialogColorPicker(F32 *r, F32 *g, F32 *b) return false; } -void *LLWindow::getMediaWindow() -{ - // Default to returning the platform window. - return getPlatformWindow(); -} - bool LLWindow::setSize(LLCoordScreen size) { if (!getMaximized()) @@ -258,12 +256,12 @@ bool LLWindow::copyTextToPrimary(const LLWString &src) // static std::vector LLWindow::getDynamicFallbackFontList() { -#if LL_WINDOWS +#if LL_SDL_WINDOW && !LL_MESA_HEADLESS + return LLWindowSDL::getDynamicFallbackFontList(); +#elif LL_WINDOWS return LLWindowWin32::getDynamicFallbackFontList(); #elif LL_DARWIN return LLWindowMacOSX::getDynamicFallbackFontList(); -#elif LL_SDL - return LLWindowSDL::getDynamicFallbackFontList(); #else return std::vector(); #endif @@ -272,7 +270,9 @@ std::vector LLWindow::getDynamicFallbackFontList() // static std::vector LLWindow::getDisplaysResolutionList() { -#if LL_WINDOWS +#if LL_SDL_WINDOW && !LL_MESA_HEADLESS + return LLWindowSDL::getDisplaysResolutionList(); +#elif LL_WINDOWS return LLWindowWin32::getDisplaysResolutionList(); #elif LL_DARWIN return LLWindowMacOSX::getDisplaysResolutionList(); @@ -341,14 +341,17 @@ bool LLSplashScreen::isVisible() // static LLSplashScreen *LLSplashScreen::create() { -#if LL_MESA_HEADLESS || LL_SDL // !!! *FIX: (?) - return 0; +#if LL_MESA_HEADLESS + return nullptr; +#elif LL_SDL_WINDOW + return new LLSplashScreenSDL; #elif LL_WINDOWS return new LLSplashScreenWin32; #elif LL_DARWIN return new LLSplashScreenMacOSX; #else -#error("LLSplashScreen not implemented on this platform!") + LL_WARNS() << ("LLSplashScreen not implemented on this platform!") << LL_ENDL; + return nullptr; #endif } @@ -358,7 +361,9 @@ void LLSplashScreen::show() { if (!gSplashScreenp) { -#if LL_WINDOWS && !LL_MESA_HEADLESS +#if LL_SDL_WINDOW && !LL_MESA_HEADLESS + gSplashScreenp = new LLSplashScreenSDL; +#elif LL_WINDOWS && !LL_MESA_HEADLESS gSplashScreenp = new LLSplashScreenWin32; #elif LL_DARWIN gSplashScreenp = new LLSplashScreenMacOSX; @@ -412,15 +417,19 @@ LLWindow* LLWindowManager::createWindow( { LLWindow* new_window; +#if LL_SDL_WINDOW && !defined(LL_MESA_HEADLESS) + init_sdl(name); +#endif + if (use_gl) { #if LL_MESA_HEADLESS new_window = new LLWindowMesaHeadless(callbacks, title, name, x, y, width, height, flags, fullscreen, clearBg, enable_vsync, use_gl, ignore_pixel_depth); -#elif LL_SDL +#elif LL_SDL_WINDOW new_window = new LLWindowSDL(callbacks, - title, x, y, width, height, flags, + title, name, x, y, width, height, flags, fullscreen, clearBg, enable_vsync, use_gl, ignore_pixel_depth, fsaa_samples); #elif LL_WINDOWS new_window = new LLWindowWin32(callbacks, @@ -461,6 +470,9 @@ bool LLWindowManager::destroyWindow(LLWindow* window) window->close(); sWindowList.erase(window); +#if LL_SDL_WINDOW && !defined(LL_MESA_HEADLESS) + quit_sdl(); +#endif delete window; diff --git a/indra/llwindow/llwindow.h b/indra/llwindow/llwindow.h index 7a5404e615..2d8fc80b9e 100644 --- a/indra/llwindow/llwindow.h +++ b/indra/llwindow/llwindow.h @@ -92,7 +92,7 @@ public: virtual bool setCursorPosition(LLCoordWindow position) = 0; virtual bool getCursorPosition(LLCoordWindow *position) = 0; -#if LL_WINDOWS +#if LL_WINDOWS && !LL_SDL_WINDOW virtual bool getCursorDelta(LLCoordCommon* delta) = 0; #endif virtual bool isWrapMouse() const = 0; @@ -174,9 +174,6 @@ public: // return a platform-specific window reference (HWND on Windows, WindowRef on the Mac, Gtk window on Linux) virtual void *getPlatformWindow() = 0; -// return the platform-specific window reference we use to initialize llmozlib (HWND on Windows, WindowRef on the Mac, Gtk window on Linux) - virtual void *getMediaWindow(); - // control platform's Language Text Input mechanisms. virtual void allowLanguageTextInput(LLPreeditor *preeditor, bool b) {} virtual void setLanguageTextInput( const LLCoordGL & pos ) {}; diff --git a/indra/llwindow/llwindowheadless.h b/indra/llwindow/llwindowheadless.h index dc7b833013..8b7b0ef55c 100644 --- a/indra/llwindow/llwindowheadless.h +++ b/indra/llwindow/llwindowheadless.h @@ -60,7 +60,7 @@ public: /*virtual*/ void toggleVSync(bool enable_vsync) override { } /*virtual*/ bool setCursorPosition(LLCoordWindow position) override {return false;} /*virtual*/ bool getCursorPosition(LLCoordWindow *position) override {return false;} -#if LL_WINDOWS +#if LL_WINDOWS && !LL_SDL_WINDOW /*virtual*/ bool getCursorDelta(LLCoordCommon* delta) override { return false; } #endif /*virtual*/ bool isWrapMouse() const override { return true; } diff --git a/indra/llwindow/llwindowmesaheadless.h b/indra/llwindow/llwindowmesaheadless.h index 0bf8c46a30..ad08c4f065 100644 --- a/indra/llwindow/llwindowmesaheadless.h +++ b/indra/llwindow/llwindowmesaheadless.h @@ -30,70 +30,74 @@ #if LL_MESA_HEADLESS #include "llwindow.h" -#include "GL/glu.h" #include "GL/osmesa.h" class LLWindowMesaHeadless : public LLWindow { public: - /*virtual*/ void show() {}; - /*virtual*/ void hide() {}; - /*virtual*/ void close() {}; - /*virtual*/ bool getVisible() {return false;}; - /*virtual*/ bool getMinimized() {return false;}; - /*virtual*/ bool getMaximized() {return false;}; - /*virtual*/ bool maximize() {return false;}; - /*virtual*/ void minimize() {}; - /*virtual*/ void restore() {}; - /*virtual*/ bool getFullscreen() {return false;}; - /*virtual*/ bool getPosition(LLCoordScreen *position) {return false;}; - /*virtual*/ bool getSize(LLCoordScreen *size) {return false;}; - /*virtual*/ bool getSize(LLCoordWindow *size) {return false;}; - /*virtual*/ bool setPosition(LLCoordScreen position) {return false;}; - /*virtual*/ bool setSizeImpl(LLCoordScreen size) {return false;}; - /*virtual*/ bool switchContext(bool fullscreen, const LLCoordScreen &size, bool disable_vsync, const LLCoordScreen * const posp = NULL) {return false;}; - /*virtual*/ bool setCursorPosition(LLCoordWindow position) {return false;}; - /*virtual*/ bool getCursorPosition(LLCoordWindow *position) {return false;}; - /*virtual*/ void showCursor() {}; - /*virtual*/ void hideCursor() {}; - /*virtual*/ void showCursorFromMouseMove() {}; - /*virtual*/ void hideCursorUntilMouseMove() {}; - /*virtual*/ bool isCursorHidden() {return false;}; - /*virtual*/ void updateCursor() {}; - //virtual ECursorType getCursor() { return mCurrentCursor; }; - /*virtual*/ void captureMouse() {}; - /*virtual*/ void releaseMouse() {}; - /*virtual*/ void setMouseClipping( bool b ) {}; - /*virtual*/ bool isClipboardTextAvailable() {return false; }; - /*virtual*/ bool pasteTextFromClipboard(LLWString &dst) {return false; }; - /*virtual*/ bool copyTextToClipboard(const LLWString &src) {return false; }; - /*virtual*/ void flashIcon(F32 seconds) {}; - /*virtual*/ F32 getGamma() {return 1.0f; }; - /*virtual*/ bool setGamma(const F32 gamma) {return false; }; // Set the gamma - /*virtual*/ bool restoreGamma() {return false; }; // Restore original gamma table (before updating gamma) - /*virtual*/ void setFSAASamples(const U32 fsaa_samples) { /* FSAA not supported yet on Mesa headless.*/ } - /*virtual*/ U32 getFSAASamples() { return 0; } - //virtual ESwapMethod getSwapMethod() { return mSwapMethod; } - /*virtual*/ void gatherInput() {}; - /*virtual*/ void delayInputProcessing() {}; - /*virtual*/ void swapBuffers(); - /*virtual*/ void restoreGLContext() {}; + void show() override {}; + void hide() override {}; + void close() override {}; + bool getVisible() override {return false;}; + bool getMinimized() override {return false;}; + bool getMaximized() override {return false;}; + bool maximize() override {return false;}; + void minimize() override {}; + void restore() override {}; + bool getFullscreen() {return false;}; + bool getPosition(LLCoordScreen *position) override {return false;}; + bool getSize(LLCoordScreen *size) override {return false;}; + bool getSize(LLCoordWindow *size) override {return false;}; + bool setPosition(LLCoordScreen position) override {return false;}; + bool setSizeImpl(LLCoordScreen size) override {return false;}; + bool switchContext(bool fullscreen, const LLCoordScreen &size, bool disable_vsync, const LLCoordScreen * const posp = NULL) override {return false;}; + bool setCursorPosition(LLCoordWindow position) override {return false;}; + bool getCursorPosition(LLCoordWindow *position) override {return false;}; + void showCursor() override {}; + void hideCursor() override {}; + void showCursorFromMouseMove() override {}; + void hideCursorUntilMouseMove() override {}; + bool isCursorHidden() override {return false;}; + void updateCursor() override {}; + //virtual ECursorType getCursor() override { return mCurrentCursor; }; + void captureMouse() override {}; + void releaseMouse() override {}; + void setMouseClipping( bool b ) override {}; + bool isClipboardTextAvailable() override {return false; }; + bool pasteTextFromClipboard(LLWString &dst) override {return false; }; + bool copyTextToClipboard(const LLWString &src) override {return false; }; + void flashIcon(F32 seconds) override {}; + F32 getGamma() override {return 1.0f; }; + bool setGamma(const F32 gamma) override {return false; }; // Set the gamma + bool restoreGamma() override {return false; }; // Restore original gamma table (before updating gamma) + void setFSAASamples(const U32 fsaa_samples) override { /* FSAA not supported yet on Mesa headless.*/ } + U32 getFSAASamples() override { return 0; } + //virtual ESwapMethod getSwapMethod() override { return mSwapMethod; } + void gatherInput() override {}; + void delayInputProcessing() override {}; + void swapBuffers() override; + + void* createSharedContext()override{return nullptr;}; + void makeContextCurrent(void* context)override{}; + void destroySharedContext(void* context)override{}; + void toggleVSync(bool enable_vsync) override {}; + bool setSizeImpl(LLCoordWindow size) override { return false; }; // handy coordinate space conversion routines - /*virtual*/ bool convertCoords(LLCoordScreen from, LLCoordWindow *to) { return false; }; - /*virtual*/ bool convertCoords(LLCoordWindow from, LLCoordScreen *to) { return false; }; - /*virtual*/ bool convertCoords(LLCoordWindow from, LLCoordGL *to) { return false; }; - /*virtual*/ bool convertCoords(LLCoordGL from, LLCoordWindow *to) { return false; }; - /*virtual*/ bool convertCoords(LLCoordScreen from, LLCoordGL *to) { return false; }; - /*virtual*/ bool convertCoords(LLCoordGL from, LLCoordScreen *to) { return false; }; + bool convertCoords(LLCoordScreen from, LLCoordWindow *to) override { return false; }; + bool convertCoords(LLCoordWindow from, LLCoordScreen *to) override { return false; }; + bool convertCoords(LLCoordWindow from, LLCoordGL *to) override { return false; }; + bool convertCoords(LLCoordGL from, LLCoordWindow *to) override { return false; }; + bool convertCoords(LLCoordScreen from, LLCoordGL *to) override { return false; }; + bool convertCoords(LLCoordGL from, LLCoordScreen *to) override { return false; }; - /*virtual*/ LLWindowResolution* getSupportedResolutions(S32 &num_resolutions) { return NULL; }; - /*virtual*/ F32 getNativeAspectRatio() { return 1.0f; }; - /*virtual*/ F32 getPixelAspectRatio() { return 1.0f; }; - /*virtual*/ void setNativeAspectRatio(F32 ratio) {} + LLWindowResolution* getSupportedResolutions(S32 &num_resolutions) override { return NULL; }; + F32 getNativeAspectRatio() override { return 1.0f; }; + F32 getPixelAspectRatio() override { return 1.0f; }; + void setNativeAspectRatio(F32 ratio) override {} - /*virtual*/ void *getPlatformWindow() { return 0; }; - /*virtual*/ void bringToFront() {}; + void *getPlatformWindow() override { return 0; }; + void bringToFront() override {}; LLWindowMesaHeadless(LLWindowCallbacks* callbacks, const std::string& title, const std::string& name, S32 x, S32 y, S32 width, S32 height, @@ -112,9 +116,9 @@ public: LLSplashScreenMesaHeadless() {}; virtual ~LLSplashScreenMesaHeadless() {}; - /*virtual*/ void showImpl() {}; - /*virtual*/ void updateImpl(const std::string& mesg) {}; - /*virtual*/ void hideImpl() {}; + void showImpl() override {}; + void updateImpl(const std::string& mesg) override {}; + void hideImpl() override {}; }; diff --git a/indra/llwindow/llwindowsdl.cpp b/indra/llwindow/llwindowsdl.cpp index 05be319c0b..57110f8634 100644 --- a/indra/llwindow/llwindowsdl.cpp +++ b/indra/llwindow/llwindowsdl.cpp @@ -25,8 +25,6 @@ * $/LicenseInfo$ */ -#if LL_SDL - #include "linden_common.h" #include "llwindowsdl.h" @@ -39,197 +37,77 @@ #include "llstring.h" #include "lldir.h" #include "llfindlocale.h" +#include "llpreeditor.h" +#include "llsdl.h" -#if LL_GTK -extern "C" { -# include "gtk/gtk.h" -} -#include -#endif // LL_GTK +#ifdef LL_GLIB +#include +#endif +#if LL_LINUX extern "C" { # include "fontconfig/fontconfig.h" } -#if LL_LINUX // not necessarily available on random SDL platforms, so #if LL_LINUX // for execv(), waitpid(), fork() -# include -# include -# include +#include +#include +#include +#include #endif // LL_LINUX -extern bool gDebugWindowProc; +#if LL_DARWIN +#include +#include +#include +#include -const S32 MAX_NUM_RESOLUTIONS = 200; +bool LLWindowSDL::sUseMultGL = false; +#endif -// static variable for ATI mouse cursor crash work-around: -static bool ATIbug = false; +bool gHiDPISupport = true; + +const S32 MAX_NUM_RESOLUTIONS = 200; +const S32 DEFAULT_REFRESH_RATE = 60; // // LLWindowSDL // -#if LL_X11 -# include -#endif //LL_X11 - // 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 = NULL; - - -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(); - } -} - - -#if LL_GTK -// Lazily initialize and check the runtime GTK version for goodness. -// static -bool LLWindowSDL::ll_try_gtk_init(void) -{ - static bool done_gtk_diag = false; - static bool gtk_is_good = false; - static bool done_setlocale = false; - static bool tried_gtk_init = false; - - if (!done_setlocale) - { - LL_INFOS() << "Starting GTK Initialization." << LL_ENDL; - maybe_lock_display(); - gtk_disable_setlocale(); - maybe_unlock_display(); - done_setlocale = true; - } - - if (!tried_gtk_init) - { - tried_gtk_init = true; - if (!g_thread_supported ()) g_thread_init (NULL); - maybe_lock_display(); - gtk_is_good = gtk_init_check(NULL, NULL); - maybe_unlock_display(); - if (!gtk_is_good) - LL_WARNS() << "GTK Initialization failed." << LL_ENDL; - } - - if (gtk_is_good && !done_gtk_diag) - { - LL_INFOS() << "GTK Initialized." << LL_ENDL; - LL_INFOS() << "- Compiled against GTK version " - << GTK_MAJOR_VERSION << "." - << GTK_MINOR_VERSION << "." - << GTK_MICRO_VERSION << LL_ENDL; - LL_INFOS() << "- Running against GTK version " - << gtk_major_version << "." - << gtk_minor_version << "." - << gtk_micro_version << LL_ENDL; - maybe_lock_display(); - const gchar* gtk_warning = gtk_check_version( - GTK_MAJOR_VERSION, - GTK_MINOR_VERSION, - GTK_MICRO_VERSION); - maybe_unlock_display(); - if (gtk_warning) - { - LL_WARNS() << "- GTK COMPATIBILITY WARNING: " << - gtk_warning << LL_ENDL; - gtk_is_good = false; - } else { - LL_INFOS() << "- GTK version is good." << LL_ENDL; - } - - done_gtk_diag = true; - } - - return gtk_is_good; -} -#endif // LL_GTK - - -#if LL_X11 -// static -Window LLWindowSDL::get_SDL_XWindowID(void) -{ - if (gWindowImplementation) { - return gWindowImplementation->mSDL_XWindowID; - } - return None; -} - -//static -Display* LLWindowSDL::get_SDL_Display(void) -{ - if (gWindowImplementation) { - return gWindowImplementation->mSDL_Display; - } - return NULL; -} -#endif // LL_X11 - +static LLWindowSDL *gWindowImplementation = nullptr; LLWindowSDL::LLWindowSDL(LLWindowCallbacks* callbacks, - const std::string& title, S32 x, S32 y, S32 width, - S32 height, U32 flags, - bool fullscreen, bool clearBg, - bool disable_vsync, bool use_gl, - bool ignore_pixel_depth, U32 fsaa_samples) - : LLWindow(callbacks, fullscreen, flags), - Lock_Display(NULL), - Unlock_Display(NULL), mGamma(1.0f) + const std::string& title, const std::string& name, S32 x, S32 y, S32 width, + S32 height, U32 flags, + bool fullscreen, bool clearBg, + bool enable_vsync, bool use_gl, + bool ignore_pixel_depth, U32 fsaa_samples) + : LLWindow(callbacks, fullscreen, flags), + mGamma(1.0f), mFlashing(false) { + SDL_GL_LoadLibrary(nullptr); + // Initialize the keyboard gKeyboard = new LLKeyboardSDL(); gKeyboard->setCallbacks(callbacks); - // Note that we can't set up key-repeat until after SDL has init'd video - - // Ignore use_gl for now, only used for drones on PC - mWindow = NULL; - mNeedsResize = false; - mOverrideAspectRatio = 0.f; - mGrabbyKeyFlags = 0; - mReallyCapturedCount = 0; - mHaveInputFocus = -1; - mIsMinimized = -1; - mFSAASamples = fsaa_samples; - -#if LL_X11 - mSDL_XWindowID = None; - mSDL_Display = NULL; -#endif // LL_X11 - -#if LL_GTK - // We MUST be the first to initialize GTK so that GTK doesn't get badly - // initialized with a non-C locale and cause lots of serious random - // weirdness. - ll_try_gtk_init(); -#endif // LL_GTK // Assume 4:3 aspect ratio until we know better - mOriginalAspectRatio = 1024.0 / 768.0; + mNativeAspectRatio = 1024.f / 768.f; if (title.empty()) - mWindowTitle = "SDL Window"; // *FIX: (?) + mWindowTitle = "Second Life"; else mWindowTitle = title; // Create the GL context and set it up for windowed or fullscreen, as appropriate. - if(createContext(x, y, width, height, 32, fullscreen, disable_vsync)) + if(createContext(x, y, width, height, 32, fullscreen, enable_vsync)) { + gGLManager.initWGL(); gGLManager.initGL(); //start with arrow cursor @@ -241,14 +119,6 @@ LLWindowSDL::LLWindowSDL(LLWindowCallbacks* callbacks, // Stash an object pointer for OSMessageBox() gWindowImplementation = this; - -#if LL_X11 - mFlashing = false; -#endif // LL_X11 - - mKeyScanCode = 0; - mKeyVirtualKey = 0; - mKeyModifiers = KMOD_NONE; } static SDL_Surface *Load_BMP_Resource(const char *basename) @@ -258,480 +128,297 @@ static SDL_Surface *Load_BMP_Resource(const char *basename) // Figure out where our BMP is living on the disk snprintf(path_buffer, PATH_BUFFER_SIZE-1, "%s%sres-sdl%s%s", - gDirUtilp->getAppRODataDir().c_str(), - gDirUtilp->getDirDelimiter().c_str(), - gDirUtilp->getDirDelimiter().c_str(), - basename); + gDirUtilp->getAppRODataDir().c_str(), + gDirUtilp->getDirDelimiter().c_str(), + gDirUtilp->getDirDelimiter().c_str(), + basename); path_buffer[PATH_BUFFER_SIZE-1] = '\0'; return SDL_LoadBMP(path_buffer); } -#if LL_X11 -// This is an XFree86/XOrg-specific hack for detecting the amount of Video RAM -// on this machine. It works by searching /var/log/var/log/Xorg.?.log or -// /var/log/XFree86.?.log for a ': (VideoRAM ?|Memory): (%d+) kB' regex, where -// '?' is the X11 display number derived from $DISPLAY -static int x11_detect_VRAM_kb_fp(FILE *fp, const char *prefix_str) -{ - const int line_buf_size = 1000; - char line_buf[line_buf_size]; - while (fgets(line_buf, line_buf_size, fp)) - { - //LL_DEBUGS() << "XLOG: " << line_buf << LL_ENDL; - - // Why the ad-hoc parser instead of using a regex? Our - // favourite regex implementation - libboost_regex - is - // quite a heavy and troublesome dependency for the client, so - // it seems a shame to introduce it for such a simple task. - // *FIXME: libboost_regex is a dependency now anyway, so we may - // as well use it instead of this hand-rolled nonsense. - const char *part1_template = prefix_str; - const char part2_template[] = " kB"; - char *part1 = strstr(line_buf, part1_template); - if (part1) // found start of matching line - { - part1 = &part1[strlen(part1_template)]; // -> after - char *part2 = strstr(part1, part2_template); - if (part2) // found end of matching line - { - // now everything between part1 and part2 is - // supposed to be numeric, describing the - // number of kB of Video RAM supported - int rtn = 0; - for (; part1 < part2; ++part1) - { - if (*part1 < '0' || *part1 > '9') - { - // unexpected char, abort parse - rtn = 0; - break; - } - rtn *= 10; - rtn += (*part1) - '0'; - } - if (rtn > 0) - { - // got the kB number. return it now. - return rtn; - } - } - } - } - return 0; // 'could not detect' +void LLWindowSDL::setTitle(const std::string title) +{ + SDL_SetWindowTitle( mWindow, title.c_str() ); } -static int x11_detect_VRAM_kb() +void LLWindowSDL::tryFindFullscreenSize( int &width, int &height ) { - std::string x_log_location("/var/log/"); - std::string fname; - int rtn = 0; // 'could not detect' - int display_num = 0; - FILE *fp; - char *display_env = getenv("DISPLAY"); // e.g. :0 or :0.0 or :1.0 etc - // parse DISPLAY number so we can go grab the right log file - if (display_env[0] == ':' && - display_env[1] >= '0' && display_env[1] <= '9') - { - display_num = display_env[1] - '0'; - } + LL_INFOS() << "createContext: setting up fullscreen " << width << "x" << height << LL_ENDL; - // *TODO: we could be smarter and see which of Xorg/XFree86 has the - // freshest time-stamp. - - // Try Xorg log first - fname = x_log_location; - fname += "Xorg."; - fname += ('0' + display_num); - fname += ".log"; - fp = fopen(fname.c_str(), "r"); - if (fp) + // If the requested width or height is 0, find the best default for the monitor. + if(width == 0 || height == 0) { - LL_INFOS() << "Looking in " << fname - << " for VRAM info..." << LL_ENDL; - rtn = x11_detect_VRAM_kb_fp(fp, ": VideoRAM: "); - fclose(fp); - if (0 == rtn) + // Scan through the list of modes, looking for one which has: + // height between 700 and 800 + // aspect ratio closest to the user's original mode + S32 resolutionCount = 0; + LLWindowResolution *resolutionList = getSupportedResolutions(resolutionCount); + + if(resolutionList != nullptr) { - fp = fopen(fname.c_str(), "r"); - if (fp) + F32 closestAspect = 0; + U32 closestHeight = 0; + U32 closestWidth = 0; + + LL_INFOS() << "createContext: searching for a display mode, original aspect is " << mNativeAspectRatio << LL_ENDL; + + for(S32 i=0; i < resolutionCount; i++) { - rtn = x11_detect_VRAM_kb_fp(fp, ": Video RAM: "); - fclose(fp); - if (0 == rtn) + F32 aspect = (F32)resolutionList[i].mWidth / (F32)resolutionList[i].mHeight; + + LL_INFOS() << "createContext: width " << resolutionList[i].mWidth << " height " << resolutionList[i].mHeight << " aspect " << aspect << LL_ENDL; + + if( (resolutionList[i].mHeight >= 700) && (resolutionList[i].mHeight <= 800) && + (fabs(aspect - mNativeAspectRatio) < fabs(closestAspect - mNativeAspectRatio))) { - fp = fopen(fname.c_str(), "r"); - if (fp) - { - rtn = x11_detect_VRAM_kb_fp(fp, ": Memory: "); - fclose(fp); - } + LL_INFOS() << " (new closest mode) " << LL_ENDL; + + // This is the closest mode we've seen yet. + closestWidth = resolutionList[i].mWidth; + closestHeight = resolutionList[i].mHeight; + closestAspect = aspect; } } + + width = closestWidth; + height = closestHeight; } } - else + + if(width == 0 || height == 0) { - LL_INFOS() << "Could not open " << fname - << " - skipped." << LL_ENDL; - // Try old XFree86 log otherwise - fname = x_log_location; - fname += "XFree86."; - fname += ('0' + display_num); - fname += ".log"; - fp = fopen(fname.c_str(), "r"); - if (fp) - { - LL_INFOS() << "Looking in " << fname - << " for VRAM info..." << LL_ENDL; - rtn = x11_detect_VRAM_kb_fp(fp, ": VideoRAM: "); - fclose(fp); - if (0 == rtn) - { - fp = fopen(fname.c_str(), "r"); - if (fp) - { - rtn = x11_detect_VRAM_kb_fp(fp, ": Memory: "); - fclose(fp); - } - } - } - else - { - LL_INFOS() << "Could not open " << fname - << " - skipped." << LL_ENDL; - } + // Mode search failed for some reason. Use the old-school default. + width = 1024; + height = 768; } - return rtn; } -#endif // LL_X11 -bool LLWindowSDL::createContext(int x, int y, int width, int height, int bits, bool fullscreen, bool disable_vsync) +bool LLWindowSDL::createContext(int x, int y, int width, int height, int bits, bool fullscreen, bool enable_vsync) { - //bool glneedsinit = false; - - LL_INFOS() << "createContext, fullscreen=" << fullscreen << - " size=" << width << "x" << height << LL_ENDL; + LL_INFOS() << "createContext, fullscreen=" << fullscreen << " size=" << width << "x" << height << LL_ENDL; // captures don't survive contexts mGrabbyKeyFlags = 0; - mReallyCapturedCount = 0; - - if (SDL_Init(SDL_INIT_VIDEO) < 0) - { - LL_INFOS() << "sdl_init() failed! " << SDL_GetError() << LL_ENDL; - setupFailure("sdl_init() failure, window creation error", "error", OSMB_OK); - return false; - } - - SDL_version c_sdl_version; - SDL_VERSION(&c_sdl_version); - LL_INFOS() << "Compiled against SDL " - << int(c_sdl_version.major) << "." - << int(c_sdl_version.minor) << "." - << int(c_sdl_version.patch) << LL_ENDL; - const SDL_version *r_sdl_version; - r_sdl_version = SDL_Linked_Version(); - LL_INFOS() << " Running against SDL " - << int(r_sdl_version->major) << "." - << int(r_sdl_version->minor) << "." - << int(r_sdl_version->patch) << LL_ENDL; - - const SDL_VideoInfo *video_info = SDL_GetVideoInfo( ); - if (!video_info) - { - LL_INFOS() << "SDL_GetVideoInfo() failed! " << SDL_GetError() << LL_ENDL; - setupFailure("SDL_GetVideoInfo() failed, Window creation error", "Error", OSMB_OK); - return false; - } - - if (video_info->current_h > 0) - { - mOriginalAspectRatio = (float)video_info->current_w / (float)video_info->current_h; - LL_INFOS() << "Original aspect ratio was " << video_info->current_w << ":" << video_info->current_h << "=" << mOriginalAspectRatio << LL_ENDL; - } - SDL_EnableUNICODE(1); - SDL_WM_SetCaption(mWindowTitle.c_str(), mWindowTitle.c_str()); - - // Set the application icon. - SDL_Surface *bmpsurface; - bmpsurface = Load_BMP_Resource("ll_icon.BMP"); - if (bmpsurface) - { - // This attempts to give a black-keyed mask to the icon. - SDL_SetColorKey(bmpsurface, - SDL_SRCCOLORKEY, - SDL_MapRGB(bmpsurface->format, 0,0,0) ); - SDL_WM_SetIcon(bmpsurface, NULL); - // The SDL examples cheerfully avoid freeing the icon - // surface, but I'm betting that's leaky. - SDL_FreeSurface(bmpsurface); - bmpsurface = NULL; - } - - // note: these SetAttributes make Tom's 9600-on-AMD64 fail to - // get a visual, but it's broken anyway when it does, and without - // these SetAttributes we might easily get an avoidable substandard - // visual to work with on most other machines. - SDL_GL_SetAttribute(SDL_GL_RED_SIZE, 8); - SDL_GL_SetAttribute(SDL_GL_GREEN_SIZE,8); - SDL_GL_SetAttribute(SDL_GL_BLUE_SIZE, 8); - SDL_GL_SetAttribute(SDL_GL_DEPTH_SIZE, (bits <= 16) ? 16 : 24); - // We need stencil support for a few (minor) things. - if (!getenv("LL_GL_NO_STENCIL")) - SDL_GL_SetAttribute(SDL_GL_STENCIL_SIZE, 8); - SDL_GL_SetAttribute(SDL_GL_ALPHA_SIZE, (bits <= 16) ? 1 : 8); - - // *FIX: try to toggle vsync here? + if (width == 0) + width = 1024; + if (height == 0) + width = 768; + if (x == 0) + x = SDL_WINDOWPOS_UNDEFINED; + if (y == 0) + y = SDL_WINDOWPOS_UNDEFINED; mFullscreen = fullscreen; - int sdlflags = SDL_OPENGL | SDL_RESIZABLE | SDL_ANYFORMAT; + // Setup default backing colors + GLint redBits{8}, greenBits{8}, blueBits{8}, alphaBits{8}; + GLint depthBits{24}, stencilBits{8}; + SDL_GL_SetAttribute(SDL_GL_RED_SIZE, redBits); + SDL_GL_SetAttribute(SDL_GL_GREEN_SIZE, greenBits); + SDL_GL_SetAttribute(SDL_GL_BLUE_SIZE, blueBits); + SDL_GL_SetAttribute(SDL_GL_ALPHA_SIZE, alphaBits); + SDL_GL_SetAttribute(SDL_GL_DEPTH_SIZE, depthBits); + SDL_GL_SetAttribute(SDL_GL_STENCIL_SIZE, stencilBits); SDL_GL_SetAttribute(SDL_GL_DOUBLEBUFFER, 1); - if (mFSAASamples > 0) + if(LLRender::sGLCoreProfile) { - SDL_GL_SetAttribute(SDL_GL_MULTISAMPLEBUFFERS, 1); - SDL_GL_SetAttribute(SDL_GL_MULTISAMPLESAMPLES, mFSAASamples); - } +#if LL_DARWIN + SDL_GL_SetAttribute(SDL_GL_CONTEXT_MAJOR_VERSION, 3); + SDL_GL_SetAttribute(SDL_GL_CONTEXT_MINOR_VERSION, 2); +#endif - mSDLFlags = sdlflags; + SDL_GL_SetAttribute(SDL_GL_CONTEXT_PROFILE_MASK, SDL_GL_CONTEXT_PROFILE_CORE); + } - if (mFullscreen) + SDL_GLContextFlag context_flags{}; + if (gDebugGL) { - LL_INFOS() << "createContext: setting up fullscreen " << width << "x" << height << LL_ENDL; - - // If the requested width or height is 0, find the best default for the monitor. - if((width == 0) || (height == 0)) - { - // Scan through the list of modes, looking for one which has: - // height between 700 and 800 - // aspect ratio closest to the user's original mode - S32 resolutionCount = 0; - LLWindowResolution *resolutionList = getSupportedResolutions(resolutionCount); - - if(resolutionList != NULL) - { - F32 closestAspect = 0; - U32 closestHeight = 0; - U32 closestWidth = 0; - int i; - - LL_INFOS() << "createContext: searching for a display mode, original aspect is " << mOriginalAspectRatio << LL_ENDL; - - for(i=0; i < resolutionCount; i++) - { - F32 aspect = (F32)resolutionList[i].mWidth / (F32)resolutionList[i].mHeight; + context_flags |= SDL_GL_CONTEXT_DEBUG_FLAG; + } - LL_INFOS() << "createContext: width " << resolutionList[i].mWidth << " height " << resolutionList[i].mHeight << " aspect " << aspect << LL_ENDL; +#if LL_DARWIN + context_flags |= SDL_GL_CONTEXT_FORWARD_COMPATIBLE_FLAG; +#endif + SDL_GL_SetAttribute(SDL_GL_CONTEXT_FLAGS, context_flags); + SDL_GL_SetAttribute(SDL_GL_SHARE_WITH_CURRENT_CONTEXT, 1); - if( (resolutionList[i].mHeight >= 700) && (resolutionList[i].mHeight <= 800) && - (fabs(aspect - mOriginalAspectRatio) < fabs(closestAspect - mOriginalAspectRatio))) - { - LL_INFOS() << " (new closest mode) " << LL_ENDL; + if(mFullscreen) + { + tryFindFullscreenSize( width, height ); + } - // This is the closest mode we've seen yet. - closestWidth = resolutionList[i].mWidth; - closestHeight = resolutionList[i].mHeight; - closestAspect = aspect; - } - } + SDL_PropertiesID props = SDL_CreateProperties(); + SDL_SetStringProperty(props, SDL_PROP_WINDOW_CREATE_TITLE_STRING, mWindowTitle.c_str()); + SDL_SetNumberProperty(props, SDL_PROP_WINDOW_CREATE_X_NUMBER, x); + SDL_SetNumberProperty(props, SDL_PROP_WINDOW_CREATE_Y_NUMBER, y); + SDL_SetNumberProperty(props, SDL_PROP_WINDOW_CREATE_WIDTH_NUMBER, width); + SDL_SetNumberProperty(props, SDL_PROP_WINDOW_CREATE_HEIGHT_NUMBER, height); + SDL_SetBooleanProperty(props, SDL_PROP_WINDOW_CREATE_RESIZABLE_BOOLEAN, true); + SDL_SetBooleanProperty(props, SDL_PROP_WINDOW_CREATE_OPENGL_BOOLEAN, true); + SDL_SetBooleanProperty(props, SDL_PROP_WINDOW_CREATE_FULLSCREEN_BOOLEAN, mFullscreen); + SDL_SetBooleanProperty(props, SDL_PROP_WINDOW_CREATE_HIDDEN_BOOLEAN, true); + SDL_SetBooleanProperty(props, SDL_PROP_WINDOW_CREATE_HIGH_PIXEL_DENSITY_BOOLEAN, gHiDPISupport); - width = closestWidth; - height = closestHeight; - } - } + mWindow = SDL_CreateWindowWithProperties(props); + if (mWindow == nullptr) + { + LL_WARNS() << "Window creation failure. SDL: " << SDL_GetError() << LL_ENDL; + setupFailure("Window creation error", "Error", OSMB_OK); + return false; + } + SDL_DestroyProperties(props); // Free properties once window is created - if((width == 0) || (height == 0)) - { - // Mode search failed for some reason. Use the old-school default. - width = 1024; - height = 768; - } + // Create the context + mContext = SDL_GL_CreateContext(mWindow); + if(!mContext) + { + LL_WARNS() << "Cannot create GL context " << SDL_GetError() << LL_ENDL; + setupFailure("GL Context creation error", "Error", OSMB_OK); + return false; + } - mWindow = SDL_SetVideoMode(width, height, bits, sdlflags | SDL_FULLSCREEN); - if (!mWindow && bits > 16) - { - SDL_GL_SetAttribute(SDL_GL_DEPTH_SIZE, 16); - mWindow = SDL_SetVideoMode(width, height, bits, sdlflags | SDL_FULLSCREEN); - } + if (!SDL_GL_MakeCurrent(mWindow, mContext)) + { + LL_WARNS() << "Failed to make context current. SDL: " << SDL_GetError() << LL_ENDL; + setupFailure("GL Context failed to set current failure", "Error", OSMB_OK); + return false; + } - if (mWindow) + const SDL_DisplayMode* displayMode = SDL_GetCurrentDisplayMode(SDL_GetDisplayForWindow(mWindow)); + if(displayMode) + { + mRefreshRate = ll_round(displayMode->refresh_rate); + mNativeAspectRatio = ((F32)displayMode->w) / ((F32)displayMode->h); + if(mFullscreen) { - mFullscreen = true; - mFullscreenWidth = mWindow->w; - mFullscreenHeight = mWindow->h; - mFullscreenBits = mWindow->format->BitsPerPixel; - mFullscreenRefresh = -1; + mFullscreenWidth = displayMode->w; + mFullscreenHeight = displayMode->h; + mFullscreenRefresh = ll_round(displayMode->refresh_rate); LL_INFOS() << "Running at " << mFullscreenWidth - << "x" << mFullscreenHeight - << "x" << mFullscreenBits - << " @ " << mFullscreenRefresh - << LL_ENDL; - } - else - { - LL_WARNS() << "createContext: fullscreen creation failure. SDL: " << SDL_GetError() << LL_ENDL; - // No fullscreen support - mFullscreen = false; - mFullscreenWidth = -1; - mFullscreenHeight = -1; - mFullscreenBits = -1; - mFullscreenRefresh = -1; - - std::string error = llformat("Unable to run fullscreen at %d x %d.\nRunning in window.", width, height); - OSMessageBox(error, "Error", OSMB_OK); + << "x" << mFullscreenHeight + << " @ " << mFullscreenRefresh + << LL_ENDL; } } - - if(!mFullscreen && (mWindow == NULL)) + else { - if (width == 0) - width = 1024; - if (height == 0) - width = 768; - - LL_INFOS() << "createContext: creating window " << width << "x" << height << "x" << bits << LL_ENDL; - mWindow = SDL_SetVideoMode(width, height, bits, sdlflags); - if (!mWindow && bits > 16) + LL_WARNS() << "Failed to get current display mode and refresh rate" << LL_ENDL; + mRefreshRate = 0; + mNativeAspectRatio = 1024.f / 768.f; + if(mFullscreen) // Fallback to window size { - SDL_GL_SetAttribute(SDL_GL_DEPTH_SIZE, 16); - mWindow = SDL_SetVideoMode(width, height, bits, sdlflags); - } - - if (!mWindow) - { - LL_WARNS() << "createContext: window creation failure. SDL: " << SDL_GetError() << LL_ENDL; - setupFailure("Window creation error", "Error", OSMB_OK); - return false; + SDL_GetWindowSize(mWindow, &mFullscreenWidth, &mFullscreenHeight); + mFullscreenRefresh = -1; } - } else if (!mFullscreen && (mWindow != NULL)) - { - LL_INFOS() << "createContext: SKIPPING - !fullscreen, but +mWindow " << width << "x" << height << "x" << bits << LL_ENDL; } - // Detect video memory size. -# if LL_X11 - gGLManager.mVRAM = x11_detect_VRAM_kb() / 1024; - if (gGLManager.mVRAM != 0) + if(mRefreshRate == 0) // We failed to get a valid refresh rate above { - LL_INFOS() << "X11 log-parser detected " << gGLManager.mVRAM << "MB VRAM." << LL_ENDL; - } else -# endif // LL_X11 - { - // fallback to letting SDL detect VRAM. - // note: I've not seen SDL's detection ever actually find - // VRAM != 0, but if SDL *does* detect it then that's a bonus. - gGLManager.mVRAM = video_info->video_mem / 1024; - if (gGLManager.mVRAM != 0) - { - LL_INFOS() << "SDL detected " << gGLManager.mVRAM << "MB VRAM." << LL_ENDL; - } + mRefreshRate = DEFAULT_REFRESH_RATE; } - // If VRAM is not detected, that is handled later - // *TODO: Now would be an appropriate time to check for some - // explicitly unsupported cards. - //const char* RENDERER = (const char*) glGetString(GL_RENDERER); - - GLint depthBits, stencilBits, redBits, greenBits, blueBits, alphaBits; - - glGetIntegerv(GL_RED_BITS, &redBits); - glGetIntegerv(GL_GREEN_BITS, &greenBits); - glGetIntegerv(GL_BLUE_BITS, &blueBits); - glGetIntegerv(GL_ALPHA_BITS, &alphaBits); - glGetIntegerv(GL_DEPTH_BITS, &depthBits); - glGetIntegerv(GL_STENCIL_BITS, &stencilBits); + SDL_GL_GetAttribute(SDL_GL_RED_SIZE, &redBits); + SDL_GL_GetAttribute(SDL_GL_GREEN_SIZE, &greenBits); + SDL_GL_GetAttribute(SDL_GL_BLUE_SIZE, &blueBits); + SDL_GL_GetAttribute(SDL_GL_ALPHA_SIZE, &alphaBits); + SDL_GL_GetAttribute(SDL_GL_DEPTH_SIZE, &depthBits); + SDL_GL_GetAttribute(SDL_GL_STENCIL_SIZE, &stencilBits); LL_INFOS() << "GL buffer:" << LL_ENDL; - LL_INFOS() << " Red Bits " << S32(redBits) << LL_ENDL; - LL_INFOS() << " Green Bits " << S32(greenBits) << LL_ENDL; - LL_INFOS() << " Blue Bits " << S32(blueBits) << LL_ENDL; - LL_INFOS() << " Alpha Bits " << S32(alphaBits) << LL_ENDL; - LL_INFOS() << " Depth Bits " << S32(depthBits) << LL_ENDL; - LL_INFOS() << " Stencil Bits " << S32(stencilBits) << LL_ENDL; + LL_INFOS() << " Red Bits " << S32(redBits) << LL_ENDL; + LL_INFOS() << " Green Bits " << S32(greenBits) << LL_ENDL; + LL_INFOS() << " Blue Bits " << S32(blueBits) << LL_ENDL; + LL_INFOS() << " Alpha Bits " << S32(alphaBits) << LL_ENDL; + LL_INFOS() << " Depth Bits " << S32(depthBits) << LL_ENDL; + LL_INFOS() << " Stencil Bits " << S32(stencilBits) << LL_ENDL; GLint colorBits = redBits + greenBits + blueBits + alphaBits; - // fixme: actually, it's REALLY important for picking that we get at - // least 8 bits each of red,green,blue. Alpha we can be a bit more - // relaxed about if we have to. if (colorBits < 32) { - close(); setupFailure( - "Second Life requires True Color (32-bit) to run in a window.\n" - "Please go to Control Panels -> Display -> Settings and\n" - "set the screen to 32-bit color.\n" - "Alternately, if you choose to run fullscreen, Second Life\n" - "will automatically adjust the screen each time it runs.", - "Error", - OSMB_OK); + "Second Life requires True Color (32-bit) to run in a window.\n" + "Please go to Control Panels -> Display -> Settings and\n" + "set the screen to 32-bit color.\n" + "Alternately, if you choose to run fullscreen, Second Life\n" + "will automatically adjust the screen each time it runs.", + "Error", + OSMB_OK); return false; } -#if 0 // *FIX: we're going to brave it for now... - if (alphaBits < 8) - { - close(); - setupFailure( - "Second Life is unable to run because it can't get an 8 bit alpha\n" - "channel. Usually this is due to video card driver issues.\n" - "Please make sure you have the latest video card drivers installed.\n" - "Also be sure your monitor is set to True Color (32-bit) in\n" - "Control Panels -> Display -> Settings.\n" - "If you continue to receive this message, contact customer service.", - "Error", - OSMB_OK); - return false; - } + LL_PROFILER_GPU_CONTEXT; + + // Enable vertical sync + toggleVSync(enable_vsync); + +#if LL_DARWIN + setUseMultGL(sUseMultGL); + + // Get vram via CGL on macos + gGLManager.mVRAM = getVramSize(); #endif -#if LL_X11 - /* Grab the window manager specific information */ - SDL_SysWMinfo info; - SDL_VERSION(&info.version); - if ( SDL_GetWMInfo(&info) ) + // Set the application icon. + SDL_Surface* bmpsurface = Load_BMP_Resource("ll_icon.BMP"); + if (bmpsurface) { - /* Save the information for later use */ - if ( info.subsystem == SDL_SYSWM_X11 ) - { - mSDL_Display = info.info.x11.display; - mSDL_XWindowID = info.info.x11.wmwindow; - Lock_Display = info.info.x11.lock_func; - Unlock_Display = info.info.x11.unlock_func; - } - else - { - LL_WARNS() << "We're not running under X11? Wild." - << LL_ENDL; - } + SDL_SetWindowIcon(mWindow, bmpsurface); + SDL_DestroySurface(bmpsurface); + bmpsurface = nullptr; } - else + + SDL_StartTextInput(mWindow); + return true; +} + +void* LLWindowSDL::createSharedContext() +{ + SDL_GLContext pContext = SDL_GL_CreateContext(mWindow); + if (pContext) { - LL_WARNS() << "We're not running under any known WM. Wild." - << LL_ENDL; + // HACK to ensure windows GL context is set correctly when threaded - Rye + SDL_GL_MakeCurrent(mWindow, pContext); + SDL_GL_MakeCurrent(mWindow, mContext); + LL_DEBUGS() << "Creating shared OpenGL context successful!" << LL_ENDL; + return (void*)pContext; } -#endif // LL_X11 + LL_WARNS() << "Creating shared OpenGL context failed!" << LL_ENDL; + return nullptr; +} - //make sure multisampling is disabled by default - glDisable(GL_MULTISAMPLE_ARB); - - // We need to do this here, once video is init'd - if (-1 == SDL_EnableKeyRepeat(SDL_DEFAULT_REPEAT_DELAY, - SDL_DEFAULT_REPEAT_INTERVAL)) - LL_WARNS() << "Couldn't enable key-repeat: " << SDL_GetError() <mX = 0; - position->mY = 0; - return true; + if (mWindow) + { + SDL_GetWindowPosition(mWindow, &position->mX, &position->mY); + return true; + } + return false; } bool LLWindowSDL::getSize(LLCoordScreen *size) { if (mWindow) { - size->mX = mWindow->w; - size->mY = mWindow->h; - return (true); + SDL_GetWindowSize(mWindow, &size->mX, &size->mY); + return true; } - return (false); + return false; } bool LLWindowSDL::getSize(LLCoordWindow *size) { if (mWindow) { - size->mX = mWindow->w; - size->mY = mWindow->h; - return (true); + SDL_GetWindowSizeInPixels(mWindow, &size->mX, &size->mY); + return true; } - return (false); + return false; } bool LLWindowSDL::setPosition(const LLCoordScreen position) { - if(mWindow) + if (mWindow) { - // *FIX: (?) - //MacMoveWindow(mWindow, position.mX, position.mY, false); + SDL_SetWindowPosition(mWindow, position.mX, position.mY); + return true; } - return true; + return false; } -bool LLWindowSDL::setSizeImpl(const LLCoordScreen size) +template< typename T > bool setSizeImpl( const T& newSize, SDL_Window *pWin ) { - if(mWindow) - { - // Push a resize event onto SDL's queue - we'll handle it - // when it comes out again. - SDL_Event event; - event.type = SDL_VIDEORESIZE; - event.resize.w = size.mX; - event.resize.h = size.mY; - SDL_PushEvent(&event); // copied into queue + if( !pWin ) + return false; - return true; - } + SDL_WindowFlags winFlags = SDL_GetWindowFlags(pWin); - return false; + if( winFlags & SDL_WINDOW_MAXIMIZED) + SDL_RestoreWindow(pWin); + + SDL_SetWindowSize(pWin, newSize.mX, newSize.mY); + return true; } -bool LLWindowSDL::setSizeImpl(const LLCoordWindow size) +bool LLWindowSDL::setSizeImpl(const LLCoordScreen size) { - if(mWindow) - { - // Push a resize event onto SDL's queue - we'll handle it - // when it comes out again. - SDL_Event event; - event.type = SDL_VIDEORESIZE; - event.resize.w = size.mX; - event.resize.h = size.mY; - SDL_PushEvent(&event); // copied into queue - - return true; - } + return ::setSizeImpl( size, mWindow ); +} - return false; +bool LLWindowSDL::setSizeImpl(const LLCoordWindow size) +{ + return ::setSizeImpl( size, mWindow ); } @@ -968,8 +667,9 @@ void LLWindowSDL::swapBuffers() { if (mWindow) { - SDL_GL_SwapBuffers(); + SDL_GL_SwapWindow(mWindow); } + LL_PROFILER_GPU_COLLECT; } U32 LLWindowSDL::getFSAASamples() @@ -984,22 +684,23 @@ void LLWindowSDL::setFSAASamples(const U32 samples) F32 LLWindowSDL::getGamma() { - return 1/mGamma; + return 1.f / mGamma; } bool LLWindowSDL::restoreGamma() { - //CGDisplayRestoreColorSyncSettings(); - SDL_SetGamma(1.0f, 1.0f, 1.0f); return true; } bool LLWindowSDL::setGamma(const F32 gamma) { - mGamma = gamma; - if (mGamma == 0) mGamma = 0.1f; - mGamma = 1/mGamma; - SDL_SetGamma(mGamma, mGamma, mGamma); + if (mWindow) + { + mGamma = gamma; + if (mGamma == 0) + mGamma = 0.1f; + mGamma = 1.f / mGamma; + } return true; } @@ -1008,12 +709,13 @@ bool LLWindowSDL::isCursorHidden() return mCursorHidden; } - - // Constrains the mouse to the window. -void LLWindowSDL::setMouseClipping( bool b ) +void LLWindowSDL::setMouseClipping(bool b) { - //SDL_WM_GrabInput(b ? SDL_GRAB_ON : SDL_GRAB_OFF); + if (mWindow) + { + SDL_SetWindowMouseGrab(mWindow, b); + } } // virtual @@ -1021,38 +723,16 @@ void LLWindowSDL::setMinSize(U32 min_width, U32 min_height, bool enforce_immedia { LLWindow::setMinSize(min_width, min_height, enforce_immediately); -#if LL_X11 - // Set the minimum size limits for X11 window - // so the window manager doesn't allow resizing below those limits. - XSizeHints* hints = XAllocSizeHints(); - hints->flags |= PMinSize; - hints->min_width = mMinWindowWidth; - hints->min_height = mMinWindowHeight; - - XSetWMNormalHints(mSDL_Display, mSDL_XWindowID, hints); - - XFree(hints); -#endif + if (mWindow && min_width > 0 && min_height > 0) + { + SDL_SetWindowMinimumSize(mWindow, mMinWindowWidth, mMinWindowHeight); + } } bool LLWindowSDL::setCursorPosition(const LLCoordWindow position) { - bool result = true; - LLCoordScreen screen_pos; - - if (!convertCoords(position, &screen_pos)) - { - return false; - } - - //LL_INFOS() << "setCursorPosition(" << screen_pos.mX << ", " << screen_pos.mY << ")" << LL_ENDL; - - // do the actual forced cursor move. - SDL_WarpMouse(screen_pos.mX, screen_pos.mY); - - //LL_INFOS() << llformat("llcw %d,%d -> scr %d,%d", position.mX, position.mY, screen_pos.mX, screen_pos.mY) << LL_ENDL; - - return result; + SDL_WarpMouseInWindow(mWindow, (F32)position.mX, (F32)position.mY); + return true; } bool LLWindowSDL::getCursorPosition(LLCoordWindow *position) @@ -1060,54 +740,34 @@ bool LLWindowSDL::getCursorPosition(LLCoordWindow *position) //Point cursor_point; LLCoordScreen screen_pos; - //GetMouse(&cursor_point); - int x, y; + float x, y; SDL_GetMouseState(&x, &y); - screen_pos.mX = x; - screen_pos.mY = y; + screen_pos.mX = (S32)x; + screen_pos.mY = (S32)y; return convertCoords(screen_pos, position); } - F32 LLWindowSDL::getNativeAspectRatio() { -#if 0 + if (mOverrideAspectRatio > 0.f) + { + return mOverrideAspectRatio; + } + else if (mNativeAspectRatio > 0.f) + { + // we grabbed this value at startup, based on the user's desktop settings + return mNativeAspectRatio; + } + // RN: this hack presumes that the largest supported resolution is monitor-limited // and that pixels in that mode are square, therefore defining the native aspect ratio // of the monitor...this seems to work to a close approximation for most CRTs/LCDs S32 num_resolutions; LLWindowResolution* resolutions = getSupportedResolutions(num_resolutions); - return ((F32)resolutions[num_resolutions - 1].mWidth / (F32)resolutions[num_resolutions - 1].mHeight); - //rn: AC -#endif - - // MBW -- there are a couple of bad assumptions here. One is that the display list won't include - // ridiculous resolutions nobody would ever use. The other is that the list is in order. - - // New assumptions: - // - pixels are square (the only reasonable choice, really) - // - The user runs their display at a native resolution, so the resolution of the display - // when the app is launched has an aspect ratio that matches the monitor. - - //RN: actually, the assumption that there are no ridiculous resolutions (above the display's native capabilities) has - // been born out in my experience. - // Pixels are often not square (just ask the people who run their LCDs at 1024x768 or 800x600 when running fullscreen, like me) - // The ordering of display list is a blind assumption though, so we should check for max values - // Things might be different on the Mac though, so I'll defer to MBW - - // The constructor for this class grabs the aspect ratio of the monitor before doing any resolution - // switching, and stashes it in mOriginalAspectRatio. Here, we just return it. - - if (mOverrideAspectRatio > 0.f) - { - return mOverrideAspectRatio; - } - - return mOriginalAspectRatio; } F32 LLWindowSDL::getPixelAspectRatio() @@ -1130,104 +790,26 @@ F32 LLWindowSDL::getPixelAspectRatio() // dialogs are still usable in fullscreen. void LLWindowSDL::beforeDialog() { - bool running_x11 = false; -#if LL_X11 - running_x11 = (mSDL_XWindowID != None); -#endif //LL_X11 - LL_INFOS() << "LLWindowSDL::beforeDialog()" << LL_ENDL; if (SDLReallyCaptureInput(false)) // must ungrab input so popup works! { - if (mFullscreen) - { - // need to temporarily go non-fullscreen; bless SDL - // for providing a SDL_WM_ToggleFullScreen() - though - // it only works in X11 - if (running_x11 && mWindow) - { - SDL_WM_ToggleFullScreen(mWindow); - } - } - } - -#if LL_X11 - if (mSDL_Display) - { - // Everything that we/SDL asked for should happen before we - // potentially hand control over to GTK. - maybe_lock_display(); - XSync(mSDL_Display, False); - maybe_unlock_display(); + if (mFullscreen && mWindow ) + SDL_SetWindowFullscreen( mWindow, 0 ); } -#endif // LL_X11 - -#if LL_GTK - // this is a good time to grab some GTK version information for - // diagnostics, if not already done. - ll_try_gtk_init(); -#endif // LL_GTK - - maybe_lock_display(); } void LLWindowSDL::afterDialog() { - bool running_x11 = false; -#if LL_X11 - running_x11 = (mSDL_XWindowID != None); -#endif //LL_X11 - LL_INFOS() << "LLWindowSDL::afterDialog()" << LL_ENDL; - maybe_unlock_display(); - - if (mFullscreen) - { - // need to restore fullscreen mode after dialog - only works - // in X11 - if (running_x11 && mWindow) - { - SDL_WM_ToggleFullScreen(mWindow); - } - } -} - - -#if LL_X11 -// set/reset the XWMHints flag for 'urgency' that usually makes the icon flash -void LLWindowSDL::x11_set_urgent(bool urgent) -{ - if (mSDL_Display && !mFullscreen) - { - XWMHints *wm_hints; - - LL_INFOS() << "X11 hint for urgency, " << urgent << LL_ENDL; - - maybe_lock_display(); - wm_hints = XGetWMHints(mSDL_Display, mSDL_XWindowID); - if (!wm_hints) - wm_hints = XAllocWMHints(); - - if (urgent) - wm_hints->flags |= XUrgencyHint; - else - wm_hints->flags &= ~XUrgencyHint; - - XSetWMHints(mSDL_Display, mSDL_XWindowID, wm_hints); - XFree(wm_hints); - XSync(mSDL_Display, False); - maybe_unlock_display(); - } + if (mFullscreen && mWindow ) + SDL_SetWindowFullscreen( mWindow, 0 ); } -#endif // LL_X11 void LLWindowSDL::flashIcon(F32 seconds) { -#if !LL_X11 - LL_INFOS() << "Stub LLWindowSDL::flashIcon(" << seconds << ")" << LL_ENDL; -#else - LL_INFOS() << "X11 LLWindowSDL::flashIcon(" << seconds << ")" << LL_ENDL; + LL_INFOS() << "LLWindowSDL::flashIcon(" << seconds << ")" << LL_ENDL; F32 remaining_time = mFlashTimer.getRemainingTimeF32(); if (remaining_time < seconds) @@ -1235,132 +817,71 @@ void LLWindowSDL::flashIcon(F32 seconds) mFlashTimer.reset(); mFlashTimer.setTimerExpirySec(remaining_time); - x11_set_urgent(true); + SDL_FlashWindow(mWindow, SDL_FLASH_UNTIL_FOCUSED); mFlashing = true; -#endif // LL_X11 } - -#if LL_GTK -bool LLWindowSDL::isClipboardTextAvailable() +void LLWindowSDL::maybeStopFlashIcon() { - if (ll_try_gtk_init()) + if (mFlashing && mFlashTimer.hasExpired()) { - GtkClipboard * const clipboard = - gtk_clipboard_get(GDK_NONE); - return gtk_clipboard_wait_is_text_available(clipboard) ? - true : false; + mFlashing = false; + SDL_FlashWindow( mWindow, SDL_FLASH_CANCEL ); } - return false; // failure } -bool LLWindowSDL::pasteTextFromClipboard(LLWString &text) +bool LLWindowSDL::isClipboardTextAvailable() { - if (ll_try_gtk_init()) + return SDL_HasClipboardText(); +} + +bool LLWindowSDL::pasteTextFromClipboard(LLWString &dst) +{ + if (isClipboardTextAvailable()) { - GtkClipboard * const clipboard = - gtk_clipboard_get(GDK_NONE); - gchar * const data = gtk_clipboard_wait_for_text(clipboard); + char* data = SDL_GetClipboardText(); if (data) { - text = LLWString(utf8str_to_wstring(data)); - g_free(data); + dst = LLWString(utf8str_to_wstring(data)); + SDL_free(data); return true; } } - return false; // failure + return false; } -bool LLWindowSDL::copyTextToClipboard(const LLWString &text) +bool LLWindowSDL::copyTextToClipboard(const LLWString& text) { - if (ll_try_gtk_init()) - { - const std::string utf8 = wstring_to_utf8str(text); - GtkClipboard * const clipboard = - gtk_clipboard_get(GDK_NONE); - gtk_clipboard_set_text(clipboard, utf8.c_str(), utf8.length()); - return true; - } - return false; // failure + const std::string utf8 = wstring_to_utf8str(text); + return SDL_SetClipboardText(utf8.c_str()); } - bool LLWindowSDL::isPrimaryTextAvailable() { - if (ll_try_gtk_init()) - { - GtkClipboard * const clipboard = - gtk_clipboard_get(GDK_SELECTION_PRIMARY); - return gtk_clipboard_wait_is_text_available(clipboard) ? - true : false; - } - return false; // failure + return SDL_HasPrimarySelectionText(); } -bool LLWindowSDL::pasteTextFromPrimary(LLWString &text) +bool LLWindowSDL::pasteTextFromPrimary(LLWString &dst) { - if (ll_try_gtk_init()) + if (isPrimaryTextAvailable()) { - GtkClipboard * const clipboard = - gtk_clipboard_get(GDK_SELECTION_PRIMARY); - gchar * const data = gtk_clipboard_wait_for_text(clipboard); + char* data = SDL_GetPrimarySelectionText(); if (data) { - text = LLWString(utf8str_to_wstring(data)); - g_free(data); + dst = LLWString(utf8str_to_wstring(data)); + SDL_free(data); return true; } } - return false; // failure -} - -bool LLWindowSDL::copyTextToPrimary(const LLWString &text) -{ - if (ll_try_gtk_init()) - { - const std::string utf8 = wstring_to_utf8str(text); - GtkClipboard * const clipboard = - gtk_clipboard_get(GDK_SELECTION_PRIMARY); - gtk_clipboard_set_text(clipboard, utf8.c_str(), utf8.length()); - return true; - } - return false; // failure -} - -#else - -bool LLWindowSDL::isClipboardTextAvailable() -{ - return false; // unsupported -} - -bool LLWindowSDL::pasteTextFromClipboard(LLWString &dst) -{ - return false; // unsupported -} - -bool LLWindowSDL::copyTextToClipboard(const LLWString &s) -{ - return false; // unsupported -} - -bool LLWindowSDL::isPrimaryTextAvailable() -{ - return false; // unsupported -} - -bool LLWindowSDL::pasteTextFromPrimary(LLWString &dst) -{ - return false; // unsupported + return false; } -bool LLWindowSDL::copyTextToPrimary(const LLWString &s) +bool LLWindowSDL::copyTextToPrimary(const LLWString& text) { - return false; // unsupported + const std::string utf8 = wstring_to_utf8str(text); + return SDL_SetPrimarySelectionText(utf8.c_str()); } -#endif // LL_GTK - LLWindow::LLWindowResolution* LLWindowSDL::getSupportedResolutions(S32 &num_resolutions) { if (!mSupportedResolutions) @@ -1368,28 +889,21 @@ LLWindow::LLWindowResolution* LLWindowSDL::getSupportedResolutions(S32 &num_reso mSupportedResolutions = new LLWindowResolution[MAX_NUM_RESOLUTIONS]; mNumSupportedResolutions = 0; - SDL_Rect **modes = SDL_ListModes(NULL, SDL_OPENGL | SDL_FULLSCREEN); - if ( (modes != NULL) && (modes != ((SDL_Rect **) -1)) ) - { - int count = 0; - while (*modes && countw; - int h = r->h; + SDL_DisplayID display = SDL_GetPrimaryDisplay(); + int num_modes = 0; + SDL_DisplayMode **modes = SDL_GetFullscreenDisplayModes(display, &num_modes); + num_modes = llclamp(num_modes, 0, MAX_NUM_RESOLUTIONS); + if (modes) { + for (int i = 0; i < num_modes; ++i) { + SDL_DisplayMode *mode = modes[i]; + int w = mode->w; + int h = mode->h; if ((w >= 800) && (h >= 600)) { // make sure we don't add the same resolution multiple times! if ( (mNumSupportedResolutions == 0) || - ((mSupportedResolutions[mNumSupportedResolutions-1].mWidth != w) && - (mSupportedResolutions[mNumSupportedResolutions-1].mHeight != h)) ) + ((mSupportedResolutions[mNumSupportedResolutions-1].mWidth != w) && + (mSupportedResolutions[mNumSupportedResolutions-1].mHeight != h)) ) { mSupportedResolutions[mNumSupportedResolutions].mWidth = w; mSupportedResolutions[mNumSupportedResolutions].mHeight = h; @@ -1397,6 +911,7 @@ LLWindow::LLWindowResolution* LLWindowSDL::getSupportedResolutions(S32 &num_reso } } } + SDL_free(modes); } } @@ -1404,13 +919,42 @@ LLWindow::LLWindowResolution* LLWindowSDL::getSupportedResolutions(S32 &num_reso return mSupportedResolutions; } +//static +std::vector LLWindowSDL::getDisplaysResolutionList() +{ + std::vector ret; + if (gWindowImplementation) + { + S32 resolutionCount = 0; + LLWindowResolution* resolutionList = gWindowImplementation->getSupportedResolutions(resolutionCount); + if (resolutionList != nullptr) + { + for (S32 i = 0; i < resolutionCount; i++) + { + const LLWindowResolution& resolution = resolutionList[i]; + ret.push_back(std::to_string(resolution.mWidth) + "x" + std::to_string(resolution.mHeight)); + } + } + } + return ret; +} + + bool LLWindowSDL::convertCoords(LLCoordGL from, LLCoordWindow *to) { if (!to) return false; - to->mX = from.mX; - to->mY = mWindow->h - from.mY - 1; + if (!mWindow) + return false; + + S32 height; + SDL_GetWindowSizeInPixels(mWindow, nullptr, &height); + + float pixel_scale = SDL_GetWindowPixelDensity(mWindow); + + to->mX = from.mX / pixel_scale; + to->mY = (height - from.mY - 1) / pixel_scale; return true; } @@ -1420,8 +964,15 @@ bool LLWindowSDL::convertCoords(LLCoordWindow from, LLCoordGL* to) if (!to) return false; - to->mX = from.mX; - to->mY = mWindow->h - from.mY - 1; + if (!mWindow) + return false; + S32 height; + SDL_GetWindowSize(mWindow, nullptr, &height); + + float pixel_scale = SDL_GetWindowPixelDensity(mWindow); + + to->mX = from.mX * pixel_scale; + to->mY = (height - from.mY - 1) * pixel_scale; return true; } @@ -1434,7 +985,7 @@ bool LLWindowSDL::convertCoords(LLCoordScreen from, LLCoordWindow* to) // In the fullscreen case, window and screen coordinates are the same. to->mX = from.mX; to->mY = from.mY; - return (true); + return true; } bool LLWindowSDL::convertCoords(LLCoordWindow from, LLCoordScreen *to) @@ -1445,29 +996,26 @@ bool LLWindowSDL::convertCoords(LLCoordWindow from, LLCoordScreen *to) // In the fullscreen case, window and screen coordinates are the same. to->mX = from.mX; to->mY = from.mY; - return (true); + return true; } bool LLWindowSDL::convertCoords(LLCoordScreen from, LLCoordGL *to) { LLCoordWindow window_coord; - return(convertCoords(from, &window_coord) && convertCoords(window_coord, to)); + return convertCoords(from, &window_coord) && convertCoords(window_coord, to); } bool LLWindowSDL::convertCoords(LLCoordGL from, LLCoordScreen *to) { LLCoordWindow window_coord; - return(convertCoords(from, &window_coord) && convertCoords(window_coord, to)); + return convertCoords(from, &window_coord) && convertCoords(window_coord, to); } - - - void LLWindowSDL::setupFailure(const std::string& text, const std::string& caption, U32 type) { - destroyContext(); + close(); OSMessageBox(text, caption, type); } @@ -1482,13 +1030,13 @@ bool LLWindowSDL::SDLReallyCaptureInput(bool capture) else mReallyCapturedCount = 0; - SDL_GrabMode wantmode, newmode; + bool wantGrab; if (mReallyCapturedCount <= 0) // uncapture { - wantmode = SDL_GRAB_OFF; + wantGrab = false; } else // capture { - wantmode = SDL_GRAB_ON; + wantGrab = true; } if (mReallyCapturedCount < 0) // yuck, imbalance. @@ -1497,64 +1045,32 @@ bool LLWindowSDL::SDLReallyCaptureInput(bool capture) LL_WARNS() << "ReallyCapture count was < 0" << LL_ENDL; } + bool newGrab = wantGrab; if (!mFullscreen) /* only bother if we're windowed anyway */ { -#if LL_X11 - if (mSDL_Display) + int result; + if (wantGrab) { - /* we dirtily mix raw X11 with SDL so that our pointer - isn't (as often) constrained to the limits of the - window while grabbed, which feels nicer and - hopefully eliminates some reported 'sticky pointer' - problems. We use raw X11 instead of - SDL_WM_GrabInput() because the latter constrains - the pointer to the window and also steals all - *keyboard* input from the window manager, which was - frustrating users. */ - int result; - if (wantmode == SDL_GRAB_ON) - { - //LL_INFOS() << "X11 POINTER GRABBY" << LL_ENDL; - //newmode = SDL_WM_GrabInput(wantmode); - maybe_lock_display(); - result = XGrabPointer(mSDL_Display, mSDL_XWindowID, - True, 0, GrabModeAsync, - GrabModeAsync, - None, None, CurrentTime); - maybe_unlock_display(); - if (GrabSuccess == result) - newmode = SDL_GRAB_ON; - else - newmode = SDL_GRAB_OFF; - } else if (wantmode == SDL_GRAB_OFF) - { - //LL_INFOS() << "X11 POINTER UNGRABBY" << LL_ENDL; - newmode = SDL_GRAB_OFF; - //newmode = SDL_WM_GrabInput(SDL_GRAB_OFF); - - maybe_lock_display(); - XUngrabPointer(mSDL_Display, CurrentTime); - // Make sure the ungrab happens RIGHT NOW. - XSync(mSDL_Display, False); - maybe_unlock_display(); - } else - { - newmode = SDL_GRAB_QUERY; // neutral - } - } else // not actually running on X11, for some reason - newmode = wantmode; -#endif // LL_X11 - } else { - // pretend we got what we wanted, when really we don't care. - newmode = wantmode; + // LL_INFOS() << "X11 POINTER GRABBY" << LL_ENDL; + result = SDL_SetWindowMouseGrab(mWindow, true); + if (0 == result) + newGrab = true; + else + newGrab = false; + } + else + { + newGrab = false; + result = SDL_SetWindowMouseGrab(mWindow, false); + } } + // pretend we got what we wanted, when really we don't care. // return boolean success for whether we ended up in the desired state - return (capture && SDL_GRAB_ON==newmode) || - (!capture && SDL_GRAB_OFF==newmode); + return capture == newGrab; } -U32 LLWindowSDL::SDLCheckGrabbyKeys(SDLKey keysym, bool gain) +U32 LLWindowSDL::SDLCheckGrabbyKeys(U32 keysym, bool gain) { /* part of the fix for SL-13243: Some popular window managers like to totally eat alt-drag for the purposes of moving windows. We @@ -1572,16 +1088,16 @@ U32 LLWindowSDL::SDLCheckGrabbyKeys(SDLKey keysym, bool gain) U32 mask = 0; switch (keysym) { - case SDLK_LALT: - mask = 1U << 0; break; - case SDLK_RALT: - mask = 1U << 1; break; - case SDLK_LCTRL: - mask = 1U << 2; break; - case SDLK_RCTRL: - mask = 1U << 3; break; - default: - break; + case SDLK_LALT: + mask = 1U << 0; break; + case SDLK_RALT: + mask = 1U << 1; break; + case SDLK_LCTRL: + mask = 1U << 2; break; + case SDLK_RCTRL: + mask = 1U << 3; break; + default: + break; } if (gain) @@ -1595,371 +1111,257 @@ U32 LLWindowSDL::SDLCheckGrabbyKeys(SDLKey keysym, bool gain) return mGrabbyKeyFlags; } +// virtual +void LLWindowSDL::processMiscNativeEvents() +{ +} -void check_vm_bloat() +void LLWindowSDL::gatherInput() { -#if LL_LINUX - // watch our own VM and RSS sizes, warn if we bloated rapidly - static const std::string STATS_FILE = "/proc/self/stat"; - FILE *fp = fopen(STATS_FILE.c_str(), "r"); - if (fp) - { - static long long last_vm_size = 0; - static long long last_rss_size = 0; - const long long significant_vm_difference = 250 * 1024*1024; - const long long significant_rss_difference = 50 * 1024*1024; - long long this_vm_size = 0; - long long this_rss_size = 0; - - ssize_t res; - size_t dummy; - char *ptr = NULL; - for (int i=0; i<22; ++i) // parse past the values we don't want + // This is for the case where SDL is not driving the main event loop + if(!gSDLMainHandled) + { + SDL_Event event; + + // Handle all outstanding SDL events + while (SDL_PollEvent(&event)) { - res = getdelim(&ptr, &dummy, ' ', fp); - if (-1 == res) - { - LL_WARNS() << "Unable to parse " << STATS_FILE << LL_ENDL; - goto finally; - } - free(ptr); - ptr = NULL; + handleEvent(event); } - // 23rd space-delimited entry is vsize - res = getdelim(&ptr, &dummy, ' ', fp); - llassert(ptr); - if (-1 == res) + } + + updateCursor(); + + // This is a good time to stop flashing the icon if our mFlashTimer has + // expired. + if (mFlashing && mFlashTimer.hasExpired()) + { + SDL_FlashWindow(mWindow, SDL_FLASH_CANCEL); + mFlashing = false; + } +} + +SDL_AppResult LLWindowSDL::handleEvent(const SDL_Event& event) +{ + switch(event.type) + { + case SDL_EVENT_MOUSE_MOTION: { - LL_WARNS() << "Unable to parse " << STATS_FILE << LL_ENDL; - goto finally; + LLCoordWindow winCoord(llfloor(event.motion.x), llfloor(event.motion.y)); + LLCoordGL openGlCoord; + convertCoords(winCoord, &openGlCoord); + mCallbacks->handleMouseMove(this, openGlCoord, gKeyboard->currentMask(true)); + break; } - this_vm_size = atoll(ptr); - free(ptr); - ptr = NULL; - // 24th space-delimited entry is RSS - res = getdelim(&ptr, &dummy, ' ', fp); - llassert(ptr); - if (-1 == res) + + case SDL_EVENT_MOUSE_WHEEL: { - LL_WARNS() << "Unable to parse " << STATS_FILE << LL_ENDL; - goto finally; + if(event.wheel.integer_y != 0) + { + mCallbacks->handleScrollWheel(this, -event.wheel.integer_y); + } + if (event.wheel.integer_x != 0) + { + mCallbacks->handleScrollHWheel(this, -event.wheel.integer_x); + } + break; } - this_rss_size = getpagesize() * atoll(ptr); - free(ptr); - ptr = NULL; - LL_INFOS() << "VM SIZE IS NOW " << (this_vm_size/(1024*1024)) << " MB, RSS SIZE IS NOW " << (this_rss_size/(1024*1024)) << " MB" << LL_ENDL; - - if (llabs(last_vm_size - this_vm_size) > - significant_vm_difference) + case SDL_EVENT_MOUSE_BUTTON_DOWN: { - if (this_vm_size > last_vm_size) + LLCoordWindow winCoord(llfloor(event.button.x), llfloor(event.button.y)); + LLCoordGL openGlCoord; + convertCoords(winCoord, &openGlCoord); + MASK mask = gKeyboard->currentMask(true); + + if (event.button.button == SDL_BUTTON_LEFT) // left + { + if (event.button.clicks == 2) + mCallbacks->handleDoubleClick(this, openGlCoord, mask); + else + mCallbacks->handleMouseDown(this, openGlCoord, mask); + } + else if (event.button.button == SDL_BUTTON_RIGHT) + { + mCallbacks->handleRightMouseDown(this, openGlCoord, mask); + } + else if (event.button.button == SDL_BUTTON_MIDDLE) // middle { - LL_WARNS() << "VM size grew by " << (this_vm_size - last_vm_size)/(1024*1024) << " MB in last frame" << LL_ENDL; + mCallbacks->handleMiddleMouseDown(this, openGlCoord, mask); } else { - LL_INFOS() << "VM size shrank by " << (last_vm_size - this_vm_size)/(1024*1024) << " MB in last frame" << LL_ENDL; + mCallbacks->handleOtherMouseDown(this, openGlCoord, mask, event.button.button); } + + break; } - if (llabs(last_rss_size - this_rss_size) > - significant_rss_difference) + case SDL_EVENT_MOUSE_BUTTON_UP: { - if (this_rss_size > last_rss_size) + LLCoordWindow winCoord(llfloor(event.button.x), llfloor(event.button.y)); + LLCoordGL openGlCoord; + convertCoords(winCoord, &openGlCoord); + MASK mask = gKeyboard->currentMask(true); + + if (event.button.button == SDL_BUTTON_LEFT) // left + { + mCallbacks->handleMouseUp(this, openGlCoord, mask); + } + else if (event.button.button == SDL_BUTTON_RIGHT) // right + { + mCallbacks->handleRightMouseUp(this, openGlCoord, mask); + } + else if (event.button.button == SDL_BUTTON_MIDDLE) // middle { - LL_WARNS() << "RSS size grew by " << (this_rss_size - last_rss_size)/(1024*1024) << " MB in last frame" << LL_ENDL; + mCallbacks->handleMiddleMouseUp(this, openGlCoord, mask); } else { - LL_INFOS() << "RSS size shrank by " << (last_rss_size - this_rss_size)/(1024*1024) << " MB in last frame" << LL_ENDL; + mCallbacks->handleOtherMouseUp(this, openGlCoord, mask, event.button.button); } - } - last_rss_size = this_rss_size; - last_vm_size = this_vm_size; - -finally: - if (NULL != ptr) - { - free(ptr); - ptr = NULL; + break; } - fclose(fp); - } -#endif // LL_LINUX -} - - -// virtual -void LLWindowSDL::processMiscNativeEvents() -{ -#if LL_GTK - // Pump GTK events to avoid starvation for: - // * DBUS servicing - // * Anything else which quietly hooks into the default glib/GTK loop - if (ll_try_gtk_init()) - { - // Yuck, Mozilla's GTK callbacks play with the locale - push/pop - // the locale to protect it, as exotic/non-C locales - // causes our code lots of general critical weirdness - // and crashness. (SL-35450) - static std::string saved_locale; - saved_locale = ll_safe_string(setlocale(LC_ALL, NULL)); - // Pump until we've nothing left to do or passed 1/15th of a - // second pumping for this frame. - static LLTimer pump_timer; - pump_timer.reset(); - pump_timer.setTimerExpirySec(1.0f / 15.0f); - do { - // Always do at least one non-blocking pump - gtk_main_iteration_do(false); - } while (gtk_events_pending() && - !pump_timer.hasExpired()); - - setlocale(LC_ALL, saved_locale.c_str() ); - } -#endif // LL_GTK + case SDL_EVENT_KEY_DOWN: + { + mKeyVirtualKey = event.key.key; + mKeyModifiers = event.key.mod; - // hack - doesn't belong here - but this is just for debugging - if (getenv("LL_DEBUG_BLOAT")) - { - check_vm_bloat(); - } -} + if (mKeyVirtualKey == SDLK_RETURN2 || mKeyVirtualKey == SDLK_KP_ENTER) + { + mKeyVirtualKey = SDLK_RETURN; + } -void LLWindowSDL::gatherInput() -{ - const Uint32 CLICK_THRESHOLD = 300; // milliseconds - static int leftClick = 0; - static int rightClick = 0; - static Uint32 lastLeftDown = 0; - static Uint32 lastRightDown = 0; - SDL_Event event; + gKeyboard->handleKeyDown(mKeyVirtualKey, mKeyModifiers); - // Handle all outstanding SDL events - while (SDL_PollEvent(&event)) - { - switch (event.type) - { - case SDL_MOUSEMOTION: + if (mKeyVirtualKey == SDLK_RETURN) { - LLCoordWindow winCoord(event.button.x, event.button.y); - LLCoordGL openGlCoord; - convertCoords(winCoord, &openGlCoord); - MASK mask = gKeyboard->currentMask(true); - mCallbacks->handleMouseMove(this, openGlCoord, mask); - break; + // fix return key not working when capslock, scrolllock or numlock are enabled + mKeyModifiers &= (~(SDL_KMOD_NUM | SDL_KMOD_CAPS | SDL_KMOD_MODE | SDL_KMOD_SCROLL)); + mCallbacks->handleUnicodeChar(mKeyVirtualKey, gKeyboard->currentMask(false)); } - case SDL_KEYDOWN: - mKeyScanCode = event.key.keysym.scancode; - mKeyVirtualKey = event.key.keysym.unicode; - mKeyModifiers = event.key.keysym.mod; - - gKeyboard->handleKeyDown(event.key.keysym.sym, event.key.keysym.mod); // part of the fix for SL-13243 - if (SDLCheckGrabbyKeys(event.key.keysym.sym, true) != 0) + if (SDLCheckGrabbyKeys(mKeyVirtualKey, true) != 0) SDLReallyCaptureInput(true); + break; + } + + case SDL_EVENT_KEY_UP: + { + mKeyVirtualKey = event.key.key; + mKeyModifiers = event.key.mod; - if (event.key.keysym.unicode) + if (mKeyVirtualKey == SDLK_RETURN2 || mKeyVirtualKey == SDLK_KP_ENTER) { - handleUnicodeUTF16(event.key.keysym.unicode, - gKeyboard->currentMask(false)); + mKeyVirtualKey = SDLK_RETURN; } - break; - - case SDL_KEYUP: - mKeyScanCode = event.key.keysym.scancode; - mKeyVirtualKey = event.key.keysym.unicode; - mKeyModifiers = event.key.keysym.mod; - if (SDLCheckGrabbyKeys(event.key.keysym.sym, false) == 0) + gKeyboard->handleKeyUp(mKeyVirtualKey, mKeyModifiers); + if (SDLCheckGrabbyKeys(mKeyVirtualKey, false) == 0) SDLReallyCaptureInput(false); // part of the fix for SL-13243 - - gKeyboard->handleKeyUp(event.key.keysym.sym, event.key.keysym.mod); break; + } - case SDL_MOUSEBUTTONDOWN: - { - bool isDoubleClick = false; - LLCoordWindow winCoord(event.button.x, event.button.y); - LLCoordGL openGlCoord; - convertCoords(winCoord, &openGlCoord); - MASK mask = gKeyboard->currentMask(true); - - if (event.button.button == SDL_BUTTON_LEFT) // SDL doesn't manage double clicking... - { - Uint32 now = SDL_GetTicks(); - if ((now - lastLeftDown) > CLICK_THRESHOLD) - leftClick = 1; - else - { - if (++leftClick >= 2) - { - leftClick = 0; - isDoubleClick = true; - } - } - lastLeftDown = now; - } - else if (event.button.button == SDL_BUTTON_RIGHT) - { - Uint32 now = SDL_GetTicks(); - if ((now - lastRightDown) > CLICK_THRESHOLD) - rightClick = 1; - else - { - if (++rightClick >= 2) - { - rightClick = 0; - isDoubleClick = true; - } - } - lastRightDown = now; - } - - if (event.button.button == SDL_BUTTON_LEFT) // left - { - if (isDoubleClick) - mCallbacks->handleDoubleClick(this, openGlCoord, mask); - else - mCallbacks->handleMouseDown(this, openGlCoord, mask); - } - - else if (event.button.button == SDL_BUTTON_RIGHT) // right - { - mCallbacks->handleRightMouseDown(this, openGlCoord, mask); - } - - else if (event.button.button == SDL_BUTTON_MIDDLE) // middle - { - mCallbacks->handleMiddleMouseDown(this, openGlCoord, mask); - } - else if (event.button.button == 4) // mousewheel up...thanks to X11 for making SDL consider these "buttons". - mCallbacks->handleScrollWheel(this, -1); - else if (event.button.button == 5) // mousewheel down...thanks to X11 for making SDL consider these "buttons". - mCallbacks->handleScrollWheel(this, 1); - - break; - } - - case SDL_MOUSEBUTTONUP: + case SDL_EVENT_TEXT_INPUT: + { + auto string = utf8str_to_wstring(event.text.text); + MASK current_mask = gKeyboard->currentMask(false); + for (auto key : string) { - LLCoordWindow winCoord(event.button.x, event.button.y); - LLCoordGL openGlCoord; - convertCoords(winCoord, &openGlCoord); - MASK mask = gKeyboard->currentMask(true); - - if (event.button.button == SDL_BUTTON_LEFT) // left - mCallbacks->handleMouseUp(this, openGlCoord, mask); - else if (event.button.button == SDL_BUTTON_RIGHT) // right - mCallbacks->handleRightMouseUp(this, openGlCoord, mask); - else if (event.button.button == SDL_BUTTON_MIDDLE) // middle - mCallbacks->handleMiddleMouseUp(this, openGlCoord, mask); - // don't handle mousewheel here... - - break; + mKeyVirtualKey = key; + mCallbacks->handleUnicodeChar(key, current_mask); } + break; + } - case SDL_VIDEOEXPOSE: // VIDEOEXPOSE doesn't specify the damage, but hey, it's OpenGL...repaint the whole thing! - mCallbacks->handlePaint(this, 0, 0, mWindow->w, mWindow->h); - break; - - case SDL_VIDEORESIZE: // *FIX: handle this? - { - LL_INFOS() << "Handling a resize event: " << event.resize.w << - "x" << event.resize.h << LL_ENDL; - - S32 width = llmax(event.resize.w, (S32)mMinWindowWidth); - S32 height = llmax(event.resize.h, (S32)mMinWindowHeight); - - // *FIX: I'm not sure this is necessary! - mWindow = SDL_SetVideoMode(width, height, 32, mSDLFlags); - if (!mWindow) + case SDL_EVENT_WINDOW_EXPOSED: { - // *FIX: More informative dialog? - LL_INFOS() << "Could not recreate context after resize! Quitting..." << LL_ENDL; - if(mCallbacks->handleCloseRequest(this, false)) - { - // Get the app to initiate cleanup. - mCallbacks->handleQuit(this); - // The app is responsible for calling destroyWindow when done with GL - } - break; + mCallbacks->handlePaint(this, 0, 0, 0, 0); + break; } - mCallbacks->handleResize(this, width, height); - break; - } - case SDL_ACTIVEEVENT: - if (event.active.state & SDL_APPINPUTFOCUS) - { - // Note that for SDL (particularly on X11), keyboard - // and mouse focus are independent things. Here we are - // tracking keyboard focus state changes. - - // We have to do our own state massaging because SDL - // can send us two unfocus events in a row for example, - // which confuses the focus code [SL-24071]. - if (event.active.gain != mHaveInputFocus) - { - mHaveInputFocus = !!event.active.gain; + case SDL_EVENT_WINDOW_RESIZED: + { + LL_INFOS() << "Handling a resize event: " << event.window.data1 << "x" << event.window.data2 << LL_ENDL; + F32 pixel_density = SDL_GetWindowPixelDensity(mWindow); + S32 width = llmax(event.window.data1, (S32)mMinWindowWidth) * pixel_density; + S32 height = llmax(event.window.data2, (S32)mMinWindowHeight) * pixel_density; - if (mHaveInputFocus) - mCallbacks->handleFocus(this); - else - mCallbacks->handleFocusLost(this); - } - } - if (event.active.state & SDL_APPACTIVE) - { - // Change in iconification/minimization state. - if ((!event.active.gain) != mIsMinimized) + mCallbacks->handleResize(this, width, height); + break; + } + case SDL_EVENT_WINDOW_MOUSE_ENTER: + break; + case SDL_EVENT_WINDOW_MOUSE_LEAVE: + mCallbacks->handleMouseLeave(this); + break; + case SDL_EVENT_WINDOW_FOCUS_GAINED: + //SDL_SetWindowKeyboardGrab(mWindow, true); + mCallbacks->handleFocus(this); + break; + case SDL_EVENT_WINDOW_FOCUS_LOST: + mCallbacks->handleFocusLost(this); + //SDL_SetWindowKeyboardGrab(mWindow, false); + break; + case SDL_EVENT_WINDOW_RESTORED: + mCallbacks->handleActivate(this, true); + break; + case SDL_EVENT_WINDOW_MAXIMIZED: + mCallbacks->handleActivate(this, true); + break; + case SDL_EVENT_WINDOW_MINIMIZED: + mCallbacks->handleActivate(this, false); + break; + case SDL_EVENT_WINDOW_DISPLAY_CHANGED: + { + // Update refresh rate when changing monitors + const SDL_DisplayMode* displayMode = SDL_GetCurrentDisplayMode(event.window.data1); + if(displayMode) { - mIsMinimized = (!event.active.gain); - - mCallbacks->handleActivate(this, !mIsMinimized); - LL_INFOS() << "SDL deiconification state switched to " << bool(event.active.gain) << LL_ENDL; + mRefreshRate = ll_round(displayMode->refresh_rate); + mNativeAspectRatio = ((F32)displayMode->w) / ((F32)displayMode->h); } - else + mCallbacks->handleDisplayChanged(); + break; + } + case SDL_EVENT_WINDOW_DISPLAY_SCALE_CHANGED: + { + S32 w, h = 0; + SDL_GetWindowSizeInPixels(mWindow, &w, &h); + mCallbacks->handleDPIChanged(this, getSystemUISize(), w, h); + break; + } + case SDL_EVENT_WINDOW_CLOSE_REQUESTED: + { + if(mCallbacks->handleCloseRequest(this, true)) { - LL_INFOS() << "Ignored bogus redundant SDL deiconification state switch to " << bool(event.active.gain) << LL_ENDL; + // Get the app to initiate cleanup. + mCallbacks->handleQuit(this); + // The app is responsible for calling destroyWindow when done with GL } - } - break; - - case SDL_QUIT: - if(mCallbacks->handleCloseRequest(this, true)) - { - // Get the app to initiate cleanup. - mCallbacks->handleQuit(this); - // The app is responsible for calling destroyWindow when done with GL - } - break; - default: - //LL_INFOS() << "Unhandled SDL event type " << event.type << LL_ENDL; - break; + break; } + default: + break; } - updateCursor(); + return SDL_APP_CONTINUE; +} -#if LL_X11 - // This is a good time to stop flashing the icon if our mFlashTimer has - // expired. - if (mFlashing && mFlashTimer.hasExpired()) - { - x11_set_urgent(false); - mFlashing = false; - } -#endif // LL_X11 +// static +SDL_AppResult LLWindowSDL::handleEvents(const SDL_Event& event) +{ + if(!gWindowImplementation) return SDL_APP_CONTINUE; + + return gWindowImplementation->handleEvent(event); } static SDL_Cursor *makeSDLCursorFromBMP(const char *filename, int hotx, int hoty) { - SDL_Cursor *sdlcursor = NULL; + SDL_Cursor *sdlcursor = nullptr; SDL_Surface *bmpsurface; // Load cursor pixel data from BMP file @@ -1968,21 +1370,32 @@ static SDL_Cursor *makeSDLCursorFromBMP(const char *filename, int hotx, int hoty { SDL_Surface *cursurface; LL_DEBUGS() << "Loaded cursor file " << filename << " " - << bmpsurface->w << "x" << bmpsurface->h << LL_ENDL; - cursurface = SDL_CreateRGBSurface (SDL_SWSURFACE, - bmpsurface->w, - bmpsurface->h, - 32, - SDL_SwapLE32(0xFFU), - SDL_SwapLE32(0xFF00U), - SDL_SwapLE32(0xFF0000U), - SDL_SwapLE32(0xFF000000U)); - SDL_FillRect(cursurface, NULL, SDL_SwapLE32(0x00000000U)); + << bmpsurface->w << "x" << bmpsurface->h << LL_ENDL; + SDL_PixelFormat pix_format = SDL_GetPixelFormatForMasks(32, + SDL_Swap32LE(0xFFU), + SDL_Swap32LE(0xFF00U), + SDL_Swap32LE(0xFF0000U), + SDL_Swap32LE(0xFF000000U)); + if (pix_format == SDL_PIXELFORMAT_UNKNOWN) + { + return nullptr; + } + + const SDL_PixelFormatDetails* pix_format_details = SDL_GetPixelFormatDetails(pix_format); + if(!pix_format_details) + { + return nullptr; + } + + cursurface = SDL_CreateSurface(bmpsurface->w, + bmpsurface->h, + pix_format); + SDL_FillSurfaceRect(cursurface, nullptr, SDL_Swap32LE(0x00000000U)); // Blit the cursor pixel data onto a 32-bit RGBA surface so we // only have to cope with processing one type of pixel format. - if (0 == SDL_BlitSurface(bmpsurface, NULL, - cursurface, NULL)) + if (SDL_BlitSurface(bmpsurface, nullptr, + cursurface, nullptr)) { // n.b. we already checked that width is a multiple of 8. const int bitmap_bytes = (cursurface->w * cursurface->h) / 8; @@ -1997,33 +1410,33 @@ static SDL_Cursor *makeSDLCursorFromBMP(const char *filename, int hotx, int hoty for (i=0; ih; ++i) { for (j=0; jw; ++j) { U8 *pixelp = - ((U8*)cursurface->pixels) - + cursurface->pitch * i - + j*cursurface->format->BytesPerPixel; + ((U8*)cursurface->pixels) + + cursurface->pitch * i + + j*pix_format_details->bytes_per_pixel; U8 srcred = pixelp[0]; U8 srcgreen = pixelp[1]; U8 srcblue = pixelp[2]; bool mask_bit = (srcred != 200) - || (srcgreen != 200) - || (srcblue != 200); + || (srcgreen != 200) + || (srcblue != 200); bool data_bit = mask_bit && (srcgreen <= 80);//not 0x80 unsigned char bit_offset = (cursurface->w/8) * i - + j/8; + + j/8; cursor_data[bit_offset] |= (data_bit) << (7 - (j&7)); cursor_mask[bit_offset] |= (mask_bit) << (7 - (j&7)); } } sdlcursor = SDL_CreateCursor((Uint8*)cursor_data, - (Uint8*)cursor_mask, - cursurface->w, cursurface->h, - hotx, hoty); + (Uint8*)cursor_mask, + cursurface->w, cursurface->h, + hotx, hoty); delete[] cursor_data; delete[] cursor_mask; } else { LL_WARNS() << "CURSOR BLIT FAILURE, cursurface: " << cursurface << LL_ENDL; } - SDL_FreeSurface(cursurface); - SDL_FreeSurface(bmpsurface); + SDL_DestroySurface(cursurface); + SDL_DestroySurface(bmpsurface); } else { LL_WARNS() << "CURSOR LOAD FAILURE " << filename << LL_ENDL; } @@ -2033,12 +1446,6 @@ static SDL_Cursor *makeSDLCursorFromBMP(const char *filename, int hotx, int hoty void LLWindowSDL::updateCursor() { - if (ATIbug) { - // cursor-updating is very flaky when this bug is - // present; do nothing. - return; - } - if (mCurrentCursor != mNextCursor) { if (mNextCursor < UI_CURSOR_COUNT) @@ -2050,37 +1457,40 @@ void LLWindowSDL::updateCursor() sdlcursor = mSDLCursors[UI_CURSOR_ARROW]; if (sdlcursor) SDL_SetCursor(sdlcursor); - } else { + + mCurrentCursor = mNextCursor; + } + else + { LL_WARNS() << "Tried to set invalid cursor number " << mNextCursor << LL_ENDL; } - mCurrentCursor = mNextCursor; } } void LLWindowSDL::initCursors() { - int i; // Blank the cursor pointer array for those we may miss. - for (i=0; ibeforeDialog(); - - if (LLWindowSDL::ll_try_gtk_init()) + switch (type) { - GtkWidget *win = NULL; - - LL_INFOS() << "Creating a dialog because we're in windowed mode and GTK is happy." << LL_ENDL; - - GtkDialogFlags flags = GTK_DIALOG_MODAL; - GtkMessageType messagetype; - GtkButtonsType buttons; - switch (type) - { default: case OSMB_OK: - messagetype = GTK_MESSAGE_WARNING; - buttons = GTK_BUTTONS_OK; + oData.flags = SDL_MESSAGEBOX_WARNING; + oData.buttons = btnOk; + oData.numbuttons = 1; break; case OSMB_OKCANCEL: - messagetype = GTK_MESSAGE_QUESTION; - buttons = GTK_BUTTONS_OK_CANCEL; + oData.flags = SDL_MESSAGEBOX_INFORMATION; + oData.buttons = btnOkCancel; + oData.numbuttons = 2; break; case OSMB_YESNO: - messagetype = GTK_MESSAGE_QUESTION; - buttons = GTK_BUTTONS_YES_NO; + oData.flags = SDL_MESSAGEBOX_INFORMATION; + oData.buttons = btnYesNo; + oData.numbuttons = 2; break; - } - win = gtk_message_dialog_new(NULL, flags, messagetype, buttons, "%s", - text.c_str()); - -# if LL_X11 - // Make GTK tell the window manager to associate this - // dialog with our non-GTK SDL window, which should try - // to keep it on top etc. - if (gWindowImplementation && - gWindowImplementation->mSDL_XWindowID != None) - { - gtk_widget_realize(GTK_WIDGET(win)); // so we can get its gdkwin - GdkWindow *gdkwin = gdk_window_foreign_new(gWindowImplementation->mSDL_XWindowID); - gdk_window_set_transient_for(GTK_WIDGET(win)->window, - gdkwin); - } -# endif //LL_X11 - - gtk_window_set_position(GTK_WINDOW(win), - GTK_WIN_POS_CENTER_ON_PARENT); - - gtk_window_set_type_hint(GTK_WINDOW(win), - GDK_WINDOW_TYPE_HINT_DIALOG); - - if (!caption.empty()) - gtk_window_set_title(GTK_WINDOW(win), caption.c_str()); - - gint response = GTK_RESPONSE_NONE; - g_signal_connect (win, - "response", - G_CALLBACK (response_callback), - &response); + } - // we should be able to use a gtk_dialog_run(), but it's - // apparently not written to exist in a world without a higher - // gtk_main(), so we manage its signal/destruction outselves. - gtk_widget_show_all (win); - gtk_main(); + if(gWindowImplementation != nullptr) + gWindowImplementation->beforeDialog(); - //LL_INFOS() << "response: " << response << LL_ENDL; - switch (response) - { - case GTK_RESPONSE_OK: rtn = OSBTN_OK; break; - case GTK_RESPONSE_YES: rtn = OSBTN_YES; break; - case GTK_RESPONSE_NO: rtn = OSBTN_NO; break; - case GTK_RESPONSE_APPLY: rtn = OSBTN_OK; break; - case GTK_RESPONSE_NONE: - case GTK_RESPONSE_CANCEL: - case GTK_RESPONSE_CLOSE: - case GTK_RESPONSE_DELETE_EVENT: - default: rtn = OSBTN_CANCEL; - } - } - else + int btn{0}; + if(SDL_ShowMessageBox( &oData, &btn )) { - LL_INFOS() << "MSGBOX: " << caption << ": " << text << LL_ENDL; - LL_INFOS() << "Skipping dialog because we're in fullscreen mode or GTK is not happy." << LL_ENDL; - rtn = OSBTN_OK; + if(gWindowImplementation != nullptr) + gWindowImplementation->afterDialog(); + return btn; } - if(gWindowImplementation != NULL) + if(gWindowImplementation != nullptr) gWindowImplementation->afterDialog(); - return rtn; + return OSBTN_CANCEL; } -static void color_changed_callback(GtkWidget *widget, - gpointer user_data) +bool LLWindowSDL::dialogColorPicker( F32 *r, F32 *g, F32 *b) { - GtkColorSelection *colorsel = GTK_COLOR_SELECTION(widget); - GdkColor *colorp = (GdkColor*)user_data; - - gtk_color_selection_get_current_color(colorsel, colorp); + return false; } - /* Make the raw keyboard data available - used to poke through to LLQtWebKit so that Qt/Webkit has access to the virtual keycodes etc. that it needs */ LLSD LLWindowSDL::getNativeKeyData() { - LLSD result = LLSD::emptyMap(); + LLSD result = LLSD::emptyMap(); U32 modifiers = 0; // pretend-native modifiers... oh what a tangled web we weave! @@ -2367,140 +1700,21 @@ LLSD LLWindowSDL::getNativeKeyData() // what a plugin under GDK under Qt under SL under SDL under X11 considers // a 'native' modifier mask. this has been sort of reverse-engineered... they *appear* // to match GDK consts, but that may be co-incidence. - modifiers |= (mKeyModifiers & KMOD_LSHIFT) ? 0x0001 : 0; - modifiers |= (mKeyModifiers & KMOD_RSHIFT) ? 0x0001 : 0;// munge these into the same shift - modifiers |= (mKeyModifiers & KMOD_CAPS) ? 0x0002 : 0; - modifiers |= (mKeyModifiers & KMOD_LCTRL) ? 0x0004 : 0; - modifiers |= (mKeyModifiers & KMOD_RCTRL) ? 0x0004 : 0;// munge these into the same ctrl - modifiers |= (mKeyModifiers & KMOD_LALT) ? 0x0008 : 0;// untested - modifiers |= (mKeyModifiers & KMOD_RALT) ? 0x0008 : 0;// untested + modifiers |= (mKeyModifiers & SDL_KMOD_LSHIFT) ? 0x0001 : 0; + modifiers |= (mKeyModifiers & SDL_KMOD_RSHIFT) ? 0x0001 : 0;// munge these into the same shift + modifiers |= (mKeyModifiers & SDL_KMOD_CAPS) ? 0x0002 : 0; + modifiers |= (mKeyModifiers & SDL_KMOD_LCTRL) ? 0x0004 : 0; + modifiers |= (mKeyModifiers & SDL_KMOD_RCTRL) ? 0x0004 : 0;// munge these into the same ctrl + modifiers |= (mKeyModifiers & SDL_KMOD_LALT) ? 0x0008 : 0;// untested + modifiers |= (mKeyModifiers & SDL_KMOD_RALT) ? 0x0008 : 0;// untested // *todo: test ALTs - I don't have a case for testing these. Do you? // *todo: NUM? - I don't care enough right now (and it's not a GDK modifier). - result["scan_code"] = (S32)mKeyScanCode; - result["virtual_key"] = (S32)mKeyVirtualKey; + result["virtual_key"] = (S32)mKeyVirtualKey; + result["virtual_key_win"] = (S32)LLKeyboardSDL::mapSDL2toWin( mKeyVirtualKey ); result["modifiers"] = (S32)modifiers; - - return result; -} - - -bool LLWindowSDL::dialogColorPicker( F32 *r, F32 *g, F32 *b) -{ - bool rtn = false; - - beforeDialog(); - - if (ll_try_gtk_init()) - { - GtkWidget *win = NULL; - - win = gtk_color_selection_dialog_new(NULL); - -# if LL_X11 - // Get GTK to tell the window manager to associate this - // dialog with our non-GTK SDL window, which should try - // to keep it on top etc. - if (mSDL_XWindowID != None) - { - gtk_widget_realize(GTK_WIDGET(win)); // so we can get its gdkwin - GdkWindow *gdkwin = gdk_window_foreign_new(mSDL_XWindowID); - gdk_window_set_transient_for(GTK_WIDGET(win)->window, - gdkwin); - } -# endif //LL_X11 - - GtkColorSelection *colorsel = GTK_COLOR_SELECTION (GTK_COLOR_SELECTION_DIALOG(win)->colorsel); - - GdkColor color, orig_color; - orig_color.pixel = 0; - orig_color.red = guint16(65535 * *r); - orig_color.green= guint16(65535 * *g); - orig_color.blue = guint16(65535 * *b); - color = orig_color; - - gtk_color_selection_set_previous_color (colorsel, &color); - gtk_color_selection_set_current_color (colorsel, &color); - gtk_color_selection_set_has_palette (colorsel, true); - gtk_color_selection_set_has_opacity_control(colorsel, false); - - gint response = GTK_RESPONSE_NONE; - g_signal_connect (win, - "response", - G_CALLBACK (response_callback), - &response); - - g_signal_connect (G_OBJECT (colorsel), "color_changed", - G_CALLBACK (color_changed_callback), - &color); - - gtk_window_set_modal(GTK_WINDOW(win), true); - gtk_widget_show_all(win); - // hide the help button - we don't service it. - gtk_widget_hide(GTK_COLOR_SELECTION_DIALOG(win)->help_button); - gtk_main(); - - if (response == GTK_RESPONSE_OK && - (orig_color.red != color.red - || orig_color.green != color.green - || orig_color.blue != color.blue) ) - { - *r = color.red / 65535.0f; - *g = color.green / 65535.0f; - *b = color.blue / 65535.0f; - rtn = true; - } - } - - afterDialog(); - - return rtn; -} -#else -S32 OSMessageBoxSDL(const std::string& text, const std::string& caption, U32 type) -{ - LL_INFOS() << "MSGBOX: " << caption << ": " << text << LL_ENDL; - return 0; -} - -bool LLWindowSDL::dialogColorPicker( F32 *r, F32 *g, F32 *b) -{ - return (false); -} -#endif // LL_GTK - -#if LL_LINUX -// extracted from spawnWebBrowser for clarity and to eliminate -// compiler confusion regarding close(int fd) vs. LLWindow::close() -void exec_cmd(const std::string& cmd, const std::string& arg) -{ - char* const argv[] = {(char*)cmd.c_str(), (char*)arg.c_str(), NULL}; - fflush(NULL); - pid_t pid = fork(); - if (pid == 0) - { // child - // disconnect from stdin/stdout/stderr, or child will - // keep our output pipe undesirably alive if it outlives us. - close(0); - close(1); - close(2); - // end ourself by running the command - execv(cmd.c_str(), argv); /* Flawfinder: ignore */ - // if execv returns at all, there was a problem. - LL_WARNS() << "execv failure when trying to start " << cmd << LL_ENDL; - _exit(1); // _exit because we don't want atexit() clean-up! - } else { - if (pid > 0) - { - // parent - wait for child to die - int childExitStatus; - waitpid(pid, &childExitStatus, 0); - } else { - LL_WARNS() << "fork failure." << LL_ENDL; - } - } + return result; } -#endif // Open a URL with the user's default web browser. // Must begin with protocol identifier. @@ -2525,56 +1739,26 @@ void LLWindowSDL::spawnWebBrowser(const std::string& escaped_url, bool async) LL_INFOS() << "spawn_web_browser: " << escaped_url << LL_ENDL; -#if LL_LINUX -# if LL_X11 - if (mSDL_Display) - { - maybe_lock_display(); - // Just in case - before forking. - XSync(mSDL_Display, False); - maybe_unlock_display(); - } -# endif // LL_X11 - - std::string cmd, arg; - cmd = gDirUtilp->getAppRODataDir(); - cmd += gDirUtilp->getDirDelimiter(); - cmd += "etc"; - cmd += gDirUtilp->getDirDelimiter(); - cmd += "launch_url.sh"; - arg = escaped_url; - exec_cmd(cmd, arg); -#endif // LL_LINUX + if (!SDL_OpenURL(escaped_url.c_str())) + { + LL_WARNS() << "spawn_web_browser failed with error: " << SDL_GetError() << LL_ENDL; + } LL_INFOS() << "spawn_web_browser returning." << LL_ENDL; } - -void *LLWindowSDL::getPlatformWindow() +void* LLWindowSDL::getPlatformWindow() { -#if LL_GTK && LL_LLMOZLIB_ENABLED - if (LLWindowSDL::ll_try_gtk_init()) + void* ret = nullptr; + if (mWindow) { - maybe_lock_display(); - - GtkWidget *owin = gtk_window_new(GTK_WINDOW_POPUP); - // Why a layout widget? A MozContainer would be ideal, but - // it involves exposing Mozilla headers to mozlib-using apps. - // A layout widget with a GtkWindow parent has the desired - // properties of being plain GTK, having a window, and being - // derived from a GtkContainer. - GtkWidget *rtnw = gtk_layout_new(NULL, NULL); - gtk_container_add(GTK_CONTAINER(owin), rtnw); - gtk_widget_realize(rtnw); - GTK_WIDGET_UNSET_FLAGS(GTK_WIDGET(rtnw), GTK_NO_WINDOW); - - maybe_unlock_display(); - - return rtnw; +#if LL_WINDOWS + ret = SDL_GetPointerProperty(SDL_GetWindowProperties(mWindow), SDL_PROP_WINDOW_WIN32_HWND_POINTER, nullptr); +#elif LL_DARWIN + ret = SDL_GetPointerProperty(SDL_GetWindowProperties(mWindow), SDL_PROP_WINDOW_COCOA_WINDOW_POINTER, nullptr); +#endif } -#endif // LL_GTK && LL_LLMOZLIB_ENABLED - // Unixoid mozilla really needs GTK. - return NULL; + return ret; } void LLWindowSDL::bringToFront() @@ -2582,20 +1766,17 @@ void LLWindowSDL::bringToFront() // This is currently used when we are 'launched' to a specific // map position externally. LL_INFOS() << "bringToFront" << LL_ENDL; -#if LL_X11 - if (mSDL_Display && !mFullscreen) + if (mWindow && !mFullscreen) { - maybe_lock_display(); - XRaiseWindow(mSDL_Display, mSDL_XWindowID); - XSync(mSDL_Display, False); - maybe_unlock_display(); + SDL_RaiseWindow(mWindow); } -#endif // LL_X11 } //static std::vector LLWindowSDL::getDynamicFallbackFontList() { + std::vector rtns; +#if LL_LINUX // Use libfontconfig to find us a nice ordered list of fallback fonts // specific to this system. std::string final_fallback("/usr/share/fonts/truetype/kochi/kochi-gothic.ttf"); @@ -2612,9 +1793,9 @@ std::vector LLWindowSDL::getDynamicFallbackFontList() // renderable range if for some reason our FreeType actually fails // to use some of the fonts we want it to. const bool elide_unicode_coverage = true; - std::vector rtns; - FcFontSet *fs = NULL; - FcPattern *sortpat = NULL; + + FcFontSet *fs = nullptr; + FcPattern *sortpat = nullptr; LL_INFOS() << "Getting system font list from FontConfig..." << LL_ENDL; @@ -2623,7 +1804,7 @@ std::vector LLWindowSDL::getDynamicFallbackFontList() // of languages that can be displayed, but ensures that their // preferred language is rendered from a single consistent font where // possible. - FL_Locale *locale = NULL; + FL_Locale *locale = nullptr; FL_Success success = FL_FindLocale(&locale, FL_MESSAGES); if (success != 0) { @@ -2634,10 +1815,10 @@ std::vector LLWindowSDL::getDynamicFallbackFontList() LL_INFOS("AppInit") << "Variant " << locale->variant << LL_ENDL; LL_INFOS() << "Preferring fonts of language: " - << locale->lang - << LL_ENDL; + << locale->lang + << LL_ENDL; sort_order = "lang=" + std::string(locale->lang) + ":" - + sort_order; + + sort_order; } } FL_FreeLocale(&locale); @@ -2654,8 +1835,7 @@ std::vector LLWindowSDL::getDynamicFallbackFontList() { // Sort the list of system fonts from most-to-least-desirable. FcResult result; - fs = FcFontSort(NULL, sortpat, elide_unicode_coverage, - NULL, &result); + fs = FcFontSort(nullptr, sortpat, elide_unicode_coverage, nullptr, &result); FcPatternDestroy(sortpat); } @@ -2668,10 +1848,7 @@ std::vector LLWindowSDL::getDynamicFallbackFontList() for (int i=0; infont; ++i) { FcChar8 *filename; - if (FcResultMatch == FcPatternGetString(fs->fonts[i], - FC_FILE, 0, - &filename) - && filename) + if (FcResultMatch == FcPatternGetString(fs->fonts[i], FC_FILE, 0, &filename) && filename) { rtns.push_back(std::string((const char*)filename)); if (rtns.size() >= max_font_count_cutoff) @@ -2682,16 +1859,101 @@ std::vector LLWindowSDL::getDynamicFallbackFontList() } LL_DEBUGS() << "Using font list: " << LL_ENDL; - for (std::vector::iterator it = rtns.begin(); - it != rtns.end(); - ++it) + for (auto it = rtns.begin(); it != rtns.end(); ++it) { LL_DEBUGS() << " file: " << *it << LL_ENDL; } + LL_INFOS() << "Using " << rtns.size() << "/" << found_font_count << " system fonts." << LL_ENDL; rtns.push_back(final_fallback); +#endif return rtns; } -#endif // LL_SDL +void LLWindowSDL::setLanguageTextInput(const LLCoordGL& position) +{ + LLCoordWindow win_pos; + convertCoords( position, &win_pos ); + + SDL_Rect r; + r.x = win_pos.mX; + r.y = win_pos.mY; + r.w = 500; + r.h = 16; + + SDL_SetTextInputArea(mWindow, &r, 0); +} + +F32 LLWindowSDL::getSystemUISize() +{ + if(mWindow) + { + F32 scale = SDL_GetWindowDisplayScale(mWindow); + if (scale > 0.0f) + { + return scale; + } + } + return 1.f; +} + +#if LL_DARWIN +// static +U64 LLWindowSDL::getVramSize() +{ + CGLRendererInfoObj info = 0; + GLint vram_megabytes = 0; + int num_renderers = 0; + CGLError the_err = CGLQueryRendererInfo (CGDisplayIDToOpenGLDisplayMask(kCGDirectMainDisplay), &info, &num_renderers); + if(0 == the_err) + { + // The name, uses, and other platform definitions of gGLManager.mVRAM suggest that this is supposed to be total vram in MB, + // rather than, say, just the texture memory. The two exceptions are: + // 1. LLAppViewer::getViewerInfo() puts the value in a field labeled "TEXTURE_MEMORY" + // 2. For years, this present function used kCGLRPTextureMemoryMegabytes + // Now we use kCGLRPVideoMemoryMegabytes to bring it in line with everything else (except thatone label). + CGLDescribeRenderer (info, 0, kCGLRPVideoMemoryMegabytes, &vram_megabytes); + CGLDestroyRendererInfo (info); + } + else + { + vram_megabytes = 256; + } + + return (U64)vram_megabytes; // return value is in megabytes. +} + +//static +void LLWindowSDL::setUseMultGL(bool use_mult_gl) +{ + bool was_enabled = sUseMultGL; + + sUseMultGL = use_mult_gl; + + if (gGLManager.mInited) + { + CGLContextObj ctx = CGLGetCurrentContext(); + //enable multi-threaded OpenGL (whether or not sUseMultGL actually changed) + if (sUseMultGL) + { + CGLError cgl_err = CGLEnable( ctx, kCGLCEMPEngine); + if (cgl_err != kCGLNoError ) + { + LL_INFOS("GLInit") << "Multi-threaded OpenGL not available." << LL_ENDL; + sUseMultGL = false; + } + else + { + LL_INFOS("GLInit") << "Multi-threaded OpenGL enabled." << LL_ENDL; + } + } + else if (was_enabled) + { + CGLDisable( ctx, kCGLCEMPEngine); + LL_INFOS("GLInit") << "Multi-threaded OpenGL disabled." << LL_ENDL; + } + } +} +#endif + diff --git a/indra/llwindow/llwindowsdl.h b/indra/llwindow/llwindowsdl.h index 521d52df30..966999ac12 100644 --- a/indra/llwindow/llwindowsdl.h +++ b/indra/llwindow/llwindowsdl.h @@ -32,141 +32,152 @@ #include "llwindow.h" #include "lltimer.h" -#include "SDL/SDL.h" -#include "SDL/SDL_endian.h" - -#if LL_X11 -// get X11-specific headers for use in low-level stuff like copy-and-paste support -#include "SDL/SDL_syswm.h" -#endif - -// AssertMacros.h does bad things. -#include "fix_macros.h" -#undef verify -#undef require +#include "SDL3/SDL.h" +#include "SDL3/SDL_endian.h" +class LLPreeditor; -class LLWindowSDL : public LLWindow +class LLWindowSDL final : public LLWindow { public: - /*virtual*/ void show(); - /*virtual*/ void hide(); - /*virtual*/ void close(); - /*virtual*/ bool getVisible(); - /*virtual*/ bool getMinimized(); - /*virtual*/ bool getMaximized(); - /*virtual*/ bool maximize(); - /*virtual*/ void minimize(); - /*virtual*/ void restore(); - /*virtual*/ bool getFullscreen(); - /*virtual*/ bool getPosition(LLCoordScreen *position); - /*virtual*/ bool getSize(LLCoordScreen *size); - /*virtual*/ bool getSize(LLCoordWindow *size); - /*virtual*/ bool setPosition(LLCoordScreen position); - /*virtual*/ bool setSizeImpl(LLCoordScreen size); - /*virtual*/ bool setSizeImpl(LLCoordWindow size); - /*virtual*/ bool switchContext(bool fullscreen, const LLCoordScreen &size, bool disable_vsync, const LLCoordScreen * const posp = NULL); - /*virtual*/ bool setCursorPosition(LLCoordWindow position); - /*virtual*/ bool getCursorPosition(LLCoordWindow *position); - /*virtual*/ bool isWrapMouse() const override { return true; } - /*virtual*/ void showCursor(); - /*virtual*/ void hideCursor(); - /*virtual*/ void showCursorFromMouseMove(); - /*virtual*/ void hideCursorUntilMouseMove(); - /*virtual*/ bool isCursorHidden(); - /*virtual*/ void updateCursor(); - /*virtual*/ void captureMouse(); - /*virtual*/ void releaseMouse(); - /*virtual*/ void setMouseClipping( bool b ); - /*virtual*/ void setMinSize(U32 min_width, U32 min_height, bool enforce_immediately = true); - - /*virtual*/ bool isClipboardTextAvailable(); - /*virtual*/ bool pasteTextFromClipboard(LLWString &dst); - /*virtual*/ bool copyTextToClipboard(const LLWString & src); - - /*virtual*/ bool isPrimaryTextAvailable(); - /*virtual*/ bool pasteTextFromPrimary(LLWString &dst); - /*virtual*/ bool copyTextToPrimary(const LLWString & src); - - /*virtual*/ void flashIcon(F32 seconds); - /*virtual*/ F32 getGamma(); - /*virtual*/ bool setGamma(const F32 gamma); // Set the gamma - /*virtual*/ U32 getFSAASamples(); - /*virtual*/ void setFSAASamples(const U32 samples); - /*virtual*/ bool restoreGamma(); // Restore original gamma table (before updating gamma) - /*virtual*/ ESwapMethod getSwapMethod() { return mSwapMethod; } - /*virtual*/ void processMiscNativeEvents(); - /*virtual*/ void gatherInput(); - /*virtual*/ void swapBuffers(); - /*virtual*/ void restoreGLContext() {}; - - /*virtual*/ void delayInputProcessing() { }; + void show() override; + void hide() override; + void restore() override; + + void close() override; + + bool getVisible() override; + + bool getMinimized() override; + + bool getMaximized() override; + + bool maximize() override; + void minimize() override; + + bool getPosition(LLCoordScreen *position) override; + + bool getSize(LLCoordScreen *size) override; + bool getSize(LLCoordWindow *size) override; + + bool setPosition(LLCoordScreen position) override; + + bool setSizeImpl(LLCoordScreen size) override; + bool setSizeImpl(LLCoordWindow size) override; + + bool switchContext(bool fullscreen, const LLCoordScreen &size, bool enable_vsync, + const LLCoordScreen *const posp = NULL) override; + + bool setCursorPosition(LLCoordWindow position) override; + + bool getCursorPosition(LLCoordWindow *position) override; + bool isWrapMouse() const override { return true; } + void showCursor() override; + void hideCursor() override; + bool isCursorHidden() override; + + void showCursorFromMouseMove() override; + void hideCursorUntilMouseMove() override; + + void updateCursor() override; + + void captureMouse() override; + void releaseMouse() override; + + void setMouseClipping(bool b) override; + + void setMinSize(U32 min_width, U32 min_height, bool enforce_immediately = true) override; + + bool isClipboardTextAvailable() override; + bool pasteTextFromClipboard(LLWString &dst) override; + bool copyTextToClipboard(const LLWString &src) override; + + bool isPrimaryTextAvailable() override; + bool pasteTextFromPrimary(LLWString &dst) override; + bool copyTextToPrimary(const LLWString &src) override; + + void flashIcon(F32 seconds) override; + void maybeStopFlashIcon(); + + F32 getGamma() override; + bool setGamma(const F32 gamma) override; // Set the gamma + bool restoreGamma() override; // Restore original gamma table (before updating gamma) + + U32 getFSAASamples() override; + void setFSAASamples(const U32 samples) override; + + void processMiscNativeEvents() override; + + void gatherInput() override; + + SDL_AppResult handleEvent(const SDL_Event& event); + static SDL_AppResult handleEvents(const SDL_Event& event); + + void swapBuffers() override; + + void delayInputProcessing() override {}; // handy coordinate space conversion routines - /*virtual*/ bool convertCoords(LLCoordScreen from, LLCoordWindow *to); - /*virtual*/ bool convertCoords(LLCoordWindow from, LLCoordScreen *to); - /*virtual*/ bool convertCoords(LLCoordWindow from, LLCoordGL *to); - /*virtual*/ bool convertCoords(LLCoordGL from, LLCoordWindow *to); - /*virtual*/ bool convertCoords(LLCoordScreen from, LLCoordGL *to); - /*virtual*/ bool convertCoords(LLCoordGL from, LLCoordScreen *to); + bool convertCoords(LLCoordScreen from, LLCoordWindow *to) override; + bool convertCoords(LLCoordWindow from, LLCoordScreen *to) override; + bool convertCoords(LLCoordWindow from, LLCoordGL *to) override; + bool convertCoords(LLCoordGL from, LLCoordWindow *to) override; + bool convertCoords(LLCoordScreen from, LLCoordGL *to) override; + bool convertCoords(LLCoordGL from, LLCoordScreen *to) override; - /*virtual*/ LLWindowResolution* getSupportedResolutions(S32 &num_resolutions); - /*virtual*/ F32 getNativeAspectRatio(); - /*virtual*/ F32 getPixelAspectRatio(); - /*virtual*/ void setNativeAspectRatio(F32 ratio) { mOverrideAspectRatio = ratio; } + LLWindowResolution *getSupportedResolutions(S32 &num_resolutions) override; - /*virtual*/ void beforeDialog(); - /*virtual*/ void afterDialog(); + F32 getNativeAspectRatio() override; + F32 getPixelAspectRatio() override; + void setNativeAspectRatio(F32 ratio) override { mOverrideAspectRatio = ratio; } - /*virtual*/ bool dialogColorPicker(F32 *r, F32 *g, F32 *b); + void beforeDialog() override; + void afterDialog() override; - /*virtual*/ void *getPlatformWindow(); - /*virtual*/ void bringToFront(); + bool dialogColorPicker(F32 *r, F32 *g, F32 *b) override; - /*virtual*/ void spawnWebBrowser(const std::string& escaped_url, bool async); + void *getPlatformWindow() override; + + void bringToFront() override; + + void setLanguageTextInput(const LLCoordGL& pos) override; + + void spawnWebBrowser(const std::string &escaped_url, bool async) override; + + void setTitle(const std::string title) override; static std::vector getDynamicFallbackFontList(); - // Not great that these are public, but they have to be accessible - // by non-class code and it's better than making them global. -#if LL_X11 - Window mSDL_XWindowID; - Display *mSDL_Display; -#endif - void (*Lock_Display)(void); - void (*Unlock_Display)(void); + void *createSharedContext() override; + void makeContextCurrent(void *context) override; + void destroySharedContext(void *context) override; + void toggleVSync(bool enable_vsync) override; -#if LL_GTK - // Lazily initialize and check the runtime GTK version for goodness. - static bool ll_try_gtk_init(void); -#endif // LL_GTK + F32 getSystemUISize() override; -#if LL_X11 - static Window get_SDL_XWindowID(void); - static Display* get_SDL_Display(void); -#endif // LL_X11 + static std::vector getDisplaysResolutionList(); -protected: - LLWindowSDL(LLWindowCallbacks* callbacks, - const std::string& title, int x, int y, int width, int height, U32 flags, - bool fullscreen, bool clearBg, bool disable_vsync, bool use_gl, - bool ignore_pixel_depth, U32 fsaa_samples); - ~LLWindowSDL(); +#if LL_DARWIN + static U64 getVramSize(); + static void setUseMultGL(bool use_mult_gl); + + static bool sUseMultGL; +#endif - /*virtual*/ bool isValid(); - /*virtual*/ LLSD getNativeKeyData(); +protected: + LLWindowSDL(LLWindowCallbacks *callbacks, + const std::string &title, const std::string& name, int x, int y, int width, int height, U32 flags, + bool fullscreen, bool clearBg, bool enable_vsync, bool use_gl, + bool ignore_pixel_depth, U32 fsaa_samples); - void initCursors(); - void quitCursors(); - void moveWindow(const LLCoordScreen& position,const LLCoordScreen& size); + ~LLWindowSDL(); - // Changes display resolution. Returns true if successful - bool setDisplayResolution(S32 width, S32 height, S32 bits, S32 refresh); + bool isValid() override; - // Go back to last fullscreen display resolution. - bool setFullscreenResolution(); + LLSD getNativeKeyData() override; - bool shouldPostQuit() { return mPostQuit; } + void initCursors(); + void quitCursors(); protected: // @@ -174,57 +185,49 @@ protected: // // create or re-create the GL context/window. Called from the constructor and switchContext(). - bool createContext(int x, int y, int width, int height, int bits, bool fullscreen, bool disable_vsync); + bool createContext(int x, int y, int width, int height, int bits, bool fullscreen, bool enable_vsync); void destroyContext(); - void setupFailure(const std::string& text, const std::string& caption, U32 type); - void fixWindowSize(void); - U32 SDLCheckGrabbyKeys(SDLKey keysym, bool gain); + + void setupFailure(const std::string &text, const std::string &caption, U32 type); + bool SDLReallyCaptureInput(bool capture); + U32 SDLCheckGrabbyKeys(U32 keysym, bool gain); // // Platform specific variables // - U32 mGrabbyKeyFlags; - int mReallyCapturedCount; - SDL_Surface * mWindow; - std::string mWindowTitle; - double mOriginalAspectRatio; - bool mNeedsResize; // Constructor figured out the window is too big, it needs a resize. - LLCoordScreen mNeedsResizeSize; - F32 mOverrideAspectRatio; - F32 mGamma; - U32 mFSAASamples; - - int mSDLFlags; + U32 mGrabbyKeyFlags = 0; + S32 mReallyCapturedCount = 0; + SDL_Window *mWindow = nullptr; + SDL_GLContext mContext; + SDL_Cursor *mSDLCursors[UI_CURSOR_COUNT]; - SDL_Cursor* mSDLCursors[UI_CURSOR_COUNT]; - int mHaveInputFocus; /* 0=no, 1=yes, else unknown */ - int mIsMinimized; /* 0=no, 1=yes, else unknown */ + std::string mWindowTitle; + F32 mNativeAspectRatio = 0.0f; + F32 mOverrideAspectRatio = 0.0f; + F32 mGamma = 0.0f; + U32 mFSAASamples = 0; friend class LLWindowManager; private: -#if LL_X11 - void x11_set_urgent(bool urgent); - bool mFlashing; + bool mFlashing = false; LLTimer mFlashTimer; -#endif //LL_X11 + U32 mKeyVirtualKey = 0; + U32 mKeyModifiers = SDL_KMOD_NONE; - U32 mKeyScanCode; - U32 mKeyVirtualKey; - SDLMod mKeyModifiers; + void tryFindFullscreenSize(int &aWidth, int &aHeight); }; - class LLSplashScreenSDL : public LLSplashScreen { public: LLSplashScreenSDL(); virtual ~LLSplashScreenSDL(); - /*virtual*/ void showImpl(); - /*virtual*/ void updateImpl(const std::string& mesg); - /*virtual*/ void hideImpl(); + void showImpl() override; + void updateImpl(const std::string& mesg) override; + void hideImpl() override; }; S32 OSMessageBoxSDL(const std::string& text, const std::string& caption, U32 type); diff --git a/indra/newview/llappviewer.cpp b/indra/newview/llappviewer.cpp index 0d2491609b..0ba86307a2 100644 --- a/indra/newview/llappviewer.cpp +++ b/indra/newview/llappviewer.cpp @@ -288,7 +288,7 @@ extern bool gRandomizeFramerate; extern bool gPeriodicSlowFrame; extern bool gDebugGL; -#if LL_DARWIN +#if LL_DARWIN || LL_SDL_WINDOW extern bool gHiDPISupport; #endif @@ -571,6 +571,9 @@ static void settings_to_globals() #if LL_DARWIN LLWindowMacOSX::sUseMultGL = gSavedSettings.getBOOL("RenderAppleUseMultGL"); +#endif + +#if LL_DARWIN || LL_SDL_WINDOW gHiDPISupport = gSavedSettings.getBOOL("RenderHiDPI"); #endif } @@ -3380,7 +3383,7 @@ LLSD LLAppViewer::getViewerInfo() const info["RENDER_QUALITY"] = (F32)gSavedSettings.getU32("RenderQualityPerformance"); info["TEXTURE_MEMORY"] = LLSD::Integer(gGLManager.mVRAM); -#if LL_DARWIN +#if LL_DARWIN || LL_SDL_WINDOW info["HIDPI"] = gHiDPISupport; #endif diff --git a/indra/newview/llappviewerlinux.cpp b/indra/newview/llappviewerlinux.cpp index 9366c6f46e..4a96c45c69 100644 --- a/indra/newview/llappviewerlinux.cpp +++ b/indra/newview/llappviewerlinux.cpp @@ -36,8 +36,18 @@ #include "llviewercontrol.h" #include "llmd5.h" #include "llfindlocale.h" +#include "llversioninfo.h" #include + +#define SDL_MAIN_USE_CALLBACKS +#include + +#include "SDL3/SDL.h" + +#include "llsdl.h" +#include "llwindowsdl.h" + #ifdef LL_GLIB #include #endif @@ -86,9 +96,101 @@ namespace { int gArgC = 0; char **gArgV = NULL; + LLAppViewerLinux* gViewerAppPtr = NULL; void (*gOldTerminateHandler)() = NULL; } +void check_vm_bloat() +{ +#if LL_LINUX + // watch our own VM and RSS sizes, warn if we bloated rapidly + static const std::string STATS_FILE = "/proc/self/stat"; + FILE *fp = fopen(STATS_FILE.c_str(), "r"); + if (fp) + { + static long long last_vm_size = 0; + static long long last_rss_size = 0; + const long long significant_vm_difference = 250 * 1024*1024; + const long long significant_rss_difference = 50 * 1024*1024; + long long this_vm_size = 0; + long long this_rss_size = 0; + + ssize_t res; + size_t dummy; + char *ptr = nullptr; + for (int i=0; i<22; ++i) // parse past the values we don't want + { + res = getdelim(&ptr, &dummy, ' ', fp); + if (-1 == res) + { + LL_WARNS() << "Unable to parse " << STATS_FILE << LL_ENDL; + goto finally; + } + free(ptr); + ptr = nullptr; + } + // 23rd space-delimited entry is vsize + res = getdelim(&ptr, &dummy, ' ', fp); + llassert(ptr); + if (-1 == res) + { + LL_WARNS() << "Unable to parse " << STATS_FILE << LL_ENDL; + goto finally; + } + this_vm_size = atoll(ptr); + free(ptr); + ptr = nullptr; + // 24th space-delimited entry is RSS + res = getdelim(&ptr, &dummy, ' ', fp); + llassert(ptr); + if (-1 == res) + { + LL_WARNS() << "Unable to parse " << STATS_FILE << LL_ENDL; + goto finally; + } + this_rss_size = getpagesize() * atoll(ptr); + free(ptr); + ptr = nullptr; + + LL_INFOS() << "VM SIZE IS NOW " << (this_vm_size/(1024*1024)) << " MB, RSS SIZE IS NOW " << (this_rss_size/(1024*1024)) << " MB" << LL_ENDL; + + if (llabs(last_vm_size - this_vm_size) > significant_vm_difference) + { + if (this_vm_size > last_vm_size) + { + LL_WARNS() << "VM size grew by " << (this_vm_size - last_vm_size)/(1024*1024) << " MB in last frame" << LL_ENDL; + } + else + { + LL_INFOS() << "VM size shrank by " << (last_vm_size - this_vm_size)/(1024*1024) << " MB in last frame" << LL_ENDL; + } + } + + if (llabs(last_rss_size - this_rss_size) > significant_rss_difference) + { + if (this_rss_size > last_rss_size) + { + LL_WARNS() << "RSS size grew by " << (this_rss_size - last_rss_size)/(1024*1024) << " MB in last frame" << LL_ENDL; + } + else + { + LL_INFOS() << "RSS size shrank by " << (last_rss_size - this_rss_size)/(1024*1024) << " MB in last frame" << LL_ENDL; + } + } + + last_rss_size = this_rss_size; + last_vm_size = this_vm_size; + +finally: + if (ptr) + { + free(ptr); + ptr = nullptr; + } + fclose(fp); + } +#endif // LL_LINUX +} static void exceptionTerminateHandler() { @@ -102,34 +204,85 @@ static void exceptionTerminateHandler() gOldTerminateHandler(); // call old terminate() handler } -int main( int argc, char **argv ) +SDL_AppResult SDL_AppInit(void **appstate, int argc, char **argv) { // Call Tracy first thing to have it allocate memory // https://github.com/wolfpld/tracy/issues/196 LL_PROFILER_FRAME_END; LL_PROFILER_SET_THREAD_NAME("App"); + gSDLMainHandled = true; + gArgC = argc; gArgV = argv; - LLAppViewer* viewer_app_ptr = new LLAppViewerLinux(); + gViewerAppPtr = new LLAppViewerLinux(); // install unexpected exception handler gOldTerminateHandler = std::set_terminate(exceptionTerminateHandler); unsetenv( "LD_PRELOAD" ); // Get rid of any preloading, we do not want this to happen during startup of plugins. - bool ok = viewer_app_ptr->init(); + // This needs to be set as early as possible + SDL_SetAppMetadataProperty(SDL_PROP_APP_METADATA_NAME_STRING, LLVersionInfo::getInstance()->getChannel().c_str()); + SDL_SetAppMetadataProperty(SDL_PROP_APP_METADATA_VERSION_STRING, LLVersionInfo::getInstance()->getVersion().c_str()); + SDL_SetAppMetadataProperty(SDL_PROP_APP_METADATA_IDENTIFIER_STRING, "com.secondlife.indra.viewer"); + SDL_SetAppMetadataProperty(SDL_PROP_APP_METADATA_CREATOR_STRING, "Linden Research Inc"); + SDL_SetAppMetadataProperty(SDL_PROP_APP_METADATA_COPYRIGHT_STRING, "Copyright (c) Linden Research, Inc. 2025"); + SDL_SetAppMetadataProperty(SDL_PROP_APP_METADATA_URL_STRING, "https://www.secondlife.com"); + SDL_SetAppMetadataProperty(SDL_PROP_APP_METADATA_TYPE_STRING, "game"); + + bool ok = gViewerAppPtr->init(); if(!ok) { LL_WARNS() << "Application init failed." << LL_ENDL; - return -1; + return SDL_APP_FAILURE; } + return SDL_APP_CONTINUE; +} + +SDL_AppResult SDL_AppIterate(void *appstate) +{ // Run the application main loop - while (! viewer_app_ptr->frame()) - {} + if (!gViewerAppPtr->frame()) + { +#if LL_GLIB + // Pump until we've nothing left to do or passed 1/15th of a + // second pumping for this frame. + static LLTimer pump_timer; + pump_timer.reset(); + pump_timer.setTimerExpirySec(1.0f / 15.0f); + do + { + g_main_context_iteration(g_main_context_default(), false); + } while( g_main_context_pending(g_main_context_default()) && !pump_timer.hasExpired()); +#endif + + // hack - doesn't belong here - but this is just for debugging + if (getenv("LL_DEBUG_BLOAT")) + { + check_vm_bloat(); + } + + return SDL_APP_CONTINUE; + } + + if(LLApp::isError()) + { + return SDL_APP_FAILURE; + } + + return SDL_APP_SUCCESS; +} + +SDL_AppResult SDL_AppEvent(void *appstate, SDL_Event *event) +{ + return LLWindowSDL::handleEvents(*event); +} +void SDL_AppQuit(void *appstate, SDL_AppResult result) +{ if (!LLApp::isError()) { // @@ -137,19 +290,11 @@ int main( int argc, char **argv ) // the assumption is that the error handler is responsible for doing // app cleanup if there was a problem. // - viewer_app_ptr->cleanup(); + gViewerAppPtr->cleanup(); } - delete viewer_app_ptr; - viewer_app_ptr = NULL; - return 0; -} - -LLAppViewerLinux::LLAppViewerLinux() -{ -} -LLAppViewerLinux::~LLAppViewerLinux() -{ + delete gViewerAppPtr; + gViewerAppPtr = nullptr; } bool LLAppViewerLinux::init() @@ -333,63 +478,6 @@ bool LLAppViewerLinux::sendURLToOtherInstance(const std::string& url) void LLAppViewerLinux::initCrashReporting(bool reportFreeze) { - std::string cmd =gDirUtilp->getExecutableDir(); - cmd += gDirUtilp->getDirDelimiter(); -#if LL_LINUX - cmd += "linux-crash-logger.bin"; -#else -# error Unknown platform -#endif - - std::stringstream pid_str; - pid_str << LLApp::getPid(); - std::string logdir = gDirUtilp->getExpandedFilename(LL_PATH_DUMP, ""); - std::string appname = gDirUtilp->getExecutableFilename(); - std::string grid{ LLGridManager::getInstance()->getGridId() }; - std::string title{ LLAppViewer::instance()->getSecondLifeTitle() }; - std::string pidstr{ pid_str.str() }; - // launch the actual crash logger - const char * cmdargv[] = - {cmd.c_str(), - "-user", - grid.c_str(), - "-name", - title.c_str(), - "-pid", - pidstr.c_str(), - "-dumpdir", - logdir.c_str(), - "-procname", - appname.c_str(), - NULL}; - fflush(NULL); - - pid_t pid = fork(); - if (pid == 0) - { // child - execv(cmd.c_str(), (char* const*) cmdargv); /* Flawfinder: ignore */ - LL_WARNS() << "execv failure when trying to start " << cmd << LL_ENDL; - _exit(1); // avoid atexit() - } - else - { - if (pid > 0) - { - // DO NOT wait for child proc to die; we want - // the logger to outlive us while we quit to - // free up the screen/keyboard/etc. - ////int childExitStatus; - ////waitpid(pid, &childExitStatus, 0); - } - else - { - LL_WARNS() << "fork failure." << LL_ENDL; - } - } - // Sometimes signals don't seem to quit the viewer. Also, we may - // have been called explicitly instead of from a signal handler. - // Make sure we exit so as to not totally confuse the user. - //_exit(1); // avoid atexit(), else we may re-crash in dtors. } bool LLAppViewerLinux::beingDebugged() @@ -420,7 +508,7 @@ bool LLAppViewerLinux::beingDebugged() base += 1; } - if (strcmp(base, "gdb") == 0) + if (strcmp(base, "gdb") == 0 || strcmp(base, "lldb") == 0) { debugged = yes; } @@ -432,18 +520,6 @@ bool LLAppViewerLinux::beingDebugged() return debugged == yes; } -void LLAppViewerLinux::initLoggingAndGetLastDuration() -{ - // Remove the last stack trace, if any - // This file is no longer created, since the move to Google Breakpad - // The code is left here to clean out any old state in the log dir - std::string old_stack_file = - gDirUtilp->getExpandedFilename(LL_PATH_LOGS,"stack_trace.log"); - LLFile::remove(old_stack_file); - - LLAppViewer::initLoggingAndGetLastDuration(); -} - bool LLAppViewerLinux::initParseCommandLine(LLCommandLineParser& clp) { if (!clp.parseCommandLine(gArgC, gArgV)) diff --git a/indra/newview/llappviewerlinux.h b/indra/newview/llappviewerlinux.h index 460ca721f1..8154d38921 100644 --- a/indra/newview/llappviewerlinux.h +++ b/indra/newview/llappviewerlinux.h @@ -33,30 +33,29 @@ class LLCommandLineParser; -class LLAppViewerLinux : public LLAppViewer +class LLAppViewerLinux final : public LLAppViewer { public: - LLAppViewerLinux(); - virtual ~LLAppViewerLinux(); + LLAppViewerLinux() = default; + ~LLAppViewerLinux() override = default; // // Main application logic // - virtual bool init(); // Override to do application initialization + bool init() override; // Override to do application initialization std::string generateSerialNumber(); bool setupSLURLHandler(); protected: - virtual bool beingDebugged(); + bool beingDebugged() override; - virtual bool restoreErrorTrap(); - virtual void initCrashReporting(bool reportFreeze); + bool restoreErrorTrap() override; + void initCrashReporting(bool reportFreeze); - virtual void initLoggingAndGetLastDuration(); - virtual bool initParseCommandLine(LLCommandLineParser& clp); + bool initParseCommandLine(LLCommandLineParser& clp) override; - virtual bool initSLURLHandler(); - virtual bool sendURLToOtherInstance(const std::string& url); + bool initSLURLHandler() override; + bool sendURLToOtherInstance(const std::string& url) override; }; #endif // LL_LLAPPVIEWERLINUX_H diff --git a/indra/newview/lldirpicker.cpp b/indra/newview/lldirpicker.cpp index e967ff3df2..2dba778e24 100644 --- a/indra/newview/lldirpicker.cpp +++ b/indra/newview/lldirpicker.cpp @@ -37,6 +37,10 @@ #include "llviewercontrol.h" #include "llwin32headers.h" +#if LL_SDL_WINDOW +#include "SDL3/SDL.h" +#endif + #if LL_LINUX || LL_DARWIN # include "llfilepicker.h" #endif @@ -65,7 +69,103 @@ bool LLDirPicker::check_local_file_access_enabled() return true; } -#if LL_WINDOWS +#if LL_SDL_WINDOW + +LLDirPicker::LLDirPicker() : + mFileName(NULL), + mLocked(false) +{ + reset(); +} + +LLDirPicker::~LLDirPicker() +{ +} + +void LLDirPicker::reset() +{ +} + +bool LLDirPicker::getDir(std::string* filename, bool blocking) +{ + return false; +} + +std::string LLDirPicker::getDirName() +{ + return {}; +} + +bool LLDirPicker::getDirModeless(std::string* filename, + void (*callback)(bool, std::string&, void*), + void* userdata) +{ + if (mLocked) + { + return false; + } + + // if local file browsing is turned off, return without opening dialog + if (!check_local_file_access_enabled()) + { + return false; + } + + { + struct LLSDLFileUserdata + { + LLSDLFileUserdata(void (*callback_func)(bool, std::string&, void*), void* callback_userdata) + : mCallback(callback_func), mUserdata(callback_userdata) + { + } + void (*mCallback)(bool, std::string&, void*); + void* mUserdata; + }; + + auto sdl_callback = [](void* userdata, const char* const* filelist, int filter) + { + LLSDLFileUserdata* callback_struct = (LLSDLFileUserdata*)userdata; + + auto* callback_func = callback_struct->mCallback; + auto* callback_data = callback_struct->mUserdata; + delete callback_struct; // delete callback container + + std::string rtn; + if (!filelist) + { + LL_WARNS() << "Error during SDL folder picking: " << SDL_GetError() << LL_ENDL; + callback_func(false, rtn, callback_data); + return; + } + else if (!*filelist) + { + LL_INFOS() << "User did not select any folders. Dialog likely cancelled." << LL_ENDL; + callback_func(false, rtn, callback_data); + return; + } + + while (*filelist) { + rtn = std::string(*filelist); + break; + } + callback_func(true, rtn, callback_data); + + }; + + LLSDLFileUserdata* llfilecallback = new LLSDLFileUserdata(callback, userdata); + + SDL_PropertiesID props = SDL_CreateProperties(); + SDL_SetPointerProperty(props, SDL_PROP_FILE_DIALOG_WINDOW_POINTER, SDL_GL_GetCurrentWindow()); + SDL_ShowFileDialogWithProperties(SDL_FILEDIALOG_OPENFOLDER, sdl_callback, llfilecallback, props); + + SDL_DestroyProperties(props); + } + + return true; +} + + +#elif LL_WINDOWS LLDirPicker::LLDirPicker() : mFileName(NULL), @@ -167,6 +267,13 @@ bool LLDirPicker::getDir(std::string* filename, bool blocking) return success; } +bool LLDirPicker::getDirModeless(std::string* filename, + void (*callback)(bool, std::string&, void*), + void* userdata) +{ + return false; +} + std::string LLDirPicker::getDirName() { return mDir; @@ -195,7 +302,6 @@ void LLDirPicker::reset() } -//static bool LLDirPicker::getDir(std::string* filename, bool blocking) { LLFilePicker::ELoadFilter filter=LLFilePicker::FFLOAD_DIRECTORY; @@ -203,6 +309,13 @@ bool LLDirPicker::getDir(std::string* filename, bool blocking) return mFilePicker->getOpenFile(filter, true); } +bool LLDirPicker::getDirModeless(std::string* filename, + void (*callback)(bool, std::string&, void*), + void* userdata) +{ + return false; +} + std::string LLDirPicker::getDirName() { return mFilePicker->getFirstFile(); @@ -240,23 +353,13 @@ bool LLDirPicker::getDir(std::string* filename, bool blocking) return false; } -#if !LL_MESA_HEADLESS - - if (mFilePicker) - { - GtkWindow* picker = mFilePicker->buildFilePicker(false, true, - "dirpicker"); - - if (picker) - { - gtk_window_set_title(GTK_WINDOW(picker), LLTrans::getString("choose_the_directory").c_str()); - gtk_widget_show_all(GTK_WIDGET(picker)); - gtk_main(); - return (!mFilePicker->getFirstFile().empty()); - } - } -#endif // !LL_MESA_HEADLESS + return false; +} +bool LLDirPicker::getDirModeless(std::string* filename, + void (*callback)(bool, std::string&, void*), + void* userdata) +{ return false; } @@ -290,6 +393,13 @@ bool LLDirPicker::getDir(std::string* filename, bool blocking) return false; } +bool LLDirPicker::getDirModeless(std::string* filename, + void (*callback)(bool, std::string&, void*), + void* userdata) +{ + return false; +} + std::string LLDirPicker::getDirName() { return ""; @@ -303,7 +413,9 @@ std::queue LLDirPickerThread::sDeadQ; void LLDirPickerThread::getFile() { -#if LL_WINDOWS +#if LL_SDL_WINDOW + runModeless(); +#elif LL_WINDOWS start(); #else run(); @@ -333,6 +445,32 @@ void LLDirPickerThread::run() } +void LLDirPickerThread::runModeless() +{ + LLDirPicker picker; + bool result = picker.getDirModeless(&mProposedName, modelessStringCallback, this); + if (!result) + { + LLMutexLock lock(sMutex); + sDeadQ.push(this); + } +} + +void LLDirPickerThread::modelessStringCallback(bool success, + std::string& response, + void* user_data) +{ + LLDirPickerThread* picker = (LLDirPickerThread*)user_data; + { + LLMutexLock lock(sMutex); + if (success) + { + picker->mResponses.push_back(response); + } + sDeadQ.push(picker); + } +} + //static void LLDirPickerThread::initClass() { diff --git a/indra/newview/lldirpicker.h b/indra/newview/lldirpicker.h index dc740caab2..c3619f91f5 100644 --- a/indra/newview/lldirpicker.h +++ b/indra/newview/lldirpicker.h @@ -58,6 +58,9 @@ class LLDirPicker { public: bool getDir(std::string* filename, bool blocking = true); + bool getDirModeless(std::string* filename, + void (*callback)(bool, std::string&, void*), + void* userdata); std::string getDirName(); // clear any lists of buffers or whatever, and make sure the dir @@ -116,6 +119,11 @@ public: virtual void run(); + void runModeless(); + static void modelessStringCallback(bool success, + std::string& response, + void* user_data); + virtual void notify(const std::vector& filenames); private: diff --git a/indra/newview/llfloaterpreferencesgraphicsadvanced.cpp b/indra/newview/llfloaterpreferencesgraphicsadvanced.cpp index a8a1e507a8..85c027c84e 100644 --- a/indra/newview/llfloaterpreferencesgraphicsadvanced.cpp +++ b/indra/newview/llfloaterpreferencesgraphicsadvanced.cpp @@ -81,7 +81,7 @@ bool LLFloaterPreferenceGraphicsAdvanced::postBuild() } } -#if !LL_DARWIN +#if !LL_DARWIN && !LL_SDL_WINDOW LLCheckBoxCtrl *use_HiDPI = getChild("use HiDPI"); use_HiDPI->setVisible(false); #endif diff --git a/indra/newview/llviewerwindow.cpp b/indra/newview/llviewerwindow.cpp index 72671c52ad..7dfc5150c4 100644 --- a/indra/newview/llviewerwindow.cpp +++ b/indra/newview/llviewerwindow.cpp @@ -5646,11 +5646,6 @@ void* LLViewerWindow::getPlatformWindow() const return mWindow->getPlatformWindow(); } -void* LLViewerWindow::getMediaWindow() const -{ - return mWindow->getMediaWindow(); -} - void LLViewerWindow::focusClient() const { return mWindow->focusClient(); diff --git a/indra/newview/llviewerwindow.h b/indra/newview/llviewerwindow.h index 61aa84394c..00413ce141 100644 --- a/indra/newview/llviewerwindow.h +++ b/indra/newview/llviewerwindow.h @@ -270,7 +270,6 @@ public: LLWindow* getWindow() const { return mWindow; } void* getPlatformWindow() const; - void* getMediaWindow() const; void focusClient() const; LLCoordGL getLastMouse() const { return mLastMousePoint; } diff --git a/indra/newview/viewer_manifest.py b/indra/newview/viewer_manifest.py index 6f13466d75..2b30920265 100755 --- a/indra/newview/viewer_manifest.py +++ b/indra/newview/viewer_manifest.py @@ -1116,6 +1116,9 @@ class LinuxManifest(ViewerManifest): super(LinuxManifest, self).construct() pkgdir = os.path.join(self.args['build'], os.pardir, 'packages') + if "package_dir" in self.args: + pkgdir = self.args['package_dir'] + relpkgdir = os.path.join(pkgdir, "lib", "release") debpkgdir = os.path.join(pkgdir, "lib", "debug") @@ -1240,7 +1243,7 @@ class LinuxManifest(ViewerManifest): def strip_binaries(self): if self.args['buildtype'].lower() == 'release' and self.is_packaging_viewer(): - print("* Going strip-crazy on the packaged binaries, since this is a RELEASE build") + print("* Going strip-crazy on the packaged binaries, since this is a Release build") # makes some small assumptions about our packaged dir structure self.run_command( ["find"] + @@ -1255,58 +1258,27 @@ class LinuxManifest(ViewerManifest): '!', '-name', '*.json', '!', '-name', 'update_install', '-exec', 'strip', '-S', '{}', ';']) -class Linux_i686_Manifest(LinuxManifest): - address_size = 32 +class Linux_x86_64_Manifest(LinuxManifest): + address_size = 64 def construct(self): - super(Linux_i686_Manifest, self).construct() + super(Linux_x86_64_Manifest, self).construct() pkgdir = os.path.join(self.args['build'], os.pardir, 'packages') + if "package_dir" in self.args: + pkgdir = self.args['package_dir'] + relpkgdir = os.path.join(pkgdir, "lib", "release") - debpkgdir = os.path.join(pkgdir, "lib", "debug") + #debpkgdir = os.path.join(pkgdir, "lib", "debug") with self.prefix(src=relpkgdir, dst="lib"): - self.path("libdb*.so") - self.path("libuuid.so*") - self.path("libSDL-1.2.so.*") - self.path("libdirectfb-1.*.so.*") - self.path("libfusion-1.*.so.*") - self.path("libdirect-1.*.so.*") - self.path("libopenjp2.so*") - self.path("libdirectfb-1.4.so.5") - self.path("libfusion-1.4.so.5") - self.path("libdirect-1.4.so.5*") + self.path("libSDL*.so.*") + self.path("libalut.so*") self.path("libopenal.so*") - self.path("libopenal.so", "libvivoxoal.so.1") # vivox's sdk expects this soname - # KLUDGE: As of 2012-04-11, the 'fontconfig' package installs - # libfontconfig.so.1.4.4, along with symlinks libfontconfig.so.1 - # and libfontconfig.so. Before we added support for library-file - # wildcards, though, this self.path() call specifically named - # libfontconfig.so.1.4.4 WITHOUT also copying the symlinks. When I - # (nat) changed the call to self.path("libfontconfig.so.*"), we - # ended up with the libfontconfig.so.1 symlink in the target - # directory as well. But guess what! At least on Ubuntu 10.04, - # certain viewer fonts look terrible with libfontconfig.so.1 - # present in the target directory. Removing that symlink suffices - # to improve them. I suspect that means we actually do better when - # the viewer fails to find our packaged libfontconfig.so*, falling - # back on the system one instead -- but diagnosing and fixing that - # is a bit out of scope for the present project. Meanwhile, this - # particular wildcard specification gets us exactly what the - # previous call did, without having to explicitly state the - # version number. - self.path("libfontconfig.so.*.*") - - # Include libfreetype.so. but have it work as libfontconfig does. - self.path("libfreetype.so.*.*") - try: - self.path("libtcmalloc.so*") #formerly called google perf tools - pass - except: - print("tcmalloc files not found, skipping") - pass + if self.args['discord'] == 'ON': + self.path("libdiscord_partner_sdk.so*") # Vivox runtimes with self.prefix(src=relpkgdir, dst="bin"): @@ -1318,17 +1290,6 @@ class Linux_i686_Manifest(LinuxManifest): self.path("libvivoxsdk.so") self.strip_binaries() - - -class Linux_x86_64_Manifest(LinuxManifest): - address_size = 64 - - def construct(self): - super(Linux_x86_64_Manifest, self).construct() - - # support file for valgrind debug tool - self.path("secondlife-i686.supp") - ################################################################ if __name__ == "__main__": -- cgit v1.3 From 1727c4d26429dd256fb2cd90fa83085e976794cc Mon Sep 17 00:00:00 2001 From: Rye Date: Fri, 24 Oct 2025 01:38:56 -0400 Subject: Reintroduce llappearanceutility to viewer tree from archive/develop Signed-off-by: Rye --- .gitattributes | 4 + .github/workflows/build.yaml | 10 + autobuild.xml | 30 - build.sh | 12 +- indra/CMakeLists.txt | 12 +- indra/cmake/LLAppearanceUtility.cmake | 12 - indra/llappearance/llavatarappearancedefines.cpp | 4 +- indra/llappearance/llavatarappearancedefines.h | 4 +- indra/llappearance/lltexlayer.cpp | 25 + indra/llappearance/lltexlayer.h | 2 + indra/llappearance/lltexlayerparams.h | 1 + indra/llappearanceutility/CMakeLists.txt | 78 ++ indra/llappearanceutility/README.md | 33 + indra/llappearanceutility/appearance_utility.cpp | 66 ++ .../llappearanceutility/llappappearanceutility.cpp | 681 ++++++++++++ indra/llappearanceutility/llappappearanceutility.h | 108 ++ indra/llappearanceutility/llbakingavatar.cpp | 177 +++ indra/llappearanceutility/llbakingavatar.h | 139 +++ indra/llappearanceutility/llbakingjoint.cpp | 54 + indra/llappearanceutility/llbakingjoint.h | 44 + indra/llappearanceutility/llbakingjointmesh.cpp | 43 + indra/llappearanceutility/llbakingjointmesh.h | 45 + indra/llappearanceutility/llbakingprocess.cpp | 47 + indra/llappearanceutility/llbakingprocess.h | 60 ++ indra/llappearanceutility/llbakingshadermgr.cpp | 250 +++++ indra/llappearanceutility/llbakingshadermgr.h | 137 +++ indra/llappearanceutility/llbakingtexlayer.cpp | 373 +++++++ indra/llappearanceutility/llbakingtexlayer.h | 77 ++ indra/llappearanceutility/llbakingtexture.cpp | 81 ++ indra/llappearanceutility/llbakingtexture.h | 69 ++ indra/llappearanceutility/llbakingwearable.cpp | 77 ++ indra/llappearanceutility/llbakingwearable.h | 48 + .../llappearanceutility/llbakingwearablesdata.cpp | 131 +++ indra/llappearanceutility/llbakingwearablesdata.h | 55 + indra/llappearanceutility/llbakingwindow.cpp | 94 ++ indra/llappearanceutility/llbakingwindow.h | 45 + indra/llappearanceutility/llprocessparams.cpp | 281 +++++ indra/llappearanceutility/llprocessparams.h | 49 + indra/llappearanceutility/llprocessskin.cpp | 118 ++ indra/llappearanceutility/llprocessskin.h | 43 + indra/llappearanceutility/llprocesstexture.cpp | 285 +++++ indra/llappearanceutility/llprocesstexture.h | 63 ++ indra/llappearanceutility/tests/joint-offsets.xml | 1 + .../tests/joint-offsets.xml.output | 1 + indra/llappearanceutility/tests/params.xml | 1140 ++++++++++++++++++++ indra/llappearanceutility/tests/params.xml.output | 1 + .../llappearanceutility/tests/texture.llsd.binary | Bin 0 -> 170423 bytes .../llappearanceutility/tests/texture.llsd.output | Bin 0 -> 112866 bytes indra/llrender/llglheaders.h | 2 - indra/llrender/llimagegl.cpp | 6 +- 50 files changed, 5058 insertions(+), 60 deletions(-) delete mode 100644 indra/cmake/LLAppearanceUtility.cmake create mode 100644 indra/llappearanceutility/CMakeLists.txt create mode 100644 indra/llappearanceutility/README.md create mode 100644 indra/llappearanceutility/appearance_utility.cpp create mode 100644 indra/llappearanceutility/llappappearanceutility.cpp create mode 100644 indra/llappearanceutility/llappappearanceutility.h create mode 100644 indra/llappearanceutility/llbakingavatar.cpp create mode 100644 indra/llappearanceutility/llbakingavatar.h create mode 100644 indra/llappearanceutility/llbakingjoint.cpp create mode 100644 indra/llappearanceutility/llbakingjoint.h create mode 100644 indra/llappearanceutility/llbakingjointmesh.cpp create mode 100644 indra/llappearanceutility/llbakingjointmesh.h create mode 100644 indra/llappearanceutility/llbakingprocess.cpp create mode 100644 indra/llappearanceutility/llbakingprocess.h create mode 100644 indra/llappearanceutility/llbakingshadermgr.cpp create mode 100644 indra/llappearanceutility/llbakingshadermgr.h create mode 100644 indra/llappearanceutility/llbakingtexlayer.cpp create mode 100644 indra/llappearanceutility/llbakingtexlayer.h create mode 100644 indra/llappearanceutility/llbakingtexture.cpp create mode 100644 indra/llappearanceutility/llbakingtexture.h create mode 100644 indra/llappearanceutility/llbakingwearable.cpp create mode 100644 indra/llappearanceutility/llbakingwearable.h create mode 100644 indra/llappearanceutility/llbakingwearablesdata.cpp create mode 100644 indra/llappearanceutility/llbakingwearablesdata.h create mode 100644 indra/llappearanceutility/llbakingwindow.cpp create mode 100644 indra/llappearanceutility/llbakingwindow.h create mode 100755 indra/llappearanceutility/llprocessparams.cpp create mode 100644 indra/llappearanceutility/llprocessparams.h create mode 100644 indra/llappearanceutility/llprocessskin.cpp create mode 100644 indra/llappearanceutility/llprocessskin.h create mode 100644 indra/llappearanceutility/llprocesstexture.cpp create mode 100644 indra/llappearanceutility/llprocesstexture.h create mode 100644 indra/llappearanceutility/tests/joint-offsets.xml create mode 100644 indra/llappearanceutility/tests/joint-offsets.xml.output create mode 100644 indra/llappearanceutility/tests/params.xml create mode 100644 indra/llappearanceutility/tests/params.xml.output create mode 100644 indra/llappearanceutility/tests/texture.llsd.binary create mode 100644 indra/llappearanceutility/tests/texture.llsd.output (limited to 'autobuild.xml') diff --git a/.gitattributes b/.gitattributes index 5c7f5b73b0..e7c2f83897 100644 --- a/.gitattributes +++ b/.gitattributes @@ -24,6 +24,10 @@ *.dll binary *.exe binary +# Test Resources +*.binary binary +*.output binary + # Files with Windows line endings VivoxAUP.txt text eol=crlf FILES_ARE_UNICODE_UTF-16LE.txt text eol=crlf diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index 4c948e5586..db7d21b961 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -298,6 +298,16 @@ jobs: path: | ${{ steps.build.outputs.physicstpv }} + - name: Upload appearance utility package + uses: actions/upload-artifact@v4 + if: steps.build.outputs.appearanceutility + with: + name: "${{ steps.build.outputs.artifact }}-appearanceutility" + # emitted by build.sh, zero or one lines + path: | + ${{ steps.build.outputs.appearanceutility }} + + sign-and-package-windows: env: AZURE_KEY_VAULT_URI: ${{ secrets.AZURE_KEY_VAULT_URI }} diff --git a/autobuild.xml b/autobuild.xml index 78b235fabb..85b3ea4e63 100644 --- a/autobuild.xml +++ b/autobuild.xml @@ -1241,36 +1241,6 @@ description Libxml2 is the XML C parser and toolkit developed for the Gnome project. - llappearance_utility - - platforms - - linux - - archive - - hash - fddd634dec5ec03924d62cc774f7f8ea - url - http://s3-proxy.lindenlab.com/private-builds-secondlife-com/hg/repo/p64_viewer-llappearance-utility/rev/317266/arch/Linux/installer/llappearance_utility-0.0.1-linux-317266.tar.bz2 - - name - linux - - - license - Proprietary - license_file - LICENSES/llappearanceutility.txt - copyright - Copyright (c) 2000-2012, Linden Research, Inc. - version - 0.0.1 - name - llappearance_utility - description - Linden Lab appearance utility for server-side avatar baking services. - llca platforms diff --git a/build.sh b/build.sh index ba90065827..0a55941812 100755 --- a/build.sh +++ b/build.sh @@ -119,11 +119,13 @@ EOF=$(dd if=/dev/urandom bs=15 count=1 status=none | base64) metadata=() symbolfile=() physicstpv=() +appearanceutility=() # and dump them to GITHUB_OUTPUT when done cleanup="$cleanup ; \ arrayoutput metadata ; \ arrayoutput symbolfile ; \ -arrayoutput physicstpv" +arrayoutput physicstpv ; \ +arrayoutput appearanceutility" trap "$cleanup" EXIT arrayoutput() @@ -537,6 +539,14 @@ then symbolfile+=("$symbol_file") fi + # Upload our apperance utility packages for linux + if [ "$arch" == "Linux" ] + then + appearance_utility_dir="${build_dir}/llappearanceutility" + appearanceutility+=("${appearance_utility_dir}/appearance-utility-bin") + appearanceutility+=("${appearance_utility_dir}/appearance-utility-headless-bin") + fi + # Upload the llphysicsextensions_tpv package, if one was produced # Only upload this package when building the private repo so the # artifact is private. diff --git a/indra/CMakeLists.txt b/indra/CMakeLists.txt index 8fde58fa43..571465c707 100644 --- a/indra/CMakeLists.txt +++ b/indra/CMakeLists.txt @@ -103,16 +103,8 @@ add_subdirectory(${LIBS_OPEN_PREFIX}media_plugins) endif (ENABLE_MEDIA_PLUGINS) if (LINUX) - if (INSTALL_PROPRIETARY) - include(LLAppearanceUtility) - add_subdirectory(${LLAPPEARANCEUTILITY_SRC_DIR} ${LLAPPEARANCEUTILITY_BIN_DIR}) - endif (INSTALL_PROPRIETARY) -elseif (WINDOWS) - # cmake EXISTS requires an absolute path, see indra/cmake/Variables.cmake - if (EXISTS ${VIEWER_DIR}win_setup) - add_subdirectory(${VIEWER_DIR}win_setup) - endif (EXISTS ${VIEWER_DIR}win_setup) -endif (LINUX) + add_subdirectory(llappearanceutility) +endif() if (WINDOWS) # cmake EXISTS requires an absolute path, see indra/cmake/Variables.cmake diff --git a/indra/cmake/LLAppearanceUtility.cmake b/indra/cmake/LLAppearanceUtility.cmake deleted file mode 100644 index 0eb3c723d5..0000000000 --- a/indra/cmake/LLAppearanceUtility.cmake +++ /dev/null @@ -1,12 +0,0 @@ -# -*- cmake -*- -include(Prebuilt) -include(Boost) - -# Linux proprietary build only -if (INSTALL_PROPRIETARY) - if(LINUX) - use_prebuilt_binary(llappearance_utility) - set(LLAPPEARANCEUTILITY_SRC_DIR ${LIBS_PREBUILT_DIR}/llappearanceutility/src) - set(LLAPPEARANCEUTILITY_BIN_DIR ${CMAKE_BINARY_DIR}/llappearanceutility) - endif (LINUX) -endif (INSTALL_PROPRIETARY) diff --git a/indra/llappearance/llavatarappearancedefines.cpp b/indra/llappearance/llavatarappearancedefines.cpp index 47798844bc..f26795123f 100644 --- a/indra/llappearance/llavatarappearancedefines.cpp +++ b/indra/llappearance/llavatarappearancedefines.cpp @@ -260,7 +260,7 @@ ETextureIndex LLAvatarAppearanceDictionary::bakedToLocalTextureIndex(EBakedTextu return getBakedTexture(index)->mTextureIndex; } -EBakedTextureIndex LLAvatarAppearanceDictionary::findBakedByRegionName(std::string name) +EBakedTextureIndex LLAvatarAppearanceDictionary::findBakedByRegionName(const std::string& name) const { U8 index = 0; while (index < BAKED_NUM_INDICES) @@ -277,7 +277,7 @@ EBakedTextureIndex LLAvatarAppearanceDictionary::findBakedByRegionName(std::stri return BAKED_NUM_INDICES; } -EBakedTextureIndex LLAvatarAppearanceDictionary::findBakedByImageName(std::string name) +EBakedTextureIndex LLAvatarAppearanceDictionary::findBakedByImageName(const std::string& name) const { U8 index = 0; while (index < BAKED_NUM_INDICES) diff --git a/indra/llappearance/llavatarappearancedefines.h b/indra/llappearance/llavatarappearancedefines.h index 50a72a45a5..0f9edc1ca0 100644 --- a/indra/llappearance/llavatarappearancedefines.h +++ b/indra/llappearance/llavatarappearancedefines.h @@ -238,8 +238,8 @@ public: ETextureIndex bakedToLocalTextureIndex(EBakedTextureIndex t) const; // find a baked texture index based on its name - EBakedTextureIndex findBakedByRegionName(std::string name); - EBakedTextureIndex findBakedByImageName(std::string name); + EBakedTextureIndex findBakedByRegionName(const std::string& name) const; + EBakedTextureIndex findBakedByImageName(const std::string& name) const; // Given a texture entry, determine which wearable type owns it. LLWearableType::EType getTEWearableType(ETextureIndex index) const; diff --git a/indra/llappearance/lltexlayer.cpp b/indra/llappearance/lltexlayer.cpp index b3800e6981..389efe47a9 100644 --- a/indra/llappearance/lltexlayer.cpp +++ b/indra/llappearance/lltexlayer.cpp @@ -435,6 +435,31 @@ const std::string LLTexLayerSet::getBodyRegionName() const return mInfo->mBodyRegion; } +// virtual +void LLTexLayerSet::asLLSD(LLSD& sd) const +{ + sd["visible"] = LLSD::Boolean(isVisible()); + LLSD layer_list_sd; + layer_list_t::const_iterator layer_iter = mLayerList.begin(); + layer_list_t::const_iterator layer_end = mLayerList.end(); + for(; layer_iter != layer_end; ++layer_iter) + { + LLSD layer_sd; + LLTexLayerInterface* layer = (*layer_iter); + if (layer) + { + layer->asLLSD(layer_sd); + } + layer_list_sd.append(layer_sd); + } + LLSD mask_list_sd; + LLSD info_sd; + sd["layers"] = layer_list_sd; + sd["masks"] = mask_list_sd; + sd["info"] = info_sd; +} + + void LLTexLayerSet::destroyComposite() { if( mComposite ) diff --git a/indra/llappearance/lltexlayer.h b/indra/llappearance/lltexlayer.h index 876ea6f600..6b501474d6 100644 --- a/indra/llappearance/lltexlayer.h +++ b/indra/llappearance/lltexlayer.h @@ -220,6 +220,8 @@ public: static bool sHasCaches; + virtual void asLLSD(LLSD& sd) const; + protected: typedef std::vector layer_list_t; layer_list_t mLayerList; diff --git a/indra/llappearance/lltexlayerparams.h b/indra/llappearance/lltexlayerparams.h index 5e785e4f3e..116eb3bee0 100644 --- a/indra/llappearance/lltexlayerparams.h +++ b/indra/llappearance/lltexlayerparams.h @@ -30,6 +30,7 @@ #include "llpointer.h" #include "v4color.h" #include "llviewervisualparam.h" +#include class LLAvatarAppearance; class LLImageRaw; diff --git a/indra/llappearanceutility/CMakeLists.txt b/indra/llappearanceutility/CMakeLists.txt new file mode 100644 index 0000000000..1d4e5309ba --- /dev/null +++ b/indra/llappearanceutility/CMakeLists.txt @@ -0,0 +1,78 @@ +# -*- cmake -*- + +project(appearance_utility) + +include(00-Common) +include(Boost) +include(LLAppearance) +include(LLCommon) +include(LLImage) +include(LLMath) +include(LLWindow) +include(Linking) + +set(appearance_utility_SOURCE_FILES + appearance_utility.cpp + llappappearanceutility.cpp + llbakingavatar.cpp + llbakingjoint.cpp + llbakingjointmesh.cpp + llbakingprocess.cpp + llbakingshadermgr.cpp + llbakingtexlayer.cpp + llbakingtexture.cpp + llbakingwearable.cpp + llbakingwearablesdata.cpp + llbakingwindow.cpp + llprocessparams.cpp + llprocessskin.cpp + llprocesstexture.cpp + ) + +set(appearance_utility_HEADER_FILES + CMakeLists.txt + llappappearanceutility.h + llbakingavatar.h + llbakingjoint.h + llbakingjointmesh.h + llbakingprocess.h + llbakingshadermgr.h + llbakingtexlayer.h + llbakingtexture.h + llbakingwearable.h + llbakingwearablesdata.h + llbakingwindow.h + llprocessparams.h + llprocessskin.h + llprocesstexture.h + ) + +set_source_files_properties(${appearance_utility_HEADER_FILES} + PROPERTIES HEADER_FILES_ONLY TRUE) + +list(APPEND appearance_utility_SOURCE_FILES ${appearance_utility_HEADER_FILES}) + +add_executable(appearance-utility-bin ${appearance_utility_SOURCE_FILES}) + +target_link_libraries(appearance-utility-bin + llcharacter + llinventory + llappearance + llwindow + llrender + llxml + ) + +if (BUILD_HEADLESS) + add_executable(appearance-utility-headless-bin ${appearance_utility_SOURCE_FILES}) + + target_link_libraries(appearance-utility-headless-bin + llcharacter + llinventory + llappearanceheadless + llwindowheadless + llrenderheadless + llxml + ) +endif (BUILD_HEADLESS) + diff --git a/indra/llappearanceutility/README.md b/indra/llappearanceutility/README.md new file mode 100644 index 0000000000..21019ffd27 --- /dev/null +++ b/indra/llappearanceutility/README.md @@ -0,0 +1,33 @@ +# llappearanceutility + +This directory contains the appearance utility employed by the bake service to process avatar textures and handle various other appearance-related functions. Please note that this utility is currently configured to build only on Linux systems. + +## Prerequisites + +Ensure the following prerequisites are met before building and testing the utility: + +- **X11 Display**: Ensure an X11 display is available, either virtual or physical, with the `DISPLAY` environment variable set appropriately (e.g., `DISPLAY=:1`). +- **Linux Build Environment**: Confirm that the Second Life Viewer can be built on your Linux system. + +## Testing + +Given the constraints with GitHub runners, we instead utilize Behavior-Driven Development (BDD) tests to evaluate the `llappearanceutility` through the bake service. For local development, test inputs and their expected outputs are provided below. + +### Test Commands + +1. **Baking Textures**: + ```sh + appearance-utility-bin --agent-id de494a4f-f01a-47a4-98cf-c94ef9ecca38 --texture /viewer/indra/llappearanceutility/tests/texture.llsd.binary > /viewer/indra/llappearanceutility/tests/texture.llsd.output + ``` + +2. **Generating Bake Parameters**: + ```sh + appearance-utility-bin --agent-id de494a4f-f01a-47a4-98cf-c94ef9ecca38 --params /viewer/indra/llappearanceutility/tests/params.xml > /viewer/indra/llappearanceutility/tests/params.xml.output + ``` + +3. **Calculating Joint Offsets**: + ```sh + appearance-utility-bin --agent-id de494a4f-f01a-47a4-98cf-c94ef9ecca38 --joint-offsets /viewer/indra/llappearanceutility/tests/joint-offsets.xml > /viewer/indra/llappearanceutility/tests/joint-offsets.xml.output + ``` + +These commands will execute the utility with specific test inputs and direct the output to corresponding files for validation. \ No newline at end of file diff --git a/indra/llappearanceutility/appearance_utility.cpp b/indra/llappearanceutility/appearance_utility.cpp new file mode 100644 index 0000000000..88034cd171 --- /dev/null +++ b/indra/llappearanceutility/appearance_utility.cpp @@ -0,0 +1,66 @@ +/** + * @file appearance_utility.cpp + * @author Don Kjer , Nyx Linden + * @brief Utility for processing avatar appearance without a full viewer implementation. + * + * $LicenseInfo:firstyear=2012&license=viewerlgpl$ + * Second Life Viewer Source Code + * Copyright (C) 2012, 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$ + */ + +// linden includes +#include "linden_common.h" +#include "llapr.h" + +// project includes +#include "llappappearanceutility.h" + +int main(int argc, char** argv) +{ + // Create an application instance. + ll_init_apr(); + LLAppAppearanceUtility* app = new LLAppAppearanceUtility(argc, argv); + + // Assume success, unless exception is thrown. + EResult rv = RV_SUCCESS; + try + { + // Process command line and initialize system. + if (app->init()) + { + // Run process. + app->frame(); + } + } + catch (LLAppException& e) + { + // Deal with errors. + rv = e.getStatusCode(); + } + + // Clean up application instance. + app->cleanup(); + delete app; + ll_cleanup_apr(); + + return (int) rv; +} + + diff --git a/indra/llappearanceutility/llappappearanceutility.cpp b/indra/llappearanceutility/llappappearanceutility.cpp new file mode 100644 index 0000000000..d223c859ab --- /dev/null +++ b/indra/llappearanceutility/llappappearanceutility.cpp @@ -0,0 +1,681 @@ +/** + * @file llappappearanceutility.cpp + * @brief Implementation of LLAppAppearanceUtility class. + * + * $LicenseInfo:firstyear=2012&license=viewerlgpl$ + * Second Life Viewer Source Code + * Copyright (C) 2012, 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$ + */ + +#include +#include +#include +#include "boost/bind.hpp" + +// linden includes +#include "linden_common.h" + +#include "llapr.h" +#include "llerrorcontrol.h" +#include "llfasttimer.h" +#include "llgl.h" +#include "llmd5.h" +#include "llsd.h" +#include "llsdserialize.h" +#include "llsdutil.h" +#include "llquantize.h" +#include "lltreeiterators.h" +#include "v3color.h" +#include "llwindow.h" +#include "lltrace.h" + +// appearance includes +#include "llavatarappearance.h" +#include "llwearabletype.h" + +// project includes +#include "llappappearanceutility.h" +#include "llbakingprocess.h" +#include "llprocessparams.h" +#include "llprocesstexture.h" +#include "llprocessskin.h" + +const std::string NOTHING_EXTRA(""); + +//////////////////////////////////////////// +// LLAppException +//////////////////////////////////////////// + +static const std::string MESSAGE_RV_UNKNOWN("Unknown error."); +static const std::string MESSAGE_RV_ARGUMENTS +("Invalid arguments: "); +static const std::string MESSAGE_RV_UNABLE_OPEN("Unable to open file: "); +static const std::string MESSAGE_RV_UNABLE_TO_PARSE("Unable to parse input LLSD."); +static const std::string MESSAGE_RV_UNABLE_TO_DECODE("Unable to decode input J2C."); +static const std::string MESSAGE_RV_UNABLE_TO_ENCODE("Unable to encode output J2C."); +static const std::string MESSAGE_RV_UNABLE_TO_INIT_GL("Unable to initialize GL."); +static const std::string MESSAGE_RV_UNABLE_TO_BAKE("Unable to bake texture."); +static const std::string MESSAGE_RV_INVALID_SKIN_BLOCK("Invalid skin block."); +static const std::string MESSAGE_DUPLICATE_MODES = "Cannot specify more than one process mode."; + + +LLAppException::LLAppException(EResult status_code, const std::string& extra) : + mStatusCode(status_code) +{ + switch(status_code) + { + case RV_UNKNOWN_ERROR: + printErrorLLSD("unknown", MESSAGE_RV_UNKNOWN); + case RV_BAD_ARGUMENTS: + printErrorLLSD("arguments", MESSAGE_RV_ARGUMENTS + extra); + break; + case RV_UNABLE_OPEN: + printErrorLLSD("file", MESSAGE_RV_UNABLE_OPEN + extra); + break; + case RV_UNABLE_TO_PARSE: + printErrorLLSD("input", MESSAGE_RV_UNABLE_TO_PARSE + extra); + break; + case RV_UNABLE_TO_DECODE: + printErrorLLSD("input", MESSAGE_RV_UNABLE_TO_DECODE + extra); + break; + case RV_UNABLE_TO_ENCODE: + printErrorLLSD("input", MESSAGE_RV_UNABLE_TO_ENCODE + extra); + break; + case RV_UNABLE_TO_INIT_GL: + printErrorLLSD("input", MESSAGE_RV_UNABLE_TO_INIT_GL + extra); + break; + case RV_UNABLE_TO_BAKE: + printErrorLLSD("input", MESSAGE_RV_UNABLE_TO_BAKE + extra); + break; + case RV_INVALID_SKIN_BLOCK: + printErrorLLSD("input", MESSAGE_RV_INVALID_SKIN_BLOCK + extra); + break; + default: + printErrorLLSD("arguments", "Unknown exception."); + break; + } +} + +void LLAppException::printErrorLLSD(const std::string& key, const std::string& message) +{ + LLSD error_llsd; + error_llsd["success"] = false; + error_llsd["error"]["key"] = key; + error_llsd["error"]["message"] = message; + + std::cerr << LLSDOStreamer(error_llsd); +} + + + +//////////////////////////////////////////// +// LLAppAppearanceUtility +//////////////////////////////////////////// + +///////// Option Parsing ///////// + +// Simple usage command. +class LLProcessUsage : public LLBakingProcess +{ +public: + LLProcessUsage(LLAppAppearanceUtility* app) : + LLBakingProcess(app) {} + void process(std::ostream& output) override + { + mApp->usage(output); + } +}; + + +static const apr_getopt_option_t APPEARANCE_UTILITY_OPTIONS[] = +{ + {"params", 'p', 0, "Generate appearance parameters for an agent."}, + {"texture", 't', 0, "Generate baked texture for a slot."}, + {"output", 'o', 1, "The output file to write to. Default is stdout"}, + {"agent-id", 'a', 1, "The agent-id of the user."}, + {"bake-size", 'b', 1, "The bake texture size. eg use 512 for 512*512 textures, 1024 for 1024*1024 textures" }, + //{"grid", 'g', 1, "The grid."}, + {"debug", 'd', 0, "Enable debug spam. Default is warn/info spam only."}, + {"treemap", 'm', 1, "Output LLFrameTimer to specified file in graphviz treemap/pachwork format."}, + {"threshold", 's', 1, "Percent threshold of max LLFrameTimer time in order to appear on treemap. Default is 1%."}, + {"joint-offsets",'j',0,"Extract joint positions from skin."}, + {"help", 'h', 0, "Print the help message."}, + {0, 0, 0, 0} +}; + +void LLAppAppearanceUtility::usage(std::ostream& ostr) +{ + ostr << "Utilities for processing agent appearance data." + << std::endl << std::endl + << "Usage:" << std::endl + << "\t" << mAppName << " [options] filename" << std::endl << std::endl + << "Will read from stdin if filename is set to '-'." << std::endl << std::endl + << "Options:" << std::endl; + const apr_getopt_option_t* option = &APPEARANCE_UTILITY_OPTIONS[0]; + while(option->name) + { + ostr << "\t--" << option->name << "\t\t" + << option->description << std::endl; + ++option; + } + ostr << std::endl << "Return Values:" << std::endl + << "\t0\t\tSuccess." << std::endl + << "\t1\t\tUnknown error." << std::endl + << "\t2\t\tBad arguments." << std::endl + << "\t3\t\tUnable to open file. Possibly wrong filename" + << " or bad permissions." << std::endl + << "\t4\t\tUnable to parse input LLSD." << std::endl + << std::endl + << "Output:" << std::endl + << "If a non-zero status code is returned, additional error information" + << " will be returned on stderr." << std::endl + << "* This will be in the form of an LLSD document." << std::endl + << "* Check ['error']['message'] to get a human readable message." << std::endl + << "If a zero status code is returned, processed output will be written" + << " to the file specified by --out (or stdout, if not specified)." << std::endl + << std::endl + << std::endl; +} + + +/////// LLApp Interface //////// + +LLAppAppearanceUtility::LLAppAppearanceUtility(int argc, char** argv) : + LLApp(), + mArgc(argc), + mArgv(argv), + mProcess(nullptr), + mInput(nullptr), + mOutput(nullptr), + mAppName(argv[0]), + mDebugMode(false), + mTreeMapThreshold(1), + mBakeTextureSize(512) +{ +} + +// virtual +LLAppAppearanceUtility::~LLAppAppearanceUtility() +{ +} + +void LLAppAppearanceUtility::verifyNoProcess() +{ + if (mProcess) + { + std::cerr << "Invalid arguments. " << MESSAGE_DUPLICATE_MODES << std::endl; + usage(std::cerr); + throw LLAppException(RV_BAD_ARGUMENTS, MESSAGE_DUPLICATE_MODES); + } +} + +void LLAppAppearanceUtility::parseArguments() +{ + ////// BEGIN OPTION PARSING ////// + // Check for '-' as last option, since apr doesn't seem to like that. + if (std::string(mArgv[mArgc-1]) == "-") + { + mInputFilename.assign("-"); + mArgc--; + } + + apr_status_t apr_err; + const char* opt_arg = nullptr; + int opt_id = 0; + apr_getopt_t* os = nullptr; + if(APR_SUCCESS != apr_getopt_init(&os, gAPRPoolp, mArgc, mArgv)) + { + std::cerr << "Unable to initialize apr" << std::endl; + throw LLAppException(RV_UNKNOWN_ERROR); + } + + //std::string grid; + while(true) + { + apr_err = apr_getopt_long(os, APPEARANCE_UTILITY_OPTIONS, &opt_id, &opt_arg); + if(APR_STATUS_IS_EOF(apr_err)) break; + if(apr_err) + { + char buf[MAX_STRING]; /* Flawfinder: ignore */ + std::cerr << "Error parsing options: " + << apr_strerror(apr_err, buf, MAX_STRING) << std::endl; + usage(std::cerr); + throw LLAppException(RV_BAD_ARGUMENTS, buf); + } + switch (opt_id) + { + case 'h': + verifyNoProcess(); + mProcess = new LLProcessUsage(this); + break; + case 'p': + verifyNoProcess(); + mProcess = new LLProcessParams(this); + break; + case 't': + verifyNoProcess(); + mProcess = new LLProcessTexture(this); + break; + case 'j': + verifyNoProcess(); + mProcess = new LLProcessSkin( this ); + break; + case 'o': + mOutputFilename.assign(opt_arg); + break; + case 'a': + mAgentID.set(opt_arg); + if (mAgentID.isNull()) + { + const char* INVALID_AGENT_ID="agent-id must be a valid uuid."; + std::cerr << "Invalid arguments. " << INVALID_AGENT_ID << std::endl; + usage(std::cerr); + throw LLAppException(RV_BAD_ARGUMENTS, INVALID_AGENT_ID); + } + break; + case 'b': + mBakeTextureSize = atoi(opt_arg); + break; + //case 'g': + // grid = opt_arg; + // break; + case 'd': + mDebugMode = true; + break; + case 'm': + mTreeMapFilename.assign(opt_arg); + break; + case 's': + mTreeMapThreshold = atoi(opt_arg); + break; + default: + usage(std::cerr); + throw LLAppException(RV_BAD_ARGUMENTS, "Unknown option."); + } + } + + if ("-" != mInputFilename) + { + bool valid_input_filename = false; + // Try to grab the input filename. + if (os->argv && os->argv[os->ind]) + { + mInputFilename.assign(os->argv[os->ind]); + if (! mInputFilename.empty() ) + { + valid_input_filename = true; + } + } + if (!valid_input_filename) + { + const char* INVALID_FILENAME="Must specify input file."; + std::cerr << "Invalid arguments. " << INVALID_FILENAME << std::endl; + usage(std::cerr); + throw LLAppException(RV_BAD_ARGUMENTS, INVALID_FILENAME); + } + } + + ////// END OPTION PARSING ////// +} + +void LLAppAppearanceUtility::validateArguments() +{ + ///// BEGIN ARGUMENT VALIDATION ///// + + // Make sure we have a command specified. + if (!mProcess) + { + const char* INVALID_MODE="No process mode specified."; + std::cerr << "Invalid arguments. " << INVALID_MODE + << std::endl; + usage(std::cerr); + throw LLAppException(RV_BAD_ARGUMENTS, INVALID_MODE); + } + + ///// END ARGUMENT VALIDATION ///// +} + +void LLAppAppearanceUtility::initializeIO() +{ + ///// BEGIN OPEN INPUT FILE //// + + if ( "-" == mInputFilename ) + { + // Read unformated data from stdin in to memory. + std::stringstream* data = new std::stringstream(); + const S32 BUFFER_SIZE = BUFSIZ; + char buffer[BUFFER_SIZE]; + while (true) + { + std::cin.read(buffer, BUFFER_SIZE); + // Check if anything out of the ordinary happened. + if (!std::cin) + { + // See if something 'really bad' happened, or if we just + // used up all of our buffer. + if (std::cin.bad()) + { + std::cerr << "Problem reading standard input." << std::endl; + delete data; + throw (RV_UNKNOWN_ERROR); + } + else + { + // Output normally. + data->write(buffer, std::cin.gcount()); + if (std::cin.eof()) break; + + // Clear this problem. We have handled it. + std::cin.clear(); + } + } + else + { + data->write(buffer, std::cin.gcount()); + if (std::cin.eof()) break; + } + } + mInput = data; + } + else + { + // Make sure we can open the input file. + std::ifstream* input_file = new std::ifstream(); + input_file->open( mInputFilename.c_str(), std::fstream::in | std::fstream::binary ); + if ( input_file->fail()) + { + std::cerr << "Couldn't open input file '" << mInputFilename << "'." << std::endl; + delete input_file; + throw LLAppException(RV_UNABLE_OPEN, mInputFilename); + } + mInput = input_file; + } + ///// END OPEN INPUT FILE //// + + ///// BEGIN OPEN OUTPUT FILE //// + + if ("" == mOutputFilename) + { + mOutput = &std::cout; + } + else + { + // Make sure we can open the output file. + std::fstream* output_file = new std::fstream(); + output_file->open( mOutputFilename.c_str(), std::fstream::out ); + if ( output_file->fail() ) + { + std::cerr << "Couldn't open output file '" << mOutputFilename << "'." << std::endl; + delete output_file; + throw LLAppException(RV_UNABLE_OPEN, mOutputFilename); + } + mOutput = output_file; + } + ///// END OPEN OUTPUT FILE //// + + ///// BEGIN INPUT PARSING //// + if (mProcess) + { + mProcess->parseInput( *mInput ); + } + ///// END INPUT PARSING //// +} + +class LLPassthroughTranslationBridge : public LLTranslationBridge +{ +public: + virtual std::string getString(const std::string &xml_desc) + { + // Just pass back the input string. + return xml_desc; + } +}; + + +bool LLAppAppearanceUtility::init() +{ + parseArguments(); + + bool log_to_stderr = true; + LLError::initForApplication(".", ".", true); + if (mDebugMode) + { + mRecording.start(); + LLError::setDefaultLevel(LLError::LEVEL_DEBUG); + } + else + { + LLError::setDefaultLevel(LLError::LEVEL_WARN); + } + + validateArguments(); + + LL_DEBUGS() << "BakeSize: " << mBakeTextureSize << LL_ENDL; + + // Initialize classes. + // Values taken from settings.xml. + const bool USE_TEXTURE_NEW_BYTE_RANGE=true; + const S32 TEXTURE_REVERSE_BYTE_RANGE=50; + LLImage::initClass(USE_TEXTURE_NEW_BYTE_RANGE, TEXTURE_REVERSE_BYTE_RANGE); + const bool SKIP_ANALYZE_ALPHA=true; + + LLTranslationBridge::ptr_t trans = std::make_shared(); + LLWearableType::initParamSingleton(trans); + + // *TODO: Create a texture bridge? + LLAvatarAppearance::initClass(); + + initializeIO(); + if (mProcess) + { + mProcess->init(); + } + return true; +} + + +void add_cluster(LLTrace::Recording& recording, std::ostream& tree, LLTrace::BlockTimerStatHandle& node, std::vector < S32 > & clusters, F64Milliseconds threshold) +{ + LLMD5 hash; + hash.update((const unsigned char*)node.getName().c_str(), node.getName().size()); + hash.finalize(); + char buf[33]; + hash.hex_digest(buf); + buf[6] = 0; + LLColor3 color(buf); + if (color.brightness() < 0.25f) + { + color.normalize(); + } + std::ostringstream color_str; + color_str << "#" << std::hex << std::setfill('0') << std::setw(2) + << (S32) F32_to_U8(color.mV[0], 0.0f, 1.0f) + << (S32) F32_to_U8(color.mV[1], 0.0f, 1.0f) + << (S32) F32_to_U8(color.mV[2], 0.0f, 1.0f); + + std::vector::iterator iter = clusters.begin(); + std::vector::iterator end = clusters.end(); + std::ostringstream padding; + for(; iter != end; ++iter) + { + padding << " "; + } + + std::ostringstream node_id; + bool first = true; + iter = clusters.begin(); + for(; iter != end; ++iter) + { + if (!first) + { + node_id << "_"; + } + first = false; + node_id << (*iter); + } + + if (node.getChildren().size() == 0) + { + F64Milliseconds leaf_time_ms(recording.getSum(node)); + if (leaf_time_ms > threshold) + { + tree << padding.str() << "n" << node_id.str() << " [" + << "label=\"" << node.getName() << " (" << leaf_time_ms.value() << ")\" " + << "fillcolor=\"" << color_str.str() << "\" " + << "area=" << leaf_time_ms.value() / 10 << "]" << std::endl; + } + } + else + { + if (clusters.size()) + { + tree << padding.str() << "subgraph cluster" << node_id.str(); + tree << " {" << std::endl; + } + + S32Milliseconds node_area(recording.getSum(node)); + std::vector::iterator child_iter = node.getChildren().begin(); + for (S32 num=0; child_iter != node.getChildren().end(); ++child_iter, ++num) + { + clusters.push_back(num); + add_cluster(recording, tree, *(*child_iter), clusters, threshold); + clusters.pop_back(); + node_area -= recording.getSum(*(*child_iter)); + } + + S32Milliseconds node_time_ms(node_area); + if (node_time_ms > threshold) + { + tree << padding.str() << "n" << node_id.str() << " [" + << "label=\"" << node.getName() << " (" << node_time_ms.value() << ")\" " + << "fillcolor=\"" << color_str.str() << "\" " + << "area=" << node_time_ms.value() / 10 << "]" << std::endl; + } + if (clusters.size()) + { + tree << padding.str() << "}" << std::endl;; + } + } +} + +bool LLAppAppearanceUtility::cleanup() +{ + if (mProcess) + { + mProcess->cleanup(); + } + + // Spam fast timer information in debug mode. + if (mDebugMode) + { + mRecording.stop(); + LLTrace::BlockTimer::processTimes(); + + S32Milliseconds max_time_ms(0); + for (LLTrace::block_timer_tree_df_iterator_t it = LLTrace::begin_block_timer_tree_df(LLTrace::BlockTimer::getRootTimeBlock()); + it != LLTrace::end_block_timer_tree_df(); + ++it) + { + LLTrace::BlockTimerStatHandle* idp = (*it); + // Skip near-zero time leafs. + S32Milliseconds leaf_time_ms(mRecording.getSum(*idp)); + if (leaf_time_ms > max_time_ms) max_time_ms = leaf_time_ms; + if ((S32Milliseconds)0 == leaf_time_ms) continue; + + std::vector< LLTrace::BlockTimerStatHandle* > parents; + LLTrace::BlockTimerStatHandle* parentp = idp->getParent(); + while (parentp) + { + parents.push_back(parentp); + if (parentp->getParent() == parentp) break; + parentp = parentp->getParent(); + } + + std::ostringstream fullname; + bool is_first = true; + for ( std::vector< LLTrace::BlockTimerStatHandle* >::reverse_iterator iter = parents.rbegin(); + iter != parents.rend(); ++iter) + { + // Skip root + if (is_first) + { + is_first = false; + continue; + } + LLTrace::BlockTimerStatHandle* parent_idp = (*iter); + U32Milliseconds time_ms(mRecording.getSum(parent_idp->selfTime())); + fullname << parent_idp->getName() << " "; + fullname << "("; + if (time_ms > (U32Milliseconds)0) + { + fullname << time_ms.value() << " ms, "; + } + fullname << mRecording.getSum(parent_idp->callCount()) << " call)-> "; + } + LL_DEBUGS() << fullname.str() << LL_ENDL; + } + if (!mTreeMapFilename.empty()) + { + std::ofstream tree(mTreeMapFilename.c_str()); + tree << "graph G {" << std::endl; + tree << " node[style=filled]" << std::endl; + + LLTrace::BlockTimerStatHandle& root = LLTrace::BlockTimer::getRootTimeBlock(); + std::vector clusters; + add_cluster(mRecording, tree, root, clusters, (((F32) mTreeMapThreshold / 100.f) * max_time_ms) ); + + tree << "}" << std::endl; + + LL_DEBUGS() << "To generate a treemap of LLFrameTimer results, run:" << LL_ENDL; + LL_DEBUGS() << "patchwork " << mTreeMapFilename << " -Tpng > rendered.png" << LL_ENDL; + } + } + + LLAvatarAppearance::cleanupClass(); + LLImageGL::cleanupClass(); + LLImage::cleanupClass(); + + if (mProcess) + { + delete mProcess; + mProcess = nullptr; + } + if ("-" != mInputFilename && mInput) + { + static_cast(mInput)->close(); + } + if ("" != mOutputFilename && mOutput) + { + static_cast(mOutput)->close(); + delete mOutput; + mOutput = nullptr; + } + delete mInput; + mInput = nullptr; + return true; +} + +bool LLAppAppearanceUtility::frame() +{ + // This isn't really a loop, for this application. We just execute the requested command. + mProcess->process(*mOutput); + return true; +} + diff --git a/indra/llappearanceutility/llappappearanceutility.h b/indra/llappearanceutility/llappappearanceutility.h new file mode 100644 index 0000000000..80d1e8b1bf --- /dev/null +++ b/indra/llappearanceutility/llappappearanceutility.h @@ -0,0 +1,108 @@ +/** + * @file llappappearanceutility.h + * @brief Declaration of LLAppAppearanceUtility class. + * + * $LicenseInfo:firstyear=2012&license=viewerlgpl$ + * Second Life Viewer Source Code + * Copyright (C) 2012, 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$ + */ + +#ifndef LL_LLAPPAPPEARANCEUTILITY_H +#define LL_LLAPPAPPEARANCEUTILITY_H + +#include + +#include "llapp.h" +#include "lltracerecording.h" + +enum EResult +{ + RV_SUCCESS = 0, + RV_UNKNOWN_ERROR, + RV_BAD_ARGUMENTS, + RV_UNABLE_OPEN, + RV_UNABLE_TO_PARSE, + RV_UNABLE_TO_DECODE, + RV_UNABLE_TO_ENCODE, + RV_UNABLE_TO_INIT_GL, + RV_UNABLE_TO_BAKE, + RV_INVALID_SKIN_BLOCK, +}; + +extern const std::string NOTHING_EXTRA; + +class LLAppAppearanceUtility; +class LLBakingProcess; + +// Translate error status into error messages. +class LLAppException : public std::exception +{ +public: + LLAppException(EResult status_code, const std::string& extra = NOTHING_EXTRA); + EResult getStatusCode() { return mStatusCode; } + +private: + void printErrorLLSD(const std::string& key, const std::string& message); + EResult mStatusCode; +}; + + +class LLAppAppearanceUtility : public LLApp +{ +public: + LLAppAppearanceUtility(int argc, char** argv); + virtual ~LLAppAppearanceUtility(); + + // LLApp interface. + bool init() override; + bool cleanup() override; + bool frame() override; + +private: + // Option parsing. + void verifyNoProcess(); + void parseArguments(); + void validateArguments(); + void initializeIO(); +public: + void usage(std::ostream& ostr); + bool isDebugMode() const { return mDebugMode; } + S32 bakeTextureSize() const { return mBakeTextureSize; } + +private: + int mArgc; + char** mArgv; + LLBakingProcess* mProcess; + std::istream* mInput; + std::ostream* mOutput; + std::string mAppName; + std::string mInputFilename; + std::string mOutputFilename; + LLUUID mAgentID; + S32 mBakeTextureSize; + bool mDebugMode; + LLTrace::Recording mRecording; + S32 mTreeMapThreshold; + std::string mTreeMapFilename; +}; + + +#endif /* LL_LLAPPAPPEARANCEUTILITY_H */ + diff --git a/indra/llappearanceutility/llbakingavatar.cpp b/indra/llappearanceutility/llbakingavatar.cpp new file mode 100644 index 0000000000..426fa705e9 --- /dev/null +++ b/indra/llappearanceutility/llbakingavatar.cpp @@ -0,0 +1,177 @@ +/** + * @File llbakingavatar.cpp + * @brief Implementation of LLBakingAvatar class which is a derivation of LLAvatarAppearance + * + * $LicenseInfo:firstyear=2012&license=viewerlgpl$ + * Second Life Viewer Source Code + * Copyright (C) 2012, 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$ + */ + +// linden includes +#include "linden_common.h" +#include "v3dmath.h" + +// appearance includes +#include "llavatarappearancedefines.h" + +// project includes +#include "llbakingavatar.h" +#include "llbakingjoint.h" +#include "llbakingjointmesh.h" +#include "llbakingtexlayer.h" + +using namespace LLAvatarAppearanceDefines; + +LLBakingAvatar::LLBakingAvatar(LLWearableData* wearable_data,S32 bakeTextureSize) : + LLAvatarAppearance(wearable_data), + mBakeTextureSize(bakeTextureSize) +{ +} + +// virtual +LLBakingAvatar::~LLBakingAvatar() +{ +} + +//----------------------------------------------------------------------------- +// Implemented methods +//----------------------------------------------------------------------------- + +LLAvatarJoint* LLBakingAvatar::createAvatarJoint() +{ + return new LLBakingJoint(); +} + +LLAvatarJoint* LLBakingAvatar::createAvatarJoint(S32 joint_num) +{ + return new LLBakingJoint(joint_num); +} + +LLAvatarJointMesh* LLBakingAvatar::createAvatarJointMesh() +{ + return new LLBakingJointMesh(); +} + +LLTexLayerSet* LLBakingAvatar::createTexLayerSet() +{ + return new LLBakingTexLayerSet(this); +} + +void LLBakingAvatar::bakedTextureDatasAsLLSD(LLSD& sd) const +{ + bakedtexturedata_vec_t::const_iterator baked_iter = mBakedTextureDatas.begin(); + bakedtexturedata_vec_t::const_iterator baked_end = mBakedTextureDatas.end(); + for (; baked_iter != baked_end; ++baked_iter) + { + LLBakingTexLayerSet* layer_set = dynamic_cast(baked_iter->mTexLayerSet); + LLSD layer_sd; + layer_set->asLLSD(layer_sd); + sd[LLAvatarAppearance::getDictionary()->getTexture(baked_iter->mTextureIndex)->mName] = layer_sd; + } +} + +//----------------------------------------------------------------------------- +// (Ignored) Non-implemented methods. +//----------------------------------------------------------------------------- + +void LLBakingAvatar::applyMorphMask(const U8* tex_data, S32 width, S32 height, S32 num_components, + LLAvatarAppearanceDefines::EBakedTextureIndex index) {} +void LLBakingAvatar::invalidateComposite(LLTexLayerSet* layerset) {} +void LLBakingAvatar::updateMeshTextures() {} +void LLBakingAvatar::dirtyMesh() {} +void LLBakingAvatar::dirtyMesh(S32 priority) {} +void LLBakingAvatar::onGlobalColorChanged(const LLTexGlobalColor* global_color) {} + +bool LLBakingAvatar::isTextureDefined(LLAvatarAppearanceDefines::ETextureIndex type, U32 index) const +{ + return true; +} + + +//----------------------------------------------------------------------------- +// (LLERR) Non-implemented methods. +//----------------------------------------------------------------------------- + +LLVector3 LLBakingAvatar::getCharacterPosition() +{ + LL_ERRS("AppearanceUtility") << "Not implemented." << LL_ENDL; + return LLVector3::zero; +} + +LLQuaternion LLBakingAvatar::getCharacterRotation() +{ + LL_ERRS("AppearanceUtility") << "Not implemented." << LL_ENDL; + return LLQuaternion::DEFAULT; +} + +LLVector3 LLBakingAvatar::getCharacterVelocity() +{ + LL_ERRS("AppearanceUtility") << "Not implemented." << LL_ENDL; + return LLVector3::zero; +} + +LLVector3 LLBakingAvatar::getCharacterAngularVelocity() +{ + LL_ERRS("AppearanceUtility") << "Not implemented." << LL_ENDL; + return LLVector3::zero; +} + +const LLUUID& LLBakingAvatar::getID() const +{ + LL_ERRS("AppearanceUtility") << "Not implemented." << LL_ENDL; + return LLUUID::null; +} + +void LLBakingAvatar::addDebugText(const std::string& text) +{ + LL_ERRS("AppearanceUtility") << "Not implemented." << LL_ENDL; +} + +F32 LLBakingAvatar::getTimeDilation() +{ + LL_ERRS("AppearanceUtility") << "Not implemented." << LL_ENDL; + return 0.0f; +} + +void LLBakingAvatar::getGround(const LLVector3 &inPos, LLVector3 &outPos, LLVector3 &outNorm) +{ + LL_ERRS("AppearanceUtility") << "Not implemented." << LL_ENDL; +} + +F32 LLBakingAvatar::getPixelArea() const +{ + LL_ERRS("AppearanceUtility") << "Not implemented." << LL_ENDL; + return 0.0f; +} + +LLVector3d LLBakingAvatar::getPosGlobalFromAgent(const LLVector3 &position) +{ + LL_ERRS("AppearanceUtility") << "Not implemented." << LL_ENDL; + return LLVector3d::zero; +} + +LLVector3 LLBakingAvatar::getPosAgentFromGlobal(const LLVector3d &position) +{ + LL_ERRS("AppearanceUtility") << "Not implemented." << LL_ENDL; + return LLVector3::zero; +} + + + diff --git a/indra/llappearanceutility/llbakingavatar.h b/indra/llappearanceutility/llbakingavatar.h new file mode 100644 index 0000000000..8261dfc814 --- /dev/null +++ b/indra/llappearanceutility/llbakingavatar.h @@ -0,0 +1,139 @@ +/** + * @file llbakingavatar.h + * @brief Declaration of LLBakingAvatar class which is a derivation of LLAvatarAppearance + * + * $LicenseInfo:firstyear=2012&license=viewerlgpl$ + * Second Life Viewer Source Code + * Copyright (C) 2012, 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$ + */ + +#ifndef LL_LLBAKINGAVATAR_H +#define LL_LLBAKINGAVATAR_H + +#include "llavatarappearance.h" + +class LLBakingAvatar : public LLAvatarAppearance +{ + LOG_CLASS(LLBakingAvatar); + +/******************************************************************************** + ** ** + ** INITIALIZATION + **/ +public: + void* operator new(size_t size) + { + return ll_aligned_malloc_16(size); + } + + void operator delete(void* ptr) + { + ll_aligned_free_16(ptr); + } + + LLBakingAvatar(LLWearableData* wearable_data, S32 bakeTextureSize = 512); + virtual ~LLBakingAvatar(); + + static void initClass(); // initializes static members + +/** Initialization + ** ** + *******************************************************************************/ + +/******************************************************************************** + ** ** + ** INHERITED + **/ + + //-------------------------------------------------------------------- + // LLCharacter interface + //-------------------------------------------------------------------- +public: + LLVector3 getCharacterPosition() override; + LLQuaternion getCharacterRotation() override; + LLVector3 getCharacterVelocity() override; + LLVector3 getCharacterAngularVelocity() override; + + const LLUUID& getID() const override; + void addDebugText(const std::string& text) override; + F32 getTimeDilation() override; + void getGround(const LLVector3 &inPos, LLVector3 &outPos, LLVector3 &outNorm) override; + F32 getPixelArea() const override; + LLVector3d getPosGlobalFromAgent(const LLVector3 &position) override; + LLVector3 getPosAgentFromGlobal(const LLVector3d &position) override; + + //-------------------------------------------------------------------- + // LLAvatarAppearance interface + //-------------------------------------------------------------------- +public: + void applyMorphMask(const U8* tex_data, S32 width, S32 height, S32 num_components, + LLAvatarAppearanceDefines::EBakedTextureIndex index) override; + void invalidateComposite(LLTexLayerSet* layerset) override; + void updateMeshTextures() override; + void dirtyMesh() override; // Dirty the avatar mesh + void onGlobalColorChanged(const LLTexGlobalColor* global_color) override; + bool isTextureDefined(LLAvatarAppearanceDefines::ETextureIndex type, U32 index = 0) const override; + bool isUsingLocalAppearance() const override { return false; } + bool isEditingAppearance() const override { return false; } +private: + void dirtyMesh(S32 priority) override; // Dirty the avatar mesh, with priority + + // LLAvatarAppearance instance factories: +protected: + LLAvatarJoint* createAvatarJoint() override; + LLAvatarJoint* createAvatarJoint(S32 joint_num) override; + LLAvatarJointMesh* createAvatarJointMesh() override; + LLTexLayerSet* createTexLayerSet() override; + + +/** Inherited + ** ** + *******************************************************************************/ + +/******************************************************************************** + ** ** + ** STATE + **/ +public: + bool isSelf() const override { return true; } + bool isValid() const override { return true; } + +/** State + ** ** + *******************************************************************************/ + +/******************************************************************************** + ** ** + ** BAKING + **/ +public: + void bakedTextureDatasAsLLSD(LLSD& sd) const; + S32 bakeTextureSize() const { return mBakeTextureSize; } + +/** Baking + ** ** + *******************************************************************************/ + +private: + S32 mBakeTextureSize; +}; + +#endif /* LL_LLBAKINGAVATAR_H */ + diff --git a/indra/llappearanceutility/llbakingjoint.cpp b/indra/llappearanceutility/llbakingjoint.cpp new file mode 100644 index 0000000000..25edaa645f --- /dev/null +++ b/indra/llappearanceutility/llbakingjoint.cpp @@ -0,0 +1,54 @@ +/** + * @file llbakingjoint.cpp + * @brief Implementation of LLBakingJoint class + * + * $LicenseInfo:firstyear=2012&license=viewerlgpl$ + * Second Life Viewer Source Code + * Copyright (C) 2012, 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$ + */ + + +#include "linden_common.h" + +#include "llbakingjoint.h" + + +LLBakingJoint::LLBakingJoint() : + LLAvatarJoint() +{ +} + +LLBakingJoint::LLBakingJoint(S32 joint_num) : + LLAvatarJoint(joint_num) +{ +} + +// virtual +LLBakingJoint::~LLBakingJoint() +{ +} + +// virtual +U32 LLBakingJoint::render( F32 pixelArea, bool first_pass, bool is_dummy) +{ + LL_ERRS() << "LLBakingJoint::render() should never be called!" << LL_ENDL; + return 0; +} + diff --git a/indra/llappearanceutility/llbakingjoint.h b/indra/llappearanceutility/llbakingjoint.h new file mode 100644 index 0000000000..07e15a1d04 --- /dev/null +++ b/indra/llappearanceutility/llbakingjoint.h @@ -0,0 +1,44 @@ +/** + * @file llbakingjoint.h + * @brief Declaration of LLBakingJoint class + * + * $LicenseInfo:firstyear=2012&license=viewerlgpl$ + * Second Life Viewer Source Code + * Copyright (C) 2012, 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$ + */ + +#ifndef LL_LLBAKINGJOINT_H +#define LL_LLBAKINGJOINT_H + +#include "llavatarjoint.h" + +class LLBakingJoint : public virtual LLAvatarJoint +{ +public: + LLBakingJoint(); + LLBakingJoint(S32 joint_num); + virtual ~LLBakingJoint(); + + // LLViewerJoint interface + U32 render( F32 pixelArea, bool first_pass = true, bool is_dummy = false ) override; +}; + +#endif /* LL_LLBAKINGJOINT_H */ + diff --git a/indra/llappearanceutility/llbakingjointmesh.cpp b/indra/llappearanceutility/llbakingjointmesh.cpp new file mode 100644 index 0000000000..b8e3283df2 --- /dev/null +++ b/indra/llappearanceutility/llbakingjointmesh.cpp @@ -0,0 +1,43 @@ +/** + * @file llbakingjointmesh.cpp + * @brief Implementation of LLBakingJointMesh class + * + * $LicenseInfo:firstyear=2012&license=viewerlgpl$ + * Second Life Viewer Source Code + * Copyright (C) 2012, 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$ + */ + + +#include "linden_common.h" + +#include "llbakingjointmesh.h" + + +LLBakingJointMesh::LLBakingJointMesh() : + LLAvatarJointMesh() +{ +} + +// virtual +LLBakingJointMesh::~LLBakingJointMesh() +{ +} + + diff --git a/indra/llappearanceutility/llbakingjointmesh.h b/indra/llappearanceutility/llbakingjointmesh.h new file mode 100644 index 0000000000..a66bf3f61b --- /dev/null +++ b/indra/llappearanceutility/llbakingjointmesh.h @@ -0,0 +1,45 @@ +/** + * @file llbakingjoint.h + * @brief Implementation of LLBakingJointMesh class + * + * $LicenseInfo:firstyear=2012&license=viewerlgpl$ + * Second Life Viewer Source Code + * Copyright (C) 2012, 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$ + */ + +#ifndef LL_LLBAKINGJOINTMESH_H +#define LL_LLBAKINGJOINTMESH_H + +#include "llavatarjointmesh.h" +#include "llbakingjoint.h" + +class LLBakingJointMesh : public LLAvatarJointMesh, public LLBakingJoint +{ +public: + LLBakingJointMesh(); + LLBakingJointMesh(S32 joint_num); + virtual ~LLBakingJointMesh(); + + U32 render( F32 pixelArea, bool first_pass = true, bool is_dummy = false ) + { return LLBakingJoint::render(pixelArea,first_pass,is_dummy); } +}; + +#endif /* LL_LLBAKINGJOINTMESH_H */ + diff --git a/indra/llappearanceutility/llbakingprocess.cpp b/indra/llappearanceutility/llbakingprocess.cpp new file mode 100644 index 0000000000..85553b0fdb --- /dev/null +++ b/indra/llappearanceutility/llbakingprocess.cpp @@ -0,0 +1,47 @@ +/** + * @file llbakingprocess.cpp + * @brief Implementation of LLBakingProcess class. + * + * $LicenseInfo:firstyear=2012&license=viewerlgpl$ + * Second Life Viewer Source Code + * Copyright (C) 2012, 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$ + */ + +// linden includes +#include "linden_common.h" + +#include "llsd.h" +#include "llsdserialize.h" + +// project includes +#include "llappappearanceutility.h" +#include "llbakingprocess.h" + +// virtual +void LLBakingProcess::parseInput(std::istream& input) +{ + LLSDSerialize::fromXML( mInputData, input ); + if (mInputData.isUndefined()) + { + throw LLAppException(RV_UNABLE_TO_PARSE); + } +} + + diff --git a/indra/llappearanceutility/llbakingprocess.h b/indra/llappearanceutility/llbakingprocess.h new file mode 100644 index 0000000000..de38b7a36b --- /dev/null +++ b/indra/llappearanceutility/llbakingprocess.h @@ -0,0 +1,60 @@ +/** + * @file llbakingprocess.h + * @brief Declaration of LLBakingProcess interface. + * + * $LicenseInfo:firstyear=2012&license=viewerlgpl$ + * Second Life Viewer Source Code + * Copyright (C) 2012, 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$ + */ + +#ifndef LL_LLBAKINGPROCESS_H +#define LL_LLBAKINGPROCESS_H + +#include + +class LLAppAppearanceUtility; +class LLSD; + +// Simple wrapper for various process modes. +class LLBakingProcess +{ +private: + // Hide default constructor. + LLBakingProcess() {} +public: + LLBakingProcess(LLAppAppearanceUtility* app) : + mApp(app) {} + virtual ~LLBakingProcess() {} + + virtual void parseInput(std::istream& input); + //virtual std::string getProcessName() const = 0; + virtual void process(std::ostream& output) = 0; + + virtual void init() {} + virtual void cleanup() {} + +protected: + LLAppAppearanceUtility* mApp; + LLSD mInputData; +}; + + +#endif /* LL_LLBAKINGPROCESS_H */ + diff --git a/indra/llappearanceutility/llbakingshadermgr.cpp b/indra/llappearanceutility/llbakingshadermgr.cpp new file mode 100644 index 0000000000..07c747a8a0 --- /dev/null +++ b/indra/llappearanceutility/llbakingshadermgr.cpp @@ -0,0 +1,250 @@ + +/** + * @file LLBakingShaderMgr.cpp + * @brief Viewer shader manager implementation. + * + * $LicenseInfo:firstyear=2005&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$ + */ + + +#include "linden_common.h" + +#include "llbakingshadermgr.h" + +#include "lldir.h" +#include "llfile.h" +#include "llrender.h" +#include "llvertexbuffer.h" + +#if LL_DARWIN +#include "OpenGL/OpenGL.h" +#endif + +#ifdef LL_RELEASE_FOR_DOWNLOAD +#define UNIFORM_ERRS LL_WARNS_ONCE("Shader") +#else +#define UNIFORM_ERRS LL_ERRS("Shader") +#endif + +// Lots of STL stuff in here, using namespace std to keep things more readable +using std::vector; +using std::pair; +using std::make_pair; +using std::string; + +bool LLBakingShaderMgr::sInitialized = false; +bool LLBakingShaderMgr::sSkipReload = false; + +//utility shaders +LLGLSLShader gAlphaMaskProgram; + + +LLBakingShaderMgr::LLBakingShaderMgr() : + mVertexShaderLevel(SHADER_COUNT, 0), + mMaxAvatarShaderLevel(0) +{ +} + +LLBakingShaderMgr::~LLBakingShaderMgr() +{ + mVertexShaderLevel.clear(); + mShaderList.clear(); +} + +// static +LLBakingShaderMgr * LLBakingShaderMgr::instance() +{ + if(nullptr == sInstance) + { + sInstance = new LLBakingShaderMgr(); + } + + return static_cast(sInstance); +} + +void LLBakingShaderMgr::initAttribsAndUniforms(void) +{ + if (mReservedAttribs.empty()) + { + LLShaderMgr::initAttribsAndUniforms(); + } +} + + +//============================================================================ +// Set Levels + +S32 LLBakingShaderMgr::getVertexShaderLevel(S32 type) +{ + return mVertexShaderLevel[type]; +} + +//============================================================================ +// Shader Management + +void LLBakingShaderMgr::setShaders() +{ + //setShaders might be called redundantly by gSavedSettings, so return on reentrance + static bool reentrance = false; + + if (!sInitialized || reentrance || sSkipReload) + { + return; + } + + LLGLSLShader::sIndexedTextureChannels = llmax(gGLManager.mNumTextureImageUnits, 1); + + //NEVER use more than 16 texture channels (work around for prevalent driver bug) + LLGLSLShader::sIndexedTextureChannels = llmin(LLGLSLShader::sIndexedTextureChannels, 16); + + if (gGLManager.mGLSLVersionMajor < 1 || + (gGLManager.mGLSLVersionMajor == 1 && gGLManager.mGLSLVersionMinor <= 20)) + { //NEVER use indexed texture rendering when GLSL version is 1.20 or earlier + LLGLSLShader::sIndexedTextureChannels = 1; + } + + reentrance = true; + + initAttribsAndUniforms(); + + // Shaders + LL_INFOS("ShaderLoading") << "\n~~~~~~~~~~~~~~~~~~\n Loading Shaders:\n~~~~~~~~~~~~~~~~~~" << LL_ENDL; + LL_INFOS("ShaderLoading") << llformat("Using GLSL %d.%d", gGLManager.mGLSLVersionMajor, gGLManager.mGLSLVersionMinor) << LL_ENDL; + + for (S32 i = 0; i < SHADER_COUNT; i++) + { + mVertexShaderLevel[i] = 0; + } + mMaxAvatarShaderLevel = 0; + + LLVertexBuffer::unbind(); + bool loaded = false; + if (gGLManager.mGLSLVersionMajor > 1 || gGLManager.mGLSLVersionMinor >= 10) + { + S32 light_class = 2; + mVertexShaderLevel[SHADER_INTERFACE] = light_class; + + // loadBasicShaders + vector< pair > shaders; + if (gGLManager.mGLSLVersionMajor >= 2 || gGLManager.mGLSLVersionMinor >= 30) + { + shaders.push_back( make_pair( "objects/indexedTextureV.glsl", 1 ) ); + } + shaders.push_back( make_pair( "objects/nonindexedTextureV.glsl", 1 ) ); + shaders.push_back( make_pair( "deferred/textureUtilV.glsl", 1 ) ); + loaded = true; + for (U32 i = 0; i < shaders.size(); i++) + { + // Note usage of GL_VERTEX_SHADER_ARB + if (loadShaderFile(shaders[i].first, shaders[i].second, GL_VERTEX_SHADER_ARB) == 0) + { + LL_WARNS("Shader") << "Failed to load vertex shader " << shaders[i].first << LL_ENDL; + loaded = false; + break; + } + } + + shaders.clear(); + + // fragment shaders + shaders.push_back( make_pair( "deferred/globalF.glsl", 1 ) ); + + for (U32 i = 0; i < shaders.size(); i++) + { + // Note usage of GL_FRAGMENT_SHADER + if (loadShaderFile(shaders[i].first, shaders[i].second, GL_FRAGMENT_SHADER_ARB) == 0) + { + LL_WARNS("Shader") << "Failed to load fragment shader " << shaders[i].first << LL_ENDL; + loaded = false; + break; + } + } + + if (loaded) + { + loaded = loadShadersInterface(); + } + } + + if (!loaded) + { + //gPipeline.mVertexShadersEnabled = false; + //gPipeline.mVertexShadersLoaded = 0; + mVertexShaderLevel[SHADER_LIGHTING] = 0; + mVertexShaderLevel[SHADER_INTERFACE] = 0; + mVertexShaderLevel[SHADER_ENVIRONMENT] = 0; + mVertexShaderLevel[SHADER_WATER] = 0; + mVertexShaderLevel[SHADER_OBJECT] = 0; + mVertexShaderLevel[SHADER_EFFECT] = 0; + mVertexShaderLevel[SHADER_WINDLIGHT] = 0; + mVertexShaderLevel[SHADER_AVATAR] = 0; + } + + //gPipeline.createGLBuffers(); + + reentrance = false; +} + +void LLBakingShaderMgr::unloadShaders() +{ + gAlphaMaskProgram.unload(); + + mVertexShaderLevel[SHADER_INTERFACE] = 0; + + //gPipeline.mVertexShadersLoaded = 0; +} + +bool LLBakingShaderMgr::loadShadersInterface() +{ + gAlphaMaskProgram.mName = "Alpha Mask Shader"; + gAlphaMaskProgram.mShaderFiles.clear(); + gAlphaMaskProgram.mShaderFiles.push_back(make_pair("interface/alphamaskV.glsl", GL_VERTEX_SHADER_ARB)); + gAlphaMaskProgram.mShaderFiles.push_back(make_pair("interface/alphamaskF.glsl", GL_FRAGMENT_SHADER_ARB)); + gAlphaMaskProgram.mShaderLevel = mVertexShaderLevel[SHADER_INTERFACE]; + + if( !gAlphaMaskProgram.createShader() ) + { + mVertexShaderLevel[SHADER_INTERFACE] = 0; + return false; + } + + return true; +} + +std::string LLBakingShaderMgr::getShaderDirPrefix(void) +{ + return gDirUtilp->getExpandedFilename(LL_PATH_APP_SETTINGS, "shaders/class"); +} + +void LLBakingShaderMgr::updateShaderUniforms(LLGLSLShader * shader) +{ +} + +LLBakingShaderMgr::shader_iter LLBakingShaderMgr::beginShaders() const +{ + return mShaderList.begin(); +} + +LLBakingShaderMgr::shader_iter LLBakingShaderMgr::endShaders() const +{ + return mShaderList.end(); +} diff --git a/indra/llappearanceutility/llbakingshadermgr.h b/indra/llappearanceutility/llbakingshadermgr.h new file mode 100644 index 0000000000..60ab3f94e8 --- /dev/null +++ b/indra/llappearanceutility/llbakingshadermgr.h @@ -0,0 +1,137 @@ +/** + * @file llbakingshadermgr.h + * @brief Texture Baking Shader Manager + * + * $LicenseInfo:firstyear=2012&license=viewerlgpl$ + * Second Life Viewer Source Code + * Copyright (C) 2012, 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$ + */ + +#ifndef LL_BAKING_SHADER_MGR_H +#define LL_BAKING_SHADER_MGR_H + +#include "llshadermgr.h" + +class LLBakingShaderMgr: public LLShaderMgr +{ +public: + static bool sInitialized; + static bool sSkipReload; + + LLBakingShaderMgr(); + ~LLBakingShaderMgr(); + + // singleton pattern implementation + static LLBakingShaderMgr * instance(); + + void initAttribsAndUniforms(void) override; + void setShaders(); + void unloadShaders(); + S32 getVertexShaderLevel(S32 type); + bool loadShadersInterface(); + + std::vector mVertexShaderLevel; + S32 mMaxAvatarShaderLevel; + + enum EShaderClass + { + SHADER_LIGHTING, + SHADER_OBJECT, + SHADER_AVATAR, + SHADER_ENVIRONMENT, + SHADER_INTERFACE, + SHADER_EFFECT, + SHADER_WINDLIGHT, + SHADER_WATER, + SHADER_DEFERRED, + SHADER_TRANSFORM, + SHADER_COUNT + }; + + // simple model of forward iterator + // http://www.sgi.com/tech/stl/ForwardIterator.html + class shader_iter + { + private: + friend bool operator == (shader_iter const & a, shader_iter const & b); + friend bool operator != (shader_iter const & a, shader_iter const & b); + + typedef std::vector::const_iterator base_iter_t; + public: + shader_iter() + { + } + + shader_iter(base_iter_t iter) : mIter(iter) + { + } + + LLGLSLShader & operator * () const + { + return **mIter; + } + + LLGLSLShader * operator -> () const + { + return *mIter; + } + + shader_iter & operator++ () + { + ++mIter; + return *this; + } + + shader_iter operator++ (int) + { + return mIter++; + } + + private: + base_iter_t mIter; + }; + + shader_iter beginShaders() const; + shader_iter endShaders() const; + + std::string getShaderDirPrefix(void) override; + + void updateShaderUniforms(LLGLSLShader * shader) override; + +private: + + // the list of shaders we need to propagate parameters to. + std::vector mShaderList; + +}; //LLBakingShaderMgr + +inline bool operator == (LLBakingShaderMgr::shader_iter const & a, LLBakingShaderMgr::shader_iter const & b) +{ + return a.mIter == b.mIter; +} + +inline bool operator != (LLBakingShaderMgr::shader_iter const & a, LLBakingShaderMgr::shader_iter const & b) +{ + return a.mIter != b.mIter; +} + +extern LLVector4 gShinyOrigin; + +#endif // LL_BAKING_SHADER_MGR_H diff --git a/indra/llappearanceutility/llbakingtexlayer.cpp b/indra/llappearanceutility/llbakingtexlayer.cpp new file mode 100644 index 0000000000..3427331a96 --- /dev/null +++ b/indra/llappearanceutility/llbakingtexlayer.cpp @@ -0,0 +1,373 @@ +/** + * @file llbakingtexlayer.cpp + * @brief Implementation of LLBakingTexLayer class + * + * $LicenseInfo:firstyear=2012&license=viewerlgpl$ + * Second Life Viewer Source Code + * Copyright (C) 2012, 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$ + */ + +#include "linden_common.h" + +#include "indra_constants.h" +#include "llappappearanceutility.h" +#include "llavatarappearance.h" +#include "llbakingtexlayer.h" +#include "llbakingwearable.h" +#include "llfasttimer.h" +#include "lllocaltextureobject.h" +#include "llimagej2c.h" +#include "llwearabledata.h" +#include "llmd5.h" +#include "llbakingavatar.h" + +//#define DEBUG_TEXTURE_IDS 1 + +static const char* BAKE_HASH_VERSION = "3"; + +using namespace LLAvatarAppearanceDefines; + +LLBakingTexLayerSetBuffer::LLBakingTexLayerSetBuffer(LLTexLayerSet* const owner, S32 width, S32 height) + : LLTexLayerSetBuffer(owner), + LLBakingTexture( width, height, 4 ) +{} + +// virtual +LLBakingTexLayerSetBuffer::~LLBakingTexLayerSetBuffer() +{ + destroyGLTexture(); +} + +bool LLBakingTexLayerSetBuffer::render() +{ + bool result = false; + + preRenderTexLayerSet(); + result = renderTexLayerSet(nullptr); + postRenderTexLayerSet(result); + + return result; +} + +static LLFastTimer::DeclareTimer FTM_MID_RENDER("midRenderTexLayerSet"); +static LLFastTimer::DeclareTimer FTM_CREATE_J2C("Encode J2C image."); +void LLBakingTexLayerSetBuffer::midRenderTexLayerSet(bool success) +{ + LL_RECORD_BLOCK_TIME(FTM_MID_RENDER); + if (!mTexLayerSet->isVisible()) + { + // Should have used IMG_INVISIBLE during hash id generation? + LL_ERRS() << "Rendered texture for non-visible tex layer set!" << LL_ENDL; + } + + if (!success) + { + throw LLAppException(RV_UNABLE_TO_BAKE, " Rendering process failed."); + } + + // Get the COLOR information from our texture + LL_DEBUGS() << "glReadPixels..." << LL_ENDL; + LL_DEBUGS() << "getCompositeWidth()" << getCompositeWidth() << "getCompositeHeight()" << getCompositeHeight() << LL_ENDL; + + U8* baked_color_data = new U8[ getCompositeWidth() * getCompositeHeight() * 4 ]; + glReadPixels(getCompositeOriginX(), getCompositeOriginY(), + getCompositeWidth(), getCompositeHeight(), + GL_RGBA, GL_UNSIGNED_BYTE, baked_color_data ); + stop_glerror(); + + // Get the MASK information from our texture + LLGLSUIDefault gls_ui; + LL_DEBUGS() << "Creating baked mask image raw.." << LL_ENDL; + LLPointer baked_mask_image = new LLImageRaw(getCompositeWidth(), getCompositeHeight(), 1 ); + U8* baked_mask_data = baked_mask_image->getData(); + + LL_DEBUGS() << "Gathering Morph Mask Alpha..." << LL_ENDL; + mTexLayerSet->gatherMorphMaskAlpha(baked_mask_data, + getCompositeOriginX(), getCompositeOriginY(), + getCompositeWidth(), getCompositeHeight(), nullptr); + + // Create the baked image from our color and mask information + const S32 baked_image_components = 5; // red green blue [bump] clothing + LL_DEBUGS() << "Creating baked image raw.." << LL_ENDL; + LLPointer baked_image = new LLImageRaw( getCompositeWidth(), getCompositeHeight(), baked_image_components ); + U8* baked_image_data = baked_image->getData(); + S32 i = 0; + LL_DEBUGS() << "Running ugly loop..." << LL_ENDL; + for (S32 u=0; u < getCompositeWidth(); u++) + { + for (S32 v=0; v < getCompositeHeight(); v++) + { + baked_image_data[5*i + 0] = baked_color_data[4*i + 0]; + baked_image_data[5*i + 1] = baked_color_data[4*i + 1]; + baked_image_data[5*i + 2] = baked_color_data[4*i + 2]; + baked_image_data[5*i + 3] = baked_color_data[4*i + 3]; // alpha should be correct for eyelashes. + baked_image_data[5*i + 4] = baked_mask_data[i]; + i++; + } + } + + { + LL_RECORD_BLOCK_TIME(FTM_CREATE_J2C); + LL_DEBUGS() << "Creating J2C..." << LL_ENDL; + mCompressedImage = new LLImageJ2C; + const char* comment_text = LINDEN_J2C_COMMENT_PREFIX "RGBHM"; // writes into baked_color_data. 5 channels (rgb, heightfield/alpha, mask) + if (!mCompressedImage->encode(baked_image, comment_text)) + { + throw LLAppException(RV_UNABLE_TO_ENCODE); + } + } + + delete [] baked_color_data; +} + +LLBakingTexLayerSet::LLBakingTexLayerSet(LLAvatarAppearance* const appearance) : + LLTexLayerSet(appearance) +{ +} + +// virtual +LLBakingTexLayerSet::~LLBakingTexLayerSet() +{ +} + +// Ignored. +void LLBakingTexLayerSet::requestUpdate() +{ +} + +void LLBakingTexLayerSet::createComposite() +{ + if(!mComposite) + { + const LLBakingAvatar* avatar = dynamic_cast (mAvatarAppearance); + S32 width = avatar->bakeTextureSize(); + S32 height = avatar->bakeTextureSize(); + + LL_DEBUGS() << "Creating composite with width and height " << width << " " << height << LL_ENDL; + + mComposite = new LLBakingTexLayerSetBuffer(this, width, height); + } +} + +LLSD LLBakingTexLayerSet::computeTextureIDs() const +{ + const LLAvatarAppearanceDictionary::BakedEntry *baked_dict = + LLAvatarAppearance::getDictionary()->getBakedTexture(getBakedTexIndex()); +#ifdef DEBUG_TEXTURE_IDS + const std::string& slot_name = LLAvatarAppearance::getDictionary()->getTexture( + LLAvatarAppearance::getDictionary()->bakedToLocalTextureIndex(getBakedTexIndex()) )->mDefaultImageName; + const LLAvatarAppearanceDictionary::TextureEntry* entry = LLAvatarAppearance::getDictionary()->getTexture(baked_dict->mTextureIndex); + LL_DEBUGS() << "-----------------------------------------------------------------" << LL_ENDL; + LL_DEBUGS() << "BakedTexIndex = " << (S32) getBakedTexIndex() << " (" << slot_name << ") " + << "BakedEntry::mTextureIndex = " << (S32) baked_dict->mTextureIndex + << " (" << entry->mDefaultImageName + << ")" << LL_ENDL; + //LL_DEBUGS() << "LLAvatarAppearanceDictionary::getTEWearableType(" << baked_dict->mTextureIndex << ") = " << (S32) LLAvatarAppearanceDictionary::getTEWearableType(baked_dict->mTextureIndex) << LL_ENDL; + + texture_vec_t::const_iterator idx_iter = baked_dict->mLocalTextures.begin(); + texture_vec_t::const_iterator idx_end = baked_dict->mLocalTextures.end(); + std::ostringstream idx_str; + for (; idx_iter != idx_end; ++idx_iter) + { + entry = LLAvatarAppearance::getDictionary()->getTexture((*idx_iter)); + idx_str << (*idx_iter) << " (" << entry->mDefaultImageName + << ";" << LLWearableType::getInstance()->getTypeName( entry->mWearableType ) + << "), "; + } + LL_DEBUGS() << "BakedEntry::mLocalTextures: " << idx_str.str() << LL_ENDL; + wearables_vec_t::const_iterator type_iter = baked_dict->mWearables.begin(); + wearables_vec_t::const_iterator type_end = baked_dict->mWearables.end(); + std::ostringstream type_str; + for (; type_iter != type_end; ++type_iter) + { + type_str << (S32) (*type_iter) << " (" + << LLWearableType::getInstance()->getTypeName( (*type_iter) ) + << "), "; + } + LL_DEBUGS() << "BakedEntry::mWearables: " << type_str.str() << LL_ENDL; + //LL_DEBUGS() << "BakedEntry::mWearablesHashID: " << baked_dict->mWearablesHashID << LL_ENDL; +#endif + + LLMD5 hash; + std::set texture_ids; + + bool is_visible = true; + bool hash_computed = computeLayerListTextureIDs(hash, texture_ids, mLayerList, is_visible); + if (is_visible) + { + hash_computed |= computeLayerListTextureIDs(hash, texture_ids, mMaskLayerList, is_visible); + } + + LLUUID hash_id; + if (!is_visible) + { + hash_id = IMG_INVISIBLE; + texture_ids.clear(); + } + else if (hash_computed) + { + if ((getBakedTexIndex() == EBakedTextureIndex::BAKED_LEFT_ARM) || + (getBakedTexIndex() == EBakedTextureIndex::BAKED_LEFT_LEG) || + (getBakedTexIndex() == EBakedTextureIndex::BAKED_AUX1) || + (getBakedTexIndex() == EBakedTextureIndex::BAKED_AUX2) || + (getBakedTexIndex() == EBakedTextureIndex::BAKED_AUX3)) + { + hash.update(BAKE_HASH_VERSION); + } + + hash.update((const unsigned char*)baked_dict->mWearablesHashID.mData, UUID_BYTES); + hash.finalize(); + hash.raw_digest(hash_id.mData); + } + + if (hash_id.isNull()) + { + hash_id = IMG_DEFAULT_AVATAR; + } + + if (getBakedTexIndex() == EBakedTextureIndex::BAKED_SKIRT) + { + if (getAvatarAppearance()->getWearableData()->getWearableCount(LLWearableType::WT_SKIRT) == 0) + { + hash_id = IMG_DEFAULT_AVATAR; + texture_ids.clear(); + } + } + LLSD sd; + sd["hash_id"] = hash_id; + sd["texture_ids"] = LLSD::emptyArray(); + std::set::iterator id_iter = texture_ids.begin(); + std::set::iterator id_end = texture_ids.end(); + for (; id_iter != id_end; ++id_iter) + { + sd["texture_ids"].append( *id_iter ); + } + return sd; +} + +bool LLBakingTexLayerSet::computeLayerListTextureIDs(LLMD5& hash, + std::set& texture_ids, + const layer_list_t& layer_list, + bool& is_visible) const +{ + is_visible = true; + bool hash_computed = false; + layer_list_t::const_iterator iter = layer_list.begin(); + layer_list_t::const_iterator end = layer_list.end(); + for (; iter != end; ++iter) + { + const LLTexLayerInterface* layer_template = *iter; + LLWearableType::EType wearable_type = layer_template->getWearableType(); + ETextureIndex te = layer_template->getLocalTextureIndex(); + U32 num_wearables = getAvatarAppearance()->getWearableData()->getWearableCount(wearable_type); +#ifdef DEBUG_TEXTURE_IDS + const LLAvatarAppearanceDictionary::TextureEntry* entry = LLAvatarAppearance::getDictionary()->getTexture(te); + if (entry) + { + LL_DEBUGS() << "LLTexLayerInterface(" << layer_template->getName() << ") type = " + << (S32) wearable_type << " (" + << LLWearableType::getInstance()->getTypeName( wearable_type ) << ") te = " + << (S32) te << " ("<< entry->mDefaultImageName + << ";" << LLWearableType::getInstance()->getTypeName( entry->mWearableType ) + << ") wearable_count = " << num_wearables << LL_ENDL; + } + else + { + LL_DEBUGS() << "LLTexLayerInterface(" << layer_template->getName() << ") type = " + << (S32) wearable_type << " (" + << LLWearableType::getInstance()->getTypeName( wearable_type ) + << ") wearable_count = " << num_wearables << LL_ENDL; + } +#endif + if (LLWearableType::WT_INVALID == wearable_type) + { + //LL_DEBUGS() << "Skipping invalid wearable type" << LL_ENDL; + continue; + } + + for (U32 i = 0; i < num_wearables; i++) + { + LLBakingWearable* wearable = dynamic_cast ( + getAvatarAppearance()->getWearableData()->getWearable(wearable_type, i)); + if (!wearable) + { + //LL_DEBUGS() << "Skipping wearable" << LL_ENDL; + continue; + } +#ifdef DEBUG_TEXTURE_IDS + S32 num_ltos = wearable->getLocalTextureListSeq().size(); + LL_DEBUGS() << "LLWearable (" << wearable->getName() << ") type = " + << (S32) wearable->getAssetType() << " (" + << LLAssetType::lookup(wearable->getAssetType()) + << ") num_ltos = " << num_ltos << LL_ENDL; +#endif + LLLocalTextureObject *lto = wearable->getLocalTextureObject(te); + if (lto) + { +#ifdef DEBUG_TEXTURE_IDS + LL_DEBUGS() << "LocalTextureObject id = " << lto->getID() << " num texlayers = " << lto->getNumTexLayers() << LL_ENDL; +#endif + // Hash texture id + LLUUID texture_id = lto->getID(); + if (IMG_INVISIBLE == texture_id) + { + is_visible = false; + } + hash.update((const unsigned char*)texture_id.mData, UUID_BYTES); + hash_computed = true; + // Add texture to list. + texture_ids.insert(texture_id); + } +#ifdef DEBUG_TEXTURE_IDS + else + { + LL_DEBUGS() << "LLWearable -- no LocalTextureObject for te " << (S32) te << LL_ENDL; + } + + + for(S32 i = 0; i < (S32)TEX_NUM_INDICES; i++) + { + lto = wearable->getLocalTextureObject(i); + if (lto) + { + LL_DEBUGS() << "LTO (" << i << ") id = " << lto->getID() << " num texlayers = " << lto->getNumTexLayers() << LL_ENDL; + } + } +#endif + + for( LLVisualParam* param = getAvatarAppearance()->getFirstVisualParam(); + param; param = getAvatarAppearance()->getNextVisualParam() ) + { + // cross-wearable parameters are not authoritative, as they are driven by a different wearable. + if( (((LLViewerVisualParam*)param)->getWearableType() == wearable_type) && + (!((LLViewerVisualParam*)param)->getCrossWearable()) ) + { + std::ostringstream ostr; + F32 weight = wearable->getVisualParamWeight(param->getID()); + ostr << param->getID() << " " << weight; + hash.update(ostr.str()); + hash_computed = true; + } + } + } + } + return hash_computed; +} + diff --git a/indra/llappearanceutility/llbakingtexlayer.h b/indra/llappearanceutility/llbakingtexlayer.h new file mode 100644 index 0000000000..dc82b27ce2 --- /dev/null +++ b/indra/llappearanceutility/llbakingtexlayer.h @@ -0,0 +1,77 @@ +/** + * @file llbakingtexlayer.h + * @brief Declaration of LLBakingTexLayerSet. + * + * $LicenseInfo:firstyear=2012&license=viewerlgpl$ + * Second Life Viewer Source Code + * Copyright (C) 2012, 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$ + */ + +#ifndef LL_LLBAKINGTEXLAYER_H +#define LL_LLBAKINGTEXLAYER_H + +#include "llbakingtexture.h" +#include "llimagej2c.h" +#include "llpointer.h" +#include "lltexlayer.h" + +class LLMD5; + +class LLBakingTexLayerSetBuffer : public LLTexLayerSetBuffer, public LLBakingTexture +{ + LOG_CLASS(LLBakingTexLayerSetBuffer); +public: + LLBakingTexLayerSetBuffer(LLTexLayerSet* const owner, S32 width, S32 height); + virtual ~LLBakingTexLayerSetBuffer(); + + LLImageJ2C* getCompressedImage() { return mCompressedImage; } + + bool render(); + bool bindDebugImage(const S32 stage = 0) override { return false; } + bool isActiveFetching() override { return false; }; + +private: + S32 getCompositeOriginX() const override { return 0; } + S32 getCompositeOriginY() const override { return 0; } + S32 getCompositeWidth() const override { return getFullWidth(); } + S32 getCompositeHeight() const override { return getFullHeight(); } + void midRenderTexLayerSet(bool success) override; + + LLPointer mCompressedImage; +}; + +class LLBakingTexLayerSet : public LLTexLayerSet +{ +public: + LLBakingTexLayerSet(LLAvatarAppearance* const appearance); + virtual ~LLBakingTexLayerSet(); + + LLSD computeTextureIDs() const; + bool computeLayerListTextureIDs(LLMD5& hash, + std::set& texture_ids, + const layer_list_t& layer_list, + bool& is_visible) const; + + void requestUpdate() override; + void createComposite() override; +}; + +#endif /* LL_LLBAKINGTEXLAYER_H */ + diff --git a/indra/llappearanceutility/llbakingtexture.cpp b/indra/llappearanceutility/llbakingtexture.cpp new file mode 100644 index 0000000000..ae83081aef --- /dev/null +++ b/indra/llappearanceutility/llbakingtexture.cpp @@ -0,0 +1,81 @@ +/** + * @file llbakingtexture.cpp + * @brief Implementation of LLBakingTexture class. + * + * $LicenseInfo:firstyear=2012&license=viewerlgpl$ + * Second Life Viewer Source Code + * Copyright (C) 2012, 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$ + */ + +// linden includes +#include "linden_common.h" + +// project includes +#include "llbakingtexture.h" +#include "llgltexture.h" +#include "llimage.h" + +static const bool USE_MIP_MAPS = true; + +LLBakingTexture::LLBakingTexture(const LLUUID& id, const LLImageRaw* raw) + : LLGLTexture(raw, USE_MIP_MAPS), + mID(id) +{ +} + +LLBakingTexture::LLBakingTexture(bool usemipmaps) + : LLGLTexture(usemipmaps), + mID(LLUUID::null) +{ +} + +LLBakingTexture::LLBakingTexture(const U32 width, const U32 height, const U8 components, bool usemipmaps) + : LLGLTexture(width, height, components, USE_MIP_MAPS), + mID(LLUUID::null) +{ +} + +// virtual +LLBakingTexture::~LLBakingTexture() +{ +} + +void LLBakingTexture::setKnownDrawSize(S32 width, S32 height) +{ + //nothing here. + LL_ERRS() << "Not implemented." << LL_ENDL; +} + +bool LLBakingTexture::bindDefaultImage(S32 stage) +{ + LL_ERRS() << "Not implemented." << LL_ENDL; + return false; +} + +void LLBakingTexture::forceImmediateUpdate() +{ + LL_ERRS() << "Not implemented." << LL_ENDL; +} + +void LLBakingTexture::updateBindStatsForTester() +{ + LL_ERRS() << "Not implemented." << LL_ENDL; +} + diff --git a/indra/llappearanceutility/llbakingtexture.h b/indra/llappearanceutility/llbakingtexture.h new file mode 100644 index 0000000000..50b4193b2e --- /dev/null +++ b/indra/llappearanceutility/llbakingtexture.h @@ -0,0 +1,69 @@ +/** + * @file llbakingtexture.h + * @brief Declaration of LLBakingTexture class. + * + * $LicenseInfo:firstyear=2012&license=viewerlgpl$ + * Second Life Viewer Source Code + * Copyright (C) 2012, 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$ + */ + +#ifndef LL_LLBAKINGTEXTURE_H +#define LL_LLBAKINGTEXTURE_H + +#include "llgltexture.h" +#include "lluuid.h" + +class LLImageRaw; + +class LLBakingTexture : public LLGLTexture +{ +public: + enum + { + LOCAL_TEXTURE, + BAKING_TEXTURE, + INVALID_TEXTURE_TYPE + }; + LLBakingTexture(const LLUUID& id, const LLImageRaw* raw); + LLBakingTexture(bool usemipmaps); + LLBakingTexture(const U32 width, const U32 height, const U8 components, bool usemipmaps = true); + const LLUUID& getID() const override { return mID; } + S8 getType() const override { return BAKING_TEXTURE; } + + // Not implemented. + void setKnownDrawSize(S32 width, S32 height) override; + bool bindDefaultImage(const S32 stage = 0) override ; + void forceImmediateUpdate() override; + void updateBindStatsForTester() override ; + bool bindDebugImage(const S32 stage = 0) override { return false; } + bool isActiveFetching() override { return false; } + +protected: + virtual ~LLBakingTexture(); + LOG_CLASS(LLBakingTexture); +private: + // Hide default constructor. + LLBakingTexture() {} + + LLUUID mID; +}; + +#endif /* LL_LLBAKINGTEXTURE_H */ + diff --git a/indra/llappearanceutility/llbakingwearable.cpp b/indra/llappearanceutility/llbakingwearable.cpp new file mode 100644 index 0000000000..0e5251aba1 --- /dev/null +++ b/indra/llappearanceutility/llbakingwearable.cpp @@ -0,0 +1,77 @@ +/** + * @file llbakingwearable.cpp + * @brief Implementation of LLBakingWearable class + * + * $LicenseInfo:firstyear=2012&license=viewerlgpl$ + * Second Life Viewer Source Code + * Copyright (C) 2012, 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$ + */ + + +#include "linden_common.h" + +#include "llavatarappearance.h" +#include "llavatarappearancedefines.h" +#include "llbakingwearable.h" +#include "llmd5.h" +#include "indra_constants.h" + +using namespace LLAvatarAppearanceDefines; + +LLBakingWearable::LLBakingWearable() +{ +} + +// virtual +LLBakingWearable::~LLBakingWearable() +{ +} + +// virtual +void LLBakingWearable::setUpdated() const +{ +} + +// virtual +void LLBakingWearable::addToBakedTextureHash(LLMD5& hash) const +{ +} + +// virtual +LLUUID LLBakingWearable::getDefaultTextureImageID(ETextureIndex index) const +{ + const LLAvatarAppearanceDictionary::TextureEntry *texture_dict = LLAvatarAppearance::getDictionary()->getTexture(index); + const std::string &default_image_name = texture_dict->mDefaultImageName; + if (default_image_name == "") + { + return IMG_DEFAULT_AVATAR; + } + else + { + //return LLUUID(gSavedSettings.getString(default_image_name)); + // *TODO: Fix this. + return LLUUID::null; + } +} + +void LLBakingWearable::asLLSD(LLSD& sd) const +{ + // stub implementation. TODO: fill in. +} diff --git a/indra/llappearanceutility/llbakingwearable.h b/indra/llappearanceutility/llbakingwearable.h new file mode 100644 index 0000000000..bb96dc3709 --- /dev/null +++ b/indra/llappearanceutility/llbakingwearable.h @@ -0,0 +1,48 @@ +/** + * @file llbakingwearable.h + * @brief Declaration of LLBakingWearable class + * + * $LicenseInfo:firstyear=2012&license=viewerlgpl$ + * Second Life Viewer Source Code + * Copyright (C) 2012, 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$ + */ + +#ifndef LL_LLBAKINGWEARABLE_H +#define LL_LLBAKINGWEARABLE_H + +#include "llwearable.h" +#include "llmd5.h" + +class LLBakingWearable : public LLWearable +{ +public: + LLBakingWearable(); + virtual ~LLBakingWearable(); + + virtual void setUpdated() const; + virtual void addToBakedTextureHash(LLMD5& hash) const; + virtual LLUUID getDefaultTextureImageID(LLAvatarAppearanceDefines::ETextureIndex index) const; + + void asLLSD(LLSD& sd) const; + +}; + +#endif /* LL_LLBAKINGWEARABLE_H */ + diff --git a/indra/llappearanceutility/llbakingwearablesdata.cpp b/indra/llappearanceutility/llbakingwearablesdata.cpp new file mode 100644 index 0000000000..18edb86348 --- /dev/null +++ b/indra/llappearanceutility/llbakingwearablesdata.cpp @@ -0,0 +1,131 @@ +/** + * @file llbakingwearablesdata.cpp + * @brief Implementation of LLBakingWearablesData class + * + * $LicenseInfo:firstyear=2012&license=viewerlgpl$ + * Second Life Viewer Source Code + * Copyright (C) 2012, 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$ + */ + + +#include "linden_common.h" + +#include "llbakingwearablesdata.h" +#include "llbakingwearable.h" + +using namespace LLAvatarAppearanceDefines; + +LLBakingWearablesData::LLBakingWearablesData() +{ +} + +// virtual +LLBakingWearablesData::~LLBakingWearablesData() +{ + std::for_each(mWearables.begin(), mWearables.end(), DeletePointer()); + mWearables.clear(); +} + +void LLBakingWearablesData::setWearableOutfit(LLSD& sd) +{ + LLSD::array_const_iterator type_iter = sd.beginArray(); + LLSD::array_const_iterator type_end = sd.endArray(); + S32 wearable_index = 0; + for (; type_iter != type_end && wearable_index < (S32) LLWearableType::WT_COUNT; ++type_iter, ++wearable_index) + { + LLSD::array_const_iterator wearable_iter = type_iter->beginArray(); + LLSD::array_const_iterator wearable_end = type_iter->endArray(); + for (; wearable_iter != wearable_end; ++wearable_iter) + { + if ( wearable_iter->isDefined() ) + { + LLBakingWearable* wearable = new LLBakingWearable(); + std::istringstream istr( (*wearable_iter)["contents"].asString() ); + wearable->importStream(istr, mAvatarAppearance); + + // Sanity check the wearable type. + if (wearable->getType() != wearable_index) + { + LL_WARNS() << "Unexpected wearable type! Expected " << wearable_index + << ", processed " << (S32) wearable->getType() << LL_ENDL; + // *TODO: Throw exception? + delete wearable; + continue; + } + mWearables.push_back(wearable); + + const LLWearableType::EType type = wearable->getType(); + if (wearable->getAssetType() == LLAssetType::AT_BODYPART) + { + // exactly one wearable per body part + setWearable(type,0,wearable); + } + else + { + pushWearable(type,wearable); + } + } + } + } + + wearable_list_t::const_iterator wearable_iter = mWearables.begin(); + wearable_list_t::const_iterator wearable_end = mWearables.end(); + for (; wearable_iter != wearable_end; ++wearable_iter) + { + LLBakingWearable* wearable = (*wearable_iter); + const bool removed = false; + wearableUpdated(wearable, removed); + } + + for(wearable_index = 0; wearable_index < (S32) LLWearableType::WT_COUNT; wearable_index++) + { + LLWearable* top_wearable = getTopWearable((LLWearableType::EType)wearable_index); + if (top_wearable) + { + top_wearable->writeToAvatar(mAvatarAppearance); + } + } +} + + +void LLBakingWearablesData::asLLSD(LLSD& sd) const +{ + sd = LLSD::emptyMap(); + wearableentry_map_t::const_iterator type_iter = mWearableDatas.begin(); + wearableentry_map_t::const_iterator type_end = mWearableDatas.end(); + for (; type_iter != type_end; ++type_iter) + { + LLSD wearable_type_sd = LLSD::emptyArray(); + LLWearableType::EType wearable_type = type_iter->first; + wearableentry_vec_t::const_iterator wearable_iter = type_iter->second.begin(); + wearableentry_vec_t::const_iterator wearable_end = type_iter->second.end(); + for (; wearable_iter != wearable_end; ++wearable_iter) + { + const LLBakingWearable* wearable = dynamic_cast(*wearable_iter); + LLSD wearable_sd; + wearable->asLLSD(wearable_sd); + wearable_type_sd.append(wearable_sd); + } + sd[LLWearableType::getInstance()->getTypeName(wearable_type)] = wearable_type_sd; + } +} + + + diff --git a/indra/llappearanceutility/llbakingwearablesdata.h b/indra/llappearanceutility/llbakingwearablesdata.h new file mode 100644 index 0000000000..1db2ca4bc1 --- /dev/null +++ b/indra/llappearanceutility/llbakingwearablesdata.h @@ -0,0 +1,55 @@ +/** + * @file llbakingwearablesdata.h + * @brief Declaration of LLBakingWearablesData class + * + * $LicenseInfo:firstyear=2012&license=viewerlgpl$ + * Second Life Viewer Source Code + * Copyright (C) 2012, 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$ + */ + +#ifndef LL_LLBAKINGWEARABLESDATA_H +#define LL_LLBAKINGWEARABLESDATA_H + +#include "llwearabledata.h" + +class LLBakingWearable; + +class LLBakingWearablesData : public LLWearableData +{ +public: + LLBakingWearablesData(); + virtual ~LLBakingWearablesData(); + + void setWearableOutfit(LLSD& sd); + + //-------------------------------------------------------------------- + // I/O methods + //-------------------------------------------------------------------- +public: + void asLLSD(LLSD& sd) const; + +private: + typedef std::vector wearable_list_t; + wearable_list_t mWearables; + +}; + +#endif /* LL_LLBAKINGWEARABLESDATA_H */ + diff --git a/indra/llappearanceutility/llbakingwindow.cpp b/indra/llappearanceutility/llbakingwindow.cpp new file mode 100644 index 0000000000..8799105932 --- /dev/null +++ b/indra/llappearanceutility/llbakingwindow.cpp @@ -0,0 +1,94 @@ +/** + * @file llbakingwindow.cpp + * @brief Implementation of LLBakingWindow class. + * + * $LicenseInfo:firstyear=2012&license=viewerlgpl$ + * Second Life Viewer Source Code + * Copyright (C) 2012, 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$ + */ + +// linden includes +#include "linden_common.h" + +// project includes +#include "llappappearanceutility.h" +#include "llbakingshadermgr.h" +#include "llbakingwindow.h" +#include "llgl.h" +#include "llgltexture.h" +#include "llvertexbuffer.h" + +LLBakingWindow::LLBakingWindow(S32 width, S32 height) +{ + const S32 WINDOW_ORIGIN_X = 0; + const S32 WINDOW_ORIGIN_Y = 0; + const U32 FLAGS = 32; // *TODO: Why did mapserver use this? mFlags looks unused. + const bool NO_FULLSCREEN = false; + const bool NO_CLEAR_BG = false; + const bool NO_DISABLE_VSYNC = false; + const bool NO_IGNORE_PIXEL_DEPTH = false; + const bool USE_GL = true; + mWindow = LLWindowManager::createWindow(this, + "appearanceutility", "Appearance Utility", + WINDOW_ORIGIN_X, WINDOW_ORIGIN_Y, + width, height, + FLAGS, + NO_FULLSCREEN, + NO_CLEAR_BG, + NO_DISABLE_VSYNC, //gSavedSettings.getBOOL("DisableVerticalSync"), + USE_GL, // not headless + NO_IGNORE_PIXEL_DEPTH); //gIgnorePixelDepth = false + + if (nullptr == mWindow) + { + throw LLAppException(RV_UNABLE_TO_INIT_GL); + } + + LLVertexBuffer::initClass(mWindow); + + gGL.init(true); + + if (!LLBakingShaderMgr::sInitialized) + { //immediately initialize shaders + LLBakingShaderMgr::sInitialized = true; + LLBakingShaderMgr::instance()->setShaders(); + } + + LLImageGL::initClass(mWindow, LLGLTexture::MAX_GL_IMAGE_CATEGORY, true, false); + + // mWindow->show(); + // mWindow->bringToFront(); + // mWindow->focusClient(); + // mWindow->gatherInput(); +} + +LLBakingWindow::~LLBakingWindow() +{ + if (mWindow) + { + LLWindowManager::destroyWindow(mWindow); + } + mWindow = nullptr; +} + +void LLBakingWindow::swapBuffers() +{ + mWindow->swapBuffers(); +} diff --git a/indra/llappearanceutility/llbakingwindow.h b/indra/llappearanceutility/llbakingwindow.h new file mode 100644 index 0000000000..a6bf1d8714 --- /dev/null +++ b/indra/llappearanceutility/llbakingwindow.h @@ -0,0 +1,45 @@ +/** + * @file llbakingwindow.h + * @brief Declaration of LLBakingWindow class. + * + * $LicenseInfo:firstyear=2012&license=viewerlgpl$ + * Second Life Viewer Source Code + * Copyright (C) 2012, 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$ + */ + +#ifndef LL_LLBAKINGWINDOW_H +#define LL_LLBAKINGWINDOW_H + +#include "llwindow.h" +#include "llwindowcallbacks.h" + +class LLBakingWindow : public LLWindowCallbacks +{ +public: + LLBakingWindow(S32 width, S32 height); + ~LLBakingWindow(); + + void swapBuffers(); +private: + LLWindow* mWindow; +}; + +#endif /* LL_LLBAKINGWINDOW_H */ + diff --git a/indra/llappearanceutility/llprocessparams.cpp b/indra/llappearanceutility/llprocessparams.cpp new file mode 100755 index 0000000000..ad1b44e794 --- /dev/null +++ b/indra/llappearanceutility/llprocessparams.cpp @@ -0,0 +1,281 @@ +/** + * @file llprocessparams.cpp + * @brief Implementation of LLProcessParams class. + * + * $LicenseInfo:firstyear=2012&license=viewerlgpl$ + * Second Life Viewer Source Code + * Copyright (C) 2012, 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$ + */ + +// linden includes +#include "linden_common.h" + +#include "llsd.h" +#include "llsdserialize.h" +#include "llsdutil.h" +#include "llsdutil_math.h" +#include "llstl.h" +#include "llmath.h" +#include "llquantize.h" + +// appearance includes +#include "lltexturemanagerbridge.h" +#include "llwearabletype.h" +#include "llavatarappearancedefines.h" + +// project includes +#include "llappappearanceutility.h" +#include "llbakingavatar.h" +#include "llbakingtexlayer.h" +#include "llbakingwearable.h" +#include "llbakingwearablesdata.h" +#include "llprocessparams.h" + +#define APPEARANCE_PARAM_VERSION 11000 + +const U32 FULL_RIG_JOINT_COUNT = 20; + +using namespace LLAvatarAppearanceDefines; + +// Create a bridge to the viewer texture manager. +class LLNullTextureManagerBridge : public LLTextureManagerBridge +{ +public: + LLPointer getLocalTexture(bool usemipmaps = true, bool generate_gl_tex = true) override + { + return nullptr; + } + + LLPointer getLocalTexture(const U32 width, const U32 height, const U8 components, bool usemipmaps, bool generate_gl_tex = true) override + { + return nullptr; + } + + LLGLTexture* getFetchedTexture(const LLUUID &image_id) override + { + return nullptr; + } +}; + +LLSD dump_joint_offsets_for_avatar(LLBakingAvatar& avatar) +{ + LLSD joints = LLSD::emptyArray(); + + for (U32 joint_index = 0;; joint_index++) + { + LLJoint* pJoint = avatar.getCharacterJoint(joint_index); + if (!pJoint) + { + break; + } + LLVector3 pos; + LLUUID mesh_id; + if (pJoint->hasAttachmentPosOverride(pos, mesh_id)) + { + LLSD info; + info["name"] = pJoint->getName(); + info["pos"] = ll_sd_from_vector3(pos); + info["mesh_id"] = mesh_id; + joints.append(info); + } + } + + return joints; +} + +void LLProcessParams::process(std::ostream& output) +{ + if (!mInputData.has("wearables")) throw LLAppException(RV_UNABLE_TO_PARSE, " Missing wearables"); + + // Create a null-texture manager bridge. + gTextureManagerBridgep = new LLNullTextureManagerBridge(); + + // Construct the avatar. + LLBakingWearablesData wearable_data; + LLBakingAvatar avatar(&wearable_data, mApp->bakeTextureSize()); + avatar.initInstance(); + wearable_data.setAvatarAppearance(&avatar); + + //Process the params data for joint information + //bool bodySizeSet = processInputDataForJointInfo( avatar ); + + // Extract and parse wearables. + wearable_data.setWearableOutfit(mInputData["wearables"]); + + // Set appearance parameter to flag server-side baking. + avatar.setVisualParamWeight(APPEARANCE_PARAM_VERSION, 1.0f); + + avatar.setSex( (avatar.getVisualParamWeight( "male" ) > 0.5f) ? SEX_MALE : SEX_FEMALE ); + + avatar.updateVisualParams(); + + // Extract texture ids, texture hashes, and avatar scale. + LLSD texture_ids = LLSD::emptyMap(); + + //Process the params data for joint information + bool bodySizeSet = processInputDataForJointInfo( avatar ); + + //if we didn't compute a body size from a mesh attachment that included + //joint offsets we need to do it now + if (!bodySizeSet ) + { + avatar.computeBodySize(); + } + + for (U32 baked_index = 0; baked_index < BAKED_NUM_INDICES; baked_index++) + { + EBakedTextureIndex bake_type = (EBakedTextureIndex) baked_index; + LLBakingTexLayerSet* layer_set = dynamic_cast(avatar.getAvatarLayerSet(bake_type)); + const std::string& slot_name = LLAvatarAppearance::getDictionary()->getTexture( + LLAvatarAppearance::getDictionary()->bakedToLocalTextureIndex(bake_type) )->mDefaultImageName; + texture_ids[slot_name] = layer_set->computeTextureIDs(); + } + + // Extract visual params + U32 count = 0; + LLSD params = LLSD::emptyMap(); + LLSD debug_params = LLSD::emptyMap(); + for (LLViewerVisualParam* param = (LLViewerVisualParam*)avatar.getFirstVisualParam(); + param; + param = (LLViewerVisualParam*)avatar.getNextVisualParam()) + { + if (param->getGroup() == VISUAL_PARAM_GROUP_TWEAKABLE || + param->getGroup() == VISUAL_PARAM_GROUP_TRANSMIT_NOT_TWEAKABLE) // do not transmit params of group VISUAL_PARAM_GROUP_TWEAKABLE_NO_TRANSMIT + { + const F32 param_value = param->getWeight(); + const U8 new_weight = F32_to_U8(param_value, param->getMinWeight(), param->getMaxWeight()); + LLSD body; + body["name"] = param->getName(); + body["value"] = param_value; + body["weight"] = new_weight; + debug_params[LLSD(param->getID()).asString()] = body; + params.append(new_weight); + count++; + } + } + + // Output + LLSD result; + result["success"] = true; + result["params"] = params; + result["debug_params"] = debug_params; + result["slot_textures"] = texture_ids; + result["avatar_scale"] = ll_sd_from_vector3(avatar.mBodySize + avatar.mAvatarOffset); + result["dump_joint_offsets"] = dump_joint_offsets_for_avatar(avatar); + output << LLSDOStreamer(result); +} + +bool LLProcessParams::processInputDataForJointInfo( LLBakingAvatar& avatar ) +{ + bool returnResult = false; + + if ( !mInputData.has("skindata") || mInputData["skindata"].isUndefined() ) + { + LL_DEBUGS() << "Skipping missing skindata" << LL_ENDL; + return returnResult; + } + + const LLSD& skindata = mInputData["skindata"]; + + //float pelvisOffset = 0.0f; + std::vector jointNames; + std::vector jointOffsets; + + LLSD::map_const_iterator skinIter = skindata.beginMap(); + LLSD::map_const_iterator skinIterEnd = skindata.endMap(); + + for ( ; skinIter!=skinIterEnd; ++skinIter ) + { + const LLSD& skin = skinIter->second; + const char *uuid_str = skinIter->first.c_str(); + const LLUUID mesh_id(uuid_str); + + if ( !skin.has("joint_names") || !skin.has("joint_offset") ) + { + throw LLAppException(RV_INVALID_SKIN_BLOCK); + } + + // Build list of joints + { + LLSD::array_const_iterator iter(skin["joint_names"].beginArray()); + LLSD::array_const_iterator iter_end(skin["joint_names"].endArray()); + for ( ; iter != iter_end; ++iter ) + { + jointNames.push_back( iter->asString() ); + } + } + // Extract joint offsets + { + LLSD::array_const_iterator iter(skin["joint_offset"].beginArray()); + LLSD::array_const_iterator iter_end(skin["joint_offset"].endArray()); + for ( ; iter != iter_end; ++iter ) + { + jointOffsets.push_back( ll_vector3_from_sd(*iter) ); + } + } + + // get at the *optional* pelvis offset + //if ( skin.has("pelvis_offset") ) + //{ + // pelvisOffset = skin["pelvis_offset"].asReal(); + //} + // Now apply the extracted joint data to the avatar + U32 jointCount = narrow(jointNames.size()); + + if ( jointOffsets.size() < jointCount ) + { + throw LLAppException(RV_INVALID_SKIN_BLOCK); + } + + bool fullRig = ( jointCount>= FULL_RIG_JOINT_COUNT ) ? true : false; + //bool pelvisGotSet = false; + + returnResult = fullRig; + + if ( fullRig ) + { + for ( U32 i=0; istoreCurrentXform( jointOffsets[i] ); + + bool active_override_changed = false; + pJoint->addAttachmentPosOverride(jointOffsets[i], mesh_id, "", active_override_changed); + } + } + + avatar.computeBodySize(); + avatar.mRoot->touch(); + avatar.mRoot->updateWorldMatrixChildren(); + + } + + jointNames.clear(); + jointOffsets.clear(); + } + return returnResult; +} diff --git a/indra/llappearanceutility/llprocessparams.h b/indra/llappearanceutility/llprocessparams.h new file mode 100644 index 0000000000..6df893fe21 --- /dev/null +++ b/indra/llappearanceutility/llprocessparams.h @@ -0,0 +1,49 @@ +/** + * @file llprocessparams.h + * @brief Declaration of LLProcessParams class. + * + * $LicenseInfo:firstyear=2012&license=viewerlgpl$ + * Second Life Viewer Source Code + * Copyright (C) 2012, 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$ + */ + +#ifndef LL_LLPROCESSPARAMS_H +#define LL_LLPROCESSPARAMS_H + +#include "llbakingprocess.h" + +class LLBakingAvatar; +class LLProcessParams : public LLBakingProcess +{ +public: + LLProcessParams(LLAppAppearanceUtility* app) : + LLBakingProcess(app) {} + + void process(std::ostream& output) override; +private: + + bool processInputDataForJointInfo( LLBakingAvatar& avatar ); +}; + + + + +#endif /* LL_LLPROCESSPARAMS_H */ + diff --git a/indra/llappearanceutility/llprocessskin.cpp b/indra/llappearanceutility/llprocessskin.cpp new file mode 100644 index 0000000000..a3d4d3c6f3 --- /dev/null +++ b/indra/llappearanceutility/llprocessskin.cpp @@ -0,0 +1,118 @@ +/** + * @file llprocessskin.cpp + * @brief Implementation of LLProcesSkin class. + * + * $LicenseInfo:firstyear=2012&license=viewerlgpl$ + * Second Life Viewer Source Code + * Copyright (C) 2012, 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$ + */ + +// linden includes +#include "linden_common.h" + +#include "llsd.h" +#include "llsdserialize.h" +#include "llsdutil.h" +#include "llsdutil_math.h" +#include "llstl.h" +#include "llmath.h" +#include "m4math.h" +#include "v4math.h" + +// project includes +#include "llappappearanceutility.h" +#include "llprocessskin.h" + +void LLProcessSkin::process(std::ostream& output) +{ + const LLSD& dataBlock = mInputData; + LLSD skinData = LLSD::emptyMap(); + + LLSD::map_const_iterator skinIter = dataBlock.beginMap(); + LLSD::map_const_iterator skinIterEnd = dataBlock.endMap(); + + for ( ; skinIter!=skinIterEnd; ++skinIter ) + { + const LLSD& skin = skinIter->second; + if ( !skin.has("joint_names") || !skin.has("alt_inverse_bind_matrix") ) + { + throw LLAppException(RV_INVALID_SKIN_BLOCK); + } + + LLSD entry = LLSD::emptyMap(); + + //get all joint names from the skin + { + entry["joint_names"] = LLSD::emptyArray(); + LLSD& joint_names = entry["joint_names"]; + LLSD::array_const_iterator iter(skin["joint_names"].beginArray()); + LLSD::array_const_iterator iter_end(skin["joint_names"].endArray()); + for ( ; iter != iter_end; ++iter ) + { + LL_DEBUGS() << "joint: " << iter->asString() << LL_ENDL; + joint_names.append(*iter); + } + } + //get at the translational component for the joint offsets + { + entry["joint_offset"] = LLSD::emptyArray(); + LLSD& joint_offsets = entry["joint_offset"]; + LLSD::array_const_iterator iter(skin["alt_inverse_bind_matrix"].beginArray()); + LLSD::array_const_iterator iter_end(skin["alt_inverse_bind_matrix"].endArray()); + //just get at the translational component + for ( ; iter != iter_end; ++iter ) + { + LLMatrix4 mat; + for (U32 j = 0; j < 4; j++) + { + for (U32 k = 0; k < 4; k++) + { + mat.mMatrix[j][k] = static_cast((*iter)[j*4+k].asReal()); + } + } + joint_offsets.append( ll_sd_from_vector3( mat.getTranslation() )); + LL_DEBUGS() << "offset: [" << mat.getTranslation()[0] << " " + << mat.getTranslation()[1] << " " + << mat.getTranslation()[2] << " ]" << LL_ENDL; + } + } + + //get at the *optional* pelvis offset + if (skin.has("pelvis_offset")) + { + entry["pelvis_offset"] = skin["pelvis_offset"]; + } + else + { + entry["pelvis_offset"] = LLSD::Real(0.f); + } + + //add block to outgoing result llsd + skinData[skinIter->first] = entry; + } + + //dump the result llsd into the outgoing output + LLSD result; + result["success"] = true; + result["skindata"] = skinData; + LL_DEBUGS() << "---------------------------\n" << result << LL_ENDL; + output << LLSDOStreamer(result); +} + diff --git a/indra/llappearanceutility/llprocessskin.h b/indra/llappearanceutility/llprocessskin.h new file mode 100644 index 0000000000..a3cc8c7087 --- /dev/null +++ b/indra/llappearanceutility/llprocessskin.h @@ -0,0 +1,43 @@ +/** + * @file llprocessskin.h + * @brief Declaration of LLProcessSkin class. + * + * $LicenseInfo:firstyear=2012&license=viewerlgpl$ + * Second Life Viewer Source Code + * Copyright (C) 2012, 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$ + */ + +#ifndef LL_LLPROCESSSKIN_H +#define LL_LLPROCESSSKIN_H + +#include "llbakingprocess.h" +class LLProcessSkin : public LLBakingProcess +{ +public: + LLProcessSkin(LLAppAppearanceUtility* app) : + LLBakingProcess(app) {} + void process(std::ostream& output) override; + +private: + +}; + +#endif /* LL_LLPROCESSSKIN_H */ + diff --git a/indra/llappearanceutility/llprocesstexture.cpp b/indra/llappearanceutility/llprocesstexture.cpp new file mode 100644 index 0000000000..91ceedc8f6 --- /dev/null +++ b/indra/llappearanceutility/llprocesstexture.cpp @@ -0,0 +1,285 @@ +/** + * @file llprocesstexture.cpp + * @brief Implementation of LLProcessTexture class. + * + * $LicenseInfo:firstyear=2012&license=viewerlgpl$ + * Second Life Viewer Source Code + * Copyright (C) 2012, 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$ + */ + +// linden includes +#include "linden_common.h" + +#include "llfasttimer.h" +#include "llgl.h" +#include "llimagej2c.h" +#include "llsd.h" +#include "llsdserialize.h" +#include "llsdutil.h" + +// appearance includes +#include "llwearabletype.h" +#include "llavatarappearancedefines.h" + +// project includes +#include "llappappearanceutility.h" +#include "llbakingavatar.h" +#include "llbakingtexlayer.h" +#include "llbakingtexture.h" +#include "llbakingwearable.h" +#include "llbakingwearablesdata.h" +#include "llbakingwindow.h" +#include "llprocesstexture.h" + +static const S32 MAX_SIZE_LLSD_HEADER = 1024 * 1024; +static const bool USE_MIP_MAPS = true; + +static const S32 EYES_SLOT_DIMENSIONS=512; + +using namespace LLAvatarAppearanceDefines; + +LLProcessTexture::LLProcessTexture(LLAppAppearanceUtility* app) + : LLBakingProcess(app), + mWindow(nullptr), + mInputRaw(nullptr), + mBakeSize(512) +{ +} + +void LLProcessTexture::cleanup() +{ + delete mWindow; +} + +static LLFastTimer::DeclareTimer FTM_CREATE_TEXTURE_FROM_STREAM("Create texture from stream."); +static LLPointer create_texture_from_stream(std::istream& input, + S32 texture_size, + const LLUUID& id) +{ + LL_RECORD_BLOCK_TIME(FTM_CREATE_TEXTURE_FROM_STREAM); + // Read compressed j2c texture data from the input stream. + U8* buffer = (U8*) ll_aligned_malloc_16(texture_size); + input.read((char*) buffer, texture_size); + + if (input.gcount() < texture_size) + { + ll_aligned_free_16(buffer); + throw LLAppException(RV_UNABLE_TO_DECODE, " Early EOF in input stream."); + } + if (input.gcount() > texture_size) + { + ll_aligned_free_16(buffer); + throw LLAppException(RV_UNABLE_TO_DECODE, " Read too much data from input stream: Programming Error."); + } + + const S32 DISCARD_FULL_TEXTURE_RESOLUTION = 0; + LLPointer j2c = new LLImageJ2C(); + j2c->setDiscardLevel(DISCARD_FULL_TEXTURE_RESOLUTION); + // Transfer the j2c buffer to an LLImageJ2C object. + // This gives memory ownership of buffer to LLImageJ2C + if (!j2c->validate(buffer, texture_size)) + { + throw LLAppException(RV_UNABLE_TO_DECODE, " Unable to validate J2C: " + LLImage::getLastThreadError()); + } + if (!(j2c->getWidth() * j2c->getHeight() * j2c->getComponents() > 0)) + { + throw LLAppException(RV_UNABLE_TO_DECODE, " Invalid dimensions."); + } + + // Decompress the J2C image into a raw image. + LLPointer image_raw = new LLImageRaw(j2c->getWidth(), + j2c->getHeight(), + j2c->getComponents()); + const F32 MAX_DECODE_TIME = 60.f; + j2c->setDiscardLevel(0); + if (!j2c->decode(image_raw, MAX_DECODE_TIME)) + { + throw LLAppException(RV_UNABLE_TO_DECODE, " Decoding timeout."); + } + // *TODO: Check for decode failure? + LL_DEBUGS() << "ID: " << id << ", Raw Width: " << image_raw->getWidth() << ", Raw Height: " << image_raw->getHeight() + << ", Raw Components: " << (S32) image_raw->getComponents() + << ", J2C Width: " << j2c->getWidth() << ", J2C Height: " << j2c->getHeight() + << ", J2C Components: " << (S32) j2c->getComponents() << LL_ENDL; + + return image_raw; +} + +void LLProcessTexture::parseInput(std::istream& input) +{ + mInputRaw = &input; + LL_DEBUGS() << "Reading..." << LL_ENDL; + // Parse LLSD header. + mInputData = LLSDSerialize::fromBinary( *mInputRaw, MAX_SIZE_LLSD_HEADER ); + if (mInputData.isUndefined()) throw LLAppException(RV_UNABLE_TO_PARSE); + if (!mInputData.has("slot_id")) throw LLAppException(RV_UNABLE_TO_PARSE, " Missing slot id"); + if (!mInputData.has("textures")) throw LLAppException(RV_UNABLE_TO_PARSE, " Missing texture header"); + if (!mInputData.has("wearables")) throw LLAppException(RV_UNABLE_TO_PARSE, " Missing wearables"); + + // Verify the slot_id is valid. + if (BAKED_NUM_INDICES == LLAvatarAppearance::getDictionary()->findBakedByImageName(mInputData["slot_id"].asString())) + { + throw LLAppException(RV_UNABLE_TO_PARSE, " Invalid slot id"); + } +} + +void LLProcessTexture::init() +{ + if (mApp->isDebugMode()) gDebugGL = true; + + S32 maxTextureDecodedWidth = 0; + S32 maxTextureDecodedHeight = 0; + + // Extract texture data. + LLSD::array_const_iterator iter = mInputData["textures"].beginArray(); + LLSD::array_const_iterator end = mInputData["textures"].endArray(); + std::map< LLUUID, LLPointer > imageRawMap; + + for (; iter != end; ++iter) + { + LLUUID texture_id = (*iter)[0].asUUID(); + S32 texture_size = (*iter)[1]; + imageRawMap[texture_id] = create_texture_from_stream(*mInputRaw, texture_size, texture_id); + maxTextureDecodedWidth = imageRawMap[texture_id]->getWidth() > maxTextureDecodedWidth ? imageRawMap[texture_id]->getWidth() : maxTextureDecodedWidth; + maxTextureDecodedHeight = imageRawMap[texture_id]->getHeight() > maxTextureDecodedHeight ? imageRawMap[texture_id]->getHeight() : maxTextureDecodedHeight; + } + + if ("eyes" == mInputData["slot_id"].asString()) + { + mBakeSize = 512; + } + else + { + // optimization: maybe we could use maxTextureDecodedWidth and + // maxTextureDecodedHeight for new LLBakingWindow below? + if ((maxTextureDecodedWidth > 1024) || (maxTextureDecodedHeight > 1024)) + { + mBakeSize = 2048; + } + else if ((maxTextureDecodedWidth > 512) || (maxTextureDecodedHeight > 512)) + { + mBakeSize = 1024; + } + else + { + mBakeSize = 512; + } + } + + mWindow = new LLBakingWindow(mBakeSize, mBakeSize); + + for (iter = mInputData["textures"].beginArray(); iter != mInputData["textures"].endArray(); ++iter) + { + LLUUID texture_id = (*iter)[0].asUUID(); + + LLPointer texture = new LLBakingTexture(texture_id, imageRawMap[texture_id]); + texture->forceActive(); + texture->setGLTextureCreated(true); + + mTextureData[texture_id] = texture; + } + +} + +LLPointer LLProcessTexture::getLocalTexture(bool usemipmaps, bool generate_gl_tex) +{ + LLPointer tex = new LLBakingTexture(usemipmaps); + if(generate_gl_tex) + { + tex->generateGLTexture() ; + tex->setCategory(LLGLTexture::LOCAL) ; + } + return tex ; +} + +LLPointer LLProcessTexture::getLocalTexture(const U32 width, const U32 height, const U8 components, bool usemipmaps, bool generate_gl_tex) +{ + LLPointer tex = new LLBakingTexture(width, height, components, usemipmaps) ; + if(generate_gl_tex) + { + tex->generateGLTexture() ; + tex->setCategory(LLGLTexture::LOCAL) ; + } + return tex ; +} + +LLGLTexture* LLProcessTexture::getFetchedTexture(const LLUUID &image_id) +{ + texture_map_t::iterator texture_iter = mTextureData.find(image_id); + if (mTextureData.end() == texture_iter) + { + LL_DEBUGS() << "Ignoring unused texture id: " << image_id << LL_ENDL; + return nullptr; + } + + return texture_iter->second; +} + +void LLProcessTexture::process(std::ostream& output) +{ + LL_DEBUGS() << "Building avatar..." << LL_ENDL; + // Set ourself as the texture bridge. + gTextureManagerBridgep = this; + + // Construct the avatar. + LLBakingWearablesData wearable_data; + LLBakingAvatar avatar(&wearable_data, mBakeSize); + avatar.initInstance(); + wearable_data.setAvatarAppearance(&avatar); + + // Extract and parse wearables. + wearable_data.setWearableOutfit(mInputData["wearables"]); + + avatar.setSex( (avatar.getVisualParamWeight( "male" ) > 0.5f) ? SEX_MALE : SEX_FEMALE ); + + avatar.updateVisualParams(); + + // Prepare gl for avatar baking + glClearColor(0.0f, 0.0f, 0.0f, 0.0f); + LLGLEnable color_mat(GL_COLOR_MATERIAL); + gGL.setSceneBlendType(LLRender::BT_ALPHA); + + EBakedTextureIndex bake_type = LLAvatarAppearance::getDictionary()->findBakedByImageName(mInputData["slot_id"].asString()); + LLTexLayerSet* layer_set = avatar.getAvatarLayerSet(bake_type); + LLBakingTexLayerSetBuffer* composite = dynamic_cast (layer_set->getComposite()); + if (!composite) + { + throw LLAppException(RV_UNABLE_TO_BAKE, " Could not build composite."); + } + + LL_DEBUGS() << "Rendering..." << LL_ENDL; + if (!composite->render()) + { + throw LLAppException(RV_UNABLE_TO_BAKE, " Failed to render composite."); + } + + mWindow->swapBuffers(); + + LL_DEBUGS() << "Compressing..." << LL_ENDL; + LLImageJ2C* j2c = composite->getCompressedImage(); + if (!j2c) + { + throw LLAppException(RV_UNABLE_TO_BAKE, " Could not build image."); + } + + LL_DEBUGS() << "Writing..." << LL_ENDL; + output.write((char*)j2c->getData(), j2c->getDataSize()); + LL_DEBUGS() << "Done." << LL_ENDL; +} diff --git a/indra/llappearanceutility/llprocesstexture.h b/indra/llappearanceutility/llprocesstexture.h new file mode 100644 index 0000000000..8bf2c7396f --- /dev/null +++ b/indra/llappearanceutility/llprocesstexture.h @@ -0,0 +1,63 @@ +/** + * @file llprocesstexture.h + * @brief Declaration of LLProcessTexture class. + * + * $LicenseInfo:firstyear=2012&license=viewerlgpl$ + * Second Life Viewer Source Code + * Copyright (C) 2012, 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$ + */ + +#ifndef LL_LLPROCESSTEXTURE_H +#define LL_LLPROCESSTEXTURE_H + +#include "llbakingprocess.h" +#include "llbakingtexture.h" +#include "llpointer.h" +#include "lltexturemanagerbridge.h" +#include "llbakingwindow.h" + +class LLBakingWindow; + +class LLProcessTexture : public LLBakingProcess, public LLTextureManagerBridge +{ +public: + LLProcessTexture(LLAppAppearanceUtility* app); + + /////// LLBakingProcess interface. ///////// + void parseInput(std::istream& input) override; + void process(std::ostream& output) override; + void init() override; + void cleanup() override; + + /////// LLTextureManagerBridge interface. //////// + LLPointer getLocalTexture(bool usemipmaps = true, bool generate_gl_tex = true) override; + LLPointer getLocalTexture(const U32 width, const U32 height, const U8 components, bool usemipmaps, bool generate_gl_tex = true) override; + LLGLTexture* getFetchedTexture(const LLUUID &image_id) override; + +private: + typedef std::map< LLUUID, LLPointer > texture_map_t; + texture_map_t mTextureData; + LLBakingWindow* mWindow; + std::istream* mInputRaw; + S32 mBakeSize; +}; + +#endif /* LL_LLPROCESSTEXTURE_H */ + diff --git a/indra/llappearanceutility/tests/joint-offsets.xml b/indra/llappearanceutility/tests/joint-offsets.xml new file mode 100644 index 0000000000..4dca3c3429 --- /dev/null +++ b/indra/llappearanceutility/tests/joint-offsets.xml @@ -0,0 +1 @@ +92a7dd5c-bc30-9952-3b3b-e6cc10336cbebind_shape_matrix0.048803295940160750.00.00.00.00.0488033369183540340.00.00.00.00.049029946327209470.00.05886554718017578-0.03438653051853181.75724506378173831.0joint_namesmEyeLeftmHeadmNeckmChestmTorsomPelvismEyeRightalt_inverse_bind_matrix1.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.00.090427502989768980.037174601107835770.080562800168991091.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.075629897415637971.01.18342995643615720.00.00.00.01.197600007057190.00.00.00.01.00.0-0.009507000446319580.00.251107990741729741.01.010100007057190.00.00.00.01.04166996479034420.00.00.00.01.00.0-0.015367999672889710.00.204877004027366641.01.00.00.00.00.01.00.00.00.00.01.00.00.00.00.084072902798652651.01.00.00.00.00.01.00.00.00.00.01.00.00.00.01.0670200586318971.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.00.09042750298976898-0.037174601107835770.080562800168991091.0pelvis_offset0.0inverse_bind_matrix1.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.0-0.06363839656114578-0.03717460110783577-1.89970004558563231.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.00.0267891008406877520.0-1.81913995742797851.01.18342995643615720.00.00.00.01.197600007057190.00.00.00.01.00.00.0293253995478153230.0-1.6070699691772461.01.010100007057190.00.00.00.01.04166996479034420.00.00.00.01.00.00.0155231999233365060.0-1.35596001148223881.01.00.00.00.00.01.00.00.00.00.01.00.00.00.0-1.15109002590179441.01.00.00.00.00.01.00.00.00.00.01.00.00.00.0-1.06701004505157471.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.0-0.063638396561145780.03717460110783577-1.89970004558563231.0971cf873-afce-8b69-44d6-3f5879cb94c2bind_shape_matrix0.029928008094429970.00.00.00.00.046580597758293150.00.00.00.00.0094699859619140620.00.137737005949020395.450006574392319e-051.68836498260498051.0joint_namesmHeadmNeckmChestmTorsomPelvismFaceJawmFaceRootmFaceLipUpperLeftmFaceTeethUppermFaceLipUpperRightmFaceLipCornerLeftmFaceLipCornerRightmFaceLipLowerCentermFaceTeethLowermFaceChinmFaceLipLowerLeftmFaceLipLowerRightmFaceEyeLidUpperLeftmFaceEyeLidUpperRightmFaceEyebrowInnerLeftmFaceEyebrowInnerRightmFaceEyebrowCenterLeftmFaceEyebrowCenterRightmFaceForeheadCentermFaceNoseBridgemFaceNoseBasemFaceEyeLidLowerLeftmFaceEyeLidLowerRightmFaceCheekUpperLeftmFaceCheekUpperRightmFaceLipUpperCenteralt_inverse_bind_matrix1.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.075629897415637971.01.18342995643615720.00.00.00.01.197600007057190.00.00.00.01.00.0-0.009507000446319580.00.251107990741729741.01.010100007057190.00.00.00.01.04166996479034420.00.00.00.01.00.0-0.015367999672889710.00.204877004027366641.01.00.00.00.00.01.00.00.00.00.01.00.00.00.00.084072902798652651.01.00.00.00.00.01.00.00.00.00.01.00.00.00.01.0670200586318971.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.00.0359875001013278960.0-0.0253947004675865171.01.08107995986938480.00.00.00.01.05708003044128420.00.00.00.01.10618996620178220.00.025000000372529030.00.045000001788139341.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.2208299636840820.0-0.0591681003570556640.00.0048508602194488051.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.00.107000999152660370.0-0.026074899360537531.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.2208299636840820.0-0.0591681003570556640.00.0048508602194488051.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.00.03629549965262413-0.01899999938905239-0.0134859997779130941.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.00.036295499652624130.01899999938905239-0.0134859997779130941.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.0-0.020269699394702910.00.0053312801755964761.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.00.083006501197814940.0-0.0203639995306730271.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.00.083787396550178530.0-0.0266884993761777881.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.00.03427229821681976-0.012062000110745430.00051081198034808041.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.00.034272298216819760.012062000110745430.00051081198034808041.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.00.044901698827743530.0369763001799583440.0383545011281967161.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.00.04490169882774353-0.0369763001799583440.0383545011281967161.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.00.85106402635574340.00.0181128997355699540.0167341008782386780.0570053011178970341.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.00.85106402635574340.00.018112899735569954-0.0167341008782386780.0570053011178970341.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.00.85106402635574340.0-0.0082314396277070050.037603501230478290.0562760010361671451.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.00.85106402635574340.0-0.008231439627707005-0.037603501230478290.0562760010361671451.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.00.073194302618503570.00.087503999471664431.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.00.104399003088474270.00.0171787999570369721.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.00.150499001145362850.00.0038539199158549311.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.00.044901698827743530.0369763001799583440.0383545011281967161.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.00.04490169882774353-0.0369763001799583440.0383545011281967161.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.00.0291581992059946060.05687420070171356-0.00453078979626297951.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.00.029158199205994606-0.05687420070171356-0.00453078979626297951.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.041350007057190.00.0167011991143226620.00.0097117396071553231.0pelvis_offset0.0inverse_bind_matrix1.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.00.0267891008406877520.0-1.81913995742797851.01.18342995643615720.00.00.00.01.197600007057190.00.00.00.01.00.00.0293253995478153230.0-1.6070699691772461.01.010100007057190.00.00.00.01.04166996479034420.00.00.00.01.00.00.0155231999233365060.0-1.35596001148223881.01.00.00.00.00.01.00.00.00.00.01.00.00.00.0-1.15109002590179441.01.00.00.00.00.01.00.00.00.00.01.00.00.00.0-1.06701004505157471.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.0-0.0341983996331691740.0-1.84081995487213131.01.08107995986938480.00.00.00.01.05708003044128420.00.00.00.01.10618996620178220.00.00178911001421511170.0-1.90898001194000241.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.2208299636840820.0-0.046043299138545990.0-2.08349990844726561.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.0-0.105210997164249420.0-1.84016001224517821.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.2208299636840820.0-0.046043299138545990.0-2.08349990844726561.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.0-0.141506999731063840.01899999938905239-1.82667005062103271.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.0-0.14150699973106384-0.01899999938905239-1.82667005062103271.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.0-0.096935302019119260.0-1.82579004764556881.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.0-0.117205001413822170.0-1.82045996189117431.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.0-0.117986001074314120.0-1.81412994861602781.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.0-0.151476994156837460.01206200011074543-1.8209700584411621.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.0-0.15147699415683746-0.01206200011074543-1.8209700584411621.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.0-0.04311259835958481-0.037815701216459274-1.90312004089355471.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.0-0.043112598359584810.037815701216459274-1.90312004089355471.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.00.85106402635574340.0-0.016323799267411232-0.017114000394940376-1.51254999637603761.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.00.85106402635574340.0-0.0163237992674112320.017114000394940376-1.51254999637603761.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.00.85106402635574340.00.010020599700510502-0.038457199931144714-1.5119899511337281.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.00.85106402635574340.00.0100205997005105020.038457199931144714-1.5119899511337281.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.0-0.071405202150344850.0-1.9511599540710451.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.0-0.102609001100063320.0-1.88242995738983151.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.0-0.14870999753475190.0-1.86940002441406251.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.0-0.04311259835958481-0.037815701216459274-1.90312004089355471.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.0-0.043112598359584810.037815701216459274-1.90312004089355471.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.0-0.027369100600481033-0.058165401220321655-1.86120998859405521.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.0-0.0273691006004810330.058165401220321655-1.86120998859405521.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.041350007057190.0-0.121913000941276550.0-1.78188002109527591.07e7a6834-8b41-4029-8f87-ce57b7d05beebind_shape_matrix0.27415099740028380.00.00.00.00.152832403779029850.00.00.00.00.23362004756927490.00.033084496855735780.01.74006009101867681.0joint_namesmHeadmNeckmChestmTorsomPelvismFaceJawmFaceRootmFaceLipUpperLeftmFaceTeethUppermFaceLipUpperRightmFaceLipCornerLeftmFaceLipCornerRightmFaceLipLowerCentermFaceTeethLowermFaceChinmFaceLipLowerLeftmFaceLipLowerRightmFaceEyeLidUpperLeftmFaceEyeLidUpperRightmFaceEyebrowInnerLeftmFaceEyebrowInnerRightmFaceEyebrowCenterLeftmFaceEyebrowCenterRightmFaceForeheadCentermFaceNoseBridgemFaceNoseBasemFaceEyeLidLowerLeftmFaceEyeLidLowerRightmFaceCheekUpperLeftmFaceCheekUpperRightmFaceLipUpperCenteralt_inverse_bind_matrix1.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.075629897415637971.01.18342995643615720.00.00.00.01.197600007057190.00.00.00.01.00.0-0.009507000446319580.00.251107990741729741.01.010100007057190.00.00.00.01.04166996479034420.00.00.00.01.00.0-0.015367999672889710.00.204877004027366641.01.00.00.00.00.01.00.00.00.00.01.00.00.00.00.084072902798652651.01.00.00.00.00.01.00.00.00.00.01.00.00.00.01.0670200586318971.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.00.0359875001013278960.0-0.0253947004675865171.01.08107995986938480.00.00.00.01.05708003044128420.00.00.00.01.10618996620178220.00.025000000372529030.00.045000001788139341.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.2208299636840820.0-0.0591681003570556640.00.0048508602194488051.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.00.107000999152660370.0-0.026074899360537531.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.2208299636840820.0-0.0591681003570556640.00.0048508602194488051.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.00.03629549965262413-0.01899999938905239-0.0134859997779130941.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.00.036295499652624130.01899999938905239-0.0134859997779130941.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.0-0.020269699394702910.00.0053312801755964761.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.00.083006501197814940.0-0.0203639995306730271.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.00.083787396550178530.0-0.0266884993761777881.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.00.03427229821681976-0.012062000110745430.00051081198034808041.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.00.034272298216819760.012062000110745430.00051081198034808041.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.00.044901698827743530.0369763001799583440.0383545011281967161.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.00.04490169882774353-0.0369763001799583440.0383545011281967161.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.00.85106402635574340.00.0181128997355699540.0167341008782386780.0570053011178970341.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.00.85106402635574340.00.018112899735569954-0.0167341008782386780.0570053011178970341.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.00.85106402635574340.0-0.0082314396277070050.037603501230478290.0562760010361671451.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.00.85106402635574340.0-0.008231439627707005-0.037603501230478290.0562760010361671451.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.00.073194302618503570.00.087503999471664431.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.00.104399003088474270.00.0171787999570369721.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.00.150499001145362850.00.0038539199158549311.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.00.044901698827743530.0369763001799583440.0383545011281967161.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.00.04490169882774353-0.0369763001799583440.0383545011281967161.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.00.0291581992059946060.05687420070171356-0.00453078979626297951.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.00.029158199205994606-0.05687420070171356-0.00453078979626297951.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.041350007057190.00.0167011991143226620.00.0097117396071553231.0pelvis_offset0.0inverse_bind_matrix1.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.00.0267891008406877520.0-1.81913995742797851.01.18342995643615720.00.00.00.01.197600007057190.00.00.00.01.00.00.0293253995478153230.0-1.6070699691772461.01.010100007057190.00.00.00.01.04166996479034420.00.00.00.01.00.00.0155231999233365060.0-1.35596001148223881.01.00.00.00.00.01.00.00.00.00.01.00.00.00.0-1.15109002590179441.01.00.00.00.00.01.00.00.00.00.01.00.00.00.0-1.06701004505157471.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.0-0.0341983996331691740.0-1.84081995487213131.01.08107995986938480.00.00.00.01.05708003044128420.00.00.00.01.10618996620178220.00.00178911001421511170.0-1.90898001194000241.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.2208299636840820.0-0.046043299138545990.0-2.08349990844726561.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.0-0.105210997164249420.0-1.84016001224517821.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.2208299636840820.0-0.046043299138545990.0-2.08349990844726561.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.0-0.141506999731063840.01899999938905239-1.82667005062103271.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.0-0.14150699973106384-0.01899999938905239-1.82667005062103271.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.0-0.096935302019119260.0-1.82579004764556881.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.0-0.117205001413822170.0-1.82045996189117431.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.0-0.117986001074314120.0-1.81412994861602781.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.0-0.151476994156837460.01206200011074543-1.8209700584411621.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.0-0.15147699415683746-0.01206200011074543-1.8209700584411621.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.0-0.04311259835958481-0.037815701216459274-1.90312004089355471.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.0-0.043112598359584810.037815701216459274-1.90312004089355471.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.00.85106402635574340.0-0.016323799267411232-0.017114000394940376-1.51254999637603761.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.00.85106402635574340.0-0.0163237992674112320.017114000394940376-1.51254999637603761.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.00.85106402635574340.00.010020599700510502-0.038457199931144714-1.5119899511337281.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.00.85106402635574340.00.0100205997005105020.038457199931144714-1.5119899511337281.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.0-0.071405202150344850.0-1.9511599540710451.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.0-0.102609001100063320.0-1.88242995738983151.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.0-0.14870999753475190.0-1.86940002441406251.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.0-0.04311259835958481-0.037815701216459274-1.90312004089355471.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.0-0.043112598359584810.037815701216459274-1.90312004089355471.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.0-0.027369100600481033-0.058165401220321655-1.86120998859405521.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.0-0.0273691006004810330.058165401220321655-1.86120998859405521.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.041350007057190.0-0.121913000941276550.0-1.78188002109527591.0547d8392-9f19-35fb-3508-121eea388f0abind_shape_matrix0.12420170754194260.00.00.00.00.040834598243236540.00.00.00.00.0144999027252197270.00.077383153140544890.01.68994998931884771.0joint_namesmFaceJawmFaceRootmHeadmNeckmChestmTorsomPelvismFaceTongueBasemFaceTeethLowermFaceTongueTipalt_inverse_bind_matrix1.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.00.0359875001013278960.0-0.0253947004675865171.01.08107995986938480.00.00.00.01.05708003044128420.00.00.00.01.10618996620178220.00.025000000372529030.00.045000001788139341.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.075629897415637971.01.18342995643615720.00.00.00.01.197600007057190.00.00.00.01.00.0-0.009507000446319580.00.251107990741729741.01.010100007057190.00.00.00.01.04166996479034420.00.00.00.01.00.0-0.015367999672889710.00.204877004027366641.01.00.00.00.00.01.00.00.00.00.01.00.00.00.00.084072902798652651.01.00.00.00.00.01.00.00.00.00.01.00.00.00.01.0670200586318971.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.0-0.0298503991216421130.00.0078316899016499521.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.00.083006501197814940.0-0.0203639995306730271.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.00.0389162003993988040.0-0.0027754299808293581.0pelvis_offset0.0inverse_bind_matrix1.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.0-0.0341983996331691740.0-1.84081995487213131.01.08107995986938480.00.00.00.01.05708003044128420.00.00.00.01.10618996620178220.00.00178911001421511170.0-1.90898001194000241.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.00.0267891008406877520.0-1.81913995742797851.01.18342995643615720.00.00.00.01.197600007057190.00.00.00.01.00.00.0293253995478153230.0-1.6070699691772461.01.010100007057190.00.00.00.01.04166996479034420.00.00.00.01.00.00.0155231999233365060.0-1.35596001148223881.01.00.00.00.00.01.00.00.00.00.01.00.00.00.0-1.15109002590179441.01.00.00.00.00.01.00.00.00.00.01.00.00.00.0-1.06701004505157471.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.0-0.087354503571987150.0-1.82828998565673831.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.0-0.117205001413822170.0-1.82045996189117431.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.0-0.126270994544029240.0-1.8255100250244141.0ed796a27-cff0-454a-ecec-fd10794ca2c9bind_shape_matrix0.0071529899723827840.00.00.00.00.0193126909434795380.00.00.00.00.0236200094223022460.00.163101494312286380.00020919507369399071.71106004714965821.0joint_namesmFaceNoseBasemFaceRootmHeadmNeckmChestmTorsomPelvismFaceLipUpperCentermFaceTeethUpperalt_inverse_bind_matrix1.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.00.150499001145362850.00.0038539199158549311.01.08107995986938480.00.00.00.01.05708003044128420.00.00.00.01.10618996620178220.00.025000000372529030.00.045000001788139341.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.075629897415637971.01.18342995643615720.00.00.00.01.197600007057190.00.00.00.01.00.0-0.009507000446319580.00.251107990741729741.01.010100007057190.00.00.00.01.04166996479034420.00.00.00.01.00.0-0.015367999672889710.00.204877004027366641.01.00.00.00.00.01.00.00.00.00.01.00.00.00.00.084072902798652651.01.00.00.00.00.01.00.00.00.00.01.00.00.00.01.0670200586318971.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.041350007057190.00.0167011991143226620.00.0097117396071553231.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.00.107000999152660370.0-0.026074899360537531.0pelvis_offset0.0inverse_bind_matrix1.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.0-0.14870999753475190.0-1.86940002441406251.01.08107995986938480.00.00.00.01.05708003044128420.00.00.00.01.10618996620178220.00.00178911001421511170.0-1.90898001194000241.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.00.0267891008406877520.0-1.81913995742797851.01.18342995643615720.00.00.00.01.197600007057190.00.00.00.01.00.00.0293253995478153230.0-1.6070699691772461.01.010100007057190.00.00.00.01.04166996479034420.00.00.00.01.00.00.0155231999233365060.0-1.35596001148223881.01.00.00.00.00.01.00.00.00.00.01.00.00.00.0-1.15109002590179441.01.00.00.00.00.01.00.00.00.00.01.00.00.00.0-1.06701004505157471.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.041350007057190.0-0.121913000941276550.0-1.78188002109527591.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.0-0.105210997164249420.0-1.84016001224517821.0fa0aabfe-4b1c-fa9b-4942-74e7e7f50fe2bind_shape_matrix0.022715998813509940.00.00.00.00.022715998813509940.00.00.00.00.0227099657058715820.00.00.01.06701493263244631.0joint_namesmPelvismHandMiddle1LeftmHandMiddle2LeftmHandMiddle3LeftmHandIndex1LeftmHandIndex2LeftmHandIndex3LeftmHandRing1LeftmHandRing2LeftmHandRing3LeftmHandPinky1LeftmHandPinky2LeftmHandPinky3LeftmHandThumb1LeftmHandThumb2LeftmHandThumb3LeftmHandMiddle1RightmHandMiddle2RightmHandMiddle3RightmHandIndex1RightmHandIndex2RightmHandIndex3RightmHandRing1RightmHandRing2RightmHandRing3RightmHandPinky1RightmHandPinky2RightmHandPinky3RightmHandThumb1RightmHandThumb2RightmHandThumb3Rightalt_inverse_bind_matrix1.00.00.00.00.01.00.00.00.00.01.00.00.00.01.0670200586318971.00.99873197078704830.04983130097389221-0.0070897499099373820.0-0.0301342997699975970.7048000097274780.7087659835815430.00.040315598249435425-0.70765399932861330.7054079771041870.00.0151886995881795880.098942197859287260.0104294996708631521.00.99894601106643680.045610301196575165-0.005135800223797560.0-0.0289570000022649770.71308398246765140.70047998428344730.00.03561139851808548-0.69959300756454470.71365398168563840.0-0.00105056003667414190.04202070087194443-0.0063029900193214421.00.99634701013565060.08039940148591995-0.028780499473214150.0-0.0383009985089302060.72195601463317870.69087797403335570.00.07632440328598022-0.68725198507308960.72239899635314940.0-0.00050425098743289710.024710899218916893-0.0040346500463783741.00.9319689869880676-0.248298004269599910.264160990715026860.00.023382499814033510.7682970166206360.63966602087020870.0-0.3617820143699646-0.5899729728698730.72183501720428470.00.03427390009164810.094680696725845340.0096299396827816961.00.9427329897880554-0.223545998334884640.24755300581455230.00.017677599564194680.7746199965476990.63217902183532710.0-0.333079993724823-0.59160000085830690.73421198129653930.00.0171910002827644350.03640490025281906-0.0060679200105369091.00.9429500102996826-0.21653699874877930.25289699435234070.00.002694060094654560.76453900337219240.64457201957702640.0-0.3329229950904846-0.60711801052093510.72150599956512450.00.0102137001231312750.023345300927758217-0.0043774899095296861.00.9654129743576050.157709002494812-0.207616999745368960.00.0155645003542304040.76002901792526250.64970201253890990.00.2602590024471283-0.63046300411224370.73128801584243770.0-0.00364764011465013030.096580803394317630.0044052097946405411.00.97247397899627690.11432900279760361-0.203038007020950320.00.044799100607633590.76336401700973510.64441400766372680.00.2286670058965683-0.63577097654342650.73722898960113530.0-0.0123153002932667730.035998500883579254-0.0075785201042890551.00.96376097202301030.15707699954509735-0.21561999619007110.00.0189111009240150450.76600497961044310.64255702495574950.00.2660970091819763-0.62334901094436650.73527497053146360.0-0.0065627098083496090.02019299939274788-0.0045438897795975211.00.82219499349594120.3776470124721527-0.42588400840759280.0-0.118125997483730320.84512501955032350.5213530063629150.00.5568130016326904-0.37834599614143370.7394679784774780.0-0.0232133995741605760.08812329918146133-0.0041738501749932771.00.86176002025604250.33954399824142456-0.37693598866462710.0-0.106248997151851650.84731501340866090.52035301923751830.00.49606600403785706-0.40837100148200990.76625800132751460.0-0.0222677998244762420.02319590002298355-0.0055669201537966731.00.87477701902389530.3211840093135834-0.36277499794960020.0-0.108980998396873470.85996502637863160.49858099222183230.00.47211000323295593-0.39661198854446410.78728097677230830.0-0.012436700053513050.014924099668860435-0.0033164799679070711.00.9163669943809509-0.072017200291156770.39380899071693420.0-0.11881099641323090.89044702053070070.4393039941787720.0-0.38230299949645996-0.44935199618339540.8074200153350830.00.032215598970651630.02088090032339096-0.008553059771656991.00.9283679723739624-0.0201622005552053450.37111499905586240.0-0.166196003556251530.87061101198196410.46305000782012940.0-0.33243298530578613-0.49155899882316590.80489701032638550.00.0294509995728731160.03365840017795563-0.00105202000122517351.00.9289919734001160.079554900527000430.36144900321960450.0-0.26165801286697390.83187001943588260.48941498994827270.0-0.2617430090904236-0.54923802614212040.79361701011657710.00.0209248997271060940.028203699737787247-0.0009096220019273461.00.9987319707870483-0.04983120039105415-0.0070897699333727360.00.0301342997699975970.704800009727478-0.7087659835815430.00.0403155013918876650.70765399932861330.7054079771041870.00.015188699588179588-0.098942197859287260.0104294996708631521.00.9989460110664368-0.045610301196575165-0.005135800223797560.00.0289570000022649770.7130839824676514-0.70047998428344730.00.035611398518085480.69959300756454470.71365398168563840.0-0.0010505500249564648-0.042020801454782486-0.0063028801232576371.00.9963470101356506-0.08039940148591995-0.028780499473214150.00.0383009985089302060.7219560146331787-0.69087797403335570.00.076324403285980220.68725198507308960.72239899635314940.0-0.0005042660050094128-0.024710899218916893-0.00403465982526540761.00.93196898698806760.248298004269599910.264160990715026860.0-0.0233826003968715670.768297016620636-0.63966697454452510.0-0.36178201436996460.5899729728698730.72183501720428470.00.0342739000916481-0.094680696725845340.0096299396827816961.00.94273298978805540.223545998334884640.24755300581455230.0-0.0176777001470327380.774619996547699-0.63217902183532710.0-0.3330799937248230.59160000085830690.73421198129653930.00.017191000282764435-0.03640500083565712-0.0060678198933601381.00.94295001029968260.21653699874877930.25289699435234070.0-0.0026940701063722370.7645390033721924-0.64457201957702640.0-0.33292299509048460.60711801052093510.72150599956512450.00.010213700123131275-0.023345300927758217-0.0043774899095296861.00.965412974357605-0.157709002494812-0.207616999745368960.0-0.0155645003542304040.7600290179252625-0.64970201253890990.00.26025900244712830.63046300411224370.73128801584243770.0-0.0036476401146501303-0.096580803394317630.0044052097946405411.00.9724739789962769-0.11432900279760361-0.203038007020950320.0-0.044799100607633590.7633640170097351-0.64441400766372680.00.22866700589656830.63577097654342650.73722898960113530.0-0.012315300293266773-0.035998400300741196-0.0075783901847898961.00.9637609720230103-0.15707699954509735-0.21561999619007110.0-0.0189111009240150450.7660049796104431-0.64255702495574950.00.26609700918197630.62334901094436650.73527497053146360.0-0.006562769878655672-0.02019290067255497-0.0045436499640345571.00.8221949934959412-0.3776470124721527-0.42588400840759280.00.118125997483730320.8451250195503235-0.5213530063629150.00.55681300163269040.37834599614143370.7394679784774780.0-0.023213399574160576-0.08812329918146133-0.0041738501749932771.00.8617600202560425-0.33954399824142456-0.37693598866462710.00.106248997151851650.8473150134086609-0.52035301923751830.00.496066004037857060.40837100148200990.76625800132751460.0-0.022267799824476242-0.023195700719952583-0.0055669001303613191.00.8747770190238953-0.3211840093135834-0.36277499794960020.00.108980998396873470.8599650263786316-0.49858099222183230.00.472110003232955930.39661198854446410.78728097677230830.0-0.012436600401997566-0.014924000017344952-0.00331673002801835541.00.91636699438095090.072017401456832890.39380899071693420.00.11881099641323090.8904470205307007-0.4393039941787720.0-0.382302999496459960.44935199618339540.8074200153350830.00.03221559897065163-0.02088090032339096-0.008553059771656991.00.92836797237396240.0201622005552053450.37111499905586240.00.166196003556251530.8706110119819641-0.46305000782012940.0-0.332432985305786130.49155899882316590.80489701032638550.00.029450900852680206-0.03365840017795563-0.00105209997855126861.00.928991973400116-0.079554900527000430.36144900321960450.00.26165801286697390.8318700194358826-0.48941498994827270.0-0.26174300909042360.54923802614212040.79361701011657710.00.020925000309944153-0.028203800320625305-0.00090978998923674231.0pelvis_offset0.0inverse_bind_matrix1.00.00.00.00.01.00.00.00.00.01.00.00.00.0-1.0670200586318971.00.99873197078704830.04983130097389221-0.0070897499099373820.0-0.0301342997699975970.7048000097274780.7087659835815430.00.040315598249435425-0.70765399932861330.7054079771041870.0-0.0084887603297829630.41053301095962524-1.20159995555877691.00.99894601106643680.045610301196575165-0.005135800223797560.0-0.0289570000022649770.71308398246765140.70047998428344730.00.03561139851808548-0.69959300756454470.71365398168563840.0-0.00293081998825073240.35466399788856506-1.19949996471405031.00.99634701013565060.08039940148591995-0.028780499473214150.0-0.0383009985089302060.72195601463317870.69087797403335570.00.07632440328598022-0.68725198507308960.72239899635314940.0-0.040985401719808580.3118860125541687-1.19960999488830571.00.9319689869880676-0.248298004269599910.264160990715026860.00.023382499814033510.7682970166206360.63966602087020870.0-0.3617820143699646-0.5899729728698730.72183501720428470.00.401042997837066650.2437240034341812-1.18042004108428961.00.9427329897880554-0.223545998334884640.24755300581455230.00.017677599564194680.7746199965476990.63217902183532710.0-0.333079993724823-0.59160000085830690.73421198129653930.00.355307996273040770.2053389996290207-1.1836500167846681.00.9429500102996826-0.21653699874877930.25289699435234070.00.002694060094654560.76453900337219240.64457201957702640.0-0.3329229950904846-0.60711801052093510.72150599956512450.00.353888005018234250.2048649936914444-1.17289996147155761.00.9654129743576050.157709002494812-0.207616999745368960.00.0155645003542304040.76002901792526250.64970201253890990.00.2602590024471283-0.63046300411224370.73128801584243770.0-0.26629498600959780.2996309995651245-1.20013999938964841.00.97247397899627690.11432900279760361-0.203038007020950320.00.044799100607633590.76336401700973510.64441400766372680.00.2286670058965683-0.63577097654342650.73722898960113530.0-0.23568700253963470.26565900444984436-1.19586002826690671.00.96376097202301030.15707699954509735-0.21561999619007110.00.0189111009240150450.76600497961044310.64255702495574950.00.2660970091819763-0.62334901094436650.73527497053146360.0-0.25492200255393980.23242099583148956-1.1886899471282961.00.82219499349594120.3776470124721527-0.42588400840759280.0-0.118125997483730320.84512501955032350.5213530063629150.00.5568130016326904-0.37834599614143370.7394679784774780.0-0.5196760296821594-0.007902019657194614-1.14863002300262451.00.86176002025604250.33954399824142456-0.37693598866462710.0-0.106248997151851650.84731501340866090.52035301923751830.00.49606600403785706-0.40837100148200990.76625800132751460.0-0.4340290129184723-0.0015098199946805835-1.1690100431442261.00.87477701902389530.3211840093135834-0.36277499794960020.0-0.108980998396873470.85996502637863160.49858099222183230.00.47211000323295593-0.39661198854446410.78728097677230830.0-0.3928540050983429-0.03789449855685234-1.17518997192382811.00.9163669943809509-0.072017200291156770.39380899071693420.0-0.11881099641323090.89044702053070070.4393039941787720.0-0.38230299949645996-0.44935199618339540.8074200153350830.00.513168990612030.09074380248785019-1.16830003261566161.00.9283679723739624-0.0201622005552053450.37111499905586240.0-0.166196003556251530.87061101198196410.46305000782012940.0-0.33243298530578613-0.49155899882316590.80489701032638550.00.450581997632980350.11499100178480148-1.17621004581451421.00.9289919734001160.079554900527000430.36144900321960450.0-0.26165801286697390.83187001943588260.48941498994827270.0-0.2617430090904236-0.54923802614212040.79361701011657710.00.4012039899826050.1690800040960312-1.17639994621276861.00.9987319707870483-0.04983120039105415-0.0070897699333727360.00.0301342997699975970.704800009727478-0.7087659835815430.00.0403155013918876650.70765399932861330.7054079771041870.0-0.008488760329782963-0.41053301095962524-1.20159995555877691.00.9989460110664368-0.045610301196575165-0.005135800223797560.00.0289570000022649770.7130839824676514-0.70047998428344730.00.035611398518085480.69959300756454470.71365398168563840.0-0.0029308199882507324-0.35466399788856506-1.19949996471405031.00.9963470101356506-0.08039940148591995-0.028780499473214150.00.0383009985089302060.7219560146331787-0.69087797403335570.00.076324403285980220.68725198507308960.72239899635314940.0-0.04098540171980858-0.3118860125541687-1.19960999488830571.00.93196898698806760.248298004269599910.264160990715026860.0-0.0233826003968715670.768297016620636-0.63966697454452510.0-0.36178201436996460.5899729728698730.72183501720428470.00.40104299783706665-0.2437240034341812-1.18042004108428961.00.94273298978805540.223545998334884640.24755300581455230.0-0.0176777001470327380.774619996547699-0.63217902183532710.0-0.3330799937248230.59160000085830690.73421198129653930.00.35530799627304077-0.2053389996290207-1.1836500167846681.00.94295001029968260.21653699874877930.25289699435234070.0-0.0026940701063722370.7645390033721924-0.64457201957702640.0-0.33292299509048460.60711801052093510.72150599956512450.00.35388800501823425-0.2048649936914444-1.17289996147155761.00.965412974357605-0.157709002494812-0.207616999745368960.0-0.0155645003542304040.7600290179252625-0.64970201253890990.00.26025900244712830.63046300411224370.73128801584243770.0-0.2662949860095978-0.2996309995651245-1.20013999938964841.00.9724739789962769-0.11432900279760361-0.203038007020950320.0-0.044799100607633590.7633640170097351-0.64441400766372680.00.22866700589656830.63577097654342650.73722898960113530.0-0.2356870025396347-0.26565900444984436-1.19586002826690671.00.9637609720230103-0.15707699954509735-0.21561999619007110.0-0.0189111009240150450.7660049796104431-0.64255702495574950.00.26609700918197630.62334901094436650.73527497053146360.0-0.2549220025539398-0.23242099583148956-1.1886899471282961.00.8221949934959412-0.3776470124721527-0.42588400840759280.00.118125997483730320.8451250195503235-0.5213530063629150.00.55681300163269040.37834599614143370.7394679784774780.0-0.51967602968215940.007902019657194614-1.14863002300262451.00.8617600202560425-0.33954399824142456-0.37693598866462710.00.106248997151851650.8473150134086609-0.52035301923751830.00.496066004037857060.40837100148200990.76625800132751460.0-0.43402901291847230.0015098199946805835-1.1690100431442261.00.8747770190238953-0.3211840093135834-0.36277499794960020.00.108980998396873470.8599650263786316-0.49858099222183230.00.472110003232955930.39661198854446410.78728097677230830.0-0.39285400509834290.03789449855685234-1.17518997192382811.00.91636699438095090.072017401456832890.39380899071693420.00.11881099641323090.8904470205307007-0.4393039941787720.0-0.382302999496459960.44935199618339540.8074200153350830.00.51316899061203-0.0907440036535263-1.16830003261566161.00.92836797237396240.0201622005552053450.37111499905586240.00.166196003556251530.8706110119819641-0.46305000782012940.0-0.332432985305786130.49155899882316590.80489701032638550.00.45058199763298035-0.11499100178480148-1.17621004581451421.00.928991973400116-0.079554900527000430.36144900321960450.00.26165801286697390.8318700194358826-0.48941498994827270.0-0.26174300909042360.54923802614212040.79361701011657710.00.401203989982605-0.1690800040960312-1.17639994621276861.015659a9a-f1c1-3e38-8343-2e23e9f65d20bind_shape_matrix0.129504993557930.00.00.00.00.097699806094169620.00.00.00.00.138080000877380370.00.021911798045039177-0.0570470988750457761.83544993400573731.0joint_namesmHeadmNeckmChestmTorsomPelvismFaceEar2RightmFaceEar1RightmFaceRootmFaceEar1LeftmFaceEar2Leftalt_inverse_bind_matrix1.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.075629897415637971.01.18342995643615720.00.00.00.01.197600007057190.00.00.00.01.00.0-0.009507000446319580.00.251107990741729741.01.010100007057190.00.00.00.01.04166996479034420.00.00.00.01.00.0-0.015367999672889710.00.204877004027366641.01.00.00.00.00.01.00.00.00.00.01.00.00.00.00.084072902798652651.01.00.00.00.00.01.00.00.00.00.01.00.00.00.01.0670200586318971.01.00.00.00.00.01.00.00.00.00.01.00.00.0142705999314785-0.0175573993474245070.056489199399948121.01.00.00.00.00.01.00.00.00.00.01.00.00.0041375597938895226-0.047394301742315290.089543297886848451.01.08107995986938480.00.00.00.01.05708003044128420.00.00.00.01.10618996620178220.00.025000000372529030.00.045000001788139341.01.00.00.00.00.01.00.00.00.00.01.00.00.00413755979388952260.047394301742315290.089543297886848451.01.00.00.00.00.01.00.00.00.00.01.00.00.01427059993147850.0175573993474245070.056489199399948121.0pelvis_offset0.0inverse_bind_matrix1.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.00.0267891008406877520.0-1.81913995742797851.01.18342995643615720.00.00.00.01.197600007057190.00.00.00.01.00.00.0293253995478153230.0-1.6070699691772461.01.010100007057190.00.00.00.01.04166996479034420.00.00.00.01.00.00.0155231999233365060.0-1.35596001148223881.01.00.00.00.00.01.00.00.00.00.01.00.00.00.0-1.15109002590179441.01.00.00.00.00.01.00.00.00.00.01.00.00.00.0-1.06701004505157471.01.00.00.00.00.01.00.00.00.00.01.00.0-0.0164429005235433580.062392398715019226-1.86315000057220461.01.00.00.00.00.01.00.00.00.00.01.00.0-0.00217230990529060360.04483500123023987-1.80666005611419681.01.08107995986938480.00.00.00.01.05708003044128420.00.00.00.01.10618996620178220.00.00178911001421511170.0-1.90898001194000241.01.00.00.00.00.01.00.00.00.00.01.00.0-0.0021723099052906036-0.04483500123023987-1.80666005611419681.01.00.00.00.00.01.00.00.00.00.01.00.0-0.016442900523543358-0.062392398715019226-1.86315000057220461.01d5936bc-0501-7376-f70c-06dcfac920edbind_shape_matrix0.048803295940160750.00.00.00.00.0488033369183540340.00.00.00.00.049029946327209470.00.058865547180175780.03438653051853181.75724506378173831.0joint_namesmEyeLeftmHeadmNeckmChestmTorsomPelvismEyeRightalt_inverse_bind_matrix1.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.00.090427502989768980.037174601107835770.080562800168991091.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.075629897415637971.01.18342995643615720.00.00.00.01.197600007057190.00.00.00.01.00.0-0.009507000446319580.00.251107990741729741.01.010100007057190.00.00.00.01.04166996479034420.00.00.00.01.00.0-0.015367999672889710.00.204877004027366641.01.00.00.00.00.01.00.00.00.00.01.00.00.00.00.084072902798652651.01.00.00.00.00.01.00.00.00.00.01.00.00.00.01.0670200586318971.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.00.09042750298976898-0.037174601107835770.080562800168991091.0pelvis_offset0.0inverse_bind_matrix1.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.0-0.06363839656114578-0.03717460110783577-1.89970004558563231.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.00.0267891008406877520.0-1.81913995742797851.01.18342995643615720.00.00.00.01.197600007057190.00.00.00.01.00.00.0293253995478153230.0-1.6070699691772461.01.010100007057190.00.00.00.01.04166996479034420.00.00.00.01.00.00.0155231999233365060.0-1.35596001148223881.01.00.00.00.00.01.00.00.00.00.01.00.00.00.0-1.15109002590179441.01.00.00.00.00.01.00.00.00.00.01.00.00.00.0-1.06701004505157471.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.0-0.063638396561145780.03717460110783577-1.89970004558563231.09174c7f1-bd5f-68d2-2f4f-cc9b36312067bind_shape_matrix0.083263903856277470.00.00.00.00.125166594982147220.00.00.00.00.105179905891418460.00.113597050309181210.01.73993992805480961.0joint_namesmHeadmNeckmChestmTorsomPelvismFaceJawmFaceRootmFaceLipUpperLeftmFaceTeethUppermFaceLipUpperRightmFaceLipCornerLeftmFaceLipCornerRightmFaceLipLowerCentermFaceTeethLowermFaceChinmFaceLipLowerLeftmFaceLipLowerRightmFaceEyeLidUpperLeftmFaceEyeLidUpperRightmFaceEyebrowInnerLeftmFaceEyebrowInnerRightmFaceEyebrowCenterLeftmFaceEyebrowCenterRightmFaceForeheadCentermFaceNoseBridgemFaceNoseBasemFaceEyeLidLowerLeftmFaceEyeLidLowerRightmFaceCheekUpperLeftmFaceCheekUpperRightmFaceLipUpperCenteralt_inverse_bind_matrix1.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.075629897415637971.01.18342995643615720.00.00.00.01.197600007057190.00.00.00.01.00.0-0.009507000446319580.00.251107990741729741.01.010100007057190.00.00.00.01.04166996479034420.00.00.00.01.00.0-0.015367999672889710.00.204877004027366641.01.00.00.00.00.01.00.00.00.00.01.00.00.00.00.084072902798652651.01.00.00.00.00.01.00.00.00.00.01.00.00.00.01.0670200586318971.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.00.0359875001013278960.0-0.0253964997828006741.01.08107995986938480.00.00.00.01.05708003044128420.00.00.00.01.10618996620178220.00.025000000372529030.00.045000001788139341.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.2208299636840820.0-0.0591681003570556640.00.0048508602194488051.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.00.107000999152660370.0-0.0260765999555587771.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.2208299636840820.0-0.0591681003570556640.00.0048508602194488051.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.00.03629549965262413-0.01899999938905239-0.0134859997779130941.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.00.036295499652624130.01899999938905239-0.0134859997779130941.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.0-0.020269699394702910.00.0053312801755964761.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.00.083006501197814940.0-0.0203639995306730271.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.00.083787396550178530.0-0.0266884993761777881.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.00.03427229821681976-0.012062000110745430.00051081198034808041.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.00.034272298216819760.012062000110745430.00051081198034808041.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.00.044901698827743530.0369763001799583440.038352798670530321.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.00.04490169882774353-0.0369763001799583440.038352798670530321.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.00.85106402635574340.00.0181128997355699540.0167341008782386780.057003501802682881.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.00.85106402635574340.00.018112899735569954-0.0167341008782386780.057003501802682881.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.00.85106402635574340.0-0.0082314396277070050.037603501230478290.056274298578500751.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.00.85106402635574340.0-0.008231439627707005-0.037603501230478290.056274298578500751.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.00.073194302618503570.00.087502397596836091.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.00.104399003088474270.00.0171770993620157241.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.00.150499001145362850.00.00385225005447864531.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.00.044901698827743530.0369763001799583440.038352798670530321.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.00.04490169882774353-0.0369763001799583440.038352798670530321.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.00.0291581992059946060.05687420070171356-0.0045324601233005521.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.00.029158199205994606-0.05687420070171356-0.0045324601233005521.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.041350007057190.00.0167011991143226620.00.0097117396071553231.0pelvis_offset0.0inverse_bind_matrix1.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.00.0267891008406877520.0-1.81913995742797851.01.18342995643615720.00.00.00.01.197600007057190.00.00.00.01.00.00.0293253995478153230.0-1.6070699691772461.01.010100007057190.00.00.00.01.04166996479034420.00.00.00.01.00.00.0155231999233365060.0-1.35596001148223881.01.00.00.00.00.01.00.00.00.00.01.00.00.00.0-1.15109002590179441.01.00.00.00.00.01.00.00.00.00.01.00.00.00.0-1.06701004505157471.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.0-0.0341983996331691740.0-1.84081995487213131.01.08107995986938480.00.00.00.01.05708003044128420.00.00.00.01.10618996620178220.00.00178911001421511170.0-1.90898001194000241.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.2208299636840820.0-0.046043299138545990.0-2.08349990844726561.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.0-0.105210997164249420.0-1.8401499986648561.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.2208299636840820.0-0.046043299138545990.0-2.08349990844726561.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.0-0.141506999731063840.01899999938905239-1.82667005062103271.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.0-0.14150699973106384-0.01899999938905239-1.82667005062103271.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.0-0.096935302019119260.0-1.82579004764556881.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.0-0.117205001413822170.0-1.8204499483108521.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.0-0.117986001074314120.0-1.81412994861602781.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.0-0.151476994156837460.01206200011074543-1.8209700584411621.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.0-0.15147699415683746-0.01206200011074543-1.8209700584411621.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.0-0.04311259835958481-0.037815701216459274-1.90312004089355471.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.0-0.043112598359584810.037815701216459274-1.90312004089355471.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.00.85106402635574340.0-0.016323799267411232-0.017114000394940376-1.51254999637603761.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.00.85106402635574340.0-0.0163237992674112320.017114000394940376-1.51254999637603761.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.00.85106402635574340.00.010020599700510502-0.038457199931144714-1.5119899511337281.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.00.85106402635574340.00.0100205997005105020.038457199931144714-1.5119899511337281.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.0-0.071405202150344850.0-1.95114994049072271.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.0-0.102609001100063320.0-1.88242995738983151.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.0-0.14870999753475190.0-1.86940002441406251.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.0-0.04311259835958481-0.037815701216459274-1.90312004089355471.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.0-0.043112598359584810.037815701216459274-1.90312004089355471.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.0-0.027369100600481033-0.058165401220321655-1.86120998859405521.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.0-0.0273691006004810330.058165401220321655-1.86120998859405521.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.041350007057190.0-0.121913000941276550.0-1.78188002109527591.0d73dea3b-b8cb-59ff-c76b-cfdcc8119bb5bind_shape_matrix0.088992610573768620.00.00.00.00.063932202756404880.00.00.00.00.0207600593566894530.00.103547699749469760.01.6937500238418581.0joint_namesmFaceJawmFaceRootmHeadmNeckmChestmTorsomPelvisalt_inverse_bind_matrix1.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.00.0359875001013278960.0-0.0253947004675865171.01.08107995986938480.00.00.00.01.05708003044128420.00.00.00.01.10618996620178220.00.025000000372529030.00.045000001788139341.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.075629897415637971.01.18342995643615720.00.00.00.01.197600007057190.00.00.00.01.00.0-0.009507000446319580.00.251107990741729741.01.010100007057190.00.00.00.01.04166996479034420.00.00.00.01.00.0-0.015367999672889710.00.204877004027366641.01.00.00.00.00.01.00.00.00.00.01.00.00.00.00.084072902798652651.01.00.00.00.00.01.00.00.00.00.01.00.00.00.01.0670200586318971.0pelvis_offset0.0inverse_bind_matrix1.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.0-0.0341983996331691740.0-1.84081995487213131.01.08107995986938480.00.00.00.01.05708003044128420.00.00.00.01.10618996620178220.00.00178911001421511170.0-1.90898001194000241.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.00.0267891008406877520.0-1.81913995742797851.01.18342995643615720.00.00.00.01.197600007057190.00.00.00.01.00.00.0293253995478153230.0-1.6070699691772461.01.010100007057190.00.00.00.01.04166996479034420.00.00.00.01.00.00.0155231999233365060.0-1.35596001148223881.01.00.00.00.00.01.00.00.00.00.01.00.00.00.0-1.15109002590179441.01.00.00.00.00.01.00.00.00.00.01.00.00.00.0-1.06701004505157471.0d0328b82-d9ca-6071-b248-17edfc7612cbbind_shape_matrix0.135498702526092530.00.00.00.00.14647419750690460.00.00.00.00.120779991149902340.00.103381648659706120.01.74884998798370361.0joint_namesmHeadmNeckmChestmTorsomPelvismFaceJawmFaceRootmFaceLipUpperLeftmFaceTeethUppermFaceLipUpperRightmFaceLipCornerLeftmFaceLipCornerRightmFaceLipLowerCentermFaceTeethLowermFaceChinmFaceLipLowerLeftmFaceLipLowerRightmFaceEyeLidUpperLeftmFaceEyeLidUpperRightmFaceEyebrowInnerLeftmFaceEyebrowInnerRightmFaceEyebrowCenterLeftmFaceEyebrowCenterRightmFaceForeheadCentermFaceNoseBridgemFaceNoseBasemFaceEyeLidLowerLeftmFaceEyeLidLowerRightmFaceCheekUpperLeftmFaceCheekUpperRightmFaceLipUpperCenteralt_inverse_bind_matrix1.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.075629897415637971.01.18342995643615720.00.00.00.01.197600007057190.00.00.00.01.00.0-0.009507000446319580.00.251107990741729741.01.010100007057190.00.00.00.01.04166996479034420.00.00.00.01.00.0-0.015367999672889710.00.204877004027366641.01.00.00.00.00.01.00.00.00.00.01.00.00.00.00.084072902798652651.01.00.00.00.00.01.00.00.00.00.01.00.00.00.01.0670200586318971.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.00.0359875001013278960.0-0.0253947004675865171.01.08107995986938480.00.00.00.01.05708003044128420.00.00.00.01.10618996620178220.00.025000000372529030.00.045000001788139341.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.2208299636840820.0-0.0591681003570556640.00.0048508602194488051.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.00.107000999152660370.0-0.026074899360537531.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.2208299636840820.0-0.0591681003570556640.00.0048508602194488051.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.00.03629549965262413-0.01899999938905239-0.0134859997779130941.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.00.036295499652624130.01899999938905239-0.0134859997779130941.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.0-0.020269699394702910.00.0053312801755964761.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.00.083006501197814940.0-0.0203639995306730271.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.00.083787396550178530.0-0.0266884993761777881.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.00.03427229821681976-0.012062000110745430.00051081198034808041.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.00.034272298216819760.012062000110745430.00051081198034808041.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.00.044901698827743530.0369763001799583440.0383545011281967161.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.00.04490169882774353-0.0369763001799583440.0383545011281967161.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.00.85106402635574340.00.0181128997355699540.0167341008782386780.0570053011178970341.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.00.85106402635574340.00.018112899735569954-0.0167341008782386780.0570053011178970341.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.00.85106402635574340.0-0.0082314396277070050.037603501230478290.0562760010361671451.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.00.85106402635574340.0-0.008231439627707005-0.037603501230478290.0562760010361671451.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.00.073194302618503570.00.087503999471664431.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.00.104399003088474270.00.0171787999570369721.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.00.150499001145362850.00.0038539199158549311.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.00.044901698827743530.0369763001799583440.0383545011281967161.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.00.04490169882774353-0.0369763001799583440.0383545011281967161.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.00.0291581992059946060.05687420070171356-0.00453078979626297951.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.00.029158199205994606-0.05687420070171356-0.00453078979626297951.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.041350007057190.00.0167011991143226620.00.0097117396071553231.0pelvis_offset0.0inverse_bind_matrix1.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.00.0267891008406877520.0-1.81913995742797851.01.18342995643615720.00.00.00.01.197600007057190.00.00.00.01.00.00.0293253995478153230.0-1.6070699691772461.01.010100007057190.00.00.00.01.04166996479034420.00.00.00.01.00.00.0155231999233365060.0-1.35596001148223881.01.00.00.00.00.01.00.00.00.00.01.00.00.00.0-1.15109002590179441.01.00.00.00.00.01.00.00.00.00.01.00.00.00.0-1.06701004505157471.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.0-0.0341983996331691740.0-1.84081995487213131.01.08107995986938480.00.00.00.01.05708003044128420.00.00.00.01.10618996620178220.00.00178911001421511170.0-1.90898001194000241.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.2208299636840820.0-0.046043299138545990.0-2.08349990844726561.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.0-0.105210997164249420.0-1.84016001224517821.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.2208299636840820.0-0.046043299138545990.0-2.08349990844726561.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.0-0.141506999731063840.01899999938905239-1.82667005062103271.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.0-0.14150699973106384-0.01899999938905239-1.82667005062103271.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.0-0.096935302019119260.0-1.82579004764556881.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.0-0.117205001413822170.0-1.82045996189117431.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.0-0.117986001074314120.0-1.81412994861602781.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.0-0.151476994156837460.01206200011074543-1.8209700584411621.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.0-0.15147699415683746-0.01206200011074543-1.8209700584411621.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.0-0.04311259835958481-0.037815701216459274-1.90312004089355471.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.0-0.043112598359584810.037815701216459274-1.90312004089355471.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.00.85106402635574340.0-0.016323799267411232-0.017114000394940376-1.51254999637603761.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.00.85106402635574340.0-0.0163237992674112320.017114000394940376-1.51254999637603761.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.00.85106402635574340.00.010020599700510502-0.038457199931144714-1.5119899511337281.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.00.85106402635574340.00.0100205997005105020.038457199931144714-1.5119899511337281.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.0-0.071405202150344850.0-1.9511599540710451.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.0-0.102609001100063320.0-1.88242995738983151.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.0-0.14870999753475190.0-1.86940002441406251.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.0-0.04311259835958481-0.037815701216459274-1.90312004089355471.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.0-0.043112598359584810.037815701216459274-1.90312004089355471.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.0-0.027369100600481033-0.058165401220321655-1.86120998859405521.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.0-0.0273691006004810330.058165401220321655-1.86120998859405521.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.041350007057190.0-0.121913000941276550.0-1.78188002109527591.005bf604d-d1c0-352b-cb2f-c37caca6f542bind_shape_matrix0.0145499994978308680.00.00.00.00.0359961986541748050.00.00.00.00.0196599960327148440.00.13412399590015410.01.69300997257232671.0joint_namesmFaceJawmFaceRootmHeadmNeckmChestmTorsomPelvisalt_inverse_bind_matrix1.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.00.0359875001013278960.0-0.0253947004675865171.01.08107995986938480.00.00.00.01.05708003044128420.00.00.00.01.10618996620178220.00.025000000372529030.00.045000001788139341.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.075629897415637971.01.18342995643615720.00.00.00.01.197600007057190.00.00.00.01.00.0-0.009507000446319580.00.251107990741729741.01.010100007057190.00.00.00.01.04166996479034420.00.00.00.01.00.0-0.015367999672889710.00.204877004027366641.01.00.00.00.00.01.00.00.00.00.01.00.00.00.00.084072902798652651.01.00.00.00.00.01.00.00.00.00.01.00.00.00.01.0670200586318971.0pelvis_offset0.0inverse_bind_matrix1.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.0-0.0341983996331691740.0-1.84081995487213131.01.08107995986938480.00.00.00.01.05708003044128420.00.00.00.01.10618996620178220.00.00178911001421511170.0-1.90898001194000241.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.00.0267891008406877520.0-1.81913995742797851.01.18342995643615720.00.00.00.01.197600007057190.00.00.00.01.00.00.0293253995478153230.0-1.6070699691772461.01.010100007057190.00.00.00.01.04166996479034420.00.00.00.01.00.00.0155231999233365060.0-1.35596001148223881.01.00.00.00.00.01.00.00.00.00.01.00.00.00.0-1.15109002590179441.01.00.00.00.00.01.00.00.00.00.01.00.00.00.0-1.06701004505157471.046ee8fb2-15f0-fa2e-d260-e7e6e8295445bind_shape_matrix0.144471108913421630.00.00.00.00.079346001148223880.00.00.00.00.03420996665954590.00.078120440244674680.01.697255015373231.0joint_namesmFaceJawmFaceRootmHeadmNeckmChestmTorsomPelvisalt_inverse_bind_matrix1.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.00.0359875001013278960.0-0.0253947004675865171.01.08107995986938480.00.00.00.01.05708003044128420.00.00.00.01.10618996620178220.00.025000000372529030.00.045000001788139341.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.075629897415637971.01.18342995643615720.00.00.00.01.197600007057190.00.00.00.01.00.0-0.009507000446319580.00.251107990741729741.01.010100007057190.00.00.00.01.04166996479034420.00.00.00.01.00.0-0.015367999672889710.00.204877004027366641.01.00.00.00.00.01.00.00.00.00.01.00.00.00.00.084072902798652651.01.00.00.00.00.01.00.00.00.00.01.00.00.00.01.0670200586318971.0pelvis_offset0.0inverse_bind_matrix1.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.0-0.0341983996331691740.0-1.84081995487213131.01.08107995986938480.00.00.00.01.05708003044128420.00.00.00.01.10618996620178220.00.00178911001421511170.0-1.90898001194000241.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.00.0267891008406877520.0-1.81913995742797851.01.18342995643615720.00.00.00.01.197600007057190.00.00.00.01.00.00.0293253995478153230.0-1.6070699691772461.01.010100007057190.00.00.00.01.04166996479034420.00.00.00.01.00.00.0155231999233365060.0-1.35596001148223881.01.00.00.00.00.01.00.00.00.00.01.00.00.00.0-1.15109002590179441.01.00.00.00.00.01.00.00.00.00.01.00.00.00.0-1.06701004505157471.0d2205615-2ce0-4ff1-2bfd-bdc77a3825ccbind_shape_matrix0.065835200250148770.00.00.00.00.19282799959182740.00.00.00.00.105929970741271970.00.020774498581886290.01.71460509300231931.0joint_namesmHeadmNeckmChestmTorsomPelvismFaceJawmFaceRootmFaceLipUpperLeftmFaceTeethUppermFaceLipUpperRightmFaceLipCornerLeftmFaceLipCornerRightmFaceLipLowerCentermFaceTeethLowermFaceChinmFaceLipLowerLeftmFaceLipLowerRightmFaceEyeLidUpperLeftmFaceEyeLidUpperRightmFaceEyebrowInnerLeftmFaceEyebrowInnerRightmFaceEyebrowCenterLeftmFaceEyebrowCenterRightmFaceForeheadCentermFaceNoseBridgemFaceNoseBasemFaceEyeLidLowerLeftmFaceEyeLidLowerRightmFaceCheekUpperLeftmFaceCheekUpperRightmFaceLipUpperCenteralt_inverse_bind_matrix1.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.075629897415637971.01.18342995643615720.00.00.00.01.197600007057190.00.00.00.01.00.0-0.009507000446319580.00.251107990741729741.01.010100007057190.00.00.00.01.04166996479034420.00.00.00.01.00.0-0.015367999672889710.00.204877004027366641.01.00.00.00.00.01.00.00.00.00.01.00.00.00.00.084072902798652651.01.00.00.00.00.01.00.00.00.00.01.00.00.00.01.0670200586318971.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.00.0359875001013278960.0-0.0253947004675865171.01.08107995986938480.00.00.00.01.05708003044128420.00.00.00.01.10618996620178220.00.025000000372529030.00.045000001788139341.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.2208299636840820.0-0.0591681003570556640.00.0048508602194488051.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.00.107000999152660370.0-0.026074899360537531.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.2208299636840820.0-0.0591681003570556640.00.0048508602194488051.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.00.03629549965262413-0.01899999938905239-0.0134859997779130941.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.00.036295499652624130.01899999938905239-0.0134859997779130941.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.0-0.020269699394702910.00.0053312801755964761.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.00.083006501197814940.0-0.0203639995306730271.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.00.083787396550178530.0-0.0266884993761777881.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.00.03427229821681976-0.012062000110745430.00051081198034808041.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.00.034272298216819760.012062000110745430.00051081198034808041.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.00.044901698827743530.0369763001799583440.0383545011281967161.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.00.04490169882774353-0.0369763001799583440.0383545011281967161.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.00.85106402635574340.00.0181128997355699540.0167341008782386780.0570053011178970341.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.00.85106402635574340.00.018112899735569954-0.0167341008782386780.0570053011178970341.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.00.85106402635574340.0-0.0082314396277070050.037603501230478290.0562760010361671451.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.00.85106402635574340.0-0.008231439627707005-0.037603501230478290.0562760010361671451.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.00.073194302618503570.00.087503999471664431.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.00.104399003088474270.00.0171787999570369721.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.00.150499001145362850.00.0038539199158549311.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.00.044901698827743530.0369763001799583440.0383545011281967161.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.00.04490169882774353-0.0369763001799583440.0383545011281967161.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.00.0291581992059946060.05687420070171356-0.00453078979626297951.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.00.029158199205994606-0.05687420070171356-0.00453078979626297951.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.041350007057190.00.0167011991143226620.00.0097117396071553231.0pelvis_offset0.0inverse_bind_matrix1.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.00.0267891008406877520.0-1.81913995742797851.01.18342995643615720.00.00.00.01.197600007057190.00.00.00.01.00.00.0293253995478153230.0-1.6070699691772461.01.010100007057190.00.00.00.01.04166996479034420.00.00.00.01.00.00.0155231999233365060.0-1.35596001148223881.01.00.00.00.00.01.00.00.00.00.01.00.00.00.0-1.15109002590179441.01.00.00.00.00.01.00.00.00.00.01.00.00.00.0-1.06701004505157471.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.0-0.0341983996331691740.0-1.84081995487213131.01.08107995986938480.00.00.00.01.05708003044128420.00.00.00.01.10618996620178220.00.00178911001421511170.0-1.90898001194000241.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.2208299636840820.0-0.046043299138545990.0-2.08349990844726561.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.0-0.105210997164249420.0-1.84016001224517821.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.2208299636840820.0-0.046043299138545990.0-2.08349990844726561.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.0-0.141506999731063840.01899999938905239-1.82667005062103271.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.0-0.14150699973106384-0.01899999938905239-1.82667005062103271.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.0-0.096935302019119260.0-1.82579004764556881.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.0-0.117205001413822170.0-1.82045996189117431.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.0-0.117986001074314120.0-1.81412994861602781.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.0-0.151476994156837460.01206200011074543-1.8209700584411621.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.0-0.15147699415683746-0.01206200011074543-1.8209700584411621.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.0-0.04311259835958481-0.037815701216459274-1.90312004089355471.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.0-0.043112598359584810.037815701216459274-1.90312004089355471.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.00.85106402635574340.0-0.016323799267411232-0.017114000394940376-1.51254999637603761.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.00.85106402635574340.0-0.0163237992674112320.017114000394940376-1.51254999637603761.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.00.85106402635574340.00.010020599700510502-0.038457199931144714-1.5119899511337281.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.00.85106402635574340.00.0100205997005105020.038457199931144714-1.5119899511337281.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.0-0.071405202150344850.0-1.9511599540710451.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.0-0.102609001100063320.0-1.88242995738983151.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.0-0.14870999753475190.0-1.86940002441406251.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.0-0.04311259835958481-0.037815701216459274-1.90312004089355471.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.0-0.043112598359584810.037815701216459274-1.90312004089355471.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.0-0.027369100600481033-0.058165401220321655-1.86120998859405521.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.0-0.0273691006004810330.058165401220321655-1.86120998859405521.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.041350007057190.0-0.121913000941276550.0-1.78188002109527591.08665c374-cb61-d418-d412-7f4ea828e119bind_shape_matrix0.66893059015274050.00.00.00.00.171288996934890750.00.00.00.00.19170999526977540.0-0.406830698251724240.01.12604498863220211.0joint_namesmTail1mPelvismTail2mTail3mTail4mTail6mTail5alt_inverse_bind_matrix1.00.00.00.00.01.00.00.00.00.01.00.0-0.165999993681907650.00.067000001668930051.01.00.00.00.00.01.00.00.00.00.01.00.00.00.01.0670200586318971.01.00.00.00.00.01.00.00.00.00.01.00.0-0.147750005125999450.00.01.01.00.00.00.00.01.00.00.00.00.01.00.0-0.126000002026557920.00.01.01.00.00.00.00.01.00.00.00.00.01.00.0-0.106499999761581420.00.01.01.00.00.00.00.01.00.00.00.00.01.00.0-0.070500001311302190.00.01.01.00.00.00.00.01.00.00.00.00.01.00.0-0.083999998867511750.00.01.0pelvis_offset0.0inverse_bind_matrix1.00.00.00.00.01.00.00.00.00.01.00.00.165999993681907650.0-1.13401997089385991.01.00.00.00.00.01.00.00.00.00.01.00.00.00.0-1.0670200586318971.01.00.00.00.00.01.00.00.00.00.01.00.00.31374999880790710.0-1.13401997089385991.01.00.00.00.00.01.00.00.00.00.01.00.00.439749985933303830.0-1.13401997089385991.01.00.00.00.00.01.00.00.00.00.01.00.00.54624998569488530.0-1.13401997089385991.01.00.00.00.00.01.00.00.00.00.01.00.00.70074999332427980.0-1.13401997089385991.01.00.00.00.00.01.00.00.00.00.01.00.00.63024997711181640.0-1.13401997089385991.0e678576a-dc9f-5187-6ed5-5b4aafb65d7bbind_shape_matrix0.0103429928421974180.00.00.00.00.060677599161863330.00.00.00.00.0129300355911254880.00.111756503582000730.01.68668508529663091.0joint_namesmHeadmNeckmChestmTorsomPelvismFaceJawmFaceRootmFaceLipUpperLeftmFaceTeethUppermFaceLipUpperRightmFaceLipCornerLeftmFaceLipCornerRightmFaceLipLowerCentermFaceTeethLowermFaceChinmFaceLipLowerLeftmFaceLipLowerRightmFaceEyeLidUpperLeftmFaceEyeLidUpperRightmFaceEyebrowInnerLeftmFaceEyebrowInnerRightmFaceEyebrowCenterLeftmFaceEyebrowCenterRightmFaceForeheadCentermFaceNoseBridgemFaceNoseBasemFaceEyeLidLowerLeftmFaceEyeLidLowerRightmFaceCheekUpperLeftmFaceCheekUpperRightmFaceLipUpperCenteralt_inverse_bind_matrix1.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.075629897415637971.01.18342995643615720.00.00.00.01.197600007057190.00.00.00.01.00.0-0.009507000446319580.00.251107990741729741.01.010100007057190.00.00.00.01.04166996479034420.00.00.00.01.00.0-0.015367999672889710.00.204877004027366641.01.00.00.00.00.01.00.00.00.00.01.00.00.00.00.084072902798652651.01.00.00.00.00.01.00.00.00.00.01.00.00.00.01.0670200586318971.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.00.0359875001013278960.0-0.0253947004675865171.01.08107995986938480.00.00.00.01.05708003044128420.00.00.00.01.10618996620178220.00.025000000372529030.00.045000001788139341.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.2208299636840820.0-0.0591681003570556640.00.0048508602194488051.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.00.107000999152660370.0-0.026074899360537531.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.2208299636840820.0-0.0591681003570556640.00.0048508602194488051.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.00.03629549965262413-0.01899999938905239-0.0134859997779130941.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.00.036295499652624130.01899999938905239-0.0134859997779130941.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.0-0.020269699394702910.00.0053312801755964761.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.00.083006501197814940.0-0.0203639995306730271.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.00.083787396550178530.0-0.0266884993761777881.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.00.03427229821681976-0.012062000110745430.00051081198034808041.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.00.034272298216819760.012062000110745430.00051081198034808041.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.00.044901698827743530.0369763001799583440.0383545011281967161.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.00.04490169882774353-0.0369763001799583440.0383545011281967161.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.00.85106402635574340.00.0181128997355699540.0167341008782386780.0570053011178970341.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.00.85106402635574340.00.018112899735569954-0.0167341008782386780.0570053011178970341.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.00.85106402635574340.0-0.0082314396277070050.037603501230478290.0562760010361671451.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.00.85106402635574340.0-0.008231439627707005-0.037603501230478290.0562760010361671451.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.00.073194302618503570.00.087503999471664431.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.00.104399003088474270.00.0171787999570369721.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.00.150499001145362850.00.0038539199158549311.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.00.044901698827743530.0369763001799583440.0383545011281967161.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.00.04490169882774353-0.0369763001799583440.0383545011281967161.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.00.0291581992059946060.05687420070171356-0.00453078979626297951.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.00.029158199205994606-0.05687420070171356-0.00453078979626297951.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.041350007057190.00.0167011991143226620.00.0097117396071553231.0pelvis_offset0.0inverse_bind_matrix1.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.00.0267891008406877520.0-1.81913995742797851.01.18342995643615720.00.00.00.01.197600007057190.00.00.00.01.00.00.0293253995478153230.0-1.6070699691772461.01.010100007057190.00.00.00.01.04166996479034420.00.00.00.01.00.00.0155231999233365060.0-1.35596001148223881.01.00.00.00.00.01.00.00.00.00.01.00.00.00.0-1.15109002590179441.01.00.00.00.00.01.00.00.00.00.01.00.00.00.0-1.06701004505157471.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.0-0.0341983996331691740.0-1.84081995487213131.01.08107995986938480.00.00.00.01.05708003044128420.00.00.00.01.10618996620178220.00.00178911001421511170.0-1.90898001194000241.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.2208299636840820.0-0.046043299138545990.0-2.08349990844726561.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.0-0.105210997164249420.0-1.84016001224517821.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.2208299636840820.0-0.046043299138545990.0-2.08349990844726561.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.0-0.141506999731063840.01899999938905239-1.82667005062103271.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.0-0.14150699973106384-0.01899999938905239-1.82667005062103271.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.0-0.096935302019119260.0-1.82579004764556881.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.0-0.117205001413822170.0-1.82045996189117431.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.0-0.117986001074314120.0-1.81412994861602781.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.0-0.151476994156837460.01206200011074543-1.8209700584411621.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.0-0.15147699415683746-0.01206200011074543-1.8209700584411621.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.0-0.04311259835958481-0.037815701216459274-1.90312004089355471.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.0-0.043112598359584810.037815701216459274-1.90312004089355471.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.00.85106402635574340.0-0.016323799267411232-0.017114000394940376-1.51254999637603761.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.00.85106402635574340.0-0.0163237992674112320.017114000394940376-1.51254999637603761.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.00.85106402635574340.00.010020599700510502-0.038457199931144714-1.5119899511337281.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.00.85106402635574340.00.0100205997005105020.038457199931144714-1.5119899511337281.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.0-0.071405202150344850.0-1.9511599540710451.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.0-0.102609001100063320.0-1.88242995738983151.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.0-0.14870999753475190.0-1.86940002441406251.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.0-0.04311259835958481-0.037815701216459274-1.90312004089355471.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.0-0.043112598359584810.037815701216459274-1.90312004089355471.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.0-0.027369100600481033-0.058165401220321655-1.86120998859405521.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.0-0.0273691006004810330.058165401220321655-1.86120998859405521.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.041350007057190.0-0.121913000941276550.0-1.78188002109527591.08d23b8c8-fadf-c1b3-0b04-a3ecea292576bind_shape_matrix0.129504993557930.00.00.00.00.097699806094169620.00.00.00.00.138080000877380370.00.0219117980450391770.0570470988750457761.83544993400573731.0joint_namesmHeadmNeckmChestmTorsomPelvismFaceEar2RightmFaceEar1RightmFaceRootmFaceEar1LeftmFaceEar2Leftalt_inverse_bind_matrix1.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.075629897415637971.01.18342995643615720.00.00.00.01.197600007057190.00.00.00.01.00.0-0.009507000446319580.00.251107990741729741.01.010100007057190.00.00.00.01.04166996479034420.00.00.00.01.00.0-0.015367999672889710.00.204877004027366641.01.00.00.00.00.01.00.00.00.00.01.00.00.00.00.084072902798652651.01.00.00.00.00.01.00.00.00.00.01.00.00.00.01.0670200586318971.01.00.00.00.00.01.00.00.00.00.01.00.00.0142705999314785-0.0175573993474245070.056489199399948121.01.00.00.00.00.01.00.00.00.00.01.00.00.0041375597938895226-0.047394301742315290.089543297886848451.01.08107995986938480.00.00.00.01.05708003044128420.00.00.00.01.10618996620178220.00.025000000372529030.00.045000001788139341.01.00.00.00.00.01.00.00.00.00.01.00.00.00413755979388952260.047394301742315290.089543297886848451.01.00.00.00.00.01.00.00.00.00.01.00.00.01427059993147850.0175573993474245070.056489199399948121.0pelvis_offset0.0inverse_bind_matrix1.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.00.0267891008406877520.0-1.81913995742797851.01.18342995643615720.00.00.00.01.197600007057190.00.00.00.01.00.00.0293253995478153230.0-1.6070699691772461.01.010100007057190.00.00.00.01.04166996479034420.00.00.00.01.00.00.0155231999233365060.0-1.35596001148223881.01.00.00.00.00.01.00.00.00.00.01.00.00.00.0-1.15109002590179441.01.00.00.00.00.01.00.00.00.00.01.00.00.00.0-1.06701004505157471.01.00.00.00.00.01.00.00.00.00.01.00.0-0.0164429005235433580.062392398715019226-1.86315000057220461.01.00.00.00.00.01.00.00.00.00.01.00.0-0.00217230990529060360.04483500123023987-1.80666005611419681.01.08107995986938480.00.00.00.01.05708003044128420.00.00.00.01.10618996620178220.00.00178911001421511170.0-1.90898001194000241.01.00.00.00.00.01.00.00.00.00.01.00.0-0.0021723099052906036-0.04483500123023987-1.80666005611419681.01.00.00.00.00.01.00.00.00.00.01.00.0-0.016442900523543358-0.062392398715019226-1.86315000057220461.02a30e7ec-9840-f495-daa1-2b8d0d025a78bind_shape_matrix0.064477898180484770.00.00.00.00.069889500737190250.00.00.00.00.105170004069805150.00.0064538493752479550.078819252550601961.84524500370025631.0joint_namesmHeadmNeckmChestmTorsomPelvismFaceEar2RightmFaceEar1RightmFaceRootmFaceEar1LeftmFaceEar2Leftalt_inverse_bind_matrix1.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.075629897415637971.01.18342995643615720.00.00.00.01.197600007057190.00.00.00.01.00.0-0.009507000446319580.00.251107990741729741.01.010100007057190.00.00.00.01.04166996479034420.00.00.00.01.00.0-0.015367999672889710.00.204877004027366641.01.00.00.00.00.01.00.00.00.00.01.00.00.00.00.084072902798652651.01.00.00.00.00.01.00.00.00.00.01.00.00.00.01.0670200586318971.01.00.00.00.00.01.00.00.00.00.01.00.00.0142705999314785-0.0175573993474245070.056489199399948121.01.00.00.00.00.01.00.00.00.00.01.00.00.0041375597938895226-0.047394301742315290.089543297886848451.01.08107995986938480.00.00.00.01.05708003044128420.00.00.00.01.10618996620178220.00.025000000372529030.00.045000001788139341.01.00.00.00.00.01.00.00.00.00.01.00.00.00413755979388952260.047394301742315290.089543297886848451.01.00.00.00.00.01.00.00.00.00.01.00.00.01427059993147850.0175573993474245070.056489199399948121.0pelvis_offset0.0inverse_bind_matrix1.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.00.0267891008406877520.0-1.81913995742797851.01.18342995643615720.00.00.00.01.197600007057190.00.00.00.01.00.00.0293253995478153230.0-1.6070699691772461.01.010100007057190.00.00.00.01.04166996479034420.00.00.00.01.00.00.0155231999233365060.0-1.35596001148223881.01.00.00.00.00.01.00.00.00.00.01.00.00.00.0-1.15109002590179441.01.00.00.00.00.01.00.00.00.00.01.00.00.00.0-1.06701004505157471.01.00.00.00.00.01.00.00.00.00.01.00.0-0.0164429005235433580.062392398715019226-1.86315000057220461.01.00.00.00.00.01.00.00.00.00.01.00.0-0.00217230990529060360.04483500123023987-1.80666005611419681.01.08107995986938480.00.00.00.01.05708003044128420.00.00.00.01.10618996620178220.00.00178911001421511170.0-1.90898001194000241.01.00.00.00.00.01.00.00.00.00.01.00.0-0.0021723099052906036-0.04483500123023987-1.80666005611419681.01.00.00.00.00.01.00.00.00.00.01.00.0-0.016442900523543358-0.062392398715019226-1.86315000057220461.03bd8d73d-be6f-8de2-39ae-1f680189bc27bind_shape_matrix0.064477898180484770.00.00.00.00.069889500737190250.00.00.00.00.105170004069805150.00.006453849375247955-0.078819252550601961.84524500370025631.0joint_namesmHeadmNeckmChestmTorsomPelvismFaceEar2RightmFaceEar1RightmFaceRootmFaceEar1LeftmFaceEar2Leftalt_inverse_bind_matrix1.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.075629897415637971.01.18342995643615720.00.00.00.01.197600007057190.00.00.00.01.00.0-0.009507000446319580.00.251107990741729741.01.010100007057190.00.00.00.01.04166996479034420.00.00.00.01.00.0-0.015367999672889710.00.204877004027366641.01.00.00.00.00.01.00.00.00.00.01.00.00.00.00.084072902798652651.01.00.00.00.00.01.00.00.00.00.01.00.00.00.01.0670200586318971.01.00.00.00.00.01.00.00.00.00.01.00.00.0142705999314785-0.0175573993474245070.056489199399948121.01.00.00.00.00.01.00.00.00.00.01.00.00.0041375597938895226-0.047394301742315290.089543297886848451.01.08107995986938480.00.00.00.01.05708003044128420.00.00.00.01.10618996620178220.00.025000000372529030.00.045000001788139341.01.00.00.00.00.01.00.00.00.00.01.00.00.00413755979388952260.047394301742315290.089543297886848451.01.00.00.00.00.01.00.00.00.00.01.00.00.01427059993147850.0175573993474245070.056489199399948121.0pelvis_offset0.0inverse_bind_matrix1.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.00.0267891008406877520.0-1.81913995742797851.01.18342995643615720.00.00.00.01.197600007057190.00.00.00.01.00.00.0293253995478153230.0-1.6070699691772461.01.010100007057190.00.00.00.01.04166996479034420.00.00.00.01.00.00.0155231999233365060.0-1.35596001148223881.01.00.00.00.00.01.00.00.00.00.01.00.00.00.0-1.15109002590179441.01.00.00.00.00.01.00.00.00.00.01.00.00.00.0-1.06701004505157471.01.00.00.00.00.01.00.00.00.00.01.00.0-0.0164429005235433580.062392398715019226-1.86315000057220461.01.00.00.00.00.01.00.00.00.00.01.00.0-0.00217230990529060360.04483500123023987-1.80666005611419681.01.08107995986938480.00.00.00.01.05708003044128420.00.00.00.01.10618996620178220.00.00178911001421511170.0-1.90898001194000241.01.00.00.00.00.01.00.00.00.00.01.00.0-0.0021723099052906036-0.04483500123023987-1.80666005611419681.01.00.00.00.00.01.00.00.00.00.01.00.0-0.016442900523543358-0.062392398715019226-1.86315000057220461.034db2e33-e79f-ea57-14af-c1ce9cbc63ffbind_shape_matrix0.037142097949981690.00.00.00.00.146102800965309140.00.00.00.00.032979965209960940.00.079298749566078190.01.75784003734588621.0joint_namesmHeadmNeckmChestmTorsomPelvismFaceJawmFaceRootmFaceLipUpperLeftmFaceTeethUppermFaceLipUpperRightmFaceLipCornerLeftmFaceLipCornerRightmFaceLipLowerCentermFaceTeethLowermFaceChinmFaceLipLowerLeftmFaceLipLowerRightmFaceEyeLidUpperLeftmFaceEyeLidUpperRightmFaceEyebrowInnerLeftmFaceEyebrowInnerRightmFaceEyebrowCenterLeftmFaceEyebrowCenterRightmFaceForeheadCentermFaceNoseBridgemFaceNoseBasemFaceEyeLidLowerLeftmFaceEyeLidLowerRightmFaceCheekUpperLeftmFaceCheekUpperRightmFaceLipUpperCenteralt_inverse_bind_matrix1.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.075629897415637971.01.18342995643615720.00.00.00.01.197600007057190.00.00.00.01.00.0-0.009507000446319580.00.251107990741729741.01.010100007057190.00.00.00.01.04166996479034420.00.00.00.01.00.0-0.015367999672889710.00.204877004027366641.01.00.00.00.00.01.00.00.00.00.01.00.00.00.00.084072902798652651.01.00.00.00.00.01.00.00.00.00.01.00.00.00.01.0670200586318971.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.00.0359875001013278960.0-0.0253947004675865171.01.08107995986938480.00.00.00.01.05708003044128420.00.00.00.01.10618996620178220.00.025000000372529030.00.045000001788139341.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.2208299636840820.0-0.0591681003570556640.00.0048508602194488051.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.00.107000999152660370.0-0.026074899360537531.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.2208299636840820.0-0.0591681003570556640.00.0048508602194488051.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.00.03629549965262413-0.01899999938905239-0.0134859997779130941.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.00.036295499652624130.01899999938905239-0.0134859997779130941.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.0-0.020269699394702910.00.0053312801755964761.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.00.083006501197814940.0-0.0203639995306730271.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.00.083787396550178530.0-0.0266884993761777881.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.00.03427229821681976-0.012062000110745430.00051081198034808041.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.00.034272298216819760.012062000110745430.00051081198034808041.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.00.044901698827743530.0369763001799583440.0383545011281967161.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.00.04490169882774353-0.0369763001799583440.0383545011281967161.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.00.85106402635574340.00.0181128997355699540.0167341008782386780.0570053011178970341.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.00.85106402635574340.00.018112899735569954-0.0167341008782386780.0570053011178970341.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.00.85106402635574340.0-0.0082314396277070050.037603501230478290.0562760010361671451.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.00.85106402635574340.0-0.008231439627707005-0.037603501230478290.0562760010361671451.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.00.073194302618503570.00.087503999471664431.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.00.104399003088474270.00.0171787999570369721.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.00.150499001145362850.00.0038539199158549311.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.00.044901698827743530.0369763001799583440.0383545011281967161.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.00.04490169882774353-0.0369763001799583440.0383545011281967161.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.00.0291581992059946060.05687420070171356-0.00453078979626297951.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.00.029158199205994606-0.05687420070171356-0.00453078979626297951.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.041350007057190.00.0167011991143226620.00.0097117396071553231.0pelvis_offset0.0inverse_bind_matrix1.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.00.0267891008406877520.0-1.81913995742797851.01.18342995643615720.00.00.00.01.197600007057190.00.00.00.01.00.00.0293253995478153230.0-1.6070699691772461.01.010100007057190.00.00.00.01.04166996479034420.00.00.00.01.00.00.0155231999233365060.0-1.35596001148223881.01.00.00.00.00.01.00.00.00.00.01.00.00.00.0-1.15109002590179441.01.00.00.00.00.01.00.00.00.00.01.00.00.00.0-1.06701004505157471.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.0-0.0341983996331691740.0-1.84081995487213131.01.08107995986938480.00.00.00.01.05708003044128420.00.00.00.01.10618996620178220.00.00178911001421511170.0-1.90898001194000241.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.2208299636840820.0-0.046043299138545990.0-2.08349990844726561.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.0-0.105210997164249420.0-1.84016001224517821.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.2208299636840820.0-0.046043299138545990.0-2.08349990844726561.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.0-0.141506999731063840.01899999938905239-1.82667005062103271.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.0-0.14150699973106384-0.01899999938905239-1.82667005062103271.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.0-0.096935302019119260.0-1.82579004764556881.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.0-0.117205001413822170.0-1.82045996189117431.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.0-0.117986001074314120.0-1.81412994861602781.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.0-0.151476994156837460.01206200011074543-1.8209700584411621.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.0-0.15147699415683746-0.01206200011074543-1.8209700584411621.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.0-0.04311259835958481-0.037815701216459274-1.90312004089355471.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.0-0.043112598359584810.037815701216459274-1.90312004089355471.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.00.85106402635574340.0-0.016323799267411232-0.017114000394940376-1.51254999637603761.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.00.85106402635574340.0-0.0163237992674112320.017114000394940376-1.51254999637603761.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.00.85106402635574340.00.010020599700510502-0.038457199931144714-1.5119899511337281.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.00.85106402635574340.00.0100205997005105020.038457199931144714-1.5119899511337281.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.0-0.071405202150344850.0-1.9511599540710451.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.0-0.102609001100063320.0-1.88242995738983151.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.0-0.14870999753475190.0-1.86940002441406251.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.0-0.04311259835958481-0.037815701216459274-1.90312004089355471.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.0-0.043112598359584810.037815701216459274-1.90312004089355471.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.0-0.027369100600481033-0.058165401220321655-1.86120998859405521.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.08107995986938480.0-0.0273691006004810330.058165401220321655-1.86120998859405521.01.08107995986938480.00.00.00.01.08107995986938480.00.00.00.01.041350007057190.0-0.121913000941276550.0-1.78188002109527591.0 \ No newline at end of file diff --git a/indra/llappearanceutility/tests/joint-offsets.xml.output b/indra/llappearanceutility/tests/joint-offsets.xml.output new file mode 100644 index 0000000000..d0f94b8f11 --- /dev/null +++ b/indra/llappearanceutility/tests/joint-offsets.xml.output @@ -0,0 +1 @@ +skindata05bf604d-d1c0-352b-cb2f-c37caca6f542joint_namesmFaceJawmFaceRootmHeadmNeckmChestmTorsomPelvisjoint_offset0.035987500101327896118164060-0.025394700467586517333984380.0250000003725290298461914100.04500000178813934326171875000.07562989741563796997070312-0.00950700044631958007812500.251107990741729736328125-0.0153679996728897094726562500.2048770040273666381835938000.08407290279865264892578125001.06702005863189697265625pelvis_offset015659a9a-f1c1-3e38-8343-2e23e9f65d20joint_namesmHeadmNeckmChestmTorsomPelvismFaceEar2RightmFaceEar1RightmFaceRootmFaceEar1LeftmFaceEar2Leftjoint_offset000.07562989741563796997070312-0.00950700044631958007812500.251107990741729736328125-0.0153679996728897094726562500.2048770040273666381835938000.08407290279865264892578125001.067020058631896972656250.01427059993147850036621094-0.017557399347424507141113280.05648919939994812011718750.004137559793889522552490234-0.047394301742315292358398440.089543297886848449707031250.0250000003725290298461914100.045000001788139343261718750.0041375597938895225524902340.047394301742315292358398440.089543297886848449707031250.014270599931478500366210940.017557399347424507141113280.0564891993999481201171875pelvis_offset01d5936bc-0501-7376-f70c-06dcfac920edjoint_namesmEyeLeftmHeadmNeckmChestmTorsomPelvismEyeRightjoint_offset0.090427502989768981933593750.037174601107835769653320310.0805628001689910888671875000.07562989741563796997070312-0.00950700044631958007812500.251107990741729736328125-0.0153679996728897094726562500.2048770040273666381835938000.08407290279865264892578125001.067020058631896972656250.09042750298976898193359375-0.037174601107835769653320310.0805628001689910888671875pelvis_offset02a30e7ec-9840-f495-daa1-2b8d0d025a78joint_namesmHeadmNeckmChestmTorsomPelvismFaceEar2RightmFaceEar1RightmFaceRootmFaceEar1LeftmFaceEar2Leftjoint_offset000.07562989741563796997070312-0.00950700044631958007812500.251107990741729736328125-0.0153679996728897094726562500.2048770040273666381835938000.08407290279865264892578125001.067020058631896972656250.01427059993147850036621094-0.017557399347424507141113280.05648919939994812011718750.004137559793889522552490234-0.047394301742315292358398440.089543297886848449707031250.0250000003725290298461914100.045000001788139343261718750.0041375597938895225524902340.047394301742315292358398440.089543297886848449707031250.014270599931478500366210940.017557399347424507141113280.0564891993999481201171875pelvis_offset034db2e33-e79f-ea57-14af-c1ce9cbc63ffjoint_namesmHeadmNeckmChestmTorsomPelvismFaceJawmFaceRootmFaceLipUpperLeftmFaceTeethUppermFaceLipUpperRightmFaceLipCornerLeftmFaceLipCornerRightmFaceLipLowerCentermFaceTeethLowermFaceChinmFaceLipLowerLeftmFaceLipLowerRightmFaceEyeLidUpperLeftmFaceEyeLidUpperRightmFaceEyebrowInnerLeftmFaceEyebrowInnerRightmFaceEyebrowCenterLeftmFaceEyebrowCenterRightmFaceForeheadCentermFaceNoseBridgemFaceNoseBasemFaceEyeLidLowerLeftmFaceEyeLidLowerRightmFaceCheekUpperLeftmFaceCheekUpperRightmFaceLipUpperCenterjoint_offset000.07562989741563796997070312-0.00950700044631958007812500.251107990741729736328125-0.0153679996728897094726562500.2048770040273666381835938000.08407290279865264892578125001.067020058631896972656250.035987500101327896118164060-0.025394700467586517333984380.0250000003725290298461914100.04500000178813934326171875-0.059168100357055664062500.004850860219448804855346680.10700099915266036987304690-0.02607489936053752899169922-0.059168100357055664062500.004850860219448804855346680.03629549965262413024902344-0.01899999938905239105224609-0.013485999777913093566894530.036295499652624130249023440.01899999938905239105224609-0.01348599977791309356689453-0.0202696993947029113769531200.0053312801755964756011962890.083006501197814941406250-0.020363999530673027038574220.083787396550178527832031250-0.026688499376177787780761720.03427229821681976318359375-0.012062000110745429992675780.00051081198034808039665222170.034272298216819763183593750.012062000110745429992675780.00051081198034808039665222170.04490169882774353027343750.036976300179958343505859380.038354501128196716308593750.0449016988277435302734375-0.036976300179958343505859380.038354501128196716308593750.018112899735569953918457030.016734100878238677978515620.057005301117897033691406250.01811289973556995391845703-0.016734100878238677978515620.05700530111789703369140625-0.0082314396277070045471191410.037603501230478286743164060.05627600103616714477539062-0.008231439627707004547119141-0.037603501230478286743164060.056276001036167144775390620.0731943026185035705566406200.08750399947166442871093750.104399003088474273681640600.017178799957036972045898440.150499001145362854003906200.0038539199158549308776855470.04490169882774353027343750.036976300179958343505859380.038354501128196716308593750.0449016988277435302734375-0.036976300179958343505859380.038354501128196716308593750.029158199205994606018066410.05687420070171356201171875-0.0045307897962629795074462890.02915819920599460601806641-0.05687420070171356201171875-0.0045307897962629795074462890.0167011991143226623535156200.009711739607155323028564453pelvis_offset03bd8d73d-be6f-8de2-39ae-1f680189bc27joint_namesmHeadmNeckmChestmTorsomPelvismFaceEar2RightmFaceEar1RightmFaceRootmFaceEar1LeftmFaceEar2Leftjoint_offset000.07562989741563796997070312-0.00950700044631958007812500.251107990741729736328125-0.0153679996728897094726562500.2048770040273666381835938000.08407290279865264892578125001.067020058631896972656250.01427059993147850036621094-0.017557399347424507141113280.05648919939994812011718750.004137559793889522552490234-0.047394301742315292358398440.089543297886848449707031250.0250000003725290298461914100.045000001788139343261718750.0041375597938895225524902340.047394301742315292358398440.089543297886848449707031250.014270599931478500366210940.017557399347424507141113280.0564891993999481201171875pelvis_offset046ee8fb2-15f0-fa2e-d260-e7e6e8295445joint_namesmFaceJawmFaceRootmHeadmNeckmChestmTorsomPelvisjoint_offset0.035987500101327896118164060-0.025394700467586517333984380.0250000003725290298461914100.04500000178813934326171875000.07562989741563796997070312-0.00950700044631958007812500.251107990741729736328125-0.0153679996728897094726562500.2048770040273666381835938000.08407290279865264892578125001.06702005863189697265625pelvis_offset0547d8392-9f19-35fb-3508-121eea388f0ajoint_namesmFaceJawmFaceRootmHeadmNeckmChestmTorsomPelvismFaceTongueBasemFaceTeethLowermFaceTongueTipjoint_offset0.035987500101327896118164060-0.025394700467586517333984380.0250000003725290298461914100.04500000178813934326171875000.07562989741563796997070312-0.00950700044631958007812500.251107990741729736328125-0.0153679996728897094726562500.2048770040273666381835938000.08407290279865264892578125001.06702005863189697265625-0.0298503991216421127319335900.0078316899016499519348144530.083006501197814941406250-0.020363999530673027038574220.03891620039939880371093750-0.002775429980829358100891113pelvis_offset07e7a6834-8b41-4029-8f87-ce57b7d05beejoint_namesmHeadmNeckmChestmTorsomPelvismFaceJawmFaceRootmFaceLipUpperLeftmFaceTeethUppermFaceLipUpperRightmFaceLipCornerLeftmFaceLipCornerRightmFaceLipLowerCentermFaceTeethLowermFaceChinmFaceLipLowerLeftmFaceLipLowerRightmFaceEyeLidUpperLeftmFaceEyeLidUpperRightmFaceEyebrowInnerLeftmFaceEyebrowInnerRightmFaceEyebrowCenterLeftmFaceEyebrowCenterRightmFaceForeheadCentermFaceNoseBridgemFaceNoseBasemFaceEyeLidLowerLeftmFaceEyeLidLowerRightmFaceCheekUpperLeftmFaceCheekUpperRightmFaceLipUpperCenterjoint_offset000.07562989741563796997070312-0.00950700044631958007812500.251107990741729736328125-0.0153679996728897094726562500.2048770040273666381835938000.08407290279865264892578125001.067020058631896972656250.035987500101327896118164060-0.025394700467586517333984380.0250000003725290298461914100.04500000178813934326171875-0.059168100357055664062500.004850860219448804855346680.10700099915266036987304690-0.02607489936053752899169922-0.059168100357055664062500.004850860219448804855346680.03629549965262413024902344-0.01899999938905239105224609-0.013485999777913093566894530.036295499652624130249023440.01899999938905239105224609-0.01348599977791309356689453-0.0202696993947029113769531200.0053312801755964756011962890.083006501197814941406250-0.020363999530673027038574220.083787396550178527832031250-0.026688499376177787780761720.03427229821681976318359375-0.012062000110745429992675780.00051081198034808039665222170.034272298216819763183593750.012062000110745429992675780.00051081198034808039665222170.04490169882774353027343750.036976300179958343505859380.038354501128196716308593750.0449016988277435302734375-0.036976300179958343505859380.038354501128196716308593750.018112899735569953918457030.016734100878238677978515620.057005301117897033691406250.01811289973556995391845703-0.016734100878238677978515620.05700530111789703369140625-0.0082314396277070045471191410.037603501230478286743164060.05627600103616714477539062-0.008231439627707004547119141-0.037603501230478286743164060.056276001036167144775390620.0731943026185035705566406200.08750399947166442871093750.104399003088474273681640600.017178799957036972045898440.150499001145362854003906200.0038539199158549308776855470.04490169882774353027343750.036976300179958343505859380.038354501128196716308593750.0449016988277435302734375-0.036976300179958343505859380.038354501128196716308593750.029158199205994606018066410.05687420070171356201171875-0.0045307897962629795074462890.02915819920599460601806641-0.05687420070171356201171875-0.0045307897962629795074462890.0167011991143226623535156200.009711739607155323028564453pelvis_offset08665c374-cb61-d418-d412-7f4ea828e119joint_namesmTail1mPelvismTail2mTail3mTail4mTail6mTail5joint_offset-0.165999993681907653808593800.0670000016689300537109375001.06702005863189697265625-0.147750005125999450683593800-0.126000002026557922363281200-0.106499999761581420898437500-0.0705000013113021850585937500-0.0839999988675117492675781200pelvis_offset08d23b8c8-fadf-c1b3-0b04-a3ecea292576joint_namesmHeadmNeckmChestmTorsomPelvismFaceEar2RightmFaceEar1RightmFaceRootmFaceEar1LeftmFaceEar2Leftjoint_offset000.07562989741563796997070312-0.00950700044631958007812500.251107990741729736328125-0.0153679996728897094726562500.2048770040273666381835938000.08407290279865264892578125001.067020058631896972656250.01427059993147850036621094-0.017557399347424507141113280.05648919939994812011718750.004137559793889522552490234-0.047394301742315292358398440.089543297886848449707031250.0250000003725290298461914100.045000001788139343261718750.0041375597938895225524902340.047394301742315292358398440.089543297886848449707031250.014270599931478500366210940.017557399347424507141113280.0564891993999481201171875pelvis_offset09174c7f1-bd5f-68d2-2f4f-cc9b36312067joint_namesmHeadmNeckmChestmTorsomPelvismFaceJawmFaceRootmFaceLipUpperLeftmFaceTeethUppermFaceLipUpperRightmFaceLipCornerLeftmFaceLipCornerRightmFaceLipLowerCentermFaceTeethLowermFaceChinmFaceLipLowerLeftmFaceLipLowerRightmFaceEyeLidUpperLeftmFaceEyeLidUpperRightmFaceEyebrowInnerLeftmFaceEyebrowInnerRightmFaceEyebrowCenterLeftmFaceEyebrowCenterRightmFaceForeheadCentermFaceNoseBridgemFaceNoseBasemFaceEyeLidLowerLeftmFaceEyeLidLowerRightmFaceCheekUpperLeftmFaceCheekUpperRightmFaceLipUpperCenterjoint_offset000.07562989741563796997070312-0.00950700044631958007812500.251107990741729736328125-0.0153679996728897094726562500.2048770040273666381835938000.08407290279865264892578125001.067020058631896972656250.035987500101327896118164060-0.025396499782800674438476560.0250000003725290298461914100.04500000178813934326171875-0.059168100357055664062500.004850860219448804855346680.10700099915266036987304690-0.02607659995555877685546875-0.059168100357055664062500.004850860219448804855346680.03629549965262413024902344-0.01899999938905239105224609-0.013485999777913093566894530.036295499652624130249023440.01899999938905239105224609-0.01348599977791309356689453-0.0202696993947029113769531200.0053312801755964756011962890.083006501197814941406250-0.020363999530673027038574220.083787396550178527832031250-0.026688499376177787780761720.03427229821681976318359375-0.012062000110745429992675780.00051081198034808039665222170.034272298216819763183593750.012062000110745429992675780.00051081198034808039665222170.04490169882774353027343750.036976300179958343505859380.038352798670530319213867190.0449016988277435302734375-0.036976300179958343505859380.038352798670530319213867190.018112899735569953918457030.016734100878238677978515620.057003501802682876586914060.01811289973556995391845703-0.016734100878238677978515620.05700350180268287658691406-0.0082314396277070045471191410.037603501230478286743164060.05627429857850074768066406-0.008231439627707004547119141-0.037603501230478286743164060.056274298578500747680664060.0731943026185035705566406200.087502397596836090087890620.104399003088474273681640600.017177099362015724182128910.150499001145362854003906200.0038522500544786453247070310.04490169882774353027343750.036976300179958343505859380.038352798670530319213867190.0449016988277435302734375-0.036976300179958343505859380.038352798670530319213867190.029158199205994606018066410.05687420070171356201171875-0.0045324601233005523681640620.02915819920599460601806641-0.05687420070171356201171875-0.0045324601233005523681640620.0167011991143226623535156200.009711739607155323028564453pelvis_offset092a7dd5c-bc30-9952-3b3b-e6cc10336cbejoint_namesmEyeLeftmHeadmNeckmChestmTorsomPelvismEyeRightjoint_offset0.090427502989768981933593750.037174601107835769653320310.0805628001689910888671875000.07562989741563796997070312-0.00950700044631958007812500.251107990741729736328125-0.0153679996728897094726562500.2048770040273666381835938000.08407290279865264892578125001.067020058631896972656250.09042750298976898193359375-0.037174601107835769653320310.0805628001689910888671875pelvis_offset0971cf873-afce-8b69-44d6-3f5879cb94c2joint_namesmHeadmNeckmChestmTorsomPelvismFaceJawmFaceRootmFaceLipUpperLeftmFaceTeethUppermFaceLipUpperRightmFaceLipCornerLeftmFaceLipCornerRightmFaceLipLowerCentermFaceTeethLowermFaceChinmFaceLipLowerLeftmFaceLipLowerRightmFaceEyeLidUpperLeftmFaceEyeLidUpperRightmFaceEyebrowInnerLeftmFaceEyebrowInnerRightmFaceEyebrowCenterLeftmFaceEyebrowCenterRightmFaceForeheadCentermFaceNoseBridgemFaceNoseBasemFaceEyeLidLowerLeftmFaceEyeLidLowerRightmFaceCheekUpperLeftmFaceCheekUpperRightmFaceLipUpperCenterjoint_offset000.07562989741563796997070312-0.00950700044631958007812500.251107990741729736328125-0.0153679996728897094726562500.2048770040273666381835938000.08407290279865264892578125001.067020058631896972656250.035987500101327896118164060-0.025394700467586517333984380.0250000003725290298461914100.04500000178813934326171875-0.059168100357055664062500.004850860219448804855346680.10700099915266036987304690-0.02607489936053752899169922-0.059168100357055664062500.004850860219448804855346680.03629549965262413024902344-0.01899999938905239105224609-0.013485999777913093566894530.036295499652624130249023440.01899999938905239105224609-0.01348599977791309356689453-0.0202696993947029113769531200.0053312801755964756011962890.083006501197814941406250-0.020363999530673027038574220.083787396550178527832031250-0.026688499376177787780761720.03427229821681976318359375-0.012062000110745429992675780.00051081198034808039665222170.034272298216819763183593750.012062000110745429992675780.00051081198034808039665222170.04490169882774353027343750.036976300179958343505859380.038354501128196716308593750.0449016988277435302734375-0.036976300179958343505859380.038354501128196716308593750.018112899735569953918457030.016734100878238677978515620.057005301117897033691406250.01811289973556995391845703-0.016734100878238677978515620.05700530111789703369140625-0.0082314396277070045471191410.037603501230478286743164060.05627600103616714477539062-0.008231439627707004547119141-0.037603501230478286743164060.056276001036167144775390620.0731943026185035705566406200.08750399947166442871093750.104399003088474273681640600.017178799957036972045898440.150499001145362854003906200.0038539199158549308776855470.04490169882774353027343750.036976300179958343505859380.038354501128196716308593750.0449016988277435302734375-0.036976300179958343505859380.038354501128196716308593750.029158199205994606018066410.05687420070171356201171875-0.0045307897962629795074462890.02915819920599460601806641-0.05687420070171356201171875-0.0045307897962629795074462890.0167011991143226623535156200.009711739607155323028564453pelvis_offset0d0328b82-d9ca-6071-b248-17edfc7612cbjoint_namesmHeadmNeckmChestmTorsomPelvismFaceJawmFaceRootmFaceLipUpperLeftmFaceTeethUppermFaceLipUpperRightmFaceLipCornerLeftmFaceLipCornerRightmFaceLipLowerCentermFaceTeethLowermFaceChinmFaceLipLowerLeftmFaceLipLowerRightmFaceEyeLidUpperLeftmFaceEyeLidUpperRightmFaceEyebrowInnerLeftmFaceEyebrowInnerRightmFaceEyebrowCenterLeftmFaceEyebrowCenterRightmFaceForeheadCentermFaceNoseBridgemFaceNoseBasemFaceEyeLidLowerLeftmFaceEyeLidLowerRightmFaceCheekUpperLeftmFaceCheekUpperRightmFaceLipUpperCenterjoint_offset000.07562989741563796997070312-0.00950700044631958007812500.251107990741729736328125-0.0153679996728897094726562500.2048770040273666381835938000.08407290279865264892578125001.067020058631896972656250.035987500101327896118164060-0.025394700467586517333984380.0250000003725290298461914100.04500000178813934326171875-0.059168100357055664062500.004850860219448804855346680.10700099915266036987304690-0.02607489936053752899169922-0.059168100357055664062500.004850860219448804855346680.03629549965262413024902344-0.01899999938905239105224609-0.013485999777913093566894530.036295499652624130249023440.01899999938905239105224609-0.01348599977791309356689453-0.0202696993947029113769531200.0053312801755964756011962890.083006501197814941406250-0.020363999530673027038574220.083787396550178527832031250-0.026688499376177787780761720.03427229821681976318359375-0.012062000110745429992675780.00051081198034808039665222170.034272298216819763183593750.012062000110745429992675780.00051081198034808039665222170.04490169882774353027343750.036976300179958343505859380.038354501128196716308593750.0449016988277435302734375-0.036976300179958343505859380.038354501128196716308593750.018112899735569953918457030.016734100878238677978515620.057005301117897033691406250.01811289973556995391845703-0.016734100878238677978515620.05700530111789703369140625-0.0082314396277070045471191410.037603501230478286743164060.05627600103616714477539062-0.008231439627707004547119141-0.037603501230478286743164060.056276001036167144775390620.0731943026185035705566406200.08750399947166442871093750.104399003088474273681640600.017178799957036972045898440.150499001145362854003906200.0038539199158549308776855470.04490169882774353027343750.036976300179958343505859380.038354501128196716308593750.0449016988277435302734375-0.036976300179958343505859380.038354501128196716308593750.029158199205994606018066410.05687420070171356201171875-0.0045307897962629795074462890.02915819920599460601806641-0.05687420070171356201171875-0.0045307897962629795074462890.0167011991143226623535156200.009711739607155323028564453pelvis_offset0d2205615-2ce0-4ff1-2bfd-bdc77a3825ccjoint_namesmHeadmNeckmChestmTorsomPelvismFaceJawmFaceRootmFaceLipUpperLeftmFaceTeethUppermFaceLipUpperRightmFaceLipCornerLeftmFaceLipCornerRightmFaceLipLowerCentermFaceTeethLowermFaceChinmFaceLipLowerLeftmFaceLipLowerRightmFaceEyeLidUpperLeftmFaceEyeLidUpperRightmFaceEyebrowInnerLeftmFaceEyebrowInnerRightmFaceEyebrowCenterLeftmFaceEyebrowCenterRightmFaceForeheadCentermFaceNoseBridgemFaceNoseBasemFaceEyeLidLowerLeftmFaceEyeLidLowerRightmFaceCheekUpperLeftmFaceCheekUpperRightmFaceLipUpperCenterjoint_offset000.07562989741563796997070312-0.00950700044631958007812500.251107990741729736328125-0.0153679996728897094726562500.2048770040273666381835938000.08407290279865264892578125001.067020058631896972656250.035987500101327896118164060-0.025394700467586517333984380.0250000003725290298461914100.04500000178813934326171875-0.059168100357055664062500.004850860219448804855346680.10700099915266036987304690-0.02607489936053752899169922-0.059168100357055664062500.004850860219448804855346680.03629549965262413024902344-0.01899999938905239105224609-0.013485999777913093566894530.036295499652624130249023440.01899999938905239105224609-0.01348599977791309356689453-0.0202696993947029113769531200.0053312801755964756011962890.083006501197814941406250-0.020363999530673027038574220.083787396550178527832031250-0.026688499376177787780761720.03427229821681976318359375-0.012062000110745429992675780.00051081198034808039665222170.034272298216819763183593750.012062000110745429992675780.00051081198034808039665222170.04490169882774353027343750.036976300179958343505859380.038354501128196716308593750.0449016988277435302734375-0.036976300179958343505859380.038354501128196716308593750.018112899735569953918457030.016734100878238677978515620.057005301117897033691406250.01811289973556995391845703-0.016734100878238677978515620.05700530111789703369140625-0.0082314396277070045471191410.037603501230478286743164060.05627600103616714477539062-0.008231439627707004547119141-0.037603501230478286743164060.056276001036167144775390620.0731943026185035705566406200.08750399947166442871093750.104399003088474273681640600.017178799957036972045898440.150499001145362854003906200.0038539199158549308776855470.04490169882774353027343750.036976300179958343505859380.038354501128196716308593750.0449016988277435302734375-0.036976300179958343505859380.038354501128196716308593750.029158199205994606018066410.05687420070171356201171875-0.0045307897962629795074462890.02915819920599460601806641-0.05687420070171356201171875-0.0045307897962629795074462890.0167011991143226623535156200.009711739607155323028564453pelvis_offset0d73dea3b-b8cb-59ff-c76b-cfdcc8119bb5joint_namesmFaceJawmFaceRootmHeadmNeckmChestmTorsomPelvisjoint_offset0.035987500101327896118164060-0.025394700467586517333984380.0250000003725290298461914100.04500000178813934326171875000.07562989741563796997070312-0.00950700044631958007812500.251107990741729736328125-0.0153679996728897094726562500.2048770040273666381835938000.08407290279865264892578125001.06702005863189697265625pelvis_offset0e678576a-dc9f-5187-6ed5-5b4aafb65d7bjoint_namesmHeadmNeckmChestmTorsomPelvismFaceJawmFaceRootmFaceLipUpperLeftmFaceTeethUppermFaceLipUpperRightmFaceLipCornerLeftmFaceLipCornerRightmFaceLipLowerCentermFaceTeethLowermFaceChinmFaceLipLowerLeftmFaceLipLowerRightmFaceEyeLidUpperLeftmFaceEyeLidUpperRightmFaceEyebrowInnerLeftmFaceEyebrowInnerRightmFaceEyebrowCenterLeftmFaceEyebrowCenterRightmFaceForeheadCentermFaceNoseBridgemFaceNoseBasemFaceEyeLidLowerLeftmFaceEyeLidLowerRightmFaceCheekUpperLeftmFaceCheekUpperRightmFaceLipUpperCenterjoint_offset000.07562989741563796997070312-0.00950700044631958007812500.251107990741729736328125-0.0153679996728897094726562500.2048770040273666381835938000.08407290279865264892578125001.067020058631896972656250.035987500101327896118164060-0.025394700467586517333984380.0250000003725290298461914100.04500000178813934326171875-0.059168100357055664062500.004850860219448804855346680.10700099915266036987304690-0.02607489936053752899169922-0.059168100357055664062500.004850860219448804855346680.03629549965262413024902344-0.01899999938905239105224609-0.013485999777913093566894530.036295499652624130249023440.01899999938905239105224609-0.01348599977791309356689453-0.0202696993947029113769531200.0053312801755964756011962890.083006501197814941406250-0.020363999530673027038574220.083787396550178527832031250-0.026688499376177787780761720.03427229821681976318359375-0.012062000110745429992675780.00051081198034808039665222170.034272298216819763183593750.012062000110745429992675780.00051081198034808039665222170.04490169882774353027343750.036976300179958343505859380.038354501128196716308593750.0449016988277435302734375-0.036976300179958343505859380.038354501128196716308593750.018112899735569953918457030.016734100878238677978515620.057005301117897033691406250.01811289973556995391845703-0.016734100878238677978515620.05700530111789703369140625-0.0082314396277070045471191410.037603501230478286743164060.05627600103616714477539062-0.008231439627707004547119141-0.037603501230478286743164060.056276001036167144775390620.0731943026185035705566406200.08750399947166442871093750.104399003088474273681640600.017178799957036972045898440.150499001145362854003906200.0038539199158549308776855470.04490169882774353027343750.036976300179958343505859380.038354501128196716308593750.0449016988277435302734375-0.036976300179958343505859380.038354501128196716308593750.029158199205994606018066410.05687420070171356201171875-0.0045307897962629795074462890.02915819920599460601806641-0.05687420070171356201171875-0.0045307897962629795074462890.0167011991143226623535156200.009711739607155323028564453pelvis_offset0ed796a27-cff0-454a-ecec-fd10794ca2c9joint_namesmFaceNoseBasemFaceRootmHeadmNeckmChestmTorsomPelvismFaceLipUpperCentermFaceTeethUpperjoint_offset0.150499001145362854003906200.0038539199158549308776855470.0250000003725290298461914100.04500000178813934326171875000.07562989741563796997070312-0.00950700044631958007812500.251107990741729736328125-0.0153679996728897094726562500.2048770040273666381835938000.08407290279865264892578125001.067020058631896972656250.0167011991143226623535156200.0097117396071553230285644530.10700099915266036987304690-0.02607489936053752899169922pelvis_offset0fa0aabfe-4b1c-fa9b-4942-74e7e7f50fe2joint_namesmPelvismHandMiddle1LeftmHandMiddle2LeftmHandMiddle3LeftmHandIndex1LeftmHandIndex2LeftmHandIndex3LeftmHandRing1LeftmHandRing2LeftmHandRing3LeftmHandPinky1LeftmHandPinky2LeftmHandPinky3LeftmHandThumb1LeftmHandThumb2LeftmHandThumb3LeftmHandMiddle1RightmHandMiddle2RightmHandMiddle3RightmHandIndex1RightmHandIndex2RightmHandIndex3RightmHandRing1RightmHandRing2RightmHandRing3RightmHandPinky1RightmHandPinky2RightmHandPinky3RightmHandThumb1RightmHandThumb2RightmHandThumb3Rightjoint_offset001.067020058631896972656250.015188699588179588317871090.098942197859287261962890620.01042949967086315155029297-0.0010505600366741418838500980.04202070087194442749023438-0.006302990019321441650390625-0.00050425098743289709091186520.02471089921891689300537109-0.0040346500463783740997314450.034273900091648101806640620.09468069672584533691406250.0096299396827816963195800780.017191000282764434814453120.03640490025281906127929688-0.0060679200105369091033935550.010213700123131275177001950.02334530092775821685791016-0.004377489909529685974121094-0.0036476401146501302719116210.0965808033943176269531250.004405209794640541076660156-0.012315300293266773223876950.03599850088357925415039062-0.007578520104289054870605469-0.0065627098083496093750.02019299939274787902832031-0.00454388977959752082824707-0.023213399574160575866699220.08812329918146133422851562-0.004173850174993276596069336-0.022267799824476242065429690.02319590002298355102539062-0.005566920153796672821044922-0.01243670005351305007934570.01492409966886043548583984-0.0033164799679070711135864260.032215598970651626586914060.02088090032339096069335938-0.0085530597716569900512695310.029450999572873115539550780.03365840017795562744140625-0.0010520200012251734733581540.020924899727106094360351560.02820369973778724670410156-0.00090962200192734599113464360.01518869958817958831787109-0.098942197859287261962890620.01042949967086315155029297-0.001050550024956464767456055-0.04202080145478248596191406-0.006302880123257637023925781-0.0005042660050094127655029297-0.02471089921891689300537109-0.0040346598252654075622558590.03427390009164810180664062-0.09468069672584533691406250.0096299396827816963195800780.01719100028276443481445312-0.03640500083565711975097656-0.0060678198933601379394531250.01021370012313127517700195-0.02334530092775821685791016-0.004377489909529685974121094-0.003647640114650130271911621-0.0965808033943176269531250.004405209794640541076660156-0.01231530029326677322387695-0.03599840030074119567871094-0.007578390184789896011352539-0.006562769878655672073364258-0.02019290067255496978759766-0.004543649964034557342529297-0.02321339957416057586669922-0.08812329918146133422851562-0.004173850174993276596069336-0.02226779982447624206542969-0.02319570071995258331298828-0.005566900130361318588256836-0.01243660040199756622314453-0.01492400001734495162963867-0.0033167300280183553695678710.03221559897065162658691406-0.02088090032339096069335938-0.0085530597716569900512695310.02945090085268020629882812-0.03365840017795562744140625-0.0010520999785512685775756840.02092500030994415283203125-0.02820380032062530517578125-0.0009097899892367422580718994pelvis_offset0success1 diff --git a/indra/llappearanceutility/tests/params.xml b/indra/llappearanceutility/tests/params.xml new file mode 100644 index 0000000000..7d7ff646b7 --- /dev/null +++ b/indra/llappearanceutility/tests/params.xml @@ -0,0 +1,1140 @@ + + + + skindata + + 270bb701-8643-c4b3-6a93-7a2b6503b30a + + joint_names + + mTail1 + mPelvis + mTail2 + mTorso + mSpine2 + mSpine1 + mHipLeft + mKneeLeft + mHipRight + mKneeRight + mChest + mSpine4 + mSpine3 + mShoulderRight + mCollarRight + mShoulderLeft + mCollarLeft + mElbowRight + mElbowLeft + mNeck + mAnkleRight + mAnkleLeft + + joint_offset + + + -0.12795400619506836 + 0.0 + 0.001858999952673912 + + + 0.0 + 0.0 + 1.081987977027893 + + + -0.018850000575184822 + 0.0 + -0.09493499994277954 + + + 0.0 + 0.0 + 0.08407299965620041 + + + 0.0 + 0.0 + -0.08407299965620041 + + + 0.0 + 0.0 + 0.08407299965620041 + + + 0.03375700116157532 + 0.12676499783992767 + -0.04099800065159798 + + + -0.0008870000019669533 + -0.04556800052523613 + -0.4910529851913452 + + + 0.03361999988555908 + -0.1288059949874878 + -0.041085999459028244 + + + -0.0007800000021234155 + 0.04863499850034714 + -0.4909220039844513 + + + -0.01536799967288971 + 0.0 + 0.20487700402736664 + + + 0.01536799967288971 + 0.0 + -0.20487700402736664 + + + -0.01536799967288971 + 0.0 + 0.20487700402736664 + + + 0.0 + -0.07941800355911255 + 0.0 + + + -0.020927000790834427 + -0.08500000089406967 + 0.16539600491523743 + + + 0.0 + 0.07900000363588333 + 0.0 + + + -0.020927000790834427 + 0.08466500043869019 + 0.16539600491523743 + + + 0.0 + -0.24799999594688416 + 0.0 + + + 0.0 + 0.24799999594688416 + 0.0 + + + -0.00950700044631958 + 0.0 + 0.25110799074172974 + + + -0.02886899933218956 + 0.0 + -0.4684939980506897 + + + -0.028886999934911728 + 0.0013780000153928995 + -0.4684489965438843 + + + pelvis_offset + 0.0 + + + wearables + + + + agent_id + de494a4f-f01a-47a4-98cf-c94ef9ecca38 + asset_id + 7e3e76fc-7fa4-ec8f-a785-8956dbce6e72 + contents + LLWearable version 22 +Fashionista Male - Shape (new) + + permissions 0 + { + base_mask 7fffffff + owner_mask 7fffffff + group_mask 00000000 + everyone_mask 00000000 + next_owner_mask 00082000 + creator_id 1f8f7642-ce98-4d1b-9314-e2bc98b6538d + owner_id 1f8f7642-ce98-4d1b-9314-e2bc98b6538d + last_owner_id 1f8f7642-ce98-4d1b-9314-e2bc98b6538d + group_id 00000000-0000-0000-0000-000000000000 + } + sale_info 0 + { + sale_type not + sale_price 10 + } +type 0 +parameters 142 +1 0 +2 .16 +4 -.23 +5 -.1 +6 -.3 +7 0 +8 0 +10 0 +11 .04 +12 0 +13 0 +14 0 +15 0 +17 0 +18 0 +19 -.1 +20 .56 +21 .07 +22 0 +23 .42 +24 -.66 +25 .51 +26 0 +27 .02 +28 .6 +29 0 +30 0 +32 1 +33 -.41 +34 .4 +35 0 +36 -.49 +37 0 +38 .42 +40 1 +80 1 +100 1 +104 0 +105 .5 +106 0 +107 0 +151 .16 +152 0 +153 1 +155 -.13 +156 0 +157 0 +185 -.44 +186 0 +187 0 +188 0 +189 0 +193 .5 +194 -.12 +195 -.06 +196 -.59 +505 .65 +506 -.04 +507 0 +515 -.2 +517 .12 +518 -.3 +626 0 +627 0 +629 .5 +630 0 +631 0 +633 .01 +634 .01 +635 .01 +637 .01 +646 0 +647 0 +648 0 +649 .5 +650 -.67 +651 .03 +652 .49 +653 .26 +655 -.08 +656 0 +657 .03 +658 0 +659 .51 +660 0 +661 0 +662 .5 +663 -.2 +664 .13 +665 .04 +675 .03 +676 -.43 +677 .34 +678 .37 +679 -.08 +680 -.08 +681 -.08 +682 .5 +683 -.14 +684 0 +685 .14 +686 -.68 +687 -.09 +688 -.09 +689 -.34 +690 .33 +691 -.09 +692 .24 +693 .1 +694 -.08 +695 -.09 +753 .06 +756 -.08 +758 -1.05 +759 .67 +760 0 +764 -.5 +765 1.02 +767 .08 +768 .08 +769 .52 +770 0 +772 0 +773 .5 +794 0 +795 .41 +796 0 +797 .15 +798 0 +799 .45 +841 0 +842 -.8 +843 0 +853 0 +854 .06 +855 -.43 +879 -.1 +880 -.82 +1103 0 +1104 0 +1105 0 +11001 0 +textures 0 + + created_at + 1724256027 + desc + + flags + 256 + inv_type + 18 + item_id + 8bbf11b0-b86b-3b4c-8c5c-c84902425f42 + metadata + + + name + Leonard - Shape + parent_id + 056f26cf-a9d9-39b9-a90c-f7b0fcd92347 + permissions + + base_mask + 573440 + creator_id + ba2a564a-f0f1-4b82-9c61-b7520bfcd09f + everyone_mask + 524288 + group_id + 00000000-0000-0000-0000-000000000000 + group_mask + 540672 + last_owner_id + ba2a564a-f0f1-4b82-9c61-b7520bfcd09f + next_owner_mask + 573440 + owner_id + de494a4f-f01a-47a4-98cf-c94ef9ecca38 + owner_mask + 573440 + + sale_info + + sale_price + 10 + sale_type + 0 + + type + 13 + wearable_type + 0 + + + + + agent_id + de494a4f-f01a-47a4-98cf-c94ef9ecca38 + asset_id + 9e675544-77c0-0db6-3694-462be7460b76 + contents + LLWearable version 22 +Formal Male - Skin (less old) + + permissions 0 + { + base_mask 7fffffff + owner_mask 7fffffff + group_mask 00000000 + everyone_mask 00000000 + next_owner_mask 00082000 + creator_id 1f8f7642-ce98-4d1b-9314-e2bc98b6538d + owner_id 1f8f7642-ce98-4d1b-9314-e2bc98b6538d + last_owner_id 1f8f7642-ce98-4d1b-9314-e2bc98b6538d + group_id 00000000-0000-0000-0000-000000000000 + } + sale_info 0 + { + sale_type not + sale_price 10 + } +type 1 +parameters 37 +108 0 +110 0 +111 0 +116 0 +117 0 +118 0 +125 0 +126 0 +150 0 +158 0 +159 0 +161 0 +162 0 +163 0 +165 0 +700 .25 +701 0 +702 0 +703 0 +704 0 +705 .5 +706 .6 +707 0 +708 0 +709 0 +710 0 +711 .5 +712 0 +713 .7 +714 0 +715 0 +775 0 +776 0 +777 0 +873 0 +874 0 +878 0 +textures 3 +0 a21d4081-601e-f9f0-0acc-9192c72863dc +5 a85bf749-952d-3835-d9ac-a307c780930c +6 ab169525-d46c-918b-3195-7f2b92fd76c5 + + created_at + 1724256027 + desc + + flags + 257 + inv_type + 18 + item_id + 9e6c5696-cae0-337e-a5c6-aa6fede08ec6 + metadata + + + name + Leonard - Skin + parent_id + 056f26cf-a9d9-39b9-a90c-f7b0fcd92347 + permissions + + base_mask + 557056 + creator_id + ba2a564a-f0f1-4b82-9c61-b7520bfcd09f + everyone_mask + 524288 + group_id + 00000000-0000-0000-0000-000000000000 + group_mask + 524288 + last_owner_id + ba2a564a-f0f1-4b82-9c61-b7520bfcd09f + next_owner_mask + 557056 + owner_id + de494a4f-f01a-47a4-98cf-c94ef9ecca38 + owner_mask + 557056 + + sale_info + + sale_price + 10 + sale_type + 0 + + type + 13 + wearable_type + 1 + + + + + agent_id + de494a4f-f01a-47a4-98cf-c94ef9ecca38 + asset_id + 0b935621-92da-099e-a248-cfbfa3624c68 + contents + LLWearable version 22 +Fashionista Male - Brows (new) + + permissions 0 + { + base_mask 00082000 + owner_mask 00082000 + group_mask 00000000 + everyone_mask 00000000 + next_owner_mask 00082000 + creator_id 1f8f7642-ce98-4d1b-9314-e2bc98b6538d + owner_id 1f8f7642-ce98-4d1b-9314-e2bc98b6538d + last_owner_id 1f8f7642-ce98-4d1b-9314-e2bc98b6538d + group_id 00000000-0000-0000-0000-000000000000 + } + sale_info 0 + { + sale_type not + sale_price 10 + } +type 2 +parameters 90 +16 .41 +31 1.04 +112 0 +113 0 +114 0 +115 0 +119 .5 +130 0 +131 0 +132 0 +133 0 +134 0 +135 0 +136 0 +137 .5 +140 0 +141 0 +142 0 +143 -4 +144 1 +145 0 +146 1 +147 0 +148 1 +149 0 +166 0 +167 0 +168 0 +169 0 +171 0 +172 1 +173 0 +174 1 +175 0 +176 1 +177 0 +178 0 +179 1 +180 0 +181 -1 +182 -1 +183 -1 +184 0 +190 0 +191 0 +192 0 +400 .75 +640 -.01 +641 .2 +642 0 +643 0 +644 .24 +645 0 +674 -.3 +750 .65 +751 0 +752 .5 +754 0 +755 .05 +757 -1.6 +761 1.3 +762 0 +763 0 +771 -.08 +774 0 +782 0 +783 0 +784 0 +785 0 +786 0 +787 0 +788 0 +789 0 +790 0 +870 -.11 +871 -.4 +872 .52 +1000 .5 +1001 .5 +1002 .65 +1003 .65 +1004 0 +1005 0 +1006 0 +1007 0 +1008 0 +1009 0 +1010 0 +1011 0 +1012 .25 +textures 1 +4 3cc3add8-6ff0-0640-79ba-b15137f64008 + + created_at + 1724256027 + desc + + flags + 258 + inv_type + 18 + item_id + 3ddd2d41-fbe4-3076-9732-c5f3b12973b1 + metadata + + + name + Leonard - Brows + parent_id + 056f26cf-a9d9-39b9-a90c-f7b0fcd92347 + permissions + + base_mask + 557056 + creator_id + ba2a564a-f0f1-4b82-9c61-b7520bfcd09f + everyone_mask + 524288 + group_id + 00000000-0000-0000-0000-000000000000 + group_mask + 524288 + last_owner_id + ba2a564a-f0f1-4b82-9c61-b7520bfcd09f + next_owner_mask + 557056 + owner_id + de494a4f-f01a-47a4-98cf-c94ef9ecca38 + owner_mask + 557056 + + sale_info + + sale_price + 10 + sale_type + 0 + + type + 13 + wearable_type + 2 + + + + + agent_id + de494a4f-f01a-47a4-98cf-c94ef9ecca38 + asset_id + 052ca46d-9612-7a43-25a9-d7c8a5387cf6 + contents + LLWearable version 22 +Fashionista Male - Eyes + + permissions 0 + { + base_mask 7fffffff + owner_mask 7fffffff + group_mask 00000000 + everyone_mask 00000000 + next_owner_mask 00082000 + creator_id 1f8f7642-ce98-4d1b-9314-e2bc98b6538d + owner_id 1f8f7642-ce98-4d1b-9314-e2bc98b6538d + last_owner_id 1f8f7642-ce98-4d1b-9314-e2bc98b6538d + group_id 00000000-0000-0000-0000-000000000000 + } + sale_info 0 + { + sale_type not + sale_price 10 + } +type 3 +parameters 2 +98 1 +99 0 +textures 1 +3 579e320c-0f16-2a1d-2018-2a00cc657068 + + created_at + 1724256027 + desc + + flags + 259 + inv_type + 18 + item_id + 9d4e7072-0e92-39a1-95a4-b5330450b1ee + metadata + + + name + Leonard - Eyes + parent_id + 056f26cf-a9d9-39b9-a90c-f7b0fcd92347 + permissions + + base_mask + 557056 + creator_id + ba2a564a-f0f1-4b82-9c61-b7520bfcd09f + everyone_mask + 524288 + group_id + 00000000-0000-0000-0000-000000000000 + group_mask + 524288 + last_owner_id + ba2a564a-f0f1-4b82-9c61-b7520bfcd09f + next_owner_mask + 557056 + owner_id + de494a4f-f01a-47a4-98cf-c94ef9ecca38 + owner_mask + 557056 + + sale_info + + sale_price + 10 + sale_type + 0 + + type + 13 + wearable_type + 3 + + + + + + + + + agent_id + de494a4f-f01a-47a4-98cf-c94ef9ecca38 + asset_id + 5f049939-bb34-ad27-66cb-38c9151a105d + contents + LLWearable version 22 +Fashionista Male - Shoe Base + + permissions 0 + { + base_mask 7fffffff + owner_mask 7fffffff + group_mask 00000000 + everyone_mask 00000000 + next_owner_mask 00082000 + creator_id 73ecef5a-3110-4e95-92bc-da0ae7598652 + owner_id 73ecef5a-3110-4e95-92bc-da0ae7598652 + last_owner_id 73ecef5a-3110-4e95-92bc-da0ae7598652 + group_id 00000000-0000-0000-0000-000000000000 + } + sale_info 0 + { + sale_type not + sale_price 10 + } +type 6 +parameters 20 +197 0 +198 0 +500 0 +501 .1 +502 .1 +503 .1 +508 -.52 +509 1 +510 0 +511 .82 +512 0 +513 0 +514 .09 +616 .3 +654 .06 +812 1 +813 1 +817 1 +1052 .3 +1053 .3 +textures 1 +7 8dcd4a48-2d37-4909-9f78-f7a9eb4ef903 + + created_at + 1724256027 + desc + @600 + flags + 262 + inv_type + 18 + item_id + dc5e279a-4a34-36ee-9075-028df446392c + metadata + + + name + Leonard - Shoes BASE + parent_id + 056f26cf-a9d9-39b9-a90c-f7b0fcd92347 + permissions + + base_mask + 557056 + creator_id + ba2a564a-f0f1-4b82-9c61-b7520bfcd09f + everyone_mask + 524288 + group_id + 00000000-0000-0000-0000-000000000000 + group_mask + 524288 + last_owner_id + ba2a564a-f0f1-4b82-9c61-b7520bfcd09f + next_owner_mask + 557056 + owner_id + de494a4f-f01a-47a4-98cf-c94ef9ecca38 + owner_mask + 557056 + + sale_info + + sale_price + 10 + sale_type + 0 + + type + 5 + wearable_type + 6 + + + + + + + + + + + + + + + + + agent_id + de494a4f-f01a-47a4-98cf-c94ef9ecca38 + asset_id + ab0bd2c6-3776-7ea6-264f-102842c6328b + contents + LLWearable version 22 +Fashionista Female - Heels Alpha + + permissions 0 + { + base_mask 7fffffff + owner_mask 7fffffff + group_mask 00000000 + everyone_mask 00000000 + next_owner_mask 00082000 + creator_id 73ecef5a-3110-4e95-92bc-da0ae7598652 + owner_id 73ecef5a-3110-4e95-92bc-da0ae7598652 + last_owner_id 73ecef5a-3110-4e95-92bc-da0ae7598652 + group_id 00000000-0000-0000-0000-000000000000 + } + sale_info 0 + { + sale_type not + sale_price 10 + } +type 13 +parameters 0 +textures 5 +21 b5b09502-8305-af43-cc4e-7238cb715b11 +22 5748decc-f629-461c-9a36-a35a221fe21f +23 5748decc-f629-461c-9a36-a35a221fe21f +24 5748decc-f629-461c-9a36-a35a221fe21f +25 5748decc-f629-461c-9a36-a35a221fe21f + + created_at + 1724256027 + desc + @1300 + flags + 269 + inv_type + 18 + item_id + b76dde5f-0da2-3e21-b505-d587b16ddb3c + metadata + + + name + Leonard - Shoes ALPHA + parent_id + 056f26cf-a9d9-39b9-a90c-f7b0fcd92347 + permissions + + base_mask + 557056 + creator_id + ba2a564a-f0f1-4b82-9c61-b7520bfcd09f + everyone_mask + 524288 + group_id + 00000000-0000-0000-0000-000000000000 + group_mask + 524288 + last_owner_id + ba2a564a-f0f1-4b82-9c61-b7520bfcd09f + next_owner_mask + 557056 + owner_id + de494a4f-f01a-47a4-98cf-c94ef9ecca38 + owner_mask + 557056 + + sale_info + + sale_price + 10 + sale_type + 0 + + type + 5 + wearable_type + 13 + + + agent_id + de494a4f-f01a-47a4-98cf-c94ef9ecca38 + asset_id + cb80f44f-8265-f56b-c812-ddf729cee73b + contents + LLWearable version 22 +New Alpha + + permissions 0 + { + base_mask 7fffffff + owner_mask 7fffffff + group_mask 00000000 + everyone_mask 00000000 + next_owner_mask 00082000 + creator_id 8b1453d6-ec45-4434-bee3-1c4d6fe1bc55 + owner_id 8b1453d6-ec45-4434-bee3-1c4d6fe1bc55 + last_owner_id 8b1453d6-ec45-4434-bee3-1c4d6fe1bc55 + group_id 00000000-0000-0000-0000-000000000000 + } + sale_info 0 + { + sale_type not + sale_price 10 + } +type 13 +parameters 0 +textures 5 +21 d9413239-769d-abc9-e929-4fa98f52c07b +22 b5d465f9-ca8e-8ba4-efd8-ee8929c592b8 +23 5748decc-f629-461c-9a36-a35a221fe21f +24 5748decc-f629-461c-9a36-a35a221fe21f +25 5748decc-f629-461c-9a36-a35a221fe21f + + created_at + 1724256027 + desc + @1301 + flags + 269 + inv_type + 18 + item_id + efc7da55-02ba-3286-8458-780aede51b49 + metadata + + + name + Leonard - Suit Alpha + parent_id + 056f26cf-a9d9-39b9-a90c-f7b0fcd92347 + permissions + + base_mask + 557056 + creator_id + ba2a564a-f0f1-4b82-9c61-b7520bfcd09f + everyone_mask + 524288 + group_id + 00000000-0000-0000-0000-000000000000 + group_mask + 524288 + last_owner_id + ba2a564a-f0f1-4b82-9c61-b7520bfcd09f + next_owner_mask + 557056 + owner_id + de494a4f-f01a-47a4-98cf-c94ef9ecca38 + owner_mask + 557056 + + sale_info + + sale_price + 10 + sale_type + 0 + + type + 5 + wearable_type + 13 + + + agent_id + de494a4f-f01a-47a4-98cf-c94ef9ecca38 + asset_id + f235a6a9-062a-bb40-46c2-c8a7bec95fbf + contents + LLWearable version 22 +System Eyelash Remover + + permissions 0 + { + base_mask 7fffffff + owner_mask 7fffffff + group_mask 00000000 + everyone_mask 00000000 + next_owner_mask 00082000 + creator_id 1f8f7642-ce98-4d1b-9314-e2bc98b6538d + owner_id 1f8f7642-ce98-4d1b-9314-e2bc98b6538d + last_owner_id 1f8f7642-ce98-4d1b-9314-e2bc98b6538d + group_id 00000000-0000-0000-0000-000000000000 + } + sale_info 0 + { + sale_type not + sale_price 10 + } +type 13 +parameters 0 +textures 5 +21 5748decc-f629-461c-9a36-a35a221fe21f +22 5748decc-f629-461c-9a36-a35a221fe21f +23 9e460914-daed-b03f-0f2a-afbe67833b11 +24 5748decc-f629-461c-9a36-a35a221fe21f +25 5748decc-f629-461c-9a36-a35a221fe21f + + created_at + 1724256027 + desc + @1302 + flags + 269 + inv_type + 18 + item_id + 624f9c12-72e8-3409-a3f3-b3fe8f496b13 + metadata + + + name + System Eyelash Remover + parent_id + 056f26cf-a9d9-39b9-a90c-f7b0fcd92347 + permissions + + base_mask + 557056 + creator_id + ba2a564a-f0f1-4b82-9c61-b7520bfcd09f + everyone_mask + 524288 + group_id + 00000000-0000-0000-0000-000000000000 + group_mask + 524288 + last_owner_id + ba2a564a-f0f1-4b82-9c61-b7520bfcd09f + next_owner_mask + 557056 + owner_id + de494a4f-f01a-47a4-98cf-c94ef9ecca38 + owner_mask + 557056 + + sale_info + + sale_price + 10 + sale_type + 0 + + type + 5 + wearable_type + 13 + + + + + + + + + + + diff --git a/indra/llappearanceutility/tests/params.xml.output b/indra/llappearanceutility/tests/params.xml.output new file mode 100644 index 0000000000..58449dd37a --- /dev/null +++ b/indra/llappearanceutility/tests/params.xml.output @@ -0,0 +1 @@ +avatar_scale0.4499999880790710449218750.600000023841857910156251.76146829128265380859375debug_params1namebig_browvalue0weight3310namesunken_cheeksvalue0weight8510000namebreast_physics_massvalue0.1000000014901161193847656weight010001namebreast_physics_gravityvalue0weight010002namebreast_physics_dragvalue1weight2510003namebreast_physics_updown_max_effectvalue0weight010004namebreast_physics_updown_springvalue10weight2510005namebreast_physics_updown_gainvalue10weight2310006namebreast_physics_updown_dampingvalue0.2000000029802322387695312weight5110007namebreast_physics_inout_max_effectvalue0weight010008namebreast_physics_inout_springvalue10weight2510009namebreast_physics_inout_gainvalue10weight2310010namebreast_physics_inout_dampingvalue0.2000000029802322387695312weight5110011namebelly_physics_massvalue0.1000000014901161193847656weight010012namebelly_physics_gravityvalue0weight010013namebelly_physics_dragvalue1weight2510014namebelly_physics_updown_max_effectvalue0weight010015namebelly_physics_updown_springvalue10weight2510016namebelly_physics_updown_gainvalue10weight2310017namebelly_physics_updown_dampingvalue0.2000000029802322387695312weight5110018namebutt_physics_massvalue0.1000000014901161193847656weight010019namebutt_physics_gravityvalue0weight010020namebutt_physics_dragvalue1weight2510021namebutt_physics_updown_max_effectvalue0weight010022namebutt_physics_updown_springvalue10weight2510023namebutt_physics_updown_gainvalue10weight2310024namebutt_physics_updown_dampingvalue0.2000000029802322387695312weight5110025namebutt_physics_leftright_max_effectvalue0weight010026namebutt_physics_leftright_springvalue10weight2510027namebutt_physics_leftright_gainvalue10weight2310028namebutt_physics_leftright_dampingvalue0.2000000029802322387695312weight5110029namebreast_physics_leftright_max_effectvalue0weight010030namebreast_physics_leftright_springvalue10weight2510031namebreast_physics_leftright_gainvalue10weight2310032namebreast_physics_leftright_dampingvalue0.2000000029802322387695312weight51105namebreast sizevalue0.5weight127108namerainbow colorvalue0weight011namenoble_nose_bridgevalue0.03999999910593032836914062weight68110namered skinvalue0weight011000nameappearancemessage_versionvalue1weight111001namehovervalue0weight127111namepigmentvalue0weight0112namerainbow colorvalue0weight0113namered hairvalue0weight0114nameblonde hairvalue0weight0115namewhite hairvalue0weight0116namerosy complexionvalue0weight0117namelip pinknessvalue0weight0119nameeyebrow sizevalue0.5weight12712namejowlsvalue0weight4213namecleft_chin_uppervalue0weight0130namefront fringevalue0weight0131nameside fringevalue0weight0132nameback fringevalue0weight0133namehair frontvalue0weight0134namehair sidesvalue0weight0135namehair backvalue0weight0136namehair sweepvalue0weight0137namehair tiltvalue0.5weight12714namehigh_cheek_bonesvalue0weight85140namehair_part_middlevalue0weight0141namehair_part_rightvalue0weight0142namehair_part_leftvalue0weight0143namehair_sides_fullvalue-4weight015nameears_outvalue0weight63150namebody definitionvalue0weight0155namelip widthvalue-0.12999999523162841796875weight89157namebelly sizevalue0weight016namepointy_eyebrowsvalue0.4099999964237213134765625weight66162namefacial definitionvalue0weight0163namewrinklesvalue0weight0165namefrecklesvalue0weight0166namesideburnsvalue0weight0167namemoustachevalue0weight0168namesoulpatchvalue0weight0169namechin curtainsvalue0weight017namesquare_jawvalue0weight85177namehair_rumpledvalue0weight018namepuffy_upper_cheeksvalue0weight95181namehair_big_frontvalue-1weight0182namehair_big_topvalue-1weight0183namehair_big_backvalue-1weight0184namehair_spikedvalue0weight0185namedeep_chinvalue-0.439999997615814208984375weight7119nameupturned_nose_tipvalue-0.1000000014901161193847656weight142192namebangs_part_middlevalue0weight0193namehead shapevalue0.5weight127196nameeye spacingvalue-0.589999973773956298828125weight119198nameheel heightvalue0weight02namenose_big_outvalue0.1599999964237213134765625weight7420namebulbous_nosevalue0.560000002384185791015625weight13521nameupper_eyelid_foldvalue0.07000000029802322387695312weight4522nameattached_earlobesvalue0weight023namebaggy_eyesvalue0.4199999868869781494140625weight11724namewide_eyesvalue-0.660000026226043701171875weight6125namewide_lip_cleftvalue0.5099999904632568359375weight14527namewide_nose_bridgevalue0.01999999955296516418457031weight13431namearced_eyebrowsvalue1.03999996185302734375weight13233nameheightvalue-0.4099999964237213134765625weight11234namethicknessvalue0.4000000059604644775390625weight12735namebig_earsvalue0weight8536nameshouldersvalue-0.4900000095367431640625weight10437namehip widthvalue0weight13638nametorso lengthvalue0.4199999868869781494140625weight1814namebroad_nostrilsvalue-0.2300000041723251342773438weight455namecleft_chinvalue-0.1000000014901161193847656weight0503nameplatform heightvalue0.1000000014901161193847656weight25505namelip thicknessvalue0.64999997615814208984375weight165506namemouth_heightvalue-0.03999999910593032836914062weight124507namebreast_gravityvalue0weight109508nameshoe_platform_widthvalue-0.519999980926513671875weight40513nameheel shapevalue0weight0514nametoe shapevalue0.0900000035762786865234375weight22515namefoot_sizevalue-0.2000000029802322387695312weight51517namewide_nosevalue0.1199999973177909851074219weight105518nameeyelashes_longvalue-0.300000011920928955078125weight06namebulbous_nose_tipvalue-0.300000011920928955078125weight0603namesleeve lengthvalue0.4000000059604644775390625weight100604namebottomvalue0.85000002384185791015625weight216605namecollar frontvalue0.839999973773956298828125weight214606namesleeve lengthvalue0.800000011920928955078125weight204607namecollar frontvalue0.800000011920928955078125weight204608namebottom length lowervalue0.800000011920928955078125weight204609nameopen jacketvalue0.2000000029802322387695312weight51616nameshoe heightvalue0.300000011920928955078125weight76617namesocks lengthvalue0.3499999940395355224609375weight89619namepants lengthvalue0.300000011920928955078125weight76624namepants waistvalue0.800000011920928955078125weight204625nameleg_pantflairvalue0weight0629nameforehead anglevalue0.5weight127637namebody fatvalue0.009999999776482582092285156weight2638namelow_crotchvalue0weight0646nameegg_headvalue0weight144647namesquash_stretch_headvalue0weight85649nametorso musclesvalue0.5weight127650nameeyelid_corner_upvalue-0.670000016689300537109375weight64652nameleg musclesvalue0.4900000095367431640625weight124653nametall_lipsvalue0.2599999904632568359375weight107654nameshoe_toe_thickvalue0.05999999865889549255371094weight7656namecrooked_nosevalue0weight127659namemouth cornervalue0.5099999904632568359375weight130662nameface shearvalue0.5weight127663nameshift_mouthvalue-0.2000000029802322387695312weight114664namepop_eyevalue0.12999999523162841796875weight140665namejaw_jutvalue0.03999999910593032836914062weight130674namehair_shear_backvalue-0.300000011920928955078125weight59675namehand sizevalue0.02999999932944774627685547weight140676namelove_handlesvalue-0.430000007152557373046875weight48678nametorso musclesvalue0.37000000476837158203125weight94682namehead sizevalue0.5weight127683nameneck thicknessvalue-0.1400000005960464477539062weight110684namebreast_female_cleavagevalue0weight47685namechest_male_no_pecsvalue0.1400000005960464477539062weight101690nameeye sizevalue0.3300000131130218505859375weight84692nameleg lengthvalue0.2399999946355819702148438weight158693namearm lengthvalue0.1000000014901161193847656weight1407nameweak_chinvalue0weight127700namelipstick colorvalue0.25weight63701namelipstickvalue0weight0702namelipglossvalue0weight0703nameeyelinervalue0weight0704nameblushvalue0weight0705nameblush colorvalue0.5weight127706nameout shdw opacityvalue0.60000002384185791015625weight127707nameouter shadowvalue0weight0708nameout shdw colorvalue0weight0709nameinner shadowvalue0weight0710namenail polishvalue0weight0711nameblush opacityvalue0.5weight127712namein shdw colorvalue0weight0713namein shdw opacityvalue0.699999988079071044921875weight159714nameeyeliner colorvalue0weight0715namenail polish colorvalue0weight0750nameeyebrow densityvalue0.64999997615814208984375weight165752namehair thicknessvalue0.5weight127753namesaddlebagsvalue0.05999999865889549255371094weight40754namehair_taper_backvalue0weight85755namehair_taper_frontvalue0.05000000074505805969238281weight131756nameneck lengthvalue-0.07999999821186065673828125weight117757namelower_eyebrowsvalue-1.60000002384185791015625weight102758namelower_bridge_nosevalue-1.0499999523162841796875weight38759namelow_septum_nosevalue0.670000016689300537109375weight170760namejaw_anglevalue0weight95762namehair_shear_frontvalue0weight0763namehair volumevalue0weight0764namelip_cleft_deepvalue-0.5weight0765namepuffy_lower_lidsvalue1.019999980926513671875weight120769nameeye depthvalue0.519999980926513671875weight132773namehead lengthvalue0.5weight127775namebody frecklesvalue0weight0779namecollar backvalue0.839999973773956298828125weight214780namecollar backvalue0.800000011920928955078125weight204781namecollar backvalue0.7799999713897705078125weight198785namepigtailsvalue0weight0789nameponytailvalue0weight0795namebutt sizevalue0.4099999964237213134765625weight104796namepointy_earsvalue0weight30799namelip ratiovalue0.449999988079071044921875weight1148namedouble_chinvalue0weight6380namemalevalue1weight255800namesleeve lengthvalue0.88999998569488525390625weight226801nameshirt bottomvalue1weight255802namecollar frontvalue0.7799999713897705078125weight198803nameshirt_redvalue1weight255804nameshirt_greenvalue1weight255805nameshirt_bluevalue1weight255806namepants_redvalue1weight255807namepants_greenvalue1weight255808namepants_bluevalue1weight255812nameshoes_redvalue1weight255813nameshoes_greenvalue1weight255814namewaist heightvalue1weight255815namepants lengthvalue0.800000011920928955078125weight204816nameloose lower clothingvalue0weight0817nameshoes_bluevalue1weight255818namesocks_redvalue1weight255819namesocks_greenvalue1weight255820namesocks_bluevalue1weight255821nameundershirt_redvalue1weight255822nameundershirt_greenvalue1weight255823nameundershirt_bluevalue1weight255824nameunderpants_redvalue1weight255825nameunderpants_greenvalue1weight255826nameunderpants_bluevalue1weight255827namegloves_redvalue1weight255828nameloose upper clothingvalue0weight0829namegloves_greenvalue1weight255830namegloves_bluevalue1weight255834namejacket_redvalue1weight255835namejacket_greenvalue1weight255836namejacket_bluevalue1weight255840nameshirtsleeve_flairvalue0weight0841namebowed_legsvalue0weight127842namehip lengthvalue-0.800000011920928955078125weight25844nameglove fingersvalue1weight255848nameskirt_bustlevalue0.2000000029802322387695312weight25858nameskirt lengthvalue0.4000000059604644775390625weight100859nameslit frontvalue1weight255860nameslit backvalue1weight255861nameslit leftvalue1weight255862nameslit rightvalue1weight255863nameskirt_loosenessvalue0.333000004291534423828125weight84868nameshirt wrinklesvalue0weight0869namepants wrinklesvalue0weight0877namejacket wrinklesvalue0weight0879namemale_packagevalue-0.1000000014901161193847656weight40880nameeyelid_inner_corner_upvalue-0.819999992847442626953125weight48921nameskirt_redvalue1weight255922nameskirt_greenvalue1weight255923nameskirt_bluevalue1weight25593nameglove lengthvalue0.800000011920928955078125weight20398nameeye lightnessvalue1weight25599nameeye colorvalue0weight0dump_joint_offsetsmesh_id270bb701-8643-c4b3-6a93-7a2b6503b30anamemPelvispos001.08198797702789306640625mesh_id270bb701-8643-c4b3-6a93-7a2b6503b30anamemSpine1pos000.08407299965620040893554688mesh_id270bb701-8643-c4b3-6a93-7a2b6503b30anamemSpine2pos00-0.08407299965620040893554688mesh_id270bb701-8643-c4b3-6a93-7a2b6503b30anamemTorsopos000.08407299965620040893554688mesh_id270bb701-8643-c4b3-6a93-7a2b6503b30anamemSpine3pos-0.0153679996728897094726562500.2048770040273666381835938mesh_id270bb701-8643-c4b3-6a93-7a2b6503b30anamemSpine4pos0.015367999672889709472656250-0.2048770040273666381835938mesh_id270bb701-8643-c4b3-6a93-7a2b6503b30anamemChestpos-0.0153679996728897094726562500.2048770040273666381835938mesh_id270bb701-8643-c4b3-6a93-7a2b6503b30anamemNeckpos-0.00950700044631958007812500.251107990741729736328125mesh_id270bb701-8643-c4b3-6a93-7a2b6503b30anamemCollarLeftpos-0.020927000790834426879882810.0846650004386901855468750.1653960049152374267578125mesh_id270bb701-8643-c4b3-6a93-7a2b6503b30anamemShoulderLeftpos00.079000003635883331298828120mesh_id270bb701-8643-c4b3-6a93-7a2b6503b30anamemElbowLeftpos00.24799999594688415527343750mesh_id270bb701-8643-c4b3-6a93-7a2b6503b30anamemCollarRightpos-0.02092700079083442687988281-0.085000000894069671630859380.1653960049152374267578125mesh_id270bb701-8643-c4b3-6a93-7a2b6503b30anamemShoulderRightpos0-0.0794180035591125488281250mesh_id270bb701-8643-c4b3-6a93-7a2b6503b30anamemElbowRightpos0-0.24799999594688415527343750mesh_id270bb701-8643-c4b3-6a93-7a2b6503b30anamemHipRightpos0.03361999988555908203125-0.12880599498748779296875-0.04108599945902824401855469mesh_id270bb701-8643-c4b3-6a93-7a2b6503b30anamemKneeRightpos-0.0007800000021234154701232910.04863499850034713745117188-0.4909220039844512939453125mesh_id270bb701-8643-c4b3-6a93-7a2b6503b30anamemAnkleRightpos-0.028868999332189559936523440-0.468493998050689697265625mesh_id270bb701-8643-c4b3-6a93-7a2b6503b30anamemHipLeftpos0.03375700116157531738281250.1267649978399276733398438-0.04099800065159797668457031mesh_id270bb701-8643-c4b3-6a93-7a2b6503b30anamemKneeLeftpos-0.0008870000019669532775878906-0.04556800052523612976074219-0.49105298519134521484375mesh_id270bb701-8643-c4b3-6a93-7a2b6503b30anamemAnkleLeftpos-0.028886999934911727905273440.001378000015392899513244629-0.46844899654388427734375mesh_id270bb701-8643-c4b3-6a93-7a2b6503b30anamemTail1pos-0.12795400619506835937500.001858999952673912048339844mesh_id270bb701-8643-c4b3-6a93-7a2b6503b30anamemTail2pos-0.018850000575184822082519530-0.094934999942779541015625params3374450012763856842085636685951421354501176114513413211212785104136181255203255012700000000012700000001270000089000000000000071012711902516512410940022511050100216214204204204517689762040127201448512764124107712713012711414013059140489412711047101841581406300001271270000127015900165127408513111710238170950001201321270214204198001043011422625519825525525525525525525525525520402552552552552552552552552552552550255255255255255012725255251002552552552558400040482552552550025025235102523510025025235100250252351025235102523511127slot_texturesaux1hash_idc228d1cf-4b5d-4ba8-84f4-899a0796aa97texture_idsaux2hash_idc228d1cf-4b5d-4ba8-84f4-899a0796aa97texture_idsaux3hash_idc228d1cf-4b5d-4ba8-84f4-899a0796aa97texture_idseyeshash_id812bffac-704c-d4bb-487d-0674ccbd5d9dtexture_ids5748decc-f629-461c-9a36-a35a221fe21f579e320c-0f16-2a1d-2018-2a00cc657068hairhash_idfc7ad735-99b6-aaf1-a1bf-676ea304b624texture_ids3cc3add8-6ff0-0640-79ba-b15137f640085748decc-f629-461c-9a36-a35a221fe21fheadhash_id799f44a9-82ec-78bd-7800-3e17367229fatexture_ids5748decc-f629-461c-9a36-a35a221fe21f9e460914-daed-b03f-0f2a-afbe67833b11a21d4081-601e-f9f0-0acc-9192c72863dcleftarmhash_idc228d1cf-4b5d-4ba8-84f4-899a0796aa97texture_idsleftleghash_idc228d1cf-4b5d-4ba8-84f4-899a0796aa97texture_idslowerhash_id6d752c11-c33a-43c4-8631-3f8a6722ba59texture_ids5748decc-f629-461c-9a36-a35a221fe21f8dcd4a48-2d37-4909-9f78-f7a9eb4ef903ab169525-d46c-918b-3195-7f2b92fd76c5b5b09502-8305-af43-cc4e-7238cb715b11d9413239-769d-abc9-e929-4fa98f52c07bskirthash_idc228d1cf-4b5d-4ba8-84f4-899a0796aa97texture_idsupperhash_id5b4d5c23-3073-26d1-8d68-78d5bfa308e4texture_ids5748decc-f629-461c-9a36-a35a221fe21fa85bf749-952d-3835-d9ac-a307c780930cb5d465f9-ca8e-8ba4-efd8-ee8929c592b8success1 diff --git a/indra/llappearanceutility/tests/texture.llsd.binary b/indra/llappearanceutility/tests/texture.llsd.binary new file mode 100644 index 0000000000..6b4f34831c Binary files /dev/null and b/indra/llappearanceutility/tests/texture.llsd.binary differ diff --git a/indra/llappearanceutility/tests/texture.llsd.output b/indra/llappearanceutility/tests/texture.llsd.output new file mode 100644 index 0000000000..6c7690decc Binary files /dev/null and b/indra/llappearanceutility/tests/texture.llsd.output differ diff --git a/indra/llrender/llglheaders.h b/indra/llrender/llglheaders.h index ad31921c05..4c0fa6df1c 100644 --- a/indra/llrender/llglheaders.h +++ b/indra/llrender/llglheaders.h @@ -34,7 +34,6 @@ #define GL_GLEXT_PROTOTYPES 1 #include "GL/gl.h" #include "GL/glext.h" -#include "GL/glu.h" // The __APPLE__ kludge is to make glh_extensions.h not symbol-clash horribly # define __APPLE__ @@ -56,7 +55,6 @@ # include "GL/glx.h" # include "GL/glxext.h" - #elif LL_WINDOWS //---------------------------------------------------------------------------- // LL_WINDOWS diff --git a/indra/llrender/llimagegl.cpp b/indra/llrender/llimagegl.cpp index 97ea6f67bd..e319816377 100644 --- a/indra/llrender/llimagegl.cpp +++ b/indra/llrender/llimagegl.cpp @@ -1053,7 +1053,11 @@ U32 type_width_from_pixtype(U32 pixtype) bool should_stagger_image_set(bool compressed) { -#if LL_DARWIN +#if LL_MESA_HEADLESS + return false; +#elif LL_LINUX + return !compressed && on_main_thread() && gGLManager.mIsNVIDIA; +#elif LL_DARWIN return !compressed && on_main_thread() && gGLManager.mIsAMD; #else // glTexSubImage2D doesn't work with compressed textures on select tested Nvidia GPUs on Windows 10 -Cosmic,2023-03-08 -- cgit v1.3 From b66d6679b268069b155e7a0f5b843095a200a29f Mon Sep 17 00:00:00 2001 From: Rye Date: Thu, 23 Oct 2025 20:19:06 -0400 Subject: Run tests using ctest after all targets are built to reduce build contention Reuse test runner compilation unit to reduce extra source files compiled by 189 Only build macOS tests for build host architecture that will be running them to reduce wasted CI time Signed-off-by: Rye --- autobuild.xml | 40 +++++------- build.sh | 4 ++ indra/CMakeLists.txt | 26 ++++++++ indra/cmake/LLAddBuildTest.cmake | 41 +++++------- indra/cmake/Variables.cmake | 5 ++ indra/cmake/run_build_test.py | 2 +- .../llimage_libtest/CMakeLists.txt | 13 +++- .../integration_tests/llui_libtest/CMakeLists.txt | 14 +++- indra/llcorehttp/CMakeLists.txt | 7 ++ indra/test/CMakeLists.txt | 75 ++++++++++++++-------- 10 files changed, 151 insertions(+), 76 deletions(-) (limited to 'autobuild.xml') diff --git a/autobuild.xml b/autobuild.xml index 85b3ea4e63..4dcb2e7d3a 100644 --- a/autobuild.xml +++ b/autobuild.xml @@ -3018,7 +3018,7 @@ Copyright (c) 2012, 2014, 2015, 2016 nghttp2 contributors options -G - Unix Makefiles + Ninja build @@ -3076,7 +3076,7 @@ Copyright (c) 2012, 2014, 2015, 2016 nghttp2 contributors options -G - Unix Makefiles + Ninja build @@ -3163,19 +3163,15 @@ Copyright (c) 2012, 2014, 2015, 2016 nghttp2 contributors build command - msbuild.exe + cmake options - /p:Configuration=RelWithDebInfo - /p:Platform=${AUTOBUILD_WIN_VSPLATFORM|NOTWIN} - /t:Build - /p:useenv=true - /verbosity:minimal - /p:VCBuildAdditionalOptions= /incremental - - arguments - - SecondLife.sln + --build + . + --config + RelWithDebInfo + --parallel + $AUTOBUILD_CPU_COUNT name @@ -3237,19 +3233,15 @@ Copyright (c) 2012, 2014, 2015, 2016 nghttp2 contributors build command - msbuild.exe + cmake options - /p:Configuration=Release - /p:Platform=${AUTOBUILD_WIN_VSPLATFORM|NOTWIN} - /t:Build - /p:useenv=true - /verbosity:minimal - /p:VCBuildAdditionalOptions= /incremental - - arguments - - SecondLife.sln + --build + . + --config + Release + --parallel + $AUTOBUILD_CPU_COUNT name diff --git a/build.sh b/build.sh index c9f366d64c..31604663f1 100755 --- a/build.sh +++ b/build.sh @@ -254,6 +254,10 @@ build() "$autobuild" build --no-configure -c $variant \ $eval_autobuild_build_parameters \ || fatal "failed building $variant" + + ctest -C Release --test-dir "${build_dir}" --output-on-failure -j $(nproc --all) \ + || fatal "failed testing $variant" + echo true >"$build_dir"/build_ok end_section "autobuild $variant" diff --git a/indra/CMakeLists.txt b/indra/CMakeLists.txt index a7f0ab0486..fb5cceb9ce 100644 --- a/indra/CMakeLists.txt +++ b/indra/CMakeLists.txt @@ -56,6 +56,32 @@ if (NOT CMAKE_BUILD_TYPE) "Build type. One of: Debug Release RelWithDebInfo" FORCE) endif (NOT CMAKE_BUILD_TYPE) +if (LL_TESTS) + set(CMAKE_SKIP_TEST_ALL_DEPENDENCY FALSE) + include(ProcessorCount) + ProcessorCount(NUM_CORES) + + # Set parallel level to decrease test runtime + set(CMAKE_CTEST_ARGUMENTS -j${NUM_CORES} --output-on-failure) + + # Set up our test targets + set(CTEST_TEST_TARGET_ALIAS BUILD_AND_RUN_TESTS) + include(CTest) + + set_target_properties(BUILD_AND_RUN_TESTS + PROPERTIES + FOLDER "CMakePredefinedTargets" + ) + + add_custom_target(BUILD_TESTS) + add_dependencies(BUILD_AND_RUN_TESTS BUILD_TESTS) + + set_target_properties(BUILD_TESTS + PROPERTIES + FOLDER "CMakePredefinedTargets" + ) +endif () + add_subdirectory(cmake) if (USE_PRECOMPILED_HEADERS) diff --git a/indra/cmake/LLAddBuildTest.cmake b/indra/cmake/LLAddBuildTest.cmake index 4959051617..bd2f894c97 100644 --- a/indra/cmake/LLAddBuildTest.cmake +++ b/indra/cmake/LLAddBuildTest.cmake @@ -1,4 +1,11 @@ # -*- cmake -*- + +include_guard() + +if( NOT LL_TESTS ) + return() +endif() + include(00-Common) include(LLTestCommand) include(bugsplat) @@ -26,8 +33,6 @@ MACRO(LL_ADD_PROJECT_UNIT_TESTS project sources) #project(UNITTEST_PROJECT_${project}) # Setup includes, paths, etc set(alltest_SOURCE_FILES - ${CMAKE_SOURCE_DIR}/test/test.cpp - ${CMAKE_SOURCE_DIR}/test/lltut.cpp ) set(alltest_DEP_TARGETS # needed by the test harness itself @@ -35,6 +40,7 @@ MACRO(LL_ADD_PROJECT_UNIT_TESTS project sources) ) set(alltest_LIBRARIES + lltut_runner_lib llcommon ) if(NOT "${project}" STREQUAL "llmath") @@ -137,6 +143,7 @@ MACRO(LL_ADD_PROJECT_UNIT_TESTS project sources) # test binaries always need to be signed for local development set_target_properties(PROJECT_${project}_TEST_${name} PROPERTIES + OSX_ARCHITECTURES ${LL_MACOS_TEST_ARCHITECTURE} XCODE_ATTRIBUTE_CODE_SIGN_IDENTITY "-") endif () @@ -159,24 +166,15 @@ MACRO(LL_ADD_PROJECT_UNIT_TESTS project sources) endif() # Add test - add_custom_command( - OUTPUT ${TEST_OUTPUT} + add_test( + NAME PROJECT_${project}_TEST_${name} COMMAND ${TEST_SCRIPT_CMD} - DEPENDS PROJECT_${project}_TEST_${name} WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} ) - # Why not add custom target and add POST_BUILD command? - # Slightly less uncertain behavior - # (OUTPUT commands run non-deterministically AFAIK) + poppy 2009-04-19 - # > I did not use a post build step as I could not make it notify of a - # > failure after the first time you build and fail a test. - daveh 2009-04-20 + + add_dependencies(BUILD_TESTS PROJECT_${project}_TEST_${name}) list(APPEND ${project}_TEST_OUTPUT ${TEST_OUTPUT}) endforeach (source) - - # Add the test runner target per-project - # (replaces old _test_ok targets all over the place) - add_custom_target(${project}_tests ALL DEPENDS ${${project}_TEST_OUTPUT}) - add_dependencies(${project} ${project}_tests) ENDMACRO(LL_ADD_PROJECT_UNIT_TESTS) #***************************************************************************** @@ -204,12 +202,11 @@ FUNCTION(LL_ADD_INTEGRATION_TEST set(source_files tests/${testname}_test.cpp - ${CMAKE_SOURCE_DIR}/test/test.cpp - ${CMAKE_SOURCE_DIR}/test/lltut.cpp ${additional_source_files} ) set(libraries + lltut_runner_lib ${library_dependencies} ) @@ -239,6 +236,7 @@ FUNCTION(LL_ADD_INTEGRATION_TEST # test binaries always need to be signed for local development set_target_properties(INTEGRATION_TEST_${testname} PROPERTIES + OSX_ARCHITECTURES ${LL_MACOS_TEST_ARCHITECTURE} XCODE_ATTRIBUTE_CODE_SIGN_IDENTITY "-" BUILD_WITH_INSTALL_RPATH 1 INSTALL_RPATH "@executable_path/Resources" @@ -286,14 +284,9 @@ FUNCTION(LL_ADD_INTEGRATION_TEST message(STATUS "TEST_SCRIPT_CMD: ${TEST_SCRIPT_CMD}") endif() - add_custom_command( - TARGET INTEGRATION_TEST_${testname} - POST_BUILD - COMMAND ${TEST_SCRIPT_CMD} - ) + add_test(NAME INTEGRATION_TEST_RUNNER_${testname} COMMAND ${TEST_SCRIPT_CMD}) - # Use CTEST? Not sure how to yet... - # ADD_TEST(INTEGRATION_TEST_RUNNER_${testname} ${TEST_SCRIPT_CMD}) + add_dependencies(BUILD_TESTS INTEGRATION_TEST_${testname}) ENDFUNCTION(LL_ADD_INTEGRATION_TEST) diff --git a/indra/cmake/Variables.cmake b/indra/cmake/Variables.cmake index 2341d15a85..81a8f87cd3 100644 --- a/indra/cmake/Variables.cmake +++ b/indra/cmake/Variables.cmake @@ -198,6 +198,11 @@ if (${CMAKE_SYSTEM_NAME} MATCHES "Darwin") 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 "arm64;x86_64" CACHE STRING "macOS Build Arch" FORCE) + if(CMAKE_SYSTEM_PROCESSOR STREQUAL "arm64") + set(LL_MACOS_TEST_ARCHITECTURE "arm64") + else() + set(LL_MACOS_TEST_ARCHITECTURE "x86_64") + endif() endif (${CMAKE_SYSTEM_NAME} MATCHES "Darwin") # Default deploy grid diff --git a/indra/cmake/run_build_test.py b/indra/cmake/run_build_test.py index 940a130a50..85689b361a 100755 --- a/indra/cmake/run_build_test.py +++ b/indra/cmake/run_build_test.py @@ -133,7 +133,7 @@ def main(command, arguments=[], libpath=[], vars={}): raise # In practice, the pathnames into CMake's build tree are so long as to # obscure the name of the test program. Just log its basename. - log.warn("No such program %s; check for preceding build errors" % \ + log.warning("No such program %s; check for preceding build errors" % \ os.path.basename(command[0])) # What rc should we simulate for missing executable? Windows produces # 9009. diff --git a/indra/integration_tests/llimage_libtest/CMakeLists.txt b/indra/integration_tests/llimage_libtest/CMakeLists.txt index e6ff142626..40837c8abb 100644 --- a/indra/integration_tests/llimage_libtest/CMakeLists.txt +++ b/indra/integration_tests/llimage_libtest/CMakeLists.txt @@ -9,7 +9,6 @@ include(00-Common) include(LLCommon) include(LLImage) include(LLMath) -include(LLKDU) set(llimage_libtest_SOURCE_FILES llimage_libtest.cpp @@ -26,6 +25,18 @@ add_executable(llimage_libtest ${llimage_libtest_SOURCE_FILES} ) +set_target_properties(llimage_libtest + PROPERTIES + FOLDER "Tests" + ) + +if(DARWIN) + set_target_properties(llimage_libtest + PROPERTIES + OSX_ARCHITECTURES ${LL_MACOS_TEST_ARCHITECTURE} + ) +endif() + # Libraries on which this application depends on # Sort by high-level to low-level target_link_libraries(llimage_libtest diff --git a/indra/integration_tests/llui_libtest/CMakeLists.txt b/indra/integration_tests/llui_libtest/CMakeLists.txt index a6ce657f4f..19ae1ae215 100644 --- a/indra/integration_tests/llui_libtest/CMakeLists.txt +++ b/indra/integration_tests/llui_libtest/CMakeLists.txt @@ -49,9 +49,14 @@ target_link_libraries(llui_libtest llimagej2coj ) +set_target_properties(llui_libtest + PROPERTIES + FOLDER "Tests" + ) + if (WINDOWS) set_target_properties(llui_libtest - PROPERTIES + PROPERTIES LINK_FLAGS "/NODEFAULTLIB:LIBCMT" ) @@ -66,6 +71,13 @@ if (WINDOWS) ) endif (WINDOWS) +if(DARWIN) + set_target_properties(llui_libtest + PROPERTIES + OSX_ARCHITECTURES ${LL_MACOS_TEST_ARCHITECTURE} + ) +endif() + # Ensure people working on the viewer don't break this library # *NOTE: This could be removed, or only built by Parabuild, if the build # and link times become too long. JC diff --git a/indra/llcorehttp/CMakeLists.txt b/indra/llcorehttp/CMakeLists.txt index 46503a8a4b..58bbdb2d9a 100644 --- a/indra/llcorehttp/CMakeLists.txt +++ b/indra/llcorehttp/CMakeLists.txt @@ -169,6 +169,13 @@ if (LL_TESTS AND LLCOREHTTP_TESTS) ) endif (WINDOWS) + if(DARWIN) + set_target_properties(http_texture_load + PROPERTIES + OSX_ARCHITECTURES ${LL_MACOS_TEST_ARCHITECTURE} + ) + endif() + target_link_libraries(http_texture_load ${example_libs}) endif (LL_TESTS AND LLCOREHTTP_TESTS) diff --git a/indra/test/CMakeLists.txt b/indra/test/CMakeLists.txt index f80286a630..a3cf762f90 100644 --- a/indra/test/CMakeLists.txt +++ b/indra/test/CMakeLists.txt @@ -10,6 +10,27 @@ include(Tut) include(LLAddBuildTest) include(bugsplat) +set(test_lib_SOURCE_FILES + lltut.cpp + test.cpp + ) + +set(test_lib_HEADER_FILES + CMakeLists.txt + lltut.h + ) + +list(APPEND test_lib_SOURCE_FILES ${test_lib_HEADER_FILES}) + +add_library(lltut_runner_lib ${test_lib_SOURCE_FILES}) + +target_link_libraries(lltut_runner_lib PRIVATE llcommon) + +set_target_properties(lltut_runner_lib + PROPERTIES + FOLDER "Tests" + ) + set(test_SOURCE_FILES io.cpp llapp_tut.cpp @@ -31,9 +52,7 @@ set(test_SOURCE_FILES llservicebuilder_tut.cpp llstreamtools_tut.cpp lltemplatemessagebuilder_tut.cpp - lltut.cpp message_tut.cpp - test.cpp ) set(test_HEADER_FILES @@ -57,6 +76,7 @@ list(APPEND test_SOURCE_FILES ${test_HEADER_FILES}) add_executable(lltest ${test_SOURCE_FILES}) target_link_libraries(lltest + lltut_runner_lib llinventory llmessage llmath @@ -66,14 +86,27 @@ target_link_libraries(lltest llcorehttp ) +set_target_properties(lltest + PROPERTIES + FOLDER "Tests" + ) + 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}" ) elseif (DARWIN) + set_target_properties(lltut_runner_lib + PROPERTIES + OSX_ARCHITECTURES ${LL_MACOS_TEST_ARCHITECTURE} + ) + set_target_properties(lltest + PROPERTIES + OSX_ARCHITECTURES ${LL_MACOS_TEST_ARCHITECTURE} + ) # Support our "@executable_path/../Resources" load path for our test # executable. This SHOULD properly be "$/Resources", # but the CMake $ generator expression isn't evaluated by @@ -82,32 +115,24 @@ elseif (DARWIN) SYMBOLIC) endif (WINDOWS) -set(TEST_EXE $) - -SET_TEST_PATH(LD_LIBRARY_PATH) +# 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 +# developers choose to disable LL_TESTS. +if (LL_TESTS) + set(TEST_EXE $) -LL_TEST_COMMAND(command - "${LD_LIBRARY_PATH}" - "${TEST_EXE}" - "--output=${CMAKE_CURRENT_BINARY_DIR}/cpp_test_results.txt" - "--touch=${CMAKE_CURRENT_BINARY_DIR}/cpp_tests_ok.txt") + SET_TEST_PATH(LD_LIBRARY_PATH) -ADD_CUSTOM_COMMAND( - OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/cpp_tests_ok.txt - COMMAND ${command} - DEPENDS lltest - WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} - COMMENT "C++ unit tests" - ) + LL_TEST_COMMAND(command + "${LD_LIBRARY_PATH}" + "${TEST_EXE}" + "--output=${CMAKE_CURRENT_BINARY_DIR}/cpp_test_results.txt" + "--touch=${CMAKE_CURRENT_BINARY_DIR}/cpp_tests_ok.txt") -set(test_results ${CMAKE_CURRENT_BINARY_DIR}/cpp_tests_ok.txt) + add_test(NAME "C++ unit tests" COMMAND ${command} WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}) -# 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 -# developers choose to disable LL_TESTS. -if (LL_TESTS) - add_custom_target(tests_ok ALL DEPENDS ${test_results}) + add_dependencies(BUILD_TESTS lltest) if(DARWIN) # Support our "@executable_path/../Resources" load path for our test # executable. This SHOULD properly be "$/Resources", -- cgit v1.3 From 55d9a8c49547f30157edc68c65dff7c44bf513c2 Mon Sep 17 00:00:00 2001 From: Rye Date: Mon, 27 Oct 2025 03:15:41 -0400 Subject: Update openjpeg to 2.5.4-r1 Signed-off-by: Rye --- autobuild.xml | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'autobuild.xml') diff --git a/autobuild.xml b/autobuild.xml index 4dcb2e7d3a..0bab71a29a 100644 --- a/autobuild.xml +++ b/autobuild.xml @@ -1854,11 +1854,11 @@ Copyright (c) 2012, 2014, 2015, 2016 nghttp2 contributors archive hash - 94a72c6ddbfb23796ce913c55bc47c128542a582 + 8dc190451c5b7af0d72e7ab54f8fbde6dccf79c6 hash_algorithm sha1 url - https://github.com/secondlife/3p-openjpeg/releases/download/v2.5.3-r1/openjpeg-2.5.3.15590356935-darwin64-15590356935.tar.zst + https://github.com/secondlife/3p-openjpeg/releases/download/v2.5.4-r1/openjpeg-2.5.4.18754730947-darwin64-18754730947.tar.zst name darwin64 @@ -1868,11 +1868,11 @@ Copyright (c) 2012, 2014, 2015, 2016 nghttp2 contributors archive hash - 751172af405f4a47a3aebb37729d62229cab6c07 + 9c89879f81ee0434e1f59c47d74a25958ae08e9e hash_algorithm sha1 url - https://github.com/secondlife/3p-openjpeg/releases/download/v2.5.3-r1/openjpeg-2.5.3.15590356935-linux64-15590356935.tar.zst + https://github.com/secondlife/3p-openjpeg/releases/download/v2.5.4-r1/openjpeg-2.5.4.18754730947-linux64-18754730947.tar.zst name linux64 @@ -1882,11 +1882,11 @@ Copyright (c) 2012, 2014, 2015, 2016 nghttp2 contributors archive hash - 8aab9cf250dfee252386e1c79b5205e6d3b3e19e + b78887212f18ae59dc7961e0e1af781e568bd92c hash_algorithm sha1 url - https://github.com/secondlife/3p-openjpeg/releases/download/v2.5.3-r1/openjpeg-2.5.3.15590356935-windows64-15590356935.tar.zst + https://github.com/secondlife/3p-openjpeg/releases/download/v2.5.4-r1/openjpeg-2.5.4.18754730947-windows64-18754730947.tar.zst name windows64 @@ -1899,7 +1899,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.3.15590356935 + 2.5.4.18754730947 name openjpeg description -- cgit v1.3 From b25ca9b2941d7dcafbba840571fdf0a66cf212eb Mon Sep 17 00:00:00 2001 From: Rye Date: Fri, 31 Oct 2025 07:46:03 -0400 Subject: Rework and modernize GL function/extension initialization for better wayland compatability Signed-off-by: Rye --- autobuild.xml | 38 +- indra/cmake/CMakeLists.txt | 1 - indra/cmake/GLEXT.cmake | 3 +- indra/cmake/GLH.cmake | 7 - indra/llrender/CMakeLists.txt | 10 +- indra/llrender/llgl.cpp | 1799 +++++++++++++--------------- indra/llrender/llgl.h | 83 +- indra/llrender/llglheaders.h | 557 +++------ indra/llrender/llimagegl.cpp | 2 +- indra/llwindow/llwindowwin32.cpp | 17 +- indra/llwindow/llwindowwin32.h | 3 + indra/newview/llgltfmaterialpreviewmgr.cpp | 2 +- indra/newview/llviewerjointmesh.cpp | 6 - 13 files changed, 1059 insertions(+), 1469 deletions(-) delete mode 100644 indra/cmake/GLH.cmake (limited to 'autobuild.xml') diff --git a/autobuild.xml b/autobuild.xml index 0bab71a29a..aff507828e 100644 --- a/autobuild.xml +++ b/autobuild.xml @@ -666,11 +666,11 @@ archive hash - 7cc58b3acb230a7e65ea5f0ff800be393eb4aa1b + 90eade4785ee8acf18837125208b717f7e857d06 hash_algorithm sha1 url - https://github.com/secondlife/3p-glext/releases/download/v69/glext-68-common-685b36e.tar.zst + https://github.com/secondlife/3p-glext/releases/download/v2025.10.27-r1/glext-2025.10.27-common-18888617188.tar.zst name common @@ -683,44 +683,12 @@ copyright Copyright (c) 2007-2010 The Khronos Group Inc. version - 68 + 2025.10.27 name glext description glext headers define function prototypes and constants for OpenGL extensions - glh_linear - - platforms - - common - - archive - - hash - 066625e7aa7f697a4b6cd461aad960c57181011f - hash_algorithm - sha1 - url - https://github.com/secondlife/3p-glh_linear/releases/download/v1.0.1-dev4-984c397/glh_linear-1.0.1-dev4-common-984c397.tar.zst - - name - common - - - license - BSD - license_file - LICENSES/glh-linear.txt - copyright - Copyright (c) 2000 Cass Everitt - version - 1.0.1-dev4 - name - glh_linear - description - glh - is a platform-indepenedent C++ OpenGL helper library - glm platforms diff --git a/indra/cmake/CMakeLists.txt b/indra/cmake/CMakeLists.txt index 5847553993..fa5008c373 100644 --- a/indra/cmake/CMakeLists.txt +++ b/indra/cmake/CMakeLists.txt @@ -26,7 +26,6 @@ set(cmake_SOURCE_FILES FindPipeWire.cmake FreeType.cmake GLEXT.cmake - GLH.cmake GLIB.cmake GLM.cmake GStreamer10Plugin.cmake diff --git a/indra/cmake/GLEXT.cmake b/indra/cmake/GLEXT.cmake index a780966f0c..2124cc2fc8 100644 --- a/indra/cmake/GLEXT.cmake +++ b/indra/cmake/GLEXT.cmake @@ -1,8 +1,7 @@ # -*- cmake -*- include(Prebuilt) -include(GLH) -add_library( ll::glext INTERFACE IMPORTED ) +add_library(ll::glext INTERFACE IMPORTED) use_system_binary(glext) use_prebuilt_binary(glext) diff --git a/indra/cmake/GLH.cmake b/indra/cmake/GLH.cmake deleted file mode 100644 index 0cefc3543a..0000000000 --- a/indra/cmake/GLH.cmake +++ /dev/null @@ -1,7 +0,0 @@ -# -*- cmake -*- -include(Prebuilt) - -add_library( ll::glh_linear INTERFACE IMPORTED ) - -use_system_binary( glh_linear ) -use_prebuilt_binary(glh_linear) diff --git a/indra/llrender/CMakeLists.txt b/indra/llrender/CMakeLists.txt index 77af0693f3..2449c0d0bf 100644 --- a/indra/llrender/CMakeLists.txt +++ b/indra/llrender/CMakeLists.txt @@ -74,7 +74,7 @@ if (BUILD_HEADLESS) add_library (llrenderheadless ${llrender_SOURCE_FILES} ) - target_include_directories( llrenderheadless INTERFACE ${CMAKE_CURRENT_SOURCE_DIR}) + target_include_directories(llrenderheadless INTERFACE ${CMAKE_CURRENT_SOURCE_DIR}) target_link_libraries(llrenderheadless llcommon @@ -93,7 +93,7 @@ if (BUILD_HEADLESS) endif (BUILD_HEADLESS) add_library (llrender ${llrender_SOURCE_FILES}) -target_include_directories( llrender INTERFACE ${CMAKE_CURRENT_SOURCE_DIR}) +target_include_directories(llrender INTERFACE ${CMAKE_CURRENT_SOURCE_DIR}) # Libraries on which this library depends, needed for Linux builds # Sort by high-level to low-level @@ -105,9 +105,15 @@ target_link_libraries(llrender llxml llwindow ll::freetype + ) + +if (NOT USE_SDL_WINDOW) +target_link_libraries(llrender OpenGL::GL ) +endif() + if (USE_PRECOMPILED_HEADERS) target_precompile_headers(llrender REUSE_FROM llprecompiled) endif () diff --git a/indra/llrender/llgl.cpp b/indra/llrender/llgl.cpp index 22d244d552..f5f70c2935 100644 --- a/indra/llrender/llgl.cpp +++ b/indra/llrender/llgl.cpp @@ -27,8 +27,6 @@ // This file sets some global GL parameters, and implements some // useful functions for GL operations. -#define GLH_EXT_SINGLE_FILE - #include "linden_common.h" #include "boost/tokenizer.hpp" @@ -54,6 +52,17 @@ #include #include "glm/gtc/type_ptr.hpp" +#if LL_MESA +# include "GL/osmesa.h" +# define LL_GET_PROC_ADDRESS(func) OSMesaGetProcAddress(func) +#elif LL_SDL_WINDOW +# include "SDL3/SDL.h" +# define LL_GET_PROC_ADDRESS(func) SDL_GL_GetProcAddress(func) +#elif LL_WINDOWS +# include "llwindowwin32.h" +# define LL_GET_PROC_ADDRESS(func) LLWindowWin32::getProcAddress(func) +#endif + #if LL_WINDOWS #include "lldxhardware.h" #endif @@ -62,10 +71,8 @@ //#define GL_STATE_VERIFY #endif - bool gDebugSession = false; bool gDebugGLSession = false; -bool gClothRipple = false; bool gHeadlessClient = false; bool gNonInteractive = false; bool gGLActive = false; @@ -211,11 +218,16 @@ void ll_close_fail_log() LLMatrix4 gGLObliqueProjectionInverse; -#define LL_GL_NAME_POOLING 0 - std::list LLGLUpdate::sGLQ; +#if LL_GL_FUNC_POINTER + #if LL_WINDOWS +// WGL_ARB_pixel_format +PFNWGLGETPIXELFORMATATTRIBIVARBPROC wglGetPixelFormatAttribivARB = nullptr; +PFNWGLGETPIXELFORMATATTRIBFVARBPROC wglGetPixelFormatAttribfvARB = nullptr; +PFNWGLCHOOSEPIXELFORMATARBPROC wglChoosePixelFormatARB = nullptr; + // WGL_ARB_create_context PFNWGLCREATECONTEXTATTRIBSARBPROC wglCreateContextAttribsARB = nullptr; @@ -233,12 +245,80 @@ PFNWGLBLITCONTEXTFRAMEBUFFERAMDPROC wglBlitContextFramebufferAMD = n // WGL_EXT_swap_control PFNWGLSWAPINTERVALEXTPROC wglSwapIntervalEXT = nullptr; PFNWGLGETSWAPINTERVALEXTPROC wglGetSwapIntervalEXT = nullptr; +#endif + +// GL_VERSION_1_0 +PFNGLCLEARCOLORPROC glClearColor = nullptr; +PFNGLCLEARPROC glClear = nullptr; +PFNGLCOLORMASKPROC glColorMask = nullptr; +PFNGLBLENDFUNCPROC glBlendFunc = nullptr; +PFNGLLOGICOPPROC glLogicOp = nullptr; +PFNGLFRONTFACEPROC glFrontFace = nullptr; +PFNGLCULLFACEPROC glCullFace = nullptr; +PFNGLPOINTSIZEPROC glPointSize = nullptr; +PFNGLLINEWIDTHPROC glLineWidth = nullptr; +PFNGLPOLYGONMODEPROC glPolygonMode = nullptr; +PFNGLSCISSORPROC glScissor = nullptr; +PFNGLDRAWBUFFERPROC glDrawBuffer = nullptr; +PFNGLREADBUFFERPROC glReadBuffer = nullptr; +PFNGLENABLEPROC glEnable = nullptr; +PFNGLDISABLEPROC glDisable = nullptr; +PFNGLISENABLEDPROC glIsEnabled = nullptr; +PFNGLGETBOOLEANVPROC glGetBooleanv = nullptr; +PFNGLGETDOUBLEVPROC glGetDoublev = nullptr; +PFNGLGETFLOATVPROC glGetFloatv = nullptr; +PFNGLGETINTEGERVPROC glGetIntegerv = nullptr; +PFNGLGETERRORPROC glGetError = nullptr; +PFNGLGETSTRINGPROC glGetString = nullptr; +PFNGLFINISHPROC glFinish = nullptr; +PFNGLFLUSHPROC glFlush = nullptr; +PFNGLHINTPROC glHint = nullptr; +PFNGLCLEARDEPTHPROC glClearDepth = nullptr; +PFNGLDEPTHFUNCPROC glDepthFunc = nullptr; +PFNGLDEPTHMASKPROC glDepthMask = nullptr; +PFNGLDEPTHRANGEPROC glDepthRange = nullptr; +PFNGLVIEWPORTPROC glViewport = nullptr; +PFNGLPIXELSTOREFPROC glPixelStoref = nullptr; +PFNGLPIXELSTOREIPROC glPixelStorei = nullptr; +PFNGLREADPIXELSPROC glReadPixels = nullptr; +PFNGLSTENCILFUNCPROC glStencilFunc = nullptr; +PFNGLSTENCILMASKPROC glStencilMask = nullptr; +PFNGLSTENCILOPPROC glStencilOp = nullptr; +PFNGLCLEARSTENCILPROC glClearStencil = nullptr; +PFNGLTEXPARAMETERFPROC glTexParameterf = nullptr; +PFNGLTEXPARAMETERIPROC glTexParameteri = nullptr; +PFNGLTEXPARAMETERFVPROC glTexParameterfv = nullptr; +PFNGLTEXPARAMETERIVPROC glTexParameteriv = nullptr; +PFNGLGETTEXPARAMETERFVPROC glGetTexParameterfv = nullptr; +PFNGLGETTEXPARAMETERIVPROC glGetTexParameteriv = nullptr; +PFNGLGETTEXLEVELPARAMETERFVPROC glGetTexLevelParameterfv = nullptr; +PFNGLGETTEXLEVELPARAMETERIVPROC glGetTexLevelParameteriv = nullptr; +PFNGLTEXIMAGE1DPROC glTexImage1D = nullptr; +PFNGLTEXIMAGE2DPROC glTexImage2D = nullptr; +PFNGLGETTEXIMAGEPROC glGetTexImage = nullptr; + +// GL_VERSION_1_1 +PFNGLDRAWARRAYSPROC glDrawArrays = nullptr; +PFNGLDRAWELEMENTSPROC glDrawElements = nullptr; +PFNGLGETPOINTERVPROC glGetPointerv = nullptr; +PFNGLPOLYGONOFFSETPROC glPolygonOffset = nullptr; +PFNGLCOPYTEXIMAGE1DPROC glCopyTexImage1D = nullptr; +PFNGLCOPYTEXIMAGE2DPROC glCopyTexImage2D = nullptr; +PFNGLCOPYTEXSUBIMAGE1DPROC glCopyTexSubImage1D = nullptr; +PFNGLCOPYTEXSUBIMAGE2DPROC glCopyTexSubImage2D = nullptr; +PFNGLTEXSUBIMAGE1DPROC glTexSubImage1D = nullptr; +PFNGLTEXSUBIMAGE2DPROC glTexSubImage2D = nullptr; +PFNGLBINDTEXTUREPROC glBindTexture = nullptr; +PFNGLDELETETEXTURESPROC glDeleteTextures = nullptr; +PFNGLGENTEXTURESPROC glGenTextures = nullptr; +PFNGLISTEXTUREPROC glIsTexture = nullptr; + // GL_VERSION_1_2 -//PFNGLDRAWRANGEELEMENTSPROC glDrawRangeElements = nullptr; -//PFNGLTEXIMAGE3DPROC glTexImage3D = nullptr; -//PFNGLTEXSUBIMAGE3DPROC glTexSubImage3D = nullptr; -//PFNGLCOPYTEXSUBIMAGE3DPROC glCopyTexSubImage3D = nullptr; +PFNGLDRAWRANGEELEMENTSPROC glDrawRangeElements = nullptr; +PFNGLTEXIMAGE3DPROC glTexImage3D = nullptr; +PFNGLTEXSUBIMAGE3DPROC glTexSubImage3D = nullptr; +PFNGLCOPYTEXSUBIMAGE3DPROC glCopyTexSubImage3D = nullptr; // GL_VERSION_1_3 PFNGLACTIVETEXTUREPROC glActiveTexture = nullptr; @@ -250,43 +330,6 @@ PFNGLCOMPRESSEDTEXSUBIMAGE3DPROC glCompressedTexSubImage3D = nullptr; PFNGLCOMPRESSEDTEXSUBIMAGE2DPROC glCompressedTexSubImage2D = nullptr; PFNGLCOMPRESSEDTEXSUBIMAGE1DPROC glCompressedTexSubImage1D = nullptr; PFNGLGETCOMPRESSEDTEXIMAGEPROC glGetCompressedTexImage = nullptr; -PFNGLCLIENTACTIVETEXTUREPROC glClientActiveTexture = nullptr; -PFNGLMULTITEXCOORD1DPROC glMultiTexCoord1d = nullptr; -PFNGLMULTITEXCOORD1DVPROC glMultiTexCoord1dv = nullptr; -PFNGLMULTITEXCOORD1FPROC glMultiTexCoord1f = nullptr; -PFNGLMULTITEXCOORD1FVPROC glMultiTexCoord1fv = nullptr; -PFNGLMULTITEXCOORD1IPROC glMultiTexCoord1i = nullptr; -PFNGLMULTITEXCOORD1IVPROC glMultiTexCoord1iv = nullptr; -PFNGLMULTITEXCOORD1SPROC glMultiTexCoord1s = nullptr; -PFNGLMULTITEXCOORD1SVPROC glMultiTexCoord1sv = nullptr; -PFNGLMULTITEXCOORD2DPROC glMultiTexCoord2d = nullptr; -PFNGLMULTITEXCOORD2DVPROC glMultiTexCoord2dv = nullptr; -PFNGLMULTITEXCOORD2FPROC glMultiTexCoord2f = nullptr; -PFNGLMULTITEXCOORD2FVPROC glMultiTexCoord2fv = nullptr; -PFNGLMULTITEXCOORD2IPROC glMultiTexCoord2i = nullptr; -PFNGLMULTITEXCOORD2IVPROC glMultiTexCoord2iv = nullptr; -PFNGLMULTITEXCOORD2SPROC glMultiTexCoord2s = nullptr; -PFNGLMULTITEXCOORD2SVPROC glMultiTexCoord2sv = nullptr; -PFNGLMULTITEXCOORD3DPROC glMultiTexCoord3d = nullptr; -PFNGLMULTITEXCOORD3DVPROC glMultiTexCoord3dv = nullptr; -PFNGLMULTITEXCOORD3FPROC glMultiTexCoord3f = nullptr; -PFNGLMULTITEXCOORD3FVPROC glMultiTexCoord3fv = nullptr; -PFNGLMULTITEXCOORD3IPROC glMultiTexCoord3i = nullptr; -PFNGLMULTITEXCOORD3IVPROC glMultiTexCoord3iv = nullptr; -PFNGLMULTITEXCOORD3SPROC glMultiTexCoord3s = nullptr; -PFNGLMULTITEXCOORD3SVPROC glMultiTexCoord3sv = nullptr; -PFNGLMULTITEXCOORD4DPROC glMultiTexCoord4d = nullptr; -PFNGLMULTITEXCOORD4DVPROC glMultiTexCoord4dv = nullptr; -PFNGLMULTITEXCOORD4FPROC glMultiTexCoord4f = nullptr; -PFNGLMULTITEXCOORD4FVPROC glMultiTexCoord4fv = nullptr; -PFNGLMULTITEXCOORD4IPROC glMultiTexCoord4i = nullptr; -PFNGLMULTITEXCOORD4IVPROC glMultiTexCoord4iv = nullptr; -PFNGLMULTITEXCOORD4SPROC glMultiTexCoord4s = nullptr; -PFNGLMULTITEXCOORD4SVPROC glMultiTexCoord4sv = nullptr; -PFNGLLOADTRANSPOSEMATRIXFPROC glLoadTransposeMatrixf = nullptr; -PFNGLLOADTRANSPOSEMATRIXDPROC glLoadTransposeMatrixd = nullptr; -PFNGLMULTTRANSPOSEMATRIXFPROC glMultTransposeMatrixf = nullptr; -PFNGLMULTTRANSPOSEMATRIXDPROC glMultTransposeMatrixd = nullptr; // GL_VERSION_1_4 PFNGLBLENDFUNCSEPARATEPROC glBlendFuncSeparate = nullptr; @@ -296,44 +339,6 @@ PFNGLPOINTPARAMETERFPROC glPointParameterf = nullptr; PFNGLPOINTPARAMETERFVPROC glPointParameterfv = nullptr; PFNGLPOINTPARAMETERIPROC glPointParameteri = nullptr; PFNGLPOINTPARAMETERIVPROC glPointParameteriv = nullptr; -PFNGLFOGCOORDFPROC glFogCoordf = nullptr; -PFNGLFOGCOORDFVPROC glFogCoordfv = nullptr; -PFNGLFOGCOORDDPROC glFogCoordd = nullptr; -PFNGLFOGCOORDDVPROC glFogCoorddv = nullptr; -PFNGLFOGCOORDPOINTERPROC glFogCoordPointer = nullptr; -PFNGLSECONDARYCOLOR3BPROC glSecondaryColor3b = nullptr; -PFNGLSECONDARYCOLOR3BVPROC glSecondaryColor3bv = nullptr; -PFNGLSECONDARYCOLOR3DPROC glSecondaryColor3d = nullptr; -PFNGLSECONDARYCOLOR3DVPROC glSecondaryColor3dv = nullptr; -PFNGLSECONDARYCOLOR3FPROC glSecondaryColor3f = nullptr; -PFNGLSECONDARYCOLOR3FVPROC glSecondaryColor3fv = nullptr; -PFNGLSECONDARYCOLOR3IPROC glSecondaryColor3i = nullptr; -PFNGLSECONDARYCOLOR3IVPROC glSecondaryColor3iv = nullptr; -PFNGLSECONDARYCOLOR3SPROC glSecondaryColor3s = nullptr; -PFNGLSECONDARYCOLOR3SVPROC glSecondaryColor3sv = nullptr; -PFNGLSECONDARYCOLOR3UBPROC glSecondaryColor3ub = nullptr; -PFNGLSECONDARYCOLOR3UBVPROC glSecondaryColor3ubv = nullptr; -PFNGLSECONDARYCOLOR3UIPROC glSecondaryColor3ui = nullptr; -PFNGLSECONDARYCOLOR3UIVPROC glSecondaryColor3uiv = nullptr; -PFNGLSECONDARYCOLOR3USPROC glSecondaryColor3us = nullptr; -PFNGLSECONDARYCOLOR3USVPROC glSecondaryColor3usv = nullptr; -PFNGLSECONDARYCOLORPOINTERPROC glSecondaryColorPointer = nullptr; -PFNGLWINDOWPOS2DPROC glWindowPos2d = nullptr; -PFNGLWINDOWPOS2DVPROC glWindowPos2dv = nullptr; -PFNGLWINDOWPOS2FPROC glWindowPos2f = nullptr; -PFNGLWINDOWPOS2FVPROC glWindowPos2fv = nullptr; -PFNGLWINDOWPOS2IPROC glWindowPos2i = nullptr; -PFNGLWINDOWPOS2IVPROC glWindowPos2iv = nullptr; -PFNGLWINDOWPOS2SPROC glWindowPos2s = nullptr; -PFNGLWINDOWPOS2SVPROC glWindowPos2sv = nullptr; -PFNGLWINDOWPOS3DPROC glWindowPos3d = nullptr; -PFNGLWINDOWPOS3DVPROC glWindowPos3dv = nullptr; -PFNGLWINDOWPOS3FPROC glWindowPos3f = nullptr; -PFNGLWINDOWPOS3FVPROC glWindowPos3fv = nullptr; -PFNGLWINDOWPOS3IPROC glWindowPos3i = nullptr; -PFNGLWINDOWPOS3IVPROC glWindowPos3iv = nullptr; -PFNGLWINDOWPOS3SPROC glWindowPos3s = nullptr; -PFNGLWINDOWPOS3SVPROC glWindowPos3sv = nullptr; // GL_VERSION_1_5 PFNGLGENQUERIESPROC glGenQueries = nullptr; @@ -609,36 +614,6 @@ PFNGLVERTEXATTRIBP3UIPROC glVertexAttribP3ui = nullptr; PFNGLVERTEXATTRIBP3UIVPROC glVertexAttribP3uiv = nullptr; PFNGLVERTEXATTRIBP4UIPROC glVertexAttribP4ui = nullptr; PFNGLVERTEXATTRIBP4UIVPROC glVertexAttribP4uiv = nullptr; -PFNGLVERTEXP2UIPROC glVertexP2ui = nullptr; -PFNGLVERTEXP2UIVPROC glVertexP2uiv = nullptr; -PFNGLVERTEXP3UIPROC glVertexP3ui = nullptr; -PFNGLVERTEXP3UIVPROC glVertexP3uiv = nullptr; -PFNGLVERTEXP4UIPROC glVertexP4ui = nullptr; -PFNGLVERTEXP4UIVPROC glVertexP4uiv = nullptr; -PFNGLTEXCOORDP1UIPROC glTexCoordP1ui = nullptr; -PFNGLTEXCOORDP1UIVPROC glTexCoordP1uiv = nullptr; -PFNGLTEXCOORDP2UIPROC glTexCoordP2ui = nullptr; -PFNGLTEXCOORDP2UIVPROC glTexCoordP2uiv = nullptr; -PFNGLTEXCOORDP3UIPROC glTexCoordP3ui = nullptr; -PFNGLTEXCOORDP3UIVPROC glTexCoordP3uiv = nullptr; -PFNGLTEXCOORDP4UIPROC glTexCoordP4ui = nullptr; -PFNGLTEXCOORDP4UIVPROC glTexCoordP4uiv = nullptr; -PFNGLMULTITEXCOORDP1UIPROC glMultiTexCoordP1ui = nullptr; -PFNGLMULTITEXCOORDP1UIVPROC glMultiTexCoordP1uiv = nullptr; -PFNGLMULTITEXCOORDP2UIPROC glMultiTexCoordP2ui = nullptr; -PFNGLMULTITEXCOORDP2UIVPROC glMultiTexCoordP2uiv = nullptr; -PFNGLMULTITEXCOORDP3UIPROC glMultiTexCoordP3ui = nullptr; -PFNGLMULTITEXCOORDP3UIVPROC glMultiTexCoordP3uiv = nullptr; -PFNGLMULTITEXCOORDP4UIPROC glMultiTexCoordP4ui = nullptr; -PFNGLMULTITEXCOORDP4UIVPROC glMultiTexCoordP4uiv = nullptr; -PFNGLNORMALP3UIPROC glNormalP3ui = nullptr; -PFNGLNORMALP3UIVPROC glNormalP3uiv = nullptr; -PFNGLCOLORP3UIPROC glColorP3ui = nullptr; -PFNGLCOLORP3UIVPROC glColorP3uiv = nullptr; -PFNGLCOLORP4UIPROC glColorP4ui = nullptr; -PFNGLCOLORP4UIVPROC glColorP4uiv = nullptr; -PFNGLSECONDARYCOLORP3UIPROC glSecondaryColorP3ui = nullptr; -PFNGLSECONDARYCOLORP3UIVPROC glSecondaryColorP3uiv = nullptr; // GL_VERSION_4_0 PFNGLMINSAMPLESHADINGPROC glMinSampleShading = nullptr; @@ -958,18 +933,6 @@ PFNGLGETNUNIFORMFVPROC glGetnUniformfv = nullp PFNGLGETNUNIFORMIVPROC glGetnUniformiv = nullptr; PFNGLGETNUNIFORMUIVPROC glGetnUniformuiv = nullptr; PFNGLREADNPIXELSPROC glReadnPixels = nullptr; -PFNGLGETNMAPDVPROC glGetnMapdv = nullptr; -PFNGLGETNMAPFVPROC glGetnMapfv = nullptr; -PFNGLGETNMAPIVPROC glGetnMapiv = nullptr; -PFNGLGETNPIXELMAPFVPROC glGetnPixelMapfv = nullptr; -PFNGLGETNPIXELMAPUIVPROC glGetnPixelMapuiv = nullptr; -PFNGLGETNPIXELMAPUSVPROC glGetnPixelMapusv = nullptr; -PFNGLGETNPOLYGONSTIPPLEPROC glGetnPolygonStipple = nullptr; -PFNGLGETNCOLORTABLEPROC glGetnColorTable = nullptr; -PFNGLGETNCONVOLUTIONFILTERPROC glGetnConvolutionFilter = nullptr; -PFNGLGETNSEPARABLEFILTERPROC glGetnSeparableFilter = nullptr; -PFNGLGETNHISTOGRAMPROC glGetnHistogram = nullptr; -PFNGLGETNMINMAXPROC glGetnMinmax = nullptr; PFNGLTEXTUREBARRIERPROC glTextureBarrier = nullptr; // GL_VERSION_4_6 @@ -1006,7 +969,8 @@ LLGLManager::LLGLManager() : mGLSLVersionMinor(0), mVRAM(0), mGLMaxVertexRange(0), - mGLMaxIndexRange(0) + mGLMaxIndexRange(0), + mGLMaxTextureSize(0) { } @@ -1016,14 +980,23 @@ LLGLManager::LLGLManager() : void LLGLManager::initWGL() { #if LL_WINDOWS && !LL_MESA_HEADLESS - if (!glh_init_extensions("WGL_ARB_pixel_format")) + reloadExtensionsString(); + + if (mGLExtensions.contains("WGL_ARB_pixel_format")) + { + wglGetPixelFormatAttribivARB = (PFNWGLGETPIXELFORMATATTRIBIVARBPROC)LL_GET_PROC_ADDRESS("wglGetPixelFormatAttribivARB"); + wglGetPixelFormatAttribfvARB = (PFNWGLGETPIXELFORMATATTRIBFVARBPROC)LL_GET_PROC_ADDRESS("wglGetPixelFormatAttribfvARB"); + wglChoosePixelFormatARB = (PFNWGLCHOOSEPIXELFORMATARBPROC)LL_GET_PROC_ADDRESS("wglChoosePixelFormatARB"); + } + else { LL_WARNS("RenderInit") << "No ARB pixel format extensions" << LL_ENDL; } - if (ExtensionExists("WGL_ARB_create_context",gGLHExts.mSysExts)) + // WGL_ARB_create_context + if (mGLExtensions.contains("WGL_ARB_create_context")) { - GLH_EXT_NAME(wglCreateContextAttribsARB) = (PFNWGLCREATECONTEXTATTRIBSARBPROC)GLH_EXT_GET_PROC_ADDRESS("wglCreateContextAttribsARB"); + wglCreateContextAttribsARB = (PFNWGLCREATECONTEXTATTRIBSARBPROC)LL_GET_PROC_ADDRESS("wglCreateContextAttribsARB"); } else { @@ -1032,24 +1005,34 @@ void LLGLManager::initWGL() // For retreiving information per AMD adapter, // because we can't trust curently selected/default one when there are multiple - mHasAMDAssociations = ExtensionExists("WGL_AMD_gpu_association", gGLHExts.mSysExts); + mHasAMDAssociations = mGLExtensions.contains("WGL_AMD_gpu_association"); if (mHasAMDAssociations) { - GLH_EXT_NAME(wglGetGPUIDsAMD) = (PFNWGLGETGPUIDSAMDPROC)GLH_EXT_GET_PROC_ADDRESS("wglGetGPUIDsAMD"); - GLH_EXT_NAME(wglGetGPUInfoAMD) = (PFNWGLGETGPUINFOAMDPROC)GLH_EXT_GET_PROC_ADDRESS("wglGetGPUInfoAMD"); + wglGetGPUIDsAMD = (PFNWGLGETGPUIDSAMDPROC)LL_GET_PROC_ADDRESS("wglGetGPUIDsAMD"); + wglGetGPUInfoAMD = (PFNWGLGETGPUINFOAMDPROC)LL_GET_PROC_ADDRESS("wglGetGPUInfoAMD"); + wglGetContextGPUIDAMD = (PFNWGLGETCONTEXTGPUIDAMDPROC)LL_GET_PROC_ADDRESS("wglGetContextGPUIDAMD"); + wglCreateAssociatedContextAMD = (PFNWGLCREATEASSOCIATEDCONTEXTAMDPROC)LL_GET_PROC_ADDRESS("wglCreateAssociatedContextAMD"); + wglCreateAssociatedContextAttribsAMD = (PFNWGLCREATEASSOCIATEDCONTEXTATTRIBSAMDPROC)LL_GET_PROC_ADDRESS("wglCreateAssociatedContextAttribsAMD"); + wglDeleteAssociatedContextAMD = (PFNWGLDELETEASSOCIATEDCONTEXTAMDPROC)LL_GET_PROC_ADDRESS("wglDeleteAssociatedContextAMD"); + wglMakeAssociatedContextCurrentAMD = (PFNWGLMAKEASSOCIATEDCONTEXTCURRENTAMDPROC)LL_GET_PROC_ADDRESS("wglMakeAssociatedContextCurrentAMD"); + wglGetCurrentAssociatedContextAMD = (PFNWGLGETCURRENTASSOCIATEDCONTEXTAMDPROC)LL_GET_PROC_ADDRESS("wglGetCurrentAssociatedContextAMD"); + wglBlitContextFramebufferAMD = (PFNWGLBLITCONTEXTFRAMEBUFFERAMDPROC)LL_GET_PROC_ADDRESS("wglBlitContextFramebufferAMD"); + } - if (ExtensionExists("WGL_EXT_swap_control", gGLHExts.mSysExts)) + // WGL_EXT_swap_control + if (mGLExtensions.contains("WGL_EXT_swap_control")) { - GLH_EXT_NAME(wglSwapIntervalEXT) = (PFNWGLSWAPINTERVALEXTPROC)GLH_EXT_GET_PROC_ADDRESS("wglSwapIntervalEXT"); + wglSwapIntervalEXT = (PFNWGLSWAPINTERVALEXTPROC)LL_GET_PROC_ADDRESS("wglSwapIntervalEXT"); + wglGetSwapIntervalEXT = (PFNWGLGETSWAPINTERVALEXTPROC)LL_GET_PROC_ADDRESS("wglGetSwapIntervalEXT"); } - if( !glh_init_extensions("WGL_ARB_pbuffer") ) + if(!mGLExtensions.contains("WGL_ARB_pbuffer")) { LL_WARNS("RenderInit") << "No ARB WGL PBuffer extensions" << LL_ENDL; } - if( !glh_init_extensions("WGL_ARB_render_texture") ) + if(!mGLExtensions.contains("WGL_ARB_render_texture")) { LL_WARNS("RenderInit") << "No ARB WGL render texture extensions" << LL_ENDL; } @@ -1064,39 +1047,73 @@ bool LLGLManager::initGL() LL_ERRS("RenderInit") << "Calling init on LLGLManager after already initialized!" << LL_ENDL; } -#if 0 && LL_WINDOWS - if (!glGetStringi) - { - glGetStringi = (PFNGLGETSTRINGIPROC) GLH_EXT_GET_PROC_ADDRESS("glGetStringi"); - } - - //reload extensions string (may have changed after using wglCreateContextAttrib) - if (glGetStringi) - { - std::stringstream str; - - GLint count = 0; - glGetIntegerv(GL_NUM_EXTENSIONS, &count); - for (GLint i = 0; i < count; ++i) - { - std::string ext = ll_safe_string((const char*) glGetStringi(GL_EXTENSIONS, i)); - str << ext << " "; - LL_DEBUGS("GLExtensions") << ext << LL_ENDL; - } - - { - PFNWGLGETEXTENSIONSSTRINGARBPROC wglGetExtensionsStringARB = 0; - wglGetExtensionsStringARB = (PFNWGLGETEXTENSIONSSTRINGARBPROC)wglGetProcAddress("wglGetExtensionsStringARB"); - if(wglGetExtensionsStringARB) - { - str << (const char*) wglGetExtensionsStringARB(wglGetCurrentDC()); - } - } - - free(gGLHExts.mSysExts); - std::string extensions = str.str(); - gGLHExts.mSysExts = strdup(extensions.c_str()); - } +#if LL_GL_FUNC_POINTER + // OpenGL 1.0 and 1.1 always exist + // GL_VERSION_1_0 + glClearColor = (PFNGLCLEARCOLORPROC)LL_GET_PROC_ADDRESS("glClearColor"); + glClear = (PFNGLCLEARPROC)LL_GET_PROC_ADDRESS("glClear"); + glColorMask = (PFNGLCOLORMASKPROC)LL_GET_PROC_ADDRESS("glColorMask"); + glBlendFunc = (PFNGLBLENDFUNCPROC)LL_GET_PROC_ADDRESS("glBlendFunc"); + glLogicOp = (PFNGLLOGICOPPROC)LL_GET_PROC_ADDRESS("glLogicOp"); + glFrontFace = (PFNGLFRONTFACEPROC)LL_GET_PROC_ADDRESS("glFrontFace"); + glCullFace = (PFNGLCULLFACEPROC)LL_GET_PROC_ADDRESS("glCullFace");; + glPointSize = (PFNGLPOINTSIZEPROC)LL_GET_PROC_ADDRESS("glPointSize"); + glLineWidth = (PFNGLLINEWIDTHPROC)LL_GET_PROC_ADDRESS("glLineWidth"); + glPolygonMode = (PFNGLPOLYGONMODEPROC)LL_GET_PROC_ADDRESS("glPolygonMode"); + glScissor = (PFNGLSCISSORPROC)LL_GET_PROC_ADDRESS("glScissor"); + glDrawBuffer = (PFNGLDRAWBUFFERPROC)LL_GET_PROC_ADDRESS("glDrawBuffer"); + glReadBuffer = (PFNGLREADBUFFERPROC)LL_GET_PROC_ADDRESS("glReadBuffer"); + glEnable = (PFNGLENABLEPROC)LL_GET_PROC_ADDRESS("glEnable"); + glDisable = (PFNGLDISABLEPROC)LL_GET_PROC_ADDRESS("glDisable"); + glIsEnabled = (PFNGLISENABLEDPROC)LL_GET_PROC_ADDRESS("glIsEnabled"); + glGetBooleanv = (PFNGLGETBOOLEANVPROC)LL_GET_PROC_ADDRESS("glGetBooleanv"); + glGetDoublev = (PFNGLGETDOUBLEVPROC)LL_GET_PROC_ADDRESS("glGetDoublev"); + glGetFloatv = (PFNGLGETFLOATVPROC)LL_GET_PROC_ADDRESS("glGetFloatv"); + glGetIntegerv = (PFNGLGETINTEGERVPROC)LL_GET_PROC_ADDRESS("glGetIntegerv"); + glGetError = (PFNGLGETERRORPROC)LL_GET_PROC_ADDRESS("glGetError"); + glGetString = (PFNGLGETSTRINGPROC)LL_GET_PROC_ADDRESS("glGetString"); + glFinish = (PFNGLFINISHPROC)LL_GET_PROC_ADDRESS("glFinish"); + glFlush = (PFNGLFLUSHPROC)LL_GET_PROC_ADDRESS("glFlush"); + glHint = (PFNGLHINTPROC)LL_GET_PROC_ADDRESS("glHint"); + glClearDepth = (PFNGLCLEARDEPTHPROC)LL_GET_PROC_ADDRESS("glClearDepth"); + glDepthFunc = (PFNGLDEPTHFUNCPROC)LL_GET_PROC_ADDRESS("glDepthFunc"); + glDepthMask = (PFNGLDEPTHMASKPROC)LL_GET_PROC_ADDRESS("glDepthMask"); + glDepthRange = (PFNGLDEPTHRANGEPROC)LL_GET_PROC_ADDRESS("glDepthRange"); + glViewport = (PFNGLVIEWPORTPROC)LL_GET_PROC_ADDRESS("glViewport"); + glPixelStoref = (PFNGLPIXELSTOREFPROC)LL_GET_PROC_ADDRESS("glPixelStoref"); + glPixelStorei = (PFNGLPIXELSTOREIPROC)LL_GET_PROC_ADDRESS("glPixelStorei"); + glReadPixels = (PFNGLREADPIXELSPROC)LL_GET_PROC_ADDRESS("glReadPixels"); + glStencilFunc = (PFNGLSTENCILFUNCPROC)LL_GET_PROC_ADDRESS("glStencilFunc"); + glStencilMask = (PFNGLSTENCILMASKPROC)LL_GET_PROC_ADDRESS("glStencilMask"); + glStencilOp = (PFNGLSTENCILOPPROC)LL_GET_PROC_ADDRESS("glStencilOp"); + glClearStencil = (PFNGLCLEARSTENCILPROC)LL_GET_PROC_ADDRESS("glClearStencil"); + glTexParameterf = (PFNGLTEXPARAMETERFPROC)LL_GET_PROC_ADDRESS("glTexParameterf"); + glTexParameteri = (PFNGLTEXPARAMETERIPROC)LL_GET_PROC_ADDRESS("glTexParameteri"); + glTexParameterfv = (PFNGLTEXPARAMETERFVPROC)LL_GET_PROC_ADDRESS("glTexParameterfv"); + glTexParameteriv = (PFNGLTEXPARAMETERIVPROC)LL_GET_PROC_ADDRESS("glTexParameteriv"); + glGetTexParameterfv = (PFNGLGETTEXPARAMETERFVPROC)LL_GET_PROC_ADDRESS("glGetTexParameterfv"); + glGetTexParameteriv = (PFNGLGETTEXPARAMETERIVPROC)LL_GET_PROC_ADDRESS("glGetTexParameteriv"); + glGetTexLevelParameterfv = (PFNGLGETTEXLEVELPARAMETERFVPROC)LL_GET_PROC_ADDRESS("glGetTexLevelParameterfv"); + glGetTexLevelParameteriv = (PFNGLGETTEXLEVELPARAMETERIVPROC)LL_GET_PROC_ADDRESS("glGetTexLevelParameteriv"); + glTexImage1D = (PFNGLTEXIMAGE1DPROC)LL_GET_PROC_ADDRESS("glTexImage1D"); + glTexImage2D = (PFNGLTEXIMAGE2DPROC)LL_GET_PROC_ADDRESS("glTexImage2D"); + glGetTexImage = (PFNGLGETTEXIMAGEPROC)LL_GET_PROC_ADDRESS("glGetTexImage"); + + // GL_VERSION_1_1 + glDrawArrays = (PFNGLDRAWARRAYSPROC)LL_GET_PROC_ADDRESS("glDrawArrays"); + glDrawElements = (PFNGLDRAWELEMENTSPROC)LL_GET_PROC_ADDRESS("glDrawElements"); + glGetPointerv = (PFNGLGETPOINTERVPROC)LL_GET_PROC_ADDRESS("glGetPointerv"); + glPolygonOffset = (PFNGLPOLYGONOFFSETPROC)LL_GET_PROC_ADDRESS("glPolygonOffset"); + glCopyTexImage1D = (PFNGLCOPYTEXIMAGE1DPROC)LL_GET_PROC_ADDRESS("glCopyTexImage1D"); + glCopyTexImage2D = (PFNGLCOPYTEXIMAGE2DPROC)LL_GET_PROC_ADDRESS("glCopyTexImage2D"); + glCopyTexSubImage1D = (PFNGLCOPYTEXSUBIMAGE1DPROC)LL_GET_PROC_ADDRESS("glCopyTexSubImage1D"); + glCopyTexSubImage2D = (PFNGLCOPYTEXSUBIMAGE2DPROC)LL_GET_PROC_ADDRESS("glCopyTexSubImage2D"); + glTexSubImage1D = (PFNGLTEXSUBIMAGE1DPROC)LL_GET_PROC_ADDRESS("glTexSubImage1D"); + glTexSubImage2D = (PFNGLTEXSUBIMAGE2DPROC)LL_GET_PROC_ADDRESS("glTexSubImage2D"); + glBindTexture = (PFNGLBINDTEXTUREPROC)LL_GET_PROC_ADDRESS("glBindTexture"); + glDeleteTextures = (PFNGLDELETETEXTURESPROC)LL_GET_PROC_ADDRESS("glDeleteTextures"); + glGenTextures = (PFNGLGENTEXTURESPROC)LL_GET_PROC_ADDRESS("glGenTextures"); + glIsTexture = (PFNGLISTEXTUREPROC)LL_GET_PROC_ADDRESS("glIsTexture"); #endif // Extract video card strings and convert to upper case to @@ -1275,12 +1292,9 @@ void LLGLManager::getGLInfo(LLSD& info) } #if !LL_MESA_HEADLESS - std::string all_exts = ll_safe_string((const char *)gGLHExts.mSysExts); - boost::char_separator sep(" "); - boost::tokenizer > tok(all_exts, sep); - for(boost::tokenizer >::iterator i = tok.begin(); i != tok.end(); ++i) + for (const auto& ext : mGLExtensions) { - info["GLInfo"]["GLExtensions"].append(*i); + info["GLInfo"]["GLExtensions"].append(ext); } #endif } @@ -1303,8 +1317,12 @@ std::string LLGLManager::getGLInfoString() } #if !LL_MESA_HEADLESS - std::string all_exts= ll_safe_string(((const char *)gGLHExts.mSysExts)); - LLStringUtil::replaceChar(all_exts, ' ', '\n'); + std::string all_exts; + for (const auto& ext : mGLExtensions) + { + all_exts += ext; + all_exts += '\n'; + } info_str += std::string("GL_EXTENSIONS:\n") + all_exts + std::string("\n"); #endif @@ -1327,9 +1345,13 @@ void LLGLManager::printGLInfoString() } #if !LL_MESA_HEADLESS - std::string all_exts= ll_safe_string(((const char *)gGLHExts.mSysExts)); - LLStringUtil::replaceChar(all_exts, ' ', '\n'); - LL_DEBUGS("RenderInit") << "GL_EXTENSIONS:\n" << all_exts << LL_ENDL; + std::string all_exts; + for (const auto& ext : mGLExtensions) + { + all_exts += ext; + all_exts += '\n'; + } + LL_INFOS("RenderInit") << "GL_EXTENSIONS:\n" << all_exts << LL_ENDL; #endif } @@ -1388,26 +1410,62 @@ void LLGLManager::shutdownGL() // these are used to turn software blending on. They appear in the Debug/Avatar menu // presence of vertex skinning/blending or vertex programs will set these to false by default. -void LLGLManager::initExtensions() +void LLGLManager::reloadExtensionsString() { -#if LL_LINUX - glh_init_extensions(""); -#endif + mGLExtensions.clear(); + + //reload extensions string + // I am deeply sorry for how ugly this is. - Rye +#if LL_GL_FUNC_POINTER + PFNGLGETSTRINGIPROC llglGetStringi = (PFNGLGETSTRINGIPROC)LL_GET_PROC_ADDRESS("glGetStringi"); + PFNGLGETINTEGERVPROC llglGetIntegerv = (PFNGLGETINTEGERVPROC)LL_GET_PROC_ADDRESS("glGetIntegerv"); + if (llglGetStringi && llglGetIntegerv) + { + GLint num_extensions = 0; + llglGetIntegerv(GL_NUM_EXTENSIONS, &num_extensions); + for (GLint i = 0; i < num_extensions; ++i) { + mGLExtensions.insert(ll_safe_string((char const*)llglGetStringi(GL_EXTENSIONS, i))); + } + } +#else + { + GLint num_extensions = 0; + glGetIntegerv(GL_NUM_EXTENSIONS, &num_extensions); + for (GLint i = 0; i < num_extensions; ++i) { + mGLExtensions.insert(ll_safe_string((char const*)glGetStringi(GL_EXTENSIONS, i))); + } #if LL_DARWIN - GLint num_extensions = 0; - std::string all_extensions{""}; - glGetIntegerv(GL_NUM_EXTENSIONS, &num_extensions); - for(GLint i = 0; i < num_extensions; ++i) { - char const * extension = (char const *)glGetStringi(GL_EXTENSIONS, i); - all_extensions += extension; - all_extensions += ' '; + if (num_extensions > 0) + { + mGLExtensions.insert("GL_ARB_multitexture"); + mGLExtensions.insert("GL_ARB_texture_cube_map"); + mGLExtensions.insert("GL_ARB_texture_compression"); + } +#endif } - if (num_extensions) +#endif + + +#if LL_WINDOWS { - all_extensions += "GL_ARB_multitexture GL_ARB_texture_cube_map GL_ARB_texture_compression "; // These are in 3.2 core, but not listed by OSX - gGLHExts.mSysExts = strdup(all_extensions.data()); + PFNWGLGETEXTENSIONSSTRINGARBPROC wglGetExtensionsStringARB = (PFNWGLGETEXTENSIONSSTRINGARBPROC)LL_GET_PROC_ADDRESS("wglGetExtensionsStringARB"); + if (wglGetExtensionsStringARB) + { + std::string wgl_exts = ll_safe_string((const char*)wglGetExtensionsStringARB(wglGetCurrentDC()));; + boost::char_separator sep(" "); + boost::tokenizer > tok(wgl_exts, sep); + for (boost::tokenizer >::iterator i = tok.begin(); i != tok.end(); ++i) + { + mGLExtensions.insert(*i); + } + } } #endif +} + +void LLGLManager::initExtensions() +{ + reloadExtensionsString(); // NOTE: version checks against mGLVersion should bias down by 0.01 because of F32 errors @@ -1416,20 +1474,13 @@ void LLGLManager::initExtensions() mHasTransformFeedback = mGLVersion >= 3.99f; mHasDebugOutput = mGLVersion >= 4.29f; mHasAnisotropic = mGLVersion >= 4.59f; - if(!mHasAnisotropic && gGLHExts.mSysExts) + if(!mHasAnisotropic) { - mHasAnisotropic = ExtensionExists("GL_EXT_texture_filter_anisotropic", gGLHExts.mSysExts); + mHasAnisotropic = mGLExtensions.contains("GL_EXT_texture_filter_anisotropic"); } -#if LL_WINDOWS || LL_LINUX - if( gGLHExts.mSysExts ) - { - mHasNVXGpuMemoryInfo = ExtensionExists("GL_NVX_gpu_memory_info", gGLHExts.mSysExts); - mHasATIMemInfo = ExtensionExists("GL_ATI_meminfo", gGLHExts.mSysExts); - } - else - LL_WARNS() << "gGLHExts.mSysExts is not set.?" << LL_ENDL; -#endif + mHasNVXGpuMemoryInfo = mGLExtensions.contains("GL_NVX_gpu_memory_info"); + mHasATIMemInfo = mGLExtensions.contains("GL_ATI_meminfo"); //Basic AMD method, also see mHasAMDAssociations // Misc glGetIntegerv(GL_MAX_ELEMENTS_VERTICES, (GLint*) &mGLMaxVertexRange); @@ -1438,843 +1489,706 @@ void LLGLManager::initExtensions() mInited = true; -#if LL_WINDOWS - LL_DEBUGS("RenderInit") << "GL Probe: Getting symbols" << LL_ENDL; - - // WGL_AMD_gpu_association - wglGetGPUIDsAMD = (PFNWGLGETGPUIDSAMDPROC)GLH_EXT_GET_PROC_ADDRESS("wglGetGPUIDsAMD"); - wglGetGPUInfoAMD = (PFNWGLGETGPUINFOAMDPROC)GLH_EXT_GET_PROC_ADDRESS("wglGetGPUInfoAMD"); - wglGetContextGPUIDAMD = (PFNWGLGETCONTEXTGPUIDAMDPROC)GLH_EXT_GET_PROC_ADDRESS("wglGetContextGPUIDAMD"); - wglCreateAssociatedContextAMD = (PFNWGLCREATEASSOCIATEDCONTEXTAMDPROC)GLH_EXT_GET_PROC_ADDRESS("wglCreateAssociatedContextAMD"); - wglCreateAssociatedContextAttribsAMD = (PFNWGLCREATEASSOCIATEDCONTEXTATTRIBSAMDPROC)GLH_EXT_GET_PROC_ADDRESS("wglCreateAssociatedContextAttribsAMD"); - wglDeleteAssociatedContextAMD = (PFNWGLDELETEASSOCIATEDCONTEXTAMDPROC)GLH_EXT_GET_PROC_ADDRESS("wglDeleteAssociatedContextAMD"); - wglMakeAssociatedContextCurrentAMD = (PFNWGLMAKEASSOCIATEDCONTEXTCURRENTAMDPROC)GLH_EXT_GET_PROC_ADDRESS("wglMakeAssociatedContextCurrentAMD"); - wglGetCurrentAssociatedContextAMD = (PFNWGLGETCURRENTASSOCIATEDCONTEXTAMDPROC)GLH_EXT_GET_PROC_ADDRESS("wglGetCurrentAssociatedContextAMD"); - wglBlitContextFramebufferAMD = (PFNWGLBLITCONTEXTFRAMEBUFFERAMDPROC)GLH_EXT_GET_PROC_ADDRESS("wglBlitContextFramebufferAMD"); - - // WGL_EXT_swap_control - wglSwapIntervalEXT = (PFNWGLSWAPINTERVALEXTPROC)GLH_EXT_GET_PROC_ADDRESS("wglSwapIntervalEXT"); - wglGetSwapIntervalEXT = (PFNWGLGETSWAPINTERVALEXTPROC)GLH_EXT_GET_PROC_ADDRESS("wglGetSwapIntervalEXT"); - - // WGL_ARB_create_context - wglCreateContextAttribsARB = (PFNWGLCREATECONTEXTATTRIBSARBPROC)GLH_EXT_GET_PROC_ADDRESS("wglCreateContextAttribsARB"); - +#if LL_GL_FUNC_POINTER // Load entire OpenGL API through GetProcAddress, leaving sections beyond mGLVersion unloaded + LL_DEBUGS("RenderInit") << "GL Probe: Getting symbols" << LL_ENDL; // GL_VERSION_1_2 if (mGLVersion < 1.19f) { return; } - glDrawRangeElements = (PFNGLDRAWRANGEELEMENTSPROC)GLH_EXT_GET_PROC_ADDRESS("glDrawRangeElements"); - glTexImage3D = (PFNGLTEXIMAGE3DPROC)GLH_EXT_GET_PROC_ADDRESS("glTexImage3D"); - glTexSubImage3D = (PFNGLTEXSUBIMAGE3DPROC)GLH_EXT_GET_PROC_ADDRESS("glTexSubImage3D"); - glCopyTexSubImage3D = (PFNGLCOPYTEXSUBIMAGE3DPROC)GLH_EXT_GET_PROC_ADDRESS("glCopyTexSubImage3D"); - + glDrawRangeElements = (PFNGLDRAWRANGEELEMENTSPROC)LL_GET_PROC_ADDRESS("glDrawRangeElements"); + glTexImage3D = (PFNGLTEXIMAGE3DPROC)LL_GET_PROC_ADDRESS("glTexImage3D"); + glTexSubImage3D = (PFNGLTEXSUBIMAGE3DPROC)LL_GET_PROC_ADDRESS("glTexSubImage3D"); + glCopyTexSubImage3D = (PFNGLCOPYTEXSUBIMAGE3DPROC)LL_GET_PROC_ADDRESS("glCopyTexSubImage3D"); // GL_VERSION_1_3 if (mGLVersion < 1.29f) { return; } - glActiveTexture = (PFNGLACTIVETEXTUREPROC)GLH_EXT_GET_PROC_ADDRESS("glActiveTexture"); - glSampleCoverage = (PFNGLSAMPLECOVERAGEPROC)GLH_EXT_GET_PROC_ADDRESS("glSampleCoverage"); - glCompressedTexImage3D = (PFNGLCOMPRESSEDTEXIMAGE3DPROC)GLH_EXT_GET_PROC_ADDRESS("glCompressedTexImage3D"); - glCompressedTexImage2D = (PFNGLCOMPRESSEDTEXIMAGE2DPROC)GLH_EXT_GET_PROC_ADDRESS("glCompressedTexImage2D"); - glCompressedTexImage1D = (PFNGLCOMPRESSEDTEXIMAGE1DPROC)GLH_EXT_GET_PROC_ADDRESS("glCompressedTexImage1D"); - glCompressedTexSubImage3D = (PFNGLCOMPRESSEDTEXSUBIMAGE3DPROC)GLH_EXT_GET_PROC_ADDRESS("glCompressedTexSubImage3D"); - glCompressedTexSubImage2D = (PFNGLCOMPRESSEDTEXSUBIMAGE2DPROC)GLH_EXT_GET_PROC_ADDRESS("glCompressedTexSubImage2D"); - glCompressedTexSubImage1D = (PFNGLCOMPRESSEDTEXSUBIMAGE1DPROC)GLH_EXT_GET_PROC_ADDRESS("glCompressedTexSubImage1D"); - glGetCompressedTexImage = (PFNGLGETCOMPRESSEDTEXIMAGEPROC)GLH_EXT_GET_PROC_ADDRESS("glGetCompressedTexImage"); - glClientActiveTexture = (PFNGLCLIENTACTIVETEXTUREPROC)GLH_EXT_GET_PROC_ADDRESS("glClientActiveTexture"); - glMultiTexCoord1d = (PFNGLMULTITEXCOORD1DPROC)GLH_EXT_GET_PROC_ADDRESS("glMultiTexCoord1d"); - glMultiTexCoord1dv = (PFNGLMULTITEXCOORD1DVPROC)GLH_EXT_GET_PROC_ADDRESS("glMultiTexCoord1dv"); - glMultiTexCoord1f = (PFNGLMULTITEXCOORD1FPROC)GLH_EXT_GET_PROC_ADDRESS("glMultiTexCoord1f"); - glMultiTexCoord1fv = (PFNGLMULTITEXCOORD1FVPROC)GLH_EXT_GET_PROC_ADDRESS("glMultiTexCoord1fv"); - glMultiTexCoord1i = (PFNGLMULTITEXCOORD1IPROC)GLH_EXT_GET_PROC_ADDRESS("glMultiTexCoord1i"); - glMultiTexCoord1iv = (PFNGLMULTITEXCOORD1IVPROC)GLH_EXT_GET_PROC_ADDRESS("glMultiTexCoord1iv"); - glMultiTexCoord1s = (PFNGLMULTITEXCOORD1SPROC)GLH_EXT_GET_PROC_ADDRESS("glMultiTexCoord1s"); - glMultiTexCoord1sv = (PFNGLMULTITEXCOORD1SVPROC)GLH_EXT_GET_PROC_ADDRESS("glMultiTexCoord1sv"); - glMultiTexCoord2d = (PFNGLMULTITEXCOORD2DPROC)GLH_EXT_GET_PROC_ADDRESS("glMultiTexCoord2d"); - glMultiTexCoord2dv = (PFNGLMULTITEXCOORD2DVPROC)GLH_EXT_GET_PROC_ADDRESS("glMultiTexCoord2dv"); - glMultiTexCoord2f = (PFNGLMULTITEXCOORD2FPROC)GLH_EXT_GET_PROC_ADDRESS("glMultiTexCoord2f"); - glMultiTexCoord2fv = (PFNGLMULTITEXCOORD2FVPROC)GLH_EXT_GET_PROC_ADDRESS("glMultiTexCoord2fv"); - glMultiTexCoord2i = (PFNGLMULTITEXCOORD2IPROC)GLH_EXT_GET_PROC_ADDRESS("glMultiTexCoord2i"); - glMultiTexCoord2iv = (PFNGLMULTITEXCOORD2IVPROC)GLH_EXT_GET_PROC_ADDRESS("glMultiTexCoord2iv"); - glMultiTexCoord2s = (PFNGLMULTITEXCOORD2SPROC)GLH_EXT_GET_PROC_ADDRESS("glMultiTexCoord2s"); - glMultiTexCoord2sv = (PFNGLMULTITEXCOORD2SVPROC)GLH_EXT_GET_PROC_ADDRESS("glMultiTexCoord2sv"); - glMultiTexCoord3d = (PFNGLMULTITEXCOORD3DPROC)GLH_EXT_GET_PROC_ADDRESS("glMultiTexCoord3d"); - glMultiTexCoord3dv = (PFNGLMULTITEXCOORD3DVPROC)GLH_EXT_GET_PROC_ADDRESS("glMultiTexCoord3dv"); - glMultiTexCoord3f = (PFNGLMULTITEXCOORD3FPROC)GLH_EXT_GET_PROC_ADDRESS("glMultiTexCoord3f"); - glMultiTexCoord3fv = (PFNGLMULTITEXCOORD3FVPROC)GLH_EXT_GET_PROC_ADDRESS("glMultiTexCoord3fv"); - glMultiTexCoord3i = (PFNGLMULTITEXCOORD3IPROC)GLH_EXT_GET_PROC_ADDRESS("glMultiTexCoord3i"); - glMultiTexCoord3iv = (PFNGLMULTITEXCOORD3IVPROC)GLH_EXT_GET_PROC_ADDRESS("glMultiTexCoord3iv"); - glMultiTexCoord3s = (PFNGLMULTITEXCOORD3SPROC)GLH_EXT_GET_PROC_ADDRESS("glMultiTexCoord3s"); - glMultiTexCoord3sv = (PFNGLMULTITEXCOORD3SVPROC)GLH_EXT_GET_PROC_ADDRESS("glMultiTexCoord3sv"); - glMultiTexCoord4d = (PFNGLMULTITEXCOORD4DPROC)GLH_EXT_GET_PROC_ADDRESS("glMultiTexCoord4d"); - glMultiTexCoord4dv = (PFNGLMULTITEXCOORD4DVPROC)GLH_EXT_GET_PROC_ADDRESS("glMultiTexCoord4dv"); - glMultiTexCoord4f = (PFNGLMULTITEXCOORD4FPROC)GLH_EXT_GET_PROC_ADDRESS("glMultiTexCoord4f"); - glMultiTexCoord4fv = (PFNGLMULTITEXCOORD4FVPROC)GLH_EXT_GET_PROC_ADDRESS("glMultiTexCoord4fv"); - glMultiTexCoord4i = (PFNGLMULTITEXCOORD4IPROC)GLH_EXT_GET_PROC_ADDRESS("glMultiTexCoord4i"); - glMultiTexCoord4iv = (PFNGLMULTITEXCOORD4IVPROC)GLH_EXT_GET_PROC_ADDRESS("glMultiTexCoord4iv"); - glMultiTexCoord4s = (PFNGLMULTITEXCOORD4SPROC)GLH_EXT_GET_PROC_ADDRESS("glMultiTexCoord4s"); - glMultiTexCoord4sv = (PFNGLMULTITEXCOORD4SVPROC)GLH_EXT_GET_PROC_ADDRESS("glMultiTexCoord4sv"); - glLoadTransposeMatrixf = (PFNGLLOADTRANSPOSEMATRIXFPROC)GLH_EXT_GET_PROC_ADDRESS("glLoadTransposeMatrixf"); - glLoadTransposeMatrixd = (PFNGLLOADTRANSPOSEMATRIXDPROC)GLH_EXT_GET_PROC_ADDRESS("glLoadTransposeMatrixd"); - glMultTransposeMatrixf = (PFNGLMULTTRANSPOSEMATRIXFPROC)GLH_EXT_GET_PROC_ADDRESS("glMultTransposeMatrixf"); - glMultTransposeMatrixd = (PFNGLMULTTRANSPOSEMATRIXDPROC)GLH_EXT_GET_PROC_ADDRESS("glMultTransposeMatrixd"); + glActiveTexture = (PFNGLACTIVETEXTUREPROC)LL_GET_PROC_ADDRESS("glActiveTexture"); + glSampleCoverage = (PFNGLSAMPLECOVERAGEPROC)LL_GET_PROC_ADDRESS("glSampleCoverage"); + glCompressedTexImage3D = (PFNGLCOMPRESSEDTEXIMAGE3DPROC)LL_GET_PROC_ADDRESS("glCompressedTexImage3D"); + glCompressedTexImage2D = (PFNGLCOMPRESSEDTEXIMAGE2DPROC)LL_GET_PROC_ADDRESS("glCompressedTexImage2D"); + glCompressedTexImage1D = (PFNGLCOMPRESSEDTEXIMAGE1DPROC)LL_GET_PROC_ADDRESS("glCompressedTexImage1D"); + glCompressedTexSubImage3D = (PFNGLCOMPRESSEDTEXSUBIMAGE3DPROC)LL_GET_PROC_ADDRESS("glCompressedTexSubImage3D"); + glCompressedTexSubImage2D = (PFNGLCOMPRESSEDTEXSUBIMAGE2DPROC)LL_GET_PROC_ADDRESS("glCompressedTexSubImage2D"); + glCompressedTexSubImage1D = (PFNGLCOMPRESSEDTEXSUBIMAGE1DPROC)LL_GET_PROC_ADDRESS("glCompressedTexSubImage1D"); + glGetCompressedTexImage = (PFNGLGETCOMPRESSEDTEXIMAGEPROC)LL_GET_PROC_ADDRESS("glGetCompressedTexImage"); // GL_VERSION_1_4 if (mGLVersion < 1.39f) { return; } - glBlendFuncSeparate = (PFNGLBLENDFUNCSEPARATEPROC)GLH_EXT_GET_PROC_ADDRESS("glBlendFuncSeparate"); - glMultiDrawArrays = (PFNGLMULTIDRAWARRAYSPROC)GLH_EXT_GET_PROC_ADDRESS("glMultiDrawArrays"); - glMultiDrawElements = (PFNGLMULTIDRAWELEMENTSPROC)GLH_EXT_GET_PROC_ADDRESS("glMultiDrawElements"); - glPointParameterf = (PFNGLPOINTPARAMETERFPROC)GLH_EXT_GET_PROC_ADDRESS("glPointParameterf"); - glPointParameterfv = (PFNGLPOINTPARAMETERFVPROC)GLH_EXT_GET_PROC_ADDRESS("glPointParameterfv"); - glPointParameteri = (PFNGLPOINTPARAMETERIPROC)GLH_EXT_GET_PROC_ADDRESS("glPointParameteri"); - glPointParameteriv = (PFNGLPOINTPARAMETERIVPROC)GLH_EXT_GET_PROC_ADDRESS("glPointParameteriv"); - glFogCoordf = (PFNGLFOGCOORDFPROC)GLH_EXT_GET_PROC_ADDRESS("glFogCoordf"); - glFogCoordfv = (PFNGLFOGCOORDFVPROC)GLH_EXT_GET_PROC_ADDRESS("glFogCoordfv"); - glFogCoordd = (PFNGLFOGCOORDDPROC)GLH_EXT_GET_PROC_ADDRESS("glFogCoordd"); - glFogCoorddv = (PFNGLFOGCOORDDVPROC)GLH_EXT_GET_PROC_ADDRESS("glFogCoorddv"); - glFogCoordPointer = (PFNGLFOGCOORDPOINTERPROC)GLH_EXT_GET_PROC_ADDRESS("glFogCoordPointer"); - glSecondaryColor3b = (PFNGLSECONDARYCOLOR3BPROC)GLH_EXT_GET_PROC_ADDRESS("glSecondaryColor3b"); - glSecondaryColor3bv = (PFNGLSECONDARYCOLOR3BVPROC)GLH_EXT_GET_PROC_ADDRESS("glSecondaryColor3bv"); - glSecondaryColor3d = (PFNGLSECONDARYCOLOR3DPROC)GLH_EXT_GET_PROC_ADDRESS("glSecondaryColor3d"); - glSecondaryColor3dv = (PFNGLSECONDARYCOLOR3DVPROC)GLH_EXT_GET_PROC_ADDRESS("glSecondaryColor3dv"); - glSecondaryColor3f = (PFNGLSECONDARYCOLOR3FPROC)GLH_EXT_GET_PROC_ADDRESS("glSecondaryColor3f"); - glSecondaryColor3fv = (PFNGLSECONDARYCOLOR3FVPROC)GLH_EXT_GET_PROC_ADDRESS("glSecondaryColor3fv"); - glSecondaryColor3i = (PFNGLSECONDARYCOLOR3IPROC)GLH_EXT_GET_PROC_ADDRESS("glSecondaryColor3i"); - glSecondaryColor3iv = (PFNGLSECONDARYCOLOR3IVPROC)GLH_EXT_GET_PROC_ADDRESS("glSecondaryColor3iv"); - glSecondaryColor3s = (PFNGLSECONDARYCOLOR3SPROC)GLH_EXT_GET_PROC_ADDRESS("glSecondaryColor3s"); - glSecondaryColor3sv = (PFNGLSECONDARYCOLOR3SVPROC)GLH_EXT_GET_PROC_ADDRESS("glSecondaryColor3sv"); - glSecondaryColor3ub = (PFNGLSECONDARYCOLOR3UBPROC)GLH_EXT_GET_PROC_ADDRESS("glSecondaryColor3ub"); - glSecondaryColor3ubv = (PFNGLSECONDARYCOLOR3UBVPROC)GLH_EXT_GET_PROC_ADDRESS("glSecondaryColor3ubv"); - glSecondaryColor3ui = (PFNGLSECONDARYCOLOR3UIPROC)GLH_EXT_GET_PROC_ADDRESS("glSecondaryColor3ui"); - glSecondaryColor3uiv = (PFNGLSECONDARYCOLOR3UIVPROC)GLH_EXT_GET_PROC_ADDRESS("glSecondaryColor3uiv"); - glSecondaryColor3us = (PFNGLSECONDARYCOLOR3USPROC)GLH_EXT_GET_PROC_ADDRESS("glSecondaryColor3us"); - glSecondaryColor3usv = (PFNGLSECONDARYCOLOR3USVPROC)GLH_EXT_GET_PROC_ADDRESS("glSecondaryColor3usv"); - glSecondaryColorPointer = (PFNGLSECONDARYCOLORPOINTERPROC)GLH_EXT_GET_PROC_ADDRESS("glSecondaryColorPointer"); - glWindowPos2d = (PFNGLWINDOWPOS2DPROC)GLH_EXT_GET_PROC_ADDRESS("glWindowPos2d"); - glWindowPos2dv = (PFNGLWINDOWPOS2DVPROC)GLH_EXT_GET_PROC_ADDRESS("glWindowPos2dv"); - glWindowPos2f = (PFNGLWINDOWPOS2FPROC)GLH_EXT_GET_PROC_ADDRESS("glWindowPos2f"); - glWindowPos2fv = (PFNGLWINDOWPOS2FVPROC)GLH_EXT_GET_PROC_ADDRESS("glWindowPos2fv"); - glWindowPos2i = (PFNGLWINDOWPOS2IPROC)GLH_EXT_GET_PROC_ADDRESS("glWindowPos2i"); - glWindowPos2iv = (PFNGLWINDOWPOS2IVPROC)GLH_EXT_GET_PROC_ADDRESS("glWindowPos2iv"); - glWindowPos2s = (PFNGLWINDOWPOS2SPROC)GLH_EXT_GET_PROC_ADDRESS("glWindowPos2s"); - glWindowPos2sv = (PFNGLWINDOWPOS2SVPROC)GLH_EXT_GET_PROC_ADDRESS("glWindowPos2sv"); - glWindowPos3d = (PFNGLWINDOWPOS3DPROC)GLH_EXT_GET_PROC_ADDRESS("glWindowPos3d"); - glWindowPos3dv = (PFNGLWINDOWPOS3DVPROC)GLH_EXT_GET_PROC_ADDRESS("glWindowPos3dv"); - glWindowPos3f = (PFNGLWINDOWPOS3FPROC)GLH_EXT_GET_PROC_ADDRESS("glWindowPos3f"); - glWindowPos3fv = (PFNGLWINDOWPOS3FVPROC)GLH_EXT_GET_PROC_ADDRESS("glWindowPos3fv"); - glWindowPos3i = (PFNGLWINDOWPOS3IPROC)GLH_EXT_GET_PROC_ADDRESS("glWindowPos3i"); - glWindowPos3iv = (PFNGLWINDOWPOS3IVPROC)GLH_EXT_GET_PROC_ADDRESS("glWindowPos3iv"); - glWindowPos3s = (PFNGLWINDOWPOS3SPROC)GLH_EXT_GET_PROC_ADDRESS("glWindowPos3s"); - glWindowPos3sv = (PFNGLWINDOWPOS3SVPROC)GLH_EXT_GET_PROC_ADDRESS("glWindowPos3sv"); + glBlendFuncSeparate = (PFNGLBLENDFUNCSEPARATEPROC)LL_GET_PROC_ADDRESS("glBlendFuncSeparate"); + glMultiDrawArrays = (PFNGLMULTIDRAWARRAYSPROC)LL_GET_PROC_ADDRESS("glMultiDrawArrays"); + glMultiDrawElements = (PFNGLMULTIDRAWELEMENTSPROC)LL_GET_PROC_ADDRESS("glMultiDrawElements"); + glPointParameterf = (PFNGLPOINTPARAMETERFPROC)LL_GET_PROC_ADDRESS("glPointParameterf"); + glPointParameterfv = (PFNGLPOINTPARAMETERFVPROC)LL_GET_PROC_ADDRESS("glPointParameterfv"); + glPointParameteri = (PFNGLPOINTPARAMETERIPROC)LL_GET_PROC_ADDRESS("glPointParameteri"); + glPointParameteriv = (PFNGLPOINTPARAMETERIVPROC)LL_GET_PROC_ADDRESS("glPointParameteriv"); // GL_VERSION_1_5 if (mGLVersion < 1.49f) { return; } - glGenQueries = (PFNGLGENQUERIESPROC)GLH_EXT_GET_PROC_ADDRESS("glGenQueries"); - glDeleteQueries = (PFNGLDELETEQUERIESPROC)GLH_EXT_GET_PROC_ADDRESS("glDeleteQueries"); - glIsQuery = (PFNGLISQUERYPROC)GLH_EXT_GET_PROC_ADDRESS("glIsQuery"); - glBeginQuery = (PFNGLBEGINQUERYPROC)GLH_EXT_GET_PROC_ADDRESS("glBeginQuery"); - glEndQuery = (PFNGLENDQUERYPROC)GLH_EXT_GET_PROC_ADDRESS("glEndQuery"); - glGetQueryiv = (PFNGLGETQUERYIVPROC)GLH_EXT_GET_PROC_ADDRESS("glGetQueryiv"); - glGetQueryObjectiv = (PFNGLGETQUERYOBJECTIVPROC)GLH_EXT_GET_PROC_ADDRESS("glGetQueryObjectiv"); - glGetQueryObjectuiv = (PFNGLGETQUERYOBJECTUIVPROC)GLH_EXT_GET_PROC_ADDRESS("glGetQueryObjectuiv"); - glBindBuffer = (PFNGLBINDBUFFERPROC)GLH_EXT_GET_PROC_ADDRESS("glBindBuffer"); - glDeleteBuffers = (PFNGLDELETEBUFFERSPROC)GLH_EXT_GET_PROC_ADDRESS("glDeleteBuffers"); - glGenBuffers = (PFNGLGENBUFFERSPROC)GLH_EXT_GET_PROC_ADDRESS("glGenBuffers"); - glIsBuffer = (PFNGLISBUFFERPROC)GLH_EXT_GET_PROC_ADDRESS("glIsBuffer"); - glBufferData = (PFNGLBUFFERDATAPROC)GLH_EXT_GET_PROC_ADDRESS("glBufferData"); - glBufferSubData = (PFNGLBUFFERSUBDATAPROC)GLH_EXT_GET_PROC_ADDRESS("glBufferSubData"); - glGetBufferSubData = (PFNGLGETBUFFERSUBDATAPROC)GLH_EXT_GET_PROC_ADDRESS("glGetBufferSubData"); - glMapBuffer = (PFNGLMAPBUFFERPROC)GLH_EXT_GET_PROC_ADDRESS("glMapBuffer"); - glUnmapBuffer = (PFNGLUNMAPBUFFERPROC)GLH_EXT_GET_PROC_ADDRESS("glUnmapBuffer"); - glGetBufferParameteriv = (PFNGLGETBUFFERPARAMETERIVPROC)GLH_EXT_GET_PROC_ADDRESS("glGetBufferParameteriv"); - glGetBufferPointerv = (PFNGLGETBUFFERPOINTERVPROC)GLH_EXT_GET_PROC_ADDRESS("glGetBufferPointerv"); + glGenQueries = (PFNGLGENQUERIESPROC)LL_GET_PROC_ADDRESS("glGenQueries"); + glDeleteQueries = (PFNGLDELETEQUERIESPROC)LL_GET_PROC_ADDRESS("glDeleteQueries"); + glIsQuery = (PFNGLISQUERYPROC)LL_GET_PROC_ADDRESS("glIsQuery"); + glBeginQuery = (PFNGLBEGINQUERYPROC)LL_GET_PROC_ADDRESS("glBeginQuery"); + glEndQuery = (PFNGLENDQUERYPROC)LL_GET_PROC_ADDRESS("glEndQuery"); + glGetQueryiv = (PFNGLGETQUERYIVPROC)LL_GET_PROC_ADDRESS("glGetQueryiv"); + glGetQueryObjectiv = (PFNGLGETQUERYOBJECTIVPROC)LL_GET_PROC_ADDRESS("glGetQueryObjectiv"); + glGetQueryObjectuiv = (PFNGLGETQUERYOBJECTUIVPROC)LL_GET_PROC_ADDRESS("glGetQueryObjectuiv"); + glBindBuffer = (PFNGLBINDBUFFERPROC)LL_GET_PROC_ADDRESS("glBindBuffer"); + glDeleteBuffers = (PFNGLDELETEBUFFERSPROC)LL_GET_PROC_ADDRESS("glDeleteBuffers"); + glGenBuffers = (PFNGLGENBUFFERSPROC)LL_GET_PROC_ADDRESS("glGenBuffers"); + glIsBuffer = (PFNGLISBUFFERPROC)LL_GET_PROC_ADDRESS("glIsBuffer"); + glBufferData = (PFNGLBUFFERDATAPROC)LL_GET_PROC_ADDRESS("glBufferData"); + glBufferSubData = (PFNGLBUFFERSUBDATAPROC)LL_GET_PROC_ADDRESS("glBufferSubData"); + glGetBufferSubData = (PFNGLGETBUFFERSUBDATAPROC)LL_GET_PROC_ADDRESS("glGetBufferSubData"); + glMapBuffer = (PFNGLMAPBUFFERPROC)LL_GET_PROC_ADDRESS("glMapBuffer"); + glUnmapBuffer = (PFNGLUNMAPBUFFERPROC)LL_GET_PROC_ADDRESS("glUnmapBuffer"); + glGetBufferParameteriv = (PFNGLGETBUFFERPARAMETERIVPROC)LL_GET_PROC_ADDRESS("glGetBufferParameteriv"); + glGetBufferPointerv = (PFNGLGETBUFFERPOINTERVPROC)LL_GET_PROC_ADDRESS("glGetBufferPointerv"); // GL_VERSION_2_0 if (mGLVersion < 1.9f) { return; } - glBlendEquationSeparate = (PFNGLBLENDEQUATIONSEPARATEPROC)GLH_EXT_GET_PROC_ADDRESS("glBlendEquationSeparate"); - glDrawBuffers = (PFNGLDRAWBUFFERSPROC)GLH_EXT_GET_PROC_ADDRESS("glDrawBuffers"); - glStencilOpSeparate = (PFNGLSTENCILOPSEPARATEPROC)GLH_EXT_GET_PROC_ADDRESS("glStencilOpSeparate"); - glStencilFuncSeparate = (PFNGLSTENCILFUNCSEPARATEPROC)GLH_EXT_GET_PROC_ADDRESS("glStencilFuncSeparate"); - glStencilMaskSeparate = (PFNGLSTENCILMASKSEPARATEPROC)GLH_EXT_GET_PROC_ADDRESS("glStencilMaskSeparate"); - glAttachShader = (PFNGLATTACHSHADERPROC)GLH_EXT_GET_PROC_ADDRESS("glAttachShader"); - glBindAttribLocation = (PFNGLBINDATTRIBLOCATIONPROC)GLH_EXT_GET_PROC_ADDRESS("glBindAttribLocation"); - glCompileShader = (PFNGLCOMPILESHADERPROC)GLH_EXT_GET_PROC_ADDRESS("glCompileShader"); - glCreateProgram = (PFNGLCREATEPROGRAMPROC)GLH_EXT_GET_PROC_ADDRESS("glCreateProgram"); - glCreateShader = (PFNGLCREATESHADERPROC)GLH_EXT_GET_PROC_ADDRESS("glCreateShader"); - glDeleteProgram = (PFNGLDELETEPROGRAMPROC)GLH_EXT_GET_PROC_ADDRESS("glDeleteProgram"); - glDeleteShader = (PFNGLDELETESHADERPROC)GLH_EXT_GET_PROC_ADDRESS("glDeleteShader"); - glDetachShader = (PFNGLDETACHSHADERPROC)GLH_EXT_GET_PROC_ADDRESS("glDetachShader"); - glDisableVertexAttribArray = (PFNGLDISABLEVERTEXATTRIBARRAYPROC)GLH_EXT_GET_PROC_ADDRESS("glDisableVertexAttribArray"); - glEnableVertexAttribArray = (PFNGLENABLEVERTEXATTRIBARRAYPROC)GLH_EXT_GET_PROC_ADDRESS("glEnableVertexAttribArray"); - glGetActiveAttrib = (PFNGLGETACTIVEATTRIBPROC)GLH_EXT_GET_PROC_ADDRESS("glGetActiveAttrib"); - glGetActiveUniform = (PFNGLGETACTIVEUNIFORMPROC)GLH_EXT_GET_PROC_ADDRESS("glGetActiveUniform"); - glGetAttachedShaders = (PFNGLGETATTACHEDSHADERSPROC)GLH_EXT_GET_PROC_ADDRESS("glGetAttachedShaders"); - glGetAttribLocation = (PFNGLGETATTRIBLOCATIONPROC)GLH_EXT_GET_PROC_ADDRESS("glGetAttribLocation"); - glGetProgramiv = (PFNGLGETPROGRAMIVPROC)GLH_EXT_GET_PROC_ADDRESS("glGetProgramiv"); - glGetProgramInfoLog = (PFNGLGETPROGRAMINFOLOGPROC)GLH_EXT_GET_PROC_ADDRESS("glGetProgramInfoLog"); - glGetShaderiv = (PFNGLGETSHADERIVPROC)GLH_EXT_GET_PROC_ADDRESS("glGetShaderiv"); - glGetShaderInfoLog = (PFNGLGETSHADERINFOLOGPROC)GLH_EXT_GET_PROC_ADDRESS("glGetShaderInfoLog"); - glGetShaderSource = (PFNGLGETSHADERSOURCEPROC)GLH_EXT_GET_PROC_ADDRESS("glGetShaderSource"); - glGetUniformLocation = (PFNGLGETUNIFORMLOCATIONPROC)GLH_EXT_GET_PROC_ADDRESS("glGetUniformLocation"); - glGetUniformfv = (PFNGLGETUNIFORMFVPROC)GLH_EXT_GET_PROC_ADDRESS("glGetUniformfv"); - glGetUniformiv = (PFNGLGETUNIFORMIVPROC)GLH_EXT_GET_PROC_ADDRESS("glGetUniformiv"); - glGetVertexAttribdv = (PFNGLGETVERTEXATTRIBDVPROC)GLH_EXT_GET_PROC_ADDRESS("glGetVertexAttribdv"); - glGetVertexAttribfv = (PFNGLGETVERTEXATTRIBFVPROC)GLH_EXT_GET_PROC_ADDRESS("glGetVertexAttribfv"); - glGetVertexAttribiv = (PFNGLGETVERTEXATTRIBIVPROC)GLH_EXT_GET_PROC_ADDRESS("glGetVertexAttribiv"); - glGetVertexAttribPointerv = (PFNGLGETVERTEXATTRIBPOINTERVPROC)GLH_EXT_GET_PROC_ADDRESS("glGetVertexAttribPointerv"); - glIsProgram = (PFNGLISPROGRAMPROC)GLH_EXT_GET_PROC_ADDRESS("glIsProgram"); - glIsShader = (PFNGLISSHADERPROC)GLH_EXT_GET_PROC_ADDRESS("glIsShader"); - glLinkProgram = (PFNGLLINKPROGRAMPROC)GLH_EXT_GET_PROC_ADDRESS("glLinkProgram"); - glShaderSource = (PFNGLSHADERSOURCEPROC)GLH_EXT_GET_PROC_ADDRESS("glShaderSource"); - glUseProgram = (PFNGLUSEPROGRAMPROC)GLH_EXT_GET_PROC_ADDRESS("glUseProgram"); - glUniform1f = (PFNGLUNIFORM1FPROC)GLH_EXT_GET_PROC_ADDRESS("glUniform1f"); - glUniform2f = (PFNGLUNIFORM2FPROC)GLH_EXT_GET_PROC_ADDRESS("glUniform2f"); - glUniform3f = (PFNGLUNIFORM3FPROC)GLH_EXT_GET_PROC_ADDRESS("glUniform3f"); - glUniform4f = (PFNGLUNIFORM4FPROC)GLH_EXT_GET_PROC_ADDRESS("glUniform4f"); - glUniform1i = (PFNGLUNIFORM1IPROC)GLH_EXT_GET_PROC_ADDRESS("glUniform1i"); - glUniform2i = (PFNGLUNIFORM2IPROC)GLH_EXT_GET_PROC_ADDRESS("glUniform2i"); - glUniform3i = (PFNGLUNIFORM3IPROC)GLH_EXT_GET_PROC_ADDRESS("glUniform3i"); - glUniform4i = (PFNGLUNIFORM4IPROC)GLH_EXT_GET_PROC_ADDRESS("glUniform4i"); - glUniform1fv = (PFNGLUNIFORM1FVPROC)GLH_EXT_GET_PROC_ADDRESS("glUniform1fv"); - glUniform2fv = (PFNGLUNIFORM2FVPROC)GLH_EXT_GET_PROC_ADDRESS("glUniform2fv"); - glUniform3fv = (PFNGLUNIFORM3FVPROC)GLH_EXT_GET_PROC_ADDRESS("glUniform3fv"); - glUniform4fv = (PFNGLUNIFORM4FVPROC)GLH_EXT_GET_PROC_ADDRESS("glUniform4fv"); - glUniform1iv = (PFNGLUNIFORM1IVPROC)GLH_EXT_GET_PROC_ADDRESS("glUniform1iv"); - glUniform2iv = (PFNGLUNIFORM2IVPROC)GLH_EXT_GET_PROC_ADDRESS("glUniform2iv"); - glUniform3iv = (PFNGLUNIFORM3IVPROC)GLH_EXT_GET_PROC_ADDRESS("glUniform3iv"); - glUniform4iv = (PFNGLUNIFORM4IVPROC)GLH_EXT_GET_PROC_ADDRESS("glUniform4iv"); - glUniformMatrix2fv = (PFNGLUNIFORMMATRIX2FVPROC)GLH_EXT_GET_PROC_ADDRESS("glUniformMatrix2fv"); - glUniformMatrix3fv = (PFNGLUNIFORMMATRIX3FVPROC)GLH_EXT_GET_PROC_ADDRESS("glUniformMatrix3fv"); - glUniformMatrix4fv = (PFNGLUNIFORMMATRIX4FVPROC)GLH_EXT_GET_PROC_ADDRESS("glUniformMatrix4fv"); - glValidateProgram = (PFNGLVALIDATEPROGRAMPROC)GLH_EXT_GET_PROC_ADDRESS("glValidateProgram"); - glVertexAttrib1d = (PFNGLVERTEXATTRIB1DPROC)GLH_EXT_GET_PROC_ADDRESS("glVertexAttrib1d"); - glVertexAttrib1dv = (PFNGLVERTEXATTRIB1DVPROC)GLH_EXT_GET_PROC_ADDRESS("glVertexAttrib1dv"); - glVertexAttrib1f = (PFNGLVERTEXATTRIB1FPROC)GLH_EXT_GET_PROC_ADDRESS("glVertexAttrib1f"); - glVertexAttrib1fv = (PFNGLVERTEXATTRIB1FVPROC)GLH_EXT_GET_PROC_ADDRESS("glVertexAttrib1fv"); - glVertexAttrib1s = (PFNGLVERTEXATTRIB1SPROC)GLH_EXT_GET_PROC_ADDRESS("glVertexAttrib1s"); - glVertexAttrib1sv = (PFNGLVERTEXATTRIB1SVPROC)GLH_EXT_GET_PROC_ADDRESS("glVertexAttrib1sv"); - glVertexAttrib2d = (PFNGLVERTEXATTRIB2DPROC)GLH_EXT_GET_PROC_ADDRESS("glVertexAttrib2d"); - glVertexAttrib2dv = (PFNGLVERTEXATTRIB2DVPROC)GLH_EXT_GET_PROC_ADDRESS("glVertexAttrib2dv"); - glVertexAttrib2f = (PFNGLVERTEXATTRIB2FPROC)GLH_EXT_GET_PROC_ADDRESS("glVertexAttrib2f"); - glVertexAttrib2fv = (PFNGLVERTEXATTRIB2FVPROC)GLH_EXT_GET_PROC_ADDRESS("glVertexAttrib2fv"); - glVertexAttrib2s = (PFNGLVERTEXATTRIB2SPROC)GLH_EXT_GET_PROC_ADDRESS("glVertexAttrib2s"); - glVertexAttrib2sv = (PFNGLVERTEXATTRIB2SVPROC)GLH_EXT_GET_PROC_ADDRESS("glVertexAttrib2sv"); - glVertexAttrib3d = (PFNGLVERTEXATTRIB3DPROC)GLH_EXT_GET_PROC_ADDRESS("glVertexAttrib3d"); - glVertexAttrib3dv = (PFNGLVERTEXATTRIB3DVPROC)GLH_EXT_GET_PROC_ADDRESS("glVertexAttrib3dv"); - glVertexAttrib3f = (PFNGLVERTEXATTRIB3FPROC)GLH_EXT_GET_PROC_ADDRESS("glVertexAttrib3f"); - glVertexAttrib3fv = (PFNGLVERTEXATTRIB3FVPROC)GLH_EXT_GET_PROC_ADDRESS("glVertexAttrib3fv"); - glVertexAttrib3s = (PFNGLVERTEXATTRIB3SPROC)GLH_EXT_GET_PROC_ADDRESS("glVertexAttrib3s"); - glVertexAttrib3sv = (PFNGLVERTEXATTRIB3SVPROC)GLH_EXT_GET_PROC_ADDRESS("glVertexAttrib3sv"); - glVertexAttrib4Nbv = (PFNGLVERTEXATTRIB4NBVPROC)GLH_EXT_GET_PROC_ADDRESS("glVertexAttrib4Nbv"); - glVertexAttrib4Niv = (PFNGLVERTEXATTRIB4NIVPROC)GLH_EXT_GET_PROC_ADDRESS("glVertexAttrib4Niv"); - glVertexAttrib4Nsv = (PFNGLVERTEXATTRIB4NSVPROC)GLH_EXT_GET_PROC_ADDRESS("glVertexAttrib4Nsv"); - glVertexAttrib4Nub = (PFNGLVERTEXATTRIB4NUBPROC)GLH_EXT_GET_PROC_ADDRESS("glVertexAttrib4Nub"); - glVertexAttrib4Nubv = (PFNGLVERTEXATTRIB4NUBVPROC)GLH_EXT_GET_PROC_ADDRESS("glVertexAttrib4Nubv"); - glVertexAttrib4Nuiv = (PFNGLVERTEXATTRIB4NUIVPROC)GLH_EXT_GET_PROC_ADDRESS("glVertexAttrib4Nuiv"); - glVertexAttrib4Nusv = (PFNGLVERTEXATTRIB4NUSVPROC)GLH_EXT_GET_PROC_ADDRESS("glVertexAttrib4Nusv"); - glVertexAttrib4bv = (PFNGLVERTEXATTRIB4BVPROC)GLH_EXT_GET_PROC_ADDRESS("glVertexAttrib4bv"); - glVertexAttrib4d = (PFNGLVERTEXATTRIB4DPROC)GLH_EXT_GET_PROC_ADDRESS("glVertexAttrib4d"); - glVertexAttrib4dv = (PFNGLVERTEXATTRIB4DVPROC)GLH_EXT_GET_PROC_ADDRESS("glVertexAttrib4dv"); - glVertexAttrib4f = (PFNGLVERTEXATTRIB4FPROC)GLH_EXT_GET_PROC_ADDRESS("glVertexAttrib4f"); - glVertexAttrib4fv = (PFNGLVERTEXATTRIB4FVPROC)GLH_EXT_GET_PROC_ADDRESS("glVertexAttrib4fv"); - glVertexAttrib4iv = (PFNGLVERTEXATTRIB4IVPROC)GLH_EXT_GET_PROC_ADDRESS("glVertexAttrib4iv"); - glVertexAttrib4s = (PFNGLVERTEXATTRIB4SPROC)GLH_EXT_GET_PROC_ADDRESS("glVertexAttrib4s"); - glVertexAttrib4sv = (PFNGLVERTEXATTRIB4SVPROC)GLH_EXT_GET_PROC_ADDRESS("glVertexAttrib4sv"); - glVertexAttrib4ubv = (PFNGLVERTEXATTRIB4UBVPROC)GLH_EXT_GET_PROC_ADDRESS("glVertexAttrib4ubv"); - glVertexAttrib4uiv = (PFNGLVERTEXATTRIB4UIVPROC)GLH_EXT_GET_PROC_ADDRESS("glVertexAttrib4uiv"); - glVertexAttrib4usv = (PFNGLVERTEXATTRIB4USVPROC)GLH_EXT_GET_PROC_ADDRESS("glVertexAttrib4usv"); - glVertexAttribPointer = (PFNGLVERTEXATTRIBPOINTERPROC)GLH_EXT_GET_PROC_ADDRESS("glVertexAttribPointer"); + glBlendEquationSeparate = (PFNGLBLENDEQUATIONSEPARATEPROC)LL_GET_PROC_ADDRESS("glBlendEquationSeparate"); + glDrawBuffers = (PFNGLDRAWBUFFERSPROC)LL_GET_PROC_ADDRESS("glDrawBuffers"); + glStencilOpSeparate = (PFNGLSTENCILOPSEPARATEPROC)LL_GET_PROC_ADDRESS("glStencilOpSeparate"); + glStencilFuncSeparate = (PFNGLSTENCILFUNCSEPARATEPROC)LL_GET_PROC_ADDRESS("glStencilFuncSeparate"); + glStencilMaskSeparate = (PFNGLSTENCILMASKSEPARATEPROC)LL_GET_PROC_ADDRESS("glStencilMaskSeparate"); + glAttachShader = (PFNGLATTACHSHADERPROC)LL_GET_PROC_ADDRESS("glAttachShader"); + glBindAttribLocation = (PFNGLBINDATTRIBLOCATIONPROC)LL_GET_PROC_ADDRESS("glBindAttribLocation"); + glCompileShader = (PFNGLCOMPILESHADERPROC)LL_GET_PROC_ADDRESS("glCompileShader"); + glCreateProgram = (PFNGLCREATEPROGRAMPROC)LL_GET_PROC_ADDRESS("glCreateProgram"); + glCreateShader = (PFNGLCREATESHADERPROC)LL_GET_PROC_ADDRESS("glCreateShader"); + glDeleteProgram = (PFNGLDELETEPROGRAMPROC)LL_GET_PROC_ADDRESS("glDeleteProgram"); + glDeleteShader = (PFNGLDELETESHADERPROC)LL_GET_PROC_ADDRESS("glDeleteShader"); + glDetachShader = (PFNGLDETACHSHADERPROC)LL_GET_PROC_ADDRESS("glDetachShader"); + glDisableVertexAttribArray = (PFNGLDISABLEVERTEXATTRIBARRAYPROC)LL_GET_PROC_ADDRESS("glDisableVertexAttribArray"); + glEnableVertexAttribArray = (PFNGLENABLEVERTEXATTRIBARRAYPROC)LL_GET_PROC_ADDRESS("glEnableVertexAttribArray"); + glGetActiveAttrib = (PFNGLGETACTIVEATTRIBPROC)LL_GET_PROC_ADDRESS("glGetActiveAttrib"); + glGetActiveUniform = (PFNGLGETACTIVEUNIFORMPROC)LL_GET_PROC_ADDRESS("glGetActiveUniform"); + glGetAttachedShaders = (PFNGLGETATTACHEDSHADERSPROC)LL_GET_PROC_ADDRESS("glGetAttachedShaders"); + glGetAttribLocation = (PFNGLGETATTRIBLOCATIONPROC)LL_GET_PROC_ADDRESS("glGetAttribLocation"); + glGetProgramiv = (PFNGLGETPROGRAMIVPROC)LL_GET_PROC_ADDRESS("glGetProgramiv"); + glGetProgramInfoLog = (PFNGLGETPROGRAMINFOLOGPROC)LL_GET_PROC_ADDRESS("glGetProgramInfoLog"); + glGetShaderiv = (PFNGLGETSHADERIVPROC)LL_GET_PROC_ADDRESS("glGetShaderiv"); + glGetShaderInfoLog = (PFNGLGETSHADERINFOLOGPROC)LL_GET_PROC_ADDRESS("glGetShaderInfoLog"); + glGetShaderSource = (PFNGLGETSHADERSOURCEPROC)LL_GET_PROC_ADDRESS("glGetShaderSource"); + glGetUniformLocation = (PFNGLGETUNIFORMLOCATIONPROC)LL_GET_PROC_ADDRESS("glGetUniformLocation"); + glGetUniformfv = (PFNGLGETUNIFORMFVPROC)LL_GET_PROC_ADDRESS("glGetUniformfv"); + glGetUniformiv = (PFNGLGETUNIFORMIVPROC)LL_GET_PROC_ADDRESS("glGetUniformiv"); + glGetVertexAttribdv = (PFNGLGETVERTEXATTRIBDVPROC)LL_GET_PROC_ADDRESS("glGetVertexAttribdv"); + glGetVertexAttribfv = (PFNGLGETVERTEXATTRIBFVPROC)LL_GET_PROC_ADDRESS("glGetVertexAttribfv"); + glGetVertexAttribiv = (PFNGLGETVERTEXATTRIBIVPROC)LL_GET_PROC_ADDRESS("glGetVertexAttribiv"); + glGetVertexAttribPointerv = (PFNGLGETVERTEXATTRIBPOINTERVPROC)LL_GET_PROC_ADDRESS("glGetVertexAttribPointerv"); + glIsProgram = (PFNGLISPROGRAMPROC)LL_GET_PROC_ADDRESS("glIsProgram"); + glIsShader = (PFNGLISSHADERPROC)LL_GET_PROC_ADDRESS("glIsShader"); + glLinkProgram = (PFNGLLINKPROGRAMPROC)LL_GET_PROC_ADDRESS("glLinkProgram"); + glShaderSource = (PFNGLSHADERSOURCEPROC)LL_GET_PROC_ADDRESS("glShaderSource"); + glUseProgram = (PFNGLUSEPROGRAMPROC)LL_GET_PROC_ADDRESS("glUseProgram"); + glUniform1f = (PFNGLUNIFORM1FPROC)LL_GET_PROC_ADDRESS("glUniform1f"); + glUniform2f = (PFNGLUNIFORM2FPROC)LL_GET_PROC_ADDRESS("glUniform2f"); + glUniform3f = (PFNGLUNIFORM3FPROC)LL_GET_PROC_ADDRESS("glUniform3f"); + glUniform4f = (PFNGLUNIFORM4FPROC)LL_GET_PROC_ADDRESS("glUniform4f"); + glUniform1i = (PFNGLUNIFORM1IPROC)LL_GET_PROC_ADDRESS("glUniform1i"); + glUniform2i = (PFNGLUNIFORM2IPROC)LL_GET_PROC_ADDRESS("glUniform2i"); + glUniform3i = (PFNGLUNIFORM3IPROC)LL_GET_PROC_ADDRESS("glUniform3i"); + glUniform4i = (PFNGLUNIFORM4IPROC)LL_GET_PROC_ADDRESS("glUniform4i"); + glUniform1fv = (PFNGLUNIFORM1FVPROC)LL_GET_PROC_ADDRESS("glUniform1fv"); + glUniform2fv = (PFNGLUNIFORM2FVPROC)LL_GET_PROC_ADDRESS("glUniform2fv"); + glUniform3fv = (PFNGLUNIFORM3FVPROC)LL_GET_PROC_ADDRESS("glUniform3fv"); + glUniform4fv = (PFNGLUNIFORM4FVPROC)LL_GET_PROC_ADDRESS("glUniform4fv"); + glUniform1iv = (PFNGLUNIFORM1IVPROC)LL_GET_PROC_ADDRESS("glUniform1iv"); + glUniform2iv = (PFNGLUNIFORM2IVPROC)LL_GET_PROC_ADDRESS("glUniform2iv"); + glUniform3iv = (PFNGLUNIFORM3IVPROC)LL_GET_PROC_ADDRESS("glUniform3iv"); + glUniform4iv = (PFNGLUNIFORM4IVPROC)LL_GET_PROC_ADDRESS("glUniform4iv"); + glUniformMatrix2fv = (PFNGLUNIFORMMATRIX2FVPROC)LL_GET_PROC_ADDRESS("glUniformMatrix2fv"); + glUniformMatrix3fv = (PFNGLUNIFORMMATRIX3FVPROC)LL_GET_PROC_ADDRESS("glUniformMatrix3fv"); + glUniformMatrix4fv = (PFNGLUNIFORMMATRIX4FVPROC)LL_GET_PROC_ADDRESS("glUniformMatrix4fv"); + glValidateProgram = (PFNGLVALIDATEPROGRAMPROC)LL_GET_PROC_ADDRESS("glValidateProgram"); + glVertexAttrib1d = (PFNGLVERTEXATTRIB1DPROC)LL_GET_PROC_ADDRESS("glVertexAttrib1d"); + glVertexAttrib1dv = (PFNGLVERTEXATTRIB1DVPROC)LL_GET_PROC_ADDRESS("glVertexAttrib1dv"); + glVertexAttrib1f = (PFNGLVERTEXATTRIB1FPROC)LL_GET_PROC_ADDRESS("glVertexAttrib1f"); + glVertexAttrib1fv = (PFNGLVERTEXATTRIB1FVPROC)LL_GET_PROC_ADDRESS("glVertexAttrib1fv"); + glVertexAttrib1s = (PFNGLVERTEXATTRIB1SPROC)LL_GET_PROC_ADDRESS("glVertexAttrib1s"); + glVertexAttrib1sv = (PFNGLVERTEXATTRIB1SVPROC)LL_GET_PROC_ADDRESS("glVertexAttrib1sv"); + glVertexAttrib2d = (PFNGLVERTEXATTRIB2DPROC)LL_GET_PROC_ADDRESS("glVertexAttrib2d"); + glVertexAttrib2dv = (PFNGLVERTEXATTRIB2DVPROC)LL_GET_PROC_ADDRESS("glVertexAttrib2dv"); + glVertexAttrib2f = (PFNGLVERTEXATTRIB2FPROC)LL_GET_PROC_ADDRESS("glVertexAttrib2f"); + glVertexAttrib2fv = (PFNGLVERTEXATTRIB2FVPROC)LL_GET_PROC_ADDRESS("glVertexAttrib2fv"); + glVertexAttrib2s = (PFNGLVERTEXATTRIB2SPROC)LL_GET_PROC_ADDRESS("glVertexAttrib2s"); + glVertexAttrib2sv = (PFNGLVERTEXATTRIB2SVPROC)LL_GET_PROC_ADDRESS("glVertexAttrib2sv"); + glVertexAttrib3d = (PFNGLVERTEXATTRIB3DPROC)LL_GET_PROC_ADDRESS("glVertexAttrib3d"); + glVertexAttrib3dv = (PFNGLVERTEXATTRIB3DVPROC)LL_GET_PROC_ADDRESS("glVertexAttrib3dv"); + glVertexAttrib3f = (PFNGLVERTEXATTRIB3FPROC)LL_GET_PROC_ADDRESS("glVertexAttrib3f"); + glVertexAttrib3fv = (PFNGLVERTEXATTRIB3FVPROC)LL_GET_PROC_ADDRESS("glVertexAttrib3fv"); + glVertexAttrib3s = (PFNGLVERTEXATTRIB3SPROC)LL_GET_PROC_ADDRESS("glVertexAttrib3s"); + glVertexAttrib3sv = (PFNGLVERTEXATTRIB3SVPROC)LL_GET_PROC_ADDRESS("glVertexAttrib3sv"); + glVertexAttrib4Nbv = (PFNGLVERTEXATTRIB4NBVPROC)LL_GET_PROC_ADDRESS("glVertexAttrib4Nbv"); + glVertexAttrib4Niv = (PFNGLVERTEXATTRIB4NIVPROC)LL_GET_PROC_ADDRESS("glVertexAttrib4Niv"); + glVertexAttrib4Nsv = (PFNGLVERTEXATTRIB4NSVPROC)LL_GET_PROC_ADDRESS("glVertexAttrib4Nsv"); + glVertexAttrib4Nub = (PFNGLVERTEXATTRIB4NUBPROC)LL_GET_PROC_ADDRESS("glVertexAttrib4Nub"); + glVertexAttrib4Nubv = (PFNGLVERTEXATTRIB4NUBVPROC)LL_GET_PROC_ADDRESS("glVertexAttrib4Nubv"); + glVertexAttrib4Nuiv = (PFNGLVERTEXATTRIB4NUIVPROC)LL_GET_PROC_ADDRESS("glVertexAttrib4Nuiv"); + glVertexAttrib4Nusv = (PFNGLVERTEXATTRIB4NUSVPROC)LL_GET_PROC_ADDRESS("glVertexAttrib4Nusv"); + glVertexAttrib4bv = (PFNGLVERTEXATTRIB4BVPROC)LL_GET_PROC_ADDRESS("glVertexAttrib4bv"); + glVertexAttrib4d = (PFNGLVERTEXATTRIB4DPROC)LL_GET_PROC_ADDRESS("glVertexAttrib4d"); + glVertexAttrib4dv = (PFNGLVERTEXATTRIB4DVPROC)LL_GET_PROC_ADDRESS("glVertexAttrib4dv"); + glVertexAttrib4f = (PFNGLVERTEXATTRIB4FPROC)LL_GET_PROC_ADDRESS("glVertexAttrib4f"); + glVertexAttrib4fv = (PFNGLVERTEXATTRIB4FVPROC)LL_GET_PROC_ADDRESS("glVertexAttrib4fv"); + glVertexAttrib4iv = (PFNGLVERTEXATTRIB4IVPROC)LL_GET_PROC_ADDRESS("glVertexAttrib4iv"); + glVertexAttrib4s = (PFNGLVERTEXATTRIB4SPROC)LL_GET_PROC_ADDRESS("glVertexAttrib4s"); + glVertexAttrib4sv = (PFNGLVERTEXATTRIB4SVPROC)LL_GET_PROC_ADDRESS("glVertexAttrib4sv"); + glVertexAttrib4ubv = (PFNGLVERTEXATTRIB4UBVPROC)LL_GET_PROC_ADDRESS("glVertexAttrib4ubv"); + glVertexAttrib4uiv = (PFNGLVERTEXATTRIB4UIVPROC)LL_GET_PROC_ADDRESS("glVertexAttrib4uiv"); + glVertexAttrib4usv = (PFNGLVERTEXATTRIB4USVPROC)LL_GET_PROC_ADDRESS("glVertexAttrib4usv"); + glVertexAttribPointer = (PFNGLVERTEXATTRIBPOINTERPROC)LL_GET_PROC_ADDRESS("glVertexAttribPointer"); // GL_VERSION_2_1 if (mGLVersion < 2.09f) { return; } - glUniformMatrix2x3fv = (PFNGLUNIFORMMATRIX2X3FVPROC)GLH_EXT_GET_PROC_ADDRESS("glUniformMatrix2x3fv"); - glUniformMatrix3x2fv = (PFNGLUNIFORMMATRIX3X2FVPROC)GLH_EXT_GET_PROC_ADDRESS("glUniformMatrix3x2fv"); - glUniformMatrix2x4fv = (PFNGLUNIFORMMATRIX2X4FVPROC)GLH_EXT_GET_PROC_ADDRESS("glUniformMatrix2x4fv"); - glUniformMatrix4x2fv = (PFNGLUNIFORMMATRIX4X2FVPROC)GLH_EXT_GET_PROC_ADDRESS("glUniformMatrix4x2fv"); - glUniformMatrix3x4fv = (PFNGLUNIFORMMATRIX3X4FVPROC)GLH_EXT_GET_PROC_ADDRESS("glUniformMatrix3x4fv"); - glUniformMatrix4x3fv = (PFNGLUNIFORMMATRIX4X3FVPROC)GLH_EXT_GET_PROC_ADDRESS("glUniformMatrix4x3fv"); + glUniformMatrix2x3fv = (PFNGLUNIFORMMATRIX2X3FVPROC)LL_GET_PROC_ADDRESS("glUniformMatrix2x3fv"); + glUniformMatrix3x2fv = (PFNGLUNIFORMMATRIX3X2FVPROC)LL_GET_PROC_ADDRESS("glUniformMatrix3x2fv"); + glUniformMatrix2x4fv = (PFNGLUNIFORMMATRIX2X4FVPROC)LL_GET_PROC_ADDRESS("glUniformMatrix2x4fv"); + glUniformMatrix4x2fv = (PFNGLUNIFORMMATRIX4X2FVPROC)LL_GET_PROC_ADDRESS("glUniformMatrix4x2fv"); + glUniformMatrix3x4fv = (PFNGLUNIFORMMATRIX3X4FVPROC)LL_GET_PROC_ADDRESS("glUniformMatrix3x4fv"); + glUniformMatrix4x3fv = (PFNGLUNIFORMMATRIX4X3FVPROC)LL_GET_PROC_ADDRESS("glUniformMatrix4x3fv"); // GL_VERSION_3_0 if (mGLVersion < 2.99f) { return; } - glColorMaski = (PFNGLCOLORMASKIPROC)GLH_EXT_GET_PROC_ADDRESS("glColorMaski"); - glGetBooleani_v = (PFNGLGETBOOLEANI_VPROC)GLH_EXT_GET_PROC_ADDRESS("glGetBooleani_v"); - glGetIntegeri_v = (PFNGLGETINTEGERI_VPROC)GLH_EXT_GET_PROC_ADDRESS("glGetIntegeri_v"); - glEnablei = (PFNGLENABLEIPROC)GLH_EXT_GET_PROC_ADDRESS("glEnablei"); - glDisablei = (PFNGLDISABLEIPROC)GLH_EXT_GET_PROC_ADDRESS("glDisablei"); - glIsEnabledi = (PFNGLISENABLEDIPROC)GLH_EXT_GET_PROC_ADDRESS("glIsEnabledi"); - glBeginTransformFeedback = (PFNGLBEGINTRANSFORMFEEDBACKPROC)GLH_EXT_GET_PROC_ADDRESS("glBeginTransformFeedback"); - glEndTransformFeedback = (PFNGLENDTRANSFORMFEEDBACKPROC)GLH_EXT_GET_PROC_ADDRESS("glEndTransformFeedback"); - glBindBufferRange = (PFNGLBINDBUFFERRANGEPROC)GLH_EXT_GET_PROC_ADDRESS("glBindBufferRange"); - glBindBufferBase = (PFNGLBINDBUFFERBASEPROC)GLH_EXT_GET_PROC_ADDRESS("glBindBufferBase"); - glTransformFeedbackVaryings = (PFNGLTRANSFORMFEEDBACKVARYINGSPROC)GLH_EXT_GET_PROC_ADDRESS("glTransformFeedbackVaryings"); - glGetTransformFeedbackVarying = (PFNGLGETTRANSFORMFEEDBACKVARYINGPROC)GLH_EXT_GET_PROC_ADDRESS("glGetTransformFeedbackVarying"); - glClampColor = (PFNGLCLAMPCOLORPROC)GLH_EXT_GET_PROC_ADDRESS("glClampColor"); - glBeginConditionalRender = (PFNGLBEGINCONDITIONALRENDERPROC)GLH_EXT_GET_PROC_ADDRESS("glBeginConditionalRender"); - glEndConditionalRender = (PFNGLENDCONDITIONALRENDERPROC)GLH_EXT_GET_PROC_ADDRESS("glEndConditionalRender"); - glVertexAttribIPointer = (PFNGLVERTEXATTRIBIPOINTERPROC)GLH_EXT_GET_PROC_ADDRESS("glVertexAttribIPointer"); - glGetVertexAttribIiv = (PFNGLGETVERTEXATTRIBIIVPROC)GLH_EXT_GET_PROC_ADDRESS("glGetVertexAttribIiv"); - glGetVertexAttribIuiv = (PFNGLGETVERTEXATTRIBIUIVPROC)GLH_EXT_GET_PROC_ADDRESS("glGetVertexAttribIuiv"); - glVertexAttribI1i = (PFNGLVERTEXATTRIBI1IPROC)GLH_EXT_GET_PROC_ADDRESS("glVertexAttribI1i"); - glVertexAttribI2i = (PFNGLVERTEXATTRIBI2IPROC)GLH_EXT_GET_PROC_ADDRESS("glVertexAttribI2i"); - glVertexAttribI3i = (PFNGLVERTEXATTRIBI3IPROC)GLH_EXT_GET_PROC_ADDRESS("glVertexAttribI3i"); - glVertexAttribI4i = (PFNGLVERTEXATTRIBI4IPROC)GLH_EXT_GET_PROC_ADDRESS("glVertexAttribI4i"); - glVertexAttribI1ui = (PFNGLVERTEXATTRIBI1UIPROC)GLH_EXT_GET_PROC_ADDRESS("glVertexAttribI1ui"); - glVertexAttribI2ui = (PFNGLVERTEXATTRIBI2UIPROC)GLH_EXT_GET_PROC_ADDRESS("glVertexAttribI2ui"); - glVertexAttribI3ui = (PFNGLVERTEXATTRIBI3UIPROC)GLH_EXT_GET_PROC_ADDRESS("glVertexAttribI3ui"); - glVertexAttribI4ui = (PFNGLVERTEXATTRIBI4UIPROC)GLH_EXT_GET_PROC_ADDRESS("glVertexAttribI4ui"); - glVertexAttribI1iv = (PFNGLVERTEXATTRIBI1IVPROC)GLH_EXT_GET_PROC_ADDRESS("glVertexAttribI1iv"); - glVertexAttribI2iv = (PFNGLVERTEXATTRIBI2IVPROC)GLH_EXT_GET_PROC_ADDRESS("glVertexAttribI2iv"); - glVertexAttribI3iv = (PFNGLVERTEXATTRIBI3IVPROC)GLH_EXT_GET_PROC_ADDRESS("glVertexAttribI3iv"); - glVertexAttribI4iv = (PFNGLVERTEXATTRIBI4IVPROC)GLH_EXT_GET_PROC_ADDRESS("glVertexAttribI4iv"); - glVertexAttribI1uiv = (PFNGLVERTEXATTRIBI1UIVPROC)GLH_EXT_GET_PROC_ADDRESS("glVertexAttribI1uiv"); - glVertexAttribI2uiv = (PFNGLVERTEXATTRIBI2UIVPROC)GLH_EXT_GET_PROC_ADDRESS("glVertexAttribI2uiv"); - glVertexAttribI3uiv = (PFNGLVERTEXATTRIBI3UIVPROC)GLH_EXT_GET_PROC_ADDRESS("glVertexAttribI3uiv"); - glVertexAttribI4uiv = (PFNGLVERTEXATTRIBI4UIVPROC)GLH_EXT_GET_PROC_ADDRESS("glVertexAttribI4uiv"); - glVertexAttribI4bv = (PFNGLVERTEXATTRIBI4BVPROC)GLH_EXT_GET_PROC_ADDRESS("glVertexAttribI4bv"); - glVertexAttribI4sv = (PFNGLVERTEXATTRIBI4SVPROC)GLH_EXT_GET_PROC_ADDRESS("glVertexAttribI4sv"); - glVertexAttribI4ubv = (PFNGLVERTEXATTRIBI4UBVPROC)GLH_EXT_GET_PROC_ADDRESS("glVertexAttribI4ubv"); - glVertexAttribI4usv = (PFNGLVERTEXATTRIBI4USVPROC)GLH_EXT_GET_PROC_ADDRESS("glVertexAttribI4usv"); - glGetUniformuiv = (PFNGLGETUNIFORMUIVPROC)GLH_EXT_GET_PROC_ADDRESS("glGetUniformuiv"); - glBindFragDataLocation = (PFNGLBINDFRAGDATALOCATIONPROC)GLH_EXT_GET_PROC_ADDRESS("glBindFragDataLocation"); - glGetFragDataLocation = (PFNGLGETFRAGDATALOCATIONPROC)GLH_EXT_GET_PROC_ADDRESS("glGetFragDataLocation"); - glUniform1ui = (PFNGLUNIFORM1UIPROC)GLH_EXT_GET_PROC_ADDRESS("glUniform1ui"); - glUniform2ui = (PFNGLUNIFORM2UIPROC)GLH_EXT_GET_PROC_ADDRESS("glUniform2ui"); - glUniform3ui = (PFNGLUNIFORM3UIPROC)GLH_EXT_GET_PROC_ADDRESS("glUniform3ui"); - glUniform4ui = (PFNGLUNIFORM4UIPROC)GLH_EXT_GET_PROC_ADDRESS("glUniform4ui"); - glUniform1uiv = (PFNGLUNIFORM1UIVPROC)GLH_EXT_GET_PROC_ADDRESS("glUniform1uiv"); - glUniform2uiv = (PFNGLUNIFORM2UIVPROC)GLH_EXT_GET_PROC_ADDRESS("glUniform2uiv"); - glUniform3uiv = (PFNGLUNIFORM3UIVPROC)GLH_EXT_GET_PROC_ADDRESS("glUniform3uiv"); - glUniform4uiv = (PFNGLUNIFORM4UIVPROC)GLH_EXT_GET_PROC_ADDRESS("glUniform4uiv"); - glTexParameterIiv = (PFNGLTEXPARAMETERIIVPROC)GLH_EXT_GET_PROC_ADDRESS("glTexParameterIiv"); - glTexParameterIuiv = (PFNGLTEXPARAMETERIUIVPROC)GLH_EXT_GET_PROC_ADDRESS("glTexParameterIuiv"); - glGetTexParameterIiv = (PFNGLGETTEXPARAMETERIIVPROC)GLH_EXT_GET_PROC_ADDRESS("glGetTexParameterIiv"); - glGetTexParameterIuiv = (PFNGLGETTEXPARAMETERIUIVPROC)GLH_EXT_GET_PROC_ADDRESS("glGetTexParameterIuiv"); - glClearBufferiv = (PFNGLCLEARBUFFERIVPROC)GLH_EXT_GET_PROC_ADDRESS("glClearBufferiv"); - glClearBufferuiv = (PFNGLCLEARBUFFERUIVPROC)GLH_EXT_GET_PROC_ADDRESS("glClearBufferuiv"); - glClearBufferfv = (PFNGLCLEARBUFFERFVPROC)GLH_EXT_GET_PROC_ADDRESS("glClearBufferfv"); - glClearBufferfi = (PFNGLCLEARBUFFERFIPROC)GLH_EXT_GET_PROC_ADDRESS("glClearBufferfi"); - glGetStringi = (PFNGLGETSTRINGIPROC)GLH_EXT_GET_PROC_ADDRESS("glGetStringi"); - glIsRenderbuffer = (PFNGLISRENDERBUFFERPROC)GLH_EXT_GET_PROC_ADDRESS("glIsRenderbuffer"); - glBindRenderbuffer = (PFNGLBINDRENDERBUFFERPROC)GLH_EXT_GET_PROC_ADDRESS("glBindRenderbuffer"); - glDeleteRenderbuffers = (PFNGLDELETERENDERBUFFERSPROC)GLH_EXT_GET_PROC_ADDRESS("glDeleteRenderbuffers"); - glGenRenderbuffers = (PFNGLGENRENDERBUFFERSPROC)GLH_EXT_GET_PROC_ADDRESS("glGenRenderbuffers"); - glRenderbufferStorage = (PFNGLRENDERBUFFERSTORAGEPROC)GLH_EXT_GET_PROC_ADDRESS("glRenderbufferStorage"); - glGetRenderbufferParameteriv = (PFNGLGETRENDERBUFFERPARAMETERIVPROC)GLH_EXT_GET_PROC_ADDRESS("glGetRenderbufferParameteriv"); - glIsFramebuffer = (PFNGLISFRAMEBUFFERPROC)GLH_EXT_GET_PROC_ADDRESS("glIsFramebuffer"); - glBindFramebuffer = (PFNGLBINDFRAMEBUFFERPROC)GLH_EXT_GET_PROC_ADDRESS("glBindFramebuffer"); - glDeleteFramebuffers = (PFNGLDELETEFRAMEBUFFERSPROC)GLH_EXT_GET_PROC_ADDRESS("glDeleteFramebuffers"); - glGenFramebuffers = (PFNGLGENFRAMEBUFFERSPROC)GLH_EXT_GET_PROC_ADDRESS("glGenFramebuffers"); - glCheckFramebufferStatus = (PFNGLCHECKFRAMEBUFFERSTATUSPROC)GLH_EXT_GET_PROC_ADDRESS("glCheckFramebufferStatus"); - glFramebufferTexture1D = (PFNGLFRAMEBUFFERTEXTURE1DPROC)GLH_EXT_GET_PROC_ADDRESS("glFramebufferTexture1D"); - glFramebufferTexture2D = (PFNGLFRAMEBUFFERTEXTURE2DPROC)GLH_EXT_GET_PROC_ADDRESS("glFramebufferTexture2D"); - glFramebufferTexture3D = (PFNGLFRAMEBUFFERTEXTURE3DPROC)GLH_EXT_GET_PROC_ADDRESS("glFramebufferTexture3D"); - glFramebufferRenderbuffer = (PFNGLFRAMEBUFFERRENDERBUFFERPROC)GLH_EXT_GET_PROC_ADDRESS("glFramebufferRenderbuffer"); - glGetFramebufferAttachmentParameteriv = (PFNGLGETFRAMEBUFFERATTACHMENTPARAMETERIVPROC)GLH_EXT_GET_PROC_ADDRESS("glGetFramebufferAttachmentParameteriv"); - glGenerateMipmap = (PFNGLGENERATEMIPMAPPROC)GLH_EXT_GET_PROC_ADDRESS("glGenerateMipmap"); - glBlitFramebuffer = (PFNGLBLITFRAMEBUFFERPROC)GLH_EXT_GET_PROC_ADDRESS("glBlitFramebuffer"); - glRenderbufferStorageMultisample = (PFNGLRENDERBUFFERSTORAGEMULTISAMPLEPROC)GLH_EXT_GET_PROC_ADDRESS("glRenderbufferStorageMultisample"); - glFramebufferTextureLayer = (PFNGLFRAMEBUFFERTEXTURELAYERPROC)GLH_EXT_GET_PROC_ADDRESS("glFramebufferTextureLayer"); - glMapBufferRange = (PFNGLMAPBUFFERRANGEPROC)GLH_EXT_GET_PROC_ADDRESS("glMapBufferRange"); - glFlushMappedBufferRange = (PFNGLFLUSHMAPPEDBUFFERRANGEPROC)GLH_EXT_GET_PROC_ADDRESS("glFlushMappedBufferRange"); - glBindVertexArray = (PFNGLBINDVERTEXARRAYPROC)GLH_EXT_GET_PROC_ADDRESS("glBindVertexArray"); - glDeleteVertexArrays = (PFNGLDELETEVERTEXARRAYSPROC)GLH_EXT_GET_PROC_ADDRESS("glDeleteVertexArrays"); - glGenVertexArrays = (PFNGLGENVERTEXARRAYSPROC)GLH_EXT_GET_PROC_ADDRESS("glGenVertexArrays"); - glIsVertexArray = (PFNGLISVERTEXARRAYPROC)GLH_EXT_GET_PROC_ADDRESS("glIsVertexArray"); + glColorMaski = (PFNGLCOLORMASKIPROC)LL_GET_PROC_ADDRESS("glColorMaski"); + glGetBooleani_v = (PFNGLGETBOOLEANI_VPROC)LL_GET_PROC_ADDRESS("glGetBooleani_v"); + glGetIntegeri_v = (PFNGLGETINTEGERI_VPROC)LL_GET_PROC_ADDRESS("glGetIntegeri_v"); + glEnablei = (PFNGLENABLEIPROC)LL_GET_PROC_ADDRESS("glEnablei"); + glDisablei = (PFNGLDISABLEIPROC)LL_GET_PROC_ADDRESS("glDisablei"); + glIsEnabledi = (PFNGLISENABLEDIPROC)LL_GET_PROC_ADDRESS("glIsEnabledi"); + glBeginTransformFeedback = (PFNGLBEGINTRANSFORMFEEDBACKPROC)LL_GET_PROC_ADDRESS("glBeginTransformFeedback"); + glEndTransformFeedback = (PFNGLENDTRANSFORMFEEDBACKPROC)LL_GET_PROC_ADDRESS("glEndTransformFeedback"); + glBindBufferRange = (PFNGLBINDBUFFERRANGEPROC)LL_GET_PROC_ADDRESS("glBindBufferRange"); + glBindBufferBase = (PFNGLBINDBUFFERBASEPROC)LL_GET_PROC_ADDRESS("glBindBufferBase"); + glTransformFeedbackVaryings = (PFNGLTRANSFORMFEEDBACKVARYINGSPROC)LL_GET_PROC_ADDRESS("glTransformFeedbackVaryings"); + glGetTransformFeedbackVarying = (PFNGLGETTRANSFORMFEEDBACKVARYINGPROC)LL_GET_PROC_ADDRESS("glGetTransformFeedbackVarying"); + glClampColor = (PFNGLCLAMPCOLORPROC)LL_GET_PROC_ADDRESS("glClampColor"); + glBeginConditionalRender = (PFNGLBEGINCONDITIONALRENDERPROC)LL_GET_PROC_ADDRESS("glBeginConditionalRender"); + glEndConditionalRender = (PFNGLENDCONDITIONALRENDERPROC)LL_GET_PROC_ADDRESS("glEndConditionalRender"); + glVertexAttribIPointer = (PFNGLVERTEXATTRIBIPOINTERPROC)LL_GET_PROC_ADDRESS("glVertexAttribIPointer"); + glGetVertexAttribIiv = (PFNGLGETVERTEXATTRIBIIVPROC)LL_GET_PROC_ADDRESS("glGetVertexAttribIiv"); + glGetVertexAttribIuiv = (PFNGLGETVERTEXATTRIBIUIVPROC)LL_GET_PROC_ADDRESS("glGetVertexAttribIuiv"); + glVertexAttribI1i = (PFNGLVERTEXATTRIBI1IPROC)LL_GET_PROC_ADDRESS("glVertexAttribI1i"); + glVertexAttribI2i = (PFNGLVERTEXATTRIBI2IPROC)LL_GET_PROC_ADDRESS("glVertexAttribI2i"); + glVertexAttribI3i = (PFNGLVERTEXATTRIBI3IPROC)LL_GET_PROC_ADDRESS("glVertexAttribI3i"); + glVertexAttribI4i = (PFNGLVERTEXATTRIBI4IPROC)LL_GET_PROC_ADDRESS("glVertexAttribI4i"); + glVertexAttribI1ui = (PFNGLVERTEXATTRIBI1UIPROC)LL_GET_PROC_ADDRESS("glVertexAttribI1ui"); + glVertexAttribI2ui = (PFNGLVERTEXATTRIBI2UIPROC)LL_GET_PROC_ADDRESS("glVertexAttribI2ui"); + glVertexAttribI3ui = (PFNGLVERTEXATTRIBI3UIPROC)LL_GET_PROC_ADDRESS("glVertexAttribI3ui"); + glVertexAttribI4ui = (PFNGLVERTEXATTRIBI4UIPROC)LL_GET_PROC_ADDRESS("glVertexAttribI4ui"); + glVertexAttribI1iv = (PFNGLVERTEXATTRIBI1IVPROC)LL_GET_PROC_ADDRESS("glVertexAttribI1iv"); + glVertexAttribI2iv = (PFNGLVERTEXATTRIBI2IVPROC)LL_GET_PROC_ADDRESS("glVertexAttribI2iv"); + glVertexAttribI3iv = (PFNGLVERTEXATTRIBI3IVPROC)LL_GET_PROC_ADDRESS("glVertexAttribI3iv"); + glVertexAttribI4iv = (PFNGLVERTEXATTRIBI4IVPROC)LL_GET_PROC_ADDRESS("glVertexAttribI4iv"); + glVertexAttribI1uiv = (PFNGLVERTEXATTRIBI1UIVPROC)LL_GET_PROC_ADDRESS("glVertexAttribI1uiv"); + glVertexAttribI2uiv = (PFNGLVERTEXATTRIBI2UIVPROC)LL_GET_PROC_ADDRESS("glVertexAttribI2uiv"); + glVertexAttribI3uiv = (PFNGLVERTEXATTRIBI3UIVPROC)LL_GET_PROC_ADDRESS("glVertexAttribI3uiv"); + glVertexAttribI4uiv = (PFNGLVERTEXATTRIBI4UIVPROC)LL_GET_PROC_ADDRESS("glVertexAttribI4uiv"); + glVertexAttribI4bv = (PFNGLVERTEXATTRIBI4BVPROC)LL_GET_PROC_ADDRESS("glVertexAttribI4bv"); + glVertexAttribI4sv = (PFNGLVERTEXATTRIBI4SVPROC)LL_GET_PROC_ADDRESS("glVertexAttribI4sv"); + glVertexAttribI4ubv = (PFNGLVERTEXATTRIBI4UBVPROC)LL_GET_PROC_ADDRESS("glVertexAttribI4ubv"); + glVertexAttribI4usv = (PFNGLVERTEXATTRIBI4USVPROC)LL_GET_PROC_ADDRESS("glVertexAttribI4usv"); + glGetUniformuiv = (PFNGLGETUNIFORMUIVPROC)LL_GET_PROC_ADDRESS("glGetUniformuiv"); + glBindFragDataLocation = (PFNGLBINDFRAGDATALOCATIONPROC)LL_GET_PROC_ADDRESS("glBindFragDataLocation"); + glGetFragDataLocation = (PFNGLGETFRAGDATALOCATIONPROC)LL_GET_PROC_ADDRESS("glGetFragDataLocation"); + glUniform1ui = (PFNGLUNIFORM1UIPROC)LL_GET_PROC_ADDRESS("glUniform1ui"); + glUniform2ui = (PFNGLUNIFORM2UIPROC)LL_GET_PROC_ADDRESS("glUniform2ui"); + glUniform3ui = (PFNGLUNIFORM3UIPROC)LL_GET_PROC_ADDRESS("glUniform3ui"); + glUniform4ui = (PFNGLUNIFORM4UIPROC)LL_GET_PROC_ADDRESS("glUniform4ui"); + glUniform1uiv = (PFNGLUNIFORM1UIVPROC)LL_GET_PROC_ADDRESS("glUniform1uiv"); + glUniform2uiv = (PFNGLUNIFORM2UIVPROC)LL_GET_PROC_ADDRESS("glUniform2uiv"); + glUniform3uiv = (PFNGLUNIFORM3UIVPROC)LL_GET_PROC_ADDRESS("glUniform3uiv"); + glUniform4uiv = (PFNGLUNIFORM4UIVPROC)LL_GET_PROC_ADDRESS("glUniform4uiv"); + glTexParameterIiv = (PFNGLTEXPARAMETERIIVPROC)LL_GET_PROC_ADDRESS("glTexParameterIiv"); + glTexParameterIuiv = (PFNGLTEXPARAMETERIUIVPROC)LL_GET_PROC_ADDRESS("glTexParameterIuiv"); + glGetTexParameterIiv = (PFNGLGETTEXPARAMETERIIVPROC)LL_GET_PROC_ADDRESS("glGetTexParameterIiv"); + glGetTexParameterIuiv = (PFNGLGETTEXPARAMETERIUIVPROC)LL_GET_PROC_ADDRESS("glGetTexParameterIuiv"); + glClearBufferiv = (PFNGLCLEARBUFFERIVPROC)LL_GET_PROC_ADDRESS("glClearBufferiv"); + glClearBufferuiv = (PFNGLCLEARBUFFERUIVPROC)LL_GET_PROC_ADDRESS("glClearBufferuiv"); + glClearBufferfv = (PFNGLCLEARBUFFERFVPROC)LL_GET_PROC_ADDRESS("glClearBufferfv"); + glClearBufferfi = (PFNGLCLEARBUFFERFIPROC)LL_GET_PROC_ADDRESS("glClearBufferfi"); + glGetStringi = (PFNGLGETSTRINGIPROC)LL_GET_PROC_ADDRESS("glGetStringi"); + glIsRenderbuffer = (PFNGLISRENDERBUFFERPROC)LL_GET_PROC_ADDRESS("glIsRenderbuffer"); + glBindRenderbuffer = (PFNGLBINDRENDERBUFFERPROC)LL_GET_PROC_ADDRESS("glBindRenderbuffer"); + glDeleteRenderbuffers = (PFNGLDELETERENDERBUFFERSPROC)LL_GET_PROC_ADDRESS("glDeleteRenderbuffers"); + glGenRenderbuffers = (PFNGLGENRENDERBUFFERSPROC)LL_GET_PROC_ADDRESS("glGenRenderbuffers"); + glRenderbufferStorage = (PFNGLRENDERBUFFERSTORAGEPROC)LL_GET_PROC_ADDRESS("glRenderbufferStorage"); + glGetRenderbufferParameteriv = (PFNGLGETRENDERBUFFERPARAMETERIVPROC)LL_GET_PROC_ADDRESS("glGetRenderbufferParameteriv"); + glIsFramebuffer = (PFNGLISFRAMEBUFFERPROC)LL_GET_PROC_ADDRESS("glIsFramebuffer"); + glBindFramebuffer = (PFNGLBINDFRAMEBUFFERPROC)LL_GET_PROC_ADDRESS("glBindFramebuffer"); + glDeleteFramebuffers = (PFNGLDELETEFRAMEBUFFERSPROC)LL_GET_PROC_ADDRESS("glDeleteFramebuffers"); + glGenFramebuffers = (PFNGLGENFRAMEBUFFERSPROC)LL_GET_PROC_ADDRESS("glGenFramebuffers"); + glCheckFramebufferStatus = (PFNGLCHECKFRAMEBUFFERSTATUSPROC)LL_GET_PROC_ADDRESS("glCheckFramebufferStatus"); + glFramebufferTexture1D = (PFNGLFRAMEBUFFERTEXTURE1DPROC)LL_GET_PROC_ADDRESS("glFramebufferTexture1D"); + glFramebufferTexture2D = (PFNGLFRAMEBUFFERTEXTURE2DPROC)LL_GET_PROC_ADDRESS("glFramebufferTexture2D"); + glFramebufferTexture3D = (PFNGLFRAMEBUFFERTEXTURE3DPROC)LL_GET_PROC_ADDRESS("glFramebufferTexture3D"); + glFramebufferRenderbuffer = (PFNGLFRAMEBUFFERRENDERBUFFERPROC)LL_GET_PROC_ADDRESS("glFramebufferRenderbuffer"); + glGetFramebufferAttachmentParameteriv = (PFNGLGETFRAMEBUFFERATTACHMENTPARAMETERIVPROC)LL_GET_PROC_ADDRESS("glGetFramebufferAttachmentParameteriv"); + glGenerateMipmap = (PFNGLGENERATEMIPMAPPROC)LL_GET_PROC_ADDRESS("glGenerateMipmap"); + glBlitFramebuffer = (PFNGLBLITFRAMEBUFFERPROC)LL_GET_PROC_ADDRESS("glBlitFramebuffer"); + glRenderbufferStorageMultisample = (PFNGLRENDERBUFFERSTORAGEMULTISAMPLEPROC)LL_GET_PROC_ADDRESS("glRenderbufferStorageMultisample"); + glFramebufferTextureLayer = (PFNGLFRAMEBUFFERTEXTURELAYERPROC)LL_GET_PROC_ADDRESS("glFramebufferTextureLayer"); + glMapBufferRange = (PFNGLMAPBUFFERRANGEPROC)LL_GET_PROC_ADDRESS("glMapBufferRange"); + glFlushMappedBufferRange = (PFNGLFLUSHMAPPEDBUFFERRANGEPROC)LL_GET_PROC_ADDRESS("glFlushMappedBufferRange"); + glBindVertexArray = (PFNGLBINDVERTEXARRAYPROC)LL_GET_PROC_ADDRESS("glBindVertexArray"); + glDeleteVertexArrays = (PFNGLDELETEVERTEXARRAYSPROC)LL_GET_PROC_ADDRESS("glDeleteVertexArrays"); + glGenVertexArrays = (PFNGLGENVERTEXARRAYSPROC)LL_GET_PROC_ADDRESS("glGenVertexArrays"); + glIsVertexArray = (PFNGLISVERTEXARRAYPROC)LL_GET_PROC_ADDRESS("glIsVertexArray"); // GL_VERSION_3_1 if (mGLVersion < 3.09f) { return; } - glDrawArraysInstanced = (PFNGLDRAWARRAYSINSTANCEDPROC)GLH_EXT_GET_PROC_ADDRESS("glDrawArraysInstanced"); - glDrawElementsInstanced = (PFNGLDRAWELEMENTSINSTANCEDPROC)GLH_EXT_GET_PROC_ADDRESS("glDrawElementsInstanced"); - glTexBuffer = (PFNGLTEXBUFFERPROC)GLH_EXT_GET_PROC_ADDRESS("glTexBuffer"); - glPrimitiveRestartIndex = (PFNGLPRIMITIVERESTARTINDEXPROC)GLH_EXT_GET_PROC_ADDRESS("glPrimitiveRestartIndex"); - glCopyBufferSubData = (PFNGLCOPYBUFFERSUBDATAPROC)GLH_EXT_GET_PROC_ADDRESS("glCopyBufferSubData"); - glGetUniformIndices = (PFNGLGETUNIFORMINDICESPROC)GLH_EXT_GET_PROC_ADDRESS("glGetUniformIndices"); - glGetActiveUniformsiv = (PFNGLGETACTIVEUNIFORMSIVPROC)GLH_EXT_GET_PROC_ADDRESS("glGetActiveUniformsiv"); - glGetActiveUniformName = (PFNGLGETACTIVEUNIFORMNAMEPROC)GLH_EXT_GET_PROC_ADDRESS("glGetActiveUniformName"); - glGetUniformBlockIndex = (PFNGLGETUNIFORMBLOCKINDEXPROC)GLH_EXT_GET_PROC_ADDRESS("glGetUniformBlockIndex"); - glGetActiveUniformBlockiv = (PFNGLGETACTIVEUNIFORMBLOCKIVPROC)GLH_EXT_GET_PROC_ADDRESS("glGetActiveUniformBlockiv"); - glGetActiveUniformBlockName = (PFNGLGETACTIVEUNIFORMBLOCKNAMEPROC)GLH_EXT_GET_PROC_ADDRESS("glGetActiveUniformBlockName"); - glUniformBlockBinding = (PFNGLUNIFORMBLOCKBINDINGPROC)GLH_EXT_GET_PROC_ADDRESS("glUniformBlockBinding"); + glDrawArraysInstanced = (PFNGLDRAWARRAYSINSTANCEDPROC)LL_GET_PROC_ADDRESS("glDrawArraysInstanced"); + glDrawElementsInstanced = (PFNGLDRAWELEMENTSINSTANCEDPROC)LL_GET_PROC_ADDRESS("glDrawElementsInstanced"); + glTexBuffer = (PFNGLTEXBUFFERPROC)LL_GET_PROC_ADDRESS("glTexBuffer"); + glPrimitiveRestartIndex = (PFNGLPRIMITIVERESTARTINDEXPROC)LL_GET_PROC_ADDRESS("glPrimitiveRestartIndex"); + glCopyBufferSubData = (PFNGLCOPYBUFFERSUBDATAPROC)LL_GET_PROC_ADDRESS("glCopyBufferSubData"); + glGetUniformIndices = (PFNGLGETUNIFORMINDICESPROC)LL_GET_PROC_ADDRESS("glGetUniformIndices"); + glGetActiveUniformsiv = (PFNGLGETACTIVEUNIFORMSIVPROC)LL_GET_PROC_ADDRESS("glGetActiveUniformsiv"); + glGetActiveUniformName = (PFNGLGETACTIVEUNIFORMNAMEPROC)LL_GET_PROC_ADDRESS("glGetActiveUniformName"); + glGetUniformBlockIndex = (PFNGLGETUNIFORMBLOCKINDEXPROC)LL_GET_PROC_ADDRESS("glGetUniformBlockIndex"); + glGetActiveUniformBlockiv = (PFNGLGETACTIVEUNIFORMBLOCKIVPROC)LL_GET_PROC_ADDRESS("glGetActiveUniformBlockiv"); + glGetActiveUniformBlockName = (PFNGLGETACTIVEUNIFORMBLOCKNAMEPROC)LL_GET_PROC_ADDRESS("glGetActiveUniformBlockName"); + glUniformBlockBinding = (PFNGLUNIFORMBLOCKBINDINGPROC)LL_GET_PROC_ADDRESS("glUniformBlockBinding"); // GL_VERSION_3_2 if (mGLVersion < 3.19f) { return; } - glDrawElementsBaseVertex = (PFNGLDRAWELEMENTSBASEVERTEXPROC)GLH_EXT_GET_PROC_ADDRESS("glDrawElementsBaseVertex"); - glDrawRangeElementsBaseVertex = (PFNGLDRAWRANGEELEMENTSBASEVERTEXPROC)GLH_EXT_GET_PROC_ADDRESS("glDrawRangeElementsBaseVertex"); - glDrawElementsInstancedBaseVertex = (PFNGLDRAWELEMENTSINSTANCEDBASEVERTEXPROC)GLH_EXT_GET_PROC_ADDRESS("glDrawElementsInstancedBaseVertex"); - glMultiDrawElementsBaseVertex = (PFNGLMULTIDRAWELEMENTSBASEVERTEXPROC)GLH_EXT_GET_PROC_ADDRESS("glMultiDrawElementsBaseVertex"); - glProvokingVertex = (PFNGLPROVOKINGVERTEXPROC)GLH_EXT_GET_PROC_ADDRESS("glProvokingVertex"); - glFenceSync = (PFNGLFENCESYNCPROC)GLH_EXT_GET_PROC_ADDRESS("glFenceSync"); - glIsSync = (PFNGLISSYNCPROC)GLH_EXT_GET_PROC_ADDRESS("glIsSync"); - glDeleteSync = (PFNGLDELETESYNCPROC)GLH_EXT_GET_PROC_ADDRESS("glDeleteSync"); - glClientWaitSync = (PFNGLCLIENTWAITSYNCPROC)GLH_EXT_GET_PROC_ADDRESS("glClientWaitSync"); - glWaitSync = (PFNGLWAITSYNCPROC)GLH_EXT_GET_PROC_ADDRESS("glWaitSync"); - glGetInteger64v = (PFNGLGETINTEGER64VPROC)GLH_EXT_GET_PROC_ADDRESS("glGetInteger64v"); - glGetSynciv = (PFNGLGETSYNCIVPROC)GLH_EXT_GET_PROC_ADDRESS("glGetSynciv"); - glGetInteger64i_v = (PFNGLGETINTEGER64I_VPROC)GLH_EXT_GET_PROC_ADDRESS("glGetInteger64i_v"); - glGetBufferParameteri64v = (PFNGLGETBUFFERPARAMETERI64VPROC)GLH_EXT_GET_PROC_ADDRESS("glGetBufferParameteri64v"); - glFramebufferTexture = (PFNGLFRAMEBUFFERTEXTUREPROC)GLH_EXT_GET_PROC_ADDRESS("glFramebufferTexture"); - glTexImage2DMultisample = (PFNGLTEXIMAGE2DMULTISAMPLEPROC)GLH_EXT_GET_PROC_ADDRESS("glTexImage2DMultisample"); - glTexImage3DMultisample = (PFNGLTEXIMAGE3DMULTISAMPLEPROC)GLH_EXT_GET_PROC_ADDRESS("glTexImage3DMultisample"); - glGetMultisamplefv = (PFNGLGETMULTISAMPLEFVPROC)GLH_EXT_GET_PROC_ADDRESS("glGetMultisamplefv"); - glSampleMaski = (PFNGLSAMPLEMASKIPROC)GLH_EXT_GET_PROC_ADDRESS("glSampleMaski"); + glDrawElementsBaseVertex = (PFNGLDRAWELEMENTSBASEVERTEXPROC)LL_GET_PROC_ADDRESS("glDrawElementsBaseVertex"); + glDrawRangeElementsBaseVertex = (PFNGLDRAWRANGEELEMENTSBASEVERTEXPROC)LL_GET_PROC_ADDRESS("glDrawRangeElementsBaseVertex"); + glDrawElementsInstancedBaseVertex = (PFNGLDRAWELEMENTSINSTANCEDBASEVERTEXPROC)LL_GET_PROC_ADDRESS("glDrawElementsInstancedBaseVertex"); + glMultiDrawElementsBaseVertex = (PFNGLMULTIDRAWELEMENTSBASEVERTEXPROC)LL_GET_PROC_ADDRESS("glMultiDrawElementsBaseVertex"); + glProvokingVertex = (PFNGLPROVOKINGVERTEXPROC)LL_GET_PROC_ADDRESS("glProvokingVertex"); + glFenceSync = (PFNGLFENCESYNCPROC)LL_GET_PROC_ADDRESS("glFenceSync"); + glIsSync = (PFNGLISSYNCPROC)LL_GET_PROC_ADDRESS("glIsSync"); + glDeleteSync = (PFNGLDELETESYNCPROC)LL_GET_PROC_ADDRESS("glDeleteSync"); + glClientWaitSync = (PFNGLCLIENTWAITSYNCPROC)LL_GET_PROC_ADDRESS("glClientWaitSync"); + glWaitSync = (PFNGLWAITSYNCPROC)LL_GET_PROC_ADDRESS("glWaitSync"); + glGetInteger64v = (PFNGLGETINTEGER64VPROC)LL_GET_PROC_ADDRESS("glGetInteger64v"); + glGetSynciv = (PFNGLGETSYNCIVPROC)LL_GET_PROC_ADDRESS("glGetSynciv"); + glGetInteger64i_v = (PFNGLGETINTEGER64I_VPROC)LL_GET_PROC_ADDRESS("glGetInteger64i_v"); + glGetBufferParameteri64v = (PFNGLGETBUFFERPARAMETERI64VPROC)LL_GET_PROC_ADDRESS("glGetBufferParameteri64v"); + glFramebufferTexture = (PFNGLFRAMEBUFFERTEXTUREPROC)LL_GET_PROC_ADDRESS("glFramebufferTexture"); + glTexImage2DMultisample = (PFNGLTEXIMAGE2DMULTISAMPLEPROC)LL_GET_PROC_ADDRESS("glTexImage2DMultisample"); + glTexImage3DMultisample = (PFNGLTEXIMAGE3DMULTISAMPLEPROC)LL_GET_PROC_ADDRESS("glTexImage3DMultisample"); + glGetMultisamplefv = (PFNGLGETMULTISAMPLEFVPROC)LL_GET_PROC_ADDRESS("glGetMultisamplefv"); + glSampleMaski = (PFNGLSAMPLEMASKIPROC)LL_GET_PROC_ADDRESS("glSampleMaski"); // GL_VERSION_3_3 if (mGLVersion < 3.29f) { return; } - glBindFragDataLocationIndexed = (PFNGLBINDFRAGDATALOCATIONINDEXEDPROC)GLH_EXT_GET_PROC_ADDRESS("glBindFragDataLocationIndexed"); - glGetFragDataIndex = (PFNGLGETFRAGDATAINDEXPROC)GLH_EXT_GET_PROC_ADDRESS("glGetFragDataIndex"); - glGenSamplers = (PFNGLGENSAMPLERSPROC)GLH_EXT_GET_PROC_ADDRESS("glGenSamplers"); - glDeleteSamplers = (PFNGLDELETESAMPLERSPROC)GLH_EXT_GET_PROC_ADDRESS("glDeleteSamplers"); - glIsSampler = (PFNGLISSAMPLERPROC)GLH_EXT_GET_PROC_ADDRESS("glIsSampler"); - glBindSampler = (PFNGLBINDSAMPLERPROC)GLH_EXT_GET_PROC_ADDRESS("glBindSampler"); - glSamplerParameteri = (PFNGLSAMPLERPARAMETERIPROC)GLH_EXT_GET_PROC_ADDRESS("glSamplerParameteri"); - glSamplerParameteriv = (PFNGLSAMPLERPARAMETERIVPROC)GLH_EXT_GET_PROC_ADDRESS("glSamplerParameteriv"); - glSamplerParameterf = (PFNGLSAMPLERPARAMETERFPROC)GLH_EXT_GET_PROC_ADDRESS("glSamplerParameterf"); - glSamplerParameterfv = (PFNGLSAMPLERPARAMETERFVPROC)GLH_EXT_GET_PROC_ADDRESS("glSamplerParameterfv"); - glSamplerParameterIiv = (PFNGLSAMPLERPARAMETERIIVPROC)GLH_EXT_GET_PROC_ADDRESS("glSamplerParameterIiv"); - glSamplerParameterIuiv = (PFNGLSAMPLERPARAMETERIUIVPROC)GLH_EXT_GET_PROC_ADDRESS("glSamplerParameterIuiv"); - glGetSamplerParameteriv = (PFNGLGETSAMPLERPARAMETERIVPROC)GLH_EXT_GET_PROC_ADDRESS("glGetSamplerParameteriv"); - glGetSamplerParameterIiv = (PFNGLGETSAMPLERPARAMETERIIVPROC)GLH_EXT_GET_PROC_ADDRESS("glGetSamplerParameterIiv"); - glGetSamplerParameterfv = (PFNGLGETSAMPLERPARAMETERFVPROC)GLH_EXT_GET_PROC_ADDRESS("glGetSamplerParameterfv"); - glGetSamplerParameterIuiv = (PFNGLGETSAMPLERPARAMETERIUIVPROC)GLH_EXT_GET_PROC_ADDRESS("glGetSamplerParameterIuiv"); - glQueryCounter = (PFNGLQUERYCOUNTERPROC)GLH_EXT_GET_PROC_ADDRESS("glQueryCounter"); - glGetQueryObjecti64v = (PFNGLGETQUERYOBJECTI64VPROC)GLH_EXT_GET_PROC_ADDRESS("glGetQueryObjecti64v"); - glGetQueryObjectui64v = (PFNGLGETQUERYOBJECTUI64VPROC)GLH_EXT_GET_PROC_ADDRESS("glGetQueryObjectui64v"); - glVertexAttribDivisor = (PFNGLVERTEXATTRIBDIVISORPROC)GLH_EXT_GET_PROC_ADDRESS("glVertexAttribDivisor"); - glVertexAttribP1ui = (PFNGLVERTEXATTRIBP1UIPROC)GLH_EXT_GET_PROC_ADDRESS("glVertexAttribP1ui"); - glVertexAttribP1uiv = (PFNGLVERTEXATTRIBP1UIVPROC)GLH_EXT_GET_PROC_ADDRESS("glVertexAttribP1uiv"); - glVertexAttribP2ui = (PFNGLVERTEXATTRIBP2UIPROC)GLH_EXT_GET_PROC_ADDRESS("glVertexAttribP2ui"); - glVertexAttribP2uiv = (PFNGLVERTEXATTRIBP2UIVPROC)GLH_EXT_GET_PROC_ADDRESS("glVertexAttribP2uiv"); - glVertexAttribP3ui = (PFNGLVERTEXATTRIBP3UIPROC)GLH_EXT_GET_PROC_ADDRESS("glVertexAttribP3ui"); - glVertexAttribP3uiv = (PFNGLVERTEXATTRIBP3UIVPROC)GLH_EXT_GET_PROC_ADDRESS("glVertexAttribP3uiv"); - glVertexAttribP4ui = (PFNGLVERTEXATTRIBP4UIPROC)GLH_EXT_GET_PROC_ADDRESS("glVertexAttribP4ui"); - glVertexAttribP4uiv = (PFNGLVERTEXATTRIBP4UIVPROC)GLH_EXT_GET_PROC_ADDRESS("glVertexAttribP4uiv"); - glVertexP2ui = (PFNGLVERTEXP2UIPROC)GLH_EXT_GET_PROC_ADDRESS("glVertexP2ui"); - glVertexP2uiv = (PFNGLVERTEXP2UIVPROC)GLH_EXT_GET_PROC_ADDRESS("glVertexP2uiv"); - glVertexP3ui = (PFNGLVERTEXP3UIPROC)GLH_EXT_GET_PROC_ADDRESS("glVertexP3ui"); - glVertexP3uiv = (PFNGLVERTEXP3UIVPROC)GLH_EXT_GET_PROC_ADDRESS("glVertexP3uiv"); - glVertexP4ui = (PFNGLVERTEXP4UIPROC)GLH_EXT_GET_PROC_ADDRESS("glVertexP4ui"); - glVertexP4uiv = (PFNGLVERTEXP4UIVPROC)GLH_EXT_GET_PROC_ADDRESS("glVertexP4uiv"); - glTexCoordP1ui = (PFNGLTEXCOORDP1UIPROC)GLH_EXT_GET_PROC_ADDRESS("glTexCoordP1ui"); - glTexCoordP1uiv = (PFNGLTEXCOORDP1UIVPROC)GLH_EXT_GET_PROC_ADDRESS("glTexCoordP1uiv"); - glTexCoordP2ui = (PFNGLTEXCOORDP2UIPROC)GLH_EXT_GET_PROC_ADDRESS("glTexCoordP2ui"); - glTexCoordP2uiv = (PFNGLTEXCOORDP2UIVPROC)GLH_EXT_GET_PROC_ADDRESS("glTexCoordP2uiv"); - glTexCoordP3ui = (PFNGLTEXCOORDP3UIPROC)GLH_EXT_GET_PROC_ADDRESS("glTexCoordP3ui"); - glTexCoordP3uiv = (PFNGLTEXCOORDP3UIVPROC)GLH_EXT_GET_PROC_ADDRESS("glTexCoordP3uiv"); - glTexCoordP4ui = (PFNGLTEXCOORDP4UIPROC)GLH_EXT_GET_PROC_ADDRESS("glTexCoordP4ui"); - glTexCoordP4uiv = (PFNGLTEXCOORDP4UIVPROC)GLH_EXT_GET_PROC_ADDRESS("glTexCoordP4uiv"); - glMultiTexCoordP1ui = (PFNGLMULTITEXCOORDP1UIPROC)GLH_EXT_GET_PROC_ADDRESS("glMultiTexCoordP1ui"); - glMultiTexCoordP1uiv = (PFNGLMULTITEXCOORDP1UIVPROC)GLH_EXT_GET_PROC_ADDRESS("glMultiTexCoordP1uiv"); - glMultiTexCoordP2ui = (PFNGLMULTITEXCOORDP2UIPROC)GLH_EXT_GET_PROC_ADDRESS("glMultiTexCoordP2ui"); - glMultiTexCoordP2uiv = (PFNGLMULTITEXCOORDP2UIVPROC)GLH_EXT_GET_PROC_ADDRESS("glMultiTexCoordP2uiv"); - glMultiTexCoordP3ui = (PFNGLMULTITEXCOORDP3UIPROC)GLH_EXT_GET_PROC_ADDRESS("glMultiTexCoordP3ui"); - glMultiTexCoordP3uiv = (PFNGLMULTITEXCOORDP3UIVPROC)GLH_EXT_GET_PROC_ADDRESS("glMultiTexCoordP3uiv"); - glMultiTexCoordP4ui = (PFNGLMULTITEXCOORDP4UIPROC)GLH_EXT_GET_PROC_ADDRESS("glMultiTexCoordP4ui"); - glMultiTexCoordP4uiv = (PFNGLMULTITEXCOORDP4UIVPROC)GLH_EXT_GET_PROC_ADDRESS("glMultiTexCoordP4uiv"); - glNormalP3ui = (PFNGLNORMALP3UIPROC)GLH_EXT_GET_PROC_ADDRESS("glNormalP3ui"); - glNormalP3uiv = (PFNGLNORMALP3UIVPROC)GLH_EXT_GET_PROC_ADDRESS("glNormalP3uiv"); - glColorP3ui = (PFNGLCOLORP3UIPROC)GLH_EXT_GET_PROC_ADDRESS("glColorP3ui"); - glColorP3uiv = (PFNGLCOLORP3UIVPROC)GLH_EXT_GET_PROC_ADDRESS("glColorP3uiv"); - glColorP4ui = (PFNGLCOLORP4UIPROC)GLH_EXT_GET_PROC_ADDRESS("glColorP4ui"); - glColorP4uiv = (PFNGLCOLORP4UIVPROC)GLH_EXT_GET_PROC_ADDRESS("glColorP4uiv"); - glSecondaryColorP3ui = (PFNGLSECONDARYCOLORP3UIPROC)GLH_EXT_GET_PROC_ADDRESS("glSecondaryColorP3ui"); - glSecondaryColorP3uiv = (PFNGLSECONDARYCOLORP3UIVPROC)GLH_EXT_GET_PROC_ADDRESS("glSecondaryColorP3uiv"); + glBindFragDataLocationIndexed = (PFNGLBINDFRAGDATALOCATIONINDEXEDPROC)LL_GET_PROC_ADDRESS("glBindFragDataLocationIndexed"); + glGetFragDataIndex = (PFNGLGETFRAGDATAINDEXPROC)LL_GET_PROC_ADDRESS("glGetFragDataIndex"); + glGenSamplers = (PFNGLGENSAMPLERSPROC)LL_GET_PROC_ADDRESS("glGenSamplers"); + glDeleteSamplers = (PFNGLDELETESAMPLERSPROC)LL_GET_PROC_ADDRESS("glDeleteSamplers"); + glIsSampler = (PFNGLISSAMPLERPROC)LL_GET_PROC_ADDRESS("glIsSampler"); + glBindSampler = (PFNGLBINDSAMPLERPROC)LL_GET_PROC_ADDRESS("glBindSampler"); + glSamplerParameteri = (PFNGLSAMPLERPARAMETERIPROC)LL_GET_PROC_ADDRESS("glSamplerParameteri"); + glSamplerParameteriv = (PFNGLSAMPLERPARAMETERIVPROC)LL_GET_PROC_ADDRESS("glSamplerParameteriv"); + glSamplerParameterf = (PFNGLSAMPLERPARAMETERFPROC)LL_GET_PROC_ADDRESS("glSamplerParameterf"); + glSamplerParameterfv = (PFNGLSAMPLERPARAMETERFVPROC)LL_GET_PROC_ADDRESS("glSamplerParameterfv"); + glSamplerParameterIiv = (PFNGLSAMPLERPARAMETERIIVPROC)LL_GET_PROC_ADDRESS("glSamplerParameterIiv"); + glSamplerParameterIuiv = (PFNGLSAMPLERPARAMETERIUIVPROC)LL_GET_PROC_ADDRESS("glSamplerParameterIuiv"); + glGetSamplerParameteriv = (PFNGLGETSAMPLERPARAMETERIVPROC)LL_GET_PROC_ADDRESS("glGetSamplerParameteriv"); + glGetSamplerParameterIiv = (PFNGLGETSAMPLERPARAMETERIIVPROC)LL_GET_PROC_ADDRESS("glGetSamplerParameterIiv"); + glGetSamplerParameterfv = (PFNGLGETSAMPLERPARAMETERFVPROC)LL_GET_PROC_ADDRESS("glGetSamplerParameterfv"); + glGetSamplerParameterIuiv = (PFNGLGETSAMPLERPARAMETERIUIVPROC)LL_GET_PROC_ADDRESS("glGetSamplerParameterIuiv"); + glQueryCounter = (PFNGLQUERYCOUNTERPROC)LL_GET_PROC_ADDRESS("glQueryCounter"); + glGetQueryObjecti64v = (PFNGLGETQUERYOBJECTI64VPROC)LL_GET_PROC_ADDRESS("glGetQueryObjecti64v"); + glGetQueryObjectui64v = (PFNGLGETQUERYOBJECTUI64VPROC)LL_GET_PROC_ADDRESS("glGetQueryObjectui64v"); + glVertexAttribDivisor = (PFNGLVERTEXATTRIBDIVISORPROC)LL_GET_PROC_ADDRESS("glVertexAttribDivisor"); + glVertexAttribP1ui = (PFNGLVERTEXATTRIBP1UIPROC)LL_GET_PROC_ADDRESS("glVertexAttribP1ui"); + glVertexAttribP1uiv = (PFNGLVERTEXATTRIBP1UIVPROC)LL_GET_PROC_ADDRESS("glVertexAttribP1uiv"); + glVertexAttribP2ui = (PFNGLVERTEXATTRIBP2UIPROC)LL_GET_PROC_ADDRESS("glVertexAttribP2ui"); + glVertexAttribP2uiv = (PFNGLVERTEXATTRIBP2UIVPROC)LL_GET_PROC_ADDRESS("glVertexAttribP2uiv"); + glVertexAttribP3ui = (PFNGLVERTEXATTRIBP3UIPROC)LL_GET_PROC_ADDRESS("glVertexAttribP3ui"); + glVertexAttribP3uiv = (PFNGLVERTEXATTRIBP3UIVPROC)LL_GET_PROC_ADDRESS("glVertexAttribP3uiv"); + glVertexAttribP4ui = (PFNGLVERTEXATTRIBP4UIPROC)LL_GET_PROC_ADDRESS("glVertexAttribP4ui"); + glVertexAttribP4uiv = (PFNGLVERTEXATTRIBP4UIVPROC)LL_GET_PROC_ADDRESS("glVertexAttribP4uiv"); // GL_VERSION_4_0 if (mGLVersion < 3.99f) { return; } - glMinSampleShading = (PFNGLMINSAMPLESHADINGPROC)GLH_EXT_GET_PROC_ADDRESS("glMinSampleShading"); - glBlendEquationi = (PFNGLBLENDEQUATIONIPROC)GLH_EXT_GET_PROC_ADDRESS("glBlendEquationi"); - glBlendEquationSeparatei = (PFNGLBLENDEQUATIONSEPARATEIPROC)GLH_EXT_GET_PROC_ADDRESS("glBlendEquationSeparatei"); - glBlendFunci = (PFNGLBLENDFUNCIPROC)GLH_EXT_GET_PROC_ADDRESS("glBlendFunci"); - glBlendFuncSeparatei = (PFNGLBLENDFUNCSEPARATEIPROC)GLH_EXT_GET_PROC_ADDRESS("glBlendFuncSeparatei"); - glDrawArraysIndirect = (PFNGLDRAWARRAYSINDIRECTPROC)GLH_EXT_GET_PROC_ADDRESS("glDrawArraysIndirect"); - glDrawElementsIndirect = (PFNGLDRAWELEMENTSINDIRECTPROC)GLH_EXT_GET_PROC_ADDRESS("glDrawElementsIndirect"); - glUniform1d = (PFNGLUNIFORM1DPROC)GLH_EXT_GET_PROC_ADDRESS("glUniform1d"); - glUniform2d = (PFNGLUNIFORM2DPROC)GLH_EXT_GET_PROC_ADDRESS("glUniform2d"); - glUniform3d = (PFNGLUNIFORM3DPROC)GLH_EXT_GET_PROC_ADDRESS("glUniform3d"); - glUniform4d = (PFNGLUNIFORM4DPROC)GLH_EXT_GET_PROC_ADDRESS("glUniform4d"); - glUniform1dv = (PFNGLUNIFORM1DVPROC)GLH_EXT_GET_PROC_ADDRESS("glUniform1dv"); - glUniform2dv = (PFNGLUNIFORM2DVPROC)GLH_EXT_GET_PROC_ADDRESS("glUniform2dv"); - glUniform3dv = (PFNGLUNIFORM3DVPROC)GLH_EXT_GET_PROC_ADDRESS("glUniform3dv"); - glUniform4dv = (PFNGLUNIFORM4DVPROC)GLH_EXT_GET_PROC_ADDRESS("glUniform4dv"); - glUniformMatrix2dv = (PFNGLUNIFORMMATRIX2DVPROC)GLH_EXT_GET_PROC_ADDRESS("glUniformMatrix2dv"); - glUniformMatrix3dv = (PFNGLUNIFORMMATRIX3DVPROC)GLH_EXT_GET_PROC_ADDRESS("glUniformMatrix3dv"); - glUniformMatrix4dv = (PFNGLUNIFORMMATRIX4DVPROC)GLH_EXT_GET_PROC_ADDRESS("glUniformMatrix4dv"); - glUniformMatrix2x3dv = (PFNGLUNIFORMMATRIX2X3DVPROC)GLH_EXT_GET_PROC_ADDRESS("glUniformMatrix2x3dv"); - glUniformMatrix2x4dv = (PFNGLUNIFORMMATRIX2X4DVPROC)GLH_EXT_GET_PROC_ADDRESS("glUniformMatrix2x4dv"); - glUniformMatrix3x2dv = (PFNGLUNIFORMMATRIX3X2DVPROC)GLH_EXT_GET_PROC_ADDRESS("glUniformMatrix3x2dv"); - glUniformMatrix3x4dv = (PFNGLUNIFORMMATRIX3X4DVPROC)GLH_EXT_GET_PROC_ADDRESS("glUniformMatrix3x4dv"); - glUniformMatrix4x2dv = (PFNGLUNIFORMMATRIX4X2DVPROC)GLH_EXT_GET_PROC_ADDRESS("glUniformMatrix4x2dv"); - glUniformMatrix4x3dv = (PFNGLUNIFORMMATRIX4X3DVPROC)GLH_EXT_GET_PROC_ADDRESS("glUniformMatrix4x3dv"); - glGetUniformdv = (PFNGLGETUNIFORMDVPROC)GLH_EXT_GET_PROC_ADDRESS("glGetUniformdv"); - glGetSubroutineUniformLocation = (PFNGLGETSUBROUTINEUNIFORMLOCATIONPROC)GLH_EXT_GET_PROC_ADDRESS("glGetSubroutineUniformLocation"); - glGetSubroutineIndex = (PFNGLGETSUBROUTINEINDEXPROC)GLH_EXT_GET_PROC_ADDRESS("glGetSubroutineIndex"); - glGetActiveSubroutineUniformiv = (PFNGLGETACTIVESUBROUTINEUNIFORMIVPROC)GLH_EXT_GET_PROC_ADDRESS("glGetActiveSubroutineUniformiv"); - glGetActiveSubroutineUniformName = (PFNGLGETACTIVESUBROUTINEUNIFORMNAMEPROC)GLH_EXT_GET_PROC_ADDRESS("glGetActiveSubroutineUniformName"); - glGetActiveSubroutineName = (PFNGLGETACTIVESUBROUTINENAMEPROC)GLH_EXT_GET_PROC_ADDRESS("glGetActiveSubroutineName"); - glUniformSubroutinesuiv = (PFNGLUNIFORMSUBROUTINESUIVPROC)GLH_EXT_GET_PROC_ADDRESS("glUniformSubroutinesuiv"); - glGetUniformSubroutineuiv = (PFNGLGETUNIFORMSUBROUTINEUIVPROC)GLH_EXT_GET_PROC_ADDRESS("glGetUniformSubroutineuiv"); - glGetProgramStageiv = (PFNGLGETPROGRAMSTAGEIVPROC)GLH_EXT_GET_PROC_ADDRESS("glGetProgramStageiv"); - glPatchParameteri = (PFNGLPATCHPARAMETERIPROC)GLH_EXT_GET_PROC_ADDRESS("glPatchParameteri"); - glPatchParameterfv = (PFNGLPATCHPARAMETERFVPROC)GLH_EXT_GET_PROC_ADDRESS("glPatchParameterfv"); - glBindTransformFeedback = (PFNGLBINDTRANSFORMFEEDBACKPROC)GLH_EXT_GET_PROC_ADDRESS("glBindTransformFeedback"); - glDeleteTransformFeedbacks = (PFNGLDELETETRANSFORMFEEDBACKSPROC)GLH_EXT_GET_PROC_ADDRESS("glDeleteTransformFeedbacks"); - glGenTransformFeedbacks = (PFNGLGENTRANSFORMFEEDBACKSPROC)GLH_EXT_GET_PROC_ADDRESS("glGenTransformFeedbacks"); - glIsTransformFeedback = (PFNGLISTRANSFORMFEEDBACKPROC)GLH_EXT_GET_PROC_ADDRESS("glIsTransformFeedback"); - glPauseTransformFeedback = (PFNGLPAUSETRANSFORMFEEDBACKPROC)GLH_EXT_GET_PROC_ADDRESS("glPauseTransformFeedback"); - glResumeTransformFeedback = (PFNGLRESUMETRANSFORMFEEDBACKPROC)GLH_EXT_GET_PROC_ADDRESS("glResumeTransformFeedback"); - glDrawTransformFeedback = (PFNGLDRAWTRANSFORMFEEDBACKPROC)GLH_EXT_GET_PROC_ADDRESS("glDrawTransformFeedback"); - glDrawTransformFeedbackStream = (PFNGLDRAWTRANSFORMFEEDBACKSTREAMPROC)GLH_EXT_GET_PROC_ADDRESS("glDrawTransformFeedbackStream"); - glBeginQueryIndexed = (PFNGLBEGINQUERYINDEXEDPROC)GLH_EXT_GET_PROC_ADDRESS("glBeginQueryIndexed"); - glEndQueryIndexed = (PFNGLENDQUERYINDEXEDPROC)GLH_EXT_GET_PROC_ADDRESS("glEndQueryIndexed"); - glGetQueryIndexediv = (PFNGLGETQUERYINDEXEDIVPROC)GLH_EXT_GET_PROC_ADDRESS("glGetQueryIndexediv"); + glMinSampleShading = (PFNGLMINSAMPLESHADINGPROC)LL_GET_PROC_ADDRESS("glMinSampleShading"); + glBlendEquationi = (PFNGLBLENDEQUATIONIPROC)LL_GET_PROC_ADDRESS("glBlendEquationi"); + glBlendEquationSeparatei = (PFNGLBLENDEQUATIONSEPARATEIPROC)LL_GET_PROC_ADDRESS("glBlendEquationSeparatei"); + glBlendFunci = (PFNGLBLENDFUNCIPROC)LL_GET_PROC_ADDRESS("glBlendFunci"); + glBlendFuncSeparatei = (PFNGLBLENDFUNCSEPARATEIPROC)LL_GET_PROC_ADDRESS("glBlendFuncSeparatei"); + glDrawArraysIndirect = (PFNGLDRAWARRAYSINDIRECTPROC)LL_GET_PROC_ADDRESS("glDrawArraysIndirect"); + glDrawElementsIndirect = (PFNGLDRAWELEMENTSINDIRECTPROC)LL_GET_PROC_ADDRESS("glDrawElementsIndirect"); + glUniform1d = (PFNGLUNIFORM1DPROC)LL_GET_PROC_ADDRESS("glUniform1d"); + glUniform2d = (PFNGLUNIFORM2DPROC)LL_GET_PROC_ADDRESS("glUniform2d"); + glUniform3d = (PFNGLUNIFORM3DPROC)LL_GET_PROC_ADDRESS("glUniform3d"); + glUniform4d = (PFNGLUNIFORM4DPROC)LL_GET_PROC_ADDRESS("glUniform4d"); + glUniform1dv = (PFNGLUNIFORM1DVPROC)LL_GET_PROC_ADDRESS("glUniform1dv"); + glUniform2dv = (PFNGLUNIFORM2DVPROC)LL_GET_PROC_ADDRESS("glUniform2dv"); + glUniform3dv = (PFNGLUNIFORM3DVPROC)LL_GET_PROC_ADDRESS("glUniform3dv"); + glUniform4dv = (PFNGLUNIFORM4DVPROC)LL_GET_PROC_ADDRESS("glUniform4dv"); + glUniformMatrix2dv = (PFNGLUNIFORMMATRIX2DVPROC)LL_GET_PROC_ADDRESS("glUniformMatrix2dv"); + glUniformMatrix3dv = (PFNGLUNIFORMMATRIX3DVPROC)LL_GET_PROC_ADDRESS("glUniformMatrix3dv"); + glUniformMatrix4dv = (PFNGLUNIFORMMATRIX4DVPROC)LL_GET_PROC_ADDRESS("glUniformMatrix4dv"); + glUniformMatrix2x3dv = (PFNGLUNIFORMMATRIX2X3DVPROC)LL_GET_PROC_ADDRESS("glUniformMatrix2x3dv"); + glUniformMatrix2x4dv = (PFNGLUNIFORMMATRIX2X4DVPROC)LL_GET_PROC_ADDRESS("glUniformMatrix2x4dv"); + glUniformMatrix3x2dv = (PFNGLUNIFORMMATRIX3X2DVPROC)LL_GET_PROC_ADDRESS("glUniformMatrix3x2dv"); + glUniformMatrix3x4dv = (PFNGLUNIFORMMATRIX3X4DVPROC)LL_GET_PROC_ADDRESS("glUniformMatrix3x4dv"); + glUniformMatrix4x2dv = (PFNGLUNIFORMMATRIX4X2DVPROC)LL_GET_PROC_ADDRESS("glUniformMatrix4x2dv"); + glUniformMatrix4x3dv = (PFNGLUNIFORMMATRIX4X3DVPROC)LL_GET_PROC_ADDRESS("glUniformMatrix4x3dv"); + glGetUniformdv = (PFNGLGETUNIFORMDVPROC)LL_GET_PROC_ADDRESS("glGetUniformdv"); + glGetSubroutineUniformLocation = (PFNGLGETSUBROUTINEUNIFORMLOCATIONPROC)LL_GET_PROC_ADDRESS("glGetSubroutineUniformLocation"); + glGetSubroutineIndex = (PFNGLGETSUBROUTINEINDEXPROC)LL_GET_PROC_ADDRESS("glGetSubroutineIndex"); + glGetActiveSubroutineUniformiv = (PFNGLGETACTIVESUBROUTINEUNIFORMIVPROC)LL_GET_PROC_ADDRESS("glGetActiveSubroutineUniformiv"); + glGetActiveSubroutineUniformName = (PFNGLGETACTIVESUBROUTINEUNIFORMNAMEPROC)LL_GET_PROC_ADDRESS("glGetActiveSubroutineUniformName"); + glGetActiveSubroutineName = (PFNGLGETACTIVESUBROUTINENAMEPROC)LL_GET_PROC_ADDRESS("glGetActiveSubroutineName"); + glUniformSubroutinesuiv = (PFNGLUNIFORMSUBROUTINESUIVPROC)LL_GET_PROC_ADDRESS("glUniformSubroutinesuiv"); + glGetUniformSubroutineuiv = (PFNGLGETUNIFORMSUBROUTINEUIVPROC)LL_GET_PROC_ADDRESS("glGetUniformSubroutineuiv"); + glGetProgramStageiv = (PFNGLGETPROGRAMSTAGEIVPROC)LL_GET_PROC_ADDRESS("glGetProgramStageiv"); + glPatchParameteri = (PFNGLPATCHPARAMETERIPROC)LL_GET_PROC_ADDRESS("glPatchParameteri"); + glPatchParameterfv = (PFNGLPATCHPARAMETERFVPROC)LL_GET_PROC_ADDRESS("glPatchParameterfv"); + glBindTransformFeedback = (PFNGLBINDTRANSFORMFEEDBACKPROC)LL_GET_PROC_ADDRESS("glBindTransformFeedback"); + glDeleteTransformFeedbacks = (PFNGLDELETETRANSFORMFEEDBACKSPROC)LL_GET_PROC_ADDRESS("glDeleteTransformFeedbacks"); + glGenTransformFeedbacks = (PFNGLGENTRANSFORMFEEDBACKSPROC)LL_GET_PROC_ADDRESS("glGenTransformFeedbacks"); + glIsTransformFeedback = (PFNGLISTRANSFORMFEEDBACKPROC)LL_GET_PROC_ADDRESS("glIsTransformFeedback"); + glPauseTransformFeedback = (PFNGLPAUSETRANSFORMFEEDBACKPROC)LL_GET_PROC_ADDRESS("glPauseTransformFeedback"); + glResumeTransformFeedback = (PFNGLRESUMETRANSFORMFEEDBACKPROC)LL_GET_PROC_ADDRESS("glResumeTransformFeedback"); + glDrawTransformFeedback = (PFNGLDRAWTRANSFORMFEEDBACKPROC)LL_GET_PROC_ADDRESS("glDrawTransformFeedback"); + glDrawTransformFeedbackStream = (PFNGLDRAWTRANSFORMFEEDBACKSTREAMPROC)LL_GET_PROC_ADDRESS("glDrawTransformFeedbackStream"); + glBeginQueryIndexed = (PFNGLBEGINQUERYINDEXEDPROC)LL_GET_PROC_ADDRESS("glBeginQueryIndexed"); + glEndQueryIndexed = (PFNGLENDQUERYINDEXEDPROC)LL_GET_PROC_ADDRESS("glEndQueryIndexed"); + glGetQueryIndexediv = (PFNGLGETQUERYINDEXEDIVPROC)LL_GET_PROC_ADDRESS("glGetQueryIndexediv"); // GL_VERSION_4_1 if (mGLVersion < 4.09f) { return; } - glReleaseShaderCompiler = (PFNGLRELEASESHADERCOMPILERPROC)GLH_EXT_GET_PROC_ADDRESS("glReleaseShaderCompiler"); - glShaderBinary = (PFNGLSHADERBINARYPROC)GLH_EXT_GET_PROC_ADDRESS("glShaderBinary"); - glGetShaderPrecisionFormat = (PFNGLGETSHADERPRECISIONFORMATPROC)GLH_EXT_GET_PROC_ADDRESS("glGetShaderPrecisionFormat"); - glDepthRangef = (PFNGLDEPTHRANGEFPROC)GLH_EXT_GET_PROC_ADDRESS("glDepthRangef"); - glClearDepthf = (PFNGLCLEARDEPTHFPROC)GLH_EXT_GET_PROC_ADDRESS("glClearDepthf"); - glGetProgramBinary = (PFNGLGETPROGRAMBINARYPROC)GLH_EXT_GET_PROC_ADDRESS("glGetProgramBinary"); - glProgramBinary = (PFNGLPROGRAMBINARYPROC)GLH_EXT_GET_PROC_ADDRESS("glProgramBinary"); - glProgramParameteri = (PFNGLPROGRAMPARAMETERIPROC)GLH_EXT_GET_PROC_ADDRESS("glProgramParameteri"); - glUseProgramStages = (PFNGLUSEPROGRAMSTAGESPROC)GLH_EXT_GET_PROC_ADDRESS("glUseProgramStages"); - glActiveShaderProgram = (PFNGLACTIVESHADERPROGRAMPROC)GLH_EXT_GET_PROC_ADDRESS("glActiveShaderProgram"); - glCreateShaderProgramv = (PFNGLCREATESHADERPROGRAMVPROC)GLH_EXT_GET_PROC_ADDRESS("glCreateShaderProgramv"); - glBindProgramPipeline = (PFNGLBINDPROGRAMPIPELINEPROC)GLH_EXT_GET_PROC_ADDRESS("glBindProgramPipeline"); - glDeleteProgramPipelines = (PFNGLDELETEPROGRAMPIPELINESPROC)GLH_EXT_GET_PROC_ADDRESS("glDeleteProgramPipelines"); - glGenProgramPipelines = (PFNGLGENPROGRAMPIPELINESPROC)GLH_EXT_GET_PROC_ADDRESS("glGenProgramPipelines"); - glIsProgramPipeline = (PFNGLISPROGRAMPIPELINEPROC)GLH_EXT_GET_PROC_ADDRESS("glIsProgramPipeline"); - glGetProgramPipelineiv = (PFNGLGETPROGRAMPIPELINEIVPROC)GLH_EXT_GET_PROC_ADDRESS("glGetProgramPipelineiv"); - glProgramUniform1i = (PFNGLPROGRAMUNIFORM1IPROC)GLH_EXT_GET_PROC_ADDRESS("glProgramUniform1i"); - glProgramUniform1iv = (PFNGLPROGRAMUNIFORM1IVPROC)GLH_EXT_GET_PROC_ADDRESS("glProgramUniform1iv"); - glProgramUniform1f = (PFNGLPROGRAMUNIFORM1FPROC)GLH_EXT_GET_PROC_ADDRESS("glProgramUniform1f"); - glProgramUniform1fv = (PFNGLPROGRAMUNIFORM1FVPROC)GLH_EXT_GET_PROC_ADDRESS("glProgramUniform1fv"); - glProgramUniform1d = (PFNGLPROGRAMUNIFORM1DPROC)GLH_EXT_GET_PROC_ADDRESS("glProgramUniform1d"); - glProgramUniform1dv = (PFNGLPROGRAMUNIFORM1DVPROC)GLH_EXT_GET_PROC_ADDRESS("glProgramUniform1dv"); - glProgramUniform1ui = (PFNGLPROGRAMUNIFORM1UIPROC)GLH_EXT_GET_PROC_ADDRESS("glProgramUniform1ui"); - glProgramUniform1uiv = (PFNGLPROGRAMUNIFORM1UIVPROC)GLH_EXT_GET_PROC_ADDRESS("glProgramUniform1uiv"); - glProgramUniform2i = (PFNGLPROGRAMUNIFORM2IPROC)GLH_EXT_GET_PROC_ADDRESS("glProgramUniform2i"); - glProgramUniform2iv = (PFNGLPROGRAMUNIFORM2IVPROC)GLH_EXT_GET_PROC_ADDRESS("glProgramUniform2iv"); - glProgramUniform2f = (PFNGLPROGRAMUNIFORM2FPROC)GLH_EXT_GET_PROC_ADDRESS("glProgramUniform2f"); - glProgramUniform2fv = (PFNGLPROGRAMUNIFORM2FVPROC)GLH_EXT_GET_PROC_ADDRESS("glProgramUniform2fv"); - glProgramUniform2d = (PFNGLPROGRAMUNIFORM2DPROC)GLH_EXT_GET_PROC_ADDRESS("glProgramUniform2d"); - glProgramUniform2dv = (PFNGLPROGRAMUNIFORM2DVPROC)GLH_EXT_GET_PROC_ADDRESS("glProgramUniform2dv"); - glProgramUniform2ui = (PFNGLPROGRAMUNIFORM2UIPROC)GLH_EXT_GET_PROC_ADDRESS("glProgramUniform2ui"); - glProgramUniform2uiv = (PFNGLPROGRAMUNIFORM2UIVPROC)GLH_EXT_GET_PROC_ADDRESS("glProgramUniform2uiv"); - glProgramUniform3i = (PFNGLPROGRAMUNIFORM3IPROC)GLH_EXT_GET_PROC_ADDRESS("glProgramUniform3i"); - glProgramUniform3iv = (PFNGLPROGRAMUNIFORM3IVPROC)GLH_EXT_GET_PROC_ADDRESS("glProgramUniform3iv"); - glProgramUniform3f = (PFNGLPROGRAMUNIFORM3FPROC)GLH_EXT_GET_PROC_ADDRESS("glProgramUniform3f"); - glProgramUniform3fv = (PFNGLPROGRAMUNIFORM3FVPROC)GLH_EXT_GET_PROC_ADDRESS("glProgramUniform3fv"); - glProgramUniform3d = (PFNGLPROGRAMUNIFORM3DPROC)GLH_EXT_GET_PROC_ADDRESS("glProgramUniform3d"); - glProgramUniform3dv = (PFNGLPROGRAMUNIFORM3DVPROC)GLH_EXT_GET_PROC_ADDRESS("glProgramUniform3dv"); - glProgramUniform3ui = (PFNGLPROGRAMUNIFORM3UIPROC)GLH_EXT_GET_PROC_ADDRESS("glProgramUniform3ui"); - glProgramUniform3uiv = (PFNGLPROGRAMUNIFORM3UIVPROC)GLH_EXT_GET_PROC_ADDRESS("glProgramUniform3uiv"); - glProgramUniform4i = (PFNGLPROGRAMUNIFORM4IPROC)GLH_EXT_GET_PROC_ADDRESS("glProgramUniform4i"); - glProgramUniform4iv = (PFNGLPROGRAMUNIFORM4IVPROC)GLH_EXT_GET_PROC_ADDRESS("glProgramUniform4iv"); - glProgramUniform4f = (PFNGLPROGRAMUNIFORM4FPROC)GLH_EXT_GET_PROC_ADDRESS("glProgramUniform4f"); - glProgramUniform4fv = (PFNGLPROGRAMUNIFORM4FVPROC)GLH_EXT_GET_PROC_ADDRESS("glProgramUniform4fv"); - glProgramUniform4d = (PFNGLPROGRAMUNIFORM4DPROC)GLH_EXT_GET_PROC_ADDRESS("glProgramUniform4d"); - glProgramUniform4dv = (PFNGLPROGRAMUNIFORM4DVPROC)GLH_EXT_GET_PROC_ADDRESS("glProgramUniform4dv"); - glProgramUniform4ui = (PFNGLPROGRAMUNIFORM4UIPROC)GLH_EXT_GET_PROC_ADDRESS("glProgramUniform4ui"); - glProgramUniform4uiv = (PFNGLPROGRAMUNIFORM4UIVPROC)GLH_EXT_GET_PROC_ADDRESS("glProgramUniform4uiv"); - glProgramUniformMatrix2fv = (PFNGLPROGRAMUNIFORMMATRIX2FVPROC)GLH_EXT_GET_PROC_ADDRESS("glProgramUniformMatrix2fv"); - glProgramUniformMatrix3fv = (PFNGLPROGRAMUNIFORMMATRIX3FVPROC)GLH_EXT_GET_PROC_ADDRESS("glProgramUniformMatrix3fv"); - glProgramUniformMatrix4fv = (PFNGLPROGRAMUNIFORMMATRIX4FVPROC)GLH_EXT_GET_PROC_ADDRESS("glProgramUniformMatrix4fv"); - glProgramUniformMatrix2dv = (PFNGLPROGRAMUNIFORMMATRIX2DVPROC)GLH_EXT_GET_PROC_ADDRESS("glProgramUniformMatrix2dv"); - glProgramUniformMatrix3dv = (PFNGLPROGRAMUNIFORMMATRIX3DVPROC)GLH_EXT_GET_PROC_ADDRESS("glProgramUniformMatrix3dv"); - glProgramUniformMatrix4dv = (PFNGLPROGRAMUNIFORMMATRIX4DVPROC)GLH_EXT_GET_PROC_ADDRESS("glProgramUniformMatrix4dv"); - glProgramUniformMatrix2x3fv = (PFNGLPROGRAMUNIFORMMATRIX2X3FVPROC)GLH_EXT_GET_PROC_ADDRESS("glProgramUniformMatrix2x3fv"); - glProgramUniformMatrix3x2fv = (PFNGLPROGRAMUNIFORMMATRIX3X2FVPROC)GLH_EXT_GET_PROC_ADDRESS("glProgramUniformMatrix3x2fv"); - glProgramUniformMatrix2x4fv = (PFNGLPROGRAMUNIFORMMATRIX2X4FVPROC)GLH_EXT_GET_PROC_ADDRESS("glProgramUniformMatrix2x4fv"); - glProgramUniformMatrix4x2fv = (PFNGLPROGRAMUNIFORMMATRIX4X2FVPROC)GLH_EXT_GET_PROC_ADDRESS("glProgramUniformMatrix4x2fv"); - glProgramUniformMatrix3x4fv = (PFNGLPROGRAMUNIFORMMATRIX3X4FVPROC)GLH_EXT_GET_PROC_ADDRESS("glProgramUniformMatrix3x4fv"); - glProgramUniformMatrix4x3fv = (PFNGLPROGRAMUNIFORMMATRIX4X3FVPROC)GLH_EXT_GET_PROC_ADDRESS("glProgramUniformMatrix4x3fv"); - glProgramUniformMatrix2x3dv = (PFNGLPROGRAMUNIFORMMATRIX2X3DVPROC)GLH_EXT_GET_PROC_ADDRESS("glProgramUniformMatrix2x3dv"); - glProgramUniformMatrix3x2dv = (PFNGLPROGRAMUNIFORMMATRIX3X2DVPROC)GLH_EXT_GET_PROC_ADDRESS("glProgramUniformMatrix3x2dv"); - glProgramUniformMatrix2x4dv = (PFNGLPROGRAMUNIFORMMATRIX2X4DVPROC)GLH_EXT_GET_PROC_ADDRESS("glProgramUniformMatrix2x4dv"); - glProgramUniformMatrix4x2dv = (PFNGLPROGRAMUNIFORMMATRIX4X2DVPROC)GLH_EXT_GET_PROC_ADDRESS("glProgramUniformMatrix4x2dv"); - glProgramUniformMatrix3x4dv = (PFNGLPROGRAMUNIFORMMATRIX3X4DVPROC)GLH_EXT_GET_PROC_ADDRESS("glProgramUniformMatrix3x4dv"); - glProgramUniformMatrix4x3dv = (PFNGLPROGRAMUNIFORMMATRIX4X3DVPROC)GLH_EXT_GET_PROC_ADDRESS("glProgramUniformMatrix4x3dv"); - glValidateProgramPipeline = (PFNGLVALIDATEPROGRAMPIPELINEPROC)GLH_EXT_GET_PROC_ADDRESS("glValidateProgramPipeline"); - glGetProgramPipelineInfoLog = (PFNGLGETPROGRAMPIPELINEINFOLOGPROC)GLH_EXT_GET_PROC_ADDRESS("glGetProgramPipelineInfoLog"); - glVertexAttribL1d = (PFNGLVERTEXATTRIBL1DPROC)GLH_EXT_GET_PROC_ADDRESS("glVertexAttribL1d"); - glVertexAttribL2d = (PFNGLVERTEXATTRIBL2DPROC)GLH_EXT_GET_PROC_ADDRESS("glVertexAttribL2d"); - glVertexAttribL3d = (PFNGLVERTEXATTRIBL3DPROC)GLH_EXT_GET_PROC_ADDRESS("glVertexAttribL3d"); - glVertexAttribL4d = (PFNGLVERTEXATTRIBL4DPROC)GLH_EXT_GET_PROC_ADDRESS("glVertexAttribL4d"); - glVertexAttribL1dv = (PFNGLVERTEXATTRIBL1DVPROC)GLH_EXT_GET_PROC_ADDRESS("glVertexAttribL1dv"); - glVertexAttribL2dv = (PFNGLVERTEXATTRIBL2DVPROC)GLH_EXT_GET_PROC_ADDRESS("glVertexAttribL2dv"); - glVertexAttribL3dv = (PFNGLVERTEXATTRIBL3DVPROC)GLH_EXT_GET_PROC_ADDRESS("glVertexAttribL3dv"); - glVertexAttribL4dv = (PFNGLVERTEXATTRIBL4DVPROC)GLH_EXT_GET_PROC_ADDRESS("glVertexAttribL4dv"); - glVertexAttribLPointer = (PFNGLVERTEXATTRIBLPOINTERPROC)GLH_EXT_GET_PROC_ADDRESS("glVertexAttribLPointer"); - glGetVertexAttribLdv = (PFNGLGETVERTEXATTRIBLDVPROC)GLH_EXT_GET_PROC_ADDRESS("glGetVertexAttribLdv"); - glViewportArrayv = (PFNGLVIEWPORTARRAYVPROC)GLH_EXT_GET_PROC_ADDRESS("glViewportArrayv"); - glViewportIndexedf = (PFNGLVIEWPORTINDEXEDFPROC)GLH_EXT_GET_PROC_ADDRESS("glViewportIndexedf"); - glViewportIndexedfv = (PFNGLVIEWPORTINDEXEDFVPROC)GLH_EXT_GET_PROC_ADDRESS("glViewportIndexedfv"); - glScissorArrayv = (PFNGLSCISSORARRAYVPROC)GLH_EXT_GET_PROC_ADDRESS("glScissorArrayv"); - glScissorIndexed = (PFNGLSCISSORINDEXEDPROC)GLH_EXT_GET_PROC_ADDRESS("glScissorIndexed"); - glScissorIndexedv = (PFNGLSCISSORINDEXEDVPROC)GLH_EXT_GET_PROC_ADDRESS("glScissorIndexedv"); - glDepthRangeArrayv = (PFNGLDEPTHRANGEARRAYVPROC)GLH_EXT_GET_PROC_ADDRESS("glDepthRangeArrayv"); - glDepthRangeIndexed = (PFNGLDEPTHRANGEINDEXEDPROC)GLH_EXT_GET_PROC_ADDRESS("glDepthRangeIndexed"); - glGetFloati_v = (PFNGLGETFLOATI_VPROC)GLH_EXT_GET_PROC_ADDRESS("glGetFloati_v"); - glGetDoublei_v = (PFNGLGETDOUBLEI_VPROC)GLH_EXT_GET_PROC_ADDRESS("glGetDoublei_v"); + glReleaseShaderCompiler = (PFNGLRELEASESHADERCOMPILERPROC)LL_GET_PROC_ADDRESS("glReleaseShaderCompiler"); + glShaderBinary = (PFNGLSHADERBINARYPROC)LL_GET_PROC_ADDRESS("glShaderBinary"); + glGetShaderPrecisionFormat = (PFNGLGETSHADERPRECISIONFORMATPROC)LL_GET_PROC_ADDRESS("glGetShaderPrecisionFormat"); + glDepthRangef = (PFNGLDEPTHRANGEFPROC)LL_GET_PROC_ADDRESS("glDepthRangef"); + glClearDepthf = (PFNGLCLEARDEPTHFPROC)LL_GET_PROC_ADDRESS("glClearDepthf"); + glGetProgramBinary = (PFNGLGETPROGRAMBINARYPROC)LL_GET_PROC_ADDRESS("glGetProgramBinary"); + glProgramBinary = (PFNGLPROGRAMBINARYPROC)LL_GET_PROC_ADDRESS("glProgramBinary"); + glProgramParameteri = (PFNGLPROGRAMPARAMETERIPROC)LL_GET_PROC_ADDRESS("glProgramParameteri"); + glUseProgramStages = (PFNGLUSEPROGRAMSTAGESPROC)LL_GET_PROC_ADDRESS("glUseProgramStages"); + glActiveShaderProgram = (PFNGLACTIVESHADERPROGRAMPROC)LL_GET_PROC_ADDRESS("glActiveShaderProgram"); + glCreateShaderProgramv = (PFNGLCREATESHADERPROGRAMVPROC)LL_GET_PROC_ADDRESS("glCreateShaderProgramv"); + glBindProgramPipeline = (PFNGLBINDPROGRAMPIPELINEPROC)LL_GET_PROC_ADDRESS("glBindProgramPipeline"); + glDeleteProgramPipelines = (PFNGLDELETEPROGRAMPIPELINESPROC)LL_GET_PROC_ADDRESS("glDeleteProgramPipelines"); + glGenProgramPipelines = (PFNGLGENPROGRAMPIPELINESPROC)LL_GET_PROC_ADDRESS("glGenProgramPipelines"); + glIsProgramPipeline = (PFNGLISPROGRAMPIPELINEPROC)LL_GET_PROC_ADDRESS("glIsProgramPipeline"); + glGetProgramPipelineiv = (PFNGLGETPROGRAMPIPELINEIVPROC)LL_GET_PROC_ADDRESS("glGetProgramPipelineiv"); + glProgramUniform1i = (PFNGLPROGRAMUNIFORM1IPROC)LL_GET_PROC_ADDRESS("glProgramUniform1i"); + glProgramUniform1iv = (PFNGLPROGRAMUNIFORM1IVPROC)LL_GET_PROC_ADDRESS("glProgramUniform1iv"); + glProgramUniform1f = (PFNGLPROGRAMUNIFORM1FPROC)LL_GET_PROC_ADDRESS("glProgramUniform1f"); + glProgramUniform1fv = (PFNGLPROGRAMUNIFORM1FVPROC)LL_GET_PROC_ADDRESS("glProgramUniform1fv"); + glProgramUniform1d = (PFNGLPROGRAMUNIFORM1DPROC)LL_GET_PROC_ADDRESS("glProgramUniform1d"); + glProgramUniform1dv = (PFNGLPROGRAMUNIFORM1DVPROC)LL_GET_PROC_ADDRESS("glProgramUniform1dv"); + glProgramUniform1ui = (PFNGLPROGRAMUNIFORM1UIPROC)LL_GET_PROC_ADDRESS("glProgramUniform1ui"); + glProgramUniform1uiv = (PFNGLPROGRAMUNIFORM1UIVPROC)LL_GET_PROC_ADDRESS("glProgramUniform1uiv"); + glProgramUniform2i = (PFNGLPROGRAMUNIFORM2IPROC)LL_GET_PROC_ADDRESS("glProgramUniform2i"); + glProgramUniform2iv = (PFNGLPROGRAMUNIFORM2IVPROC)LL_GET_PROC_ADDRESS("glProgramUniform2iv"); + glProgramUniform2f = (PFNGLPROGRAMUNIFORM2FPROC)LL_GET_PROC_ADDRESS("glProgramUniform2f"); + glProgramUniform2fv = (PFNGLPROGRAMUNIFORM2FVPROC)LL_GET_PROC_ADDRESS("glProgramUniform2fv"); + glProgramUniform2d = (PFNGLPROGRAMUNIFORM2DPROC)LL_GET_PROC_ADDRESS("glProgramUniform2d"); + glProgramUniform2dv = (PFNGLPROGRAMUNIFORM2DVPROC)LL_GET_PROC_ADDRESS("glProgramUniform2dv"); + glProgramUniform2ui = (PFNGLPROGRAMUNIFORM2UIPROC)LL_GET_PROC_ADDRESS("glProgramUniform2ui"); + glProgramUniform2uiv = (PFNGLPROGRAMUNIFORM2UIVPROC)LL_GET_PROC_ADDRESS("glProgramUniform2uiv"); + glProgramUniform3i = (PFNGLPROGRAMUNIFORM3IPROC)LL_GET_PROC_ADDRESS("glProgramUniform3i"); + glProgramUniform3iv = (PFNGLPROGRAMUNIFORM3IVPROC)LL_GET_PROC_ADDRESS("glProgramUniform3iv"); + glProgramUniform3f = (PFNGLPROGRAMUNIFORM3FPROC)LL_GET_PROC_ADDRESS("glProgramUniform3f"); + glProgramUniform3fv = (PFNGLPROGRAMUNIFORM3FVPROC)LL_GET_PROC_ADDRESS("glProgramUniform3fv"); + glProgramUniform3d = (PFNGLPROGRAMUNIFORM3DPROC)LL_GET_PROC_ADDRESS("glProgramUniform3d"); + glProgramUniform3dv = (PFNGLPROGRAMUNIFORM3DVPROC)LL_GET_PROC_ADDRESS("glProgramUniform3dv"); + glProgramUniform3ui = (PFNGLPROGRAMUNIFORM3UIPROC)LL_GET_PROC_ADDRESS("glProgramUniform3ui"); + glProgramUniform3uiv = (PFNGLPROGRAMUNIFORM3UIVPROC)LL_GET_PROC_ADDRESS("glProgramUniform3uiv"); + glProgramUniform4i = (PFNGLPROGRAMUNIFORM4IPROC)LL_GET_PROC_ADDRESS("glProgramUniform4i"); + glProgramUniform4iv = (PFNGLPROGRAMUNIFORM4IVPROC)LL_GET_PROC_ADDRESS("glProgramUniform4iv"); + glProgramUniform4f = (PFNGLPROGRAMUNIFORM4FPROC)LL_GET_PROC_ADDRESS("glProgramUniform4f"); + glProgramUniform4fv = (PFNGLPROGRAMUNIFORM4FVPROC)LL_GET_PROC_ADDRESS("glProgramUniform4fv"); + glProgramUniform4d = (PFNGLPROGRAMUNIFORM4DPROC)LL_GET_PROC_ADDRESS("glProgramUniform4d"); + glProgramUniform4dv = (PFNGLPROGRAMUNIFORM4DVPROC)LL_GET_PROC_ADDRESS("glProgramUniform4dv"); + glProgramUniform4ui = (PFNGLPROGRAMUNIFORM4UIPROC)LL_GET_PROC_ADDRESS("glProgramUniform4ui"); + glProgramUniform4uiv = (PFNGLPROGRAMUNIFORM4UIVPROC)LL_GET_PROC_ADDRESS("glProgramUniform4uiv"); + glProgramUniformMatrix2fv = (PFNGLPROGRAMUNIFORMMATRIX2FVPROC)LL_GET_PROC_ADDRESS("glProgramUniformMatrix2fv"); + glProgramUniformMatrix3fv = (PFNGLPROGRAMUNIFORMMATRIX3FVPROC)LL_GET_PROC_ADDRESS("glProgramUniformMatrix3fv"); + glProgramUniformMatrix4fv = (PFNGLPROGRAMUNIFORMMATRIX4FVPROC)LL_GET_PROC_ADDRESS("glProgramUniformMatrix4fv"); + glProgramUniformMatrix2dv = (PFNGLPROGRAMUNIFORMMATRIX2DVPROC)LL_GET_PROC_ADDRESS("glProgramUniformMatrix2dv"); + glProgramUniformMatrix3dv = (PFNGLPROGRAMUNIFORMMATRIX3DVPROC)LL_GET_PROC_ADDRESS("glProgramUniformMatrix3dv"); + glProgramUniformMatrix4dv = (PFNGLPROGRAMUNIFORMMATRIX4DVPROC)LL_GET_PROC_ADDRESS("glProgramUniformMatrix4dv"); + glProgramUniformMatrix2x3fv = (PFNGLPROGRAMUNIFORMMATRIX2X3FVPROC)LL_GET_PROC_ADDRESS("glProgramUniformMatrix2x3fv"); + glProgramUniformMatrix3x2fv = (PFNGLPROGRAMUNIFORMMATRIX3X2FVPROC)LL_GET_PROC_ADDRESS("glProgramUniformMatrix3x2fv"); + glProgramUniformMatrix2x4fv = (PFNGLPROGRAMUNIFORMMATRIX2X4FVPROC)LL_GET_PROC_ADDRESS("glProgramUniformMatrix2x4fv"); + glProgramUniformMatrix4x2fv = (PFNGLPROGRAMUNIFORMMATRIX4X2FVPROC)LL_GET_PROC_ADDRESS("glProgramUniformMatrix4x2fv"); + glProgramUniformMatrix3x4fv = (PFNGLPROGRAMUNIFORMMATRIX3X4FVPROC)LL_GET_PROC_ADDRESS("glProgramUniformMatrix3x4fv"); + glProgramUniformMatrix4x3fv = (PFNGLPROGRAMUNIFORMMATRIX4X3FVPROC)LL_GET_PROC_ADDRESS("glProgramUniformMatrix4x3fv"); + glProgramUniformMatrix2x3dv = (PFNGLPROGRAMUNIFORMMATRIX2X3DVPROC)LL_GET_PROC_ADDRESS("glProgramUniformMatrix2x3dv"); + glProgramUniformMatrix3x2dv = (PFNGLPROGRAMUNIFORMMATRIX3X2DVPROC)LL_GET_PROC_ADDRESS("glProgramUniformMatrix3x2dv"); + glProgramUniformMatrix2x4dv = (PFNGLPROGRAMUNIFORMMATRIX2X4DVPROC)LL_GET_PROC_ADDRESS("glProgramUniformMatrix2x4dv"); + glProgramUniformMatrix4x2dv = (PFNGLPROGRAMUNIFORMMATRIX4X2DVPROC)LL_GET_PROC_ADDRESS("glProgramUniformMatrix4x2dv"); + glProgramUniformMatrix3x4dv = (PFNGLPROGRAMUNIFORMMATRIX3X4DVPROC)LL_GET_PROC_ADDRESS("glProgramUniformMatrix3x4dv"); + glProgramUniformMatrix4x3dv = (PFNGLPROGRAMUNIFORMMATRIX4X3DVPROC)LL_GET_PROC_ADDRESS("glProgramUniformMatrix4x3dv"); + glValidateProgramPipeline = (PFNGLVALIDATEPROGRAMPIPELINEPROC)LL_GET_PROC_ADDRESS("glValidateProgramPipeline"); + glGetProgramPipelineInfoLog = (PFNGLGETPROGRAMPIPELINEINFOLOGPROC)LL_GET_PROC_ADDRESS("glGetProgramPipelineInfoLog"); + glVertexAttribL1d = (PFNGLVERTEXATTRIBL1DPROC)LL_GET_PROC_ADDRESS("glVertexAttribL1d"); + glVertexAttribL2d = (PFNGLVERTEXATTRIBL2DPROC)LL_GET_PROC_ADDRESS("glVertexAttribL2d"); + glVertexAttribL3d = (PFNGLVERTEXATTRIBL3DPROC)LL_GET_PROC_ADDRESS("glVertexAttribL3d"); + glVertexAttribL4d = (PFNGLVERTEXATTRIBL4DPROC)LL_GET_PROC_ADDRESS("glVertexAttribL4d"); + glVertexAttribL1dv = (PFNGLVERTEXATTRIBL1DVPROC)LL_GET_PROC_ADDRESS("glVertexAttribL1dv"); + glVertexAttribL2dv = (PFNGLVERTEXATTRIBL2DVPROC)LL_GET_PROC_ADDRESS("glVertexAttribL2dv"); + glVertexAttribL3dv = (PFNGLVERTEXATTRIBL3DVPROC)LL_GET_PROC_ADDRESS("glVertexAttribL3dv"); + glVertexAttribL4dv = (PFNGLVERTEXATTRIBL4DVPROC)LL_GET_PROC_ADDRESS("glVertexAttribL4dv"); + glVertexAttribLPointer = (PFNGLVERTEXATTRIBLPOINTERPROC)LL_GET_PROC_ADDRESS("glVertexAttribLPointer"); + glGetVertexAttribLdv = (PFNGLGETVERTEXATTRIBLDVPROC)LL_GET_PROC_ADDRESS("glGetVertexAttribLdv"); + glViewportArrayv = (PFNGLVIEWPORTARRAYVPROC)LL_GET_PROC_ADDRESS("glViewportArrayv"); + glViewportIndexedf = (PFNGLVIEWPORTINDEXEDFPROC)LL_GET_PROC_ADDRESS("glViewportIndexedf"); + glViewportIndexedfv = (PFNGLVIEWPORTINDEXEDFVPROC)LL_GET_PROC_ADDRESS("glViewportIndexedfv"); + glScissorArrayv = (PFNGLSCISSORARRAYVPROC)LL_GET_PROC_ADDRESS("glScissorArrayv"); + glScissorIndexed = (PFNGLSCISSORINDEXEDPROC)LL_GET_PROC_ADDRESS("glScissorIndexed"); + glScissorIndexedv = (PFNGLSCISSORINDEXEDVPROC)LL_GET_PROC_ADDRESS("glScissorIndexedv"); + glDepthRangeArrayv = (PFNGLDEPTHRANGEARRAYVPROC)LL_GET_PROC_ADDRESS("glDepthRangeArrayv"); + glDepthRangeIndexed = (PFNGLDEPTHRANGEINDEXEDPROC)LL_GET_PROC_ADDRESS("glDepthRangeIndexed"); + glGetFloati_v = (PFNGLGETFLOATI_VPROC)LL_GET_PROC_ADDRESS("glGetFloati_v"); + glGetDoublei_v = (PFNGLGETDOUBLEI_VPROC)LL_GET_PROC_ADDRESS("glGetDoublei_v"); // GL_VERSION_4_2 if (mGLVersion < 4.19f) { return; } - glDrawArraysInstancedBaseInstance = (PFNGLDRAWARRAYSINSTANCEDBASEINSTANCEPROC)GLH_EXT_GET_PROC_ADDRESS("glDrawArraysInstancedBaseInstance"); - glDrawElementsInstancedBaseInstance = (PFNGLDRAWELEMENTSINSTANCEDBASEINSTANCEPROC)GLH_EXT_GET_PROC_ADDRESS("glDrawElementsInstancedBaseInstance"); - glDrawElementsInstancedBaseVertexBaseInstance = (PFNGLDRAWELEMENTSINSTANCEDBASEVERTEXBASEINSTANCEPROC)GLH_EXT_GET_PROC_ADDRESS("glDrawElementsInstancedBaseVertexBaseInstance"); - glGetInternalformativ = (PFNGLGETINTERNALFORMATIVPROC)GLH_EXT_GET_PROC_ADDRESS("glGetInternalformativ"); - glGetActiveAtomicCounterBufferiv = (PFNGLGETACTIVEATOMICCOUNTERBUFFERIVPROC)GLH_EXT_GET_PROC_ADDRESS("glGetActiveAtomicCounterBufferiv"); - glBindImageTexture = (PFNGLBINDIMAGETEXTUREPROC)GLH_EXT_GET_PROC_ADDRESS("glBindImageTexture"); - glMemoryBarrier = (PFNGLMEMORYBARRIERPROC)GLH_EXT_GET_PROC_ADDRESS("glMemoryBarrier"); - glTexStorage1D = (PFNGLTEXSTORAGE1DPROC)GLH_EXT_GET_PROC_ADDRESS("glTexStorage1D"); - glTexStorage2D = (PFNGLTEXSTORAGE2DPROC)GLH_EXT_GET_PROC_ADDRESS("glTexStorage2D"); - glTexStorage3D = (PFNGLTEXSTORAGE3DPROC)GLH_EXT_GET_PROC_ADDRESS("glTexStorage3D"); - glDrawTransformFeedbackInstanced = (PFNGLDRAWTRANSFORMFEEDBACKINSTANCEDPROC)GLH_EXT_GET_PROC_ADDRESS("glDrawTransformFeedbackInstanced"); - glDrawTransformFeedbackStreamInstanced = (PFNGLDRAWTRANSFORMFEEDBACKSTREAMINSTANCEDPROC)GLH_EXT_GET_PROC_ADDRESS("glDrawTransformFeedbackStreamInstanced"); + glDrawArraysInstancedBaseInstance = (PFNGLDRAWARRAYSINSTANCEDBASEINSTANCEPROC)LL_GET_PROC_ADDRESS("glDrawArraysInstancedBaseInstance"); + glDrawElementsInstancedBaseInstance = (PFNGLDRAWELEMENTSINSTANCEDBASEINSTANCEPROC)LL_GET_PROC_ADDRESS("glDrawElementsInstancedBaseInstance"); + glDrawElementsInstancedBaseVertexBaseInstance = (PFNGLDRAWELEMENTSINSTANCEDBASEVERTEXBASEINSTANCEPROC)LL_GET_PROC_ADDRESS("glDrawElementsInstancedBaseVertexBaseInstance"); + glGetInternalformativ = (PFNGLGETINTERNALFORMATIVPROC)LL_GET_PROC_ADDRESS("glGetInternalformativ"); + glGetActiveAtomicCounterBufferiv = (PFNGLGETACTIVEATOMICCOUNTERBUFFERIVPROC)LL_GET_PROC_ADDRESS("glGetActiveAtomicCounterBufferiv"); + glBindImageTexture = (PFNGLBINDIMAGETEXTUREPROC)LL_GET_PROC_ADDRESS("glBindImageTexture"); + glMemoryBarrier = (PFNGLMEMORYBARRIERPROC)LL_GET_PROC_ADDRESS("glMemoryBarrier"); + glTexStorage1D = (PFNGLTEXSTORAGE1DPROC)LL_GET_PROC_ADDRESS("glTexStorage1D"); + glTexStorage2D = (PFNGLTEXSTORAGE2DPROC)LL_GET_PROC_ADDRESS("glTexStorage2D"); + glTexStorage3D = (PFNGLTEXSTORAGE3DPROC)LL_GET_PROC_ADDRESS("glTexStorage3D"); + glDrawTransformFeedbackInstanced = (PFNGLDRAWTRANSFORMFEEDBACKINSTANCEDPROC)LL_GET_PROC_ADDRESS("glDrawTransformFeedbackInstanced"); + glDrawTransformFeedbackStreamInstanced = (PFNGLDRAWTRANSFORMFEEDBACKSTREAMINSTANCEDPROC)LL_GET_PROC_ADDRESS("glDrawTransformFeedbackStreamInstanced"); // GL_VERSION_4_3 if (mGLVersion < 4.29f) { return; } - glClearBufferData = (PFNGLCLEARBUFFERDATAPROC)GLH_EXT_GET_PROC_ADDRESS("glClearBufferData"); - glClearBufferSubData = (PFNGLCLEARBUFFERSUBDATAPROC)GLH_EXT_GET_PROC_ADDRESS("glClearBufferSubData"); - glDispatchCompute = (PFNGLDISPATCHCOMPUTEPROC)GLH_EXT_GET_PROC_ADDRESS("glDispatchCompute"); - glDispatchComputeIndirect = (PFNGLDISPATCHCOMPUTEINDIRECTPROC)GLH_EXT_GET_PROC_ADDRESS("glDispatchComputeIndirect"); - glCopyImageSubData = (PFNGLCOPYIMAGESUBDATAPROC)GLH_EXT_GET_PROC_ADDRESS("glCopyImageSubData"); - glFramebufferParameteri = (PFNGLFRAMEBUFFERPARAMETERIPROC)GLH_EXT_GET_PROC_ADDRESS("glFramebufferParameteri"); - glGetFramebufferParameteriv = (PFNGLGETFRAMEBUFFERPARAMETERIVPROC)GLH_EXT_GET_PROC_ADDRESS("glGetFramebufferParameteriv"); - glGetInternalformati64v = (PFNGLGETINTERNALFORMATI64VPROC)GLH_EXT_GET_PROC_ADDRESS("glGetInternalformati64v"); - glInvalidateTexSubImage = (PFNGLINVALIDATETEXSUBIMAGEPROC)GLH_EXT_GET_PROC_ADDRESS("glInvalidateTexSubImage"); - glInvalidateTexImage = (PFNGLINVALIDATETEXIMAGEPROC)GLH_EXT_GET_PROC_ADDRESS("glInvalidateTexImage"); - glInvalidateBufferSubData = (PFNGLINVALIDATEBUFFERSUBDATAPROC)GLH_EXT_GET_PROC_ADDRESS("glInvalidateBufferSubData"); - glInvalidateBufferData = (PFNGLINVALIDATEBUFFERDATAPROC)GLH_EXT_GET_PROC_ADDRESS("glInvalidateBufferData"); - glInvalidateFramebuffer = (PFNGLINVALIDATEFRAMEBUFFERPROC)GLH_EXT_GET_PROC_ADDRESS("glInvalidateFramebuffer"); - glInvalidateSubFramebuffer = (PFNGLINVALIDATESUBFRAMEBUFFERPROC)GLH_EXT_GET_PROC_ADDRESS("glInvalidateSubFramebuffer"); - glMultiDrawArraysIndirect = (PFNGLMULTIDRAWARRAYSINDIRECTPROC)GLH_EXT_GET_PROC_ADDRESS("glMultiDrawArraysIndirect"); - glMultiDrawElementsIndirect = (PFNGLMULTIDRAWELEMENTSINDIRECTPROC)GLH_EXT_GET_PROC_ADDRESS("glMultiDrawElementsIndirect"); - glGetProgramInterfaceiv = (PFNGLGETPROGRAMINTERFACEIVPROC)GLH_EXT_GET_PROC_ADDRESS("glGetProgramInterfaceiv"); - glGetProgramResourceIndex = (PFNGLGETPROGRAMRESOURCEINDEXPROC)GLH_EXT_GET_PROC_ADDRESS("glGetProgramResourceIndex"); - glGetProgramResourceName = (PFNGLGETPROGRAMRESOURCENAMEPROC)GLH_EXT_GET_PROC_ADDRESS("glGetProgramResourceName"); - glGetProgramResourceiv = (PFNGLGETPROGRAMRESOURCEIVPROC)GLH_EXT_GET_PROC_ADDRESS("glGetProgramResourceiv"); - glGetProgramResourceLocation = (PFNGLGETPROGRAMRESOURCELOCATIONPROC)GLH_EXT_GET_PROC_ADDRESS("glGetProgramResourceLocation"); - glGetProgramResourceLocationIndex = (PFNGLGETPROGRAMRESOURCELOCATIONINDEXPROC)GLH_EXT_GET_PROC_ADDRESS("glGetProgramResourceLocationIndex"); - glShaderStorageBlockBinding = (PFNGLSHADERSTORAGEBLOCKBINDINGPROC)GLH_EXT_GET_PROC_ADDRESS("glShaderStorageBlockBinding"); - glTexBufferRange = (PFNGLTEXBUFFERRANGEPROC)GLH_EXT_GET_PROC_ADDRESS("glTexBufferRange"); - glTexStorage2DMultisample = (PFNGLTEXSTORAGE2DMULTISAMPLEPROC)GLH_EXT_GET_PROC_ADDRESS("glTexStorage2DMultisample"); - glTexStorage3DMultisample = (PFNGLTEXSTORAGE3DMULTISAMPLEPROC)GLH_EXT_GET_PROC_ADDRESS("glTexStorage3DMultisample"); - glTextureView = (PFNGLTEXTUREVIEWPROC)GLH_EXT_GET_PROC_ADDRESS("glTextureView"); - glBindVertexBuffer = (PFNGLBINDVERTEXBUFFERPROC)GLH_EXT_GET_PROC_ADDRESS("glBindVertexBuffer"); - glVertexAttribFormat = (PFNGLVERTEXATTRIBFORMATPROC)GLH_EXT_GET_PROC_ADDRESS("glVertexAttribFormat"); - glVertexAttribIFormat = (PFNGLVERTEXATTRIBIFORMATPROC)GLH_EXT_GET_PROC_ADDRESS("glVertexAttribIFormat"); - glVertexAttribLFormat = (PFNGLVERTEXATTRIBLFORMATPROC)GLH_EXT_GET_PROC_ADDRESS("glVertexAttribLFormat"); - glVertexAttribBinding = (PFNGLVERTEXATTRIBBINDINGPROC)GLH_EXT_GET_PROC_ADDRESS("glVertexAttribBinding"); - glVertexBindingDivisor = (PFNGLVERTEXBINDINGDIVISORPROC)GLH_EXT_GET_PROC_ADDRESS("glVertexBindingDivisor"); - glDebugMessageControl = (PFNGLDEBUGMESSAGECONTROLPROC)GLH_EXT_GET_PROC_ADDRESS("glDebugMessageControl"); - glDebugMessageInsert = (PFNGLDEBUGMESSAGEINSERTPROC)GLH_EXT_GET_PROC_ADDRESS("glDebugMessageInsert"); - glDebugMessageCallback = (PFNGLDEBUGMESSAGECALLBACKPROC)GLH_EXT_GET_PROC_ADDRESS("glDebugMessageCallback"); - glGetDebugMessageLog = (PFNGLGETDEBUGMESSAGELOGPROC)GLH_EXT_GET_PROC_ADDRESS("glGetDebugMessageLog"); - glPushDebugGroup = (PFNGLPUSHDEBUGGROUPPROC)GLH_EXT_GET_PROC_ADDRESS("glPushDebugGroup"); - glPopDebugGroup = (PFNGLPOPDEBUGGROUPPROC)GLH_EXT_GET_PROC_ADDRESS("glPopDebugGroup"); - glObjectLabel = (PFNGLOBJECTLABELPROC)GLH_EXT_GET_PROC_ADDRESS("glObjectLabel"); - glGetObjectLabel = (PFNGLGETOBJECTLABELPROC)GLH_EXT_GET_PROC_ADDRESS("glGetObjectLabel"); - glObjectPtrLabel = (PFNGLOBJECTPTRLABELPROC)GLH_EXT_GET_PROC_ADDRESS("glObjectPtrLabel"); - glGetObjectPtrLabel = (PFNGLGETOBJECTPTRLABELPROC)GLH_EXT_GET_PROC_ADDRESS("glGetObjectPtrLabel"); + glClearBufferData = (PFNGLCLEARBUFFERDATAPROC)LL_GET_PROC_ADDRESS("glClearBufferData"); + glClearBufferSubData = (PFNGLCLEARBUFFERSUBDATAPROC)LL_GET_PROC_ADDRESS("glClearBufferSubData"); + glDispatchCompute = (PFNGLDISPATCHCOMPUTEPROC)LL_GET_PROC_ADDRESS("glDispatchCompute"); + glDispatchComputeIndirect = (PFNGLDISPATCHCOMPUTEINDIRECTPROC)LL_GET_PROC_ADDRESS("glDispatchComputeIndirect"); + glCopyImageSubData = (PFNGLCOPYIMAGESUBDATAPROC)LL_GET_PROC_ADDRESS("glCopyImageSubData"); + glFramebufferParameteri = (PFNGLFRAMEBUFFERPARAMETERIPROC)LL_GET_PROC_ADDRESS("glFramebufferParameteri"); + glGetFramebufferParameteriv = (PFNGLGETFRAMEBUFFERPARAMETERIVPROC)LL_GET_PROC_ADDRESS("glGetFramebufferParameteriv"); + glGetInternalformati64v = (PFNGLGETINTERNALFORMATI64VPROC)LL_GET_PROC_ADDRESS("glGetInternalformati64v"); + glInvalidateTexSubImage = (PFNGLINVALIDATETEXSUBIMAGEPROC)LL_GET_PROC_ADDRESS("glInvalidateTexSubImage"); + glInvalidateTexImage = (PFNGLINVALIDATETEXIMAGEPROC)LL_GET_PROC_ADDRESS("glInvalidateTexImage"); + glInvalidateBufferSubData = (PFNGLINVALIDATEBUFFERSUBDATAPROC)LL_GET_PROC_ADDRESS("glInvalidateBufferSubData"); + glInvalidateBufferData = (PFNGLINVALIDATEBUFFERDATAPROC)LL_GET_PROC_ADDRESS("glInvalidateBufferData"); + glInvalidateFramebuffer = (PFNGLINVALIDATEFRAMEBUFFERPROC)LL_GET_PROC_ADDRESS("glInvalidateFramebuffer"); + glInvalidateSubFramebuffer = (PFNGLINVALIDATESUBFRAMEBUFFERPROC)LL_GET_PROC_ADDRESS("glInvalidateSubFramebuffer"); + glMultiDrawArraysIndirect = (PFNGLMULTIDRAWARRAYSINDIRECTPROC)LL_GET_PROC_ADDRESS("glMultiDrawArraysIndirect"); + glMultiDrawElementsIndirect = (PFNGLMULTIDRAWELEMENTSINDIRECTPROC)LL_GET_PROC_ADDRESS("glMultiDrawElementsIndirect"); + glGetProgramInterfaceiv = (PFNGLGETPROGRAMINTERFACEIVPROC)LL_GET_PROC_ADDRESS("glGetProgramInterfaceiv"); + glGetProgramResourceIndex = (PFNGLGETPROGRAMRESOURCEINDEXPROC)LL_GET_PROC_ADDRESS("glGetProgramResourceIndex"); + glGetProgramResourceName = (PFNGLGETPROGRAMRESOURCENAMEPROC)LL_GET_PROC_ADDRESS("glGetProgramResourceName"); + glGetProgramResourceiv = (PFNGLGETPROGRAMRESOURCEIVPROC)LL_GET_PROC_ADDRESS("glGetProgramResourceiv"); + glGetProgramResourceLocation = (PFNGLGETPROGRAMRESOURCELOCATIONPROC)LL_GET_PROC_ADDRESS("glGetProgramResourceLocation"); + glGetProgramResourceLocationIndex = (PFNGLGETPROGRAMRESOURCELOCATIONINDEXPROC)LL_GET_PROC_ADDRESS("glGetProgramResourceLocationIndex"); + glShaderStorageBlockBinding = (PFNGLSHADERSTORAGEBLOCKBINDINGPROC)LL_GET_PROC_ADDRESS("glShaderStorageBlockBinding"); + glTexBufferRange = (PFNGLTEXBUFFERRANGEPROC)LL_GET_PROC_ADDRESS("glTexBufferRange"); + glTexStorage2DMultisample = (PFNGLTEXSTORAGE2DMULTISAMPLEPROC)LL_GET_PROC_ADDRESS("glTexStorage2DMultisample"); + glTexStorage3DMultisample = (PFNGLTEXSTORAGE3DMULTISAMPLEPROC)LL_GET_PROC_ADDRESS("glTexStorage3DMultisample"); + glTextureView = (PFNGLTEXTUREVIEWPROC)LL_GET_PROC_ADDRESS("glTextureView"); + glBindVertexBuffer = (PFNGLBINDVERTEXBUFFERPROC)LL_GET_PROC_ADDRESS("glBindVertexBuffer"); + glVertexAttribFormat = (PFNGLVERTEXATTRIBFORMATPROC)LL_GET_PROC_ADDRESS("glVertexAttribFormat"); + glVertexAttribIFormat = (PFNGLVERTEXATTRIBIFORMATPROC)LL_GET_PROC_ADDRESS("glVertexAttribIFormat"); + glVertexAttribLFormat = (PFNGLVERTEXATTRIBLFORMATPROC)LL_GET_PROC_ADDRESS("glVertexAttribLFormat"); + glVertexAttribBinding = (PFNGLVERTEXATTRIBBINDINGPROC)LL_GET_PROC_ADDRESS("glVertexAttribBinding"); + glVertexBindingDivisor = (PFNGLVERTEXBINDINGDIVISORPROC)LL_GET_PROC_ADDRESS("glVertexBindingDivisor"); + glDebugMessageControl = (PFNGLDEBUGMESSAGECONTROLPROC)LL_GET_PROC_ADDRESS("glDebugMessageControl"); + glDebugMessageInsert = (PFNGLDEBUGMESSAGEINSERTPROC)LL_GET_PROC_ADDRESS("glDebugMessageInsert"); + glDebugMessageCallback = (PFNGLDEBUGMESSAGECALLBACKPROC)LL_GET_PROC_ADDRESS("glDebugMessageCallback"); + glGetDebugMessageLog = (PFNGLGETDEBUGMESSAGELOGPROC)LL_GET_PROC_ADDRESS("glGetDebugMessageLog"); + glPushDebugGroup = (PFNGLPUSHDEBUGGROUPPROC)LL_GET_PROC_ADDRESS("glPushDebugGroup"); + glPopDebugGroup = (PFNGLPOPDEBUGGROUPPROC)LL_GET_PROC_ADDRESS("glPopDebugGroup"); + glObjectLabel = (PFNGLOBJECTLABELPROC)LL_GET_PROC_ADDRESS("glObjectLabel"); + glGetObjectLabel = (PFNGLGETOBJECTLABELPROC)LL_GET_PROC_ADDRESS("glGetObjectLabel"); + glObjectPtrLabel = (PFNGLOBJECTPTRLABELPROC)LL_GET_PROC_ADDRESS("glObjectPtrLabel"); + glGetObjectPtrLabel = (PFNGLGETOBJECTPTRLABELPROC)LL_GET_PROC_ADDRESS("glGetObjectPtrLabel"); // GL_VERSION_4_4 if (mGLVersion < 4.39f) { return; } - glBufferStorage = (PFNGLBUFFERSTORAGEPROC)GLH_EXT_GET_PROC_ADDRESS("glBufferStorage"); - glClearTexImage = (PFNGLCLEARTEXIMAGEPROC)GLH_EXT_GET_PROC_ADDRESS("glClearTexImage"); - glClearTexSubImage = (PFNGLCLEARTEXSUBIMAGEPROC)GLH_EXT_GET_PROC_ADDRESS("glClearTexSubImage"); - glBindBuffersBase = (PFNGLBINDBUFFERSBASEPROC)GLH_EXT_GET_PROC_ADDRESS("glBindBuffersBase"); - glBindBuffersRange = (PFNGLBINDBUFFERSRANGEPROC)GLH_EXT_GET_PROC_ADDRESS("glBindBuffersRange"); - glBindTextures = (PFNGLBINDTEXTURESPROC)GLH_EXT_GET_PROC_ADDRESS("glBindTextures"); - glBindSamplers = (PFNGLBINDSAMPLERSPROC)GLH_EXT_GET_PROC_ADDRESS("glBindSamplers"); - glBindImageTextures = (PFNGLBINDIMAGETEXTURESPROC)GLH_EXT_GET_PROC_ADDRESS("glBindImageTextures"); - glBindVertexBuffers = (PFNGLBINDVERTEXBUFFERSPROC)GLH_EXT_GET_PROC_ADDRESS("glBindVertexBuffers"); + glBufferStorage = (PFNGLBUFFERSTORAGEPROC)LL_GET_PROC_ADDRESS("glBufferStorage"); + glClearTexImage = (PFNGLCLEARTEXIMAGEPROC)LL_GET_PROC_ADDRESS("glClearTexImage"); + glClearTexSubImage = (PFNGLCLEARTEXSUBIMAGEPROC)LL_GET_PROC_ADDRESS("glClearTexSubImage"); + glBindBuffersBase = (PFNGLBINDBUFFERSBASEPROC)LL_GET_PROC_ADDRESS("glBindBuffersBase"); + glBindBuffersRange = (PFNGLBINDBUFFERSRANGEPROC)LL_GET_PROC_ADDRESS("glBindBuffersRange"); + glBindTextures = (PFNGLBINDTEXTURESPROC)LL_GET_PROC_ADDRESS("glBindTextures"); + glBindSamplers = (PFNGLBINDSAMPLERSPROC)LL_GET_PROC_ADDRESS("glBindSamplers"); + glBindImageTextures = (PFNGLBINDIMAGETEXTURESPROC)LL_GET_PROC_ADDRESS("glBindImageTextures"); + glBindVertexBuffers = (PFNGLBINDVERTEXBUFFERSPROC)LL_GET_PROC_ADDRESS("glBindVertexBuffers"); // GL_VERSION_4_5 if (mGLVersion < 4.49f) { return; } - glClipControl = (PFNGLCLIPCONTROLPROC)GLH_EXT_GET_PROC_ADDRESS("glClipControl"); - glCreateTransformFeedbacks = (PFNGLCREATETRANSFORMFEEDBACKSPROC)GLH_EXT_GET_PROC_ADDRESS("glCreateTransformFeedbacks"); - glTransformFeedbackBufferBase = (PFNGLTRANSFORMFEEDBACKBUFFERBASEPROC)GLH_EXT_GET_PROC_ADDRESS("glTransformFeedbackBufferBase"); - glTransformFeedbackBufferRange = (PFNGLTRANSFORMFEEDBACKBUFFERRANGEPROC)GLH_EXT_GET_PROC_ADDRESS("glTransformFeedbackBufferRange"); - glGetTransformFeedbackiv = (PFNGLGETTRANSFORMFEEDBACKIVPROC)GLH_EXT_GET_PROC_ADDRESS("glGetTransformFeedbackiv"); - glGetTransformFeedbacki_v = (PFNGLGETTRANSFORMFEEDBACKI_VPROC)GLH_EXT_GET_PROC_ADDRESS("glGetTransformFeedbacki_v"); - glGetTransformFeedbacki64_v = (PFNGLGETTRANSFORMFEEDBACKI64_VPROC)GLH_EXT_GET_PROC_ADDRESS("glGetTransformFeedbacki64_v"); - glCreateBuffers = (PFNGLCREATEBUFFERSPROC)GLH_EXT_GET_PROC_ADDRESS("glCreateBuffers"); - glNamedBufferStorage = (PFNGLNAMEDBUFFERSTORAGEPROC)GLH_EXT_GET_PROC_ADDRESS("glNamedBufferStorage"); - glNamedBufferData = (PFNGLNAMEDBUFFERDATAPROC)GLH_EXT_GET_PROC_ADDRESS("glNamedBufferData"); - glNamedBufferSubData = (PFNGLNAMEDBUFFERSUBDATAPROC)GLH_EXT_GET_PROC_ADDRESS("glNamedBufferSubData"); - glCopyNamedBufferSubData = (PFNGLCOPYNAMEDBUFFERSUBDATAPROC)GLH_EXT_GET_PROC_ADDRESS("glCopyNamedBufferSubData"); - glClearNamedBufferData = (PFNGLCLEARNAMEDBUFFERDATAPROC)GLH_EXT_GET_PROC_ADDRESS("glClearNamedBufferData"); - glClearNamedBufferSubData = (PFNGLCLEARNAMEDBUFFERSUBDATAPROC)GLH_EXT_GET_PROC_ADDRESS("glClearNamedBufferSubData"); - glMapNamedBuffer = (PFNGLMAPNAMEDBUFFERPROC)GLH_EXT_GET_PROC_ADDRESS("glMapNamedBuffer"); - glMapNamedBufferRange = (PFNGLMAPNAMEDBUFFERRANGEPROC)GLH_EXT_GET_PROC_ADDRESS("glMapNamedBufferRange"); - glUnmapNamedBuffer = (PFNGLUNMAPNAMEDBUFFERPROC)GLH_EXT_GET_PROC_ADDRESS("glUnmapNamedBuffer"); - glFlushMappedNamedBufferRange = (PFNGLFLUSHMAPPEDNAMEDBUFFERRANGEPROC)GLH_EXT_GET_PROC_ADDRESS("glFlushMappedNamedBufferRange"); - glGetNamedBufferParameteriv = (PFNGLGETNAMEDBUFFERPARAMETERIVPROC)GLH_EXT_GET_PROC_ADDRESS("glGetNamedBufferParameteriv"); - glGetNamedBufferParameteri64v = (PFNGLGETNAMEDBUFFERPARAMETERI64VPROC)GLH_EXT_GET_PROC_ADDRESS("glGetNamedBufferParameteri64v"); - glGetNamedBufferPointerv = (PFNGLGETNAMEDBUFFERPOINTERVPROC)GLH_EXT_GET_PROC_ADDRESS("glGetNamedBufferPointerv"); - glGetNamedBufferSubData = (PFNGLGETNAMEDBUFFERSUBDATAPROC)GLH_EXT_GET_PROC_ADDRESS("glGetNamedBufferSubData"); - glCreateFramebuffers = (PFNGLCREATEFRAMEBUFFERSPROC)GLH_EXT_GET_PROC_ADDRESS("glCreateFramebuffers"); - glNamedFramebufferRenderbuffer = (PFNGLNAMEDFRAMEBUFFERRENDERBUFFERPROC)GLH_EXT_GET_PROC_ADDRESS("glNamedFramebufferRenderbuffer"); - glNamedFramebufferParameteri = (PFNGLNAMEDFRAMEBUFFERPARAMETERIPROC)GLH_EXT_GET_PROC_ADDRESS("glNamedFramebufferParameteri"); - glNamedFramebufferTexture = (PFNGLNAMEDFRAMEBUFFERTEXTUREPROC)GLH_EXT_GET_PROC_ADDRESS("glNamedFramebufferTexture"); - glNamedFramebufferTextureLayer = (PFNGLNAMEDFRAMEBUFFERTEXTURELAYERPROC)GLH_EXT_GET_PROC_ADDRESS("glNamedFramebufferTextureLayer"); - glNamedFramebufferDrawBuffer = (PFNGLNAMEDFRAMEBUFFERDRAWBUFFERPROC)GLH_EXT_GET_PROC_ADDRESS("glNamedFramebufferDrawBuffer"); - glNamedFramebufferDrawBuffers = (PFNGLNAMEDFRAMEBUFFERDRAWBUFFERSPROC)GLH_EXT_GET_PROC_ADDRESS("glNamedFramebufferDrawBuffers"); - glNamedFramebufferReadBuffer = (PFNGLNAMEDFRAMEBUFFERREADBUFFERPROC)GLH_EXT_GET_PROC_ADDRESS("glNamedFramebufferReadBuffer"); - glInvalidateNamedFramebufferData = (PFNGLINVALIDATENAMEDFRAMEBUFFERDATAPROC)GLH_EXT_GET_PROC_ADDRESS("glInvalidateNamedFramebufferData"); - glInvalidateNamedFramebufferSubData = (PFNGLINVALIDATENAMEDFRAMEBUFFERSUBDATAPROC)GLH_EXT_GET_PROC_ADDRESS("glInvalidateNamedFramebufferSubData"); - glClearNamedFramebufferiv = (PFNGLCLEARNAMEDFRAMEBUFFERIVPROC)GLH_EXT_GET_PROC_ADDRESS("glClearNamedFramebufferiv"); - glClearNamedFramebufferuiv = (PFNGLCLEARNAMEDFRAMEBUFFERUIVPROC)GLH_EXT_GET_PROC_ADDRESS("glClearNamedFramebufferuiv"); - glClearNamedFramebufferfv = (PFNGLCLEARNAMEDFRAMEBUFFERFVPROC)GLH_EXT_GET_PROC_ADDRESS("glClearNamedFramebufferfv"); - glClearNamedFramebufferfi = (PFNGLCLEARNAMEDFRAMEBUFFERFIPROC)GLH_EXT_GET_PROC_ADDRESS("glClearNamedFramebufferfi"); - glBlitNamedFramebuffer = (PFNGLBLITNAMEDFRAMEBUFFERPROC)GLH_EXT_GET_PROC_ADDRESS("glBlitNamedFramebuffer"); - glCheckNamedFramebufferStatus = (PFNGLCHECKNAMEDFRAMEBUFFERSTATUSPROC)GLH_EXT_GET_PROC_ADDRESS("glCheckNamedFramebufferStatus"); - glGetNamedFramebufferParameteriv = (PFNGLGETNAMEDFRAMEBUFFERPARAMETERIVPROC)GLH_EXT_GET_PROC_ADDRESS("glGetNamedFramebufferParameteriv"); - glGetNamedFramebufferAttachmentParameteriv = (PFNGLGETNAMEDFRAMEBUFFERATTACHMENTPARAMETERIVPROC)GLH_EXT_GET_PROC_ADDRESS("glGetNamedFramebufferAttachmentParameteriv"); - glCreateRenderbuffers = (PFNGLCREATERENDERBUFFERSPROC)GLH_EXT_GET_PROC_ADDRESS("glCreateRenderbuffers"); - glNamedRenderbufferStorage = (PFNGLNAMEDRENDERBUFFERSTORAGEPROC)GLH_EXT_GET_PROC_ADDRESS("glNamedRenderbufferStorage"); - glNamedRenderbufferStorageMultisample = (PFNGLNAMEDRENDERBUFFERSTORAGEMULTISAMPLEPROC)GLH_EXT_GET_PROC_ADDRESS("glNamedRenderbufferStorageMultisample"); - glGetNamedRenderbufferParameteriv = (PFNGLGETNAMEDRENDERBUFFERPARAMETERIVPROC)GLH_EXT_GET_PROC_ADDRESS("glGetNamedRenderbufferParameteriv"); - glCreateTextures = (PFNGLCREATETEXTURESPROC)GLH_EXT_GET_PROC_ADDRESS("glCreateTextures"); - glTextureBuffer = (PFNGLTEXTUREBUFFERPROC)GLH_EXT_GET_PROC_ADDRESS("glTextureBuffer"); - glTextureBufferRange = (PFNGLTEXTUREBUFFERRANGEPROC)GLH_EXT_GET_PROC_ADDRESS("glTextureBufferRange"); - glTextureStorage1D = (PFNGLTEXTURESTORAGE1DPROC)GLH_EXT_GET_PROC_ADDRESS("glTextureStorage1D"); - glTextureStorage2D = (PFNGLTEXTURESTORAGE2DPROC)GLH_EXT_GET_PROC_ADDRESS("glTextureStorage2D"); - glTextureStorage3D = (PFNGLTEXTURESTORAGE3DPROC)GLH_EXT_GET_PROC_ADDRESS("glTextureStorage3D"); - glTextureStorage2DMultisample = (PFNGLTEXTURESTORAGE2DMULTISAMPLEPROC)GLH_EXT_GET_PROC_ADDRESS("glTextureStorage2DMultisample"); - glTextureStorage3DMultisample = (PFNGLTEXTURESTORAGE3DMULTISAMPLEPROC)GLH_EXT_GET_PROC_ADDRESS("glTextureStorage3DMultisample"); - glTextureSubImage1D = (PFNGLTEXTURESUBIMAGE1DPROC)GLH_EXT_GET_PROC_ADDRESS("glTextureSubImage1D"); - glTextureSubImage2D = (PFNGLTEXTURESUBIMAGE2DPROC)GLH_EXT_GET_PROC_ADDRESS("glTextureSubImage2D"); - glTextureSubImage3D = (PFNGLTEXTURESUBIMAGE3DPROC)GLH_EXT_GET_PROC_ADDRESS("glTextureSubImage3D"); - glCompressedTextureSubImage1D = (PFNGLCOMPRESSEDTEXTURESUBIMAGE1DPROC)GLH_EXT_GET_PROC_ADDRESS("glCompressedTextureSubImage1D"); - glCompressedTextureSubImage2D = (PFNGLCOMPRESSEDTEXTURESUBIMAGE2DPROC)GLH_EXT_GET_PROC_ADDRESS("glCompressedTextureSubImage2D"); - glCompressedTextureSubImage3D = (PFNGLCOMPRESSEDTEXTURESUBIMAGE3DPROC)GLH_EXT_GET_PROC_ADDRESS("glCompressedTextureSubImage3D"); - glCopyTextureSubImage1D = (PFNGLCOPYTEXTURESUBIMAGE1DPROC)GLH_EXT_GET_PROC_ADDRESS("glCopyTextureSubImage1D"); - glCopyTextureSubImage2D = (PFNGLCOPYTEXTURESUBIMAGE2DPROC)GLH_EXT_GET_PROC_ADDRESS("glCopyTextureSubImage2D"); - glCopyTextureSubImage3D = (PFNGLCOPYTEXTURESUBIMAGE3DPROC)GLH_EXT_GET_PROC_ADDRESS("glCopyTextureSubImage3D"); - glTextureParameterf = (PFNGLTEXTUREPARAMETERFPROC)GLH_EXT_GET_PROC_ADDRESS("glTextureParameterf"); - glTextureParameterfv = (PFNGLTEXTUREPARAMETERFVPROC)GLH_EXT_GET_PROC_ADDRESS("glTextureParameterfv"); - glTextureParameteri = (PFNGLTEXTUREPARAMETERIPROC)GLH_EXT_GET_PROC_ADDRESS("glTextureParameteri"); - glTextureParameterIiv = (PFNGLTEXTUREPARAMETERIIVPROC)GLH_EXT_GET_PROC_ADDRESS("glTextureParameterIiv"); - glTextureParameterIuiv = (PFNGLTEXTUREPARAMETERIUIVPROC)GLH_EXT_GET_PROC_ADDRESS("glTextureParameterIuiv"); - glTextureParameteriv = (PFNGLTEXTUREPARAMETERIVPROC)GLH_EXT_GET_PROC_ADDRESS("glTextureParameteriv"); - glGenerateTextureMipmap = (PFNGLGENERATETEXTUREMIPMAPPROC)GLH_EXT_GET_PROC_ADDRESS("glGenerateTextureMipmap"); - glBindTextureUnit = (PFNGLBINDTEXTUREUNITPROC)GLH_EXT_GET_PROC_ADDRESS("glBindTextureUnit"); - glGetTextureImage = (PFNGLGETTEXTUREIMAGEPROC)GLH_EXT_GET_PROC_ADDRESS("glGetTextureImage"); - glGetCompressedTextureImage = (PFNGLGETCOMPRESSEDTEXTUREIMAGEPROC)GLH_EXT_GET_PROC_ADDRESS("glGetCompressedTextureImage"); - glGetTextureLevelParameterfv = (PFNGLGETTEXTURELEVELPARAMETERFVPROC)GLH_EXT_GET_PROC_ADDRESS("glGetTextureLevelParameterfv"); - glGetTextureLevelParameteriv = (PFNGLGETTEXTURELEVELPARAMETERIVPROC)GLH_EXT_GET_PROC_ADDRESS("glGetTextureLevelParameteriv"); - glGetTextureParameterfv = (PFNGLGETTEXTUREPARAMETERFVPROC)GLH_EXT_GET_PROC_ADDRESS("glGetTextureParameterfv"); - glGetTextureParameterIiv = (PFNGLGETTEXTUREPARAMETERIIVPROC)GLH_EXT_GET_PROC_ADDRESS("glGetTextureParameterIiv"); - glGetTextureParameterIuiv = (PFNGLGETTEXTUREPARAMETERIUIVPROC)GLH_EXT_GET_PROC_ADDRESS("glGetTextureParameterIuiv"); - glGetTextureParameteriv = (PFNGLGETTEXTUREPARAMETERIVPROC)GLH_EXT_GET_PROC_ADDRESS("glGetTextureParameteriv"); - glCreateVertexArrays = (PFNGLCREATEVERTEXARRAYSPROC)GLH_EXT_GET_PROC_ADDRESS("glCreateVertexArrays"); - glDisableVertexArrayAttrib = (PFNGLDISABLEVERTEXARRAYATTRIBPROC)GLH_EXT_GET_PROC_ADDRESS("glDisableVertexArrayAttrib"); - glEnableVertexArrayAttrib = (PFNGLENABLEVERTEXARRAYATTRIBPROC)GLH_EXT_GET_PROC_ADDRESS("glEnableVertexArrayAttrib"); - glVertexArrayElementBuffer = (PFNGLVERTEXARRAYELEMENTBUFFERPROC)GLH_EXT_GET_PROC_ADDRESS("glVertexArrayElementBuffer"); - glVertexArrayVertexBuffer = (PFNGLVERTEXARRAYVERTEXBUFFERPROC)GLH_EXT_GET_PROC_ADDRESS("glVertexArrayVertexBuffer"); - glVertexArrayVertexBuffers = (PFNGLVERTEXARRAYVERTEXBUFFERSPROC)GLH_EXT_GET_PROC_ADDRESS("glVertexArrayVertexBuffers"); - glVertexArrayAttribBinding = (PFNGLVERTEXARRAYATTRIBBINDINGPROC)GLH_EXT_GET_PROC_ADDRESS("glVertexArrayAttribBinding"); - glVertexArrayAttribFormat = (PFNGLVERTEXARRAYATTRIBFORMATPROC)GLH_EXT_GET_PROC_ADDRESS("glVertexArrayAttribFormat"); - glVertexArrayAttribIFormat = (PFNGLVERTEXARRAYATTRIBIFORMATPROC)GLH_EXT_GET_PROC_ADDRESS("glVertexArrayAttribIFormat"); - glVertexArrayAttribLFormat = (PFNGLVERTEXARRAYATTRIBLFORMATPROC)GLH_EXT_GET_PROC_ADDRESS("glVertexArrayAttribLFormat"); - glVertexArrayBindingDivisor = (PFNGLVERTEXARRAYBINDINGDIVISORPROC)GLH_EXT_GET_PROC_ADDRESS("glVertexArrayBindingDivisor"); - glGetVertexArrayiv = (PFNGLGETVERTEXARRAYIVPROC)GLH_EXT_GET_PROC_ADDRESS("glGetVertexArrayiv"); - glGetVertexArrayIndexediv = (PFNGLGETVERTEXARRAYINDEXEDIVPROC)GLH_EXT_GET_PROC_ADDRESS("glGetVertexArrayIndexediv"); - glGetVertexArrayIndexed64iv = (PFNGLGETVERTEXARRAYINDEXED64IVPROC)GLH_EXT_GET_PROC_ADDRESS("glGetVertexArrayIndexed64iv"); - glCreateSamplers = (PFNGLCREATESAMPLERSPROC)GLH_EXT_GET_PROC_ADDRESS("glCreateSamplers"); - glCreateProgramPipelines = (PFNGLCREATEPROGRAMPIPELINESPROC)GLH_EXT_GET_PROC_ADDRESS("glCreateProgramPipelines"); - glCreateQueries = (PFNGLCREATEQUERIESPROC)GLH_EXT_GET_PROC_ADDRESS("glCreateQueries"); - glGetQueryBufferObjecti64v = (PFNGLGETQUERYBUFFEROBJECTI64VPROC)GLH_EXT_GET_PROC_ADDRESS("glGetQueryBufferObjecti64v"); - glGetQueryBufferObjectiv = (PFNGLGETQUERYBUFFEROBJECTIVPROC)GLH_EXT_GET_PROC_ADDRESS("glGetQueryBufferObjectiv"); - glGetQueryBufferObjectui64v = (PFNGLGETQUERYBUFFEROBJECTUI64VPROC)GLH_EXT_GET_PROC_ADDRESS("glGetQueryBufferObjectui64v"); - glGetQueryBufferObjectuiv = (PFNGLGETQUERYBUFFEROBJECTUIVPROC)GLH_EXT_GET_PROC_ADDRESS("glGetQueryBufferObjectuiv"); - glMemoryBarrierByRegion = (PFNGLMEMORYBARRIERBYREGIONPROC)GLH_EXT_GET_PROC_ADDRESS("glMemoryBarrierByRegion"); - glGetTextureSubImage = (PFNGLGETTEXTURESUBIMAGEPROC)GLH_EXT_GET_PROC_ADDRESS("glGetTextureSubImage"); - glGetCompressedTextureSubImage = (PFNGLGETCOMPRESSEDTEXTURESUBIMAGEPROC)GLH_EXT_GET_PROC_ADDRESS("glGetCompressedTextureSubImage"); - glGetGraphicsResetStatus = (PFNGLGETGRAPHICSRESETSTATUSPROC)GLH_EXT_GET_PROC_ADDRESS("glGetGraphicsResetStatus"); - glGetnCompressedTexImage = (PFNGLGETNCOMPRESSEDTEXIMAGEPROC)GLH_EXT_GET_PROC_ADDRESS("glGetnCompressedTexImage"); - glGetnTexImage = (PFNGLGETNTEXIMAGEPROC)GLH_EXT_GET_PROC_ADDRESS("glGetnTexImage"); - glGetnUniformdv = (PFNGLGETNUNIFORMDVPROC)GLH_EXT_GET_PROC_ADDRESS("glGetnUniformdv"); - glGetnUniformfv = (PFNGLGETNUNIFORMFVPROC)GLH_EXT_GET_PROC_ADDRESS("glGetnUniformfv"); - glGetnUniformiv = (PFNGLGETNUNIFORMIVPROC)GLH_EXT_GET_PROC_ADDRESS("glGetnUniformiv"); - glGetnUniformuiv = (PFNGLGETNUNIFORMUIVPROC)GLH_EXT_GET_PROC_ADDRESS("glGetnUniformuiv"); - glReadnPixels = (PFNGLREADNPIXELSPROC)GLH_EXT_GET_PROC_ADDRESS("glReadnPixels"); - glGetnMapdv = (PFNGLGETNMAPDVPROC)GLH_EXT_GET_PROC_ADDRESS("glGetnMapdv"); - glGetnMapfv = (PFNGLGETNMAPFVPROC)GLH_EXT_GET_PROC_ADDRESS("glGetnMapfv"); - glGetnMapiv = (PFNGLGETNMAPIVPROC)GLH_EXT_GET_PROC_ADDRESS("glGetnMapiv"); - glGetnPixelMapfv = (PFNGLGETNPIXELMAPFVPROC)GLH_EXT_GET_PROC_ADDRESS("glGetnPixelMapfv"); - glGetnPixelMapuiv = (PFNGLGETNPIXELMAPUIVPROC)GLH_EXT_GET_PROC_ADDRESS("glGetnPixelMapuiv"); - glGetnPixelMapusv = (PFNGLGETNPIXELMAPUSVPROC)GLH_EXT_GET_PROC_ADDRESS("glGetnPixelMapusv"); - glGetnPolygonStipple = (PFNGLGETNPOLYGONSTIPPLEPROC)GLH_EXT_GET_PROC_ADDRESS("glGetnPolygonStipple"); - glGetnColorTable = (PFNGLGETNCOLORTABLEPROC)GLH_EXT_GET_PROC_ADDRESS("glGetnColorTable"); - glGetnConvolutionFilter = (PFNGLGETNCONVOLUTIONFILTERPROC)GLH_EXT_GET_PROC_ADDRESS("glGetnConvolutionFilter"); - glGetnSeparableFilter = (PFNGLGETNSEPARABLEFILTERPROC)GLH_EXT_GET_PROC_ADDRESS("glGetnSeparableFilter"); - glGetnHistogram = (PFNGLGETNHISTOGRAMPROC)GLH_EXT_GET_PROC_ADDRESS("glGetnHistogram"); - glGetnMinmax = (PFNGLGETNMINMAXPROC)GLH_EXT_GET_PROC_ADDRESS("glGetnMinmax"); - glTextureBarrier = (PFNGLTEXTUREBARRIERPROC)GLH_EXT_GET_PROC_ADDRESS("glTextureBarrier"); + glClipControl = (PFNGLCLIPCONTROLPROC)LL_GET_PROC_ADDRESS("glClipControl"); + glCreateTransformFeedbacks = (PFNGLCREATETRANSFORMFEEDBACKSPROC)LL_GET_PROC_ADDRESS("glCreateTransformFeedbacks"); + glTransformFeedbackBufferBase = (PFNGLTRANSFORMFEEDBACKBUFFERBASEPROC)LL_GET_PROC_ADDRESS("glTransformFeedbackBufferBase"); + glTransformFeedbackBufferRange = (PFNGLTRANSFORMFEEDBACKBUFFERRANGEPROC)LL_GET_PROC_ADDRESS("glTransformFeedbackBufferRange"); + glGetTransformFeedbackiv = (PFNGLGETTRANSFORMFEEDBACKIVPROC)LL_GET_PROC_ADDRESS("glGetTransformFeedbackiv"); + glGetTransformFeedbacki_v = (PFNGLGETTRANSFORMFEEDBACKI_VPROC)LL_GET_PROC_ADDRESS("glGetTransformFeedbacki_v"); + glGetTransformFeedbacki64_v = (PFNGLGETTRANSFORMFEEDBACKI64_VPROC)LL_GET_PROC_ADDRESS("glGetTransformFeedbacki64_v"); + glCreateBuffers = (PFNGLCREATEBUFFERSPROC)LL_GET_PROC_ADDRESS("glCreateBuffers"); + glNamedBufferStorage = (PFNGLNAMEDBUFFERSTORAGEPROC)LL_GET_PROC_ADDRESS("glNamedBufferStorage"); + glNamedBufferData = (PFNGLNAMEDBUFFERDATAPROC)LL_GET_PROC_ADDRESS("glNamedBufferData"); + glNamedBufferSubData = (PFNGLNAMEDBUFFERSUBDATAPROC)LL_GET_PROC_ADDRESS("glNamedBufferSubData"); + glCopyNamedBufferSubData = (PFNGLCOPYNAMEDBUFFERSUBDATAPROC)LL_GET_PROC_ADDRESS("glCopyNamedBufferSubData"); + glClearNamedBufferData = (PFNGLCLEARNAMEDBUFFERDATAPROC)LL_GET_PROC_ADDRESS("glClearNamedBufferData"); + glClearNamedBufferSubData = (PFNGLCLEARNAMEDBUFFERSUBDATAPROC)LL_GET_PROC_ADDRESS("glClearNamedBufferSubData"); + glMapNamedBuffer = (PFNGLMAPNAMEDBUFFERPROC)LL_GET_PROC_ADDRESS("glMapNamedBuffer"); + glMapNamedBufferRange = (PFNGLMAPNAMEDBUFFERRANGEPROC)LL_GET_PROC_ADDRESS("glMapNamedBufferRange"); + glUnmapNamedBuffer = (PFNGLUNMAPNAMEDBUFFERPROC)LL_GET_PROC_ADDRESS("glUnmapNamedBuffer"); + glFlushMappedNamedBufferRange = (PFNGLFLUSHMAPPEDNAMEDBUFFERRANGEPROC)LL_GET_PROC_ADDRESS("glFlushMappedNamedBufferRange"); + glGetNamedBufferParameteriv = (PFNGLGETNAMEDBUFFERPARAMETERIVPROC)LL_GET_PROC_ADDRESS("glGetNamedBufferParameteriv"); + glGetNamedBufferParameteri64v = (PFNGLGETNAMEDBUFFERPARAMETERI64VPROC)LL_GET_PROC_ADDRESS("glGetNamedBufferParameteri64v"); + glGetNamedBufferPointerv = (PFNGLGETNAMEDBUFFERPOINTERVPROC)LL_GET_PROC_ADDRESS("glGetNamedBufferPointerv"); + glGetNamedBufferSubData = (PFNGLGETNAMEDBUFFERSUBDATAPROC)LL_GET_PROC_ADDRESS("glGetNamedBufferSubData"); + glCreateFramebuffers = (PFNGLCREATEFRAMEBUFFERSPROC)LL_GET_PROC_ADDRESS("glCreateFramebuffers"); + glNamedFramebufferRenderbuffer = (PFNGLNAMEDFRAMEBUFFERRENDERBUFFERPROC)LL_GET_PROC_ADDRESS("glNamedFramebufferRenderbuffer"); + glNamedFramebufferParameteri = (PFNGLNAMEDFRAMEBUFFERPARAMETERIPROC)LL_GET_PROC_ADDRESS("glNamedFramebufferParameteri"); + glNamedFramebufferTexture = (PFNGLNAMEDFRAMEBUFFERTEXTUREPROC)LL_GET_PROC_ADDRESS("glNamedFramebufferTexture"); + glNamedFramebufferTextureLayer = (PFNGLNAMEDFRAMEBUFFERTEXTURELAYERPROC)LL_GET_PROC_ADDRESS("glNamedFramebufferTextureLayer"); + glNamedFramebufferDrawBuffer = (PFNGLNAMEDFRAMEBUFFERDRAWBUFFERPROC)LL_GET_PROC_ADDRESS("glNamedFramebufferDrawBuffer"); + glNamedFramebufferDrawBuffers = (PFNGLNAMEDFRAMEBUFFERDRAWBUFFERSPROC)LL_GET_PROC_ADDRESS("glNamedFramebufferDrawBuffers"); + glNamedFramebufferReadBuffer = (PFNGLNAMEDFRAMEBUFFERREADBUFFERPROC)LL_GET_PROC_ADDRESS("glNamedFramebufferReadBuffer"); + glInvalidateNamedFramebufferData = (PFNGLINVALIDATENAMEDFRAMEBUFFERDATAPROC)LL_GET_PROC_ADDRESS("glInvalidateNamedFramebufferData"); + glInvalidateNamedFramebufferSubData = (PFNGLINVALIDATENAMEDFRAMEBUFFERSUBDATAPROC)LL_GET_PROC_ADDRESS("glInvalidateNamedFramebufferSubData"); + glClearNamedFramebufferiv = (PFNGLCLEARNAMEDFRAMEBUFFERIVPROC)LL_GET_PROC_ADDRESS("glClearNamedFramebufferiv"); + glClearNamedFramebufferuiv = (PFNGLCLEARNAMEDFRAMEBUFFERUIVPROC)LL_GET_PROC_ADDRESS("glClearNamedFramebufferuiv"); + glClearNamedFramebufferfv = (PFNGLCLEARNAMEDFRAMEBUFFERFVPROC)LL_GET_PROC_ADDRESS("glClearNamedFramebufferfv"); + glClearNamedFramebufferfi = (PFNGLCLEARNAMEDFRAMEBUFFERFIPROC)LL_GET_PROC_ADDRESS("glClearNamedFramebufferfi"); + glBlitNamedFramebuffer = (PFNGLBLITNAMEDFRAMEBUFFERPROC)LL_GET_PROC_ADDRESS("glBlitNamedFramebuffer"); + glCheckNamedFramebufferStatus = (PFNGLCHECKNAMEDFRAMEBUFFERSTATUSPROC)LL_GET_PROC_ADDRESS("glCheckNamedFramebufferStatus"); + glGetNamedFramebufferParameteriv = (PFNGLGETNAMEDFRAMEBUFFERPARAMETERIVPROC)LL_GET_PROC_ADDRESS("glGetNamedFramebufferParameteriv"); + glGetNamedFramebufferAttachmentParameteriv = (PFNGLGETNAMEDFRAMEBUFFERATTACHMENTPARAMETERIVPROC)LL_GET_PROC_ADDRESS("glGetNamedFramebufferAttachmentParameteriv"); + glCreateRenderbuffers = (PFNGLCREATERENDERBUFFERSPROC)LL_GET_PROC_ADDRESS("glCreateRenderbuffers"); + glNamedRenderbufferStorage = (PFNGLNAMEDRENDERBUFFERSTORAGEPROC)LL_GET_PROC_ADDRESS("glNamedRenderbufferStorage"); + glNamedRenderbufferStorageMultisample = (PFNGLNAMEDRENDERBUFFERSTORAGEMULTISAMPLEPROC)LL_GET_PROC_ADDRESS("glNamedRenderbufferStorageMultisample"); + glGetNamedRenderbufferParameteriv = (PFNGLGETNAMEDRENDERBUFFERPARAMETERIVPROC)LL_GET_PROC_ADDRESS("glGetNamedRenderbufferParameteriv"); + glCreateTextures = (PFNGLCREATETEXTURESPROC)LL_GET_PROC_ADDRESS("glCreateTextures"); + glTextureBuffer = (PFNGLTEXTUREBUFFERPROC)LL_GET_PROC_ADDRESS("glTextureBuffer"); + glTextureBufferRange = (PFNGLTEXTUREBUFFERRANGEPROC)LL_GET_PROC_ADDRESS("glTextureBufferRange"); + glTextureStorage1D = (PFNGLTEXTURESTORAGE1DPROC)LL_GET_PROC_ADDRESS("glTextureStorage1D"); + glTextureStorage2D = (PFNGLTEXTURESTORAGE2DPROC)LL_GET_PROC_ADDRESS("glTextureStorage2D"); + glTextureStorage3D = (PFNGLTEXTURESTORAGE3DPROC)LL_GET_PROC_ADDRESS("glTextureStorage3D"); + glTextureStorage2DMultisample = (PFNGLTEXTURESTORAGE2DMULTISAMPLEPROC)LL_GET_PROC_ADDRESS("glTextureStorage2DMultisample"); + glTextureStorage3DMultisample = (PFNGLTEXTURESTORAGE3DMULTISAMPLEPROC)LL_GET_PROC_ADDRESS("glTextureStorage3DMultisample"); + glTextureSubImage1D = (PFNGLTEXTURESUBIMAGE1DPROC)LL_GET_PROC_ADDRESS("glTextureSubImage1D"); + glTextureSubImage2D = (PFNGLTEXTURESUBIMAGE2DPROC)LL_GET_PROC_ADDRESS("glTextureSubImage2D"); + glTextureSubImage3D = (PFNGLTEXTURESUBIMAGE3DPROC)LL_GET_PROC_ADDRESS("glTextureSubImage3D"); + glCompressedTextureSubImage1D = (PFNGLCOMPRESSEDTEXTURESUBIMAGE1DPROC)LL_GET_PROC_ADDRESS("glCompressedTextureSubImage1D"); + glCompressedTextureSubImage2D = (PFNGLCOMPRESSEDTEXTURESUBIMAGE2DPROC)LL_GET_PROC_ADDRESS("glCompressedTextureSubImage2D"); + glCompressedTextureSubImage3D = (PFNGLCOMPRESSEDTEXTURESUBIMAGE3DPROC)LL_GET_PROC_ADDRESS("glCompressedTextureSubImage3D"); + glCopyTextureSubImage1D = (PFNGLCOPYTEXTURESUBIMAGE1DPROC)LL_GET_PROC_ADDRESS("glCopyTextureSubImage1D"); + glCopyTextureSubImage2D = (PFNGLCOPYTEXTURESUBIMAGE2DPROC)LL_GET_PROC_ADDRESS("glCopyTextureSubImage2D"); + glCopyTextureSubImage3D = (PFNGLCOPYTEXTURESUBIMAGE3DPROC)LL_GET_PROC_ADDRESS("glCopyTextureSubImage3D"); + glTextureParameterf = (PFNGLTEXTUREPARAMETERFPROC)LL_GET_PROC_ADDRESS("glTextureParameterf"); + glTextureParameterfv = (PFNGLTEXTUREPARAMETERFVPROC)LL_GET_PROC_ADDRESS("glTextureParameterfv"); + glTextureParameteri = (PFNGLTEXTUREPARAMETERIPROC)LL_GET_PROC_ADDRESS("glTextureParameteri"); + glTextureParameterIiv = (PFNGLTEXTUREPARAMETERIIVPROC)LL_GET_PROC_ADDRESS("glTextureParameterIiv"); + glTextureParameterIuiv = (PFNGLTEXTUREPARAMETERIUIVPROC)LL_GET_PROC_ADDRESS("glTextureParameterIuiv"); + glTextureParameteriv = (PFNGLTEXTUREPARAMETERIVPROC)LL_GET_PROC_ADDRESS("glTextureParameteriv"); + glGenerateTextureMipmap = (PFNGLGENERATETEXTUREMIPMAPPROC)LL_GET_PROC_ADDRESS("glGenerateTextureMipmap"); + glBindTextureUnit = (PFNGLBINDTEXTUREUNITPROC)LL_GET_PROC_ADDRESS("glBindTextureUnit"); + glGetTextureImage = (PFNGLGETTEXTUREIMAGEPROC)LL_GET_PROC_ADDRESS("glGetTextureImage"); + glGetCompressedTextureImage = (PFNGLGETCOMPRESSEDTEXTUREIMAGEPROC)LL_GET_PROC_ADDRESS("glGetCompressedTextureImage"); + glGetTextureLevelParameterfv = (PFNGLGETTEXTURELEVELPARAMETERFVPROC)LL_GET_PROC_ADDRESS("glGetTextureLevelParameterfv"); + glGetTextureLevelParameteriv = (PFNGLGETTEXTURELEVELPARAMETERIVPROC)LL_GET_PROC_ADDRESS("glGetTextureLevelParameteriv"); + glGetTextureParameterfv = (PFNGLGETTEXTUREPARAMETERFVPROC)LL_GET_PROC_ADDRESS("glGetTextureParameterfv"); + glGetTextureParameterIiv = (PFNGLGETTEXTUREPARAMETERIIVPROC)LL_GET_PROC_ADDRESS("glGetTextureParameterIiv"); + glGetTextureParameterIuiv = (PFNGLGETTEXTUREPARAMETERIUIVPROC)LL_GET_PROC_ADDRESS("glGetTextureParameterIuiv"); + glGetTextureParameteriv = (PFNGLGETTEXTUREPARAMETERIVPROC)LL_GET_PROC_ADDRESS("glGetTextureParameteriv"); + glCreateVertexArrays = (PFNGLCREATEVERTEXARRAYSPROC)LL_GET_PROC_ADDRESS("glCreateVertexArrays"); + glDisableVertexArrayAttrib = (PFNGLDISABLEVERTEXARRAYATTRIBPROC)LL_GET_PROC_ADDRESS("glDisableVertexArrayAttrib"); + glEnableVertexArrayAttrib = (PFNGLENABLEVERTEXARRAYATTRIBPROC)LL_GET_PROC_ADDRESS("glEnableVertexArrayAttrib"); + glVertexArrayElementBuffer = (PFNGLVERTEXARRAYELEMENTBUFFERPROC)LL_GET_PROC_ADDRESS("glVertexArrayElementBuffer"); + glVertexArrayVertexBuffer = (PFNGLVERTEXARRAYVERTEXBUFFERPROC)LL_GET_PROC_ADDRESS("glVertexArrayVertexBuffer"); + glVertexArrayVertexBuffers = (PFNGLVERTEXARRAYVERTEXBUFFERSPROC)LL_GET_PROC_ADDRESS("glVertexArrayVertexBuffers"); + glVertexArrayAttribBinding = (PFNGLVERTEXARRAYATTRIBBINDINGPROC)LL_GET_PROC_ADDRESS("glVertexArrayAttribBinding"); + glVertexArrayAttribFormat = (PFNGLVERTEXARRAYATTRIBFORMATPROC)LL_GET_PROC_ADDRESS("glVertexArrayAttribFormat"); + glVertexArrayAttribIFormat = (PFNGLVERTEXARRAYATTRIBIFORMATPROC)LL_GET_PROC_ADDRESS("glVertexArrayAttribIFormat"); + glVertexArrayAttribLFormat = (PFNGLVERTEXARRAYATTRIBLFORMATPROC)LL_GET_PROC_ADDRESS("glVertexArrayAttribLFormat"); + glVertexArrayBindingDivisor = (PFNGLVERTEXARRAYBINDINGDIVISORPROC)LL_GET_PROC_ADDRESS("glVertexArrayBindingDivisor"); + glGetVertexArrayiv = (PFNGLGETVERTEXARRAYIVPROC)LL_GET_PROC_ADDRESS("glGetVertexArrayiv"); + glGetVertexArrayIndexediv = (PFNGLGETVERTEXARRAYINDEXEDIVPROC)LL_GET_PROC_ADDRESS("glGetVertexArrayIndexediv"); + glGetVertexArrayIndexed64iv = (PFNGLGETVERTEXARRAYINDEXED64IVPROC)LL_GET_PROC_ADDRESS("glGetVertexArrayIndexed64iv"); + glCreateSamplers = (PFNGLCREATESAMPLERSPROC)LL_GET_PROC_ADDRESS("glCreateSamplers"); + glCreateProgramPipelines = (PFNGLCREATEPROGRAMPIPELINESPROC)LL_GET_PROC_ADDRESS("glCreateProgramPipelines"); + glCreateQueries = (PFNGLCREATEQUERIESPROC)LL_GET_PROC_ADDRESS("glCreateQueries"); + glGetQueryBufferObjecti64v = (PFNGLGETQUERYBUFFEROBJECTI64VPROC)LL_GET_PROC_ADDRESS("glGetQueryBufferObjecti64v"); + glGetQueryBufferObjectiv = (PFNGLGETQUERYBUFFEROBJECTIVPROC)LL_GET_PROC_ADDRESS("glGetQueryBufferObjectiv"); + glGetQueryBufferObjectui64v = (PFNGLGETQUERYBUFFEROBJECTUI64VPROC)LL_GET_PROC_ADDRESS("glGetQueryBufferObjectui64v"); + glGetQueryBufferObjectuiv = (PFNGLGETQUERYBUFFEROBJECTUIVPROC)LL_GET_PROC_ADDRESS("glGetQueryBufferObjectuiv"); + glMemoryBarrierByRegion = (PFNGLMEMORYBARRIERBYREGIONPROC)LL_GET_PROC_ADDRESS("glMemoryBarrierByRegion"); + glGetTextureSubImage = (PFNGLGETTEXTURESUBIMAGEPROC)LL_GET_PROC_ADDRESS("glGetTextureSubImage"); + glGetCompressedTextureSubImage = (PFNGLGETCOMPRESSEDTEXTURESUBIMAGEPROC)LL_GET_PROC_ADDRESS("glGetCompressedTextureSubImage"); + glGetGraphicsResetStatus = (PFNGLGETGRAPHICSRESETSTATUSPROC)LL_GET_PROC_ADDRESS("glGetGraphicsResetStatus"); + glGetnCompressedTexImage = (PFNGLGETNCOMPRESSEDTEXIMAGEPROC)LL_GET_PROC_ADDRESS("glGetnCompressedTexImage"); + glGetnTexImage = (PFNGLGETNTEXIMAGEPROC)LL_GET_PROC_ADDRESS("glGetnTexImage"); + glGetnUniformdv = (PFNGLGETNUNIFORMDVPROC)LL_GET_PROC_ADDRESS("glGetnUniformdv"); + glGetnUniformfv = (PFNGLGETNUNIFORMFVPROC)LL_GET_PROC_ADDRESS("glGetnUniformfv"); + glGetnUniformiv = (PFNGLGETNUNIFORMIVPROC)LL_GET_PROC_ADDRESS("glGetnUniformiv"); + glGetnUniformuiv = (PFNGLGETNUNIFORMUIVPROC)LL_GET_PROC_ADDRESS("glGetnUniformuiv"); + glReadnPixels = (PFNGLREADNPIXELSPROC)LL_GET_PROC_ADDRESS("glReadnPixels"); + glTextureBarrier = (PFNGLTEXTUREBARRIERPROC)LL_GET_PROC_ADDRESS("glTextureBarrier"); // GL_VERSION_4_6 if (mGLVersion < 4.59f) { return; } - glSpecializeShader = (PFNGLSPECIALIZESHADERPROC)GLH_EXT_GET_PROC_ADDRESS("glSpecializeShader"); - glMultiDrawArraysIndirectCount = (PFNGLMULTIDRAWARRAYSINDIRECTCOUNTPROC)GLH_EXT_GET_PROC_ADDRESS("glMultiDrawArraysIndirectCount"); - glMultiDrawElementsIndirectCount = (PFNGLMULTIDRAWELEMENTSINDIRECTCOUNTPROC)GLH_EXT_GET_PROC_ADDRESS("glMultiDrawElementsIndirectCount"); - glPolygonOffsetClamp = (PFNGLPOLYGONOFFSETCLAMPPROC)GLH_EXT_GET_PROC_ADDRESS("glPolygonOffsetClamp"); + glSpecializeShader = (PFNGLSPECIALIZESHADERPROC)LL_GET_PROC_ADDRESS("glSpecializeShader"); + glMultiDrawArraysIndirectCount = (PFNGLMULTIDRAWARRAYSINDIRECTCOUNTPROC)LL_GET_PROC_ADDRESS("glMultiDrawArraysIndirectCount"); + glMultiDrawElementsIndirectCount = (PFNGLMULTIDRAWELEMENTSINDIRECTCOUNTPROC)LL_GET_PROC_ADDRESS("glMultiDrawElementsIndirectCount"); + glPolygonOffsetClamp = (PFNGLPOLYGONOFFSETCLAMPPROC)LL_GET_PROC_ADDRESS("glPolygonOffsetClamp"); -#endif +#endif // LL_GL_FUNC_POINTER } void rotate_quat(LLQuaternion& rotation) @@ -2305,10 +2219,14 @@ const std::string getGLErrorString(GLenum error) return "Invalid Framebuffer Operation"; case GL_OUT_OF_MEMORY: return "Out of Memory"; +#ifdef GL_STACK_UNDERFLOW case GL_STACK_UNDERFLOW: return "Stack Underflow"; +#endif +#ifdef GL_STACK_OVERFLOW case GL_STACK_OVERFLOW: return "Stack Overflow"; +#endif #ifdef GL_TABLE_TOO_LARGE case GL_TABLE_TOO_LARGE: return "Table too large"; @@ -2434,11 +2352,10 @@ void LLGLState::resetTextureStates() gGL.flush(); GLint maxTextureUnits; - glGetIntegerv(GL_MAX_TEXTURE_UNITS_ARB, &maxTextureUnits); + glGetIntegerv(GL_MAX_TEXTURE_IMAGE_UNITS, &maxTextureUnits); for (S32 j = maxTextureUnits-1; j >=0; j--) { gGL.getTexUnit(j)->activate(); - glClientActiveTexture(GL_TEXTURE0+j); j == 0 ? gGL.getTexUnit(j)->enable(LLTexUnit::TT_TEXTURE) : gGL.getTexUnit(j)->disable(); } } diff --git a/indra/llrender/llgl.h b/indra/llrender/llgl.h index 8a00e513ae..e2e6e92e59 100644 --- a/indra/llrender/llgl.h +++ b/indra/llrender/llgl.h @@ -33,6 +33,8 @@ #include #include +#include "llglheaders.h" + #include "llerror.h" #include "v4color.h" #include "llstring.h" @@ -42,7 +44,6 @@ #include "llgltypes.h" #include "llinstancetracker.h" -#include "llglheaders.h" #include "glm/mat4x4.hpp" extern bool gDebugGL; @@ -141,7 +142,11 @@ public: // In ALL CAPS std::string mGLRenderer; + // GL Extension String + std::set mGLExtensions; + private: + void reloadExtensionsString(); void initExtensions(); void initGLStates(); }; @@ -263,19 +268,6 @@ protected: bool mIsEnabled; }; -// New LLGLState class wrappers that don't depend on actual GL flags. -class LLGLEnableBlending : public LLGLState -{ -public: - LLGLEnableBlending(bool enable); -}; - -class LLGLEnableAlphaReject : public LLGLState -{ -public: - LLGLEnableAlphaReject(bool enable); -}; - // Enable with functor class LLGLEnableFunc : LLGLState { @@ -420,67 +412,4 @@ extern bool gHeadlessClient; extern bool gNonInteractive; extern bool gGLActive; -// Deal with changing glext.h definitions for newer SDK versions, specifically -// with MAC OSX 10.5 -> 10.6 - - -#ifndef GL_DEPTH_ATTACHMENT -#define GL_DEPTH_ATTACHMENT GL_DEPTH_ATTACHMENT_EXT -#endif - -#ifndef GL_STENCIL_ATTACHMENT -#define GL_STENCIL_ATTACHMENT GL_STENCIL_ATTACHMENT_EXT -#endif - -#ifndef GL_FRAMEBUFFER -#define GL_FRAMEBUFFER GL_FRAMEBUFFER_EXT -#define GL_DRAW_FRAMEBUFFER GL_DRAW_FRAMEBUFFER_EXT -#define GL_READ_FRAMEBUFFER GL_READ_FRAMEBUFFER_EXT -#define GL_FRAMEBUFFER_COMPLETE GL_FRAMEBUFFER_COMPLETE_EXT -#define GL_FRAMEBUFFER_UNSUPPORTED GL_FRAMEBUFFER_UNSUPPORTED_EXT -#define GL_FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT GL_FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT_EXT -#define GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT_EXT -#define glGenFramebuffers glGenFramebuffersEXT -#define glBindFramebuffer glBindFramebufferEXT -#define glCheckFramebufferStatus glCheckFramebufferStatusEXT -#define glBlitFramebuffer glBlitFramebufferEXT -#define glDeleteFramebuffers glDeleteFramebuffersEXT -#define glFramebufferRenderbuffer glFramebufferRenderbufferEXT -#define glFramebufferTexture2D glFramebufferTexture2DEXT -#endif - -#ifndef GL_RENDERBUFFER -#define GL_RENDERBUFFER GL_RENDERBUFFER_EXT -#define glGenRenderbuffers glGenRenderbuffersEXT -#define glBindRenderbuffer glBindRenderbufferEXT -#define glRenderbufferStorage glRenderbufferStorageEXT -#define glRenderbufferStorageMultisample glRenderbufferStorageMultisampleEXT -#define glDeleteRenderbuffers glDeleteRenderbuffersEXT -#endif - -#ifndef GL_COLOR_ATTACHMENT -#define GL_COLOR_ATTACHMENT GL_COLOR_ATTACHMENT_EXT -#endif - -#ifndef GL_COLOR_ATTACHMENT0 -#define GL_COLOR_ATTACHMENT0 GL_COLOR_ATTACHMENT0_EXT -#endif - -#ifndef GL_COLOR_ATTACHMENT1 -#define GL_COLOR_ATTACHMENT1 GL_COLOR_ATTACHMENT1_EXT -#endif - -#ifndef GL_COLOR_ATTACHMENT2 -#define GL_COLOR_ATTACHMENT2 GL_COLOR_ATTACHMENT2_EXT -#endif - -#ifndef GL_COLOR_ATTACHMENT3 -#define GL_COLOR_ATTACHMENT3 GL_COLOR_ATTACHMENT3_EXT -#endif - - -#ifndef GL_DEPTH24_STENCIL8 -#define GL_DEPTH24_STENCIL8 GL_DEPTH24_STENCIL8_EXT -#endif - #endif // LL_LLGL_H diff --git a/indra/llrender/llglheaders.h b/indra/llrender/llglheaders.h index 4c0fa6df1c..fb9c339c62 100644 --- a/indra/llrender/llglheaders.h +++ b/indra/llrender/llglheaders.h @@ -27,49 +27,99 @@ #ifndef LL_LLGLHEADERS_H #define LL_LLGLHEADERS_H +#if LL_WINDOWS || LL_MESA || LL_SDL_WINDOW || LL_LINUX + //---------------------------------------------------------------------------- + // LL_WINDOWS || LL_MESA || LL_SDL_WINDOW || LL_LINUX + #if LL_MESA -//---------------------------------------------------------------------------- -// MESA headers -// quotes so we get libraries/.../GL/ version #define GL_GLEXT_PROTOTYPES 1 -#include "GL/gl.h" -#include "GL/glext.h" - -// The __APPLE__ kludge is to make glh_extensions.h not symbol-clash horribly -# define __APPLE__ -# include "GL/glh_extensions.h" -# undef __APPLE__ +#else +#define LL_GL_FUNC_POINTER 1 +#endif -#elif LL_LINUX -#define GL_GLEXT_PROTOTYPES -#define GLX_GLEXT_PROTOTYPES + // windows gl headers depend on things like APIENTRY, so include windows. +#include "llwin32headers.h" -#include "GL/gl.h" -#include "GL/glext.h" +// quotes so we get libraries/.../GL/ version +#include "GL/glcorearb.h" -// The __APPLE__ kludge is to make glh_extensions.h not symbol-clash horribly -# define __APPLE__ -# include "GL/glh_extensions.h" -# undef __APPLE__ +#if LL_WINDOWS && !LL_MESA +#include "GL/wglext.h" +#endif -# include "GL/glx.h" -# include "GL/glxext.h" +#if LL_LINUX && !LL_MESA +#define __gl_h_ 1 +#include "GL/glx.h" +#include "GL/glxext.h" +#endif -#elif LL_WINDOWS +#elif LL_DARWIN //---------------------------------------------------------------------------- -// LL_WINDOWS - -// windows gl headers depend on things like APIENTRY, so include windows. -#include "llwin32headers.h" +// LL_DARWIN -//---------------------------------------------------------------------------- -#include -#include +#define GL_GLEXT_LEGACY 1 +#include -// quotes so we get libraries/.../GL/ version +#define GL_EXT_separate_specular_color 1 +#define GL_GLEXT_PROTOTYPES 1 #include "GL/glext.h" -#include "GL/glh_extensions.h" +#endif // LL_MESA / LL_SDL_WINDOW // LL_LINUX / LL_WINDOWS / LL_DARWIN + +//GL_NVX_gpu_memory_info constants +#ifndef GL_NVX_gpu_memory_info +#define GL_NVX_gpu_memory_info +#define GL_GPU_MEMORY_INFO_DEDICATED_VIDMEM_NVX 0x9047 +#define GL_GPU_MEMORY_INFO_TOTAL_AVAILABLE_MEMORY_NVX 0x9048 +#define GL_GPU_MEMORY_INFO_CURRENT_AVAILABLE_VIDMEM_NVX 0x9049 +#define GL_GPU_MEMORY_INFO_EVICTION_COUNT_NVX 0x904A +#define GL_GPU_MEMORY_INFO_EVICTED_MEMORY_NVX 0x904B +#endif + +//GL_ATI_meminfo constants +#ifndef GL_ATI_meminfo +#define GL_ATI_meminfo +#define GL_VBO_FREE_MEMORY_ATI 0x87FB +#define GL_TEXTURE_FREE_MEMORY_ATI 0x87FC +#define GL_RENDERBUFFER_FREE_MEMORY_ATI 0x87FD +#endif + +//GL_EXT_texture_sRGB constants +#ifndef GL_EXT_texture_sRGB +#define GL_EXT_texture_sRGB 1 +#define GL_SRGB_EXT 0x8C40 +#define GL_SRGB8_EXT 0x8C41 +#define GL_SRGB_ALPHA_EXT 0x8C42 +#define GL_SRGB8_ALPHA8_EXT 0x8C43 +#define GL_SLUMINANCE_ALPHA_EXT 0x8C44 +#define GL_SLUMINANCE8_ALPHA8_EXT 0x8C45 +#define GL_SLUMINANCE_EXT 0x8C46 +#define GL_SLUMINANCE8_EXT 0x8C47 +#define GL_COMPRESSED_SRGB_EXT 0x8C48 +#define GL_COMPRESSED_SRGB_ALPHA_EXT 0x8C49 +#define GL_COMPRESSED_SLUMINANCE_EXT 0x8C4A +#define GL_COMPRESSED_SLUMINANCE_ALPHA_EXT 0x8C4B +#define GL_COMPRESSED_SRGB_S3TC_DXT1_EXT 0x8C4C +#define GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT 0x8C4D +#define GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT 0x8C4E +#define GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT 0x8C4F +#endif /* GL_EXT_texture_sRGB */ + +// Deprecated OpenGL defines we still use +#define GL_COLOR_INDEX 0x1900 +#define GL_ALPHA 0x1906 +#define GL_ALPHA8 0x803C +#define GL_LUMINANCE 0x1909 +#define GL_LUMINANCE_ALPHA 0x190A +#define GL_LUMINANCE8 0x8040 +#define GL_LUMINANCE8_ALPHA8 0x8045 +#define GL_COMPRESSED_ALPHA 0x84E9 +#define GL_COMPRESSED_LUMINANCE 0x84EA +#define GL_COMPRESSED_LUMINANCE_ALPHA 0x84EB + +#if LL_GL_FUNC_POINTER + +#if LL_WINDOWS // WGL_AMD_gpu_association extern PFNWGLGETGPUIDSAMDPROC wglGetGPUIDsAMD; extern PFNWGLGETGPUINFOAMDPROC wglGetGPUInfoAMD; @@ -88,6 +138,86 @@ extern PFNWGLGETSWAPINTERVALEXTPROC wglGetSwapIntervalEXT; // WGL_ARB_create_context extern PFNWGLCREATECONTEXTATTRIBSARBPROC wglCreateContextAttribsARB; +// WGL_ARB_pixel_format +extern PFNWGLGETPIXELFORMATATTRIBIVARBPROC wglGetPixelFormatAttribivARB; +extern PFNWGLGETPIXELFORMATATTRIBFVARBPROC wglGetPixelFormatAttribfvARB; +extern PFNWGLCHOOSEPIXELFORMATARBPROC wglChoosePixelFormatARB; + +#endif // LL_WINDOWS + +// We get all functions via getProcAddress when using SDL +// GL_VERSION_1_0 +extern PFNGLCULLFACEPROC glCullFace; +extern PFNGLFRONTFACEPROC glFrontFace; +extern PFNGLHINTPROC glHint; +extern PFNGLLINEWIDTHPROC glLineWidth; +extern PFNGLPOINTSIZEPROC glPointSize; +extern PFNGLPOLYGONMODEPROC glPolygonMode; +extern PFNGLSCISSORPROC glScissor; +extern PFNGLTEXPARAMETERFPROC glTexParameterf; +extern PFNGLTEXPARAMETERFVPROC glTexParameterfv; +extern PFNGLTEXPARAMETERIPROC glTexParameteri; +extern PFNGLTEXPARAMETERIVPROC glTexParameteriv; +extern PFNGLTEXIMAGE1DPROC glTexImage1D; +extern PFNGLTEXIMAGE2DPROC glTexImage2D; +extern PFNGLDRAWBUFFERPROC glDrawBuffer; +extern PFNGLCLEARPROC glClear; +extern PFNGLCLEARCOLORPROC glClearColor; +extern PFNGLCLEARSTENCILPROC glClearStencil; +extern PFNGLCLEARDEPTHPROC glClearDepth; +extern PFNGLSTENCILMASKPROC glStencilMask; +extern PFNGLCOLORMASKPROC glColorMask; +extern PFNGLDEPTHMASKPROC glDepthMask; +extern PFNGLDISABLEPROC glDisable; +extern PFNGLENABLEPROC glEnable; +extern PFNGLFINISHPROC glFinish; +extern PFNGLFLUSHPROC glFlush; +extern PFNGLBLENDFUNCPROC glBlendFunc; +extern PFNGLLOGICOPPROC glLogicOp; +extern PFNGLSTENCILFUNCPROC glStencilFunc; +extern PFNGLSTENCILOPPROC glStencilOp; +extern PFNGLDEPTHFUNCPROC glDepthFunc; +extern PFNGLPIXELSTOREFPROC glPixelStoref; +extern PFNGLPIXELSTOREIPROC glPixelStorei; +extern PFNGLREADBUFFERPROC glReadBuffer; +extern PFNGLREADPIXELSPROC glReadPixels; +extern PFNGLGETBOOLEANVPROC glGetBooleanv; +extern PFNGLGETDOUBLEVPROC glGetDoublev; +extern PFNGLGETERRORPROC glGetError; +extern PFNGLGETFLOATVPROC glGetFloatv; +extern PFNGLGETINTEGERVPROC glGetIntegerv; +extern PFNGLGETSTRINGPROC glGetString; +extern PFNGLGETTEXIMAGEPROC glGetTexImage; +extern PFNGLGETTEXPARAMETERFVPROC glGetTexParameterfv; +extern PFNGLGETTEXPARAMETERIVPROC glGetTexParameteriv; +extern PFNGLGETTEXLEVELPARAMETERFVPROC glGetTexLevelParameterfv; +extern PFNGLGETTEXLEVELPARAMETERIVPROC glGetTexLevelParameteriv; +extern PFNGLISENABLEDPROC glIsEnabled; +extern PFNGLDEPTHRANGEPROC glDepthRange; +extern PFNGLVIEWPORTPROC glViewport; + +// GL_VERSION_1_1 +extern PFNGLDRAWARRAYSPROC glDrawArrays; +extern PFNGLDRAWELEMENTSPROC glDrawElements; +extern PFNGLGETPOINTERVPROC glGetPointerv; +extern PFNGLPOLYGONOFFSETPROC glPolygonOffset; +extern PFNGLCOPYTEXIMAGE1DPROC glCopyTexImage1D; +extern PFNGLCOPYTEXIMAGE2DPROC glCopyTexImage2D; +extern PFNGLCOPYTEXSUBIMAGE1DPROC glCopyTexSubImage1D; +extern PFNGLCOPYTEXSUBIMAGE2DPROC glCopyTexSubImage2D; +extern PFNGLTEXSUBIMAGE1DPROC glTexSubImage1D; +extern PFNGLTEXSUBIMAGE2DPROC glTexSubImage2D; +extern PFNGLBINDTEXTUREPROC glBindTexture; +extern PFNGLDELETETEXTURESPROC glDeleteTextures; +extern PFNGLGENTEXTURESPROC glGenTextures; +extern PFNGLISTEXTUREPROC glIsTexture; + +// GL_VERSION_1_2 +extern PFNGLDRAWRANGEELEMENTSPROC glDrawRangeElements; +extern PFNGLTEXIMAGE3DPROC glTexImage3D; +extern PFNGLTEXSUBIMAGE3DPROC glTexSubImage3D; +extern PFNGLCOPYTEXSUBIMAGE3DPROC glCopyTexSubImage3D; + // GL_VERSION_1_3 extern PFNGLACTIVETEXTUREPROC glActiveTexture; extern PFNGLSAMPLECOVERAGEPROC glSampleCoverage; @@ -98,43 +228,6 @@ extern PFNGLCOMPRESSEDTEXSUBIMAGE3DPROC glCompressedTexSubImage3D; extern PFNGLCOMPRESSEDTEXSUBIMAGE2DPROC glCompressedTexSubImage2D; extern PFNGLCOMPRESSEDTEXSUBIMAGE1DPROC glCompressedTexSubImage1D; extern PFNGLGETCOMPRESSEDTEXIMAGEPROC glGetCompressedTexImage; -extern PFNGLCLIENTACTIVETEXTUREPROC glClientActiveTexture; -extern PFNGLMULTITEXCOORD1DPROC glMultiTexCoord1d; -extern PFNGLMULTITEXCOORD1DVPROC glMultiTexCoord1dv; -extern PFNGLMULTITEXCOORD1FPROC glMultiTexCoord1f; -extern PFNGLMULTITEXCOORD1FVPROC glMultiTexCoord1fv; -extern PFNGLMULTITEXCOORD1IPROC glMultiTexCoord1i; -extern PFNGLMULTITEXCOORD1IVPROC glMultiTexCoord1iv; -extern PFNGLMULTITEXCOORD1SPROC glMultiTexCoord1s; -extern PFNGLMULTITEXCOORD1SVPROC glMultiTexCoord1sv; -extern PFNGLMULTITEXCOORD2DPROC glMultiTexCoord2d; -extern PFNGLMULTITEXCOORD2DVPROC glMultiTexCoord2dv; -extern PFNGLMULTITEXCOORD2FPROC glMultiTexCoord2f; -extern PFNGLMULTITEXCOORD2FVPROC glMultiTexCoord2fv; -extern PFNGLMULTITEXCOORD2IPROC glMultiTexCoord2i; -extern PFNGLMULTITEXCOORD2IVPROC glMultiTexCoord2iv; -extern PFNGLMULTITEXCOORD2SPROC glMultiTexCoord2s; -extern PFNGLMULTITEXCOORD2SVPROC glMultiTexCoord2sv; -extern PFNGLMULTITEXCOORD3DPROC glMultiTexCoord3d; -extern PFNGLMULTITEXCOORD3DVPROC glMultiTexCoord3dv; -extern PFNGLMULTITEXCOORD3FPROC glMultiTexCoord3f; -extern PFNGLMULTITEXCOORD3FVPROC glMultiTexCoord3fv; -extern PFNGLMULTITEXCOORD3IPROC glMultiTexCoord3i; -extern PFNGLMULTITEXCOORD3IVPROC glMultiTexCoord3iv; -extern PFNGLMULTITEXCOORD3SPROC glMultiTexCoord3s; -extern PFNGLMULTITEXCOORD3SVPROC glMultiTexCoord3sv; -extern PFNGLMULTITEXCOORD4DPROC glMultiTexCoord4d; -extern PFNGLMULTITEXCOORD4DVPROC glMultiTexCoord4dv; -extern PFNGLMULTITEXCOORD4FPROC glMultiTexCoord4f; -extern PFNGLMULTITEXCOORD4FVPROC glMultiTexCoord4fv; -extern PFNGLMULTITEXCOORD4IPROC glMultiTexCoord4i; -extern PFNGLMULTITEXCOORD4IVPROC glMultiTexCoord4iv; -extern PFNGLMULTITEXCOORD4SPROC glMultiTexCoord4s; -extern PFNGLMULTITEXCOORD4SVPROC glMultiTexCoord4sv; -extern PFNGLLOADTRANSPOSEMATRIXFPROC glLoadTransposeMatrixf; -extern PFNGLLOADTRANSPOSEMATRIXDPROC glLoadTransposeMatrixd; -extern PFNGLMULTTRANSPOSEMATRIXFPROC glMultTransposeMatrixf; -extern PFNGLMULTTRANSPOSEMATRIXDPROC glMultTransposeMatrixd; // GL_VERSION_1_4 extern PFNGLBLENDFUNCSEPARATEPROC glBlendFuncSeparate; @@ -144,44 +237,6 @@ extern PFNGLPOINTPARAMETERFPROC glPointParameterf; extern PFNGLPOINTPARAMETERFVPROC glPointParameterfv; extern PFNGLPOINTPARAMETERIPROC glPointParameteri; extern PFNGLPOINTPARAMETERIVPROC glPointParameteriv; -extern PFNGLFOGCOORDFPROC glFogCoordf; -extern PFNGLFOGCOORDFVPROC glFogCoordfv; -extern PFNGLFOGCOORDDPROC glFogCoordd; -extern PFNGLFOGCOORDDVPROC glFogCoorddv; -extern PFNGLFOGCOORDPOINTERPROC glFogCoordPointer; -extern PFNGLSECONDARYCOLOR3BPROC glSecondaryColor3b; -extern PFNGLSECONDARYCOLOR3BVPROC glSecondaryColor3bv; -extern PFNGLSECONDARYCOLOR3DPROC glSecondaryColor3d; -extern PFNGLSECONDARYCOLOR3DVPROC glSecondaryColor3dv; -extern PFNGLSECONDARYCOLOR3FPROC glSecondaryColor3f; -extern PFNGLSECONDARYCOLOR3FVPROC glSecondaryColor3fv; -extern PFNGLSECONDARYCOLOR3IPROC glSecondaryColor3i; -extern PFNGLSECONDARYCOLOR3IVPROC glSecondaryColor3iv; -extern PFNGLSECONDARYCOLOR3SPROC glSecondaryColor3s; -extern PFNGLSECONDARYCOLOR3SVPROC glSecondaryColor3sv; -extern PFNGLSECONDARYCOLOR3UBPROC glSecondaryColor3ub; -extern PFNGLSECONDARYCOLOR3UBVPROC glSecondaryColor3ubv; -extern PFNGLSECONDARYCOLOR3UIPROC glSecondaryColor3ui; -extern PFNGLSECONDARYCOLOR3UIVPROC glSecondaryColor3uiv; -extern PFNGLSECONDARYCOLOR3USPROC glSecondaryColor3us; -extern PFNGLSECONDARYCOLOR3USVPROC glSecondaryColor3usv; -extern PFNGLSECONDARYCOLORPOINTERPROC glSecondaryColorPointer; -extern PFNGLWINDOWPOS2DPROC glWindowPos2d; -extern PFNGLWINDOWPOS2DVPROC glWindowPos2dv; -extern PFNGLWINDOWPOS2FPROC glWindowPos2f; -extern PFNGLWINDOWPOS2FVPROC glWindowPos2fv; -extern PFNGLWINDOWPOS2IPROC glWindowPos2i; -extern PFNGLWINDOWPOS2IVPROC glWindowPos2iv; -extern PFNGLWINDOWPOS2SPROC glWindowPos2s; -extern PFNGLWINDOWPOS2SVPROC glWindowPos2sv; -extern PFNGLWINDOWPOS3DPROC glWindowPos3d; -extern PFNGLWINDOWPOS3DVPROC glWindowPos3dv; -extern PFNGLWINDOWPOS3FPROC glWindowPos3f; -extern PFNGLWINDOWPOS3FVPROC glWindowPos3fv; -extern PFNGLWINDOWPOS3IPROC glWindowPos3i; -extern PFNGLWINDOWPOS3IVPROC glWindowPos3iv; -extern PFNGLWINDOWPOS3SPROC glWindowPos3s; -extern PFNGLWINDOWPOS3SVPROC glWindowPos3sv; // GL_VERSION_1_5 extern PFNGLGENQUERIESPROC glGenQueries; @@ -457,36 +512,6 @@ extern PFNGLVERTEXATTRIBP3UIPROC glVertexAttribP3ui; extern PFNGLVERTEXATTRIBP3UIVPROC glVertexAttribP3uiv; extern PFNGLVERTEXATTRIBP4UIPROC glVertexAttribP4ui; extern PFNGLVERTEXATTRIBP4UIVPROC glVertexAttribP4uiv; -extern PFNGLVERTEXP2UIPROC glVertexP2ui; -extern PFNGLVERTEXP2UIVPROC glVertexP2uiv; -extern PFNGLVERTEXP3UIPROC glVertexP3ui; -extern PFNGLVERTEXP3UIVPROC glVertexP3uiv; -extern PFNGLVERTEXP4UIPROC glVertexP4ui; -extern PFNGLVERTEXP4UIVPROC glVertexP4uiv; -extern PFNGLTEXCOORDP1UIPROC glTexCoordP1ui; -extern PFNGLTEXCOORDP1UIVPROC glTexCoordP1uiv; -extern PFNGLTEXCOORDP2UIPROC glTexCoordP2ui; -extern PFNGLTEXCOORDP2UIVPROC glTexCoordP2uiv; -extern PFNGLTEXCOORDP3UIPROC glTexCoordP3ui; -extern PFNGLTEXCOORDP3UIVPROC glTexCoordP3uiv; -extern PFNGLTEXCOORDP4UIPROC glTexCoordP4ui; -extern PFNGLTEXCOORDP4UIVPROC glTexCoordP4uiv; -extern PFNGLMULTITEXCOORDP1UIPROC glMultiTexCoordP1ui; -extern PFNGLMULTITEXCOORDP1UIVPROC glMultiTexCoordP1uiv; -extern PFNGLMULTITEXCOORDP2UIPROC glMultiTexCoordP2ui; -extern PFNGLMULTITEXCOORDP2UIVPROC glMultiTexCoordP2uiv; -extern PFNGLMULTITEXCOORDP3UIPROC glMultiTexCoordP3ui; -extern PFNGLMULTITEXCOORDP3UIVPROC glMultiTexCoordP3uiv; -extern PFNGLMULTITEXCOORDP4UIPROC glMultiTexCoordP4ui; -extern PFNGLMULTITEXCOORDP4UIVPROC glMultiTexCoordP4uiv; -extern PFNGLNORMALP3UIPROC glNormalP3ui; -extern PFNGLNORMALP3UIVPROC glNormalP3uiv; -extern PFNGLCOLORP3UIPROC glColorP3ui; -extern PFNGLCOLORP3UIVPROC glColorP3uiv; -extern PFNGLCOLORP4UIPROC glColorP4ui; -extern PFNGLCOLORP4UIVPROC glColorP4uiv; -extern PFNGLSECONDARYCOLORP3UIPROC glSecondaryColorP3ui; -extern PFNGLSECONDARYCOLORP3UIVPROC glSecondaryColorP3uiv; // GL_VERSION_4_0 extern PFNGLMINSAMPLESHADINGPROC glMinSampleShading; @@ -536,7 +561,7 @@ extern PFNGLBEGINQUERYINDEXEDPROC glBeginQueryIndexed; extern PFNGLENDQUERYINDEXEDPROC glEndQueryIndexed; extern PFNGLGETQUERYINDEXEDIVPROC glGetQueryIndexediv; - // GL_VERSION_4_1 +// GL_VERSION_4_1 extern PFNGLRELEASESHADERCOMPILERPROC glReleaseShaderCompiler; extern PFNGLSHADERBINARYPROC glShaderBinary; extern PFNGLGETSHADERPRECISIONFORMATPROC glGetShaderPrecisionFormat; @@ -806,18 +831,6 @@ extern PFNGLGETNUNIFORMFVPROC glGetnUniformfv; extern PFNGLGETNUNIFORMIVPROC glGetnUniformiv; extern PFNGLGETNUNIFORMUIVPROC glGetnUniformuiv; extern PFNGLREADNPIXELSPROC glReadnPixels; -extern PFNGLGETNMAPDVPROC glGetnMapdv; -extern PFNGLGETNMAPFVPROC glGetnMapfv; -extern PFNGLGETNMAPIVPROC glGetnMapiv; -extern PFNGLGETNPIXELMAPFVPROC glGetnPixelMapfv; -extern PFNGLGETNPIXELMAPUIVPROC glGetnPixelMapuiv; -extern PFNGLGETNPIXELMAPUSVPROC glGetnPixelMapusv; -extern PFNGLGETNPOLYGONSTIPPLEPROC glGetnPolygonStipple; -extern PFNGLGETNCOLORTABLEPROC glGetnColorTable; -extern PFNGLGETNCONVOLUTIONFILTERPROC glGetnConvolutionFilter; -extern PFNGLGETNSEPARABLEFILTERPROC glGetnSeparableFilter; -extern PFNGLGETNHISTOGRAMPROC glGetnHistogram; -extern PFNGLGETNMINMAXPROC glGetnMinmax; extern PFNGLTEXTUREBARRIERPROC glTextureBarrier; // GL_VERSION_4_6 @@ -826,252 +839,6 @@ extern PFNGLMULTIDRAWARRAYSINDIRECTCOUNTPROC glMultiDrawArraysIndirectCount; extern PFNGLMULTIDRAWELEMENTSINDIRECTCOUNTPROC glMultiDrawElementsIndirectCount; extern PFNGLPOLYGONOFFSETCLAMPPROC glPolygonOffsetClamp; - -#elif LL_DARWIN -//---------------------------------------------------------------------------- -// LL_DARWIN - -#define GL_GLEXT_LEGACY -#include -#include - -#define GL_EXT_separate_specular_color 1 -#define GL_GLEXT_PROTOTYPES -#include "GL/glext.h" - -#include "GL/glh_extensions.h" - -// These symbols don't exist on 10.3.9, so they have to be declared weak. Redeclaring them here fixes the problem. -// Note that they also must not be called on 10.3.9. This should be taken care of by a runtime check for the existence of the GL extension. -#include - -//GL_EXT_blend_func_separate -extern void glBlendFuncSeparateEXT(GLenum srcRGB, GLenum dstRGB, GLenum srcAlpha, GLenum dstAlpha) ; - -// GL_EXT_framebuffer_object -extern GLboolean glIsRenderbufferEXT(GLuint renderbuffer) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER; -extern void glBindRenderbufferEXT(GLenum target, GLuint renderbuffer) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER; -extern void glDeleteRenderbuffersEXT(GLsizei n, const GLuint *renderbuffers) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER; -extern void glGenRenderbuffersEXT(GLsizei n, GLuint *renderbuffers) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER; -extern void glRenderbufferStorageEXT(GLenum target, GLenum internalformat, GLsizei width, GLsizei height) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER; -extern void glGetRenderbufferParameterivEXT(GLenum target, GLenum pname, GLint *params) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER; -extern GLboolean glIsFramebufferEXT(GLuint framebuffer) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER; -extern void glBindFramebufferEXT(GLenum target, GLuint framebuffer) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER; -extern void glDeleteFramebuffersEXT(GLsizei n, const GLuint *framebuffers) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER; -extern void glGenFramebuffersEXT(GLsizei n, GLuint *framebuffers) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER; -extern GLenum glCheckFramebufferStatusEXT(GLenum target) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER; -extern void glFramebufferTexture1DEXT(GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER; -extern void glFramebufferTexture2DEXT(GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER; -extern void glFramebufferTexture3DEXT(GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level, GLint zoffset) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER; -extern void glFramebufferRenderbufferEXT(GLenum target, GLenum attachment, GLenum renderbuffertarget, GLuint renderbuffer) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER; -extern void glGetFramebufferAttachmentParameterivEXT(GLenum target, GLenum attachment, GLenum pname, GLint *params) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER; -extern void glGenerateMipmapEXT(GLenum target) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER; - -#ifndef GL_ARB_framebuffer_object -#define glGenerateMipmap glGenerateMipmapEXT -#define GL_MAX_SAMPLES 0x8D57 -#endif - -#ifdef __cplusplus -extern "C" { -#endif - -// -// Define map buffer range headers on Mac -// -#ifndef GL_ARB_map_buffer_range -#define GL_MAP_READ_BIT 0x0001 -#define GL_MAP_WRITE_BIT 0x0002 -#define GL_MAP_INVALIDATE_RANGE_BIT 0x0004 -#define GL_MAP_INVALIDATE_BUFFER_BIT 0x0008 -#define GL_MAP_FLUSH_EXPLICIT_BIT 0x0010 -#define GL_MAP_UNSYNCHRONIZED_BIT 0x0020 -#endif - -// -// Define multisample headers on Mac -// -#ifndef GL_ARB_texture_multisample -#define GL_SAMPLE_POSITION 0x8E50 -#define GL_SAMPLE_MASK 0x8E51 -#define GL_SAMPLE_MASK_VALUE 0x8E52 -#define GL_MAX_SAMPLE_MASK_WORDS 0x8E59 -#define GL_TEXTURE_2D_MULTISAMPLE 0x9100 -#define GL_PROXY_TEXTURE_2D_MULTISAMPLE 0x9101 -#define GL_TEXTURE_2D_MULTISAMPLE_ARRAY 0x9102 -#define GL_PROXY_TEXTURE_2D_MULTISAMPLE_ARRAY 0x9103 -#define GL_TEXTURE_BINDING_2D_MULTISAMPLE 0x9104 -#define GL_TEXTURE_BINDING_2D_MULTISAMPLE_ARRAY 0x9105 -#define GL_TEXTURE_SAMPLES 0x9106 -#define GL_TEXTURE_FIXED_SAMPLE_LOCATIONS 0x9107 -#define GL_SAMPLER_2D_MULTISAMPLE 0x9108 -#define GL_INT_SAMPLER_2D_MULTISAMPLE 0x9109 -#define GL_UNSIGNED_INT_SAMPLER_2D_MULTISAMPLE 0x910A -#define GL_SAMPLER_2D_MULTISAMPLE_ARRAY 0x910B -#define GL_INT_SAMPLER_2D_MULTISAMPLE_ARRAY 0x910C -#define GL_UNSIGNED_INT_SAMPLER_2D_MULTISAMPLE_ARRAY 0x910D -#define GL_MAX_COLOR_TEXTURE_SAMPLES 0x910E -#define GL_MAX_DEPTH_TEXTURE_SAMPLES 0x910F -#define GL_MAX_INTEGER_SAMPLES 0x9110 -#endif - -// -// Define vertex buffer object headers on Mac -// -#ifndef GL_ARB_vertex_buffer_object -#define GL_BUFFER_SIZE_ARB 0x8764 -#define GL_BUFFER_USAGE_ARB 0x8765 -#define GL_ARRAY_BUFFER_ARB 0x8892 -#define GL_ELEMENT_ARRAY_BUFFER_ARB 0x8893 -#define GL_ARRAY_BUFFER_BINDING_ARB 0x8894 -#define GL_ELEMENT_ARRAY_BUFFER_BINDING_ARB 0x8895 -#define GL_VERTEX_ARRAY_BUFFER_BINDING_ARB 0x8896 -#define GL_NORMAL_ARRAY_BUFFER_BINDING_ARB 0x8897 -#define GL_COLOR_ARRAY_BUFFER_BINDING_ARB 0x8898 -#define GL_INDEX_ARRAY_BUFFER_BINDING_ARB 0x8899 -#define GL_TEXTURE_COORD_ARRAY_BUFFER_BINDING_ARB 0x889A -#define GL_EDGE_FLAG_ARRAY_BUFFER_BINDING_ARB 0x889B -#define GL_SECONDARY_COLOR_ARRAY_BUFFER_BINDING_ARB 0x889C -#define GL_FOG_COORDINATE_ARRAY_BUFFER_BINDING_ARB 0x889D -#define GL_WEIGHT_ARRAY_BUFFER_BINDING_ARB 0x889E -#define GL_VERTEX_ATTRIB_ARRAY_BUFFER_BINDING_ARB 0x889F -#define GL_READ_ONLY_ARB 0x88B8 -#define GL_WRITE_ONLY_ARB 0x88B9 -#define GL_READ_WRITE_ARB 0x88BA -#define GL_BUFFER_ACCESS_ARB 0x88BB -#define GL_BUFFER_MAPPED_ARB 0x88BC -#define GL_BUFFER_MAP_POINTER_ARB 0x88BD -#define GL_STREAM_DRAW_ARB 0x88E0 -#define GL_STREAM_READ_ARB 0x88E1 -#define GL_STREAM_COPY_ARB 0x88E2 -#define GL_STATIC_DRAW_ARB 0x88E4 -#define GL_STATIC_READ_ARB 0x88E5 -#define GL_STATIC_COPY_ARB 0x88E6 -#define GL_DYNAMIC_DRAW_ARB 0x88E8 -#define GL_DYNAMIC_READ_ARB 0x88E9 -#define GL_DYNAMIC_COPY_ARB 0x88EA -#endif - - - -#ifndef GL_ARB_vertex_buffer_object -/* GL types for handling large vertex buffer objects */ -typedef intptr_t GLintptr; -typedef intptr_t GLsizeiptr; -#endif - - -#ifndef GL_ARB_vertex_buffer_object -#define GL_ARB_vertex_buffer_object 1 -#ifdef GL_GLEXT_FUNCTION_POINTERS -typedef void (* glBindBufferARBProcPtr) (GLenum target, GLuint buffer); -typedef void (* glDeleteBufferARBProcPtr) (GLsizei n, const GLuint *buffers); -typedef void (* glGenBuffersARBProcPtr) (GLsizei n, GLuint *buffers); -typedef GLboolean (* glIsBufferARBProcPtr) (GLuint buffer); -typedef void (* glBufferDataARBProcPtr) (GLenum target, GLsizeiptrARB size, const GLvoid *data, GLenum usage); -typedef void (* glBufferSubDataARBProcPtr) (GLenum target, GLintptrARB offset, GLsizeiptrARB size, const GLvoid *data); -typedef void (* glGetBufferSubDataARBProcPtr) (GLenum target, GLintptrARB offset, GLsizeiptrARB size, GLvoid *data); -typedef GLvoid* (* glMapBufferARBProcPtr) (GLenum target, GLenum access); /* Flawfinder: ignore */ -typedef GLboolean (* glUnmapBufferARBProcPtr) (GLenum target); -typedef void (* glGetBufferParameterivARBProcPtr) (GLenum target, GLenum pname, GLint *params); -typedef void (* glGetBufferPointervARBProcPtr) (GLenum target, GLenum pname, GLvoid* *params); -#else -extern void glBindBufferARB (GLenum, GLuint); -extern void glDeleteBuffersARB (GLsizei, const GLuint *); -extern void glGenBuffersARB (GLsizei, GLuint *); -extern GLboolean glIsBufferARB (GLuint); -extern void glBufferDataARB (GLenum, GLsizeiptrARB, const GLvoid *, GLenum); -extern void glBufferSubDataARB (GLenum, GLintptrARB, GLsizeiptrARB, const GLvoid *); -extern void glGetBufferSubDataARB (GLenum, GLintptrARB, GLsizeiptrARB, GLvoid *); -extern GLvoid* glMapBufferARB (GLenum, GLenum); -extern GLboolean glUnmapBufferARB (GLenum); -extern void glGetBufferParameterivARB (GLenum, GLenum, GLint *); -extern void glGetBufferPointervARB (GLenum, GLenum, GLvoid* *); -#endif /* GL_GLEXT_FUNCTION_POINTERS */ -#endif - -#ifndef GL_ARB_texture_rg -#define GL_RG 0x8227 -#define GL_RG_INTEGER 0x8228 -#define GL_R8 0x8229 -#define GL_R16 0x822A -#define GL_RG8 0x822B -#define GL_RG16 0x822C -#define GL_R16F 0x822D -#define GL_R32F 0x822E -#define GL_RG16F 0x822F -#define GL_RG32F 0x8230 -#define GL_R8I 0x8231 -#define GL_R8UI 0x8232 -#define GL_R16I 0x8233 -#define GL_R16UI 0x8234 -#define GL_R32I 0x8235 -#define GL_R32UI 0x8236 -#define GL_RG8I 0x8237 -#define GL_RG8UI 0x8238 -#define GL_RG16I 0x8239 -#define GL_RG16UI 0x823A -#define GL_RG32I 0x823B -#define GL_RG32UI 0x823C -#endif - -// May be needed for DARWIN... -// #ifndef GL_ARB_compressed_tex_image -// #define GL_ARB_compressed_tex_image 1 -// #ifdef GL_GLEXT_FUNCTION_POINTERS -// typedef void (* glCompressedTexImage1D) (GLenum, GLint, GLenum, GLsizei, GLint, GLsizei, const GLvoid*); -// typedef void (* glCompressedTexImage2D) (GLenum, GLint, GLenum, GLsizei, GLsizei, GLint, GLsizei, const GLvoid*); -// typedef void (* glCompressedTexImage3D) (GLenum, GLint, GLenum, GLsizei, GLsizei, GLsizei, GLint, GLsizei, const GLvoid*); -// typedef void (* glCompressedTexSubImage1D) (GLenum, GLint, GLint, GLsizei, GLenum, GLsizei, const GLvoid*); -// typedef void (* glCompressedTexSubImage2D) (GLenum, GLint, GLint, GLint, GLsizei, GLsizei, GLenum, GLsizei, const GLvoid*); -// typedef void (* glCompressedTexSubImage3D) (GLenum, GLint, GLint, GLint, GLint, GLsizei, GLsizei, GLsizei, GLenum, GLsizei, const GLvoid*); -// typedef void (* glGetCompressedTexImage) (GLenum, GLint, GLvoid*); -// #else -// extern void glCompressedTexImage1D (GLenum, GLint, GLenum, GLsizei, GLint, GLsizei, const GLvoid*); -// extern void glCompressedTexImage2D (GLenum, GLint, GLenum, GLsizei, GLsizei, GLint, GLsizei, const GLvoid*); -// extern void glCompressedTexImage3D (GLenum, GLint, GLenum, GLsizei, GLsizei, GLsizei, GLint, GLsizei, const GLvoid*); -// extern void glCompressedTexSubImage1D (GLenum, GLint, GLint, GLsizei, GLenum, GLsizei, const GLvoid*); -// extern void glCompressedTexSubImage2D (GLenum, GLint, GLint, GLint, GLsizei, GLsizei, GLenum, GLsizei, const GLvoid*); -// extern void glCompressedTexSubImage3D (GLenum, GLint, GLint, GLint, GLint, GLsizei, GLsizei, GLsizei, GLenum, GLsizei, const GLvoid*); -// extern void glGetCompressedTexImage (GLenum, GLint, GLvoid*); -// #endif /* GL_GLEXT_FUNCTION_POINTERS */ -// #endif - -#ifdef __cplusplus -} -#endif - -#include - -#endif // LL_MESA / LL_WINDOWS / LL_DARWIN - -// Even when GL_ARB_depth_clamp is available in the driver, the (correct) -// headers, and therefore GL_DEPTH_CLAMP might not be defined. -// In that case GL_DEPTH_CLAMP_NV should be defined, but why not just -// use the known numeric. -// -// To avoid #ifdef's in the code. Just define this here. -#ifndef GL_DEPTH_CLAMP -// Probably (still) called GL_DEPTH_CLAMP_NV. -#define GL_DEPTH_CLAMP 0x864F -#endif - -//GL_NVX_gpu_memory_info constants -#ifndef GL_NVX_gpu_memory_info -#define GL_NVX_gpu_memory_info -#define GL_GPU_MEMORY_INFO_DEDICATED_VIDMEM_NVX 0x9047 -#define GL_GPU_MEMORY_INFO_TOTAL_AVAILABLE_MEMORY_NVX 0x9048 -#define GL_GPU_MEMORY_INFO_CURRENT_AVAILABLE_VIDMEM_NVX 0x9049 -#define GL_GPU_MEMORY_INFO_EVICTION_COUNT_NVX 0x904A -#define GL_GPU_MEMORY_INFO_EVICTED_MEMORY_NVX 0x904B -#endif - -//GL_ATI_meminfo constants -#ifndef GL_ATI_meminfo -#define GL_ATI_meminfo -#define GL_VBO_FREE_MEMORY_ATI 0x87FB -#define GL_TEXTURE_FREE_MEMORY_ATI 0x87FC -#define GL_RENDERBUFFER_FREE_MEMORY_ATI 0x87FD #endif #if defined(TRACY_ENABLE) && LL_PROFILER_ENABLE_TRACY_OPENGL diff --git a/indra/llrender/llimagegl.cpp b/indra/llrender/llimagegl.cpp index e319816377..414a4db4a7 100644 --- a/indra/llrender/llimagegl.cpp +++ b/indra/llrender/llimagegl.cpp @@ -2010,7 +2010,7 @@ bool LLImageGL::getIsResident(bool test_now) { if (mTexName != 0) { - glAreTexturesResident(1, (GLuint*)&mTexName, &mIsResident); + mIsResident = true; } else { diff --git a/indra/llwindow/llwindowwin32.cpp b/indra/llwindow/llwindowwin32.cpp index 824d0f5ec6..011cb0ed9d 100644 --- a/indra/llwindow/llwindowwin32.cpp +++ b/indra/llwindow/llwindowwin32.cpp @@ -204,6 +204,7 @@ HKL LLWindowWin32::sWinInputLocale = 0; DWORD LLWindowWin32::sWinIMEConversionMode = IME_CMODE_NATIVE; DWORD LLWindowWin32::sWinIMESentenceMode = IME_SMODE_AUTOMATIC; LLCoordWindow LLWindowWin32::sWinIMEWindowPosition(-1,-1); +HMODULE LLWindowWin32::sGLDLLHandle = nullptr; static HWND sWindowHandleForMessageBox = NULL; @@ -458,7 +459,7 @@ LLWindowWin32::LLWindowWin32(LLWindowCallbacks* callbacks, mWindowThread = new LLWindowWin32Thread(); //MAINT-516 -- force a load of opengl32.dll just in case windows went sideways - LoadLibrary(L"opengl32.dll"); + sGLDLLHandle = LoadLibrary(L"opengl32.dll"); if (mMaxCores != 0) @@ -1690,6 +1691,8 @@ const S32 max_format = (S32)num_formats - 1; return false; } + gGLManager.initWGL(); // Reinit WGL functions once we have our full context + if (!gGLManager.initGL()) { LLError::LLUserWarningMsg::show(mCallbacks->translateString("MBVideoDrvErr"), 8/*LAST_EXEC_GRAPHICS_INIT*/); @@ -4659,6 +4662,18 @@ F32 LLWindowWin32::getSystemUISize() return scale_value; } +//static +PROC WINAPI LLWindowWin32::getProcAddress(const char* func) +{ + PROC ret_func = wglGetProcAddress(func); + if (!ret_func && sGLDLLHandle) + { + // Try to fallback to OpenGL32.dll + ret_func = GetProcAddress(sGLDLLHandle, func); + } + return ret_func; +} + //static std::vector LLWindowWin32::getDisplaysResolutionList() { diff --git a/indra/llwindow/llwindowwin32.h b/indra/llwindow/llwindowwin32.h index 0fc93ad0b1..77217747cc 100644 --- a/indra/llwindow/llwindowwin32.h +++ b/indra/llwindow/llwindowwin32.h @@ -125,6 +125,7 @@ public: LLWindowCallbacks::DragNDropResult completeDragNDropRequest( const LLCoordGL gl_coord, const MASK mask, LLWindowCallbacks::DragNDropAction action, const std::string url ); + static PROC WINAPI getProcAddress(const char* func); static std::vector getDisplaysResolutionList(); static std::vector getDynamicFallbackFontList(); static void setDPIAwareness(); @@ -244,6 +245,8 @@ protected: bool mMouseVanish; + static HMODULE sGLDLLHandle; + // Cached values of GetWindowRect and GetClientRect to be used by app thread void updateWindowRect(); RECT mRect; diff --git a/indra/newview/llgltfmaterialpreviewmgr.cpp b/indra/newview/llgltfmaterialpreviewmgr.cpp index ebb9dc3e3c..e7b988aef5 100644 --- a/indra/newview/llgltfmaterialpreviewmgr.cpp +++ b/indra/newview/llgltfmaterialpreviewmgr.cpp @@ -428,7 +428,7 @@ bool LLGLTFPreviewTexture::render() glClearColor(0, 0, 0, 0); glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); - LLGLDepthTest(GL_FALSE); + LLGLDepthTest depth(GL_FALSE); LLGLDisable stencil(GL_STENCIL_TEST); LLGLDisable scissor(GL_SCISSOR_TEST); SetTemporarily no_dof(&LLPipeline::RenderDepthOfField, false); diff --git a/indra/newview/llviewerjointmesh.cpp b/indra/newview/llviewerjointmesh.cpp index 4591579c7c..7870fe7823 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 -- cgit v1.3 From 8b6327cfe2e2f004166d06342f459520fbc05fdf Mon Sep 17 00:00:00 2001 From: Rye Date: Sun, 2 Nov 2025 22:48:44 -0500 Subject: Update open-libndof package with fixes for SDL3 joystick init Signed-off-by: Rye --- autobuild.xml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'autobuild.xml') diff --git a/autobuild.xml b/autobuild.xml index aff507828e..202617f76b 100644 --- a/autobuild.xml +++ b/autobuild.xml @@ -1730,11 +1730,11 @@ Copyright (c) 2012, 2014, 2015, 2016 nghttp2 contributors archive hash - 795d1e60f3e1e9092788214a6750e6506391cac5 + 612bfcb7cf0e6afaf7ce7f1db6feccd81137eb99 hash_algorithm sha1 url - https://github.com/secondlife/3p-open-libndofdev/releases/download/v1.14-r6/open_libndofdev-0.14.18543500856-linux64-18543500856.tar.zst + https://github.com/secondlife/3p-open-libndofdev/releases/download/v1.14-r7/open_libndofdev-0.14.19022717849-linux64-19022717849.tar.zst name linux64 @@ -1747,7 +1747,7 @@ Copyright (c) 2012, 2014, 2015, 2016 nghttp2 contributors copyright Copyright (c) 2008, Jan Ciger (jan.ciger (at) gmail.com) version - 0.14.18543500856 + 0.14.19022717849 name open-libndofdev description -- cgit v1.3