From f0851a025deaaa8636cde6ee8339529eb6322d3d Mon Sep 17 00:00:00 2001 From: Erik Kundiman Date: Tue, 11 Jul 2023 08:22:43 +0800 Subject: Set CMake USESYSTEMLIBS on to use system libraries Its use_system_binary implementation first tries to use pkg-config to generate the necessary flags. But if it doesn't find the package, then it will try to use find_package. The USESYSTEMLIBS is also brought back again though only in 1 place, and the name because it's the one still on the wiki page (the building the viewer with Autobuild one), so the CMake variable is not totally new. --- indra/CMakeLists.txt | 4 ++++ indra/cmake/Prebuilt.cmake | 16 ++++++++++++++++ 2 files changed, 20 insertions(+) (limited to 'indra') diff --git a/indra/CMakeLists.txt b/indra/CMakeLists.txt index 205ce402a0..52e6749c72 100644 --- a/indra/CMakeLists.txt +++ b/indra/CMakeLists.txt @@ -24,6 +24,10 @@ if( USE_CONAN ) set( USE_AUTOBUILD_3P OFF ) conan_basic_setup(TARGETS NO_OUTPUT_DIRS) add_compile_definitions(LL_USESYSTEMLIBS USE_CONAN NO_AUTOBUILD_3P) +elseif( USESYSTEMLIBS ) + set( USE_CONAN OFF ) + set( USE_AUTOBUILD_3P OFF ) + add_compile_definitions(LL_USESYSTEMLIBS) else() set( USE_CONAN OFF ) set( USE_AUTOBUILD_3P ON ) diff --git a/indra/cmake/Prebuilt.cmake b/indra/cmake/Prebuilt.cmake index 634cc15c21..b0acae279b 100644 --- a/indra/cmake/Prebuilt.cmake +++ b/indra/cmake/Prebuilt.cmake @@ -67,6 +67,22 @@ macro ( use_system_binary package ) endif() endforeach() return() + elseif( NOT USE_AUTOBUILD_3P ) + include(FindPkgConfig) + pkg_check_modules(${package} ${package}) + if( ${package}_FOUND ) + target_link_directories( ll::${package} INTERFACE ${${package}_LIBRARY_DIRS} ) + else() + pkg_check_modules(${package} lib${package}) + if( ${package}_FOUND ) + target_link_directories( ll::${package} INTERFACE ${${package}_LIBRARY_DIRS} ) + else() + find_package( ${package} REQUIRED ) + endif() + endif() + target_include_directories( ll::${package} SYSTEM INTERFACE ${${package}_INCLUDE_DIRS} ) + target_link_libraries( ll::${package} INTERFACE ${${package}_LIBRARIES} ) + return() endif() endmacro() -- cgit v1.2.3 From 351f8d2162e57751f9a4d0d47655a861ac2b37ad Mon Sep 17 00:00:00 2001 From: Erik Kundiman Date: Mon, 10 Jul 2023 17:58:14 +0800 Subject: Fix PKG_CONFIG_MULTI_GUESS value It was set to the same value as PKG_CONFIG_MULTI_LOCAL_GUESS before. That's why it couldn't find any package installed by the package manager on a GNU/Linux distro. --- indra/cmake/ConfigurePkgConfig.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'indra') diff --git a/indra/cmake/ConfigurePkgConfig.cmake b/indra/cmake/ConfigurePkgConfig.cmake index 55d865392e..a2d5b31e25 100644 --- a/indra/cmake/ConfigurePkgConfig.cmake +++ b/indra/cmake/ConfigurePkgConfig.cmake @@ -14,7 +14,7 @@ IF("$ENV{PKG_CONFIG_LIBDIR}" STREQUAL "") 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_GUESS /usr/lib/x86_64-linux-gnu) SET(PKG_CONFIG_MULTI_LOCAL_GUESS /usr/local/lib/x86_64-linux-gnu) endif (ADDRESS_SIZE EQUAL 32) -- cgit v1.2.3 From ce4362108a90033c5514a1d72230a6e91015f025 Mon Sep 17 00:00:00 2001 From: Erik Kundiman Date: Tue, 11 Jul 2023 10:41:11 +0800 Subject: OpenAL system lib flags by checking frealut module --- indra/cmake/OPENAL.cmake | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'indra') diff --git a/indra/cmake/OPENAL.cmake b/indra/cmake/OPENAL.cmake index 0b6a7c2853..cc7deac2d9 100644 --- a/indra/cmake/OPENAL.cmake +++ b/indra/cmake/OPENAL.cmake @@ -18,6 +18,17 @@ endif() if (USE_OPENAL) add_library( ll::openal INTERFACE IMPORTED ) + + if (NOT (USE_AUTOBUILD_3P OR USE_CONAN)) + target_compile_definitions( ll::openal INTERFACE LL_OPENAL=1) + include(FindPkgConfig) + pkg_check_modules(Openal REQUIRED freealut) + target_include_directories(ll::openal SYSTEM INTERFACE ${Openal_INCLUDE_DIRS}) + target_link_directories(ll::openal INTERFACE ${Openal_LIBRARY_DIRS}) + target_link_libraries(ll::openal INTERFACE ${Openal_LIBRARIES}) + return () + endif () + target_include_directories( ll::openal SYSTEM INTERFACE "${LIBS_PREBUILT_DIR}/include/AL") target_compile_definitions( ll::openal INTERFACE LL_OPENAL=1) use_prebuilt_binary(openal) -- cgit v1.2.3 From 066f6d400b7438575075f785ca8e93e435dc4029 Mon Sep 17 00:00:00 2001 From: Erik Kundiman Date: Tue, 11 Jul 2023 10:57:18 +0800 Subject: Obtain APR required flags when using system libs On some platforms such as FreeBSD or MacPorts, pkg-config --libs apr-util-1 already includes -lapr-1. But on APT, the apr-1 module needs to be checked too. --- indra/cmake/APR.cmake | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'indra') diff --git a/indra/cmake/APR.cmake b/indra/cmake/APR.cmake index 8a0939c92c..29efa634c1 100644 --- a/indra/cmake/APR.cmake +++ b/indra/cmake/APR.cmake @@ -5,6 +5,15 @@ include_guard() add_library( ll::apr INTERFACE IMPORTED ) +if (NOT (USE_AUTOBUILD_3P OR USE_CONAN)) + include(FindPkgConfig) + pkg_check_modules(Apr REQUIRED apr-1 apr-util-1) + target_include_directories(ll::apr SYSTEM INTERFACE ${Apr_INCLUDE_DIRS}) + target_link_directories(ll::apr INTERFACE ${Apr_LIBRARY_DIRS}) + target_link_libraries(ll::apr INTERFACE ${Apr_LIBRARIES}) + return () +endif () + use_system_binary( apr apr-util ) use_prebuilt_binary(apr_suite) -- cgit v1.2.3 From 7943a9e01ae970eaa39cabccda68501e47340688 Mon Sep 17 00:00:00 2001 From: Erik Kundiman Date: Tue, 11 Jul 2023 13:16:45 +0800 Subject: Obtain Boost include dir when using system libs The necessary linker flags to link the required Boost libraries are somehow not obtained from find_package. Passing boost_context, boost_fiber, or so on to find_package didn't help getting the linker flags either. Hence the manual listing of the Boost libraries to link. --- indra/cmake/Boost.cmake | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'indra') diff --git a/indra/cmake/Boost.cmake b/indra/cmake/Boost.cmake index 601a23a86d..0c5abd885c 100644 --- a/indra/cmake/Boost.cmake +++ b/indra/cmake/Boost.cmake @@ -8,6 +8,21 @@ if( USE_CONAN ) target_link_libraries( ll::boost INTERFACE CONAN_PKG::boost ) target_compile_definitions( ll::boost INTERFACE BOOST_ALLOW_DEPRECATED_HEADERS BOOST_BIND_GLOBAL_PLACEHOLDERS ) return() +elseif( NOT USE_AUTOBUILD_3P ) + find_package( Boost REQUIRED ) + target_compile_definitions( ll::boost INTERFACE BOOST_BIND_GLOBAL_PLACEHOLDERS ) + if (DARWIN) + set(sfx "-mt") + endif() + target_link_libraries( ll::boost INTERFACE + boost_context${sfx} + boost_fiber${sfx} + boost_filesystem${sfx} + boost_program_options${sfx} + boost_regex${sfx} + boost_system${sfx} + boost_thread${sfx}) + return() endif() use_prebuilt_binary(boost) -- cgit v1.2.3 From 9a3c16da3bd845964de4bc9dfe297bb3901ad84f Mon Sep 17 00:00:00 2001 From: Erik Kundiman Date: Tue, 11 Jul 2023 13:53:54 +0800 Subject: Only make sure there's xxHash when using sys libs --- indra/cmake/xxHash.cmake | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'indra') diff --git a/indra/cmake/xxHash.cmake b/indra/cmake/xxHash.cmake index a7c1cba62c..2dcab005ba 100644 --- a/indra/cmake/xxHash.cmake +++ b/indra/cmake/xxHash.cmake @@ -5,4 +5,11 @@ endif (XXHASH_CMAKE_INCLUDED) set (XXHASH_CMAKE_INCLUDED TRUE) include(Prebuilt) + +if (NOT (USE_AUTOBUILD_3P OR USE_CONAN)) + include(FindPkgConfig) + pkg_check_modules(Xxhash REQUIRED libxxhash) + return () +endif () + use_prebuilt_binary(xxhash) -- cgit v1.2.3 From f02ec9ba5df6c788399a28d57942485ca21529b7 Mon Sep 17 00:00:00 2001 From: Erik Kundiman Date: Tue, 11 Jul 2023 13:58:37 +0800 Subject: Keep using Zlib (no -ng) when using system libs Calls to zlib-ng in the viewer code aren't prefixed. And in order to build, the zlib-ng package needs to be configured with the ZLIB_COMPAT option on. Some package managers may not have provided the option on, or to turn that on, yet. --- indra/cmake/ZLIBNG.cmake | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'indra') diff --git a/indra/cmake/ZLIBNG.cmake b/indra/cmake/ZLIBNG.cmake index 5d99cd9709..60164116dd 100644 --- a/indra/cmake/ZLIBNG.cmake +++ b/indra/cmake/ZLIBNG.cmake @@ -8,6 +8,12 @@ add_library( ll::zlib-ng INTERFACE IMPORTED ) if(USE_CONAN ) target_link_libraries( ll::zlib-ng INTERFACE CONAN_PKG::zlib ) return() +elseif(NOT USE_AUTOBUILD_3P) + pkg_check_modules(Zlib REQUIRED zlib) + target_include_directories( ll::zlib-ng SYSTEM INTERFACE ${Zlib_INCLUDE_DIRS}) + target_link_directories( ll::zlib-ng INTERFACE ${Zlib_LIBRARY_DIRS} ) + target_link_libraries( ll::zlib-ng INTERFACE ${Zlib_LIBRARIES}) + return() endif() use_prebuilt_binary(zlib-ng) -- cgit v1.2.3 From 79b91a4ed2d826308e5dd2c9493efb449b380ff7 Mon Sep 17 00:00:00 2001 From: Erik Kundiman Date: Tue, 11 Jul 2023 14:28:24 +0800 Subject: Not use use_system_binary for system xmlrpc-epi The xmlrpc-epi package has no .pc or .cmake files. On some platforms, the header and the library directories don't have special paths. On GNU/Linux, at least on Debian, the headers are encapsulated in the packages's own directory. On macOS, both MacPorts & Homebrew don't have the package. On the other hand, Fink, that has the package, still doesn't support recent versions of macOS as of this writing. So it's very likely that on macOS, xmlrpc-epi is installed in /usr/local. --- indra/cmake/XmlRpcEpi.cmake | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'indra') diff --git a/indra/cmake/XmlRpcEpi.cmake b/indra/cmake/XmlRpcEpi.cmake index 6409f9d6e2..b7d2fa6ce6 100644 --- a/indra/cmake/XmlRpcEpi.cmake +++ b/indra/cmake/XmlRpcEpi.cmake @@ -4,8 +4,18 @@ include(Prebuilt) include_guard() add_library( ll::xmlrpc-epi INTERFACE IMPORTED ) +if (USE_AUTOBUILD_3P OR USE_CONAN) use_system_binary( xmlrpc-epi ) use_prebuilt_binary(xmlrpc-epi) +endif () + target_link_libraries(ll::xmlrpc-epi INTERFACE xmlrpc-epi ) + +if (USE_AUTOBUILD_3P OR USE_CONAN) target_include_directories( ll::xmlrpc-epi SYSTEM INTERFACE ${LIBS_PREBUILT_DIR}/include) +elseif (LINUX) +target_include_directories( ll::xmlrpc-epi SYSTEM INTERFACE /usr/include/xmlrpc-epi) +elseif (DARWIN) +target_link_directories( ll::xmlrpc-epi SYSTEM INTERFACE /usr/local/lib) +endif () -- cgit v1.2.3 From 78fc526400e253500f809e15b2da50061883d8c8 Mon Sep 17 00:00:00 2001 From: Erik Kundiman Date: Tue, 11 Jul 2023 15:53:04 +0800 Subject: Not use use_system_binary for system OpenSSL Some distros already include OpenSSL as part of the distribution, that OpenSSL may not be provided with its .pc files, even though they're available upstream. --- indra/cmake/OpenSSL.cmake | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'indra') diff --git a/indra/cmake/OpenSSL.cmake b/indra/cmake/OpenSSL.cmake index 3387c74f45..c9147f1d5e 100644 --- a/indra/cmake/OpenSSL.cmake +++ b/indra/cmake/OpenSSL.cmake @@ -4,8 +4,11 @@ include(Prebuilt) include_guard() add_library( ll::openssl INTERFACE IMPORTED ) +if (USE_AUTOBUILD_3P OR USE_CONAN) use_system_binary(openssl) use_prebuilt_binary(openssl) +endif () + if (WINDOWS) target_link_libraries(ll::openssl INTERFACE libssl libcrypto) elseif (LINUX) @@ -13,5 +16,6 @@ elseif (LINUX) else() target_link_libraries(ll::openssl INTERFACE ssl crypto) endif (WINDOWS) +if (USE_AUTOBUILD_3P OR USE_CONAN) target_include_directories( ll::openssl SYSTEM INTERFACE ${LIBS_PREBUILT_DIR}/include) - +endif () -- cgit v1.2.3 From b4d1301f272e707548f30f52671db76576273eaa Mon Sep 17 00:00:00 2001 From: Erik Kundiman Date: Tue, 11 Jul 2023 14:58:08 +0800 Subject: Not use use_system_binary for system GLH No package manager that I know of provide such package. So this one is expected to be installed in /usr/local/include. --- indra/cmake/GLH.cmake | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'indra') diff --git a/indra/cmake/GLH.cmake b/indra/cmake/GLH.cmake index 0cefc3543a..49c4e3b37a 100644 --- a/indra/cmake/GLH.cmake +++ b/indra/cmake/GLH.cmake @@ -3,5 +3,10 @@ include(Prebuilt) add_library( ll::glh_linear INTERFACE IMPORTED ) +if (NOT (USE_AUTOBUILD_3P OR USE_CONAN)) + target_include_directories( ll::glh_linear SYSTEM INTERFACE /usr/local/include ) + return () +endif () + use_system_binary( glh_linear ) use_prebuilt_binary(glh_linear) -- cgit v1.2.3 From c718c518f86e3bd78bd71bbd07fbc626373bbe96 Mon Sep 17 00:00:00 2001 From: Erik Kundiman Date: Tue, 11 Jul 2023 15:45:07 +0800 Subject: Not use use_system_binary for system GLEXT for the same reason as GLH, but since the headers are expected to be installed in the same directory as GLH (and GLEXT.cmake includes GLH.cmake), we can skip any additional directory to look the headers for. --- indra/cmake/GLEXT.cmake | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'indra') diff --git a/indra/cmake/GLEXT.cmake b/indra/cmake/GLEXT.cmake index 434b6f0ee8..2e46d1bea8 100644 --- a/indra/cmake/GLEXT.cmake +++ b/indra/cmake/GLEXT.cmake @@ -3,6 +3,11 @@ include(Prebuilt) include(GLH) add_library( ll::glext INTERFACE IMPORTED ) + +if (NOT (USE_AUTOBUILD_3P OR USE_CONAN)) + return () +endif () + if (WINDOWS OR LINUX) use_system_binary(glext) use_prebuilt_binary(glext) -- cgit v1.2.3 From a763de1cfa21a184e0c941c5a3618125af366939 Mon Sep 17 00:00:00 2001 From: Erik Kundiman Date: Tue, 11 Jul 2023 16:29:26 +0800 Subject: No GoogleMock, AddBuildTest & Tut when no LL_TESTS --- indra/llcorehttp/CMakeLists.txt | 6 ++++++ indra/llimage/CMakeLists.txt | 4 ++++ indra/llmessage/CMakeLists.txt | 6 ++++++ 3 files changed, 16 insertions(+) (limited to 'indra') diff --git a/indra/llcorehttp/CMakeLists.txt b/indra/llcorehttp/CMakeLists.txt index 87796abd3c..4fda964eb6 100644 --- a/indra/llcorehttp/CMakeLists.txt +++ b/indra/llcorehttp/CMakeLists.txt @@ -3,15 +3,21 @@ project(llcorehttp) include(00-Common) +if (LL_TESTS) include(GoogleMock) +endif () include(CURL) include(OpenSSL) include(NGHTTP2) include(ZLIBNG) include(LLCoreHttp) +if (LL_TESTS) include(LLAddBuildTest) +endif () include(LLCommon) +if (LL_TESTS) include(Tut) +endif () include(bugsplat) set(llcorehttp_SOURCE_FILES diff --git a/indra/llimage/CMakeLists.txt b/indra/llimage/CMakeLists.txt index cc75c463bc..79f9565ed9 100644 --- a/indra/llimage/CMakeLists.txt +++ b/indra/llimage/CMakeLists.txt @@ -8,9 +8,13 @@ include(LLImage) include(JPEG) include(LLKDU) include(ZLIBNG) +if (LL_TESTS) include(LLAddBuildTest) +endif () include(bugsplat) +if (LL_TESTS) include(Tut) +endif () set(llimage_SOURCE_FILES llimagebmp.cpp diff --git a/indra/llmessage/CMakeLists.txt b/indra/llmessage/CMakeLists.txt index 4786956e85..2fef3cf15b 100644 --- a/indra/llmessage/CMakeLists.txt +++ b/indra/llmessage/CMakeLists.txt @@ -3,13 +3,19 @@ project(llmessage) include(00-Common) +if (LL_TESTS) include(GoogleMock) include(LLAddBuildTest) +endif () include(LLCommon) include(LLCoreHttp) +if (LL_TESTS) include(LLAddBuildTest) +endif () include(Python) +if (LL_TESTS) include(Tut) +endif () include(Python) include(JsonCpp) -- cgit v1.2.3 From 593e7199e2dece84584882ed90b5dcc0ffb4d52b Mon Sep 17 00:00:00 2001 From: Erik Kundiman Date: Tue, 11 Jul 2023 19:29:32 +0800 Subject: Obtain OpenJPEG flags when using system libs The module name to check with pkgconf is different, hence the special treatment. --- indra/cmake/OpenJPEG.cmake | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'indra') diff --git a/indra/cmake/OpenJPEG.cmake b/indra/cmake/OpenJPEG.cmake index c4aab2e9e5..3f86bfd025 100644 --- a/indra/cmake/OpenJPEG.cmake +++ b/indra/cmake/OpenJPEG.cmake @@ -4,6 +4,15 @@ include(Prebuilt) include_guard() add_library( ll::openjpeg INTERFACE IMPORTED ) +if (NOT (USE_AUTOBUILD_3P OR USE_CONAN)) + include(FindPkgConfig) + pkg_check_modules(Openjpeg REQUIRED libopenjp2) + target_include_directories(ll::openjpeg SYSTEM INTERFACE ${Openjpeg_INCLUDE_DIRS}) + target_link_directories(ll::openjpeg INTERFACE ${Openjpeg_LIBRARY_DIRS}) + target_link_libraries(ll::openjpeg INTERFACE ${Openjpeg_LIBRARIES}) + return () +endif () + use_system_binary(openjpeg) use_prebuilt_binary(openjpeg) -- cgit v1.2.3 From d7a2947c4f24726df622749fa45b9306d1ed43e8 Mon Sep 17 00:00:00 2001 From: Erik Kundiman Date: Tue, 11 Jul 2023 20:02:46 +0800 Subject: Obtain Meshoptimizer flags when using system libs The Meshoptimizer CMake files don't seem to be working right. On more than one platform, they always conclude the package as not found. Nevertheless, the library is typically installed in standard paths, that no special paths need to be included for Meshoptimizer to be found. Except on macOS (so far), as existing package managers don't have that package yet, hence the /usr/local/include addition. It's a safe path to include anyway on other un*x platforms. --- indra/cmake/Meshoptimizer.cmake | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'indra') diff --git a/indra/cmake/Meshoptimizer.cmake b/indra/cmake/Meshoptimizer.cmake index fd144d2b97..6cf8343dd6 100644 --- a/indra/cmake/Meshoptimizer.cmake +++ b/indra/cmake/Meshoptimizer.cmake @@ -6,6 +6,12 @@ include(Prebuilt) include_guard() add_library( ll::meshoptimizer INTERFACE IMPORTED ) +if (NOT (USE_AUTOBUILD_3P OR USE_CONAN)) + target_include_directories( ll::meshoptimizer SYSTEM INTERFACE /usr/local/include ) + target_link_libraries( ll::meshoptimizer INTERFACE meshoptimizer) + return () +endif () + use_system_binary(meshoptimizer) use_prebuilt_binary(meshoptimizer) -- cgit v1.2.3 From 45b9eed30320c6281efcfb748098a8789b15f15f Mon Sep 17 00:00:00 2001 From: Erik Kundiman Date: Tue, 11 Jul 2023 16:56:16 +0800 Subject: LL physics extensions stub Since the CMakeLists.txt includes some same .cmake files as the viewer, I think the project might as well be a part of the Linden libraries code. And for now is put under llprimitive (might not be consistent, in fact the opposite, with they way llplugin relates to slplugin), but I think this way results the least change, and it still works. The differences include: - all files (common llphysicsextensions headers to be included by library users and the stub implementation files) are put inside one directory, and the CMakeLists.txt is adjusted accordingly; - modernised CMakeLists.txt, so include_directories are now implied by target_link_libraries; - some file name fix; - add_library is not explicitly set to STATIC; --- indra/cmake/LLPhysicsExtensions.cmake | 3 + indra/llprimitive/CMakeLists.txt | 4 + .../llprimitive/llphysicsextensions/CMakeLists.txt | 86 ++++++++ .../LLConvexDecompositionStubImpl.cpp | 143 +++++++++++++ .../LLConvexDecompositionStubImpl.h | 92 ++++++++ .../llphysicsextensions/LLPathingLibStubImpl.cpp | 107 ++++++++++ .../llphysicsextensions/LLPathingLibStubImpl.h | 78 +++++++ .../LLPhysicsExtensionsStubImpl.cpp | 49 +++++ .../LLPhysicsExtensionsStubImpl.h | 46 ++++ .../llphysicsextensions/llconvexdecomposition.cpp | 102 +++++++++ .../llphysicsextensions/llconvexdecomposition.h | 231 +++++++++++++++++++++ .../llphysicsextensions/llpathinglib.cpp | 110 ++++++++++ .../llprimitive/llphysicsextensions/llpathinglib.h | 187 +++++++++++++++++ .../llphysicsextensions/llphysicsextensions.cpp | 103 +++++++++ .../llphysicsextensions/llphysicsextensions.h | 59 ++++++ indra/newview/CMakeLists.txt | 4 +- 16 files changed, 1402 insertions(+), 2 deletions(-) create mode 100644 indra/llprimitive/llphysicsextensions/CMakeLists.txt create mode 100644 indra/llprimitive/llphysicsextensions/LLConvexDecompositionStubImpl.cpp create mode 100644 indra/llprimitive/llphysicsextensions/LLConvexDecompositionStubImpl.h create mode 100644 indra/llprimitive/llphysicsextensions/LLPathingLibStubImpl.cpp create mode 100644 indra/llprimitive/llphysicsextensions/LLPathingLibStubImpl.h create mode 100644 indra/llprimitive/llphysicsextensions/LLPhysicsExtensionsStubImpl.cpp create mode 100644 indra/llprimitive/llphysicsextensions/LLPhysicsExtensionsStubImpl.h create mode 100644 indra/llprimitive/llphysicsextensions/llconvexdecomposition.cpp create mode 100644 indra/llprimitive/llphysicsextensions/llconvexdecomposition.h create mode 100644 indra/llprimitive/llphysicsextensions/llpathinglib.cpp create mode 100644 indra/llprimitive/llphysicsextensions/llpathinglib.h create mode 100644 indra/llprimitive/llphysicsextensions/llphysicsextensions.cpp create mode 100644 indra/llprimitive/llphysicsextensions/llphysicsextensions.h (limited to 'indra') diff --git a/indra/cmake/LLPhysicsExtensions.cmake b/indra/cmake/LLPhysicsExtensions.cmake index 36821447c9..b2151dc781 100644 --- a/indra/cmake/LLPhysicsExtensions.cmake +++ b/indra/cmake/LLPhysicsExtensions.cmake @@ -26,6 +26,9 @@ if (HAVOK) elseif (HAVOK_TPV) use_prebuilt_binary(llphysicsextensions_tpv) target_link_libraries( llphysicsextensions_impl INTERFACE llphysicsextensions_tpv) +elseif (NOT (USE_AUTOBUILD_3P OR USE_CONAN)) + target_link_libraries( llphysicsextensions_impl INTERFACE llphysicsextensionsstub) + return () else (HAVOK) use_prebuilt_binary(llphysicsextensions_stub) set(LLPHYSICSEXTENSIONS_SRC_DIR ${LIBS_PREBUILT_DIR}/llphysicsextensions/stub) diff --git a/indra/llprimitive/CMakeLists.txt b/indra/llprimitive/CMakeLists.txt index d69cd958a0..b6e8773d03 100644 --- a/indra/llprimitive/CMakeLists.txt +++ b/indra/llprimitive/CMakeLists.txt @@ -66,6 +66,10 @@ target_link_libraries(llprimitive ll::glh_linear ) +if (NOT (USE_AUTOBUILD_3P OR USE_CONAN)) + add_subdirectory(llphysicsextensions) +endif () + #add unit tests if (LL_TESTS) INCLUDE(LLAddBuildTest) diff --git a/indra/llprimitive/llphysicsextensions/CMakeLists.txt b/indra/llprimitive/llphysicsextensions/CMakeLists.txt new file mode 100644 index 0000000000..c950fc6560 --- /dev/null +++ b/indra/llprimitive/llphysicsextensions/CMakeLists.txt @@ -0,0 +1,86 @@ +# -*- cmake -*- + +project(llphysicsextensions) + +include(00-Common) +include(Variables) +include(LLCommon) +include(LLMath) + +set(LLPHYSICSEXTENSIONS_LIB_NAME llphysicsextensions) + +if (WINDOWS) + set(LLPHYSICSEXTENSIONS_LIBRARIES ${LLPHYSICSEXTENSIONS_LIB_NAME}.lib) +else (WINDOWS) + set(LLPHYSICSEXTENSIONS_LIBRARIES ${LLPHYSICSEXTENSIONS_LIB_NAME}.a) +endif (WINDOWS) + +set(LLPHYSICSEXTENSIONS_INCLUDE_DIR + ${CMAKE_CURRENT_SOURCE_DIR}) + +set(LLPHYSICSEXTENSIONS_DEBUG_LIBRARY_PATH ${LIBS_PREBUILT_DIR}/lib/debug) +set(LLPHYSICSEXTENSIONS_RELEASE_LIBRARY_PATH ${LIBS_PREBUILT_DIR}/lib/release) + +#set(LLPHYSICSEXTENSIONS_LIBRARIES_LIBRARIES +# debug ${LLPHYSICSEXTENSIONS_DEBUG_LIB} +# optimized ${LLPHYSICSEXTENTIONS_RELEASE_LIB} +#) + +if (LINUX) + list(INSERT LLPHYSICSEXTENSIONS_LIBRARIES 0 -Wl,--start-group) + list(APPEND LLPHYSICSEXTENSIONS_LIBRARIES -Wl,--end-group) +endif (LINUX) + +#include_directories( +# ${CMAKE_SOURCE_DIR}/llphysicsextensions +# ${LLPHYSICSEXTENSIONS_INCLUDE_DIR} +# ${LLCOMMON_INCLUDE_DIRS} +# ${LLMATH_INCLUDE_DIRS} +# ) + +set(llphysicsextensions_SOURCE_FILES + llpathinglib.cpp + LLPathingLibStubImpl.cpp + llconvexdecomposition.cpp + LLConvexDecompositionStubImpl.cpp + llphysicsextensions.cpp + LLPhysicsExtensionsStubImpl.cpp + ) + +set(llphysicsextensions_HEADER_FILES + + ${LLPHYSICSEXTENSIONS_INCLUDE_DIR}/llpathinglib.h + ${LLPHYSICSEXTENSIONS_INCLUDE_DIR}/llconvexdecomposition.h + ${LLPHYSICSEXTENSIONS_INCLUDE_DIR}/llphysicsextensions.h + LLPathingLibStubImpl.h + LLConvexDecompositionStubImpl.h + LLPhysicsExtensionsStubImpl.h + ) + +if (WINDOWS) + list(APPEND llphysicsextensions_HEADER_FILES + ${LLPHYSICSEXTENSIONS_INCLUDE_DIR}/windowsincludes.h) +endif (WINDOWS) + +set_source_files_properties(${llphysicsextensions_HEADER_FILES} + PROPERTIES HEADER_FILE_ONLY TRUE) + +# some of the include files contain compile-time switches based on these +set_source_files_properties(${llphysicsextensions_SOURCE_FILES} + PROPERTIES COMPILE_DEFINITIONS "LL_PATHING_LIB_STUB;LL_CONVEX_DECOMP_STUB;LL_PHYSICS_EXTENSIONS_STUB") + +list(APPEND llphysicsextensionsstub_SOURCE_FILES ${llphysicsextensions_HEADER_FILES}) + +add_library(${PROJECT_NAME}stub ${${PROJECT_NAME}_SOURCE_FILES}) +target_include_directories(${PROJECT_NAME}stub INTERFACE ${CMAKE_CURRENT_SOURCE_DIR}) +target_link_libraries(${PROJECT_NAME}stub llmath llcommon) + +if (LINUX) + IF(CMAKE_BUILD_TYPE MATCHES Release) + SET(LIBRARY_OUTPUT_PATH ${PROJECT_BINARY_DIR}/release) + ENDIF(CMAKE_BUILD_TYPE MATCHES Release) + IF(CMAKE_BUILD_TYPE MATCHES Debug) + SET(LIBRARY_OUTPUT_PATH ${PROJECT_BINARY_DIR}/debug) + ENDIF(CMAKE_BUILD_TYPE MATCHES Debug) + +endif (LINUX) diff --git a/indra/llprimitive/llphysicsextensions/LLConvexDecompositionStubImpl.cpp b/indra/llprimitive/llphysicsextensions/LLConvexDecompositionStubImpl.cpp new file mode 100644 index 0000000000..b1214a7f31 --- /dev/null +++ b/indra/llprimitive/llphysicsextensions/LLConvexDecompositionStubImpl.cpp @@ -0,0 +1,143 @@ +/** +* @file LLConvexDecompositionStubImpl.cpp +* @author falcon@lindenlab.com +* @brief A stub implementation of LLConvexDecomposition +* +* $LicenseInfo:firstyear=2011&license=viewerlgpl$ +* Second Life Viewer Source Code +* Copyright (C) 20112010, 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 "LLConvexDecompositionStubImpl.h" + +LLConvexDecomposition* LLConvexDecompositionImpl::getInstance() +{ + return NULL; +} + +LLCDResult LLConvexDecompositionImpl::initSystem() +{ + return LLCD_NOT_IMPLEMENTED; +} + +LLCDResult LLConvexDecompositionImpl::initThread() +{ + return LLCD_NOT_IMPLEMENTED; +} + +LLCDResult LLConvexDecompositionImpl::quitThread() +{ + return LLCD_NOT_IMPLEMENTED; +} + +LLCDResult LLConvexDecompositionImpl::quitSystem() +{ + return LLCD_NOT_IMPLEMENTED; +} + +void LLConvexDecompositionImpl::genDecomposition(int& decomp) +{ + decomp = -1; +} + +void LLConvexDecompositionImpl::deleteDecomposition(int decomp) +{ + +} + +void LLConvexDecompositionImpl::bindDecomposition(int decomp) +{ + +} + +LLCDResult LLConvexDecompositionImpl::setParam(const char* name, float val) +{ + return LLCD_NOT_IMPLEMENTED; +} + +LLCDResult LLConvexDecompositionImpl::setParam(const char* name, bool val) +{ + return LLCD_NOT_IMPLEMENTED; +} + +LLCDResult LLConvexDecompositionImpl::setParam(const char* name, int val) +{ + return LLCD_NOT_IMPLEMENTED; +} + +LLCDResult LLConvexDecompositionImpl::setMeshData( const LLCDMeshData* data, bool vertex_based ) +{ + return LLCD_NOT_IMPLEMENTED; +} + +LLCDResult LLConvexDecompositionImpl::registerCallback(int stage, llcdCallbackFunc callback ) +{ + return LLCD_NOT_IMPLEMENTED; +} + +LLCDResult LLConvexDecompositionImpl::executeStage(int stage) +{ + return LLCD_NOT_IMPLEMENTED; +} + +int LLConvexDecompositionImpl::getNumHullsFromStage(int stage) +{ + return 0; +} + +LLCDResult LLConvexDecompositionImpl::getSingleHull( LLCDHull* hullOut ) +{ + memset( hullOut, 0, sizeof(LLCDHull) ); + return LLCD_NOT_IMPLEMENTED; +} + +LLCDResult LLConvexDecompositionImpl::getHullFromStage( int stage, int hull, LLCDHull* hullOut ) +{ + memset( hullOut, 0, sizeof(LLCDHull) ); + return LLCD_NOT_IMPLEMENTED; +} + +LLCDResult LLConvexDecompositionImpl::getMeshFromStage( int stage, int hull, LLCDMeshData* meshDataOut ) +{ + memset( meshDataOut, 0, sizeof(LLCDMeshData) ); + return LLCD_NOT_IMPLEMENTED; +} + +LLCDResult LLConvexDecompositionImpl::getMeshFromHull( LLCDHull* hullIn, LLCDMeshData* meshOut ) +{ + memset( meshOut, 0, sizeof(LLCDMeshData) ); + return LLCD_NOT_IMPLEMENTED; +} + +LLCDResult LLConvexDecompositionImpl::generateSingleHullMeshFromMesh(LLCDMeshData* meshIn, LLCDMeshData* meshOut) +{ + memset( meshOut, 0, sizeof(LLCDMeshData) ); + return LLCD_NOT_IMPLEMENTED; +} + +void LLConvexDecompositionImpl::loadMeshData(const char* fileIn, LLCDMeshData** meshDataOut) +{ + static LLCDMeshData meshData; + memset( &meshData, 0, sizeof(LLCDMeshData) ); + *meshDataOut = &meshData; +} + diff --git a/indra/llprimitive/llphysicsextensions/LLConvexDecompositionStubImpl.h b/indra/llprimitive/llphysicsextensions/LLConvexDecompositionStubImpl.h new file mode 100644 index 0000000000..9ae879efb4 --- /dev/null +++ b/indra/llprimitive/llphysicsextensions/LLConvexDecompositionStubImpl.h @@ -0,0 +1,92 @@ +/** +* @file LLConvexDecompositionStubImpl.h +* @author falcon@lindenlab.com +* @brief A stub implementation of LLConvexDecomposition +* +* $LicenseInfo:firstyear=2011&license=viewerlgpl$ +* Second Life Viewer Source Code +* Copyright (C) 20112010, 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_CONVEX_DECOMP_UTIL_H +#define LL_CONVEX_DECOMP_UTIL_H + +#include "llconvexdecomposition.h" + +class LLConvexDecompositionImpl : public LLConvexDecomposition +{ + public: + + virtual ~LLConvexDecompositionImpl() {} + + static LLConvexDecomposition* getInstance(); + static LLCDResult initSystem(); + static LLCDResult initThread(); + static LLCDResult quitThread(); + static LLCDResult quitSystem(); + + void genDecomposition(int& decomp); + void deleteDecomposition(int decomp); + void bindDecomposition(int decomp); + + // Sets *paramsOut to the address of the LLCDParam array and returns + // the length of the array + int getParameters(const LLCDParam** paramsOut) + { + *paramsOut = NULL; + return 0; + } + + int getStages(const LLCDStageData** stagesOut) + { + *stagesOut = NULL; + return 0; + } + + // Set a parameter by name. Returns false if out of bounds or unsupported parameter + LLCDResult setParam(const char* name, float val); + LLCDResult setParam(const char* name, int val); + LLCDResult setParam(const char* name, bool val); + LLCDResult setMeshData( const LLCDMeshData* data, bool vertex_based ); + LLCDResult registerCallback(int stage, llcdCallbackFunc callback ); + + LLCDResult executeStage(int stage); + + int getNumHullsFromStage(int stage); + + LLCDResult getHullFromStage( int stage, int hull, LLCDHull* hullOut ); + LLCDResult getSingleHull( LLCDHull* hullOut ) ; + + // TODO: Implement lock of some kind to disallow this call if data not yet ready + LLCDResult getMeshFromStage( int stage, int hull, LLCDMeshData* meshDataOut); + LLCDResult getMeshFromHull( LLCDHull* hullIn, LLCDMeshData* meshOut ); + + // For visualizing convex hull shapes in the viewer physics shape display + LLCDResult generateSingleHullMeshFromMesh( LLCDMeshData* meshIn, LLCDMeshData* meshOut); + + /// Debug + void loadMeshData(const char* fileIn, LLCDMeshData** meshDataOut); + + private: + LLConvexDecompositionImpl() {} +}; + +#endif //LL_CONVEX_DECOMP_UTIL_H + diff --git a/indra/llprimitive/llphysicsextensions/LLPathingLibStubImpl.cpp b/indra/llprimitive/llphysicsextensions/LLPathingLibStubImpl.cpp new file mode 100644 index 0000000000..8ad13532f2 --- /dev/null +++ b/indra/llprimitive/llphysicsextensions/LLPathingLibStubImpl.cpp @@ -0,0 +1,107 @@ +/** +* @file LLPathingLibStubImpl.cpp +* @author prep@lindenlab.com +* @brief A stubbed implementation of LLPathingLib +* +* $LicenseInfo:firstyear=2012&license=viewerlgpl$ +* Second Life Viewer Source Code +* Copyright (C) 20112010, 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 "llpathinglib.h" +#include "LLPathingLibStubImpl.h" + +#include "llsd.h" + +//============================================================================= +LLPathingLibImpl::LLPathingLibImpl() +{ +} + +LLPathingLibImpl::~LLPathingLibImpl() +{ + +} + +LLPathingLib* LLPathingLibImpl::getInstance() +{ + return NULL; +} + + +LLPathingLib::LLPLResult LLPathingLibImpl::initSystem() +{ + return LLPL_NOT_IMPLEMENTED; +} + +LLPathingLib::LLPLResult LLPathingLibImpl::quitSystem() +{ + return LLPL_NOT_IMPLEMENTED; +} + +LLPathingLib::LLPLResult LLPathingLibImpl::extractNavMeshSrcFromLLSD( const LLSD::Binary& dataBlock, int dir ) +{ + return LLPL_NOT_IMPLEMENTED; +} + +void LLPathingLibImpl::processNavMeshData() +{ +} + +LLPathingLibImpl::LLPLResult LLPathingLibImpl::generatePath( const PathingPacket& pathingPacket ) +{ + return LLPL_NOT_IMPLEMENTED; +} + +void LLPathingLibImpl::setNavMeshMaterialType( LLPLCharacterType materialType ) +{ +} + +void LLPathingLibImpl::setNavMeshColors( const NavMeshColors& color ) +{ +} + +void LLPathingLibImpl::renderNavMesh() +{ +} + +void LLPathingLibImpl::renderNavMeshEdges() +{ +} + +void LLPathingLibImpl::renderNavMeshShapesVBO( U32 shapeRenderFlags ) +{ +} + +void LLPathingLibImpl::renderPath() +{ +} + +void LLPathingLibImpl::renderPathBookend( LLRender& gl, LLPathingLib::LLPLPathBookEnd type ) +{ +} + +void LLPathingLibImpl::cleanupVBOManager() +{ +} + +void LLPathingLibImpl::cleanupResidual() +{ +} diff --git a/indra/llprimitive/llphysicsextensions/LLPathingLibStubImpl.h b/indra/llprimitive/llphysicsextensions/LLPathingLibStubImpl.h new file mode 100644 index 0000000000..75fdb3fa0f --- /dev/null +++ b/indra/llprimitive/llphysicsextensions/LLPathingLibStubImpl.h @@ -0,0 +1,78 @@ +/** +* @file LLPathingLibSubImpl.h +* @author prep@lindenlab.com +* @brief A stubbed implementation of LLPathingLib +* +* $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_PATHING_LIB_H +#define LL_PATHING_LIB_H + +#include "llpathinglib.h" + +class LLSD; + +//============================================================================= +class LLPathingLibImpl : public LLPathingLib +{ +public: + LLPathingLibImpl(); + virtual ~LLPathingLibImpl(); + + // Obtain a pointer to the actual implementation + static LLPathingLib* getInstance(); + static LLPathingLib::LLPLResult initSystem(); + static LLPathingLib::LLPLResult quitSystem(); + + //Extract and store navmesh data from the llsd datablock sent down by the server + virtual LLPLResult extractNavMeshSrcFromLLSD( const LLSD::Binary& dataBlock, int dir ); + //Stitch any stored navmeshes together + virtual void processNavMeshData(); + + //Method used to generate and visualize a path on the viewers navmesh + virtual LLPLResult generatePath( const PathingPacket& pathingPacket ); + + //Set the material type for the heatmap type + virtual void setNavMeshMaterialType( LLPLCharacterType materialType ); + //Set the various navmesh colors + virtual void setNavMeshColors( const NavMeshColors& color ); + + //The entry method to rendering the client side navmesh + virtual void renderNavMesh(); + //The entry method to rendering the client side navmesh edges + virtual void renderNavMeshEdges(); + //The entry method to render the client navmesh shapes VBO + virtual void renderNavMeshShapesVBO( U32 shapeRenderFlags ); + //The entry method to render the clients designated path + virtual void renderPath(); + //The entry method to render the capsule bookends for the clients designated path + virtual void renderPathBookend( LLRender& gl, LLPathingLib::LLPLPathBookEnd type ); + + //Method to delete any vbo's that are currently being managed by the pathing library + virtual void cleanupVBOManager(); + //Method to cleanup any allocations within the implementation + virtual void cleanupResidual(); +}; + +#endif //LL_PATHING_LIB_H + diff --git a/indra/llprimitive/llphysicsextensions/LLPhysicsExtensionsStubImpl.cpp b/indra/llprimitive/llphysicsextensions/LLPhysicsExtensionsStubImpl.cpp new file mode 100644 index 0000000000..2c432f94e3 --- /dev/null +++ b/indra/llprimitive/llphysicsextensions/LLPhysicsExtensionsStubImpl.cpp @@ -0,0 +1,49 @@ +/** +* @file LLPhysicsExtensionsStubImpl.cpp +* @author prep@lindenlab.com +* @brief A stubbed implementation of LLPhysicsExtensions +* +* $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 "llphysicsextensions.h" +#include "LLPhysicsExtensionsStubImpl.h" + +//============================================================================= +LLPhysicsExtensionsImpl::LLPhysicsExtensionsImpl() +{ +} + +LLPhysicsExtensionsImpl::~LLPhysicsExtensionsImpl() +{ +} + +bool LLPhysicsExtensionsImpl::initSystem() +{ + return false; +} + +bool LLPhysicsExtensionsImpl::quitSystem() +{ + return false; +} + diff --git a/indra/llprimitive/llphysicsextensions/LLPhysicsExtensionsStubImpl.h b/indra/llprimitive/llphysicsextensions/LLPhysicsExtensionsStubImpl.h new file mode 100644 index 0000000000..ac14da1ac3 --- /dev/null +++ b/indra/llprimitive/llphysicsextensions/LLPhysicsExtensionsStubImpl.h @@ -0,0 +1,46 @@ +/** +* @file LLPhysicsExtensionsSubImpl.h +* @author prep@lindenlab.com +* @brief A stubbed implementation of LLPhysicsExtensions +* +* $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_PHYSICS_EXTENSIONS_STUB_IMPL_H +#define LL_PHYSICS_EXTENSIONS_STUB_IMPL_H + +#include "llphysicsextensions.h" + +//============================================================================= +class LLPhysicsExtensionsImpl : public LLPhysicsExtensions +{ + public: + + LLPhysicsExtensionsImpl(); + virtual ~LLPhysicsExtensionsImpl(); + + static bool initSystem(); + static bool quitSystem(); +}; + +#endif //LL_PHYSICS_EXTENSIONS_STUB_IMPL_H + diff --git a/indra/llprimitive/llphysicsextensions/llconvexdecomposition.cpp b/indra/llprimitive/llphysicsextensions/llconvexdecomposition.cpp new file mode 100644 index 0000000000..f7caf7f676 --- /dev/null +++ b/indra/llprimitive/llphysicsextensions/llconvexdecomposition.cpp @@ -0,0 +1,102 @@ +/** +* @file llconvexdecomposition.cpp +* @author falcon@lindenlab.com +* @brief A Havok implementation of LLConvexDecomposition interface +* +* $LicenseInfo:firstyear=2011&license=lgpl$ +* Second Life Viewer Source Code +* Copyright (C) 2011, 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 defined(_WINDOWS) +# include "windowsincludes.h" +#endif + +#ifndef NULL +#define NULL 0 +#endif + +#if !defined(LL_CONVEX_DECOMP_STUB) +# include "LLConvexDecompositionImpl.h" +#else +# include "LLConvexDecompositionStubImpl.h" +#endif + +#include "llconvexdecomposition.h" + + +/*static */bool LLConvexDecomposition::s_isInitialized = false; + +/*static*/bool LLConvexDecomposition::isFunctional() +{ +#if !defined(LL_CONVEX_DECOMP_STUB) + return true; +#else + return false; +#endif +} + +#if !defined(LL_CONVEX_DECOMP_STUB) && defined(HK_COMPILER_CLANG) + //have to specialize before use so that generalized one not auto gen-d +HK_SINGLETON_SPECIALIZATION_DECL(LLConvexDecompositionImpl); +#endif + +/*static*/LLConvexDecomposition* LLConvexDecomposition::getInstance() +{ + if ( !s_isInitialized ) + { + return NULL; + } + else + { +#if !defined(LL_CONVEX_DECOMP_STUB) + return &hkSingleton::getInstance(); +#else + return LLConvexDecompositionImpl::getInstance(); +#endif + } +} + +/*static */LLCDResult LLConvexDecomposition::initSystem() +{ + LLCDResult result = LLConvexDecompositionImpl::initSystem(); + if ( result == LLCD_OK ) + { + s_isInitialized = true; + } + return result; +} + +/*static */LLCDResult LLConvexDecomposition::initThread() +{ + return LLConvexDecompositionImpl::initThread(); +} + +/*static */LLCDResult LLConvexDecomposition::quitThread() +{ + return LLConvexDecompositionImpl::quitThread(); +} + +/*static */LLCDResult LLConvexDecomposition::quitSystem() +{ + return LLConvexDecompositionImpl::quitSystem(); +} + + diff --git a/indra/llprimitive/llphysicsextensions/llconvexdecomposition.h b/indra/llprimitive/llphysicsextensions/llconvexdecomposition.h new file mode 100644 index 0000000000..10c6d55315 --- /dev/null +++ b/indra/llprimitive/llphysicsextensions/llconvexdecomposition.h @@ -0,0 +1,231 @@ +/** + * @file llconvexdecomposition.cpp + * @brief LLConvexDecomposition interface definition + * + * $LicenseInfo:firstyear=2011&license=lgpl$ + * Second Life Viewer Source Code + * Copyright (C) 2011, 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_CONVEX_DECOMPOSITION +#define LL_CONVEX_DECOMPOSITION + +typedef int bool32; + +#if defined(_WIN32) || defined(_WIN64) +#define LLCD_CALL __cdecl +#else +#define LLCD_CALL +#endif + +struct LLCDParam +{ + enum LLCDParamType + { + LLCD_INVALID = 0, + LLCD_INTEGER, + LLCD_FLOAT, + LLCD_BOOLEAN, + LLCD_ENUM + }; + + struct LLCDEnumItem + { + const char* mName; + int mValue; + }; + + union LLCDValue + { + float mFloat; + int mIntOrEnumValue; + bool32 mBool; + }; + + union LLCDParamDetails + { + struct { + LLCDValue mLow; + LLCDValue mHigh; + LLCDValue mDelta; + } mRange; + + struct { + int mNumEnums; + LLCDEnumItem* mEnumsArray; + } mEnumValues; + }; + + const char* mName; + const char* mDescription; + LLCDParamType mType; + LLCDParamDetails mDetails; + LLCDValue mDefault; + int mStage; + + // WARNING: Only the LLConvexDecomposition implementation + // should change this value + int mReserved; +}; + +struct LLCDStageData +{ + const char* mName; + const char* mDescription; + bool32 mSupportsCallback; +}; + +struct LLCDMeshData +{ + enum IndexType + { + INT_16, + INT_32 + }; + + const float* mVertexBase; + int mVertexStrideBytes; + int mNumVertices; + const void* mIndexBase; + IndexType mIndexType; + int mIndexStrideBytes; + int mNumTriangles; +}; + +struct LLCDHull +{ + const float* mVertexBase; + int mVertexStrideBytes; + int mNumVertices; +}; + +enum LLCDResult +{ + LLCD_OK = 0, + LLCD_UNKOWN_ERROR, + LLCD_NULL_PTR, + LLCD_INVALID_STAGE, + LLCD_UNKNOWN_PARAM, + LLCD_BAD_VALUE, + LLCD_REQUEST_OUT_OF_RANGE, + LLCD_INVALID_MESH_DATA, + LLCD_INVALID_HULL_DATA, + LLCD_STAGE_NOT_READY, + LLCD_INVALID_THREAD, + LLCD_NOT_IMPLEMENTED +}; + +// This callback will receive a string describing the current subtask being performed +// as well as a pair of numbers indicating progress. (The values should not be interpreted +// as a completion percentage as 'current' may be greater than 'final'.) +// If the callback returns zero, the decomposition will be terminated +typedef int (LLCD_CALL *llcdCallbackFunc)(const char* description, int current, int final); + +class LLConvexDecomposition +{ +public: + // Obtain a pointer to the actual implementation + static LLConvexDecomposition* getInstance(); + + /// @returns false if this is the stub + static bool isFunctional(); + + static LLCDResult initSystem(); + static LLCDResult initThread(); + static LLCDResult quitThread(); + static LLCDResult quitSystem(); + + // Generate a decomposition object handle + virtual void genDecomposition(int& decomp) = 0; + // Delete decomposition object handle + virtual void deleteDecomposition(int decomp) = 0; + // Bind given decomposition handle + // Commands operate on currently bound decomposition + virtual void bindDecomposition(int decomp) = 0; + + // Sets *paramsOut to the address of the LLCDParam array and returns + // the number of parameters + virtual int getParameters(const LLCDParam** paramsOut) = 0; + + + // Sets *stagesOut to the address of the LLCDStageData array and returns + // the number of stages + virtual int getStages(const LLCDStageData** stagesOut) = 0; + + + // Set a parameter by name. Pass enum values as integers. + virtual LLCDResult setParam(const char* name, float val) = 0; + virtual LLCDResult setParam(const char* name, int val) = 0; + virtual LLCDResult setParam(const char* name, bool val) = 0; + + + // Set incoming mesh data. Data is copied to local buffers and will + // persist until the next setMeshData call + virtual LLCDResult setMeshData( const LLCDMeshData* data, bool vertex_based ) = 0; + + + // Register a callback to be called periodically during the specified stage + // See the typedef above for more information + virtual LLCDResult registerCallback( int stage, llcdCallbackFunc callback ) = 0; + + + // Execute the specified decomposition stage + virtual LLCDResult executeStage(int stage) = 0; + virtual LLCDResult buildSingleHull() = 0 ; + + + // Gets the number of hulls generated by the specified decompositions stage + virtual int getNumHullsFromStage(int stage) = 0; + + + // Populates hullOut to reference the internal copy of the requested hull + // The data will persist only until the next executeStage call for that stage. + virtual LLCDResult getHullFromStage( int stage, int hull, LLCDHull* hullOut ) = 0; + + virtual LLCDResult getSingleHull( LLCDHull* hullOut ) = 0 ; + + + // TODO: Implement lock of some kind to disallow this call if data not yet ready + // Populates the meshDataOut to reference the utility's copy of the mesh geometry + // for the hull and stage specified. + // You must copy this data if you want to continue using it after the next executeStage + // call + virtual LLCDResult getMeshFromStage( int stage, int hull, LLCDMeshData* meshDataOut) = 0; + + + // Creates a mesh from hullIn and temporarily stores it internally in the utility. + // The mesh data persists only until the next call to getMeshFromHull + virtual LLCDResult getMeshFromHull( LLCDHull* hullIn, LLCDMeshData* meshOut ) = 0; + + // Takes meshIn, generates a single convex hull from it, converts that to a mesh + // stored internally, and populates meshOut to reference the internally stored data. + // The data is persistent only until the next call to generateSingleHullMeshFromMesh + virtual LLCDResult generateSingleHullMeshFromMesh( LLCDMeshData* meshIn, LLCDMeshData* meshOut) = 0; + + // + /// Debug + virtual void loadMeshData(const char* fileIn, LLCDMeshData** meshDataOut) = 0; + +private: + static bool s_isInitialized; +}; + +#endif //LL_CONVEX_DECOMPOSITION + diff --git a/indra/llprimitive/llphysicsextensions/llpathinglib.cpp b/indra/llprimitive/llphysicsextensions/llpathinglib.cpp new file mode 100644 index 0000000000..1a6017c4b8 --- /dev/null +++ b/indra/llprimitive/llphysicsextensions/llpathinglib.cpp @@ -0,0 +1,110 @@ +/** +* @file llpathinglib.cpp +* @author prep@lindenlab.com +* @brief LLPathingLib core creation methods +* +* $LicenseInfo:firstyear=2012&license=lgpl$ +* Second Life Viewer Source Code +* Copyright (C) 2011, 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 defined(_WINDOWS) +# include "windowsincludes.h" +#endif + +#ifndef NULL +#define NULL 0 +#endif + + +#if !defined(LL_PATHING_LIB_STUB) +# include "LLPathingLibImpl.h" +#else +# include "LLPathingLibStubImpl.h" +#endif + +#include "llpathinglib.h" + +//disable the undefined symbol optimization +//#pragma warning (disable : 4221) + +//============================================================================= + +/*static */bool LLPathingLib::s_isInitialized = false; + +//============================================================================= + + +/*static*/bool LLPathingLib::isFunctional() +{ +#if !defined(LL_PATHING_LIB_STUB) + return true; +#else + return false; +#endif +} + +#if !defined(LL_PATHING_LIB_STUB) && defined(HK_COMPILER_CLANG) + //have to specialize before use so that generalized one not auto gen-d +HK_SINGLETON_SPECIALIZATION_DECL(LLPathingLibImpl); +#endif + +/*static*/LLPathingLib* LLPathingLib::getInstance() +{ + if ( !s_isInitialized ) + { + return NULL; + } + else + { +#if !defined(LL_PATHING_LIB_STUB) + return &hkSingleton::getInstance(); +#else + return LLPathingLibImpl::getInstance(); +#endif + } +} + +//============================================================================= + +/*static */LLPathingLib::LLPLResult LLPathingLib::initSystem() +{ + if ( LLPathingLibImpl::initSystem() == LLPL_OK ) + { + s_isInitialized = true; + return LLPL_OK; + } + return LLPL_UNKOWN_ERROR; +} +//============================================================================= +/*static */LLPathingLib::LLPLResult LLPathingLib::quitSystem() +{ + LLPLResult quitResult = LLPL_UNKOWN_ERROR; + + if (s_isInitialized) + { + quitResult = LLPathingLibImpl::quitSystem(); + s_isInitialized = false; + } + + return quitResult; +} +//============================================================================= + diff --git a/indra/llprimitive/llphysicsextensions/llpathinglib.h b/indra/llprimitive/llphysicsextensions/llpathinglib.h new file mode 100644 index 0000000000..c8c7410797 --- /dev/null +++ b/indra/llprimitive/llphysicsextensions/llpathinglib.h @@ -0,0 +1,187 @@ +/** + * @file llpathinglib.cpp + * @author prep@lindenlab.com + * @brief LLPathingLib interface definition + * + * $LicenseInfo:firstyear=2012&license=lgpl$ + * Second Life Viewer Source Code + * Copyright (C) 2011, 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_PATHING_LIBRARY +#define LL_PATHING_LIBRARY + +#include "llpreprocessor.h" +#include "llsd.h" +#include "v3dmath.h" +#include "v4math.h" + +#include "v4color.h" +#include "v4coloru.h" +#include "llphysicsextensions.h" + +typedef int bool32; + +#if defined(_WIN32) || defined(_WIN64) +#define LLCD_CALL __cdecl +#else +#define LLCD_CALL +#endif + +class LLRender; + +//============================================================================= +class LLPathingLib +{ + +public: + enum LLShapeType + { + LLST_WalkableObjects = 0, + LLST_ObstacleObjects, + LLST_MaterialPhantoms, + LLST_ExclusionPhantoms, + LLST_MaxShapeTypes = LLST_ExclusionPhantoms+1, + LLST_None = LLST_MaxShapeTypes+2, + LLST_SimpleBox = LLST_None+1, + LLST_SimpleCapsule = LLST_SimpleBox+1, + }; + + enum LLShapeTypeFlag + { + LLSTB_WalkableObjects = 0x1 << 1, + LLSTB_ObstacleObjects = 0x1 << 2, + LLSTB_MaterialPhantoms = 0x1 << 3, + LLSTB_ExclusionPhantoms = 0x1 << 4, + LLSTB_None = 0x1 << 5 + }; + + enum LLPLPathBookEnd + { + LLPL_START = 0, + LLPL_END, + }; + + enum LLPLResult + { + LLPL_OK = 0, + LLPL_NOTSET, + LLPL_ERROR, + LLPL_NO_NAVMESH, + LLPL_UNKOWN_ERROR, + LLPL_NO_PATH, + LLPL_PATH_GENERATED_OK, + LLPL_NOT_IMPLEMENTED, + }; + + enum LLPLCharacterType + { + LLPL_CHARACTER_TYPE_A = 4, + LLPL_CHARACTER_TYPE_B = 3, + LLPL_CHARACTER_TYPE_C = 2, + LLPL_CHARACTER_TYPE_D = 1, + LLPL_CHARACTER_TYPE_NONE = 0 + }; + + struct PathingPacket + { + PathingPacket() : mHasPointA(false), mHasPointB(false), mCharacterWidth(0.0f), mCharacterType(LLPL_CHARACTER_TYPE_NONE) {} + bool mHasPointA; + LLVector3 mStartPointA; + LLVector3 mEndPointA; + bool mHasPointB; + LLVector3 mStartPointB; + LLVector3 mEndPointB; + F32 mCharacterWidth; + LLPLCharacterType mCharacterType; + }; + + struct NavMeshColors + { + LLColor4U mWalkable; + LLColor4U mObstacle; + LLColor4U mMaterial; + LLColor4U mExclusion; + LLColor4U mConnectedEdge; + LLColor4U mBoundaryEdge; + LLColor4 mHeatColorBase; + LLColor4 mHeatColorMax; + LLColor4U mFaceColor; + LLColor4U mStarValid; + LLColor4U mStarInvalid; + LLColor4U mTestPath; + LLColor4U mWaterColor; + }; + +public: + //Ctor + LLPathingLib() {} + virtual ~LLPathingLib() {} + + /// @returns false if this is the stub + static bool isFunctional(); + + // Obtain a pointer to the actual implementation + static LLPathingLib* getInstance(); + static LLPathingLib::LLPLResult initSystem(); + static LLPathingLib::LLPLResult quitSystem(); + + //Extract and store navmesh data from the llsd datablock sent down by the server + virtual LLPLResult extractNavMeshSrcFromLLSD( const LLSD::Binary& dataBlock, int dir ) = 0; + //Stitch any stored navmeshes together + virtual void processNavMeshData( ) = 0; + + //Method used to generate and visualize a path on the viewers navmesh + virtual LLPLResult generatePath( const PathingPacket& pathingPacket ) = 0; + + //Set the material type for the heatmap type + virtual void setNavMeshMaterialType( LLPLCharacterType materialType ) = 0; + //Set the various navmesh colors + virtual void setNavMeshColors( const NavMeshColors& color ) = 0; + + //The entry method to rendering the client side navmesh + virtual void renderNavMesh() = 0; + //The entry method to rendering the client side navmesh edges + virtual void renderNavMeshEdges() = 0; + //The entry method to render the client navmesh shapes VBO + virtual void renderNavMeshShapesVBO( U32 shapeRenderFlags ) = 0; + //The entry method to render the clients designated path + virtual void renderPath() = 0; + //The entry method to render the capsule bookends for the clients designated path + virtual void renderPathBookend( LLRender& gl, LLPathingLib::LLPLPathBookEnd type ) = 0; + //Renders all of the generated simple shapes (using their default transforms) + virtual void renderSimpleShapes( LLRender& gl, F32 regionsWaterHeight ) = 0; + + //Method called from second life to create a capsule from properties of a character + virtual void createPhysicsCapsuleRep( F32 length, F32 radius, BOOL horizontal, const LLUUID& id ) = 0; + //Removes any cached physics capsule using a list of cached uuids + virtual void cleanupPhysicsCapsuleRepResiduals() = 0; + //Renders a selected uuids physics rep + virtual void renderSimpleShapeCapsuleID( LLRender& gl, const LLUUID& id, const LLVector3& pos, const LLQuaternion& rot ) = 0; + + //Method to delete any vbo's that are currently being managed by the pathing library + virtual void cleanupVBOManager( ) = 0; + //Method to cleanup any allocations within the implementation + virtual void cleanupResidual( ) = 0; +private: + static bool s_isInitialized; +}; + +#endif //LL_PATHING_LIBRARY diff --git a/indra/llprimitive/llphysicsextensions/llphysicsextensions.cpp b/indra/llprimitive/llphysicsextensions/llphysicsextensions.cpp new file mode 100644 index 0000000000..9bb4522a23 --- /dev/null +++ b/indra/llprimitive/llphysicsextensions/llphysicsextensions.cpp @@ -0,0 +1,103 @@ +/** +* @file llphysicsextensions.cpp +* @author nyx@lindenlab.com +* @brief LLPhysicsExtensions core initialization methods +* +* $LicenseInfo:firstyear=2012&license=lgpl$ +* Second Life Viewer Source Code +* Copyright (C) 2011, 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 defined(_WINDOWS) +# include "windowsincludes.h" +#endif + +#ifndef NULL +#define NULL 0 +#endif + + +#include "llphysicsextensions.h" + +#if !defined(LL_PHYSICS_EXTENSIONS_STUB) +# include "LLPhysicsExtensionsImpl.h" +#else +# include "LLPhysicsExtensionsStubImpl.h" +#endif + + +//disable the undefined symbol optimization +//#pragma warning (disable : 4221) + +//============================================================================= + +/*static */bool LLPhysicsExtensions::s_isInitialized = false; + + +/*static*/bool LLPhysicsExtensions::isFunctional() +{ +#if !defined(LL_PHYSICS_EXTENSIONS_STUB) + return true; +#else + return false; +#endif +} + +//============================================================================= + +#if !defined(LL_PHYSICS_EXTENSIONS_STUB) && defined(HK_COMPILER_CLANG) + //have to specialize before use so that generalized one not auto gen-d +HK_SINGLETON_SPECIALIZATION_DECL(LLPhysicsExtensionsImpl); +#endif + +/*static*/LLPhysicsExtensions* LLPhysicsExtensions::getInstance() +{ + if ( !s_isInitialized ) + { + return NULL; + } + else + { +#if !defined(LL_PHYSICS_EXTENSIONS_STUB) + return &hkSingleton::getInstance(); +#else + return LLPhysicsExtensionsImpl::getInstance(); +#endif + } +} + +//============================================================================= + +/*static */bool LLPhysicsExtensions::initSystem() +{ + bool result = LLPhysicsExtensionsImpl::initSystem(); + if ( result ) + { + s_isInitialized = true; + } + return result; +} +//============================================================================= +/*static */bool LLPhysicsExtensions::quitSystem() +{ + return LLPhysicsExtensionsImpl::quitSystem(); +} +//============================================================================= + diff --git a/indra/llprimitive/llphysicsextensions/llphysicsextensions.h b/indra/llprimitive/llphysicsextensions/llphysicsextensions.h new file mode 100644 index 0000000000..be479f5d8a --- /dev/null +++ b/indra/llprimitive/llphysicsextensions/llphysicsextensions.h @@ -0,0 +1,59 @@ +/** +* @file llphysicsextensions.h +* @author nyx@lindenlab.com +* @brief LLPhysicsExtensions core shared initialization +* routines +* +* $LicenseInfo:firstyear=2012&license=lgpl$ +* Second Life Viewer Source Code +* Copyright (C) 2011, 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_PHYSICS_EXTENSIONS +#define LL_PHYSICS_EXTENSIONS + +#include "llpreprocessor.h" +#include "llsd.h" +#include "v3dmath.h" + +#define LLPHYSICSEXTENSIONS_VERSION "1.0" + +typedef int bool32; + +class LLPhysicsExtensions +{ + +public: + // Obtain a pointer to the actual implementation + static LLPhysicsExtensions* getInstance(); + + /// @returns false if this is the stub + static bool isFunctional(); + + static bool initSystem(); + static bool quitSystem(); + +private: + static bool s_isInitialized; +}; + +#endif //LL_PATHING_LIBRARY + + diff --git a/indra/newview/CMakeLists.txt b/indra/newview/CMakeLists.txt index dbd1f1b4ac..1c095ec548 100644 --- a/indra/newview/CMakeLists.txt +++ b/indra/newview/CMakeLists.txt @@ -47,7 +47,7 @@ include(ZLIBNG) include(URIPARSER) include(LLPrimitive) -if (NOT HAVOK_TPV) +if ((USE_AUTOBUILD_3P OR USE_CONAN) AND NOT HAVOK_TPV) # When using HAVOK_TPV, the library is precompiled, so no need for this # Stub and probably havok lib itself is a hack, autobuild loads a 3p that really is a source tarball @@ -68,7 +68,7 @@ if (NOT HAVOK_TPV) target_compile_options( llphysicsextensions PRIVATE -Wno-unused-local-typedef) endif (DARWIN) endif() -endif (NOT HAVOK_TPV) +endif ((USE_AUTOBUILD_3P OR USE_CONAN) AND NOT HAVOK_TPV) set(viewer_SOURCE_FILES -- cgit v1.2.3 From 16d30ec8b5a8bca3fac191d7bfe617a08913f803 Mon Sep 17 00:00:00 2001 From: Erik Kundiman Date: Tue, 11 Jul 2023 20:29:48 +0800 Subject: Obtain COLLADA DOM flags when using system libs There are also several additional flags from running pkgconf that we don't get from pkg_check_modules. At least 1 is needed later when compiling llprimitive. --- indra/cmake/LLPrimitive.cmake | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'indra') diff --git a/indra/cmake/LLPrimitive.cmake b/indra/cmake/LLPrimitive.cmake index 3d8499cbc3..387cae61d8 100644 --- a/indra/cmake/LLPrimitive.cmake +++ b/indra/cmake/LLPrimitive.cmake @@ -11,6 +11,16 @@ add_library( ll::minizip-ng INTERFACE IMPORTED ) add_library( ll::libxml INTERFACE IMPORTED ) add_library( ll::colladadom INTERFACE IMPORTED ) +if ( NOT (USE_AUTOBUILD_3P OR USE_CONAN) ) + include(FindPkgConfig) + pkg_check_modules(Colladadom REQUIRED collada-dom) + target_compile_definitions( ll::colladadom INTERFACE COLLADA_DOM_SUPPORT141 ) + target_include_directories( ll::colladadom SYSTEM INTERFACE ${Colladadom_INCLUDE_DIRS} ${Colladadom_INCLUDE_DIRS}/1.4 ) + target_link_directories( ll::colladadom INTERFACE ${Colladadom_LIBRARY_DIRS} ) + target_link_libraries( ll::colladadom INTERFACE ${Colladadom_LIBRARIES} ) + return () +endif () + # ND, needs fixup in collada conan pkg if( USE_CONAN ) target_include_directories( ll::colladadom SYSTEM INTERFACE -- cgit v1.2.3 From b2dbc73384ffcb65d3a50a4a38a367466ddb45ea Mon Sep 17 00:00:00 2001 From: Erik Kundiman Date: Tue, 11 Jul 2023 20:35:40 +0800 Subject: Obtain FreeType flags when using system libs The module name to check with pkgconf is different, hence the special treatment. --- indra/cmake/FreeType.cmake | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'indra') diff --git a/indra/cmake/FreeType.cmake b/indra/cmake/FreeType.cmake index 77140af641..fbf188d100 100644 --- a/indra/cmake/FreeType.cmake +++ b/indra/cmake/FreeType.cmake @@ -4,6 +4,15 @@ include(Prebuilt) include_guard() add_library( ll::freetype INTERFACE IMPORTED ) +if (NOT (USE_AUTOBUILD_3P OR USE_CONAN)) + include(FindPkgConfig) + pkg_check_modules(Freetype REQUIRED freetype2) + target_include_directories( ll::freetype SYSTEM INTERFACE ${Freetype_INCLUDE_DIRS} ) + target_link_directories( ll::freetype INTERFACE ${Freetype_LIBRARY_DIRS} ) + target_link_libraries( ll::freetype INTERFACE ${Freetype_LIBRARIES} ) + return () +endif () + use_system_binary(freetype) use_prebuilt_binary(freetype) target_include_directories( ll::freetype SYSTEM INTERFACE ${LIBS_PREBUILT_DIR}/include/freetype2/) -- cgit v1.2.3 From 2911d635af8b65de35a70f8f0fc176854cf1bdfb Mon Sep 17 00:00:00 2001 From: Erik Kundiman Date: Tue, 11 Jul 2023 18:42:41 +0800 Subject: Obtain GTK2 required flags when using system libs So far all of GTK2 dependencies flags, such as for Pango, Cairo, PNG16, etc., seem to be implied by checking the gtk+-2.0 module alone, at least on FreeBSD and Debian. --- indra/cmake/UI.cmake | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'indra') diff --git a/indra/cmake/UI.cmake b/indra/cmake/UI.cmake index 8b70192efc..1bb19e59a2 100644 --- a/indra/cmake/UI.cmake +++ b/indra/cmake/UI.cmake @@ -4,12 +4,19 @@ include(FreeType) add_library( ll::uilibraries INTERFACE IMPORTED ) -if (LINUX) +if (LINUX OR CMAKE_SYSTEM_NAME MATCHES "FreeBSD") 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() + elseif( NOT USE_AUTOBUILD_3P ) + include(FindPkgConfig) + pkg_check_modules(Gtk2 REQUIRED gtk+-2.0) + target_include_directories( ll::uilibraries SYSTEM INTERFACE ${Gtk2_INCLUDE_DIRS} ) + target_link_directories( ll::uilibraries INTERFACE ${Gtk2_LIBRARY_DIRS} ) + target_link_libraries( ll::uilibraries INTERFACE ${Gtk2_LIBRARIES} ) + return() endif() use_prebuilt_binary(gtk-atk-pango-glib) @@ -30,7 +37,7 @@ if (LINUX) Xinerama ll::freetype ) -endif (LINUX) +endif (LINUX OR CMAKE_SYSTEM_NAME MATCHES "FreeBSD") if( WINDOWS ) target_link_libraries( ll::uilibraries INTERFACE opengl32 -- cgit v1.2.3 From 2fc3845e1b23a1efd5666241a2d1cc78340d4b61 Mon Sep 17 00:00:00 2001 From: Erik Kundiman Date: Tue, 11 Jul 2023 18:54:50 +0800 Subject: Obtain FontConfig flags when using system libs and at the same time escape use_prebuilt_binary commands in the file. --- indra/cmake/ViewerMiscLibs.cmake | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'indra') diff --git a/indra/cmake/ViewerMiscLibs.cmake b/indra/cmake/ViewerMiscLibs.cmake index 00f8b77106..52128414c9 100644 --- a/indra/cmake/ViewerMiscLibs.cmake +++ b/indra/cmake/ViewerMiscLibs.cmake @@ -1,6 +1,12 @@ # -*- cmake -*- include(Prebuilt) +if (NOT (USE_AUTOBUILD_3P OR USE_CONAN)) + add_library( ll::fontconfig INTERFACE IMPORTED ) + use_system_binary(fontconfig) + return () +endif () + if (LINUX) #use_prebuilt_binary(libuuid) add_library( ll::fontconfig INTERFACE IMPORTED ) -- cgit v1.2.3 From 7360923f0888e48294921bd931c585c7c502a443 Mon Sep 17 00:00:00 2001 From: Erik Kundiman Date: Tue, 11 Jul 2023 19:19:55 +0800 Subject: Disable dictionaries when using system libs for now. Dictionaries should later be enabled when we have arrived at the point where everything has run well that the next stage would be the packaging for the distribution stage. --- indra/cmake/Hunspell.cmake | 2 ++ 1 file changed, 2 insertions(+) (limited to 'indra') diff --git a/indra/cmake/Hunspell.cmake b/indra/cmake/Hunspell.cmake index bb037c0237..96c75ad262 100644 --- a/indra/cmake/Hunspell.cmake +++ b/indra/cmake/Hunspell.cmake @@ -2,7 +2,9 @@ include(Prebuilt) include_guard() +if (USE_AUTOBUILD_3P OR USE_CONAN) use_prebuilt_binary(dictionaries) +endif () add_library( ll::hunspell INTERFACE IMPORTED ) use_system_binary(hunspell) -- cgit v1.2.3 From fed4d2186c2938b025394764ad59b38dc3cc01b9 Mon Sep 17 00:00:00 2001 From: Erik Kundiman Date: Wed, 12 Jul 2023 07:55:43 +0800 Subject: Disable JS packages when using system libs for now --- indra/newview/CMakeLists.txt | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'indra') diff --git a/indra/newview/CMakeLists.txt b/indra/newview/CMakeLists.txt index 1c095ec548..09807980b2 100644 --- a/indra/newview/CMakeLists.txt +++ b/indra/newview/CMakeLists.txt @@ -12,13 +12,17 @@ include(bugsplat) include(BuildPackagesInfo) include(BuildVersion) include(CMakeCopyIfDifferent) +if (USE_AUTOBUILD_3P OR USE_CONAN) include(CubemapToEquirectangularJS) +endif () include(DBusGlib) include(DragDrop) include(EXPAT) include(FMODSTUDIO) include(Hunspell) +if (USE_AUTOBUILD_3P OR USE_CONAN) include(JPEGEncoderBasic) +endif () include(JsonCpp) include(LLAppearance) include(LLAudio) @@ -37,7 +41,9 @@ include(OpenGL) include(OpenSSL) include(PNG) include(TemplateCheck) +if (USE_AUTOBUILD_3P OR USE_CONAN) include(ThreeJS) +endif () include(Tracy) include(UI) include(ViewerMiscLibs) -- cgit v1.2.3 From 8b7d24ade48335062d1cd93e1fd3dd58f5f02ee6 Mon Sep 17 00:00:00 2001 From: Erik Kundiman Date: Wed, 12 Jul 2023 09:52:32 +0800 Subject: Disable DBusGlib when using system libs It's deprecated anyway. --- indra/newview/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'indra') diff --git a/indra/newview/CMakeLists.txt b/indra/newview/CMakeLists.txt index 09807980b2..69b17bfa74 100644 --- a/indra/newview/CMakeLists.txt +++ b/indra/newview/CMakeLists.txt @@ -14,8 +14,8 @@ include(BuildVersion) include(CMakeCopyIfDifferent) if (USE_AUTOBUILD_3P OR USE_CONAN) include(CubemapToEquirectangularJS) -endif () include(DBusGlib) +endif () include(DragDrop) include(EXPAT) include(FMODSTUDIO) -- cgit v1.2.3 From 6690c177250445b747b6245fd45246b6992f4031 Mon Sep 17 00:00:00 2001 From: Erik Kundiman Date: Wed, 12 Jul 2023 09:53:09 +0800 Subject: Disable LLCA when using system libs for now --- indra/newview/CMakeLists.txt | 2 ++ 1 file changed, 2 insertions(+) (limited to 'indra') diff --git a/indra/newview/CMakeLists.txt b/indra/newview/CMakeLists.txt index 69b17bfa74..a1b82f47da 100644 --- a/indra/newview/CMakeLists.txt +++ b/indra/newview/CMakeLists.txt @@ -26,7 +26,9 @@ endif () include(JsonCpp) include(LLAppearance) include(LLAudio) +if (USE_AUTOBUILD_3P OR USE_CONAN) include(LLCA) +endif () include(LLCommon) include(LLCoreHttp) include(LLImage) -- cgit v1.2.3 From 088b508ddcb3c7934c400ff545a08d32e7ce1a40 Mon Sep 17 00:00:00 2001 From: Erik Kundiman Date: Wed, 12 Jul 2023 10:14:02 +0800 Subject: Disable viewer manager when using system libs --- indra/newview/CMakeLists.txt | 2 ++ 1 file changed, 2 insertions(+) (limited to 'indra') diff --git a/indra/newview/CMakeLists.txt b/indra/newview/CMakeLists.txt index a1b82f47da..d3de5b9375 100644 --- a/indra/newview/CMakeLists.txt +++ b/indra/newview/CMakeLists.txt @@ -49,7 +49,9 @@ endif () include(Tracy) include(UI) include(ViewerMiscLibs) +if (USE_AUTOBUILD_3P OR USE_CONAN) include(ViewerManager) +endif () include(VisualLeakDetector) include(ZLIBNG) include(URIPARSER) -- cgit v1.2.3 From b0f295ec2a2fd448bb248befb5b57b26b6144332 Mon Sep 17 00:00:00 2001 From: Erik Kundiman Date: Wed, 12 Jul 2023 10:20:18 +0800 Subject: Disable copy 3rd party libs when using system libs --- indra/llcommon/CMakeLists.txt | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'indra') diff --git a/indra/llcommon/CMakeLists.txt b/indra/llcommon/CMakeLists.txt index ef4899978e..c58956bd36 100644 --- a/indra/llcommon/CMakeLists.txt +++ b/indra/llcommon/CMakeLists.txt @@ -9,7 +9,9 @@ include(Linking) include(Boost) include(LLSharedLibs) include(JsonCpp) +if (USE_AUTOBUILD_3P OR USE_CONAN) include(Copy3rdPartyLibs) +endif () include(ZLIBNG) include(URIPARSER) include(Tracy) @@ -277,7 +279,9 @@ target_link_libraries( target_include_directories(llcommon INTERFACE ${CMAKE_CURRENT_SOURCE_DIR}) target_include_directories(llcommon PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}) +if (USE_AUTOBUILD_3P OR USE_CONAN) add_dependencies(llcommon stage_third_party_libs) +endif () if (LL_TESTS) include(LLAddBuildTest) -- cgit v1.2.3 From f4c8949ac66d08263845f60a7cef2ecb9c77079b Mon Sep 17 00:00:00 2001 From: Erik Kundiman Date: Wed, 12 Jul 2023 11:56:03 +0800 Subject: VLC & CEF aren't deps when no media plugins on mac --- indra/newview/CMakeLists.txt | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'indra') diff --git a/indra/newview/CMakeLists.txt b/indra/newview/CMakeLists.txt index d3de5b9375..b24f643929 100644 --- a/indra/newview/CMakeLists.txt +++ b/indra/newview/CMakeLists.txt @@ -2069,7 +2069,11 @@ if (DARWIN) ${CMAKE_CURRENT_SOURCE_DIR}/viewer_manifest.py ) + if (ENABLE_MEDIA_PLUGINS) add_dependencies(${VIEWER_BINARY_NAME} SLPlugin media_plugin_libvlc media_plugin_cef) + else () + add_dependencies(${VIEWER_BINARY_NAME} SLPlugin) + endif () if (ENABLE_SIGNING) set(SIGNING_SETTING "--signature=${SIGNING_IDENTITY}") -- cgit v1.2.3 From 146f292869a0ca2a82768374c81ae519a5eee287 Mon Sep 17 00:00:00 2001 From: Erik Kundiman Date: Sun, 4 Jun 2023 10:38:31 +0800 Subject: stdtypes.h includes C Std Lib stddef.h for size_t in order to get rid of errors complaining that size_t was not declared in the scope. --- indra/llcommon/stdtypes.h | 1 + 1 file changed, 1 insertion(+) (limited to 'indra') diff --git a/indra/llcommon/stdtypes.h b/indra/llcommon/stdtypes.h index da8512169c..192a8b97b1 100644 --- a/indra/llcommon/stdtypes.h +++ b/indra/llcommon/stdtypes.h @@ -29,6 +29,7 @@ #include #include #include +#include #include #include -- cgit v1.2.3 From 0f121ca6a6d1d505ca6cb49683c6a1ebb69e6a31 Mon Sep 17 00:00:00 2001 From: Erik Kundiman Date: Wed, 12 Jul 2023 12:28:07 +0800 Subject: Deprecated declarations aren't treated as errors I had added this to CMAKE_CXX_FLAGS in 00-Common before, and only when the compiler was Clang. But it turned out that GCC was treating them as errors too, that the addition would need to be applied to all compilers. So I prefer to put it here in llcommon with the scope set to PUBLIC cause the errors would show up again when compiling other LL libraries if the scope is set to something else. --- indra/llcommon/CMakeLists.txt | 2 ++ 1 file changed, 2 insertions(+) (limited to 'indra') diff --git a/indra/llcommon/CMakeLists.txt b/indra/llcommon/CMakeLists.txt index c58956bd36..e5a3e5e0c7 100644 --- a/indra/llcommon/CMakeLists.txt +++ b/indra/llcommon/CMakeLists.txt @@ -281,6 +281,8 @@ target_include_directories(llcommon PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}) if (USE_AUTOBUILD_3P OR USE_CONAN) add_dependencies(llcommon stage_third_party_libs) +else () + target_compile_options(${PROJECT_NAME} PUBLIC -Wno-deprecated-declarations) endif () if (LL_TESTS) -- cgit v1.2.3 From e87035c17b23dc6cca2eea2b0ff9223314bb55ea Mon Sep 17 00:00:00 2001 From: Erik Kundiman Date: Wed, 12 Jul 2023 13:24:03 +0800 Subject: Start including FBSD for common macro definitions --- indra/llcommon/llfasttimer.cpp | 2 +- indra/llcommon/llfasttimer.h | 2 +- indra/llcommon/llmemory.h | 4 ++-- indra/llcommon/stdtypes.h | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) (limited to 'indra') diff --git a/indra/llcommon/llfasttimer.cpp b/indra/llcommon/llfasttimer.cpp index 2612d0f07c..b30bb110c9 100644 --- a/indra/llcommon/llfasttimer.cpp +++ b/indra/llcommon/llfasttimer.cpp @@ -43,7 +43,7 @@ #if LL_WINDOWS #include "lltimer.h" -#elif LL_LINUX +#elif LL_LINUX || LL_FREEBSD #include #include #include "lltimer.h" diff --git a/indra/llcommon/llfasttimer.h b/indra/llcommon/llfasttimer.h index 9bd93d7240..53f936db34 100644 --- a/indra/llcommon/llfasttimer.h +++ b/indra/llcommon/llfasttimer.h @@ -159,7 +159,7 @@ public: #endif // (LL_LINUX) && !(defined(__i386__) || defined(__amd64__)) -#if (LL_LINUX || LL_DARWIN) && (defined(__i386__) || defined(__amd64__)) +#if (LL_LINUX || LL_DARWIN || LL_FREEBSD) && (defined(__i386__) || defined(__amd64__)) // // Mac+Linux FAST x86 implementation of CPU clock static U32 getCPUClockCount32() diff --git a/indra/llcommon/llmemory.h b/indra/llcommon/llmemory.h index ac6c969d70..b67a8c9bc0 100644 --- a/indra/llcommon/llmemory.h +++ b/indra/llcommon/llmemory.h @@ -52,7 +52,7 @@ class LLMutex ; #define LL_DEFAULT_HEAP_ALIGN 8 #elif LL_DARWIN #define LL_DEFAULT_HEAP_ALIGN 16 -#elif LL_LINUX +#elif LL_LINUX || LL_FREEBSD #define LL_DEFAULT_HEAP_ALIGN 8 #endif @@ -85,7 +85,7 @@ template T* LL_NEXT_ALIGNED_ADDRESS_64(T* address) (uintptr_t(address) + 0x3F) & ~0x3F); } -#if LL_LINUX || LL_DARWIN +#if LL_LINUX || LL_DARWIN || LL_FREEBSD #define LL_ALIGN_PREFIX(x) #define LL_ALIGN_POSTFIX(x) __attribute__((aligned(x))) diff --git a/indra/llcommon/stdtypes.h b/indra/llcommon/stdtypes.h index 192a8b97b1..bae4d7a5b1 100644 --- a/indra/llcommon/stdtypes.h +++ b/indra/llcommon/stdtypes.h @@ -72,7 +72,7 @@ typedef unsigned __int64 U64; #else typedef long long int S64; typedef long long unsigned int U64; -#if LL_DARWIN || LL_LINUX +#if LL_DARWIN || LL_LINUX || LL_FREEBSD #define S64L(a) (a##LL) #define U64L(a) (a##ULL) #endif -- cgit v1.2.3 From 368a9c7c61f8144eca48b12c5aac82b6a1d8c6bf Mon Sep 17 00:00:00 2001 From: Erik Kundiman Date: Wed, 12 Jul 2023 13:45:07 +0800 Subject: Undefine NULL before defining it to 0 on FreeBSD Since C++11, NULL is promoted to nullptr on some BSD platforms. This is very problematic when used with Boost. At times it would fail during compile-time. What's worse is if it passes compile-time, but then crash during run-time, for example when some condition is to be checked for its truth, when then it would be compared to a nullptr. --- indra/llcommon/stdtypes.h | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'indra') diff --git a/indra/llcommon/stdtypes.h b/indra/llcommon/stdtypes.h index bae4d7a5b1..86af192a94 100644 --- a/indra/llcommon/stdtypes.h +++ b/indra/llcommon/stdtypes.h @@ -114,6 +114,10 @@ typedef U32 TPACKETID; #define FALSE (0) #endif +#if LL_FREEBSD +#undef NULL +#endif + #ifndef NULL #define NULL (0) #endif -- cgit v1.2.3 From 4ac9396ea4183016aeff12a86e7e470e5f325ae9 Mon Sep 17 00:00:00 2001 From: Erik Kundiman Date: Wed, 12 Jul 2023 14:17:59 +0800 Subject: Processor information implementation for FreeBSD Relies on sysctl, like on Darwin, and on parsing a file, like on Linux, except the file would be /var/run/dmesg.boot. --- indra/llcommon/llprocessor.cpp | 97 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 97 insertions(+) (limited to 'indra') diff --git a/indra/llcommon/llprocessor.cpp b/indra/llcommon/llprocessor.cpp index 4a1a81f083..b3c05f5960 100644 --- a/indra/llcommon/llprocessor.cpp +++ b/indra/llcommon/llprocessor.cpp @@ -792,6 +792,100 @@ private: } }; +#elif LL_FREEBSD + +#include +class LLProcessorInfoFreeBSDImpl : public LLProcessorInfoImpl +{ +public: + LLProcessorInfoFreeBSDImpl() + { + size_t len = 0; + using std::string; + + char cpu_brand_string[0x40]; + len = sizeof cpu_brand_string; + memset(cpu_brand_string, '\0', len); + sysctlbyname("hw.model", (void *)cpu_brand_string, &len, + NULL, 0); + cpu_brand_string[0x3f] = '\0'; + setInfo(eBrandName, cpu_brand_string); + + uint64_t cpu_frequency = 0; + len = sizeof cpu_frequency; + sysctlbyname("hw.clockrate", (void *)&cpu_frequency, &len, + NULL, 0); + setInfo(eFrequency, (F64)cpu_frequency); + + auto dmesgboot = LLFile::fopen("/var/run/dmesg.boot", "rb"); + std::ostringstream s; + if (dmesgboot) { + char line[MAX_STRING]; + memset(line, 0, MAX_STRING); + while (fgets(line, MAX_STRING, dmesgboot)) { + line[strlen(line) - 1] = ' '; + s << line; + s << std::endl; + } + fclose(dmesgboot); + s << std::endl; + } + + auto dmesgboot_str = s.str(); + int decimal; + + auto idx1 = dmesgboot_str.find_first_of("\"") + 1; + auto idx2 = (idx1 != string::npos) + ? dmesgboot_str.find_first_of("\"", idx1) + : string::npos; + auto vendor = dmesgboot_str.substr(idx1, idx2 - idx1); + if (vendor.length() > 0) setInfo(eVendor, vendor.c_str()); + + idx1 = dmesgboot_str.find_first_of("=", idx2); + idx1 = dmesgboot_str.find_first_of("=", idx1 + 1) + 3; + idx2 = dmesgboot_str.find_first_of(" ", idx1); + auto family = dmesgboot_str.substr(idx1, idx2 - idx1); + std::istringstream(family) >> std::hex >> decimal; + setInfo(eFamily, decimal); + setInfo(eFamilyName, compute_CPUFamilyName(vendor.c_str(), + decimal, 0)); + + idx1 = dmesgboot_str.find_first_of("=", idx2) + 3; + idx2 = dmesgboot_str.find_first_of(" ", idx1); + auto model = dmesgboot_str.substr(idx1, idx2 - idx1); + std::istringstream(model) >> std::hex >> decimal; + setInfo(eModel, decimal); + + idx1 = dmesgboot_str.find_first_of("=", idx2) + 1; + idx2 = dmesgboot_str.find_first_of("\n", idx1); + auto stepping = dmesgboot_str.substr(idx1, idx2 - idx1); + setInfo(eStepping, std::stoi(stepping)); + + if (dmesgboot_str.find(",SSE,") != string::npos) + setExtension(cpu_feature_names[eSSE_Ext]); + + if (dmesgboot_str.find(",SSE2,") != string::npos) + setExtension(cpu_feature_names[eSSE2_Ext]); + + if (dmesgboot_str.find(" Date: Wed, 12 Jul 2023 14:37:28 +0800 Subject: Macro defs on FreeBSD as it's a supported arch now --- indra/llcommon/llsdutil.cpp | 2 +- indra/llcommon/lltimer.cpp | 6 +++--- indra/llcommon/lluuid.cpp | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) (limited to 'indra') diff --git a/indra/llcommon/llsdutil.cpp b/indra/llcommon/llsdutil.cpp index f70bee9903..512f630cdc 100644 --- a/indra/llcommon/llsdutil.cpp +++ b/indra/llcommon/llsdutil.cpp @@ -36,7 +36,7 @@ # include // for htonl #elif LL_LINUX # include -#elif LL_DARWIN +#elif LL_DARWIN || LL_FREEBSD # include #endif diff --git a/indra/llcommon/lltimer.cpp b/indra/llcommon/lltimer.cpp index 58bedacf43..8d22d7fa5e 100644 --- a/indra/llcommon/lltimer.cpp +++ b/indra/llcommon/lltimer.cpp @@ -32,7 +32,7 @@ #if LL_WINDOWS # include "llwin32headerslean.h" -#elif LL_LINUX || LL_DARWIN +#elif LL_LINUX || LL_DARWIN || LL_FREEBSD # include # include #else @@ -74,7 +74,7 @@ U32 micro_sleep(U64 us, U32 max_yields) ms_sleep((U32)(us / 1000)); return 0; } -#elif LL_LINUX || LL_DARWIN +#elif LL_LINUX || LL_DARWIN || LL_FREEBSD static void _sleep_loop(struct timespec& thiswait) { struct timespec nextwait; @@ -192,7 +192,7 @@ F64 calc_clock_frequency() #endif // LL_WINDOWS -#if LL_LINUX || LL_DARWIN +#if LL_LINUX || LL_DARWIN || LL_FREEBSD // Both Linux and Mac use gettimeofday for accurate time F64 calc_clock_frequency() { diff --git a/indra/llcommon/lluuid.cpp b/indra/llcommon/lluuid.cpp index fc04dca08d..3b575c914c 100644 --- a/indra/llcommon/lluuid.cpp +++ b/indra/llcommon/lluuid.cpp @@ -606,7 +606,7 @@ S32 LLUUID::getNodeID(unsigned char *node_id) #define HAVE_NETINET_IN_H #ifdef HAVE_NETINET_IN_H #include -#if !LL_DARWIN +#if !LL_DARWIN && !LL_FREEBSD #include #endif #endif -- cgit v1.2.3 From bcab7e348022eb219ab1beafe7bb0e64f66495f0 Mon Sep 17 00:00:00 2001 From: Erik Kundiman Date: Wed, 12 Jul 2023 14:43:01 +0800 Subject: Operating system info implementation for FreeBSD --- indra/llcommon/llsys.cpp | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) (limited to 'indra') diff --git a/indra/llcommon/llsys.cpp b/indra/llcommon/llsys.cpp index 91cb65b815..8c4e0988fc 100644 --- a/indra/llcommon/llsys.cpp +++ b/indra/llcommon/llsys.cpp @@ -83,6 +83,9 @@ using namespace llsd; # include const char MEMINFO_FILE[] = "/proc/meminfo"; # include +#elif LL_FREEBSD +# include +# include #endif LLCPUInfo gSysCPU; @@ -435,6 +438,14 @@ LLOSInfo::LLOSInfo() : if (simple.length() > 0) mOSStringSimple = simple; } + else if (ostype == "FreeBSD") + { + // Only care about major and minor FreeBSD versions, truncate at first '-' + std::string simple = mOSStringSimple.substr(0, + mOSStringSimple.find_first_of("-", 0)); + if (simple.length() > 0) + mOSStringSimple = simple; + } } else { @@ -776,10 +787,14 @@ U32Kilobytes LLMemoryInfo::getPhysicalMemoryKB() const #if LL_WINDOWS return LLMemoryAdjustKBResult(U32Kilobytes(mStatsMap["Total Physical KB"].asInteger())); -#elif LL_DARWIN +#elif LL_DARWIN || LL_FREEBSD // This might work on Linux as well. Someone check... uint64_t phys = 0; +#if LL_DARWIN int mib[2] = { CTL_HW, HW_MEMSIZE }; +#else + int mib[2] = { CTL_HW, HW_PHYSMEM }; +#endif size_t len = sizeof(phys); sysctl(mib, 2, &phys, &len, NULL, 0); -- cgit v1.2.3 From fc6d2ad320b35a7ea4dfa33d88e1bdd54d21904d Mon Sep 17 00:00:00 2001 From: Erik Kundiman Date: Wed, 12 Jul 2023 14:46:32 +0800 Subject: System xxHash header isn't (usually?) encapsulated --- indra/llcommon/hbxxh.cpp | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'indra') diff --git a/indra/llcommon/hbxxh.cpp b/indra/llcommon/hbxxh.cpp index 388269d6c8..84d215d468 100644 --- a/indra/llcommon/hbxxh.cpp +++ b/indra/llcommon/hbxxh.cpp @@ -34,7 +34,11 @@ // in your build, in which case the latter would be used instead. For ARM64 // builds, this would also automatically enable NEON vectorization. #define XXH_INLINE_ALL +#if LL_USESYSTEMLIBS +#include +#else #include "xxhash/xxhash.h" +#endif #include "hbxxh.h" -- cgit v1.2.3 From b981877c4a9edbd5df49517b294a84d665c59a5d Mon Sep 17 00:00:00 2001 From: Erik Kundiman Date: Wed, 12 Jul 2023 14:53:50 +0800 Subject: Newer system meshopt_simplify has 1 extra argument since Meshoptimizer v0.18, an option to specify meshopt_SimplifyLockBorder. --- indra/llmeshoptimizer/llmeshoptimizer.cpp | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'indra') diff --git a/indra/llmeshoptimizer/llmeshoptimizer.cpp b/indra/llmeshoptimizer/llmeshoptimizer.cpp index c178348968..ce2b9f99b1 100644 --- a/indra/llmeshoptimizer/llmeshoptimizer.cpp +++ b/indra/llmeshoptimizer/llmeshoptimizer.cpp @@ -291,6 +291,9 @@ U64 LLMeshOptimizer::simplifyU32(U32 *destination, vertex_positions_stride, target_index_count, target_error, +#ifdef LL_USESYSTEMLIBS + 0, +#endif result_error ); } @@ -332,6 +335,9 @@ U64 LLMeshOptimizer::simplify(U16 *destination, vertex_positions_stride, target_index_count, target_error, +#ifdef LL_USESYSTEMLIBS + 0, +#endif result_error ); } -- cgit v1.2.3 From 85e61212ef42e649eaea444bd9cbcad4fc26d31a Mon Sep 17 00:00:00 2001 From: Erik Kundiman Date: Sun, 4 Jun 2023 11:06:19 +0800 Subject: Explicit when using function_ptr Phoenix binder MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit From the errors: base type ‘float (*)(float, float) noexcept’ fails to be a struct or class type struct functor_action : public FuncT { ^~~~~~~~~~~~~~ ‘float (*)(float, float) noexcept’ is not a class, struct, or union type struct result { typedef typename FuncT::result_type type; }; ^~~~ type ‘float (*)(float, float) noexcept’ is not a direct base of ‘phoenix::functor_action’ : FuncT(fptr_) {} ^ it seems that GCC, at least the ones on my system, failed to deduce that the binder meant to be used when trying to bind the C Std Math Library's powf and fmodf functions is of course the function pointer one (specifically the 2 args specialisation), and not the functor one. --- indra/llmath/llcalcparser.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'indra') diff --git a/indra/llmath/llcalcparser.h b/indra/llmath/llcalcparser.h index dff5bf3af3..e4656d2376 100644 --- a/indra/llmath/llcalcparser.h +++ b/indra/llmath/llcalcparser.h @@ -131,14 +131,14 @@ struct LLCalcParser : grammar power = unary_expr[power.value = arg1] >> - *('^' >> assert_syntax(unary_expr[power.value = phoenix::bind(&powf)(power.value, arg1)])) + *('^' >> assert_syntax(unary_expr[power.value = phoenix::bind(&powf)(power.value, arg1)])) ; term = power[term.value = arg1] >> *(('*' >> assert_syntax(power[term.value *= arg1])) | ('/' >> assert_syntax(power[term.value /= arg1])) | - ('%' >> assert_syntax(power[term.value = phoenix::bind(&fmodf)(term.value, arg1)])) + ('%' >> assert_syntax(power[term.value = phoenix::bind(&fmodf)(term.value, arg1)])) ) ; -- cgit v1.2.3 From 4f817c0543ed20e4655198e0a05a8019fa795ee7 Mon Sep 17 00:00:00 2001 From: Erik Kundiman Date: Wed, 12 Jul 2023 15:09:44 +0800 Subject: Linux filesystem dir can still be used for FreeBSD --- indra/llfilesystem/lldir_linux.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'indra') diff --git a/indra/llfilesystem/lldir_linux.h b/indra/llfilesystem/lldir_linux.h index e83a020ba4..8c4d42f025 100644 --- a/indra/llfilesystem/lldir_linux.h +++ b/indra/llfilesystem/lldir_linux.h @@ -24,7 +24,7 @@ * $/LicenseInfo$ */ -#if !LL_LINUX +#if !LL_LINUX && !LL_FREEBSD #error This header must not be included when compiling for any target other than Linux. Consider including lldir.h instead. #endif // !LL_LINUX -- cgit v1.2.3 From 5dddf739f6eae3de351eeb7e5a83ddcc68b31b54 Mon Sep 17 00:00:00 2001 From: Erik Kundiman Date: Wed, 12 Jul 2023 15:20:01 +0800 Subject: System OpenJPEG headers are encapsulated For now the directory name is hardcoded since v2.5.0 is the latest and the viewer code already depends on a certain function from that version. So for now it's safe to assume that the directory name's suffix is 2.5. --- indra/llimagej2coj/llimagej2coj.cpp | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'indra') diff --git a/indra/llimagej2coj/llimagej2coj.cpp b/indra/llimagej2coj/llimagej2coj.cpp index 12985c3c7f..a15164858a 100644 --- a/indra/llimagej2coj/llimagej2coj.cpp +++ b/indra/llimagej2coj/llimagej2coj.cpp @@ -28,9 +28,15 @@ #include "llimagej2coj.h" // this is defined so that we get static linking. +#ifdef LL_USESYSTEMLIBS +#include +#include +#include +#else #include "openjpeg.h" #include "event.h" #include "cio.h" +#endif #define MAX_ENCODED_DISCARD_LEVELS 5 -- cgit v1.2.3 From 43f332459198b40dd11f9c478ca421ab71aec27b Mon Sep 17 00:00:00 2001 From: Erik Kundiman Date: Wed, 12 Jul 2023 15:25:59 +0800 Subject: Set so int in bool context isn't an error on GCC and only on a specific file. --- indra/llimage/CMakeLists.txt | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'indra') diff --git a/indra/llimage/CMakeLists.txt b/indra/llimage/CMakeLists.txt index 79f9565ed9..f1eed409cd 100644 --- a/indra/llimage/CMakeLists.txt +++ b/indra/llimage/CMakeLists.txt @@ -67,6 +67,12 @@ target_link_libraries(llimage ll::libjpeg ) +if (NOT (USE_AUTOBUILD_3P OR USE_CONAN)) + if (CMAKE_CXX_COMPILER_ID MATCHES "GNU") + set_source_files_properties(llimageworker.cpp PROPERTIES COMPILE_FLAGS -Wno-int-in-bool-context) + endif() +endif () + # Add tests if (LL_TESTS) SET(llimage_TEST_SOURCE_FILES -- cgit v1.2.3 From fe29edcff99d5e69bb4cf401870f7503089cf69c Mon Sep 17 00:00:00 2001 From: Erik Kundiman Date: Wed, 12 Jul 2023 15:42:07 +0800 Subject: Use system SDL on FreeBSD too X11 is still required too, that's why it's still added for linking. On Darwin, SDL is disabled for now. --- indra/cmake/LLWindow.cmake | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'indra') diff --git a/indra/cmake/LLWindow.cmake b/indra/cmake/LLWindow.cmake index b36e970560..f952383a27 100644 --- a/indra/cmake/LLWindow.cmake +++ b/indra/cmake/LLWindow.cmake @@ -7,6 +7,16 @@ include(Prebuilt) include_guard() add_library( ll::SDL INTERFACE IMPORTED ) +if (NOT (USE_AUTOBUILD_3P OR USE_CONAN) AND NOT DARWIN) + include(FindPkgConfig) + pkg_check_modules(Sdl REQUIRED sdl) + target_compile_definitions( ll::SDL INTERFACE LL_SDL=1) + target_include_directories(ll::SDL SYSTEM INTERFACE ${Sdl_INCLUDE_DIRS}) + target_link_directories(ll::SDL INTERFACE ${Sdl_LIBRARY_DIRS}) + target_link_libraries(ll::SDL INTERFACE ${Sdl_LIBRARIES} X11) + return () +endif () + if (LINUX) #Must come first as use_system_binary can exit this file early -- cgit v1.2.3 From 71167486f2a22717c9d30161960b6a263dfc658f Mon Sep 17 00:00:00 2001 From: Erik Kundiman Date: Sun, 4 Jun 2023 14:06:09 +0800 Subject: Stubs for missing implementations that use SDL MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit in order to get rid of this: error: invalid new-expression of abstract class type ‘LLWindowSDL’ fullscreen, clearBg, enable_vsync, use_gl, ignore_pixel_depth, fsaa_samples); note: because the following virtual functions are pure within ‘LLWindowSDL’: class LLWindowSDL : public LLWindow ^~~~~~~~~~~ virtual void* createSharedContext() = 0; ^~~~~~~~~~~~~~~~~~~ virtual void makeContextCurrent(void* context) = 0; ^~~~~~~~~~~~~~~~~~ virtual void destroySharedContext(void* context) = 0; ^~~~~~~~~~~~~~~~~~~~ virtual void toggleVSync(bool enable_vsync) = 0; ^~~~~~~~~~~ The window has been relying on some, mostly GL context related, methods. These methods are declared abstract, so for now they're implemented using member functions that do nothing, return nothing. --- indra/llwindow/llwindowsdl.cpp | 21 +++++++++++++++++++++ indra/llwindow/llwindowsdl.h | 4 ++++ 2 files changed, 25 insertions(+) (limited to 'indra') diff --git a/indra/llwindow/llwindowsdl.cpp b/indra/llwindow/llwindowsdl.cpp index 7ea87f5884..8d55e0dc79 100644 --- a/indra/llwindow/llwindowsdl.cpp +++ b/indra/llwindow/llwindowsdl.cpp @@ -1035,6 +1035,27 @@ void LLWindowSDL::setMinSize(U32 min_width, U32 min_height, bool enforce_immedia #endif } +void *LLWindowSDL::createSharedContext() +{ + // *FIX: What to do with SDL? + return nullptr; +} + +void LLWindowSDL::makeContextCurrent(void* context) +{ + // *FIX: What to do with SDL? +} + +void LLWindowSDL::destroySharedContext(void* context) +{ + // *FIX: What to do with SDL? +} + +void LLWindowSDL::toggleVSync(bool enable_vsync) +{ + // *FIX: What to do with SDL? +} + BOOL LLWindowSDL::setCursorPosition(const LLCoordWindow position) { BOOL result = TRUE; diff --git a/indra/llwindow/llwindowsdl.h b/indra/llwindow/llwindowsdl.h index 7193e6f45a..57885907b4 100644 --- a/indra/llwindow/llwindowsdl.h +++ b/indra/llwindow/llwindowsdl.h @@ -66,6 +66,10 @@ public: /*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*/ void *createSharedContext(); + /*virtual*/ void makeContextCurrent(void* context); + /*virtual*/ void destroySharedContext(void* context); + /*virtual*/ void toggleVSync(bool enable_vsync); /*virtual*/ BOOL setCursorPosition(LLCoordWindow position); /*virtual*/ BOOL getCursorPosition(LLCoordWindow *position); /*virtual*/ void showCursor(); -- cgit v1.2.3 From 6ec16974e5dcf5f9142ac4d54c4b7fb7f6366e3d Mon Sep 17 00:00:00 2001 From: Erik Kundiman Date: Wed, 12 Jul 2023 15:53:45 +0800 Subject: Include FreeBSD macro variable for GL related code --- indra/llrender/llgl.cpp | 14 +++++++------- indra/llrender/llglheaders.h | 4 ++-- 2 files changed, 9 insertions(+), 9 deletions(-) (limited to 'indra') diff --git a/indra/llrender/llgl.cpp b/indra/llrender/llgl.cpp index 193cfa64b8..a10bbbf726 100644 --- a/indra/llrender/llgl.cpp +++ b/indra/llrender/llgl.cpp @@ -156,7 +156,7 @@ LLMatrix4 gGLObliqueProjectionInverse; std::list LLGLUpdate::sGLQ; -#if (LL_WINDOWS || LL_LINUX) && !LL_MESA_HEADLESS +#if (LL_WINDOWS || LL_LINUX || LL_FREEBSD) && !LL_MESA_HEADLESS #if LL_WINDOWS PFNGLGETSTRINGIPROC glGetStringi = NULL; @@ -317,7 +317,7 @@ PFNWGLCREATECONTEXTATTRIBSARBPROC wglCreateContextAttribsARB = NULL; #endif // vertex shader prototypes -#if LL_LINUX +#if LL_LINUX || LL_FREEBSD PFNGLVERTEXATTRIB1DARBPROC glVertexAttrib1dARB = NULL; PFNGLVERTEXATTRIB1DVARBPROC glVertexAttrib1dvARB = NULL; PFNGLVERTEXATTRIB1FARBPROC glVertexAttrib1fARB = NULL; @@ -344,7 +344,7 @@ PFNGLVERTEXATTRIB4NUBARBPROC glVertexAttrib4nubARB = NULL; PFNGLVERTEXATTRIB4NUBVARBPROC glVertexAttrib4nubvARB = NULL; PFNGLVERTEXATTRIB4NUIVARBPROC glVertexAttrib4nuivARB = NULL; PFNGLVERTEXATTRIB4NUSVARBPROC glVertexAttrib4nusvARB = NULL; -#if LL_LINUX +#if LL_LINUX || LL_FREEBSD PFNGLVERTEXATTRIB4BVARBPROC glVertexAttrib4bvARB = NULL; PFNGLVERTEXATTRIB4DARBPROC glVertexAttrib4dARB = NULL; PFNGLVERTEXATTRIB4DVARBPROC glVertexAttrib4dvARB = NULL; @@ -616,7 +616,7 @@ bool LLGLManager::initGL() mIsNVIDIA = TRUE; } else if (mGLVendor.find("INTEL") != std::string::npos -#if LL_LINUX +#if LL_LINUX || LL_FREEBSD // The Mesa-based drivers put this in the Renderer string, // not the Vendor string. || mGLRenderer.find("INTEL") != std::string::npos @@ -1060,7 +1060,7 @@ void LLGLManager::initExtensions() #endif #endif -#if LL_LINUX +#if LL_LINUX || LL_FREEBSD LL_INFOS() << "initExtensions() checking shell variables to adjust features..." << LL_ENDL; // Our extension support for the Linux Client is very young with some // potential driver gotchas, so offer a semi-secret way to turn it off. @@ -1180,7 +1180,7 @@ void LLGLManager::initExtensions() glGetIntegerv(GL_MAX_ELEMENTS_INDICES, (GLint*) &mGLMaxIndexRange); glGetIntegerv(GL_MAX_TEXTURE_SIZE, (GLint*) &mGLMaxTextureSize); -#if (LL_WINDOWS || LL_LINUX) && !LL_MESA_HEADLESS +#if (LL_WINDOWS || LL_LINUX || LL_FREEBSD) && !LL_MESA_HEADLESS LL_DEBUGS("RenderInit") << "GL Probe: Getting symbols" << LL_ENDL; if (mHasVertexBufferObject) { @@ -1279,7 +1279,7 @@ void LLGLManager::initExtensions() glDebugMessageCallbackARB = (PFNGLDEBUGMESSAGECALLBACKARBPROC) GLH_EXT_GET_PROC_ADDRESS("glDebugMessageCallbackARB"); glGetDebugMessageLogARB = (PFNGLGETDEBUGMESSAGELOGARBPROC) GLH_EXT_GET_PROC_ADDRESS("glGetDebugMessageLogARB"); } -#if (!LL_LINUX) || LL_LINUX_NV_GL_HEADERS +#if (!LL_LINUX && !LL_FREEBSD) || LL_LINUX_NV_GL_HEADERS // This is expected to be a static symbol on Linux GL implementations, except if we use the nvidia headers - bah glDrawRangeElements = (PFNGLDRAWRANGEELEMENTSPROC)GLH_EXT_GET_PROC_ADDRESS("glDrawRangeElements"); if (!glDrawRangeElements) diff --git a/indra/llrender/llglheaders.h b/indra/llrender/llglheaders.h index e1ecc6a6ca..3ad92ed20e 100644 --- a/indra/llrender/llglheaders.h +++ b/indra/llrender/llglheaders.h @@ -41,7 +41,7 @@ # include "GL/glh_extensions.h" # undef __APPLE__ -#elif LL_LINUX +#elif LL_LINUX || LL_FREEBSD //---------------------------------------------------------------------------- // LL_LINUX @@ -53,7 +53,7 @@ #include "GL/glu.h" -#if LL_LINUX && !LL_MESA_HEADLESS +#if (LL_LINUX || LL_FREEBSD) && !LL_MESA_HEADLESS // The __APPLE__ kludge is to make glh_extensions.h not symbol-clash horribly # define __APPLE__ # include "GL/glh_extensions.h" -- cgit v1.2.3 From 008a46e3080e811fe5e34607c0c4cceb77d829d5 Mon Sep 17 00:00:00 2001 From: Erik Kundiman Date: Wed, 12 Jul 2023 15:34:18 +0800 Subject: Explicitly mean to use boost:placeholders Otherwise _1 and _2 would be considered undeclared in many places. --- indra/llinventory/llsettingsbase.cpp | 1 + indra/llinventory/llsettingssky.cpp | 1 + indra/llinventory/llsettingswater.cpp | 1 + 3 files changed, 3 insertions(+) (limited to 'indra') diff --git a/indra/llinventory/llsettingsbase.cpp b/indra/llinventory/llsettingsbase.cpp index 936b166409..7ca9d6b8cc 100644 --- a/indra/llinventory/llsettingsbase.cpp +++ b/indra/llinventory/llsettingsbase.cpp @@ -395,6 +395,7 @@ bool LLSettingsBase::validate() LLSD LLSettingsBase::settingValidation(LLSD &settings, validation_list_t &validations, bool partial) { + using boost::placeholders::_1, boost::placeholders::_2; static Validator validateName(SETTING_NAME, false, LLSD::TypeString, boost::bind(&Validator::verifyStringLength, _1, _2, 63)); static Validator validateId(SETTING_ID, false, LLSD::TypeUUID); static Validator validateHash(SETTING_HASH, false, LLSD::TypeInteger); diff --git a/indra/llinventory/llsettingssky.cpp b/indra/llinventory/llsettingssky.cpp index a129f0a6f0..ab88327b83 100644 --- a/indra/llinventory/llsettingssky.cpp +++ b/indra/llinventory/llsettingssky.cpp @@ -144,6 +144,7 @@ const F32 LLSettingsSky::DOME_RADIUS(15000.f); namespace { + using boost::placeholders::_1, boost::placeholders::_2; LLSettingsSky::validation_list_t legacyHazeValidationList() { diff --git a/indra/llinventory/llsettingswater.cpp b/indra/llinventory/llsettingswater.cpp index d732032a6c..94dd39170c 100644 --- a/indra/llinventory/llsettingswater.cpp +++ b/indra/llinventory/llsettingswater.cpp @@ -223,6 +223,7 @@ LLSettingsWater::validation_list_t LLSettingsWater::validationList() if (validation.empty()) { + using boost::placeholders::_1, boost::placeholders::_2; validation.push_back(Validator(SETTING_BLUR_MULTIPLIER, true, LLSD::TypeReal, boost::bind(&Validator::verifyFloatRange, _1, _2, llsd::array(-0.5f, 0.5f)))); validation.push_back(Validator(SETTING_FOG_COLOR, true, LLSD::TypeArray, -- cgit v1.2.3 From b844e48297b6650003aa1f24bef618f7b652466c Mon Sep 17 00:00:00 2001 From: Erik Kundiman Date: Wed, 12 Jul 2023 16:17:02 +0800 Subject: FreeBSD has SDL keyboard & window files built too and any Linux SDL code should be applied to FreeBSD too. --- indra/llwindow/CMakeLists.txt | 4 ++-- indra/llwindow/llwindowsdl.cpp | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) (limited to 'indra') diff --git a/indra/llwindow/CMakeLists.txt b/indra/llwindow/CMakeLists.txt index ca08e38f77..c2989e84c9 100644 --- a/indra/llwindow/CMakeLists.txt +++ b/indra/llwindow/CMakeLists.txt @@ -61,7 +61,7 @@ set(llwindow_LINK_LIBRARIES ) # Libraries on which this library depends, needed for Linux builds # Sort by high-level to low-level -if (LINUX) +if (LINUX OR CMAKE_SYSTEM_NAME MATCHES "FreeBSD") list(APPEND viewer_SOURCE_FILES llkeyboardsdl.cpp llwindowsdl.cpp @@ -84,7 +84,7 @@ if (LINUX) ) endif (BUILD_HEADLESS) -endif (LINUX) +endif (LINUX OR CMAKE_SYSTEM_NAME MATCHES "FreeBSD") if (DARWIN) list(APPEND llwindow_SOURCE_FILES diff --git a/indra/llwindow/llwindowsdl.cpp b/indra/llwindow/llwindowsdl.cpp index 8d55e0dc79..d9f7d07326 100644 --- a/indra/llwindow/llwindowsdl.cpp +++ b/indra/llwindow/llwindowsdl.cpp @@ -51,7 +51,7 @@ extern "C" { # include "fontconfig/fontconfig.h" } -#if LL_LINUX +#if LL_LINUX || LL_FREEBSD // not necessarily available on random SDL platforms, so #if LL_LINUX // for execv(), waitpid(), fork() # include @@ -2490,7 +2490,7 @@ BOOL LLWindowSDL::dialogColorPicker( F32 *r, F32 *g, F32 *b) } #endif // LL_GTK -#if LL_LINUX +#if LL_LINUX || LL_FREEBSD // 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) @@ -2546,7 +2546,7 @@ void LLWindowSDL::spawnWebBrowser(const std::string& escaped_url, bool async) LL_INFOS() << "spawn_web_browser: " << escaped_url << LL_ENDL; -#if LL_LINUX +#if LL_LINUX || LL_FREEBSD # if LL_X11 if (mSDL_Display) { -- cgit v1.2.3 From cb2595bbb1dfce0170715b7b18c80218e0c20ce9 Mon Sep 17 00:00:00 2001 From: Erik Kundiman Date: Wed, 12 Jul 2023 16:28:19 +0800 Subject: Disable g_thread_init when using system libs On GCC, compiling against a recent GTK2 version would stop on deprecated pre-processors. --- indra/llwindow/llwindowsdl.cpp | 2 ++ indra/newview/llappviewerlinux.cpp | 2 ++ 2 files changed, 4 insertions(+) (limited to 'indra') diff --git a/indra/llwindow/llwindowsdl.cpp b/indra/llwindow/llwindowsdl.cpp index d9f7d07326..8384845516 100644 --- a/indra/llwindow/llwindowsdl.cpp +++ b/indra/llwindow/llwindowsdl.cpp @@ -119,7 +119,9 @@ bool LLWindowSDL::ll_try_gtk_init(void) if (!tried_gtk_init) { tried_gtk_init = TRUE; +#ifndef LL_USESYSTEMLIBS if (!g_thread_supported ()) g_thread_init (NULL); +#endif maybe_lock_display(); gtk_is_good = gtk_init_check(NULL, NULL); maybe_unlock_display(); diff --git a/indra/newview/llappviewerlinux.cpp b/indra/newview/llappviewerlinux.cpp index 9f58f90326..a110828967 100644 --- a/indra/newview/llappviewerlinux.cpp +++ b/indra/newview/llappviewerlinux.cpp @@ -120,7 +120,9 @@ bool LLAppViewerLinux::init() // before any mutexes are held, *and* some of our third-party // libraries likes to use glib functions; in short, do this here // really early in app startup! +#ifndef LL_USESYSTEMLIBS if (!g_thread_supported ()) g_thread_init (NULL); +#endif bool success = LLAppViewer::init(); -- cgit v1.2.3 From 73d6aed67f25aed8efa5cb27b35ec30fc9a96e0e Mon Sep 17 00:00:00 2001 From: Erik Kundiman Date: Wed, 19 Jul 2023 11:35:24 +0800 Subject: Fix what GCC considers as misleading indentations The style conventions aren't really being followed that the different styles of using tabs or spaces as indentations lead to GCC considering them as misleading. It's better to just fix them (but as little as possible as to minimise this fork difference from upstream) than to supress the warnings from being treated as errors. --- indra/llwindow/llwindowsdl.cpp | 4 ++-- indra/newview/llchathistory.cpp | 2 +- indra/newview/llconversationloglist.cpp | 4 ++-- indra/newview/llfloaterregioninfo.cpp | 2 +- indra/newview/llmediadataclient.cpp | 4 ++-- indra/newview/llvoicevivox.cpp | 2 +- 6 files changed, 9 insertions(+), 9 deletions(-) (limited to 'indra') diff --git a/indra/llwindow/llwindowsdl.cpp b/indra/llwindow/llwindowsdl.cpp index 8384845516..9c8fadb968 100644 --- a/indra/llwindow/llwindowsdl.cpp +++ b/indra/llwindow/llwindowsdl.cpp @@ -1432,7 +1432,7 @@ BOOL LLWindowSDL::convertCoords(LLCoordGL from, LLCoordWindow *to) if (!to) return FALSE; - to->mX = from.mX; + to->mX = from.mX; to->mY = mWindow->h - from.mY - 1; return TRUE; @@ -1443,7 +1443,7 @@ BOOL LLWindowSDL::convertCoords(LLCoordWindow from, LLCoordGL* to) if (!to) return FALSE; - to->mX = from.mX; + to->mX = from.mX; to->mY = mWindow->h - from.mY - 1; return TRUE; diff --git a/indra/newview/llchathistory.cpp b/indra/newview/llchathistory.cpp index 9a608fba8e..9463720b6b 100644 --- a/indra/newview/llchathistory.cpp +++ b/indra/newview/llchathistory.cpp @@ -1188,7 +1188,7 @@ LLView* LLChatHistory::getHeader(const LLChat& chat,const LLStyle::Params& style LLChatHistoryHeader* header = LLChatHistoryHeader::createInstance(mMessageHeaderFilename); if (header) header->setup(chat, style_params, args); - return header; + return header; } void LLChatHistory::onClickMoreText() diff --git a/indra/newview/llconversationloglist.cpp b/indra/newview/llconversationloglist.cpp index 97b16a5e93..4f30ccfa07 100644 --- a/indra/newview/llconversationloglist.cpp +++ b/indra/newview/llconversationloglist.cpp @@ -93,8 +93,8 @@ BOOL LLConversationLogList::handleRightMouseDown(S32 x, S32 y, MASK mask) LLToggleableMenu* context_menu = mContextMenu.get(); { context_menu->buildDrawLabels(); - if (context_menu && size()) - context_menu->updateParent(LLMenuGL::sMenuContainer); + if (context_menu && size()) + context_menu->updateParent(LLMenuGL::sMenuContainer); LLMenuGL::showPopup(this, context_menu, x, y); } diff --git a/indra/newview/llfloaterregioninfo.cpp b/indra/newview/llfloaterregioninfo.cpp index a24f04ccfb..7e9d0467f6 100644 --- a/indra/newview/llfloaterregioninfo.cpp +++ b/indra/newview/llfloaterregioninfo.cpp @@ -3855,7 +3855,7 @@ void LLPanelRegionEnvironment::onChkAllowOverride(bool value) if (LLPanelEstateInfo::isLindenEstate()) notification = "ChangeLindenEstate"; - LLSD args; + LLSD args; args["ESTATENAME"] = LLEstateInfoModel::instance().getName(); LLNotification::Params params(notification); params.substitutions(args); diff --git a/indra/newview/llmediadataclient.cpp b/indra/newview/llmediadataclient.cpp index 9d0f62a30d..dabbe3a05d 100644 --- a/indra/newview/llmediadataclient.cpp +++ b/indra/newview/llmediadataclient.cpp @@ -204,7 +204,7 @@ bool LLMediaDataClient::isInQueue(const LLMediaDataClientObject::ptr_t &object) if (std::find_if(mUnQueuedRequests.begin(), mUnQueuedRequests.end(), upred) != mUnQueuedRequests.end()) return true; - return false; + return false; } void LLMediaDataClient::removeFromQueue(const LLMediaDataClientObject::ptr_t &object) @@ -829,7 +829,7 @@ bool LLObjectMediaDataClient::isInQueue(const LLMediaDataClientObject::ptr_t &ob if (std::find_if(mRoundRobinQueue.begin(), mRoundRobinQueue.end(), PredicateMatchRequest(object->getID())) != mRoundRobinQueue.end()) return true; - return false; + return false; } void LLObjectMediaDataClient::removeFromQueue(const LLMediaDataClientObject::ptr_t &object) diff --git a/indra/newview/llvoicevivox.cpp b/indra/newview/llvoicevivox.cpp index 3725510b6a..a6002715bb 100644 --- a/indra/newview/llvoicevivox.cpp +++ b/indra/newview/llvoicevivox.cpp @@ -5994,7 +5994,7 @@ LLVivoxVoiceClient::sessionState::~sessionState() if (mMyIterator != mSession.end()) mSession.erase(mMyIterator); - removeAllParticipants(); + removeAllParticipants(); } bool LLVivoxVoiceClient::sessionState::isCallBackPossible() -- cgit v1.2.3 From 7f091b864e5ec8c574971cc4a839d95c52c26b58 Mon Sep 17 00:00:00 2001 From: Erik Kundiman Date: Wed, 12 Jul 2023 16:47:32 +0800 Subject: Include standard library array header as it's not implied on some platforms that std::array would be unrecognised. --- indra/llaudio/llaudioengine.h | 1 + indra/newview/llenvironment.h | 2 ++ indra/newview/llimview.cpp | 2 ++ 3 files changed, 5 insertions(+) (limited to 'indra') diff --git a/indra/llaudio/llaudioengine.h b/indra/llaudio/llaudioengine.h index 0fe8b3d756..cf694cfaf4 100755 --- a/indra/llaudio/llaudioengine.h +++ b/indra/llaudio/llaudioengine.h @@ -30,6 +30,7 @@ #include #include +#include #include "v3math.h" #include "v3dmath.h" diff --git a/indra/newview/llenvironment.h b/indra/newview/llenvironment.h index 64fd170e43..1175baa828 100644 --- a/indra/newview/llenvironment.h +++ b/indra/newview/llenvironment.h @@ -27,6 +27,8 @@ #ifndef LL_ENVIRONMENT_H #define LL_ENVIRONMENT_H +#include + #include "llsingleton.h" #include "llmemory.h" #include "llsd.h" diff --git a/indra/newview/llimview.cpp b/indra/newview/llimview.cpp index 6880cf2171..2d22dc8212 100644 --- a/indra/newview/llimview.cpp +++ b/indra/newview/llimview.cpp @@ -24,6 +24,8 @@ * $/LicenseInfo$ */ +#include + #include "llviewerprecompiledheaders.h" #include "llimview.h" -- cgit v1.2.3 From 08b0528312c8dc90c7564634909ef49752a4f90a Mon Sep 17 00:00:00 2001 From: Erik Kundiman Date: Wed, 12 Jul 2023 17:15:57 +0800 Subject: DAE class declarations are when not on system libs cause they would cause ambiguity with system COLLADA DOM classes. --- indra/llprimitive/lldaeloader.h | 2 ++ indra/llprimitive/llmodel.h | 2 ++ 2 files changed, 4 insertions(+) (limited to 'indra') diff --git a/indra/llprimitive/lldaeloader.h b/indra/llprimitive/lldaeloader.h index 2b211343e1..e99fc51ee9 100644 --- a/indra/llprimitive/lldaeloader.h +++ b/indra/llprimitive/lldaeloader.h @@ -29,6 +29,7 @@ #include "llmodelloader.h" +#ifndef LL_USESYSTEMLIBS class DAE; class daeElement; class domProfile_COMMON; @@ -38,6 +39,7 @@ class domTranslate; class domController; class domSkin; class domMesh; +#endif class LLDAELoader : public LLModelLoader { diff --git a/indra/llprimitive/llmodel.h b/indra/llprimitive/llmodel.h index 4505d6b3b9..6a4a4927b6 100644 --- a/indra/llprimitive/llmodel.h +++ b/indra/llprimitive/llmodel.h @@ -35,8 +35,10 @@ #include +#ifndef LL_USESYSTEMLIBS class daeElement; class domMesh; +#endif #define MAX_MODEL_FACES 8 -- cgit v1.2.3 From 9dd2b858e8a60c8f31a491b04d7d0388fb80a852 Mon Sep 17 00:00:00 2001 From: Erik Kundiman Date: Wed, 12 Jul 2023 17:20:48 +0800 Subject: Cast COLLADA dom instance as instructed on its doc which can be found too in the system COLLADA DOM headers. --- indra/llprimitive/lldaeloader.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'indra') diff --git a/indra/llprimitive/lldaeloader.cpp b/indra/llprimitive/lldaeloader.cpp index 752a850d42..dead788fbe 100644 --- a/indra/llprimitive/lldaeloader.cpp +++ b/indra/llprimitive/lldaeloader.cpp @@ -943,12 +943,20 @@ bool LLDAELoader::OpenFile(const std::string& filename) domCOLLADA* dom; if (mPreprocessDAE) { +#ifdef LL_USESYSTEMLIBS + dom = static_cast(dae.openFromMemory(uri_filename, preprocessDAE(filename).c_str())); +#else dom = dae.openFromMemory(uri_filename, preprocessDAE(filename).c_str()); +#endif } else { LL_INFOS() << "Skipping dae preprocessing" << LL_ENDL; +#ifdef LL_USESYSTEMLIBS + dom = static_cast(dae.open(uri_filename)); +#else dom = dae.open(uri_filename); +#endif } if (!dom) -- cgit v1.2.3 From 1063416e8dcffe623f4d8a94c913ffc1fa048b6a Mon Sep 17 00:00:00 2001 From: Erik Kundiman Date: Wed, 12 Jul 2023 17:35:46 +0800 Subject: Use C++14 specifically on DAE loader When using system vanilla COLLADA DOM, it still uses std::auto_ptr which is deprecated in C++17. --- indra/llprimitive/CMakeLists.txt | 2 ++ 1 file changed, 2 insertions(+) (limited to 'indra') diff --git a/indra/llprimitive/CMakeLists.txt b/indra/llprimitive/CMakeLists.txt index b6e8773d03..3a3de75cd0 100644 --- a/indra/llprimitive/CMakeLists.txt +++ b/indra/llprimitive/CMakeLists.txt @@ -67,6 +67,8 @@ target_link_libraries(llprimitive ) if (NOT (USE_AUTOBUILD_3P OR USE_CONAN)) + set_source_files_properties(lldaeloader.cpp PROPERTIES COMPILE_FLAGS + -std=c++14) add_subdirectory(llphysicsextensions) endif () -- cgit v1.2.3 From e08b527caf6462f2fe94130249aec8ad44a8c83e Mon Sep 17 00:00:00 2001 From: Erik Kundiman Date: Wed, 12 Jul 2023 17:04:41 +0800 Subject: FreeBSD follows Darwin & Linux on llplugin --- indra/llplugin/llpluginsharedmemory.cpp | 2 ++ indra/llplugin/slplugin/slplugin.cpp | 6 +++--- 2 files changed, 5 insertions(+), 3 deletions(-) (limited to 'indra') diff --git a/indra/llplugin/llpluginsharedmemory.cpp b/indra/llplugin/llpluginsharedmemory.cpp index 63ff5085c6..c4e70f51e0 100644 --- a/indra/llplugin/llpluginsharedmemory.cpp +++ b/indra/llplugin/llpluginsharedmemory.cpp @@ -47,6 +47,8 @@ #define USE_SHM_OPEN_SHARED_MEMORY 1 #elif LL_LINUX #define USE_SHM_OPEN_SHARED_MEMORY 1 +#elif LL_FREEBSD + #define USE_SHM_OPEN_SHARED_MEMORY 1 #endif diff --git a/indra/llplugin/slplugin/slplugin.cpp b/indra/llplugin/slplugin/slplugin.cpp index 5c54705c71..3e9dc8cd31 100644 --- a/indra/llplugin/slplugin/slplugin.cpp +++ b/indra/llplugin/slplugin/slplugin.cpp @@ -46,7 +46,7 @@ using namespace std; #include "slplugin-objc.h" #endif -#if LL_DARWIN || LL_LINUX +#if LL_DARWIN || LL_LINUX || LL_FREEBSD #include #endif @@ -64,7 +64,7 @@ using namespace std; Now that SLPlugin is a bundled app on the Mac, this is no longer necessary (it can just use a regular Info.plist file), but I'm leaving this comment in for posterity. */ -#if LL_DARWIN || LL_LINUX +#if LL_DARWIN || LL_LINUX || LL_FREEBSD // Signal handlers to make crashes not show an OS dialog... static void crash_handler(int sig) { @@ -182,7 +182,7 @@ int main(int argc, char **argv) // display a crash message if something bad happens. The host app will // see the missing heartbeat and log appropriately. initExceptionHandler(); -#elif LL_DARWIN || LL_LINUX +#elif LL_DARWIN || LL_LINUX || LL_FREEBSD if(argc < 2) { LL_ERRS("slplugin") << "usage: " << argv[0] << " launcher_port" << LL_ENDL; -- cgit v1.2.3 From 40cd23e1aebdf0d1e7f7295f24970af25bc18983 Mon Sep 17 00:00:00 2001 From: Erik Kundiman Date: Wed, 12 Jul 2023 18:59:35 +0800 Subject: stricmp needs to be defined on FreeBSD too --- indra/llcommon/llpreprocessor.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'indra') diff --git a/indra/llcommon/llpreprocessor.h b/indra/llcommon/llpreprocessor.h index dc586b0008..5df5dd8302 100644 --- a/indra/llcommon/llpreprocessor.h +++ b/indra/llcommon/llpreprocessor.h @@ -80,7 +80,7 @@ #endif // Deal with minor differences on Unixy OSes. -#if LL_DARWIN || LL_LINUX +#if LL_DARWIN || LL_LINUX || LL_FREEBSD // Different name, same functionality. #define stricmp strcasecmp #define strnicmp strncasecmp -- cgit v1.2.3 From 59eb9cc368b359c069f1ddb187ea23aff4808d1c Mon Sep 17 00:00:00 2001 From: Erik Kundiman Date: Wed, 12 Jul 2023 17:08:29 +0800 Subject: Mac frameworks not linked for "the remaining" OSes --- indra/cmake/Linking.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'indra') diff --git a/indra/cmake/Linking.cmake b/indra/cmake/Linking.cmake index 4a501f420b..14b5e76877 100644 --- a/indra/cmake/Linking.cmake +++ b/indra/cmake/Linking.cmake @@ -64,7 +64,7 @@ elseif (WINDOWS) dbghelp legacy_stdio_definitions ) -else() +elseif (DARWIN) include(CMakeFindFrameworks) find_library(COREFOUNDATION_LIBRARY CoreFoundation) find_library(CARBON_LIBRARY Carbon) -- cgit v1.2.3 From 0f9aee9e992c34dccdb012a554a013d94437ebc5 Mon Sep 17 00:00:00 2001 From: Erik Kundiman Date: Wed, 12 Jul 2023 19:02:48 +0800 Subject: Undefine Status on FreeBSD too Otherwise we'd get this. error: declaration of anonymous struct must be a definition struct Status ^ indra/llcommon/llprocess.h:284:2: warning: declaration does not declare anything [-Wmissing-declarations] --- indra/llcommon/llprocess.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'indra') diff --git a/indra/llcommon/llprocess.h b/indra/llcommon/llprocess.h index e3386ad88e..9555df9bba 100644 --- a/indra/llcommon/llprocess.h +++ b/indra/llcommon/llprocess.h @@ -40,7 +40,7 @@ #if LL_WINDOWS #include "llwin32headerslean.h" // for HANDLE -#elif LL_LINUX +#elif LL_LINUX || LL_FREEBSD #if defined(Status) #undef Status #endif -- cgit v1.2.3 From 2c31cc45d4e41c42a8940bdefb79eae9d85d8fd7 Mon Sep 17 00:00:00 2001 From: Erik Kundiman Date: Wed, 19 Jul 2023 13:04:12 +0800 Subject: Pass texture entry pointer instead to copyTexture Otherwise on GCC the -Waddress & -Wno-nonnull-compare warnings would be treated as errors. It's a different term on Clang, which is undefined bool conversion. On Clang it's just a warning, but on AppleClang it's treated as an error. Rather than suppressing these warnings, I think it's better to just adjust the interface of copyTexture, since it isn't called that many times. --- indra/llprimitive/llprimitive.cpp | 4 ++-- indra/llprimitive/llprimtexturelist.cpp | 6 +++--- indra/llprimitive/llprimtexturelist.h | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) (limited to 'indra') diff --git a/indra/llprimitive/llprimitive.cpp b/indra/llprimitive/llprimitive.cpp index 67c225d25d..6ee438d181 100644 --- a/indra/llprimitive/llprimitive.cpp +++ b/indra/llprimitive/llprimitive.cpp @@ -263,7 +263,7 @@ void LLPrimitive::setAllTETextures(const LLUUID &tex_id) //=============================================================== void LLPrimitive::setTE(const U8 index, const LLTextureEntry& te) { - if(mTextureList.copyTexture(index, te) != TEM_CHANGE_NONE && te.getBumpmap() > 0) + if(mTextureList.copyTexture(index, &te) != TEM_CHANGE_NONE && te.getBumpmap() > 0) { mNumBumpmapTEs++; } @@ -742,7 +742,7 @@ void LLPrimitive::copyTEs(const LLPrimitive *primitivep) } for (i = 0; i < num_tes; i++) { - mTextureList.copyTexture(i, *(primitivep->getTE(i))); + mTextureList.copyTexture(i, primitivep->getTE(i)); } } diff --git a/indra/llprimitive/llprimtexturelist.cpp b/indra/llprimitive/llprimtexturelist.cpp index f4f08248b8..b50c541488 100644 --- a/indra/llprimitive/llprimtexturelist.cpp +++ b/indra/llprimitive/llprimtexturelist.cpp @@ -125,7 +125,7 @@ void LLPrimTextureList::take(LLPrimTextureList& other_list) // virtual // copies LLTextureEntry 'te' // returns TEM_CHANGE_TEXTURE if successful, otherwise TEM_CHANGE_NONE -S32 LLPrimTextureList::copyTexture(const U8 index, const LLTextureEntry& te) +S32 LLPrimTextureList::copyTexture(const U8 index, const LLTextureEntry* te) { if (S32(index) >= mEntryList.size()) { @@ -137,9 +137,9 @@ S32 LLPrimTextureList::copyTexture(const U8 index, const LLTextureEntry& te) // we're changing an existing entry llassert(mEntryList[index]); delete (mEntryList[index]); - if (&te) + if (te) { - mEntryList[index] = te.newCopy(); + mEntryList[index] = te->newCopy(); } else { diff --git a/indra/llprimitive/llprimtexturelist.h b/indra/llprimitive/llprimtexturelist.h index 49c636e40f..a5f32bada6 100644 --- a/indra/llprimitive/llprimtexturelist.h +++ b/indra/llprimitive/llprimtexturelist.h @@ -71,7 +71,7 @@ public: // copies LLTextureEntry 'te' // returns TEM_CHANGE_TEXTURE if successful, otherwise TEM_CHANGE_NONE - S32 copyTexture(const U8 index, const LLTextureEntry& te); + S32 copyTexture(const U8 index, const LLTextureEntry* te); // takes ownership of LLTextureEntry* 'te' // returns TEM_CHANGE_TEXTURE if successful, otherwise TEM_CHANGE_NONE -- cgit v1.2.3 From 1ada8b037676e39f7664dc8339f2828949b05aa0 Mon Sep 17 00:00:00 2001 From: Erik Kundiman Date: Wed, 12 Jul 2023 19:12:59 +0800 Subject: Disable packages info when using system libraries For now. Maybe. --- indra/newview/CMakeLists.txt | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'indra') diff --git a/indra/newview/CMakeLists.txt b/indra/newview/CMakeLists.txt index b24f643929..c6dc0e7c96 100644 --- a/indra/newview/CMakeLists.txt +++ b/indra/newview/CMakeLists.txt @@ -9,7 +9,9 @@ include(Linking) include(Boost) include(bugsplat) +if (USE_AUTOBUILD_3P OR USE_CONAN) include(BuildPackagesInfo) +endif () include(BuildVersion) include(CMakeCopyIfDifferent) if (USE_AUTOBUILD_3P OR USE_CONAN) @@ -1617,6 +1619,10 @@ set(viewer_APPSETTINGS_FILES featuretable_mac.txt ) +if (NOT (USE_AUTOBUILD_3P OR USE_CONAN)) + list(REMOVE_ITEM viewer_APPSETTINGS_FILES packages-info.txt) +endif () + source_group("App Settings" FILES ${viewer_APPSETTINGS_FILES}) set_source_files_properties(${viewer_APPSETTINGS_FILES} -- cgit v1.2.3 From 7b80e038829bb5055f20020b7960ce332af28116 Mon Sep 17 00:00:00 2001 From: Erik Kundiman Date: Wed, 12 Jul 2023 19:56:06 +0800 Subject: Fix lod variable name (supposed to be which_lod?) --- indra/newview/llmodelpreview.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'indra') diff --git a/indra/newview/llmodelpreview.cpp b/indra/newview/llmodelpreview.cpp index e1a5b22490..6c7d51af9a 100644 --- a/indra/newview/llmodelpreview.cpp +++ b/indra/newview/llmodelpreview.cpp @@ -1715,7 +1715,7 @@ void LLModelPreview::genMeshOptimizerLODs(S32 which_lod, S32 meshopt_mode, U32 d out << "Invalid level of detail: " << which_lod; LL_WARNS() << out.str() << LL_ENDL; LLFloaterModelPreview::addStringToLog(out, false); - assert(lod >= -1 && lod < LLModel::NUM_LODS); + assert(which_lod >= -1 && which_lod < LLModel::NUM_LODS); return; } -- cgit v1.2.3 From 658ff1a0a14af93b96de22d3def56b93c0a5abd2 Mon Sep 17 00:00:00 2001 From: Erik Kundiman Date: Wed, 12 Jul 2023 19:43:15 +0800 Subject: Boost since 1.76 already internally includes v5 Including v4 would cause conflicts. --- indra/newview/lllogchat.cpp | 2 ++ 1 file changed, 2 insertions(+) (limited to 'indra') diff --git a/indra/newview/lllogchat.cpp b/indra/newview/lllogchat.cpp index ba82ff0b0f..1dd6ac9339 100644 --- a/indra/newview/lllogchat.cpp +++ b/indra/newview/lllogchat.cpp @@ -41,7 +41,9 @@ #include #include +#ifndef LL_USESYSTEMLIBS #include +#endif #include #if LL_MSVC -- cgit v1.2.3 From 7a2a5c5c0ba9d04528d909f59c2ccfac35412e15 Mon Sep 17 00:00:00 2001 From: Erik Kundiman Date: Wed, 12 Jul 2023 20:11:26 +0800 Subject: Obtain Vorbis & Ogg flags when using system libs On some platforms, pkg-config --libs vorbis might not necessarily imply -logg. vorbisenc & vorbisfile need their own checks anyway. --- indra/cmake/Audio.cmake | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'indra') diff --git a/indra/cmake/Audio.cmake b/indra/cmake/Audio.cmake index 38547bb017..4c1a141dc5 100644 --- a/indra/cmake/Audio.cmake +++ b/indra/cmake/Audio.cmake @@ -4,6 +4,15 @@ include(Prebuilt) include_guard() add_library( ll::vorbis INTERFACE IMPORTED ) +if (NOT (USE_AUTOBUILD_3P OR USE_CONAN)) + include(FindPkgConfig) + pkg_check_modules(Vorbis REQUIRED ogg vorbis vorbisenc vorbisfile) + target_include_directories(ll::vorbis SYSTEM INTERFACE ${Vorbis_INCLUDE_DIRS}) + target_link_directories(ll::vorbis INTERFACE ${Vorbis_LIBRARY_DIRS}) + target_link_libraries(ll::vorbis INTERFACE ${Vorbis_LIBRARIES}) + return () +endif () + use_system_binary(vorbis) use_prebuilt_binary(ogg_vorbis) target_include_directories( ll::vorbis SYSTEM INTERFACE ${LIBS_PREBUILT_DIR}/include ) -- cgit v1.2.3 From 2bce7a67f89184e8741c685b8ae874caabdce4ca Mon Sep 17 00:00:00 2001 From: Erik Kundiman Date: Wed, 12 Jul 2023 19:25:40 +0800 Subject: FreeBSD gets handled too in llappviewer.cpp Mostly following Linux. --- indra/newview/llappviewer.cpp | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) (limited to 'indra') diff --git a/indra/newview/llappviewer.cpp b/indra/newview/llappviewer.cpp index e70fcb6e86..29f1fa6e4d 100644 --- a/indra/newview/llappviewer.cpp +++ b/indra/newview/llappviewer.cpp @@ -131,7 +131,7 @@ #include "stringize.h" #include "llcoros.h" #include "llexception.h" -#if !LL_LINUX +#if !LL_LINUX && !LL_FREEBSD #include "cef/dullahan_version.h" #include "vlc/libvlc_version.h" #endif // LL_LINUX @@ -262,7 +262,7 @@ using namespace LL; // define a self-registering event API object #include "llappviewerlistener.h" -#if LL_LINUX && LL_GTK +#if (LL_LINUX || LL_FREEBSD) && LL_GTK #include "glib.h" #endif // (LL_LINUX) && LL_GTK @@ -308,6 +308,8 @@ S32 gLastExecDuration = -1; // (<0 indicates unknown) # define LL_PLATFORM_KEY "mac" #elif LL_LINUX # define LL_PLATFORM_KEY "lnx" +#elif LL_FREEBSD +# define LL_PLATFORM_KEY "bsd" #else # error "Unknown Platform" #endif @@ -891,7 +893,7 @@ bool LLAppViewer::init() std::string mime_types_name; #if LL_DARWIN mime_types_name = "mime_types_mac.xml"; -#elif LL_LINUX +#elif LL_LINUX || LL_FREEBSD mime_types_name = "mime_types_linux.xml"; #else mime_types_name = "mime_types.xml"; @@ -1751,7 +1753,7 @@ bool LLAppViewer::cleanup() // one because it happens just after mFastTimerLogThread is deleted. This // comment is in case we guessed wrong, so we can move it here instead. -#if LL_LINUX +#if LL_LINUX || LL_FREEBSD // remove any old breakpad minidump files from the log directory if (! isError()) { @@ -3336,7 +3338,7 @@ LLSD LLAppViewer::getViewerInfo() const info["VOICE_VERSION"] = LLTrans::getString("NotConnected"); } -#if !LL_LINUX +#if !LL_LINUX && !LL_FREEBSD std::ostringstream cef_ver_codec; cef_ver_codec << "Dullahan: "; cef_ver_codec << DULLAHAN_VERSION_MAJOR; @@ -3366,7 +3368,7 @@ LLSD LLAppViewer::getViewerInfo() const info["LIBCEF_VERSION"] = "Undefined"; #endif -#if !LL_LINUX +#if !LL_LINUX && !LL_FREEBSD std::ostringstream vlc_ver_codec; vlc_ver_codec << LIBVLC_VERSION_MAJOR; vlc_ver_codec << "."; -- cgit v1.2.3 From 33d8ae7e170d4789db81d4ee467e7913648cf3ed Mon Sep 17 00:00:00 2001 From: Erik Kundiman Date: Wed, 12 Jul 2023 19:40:14 +0800 Subject: FreeBSD gets what Linux does in file picker --- indra/newview/llfilepicker.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'indra') diff --git a/indra/newview/llfilepicker.cpp b/indra/newview/llfilepicker.cpp index f1f156c2e0..0a59f7e148 100644 --- a/indra/newview/llfilepicker.cpp +++ b/indra/newview/llfilepicker.cpp @@ -40,7 +40,7 @@ #include "llwindowsdl.h" // for some X/GTK utils to help with filepickers #endif // LL_SDL -#if LL_LINUX +#if LL_LINUX || LL_FREEBSD #include "llhttpconstants.h" // file picker uses some of thes constants on Linux #endif @@ -1053,7 +1053,7 @@ BOOL LLFilePicker::getSaveFileModeless(ESaveFilter filter, } //END LL_DARWIN -#elif LL_LINUX +#elif LL_LINUX || LL_FREEBSD # if LL_GTK -- cgit v1.2.3 From e7ad9b00ce677fc38f0dec809dc160e7bb307dd2 Mon Sep 17 00:00:00 2001 From: Erik Kundiman Date: Mon, 5 Jun 2023 20:14:03 +0800 Subject: Stubs for missing implementations that use GTK in order to get rid of undefined references to `LLFilePicker::getOpenFileModeless(LLFilePicker::ELoadFilter, void (*)(bool, std::vector >&, void*), void*)' `LLFilePicker::getMultipleOpenFilesModeless(LLFilePicker::ELoadFilter, void (*)(bool, std::vector >&, void*), void*)' `LLFilePicker::getSaveFileModeless(LLFilePicker::ESaveFilter, std::string const&, void (*)(bool, std::string&, void*), void*)' The UI has been relying on modeless file operations. UI implementations for Linux would fall within the GTK scope, and there haven't been implementations for these three methods yet. Even know they're defined using member functions that do nothing, and return boolean false. --- indra/newview/llfilepicker.cpp | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) (limited to 'indra') diff --git a/indra/newview/llfilepicker.cpp b/indra/newview/llfilepicker.cpp index 0a59f7e148..57874c966e 100644 --- a/indra/newview/llfilepicker.cpp +++ b/indra/newview/llfilepicker.cpp @@ -1320,6 +1320,14 @@ static std::string add_save_texture_filter_to_gtkchooser(GtkWindow *picker) return caption; } +BOOL LLFilePicker::getMultipleOpenFilesModeless(ELoadFilter filter, + void (*callback)(bool, std::vector &, void*), + void *userdata ) +{ + LL_ERRS() << "NOT IMPLEMENTED" << LL_ENDL; + return FALSE; +} + BOOL LLFilePicker::getSaveFile( ESaveFilter filter, const std::string& filename, bool blocking ) { BOOL rtn = FALSE; @@ -1437,6 +1445,15 @@ BOOL LLFilePicker::getSaveFile( ESaveFilter filter, const std::string& filename, return rtn; } +BOOL LLFilePicker::getSaveFileModeless(ESaveFilter filter, + const std::string& filename, + void (*callback)(bool, std::string&, void*), + void *userdata) +{ + LL_ERRS() << "NOT IMPLEMENTED" << LL_ENDL; + return FALSE; +} + BOOL LLFilePicker::getOpenFile( ELoadFilter filter, bool blocking ) { BOOL rtn = FALSE; @@ -1499,6 +1516,14 @@ BOOL LLFilePicker::getOpenFile( ELoadFilter filter, bool blocking ) return rtn; } +BOOL LLFilePicker::getOpenFileModeless(ELoadFilter filter, + void (*callback)(bool, std::vector &, void*), + void *userdata) +{ + LL_ERRS() << "NOT IMPLEMENTED" << LL_ENDL; + return FALSE; +} + BOOL LLFilePicker::getMultipleOpenFiles( ELoadFilter filter, bool blocking) { BOOL rtn = FALSE; -- cgit v1.2.3 From b8952a7df228abd03783665ece0e91e2f0fd63bd Mon Sep 17 00:00:00 2001 From: Erik Kundiman Date: Wed, 12 Jul 2023 20:37:38 +0800 Subject: FreeBSD can use lldir_linux too --- indra/llfilesystem/CMakeLists.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'indra') diff --git a/indra/llfilesystem/CMakeLists.txt b/indra/llfilesystem/CMakeLists.txt index 9f24f75eab..23193a30ea 100644 --- a/indra/llfilesystem/CMakeLists.txt +++ b/indra/llfilesystem/CMakeLists.txt @@ -30,7 +30,7 @@ if (DARWIN) LIST(APPEND llfilesystem_HEADER_FILES lldir_mac.h) endif (DARWIN) -if (LINUX) +if (LINUX OR CMAKE_SYSTEM_NAME MATCHES "FreeBSD") LIST(APPEND llfilesystem_SOURCE_FILES lldir_linux.cpp) LIST(APPEND llfilesystem_HEADER_FILES lldir_linux.h) @@ -40,7 +40,7 @@ if (LINUX) "-DAPP_RO_DATA_DIR=\\\"${APP_SHARE_DIR}\\\"" ) endif (INSTALL) -endif (LINUX) +endif (LINUX OR CMAKE_SYSTEM_NAME MATCHES "FreeBSD") if (WINDOWS) LIST(APPEND llfilesystem_SOURCE_FILES lldir_win32.cpp) -- cgit v1.2.3 From 8356386f6674cf7f1e25bcd49f3266868cd5dc7d Mon Sep 17 00:00:00 2001 From: Erik Kundiman Date: Wed, 12 Jul 2023 21:28:49 +0800 Subject: FreeBSD can use llappviewerlinux too --- indra/newview/CMakeLists.txt | 4 ++-- indra/newview/llappviewerlinux.cpp | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) (limited to 'indra') diff --git a/indra/newview/CMakeLists.txt b/indra/newview/CMakeLists.txt index c6dc0e7c96..6a1c975a00 100644 --- a/indra/newview/CMakeLists.txt +++ b/indra/newview/CMakeLists.txt @@ -1411,7 +1411,7 @@ if (DARWIN) list(APPEND viewer_SOURCE_FILES ${viewer_RESOURCE_FILES}) endif (DARWIN) -if (LINUX) +if (LINUX OR CMAKE_SYSTEM_NAME MATCHES "FreeBSD") LIST(APPEND viewer_SOURCE_FILES llappviewerlinux.cpp) set_source_files_properties( llappviewerlinux.cpp @@ -1421,7 +1421,7 @@ if (LINUX) LIST(APPEND viewer_SOURCE_FILES llappviewerlinux_api_dbus.cpp) SET(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -Wl,--as-needed") -endif (LINUX) +endif (LINUX OR CMAKE_SYSTEM_NAME MATCHES "FreeBSD") if (WINDOWS) list(APPEND viewer_SOURCE_FILES diff --git a/indra/newview/llappviewerlinux.cpp b/indra/newview/llappviewerlinux.cpp index a110828967..ad246ae64d 100644 --- a/indra/newview/llappviewerlinux.cpp +++ b/indra/newview/llappviewerlinux.cpp @@ -330,7 +330,7 @@ void LLAppViewerLinux::initCrashReporting(bool reportFreeze) { std::string cmd =gDirUtilp->getExecutableDir(); cmd += gDirUtilp->getDirDelimiter(); -#if LL_LINUX +#if LL_LINUX || LL_FREEBSD cmd += "linux-crash-logger.bin"; #else # error Unknown platform -- cgit v1.2.3 From 0a54998432f7848ffad50e357ee5dc0de6f208a7 Mon Sep 17 00:00:00 2001 From: Erik Kundiman Date: Wed, 19 Jul 2023 16:05:19 +0800 Subject: Comment out unused variables whether set or not Otherwise GCC would treat them as errors, if not suppressed. --- indra/newview/llface.cpp | 2 +- indra/newview/llmanip.cpp | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) (limited to 'indra') diff --git a/indra/newview/llface.cpp b/indra/newview/llface.cpp index c3b3ccabb4..e1edc38923 100644 --- a/indra/newview/llface.cpp +++ b/indra/newview/llface.cpp @@ -924,7 +924,7 @@ BOOL LLFace::genVolumeBBoxes(const LLVolume &volume, S32 f, //VECTORIZE THIS LLMatrix4a mat_vert; mat_vert.loadu(mat_vert_in); - LLVector4a new_extents[2]; + //LLVector4a new_extents[2]; llassert(less_than_max_mag(face.mExtents[0])); llassert(less_than_max_mag(face.mExtents[1])); diff --git a/indra/newview/llmanip.cpp b/indra/newview/llmanip.cpp index 6589aa477f..f551eea014 100644 --- a/indra/newview/llmanip.cpp +++ b/indra/newview/llmanip.cpp @@ -568,8 +568,10 @@ void LLManip::renderTickValue(const LLVector3& pos, F32 value, const std::string gGL.scalef(inv_zoom_amt, inv_zoom_amt, inv_zoom_amt); } + /* LLColor4 shadow_color = LLColor4::black; shadow_color.mV[VALPHA] = color.mV[VALPHA] * 0.5f; + */ if (fractional_portion != 0) { -- cgit v1.2.3 From 6bcebc33c49f4f1b6180640329793e55026da540 Mon Sep 17 00:00:00 2001 From: Erik Kundiman Date: Wed, 19 Jul 2023 16:06:10 +0800 Subject: vefifySSLCert truth is enough for setVerifySSLHost The function takes a boolean argument anyway. This is so we don't get GCC int in bool context warning which would be treated as an error. --- indra/newview/llxmlrpctransaction.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'indra') diff --git a/indra/newview/llxmlrpctransaction.cpp b/indra/newview/llxmlrpctransaction.cpp index 8d178dbbdc..8baddac121 100644 --- a/indra/newview/llxmlrpctransaction.cpp +++ b/indra/newview/llxmlrpctransaction.cpp @@ -377,7 +377,7 @@ void LLXMLRPCTransaction::Impl::init(XMLRPC_REQUEST request, bool useGzip, const mCertStore = gSavedSettings.getString("CertStore"); httpOpts->setSSLVerifyPeer( vefifySSLCert ); - httpOpts->setSSLVerifyHost( vefifySSLCert ? 2 : 0); + httpOpts->setSSLVerifyHost( vefifySSLCert ); // LLRefCounted starts with a 1 ref, so don't add a ref in the smart pointer httpHeaders = LLCore::HttpHeaders::ptr_t(new LLCore::HttpHeaders()); -- cgit v1.2.3 From 787ffd6b74fb0eb488f936aa7156b7acc1b296eb Mon Sep 17 00:00:00 2001 From: Erik Kundiman Date: Wed, 12 Jul 2023 23:06:02 +0800 Subject: No dangling gsl warning on newview with Clang --- indra/newview/CMakeLists.txt | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'indra') diff --git a/indra/newview/CMakeLists.txt b/indra/newview/CMakeLists.txt index 6a1c975a00..0f5bb57bea 100644 --- a/indra/newview/CMakeLists.txt +++ b/indra/newview/CMakeLists.txt @@ -1930,6 +1930,12 @@ endif() set(ARTWORK_DIR ${CMAKE_CURRENT_SOURCE_DIR} CACHE PATH "Path to artwork files.") +if (CMAKE_CXX_COMPILER_ID MATCHES "Clang") + set_source_files_properties(llappviewerlinux.cpp PROPERTIES + COMPILE_FLAGS -Wno-dangling-gsl + ) +endif () + if (LINUX) set(product SecondLife-${ARCH}-${VIEWER_SHORT_VERSION}.${VIEWER_VERSION_REVISION}) -- cgit v1.2.3 From 13a4d60c18c7bb98a719881ebd601b61d47e8280 Mon Sep 17 00:00:00 2001 From: Erik Kundiman Date: Thu, 13 Jul 2023 08:59:57 +0800 Subject: FreeBSD uses Linux's feature table instead of letting it fallback to the default which would be Window's. When using the default, somehow the viewer launched with no colours even after resetting ~/.secondlife/user_settings/settings.xml. --- indra/newview/llfeaturemanager.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'indra') diff --git a/indra/newview/llfeaturemanager.cpp b/indra/newview/llfeaturemanager.cpp index c7f3ef3490..1b03ec3e71 100644 --- a/indra/newview/llfeaturemanager.cpp +++ b/indra/newview/llfeaturemanager.cpp @@ -62,7 +62,7 @@ #if LL_DARWIN const char FEATURE_TABLE_FILENAME[] = "featuretable_mac.txt"; -#elif LL_LINUX +#elif LL_LINUX || LL_FREEBSD const char FEATURE_TABLE_FILENAME[] = "featuretable_linux.txt"; #else const char FEATURE_TABLE_FILENAME[] = "featuretable.txt"; -- cgit v1.2.3 From 01fdae6fad1391ea7ae4778eb00570eb789b8363 Mon Sep 17 00:00:00 2001 From: Erik Kundiman Date: Thu, 13 Jul 2023 09:09:26 +0800 Subject: Add FreeBSDLocales --- indra/newview/skins/default/xui/da/language_settings.xml | 1 + indra/newview/skins/default/xui/de/language_settings.xml | 1 + indra/newview/skins/default/xui/en/language_settings.xml | 1 + indra/newview/skins/default/xui/es/language_settings.xml | 1 + indra/newview/skins/default/xui/fr/language_settings.xml | 1 + indra/newview/skins/default/xui/it/language_settings.xml | 1 + indra/newview/skins/default/xui/ja/language_settings.xml | 1 + indra/newview/skins/default/xui/pl/language_settings.xml | 1 + indra/newview/skins/default/xui/pt/language_settings.xml | 1 + 9 files changed, 9 insertions(+) (limited to 'indra') diff --git a/indra/newview/skins/default/xui/da/language_settings.xml b/indra/newview/skins/default/xui/da/language_settings.xml index 0e3cbfd2d2..fd3fa6c6fd 100644 --- a/indra/newview/skins/default/xui/da/language_settings.xml +++ b/indra/newview/skins/default/xui/da/language_settings.xml @@ -7,6 +7,7 @@ da_DK.UTF-8 da_DK.UTF-8 da_DK.UTF-8 + da_DK.UTF-8 - SECOND LIFE + MEGAPAHIT Second Life Support Portal diff --git a/indra/newview/skins/default/xui/de/strings.xml b/indra/newview/skins/default/xui/de/strings.xml index a9e7626dc5..3f4adf4d4b 100644 --- a/indra/newview/skins/default/xui/de/strings.xml +++ b/indra/newview/skins/default/xui/de/strings.xml @@ -1,8 +1,8 @@ Second Life - Second Life - SECOND LIFE + Megapahit + MEGAPAHIT Second Life-Grid: Second Life Support-Portal Hardware wird erfasst... diff --git a/indra/newview/skins/default/xui/en/strings.xml b/indra/newview/skins/default/xui/en/strings.xml index 01f5b513c7..f71a05a06f 100644 --- a/indra/newview/skins/default/xui/en/strings.xml +++ b/indra/newview/skins/default/xui/en/strings.xml @@ -7,8 +7,8 @@ Second Life - Second Life - SECOND LIFE + Megapahit + MEGAPAHIT Second Life Grid Second Life Support Portal diff --git a/indra/newview/skins/default/xui/es/strings.xml b/indra/newview/skins/default/xui/es/strings.xml index cd8e7687ae..36d9b03efc 100644 --- a/indra/newview/skins/default/xui/es/strings.xml +++ b/indra/newview/skins/default/xui/es/strings.xml @@ -1,6 +1,6 @@ - SECOND LIFE + MEGAPAHIT Portal de Soporte de Second Life Identificando el hardware... Instalando [APP_NAME]... diff --git a/indra/newview/skins/default/xui/fr/strings.xml b/indra/newview/skins/default/xui/fr/strings.xml index 0a3fbeb603..00009b6a05 100644 --- a/indra/newview/skins/default/xui/fr/strings.xml +++ b/indra/newview/skins/default/xui/fr/strings.xml @@ -1,8 +1,8 @@ Second Life - Second Life - SECOND LIFE + Megapahit + MEGAPAHIT Grille de Second Life Portail Assistance Second Life Détection du matériel... diff --git a/indra/newview/skins/default/xui/it/strings.xml b/indra/newview/skins/default/xui/it/strings.xml index 178bb90ca6..49b2b27668 100644 --- a/indra/newview/skins/default/xui/it/strings.xml +++ b/indra/newview/skins/default/xui/it/strings.xml @@ -1,8 +1,8 @@ Second Life - Second Life - SECOND LIFE + Megapahit + MEGAPAHIT Portale di supporto di Second Life Ricerca hardware... Caricamento di [APP_NAME]... diff --git a/indra/newview/skins/default/xui/ja/strings.xml b/indra/newview/skins/default/xui/ja/strings.xml index 367d43fb4c..52b3160815 100644 --- a/indra/newview/skins/default/xui/ja/strings.xml +++ b/indra/newview/skins/default/xui/ja/strings.xml @@ -1,8 +1,8 @@ Second Life - Second Life - SECOND LIFE + Megapahit + MEGAPAHIT Second Life Grid Second Life サポートポータル ハードウェアの検出中です... diff --git a/indra/newview/skins/default/xui/pt/strings.xml b/indra/newview/skins/default/xui/pt/strings.xml index 6db5da2e89..a1ec99ea47 100644 --- a/indra/newview/skins/default/xui/pt/strings.xml +++ b/indra/newview/skins/default/xui/pt/strings.xml @@ -1,6 +1,6 @@ - SECOND LIFE + MEGAPAHIT Portal de Supporte Second Life Detectando hardware... Carregando [APP_NAME]... diff --git a/indra/newview/skins/default/xui/ru/strings.xml b/indra/newview/skins/default/xui/ru/strings.xml index 61d836a2d1..649d5e7107 100644 --- a/indra/newview/skins/default/xui/ru/strings.xml +++ b/indra/newview/skins/default/xui/ru/strings.xml @@ -8,10 +8,10 @@ Second Life - Second Life + Megapahit - SECOND LIFE + MEGAPAHIT Сетка Second Life diff --git a/indra/newview/skins/default/xui/tr/strings.xml b/indra/newview/skins/default/xui/tr/strings.xml index e709a4c5d6..f80d8e3382 100644 --- a/indra/newview/skins/default/xui/tr/strings.xml +++ b/indra/newview/skins/default/xui/tr/strings.xml @@ -8,10 +8,10 @@ Second Life - Second Life + Megapahit - SECOND LIFE + MEGAPAHIT Second Life Ağı -- cgit v1.2.3 From d3c70f1795875c4b84af0f21b5473de152dec9e9 Mon Sep 17 00:00:00 2001 From: Erik Kundiman Date: Sat, 29 Jul 2023 22:00:30 +0800 Subject: Fix CMAKE_PREFIX_PATH setting syntax for Darwin --- indra/cmake/LibVLCPlugin.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'indra') diff --git a/indra/cmake/LibVLCPlugin.cmake b/indra/cmake/LibVLCPlugin.cmake index 271202be4d..f4ec34ec1b 100644 --- a/indra/cmake/LibVLCPlugin.cmake +++ b/indra/cmake/LibVLCPlugin.cmake @@ -12,7 +12,7 @@ set(LIBVLCPLUGIN ON CACHE BOOL else () include(FindPkgConfig) if (DARWIN) - set(CMAKE_PREFIX_PATH /opt/local/libexec/vlc3/lib/pkgconfig) + set(CMAKE_PREFIX_PATH "/opt/local/libexec/vlc3/lib/pkgconfig") pkg_check_modules(Libvlc REQUIRED libvlc) target_link_libraries( ll::libvlc INTERFACE vlccore ) else () -- cgit v1.2.3 From d224330cb78bfe2a766023cbccbe26a471d88712 Mon Sep 17 00:00:00 2001 From: Erik Kundiman Date: Sat, 29 Jul 2023 22:01:11 +0800 Subject: Darwin escapes prebuilt dir inclusion on sys libs --- indra/cmake/UI.cmake | 2 ++ 1 file changed, 2 insertions(+) (limited to 'indra') diff --git a/indra/cmake/UI.cmake b/indra/cmake/UI.cmake index 1bb19e59a2..03bdf4e434 100644 --- a/indra/cmake/UI.cmake +++ b/indra/cmake/UI.cmake @@ -55,7 +55,9 @@ if( WINDOWS ) ) endif() +if (USE_AUTOBUILD_3P OR USE_CONAN) target_include_directories( ll::uilibraries SYSTEM INTERFACE ${LIBS_PREBUILT_DIR}/include ) +endif () -- cgit v1.2.3 From f711733280410c40cf3e96de43692b34cebed186 Mon Sep 17 00:00:00 2001 From: Erik Kundiman Date: Sat, 29 Jul 2023 22:35:19 +0800 Subject: Add system XMLRPC-EPI include directory for Darwin --- indra/cmake/XmlRpcEpi.cmake | 1 + 1 file changed, 1 insertion(+) (limited to 'indra') diff --git a/indra/cmake/XmlRpcEpi.cmake b/indra/cmake/XmlRpcEpi.cmake index b7d2fa6ce6..ae2ed6a83f 100644 --- a/indra/cmake/XmlRpcEpi.cmake +++ b/indra/cmake/XmlRpcEpi.cmake @@ -17,5 +17,6 @@ target_include_directories( ll::xmlrpc-epi SYSTEM INTERFACE ${LIBS_PREBUILT_DIR} elseif (LINUX) target_include_directories( ll::xmlrpc-epi SYSTEM INTERFACE /usr/include/xmlrpc-epi) elseif (DARWIN) +target_include_directories( ll::xmlrpc-epi SYSTEM INTERFACE /usr/local/include) target_link_directories( ll::xmlrpc-epi SYSTEM INTERFACE /usr/local/lib) endif () -- cgit v1.2.3 From 9aac948d59cee9bce12098b060d94aeba33efa86 Mon Sep 17 00:00:00 2001 From: Erik Kundiman Date: Sun, 30 Jul 2023 17:26:55 +0800 Subject: llplugin not refer to gSavedSettings when no CEF so SLPlugin wouldn't lose reference to it when the libraries are built as dynamic. --- indra/llplugin/llpluginclassmedia.cpp | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'indra') diff --git a/indra/llplugin/llpluginclassmedia.cpp b/indra/llplugin/llpluginclassmedia.cpp index 3e72710366..e0b3f6ef56 100644 --- a/indra/llplugin/llpluginclassmedia.cpp +++ b/indra/llplugin/llpluginclassmedia.cpp @@ -33,7 +33,9 @@ #include "llpluginmessageclasses.h" #include "llcontrol.h" +#ifndef LL_USESYSTEMLIBS extern LLControlGroup gSavedSettings; +#endif #if LL_DARWIN extern BOOL gHiDPISupport; #endif @@ -934,8 +936,10 @@ void LLPluginClassMedia::setUserDataPath(const std::string &user_data_path_cache message.setValue("username", username); // cef shares cache between users but creates user-based contexts message.setValue("cef_log_file", user_data_path_cef_log); +#ifndef LL_USESYSTEMLIBS bool cef_verbose_log = gSavedSettings.getBOOL("CefVerboseLog"); message.setValueBoolean("cef_verbose_log", cef_verbose_log); +#endif sendMessage(message); } -- cgit v1.2.3 From e08ad14176502a8cc26b401c48b7161ce8c39140 Mon Sep 17 00:00:00 2001 From: Erik Kundiman Date: Sun, 30 Jul 2023 19:02:54 +0800 Subject: SLPlugin is in libexec when installed to system --- indra/cmake/UnixInstall.cmake | 4 ++++ indra/llfilesystem/CMakeLists.txt | 2 +- indra/llfilesystem/lldir_linux.cpp | 4 ++++ indra/llplugin/slplugin/CMakeLists.txt | 4 ++++ 4 files changed, 13 insertions(+), 1 deletion(-) (limited to 'indra') diff --git a/indra/cmake/UnixInstall.cmake b/indra/cmake/UnixInstall.cmake index ecec0e3417..55b6889836 100644 --- a/indra/cmake/UnixInstall.cmake +++ b/indra/cmake/UnixInstall.cmake @@ -28,4 +28,8 @@ if (INSTALL) set(APP_SHARE_DIR ${INSTALL_SHARE_DIR}/${VIEWER_BINARY_NAME} CACHE PATH "Installation directory for read-only data files.") + + set(APP_LIBEXEC_DIR ${INSTALL_PREFIX}/libexec/${VIEWER_BINARY_NAME} + CACHE PATH + "Installation directory for non-manual executables.") endif (INSTALL) diff --git a/indra/llfilesystem/CMakeLists.txt b/indra/llfilesystem/CMakeLists.txt index 6e9cec9085..9a69a833c0 100644 --- a/indra/llfilesystem/CMakeLists.txt +++ b/indra/llfilesystem/CMakeLists.txt @@ -37,7 +37,7 @@ if (LINUX OR CMAKE_SYSTEM_NAME MATCHES "FreeBSD") if (INSTALL) set_source_files_properties(lldir_linux.cpp PROPERTIES COMPILE_FLAGS - "-DAPP_RO_DATA_DIR=\\\"${APP_SHARE_DIR}\\\"" + "-DAPP_RO_DATA_DIR=\\\"${APP_SHARE_DIR}\\\" -DAPP_LIBEXEC_DIR=\\\"${APP_LIBEXEC_DIR}\\\"" ) endif (INSTALL) endif (LINUX OR CMAKE_SYSTEM_NAME MATCHES "FreeBSD") diff --git a/indra/llfilesystem/lldir_linux.cpp b/indra/llfilesystem/lldir_linux.cpp index 80ad05345a..300cab39d6 100644 --- a/indra/llfilesystem/lldir_linux.cpp +++ b/indra/llfilesystem/lldir_linux.cpp @@ -83,7 +83,11 @@ LLDir_Linux::LLDir_Linux() mExecutableFilename = ""; mExecutablePathAndName = ""; +#ifdef APP_LIBEXEC_DIR + mExecutableDir = APP_LIBEXEC_DIR; +#else mExecutableDir = tmp_str; +#endif mWorkingDir = tmp_str; #ifdef APP_RO_DATA_DIR mAppRODataDir = APP_RO_DATA_DIR; diff --git a/indra/llplugin/slplugin/CMakeLists.txt b/indra/llplugin/slplugin/CMakeLists.txt index f1a75ff97f..871d858b58 100644 --- a/indra/llplugin/slplugin/CMakeLists.txt +++ b/indra/llplugin/slplugin/CMakeLists.txt @@ -65,6 +65,10 @@ if (BUILD_SHARED_LIBS) "${LINK_FLAGS_RELEASE} -Wl,--allow-shlib-undefined") endif () +if (INSTALL) + install(TARGETS ${PROJECT_NAME} DESTINATION ${APP_LIBEXEC_DIR}) +endif () + if (LL_TESTS) ll_deploy_sharedlibs_command(SLPlugin) endif (LL_TESTS) -- cgit v1.2.3 From 9a16a223d3cd61a65871fe828e302f5e082bd1fb Mon Sep 17 00:00:00 2001 From: Erik Kundiman Date: Sun, 30 Jul 2023 20:14:16 +0800 Subject: libmedia_plugin_libvlc is installed to system too libmedia_plugin_base is now explicitly set as static, since it could be set as shared when BUILD_SHARED_LIBS is on and it's just easier to have it compiled into with every media plugin cause it's small and would only be shared by 2 dynamic libraries anyway. Trying to put a dynamic version where the media plugin can find it so the reference is not broken, seems like a hassle. --- indra/media_plugins/base/CMakeLists.txt | 1 + indra/media_plugins/libvlc/CMakeLists.txt | 4 ++++ 2 files changed, 5 insertions(+) (limited to 'indra') diff --git a/indra/media_plugins/base/CMakeLists.txt b/indra/media_plugins/base/CMakeLists.txt index 64b6a4228d..593aa982f1 100644 --- a/indra/media_plugins/base/CMakeLists.txt +++ b/indra/media_plugins/base/CMakeLists.txt @@ -31,6 +31,7 @@ set(media_plugin_base_HEADER_FILES ) add_library(media_plugin_base + STATIC ${media_plugin_base_SOURCE_FILES} ) diff --git a/indra/media_plugins/libvlc/CMakeLists.txt b/indra/media_plugins/libvlc/CMakeLists.txt index a3c1c4ef99..cdaf3efbfa 100644 --- a/indra/media_plugins/libvlc/CMakeLists.txt +++ b/indra/media_plugins/libvlc/CMakeLists.txt @@ -55,3 +55,7 @@ if (DARWIN) ) endif (DARWIN) + +if (INSTALL) + install(TARGETS ${PROJECT_NAME} DESTINATION ${APP_LIBEXEC_DIR}/llplugin) +endif () -- cgit v1.2.3 From d02fa6d02e25cdf955dabd2ff3c63925ba15afa5 Mon Sep 17 00:00:00 2001 From: Erik Kundiman Date: Tue, 1 Aug 2023 09:14:47 +0800 Subject: llaudio can be installed to the system too --- indra/llaudio/CMakeLists.txt | 2 ++ 1 file changed, 2 insertions(+) (limited to 'indra') diff --git a/indra/llaudio/CMakeLists.txt b/indra/llaudio/CMakeLists.txt index 4f469b9bb5..f36da83c69 100644 --- a/indra/llaudio/CMakeLists.txt +++ b/indra/llaudio/CMakeLists.txt @@ -69,3 +69,5 @@ endif() if( TARGET ll::fmodstudio ) target_link_libraries( llaudio ll::fmodstudio ) endif() + +include(LibraryInstall) -- cgit v1.2.3 From 7aa0299d38dd8fdef9d7e722e94db84c7b2fb5f4 Mon Sep 17 00:00:00 2001 From: Erik Kundiman Date: Tue, 1 Aug 2023 09:30:00 +0800 Subject: Set so dangling pointer is no error when using GCC --- indra/llmath/CMakeLists.txt | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'indra') diff --git a/indra/llmath/CMakeLists.txt b/indra/llmath/CMakeLists.txt index fe13d17fce..de00843be3 100644 --- a/indra/llmath/CMakeLists.txt +++ b/indra/llmath/CMakeLists.txt @@ -104,6 +104,12 @@ include_directories(${CMAKE_SOURCE_DIR}/llmeshoptimizer) target_link_libraries(llmath llcommon) target_include_directories( llmath INTERFACE ${CMAKE_CURRENT_SOURCE_DIR}) +if (USESYSTEMLIBS) + AND CMAKE_CXX_COMPILER_ID MATCHES "GNU") + set_source_files_properties(llcalc.cpp PROPERTIES + COMPILE_FLAGS -Wno-dangling-pointer) +endif () + include(LibraryInstall) # Add tests -- cgit v1.2.3 From fee49238c386e89e2530da86e31ff582337025a7 Mon Sep 17 00:00:00 2001 From: Erik Kundiman Date: Tue, 1 Aug 2023 09:33:43 +0800 Subject: Initialise vars so they wouldn't be errors on GCC --- indra/llcommon/llprocessor.cpp | 2 +- indra/llwindow/llwindow.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'indra') diff --git a/indra/llcommon/llprocessor.cpp b/indra/llcommon/llprocessor.cpp index b3c05f5960..cfa85ac2fd 100644 --- a/indra/llcommon/llprocessor.cpp +++ b/indra/llcommon/llprocessor.cpp @@ -961,7 +961,7 @@ private: LLPI_SET_INFO_INT(eModel, "model"); - S32 family; + S32 family = 0; if (!cpuinfo["cpu family"].empty() && LLStringUtil::convertToS32(cpuinfo["cpu family"], family)) { diff --git a/indra/llwindow/llwindow.cpp b/indra/llwindow/llwindow.cpp index c5725677b4..207c5cac9c 100644 --- a/indra/llwindow/llwindow.cpp +++ b/indra/llwindow/llwindow.cpp @@ -409,7 +409,7 @@ LLWindow* LLWindowManager::createWindow( BOOL ignore_pixel_depth, U32 fsaa_samples) { - LLWindow* new_window; + LLWindow* new_window = nullptr; if (use_gl) { -- cgit v1.2.3 From 02090f361e631a014a3e2d35cb25229ad0f0b843 Mon Sep 17 00:00:00 2001 From: Erik Kundiman Date: Tue, 1 Aug 2023 09:43:21 +0800 Subject: Fix commit 7aa029 --- indra/llmath/CMakeLists.txt | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'indra') diff --git a/indra/llmath/CMakeLists.txt b/indra/llmath/CMakeLists.txt index de00843be3..dfd7491790 100644 --- a/indra/llmath/CMakeLists.txt +++ b/indra/llmath/CMakeLists.txt @@ -104,8 +104,7 @@ include_directories(${CMAKE_SOURCE_DIR}/llmeshoptimizer) target_link_libraries(llmath llcommon) target_include_directories( llmath INTERFACE ${CMAKE_CURRENT_SOURCE_DIR}) -if (USESYSTEMLIBS) - AND CMAKE_CXX_COMPILER_ID MATCHES "GNU") +if (USESYSTEMLIBS AND CMAKE_CXX_COMPILER_ID MATCHES "GNU") set_source_files_properties(llcalc.cpp PROPERTIES COMPILE_FLAGS -Wno-dangling-pointer) endif () -- cgit v1.2.3 From ee14fd56f2b49e4fb38822c85bab4d342117a177 Mon Sep 17 00:00:00 2001 From: Erik Kundiman Date: Mon, 7 Aug 2023 19:57:58 +0800 Subject: Make GCC not treat uninit-ed FetchEntry as error --- indra/newview/CMakeLists.txt | 1 + 1 file changed, 1 insertion(+) (limited to 'indra') diff --git a/indra/newview/CMakeLists.txt b/indra/newview/CMakeLists.txt index 47d70c993e..48c9462f9f 100644 --- a/indra/newview/CMakeLists.txt +++ b/indra/newview/CMakeLists.txt @@ -1942,6 +1942,7 @@ elseif (CMAKE_CXX_COMPILER_ID MATCHES "GNU") llface.cpp llhttpretrypolicy.cpp llpanelface.cpp + lltexturefetch.cpp PROPERTIES COMPILE_FLAGS -Wno-maybe-uninitialized) set_source_files_properties(llurl.cpp PROPERTIES COMPILE_FLAGS -Wno-stringop-truncation) -- cgit v1.2.3 From 6d31ea65d2c597397971fb97fc17610277104e1b Mon Sep 17 00:00:00 2001 From: Erik Kundiman Date: Tue, 15 Aug 2023 16:28:26 +0800 Subject: SDL 1.2 to 2.0 migration Both keycodes and scancodes are now 32 bits, so the key type is lengthened from U16 to U32. --- indra/cmake/LLWindow.cmake | 8 +- indra/llwindow/llkeyboard.cpp | 8 +- indra/llwindow/llkeyboard.h | 12 +- indra/llwindow/llkeyboardheadless.cpp | 4 +- indra/llwindow/llkeyboardheadless.h | 4 +- indra/llwindow/llkeyboardsdl.cpp | 84 +++++++------- indra/llwindow/llkeyboardsdl.h | 14 +-- indra/llwindow/llwindowsdl.cpp | 206 +++++++++++++++++++++------------- indra/llwindow/llwindowsdl.h | 14 +-- 9 files changed, 202 insertions(+), 152 deletions(-) (limited to 'indra') diff --git a/indra/cmake/LLWindow.cmake b/indra/cmake/LLWindow.cmake index f952383a27..09b8fdb83d 100644 --- a/indra/cmake/LLWindow.cmake +++ b/indra/cmake/LLWindow.cmake @@ -9,11 +9,11 @@ add_library( ll::SDL INTERFACE IMPORTED ) if (NOT (USE_AUTOBUILD_3P OR USE_CONAN) AND NOT DARWIN) include(FindPkgConfig) - pkg_check_modules(Sdl REQUIRED sdl) + pkg_check_modules(Sdl2 REQUIRED sdl2) target_compile_definitions( ll::SDL INTERFACE LL_SDL=1) - target_include_directories(ll::SDL SYSTEM INTERFACE ${Sdl_INCLUDE_DIRS}) - target_link_directories(ll::SDL INTERFACE ${Sdl_LIBRARY_DIRS}) - target_link_libraries(ll::SDL INTERFACE ${Sdl_LIBRARIES} X11) + target_include_directories(ll::SDL SYSTEM INTERFACE ${Sdl2_INCLUDE_DIRS}) + target_link_directories(ll::SDL INTERFACE ${Sdl2_LIBRARY_DIRS}) + target_link_libraries(ll::SDL INTERFACE ${Sdl2_LIBRARIES} X11) return () endif () diff --git a/indra/llwindow/llkeyboard.cpp b/indra/llwindow/llkeyboard.cpp index e65cc7563e..ac8c97d34e 100644 --- a/indra/llwindow/llkeyboard.cpp +++ b/indra/llwindow/llkeyboard.cpp @@ -195,9 +195,9 @@ void LLKeyboard::resetKeys() } -BOOL LLKeyboard::translateKey(const U16 os_key, KEY *out_key) +BOOL LLKeyboard::translateKey(const U32 os_key, KEY *out_key) { - std::map::iterator iter; + std::map::iterator iter; // Only translate keys in the map, ignore all other keys for now iter = mTranslateKeyMap.find(os_key); @@ -215,9 +215,9 @@ BOOL LLKeyboard::translateKey(const U16 os_key, KEY *out_key) } -U16 LLKeyboard::inverseTranslateKey(const KEY translated_key) +U32 LLKeyboard::inverseTranslateKey(const KEY translated_key) { - std::map::iterator iter; + std::map::iterator iter; iter = mInvTranslateKeyMap.find(translated_key); if (iter == mInvTranslateKeyMap.end()) { diff --git a/indra/llwindow/llkeyboard.h b/indra/llwindow/llkeyboard.h index fb1ae10f50..2a700ce8e9 100644 --- a/indra/llwindow/llkeyboard.h +++ b/indra/llwindow/llkeyboard.h @@ -67,14 +67,14 @@ 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 translateKey(const U32 os_key, KEY *translated_key); + U32 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 - virtual BOOL handleKeyUp(const U16 key, MASK mask) = 0; - virtual BOOL handleKeyDown(const U16 key, MASK mask) = 0; + virtual BOOL handleKeyUp(const U32 key, MASK mask) = 0; + virtual BOOL handleKeyDown(const U32 key, MASK mask) = 0; #ifdef LL_DARWIN // We only actually use this for OS X. @@ -109,8 +109,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 a1b6b294e0..3ca421f9f9 100644 --- a/indra/llwindow/llkeyboardheadless.cpp +++ b/indra/llwindow/llkeyboardheadless.cpp @@ -35,11 +35,11 @@ void LLKeyboardHeadless::resetMaskKeys() { } -BOOL LLKeyboardHeadless::handleKeyDown(const U16 key, const U32 mask) +BOOL LLKeyboardHeadless::handleKeyDown(const U32 key, const U32 mask) { return FALSE; } -BOOL LLKeyboardHeadless::handleKeyUp(const U16 key, const U32 mask) +BOOL LLKeyboardHeadless::handleKeyUp(const U32 key, const U32 mask) { return FALSE; } MASK LLKeyboardHeadless::currentMask(BOOL for_mouse_event) diff --git a/indra/llwindow/llkeyboardheadless.h b/indra/llwindow/llkeyboardheadless.h index 8ed28ace90..929751586c 100644 --- a/indra/llwindow/llkeyboardheadless.h +++ b/indra/llwindow/llkeyboardheadless.h @@ -35,8 +35,8 @@ public: LLKeyboardHeadless(); /*virtual*/ ~LLKeyboardHeadless() {}; - /*virtual*/ BOOL handleKeyUp(const U16 key, MASK mask); - /*virtual*/ BOOL handleKeyDown(const U16 key, MASK mask); + /*virtual*/ BOOL handleKeyUp(const U32 key, MASK mask); + /*virtual*/ BOOL handleKeyDown(const U32 key, MASK mask); /*virtual*/ void resetMaskKeys(); /*virtual*/ MASK currentMask(BOOL for_mouse_event); /*virtual*/ void scanKeyboard(); diff --git a/indra/llwindow/llkeyboardsdl.cpp b/indra/llwindow/llkeyboardsdl.cpp index 7c9aa1d340..872b58e2ec 100644 --- a/indra/llwindow/llkeyboardsdl.cpp +++ b/indra/llwindow/llkeyboardsdl.cpp @@ -29,7 +29,7 @@ #include "linden_common.h" #include "llkeyboardsdl.h" #include "llwindowcallbacks.h" -#include "SDL/SDL.h" +#include "SDL2/SDL.h" LLKeyboardSDL::LLKeyboardSDL() { @@ -40,7 +40,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; + U32 cur_char; for (cur_char = 'A'; cur_char <= 'Z'; cur_char++) { mTranslateKeyMap[cur_char] = cur_char; @@ -57,16 +57,16 @@ LLKeyboardSDL::LLKeyboardSDL() // These ones are translated manually upon keydown/keyup because // SDL doesn't handle their numlock transition. - //mTranslateKeyMap[SDLK_KP4] = KEY_PAD_LEFT; - //mTranslateKeyMap[SDLK_KP6] = KEY_PAD_RIGHT; - //mTranslateKeyMap[SDLK_KP8] = KEY_PAD_UP; - //mTranslateKeyMap[SDLK_KP2] = KEY_PAD_DOWN; + //mTranslateKeyMap[SDLK_KP_4] = KEY_PAD_LEFT; + //mTranslateKeyMap[SDLK_KP_6] = KEY_PAD_RIGHT; + //mTranslateKeyMap[SDLK_KP_8] = KEY_PAD_UP; + //mTranslateKeyMap[SDLK_KP_2] = KEY_PAD_DOWN; //mTranslateKeyMap[SDLK_KP_PERIOD] = KEY_DELETE; - //mTranslateKeyMap[SDLK_KP7] = KEY_HOME; - //mTranslateKeyMap[SDLK_KP1] = KEY_END; - //mTranslateKeyMap[SDLK_KP9] = KEY_PAGE_UP; - //mTranslateKeyMap[SDLK_KP3] = KEY_PAGE_DOWN; - //mTranslateKeyMap[SDLK_KP0] = KEY_INSERT; + //mTranslateKeyMap[SDLK_KP_7] = KEY_HOME; + //mTranslateKeyMap[SDLK_KP_1] = KEY_END; + //mTranslateKeyMap[SDLK_KP_9] = KEY_PAGE_UP; + //mTranslateKeyMap[SDLK_KP_3] = KEY_PAGE_DOWN; + //mTranslateKeyMap[SDLK_KP_0] = KEY_INSERT; mTranslateKeyMap[SDLK_SPACE] = ' '; mTranslateKeyMap[SDLK_RETURN] = KEY_RETURN; @@ -124,23 +124,23 @@ LLKeyboardSDL::LLKeyboardSDL() mTranslateKeyMap[SDLK_QUOTE] = '\''; // Build inverse map - std::map::iterator iter; + std::map::iterator iter; for (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 @@ -154,7 +154,7 @@ 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. @@ -201,34 +201,34 @@ MASK LLKeyboardSDL::updateModifiers(const U32 mask) } -static U16 adjustNativekeyFromUnhandledMask(const U16 key, const U32 mask) +static U32 adjustNativekeyFromUnhandledMask(const U32 key, const U32 mask) { // SDL doesn't automatically adjust the keysym according to // whether NUMLOCK is engaged, so we massage the keysym manually. - U16 rtn = key; + U32 rtn = key; if (!(mask & 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_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 U32 key, const U32 mask) { - U16 adjusted_nativekey; + U32 adjusted_nativekey; KEY translated_key = 0; U32 translated_mask = MASK_NONE; BOOL handled = FALSE; @@ -246,9 +246,9 @@ BOOL LLKeyboardSDL::handleKeyDown(const U16 key, const U32 mask) } -BOOL LLKeyboardSDL::handleKeyUp(const U16 key, const U32 mask) +BOOL LLKeyboardSDL::handleKeyUp(const U32 key, const U32 mask) { - U16 adjusted_nativekey; + U32 adjusted_nativekey; KEY translated_key = 0; U32 translated_mask = MASK_NONE; BOOL handled = FALSE; @@ -268,7 +268,7 @@ 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; @@ -277,7 +277,7 @@ MASK LLKeyboardSDL::currentMask(BOOL for_mouse_event) // For keyboard events, consider Meta keys equivalent to Control if (!for_mouse_event) { - if (mask & KMOD_META) result |= MASK_CONTROL; + if (mask & KMOD_GUI) result |= MASK_CONTROL; } return result; @@ -310,12 +310,12 @@ void LLKeyboardSDL::scanKeyboard() } -BOOL LLKeyboardSDL::translateNumpadKey( const U16 os_key, KEY *translated_key) +BOOL LLKeyboardSDL::translateNumpadKey( const U32 os_key, KEY *translated_key) { return translateKey(os_key, translated_key); } -U16 LLKeyboardSDL::inverseTranslateNumpadKey(const KEY translated_key) +U32 LLKeyboardSDL::inverseTranslateNumpadKey(const KEY translated_key) { return inverseTranslateKey(translated_key); } diff --git a/indra/llwindow/llkeyboardsdl.h b/indra/llwindow/llkeyboardsdl.h index 02a71425f1..2b1ac5af2b 100644 --- a/indra/llwindow/llkeyboardsdl.h +++ b/indra/llwindow/llkeyboardsdl.h @@ -28,7 +28,7 @@ #define LL_LLKEYBOARDSDL_H #include "llkeyboard.h" -#include "SDL/SDL.h" +#include "SDL2/SDL.h" class LLKeyboardSDL : public LLKeyboard { @@ -36,8 +36,8 @@ public: LLKeyboardSDL(); /*virtual*/ ~LLKeyboardSDL() {}; - /*virtual*/ BOOL handleKeyUp(const U16 key, MASK mask); - /*virtual*/ BOOL handleKeyDown(const U16 key, MASK mask); + /*virtual*/ BOOL handleKeyUp(const U32 key, MASK mask); + /*virtual*/ BOOL handleKeyDown(const U32 key, MASK mask); /*virtual*/ void resetMaskKeys(); /*virtual*/ MASK currentMask(BOOL for_mouse_event); /*virtual*/ void scanKeyboard(); @@ -45,11 +45,11 @@ public: protected: MASK updateModifiers(const U32 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 U32 os_key, KEY *translated_key ); + U32 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 }; #endif diff --git a/indra/llwindow/llwindowsdl.cpp b/indra/llwindow/llwindowsdl.cpp index 9c8fadb968..11605804c0 100644 --- a/indra/llwindow/llwindowsdl.cpp +++ b/indra/llwindow/llwindowsdl.cpp @@ -432,44 +432,25 @@ BOOL LLWindowSDL::createContext(int x, int y, int width, int height, int bits, B << 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(); + SDL_version r_sdl_version; + SDL_GetVersion(&r_sdl_version); LL_INFOS() << " Running against SDL " - << int(r_sdl_version->major) << "." - << int(r_sdl_version->minor) << "." - << int(r_sdl_version->patch) << LL_ENDL; + << 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) + SDL_DisplayMode display_mode; + if (SDL_GetDesktopDisplayMode(0, &display_mode) < 0) { 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) + if (display_mode.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; + mOriginalAspectRatio = (float)display_mode.w / (float)display_mode.h; + LL_INFOS() << "Original aspect ratio was " << display_mode.w << ":" << display_mode.h << "=" << mOriginalAspectRatio << LL_ENDL; } // note: these SetAttributes make Tom's 9600-on-AMD64 fail to @@ -489,7 +470,7 @@ BOOL LLWindowSDL::createContext(int x, int y, int width, int height, int bits, B mFullscreen = fullscreen; - int sdlflags = SDL_OPENGL | SDL_RESIZABLE | SDL_ANYFORMAT; + int sdlflags = SDL_WINDOW_OPENGL | SDL_WINDOW_RESIZABLE;// | SDL_ANYFORMAT; SDL_GL_SetAttribute(SDL_GL_DOUBLEBUFFER, 1); @@ -553,19 +534,24 @@ BOOL LLWindowSDL::createContext(int x, int y, int width, int height, int bits, B height = 768; } - mWindow = SDL_SetVideoMode(width, height, bits, sdlflags | SDL_FULLSCREEN); + mWindow = SDL_CreateWindow(mWindowTitle.c_str(), + SDL_WINDOWPOS_UNDEFINED, SDL_WINDOWPOS_UNDEFINED, + width, height, sdlflags | SDL_WINDOW_FULLSCREEN); if (!mWindow && bits > 16) { SDL_GL_SetAttribute(SDL_GL_DEPTH_SIZE, 16); - mWindow = SDL_SetVideoMode(width, height, bits, sdlflags | SDL_FULLSCREEN); + mWindow = SDL_CreateWindow(mWindowTitle.c_str(), + SDL_WINDOWPOS_UNDEFINED, SDL_WINDOWPOS_UNDEFINED, + width, height, sdlflags | SDL_WINDOW_FULLSCREEN); } if (mWindow) { + SDL_GL_CreateContext(mWindow); mFullscreen = TRUE; - mFullscreenWidth = mWindow->w; - mFullscreenHeight = mWindow->h; - mFullscreenBits = mWindow->format->BitsPerPixel; + SDL_GetWindowSize(mWindow, + &mFullscreenWidth, &mFullscreenHeight); + //mFullscreenBits = mWindow->format->BitsPerPixel; mFullscreenRefresh = -1; LL_INFOS() << "Running at " << mFullscreenWidth @@ -597,11 +583,15 @@ BOOL LLWindowSDL::createContext(int x, int y, int width, int height, int bits, B width = 768; LL_INFOS() << "createContext: creating window " << width << "x" << height << "x" << bits << LL_ENDL; - mWindow = SDL_SetVideoMode(width, height, bits, sdlflags); + mWindow = SDL_CreateWindow(mWindowTitle.c_str(), + SDL_WINDOWPOS_UNDEFINED, SDL_WINDOWPOS_UNDEFINED, + width, height, sdlflags); if (!mWindow && bits > 16) { SDL_GL_SetAttribute(SDL_GL_DEPTH_SIZE, 16); - mWindow = SDL_SetVideoMode(width, height, bits, sdlflags); + mWindow = SDL_CreateWindow(mWindowTitle.c_str(), + SDL_WINDOWPOS_UNDEFINED, SDL_WINDOWPOS_UNDEFINED, + width, height, sdlflags); } if (!mWindow) @@ -610,11 +600,32 @@ BOOL LLWindowSDL::createContext(int x, int y, int width, int height, int bits, B setupFailure("Window creation error", "Error", OSMB_OK); return FALSE; } + SDL_GL_CreateContext(mWindow); } else if (!mFullscreen && (mWindow != NULL)) { LL_INFOS() << "createContext: SKIPPING - !fullscreen, but +mWindow " << width << "x" << height << "x" << bits << LL_ENDL; } + + //SDL_EnableUNICODE(1); + SDL_SetWindowTitle(mWindow, 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_TRUE, + SDL_MapRGB(bmpsurface->format, 0,0,0) ); + SDL_SetWindowIcon(mWindow, bmpsurface); + // The SDL examples cheerfully avoid freeing the icon + // surface, but I'm betting that's leaky. + SDL_FreeSurface(bmpsurface); + bmpsurface = NULL; + } + /* // Detect video memory size. # if LL_X11 gGLManager.mVRAM = x11_detect_VRAM_kb() / 1024; @@ -633,6 +644,7 @@ BOOL LLWindowSDL::createContext(int x, int y, int width, int height, int bits, B LL_INFOS() << "SDL detected " << gGLManager.mVRAM << "MB VRAM." << LL_ENDL; } } + */ // If VRAM is not detected, that is handled later // *TODO: Now would be an appropriate time to check for some @@ -695,15 +707,17 @@ BOOL LLWindowSDL::createContext(int x, int y, int width, int height, int bits, B /* Grab the window manager specific information */ SDL_SysWMinfo info; SDL_VERSION(&info.version); - if ( SDL_GetWMInfo(&info) ) + if ( SDL_GetWindowWMInfo(mWindow, &info) ) { /* Save the information for later use */ if ( info.subsystem == SDL_SYSWM_X11 ) { mSDL_Display = info.info.x11.display; - mSDL_XWindowID = info.info.x11.wmwindow; + mSDL_XWindowID = info.info.x11.window; + /* Lock_Display = info.info.x11.lock_func; Unlock_Display = info.info.x11.unlock_func; + */ } else { @@ -723,9 +737,11 @@ BOOL LLWindowSDL::createContext(int x, int y, int width, int height, int bits, B 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 = mWindow->w; - size->mY = mWindow->h; + SDL_GetWindowSize(mWindow, &size->mX, &size->mY); return (TRUE); } @@ -910,8 +925,7 @@ BOOL LLWindowSDL::getSize(LLCoordWindow *size) { if (mWindow) { - size->mX = mWindow->w; - size->mY = mWindow->h; + SDL_GetWindowSize(mWindow, &size->mX, &size->mY); return (TRUE); } @@ -936,9 +950,10 @@ BOOL LLWindowSDL::setSizeImpl(const LLCoordScreen size) // 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; + event.type = SDL_WINDOWEVENT; + event.window.event = SDL_WINDOWEVENT_RESIZED; + event.window.data1 = size.mX; + event.window.data2 = size.mY; SDL_PushEvent(&event); // copied into queue return TRUE; @@ -954,9 +969,10 @@ BOOL LLWindowSDL::setSizeImpl(const LLCoordWindow size) // 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; + event.type = SDL_WINDOWEVENT; + event.window.event = SDL_WINDOWEVENT_RESIZED; + event.window.data1 = size.mX; + event.window.data2 = size.mY; SDL_PushEvent(&event); // copied into queue return TRUE; @@ -970,7 +986,7 @@ void LLWindowSDL::swapBuffers() { if (mWindow) { - SDL_GL_SwapBuffers(); + SDL_GL_SwapWindow(mWindow); } } @@ -992,7 +1008,9 @@ F32 LLWindowSDL::getGamma() BOOL LLWindowSDL::restoreGamma() { //CGDisplayRestoreColorSyncSettings(); - SDL_SetGamma(1.0f, 1.0f, 1.0f); + Uint16 ramp; + SDL_CalculateGammaRamp(1.0f, &ramp); + SDL_SetWindowGammaRamp(mWindow, &ramp, &ramp, &ramp); return true; } @@ -1001,7 +1019,9 @@ BOOL LLWindowSDL::setGamma(const F32 gamma) mGamma = gamma; if (mGamma == 0) mGamma = 0.1f; mGamma = 1/mGamma; - SDL_SetGamma(mGamma, mGamma, mGamma); + Uint16 ramp; + SDL_CalculateGammaRamp(mGamma, &ramp); + SDL_SetWindowGammaRamp(mWindow, &ramp, &ramp, &ramp); return true; } @@ -1071,7 +1091,7 @@ BOOL LLWindowSDL::setCursorPosition(const LLCoordWindow position) //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); + SDL_WarpMouseGlobal(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; @@ -1160,6 +1180,7 @@ void LLWindowSDL::beforeDialog() LL_INFOS() << "LLWindowSDL::beforeDialog()" << LL_ENDL; + /* if (SDLReallyCaptureInput(FALSE)) // must ungrab input so popup works! { if (mFullscreen) @@ -1173,6 +1194,7 @@ void LLWindowSDL::beforeDialog() } } } + */ #if LL_X11 if (mSDL_Display) @@ -1211,7 +1233,7 @@ void LLWindowSDL::afterDialog() // in X11 if (running_x11 && mWindow) { - SDL_WM_ToggleFullScreen(mWindow); + SDL_SetWindowFullscreen(mWindow, SDL_WINDOW_FULLSCREEN); } } } @@ -1391,6 +1413,7 @@ 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)) ) { @@ -1405,8 +1428,14 @@ LLWindow::LLWindowResolution* LLWindowSDL::getSupportedResolutions(S32 &num_reso { modes--; SDL_Rect *r = *modes; - int w = r->w; - int h = r->h; + */ + static int display_in_use = 0; // Only using first display + auto display_mode_count = SDL_GetNumDisplayModes(display_in_use); + SDL_DisplayMode mode; + for (int i = 0; i < display_mode_count; ++i) { + SDL_GetDisplayMode(display_in_use, i, &mode); + int w = mode.w; + int h = mode.h; if ((w >= 800) && (h >= 600)) { // make sure we don't add the same resolution multiple times! @@ -1420,7 +1449,7 @@ LLWindow::LLWindowResolution* LLWindowSDL::getSupportedResolutions(S32 &num_reso } } } - } + //} } num_resolutions = mNumSupportedResolutions; @@ -1433,7 +1462,9 @@ BOOL LLWindowSDL::convertCoords(LLCoordGL from, LLCoordWindow *to) return FALSE; to->mX = from.mX; - to->mY = mWindow->h - from.mY - 1; + int h; + SDL_GetWindowSize(mWindow, nullptr, &h); + to->mY = h - from.mY - 1; return TRUE; } @@ -1444,7 +1475,9 @@ BOOL LLWindowSDL::convertCoords(LLCoordWindow from, LLCoordGL* to) return FALSE; to->mX = from.mX; - to->mY = mWindow->h - from.mY - 1; + int h; + SDL_GetWindowSize(mWindow, nullptr, &h); + to->mY = h - from.mY - 1; return TRUE; } @@ -1495,6 +1528,7 @@ void LLWindowSDL::setupFailure(const std::string& text, const std::string& capti OSMessageBox(text, caption, type); } +/* BOOL LLWindowSDL::SDLReallyCaptureInput(BOOL capture) { // note: this used to be safe to call nestedly, but in the @@ -1520,12 +1554,12 @@ BOOL LLWindowSDL::SDLReallyCaptureInput(BOOL capture) LL_WARNS() << "ReallyCapture count was < 0" << LL_ENDL; } - if (!mFullscreen) /* only bother if we're windowed anyway */ + if (!mFullscreen) // only bother if we're windowed anyway { #if LL_X11 if (mSDL_Display) { - /* we dirtily mix raw X11 with SDL so that our pointer + // 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' @@ -1533,7 +1567,7 @@ BOOL LLWindowSDL::SDLReallyCaptureInput(BOOL capture) 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. */ + frustrating users. * int result; if (wantmode == SDL_GRAB_ON) { @@ -1576,8 +1610,9 @@ BOOL LLWindowSDL::SDLReallyCaptureInput(BOOL capture) return (capture && SDL_GRAB_ON==newmode) || (!capture && SDL_GRAB_OFF==newmode); } +*/ -U32 LLWindowSDL::SDLCheckGrabbyKeys(SDLKey keysym, BOOL gain) +U32 LLWindowSDL::SDLCheckGrabbyKeys(SDL_Keycode 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 @@ -1778,28 +1813,36 @@ void LLWindowSDL::gatherInput() 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) SDLReallyCaptureInput(TRUE); + */ - if (event.key.keysym.unicode) + if (event.key.keysym.sym < SDLK_SPACE) { - handleUnicodeUTF16(event.key.keysym.unicode, + handleUnicodeUTF16(event.key.keysym.sym, gKeyboard->currentMask(FALSE)); } break; + case SDL_TEXTINPUT: + mKeyVirtualKey = *event.text.text; + handleUnicodeUTF16(mKeyVirtualKey, + gKeyboard->currentMask(FALSE)); + 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) SDLReallyCaptureInput(FALSE); // part of the fix for SL-13243 + */ gKeyboard->handleKeyUp(event.key.keysym.sym, event.key.keysym.mod); break; @@ -1886,19 +1929,22 @@ void LLWindowSDL::gatherInput() 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? + case SDL_WINDOWEVENT: { - 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); - + if (event.window.event == SDL_WINDOWEVENT_EXPOSED) { // VIDEOEXPOSE doesn't specify the damage, but hey, it's OpenGL...repaint the whole thing! + int w, h; + SDL_GetWindowSize(mWindow, &w, &h); + mCallbacks->handlePaint(this, 0, 0, w, h); + } else if (event.window.event == SDL_WINDOWEVENT_RESIZED) { + LL_INFOS() << "Handling a resize event: " << event.window.data1 << + "x" << event.window.data2 << LL_ENDL; + + S32 width = llmax(event.window.data1, (S32)mMinWindowWidth); + S32 height = llmax(event.window.data2, (S32)mMinWindowHeight); + + // *FIX: handle this? // *FIX: I'm not sure this is necessary! + /* mWindow = SDL_SetVideoMode(width, height, 32, mSDLFlags); if (!mWindow) { @@ -1912,10 +1958,13 @@ void LLWindowSDL::gatherInput() } break; } + */ mCallbacks->handleResize(this, width, height); + } break; } + /* case SDL_ACTIVEEVENT: if (event.active.state & SDL_APPINPUTFOCUS) { @@ -1952,6 +2001,7 @@ void LLWindowSDL::gatherInput() } } break; + */ case SDL_QUIT: if(mCallbacks->handleCloseRequest(this)) diff --git a/indra/llwindow/llwindowsdl.h b/indra/llwindow/llwindowsdl.h index 57885907b4..e8a93247f3 100644 --- a/indra/llwindow/llwindowsdl.h +++ b/indra/llwindow/llwindowsdl.h @@ -32,12 +32,12 @@ #include "llwindow.h" #include "lltimer.h" -#include "SDL/SDL.h" -#include "SDL/SDL_endian.h" +#include "SDL2/SDL.h" +#include "SDL2/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" +#include "SDL2/SDL_syswm.h" #endif // AssertMacros.h does bad things. @@ -181,15 +181,15 @@ protected: void destroyContext(); void setupFailure(const std::string& text, const std::string& caption, U32 type); void fixWindowSize(void); - U32 SDLCheckGrabbyKeys(SDLKey keysym, BOOL gain); - BOOL SDLReallyCaptureInput(BOOL capture); + U32 SDLCheckGrabbyKeys(SDL_Keycode keysym, BOOL gain); + //BOOL SDLReallyCaptureInput(BOOL capture); // // Platform specific variables // U32 mGrabbyKeyFlags; int mReallyCapturedCount; - SDL_Surface * mWindow; + SDL_Window * mWindow; std::string mWindowTitle; double mOriginalAspectRatio; BOOL mNeedsResize; // Constructor figured out the window is too big, it needs a resize. @@ -215,7 +215,7 @@ private: U32 mKeyScanCode; U32 mKeyVirtualKey; - SDLMod mKeyModifiers; + Uint16 mKeyModifiers; }; -- cgit v1.2.3 From d883a11567252d9a0baff653bb16c38817a7c21c Mon Sep 17 00:00:00 2001 From: Erik Kundiman Date: Wed, 16 Aug 2023 01:28:53 +0800 Subject: Try not to rely (explicitly) on X11 --- indra/cmake/LLWindow.cmake | 2 +- indra/cmake/UI.cmake | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) (limited to 'indra') diff --git a/indra/cmake/LLWindow.cmake b/indra/cmake/LLWindow.cmake index 09b8fdb83d..91453936f5 100644 --- a/indra/cmake/LLWindow.cmake +++ b/indra/cmake/LLWindow.cmake @@ -13,7 +13,7 @@ if (NOT (USE_AUTOBUILD_3P OR USE_CONAN) AND NOT DARWIN) target_compile_definitions( ll::SDL INTERFACE LL_SDL=1) target_include_directories(ll::SDL SYSTEM INTERFACE ${Sdl2_INCLUDE_DIRS}) target_link_directories(ll::SDL INTERFACE ${Sdl2_LIBRARY_DIRS}) - target_link_libraries(ll::SDL INTERFACE ${Sdl2_LIBRARIES} X11) + target_link_libraries(ll::SDL INTERFACE ${Sdl2_LIBRARIES}) return () endif () diff --git a/indra/cmake/UI.cmake b/indra/cmake/UI.cmake index 03bdf4e434..2e0709317b 100644 --- a/indra/cmake/UI.cmake +++ b/indra/cmake/UI.cmake @@ -5,7 +5,8 @@ include(FreeType) add_library( ll::uilibraries INTERFACE IMPORTED ) if (LINUX OR CMAKE_SYSTEM_NAME MATCHES "FreeBSD") - target_compile_definitions(ll::uilibraries INTERFACE LL_GTK=1 LL_X11=1 ) + #target_compile_definitions(ll::uilibraries INTERFACE LL_GTK=1 LL_X11=1 ) + target_compile_definitions(ll::uilibraries INTERFACE LL_GTK=1) if( USE_CONAN ) target_link_libraries( ll::uilibraries INTERFACE CONAN_PKG::gtk ) -- cgit v1.2.3 From f93b28ca61fda8a082a39406aff9e668781a5d5e Mon Sep 17 00:00:00 2001 From: Erik Kundiman Date: Wed, 16 Aug 2023 15:00:00 +0800 Subject: Revive mouse wheel on SDL2 --- indra/llwindow/llwindowsdl.cpp | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'indra') diff --git a/indra/llwindow/llwindowsdl.cpp b/indra/llwindow/llwindowsdl.cpp index 11605804c0..ff4b8aa556 100644 --- a/indra/llwindow/llwindowsdl.cpp +++ b/indra/llwindow/llwindowsdl.cpp @@ -1903,14 +1903,17 @@ void LLWindowSDL::gatherInput() { 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_MOUSEWHEEL: + if (event.wheel.y > 0) // mousewheel up + mCallbacks->handleScrollWheel(this, -1); + else if (event.wheel.y < 0) // mousewheel down + mCallbacks->handleScrollWheel(this, 1); + break; + case SDL_MOUSEBUTTONUP: { LLCoordWindow winCoord(event.button.x, event.button.y); -- cgit v1.2.3 From 12487dc5c00d68cd742f2ef4ee0a0b0713cce9f1 Mon Sep 17 00:00:00 2001 From: Erik Kundiman Date: Wed, 16 Aug 2023 16:13:30 +0800 Subject: Revert "Try not to rely (explicitly) on X11" This reverts commit d883a11567252d9a0baff653bb16c38817a7c21c. --- indra/cmake/LLWindow.cmake | 2 +- indra/cmake/UI.cmake | 3 +-- 2 files changed, 2 insertions(+), 3 deletions(-) (limited to 'indra') diff --git a/indra/cmake/LLWindow.cmake b/indra/cmake/LLWindow.cmake index 91453936f5..09b8fdb83d 100644 --- a/indra/cmake/LLWindow.cmake +++ b/indra/cmake/LLWindow.cmake @@ -13,7 +13,7 @@ if (NOT (USE_AUTOBUILD_3P OR USE_CONAN) AND NOT DARWIN) target_compile_definitions( ll::SDL INTERFACE LL_SDL=1) target_include_directories(ll::SDL SYSTEM INTERFACE ${Sdl2_INCLUDE_DIRS}) target_link_directories(ll::SDL INTERFACE ${Sdl2_LIBRARY_DIRS}) - target_link_libraries(ll::SDL INTERFACE ${Sdl2_LIBRARIES}) + target_link_libraries(ll::SDL INTERFACE ${Sdl2_LIBRARIES} X11) return () endif () diff --git a/indra/cmake/UI.cmake b/indra/cmake/UI.cmake index 2e0709317b..03bdf4e434 100644 --- a/indra/cmake/UI.cmake +++ b/indra/cmake/UI.cmake @@ -5,8 +5,7 @@ include(FreeType) add_library( ll::uilibraries INTERFACE IMPORTED ) if (LINUX OR CMAKE_SYSTEM_NAME MATCHES "FreeBSD") - #target_compile_definitions(ll::uilibraries INTERFACE LL_GTK=1 LL_X11=1 ) - target_compile_definitions(ll::uilibraries INTERFACE LL_GTK=1) + target_compile_definitions(ll::uilibraries INTERFACE LL_GTK=1 LL_X11=1 ) if( USE_CONAN ) target_link_libraries( ll::uilibraries INTERFACE CONAN_PKG::gtk ) -- cgit v1.2.3 From 2fc9c69bd7975c6439272e8be14eb9c9284b938c Mon Sep 17 00:00:00 2001 From: Erik Kundiman Date: Wed, 16 Aug 2023 16:33:11 +0800 Subject: Revive alt mouse click override with X11 On SDL2, there are no more x11.lock_func or x11.unlock_func, so the camming is too sensitive, and alt tab is overridden too when it shouldn't be. It's better than nothing at all for now. This feature should be re-perfected later. --- indra/llwindow/llwindowsdl.cpp | 38 +++++++++++++++----------------------- indra/llwindow/llwindowsdl.h | 2 +- 2 files changed, 16 insertions(+), 24 deletions(-) (limited to 'indra') diff --git a/indra/llwindow/llwindowsdl.cpp b/indra/llwindow/llwindowsdl.cpp index ff4b8aa556..7c8c3ab17a 100644 --- a/indra/llwindow/llwindowsdl.cpp +++ b/indra/llwindow/llwindowsdl.cpp @@ -1180,7 +1180,6 @@ void LLWindowSDL::beforeDialog() LL_INFOS() << "LLWindowSDL::beforeDialog()" << LL_ENDL; - /* if (SDLReallyCaptureInput(FALSE)) // must ungrab input so popup works! { if (mFullscreen) @@ -1190,11 +1189,10 @@ void LLWindowSDL::beforeDialog() // it only works in X11 if (running_x11 && mWindow) { - SDL_WM_ToggleFullScreen(mWindow); + SDL_SetWindowFullscreen(mWindow, SDL_WINDOW_FULLSCREEN); } } } - */ #if LL_X11 if (mSDL_Display) @@ -1528,7 +1526,6 @@ void LLWindowSDL::setupFailure(const std::string& text, const std::string& capti OSMessageBox(text, caption, type); } -/* BOOL LLWindowSDL::SDLReallyCaptureInput(BOOL capture) { // note: this used to be safe to call nestedly, but in the @@ -1539,13 +1536,13 @@ BOOL LLWindowSDL::SDLReallyCaptureInput(BOOL capture) else mReallyCapturedCount = 0; - SDL_GrabMode wantmode, newmode; + SDL_bool wantmode, newmode; if (mReallyCapturedCount <= 0) // uncapture { - wantmode = SDL_GRAB_OFF; + wantmode = SDL_FALSE; } else // capture { - wantmode = SDL_GRAB_ON; + wantmode = SDL_TRUE; } if (mReallyCapturedCount < 0) // yuck, imbalance. @@ -1554,12 +1551,12 @@ BOOL LLWindowSDL::SDLReallyCaptureInput(BOOL capture) LL_WARNS() << "ReallyCapture count was < 0" << LL_ENDL; } - if (!mFullscreen) // only bother if we're windowed anyway + if (!mFullscreen) /* only bother if we're windowed anyway */ { #if LL_X11 if (mSDL_Display) { - // we dirtily mix raw X11 with SDL so that our pointer + /* 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' @@ -1567,9 +1564,9 @@ BOOL LLWindowSDL::SDLReallyCaptureInput(BOOL capture) 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. * + frustrating users. */ int result; - if (wantmode == SDL_GRAB_ON) + if (wantmode == SDL_TRUE) { //LL_INFOS() << "X11 POINTER GRABBY" << LL_ENDL; //newmode = SDL_WM_GrabInput(wantmode); @@ -1580,13 +1577,13 @@ BOOL LLWindowSDL::SDLReallyCaptureInput(BOOL capture) None, None, CurrentTime); maybe_unlock_display(); if (GrabSuccess == result) - newmode = SDL_GRAB_ON; + newmode = SDL_TRUE; else - newmode = SDL_GRAB_OFF; - } else if (wantmode == SDL_GRAB_OFF) + newmode = SDL_FALSE; + } else if (wantmode == SDL_FALSE) { //LL_INFOS() << "X11 POINTER UNGRABBY" << LL_ENDL; - newmode = SDL_GRAB_OFF; + newmode = SDL_FALSE; //newmode = SDL_WM_GrabInput(SDL_GRAB_OFF); maybe_lock_display(); @@ -1596,7 +1593,7 @@ BOOL LLWindowSDL::SDLReallyCaptureInput(BOOL capture) maybe_unlock_display(); } else { - newmode = SDL_GRAB_QUERY; // neutral + //newmode = SDL_GRAB_QUERY; // neutral } } else // not actually running on X11, for some reason newmode = wantmode; @@ -1607,10 +1604,9 @@ BOOL LLWindowSDL::SDLReallyCaptureInput(BOOL capture) } // 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 && SDL_TRUE==newmode) || + (!capture && SDL_FALSE==newmode); } -*/ U32 LLWindowSDL::SDLCheckGrabbyKeys(SDL_Keycode keysym, BOOL gain) { @@ -1817,10 +1813,8 @@ void LLWindowSDL::gatherInput() 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) SDLReallyCaptureInput(TRUE); - */ if (event.key.keysym.sym < SDLK_SPACE) { @@ -1839,10 +1833,8 @@ void LLWindowSDL::gatherInput() mKeyScanCode = event.key.keysym.scancode; mKeyModifiers = event.key.keysym.mod; - /* if (SDLCheckGrabbyKeys(event.key.keysym.sym, FALSE) == 0) SDLReallyCaptureInput(FALSE); // part of the fix for SL-13243 - */ gKeyboard->handleKeyUp(event.key.keysym.sym, event.key.keysym.mod); break; diff --git a/indra/llwindow/llwindowsdl.h b/indra/llwindow/llwindowsdl.h index e8a93247f3..992f9c986c 100644 --- a/indra/llwindow/llwindowsdl.h +++ b/indra/llwindow/llwindowsdl.h @@ -182,7 +182,7 @@ protected: void setupFailure(const std::string& text, const std::string& caption, U32 type); void fixWindowSize(void); U32 SDLCheckGrabbyKeys(SDL_Keycode keysym, BOOL gain); - //BOOL SDLReallyCaptureInput(BOOL capture); + BOOL SDLReallyCaptureInput(BOOL capture); // // Platform specific variables -- cgit v1.2.3 From f8eca3e75a9325a16c0900eadfc893d049819eab Mon Sep 17 00:00:00 2001 From: Erik Kundiman Date: Thu, 17 Aug 2023 20:54:04 +0800 Subject: Re-enable x11_detect_VRAM_kb use It's an error according to GCC when defined but not used. It could, and probably should, still be used anyway, just not the SDL version. --- indra/llwindow/llwindowsdl.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'indra') diff --git a/indra/llwindow/llwindowsdl.cpp b/indra/llwindow/llwindowsdl.cpp index 7c8c3ab17a..7e2af357eb 100644 --- a/indra/llwindow/llwindowsdl.cpp +++ b/indra/llwindow/llwindowsdl.cpp @@ -625,7 +625,6 @@ BOOL LLWindowSDL::createContext(int x, int y, int width, int height, int bits, B bmpsurface = NULL; } - /* // Detect video memory size. # if LL_X11 gGLManager.mVRAM = x11_detect_VRAM_kb() / 1024; @@ -635,6 +634,7 @@ BOOL LLWindowSDL::createContext(int x, int y, int width, int height, int bits, B } 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. @@ -643,8 +643,8 @@ BOOL LLWindowSDL::createContext(int x, int y, int width, int height, int bits, B { LL_INFOS() << "SDL detected " << gGLManager.mVRAM << "MB VRAM." << LL_ENDL; } + */ } - */ // If VRAM is not detected, that is handled later // *TODO: Now would be an appropriate time to check for some -- cgit v1.2.3 From eadd80cf95cc25565a3bdcea179503d21ba5ae11 Mon Sep 17 00:00:00 2001 From: Erik Kundiman Date: Thu, 17 Aug 2023 20:57:43 +0800 Subject: GLibc related code is used only on a GNU system --- indra/llcommon/llsys.cpp | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'indra') diff --git a/indra/llcommon/llsys.cpp b/indra/llcommon/llsys.cpp index 8c4e0988fc..457ced7fae 100644 --- a/indra/llcommon/llsys.cpp +++ b/indra/llcommon/llsys.cpp @@ -82,7 +82,9 @@ using namespace llsd; # include # include const char MEMINFO_FILE[] = "/proc/meminfo"; +#ifdef __GNU__ # include +#endif #elif LL_FREEBSD # include # include @@ -353,6 +355,7 @@ LLOSInfo::LLOSInfo() : boost::regex os_version_parse(OS_VERSION_MATCH_EXPRESSION); boost::smatch matched; +#ifdef __GNU__ std::string glibc_version(gnu_get_libc_version()); if ( ll_regex_match(glibc_version, matched, os_version_parse) ) { @@ -411,6 +414,7 @@ LLOSInfo::LLOSInfo() : { LL_WARNS("AppInit") << "glibc version '" << glibc_version << "' cannot be parsed to three numbers; using all zeros" << LL_ENDL; } +#endif // __GNU__ #else -- cgit v1.2.3 From 84b72f12d42e08fe989752ce36e1972bb11c8d70 Mon Sep 17 00:00:00 2001 From: Erik Kundiman Date: Thu, 17 Aug 2023 21:01:51 +0800 Subject: Neon is used as an alternative to SSE2 on Arm systems. --- indra/llcommon/llmemory.h | 4 ++++ indra/llmath/llsimdmath.h | 6 +++++- 2 files changed, 9 insertions(+), 1 deletion(-) (limited to 'indra') diff --git a/indra/llcommon/llmemory.h b/indra/llcommon/llmemory.h index b67a8c9bc0..dd9867c9b3 100644 --- a/indra/llcommon/llmemory.h +++ b/indra/llcommon/llmemory.h @@ -71,7 +71,11 @@ LL_COMMON_API void ll_assert_aligned_func(uintptr_t ptr,U32 alignment); #define ll_assert_aligned(ptr,alignment) #endif +#if defined(__i386__) || defined(__x86_64__) #include +#else +#include +#endif template T* LL_NEXT_ALIGNED_ADDRESS(T* address) { diff --git a/indra/llmath/llsimdmath.h b/indra/llmath/llsimdmath.h index 54a275633f..a6f57d1853 100644 --- a/indra/llmath/llsimdmath.h +++ b/indra/llmath/llsimdmath.h @@ -31,7 +31,7 @@ #error "Please include llmath.h before this file." #endif -#if ( ( LL_DARWIN || LL_LINUX ) && !(__SSE2__) ) || ( LL_WINDOWS && ( _M_IX86_FP < 2 && ADDRESS_SIZE == 32 ) ) +#if ( ( LL_DARWIN || LL_LINUX ) && !(__SSE2__ || __ARM_NEON) ) || ( LL_WINDOWS && ( _M_IX86_FP < 2 && ADDRESS_SIZE == 32 ) ) #error SSE2 not enabled. LLVector4a and related class will not compile. #endif @@ -39,8 +39,12 @@ #include #endif +#if defined(__i386__) || defined(__x86_64__) #include #include +#else +#include +#endif #include "llmemory.h" #include "llsimdtypes.h" -- cgit v1.2.3 From eccb10575d3b6dc841cf4bf07db29833174d1c69 Mon Sep 17 00:00:00 2001 From: Erik Kundiman Date: Thu, 17 Aug 2023 21:04:21 +0800 Subject: Make SDL exclude immintrin.h when not on Intel I don't know why SDL2 isn't defining the macro by default when it's been compiled and installed on an Arm environment, that it has to be manually defined. I may be missing something here.. --- indra/llwindow/llkeyboardsdl.h | 3 +++ indra/llwindow/llwindowsdl.h | 3 +++ 2 files changed, 6 insertions(+) (limited to 'indra') diff --git a/indra/llwindow/llkeyboardsdl.h b/indra/llwindow/llkeyboardsdl.h index 2b1ac5af2b..43f8e1ccb4 100644 --- a/indra/llwindow/llkeyboardsdl.h +++ b/indra/llwindow/llkeyboardsdl.h @@ -28,6 +28,9 @@ #define LL_LLKEYBOARDSDL_H #include "llkeyboard.h" +#if !defined(__i386__) && !defined(__x86_64__) +#define SDL_DISABLE_IMMINTRIN_H +#endif #include "SDL2/SDL.h" class LLKeyboardSDL : public LLKeyboard diff --git a/indra/llwindow/llwindowsdl.h b/indra/llwindow/llwindowsdl.h index 992f9c986c..86e238282b 100644 --- a/indra/llwindow/llwindowsdl.h +++ b/indra/llwindow/llwindowsdl.h @@ -32,6 +32,9 @@ #include "llwindow.h" #include "lltimer.h" +#if !defined(__i386__) && !defined(__x86_64__) +#define SDL_DISABLE_IMMINTRIN_H +#endif #include "SDL2/SDL.h" #include "SDL2/SDL_endian.h" -- cgit v1.2.3 From 6da23f151be1ce7ad98912b504ef4dbcb0cdd494 Mon Sep 17 00:00:00 2001 From: Erik Kundiman Date: Mon, 21 Aug 2023 15:27:51 +0800 Subject: Revert "FreeBSD can use llappviewerlinux too" This reverts commit 8356386f6674cf7f1e25bcd49f3266868cd5dc7d. --- indra/newview/CMakeLists.txt | 4 ++-- indra/newview/llappviewerlinux.cpp | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) (limited to 'indra') diff --git a/indra/newview/CMakeLists.txt b/indra/newview/CMakeLists.txt index 48c9462f9f..a4e40d0959 100644 --- a/indra/newview/CMakeLists.txt +++ b/indra/newview/CMakeLists.txt @@ -1413,7 +1413,7 @@ if (DARWIN) list(APPEND viewer_SOURCE_FILES ${viewer_RESOURCE_FILES}) endif (DARWIN) -if (LINUX OR CMAKE_SYSTEM_NAME MATCHES "FreeBSD") +if (LINUX) LIST(APPEND viewer_SOURCE_FILES llappviewerlinux.cpp) set_source_files_properties( llappviewerlinux.cpp @@ -1423,7 +1423,7 @@ if (LINUX OR CMAKE_SYSTEM_NAME MATCHES "FreeBSD") LIST(APPEND viewer_SOURCE_FILES llappviewerlinux_api_dbus.cpp) SET(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -Wl,--as-needed") -endif (LINUX OR CMAKE_SYSTEM_NAME MATCHES "FreeBSD") +endif (LINUX) if (WINDOWS) list(APPEND viewer_SOURCE_FILES diff --git a/indra/newview/llappviewerlinux.cpp b/indra/newview/llappviewerlinux.cpp index ad246ae64d..a110828967 100644 --- a/indra/newview/llappviewerlinux.cpp +++ b/indra/newview/llappviewerlinux.cpp @@ -330,7 +330,7 @@ void LLAppViewerLinux::initCrashReporting(bool reportFreeze) { std::string cmd =gDirUtilp->getExecutableDir(); cmd += gDirUtilp->getDirDelimiter(); -#if LL_LINUX || LL_FREEBSD +#if LL_LINUX cmd += "linux-crash-logger.bin"; #else # error Unknown platform -- cgit v1.2.3 From f429c35bb46d4632e56cfff8e0fc7150baca3d27 Mon Sep 17 00:00:00 2001 From: Erik Kundiman Date: Mon, 21 Aug 2023 15:51:50 +0800 Subject: Any platform can, & should, use appviewerlinux too It's the one that plays along with SDL. --- indra/newview/CMakeLists.txt | 4 ++-- indra/newview/llappviewerlinux.cpp | 4 +++- 2 files changed, 5 insertions(+), 3 deletions(-) (limited to 'indra') diff --git a/indra/newview/CMakeLists.txt b/indra/newview/CMakeLists.txt index a4e40d0959..52a1712393 100644 --- a/indra/newview/CMakeLists.txt +++ b/indra/newview/CMakeLists.txt @@ -1413,7 +1413,7 @@ if (DARWIN) list(APPEND viewer_SOURCE_FILES ${viewer_RESOURCE_FILES}) endif (DARWIN) -if (LINUX) +if (USESYSTEMLIBS) LIST(APPEND viewer_SOURCE_FILES llappviewerlinux.cpp) set_source_files_properties( llappviewerlinux.cpp @@ -1423,7 +1423,7 @@ if (LINUX) LIST(APPEND viewer_SOURCE_FILES llappviewerlinux_api_dbus.cpp) SET(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -Wl,--as-needed") -endif (LINUX) +endif (USESYSTEMLIBS) if (WINDOWS) list(APPEND viewer_SOURCE_FILES diff --git a/indra/newview/llappviewerlinux.cpp b/indra/newview/llappviewerlinux.cpp index a110828967..deb876e24d 100644 --- a/indra/newview/llappviewerlinux.cpp +++ b/indra/newview/llappviewerlinux.cpp @@ -330,11 +330,13 @@ void LLAppViewerLinux::initCrashReporting(bool reportFreeze) { std::string cmd =gDirUtilp->getExecutableDir(); cmd += gDirUtilp->getDirDelimiter(); -#if LL_LINUX +//#if LL_LINUX cmd += "linux-crash-logger.bin"; +/* #else # error Unknown platform #endif +*/ std::stringstream pid_str; pid_str << LLApp::getPid(); -- cgit v1.2.3 From b8e727b023876c34ae3b1fca0f598c8b2dbe4bcd Mon Sep 17 00:00:00 2001 From: Erik Kundiman Date: Mon, 21 Aug 2023 16:15:56 +0800 Subject: GLib header is included only when using GTK --- indra/newview/llappviewerlinux.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'indra') diff --git a/indra/newview/llappviewerlinux.h b/indra/newview/llappviewerlinux.h index 0289c43043..14e481f054 100644 --- a/indra/newview/llappviewerlinux.h +++ b/indra/newview/llappviewerlinux.h @@ -27,9 +27,11 @@ #ifndef LL_LLAPPVIEWERLINUX_H #define LL_LLAPPVIEWERLINUX_H +#if LL_GTK extern "C" { # include } +#endif #if LL_DBUS_ENABLED extern "C" { -- cgit v1.2.3 From 99e4f282ba8df6dcaa3032fa1bfbb5f88884d9a6 Mon Sep 17 00:00:00 2001 From: Erik Kundiman Date: Mon, 21 Aug 2023 16:25:38 +0800 Subject: Darwin & any platform can, and should, use SDL The alt mouse click to cam is broken for now on macOS, but this is the path we've chosen. --- indra/cmake/LLWindow.cmake | 7 ++++-- indra/llwindow/CMakeLists.txt | 4 ++-- indra/llwindow/llwindow.cpp | 18 ++++++++------- indra/llwindow/llwindowsdl.cpp | 51 ++++++++++++++++++++++++++++++++++++++++++ indra/newview/CMakeLists.txt | 5 +++++ 5 files changed, 73 insertions(+), 12 deletions(-) (limited to 'indra') diff --git a/indra/cmake/LLWindow.cmake b/indra/cmake/LLWindow.cmake index 09b8fdb83d..8cb383d718 100644 --- a/indra/cmake/LLWindow.cmake +++ b/indra/cmake/LLWindow.cmake @@ -7,13 +7,16 @@ include(Prebuilt) include_guard() add_library( ll::SDL INTERFACE IMPORTED ) -if (NOT (USE_AUTOBUILD_3P OR USE_CONAN) AND NOT DARWIN) +if (USESYSTEMLIBS) include(FindPkgConfig) pkg_check_modules(Sdl2 REQUIRED sdl2) target_compile_definitions( ll::SDL INTERFACE LL_SDL=1) target_include_directories(ll::SDL SYSTEM INTERFACE ${Sdl2_INCLUDE_DIRS}) target_link_directories(ll::SDL INTERFACE ${Sdl2_LIBRARY_DIRS}) - target_link_libraries(ll::SDL INTERFACE ${Sdl2_LIBRARIES} X11) + if (LINUX OR CMAKE_SYSTEM_NAME MATCHES "FreeBSD") + list(APPEND Sdl2_LIBRARIES X11) + endif () + target_link_libraries(ll::SDL INTERFACE ${Sdl2_LIBRARIES}) return () endif () diff --git a/indra/llwindow/CMakeLists.txt b/indra/llwindow/CMakeLists.txt index cc44c1e2a1..9cf31d60d5 100644 --- a/indra/llwindow/CMakeLists.txt +++ b/indra/llwindow/CMakeLists.txt @@ -64,7 +64,7 @@ include_directories(${CMAKE_SOURCE_DIR}/llrender) # Libraries on which this library depends, needed for Linux builds # Sort by high-level to low-level -if (LINUX OR CMAKE_SYSTEM_NAME MATCHES "FreeBSD") +if (USESYSTEMLIBS) list(APPEND viewer_SOURCE_FILES llkeyboardsdl.cpp llwindowsdl.cpp @@ -87,7 +87,7 @@ if (LINUX OR CMAKE_SYSTEM_NAME MATCHES "FreeBSD") ) endif (BUILD_HEADLESS) -endif (LINUX OR CMAKE_SYSTEM_NAME MATCHES "FreeBSD") +endif (USESYSTEMLIBS) if (DARWIN) list(APPEND llwindow_SOURCE_FILES diff --git a/indra/llwindow/llwindow.cpp b/indra/llwindow/llwindow.cpp index 207c5cac9c..ece334b8cf 100644 --- a/indra/llwindow/llwindow.cpp +++ b/indra/llwindow/llwindow.cpp @@ -74,12 +74,12 @@ S32 OSMessageBox(const std::string& text, const std::string& caption, U32 type) #if LL_MESA_HEADLESS // !!! *FIX: (?) LL_WARNS() << "OSMessageBox: " << text << LL_ENDL; return OSBTN_OK; +#elif LL_SDL + 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!") #endif @@ -259,12 +259,12 @@ BOOL LLWindow::copyTextToPrimary(const LLWString &src) // static std::vector LLWindow::getDynamicFallbackFontList() { -#if LL_WINDOWS +#if LL_SDL + 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 @@ -273,12 +273,12 @@ std::vector LLWindow::getDynamicFallbackFontList() // static std::vector LLWindow::getDisplaysResolutionList() { -#if LL_WINDOWS +#ifdef LL_SDL + return std::vector(); +#elif LL_WINDOWS return LLWindowWin32::getDisplaysResolutionList(); #elif LL_DARWIN return LLWindowMacOSX::getDisplaysResolutionList(); -#else - return std::vector(); #endif } @@ -359,11 +359,13 @@ void LLSplashScreen::show() { if (!gSplashScreenp) { +#if !LL_SDL #if LL_WINDOWS && !LL_MESA_HEADLESS gSplashScreenp = new LLSplashScreenWin32; #elif LL_DARWIN gSplashScreenp = new LLSplashScreenMacOSX; #endif +#endif // !LL_SDL if (gSplashScreenp) { gSplashScreenp->showImpl(); diff --git a/indra/llwindow/llwindowsdl.cpp b/indra/llwindow/llwindowsdl.cpp index 7e2af357eb..293e6ec272 100644 --- a/indra/llwindow/llwindowsdl.cpp +++ b/indra/llwindow/llwindowsdl.cpp @@ -66,6 +66,33 @@ const S32 MAX_NUM_RESOLUTIONS = 200; // static variable for ATI mouse cursor crash work-around: static bool ATIbug = false; +#if LL_DARWIN + +namespace +{ + struct NativeKeyEventData { + enum EventType { + KEYUNKNOWN, + KEYUP, + KEYDOWN, + KEYCHAR + }; + + EventType mKeyEvent = KEYUNKNOWN; + uint32_t mEventType = 0; + uint32_t mEventModifiers = 0; + uint32_t mEventKeyCode = 0; + uint32_t mEventChars = 0; + uint32_t mEventUnmodChars = 0; + bool mEventRepeat = false; + } *mRawKeyEvent = NULL; +} +// +// LLWindowMacOSX +// + +#endif + // // LLWindowSDL // @@ -2535,6 +2562,30 @@ BOOL LLWindowSDL::dialogColorPicker( F32 *r, F32 *g, F32 *b) { return (FALSE); } + +#if LL_DARWIN + +LLSD LLWindowSDL::getNativeKeyData() +{ + LLSD result = LLSD::emptyMap(); + + if(mRawKeyEvent) + { + result["event_type"] = LLSD::Integer(mRawKeyEvent->mEventType); + result["event_modifiers"] = LLSD::Integer(mRawKeyEvent->mEventModifiers); + result["event_keycode"] = LLSD::Integer(mRawKeyEvent->mEventKeyCode); + result["event_chars"] = (mRawKeyEvent->mEventChars) ? LLSD(LLSD::Integer(mRawKeyEvent->mEventChars)) : LLSD(); + result["event_umodchars"] = (mRawKeyEvent->mEventUnmodChars) ? LLSD(LLSD::Integer(mRawKeyEvent->mEventUnmodChars)) : LLSD(); + result["event_isrepeat"] = LLSD::Boolean(mRawKeyEvent->mEventRepeat); + } + + LL_DEBUGS() << "native key data is: " << result << LL_ENDL; + + return result; +} + +#endif // LL_DARWIN + #endif // LL_GTK #if LL_LINUX || LL_FREEBSD diff --git a/indra/newview/CMakeLists.txt b/indra/newview/CMakeLists.txt index 52a1712393..e345b55845 100644 --- a/indra/newview/CMakeLists.txt +++ b/indra/newview/CMakeLists.txt @@ -1374,12 +1374,15 @@ set_source_files_properties( ) if (DARWIN) + if (NOT USESYSTEMLIBS) LIST(APPEND viewer_SOURCE_FILES llappviewermacosx.cpp) LIST(APPEND viewer_SOURCE_FILES llappviewermacosx-objc.mm) LIST(APPEND viewer_SOURCE_FILES llappviewermacosx-objc.h) + endif (NOT USESYSTEMLIBS) LIST(APPEND viewer_SOURCE_FILES llfilepicker_mac.mm) LIST(APPEND viewer_HEADER_FILES llfilepicker_mac.h) + if (NOT USESYSTEMLIBS) # This should be compiled with the viewer. LIST(APPEND viewer_SOURCE_FILES llappdelegate-objc.mm) set_source_files_properties( @@ -1394,6 +1397,7 @@ if (DARWIN) # warnings. COMPILE_FLAGS "-fmodules -fcxx-modules -Wno-nullability-completeness" ) + endif (NOT USESYSTEMLIBS) # Add resource files to the project. set(viewer_RESOURCE_FILES @@ -1920,6 +1924,7 @@ target_link_libraries(${VIEWER_BINARY_NAME} ll::bugsplat ll::tracy ll::libvlc + ll::fontconfig ) if( TARGET ll::intel_memops ) -- cgit v1.2.3 From 41a263a4ccc1171d04f289b62d879d2156b5f508 Mon Sep 17 00:00:00 2001 From: Erik Kundiman Date: Mon, 21 Aug 2023 16:29:33 +0800 Subject: DBus hasn't been enabled, so why compile api_dbus So it won't get in the way for other platforms that have no DBus. --- indra/newview/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'indra') diff --git a/indra/newview/CMakeLists.txt b/indra/newview/CMakeLists.txt index e345b55845..339ec8a623 100644 --- a/indra/newview/CMakeLists.txt +++ b/indra/newview/CMakeLists.txt @@ -1424,7 +1424,7 @@ if (USESYSTEMLIBS) PROPERTIES COMPILE_DEFINITIONS "${VIEWER_CHANNEL_VERSION_DEFINES}" ) - LIST(APPEND viewer_SOURCE_FILES llappviewerlinux_api_dbus.cpp) + #LIST(APPEND viewer_SOURCE_FILES llappviewerlinux_api_dbus.cpp) SET(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -Wl,--as-needed") endif (USESYSTEMLIBS) -- cgit v1.2.3 From b1cfd19724fd1791f5b383e2d9dac71d35ba2167 Mon Sep 17 00:00:00 2001 From: Erik Kundiman Date: Mon, 21 Aug 2023 16:32:19 +0800 Subject: Apple Clang doesn't recognise --as-needed --- indra/newview/CMakeLists.txt | 2 ++ 1 file changed, 2 insertions(+) (limited to 'indra') diff --git a/indra/newview/CMakeLists.txt b/indra/newview/CMakeLists.txt index 339ec8a623..226f9a3bda 100644 --- a/indra/newview/CMakeLists.txt +++ b/indra/newview/CMakeLists.txt @@ -1425,7 +1425,9 @@ if (USESYSTEMLIBS) COMPILE_DEFINITIONS "${VIEWER_CHANNEL_VERSION_DEFINES}" ) #LIST(APPEND viewer_SOURCE_FILES llappviewerlinux_api_dbus.cpp) + if (NOT (CMAKE_CXX_COMPILER_ID MATCHES "AppleClang")) SET(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -Wl,--as-needed") + endif () endif (USESYSTEMLIBS) -- cgit v1.2.3 From 7dd1149e3649057f0962b85bdc467f4e9299b235 Mon Sep 17 00:00:00 2001 From: Erik Kundiman Date: Mon, 21 Aug 2023 17:35:54 +0800 Subject: Darwin not (directly) relying on Carbon & Obj-C HiDPI support & multi threaded OpenGL haven't been used since we switched to SDL2 on Darwin, and so far there hasn't been any sign that things aren't working any more significantly. --- indra/llplugin/llpluginclassmedia.cpp | 4 ++-- indra/llwindow/CMakeLists.txt | 8 ++++---- indra/llwindow/llkeyboard.h | 2 +- indra/newview/llappviewer.cpp | 6 +++--- 4 files changed, 10 insertions(+), 10 deletions(-) (limited to 'indra') diff --git a/indra/llplugin/llpluginclassmedia.cpp b/indra/llplugin/llpluginclassmedia.cpp index e0b3f6ef56..2d19e3df90 100644 --- a/indra/llplugin/llpluginclassmedia.cpp +++ b/indra/llplugin/llpluginclassmedia.cpp @@ -36,7 +36,7 @@ #ifndef LL_USESYSTEMLIBS extern LLControlGroup gSavedSettings; #endif -#if LL_DARWIN +#if LL_DARWIN && !LL_SDL extern BOOL gHiDPISupport; #endif @@ -370,7 +370,7 @@ void LLPluginClassMedia::setSizeInternal(void) mRequestedMediaHeight = nextPowerOf2(mRequestedMediaHeight); } -#if LL_DARWIN +#if LL_DARWIN && !LL_SDL if (!gHiDPISupport) #endif { diff --git a/indra/llwindow/CMakeLists.txt b/indra/llwindow/CMakeLists.txt index 9cf31d60d5..120fd1213d 100644 --- a/indra/llwindow/CMakeLists.txt +++ b/indra/llwindow/CMakeLists.txt @@ -89,7 +89,7 @@ if (USESYSTEMLIBS) endif (USESYSTEMLIBS) -if (DARWIN) +if (DARWIN AND (NOT USESYSTEMLIBS)) list(APPEND llwindow_SOURCE_FILES llkeyboardmacosx.cpp llwindowmacosx.cpp @@ -111,7 +111,7 @@ if (DARWIN) PROPERTIES COMPILE_FLAGS "-Wno-deprecated-declarations -fpascal-strings" ) -endif (DARWIN) +endif (DARWIN AND (NOT USESYSTEMLIBS)) if (WINDOWS) @@ -181,10 +181,10 @@ endif (SDL_FOUND) target_link_libraries (llwindow ${llwindow_LINK_LIBRARIES}) target_include_directories(llwindow INTERFACE ${CMAKE_CURRENT_SOURCE_DIR}) -if (DARWIN) +if (DARWIN AND (NOT USESYSTEMLIBS)) include(CMakeFindFrameworks) find_library(CARBON_LIBRARY Carbon) target_link_libraries(llwindow ${CARBON_LIBRARY}) -endif (DARWIN) +endif (DARWIN AND (NOT USESYSTEMLIBS)) include(LibraryInstall) diff --git a/indra/llwindow/llkeyboard.h b/indra/llwindow/llkeyboard.h index 2a700ce8e9..0cfba78c5b 100644 --- a/indra/llwindow/llkeyboard.h +++ b/indra/llwindow/llkeyboard.h @@ -76,7 +76,7 @@ public: virtual BOOL handleKeyUp(const U32 key, MASK mask) = 0; virtual BOOL handleKeyDown(const U32 key, MASK mask) = 0; -#ifdef LL_DARWIN +#if defined(LL_DARWIN) && !defined(LL_SDL) // We only actually use this for OS X. virtual void handleModifier(MASK mask) = 0; #endif // LL_DARWIN diff --git a/indra/newview/llappviewer.cpp b/indra/newview/llappviewer.cpp index 23e6b16103..a63785990f 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 extern BOOL gHiDPISupport; #endif @@ -568,7 +568,7 @@ static void settings_to_globals() gShowObjectUpdates = gSavedSettings.getBOOL("ShowObjectUpdates"); LLWorldMapView::setScaleSetting(gSavedSettings.getF32("MapScale")); -#if LL_DARWIN +#if LL_DARWIN && !LL_SDL LLWindowMacOSX::sUseMultGL = gSavedSettings.getBOOL("RenderAppleUseMultGL"); gHiDPISupport = gSavedSettings.getBOOL("RenderHiDPI"); #endif @@ -3310,7 +3310,7 @@ LLSD LLAppViewer::getViewerInfo() const info["GPU_SHADERS"] = gSavedSettings.getBOOL("RenderDeferred") ? "Enabled" : "Disabled"; info["TEXTURE_MEMORY"] = gSavedSettings.getS32("TextureMemory"); -#if LL_DARWIN +#if LL_DARWIN && !LL_SDL info["HIDPI"] = gHiDPISupport; #endif -- cgit v1.2.3 From 6b26b3cf7eceda2c3fdebda268bbb900a4b57ffb Mon Sep 17 00:00:00 2001 From: Erik Kundiman Date: Mon, 21 Aug 2023 17:52:51 +0800 Subject: Exclude net/route.h on Darwin since it doesn't seem to have any effect, and it would only get in the way on other Darwin platforms. --- indra/llcommon/lluuid.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'indra') diff --git a/indra/llcommon/lluuid.cpp b/indra/llcommon/lluuid.cpp index 3b575c914c..37aee13c42 100644 --- a/indra/llcommon/lluuid.cpp +++ b/indra/llcommon/lluuid.cpp @@ -522,7 +522,7 @@ S32 LLUUID::getNodeID(unsigned char *node_id) #include #include #include -#include +//#include #include // static -- cgit v1.2.3 From 2a9bc5536330c169d43053fc7cad6311ec62c538 Mon Sep 17 00:00:00 2001 From: Erik Kundiman Date: Mon, 21 Aug 2023 17:55:19 +0800 Subject: Non x86 Darwin can use Linux's non x86 CPU clock --- indra/llcommon/llfasttimer.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'indra') diff --git a/indra/llcommon/llfasttimer.h b/indra/llcommon/llfasttimer.h index 53f936db34..9a5789d719 100644 --- a/indra/llcommon/llfasttimer.h +++ b/indra/llcommon/llfasttimer.h @@ -128,7 +128,7 @@ public: #endif -#if (LL_LINUX) && !(defined(__i386__) || defined(__amd64__)) +#if (LL_LINUX || LL_DARWIN) && !(defined(__i386__) || defined(__amd64__)) // // Linux implementation of CPU clock - non-x86. // This is accurate but SLOW! Only use out of desperation. -- cgit v1.2.3 From e24c3ed7d3baef9ea313a0f528075ef229257975 Mon Sep 17 00:00:00 2001 From: Erik Kundiman Date: Tue, 22 Aug 2023 13:53:34 +0800 Subject: Add sysroot to XMLRPC-EPI include path on Linux Useful when cross compiling. --- indra/cmake/XmlRpcEpi.cmake | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'indra') diff --git a/indra/cmake/XmlRpcEpi.cmake b/indra/cmake/XmlRpcEpi.cmake index ae2ed6a83f..337e4b8974 100644 --- a/indra/cmake/XmlRpcEpi.cmake +++ b/indra/cmake/XmlRpcEpi.cmake @@ -15,7 +15,8 @@ target_link_libraries(ll::xmlrpc-epi INTERFACE xmlrpc-epi ) if (USE_AUTOBUILD_3P OR USE_CONAN) target_include_directories( ll::xmlrpc-epi SYSTEM INTERFACE ${LIBS_PREBUILT_DIR}/include) elseif (LINUX) -target_include_directories( ll::xmlrpc-epi SYSTEM INTERFACE /usr/include/xmlrpc-epi) + target_include_directories( ll::xmlrpc-epi SYSTEM INTERFACE + ${CMAKE_SYSROOT}/usr/include/xmlrpc-epi) elseif (DARWIN) target_include_directories( ll::xmlrpc-epi SYSTEM INTERFACE /usr/local/include) target_link_directories( ll::xmlrpc-epi SYSTEM INTERFACE /usr/local/lib) -- cgit v1.2.3 From 319ed3a59df9dbd2b51ece3d6a698040dcb47135 Mon Sep 17 00:00:00 2001 From: Erik Kundiman Date: Tue, 22 Aug 2023 17:58:50 +0800 Subject: Fix target_link_directories argument Only found out after using CMake 3.26 for Darwin. It wasn't an error when using CMake 3.24. --- indra/cmake/XmlRpcEpi.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'indra') diff --git a/indra/cmake/XmlRpcEpi.cmake b/indra/cmake/XmlRpcEpi.cmake index 337e4b8974..aefc3e895f 100644 --- a/indra/cmake/XmlRpcEpi.cmake +++ b/indra/cmake/XmlRpcEpi.cmake @@ -19,5 +19,5 @@ elseif (LINUX) ${CMAKE_SYSROOT}/usr/include/xmlrpc-epi) elseif (DARWIN) target_include_directories( ll::xmlrpc-epi SYSTEM INTERFACE /usr/local/include) -target_link_directories( ll::xmlrpc-epi SYSTEM INTERFACE /usr/local/lib) +target_link_directories( ll::xmlrpc-epi INTERFACE /usr/local/lib) endif () -- cgit v1.2.3 From 5918eedb06b6441e5608ed7958a2b3ca01dc8010 Mon Sep 17 00:00:00 2001 From: Erik Kundiman Date: Tue, 22 Aug 2023 18:03:39 +0800 Subject: Reindented --- indra/cmake/XmlRpcEpi.cmake | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'indra') diff --git a/indra/cmake/XmlRpcEpi.cmake b/indra/cmake/XmlRpcEpi.cmake index aefc3e895f..994df3d128 100644 --- a/indra/cmake/XmlRpcEpi.cmake +++ b/indra/cmake/XmlRpcEpi.cmake @@ -18,6 +18,6 @@ elseif (LINUX) target_include_directories( ll::xmlrpc-epi SYSTEM INTERFACE ${CMAKE_SYSROOT}/usr/include/xmlrpc-epi) elseif (DARWIN) -target_include_directories( ll::xmlrpc-epi SYSTEM INTERFACE /usr/local/include) -target_link_directories( ll::xmlrpc-epi INTERFACE /usr/local/lib) + target_include_directories( ll::xmlrpc-epi SYSTEM INTERFACE /usr/local/include) + target_link_directories( ll::xmlrpc-epi INTERFACE /usr/local/lib) endif () -- cgit v1.2.3 From 5b9cb5bba3c12b1b5c86ba56d43ccf06b83edc14 Mon Sep 17 00:00:00 2001 From: Erik Kundiman Date: Tue, 22 Aug 2023 20:50:31 +0800 Subject: Can link to libglvnd, no need to set LEGACY pref --- indra/llrender/llgl.cpp | 2 +- indra/llrender/llimagegl.cpp | 6 +++--- indra/llrender/llrender.cpp | 6 +++--- 3 files changed, 7 insertions(+), 7 deletions(-) (limited to 'indra') diff --git a/indra/llrender/llgl.cpp b/indra/llrender/llgl.cpp index a10bbbf726..346973e3fd 100644 --- a/indra/llrender/llgl.cpp +++ b/indra/llrender/llgl.cpp @@ -1604,7 +1604,7 @@ void LLGLState::resetTextureStates() for (S32 j = maxTextureUnits-1; j >=0; j--) { gGL.getTexUnit(j)->activate(); - glClientActiveTextureARB(GL_TEXTURE0_ARB+j); + glClientActiveTexture(GL_TEXTURE0_ARB+j); j == 0 ? gGL.getTexUnit(j)->enable(LLTexUnit::TT_TEXTURE) : gGL.getTexUnit(j)->disable(); } } diff --git a/indra/llrender/llimagegl.cpp b/indra/llrender/llimagegl.cpp index 465f30a343..8e83f2b401 100644 --- a/indra/llrender/llimagegl.cpp +++ b/indra/llrender/llimagegl.cpp @@ -741,7 +741,7 @@ BOOL LLImageGL::setImage(const U8* data_in, BOOL data_hasmips /* = FALSE */, S32 if (is_compressed) { S32 tex_size = dataFormatBytes(mFormatPrimary, w, h); - glCompressedTexImage2DARB(mTarget, gl_level, mFormatPrimary, w, h, 0, tex_size, (GLvoid *)data_in); + glCompressedTexImage2D(mTarget, gl_level, mFormatPrimary, w, h, 0, tex_size, (GLvoid *)data_in); stop_glerror(); } else @@ -943,7 +943,7 @@ BOOL LLImageGL::setImage(const U8* data_in, BOOL data_hasmips /* = FALSE */, S32 if (is_compressed) { S32 tex_size = dataFormatBytes(mFormatPrimary, w, h); - glCompressedTexImage2DARB(mTarget, 0, mFormatPrimary, w, h, 0, tex_size, (GLvoid *)data_in); + glCompressedTexImage2D(mTarget, 0, mFormatPrimary, w, h, 0, tex_size, (GLvoid *)data_in); stop_glerror(); } else @@ -1837,7 +1837,7 @@ BOOL LLImageGL::readBackRaw(S32 discard_level, LLImageRaw* imageraw, bool compre return FALSE ; } - glGetCompressedTexImageARB(mTarget, gl_discard, (GLvoid*)(imageraw->getData())); + glGetCompressedTexImage(mTarget, gl_discard, (GLvoid*)(imageraw->getData())); //stop_glerror(); } else diff --git a/indra/llrender/llrender.cpp b/indra/llrender/llrender.cpp index 72cca1f2a2..ba776f3b2f 100644 --- a/indra/llrender/llrender.cpp +++ b/indra/llrender/llrender.cpp @@ -122,7 +122,7 @@ void LLTexUnit::refreshState(void) gGL.flush(); - glActiveTextureARB(GL_TEXTURE0_ARB + mIndex); + glActiveTexture(GL_TEXTURE0_ARB + mIndex); if (mCurrTexType != TT_NONE) { @@ -143,7 +143,7 @@ void LLTexUnit::activate(void) if ((S32)gGL.mCurrTextureUnitIndex != mIndex || gGL.mDirty) { gGL.flush(); - glActiveTextureARB(GL_TEXTURE0_ARB + mIndex); + glActiveTexture(GL_TEXTURE0_ARB + mIndex); gGL.mCurrTextureUnitIndex = mIndex; } } @@ -187,7 +187,7 @@ void LLTexUnit::bindFast(LLTexture* texture) { LLImageGL* gl_tex = texture->getGLTexture(); - glActiveTextureARB(GL_TEXTURE0_ARB + mIndex); + glActiveTexture(GL_TEXTURE0_ARB + mIndex); gGL.mCurrTextureUnitIndex = mIndex; mCurrTexture = gl_tex->getTexName(); if (!mCurrTexture) -- cgit v1.2.3 From b6574337ed3fd7749db6185501cd444305d44905 Mon Sep 17 00:00:00 2001 From: Erik Kundiman Date: Thu, 24 Aug 2023 08:23:25 +0800 Subject: OpenAL createDefaultStreamingAudioImpl stub In llstartup, it says if the audio engine hasn't set up its own preferred handler for streaming audio, then the generic streaming audio implementation which uses media plugins will be used. The comparison is with NULL, so it's safe to return NULL (but probably not nullptr). --- indra/llaudio/llaudioengine_openal.cpp | 5 +++++ indra/llaudio/llaudioengine_openal.h | 1 + 2 files changed, 6 insertions(+) (limited to 'indra') diff --git a/indra/llaudio/llaudioengine_openal.cpp b/indra/llaudio/llaudioengine_openal.cpp index 0a79614424..bd262f253b 100644 --- a/indra/llaudio/llaudioengine_openal.cpp +++ b/indra/llaudio/llaudioengine_openal.cpp @@ -119,6 +119,11 @@ std::string LLAudioEngine_OpenAL::getDriverName(bool verbose) return version.str(); } +LLStreamingAudioInterface *LLAudioEngine_OpenAL::createDefaultStreamingAudioImpl() const +{ + return NULL; +} + // virtual void LLAudioEngine_OpenAL::allocateListener() { diff --git a/indra/llaudio/llaudioengine_openal.h b/indra/llaudio/llaudioengine_openal.h index a3cab97cd2..49ff484809 100644 --- a/indra/llaudio/llaudioengine_openal.h +++ b/indra/llaudio/llaudioengine_openal.h @@ -42,6 +42,7 @@ class LLAudioEngine_OpenAL : public LLAudioEngine virtual bool init(void *user_data, const std::string &app_title); virtual std::string getDriverName(bool verbose); + virtual LLStreamingAudioInterface* createDefaultStreamingAudioImpl() const; virtual void allocateListener(); virtual void shutdown(); -- cgit v1.2.3 From e902a39a049f2378be0b5ee13595a58cfce2d937 Mon Sep 17 00:00:00 2001 From: Erik Kundiman Date: Fri, 25 Aug 2023 16:52:22 +0800 Subject: Fix another misleading indentation --- indra/newview/llviewerstatsrecorder.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'indra') diff --git a/indra/newview/llviewerstatsrecorder.cpp b/indra/newview/llviewerstatsrecorder.cpp index 6372679a07..26cd640a7c 100644 --- a/indra/newview/llviewerstatsrecorder.cpp +++ b/indra/newview/llviewerstatsrecorder.cpp @@ -163,7 +163,7 @@ void LLViewerStatsRecorder::writeToLog( F32 interval ) if (delta_time < interval) return; - if (mSkipSaveIfZeros) + if (mSkipSaveIfZeros) { S32 total_events = mObjectCacheHitCount + mObjectCacheMissCrcCount + mObjectCacheMissFullCount + mObjectFullUpdates + mObjectTerseUpdates + mObjectCacheMissRequests + mObjectCacheUpdateDupes + -- cgit v1.2.3 From a09352872b2f1a9db452d9cc313088abd5fb75c0 Mon Sep 17 00:00:00 2001 From: Erik Kundiman Date: Sat, 26 Aug 2023 14:04:20 +0800 Subject: Add sysroot to GLH & Meshoptimizer include paths When cross-compiling, the host's /usr/local/include would be unsafely included before. The problem with this was that it leaked other host library headers unexpectedly, like Boost. The target compilation caught some function from the host headers which of a newer version, and then when trying to link to the target libraries, the function wasn't available yet in the older version. --- indra/cmake/GLH.cmake | 7 ++++--- indra/cmake/Meshoptimizer.cmake | 2 +- 2 files changed, 5 insertions(+), 4 deletions(-) (limited to 'indra') diff --git a/indra/cmake/GLH.cmake b/indra/cmake/GLH.cmake index 49c4e3b37a..09f7d568be 100644 --- a/indra/cmake/GLH.cmake +++ b/indra/cmake/GLH.cmake @@ -3,9 +3,10 @@ include(Prebuilt) add_library( ll::glh_linear INTERFACE IMPORTED ) -if (NOT (USE_AUTOBUILD_3P OR USE_CONAN)) - target_include_directories( ll::glh_linear SYSTEM INTERFACE /usr/local/include ) - return () +if (USESYSTEMLIBS) + target_include_directories(ll::glh_linear SYSTEM INTERFACE + ${CMAKE_SYSROOT}/usr/local/include) + return () endif () use_system_binary( glh_linear ) diff --git a/indra/cmake/Meshoptimizer.cmake b/indra/cmake/Meshoptimizer.cmake index 6cf8343dd6..70b3a2c088 100644 --- a/indra/cmake/Meshoptimizer.cmake +++ b/indra/cmake/Meshoptimizer.cmake @@ -7,7 +7,7 @@ include_guard() add_library( ll::meshoptimizer INTERFACE IMPORTED ) if (NOT (USE_AUTOBUILD_3P OR USE_CONAN)) - target_include_directories( ll::meshoptimizer SYSTEM INTERFACE /usr/local/include ) + target_include_directories( ll::meshoptimizer SYSTEM INTERFACE ${CMAKE_SYSROOT}/usr/local/include ) target_link_libraries( ll::meshoptimizer INTERFACE meshoptimizer) return () endif () -- cgit v1.2.3 From 00be9e00107c51a35c04f64fe917c559b8325564 Mon Sep 17 00:00:00 2001 From: Erik Kundiman Date: Sat, 26 Aug 2023 15:46:12 +0800 Subject: CPack for packaging (when PACKAGE set to on) Since we could use the dynamic versioning from the configuration phase of CMake, the inclusion is put in BuildVersion.cmake. Other CPACK variables are usually static so can be set when running cmake. CPack somehow doesn't pick up the DESTINATION values in ViewerInstall (slplugin & libvlc too) from UnixInstall, so they're they're partially hardcoded again there. --- indra/cmake/BuildVersion.cmake | 6 ++++++ indra/llplugin/slplugin/CMakeLists.txt | 2 +- indra/media_plugins/libvlc/CMakeLists.txt | 3 ++- indra/newview/CMakeLists.txt | 4 ++++ indra/newview/ViewerInstall.cmake | 12 ++++++------ 5 files changed, 19 insertions(+), 8 deletions(-) (limited to 'indra') diff --git a/indra/cmake/BuildVersion.cmake b/indra/cmake/BuildVersion.cmake index b531f29ee2..a56829bf14 100644 --- a/indra/cmake/BuildVersion.cmake +++ b/indra/cmake/BuildVersion.cmake @@ -55,4 +55,10 @@ if (NOT DEFINED VIEWER_SHORT_VERSION) # will be true in indra/, false in indra/n "LL_VIEWER_VERSION_BUILD=${VIEWER_VERSION_REVISION}" "LLBUILD_CONFIG=\"${CMAKE_BUILD_TYPE}\"" ) +if (PACKAGE) + include(CPack) + set(CPACK_PACKAGE_VERSION + ${VIEWER_VERSION_MAJOR}.${VIEWER_VERSION_MINOR}.${VIEWER_VERSION_PATCH}.${VIEWER_VERSION_REVISION} + CACHE STRING "Viewer major.minor.patch.revision versions.") +endif (PACKAGE) endif (NOT DEFINED VIEWER_SHORT_VERSION) diff --git a/indra/llplugin/slplugin/CMakeLists.txt b/indra/llplugin/slplugin/CMakeLists.txt index 871d858b58..e86ddd8a32 100644 --- a/indra/llplugin/slplugin/CMakeLists.txt +++ b/indra/llplugin/slplugin/CMakeLists.txt @@ -66,7 +66,7 @@ if (BUILD_SHARED_LIBS) endif () if (INSTALL) - install(TARGETS ${PROJECT_NAME} DESTINATION ${APP_LIBEXEC_DIR}) + install(TARGETS ${PROJECT_NAME} DESTINATION libexec/${VIEWER_BINARY_NAME}) endif () if (LL_TESTS) diff --git a/indra/media_plugins/libvlc/CMakeLists.txt b/indra/media_plugins/libvlc/CMakeLists.txt index cdaf3efbfa..84fac1634c 100644 --- a/indra/media_plugins/libvlc/CMakeLists.txt +++ b/indra/media_plugins/libvlc/CMakeLists.txt @@ -57,5 +57,6 @@ if (DARWIN) endif (DARWIN) if (INSTALL) - install(TARGETS ${PROJECT_NAME} DESTINATION ${APP_LIBEXEC_DIR}/llplugin) + install(TARGETS ${PROJECT_NAME} DESTINATION + libexec/${VIEWER_BINARY_NAME}/llplugin) endif () diff --git a/indra/newview/CMakeLists.txt b/indra/newview/CMakeLists.txt index 226f9a3bda..b5c88cfca1 100644 --- a/indra/newview/CMakeLists.txt +++ b/indra/newview/CMakeLists.txt @@ -1955,6 +1955,8 @@ elseif (CMAKE_CXX_COMPILER_ID MATCHES "GNU") -Wno-stringop-truncation) endif () +if (NOT USESYSTEMLIBS) + if (LINUX) set(product SecondLife-${ARCH}-${VIEWER_SHORT_VERSION}.${VIEWER_VERSION_REVISION}) @@ -2141,6 +2143,8 @@ if (DARWIN) endif (PACKAGE) endif (DARWIN) +endif (NOT USESYSTEMLIBS) + if (INSTALL) include(${CMAKE_CURRENT_SOURCE_DIR}/ViewerInstall.cmake) endif (INSTALL) diff --git a/indra/newview/ViewerInstall.cmake b/indra/newview/ViewerInstall.cmake index e321d7e563..af5876f411 100644 --- a/indra/newview/ViewerInstall.cmake +++ b/indra/newview/ViewerInstall.cmake @@ -1,9 +1,9 @@ install(PROGRAMS ${CMAKE_CURRENT_BINARY_DIR}/${VIEWER_BINARY_NAME} - DESTINATION ${APP_BINARY_DIR} + DESTINATION bin ) install(DIRECTORY skins app_settings linux_tools - DESTINATION ${APP_SHARE_DIR} + DESTINATION share/${VIEWER_BINARY_NAME} PATTERN ".svn" EXCLUDE ) @@ -12,7 +12,7 @@ find_file(IS_ARTWORK_PRESENT NAMES have_artwork_bundle.marker if (IS_ARTWORK_PRESENT) install(DIRECTORY res res-sdl character - DESTINATION ${APP_SHARE_DIR} + DESTINATION share/${VIEWER_BINARY_NAME} PATTERN ".svn" EXCLUDE ) else (IS_ARTWORK_PRESENT) @@ -20,10 +20,10 @@ else (IS_ARTWORK_PRESENT) endif (IS_ARTWORK_PRESENT) install(FILES featuretable_linux.txt - #featuretable_solaris.txt - DESTINATION ${APP_SHARE_DIR} + #featuretable_solaris.txt + DESTINATION share/${VIEWER_BINARY_NAME} ) install(FILES ${SCRIPTS_DIR}/messages/message_template.msg - DESTINATION ${APP_SHARE_DIR}/app_settings + DESTINATION share/${VIEWER_BINARY_NAME}/app_settings ) -- cgit v1.2.3 From 7632a78e5eca522c23baf3adf122bd576d013d97 Mon Sep 17 00:00:00 2001 From: Erik Kundiman Date: Sat, 26 Aug 2023 16:38:39 +0800 Subject: Fonts get installed too --- indra/newview/ViewerInstall.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'indra') diff --git a/indra/newview/ViewerInstall.cmake b/indra/newview/ViewerInstall.cmake index af5876f411..39764f22a0 100644 --- a/indra/newview/ViewerInstall.cmake +++ b/indra/newview/ViewerInstall.cmake @@ -2,7 +2,7 @@ install(PROGRAMS ${CMAKE_CURRENT_BINARY_DIR}/${VIEWER_BINARY_NAME} DESTINATION bin ) -install(DIRECTORY skins app_settings linux_tools +install(DIRECTORY skins app_settings linux_tools fonts DESTINATION share/${VIEWER_BINARY_NAME} PATTERN ".svn" EXCLUDE ) -- cgit v1.2.3 From 00dc394684356a21d02a798f9ad098587381d142 Mon Sep 17 00:00:00 2001 From: Erik Kundiman Date: Sat, 26 Aug 2023 16:39:32 +0800 Subject: Certificate authority bundle gets installed too When I tried using, for example, FBSD system's ca-root-nss.crt, at runtime, the viewer would fail at downloading textures, avatar names, and so on. So for now we're still relying on LLCA, it's just get installed automatically without having to track the file in the viewer project. --- indra/llfilesystem/lldir_linux.cpp | 2 +- indra/newview/ViewerInstall.cmake | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) (limited to 'indra') diff --git a/indra/llfilesystem/lldir_linux.cpp b/indra/llfilesystem/lldir_linux.cpp index 300cab39d6..7e8fe157ba 100644 --- a/indra/llfilesystem/lldir_linux.cpp +++ b/indra/llfilesystem/lldir_linux.cpp @@ -209,7 +209,7 @@ void LLDir_Linux::initAppDirs(const std::string &app_name, LL_WARNS() << "Couldn't create LL_PATH_CACHE dir " << getExpandedFilename(LL_PATH_CACHE,"") << LL_ENDL; } - mCAFile = getExpandedFilename(LL_PATH_EXECUTABLE, "ca-bundle.crt"); + mCAFile = add(mAppRODataDir, "ca-bundle.crt"); } U32 LLDir_Linux::countFilesInDir(const std::string &dirname, const std::string &mask) diff --git a/indra/newview/ViewerInstall.cmake b/indra/newview/ViewerInstall.cmake index 39764f22a0..43d3060bb9 100644 --- a/indra/newview/ViewerInstall.cmake +++ b/indra/newview/ViewerInstall.cmake @@ -21,6 +21,7 @@ endif (IS_ARTWORK_PRESENT) install(FILES featuretable_linux.txt #featuretable_solaris.txt + ${AUTOBUILD_INSTALL_DIR}/ca-bundle.crt DESTINATION share/${VIEWER_BINARY_NAME} ) -- cgit v1.2.3 From 79cc50c4f93ebe813ddda562b6450561e7650a9d Mon Sep 17 00:00:00 2001 From: Erik Kundiman Date: Sat, 26 Aug 2023 19:22:22 +0800 Subject: Don't install the headers for now until we've tried building another project, but based on this project's liblinden. It's also because these headers would be in a separate -dev Debian package. --- indra/cmake/LibraryInstall.cmake | 4 ++-- indra/llprimitive/llphysicsextensions/CMakeLists.txt | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) (limited to 'indra') diff --git a/indra/cmake/LibraryInstall.cmake b/indra/cmake/LibraryInstall.cmake index 5a55c215ed..dfc777c1cd 100644 --- a/indra/cmake/LibraryInstall.cmake +++ b/indra/cmake/LibraryInstall.cmake @@ -1,4 +1,4 @@ list(REMOVE_ITEM ${PROJECT_NAME}_HEADER_FILES CMakeLists.txt) -install(FILES ${${PROJECT_NAME}_HEADER_FILES} - DESTINATION include/${PROJECT_NAME}) +#install(FILES ${${PROJECT_NAME}_HEADER_FILES} +# DESTINATION include/${PROJECT_NAME}) install(TARGETS ${PROJECT_NAME} DESTINATION lib) diff --git a/indra/llprimitive/llphysicsextensions/CMakeLists.txt b/indra/llprimitive/llphysicsextensions/CMakeLists.txt index c204dea264..914fa7b886 100644 --- a/indra/llprimitive/llphysicsextensions/CMakeLists.txt +++ b/indra/llprimitive/llphysicsextensions/CMakeLists.txt @@ -78,7 +78,7 @@ list(REMOVE_ITEM ${PROJECT_NAME}_HEADER_FILES LLPathingLibStubImpl.h LLConvexDecompositionStubImpl.h LLPhysicsExtensionsStubImpl.h) -install(FILES ${${PROJECT_NAME}_HEADER_FILES} DESTINATION include/${PROJECT_NAME}) +#install(FILES ${${PROJECT_NAME}_HEADER_FILES} DESTINATION include/${PROJECT_NAME}) install(TARGETS ${PROJECT_NAME}stub DESTINATION lib) if (LINUX) -- cgit v1.2.3 From b0428375e14c4c9e6bc9dc723bdc94983d3dde6b Mon Sep 17 00:00:00 2001 From: Erik Kundiman Date: Sat, 26 Aug 2023 19:25:14 +0800 Subject: Don't install the libraries when they're static For runtime, they're already part of the executable. For development, we're not there yet. So this reduces the overall package size for now. --- indra/cmake/LibraryInstall.cmake | 4 +++- indra/llprimitive/llphysicsextensions/CMakeLists.txt | 4 +++- 2 files changed, 6 insertions(+), 2 deletions(-) (limited to 'indra') diff --git a/indra/cmake/LibraryInstall.cmake b/indra/cmake/LibraryInstall.cmake index dfc777c1cd..01838fe42e 100644 --- a/indra/cmake/LibraryInstall.cmake +++ b/indra/cmake/LibraryInstall.cmake @@ -1,4 +1,6 @@ list(REMOVE_ITEM ${PROJECT_NAME}_HEADER_FILES CMakeLists.txt) #install(FILES ${${PROJECT_NAME}_HEADER_FILES} # DESTINATION include/${PROJECT_NAME}) -install(TARGETS ${PROJECT_NAME} DESTINATION lib) +if (BUILD_SHARED_LIBS) + install(TARGETS ${PROJECT_NAME} DESTINATION lib) +endif () diff --git a/indra/llprimitive/llphysicsextensions/CMakeLists.txt b/indra/llprimitive/llphysicsextensions/CMakeLists.txt index 914fa7b886..fb15e7b782 100644 --- a/indra/llprimitive/llphysicsextensions/CMakeLists.txt +++ b/indra/llprimitive/llphysicsextensions/CMakeLists.txt @@ -79,7 +79,9 @@ list(REMOVE_ITEM ${PROJECT_NAME}_HEADER_FILES LLConvexDecompositionStubImpl.h LLPhysicsExtensionsStubImpl.h) #install(FILES ${${PROJECT_NAME}_HEADER_FILES} DESTINATION include/${PROJECT_NAME}) -install(TARGETS ${PROJECT_NAME}stub DESTINATION lib) +if (BUILD_SHARED_LIBS) + install(TARGETS ${PROJECT_NAME}stub DESTINATION lib) +endif () if (LINUX) IF(CMAKE_BUILD_TYPE MATCHES Release) -- cgit v1.2.3 From 0b62583eb7dd6e193d5daa2e24646bbb9f3c74e5 Mon Sep 17 00:00:00 2001 From: Erik Kundiman Date: Sat, 26 Aug 2023 22:49:23 +0800 Subject: Make using the system browser for links works First, in order for launch_url.sh to be executable, it needs to be installed as a program. Secondly, the spawn browser command path needs to be adjusted accordingly. And last, add chrome (applies to chromium too on FBSD), to the list of browser commands to try (so chrome wasn't there :/, but dillo has always been XD, and that's why it kept opening Dillo here haha). --- indra/llwindow/llwindowsdl.cpp | 4 ++++ indra/newview/ViewerInstall.cmake | 6 +++++- indra/newview/linux_tools/launch_url.sh | 1 + 3 files changed, 10 insertions(+), 1 deletion(-) (limited to 'indra') diff --git a/indra/llwindow/llwindowsdl.cpp b/indra/llwindow/llwindowsdl.cpp index 293e6ec272..37c4d09a73 100644 --- a/indra/llwindow/llwindowsdl.cpp +++ b/indra/llwindow/llwindowsdl.cpp @@ -2656,9 +2656,13 @@ void LLWindowSDL::spawnWebBrowser(const std::string& escaped_url, bool async) # endif // LL_X11 std::string cmd, arg; +#ifdef LL_USESYSTEMLIBS + cmd = gDirUtilp->getExecutableDir(); +#else cmd = gDirUtilp->getAppRODataDir(); cmd += gDirUtilp->getDirDelimiter(); cmd += "etc"; +#endif cmd += gDirUtilp->getDirDelimiter(); cmd += "launch_url.sh"; arg = escaped_url; diff --git a/indra/newview/ViewerInstall.cmake b/indra/newview/ViewerInstall.cmake index 43d3060bb9..8cbe8bd186 100644 --- a/indra/newview/ViewerInstall.cmake +++ b/indra/newview/ViewerInstall.cmake @@ -2,7 +2,11 @@ install(PROGRAMS ${CMAKE_CURRENT_BINARY_DIR}/${VIEWER_BINARY_NAME} DESTINATION bin ) -install(DIRECTORY skins app_settings linux_tools fonts +install(PROGRAMS linux_tools/launch_url.sh + DESTINATION libexec/${VIEWER_BINARY_NAME} + ) + +install(DIRECTORY skins app_settings fonts DESTINATION share/${VIEWER_BINARY_NAME} PATTERN ".svn" EXCLUDE ) diff --git a/indra/newview/linux_tools/launch_url.sh b/indra/newview/linux_tools/launch_url.sh index 404ea36f26..7c4ebf2291 100755 --- a/indra/newview/linux_tools/launch_url.sh +++ b/indra/newview/linux_tools/launch_url.sh @@ -61,6 +61,7 @@ fi # will be tried first, which is a debian alternative. BROWSER_COMMANDS=" \ x-www-browser \ + chrome \ firefox \ mozilla-firefox \ iceweasel \ -- cgit v1.2.3 From 8e70361fc38b5a735f95459c1e717d41e639c708 Mon Sep 17 00:00:00 2001 From: Erik Kundiman Date: Sun, 27 Aug 2023 07:12:12 +0800 Subject: Force FreeBSD to accept TOS via external browser This forces the use of external browser for links too for now, as we don't have a solution for the HTML media plugin yet. --- indra/cmake/00-Common.cmake | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'indra') diff --git a/indra/cmake/00-Common.cmake b/indra/cmake/00-Common.cmake index c708199309..f81bdbf311 100644 --- a/indra/cmake/00-Common.cmake +++ b/indra/cmake/00-Common.cmake @@ -110,7 +110,7 @@ if (WINDOWS) endif (WINDOWS) -if (LINUX) +if (LINUX OR CMAKE_SYSTEM_NAME MATCHES "FreeBSD") set(CMAKE_SKIP_RPATH TRUE) # EXTERNAL_TOS @@ -151,7 +151,7 @@ if (LINUX) set(CMAKE_CXX_LINK_FLAGS "-Wl,--no-keep-memory") set(CMAKE_CXX_FLAGS_DEBUG "-fno-inline ${CMAKE_CXX_FLAGS_DEBUG}") -endif (LINUX) +endif (LINUX OR CMAKE_SYSTEM_NAME MATCHES "FreeBSD") if (DARWIN) -- cgit v1.2.3 From e7e2fa632a11da614e7afaaf766673ac41c12ba9 Mon Sep 17 00:00:00 2001 From: Erik Kundiman Date: Sun, 27 Aug 2023 07:37:49 +0800 Subject: Hidden visibility only when building static libs Otherwise it would fail to link SLPlugin. --- indra/cmake/00-Common.cmake | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'indra') diff --git a/indra/cmake/00-Common.cmake b/indra/cmake/00-Common.cmake index f81bdbf311..ebb3a73a62 100644 --- a/indra/cmake/00-Common.cmake +++ b/indra/cmake/00-Common.cmake @@ -138,9 +138,12 @@ if (LINUX OR CMAKE_SYSTEM_NAME MATCHES "FreeBSD") -pthread -Wno-parentheses -Wno-deprecated - -fvisibility=hidden ) + if (NOT BUILD_SHARED_LIBS) + add_compile_options(-fvisibility=hidden) + endif (NOT BUILD_SHARED_LIBS) + if (ADDRESS_SIZE EQUAL 32) add_compile_options(-march=pentium4) endif (ADDRESS_SIZE EQUAL 32) -- cgit v1.2.3 From c73ba11e5fa23e346991aabb17ad72c1d40a0e56 Mon Sep 17 00:00:00 2001 From: Erik Kundiman Date: Sun, 27 Aug 2023 11:14:59 +0800 Subject: Supress warnings so GCC can finish shared libs --- indra/llcommon/CMakeLists.txt | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'indra') diff --git a/indra/llcommon/CMakeLists.txt b/indra/llcommon/CMakeLists.txt index ed7ac8deb7..b1dc65ffc5 100644 --- a/indra/llcommon/CMakeLists.txt +++ b/indra/llcommon/CMakeLists.txt @@ -289,8 +289,12 @@ add_dependencies(llcommon stage_third_party_libs) else () target_compile_options(${PROJECT_NAME} PUBLIC -Wno-deprecated-declarations) if (CMAKE_CXX_COMPILER_ID MATCHES "GNU") - set_source_files_properties(llsdutil.cpp PROPERTIES - COMPILE_FLAGS -Wno-stringop-truncation) + set_source_files_properties( + llapp.cpp + llsdutil.cpp + PROPERTIES COMPILE_FLAGS -Wno-stringop-truncation) + set_source_files_properties(llevent.cpp PROPERTIES + COMPILE_FLAGS -Wno-nonnull) endif() endif () -- cgit v1.2.3 From 8a05d3cfe3f6c0ab18906dd080afe60644aa2174 Mon Sep 17 00:00:00 2001 From: Erik Kundiman Date: Mon, 28 Aug 2023 07:50:12 +0800 Subject: Temporary login MP logo so that we don't use SL's https://secondlife.com/corporate/third-party-viewers Section 5.c --- indra/newview/skins/default/textures/textures.xml | 4 ++-- .../skins/default/textures/windows/login_mp_logo.png | Bin 0 -> 10088 bytes .../default/textures/windows/login_mp_logo_small.png | Bin 0 -> 10099 bytes indra/newview/skins/default/xui/en/panel_login.xml | 2 +- .../newview/skins/default/xui/en/panel_login_first.xml | 2 +- 5 files changed, 4 insertions(+), 4 deletions(-) create mode 100644 indra/newview/skins/default/textures/windows/login_mp_logo.png create mode 100644 indra/newview/skins/default/textures/windows/login_mp_logo_small.png (limited to 'indra') diff --git a/indra/newview/skins/default/textures/textures.xml b/indra/newview/skins/default/textures/textures.xml index 7d999a2ffa..d0fa19f1a1 100644 --- a/indra/newview/skins/default/textures/textures.xml +++ b/indra/newview/skins/default/textures/textures.xml @@ -636,8 +636,8 @@ with the same filename but different name - - + + diff --git a/indra/newview/skins/default/textures/windows/login_mp_logo.png b/indra/newview/skins/default/textures/windows/login_mp_logo.png new file mode 100644 index 0000000000..a796c04ce4 Binary files /dev/null and b/indra/newview/skins/default/textures/windows/login_mp_logo.png differ diff --git a/indra/newview/skins/default/textures/windows/login_mp_logo_small.png b/indra/newview/skins/default/textures/windows/login_mp_logo_small.png new file mode 100644 index 0000000000..04c8fdc729 Binary files /dev/null and b/indra/newview/skins/default/textures/windows/login_mp_logo_small.png differ diff --git a/indra/newview/skins/default/xui/en/panel_login.xml b/indra/newview/skins/default/xui/en/panel_login.xml index 3aba80909a..7e9f4b201c 100644 --- a/indra/newview/skins/default/xui/en/panel_login.xml +++ b/indra/newview/skins/default/xui/en/panel_login.xml @@ -40,7 +40,7 @@ diff --git a/indra/newview/skins/default/xui/en/panel_login_first.xml b/indra/newview/skins/default/xui/en/panel_login_first.xml index d36c83d292..e3b16952ad 100644 --- a/indra/newview/skins/default/xui/en/panel_login_first.xml +++ b/indra/newview/skins/default/xui/en/panel_login_first.xml @@ -60,7 +60,7 @@ height="105"> -- cgit v1.2.3 From 9e8717bbd544add6d4988e9cb89790ae6ff9b25a Mon Sep 17 00:00:00 2001 From: Erik Kundiman Date: Mon, 28 Aug 2023 08:13:35 +0800 Subject: Temporary icons --- indra/newview/ViewerInstall.cmake | 4 ++++ indra/newview/icons/hicolor/128x128/apps/megapahit.png | Bin 0 -> 15094 bytes indra/newview/icons/hicolor/256x256/apps/megapahit.png | Bin 0 -> 21759 bytes indra/newview/icons/hicolor/48x48/apps/megapahit.png | Bin 0 -> 6148 bytes indra/newview/icons/hicolor/64x64/apps/megapahit.png | Bin 0 -> 6917 bytes indra/newview/icons/hicolor/96x96/apps/megapahit.png | Bin 0 -> 9711 bytes 6 files changed, 4 insertions(+) create mode 100644 indra/newview/icons/hicolor/128x128/apps/megapahit.png create mode 100644 indra/newview/icons/hicolor/256x256/apps/megapahit.png create mode 100644 indra/newview/icons/hicolor/48x48/apps/megapahit.png create mode 100644 indra/newview/icons/hicolor/64x64/apps/megapahit.png create mode 100644 indra/newview/icons/hicolor/96x96/apps/megapahit.png (limited to 'indra') diff --git a/indra/newview/ViewerInstall.cmake b/indra/newview/ViewerInstall.cmake index 8cbe8bd186..854e2123c4 100644 --- a/indra/newview/ViewerInstall.cmake +++ b/indra/newview/ViewerInstall.cmake @@ -11,6 +11,10 @@ install(DIRECTORY skins app_settings fonts PATTERN ".svn" EXCLUDE ) +install(DIRECTORY icons/hicolor + DESTINATION share/icons + ) + find_file(IS_ARTWORK_PRESENT NAMES have_artwork_bundle.marker PATHS ${VIEWER_DIR}/newview/res) diff --git a/indra/newview/icons/hicolor/128x128/apps/megapahit.png b/indra/newview/icons/hicolor/128x128/apps/megapahit.png new file mode 100644 index 0000000000..dd70f98d35 Binary files /dev/null and b/indra/newview/icons/hicolor/128x128/apps/megapahit.png differ diff --git a/indra/newview/icons/hicolor/256x256/apps/megapahit.png b/indra/newview/icons/hicolor/256x256/apps/megapahit.png new file mode 100644 index 0000000000..fa0d98be50 Binary files /dev/null and b/indra/newview/icons/hicolor/256x256/apps/megapahit.png differ diff --git a/indra/newview/icons/hicolor/48x48/apps/megapahit.png b/indra/newview/icons/hicolor/48x48/apps/megapahit.png new file mode 100644 index 0000000000..9d38f076f1 Binary files /dev/null and b/indra/newview/icons/hicolor/48x48/apps/megapahit.png differ diff --git a/indra/newview/icons/hicolor/64x64/apps/megapahit.png b/indra/newview/icons/hicolor/64x64/apps/megapahit.png new file mode 100644 index 0000000000..472796a454 Binary files /dev/null and b/indra/newview/icons/hicolor/64x64/apps/megapahit.png differ diff --git a/indra/newview/icons/hicolor/96x96/apps/megapahit.png b/indra/newview/icons/hicolor/96x96/apps/megapahit.png new file mode 100644 index 0000000000..1c7fca4953 Binary files /dev/null and b/indra/newview/icons/hicolor/96x96/apps/megapahit.png differ -- cgit v1.2.3 From e06d92b387daa967532660aa22f08b02a8f61e24 Mon Sep 17 00:00:00 2001 From: Erik Kundiman Date: Mon, 28 Aug 2023 08:32:10 +0800 Subject: XDG desktop entry --- indra/newview/ViewerInstall.cmake | 4 ++++ indra/newview/linux_tools/megapahit.desktop | 10 ++++++++++ 2 files changed, 14 insertions(+) create mode 100755 indra/newview/linux_tools/megapahit.desktop (limited to 'indra') diff --git a/indra/newview/ViewerInstall.cmake b/indra/newview/ViewerInstall.cmake index 854e2123c4..ffc18ac984 100644 --- a/indra/newview/ViewerInstall.cmake +++ b/indra/newview/ViewerInstall.cmake @@ -36,3 +36,7 @@ install(FILES featuretable_linux.txt install(FILES ${SCRIPTS_DIR}/messages/message_template.msg DESTINATION share/${VIEWER_BINARY_NAME}/app_settings ) + +install(FILES linux_tools/${VIEWER_BINARY_NAME}.desktop + DESTINATION share/applications + ) diff --git a/indra/newview/linux_tools/megapahit.desktop b/indra/newview/linux_tools/megapahit.desktop new file mode 100755 index 0000000000..05e5d0175a --- /dev/null +++ b/indra/newview/linux_tools/megapahit.desktop @@ -0,0 +1,10 @@ +[Desktop Entry] +Name=Megapahit +Comment=A fork of the Second Life viewer +Exec=megapahit +Icon=megapahit +Terminal=false +Type=Application +Categories=Application;Network; +StartupNotify=true +X-Desktop-File-Install-Version=3.0" -- cgit v1.2.3 From ee7d216baddea16375063b05934464a0462ae970 Mon Sep 17 00:00:00 2001 From: Erik Kundiman Date: Mon, 28 Aug 2023 12:40:54 +0800 Subject: Replace SL & Linden brands on macOS --- indra/newview/CMakeLists.txt | 6 +++--- indra/newview/English.lproj/InfoPlist.strings | 6 +++--- indra/newview/SecondLife.xib | 14 +++++++------- 3 files changed, 13 insertions(+), 13 deletions(-) (limited to 'indra') diff --git a/indra/newview/CMakeLists.txt b/indra/newview/CMakeLists.txt index b5c88cfca1..92e8018bf5 100644 --- a/indra/newview/CMakeLists.txt +++ b/indra/newview/CMakeLists.txt @@ -2042,12 +2042,12 @@ if (DARWIN) set(MACOSX_EXECUTABLE_NAME "${VIEWER_CHANNEL}") set(MACOSX_BUNDLE_INFO_STRING "${VIEWER_CHANNEL}") set(MACOSX_BUNDLE_ICON_FILE "secondlife.icns") - set(MACOSX_BUNDLE_GUI_IDENTIFIER "com.secondlife.indra.viewer") + set(MACOSX_BUNDLE_GUI_IDENTIFIER "net.megapahit.viewer") set(MACOSX_BUNDLE_LONG_VERSION_STRING "${VIEWER_CHANNEL} ${VIEWER_SHORT_VERSION}.${VIEWER_VERSION_REVISION}") - set(MACOSX_BUNDLE_BUNDLE_NAME "SecondLife") + set(MACOSX_BUNDLE_BUNDLE_NAME "Megapahit") set(MACOSX_BUNDLE_SHORT_VERSION_STRING "${VIEWER_SHORT_VERSION}.${VIEWER_VERSION_REVISION}") set(MACOSX_BUNDLE_BUNDLE_VERSION "${VIEWER_SHORT_VERSION}${VIEWER_MACOSX_PHASE}${VIEWER_REVISION}") - set(MACOSX_BUNDLE_COPYRIGHT "Copyright © Linden Research, Inc. 2020") + set(MACOSX_BUNDLE_COPYRIGHT "Copyright © Megapahit. 2023") set(MACOSX_BUNDLE_NSMAIN_NIB_FILE "SecondLife.nib") set(MACOSX_BUNDLE_NSPRINCIPAL_CLASS "LLApplication") diff --git a/indra/newview/English.lproj/InfoPlist.strings b/indra/newview/English.lproj/InfoPlist.strings index 041b8cea0b..58be86579c 100644 --- a/indra/newview/English.lproj/InfoPlist.strings +++ b/indra/newview/English.lproj/InfoPlist.strings @@ -1,7 +1,7 @@ /* Localized versions of Info.plist keys */ -CFBundleName = "Second Life"; +CFBundleName = "Megapahit"; -CFBundleShortVersionString = "Second Life version %%VERSION%%"; -CFBundleGetInfoString = "Second Life version %%VERSION%%, Copyright 2004 Linden Research, Inc."; +CFBundleShortVersionString = "Megapahit version %%VERSION%%"; +CFBundleGetInfoString = "Megapahit version %%VERSION%%, Copyright 2023 Megapahit."; diff --git a/indra/newview/SecondLife.xib b/indra/newview/SecondLife.xib index fbff8fe307..8302392f5d 100644 --- a/indra/newview/SecondLife.xib +++ b/indra/newview/SecondLife.xib @@ -42,7 +42,7 @@ - Second Life + Megapahit 2147483647 @@ -55,11 +55,11 @@ submenuAction: - Second Life + Megapahit - About Second Life + About Megapahit 2147483647 @@ -120,7 +120,7 @@ - Hide Second Life + Hide Megapahit h 1048576 2147483647 @@ -156,7 +156,7 @@ - Quit Second Life + Quit Megapahit q 1048576 2147483647 @@ -323,7 +323,7 @@ 2 {{196, 240}, {1024, 600}} 74974208 - Second Life + Megapahit LLNSWindow @@ -338,7 +338,7 @@ {{0, 0}, {2560, 1418}} {10000000000000, 10000000000000} - Second Life + Megapahit 128 NO -- cgit v1.2.3 From d8ff44e8f12d8a231f7492e1a19cf4a33b9bbea8 Mon Sep 17 00:00:00 2001 From: Erik Kundiman Date: Tue, 29 Aug 2023 19:57:49 +0800 Subject: Copyright notice repro on statically linked libs --- .../newview/skins/default/xui/en/floater_about.xml | 65 +++++++++++++--------- 1 file changed, 40 insertions(+), 25 deletions(-) (limited to 'indra') diff --git a/indra/newview/skins/default/xui/en/floater_about.xml b/indra/newview/skins/default/xui/en/floater_about.xml index 1ad7811d85..4b81b3dab1 100644 --- a/indra/newview/skins/default/xui/en/floater_about.xml +++ b/indra/newview/skins/default/xui/en/floater_about.xml @@ -93,35 +93,50 @@ Dummy Name replaced at run time top="5" width="465" word_wrap="true"> - 3Dconnexion SDK Copyright (C) 1992-2009 3Dconnexion - APR Copyright (C) 2011 The Apache Software Foundation - Collada DOM Copyright 2006 Sony Computer Entertainment Inc. - cURL Copyright (C) 1996-2010, Daniel Stenberg, (daniel@haxx.se) - DBus/dbus-glib Copyright (C) 2002, 2003 CodeFactory AB / Copyright (C) 2003, 2004 Red Hat, Inc. - expat Copyright (C) 1998, 1999, 2000 Thai Open Source Software Center Ltd. - FreeType Copyright (C) 1996-2002, 2006 David Turner, Robert Wilhelm, and Werner Lemberg. - GL Copyright (C) 1999-2004 Brian Paul. - google-perftools Copyright (c) 2005, Google Inc. - Havok.com(TM) Copyright (C) 1999-2001, Telekinesys Research Limited. - jpeg2000 Copyright (C) 2001, David Taubman, The University of New South Wales (UNSW) - jpeglib Copyright (C) 1991-1998, Thomas G. Lane. - meshoptimizer Copyright (c) 2016-2021 Arseny Kapoulkine - ogg/vorbis Copyright (C) 2002, Xiphophorus - OpenSSL Copyright (C) 1998-2008 The OpenSSL Project. - PCRE Copyright (c) 1997-2012 University of Cambridge - SDL Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002 Sam Lantinga - SSLeay Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) - xmlrpc-epi Copyright (C) 2000 Epinions, Inc. - xxHash Copyright (C) 2012-2020 Yann Collet. - zlib Copyright (C) 1995-2012 Jean-loup Gailly and Mark Adler. - - Second Life Viewer uses Havok (TM) Physics. (c)Copyright 1999-2010 Havok.com Inc. (and its Licensors). All Rights Reserved. See www.havok.com for details. + The library that is linked statically to this software is OpenJPEG v2.5.0. See the license below. +/* + * The copyright in this software is being made available under the 2-clauses + * BSD License, included below. This software may be subject to other third + * party and contributor rights, including patent rights, and no such rights + * are granted under this license. + * + * Copyright (c) 2002-2014, Universite catholique de Louvain (UCL), Belgium + * Copyright (c) 2002-2014, Professor Benoit Macq + * Copyright (c) 2003-2014, Antonin Descampe + * Copyright (c) 2003-2009, Francois-Olivier Devaux + * Copyright (c) 2005, Herve Drolon, FreeImage Team + * Copyright (c) 2002-2003, Yannick Verschueren + * Copyright (c) 2001-2003, David Janssens + * Copyright (c) 2011-2012, Centre National d'Etudes Spatiales (CNES), France + * Copyright (c) 2012, CS Systemes d'Information, France + * + * All rights reserved. + * + * 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 above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS `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 COPYRIGHT OWNER OR CONTRIBUTORS 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. + */ This software contains source code provided by NVIDIA Corporation. All rights reserved. See licenses.txt for details. - - Voice chat Audio coding: Polycom(R) Siren14(TM) (ITU-T Rec. G.722.1 Annex C) -- cgit v1.2.3 From 6eee5085a3269159f3e4c4db2d15251a68c53f98 Mon Sep 17 00:00:00 2001 From: Erik Kundiman Date: Tue, 29 Aug 2023 20:03:14 +0800 Subject: Adjust the credits --- indra/newview/skins/default/xui/en/floater_about.xml | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'indra') diff --git a/indra/newview/skins/default/xui/en/floater_about.xml b/indra/newview/skins/default/xui/en/floater_about.xml index 4b81b3dab1..55f7488971 100644 --- a/indra/newview/skins/default/xui/en/floater_about.xml +++ b/indra/newview/skins/default/xui/en/floater_about.xml @@ -51,15 +51,14 @@ name="credits_panel"> -Second Life is brought to you by the Lindens, -with open source contributions from: +Megapahit is brought to you by Erik Kundiman, with special thanks to the Lindens whose viewer this software is based on, which therefore has open source contributions from: Date: Tue, 29 Aug 2023 22:41:35 +0800 Subject: Give the icons rounded corners --- .../icons/hicolor/128x128/apps/megapahit.png | Bin 15094 -> 16392 bytes .../icons/hicolor/256x256/apps/megapahit.png | Bin 21759 -> 24963 bytes .../newview/icons/hicolor/48x48/apps/megapahit.png | Bin 6148 -> 6834 bytes .../newview/icons/hicolor/64x64/apps/megapahit.png | Bin 6917 -> 7755 bytes .../newview/icons/hicolor/96x96/apps/megapahit.png | Bin 9711 -> 10789 bytes 5 files changed, 0 insertions(+), 0 deletions(-) (limited to 'indra') diff --git a/indra/newview/icons/hicolor/128x128/apps/megapahit.png b/indra/newview/icons/hicolor/128x128/apps/megapahit.png index dd70f98d35..83cc5a995e 100644 Binary files a/indra/newview/icons/hicolor/128x128/apps/megapahit.png and b/indra/newview/icons/hicolor/128x128/apps/megapahit.png differ diff --git a/indra/newview/icons/hicolor/256x256/apps/megapahit.png b/indra/newview/icons/hicolor/256x256/apps/megapahit.png index fa0d98be50..9158437c00 100644 Binary files a/indra/newview/icons/hicolor/256x256/apps/megapahit.png and b/indra/newview/icons/hicolor/256x256/apps/megapahit.png differ diff --git a/indra/newview/icons/hicolor/48x48/apps/megapahit.png b/indra/newview/icons/hicolor/48x48/apps/megapahit.png index 9d38f076f1..4a997584aa 100644 Binary files a/indra/newview/icons/hicolor/48x48/apps/megapahit.png and b/indra/newview/icons/hicolor/48x48/apps/megapahit.png differ diff --git a/indra/newview/icons/hicolor/64x64/apps/megapahit.png b/indra/newview/icons/hicolor/64x64/apps/megapahit.png index 472796a454..ec4f4d86f7 100644 Binary files a/indra/newview/icons/hicolor/64x64/apps/megapahit.png and b/indra/newview/icons/hicolor/64x64/apps/megapahit.png differ diff --git a/indra/newview/icons/hicolor/96x96/apps/megapahit.png b/indra/newview/icons/hicolor/96x96/apps/megapahit.png index 1c7fca4953..40f85d99ea 100644 Binary files a/indra/newview/icons/hicolor/96x96/apps/megapahit.png and b/indra/newview/icons/hicolor/96x96/apps/megapahit.png differ -- cgit v1.2.3 From ea26a6a86279aa8ca4000e866e7b45a4a34d7354 Mon Sep 17 00:00:00 2001 From: Erik Kundiman Date: Tue, 29 Aug 2023 22:45:29 +0800 Subject: Replace login viewer name's left with circle logo --- .../default/textures/windows/login_mp_logo.png | Bin 10088 -> 12760 bytes .../textures/windows/login_mp_logo_small.png | Bin 10099 -> 12758 bytes 2 files changed, 0 insertions(+), 0 deletions(-) (limited to 'indra') diff --git a/indra/newview/skins/default/textures/windows/login_mp_logo.png b/indra/newview/skins/default/textures/windows/login_mp_logo.png index a796c04ce4..bee5252361 100644 Binary files a/indra/newview/skins/default/textures/windows/login_mp_logo.png and b/indra/newview/skins/default/textures/windows/login_mp_logo.png differ diff --git a/indra/newview/skins/default/textures/windows/login_mp_logo_small.png b/indra/newview/skins/default/textures/windows/login_mp_logo_small.png index 04c8fdc729..2e32be796d 100644 Binary files a/indra/newview/skins/default/textures/windows/login_mp_logo_small.png and b/indra/newview/skins/default/textures/windows/login_mp_logo_small.png differ -- cgit v1.2.3 From 4740db4a9935e4cc234342b9c19323afca03ae52 Mon Sep 17 00:00:00 2001 From: Erik Kundiman Date: Tue, 29 Aug 2023 23:16:25 +0800 Subject: Make it possible for external TOS to be agreed to The line that enables it in when on external TOS was only present in a similar scope which doesn't seem to be reachable. It must have been missed when the condition checking was moved. --- indra/newview/llfloatertos.cpp | 2 ++ 1 file changed, 2 insertions(+) (limited to 'indra') diff --git a/indra/newview/llfloatertos.cpp b/indra/newview/llfloatertos.cpp index 1aeb727172..189f5297a9 100644 --- a/indra/newview/llfloatertos.cpp +++ b/indra/newview/llfloatertos.cpp @@ -96,6 +96,8 @@ BOOL LLFloaterTOS::postBuild() external_prompt->setVisible(true); web_browser->setVisible(false); + + updateAgreeEnabled(true); #else web_browser->addObserver(this); -- cgit v1.2.3 From f19cb40115e3e35483d387c7e1c1bf3d119a33e5 Mon Sep 17 00:00:00 2001 From: Erik Kundiman Date: Tue, 5 Sep 2023 20:38:18 +0800 Subject: Comment out redefinitions of GL functions which are mostly ARB ones, and instead we define GLEXT prototypes to be true so we still get access to the functions. --- indra/llrender/llgl.cpp | 3 +++ indra/llrender/llglheaders.h | 4 ++++ 2 files changed, 7 insertions(+) (limited to 'indra') diff --git a/indra/llrender/llgl.cpp b/indra/llrender/llgl.cpp index e96a226115..68842c9692 100644 --- a/indra/llrender/llgl.cpp +++ b/indra/llrender/llgl.cpp @@ -162,6 +162,8 @@ std::list LLGLUpdate::sGLQ; PFNGLGETSTRINGIPROC glGetStringi = NULL; #endif +/* + // vertex blending prototypes PFNGLWEIGHTPOINTERARBPROC glWeightPointerARB = NULL; PFNGLVERTEXBLENDARBPROC glVertexBlendARB = NULL; @@ -399,6 +401,7 @@ PFNGLACTIVETEXTUREARBPROC glActiveTextureARB = NULL; PFNGLCLIENTACTIVETEXTUREARBPROC glClientActiveTextureARB = NULL; PFNGLDRAWRANGEELEMENTSPROC glDrawRangeElements = NULL; #endif // LL_LINUX_NV_GL_HEADERS +*/ #endif LLGLManager gGLManager; diff --git a/indra/llrender/llglheaders.h b/indra/llrender/llglheaders.h index 3ad92ed20e..1a8b2f1a64 100644 --- a/indra/llrender/llglheaders.h +++ b/indra/llrender/llglheaders.h @@ -48,6 +48,7 @@ //---------------------------------------------------------------------------- // Linux, MESA headers, but not necessarily assuming MESA runtime. // quotes so we get libraries/.../GL/ version +#define GL_GLEXT_PROTOTYPES 1 #include "GL/gl.h" #include "GL/glext.h" #include "GL/glu.h" @@ -83,6 +84,8 @@ extern PFNGLCLIENTACTIVETEXTUREARBPROC glClientActiveTextureARB; extern PFNGLDRAWRANGEELEMENTSPROC glDrawRangeElements; #endif // LL_LINUX_NV_GL_HEADERS +/* + // GL_ARB_vertex_array_object extern PFNGLBINDVERTEXARRAYPROC glBindVertexArray; extern PFNGLDELETEVERTEXARRAYSPROC glDeleteVertexArrays; @@ -307,6 +310,7 @@ extern PFNGLTRANSFORMFEEDBACKVARYINGSPROC glTransformFeedbackVaryings; extern PFNGLBINDBUFFERRANGEPROC glBindBufferRange; extern PFNGLBINDBUFFERBASEPROC glBindBufferBase; +*/ #elif LL_WINDOWS //---------------------------------------------------------------------------- -- cgit v1.2.3 From 6e9102ad408282ea6d5f8926f4a6ed377fe922ef Mon Sep 17 00:00:00 2001 From: Erik Kundiman Date: Tue, 5 Sep 2023 21:18:29 +0800 Subject: Exclude FBSD from more GL function redefinitions at the same time revert to less difference from upstream. --- indra/llrender/llgl.cpp | 8 ++++---- indra/newview/llviewerjointmesh.cpp | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) (limited to 'indra') diff --git a/indra/llrender/llgl.cpp b/indra/llrender/llgl.cpp index 68842c9692..6998d892e2 100644 --- a/indra/llrender/llgl.cpp +++ b/indra/llrender/llgl.cpp @@ -156,7 +156,7 @@ LLMatrix4 gGLObliqueProjectionInverse; std::list LLGLUpdate::sGLQ; -#if (LL_WINDOWS || LL_LINUX || LL_FREEBSD) && !LL_MESA_HEADLESS +#if (LL_WINDOWS || LL_LINUX) && !LL_MESA_HEADLESS #if LL_WINDOWS PFNGLGETSTRINGIPROC glGetStringi = NULL; @@ -319,7 +319,7 @@ PFNWGLCREATECONTEXTATTRIBSARBPROC wglCreateContextAttribsARB = NULL; #endif // vertex shader prototypes -#if LL_LINUX || LL_FREEBSD +#if LL_LINUX PFNGLVERTEXATTRIB1DARBPROC glVertexAttrib1dARB = NULL; PFNGLVERTEXATTRIB1DVARBPROC glVertexAttrib1dvARB = NULL; PFNGLVERTEXATTRIB1FARBPROC glVertexAttrib1fARB = NULL; @@ -346,7 +346,7 @@ PFNGLVERTEXATTRIB4NUBARBPROC glVertexAttrib4nubARB = NULL; PFNGLVERTEXATTRIB4NUBVARBPROC glVertexAttrib4nubvARB = NULL; PFNGLVERTEXATTRIB4NUIVARBPROC glVertexAttrib4nuivARB = NULL; PFNGLVERTEXATTRIB4NUSVARBPROC glVertexAttrib4nusvARB = NULL; -#if LL_LINUX || LL_FREEBSD +#if LL_LINUX PFNGLVERTEXATTRIB4BVARBPROC glVertexAttrib4bvARB = NULL; PFNGLVERTEXATTRIB4DARBPROC glVertexAttrib4dARB = NULL; PFNGLVERTEXATTRIB4DVARBPROC glVertexAttrib4dvARB = NULL; @@ -1183,7 +1183,7 @@ void LLGLManager::initExtensions() glGetIntegerv(GL_MAX_ELEMENTS_INDICES, (GLint*) &mGLMaxIndexRange); glGetIntegerv(GL_MAX_TEXTURE_SIZE, (GLint*) &mGLMaxTextureSize); -#if (LL_WINDOWS || LL_LINUX || LL_FREEBSD) && !LL_MESA_HEADLESS +#if (LL_WINDOWS || LL_LINUX) && !LL_MESA_HEADLESS LL_DEBUGS("RenderInit") << "GL Probe: Getting symbols" << LL_ENDL; if (mHasVertexBufferObject) { diff --git a/indra/newview/llviewerjointmesh.cpp b/indra/newview/llviewerjointmesh.cpp index 489f90aabb..d9cdde8d6d 100644 --- a/indra/newview/llviewerjointmesh.cpp +++ b/indra/newview/llviewerjointmesh.cpp @@ -57,7 +57,7 @@ #include "llmatrix4a.h" #include "llperfstats.h" -#if !LL_DARWIN && !LL_LINUX +#if !LL_DARWIN && !LL_LINUX && !LL_FREEBSD extern PFNGLWEIGHTPOINTERARBPROC glWeightPointerARB; extern PFNGLWEIGHTFVARBPROC glWeightfvARB; extern PFNGLVERTEXBLENDARBPROC glVertexBlendARB; -- cgit v1.2.3 From ed44bcf9f763a7d1f7549eb1f03d8aa7fb933ef7 Mon Sep 17 00:00:00 2001 From: Erik Kundiman Date: Tue, 5 Sep 2023 23:14:03 +0800 Subject: Preprocess non portable GL funcs & macros so that implementations that don't include a certain GL implementation won't fail trying to compile the code. --- indra/llrender/llgl.cpp | 19 +++++++- indra/llrender/llgldbg.cpp | 4 ++ indra/llrender/llglslshader.cpp | 6 +++ indra/llrender/llglstates.h | 89 ++++++++++++++++++++++++++++++++------ indra/llrender/llimagegl.cpp | 79 ++++++++++++++++++++++++++++++++- indra/llrender/llpostprocess.cpp | 12 +++++ indra/llrender/llrender.cpp | 24 ++++++++++ indra/llrender/llrender2dutils.cpp | 2 + indra/llrender/llrendertarget.cpp | 2 + indra/llwindow/llwindowsdl.cpp | 2 + 10 files changed, 221 insertions(+), 18 deletions(-) (limited to 'indra') diff --git a/indra/llrender/llgl.cpp b/indra/llrender/llgl.cpp index 6998d892e2..729e8a5f28 100644 --- a/indra/llrender/llgl.cpp +++ b/indra/llrender/llgl.cpp @@ -595,6 +595,7 @@ bool LLGLManager::initGL() #endif } +#if GL_VERSION_1_3 if (mGLVersion >= 2.1f && LLImageGL::sCompressTextures) { //use texture compression glHint(GL_TEXTURE_COMPRESSION_HINT, GL_NICEST); @@ -603,6 +604,7 @@ bool LLGLManager::initGL() { //GL version is < 3.0, always disable texture compression LLImageGL::sCompressTextures = false; } +#endif // Trailing space necessary to keep "nVidia Corpor_ati_on" cards // from being recognized as ATI. @@ -727,6 +729,7 @@ bool LLGLManager::initGL() { mNumTextureUnits = llmin(mNumTextureImageUnits, MAX_GL_TEXTURE_UNITS); } +#if GL_VERSION_1_3 else { GLint num_tex_units; @@ -737,6 +740,7 @@ bool LLGLManager::initGL() mNumTextureUnits = llmin(mNumTextureUnits, 2); } } +#endif } else { @@ -1474,12 +1478,14 @@ void log_glerror() error = glGetError(); while (LL_UNLIKELY(error)) { +#if GLU_VERSION_1_1 GLubyte const * gl_error_msg = gluErrorString(error); if (NULL != gl_error_msg) { LL_WARNS() << "GL Error: " << error << " GL Error String: " << gl_error_msg << LL_ENDL ; } else +#endif // GLU_VERSION_1_1 { // gluErrorString returns NULL for some extensions' error codes. // you'll probably have to grep for the number in glext.h. @@ -1498,6 +1504,7 @@ void do_assert_glerror() while (LL_UNLIKELY(error)) { quit = TRUE; +#if GLU_VERSION_1_1 GLubyte const * gl_error_msg = gluErrorString(error); if (NULL != gl_error_msg) { @@ -1510,6 +1517,7 @@ void do_assert_glerror() } } else +#endif // GLU_VERSION_1_1 { // gluErrorString returns NULL for some extensions' error codes. // you'll probably have to grep for the number in glext.h. @@ -1601,6 +1609,7 @@ void LLGLState::restoreGL() void LLGLState::resetTextureStates() { gGL.flush(); +#if GL_VERSION_1_3 GLint maxTextureUnits; glGetIntegerv(GL_MAX_TEXTURE_UNITS_ARB, &maxTextureUnits); @@ -1610,6 +1619,7 @@ void LLGLState::resetTextureStates() glClientActiveTexture(GL_TEXTURE0_ARB+j); j == 0 ? gGL.getTexUnit(j)->enable(LLTexUnit::TT_TEXTURE) : gGL.getTexUnit(j)->disable(); } +#endif } void LLGLState::dumpStates() @@ -1864,6 +1874,7 @@ LLGLState::LLGLState(LLGLenum state, S32 enabled) : mState(state), mWasEnabled(FALSE), mIsEnabled(FALSE) { LL_PROFILE_ZONE_SCOPED_CATEGORY_PIPELINE; +#if GL_VERSION_1_1 switch (state) { case GL_ALPHA_TEST: @@ -1880,6 +1891,7 @@ LLGLState::LLGLState(LLGLenum state, S32 enabled) : mState = 0; break; } +#endif // GL_VERSION_1_1 stop_glerror(); @@ -2339,8 +2351,11 @@ void LLGLSyncFence::wait() } LLGLSPipelineSkyBox::LLGLSPipelineSkyBox() -: mAlphaTest(GL_ALPHA_TEST) -, mCullFace(GL_CULL_FACE) +: +#if GL_VERSION_1_1 +mAlphaTest(GL_ALPHA_TEST), +#endif +mCullFace(GL_CULL_FACE) , mSquashClip() { } diff --git a/indra/llrender/llgldbg.cpp b/indra/llrender/llgldbg.cpp index 0f1d4ae742..210802d164 100644 --- a/indra/llrender/llgldbg.cpp +++ b/indra/llrender/llgldbg.cpp @@ -35,6 +35,7 @@ #include "llglheaders.h" +#if GL_VERSION_1_1 //------------------------------------------------------------------------ // cmstr() //------------------------------------------------------------------------ @@ -50,6 +51,7 @@ const char *cmstr(int i) } return "UNKNOWN"; } +#endif //------------------------------------------------------------------------ // facestr() @@ -116,6 +118,7 @@ void llgl_dump() LL_INFOS() << "OpenGL State" << LL_ENDL; LL_INFOS() << "==========================" << LL_ENDL; +#if GL_VERSION_1_1 LL_INFOS() << "-----------------------------------" << LL_ENDL; LL_INFOS() << "Current Values" << LL_ENDL; LL_INFOS() << "-----------------------------------" << LL_ENDL; @@ -211,6 +214,7 @@ void llgl_dump() LL_INFOS() << "-----------------------------------" << LL_ENDL; LL_INFOS() << "GL_ALPHA_TEST : " << boolstr(glIsEnabled(GL_ALPHA_TEST)) << LL_ENDL; +#endif LL_INFOS() << "GL_DEPTH_TEST : " << boolstr(glIsEnabled(GL_DEPTH_TEST)) << LL_ENDL; glGetBooleanv(GL_DEPTH_WRITEMASK, &b); diff --git a/indra/llrender/llglslshader.cpp b/indra/llrender/llglslshader.cpp index da24d999b0..cfc871e0c6 100644 --- a/indra/llrender/llglslshader.cpp +++ b/indra/llrender/llglslshader.cpp @@ -677,10 +677,14 @@ void LLGLSLShader::mapUniform(GLint index, const vector * case GL_FLOAT_VEC2: size *= 2; break; case GL_FLOAT_VEC3: size *= 3; break; case GL_FLOAT_VEC4: size *= 4; break; +#if GL_VERSION_1_1 case GL_DOUBLE: size *= 2; break; +#if GL_VERSION_4_0 case GL_DOUBLE_VEC2: size *= 2; break; case GL_DOUBLE_VEC3: size *= 6; break; case GL_DOUBLE_VEC4: size *= 8; break; +#endif // GL_VERSION_4_0 +#endif // GL_VERSION_1_1 case GL_INT_VEC2: size *= 2; break; case GL_INT_VEC3: size *= 3; break; case GL_INT_VEC4: size *= 4; break; @@ -699,6 +703,7 @@ void LLGLSLShader::mapUniform(GLint index, const vector * case GL_FLOAT_MAT3x4: size *= 12; break; case GL_FLOAT_MAT4x2: size *= 8; break; case GL_FLOAT_MAT4x3: size *= 12; break; +#if GL_VERSION_4_0 case GL_DOUBLE_MAT2: size *= 8; break; case GL_DOUBLE_MAT3: size *= 18; break; case GL_DOUBLE_MAT4: size *= 32; break; @@ -708,6 +713,7 @@ void LLGLSLShader::mapUniform(GLint index, const vector * case GL_DOUBLE_MAT3x4: size *= 24; break; case GL_DOUBLE_MAT4x2: size *= 16; break; case GL_DOUBLE_MAT4x3: size *= 24; break; +#endif // GL_VERSION_4_0 } mTotalUniformSize += size; } diff --git a/indra/llrender/llglstates.h b/indra/llrender/llglstates.h index a4924eba14..753c9a984f 100644 --- a/indra/llrender/llglstates.h +++ b/indra/llrender/llglstates.h @@ -56,42 +56,71 @@ private: class LLGLSDefault { protected: +#if GL_VERSION_1_1 LLGLEnable mColorMaterial; - LLGLDisable mAlphaTest, mBlend, mCullFace, mDither, mFog, - mLineSmooth, mLineStipple, mNormalize, mPolygonSmooth, - mGLMultisample; +#endif + LLGLDisable +#if GL_VERSION_1_1 + mAlphaTest, +#endif + mBlend, mCullFace, mDither +#if GL_VERSION_1_1 + , mFog, + mLineSmooth, mLineStipple, mNormalize, mPolygonSmooth +#if GL_VERSION_1_3 + , + mGLMultisample +#endif // GL_VERSION_1_3 +#endif // GL_VERSION_1_1 + ; public: LLGLSDefault() : // Enable +#if GL_VERSION_1_1 mColorMaterial(GL_COLOR_MATERIAL), // Disable mAlphaTest(GL_ALPHA_TEST), +#endif mBlend(GL_BLEND), mCullFace(GL_CULL_FACE), - mDither(GL_DITHER), + mDither(GL_DITHER) +#if GL_VERSION_1_1 + , mFog(GL_FOG), mLineSmooth(GL_LINE_SMOOTH), mLineStipple(GL_LINE_STIPPLE), mNormalize(GL_NORMALIZE), - mPolygonSmooth(GL_POLYGON_SMOOTH), - mGLMultisample(GL_MULTISAMPLE_ARB) + mPolygonSmooth(GL_POLYGON_SMOOTH) +#if GL_VERSION_1_3 + , + mGLMultisample(GL_MULTISAMPLE) +#endif // GL_VERSION_1_3 +#endif // GL_VERSION_1_1 { } }; class LLGLSObjectSelect { protected: - LLGLDisable mBlend, mFog, mAlphaTest; + LLGLDisable mBlend +#if GL_VERSION_1_1 + , mFog, mAlphaTest +#endif + ; LLGLEnable mCullFace; public: LLGLSObjectSelect() - : mBlend(GL_BLEND), mFog(GL_FOG), + : mBlend(GL_BLEND), +#if GL_VERSION_1_1 + mFog(GL_FOG), mAlphaTest(GL_ALPHA_TEST), +#endif mCullFace(GL_CULL_FACE) { } }; +#if GL_VERSION_1_1 class LLGLSObjectSelectAlpha { protected: @@ -101,23 +130,32 @@ public: : mAlphaTest(GL_ALPHA_TEST) {} }; +#endif //---------------------------------------------------------------------------- class LLGLSUIDefault { protected: - LLGLEnable mBlend, mAlphaTest; + LLGLEnable mBlend +#if GL_VERSION_1_1 + , mAlphaTest +#endif + ; LLGLDisable mCullFace; LLGLDepthTest mDepthTest; public: LLGLSUIDefault() - : mBlend(GL_BLEND), mAlphaTest(GL_ALPHA_TEST), + : mBlend(GL_BLEND), +#if GL_VERSION_1_1 + mAlphaTest(GL_ALPHA_TEST), +#endif mCullFace(GL_CULL_FACE), mDepthTest(GL_FALSE, GL_TRUE, GL_LEQUAL) {} }; +#if GL_VERSION_1_1 class LLGLSNoAlphaTest // : public LLGLSUIDefault { protected: @@ -149,6 +187,7 @@ public: : mFog(GL_FOG) {} }; +#endif //---------------------------------------------------------------------------- @@ -167,14 +206,22 @@ public: class LLGLSPipelineAlpha // : public LLGLSPipeline { protected: - LLGLEnable mBlend, mAlphaTest; + LLGLEnable mBlend +#if GL_VERSION_1_1 + , mAlphaTest +#endif + ; public: LLGLSPipelineAlpha() - : mBlend(GL_BLEND), + : mBlend(GL_BLEND) +#if GL_VERSION_1_1 + , mAlphaTest(GL_ALPHA_TEST) +#endif { } }; +#if GL_VERSION_1_1 class LLGLSPipelineEmbossBump { protected: @@ -184,6 +231,7 @@ public: : mFog(GL_FOG) { } }; +#endif class LLGLSPipelineSelection { @@ -195,6 +243,7 @@ public: {} }; +#if GL_VERSION_1_1 class LLGLSPipelineAvatar { protected: @@ -204,11 +253,14 @@ public: : mNormalize(GL_NORMALIZE) {} }; +#endif class LLGLSPipelineSkyBox { protected: +#if GL_VERSION_1_1 LLGLDisable mAlphaTest; +#endif LLGLDisable mCullFace; LLGLSquashToFarClip mSquashClip; public: @@ -234,18 +286,26 @@ public: class LLGLSTracker { protected: - LLGLEnable mCullFace, mBlend, mAlphaTest; + LLGLEnable mCullFace, mBlend +#if GL_VERSION_1_1 + , mAlphaTest +#endif + ; public: LLGLSTracker() : mCullFace(GL_CULL_FACE), - mBlend(GL_BLEND), + mBlend(GL_BLEND) +#if GL_VERSION_1_1 + , mAlphaTest(GL_ALPHA_TEST) +#endif { } }; //---------------------------------------------------------------------------- +#if GL_VERSION_1_1 class LLGLSSpecular { public: @@ -270,6 +330,7 @@ public: } } }; +#endif //---------------------------------------------------------------------------- diff --git a/indra/llrender/llimagegl.cpp b/indra/llrender/llimagegl.cpp index 8e83f2b401..34f668d1a2 100644 --- a/indra/llrender/llimagegl.cpp +++ b/indra/llrender/llimagegl.cpp @@ -212,14 +212,18 @@ S32 LLImageGL::dataFormatBits(S32 dataformat) case GL_LUMINANCE: return 8; case GL_ALPHA: return 8; case GL_RED: return 8; +#if GL_VERSION_1_1 case GL_COLOR_INDEX: return 8; +#endif case GL_LUMINANCE_ALPHA: return 16; case GL_RGB: return 24; case GL_SRGB: return 24; case GL_RGB8: return 24; case GL_RGBA: return 32; +#if GL_VERSION_2_1 case GL_SRGB_ALPHA: return 32; case GL_BGRA: return 32; // Used for QuickTime media textures on the Mac +#endif default: LL_ERRS() << "LLImageGL::Unknown format: " << dataformat << LL_ENDL; return 0; @@ -262,13 +266,17 @@ S32 LLImageGL::dataFormatComponents(S32 dataformat) case GL_LUMINANCE: return 1; case GL_ALPHA: return 1; case GL_RED: return 1; +#if GL_VERSION_1_1 case GL_COLOR_INDEX: return 1; +#endif case GL_LUMINANCE_ALPHA: return 2; case GL_RGB: return 3; case GL_SRGB: return 3; case GL_RGBA: return 4; +#if GL_VERSION_2_1 case GL_SRGB_ALPHA: return 4; case GL_BGRA: return 4; // Used for QuickTime media textures on the Mac +#endif default: LL_ERRS() << "LLImageGL::Unknown format: " << dataformat << LL_ENDL; return 0; @@ -746,11 +754,13 @@ BOOL LLImageGL::setImage(const U8* data_in, BOOL data_hasmips /* = FALSE */, S32 } else { +#if GL_VERSION_1_1 if(mFormatSwapBytes) { glPixelStorei(GL_UNPACK_SWAP_BYTES, 1); stop_glerror(); } +#endif LLImageGL::setManualImage(mTarget, gl_level, mFormatInternal, w, h, mFormatPrimary, GL_UNSIGNED_BYTE, (GLvoid*)data_in, mAllowCompression); if (gl_level == 0) @@ -759,11 +769,13 @@ BOOL LLImageGL::setImage(const U8* data_in, BOOL data_hasmips /* = FALSE */, S32 } updatePickMask(w, h, data_in); +#if GL_VERSION_1_1 if(mFormatSwapBytes) { glPixelStorei(GL_UNPACK_SWAP_BYTES, 0); stop_glerror(); } +#endif stop_glerror(); } @@ -776,11 +788,13 @@ BOOL LLImageGL::setImage(const U8* data_in, BOOL data_hasmips /* = FALSE */, S32 { stop_glerror(); { +#if GL_VERSION_1_1 if(mFormatSwapBytes) { glPixelStorei(GL_UNPACK_SWAP_BYTES, 1); stop_glerror(); } +#endif S32 w = getWidth(mCurrentDiscardLevel); S32 h = getHeight(mCurrentDiscardLevel); @@ -790,10 +804,12 @@ BOOL LLImageGL::setImage(const U8* data_in, BOOL data_hasmips /* = FALSE */, S32 //use legacy mipmap generation mode (note: making this condional can cause rendering issues) // -- but making it not conditional triggers deprecation warnings when core profile is enabled // (some rendering issues while core profile is enabled are acceptable at this point in time) +#if GL_VERSION_1_4 if (!LLRender::sGLCoreProfile) { glTexParameteri(mTarget, GL_GENERATE_MIPMAP, GL_TRUE); } +#endif LLImageGL::setManualImage(mTarget, 0, mFormatInternal, w, h, @@ -804,11 +820,13 @@ BOOL LLImageGL::setImage(const U8* data_in, BOOL data_hasmips /* = FALSE */, S32 updatePickMask(w, h, data_in); +#if GL_VERSION_1_1 if(mFormatSwapBytes) { glPixelStorei(GL_UNPACK_SWAP_BYTES, 0); stop_glerror(); } +#endif if (LLRender::sGLCoreProfile) { @@ -892,11 +910,13 @@ BOOL LLImageGL::setImage(const U8* data_in, BOOL data_hasmips /* = FALSE */, S32 llassert(w > 0 && h > 0 && cur_mip_data); (void)cur_mip_data; { +#if GL_VERSION_1_1 if(mFormatSwapBytes) { glPixelStorei(GL_UNPACK_SWAP_BYTES, 1); stop_glerror(); } +#endif LLImageGL::setManualImage(mTarget, m, mFormatInternal, w, h, mFormatPrimary, mFormatType, cur_mip_data, mAllowCompression); if (m == 0) @@ -909,11 +929,13 @@ BOOL LLImageGL::setImage(const U8* data_in, BOOL data_hasmips /* = FALSE */, S32 updatePickMask(w, h, cur_mip_data); } +#if GL_VERSION_1_1 if(mFormatSwapBytes) { glPixelStorei(GL_UNPACK_SWAP_BYTES, 0); stop_glerror(); } +#endif } if (prev_mip_data && prev_mip_data != data_in) { @@ -948,11 +970,13 @@ BOOL LLImageGL::setImage(const U8* data_in, BOOL data_hasmips /* = FALSE */, S32 } else { +#if GL_VERSION_1_1 if(mFormatSwapBytes) { glPixelStorei(GL_UNPACK_SWAP_BYTES, 1); stop_glerror(); } +#endif LLImageGL::setManualImage(mTarget, 0, mFormatInternal, w, h, mFormatPrimary, mFormatType, (GLvoid *)data_in, mAllowCompression); @@ -962,11 +986,13 @@ BOOL LLImageGL::setImage(const U8* data_in, BOOL data_hasmips /* = FALSE */, S32 stop_glerror(); +#if GL_VERSION_1_1 if(mFormatSwapBytes) { glPixelStorei(GL_UNPACK_SWAP_BYTES, 0); stop_glerror(); } +#endif } } @@ -1011,13 +1037,17 @@ BOOL LLImageGL::preAddToAtlas(S32 discard_level, const LLImageRaw* raw_image) { case 1: // Use luminance alpha (for fonts) +#if GL_VERSION_1_1 mFormatInternal = GL_LUMINANCE8; +#endif mFormatPrimary = GL_LUMINANCE; mFormatType = GL_UNSIGNED_BYTE; break; case 2: // Use luminance alpha (for fonts) +#if GL_VERSION_1_1 mFormatInternal = GL_LUMINANCE8_ALPHA8; +#endif mFormatPrimary = GL_LUMINANCE_ALPHA; mFormatType = GL_UNSIGNED_BYTE; break; @@ -1063,22 +1093,26 @@ BOOL LLImageGL::preAddToAtlas(S32 discard_level, const LLImageRaw* raw_image) glPixelStorei(GL_UNPACK_ROW_LENGTH, raw_image->getWidth()); stop_glerror(); +#if GL_VERSION_1_1 if(mFormatSwapBytes) { glPixelStorei(GL_UNPACK_SWAP_BYTES, 1); stop_glerror(); } +#endif return TRUE ; } void LLImageGL::postAddToAtlas() { +#if GL_VERSION_1_1 if(mFormatSwapBytes) { glPixelStorei(GL_UNPACK_SWAP_BYTES, 0); stop_glerror(); } +#endif glPixelStorei(GL_UNPACK_ROW_LENGTH, 0); gGL.getTexUnit(0)->setTextureFilteringOption(mFilterOption); @@ -1153,11 +1187,13 @@ BOOL LLImageGL::setSubImage(const U8* datap, S32 data_width, S32 data_height, S3 glPixelStorei(GL_UNPACK_ROW_LENGTH, data_width); stop_glerror(); +#if GL_VERSION_1_1 if(mFormatSwapBytes) { glPixelStorei(GL_UNPACK_SWAP_BYTES, 1); stop_glerror(); } +#endif datap += (y_pos * data_width + x_pos) * getComponents(); // Update the GL texture @@ -1169,11 +1205,13 @@ BOOL LLImageGL::setSubImage(const U8* datap, S32 data_width, S32 data_height, S3 gGL.getTexUnit(0)->disable(); stop_glerror(); +#if GL_VERSION_1_1 if(mFormatSwapBytes) { glPixelStorei(GL_UNPACK_SWAP_BYTES, 0); stop_glerror(); } +#endif glPixelStorei(GL_UNPACK_ROW_LENGTH, 0); stop_glerror(); @@ -1336,35 +1374,57 @@ void LLImageGL::setManualImage(U32 target, S32 miplevel, S32 intformat, S32 widt { case GL_RGB: case GL_RGB8: +#if GL_VERSION_1_3 intformat = GL_COMPRESSED_RGB; +#endif break; case GL_SRGB: case GL_SRGB8: +#if GL_VERSION_2_1 intformat = GL_COMPRESSED_SRGB; +#endif break; case GL_RGBA: case GL_RGBA8: +#if GL_VERSION_1_3 intformat = GL_COMPRESSED_RGBA; +#endif break; - case GL_SRGB_ALPHA: case GL_SRGB8_ALPHA8: +#if GL_VERSION_2_1 + case GL_SRGB_ALPHA: intformat = GL_COMPRESSED_SRGB_ALPHA; +#endif break; case GL_LUMINANCE: +#if GL_VERSION_1_1 case GL_LUMINANCE8: +#endif +#if GL_VERSION_1_3 intformat = GL_COMPRESSED_LUMINANCE; +#endif break; case GL_LUMINANCE_ALPHA: +#if GL_VERSION_1_1 case GL_LUMINANCE8_ALPHA8: +#endif +#if GL_VERSION_1_3 intformat = GL_COMPRESSED_LUMINANCE_ALPHA; +#endif break; case GL_ALPHA: +#if GL_VERSION_1_1 case GL_ALPHA8: +#endif +#if GL_VERSION_1_3 intformat = GL_COMPRESSED_ALPHA; +#endif break; case GL_RED: case GL_R8: +#if GL_VERSION_3_0 intformat = GL_COMPRESSED_RED; +#endif break; default: LL_WARNS() << "Could not compress format: " << std::hex << intformat << LL_ENDL; @@ -1478,13 +1538,17 @@ BOOL LLImageGL::createGLTexture(S32 discard_level, const LLImageRaw* imageraw, S { case 1: // Use luminance alpha (for fonts) +#if GL_VERSION_1_1 mFormatInternal = GL_LUMINANCE8; +#endif mFormatPrimary = GL_LUMINANCE; mFormatType = GL_UNSIGNED_BYTE; break; case 2: // Use luminance alpha (for fonts) +#if GL_VERSION_1_1 mFormatInternal = GL_LUMINANCE8_ALPHA8; +#endif mFormatPrimary = GL_LUMINANCE_ALPHA; mFormatType = GL_UNSIGNED_BYTE; break; @@ -1826,6 +1890,7 @@ BOOL LLImageGL::readBackRaw(S32 discard_level, LLImageRaw* imageraw, bool compre } //----------------------------------------------------------------------------------------------- +#if GL_VERSION_1_3 if (is_compressed) { LLGLint glbytes; @@ -1852,6 +1917,7 @@ BOOL LLImageGL::readBackRaw(S32 discard_level, LLImageRaw* imageraw, bool compre glGetTexImage(GL_TEXTURE_2D, gl_discard, mFormatPrimary, mFormatType, (GLvoid*)(imageraw->getData())); //stop_glerror(); } +#endif // GL_VERSION_1_3 //----------------------------------------------------------------------------------------------- if((error = glGetError()) != GL_NO_ERROR) @@ -1941,11 +2007,13 @@ BOOL LLImageGL::getIsResident(BOOL test_now) { if (test_now) { +#if GL_VERSION_1_1 if (mTexName != 0) { glAreTexturesResident(1, (GLuint*)&mTexName, &mIsResident); } else +#endif { mIsResident = FALSE; } @@ -2075,7 +2143,9 @@ void LLImageGL::calcAlphaChannelOffsetAndStride() mIsMask = FALSE; return; //no alpha channel. case GL_RGBA: +#if GL_VERSION_2_1 case GL_SRGB_ALPHA: +#endif mAlphaStride = 4; break; case GL_BGRA_EXT: @@ -2090,6 +2160,7 @@ void LLImageGL::calcAlphaChannelOffsetAndStride() { mAlphaOffset = mAlphaStride - 1 ; } +#if GL_VERSION_1_2 else if(is_little_endian()) { if (mFormatType == GL_UNSIGNED_INT_8_8_8_8) @@ -2112,6 +2183,7 @@ void LLImageGL::calcAlphaChannelOffsetAndStride() mAlphaOffset = 0 ; } } +#endif // GL_VERSION_1_2 if( mAlphaStride < 1 || //unsupported format mAlphaOffset < 0 || //unsupported type @@ -2266,7 +2338,10 @@ void LLImageGL::updatePickMask(S32 width, S32 height, const U8* data_in) if (mFormatType != GL_UNSIGNED_BYTE || ((mFormatPrimary != GL_RGBA) - && (mFormatPrimary != GL_SRGB_ALPHA))) +#if GL_VERSION_2_1 + && (mFormatPrimary != GL_SRGB_ALPHA) +#endif + )) { //cannot generate a pick mask for this texture return; diff --git a/indra/llrender/llpostprocess.cpp b/indra/llrender/llpostprocess.cpp index b6ea5aa7f1..ce36942e1a 100644 --- a/indra/llrender/llpostprocess.cpp +++ b/indra/llrender/llpostprocess.cpp @@ -357,8 +357,10 @@ void LLPostProcess::getShaderUniforms(glslUniforms & uniforms, GLhandleARB & pro void LLPostProcess::doEffects(void) { /// Save GL State +#if GL_VERSION_1_1 glPushAttrib(GL_ALL_ATTRIB_BITS); glPushClientAttrib(GL_ALL_ATTRIB_BITS); +#endif /// Copy the screen buffer to the render texture { @@ -383,15 +385,19 @@ void LLPostProcess::doEffects(void) viewPerspective(); /// Reset GL State +#if GL_VERSION_1_1 glPopClientAttrib(); glPopAttrib(); +#endif checkError(); } void LLPostProcess::copyFrameBuffer(U32 & texture, unsigned int width, unsigned int height) { gGL.getTexUnit(0)->bindManual(LLTexUnit::TT_RECT_TEXTURE, texture); +#if GL_VERSION_3_1 glCopyTexImage2D(GL_TEXTURE_RECTANGLE_ARB, 0, GL_RGBA, 0, 0, width, height, 0); +#endif } void LLPostProcess::drawOrthoQuad(unsigned int width, unsigned int height, QuadType type) @@ -503,8 +509,10 @@ void LLPostProcess::createTexture(LLPointer& texture, unsigned int wi if(texture->createGLTexture()) { gGL.getTexUnit(0)->bindManual(LLTexUnit::TT_RECT_TEXTURE, texture->getTexName()); +#if GL_VERSION_3_1 glTexImage2D(GL_TEXTURE_RECTANGLE_ARB, 0, 4, width, height, 0, GL_RGBA, GL_UNSIGNED_BYTE, &data[0]); +#endif gGL.getTexUnit(0)->setTextureFilteringOption(LLTexUnit::TFO_BILINEAR); gGL.getTexUnit(0)->setTextureAddressMode(LLTexUnit::TAM_CLAMP); } @@ -538,18 +546,22 @@ bool LLPostProcess::checkError(void) while (glErr != GL_NO_ERROR) { // shaderErrorLog << (const char *) gluErrorString(glErr) << std::endl; +#if GLU_VERSION_1_1 char const * err_str_raw = (const char *) gluErrorString(glErr); if(err_str_raw == NULL) { +#endif std::ostringstream err_builder; err_builder << "unknown error number " << glErr; mShaderErrorString = err_builder.str(); +#if GLU_VERSION_1_1 } else { mShaderErrorString = err_str_raw; } +#endif retCode = true; glErr = glGetError(); diff --git a/indra/llrender/llrender.cpp b/indra/llrender/llrender.cpp index ba776f3b2f..84ef895ee4 100644 --- a/indra/llrender/llrender.cpp +++ b/indra/llrender/llrender.cpp @@ -69,9 +69,13 @@ static const U32 LL_NUM_LIGHT_UNITS = 8; static const GLenum sGLTextureType[] = { GL_TEXTURE_2D, +#if GL_VERSION_3_1 GL_TEXTURE_RECTANGLE_ARB, +#endif GL_TEXTURE_CUBE_MAP_ARB, +#if GL_VERSION_3_2 GL_TEXTURE_2D_MULTISAMPLE, +#endif GL_TEXTURE_3D }; @@ -537,6 +541,7 @@ void LLTexUnit::setTextureFilteringOption(LLTexUnit::eTextureFilterOptions optio GLint LLTexUnit::getTextureSource(eTextureBlendSrc src) { +#if GL_VERSION_1_3 switch(src) { // All four cases should return the same value. @@ -551,8 +556,10 @@ GLint LLTexUnit::getTextureSource(eTextureBlendSrc src) case TBS_TEX_ALPHA: case TBS_ONE_MINUS_TEX_COLOR: case TBS_ONE_MINUS_TEX_ALPHA: +#endif return GL_TEXTURE; +#if GL_VERSION_1_3 // All four cases should return the same value. case TBS_VERT_COLOR: case TBS_VERT_ALPHA: @@ -571,6 +578,7 @@ GLint LLTexUnit::getTextureSource(eTextureBlendSrc src) LL_WARNS() << "Unknown eTextureBlendSrc: " << src << ". Using Vertex Color instead." << LL_ENDL; return GL_PRIMARY_COLOR_ARB; } +#endif } GLint LLTexUnit::getTextureSourceType(eTextureBlendSrc src, bool isAlpha) @@ -617,7 +625,9 @@ void LLTexUnit::setColorScale(S32 scale) { mCurrColorScale = scale; gGL.flush(); +#if GL_VERSION_1_1 glTexEnvi( GL_TEXTURE_ENV, GL_RGB_SCALE, scale ); +#endif } } @@ -627,7 +637,9 @@ void LLTexUnit::setAlphaScale(S32 scale) { mCurrAlphaScale = scale; gGL.flush(); +#if GL_VERSION_1_1 glTexEnvi( GL_TEXTURE_ENV, GL_ALPHA_SCALE, scale ); +#endif } } @@ -1995,10 +2007,12 @@ void LLRender::diffuseColor3f(F32 r, F32 g, F32 b) { shader->uniform4f(LLShaderMgr::DIFFUSE_COLOR, r,g,b,1.f); } +#if GL_VERSION_1_1 else { glColor3f(r,g,b); } +#endif } void LLRender::diffuseColor3fv(const F32* c) @@ -2010,10 +2024,12 @@ void LLRender::diffuseColor3fv(const F32* c) { shader->uniform4f(LLShaderMgr::DIFFUSE_COLOR, c[0], c[1], c[2], 1.f); } +#if GL_VERSION_1_1 else { glColor3fv(c); } +#endif } void LLRender::diffuseColor4f(F32 r, F32 g, F32 b, F32 a) @@ -2025,10 +2041,12 @@ void LLRender::diffuseColor4f(F32 r, F32 g, F32 b, F32 a) { shader->uniform4f(LLShaderMgr::DIFFUSE_COLOR, r,g,b,a); } +#if GL_VERSION_1_1 else { glColor4f(r,g,b,a); } +#endif } void LLRender::diffuseColor4fv(const F32* c) @@ -2040,10 +2058,12 @@ void LLRender::diffuseColor4fv(const F32* c) { shader->uniform4fv(LLShaderMgr::DIFFUSE_COLOR, 1, c); } +#if GL_VERSION_1_1 else { glColor4fv(c); } +#endif } void LLRender::diffuseColor4ubv(const U8* c) @@ -2055,10 +2075,12 @@ void LLRender::diffuseColor4ubv(const U8* c) { shader->uniform4f(LLShaderMgr::DIFFUSE_COLOR, c[0]/255.f, c[1]/255.f, c[2]/255.f, c[3]/255.f); } +#if GL_VERSION_1_1 else { glColor4ubv(c); } +#endif } void LLRender::diffuseColor4ub(U8 r, U8 g, U8 b, U8 a) @@ -2070,10 +2092,12 @@ void LLRender::diffuseColor4ub(U8 r, U8 g, U8 b, U8 a) { shader->uniform4f(LLShaderMgr::DIFFUSE_COLOR, r/255.f, g/255.f, b/255.f, a/255.f); } +#if GL_VERSION_1_1 else { glColor4ub(r,g,b,a); } +#endif } diff --git a/indra/llrender/llrender2dutils.cpp b/indra/llrender/llrender2dutils.cpp index 5cb1dc6b25..95f9376f8b 100644 --- a/indra/llrender/llrender2dutils.cpp +++ b/indra/llrender/llrender2dutils.cpp @@ -716,8 +716,10 @@ void gl_draw_scaled_rotated_image(S32 x, S32 y, S32 width, S32 height, F32 degre void gl_stippled_line_3d( const LLVector3& start, const LLVector3& end, const LLColor4& color, F32 phase ) { +#if GL_VERSION_1_1 // Stippled line LLGLEnable stipple(GL_LINE_STIPPLE); +#endif gGL.color4f(color.mV[VRED], color.mV[VGREEN], color.mV[VBLUE], color.mV[VALPHA]); diff --git a/indra/llrender/llrendertarget.cpp b/indra/llrender/llrendertarget.cpp index fffc15efc3..f73aab8d23 100644 --- a/indra/llrender/llrendertarget.cpp +++ b/indra/llrender/llrendertarget.cpp @@ -560,7 +560,9 @@ void LLRenderTarget::bindTexture(U32 index, S32 channel, LLTexUnit::eTextureFilt { case GL_SRGB: case GL_SRGB8: +#if GL_VERSION_2_1 case GL_SRGB_ALPHA: +#endif case GL_SRGB8_ALPHA8: isSRGB = true; break; diff --git a/indra/llwindow/llwindowsdl.cpp b/indra/llwindow/llwindowsdl.cpp index 37c4d09a73..e3af20c090 100644 --- a/indra/llwindow/llwindowsdl.cpp +++ b/indra/llwindow/llwindowsdl.cpp @@ -761,7 +761,9 @@ BOOL LLWindowSDL::createContext(int x, int y, int width, int height, int bits, B //make sure multisampling is disabled by default +#if GL_VERSION_1_3 glDisable(GL_MULTISAMPLE_ARB); +#endif // We need to do this here, once video is init'd /* -- cgit v1.2.3 From 4b7e271dff7fa6ff813f9fc8f81cc2b6604de6db Mon Sep 17 00:00:00 2001 From: Erik Kundiman Date: Wed, 6 Sep 2023 08:15:16 +0800 Subject: Core profile glCreateShader & return type GLuint to replace the less portable ARB versions. --- indra/llrender/llglslshader.cpp | 12 ++++++------ indra/llrender/llglslshader.h | 8 ++++---- indra/llrender/llpostprocess.cpp | 4 ++-- indra/llrender/llpostprocess.h | 4 ++-- indra/llrender/llshadermgr.cpp | 12 ++++++------ indra/llrender/llshadermgr.h | 12 ++++++------ 6 files changed, 26 insertions(+), 26 deletions(-) (limited to 'indra') diff --git a/indra/llrender/llglslshader.cpp b/indra/llrender/llglslshader.cpp index cfc871e0c6..e310278955 100644 --- a/indra/llrender/llglslshader.cpp +++ b/indra/llrender/llglslshader.cpp @@ -47,7 +47,7 @@ using std::pair; using std::make_pair; using std::string; -GLhandleARB LLGLSLShader::sCurBoundShader = 0; +GLuint LLGLSLShader::sCurBoundShader = 0; LLGLSLShader* LLGLSLShader::sCurBoundShaderPtr = NULL; S32 LLGLSLShader::sIndexedTextureChannels = 0; bool LLGLSLShader::sProfileEnabled = false; @@ -347,7 +347,7 @@ void LLGLSLShader::unloadInternal() if (mProgramObject) { - GLhandleARB obj[1024]; + GLuint obj[1024]; GLsizei count; glGetAttachedObjectsARB(mProgramObject, 1024, &count, obj); @@ -425,7 +425,7 @@ BOOL LLGLSLShader::createShader(std::vector * attributes, vector< pair >::iterator fileIter = mShaderFiles.begin(); for ( ; fileIter != mShaderFiles.end(); fileIter++ ) { - GLhandleARB shaderhandle = LLShaderMgr::instance()->loadShaderFile((*fileIter).first, mShaderLevel, (*fileIter).second, &mDefines, mFeatures.mIndexedTextureChannels); + auto shaderhandle = LLShaderMgr::instance()->loadShaderFile((*fileIter).first, mShaderLevel, (*fileIter).second, &mDefines, mFeatures.mIndexedTextureChannels); LL_DEBUGS("ShaderLoading") << "SHADER FILE: " << (*fileIter).first << " mShaderLevel=" << mShaderLevel << LL_ENDL; if (shaderhandle) { @@ -505,7 +505,7 @@ BOOL LLGLSLShader::createShader(std::vector * attributes, } #if DEBUG_SHADER_INCLUDES -void dumpAttachObject( const char *func_name, GLhandleARB program_object, const std::string &object_path ) +void dumpAttachObject( const char *func_name, GLuint program_object, const std::string &object_path ) { GLcharARB* info_log; GLint info_len_expect = 0; @@ -563,7 +563,7 @@ BOOL LLGLSLShader::attachFragmentObject(std::string object_path) } } -void LLGLSLShader::attachObject(GLhandleARB object) +void LLGLSLShader::attachObject(GLuint object) { if (object != 0) { @@ -581,7 +581,7 @@ void LLGLSLShader::attachObject(GLhandleARB object) } } -void LLGLSLShader::attachObjects(GLhandleARB* objects, S32 count) +void LLGLSLShader::attachObjects(GLuint* objects, S32 count) { for (S32 i = 0; i < count; i++) { diff --git a/indra/llrender/llglslshader.h b/indra/llrender/llglslshader.h index 85e83dbcb9..8f8834e80e 100644 --- a/indra/llrender/llglslshader.h +++ b/indra/llrender/llglslshader.h @@ -145,7 +145,7 @@ public: LLGLSLShader(); ~LLGLSLShader(); - static GLhandleARB sCurBoundShader; + static GLuint sCurBoundShader; static LLGLSLShader* sCurBoundShaderPtr; static S32 sIndexedTextureChannels; @@ -167,8 +167,8 @@ public: const char** varyings = NULL); BOOL attachFragmentObject(std::string object); BOOL attachVertexObject(std::string object); - void attachObject(GLhandleARB object); - void attachObjects(GLhandleARB* objects = NULL, S32 count = 0); + void attachObject(GLuint object); + void attachObjects(GLuint* objects = NULL, S32 count = 0); BOOL mapAttributes(const std::vector * attributes); BOOL mapUniforms(const std::vector *); void mapUniform(GLint index, const std::vector *); @@ -239,7 +239,7 @@ public: U32 mMatHash[LLRender::NUM_MATRIX_MODES]; U32 mLightHash; - GLhandleARB mProgramObject; + GLuint mProgramObject; #if LL_RELEASE_WITH_DEBUG_INFO struct attr_name { diff --git a/indra/llrender/llpostprocess.cpp b/indra/llrender/llpostprocess.cpp index ce36942e1a..4e0d43c8b4 100644 --- a/indra/llrender/llpostprocess.cpp +++ b/indra/llrender/llpostprocess.cpp @@ -345,7 +345,7 @@ void LLPostProcess::createBloomShader(void) bloomBlurUniforms[sBlurWidth] = 0; } -void LLPostProcess::getShaderUniforms(glslUniforms & uniforms, GLhandleARB & prog) +void LLPostProcess::getShaderUniforms(glslUniforms & uniforms, GLuint & prog) { /// Find uniform locations and insert into map glslUniforms::iterator i; @@ -569,7 +569,7 @@ bool LLPostProcess::checkError(void) return retCode; } -void LLPostProcess::checkShaderError(GLhandleARB shader) +void LLPostProcess::checkShaderError(GLuint shader) { GLint infologLength = 0; GLint charsWritten = 0; diff --git a/indra/llrender/llpostprocess.h b/indra/llrender/llpostprocess.h index ce17b6693d..bdfc632831 100644 --- a/indra/llrender/llpostprocess.h +++ b/indra/llrender/llpostprocess.h @@ -249,12 +249,12 @@ private: void applyColorFilterShader(void); /// OpenGL Helper Functions - void getShaderUniforms(glslUniforms & uniforms, GLhandleARB & prog); + void getShaderUniforms(glslUniforms & uniforms, GLuint & prog); void createTexture(LLPointer& texture, unsigned int width, unsigned int height); void copyFrameBuffer(U32 & texture, unsigned int width, unsigned int height); void createNoiseTexture(LLPointer& texture); bool checkError(void); - void checkShaderError(GLhandleARB shader); + void checkShaderError(GLuint shader); void drawOrthoQuad(unsigned int width, unsigned int height, QuadType type); void viewOrthogonal(unsigned int width, unsigned int height); void changeOrthogonal(unsigned int width, unsigned int height); diff --git a/indra/llrender/llshadermgr.cpp b/indra/llrender/llshadermgr.cpp index c64f46f38a..0f945dea42 100644 --- a/indra/llrender/llshadermgr.cpp +++ b/indra/llrender/llshadermgr.cpp @@ -550,7 +550,7 @@ BOOL LLShaderMgr::attachShaderFeatures(LLGLSLShader * shader) //============================================================================ // Load Shader -static std::string get_object_log(GLhandleARB ret) +static std::string get_object_log(GLuint ret) { std::string res; @@ -584,7 +584,7 @@ void LLShaderMgr::dumpShaderSource(U32 shader_code_count, GLcharARB** shader_cod LL_CONT << LL_ENDL; } -void LLShaderMgr::dumpObjectLog(GLhandleARB ret, BOOL warns, const std::string& filename) +void LLShaderMgr::dumpObjectLog(GLuint ret, BOOL warns, const std::string& filename) { std::string log = get_object_log(ret); std::string fname = filename; @@ -600,7 +600,7 @@ void LLShaderMgr::dumpObjectLog(GLhandleARB ret, BOOL warns, const std::string& } } -GLhandleARB LLShaderMgr::loadShaderFile(const std::string& filename, S32 & shader_level, GLenum type, std::unordered_map* defines, S32 texture_index_channels) +GLuint LLShaderMgr::loadShaderFile(const std::string& filename, S32 & shader_level, GLenum type, std::unordered_map* defines, S32 texture_index_channels) { // endsure work-around for missing GLSL funcs gets propogated to feature shader files (e.g. srgbF.glsl) @@ -964,7 +964,7 @@ GLhandleARB LLShaderMgr::loadShaderFile(const std::string& filename, S32 & shade fclose(file); //create shader object - GLhandleARB ret = glCreateShaderObjectARB(type); + auto ret = glCreateShader(type); error = glGetError(); if (error != GL_NO_ERROR) @@ -1042,7 +1042,7 @@ GLhandleARB LLShaderMgr::loadShaderFile(const std::string& filename, S32 & shade return ret; } -BOOL LLShaderMgr::linkProgramObject(GLhandleARB obj, BOOL suppress_errors) +BOOL LLShaderMgr::linkProgramObject(GLuint obj, BOOL suppress_errors) { //check for errors glLinkProgramARB(obj); @@ -1065,7 +1065,7 @@ BOOL LLShaderMgr::linkProgramObject(GLhandleARB obj, BOOL suppress_errors) return success; } -BOOL LLShaderMgr::validateProgramObject(GLhandleARB obj) +BOOL LLShaderMgr::validateProgramObject(GLuint obj) { //check program validity against current GL glValidateProgramARB(obj); diff --git a/indra/llrender/llshadermgr.h b/indra/llrender/llshadermgr.h index 67c0d6ab10..89d726d64a 100644 --- a/indra/llrender/llshadermgr.h +++ b/indra/llrender/llshadermgr.h @@ -260,11 +260,11 @@ public: virtual void initAttribsAndUniforms(void); BOOL attachShaderFeatures(LLGLSLShader * shader); - void dumpObjectLog(GLhandleARB ret, BOOL warns = TRUE, const std::string& filename = ""); + void dumpObjectLog(GLuint ret, BOOL warns = TRUE, const std::string& filename = ""); void dumpShaderSource(U32 shader_code_count, GLcharARB** shader_code_text); - BOOL linkProgramObject(GLhandleARB obj, BOOL suppress_errors = FALSE); - BOOL validateProgramObject(GLhandleARB obj); - GLhandleARB loadShaderFile(const std::string& filename, S32 & shader_level, GLenum type, std::unordered_map* defines = NULL, S32 texture_index_channels = -1); + BOOL linkProgramObject(GLuint obj, BOOL suppress_errors = FALSE); + BOOL validateProgramObject(GLuint obj); + GLuint loadShaderFile(const std::string& filename, S32 & shader_level, GLenum type, std::unordered_map* defines = NULL, S32 texture_index_channels = -1); // Implemented in the application to actually point to the shader directory. virtual std::string getShaderDirPrefix(void) = 0; // Pure Virtual @@ -274,8 +274,8 @@ public: public: // Map of shader names to compiled - std::map mVertexShaderObjects; - std::map mFragmentShaderObjects; + std::map mVertexShaderObjects; + std::map mFragmentShaderObjects; //global (reserved slot) shader parameters std::vector mReservedAttribs; -- cgit v1.2.3 From 1d2c62b79458feecb162f18764d0ff37f80414cf Mon Sep 17 00:00:00 2001 From: Erik Kundiman Date: Wed, 6 Sep 2023 09:02:22 +0800 Subject: Core profile shader functions, macros & type replacing legacy ARB versions. --- indra/llrender/llpostprocess.cpp | 4 ++-- indra/llrender/llshadermgr.cpp | 24 ++++++++++++------------ indra/llrender/llshadermgr.h | 2 +- 3 files changed, 15 insertions(+), 15 deletions(-) (limited to 'indra') diff --git a/indra/llrender/llpostprocess.cpp b/indra/llrender/llpostprocess.cpp index 4e0d43c8b4..d3449fb85d 100644 --- a/indra/llrender/llpostprocess.cpp +++ b/indra/llrender/llpostprocess.cpp @@ -577,7 +577,7 @@ void LLPostProcess::checkShaderError(GLuint shader) checkError(); // Check for OpenGL errors - glGetObjectParameterivARB(shader, GL_OBJECT_INFO_LOG_LENGTH_ARB, &infologLength); + glGetShaderiv(shader, GL_INFO_LOG_LENGTH, &infologLength); checkError(); // Check for OpenGL errors @@ -589,7 +589,7 @@ void LLPostProcess::checkShaderError(GLuint shader) /// Could not allocate infolog buffer return; } - glGetInfoLogARB(shader, infologLength, &charsWritten, infoLog); + glGetShaderInfoLog(shader, infologLength, &charsWritten, infoLog); // shaderErrorLog << (char *) infoLog << std::endl; mShaderErrorString = (char *) infoLog; free(infoLog); diff --git a/indra/llrender/llshadermgr.cpp b/indra/llrender/llshadermgr.cpp index 0f945dea42..114059f092 100644 --- a/indra/llrender/llshadermgr.cpp +++ b/indra/llrender/llshadermgr.cpp @@ -556,12 +556,12 @@ static std::string get_object_log(GLuint ret) //get log length GLint length; - glGetObjectParameterivARB(ret, GL_OBJECT_INFO_LOG_LENGTH_ARB, &length); + glGetShaderiv(ret, GL_INFO_LOG_LENGTH, &length); if (length > 0) { //the log could be any size, so allocate appropriately - GLcharARB* log = new GLcharARB[length]; - glGetInfoLogARB(ret, length, &length, log); + auto log = new GLchar[length]; + glGetShaderInfoLog(ret, length, &length, log); res = std::string((char *)log); delete[] log; } @@ -569,7 +569,7 @@ static std::string get_object_log(GLuint ret) } //dump shader source for debugging -void LLShaderMgr::dumpShaderSource(U32 shader_code_count, GLcharARB** shader_code_text) +void LLShaderMgr::dumpShaderSource(U32 shader_code_count, GLchar** shader_code_text) { char num_str[16]; // U32 = max 10 digits @@ -671,9 +671,9 @@ GLuint LLShaderMgr::loadShaderFile(const std::string& filename, S32 & shader_lev //we can't have any lines longer than 1024 characters //or any shaders longer than 4096 lines... deal - DaveP - GLcharARB buff[1024]; - GLcharARB *extra_code_text[1024]; - GLcharARB *shader_code_text[4096 + LL_ARRAY_SIZE(extra_code_text)] = { NULL }; + GLchar buff[1024]; + GLchar *extra_code_text[1024]; + GLchar *shader_code_text[4096 + LL_ARRAY_SIZE(extra_code_text)] = { NULL }; GLuint extra_code_count = 0, shader_code_count = 0; BOOST_STATIC_ASSERT(LL_ARRAY_SIZE(extra_code_text) < LL_ARRAY_SIZE(shader_code_text)); @@ -778,7 +778,7 @@ GLuint LLShaderMgr::loadShaderFile(const std::string& filename, S32 & shader_lev for (std::unordered_map::iterator iter = defines->begin(); iter != defines->end(); ++iter) { std::string define = "#define " + iter->first + " " + iter->second + "\n"; - extra_code_text[extra_code_count++] = (GLcharARB *) strdup(define.c_str()); + extra_code_text[extra_code_count++] = (GLchar *) strdup(define.c_str()); } } @@ -927,7 +927,7 @@ GLuint LLShaderMgr::loadShaderFile(const std::string& filename, S32 & shader_lev } else { - shader_code_text[shader_code_count] = (GLcharARB *)strdup((char *)buff); + shader_code_text[shader_code_count] = (GLchar *)strdup((char *)buff); if(flag_write_to_out_of_extra_block_area & flags) { @@ -973,7 +973,7 @@ GLuint LLShaderMgr::loadShaderFile(const std::string& filename, S32 & shader_lev } //load source - glShaderSourceARB(ret, shader_code_count, (const GLcharARB**) shader_code_text, NULL); + glShaderSource(ret, shader_code_count, (const GLchar**) shader_code_text, NULL); error = glGetError(); if (error != GL_NO_ERROR) @@ -982,7 +982,7 @@ GLuint LLShaderMgr::loadShaderFile(const std::string& filename, S32 & shader_lev } //compile source - glCompileShaderARB(ret); + glCompileShader(ret); error = glGetError(); if (error != GL_NO_ERROR) @@ -994,7 +994,7 @@ GLuint LLShaderMgr::loadShaderFile(const std::string& filename, S32 & shader_lev { //check for errors GLint success = GL_TRUE; - glGetObjectParameterivARB(ret, GL_OBJECT_COMPILE_STATUS_ARB, &success); + glGetShaderiv(ret, GL_COMPILE_STATUS, &success); error = glGetError(); if (error != GL_NO_ERROR || success == GL_FALSE) diff --git a/indra/llrender/llshadermgr.h b/indra/llrender/llshadermgr.h index 89d726d64a..598aea4ce8 100644 --- a/indra/llrender/llshadermgr.h +++ b/indra/llrender/llshadermgr.h @@ -261,7 +261,7 @@ public: BOOL attachShaderFeatures(LLGLSLShader * shader); void dumpObjectLog(GLuint ret, BOOL warns = TRUE, const std::string& filename = ""); - void dumpShaderSource(U32 shader_code_count, GLcharARB** shader_code_text); + void dumpShaderSource(U32 shader_code_count, GLchar** shader_code_text); BOOL linkProgramObject(GLuint obj, BOOL suppress_errors = FALSE); BOOL validateProgramObject(GLuint obj); GLuint loadShaderFile(const std::string& filename, S32 & shader_level, GLenum type, std::unordered_map* defines = NULL, S32 texture_index_channels = -1); -- cgit v1.2.3 From de53dff78db1cbcfc0df050f86bd23adbe2b580f Mon Sep 17 00:00:00 2001 From: Erik Kundiman Date: Wed, 6 Sep 2023 09:20:40 +0800 Subject: Core profile program object related functions Whether to create/delete, or take the program object as an argument. Include ones for attaching & detaching shaders too, ones that deal with attributes & uniforms and so on, etc.. Replacing legacy ARB versions. --- indra/llrender/llglslshader.cpp | 48 ++++++++++++++++++++-------------------- indra/llrender/llpostprocess.cpp | 2 +- indra/llrender/llshadermgr.cpp | 8 +++---- 3 files changed, 29 insertions(+), 29 deletions(-) (limited to 'indra') diff --git a/indra/llrender/llglslshader.cpp b/indra/llrender/llglslshader.cpp index e310278955..a0183e8225 100644 --- a/indra/llrender/llglslshader.cpp +++ b/indra/llrender/llglslshader.cpp @@ -349,15 +349,15 @@ void LLGLSLShader::unloadInternal() { GLuint obj[1024]; GLsizei count; - glGetAttachedObjectsARB(mProgramObject, 1024, &count, obj); + glGetAttachedShaders(mProgramObject, 1024, &count, obj); for (GLsizei i = 0; i < count; i++) { - glDetachObjectARB(mProgramObject, obj[i]); - glDeleteObjectARB(obj[i]); + glDetachShader(mProgramObject, obj[i]); + glDeleteShader(obj[i]); } - glDeleteObjectARB(mProgramObject); + glDeleteProgram(mProgramObject); mProgramObject = 0; } @@ -401,7 +401,7 @@ BOOL LLGLSLShader::createShader(std::vector * attributes, llassert_always(!mShaderFiles.empty()); // Create program - mProgramObject = glCreateProgramObjectARB(); + mProgramObject = glCreateProgram(); if (mProgramObject == 0) { // Shouldn't happen if shader related extensions, like ARB_vertex_shader, exist. @@ -530,7 +530,7 @@ BOOL LLGLSLShader::attachVertexObject(std::string object_path) if (LLShaderMgr::instance()->mVertexShaderObjects.count(object_path) > 0) { stop_glerror(); - glAttachObjectARB(mProgramObject, LLShaderMgr::instance()->mVertexShaderObjects[object_path]); + glAttachShader(mProgramObject, LLShaderMgr::instance()->mVertexShaderObjects[object_path]); #if DEBUG_SHADER_INCLUDES dumpAttachObject("attachVertexObject", mProgramObject, object_path); #endif // DEBUG_SHADER_INCLUDES @@ -549,7 +549,7 @@ BOOL LLGLSLShader::attachFragmentObject(std::string object_path) if (LLShaderMgr::instance()->mFragmentShaderObjects.count(object_path) > 0) { stop_glerror(); - glAttachObjectARB(mProgramObject, LLShaderMgr::instance()->mFragmentShaderObjects[object_path]); + glAttachShader(mProgramObject, LLShaderMgr::instance()->mFragmentShaderObjects[object_path]); #if DEBUG_SHADER_INCLUDES dumpAttachObject("attachFragmentObject", mProgramObject, object_path); #endif // DEBUG_SHADER_INCLUDES @@ -568,7 +568,7 @@ void LLGLSLShader::attachObject(GLuint object) if (object != 0) { stop_glerror(); - glAttachObjectARB(mProgramObject, object); + glAttachShader(mProgramObject, object); #if DEBUG_SHADER_INCLUDES std::string object_path("???"); dumpAttachObject("attachObject", mProgramObject, object_path); @@ -597,7 +597,7 @@ BOOL LLGLSLShader::mapAttributes(const std::vector * attri for (U32 i = 0; i < LLShaderMgr::instance()->mReservedAttribs.size(); i++) { const char* name = LLShaderMgr::instance()->mReservedAttribs[i].c_str(); - glBindAttribLocationARB(mProgramObject, i, (const GLcharARB *) name); + glBindAttribLocation(mProgramObject, i, (const GLchar *) name); } //link the program @@ -620,7 +620,7 @@ BOOL LLGLSLShader::mapAttributes(const std::vector * attri for (U32 i = 0; i < LLShaderMgr::instance()->mReservedAttribs.size(); i++) { const char* name = LLShaderMgr::instance()->mReservedAttribs[i].c_str(); - S32 index = glGetAttribLocationARB(mProgramObject, (const GLcharARB *)name); + S32 index = glGetAttribLocation(mProgramObject, (const GLchar *)name); if (index != -1) { #if LL_RELEASE_WITH_DEBUG_INFO @@ -637,7 +637,7 @@ BOOL LLGLSLShader::mapAttributes(const std::vector * attri for (U32 i = 0; i < numAttributes; i++) { const char* name = (*attributes)[i].String().c_str(); - S32 index = glGetAttribLocationARB(mProgramObject, name); + S32 index = glGetAttribLocation(mProgramObject, name); if (index != -1) { mAttribute[LLShaderMgr::instance()->mReservedAttribs.size() + i] = index; @@ -668,7 +668,7 @@ void LLGLSLShader::mapUniform(GLint index, const vector * name[0] = 0; - glGetActiveUniformARB(mProgramObject, index, 1024, &length, &size, &type, (GLcharARB *)name); + glGetActiveUniform(mProgramObject, index, 1024, &length, &size, &type, (GLchar *)name); #if !LL_DARWIN if (size > 0) { @@ -719,7 +719,7 @@ void LLGLSLShader::mapUniform(GLint index, const vector * } #endif - S32 location = glGetUniformLocationARB(mProgramObject, name); + S32 location = glGetUniformLocation(mProgramObject, name); if (location != -1) { //chop off "[0]" so we can always access the first element @@ -817,7 +817,7 @@ BOOL LLGLSLShader::mapUniforms(const vector * uniforms) //get the number of active uniforms GLint activeCount; - glGetObjectParameterivARB(mProgramObject, GL_OBJECT_ACTIVE_UNIFORMS_ARB, &activeCount); + glGetProgramiv(mProgramObject, GL_ACTIVE_UNIFORMS, &activeCount); //........................................................................................................................................ //........................................................................................ @@ -841,11 +841,11 @@ BOOL LLGLSLShader::mapUniforms(const vector * uniforms) */ - S32 diffuseMap = glGetUniformLocationARB(mProgramObject, "diffuseMap"); - S32 specularMap = glGetUniformLocationARB(mProgramObject, "specularMap"); - S32 bumpMap = glGetUniformLocationARB(mProgramObject, "bumpMap"); - S32 altDiffuseMap = glGetUniformLocationARB(mProgramObject, "altDiffuseMap"); - S32 environmentMap = glGetUniformLocationARB(mProgramObject, "environmentMap"); + S32 diffuseMap = glGetUniformLocation(mProgramObject, "diffuseMap"); + S32 specularMap = glGetUniformLocation(mProgramObject, "specularMap"); + S32 bumpMap = glGetUniformLocation(mProgramObject, "bumpMap"); + S32 altDiffuseMap = glGetUniformLocation(mProgramObject, "altDiffuseMap"); + S32 environmentMap = glGetUniformLocation(mProgramObject, "environmentMap"); std::set skip_index; @@ -862,7 +862,7 @@ BOOL LLGLSLShader::mapUniforms(const vector * uniforms) { name[0] = '\0'; - glGetActiveUniformARB(mProgramObject, i, 1024, &length, &size, &type, (GLcharARB *)name); + glGetActiveUniform(mProgramObject, i, 1024, &length, &size, &type, (GLchar *)name); if (-1 == diffuseMap && std::string(name) == "diffuseMap") { @@ -963,7 +963,7 @@ void LLGLSLShader::bind() if (sCurBoundShader != mProgramObject) // Don't re-bind current shader { LLVertexBuffer::unbind(); - glUseProgramObjectARB(mProgramObject); + glUseProgram(mProgramObject); sCurBoundShader = mProgramObject; sCurBoundShaderPtr = this; } @@ -995,7 +995,7 @@ void LLGLSLShader::unbind() gGL.flush(); stop_glerror(); LLVertexBuffer::unbind(); - glUseProgramObjectARB(0); + glUseProgram(0); sCurBoundShader = 0; sCurBoundShaderPtr = NULL; stop_glerror(); @@ -1006,7 +1006,7 @@ void LLGLSLShader::bindNoShader(void) LL_PROFILE_ZONE_SCOPED_CATEGORY_SHADER; LLVertexBuffer::unbind(); - glUseProgramObjectARB(0); + glUseProgram(0); sCurBoundShader = 0; sCurBoundShaderPtr = NULL; } @@ -1434,7 +1434,7 @@ GLint LLGLSLShader::getUniformLocation(const LLStaticHashedString& uniform) if (gDebugGL) { stop_glerror(); - if (iter->second != glGetUniformLocationARB(mProgramObject, uniform.String().c_str())) + if (iter->second != glGetUniformLocation(mProgramObject, uniform.String().c_str())) { LL_ERRS() << "Uniform does not match." << LL_ENDL; } diff --git a/indra/llrender/llpostprocess.cpp b/indra/llrender/llpostprocess.cpp index d3449fb85d..f52de96549 100644 --- a/indra/llrender/llpostprocess.cpp +++ b/indra/llrender/llpostprocess.cpp @@ -350,7 +350,7 @@ void LLPostProcess::getShaderUniforms(glslUniforms & uniforms, GLuint & prog) /// Find uniform locations and insert into map glslUniforms::iterator i; for (i = uniforms.begin(); i != uniforms.end(); ++i){ - i->second = glGetUniformLocationARB(prog, i->first.String().c_str()); + i->second = glGetUniformLocation(prog, i->first.String().c_str()); } } diff --git a/indra/llrender/llshadermgr.cpp b/indra/llrender/llshadermgr.cpp index 114059f092..ff547d9d47 100644 --- a/indra/llrender/llshadermgr.cpp +++ b/indra/llrender/llshadermgr.cpp @@ -1045,9 +1045,9 @@ GLuint LLShaderMgr::loadShaderFile(const std::string& filename, S32 & shader_lev BOOL LLShaderMgr::linkProgramObject(GLuint obj, BOOL suppress_errors) { //check for errors - glLinkProgramARB(obj); + glLinkProgram(obj); GLint success = GL_TRUE; - glGetObjectParameterivARB(obj, GL_OBJECT_LINK_STATUS_ARB, &success); + glGetProgramiv(obj, GL_LINK_STATUS, &success); if (!suppress_errors && success == GL_FALSE) { //an error occured, print log @@ -1068,9 +1068,9 @@ BOOL LLShaderMgr::linkProgramObject(GLuint obj, BOOL suppress_errors) BOOL LLShaderMgr::validateProgramObject(GLuint obj) { //check program validity against current GL - glValidateProgramARB(obj); + glValidateProgram(obj); GLint success = GL_TRUE; - glGetObjectParameterivARB(obj, GL_OBJECT_VALIDATE_STATUS_ARB, &success); + glGetProgramiv(obj, GL_VALIDATE_STATUS, &success); if (success == GL_FALSE) { LL_SHADER_LOADING_WARNS() << "GLSL program not valid: " << LL_ENDL; -- cgit v1.2.3 From 7b2b8ec46e42477f0ba43e2bc59f9fcc713d1565 Mon Sep 17 00:00:00 2001 From: Erik Kundiman Date: Wed, 6 Sep 2023 09:50:48 +0800 Subject: Core profile uniform related functions replacing legacy ARB versions. --- indra/llrender/llglslshader.cpp | 48 ++++++++++++++++++++--------------------- 1 file changed, 24 insertions(+), 24 deletions(-) (limited to 'indra') diff --git a/indra/llrender/llglslshader.cpp b/indra/llrender/llglslshader.cpp index a0183e8225..c402cab295 100644 --- a/indra/llrender/llglslshader.cpp +++ b/indra/llrender/llglslshader.cpp @@ -788,7 +788,7 @@ GLint LLGLSLShader::mapUniformTextureChannel(GLint location, GLenum type) if ((type >= GL_SAMPLER_1D_ARB && type <= GL_SAMPLER_2D_RECT_SHADOW_ARB) || type == GL_SAMPLER_2D_MULTISAMPLE) { //this here is a texture - glUniform1iARB(location, mActiveTextureChannels); + glUniform1i(location, mActiveTextureChannels); LL_DEBUGS("ShaderUniform") << "Assigned to texture channel " << mActiveTextureChannels << LL_ENDL; return mActiveTextureChannels++; } @@ -1136,7 +1136,7 @@ void LLGLSLShader::uniform1i(U32 index, GLint x) const auto& iter = mValue.find(mUniform[index]); if (iter == mValue.end() || iter->second.mV[0] != x) { - glUniform1iARB(mUniform[index], x); + glUniform1i(mUniform[index], x); mValue[mUniform[index]] = LLVector4(x,0.f,0.f,0.f); } } @@ -1159,7 +1159,7 @@ void LLGLSLShader::uniform1f(U32 index, GLfloat x) const auto& iter = mValue.find(mUniform[index]); if (iter == mValue.end() || iter->second.mV[0] != x) { - glUniform1fARB(mUniform[index], x); + glUniform1f(mUniform[index], x); mValue[mUniform[index]] = LLVector4(x,0.f,0.f,0.f); } } @@ -1182,7 +1182,7 @@ void LLGLSLShader::uniform2f(U32 index, GLfloat x, GLfloat y) LLVector4 vec(x,y,0.f,0.f); if (iter == mValue.end() || shouldChange(iter->second,vec)) { - glUniform2fARB(mUniform[index], x, y); + glUniform2f(mUniform[index], x, y); mValue[mUniform[index]] = vec; } } @@ -1205,7 +1205,7 @@ void LLGLSLShader::uniform3f(U32 index, GLfloat x, GLfloat y, GLfloat z) LLVector4 vec(x,y,z,0.f); if (iter == mValue.end() || shouldChange(iter->second,vec)) { - glUniform3fARB(mUniform[index], x, y, z); + glUniform3f(mUniform[index], x, y, z); mValue[mUniform[index]] = vec; } } @@ -1228,7 +1228,7 @@ void LLGLSLShader::uniform4f(U32 index, GLfloat x, GLfloat y, GLfloat z, GLfloat LLVector4 vec(x,y,z,w); if (iter == mValue.end() || shouldChange(iter->second,vec)) { - glUniform4fARB(mUniform[index], x, y, z, w); + glUniform4f(mUniform[index], x, y, z, w); mValue[mUniform[index]] = vec; } } @@ -1251,7 +1251,7 @@ void LLGLSLShader::uniform1iv(U32 index, U32 count, const GLint* v) LLVector4 vec(v[0],0.f,0.f,0.f); if (iter == mValue.end() || shouldChange(iter->second,vec) || count != 1) { - glUniform1ivARB(mUniform[index], count, v); + glUniform1iv(mUniform[index], count, v); mValue[mUniform[index]] = vec; } } @@ -1274,7 +1274,7 @@ void LLGLSLShader::uniform1fv(U32 index, U32 count, const GLfloat* v) LLVector4 vec(v[0],0.f,0.f,0.f); if (iter == mValue.end() || shouldChange(iter->second,vec) || count != 1) { - glUniform1fvARB(mUniform[index], count, v); + glUniform1fv(mUniform[index], count, v); mValue[mUniform[index]] = vec; } } @@ -1297,7 +1297,7 @@ void LLGLSLShader::uniform2fv(U32 index, U32 count, const GLfloat* v) LLVector4 vec(v[0],v[1],0.f,0.f); if (iter == mValue.end() || shouldChange(iter->second,vec) || count != 1) { - glUniform2fvARB(mUniform[index], count, v); + glUniform2fv(mUniform[index], count, v); mValue[mUniform[index]] = vec; } } @@ -1320,7 +1320,7 @@ void LLGLSLShader::uniform3fv(U32 index, U32 count, const GLfloat* v) LLVector4 vec(v[0],v[1],v[2],0.f); if (iter == mValue.end() || shouldChange(iter->second,vec) || count != 1) { - glUniform3fvARB(mUniform[index], count, v); + glUniform3fv(mUniform[index], count, v); mValue[mUniform[index]] = vec; } } @@ -1344,7 +1344,7 @@ void LLGLSLShader::uniform4fv(U32 index, U32 count, const GLfloat* v) if (iter == mValue.end() || shouldChange(iter->second,vec) || count != 1) { LL_PROFILE_ZONE_SCOPED_CATEGORY_SHADER; - glUniform4fvARB(mUniform[index], count, v); + glUniform4fv(mUniform[index], count, v); mValue[mUniform[index]] = vec; } } @@ -1363,7 +1363,7 @@ void LLGLSLShader::uniformMatrix2fv(U32 index, U32 count, GLboolean transpose, c if (mUniform[index] >= 0) { - glUniformMatrix2fvARB(mUniform[index], count, transpose, v); + glUniformMatrix2fv(mUniform[index], count, transpose, v); } } } @@ -1380,7 +1380,7 @@ void LLGLSLShader::uniformMatrix3fv(U32 index, U32 count, GLboolean transpose, c if (mUniform[index] >= 0) { - glUniformMatrix3fvARB(mUniform[index], count, transpose, v); + glUniformMatrix3fv(mUniform[index], count, transpose, v); } } } @@ -1416,7 +1416,7 @@ void LLGLSLShader::uniformMatrix4fv(U32 index, U32 count, GLboolean transpose, c if (mUniform[index] >= 0) { - glUniformMatrix4fvARB(mUniform[index], count, transpose, v); + glUniformMatrix4fv(mUniform[index], count, transpose, v); } } } @@ -1489,7 +1489,7 @@ void LLGLSLShader::uniform1i(const LLStaticHashedString& uniform, GLint v) LLVector4 vec(v,0.f,0.f,0.f); if (iter == mValue.end() || shouldChange(iter->second,vec)) { - glUniform1iARB(location, v); + glUniform1i(location, v); mValue[location] = vec; } } @@ -1505,7 +1505,7 @@ void LLGLSLShader::uniform2i(const LLStaticHashedString& uniform, GLint i, GLint LLVector4 vec(i,j,0.f,0.f); if (iter == mValue.end() || shouldChange(iter->second,vec)) { - glUniform2iARB(location, i, j); + glUniform2i(location, i, j); mValue[location] = vec; } } @@ -1522,7 +1522,7 @@ void LLGLSLShader::uniform1f(const LLStaticHashedString& uniform, GLfloat v) LLVector4 vec(v,0.f,0.f,0.f); if (iter == mValue.end() || shouldChange(iter->second,vec)) { - glUniform1fARB(location, v); + glUniform1f(location, v); mValue[location] = vec; } } @@ -1538,7 +1538,7 @@ void LLGLSLShader::uniform2f(const LLStaticHashedString& uniform, GLfloat x, GLf LLVector4 vec(x,y,0.f,0.f); if (iter == mValue.end() || shouldChange(iter->second,vec)) { - glUniform2fARB(location, x,y); + glUniform2f(location, x,y); mValue[location] = vec; } } @@ -1555,7 +1555,7 @@ void LLGLSLShader::uniform3f(const LLStaticHashedString& uniform, GLfloat x, GLf LLVector4 vec(x,y,z,0.f); if (iter == mValue.end() || shouldChange(iter->second,vec)) { - glUniform3fARB(location, x,y,z); + glUniform3f(location, x,y,z); mValue[location] = vec; } } @@ -1571,7 +1571,7 @@ void LLGLSLShader::uniform1fv(const LLStaticHashedString& uniform, U32 count, co LLVector4 vec(v[0],0.f,0.f,0.f); if (iter == mValue.end() || shouldChange(iter->second,vec) || count != 1) { - glUniform1fvARB(location, count, v); + glUniform1fv(location, count, v); mValue[location] = vec; } } @@ -1587,7 +1587,7 @@ void LLGLSLShader::uniform2fv(const LLStaticHashedString& uniform, U32 count, co LLVector4 vec(v[0],v[1],0.f,0.f); if (iter == mValue.end() || shouldChange(iter->second,vec) || count != 1) { - glUniform2fvARB(location, count, v); + glUniform2fv(location, count, v); mValue[location] = vec; } } @@ -1603,7 +1603,7 @@ void LLGLSLShader::uniform3fv(const LLStaticHashedString& uniform, U32 count, co LLVector4 vec(v[0],v[1],v[2],0.f); if (iter == mValue.end() || shouldChange(iter->second,vec) || count != 1) { - glUniform3fvARB(location, count, v); + glUniform3fv(location, count, v); mValue[location] = vec; } } @@ -1620,7 +1620,7 @@ void LLGLSLShader::uniform4fv(const LLStaticHashedString& uniform, U32 count, co if (iter == mValue.end() || shouldChange(iter->second,vec) || count != 1) { LL_PROFILE_ZONE_SCOPED_CATEGORY_SHADER; - glUniform4fvARB(location, count, v); + glUniform4fv(location, count, v); mValue[location] = vec; } } @@ -1633,7 +1633,7 @@ void LLGLSLShader::uniformMatrix4fv(const LLStaticHashedString& uniform, U32 cou if (location >= 0) { stop_glerror(); - glUniformMatrix4fvARB(location, count, transpose, v); + glUniformMatrix4fv(location, count, transpose, v); stop_glerror(); } } -- cgit v1.2.3 From e155e53b290f638d853ed3a027c2c8f064ff8201 Mon Sep 17 00:00:00 2001 From: Erik Kundiman Date: Wed, 6 Sep 2023 09:57:22 +0800 Subject: Core profile vertex attribute related functions replacing legacy ARB versions. --- indra/llrender/llglslshader.cpp | 4 +-- indra/llrender/llvertexbuffer.cpp | 58 +++++++++++++++++++-------------------- 2 files changed, 31 insertions(+), 31 deletions(-) (limited to 'indra') diff --git a/indra/llrender/llglslshader.cpp b/indra/llrender/llglslshader.cpp index c402cab295..48bdfb6b51 100644 --- a/indra/llrender/llglslshader.cpp +++ b/indra/llrender/llglslshader.cpp @@ -1643,7 +1643,7 @@ void LLGLSLShader::vertexAttrib4f(U32 index, GLfloat x, GLfloat y, GLfloat z, GL { if (mAttribute[index] > 0) { - glVertexAttrib4fARB(mAttribute[index], x, y, z, w); + glVertexAttrib4f(mAttribute[index], x, y, z, w); } } @@ -1651,7 +1651,7 @@ void LLGLSLShader::vertexAttrib4fv(U32 index, GLfloat* v) { if (mAttribute[index] > 0) { - glVertexAttrib4fvARB(mAttribute[index], v); + glVertexAttrib4fv(mAttribute[index], v); } } diff --git a/indra/llrender/llvertexbuffer.cpp b/indra/llrender/llvertexbuffer.cpp index be3e6ddff0..a33436eb90 100644 --- a/indra/llrender/llvertexbuffer.cpp +++ b/indra/llrender/llvertexbuffer.cpp @@ -1338,7 +1338,7 @@ void LLVertexBuffer::setupVertexArray() { if (mTypeMask & (1 << i)) { - glEnableVertexAttribArrayARB(i); + glEnableVertexAttribArray(i); if (attrib_integer[i]) { @@ -1364,14 +1364,14 @@ void LLVertexBuffer::setupVertexArray() // pointer value. Ruslan asserts that in this case the last // param is interpreted as an array data offset within the VBO // rather than as an actual pointer, so it's okay. - glVertexAttribPointerARB(i, attrib_size[i], attrib_type[i], + glVertexAttribPointer(i, attrib_size[i], attrib_type[i], attrib_normalized[i], sTypeSize[i], reinterpret_cast(intptr_t(mOffsets[i]))); } } else { - glDisableVertexAttribArrayARB(i); + glDisableVertexAttribArray(i); } } @@ -2396,74 +2396,74 @@ void LLVertexBuffer::setupVertexBuffer(U32 data_mask) { S32 loc = TYPE_NORMAL; void* ptr = (void*)(base + mOffsets[TYPE_NORMAL]); - glVertexAttribPointerARB(loc, 3, GL_FLOAT, GL_FALSE, LLVertexBuffer::sTypeSize[TYPE_NORMAL], ptr); + glVertexAttribPointer(loc, 3, GL_FLOAT, GL_FALSE, LLVertexBuffer::sTypeSize[TYPE_NORMAL], ptr); } if (data_mask & MAP_TEXCOORD3) { S32 loc = TYPE_TEXCOORD3; void* ptr = (void*)(base + mOffsets[TYPE_TEXCOORD3]); - glVertexAttribPointerARB(loc,2,GL_FLOAT, GL_FALSE, LLVertexBuffer::sTypeSize[TYPE_TEXCOORD3], ptr); + glVertexAttribPointer(loc,2,GL_FLOAT, GL_FALSE, LLVertexBuffer::sTypeSize[TYPE_TEXCOORD3], ptr); } if (data_mask & MAP_TEXCOORD2) { S32 loc = TYPE_TEXCOORD2; void* ptr = (void*)(base + mOffsets[TYPE_TEXCOORD2]); - glVertexAttribPointerARB(loc,2,GL_FLOAT, GL_FALSE, LLVertexBuffer::sTypeSize[TYPE_TEXCOORD2], ptr); + glVertexAttribPointer(loc,2,GL_FLOAT, GL_FALSE, LLVertexBuffer::sTypeSize[TYPE_TEXCOORD2], ptr); } if (data_mask & MAP_TEXCOORD1) { S32 loc = TYPE_TEXCOORD1; void* ptr = (void*)(base + mOffsets[TYPE_TEXCOORD1]); - glVertexAttribPointerARB(loc,2,GL_FLOAT, GL_FALSE, LLVertexBuffer::sTypeSize[TYPE_TEXCOORD1], ptr); + glVertexAttribPointer(loc,2,GL_FLOAT, GL_FALSE, LLVertexBuffer::sTypeSize[TYPE_TEXCOORD1], ptr); } if (data_mask & MAP_TANGENT) { S32 loc = TYPE_TANGENT; void* ptr = (void*)(base + mOffsets[TYPE_TANGENT]); - glVertexAttribPointerARB(loc, 4,GL_FLOAT, GL_FALSE, LLVertexBuffer::sTypeSize[TYPE_TANGENT], ptr); + glVertexAttribPointer(loc, 4,GL_FLOAT, GL_FALSE, LLVertexBuffer::sTypeSize[TYPE_TANGENT], ptr); } if (data_mask & MAP_TEXCOORD0) { S32 loc = TYPE_TEXCOORD0; void* ptr = (void*)(base + mOffsets[TYPE_TEXCOORD0]); - glVertexAttribPointerARB(loc,2,GL_FLOAT, GL_FALSE, LLVertexBuffer::sTypeSize[TYPE_TEXCOORD0], ptr); + glVertexAttribPointer(loc,2,GL_FLOAT, GL_FALSE, LLVertexBuffer::sTypeSize[TYPE_TEXCOORD0], ptr); } if (data_mask & MAP_COLOR) { S32 loc = TYPE_COLOR; //bind emissive instead of color pointer if emissive is present void* ptr = (data_mask & MAP_EMISSIVE) ? (void*)(base + mOffsets[TYPE_EMISSIVE]) : (void*)(base + mOffsets[TYPE_COLOR]); - glVertexAttribPointerARB(loc, 4, GL_UNSIGNED_BYTE, GL_TRUE, LLVertexBuffer::sTypeSize[TYPE_COLOR], ptr); + glVertexAttribPointer(loc, 4, GL_UNSIGNED_BYTE, GL_TRUE, LLVertexBuffer::sTypeSize[TYPE_COLOR], ptr); } if (data_mask & MAP_EMISSIVE) { S32 loc = TYPE_EMISSIVE; void* ptr = (void*)(base + mOffsets[TYPE_EMISSIVE]); - glVertexAttribPointerARB(loc, 4, GL_UNSIGNED_BYTE, GL_TRUE, LLVertexBuffer::sTypeSize[TYPE_EMISSIVE], ptr); + glVertexAttribPointer(loc, 4, GL_UNSIGNED_BYTE, GL_TRUE, LLVertexBuffer::sTypeSize[TYPE_EMISSIVE], ptr); if (!(data_mask & MAP_COLOR)) { //map emissive to color channel when color is not also being bound to avoid unnecessary shader swaps loc = TYPE_COLOR; - glVertexAttribPointerARB(loc, 4, GL_UNSIGNED_BYTE, GL_TRUE, LLVertexBuffer::sTypeSize[TYPE_EMISSIVE], ptr); + glVertexAttribPointer(loc, 4, GL_UNSIGNED_BYTE, GL_TRUE, LLVertexBuffer::sTypeSize[TYPE_EMISSIVE], ptr); } } if (data_mask & MAP_WEIGHT) { S32 loc = TYPE_WEIGHT; void* ptr = (void*)(base + mOffsets[TYPE_WEIGHT]); - glVertexAttribPointerARB(loc, 1, GL_FLOAT, GL_FALSE, LLVertexBuffer::sTypeSize[TYPE_WEIGHT], ptr); + glVertexAttribPointer(loc, 1, GL_FLOAT, GL_FALSE, LLVertexBuffer::sTypeSize[TYPE_WEIGHT], ptr); } if (data_mask & MAP_WEIGHT4) { S32 loc = TYPE_WEIGHT4; void* ptr = (void*)(base+mOffsets[TYPE_WEIGHT4]); - glVertexAttribPointerARB(loc, 4, GL_FLOAT, GL_FALSE, LLVertexBuffer::sTypeSize[TYPE_WEIGHT4], ptr); + glVertexAttribPointer(loc, 4, GL_FLOAT, GL_FALSE, LLVertexBuffer::sTypeSize[TYPE_WEIGHT4], ptr); } if (data_mask & MAP_CLOTHWEIGHT) { S32 loc = TYPE_CLOTHWEIGHT; void* ptr = (void*)(base + mOffsets[TYPE_CLOTHWEIGHT]); - glVertexAttribPointerARB(loc, 4, GL_FLOAT, GL_TRUE, LLVertexBuffer::sTypeSize[TYPE_CLOTHWEIGHT], ptr); + glVertexAttribPointer(loc, 4, GL_FLOAT, GL_TRUE, LLVertexBuffer::sTypeSize[TYPE_CLOTHWEIGHT], ptr); } if (data_mask & MAP_TEXTURE_INDEX && (gGLManager.mGLSLVersionMajor >= 2 || gGLManager.mGLSLVersionMinor >= 30)) //indexed texture rendering requires GLSL 1.30 or later @@ -2478,7 +2478,7 @@ void LLVertexBuffer::setupVertexBuffer(U32 data_mask) { S32 loc = TYPE_VERTEX; void* ptr = (void*)(base + mOffsets[TYPE_VERTEX]); - glVertexAttribPointerARB(loc, 3,GL_FLOAT, GL_FALSE, LLVertexBuffer::sTypeSize[TYPE_VERTEX], ptr); + glVertexAttribPointer(loc, 3,GL_FLOAT, GL_FALSE, LLVertexBuffer::sTypeSize[TYPE_VERTEX], ptr); } llglassertok(); @@ -2492,74 +2492,74 @@ void LLVertexBuffer::setupVertexBufferFast(U32 data_mask) { S32 loc = TYPE_NORMAL; void* ptr = (void*)(base + mOffsets[TYPE_NORMAL]); - glVertexAttribPointerARB(loc, 3, GL_FLOAT, GL_FALSE, LLVertexBuffer::sTypeSize[TYPE_NORMAL], ptr); + glVertexAttribPointer(loc, 3, GL_FLOAT, GL_FALSE, LLVertexBuffer::sTypeSize[TYPE_NORMAL], ptr); } if (data_mask & MAP_TEXCOORD3) { S32 loc = TYPE_TEXCOORD3; void* ptr = (void*)(base + mOffsets[TYPE_TEXCOORD3]); - glVertexAttribPointerARB(loc, 2, GL_FLOAT, GL_FALSE, LLVertexBuffer::sTypeSize[TYPE_TEXCOORD3], ptr); + glVertexAttribPointer(loc, 2, GL_FLOAT, GL_FALSE, LLVertexBuffer::sTypeSize[TYPE_TEXCOORD3], ptr); } if (data_mask & MAP_TEXCOORD2) { S32 loc = TYPE_TEXCOORD2; void* ptr = (void*)(base + mOffsets[TYPE_TEXCOORD2]); - glVertexAttribPointerARB(loc, 2, GL_FLOAT, GL_FALSE, LLVertexBuffer::sTypeSize[TYPE_TEXCOORD2], ptr); + glVertexAttribPointer(loc, 2, GL_FLOAT, GL_FALSE, LLVertexBuffer::sTypeSize[TYPE_TEXCOORD2], ptr); } if (data_mask & MAP_TEXCOORD1) { S32 loc = TYPE_TEXCOORD1; void* ptr = (void*)(base + mOffsets[TYPE_TEXCOORD1]); - glVertexAttribPointerARB(loc, 2, GL_FLOAT, GL_FALSE, LLVertexBuffer::sTypeSize[TYPE_TEXCOORD1], ptr); + glVertexAttribPointer(loc, 2, GL_FLOAT, GL_FALSE, LLVertexBuffer::sTypeSize[TYPE_TEXCOORD1], ptr); } if (data_mask & MAP_TANGENT) { S32 loc = TYPE_TANGENT; void* ptr = (void*)(base + mOffsets[TYPE_TANGENT]); - glVertexAttribPointerARB(loc, 4, GL_FLOAT, GL_FALSE, LLVertexBuffer::sTypeSize[TYPE_TANGENT], ptr); + glVertexAttribPointer(loc, 4, GL_FLOAT, GL_FALSE, LLVertexBuffer::sTypeSize[TYPE_TANGENT], ptr); } if (data_mask & MAP_TEXCOORD0) { S32 loc = TYPE_TEXCOORD0; void* ptr = (void*)(base + mOffsets[TYPE_TEXCOORD0]); - glVertexAttribPointerARB(loc, 2, GL_FLOAT, GL_FALSE, LLVertexBuffer::sTypeSize[TYPE_TEXCOORD0], ptr); + glVertexAttribPointer(loc, 2, GL_FLOAT, GL_FALSE, LLVertexBuffer::sTypeSize[TYPE_TEXCOORD0], ptr); } if (data_mask & MAP_COLOR) { S32 loc = TYPE_COLOR; //bind emissive instead of color pointer if emissive is present void* ptr = (data_mask & MAP_EMISSIVE) ? (void*)(base + mOffsets[TYPE_EMISSIVE]) : (void*)(base + mOffsets[TYPE_COLOR]); - glVertexAttribPointerARB(loc, 4, GL_UNSIGNED_BYTE, GL_TRUE, LLVertexBuffer::sTypeSize[TYPE_COLOR], ptr); + glVertexAttribPointer(loc, 4, GL_UNSIGNED_BYTE, GL_TRUE, LLVertexBuffer::sTypeSize[TYPE_COLOR], ptr); } if (data_mask & MAP_EMISSIVE) { S32 loc = TYPE_EMISSIVE; void* ptr = (void*)(base + mOffsets[TYPE_EMISSIVE]); - glVertexAttribPointerARB(loc, 4, GL_UNSIGNED_BYTE, GL_TRUE, LLVertexBuffer::sTypeSize[TYPE_EMISSIVE], ptr); + glVertexAttribPointer(loc, 4, GL_UNSIGNED_BYTE, GL_TRUE, LLVertexBuffer::sTypeSize[TYPE_EMISSIVE], ptr); if (!(data_mask & MAP_COLOR)) { //map emissive to color channel when color is not also being bound to avoid unnecessary shader swaps loc = TYPE_COLOR; - glVertexAttribPointerARB(loc, 4, GL_UNSIGNED_BYTE, GL_TRUE, LLVertexBuffer::sTypeSize[TYPE_EMISSIVE], ptr); + glVertexAttribPointer(loc, 4, GL_UNSIGNED_BYTE, GL_TRUE, LLVertexBuffer::sTypeSize[TYPE_EMISSIVE], ptr); } } if (data_mask & MAP_WEIGHT) { S32 loc = TYPE_WEIGHT; void* ptr = (void*)(base + mOffsets[TYPE_WEIGHT]); - glVertexAttribPointerARB(loc, 1, GL_FLOAT, GL_FALSE, LLVertexBuffer::sTypeSize[TYPE_WEIGHT], ptr); + glVertexAttribPointer(loc, 1, GL_FLOAT, GL_FALSE, LLVertexBuffer::sTypeSize[TYPE_WEIGHT], ptr); } if (data_mask & MAP_WEIGHT4) { S32 loc = TYPE_WEIGHT4; void* ptr = (void*)(base + mOffsets[TYPE_WEIGHT4]); - glVertexAttribPointerARB(loc, 4, GL_FLOAT, GL_FALSE, LLVertexBuffer::sTypeSize[TYPE_WEIGHT4], ptr); + glVertexAttribPointer(loc, 4, GL_FLOAT, GL_FALSE, LLVertexBuffer::sTypeSize[TYPE_WEIGHT4], ptr); } if (data_mask & MAP_CLOTHWEIGHT) { S32 loc = TYPE_CLOTHWEIGHT; void* ptr = (void*)(base + mOffsets[TYPE_CLOTHWEIGHT]); - glVertexAttribPointerARB(loc, 4, GL_FLOAT, GL_TRUE, LLVertexBuffer::sTypeSize[TYPE_CLOTHWEIGHT], ptr); + glVertexAttribPointer(loc, 4, GL_FLOAT, GL_TRUE, LLVertexBuffer::sTypeSize[TYPE_CLOTHWEIGHT], ptr); } if (data_mask & MAP_TEXTURE_INDEX) { @@ -2573,7 +2573,7 @@ void LLVertexBuffer::setupVertexBufferFast(U32 data_mask) { S32 loc = TYPE_VERTEX; void* ptr = (void*)(base + mOffsets[TYPE_VERTEX]); - glVertexAttribPointerARB(loc, 3, GL_FLOAT, GL_FALSE, LLVertexBuffer::sTypeSize[TYPE_VERTEX], ptr); + glVertexAttribPointer(loc, 3, GL_FLOAT, GL_FALSE, LLVertexBuffer::sTypeSize[TYPE_VERTEX], ptr); } } -- cgit v1.2.3 From f6b4f7bfd6c338c44dfbfb07479113075172d929 Mon Sep 17 00:00:00 2001 From: Erik Kundiman Date: Wed, 6 Sep 2023 10:04:56 +0800 Subject: Left out from previous commit --- indra/llrender/llvertexbuffer.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'indra') diff --git a/indra/llrender/llvertexbuffer.cpp b/indra/llrender/llvertexbuffer.cpp index a33436eb90..b48c4f8262 100644 --- a/indra/llrender/llvertexbuffer.cpp +++ b/indra/llrender/llvertexbuffer.cpp @@ -451,14 +451,14 @@ void LLVertexBuffer::setupClientArrays(U32 data_mask) { //was enabled if (!(data_mask & mask)) { //needs to be disabled - glDisableVertexAttribArrayARB(loc); + glDisableVertexAttribArray(loc); } } else { //was disabled if (data_mask & mask) { //needs to be enabled - glEnableVertexAttribArrayARB(loc); + glEnableVertexAttribArray(loc); } } } -- cgit v1.2.3 From 5c3c491537e58cb884b74694cc7453eef89d8515 Mon Sep 17 00:00:00 2001 From: Erik Kundiman Date: Wed, 6 Sep 2023 10:17:38 +0800 Subject: Core profile buffer related functions replacing their legacy ARB counterparts. --- indra/llrender/llrendertarget.cpp | 2 +- indra/llrender/llvertexbuffer.cpp | 66 +++++++++++++++++++-------------------- indra/newview/llface.cpp | 2 +- indra/newview/pipeline.cpp | 2 +- 4 files changed, 36 insertions(+), 36 deletions(-) (limited to 'indra') diff --git a/indra/llrender/llrendertarget.cpp b/indra/llrender/llrendertarget.cpp index f73aab8d23..005a7cfa97 100644 --- a/indra/llrender/llrendertarget.cpp +++ b/indra/llrender/llrendertarget.cpp @@ -485,7 +485,7 @@ void LLRenderTarget::bindTarget() GL_COLOR_ATTACHMENT2, GL_COLOR_ATTACHMENT3}; LL_PROFILER_GPU_ZONEC( "gl.DrawBuffersARB", 0x4000FF ) - glDrawBuffersARB(mTex.size(), drawbuffers); + glDrawBuffers(mTex.size(), drawbuffers); } if (mTex.empty()) diff --git a/indra/llrender/llvertexbuffer.cpp b/indra/llrender/llvertexbuffer.cpp index b48c4f8262..44107d2957 100644 --- a/indra/llrender/llvertexbuffer.cpp +++ b/indra/llrender/llvertexbuffer.cpp @@ -127,7 +127,7 @@ U32 LLVBOPool::genBuffer() if (sNameIdx == 0) { - glGenBuffersARB(1024, sNamePool); + glGenBuffers(1024, sNamePool); sNameIdx = 1024; } @@ -141,11 +141,11 @@ void LLVBOPool::deleteBuffer(U32 name) { LLVertexBuffer::unbind(); - glBindBufferARB(mType, name); - glBufferDataARB(mType, 0, NULL, mUsage); - glBindBufferARB(mType, 0); + glBindBuffer(mType, name); + glBufferData(mType, 0, NULL, mUsage); + glBindBuffer(mType, 0); - glDeleteBuffersARB(1, &name); + glDeleteBuffers(1, &name); } } @@ -176,7 +176,7 @@ U8* LLVBOPool::allocate(U32& name, U32 size, bool for_seed) //make a new buffer name = genBuffer(); - glBindBufferARB(mType, name); + glBindBuffer(mType, name); if (!for_seed && i < LL_VBO_POOL_SEED_COUNT) { //record this miss @@ -194,7 +194,7 @@ U8* LLVBOPool::allocate(U32& name, U32 size, bool for_seed) if (LLVertexBuffer::sDisableVBOMapping || mUsage != GL_DYNAMIC_DRAW_ARB) { - glBufferDataARB(mType, size, 0, mUsage); + glBufferData(mType, size, 0, mUsage); if (mUsage != GL_DYNAMIC_COPY_ARB) { //data will be provided by application ret = (U8*) ll_aligned_malloc<64>(size); @@ -212,10 +212,10 @@ U8* LLVBOPool::allocate(U32& name, U32 size, bool for_seed) } else { //always use a true hint of static draw when allocating non-client-backed buffers - glBufferDataARB(mType, size, 0, GL_STATIC_DRAW_ARB); + glBufferData(mType, size, 0, GL_STATIC_DRAW); } - glBindBufferARB(mType, 0); + glBindBuffer(mType, 0); if (for_seed) { //put into pool for future use @@ -767,12 +767,12 @@ void LLVertexBuffer::unbind() if (sVBOActive) { - glBindBufferARB(GL_ARRAY_BUFFER_ARB, 0); + glBindBuffer(GL_ARRAY_BUFFER, 0); sVBOActive = false; } if (sIBOActive) { - glBindBufferARB(GL_ELEMENT_ARRAY_BUFFER_ARB, 0); + glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, 0); sIBOActive = false; } @@ -1516,7 +1516,7 @@ U8* LLVertexBuffer::mapVertexBuffer(S32 type, S32 index, S32 count, bool map_ran if (gDebugGL) { GLint size = 0; - glGetBufferParameterivARB(GL_ARRAY_BUFFER_ARB, GL_BUFFER_SIZE_ARB, &size); + glGetBufferParameteriv(GL_ARRAY_BUFFER, GL_BUFFER_SIZE, &size); if (size < mSize) { @@ -1537,18 +1537,18 @@ U8* LLVertexBuffer::mapVertexBuffer(S32 type, S32 index, S32 count, bool map_ran #ifndef LL_MESA_HEADLESS glBufferParameteriAPPLE(GL_ARRAY_BUFFER_ARB, GL_BUFFER_SERIALIZED_MODIFY_APPLE, GL_FALSE); glBufferParameteriAPPLE(GL_ARRAY_BUFFER_ARB, GL_BUFFER_FLUSHING_UNMAP_APPLE, GL_FALSE); + src = (U8*) glMapBuffer(GL_ARRAY_BUFFER, GL_WRITE_ONLY); #endif - src = (U8*) glMapBufferARB(GL_ARRAY_BUFFER_ARB, GL_WRITE_ONLY_ARB); } else { - src = (U8*) glMapBufferARB(GL_ARRAY_BUFFER_ARB, GL_WRITE_ONLY_ARB); + src = (U8*) glMapBuffer(GL_ARRAY_BUFFER, GL_WRITE_ONLY); } } else { map_range = false; - src = (U8*) glMapBufferARB(GL_ARRAY_BUFFER_ARB, GL_WRITE_ONLY_ARB); + src = (U8*) glMapBuffer(GL_ARRAY_BUFFER, GL_WRITE_ONLY); } llassert(src != NULL); @@ -1572,7 +1572,7 @@ U8* LLVertexBuffer::mapVertexBuffer(S32 type, S32 index, S32 count, bool map_ran //print out more debug info before crash LL_INFOS() << "vertex buffer size: (num verts : num indices) = " << getNumVerts() << " : " << getNumIndices() << LL_ENDL; GLint size; - glGetBufferParameterivARB(GL_ARRAY_BUFFER_ARB, GL_BUFFER_SIZE_ARB, &size); + glGetBufferParameteriv(GL_ARRAY_BUFFER, GL_BUFFER_SIZE, &size); LL_INFOS() << "GL_ARRAY_BUFFER_ARB size is " << size << LL_ENDL; //-------------------- @@ -1710,18 +1710,18 @@ U8* LLVertexBuffer::mapIndexBuffer(S32 index, S32 count, bool map_range) #ifndef LL_MESA_HEADLESS glBufferParameteriAPPLE(GL_ELEMENT_ARRAY_BUFFER_ARB, GL_BUFFER_SERIALIZED_MODIFY_APPLE, GL_FALSE); glBufferParameteriAPPLE(GL_ELEMENT_ARRAY_BUFFER_ARB, GL_BUFFER_FLUSHING_UNMAP_APPLE, GL_FALSE); + src = (U8*) glMapBuffer(GL_ELEMENT_ARRAY_BUFFER, GL_WRITE_ONLY); #endif - src = (U8*) glMapBufferARB(GL_ELEMENT_ARRAY_BUFFER_ARB, GL_WRITE_ONLY_ARB); } else { - src = (U8*) glMapBufferARB(GL_ELEMENT_ARRAY_BUFFER_ARB, GL_WRITE_ONLY_ARB); + src = (U8*) glMapBuffer(GL_ELEMENT_ARRAY_BUFFER, GL_WRITE_ONLY); } } else { map_range = false; - src = (U8*) glMapBufferARB(GL_ELEMENT_ARRAY_BUFFER_ARB, GL_WRITE_ONLY_ARB); + src = (U8*) glMapBuffer(GL_ELEMENT_ARRAY_BUFFER, GL_WRITE_ONLY); } llassert(src != NULL); @@ -1797,12 +1797,12 @@ void LLVertexBuffer::unmapBuffer() S32 length = sTypeSize[region.mType]*region.mCount; if (mSize >= length + offset) { - glBufferSubDataARB(GL_ARRAY_BUFFER_ARB, offset, length, (U8*)mMappedData + offset); + glBufferSubData(GL_ARRAY_BUFFER, offset, length, (U8*)mMappedData + offset); } else { GLint size = 0; - glGetBufferParameterivARB(GL_ARRAY_BUFFER_ARB, GL_BUFFER_SIZE_ARB, &size); + glGetBufferParameteriv(GL_ARRAY_BUFFER, GL_BUFFER_SIZE, &size); LL_WARNS() << "Attempted to map regions to a buffer that is too small, " << "mapped size: " << mSize << ", gl buffer size: " << size @@ -1818,7 +1818,7 @@ void LLVertexBuffer::unmapBuffer() else { stop_glerror(); - glBufferSubDataARB(GL_ARRAY_BUFFER_ARB, 0, getSize(), (U8*) mMappedData); + glBufferSubData(GL_ARRAY_BUFFER, 0, getSize(), (U8*) mMappedData); stop_glerror(); } } @@ -1852,7 +1852,7 @@ void LLVertexBuffer::unmapBuffer() } } stop_glerror(); - glUnmapBufferARB(GL_ARRAY_BUFFER_ARB); + glUnmapBuffer(GL_ARRAY_BUFFER); stop_glerror(); mMappedData = NULL; @@ -1877,12 +1877,12 @@ void LLVertexBuffer::unmapBuffer() S32 length = sizeof(U16)*region.mCount; if (mIndicesSize >= length + offset) { - glBufferSubDataARB(GL_ELEMENT_ARRAY_BUFFER_ARB, offset, length, (U8*) mMappedIndexData+offset); + glBufferSubData(GL_ELEMENT_ARRAY_BUFFER, offset, length, (U8*) mMappedIndexData+offset); } else { GLint size = 0; - glGetBufferParameterivARB(GL_ELEMENT_ARRAY_BUFFER_ARB, GL_BUFFER_SIZE_ARB, &size); + glGetBufferParameteriv(GL_ELEMENT_ARRAY_BUFFER, GL_BUFFER_SIZE, &size); LL_WARNS() << "Attempted to map regions to a buffer that is too small, " << "mapped size: " << mIndicesSize << ", gl buffer size: " << size @@ -1898,7 +1898,7 @@ void LLVertexBuffer::unmapBuffer() else { stop_glerror(); - glBufferSubDataARB(GL_ELEMENT_ARRAY_BUFFER_ARB, 0, getIndicesSize(), (U8*) mMappedIndexData); + glBufferSubData(GL_ELEMENT_ARRAY_BUFFER, 0, getIndicesSize(), (U8*) mMappedIndexData); stop_glerror(); } } @@ -1935,7 +1935,7 @@ void LLVertexBuffer::unmapBuffer() } } - glUnmapBufferARB(GL_ELEMENT_ARRAY_BUFFER_ARB); + glUnmapBuffer(GL_ELEMENT_ARRAY_BUFFER); mMappedIndexData = NULL; } @@ -2089,7 +2089,7 @@ bool LLVertexBuffer::bindGLBuffer(bool force_bind) if (useVBOs() && (force_bind || (mGLBuffer && (mGLBuffer != sGLRenderBuffer || !sVBOActive)))) { LL_PROFILE_ZONE_SCOPED_CATEGORY_VERTEX; - glBindBufferARB(GL_ARRAY_BUFFER_ARB, mGLBuffer); + glBindBuffer(GL_ARRAY_BUFFER, mGLBuffer); sGLRenderBuffer = mGLBuffer; sBindCount++; sVBOActive = true; @@ -2106,7 +2106,7 @@ bool LLVertexBuffer::bindGLBufferFast() { if (mGLBuffer != sGLRenderBuffer || !sVBOActive) { - glBindBufferARB(GL_ARRAY_BUFFER_ARB, mGLBuffer); + glBindBuffer(GL_ARRAY_BUFFER, mGLBuffer); sGLRenderBuffer = mGLBuffer; sBindCount++; sVBOActive = true; @@ -2129,7 +2129,7 @@ bool LLVertexBuffer::bindGLIndices(bool force_bind) { LL_ERRS() << "VBO bound while another VBO mapped!" << LL_ENDL; }*/ - glBindBufferARB(GL_ELEMENT_ARRAY_BUFFER_ARB, mGLIndices); + glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, mGLIndices); sGLRenderIndices = mGLIndices; stop_glerror(); sBindCount++; @@ -2144,7 +2144,7 @@ bool LLVertexBuffer::bindGLIndicesFast() { if (mGLIndices != sGLRenderIndices || !sIBOActive) { - glBindBufferARB(GL_ELEMENT_ARRAY_BUFFER_ARB, mGLIndices); + glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, mGLIndices); sGLRenderIndices = mGLIndices; sBindCount++; sIBOActive = true; @@ -2306,7 +2306,7 @@ void LLVertexBuffer::setBuffer(U32 data_mask) { if (sVBOActive) { - glBindBufferARB(GL_ARRAY_BUFFER_ARB, 0); + glBindBuffer(GL_ARRAY_BUFFER, 0); sBindCount++; sVBOActive = false; setup = true; // ... or a VBO is deactivated @@ -2321,7 +2321,7 @@ void LLVertexBuffer::setBuffer(U32 data_mask) { if (sIBOActive) { - glBindBufferARB(GL_ELEMENT_ARRAY_BUFFER_ARB, 0); + glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, 0); sBindCount++; sIBOActive = false; } diff --git a/indra/newview/llface.cpp b/indra/newview/llface.cpp index e1edc38923..a7c8a0987e 100644 --- a/indra/newview/llface.cpp +++ b/indra/newview/llface.cpp @@ -1670,7 +1670,7 @@ BOOL LLFace::getGeometryVolume(const LLVolume& volume, } } - glBindBufferARB(GL_TRANSFORM_FEEDBACK_BUFFER, 0); + glBindBuffer(GL_TRANSFORM_FEEDBACK_BUFFER, 0); gGL.popMatrix(); if (cur_shader) diff --git a/indra/newview/pipeline.cpp b/indra/newview/pipeline.cpp index bbff6c889f..63714bd5cb 100644 --- a/indra/newview/pipeline.cpp +++ b/indra/newview/pipeline.cpp @@ -11131,7 +11131,7 @@ void LLPipeline::generateImpostor(LLVOAvatar* avatar, bool preview_avatar) { GLuint buff = GL_COLOR_ATTACHMENT0; LL_PROFILER_GPU_ZONEC( "gl.DrawBuffersARB", 0x8000FF ); - glDrawBuffersARB(1, &buff); + glDrawBuffers(1, &buff); } LLGLDisable blend(GL_BLEND); -- cgit v1.2.3 From b87cfc3c7eb9e5ea38d2805bfce7f2facc57bd21 Mon Sep 17 00:00:00 2001 From: Erik Kundiman Date: Wed, 6 Sep 2023 10:29:21 +0800 Subject: Core profile query related functions replacing their legacy ARB counterparts. --- indra/llrender/llglslshader.cpp | 24 ++++++++++++++++-------- indra/newview/llscenemonitor.cpp | 8 ++++---- indra/newview/llvieweroctree.cpp | 10 +++++----- indra/newview/pipeline.cpp | 2 +- 4 files changed, 26 insertions(+), 18 deletions(-) (limited to 'indra') diff --git a/indra/llrender/llglslshader.cpp b/indra/llrender/llglslshader.cpp index 48bdfb6b51..d18ee6d947 100644 --- a/indra/llrender/llglslshader.cpp +++ b/indra/llrender/llglslshader.cpp @@ -230,8 +230,8 @@ void LLGLSLShader::placeProfileQuery() #if !LL_DARWIN if (mTimerQuery == 0) { - glGenQueriesARB(1, &mSamplesQuery); - glGenQueriesARB(1, &mTimerQuery); + glGenQueries(1, &mSamplesQuery); + glGenQueries(1, &mTimerQuery); } if (!mTextureStateFetched) @@ -267,16 +267,24 @@ void LLGLSLShader::placeProfileQuery() } - glBeginQueryARB(GL_SAMPLES_PASSED, mSamplesQuery); - glBeginQueryARB(GL_TIME_ELAPSED, mTimerQuery); +#if GL_VERSION_1_5 + glBeginQuery(GL_SAMPLES_PASSED, mSamplesQuery); +#if GL_VERSION_3_3 + glBeginQuery(GL_TIME_ELAPSED, mTimerQuery); +#endif // GL_VERSION_3_3 +#endif // GL_VERSION_1_5 #endif } void LLGLSLShader::readProfileQuery(U32 count, U32 mode) { #if !LL_DARWIN - glEndQueryARB(GL_TIME_ELAPSED); - glEndQueryARB(GL_SAMPLES_PASSED); +#if GL_VERSION_1_5 +#if GL_VERSION_3_3 + glEndQuery(GL_TIME_ELAPSED); +#endif // GL_VERSION_3_3 + glEndQuery(GL_SAMPLES_PASSED); +#endif // GL_VERSION_1_5 GLuint64 time_elapsed = 0; glGetQueryObjectui64v(mTimerQuery, GL_QUERY_RESULT, &time_elapsed); @@ -364,13 +372,13 @@ void LLGLSLShader::unloadInternal() if (mTimerQuery) { - glDeleteQueriesARB(1, &mTimerQuery); + glDeleteQueries(1, &mTimerQuery); mTimerQuery = 0; } if (mSamplesQuery) { - glDeleteQueriesARB(1, &mSamplesQuery); + glDeleteQueries(1, &mSamplesQuery); mSamplesQuery = 0; } diff --git a/indra/newview/llscenemonitor.cpp b/indra/newview/llscenemonitor.cpp index 7089df677e..7c6a80e246 100644 --- a/indra/newview/llscenemonitor.cpp +++ b/indra/newview/llscenemonitor.cpp @@ -445,14 +445,14 @@ void LLSceneMonitor::calcDiffAggregate() if(mDiffState == EXECUTE_DIFF) { - glBeginQueryARB(GL_SAMPLES_PASSED_ARB, mQueryObject); + glBeginQuery(GL_SAMPLES_PASSED_ARB, mQueryObject); } gl_draw_scaled_target(0, 0, S32(mDiff->getWidth() * mDiffPixelRatio), S32(mDiff->getHeight() * mDiffPixelRatio), mDiff); if(mDiffState == EXECUTE_DIFF) { - glEndQueryARB(GL_SAMPLES_PASSED_ARB); + glEndQuery(GL_SAMPLES_PASSED_ARB); mDiffState = WAIT_ON_RESULT; } @@ -483,11 +483,11 @@ void LLSceneMonitor::fetchQueryResult() mDiffState = WAITING_FOR_NEXT_DIFF; GLuint available = 0; - glGetQueryObjectuivARB(mQueryObject, GL_QUERY_RESULT_AVAILABLE_ARB, &available); + glGetQueryObjectuiv(mQueryObject, GL_QUERY_RESULT_AVAILABLE, &available); if(available) { GLuint count = 0; - glGetQueryObjectuivARB(mQueryObject, GL_QUERY_RESULT_ARB, &count); + glGetQueryObjectuiv(mQueryObject, GL_QUERY_RESULT, &count); mDiffResult = sqrtf(count * 0.5f / (mDiff->getWidth() * mDiff->getHeight() * mDiffPixelRatio * mDiffPixelRatio)); //0.5 -> (front face + back face) diff --git a/indra/newview/llvieweroctree.cpp b/indra/newview/llvieweroctree.cpp index 36b2bd4c32..cb5ea1cef5 100644 --- a/indra/newview/llvieweroctree.cpp +++ b/indra/newview/llvieweroctree.cpp @@ -800,7 +800,7 @@ U32 LLOcclusionCullingGroup::getNewOcclusionQueryObjectName() { //seed 1024 query names into the free query pool GLuint queries[1024]; - glGenQueriesARB(1024, queries); + glGenQueries(1024, queries); for (int i = 0; i < 1024; ++i) { sFreeQueries.push(queries[i]); @@ -1129,7 +1129,7 @@ void LLOcclusionCullingGroup::checkOcclusion() GLuint available; { LL_PROFILE_ZONE_NAMED_CATEGORY_OCTREE("co - query available"); - glGetQueryObjectuivARB(mOcclusionQuery[LLViewerCamera::sCurCameraID], GL_QUERY_RESULT_AVAILABLE_ARB, &available); + glGetQueryObjectuiv(mOcclusionQuery[LLViewerCamera::sCurCameraID], GL_QUERY_RESULT_AVAILABLE, &available); } if (available) @@ -1137,7 +1137,7 @@ void LLOcclusionCullingGroup::checkOcclusion() GLuint query_result; // Will be # samples drawn, or a boolean depending on mHasOcclusionQuery2 (both are type GLuint) { LL_PROFILE_ZONE_NAMED_CATEGORY_OCTREE("co - query result"); - glGetQueryObjectuivARB(mOcclusionQuery[LLViewerCamera::sCurCameraID], GL_QUERY_RESULT_ARB, &query_result); + glGetQueryObjectuiv(mOcclusionQuery[LLViewerCamera::sCurCameraID], GL_QUERY_RESULT, &query_result); } #if LL_TRACK_PENDING_OCCLUSION_QUERIES sPendingQueries.erase(mOcclusionQuery[LLViewerCamera::sCurCameraID]); @@ -1250,7 +1250,7 @@ void LLOcclusionCullingGroup::doOcclusion(LLCamera* camera, const LLVector4a* sh //get an occlusion query that hasn't been used in awhile releaseOcclusionQueryObjectName(mOcclusionQuery[LLViewerCamera::sCurCameraID]); mOcclusionQuery[LLViewerCamera::sCurCameraID] = getNewOcclusionQueryObjectName(); - glBeginQueryARB(mode, mOcclusionQuery[LLViewerCamera::sCurCameraID]); + glBeginQuery(mode, mOcclusionQuery[LLViewerCamera::sCurCameraID]); } LLGLSLShader* shader = LLGLSLShader::sCurBoundShaderPtr; @@ -1292,7 +1292,7 @@ void LLOcclusionCullingGroup::doOcclusion(LLCamera* camera, const LLVector4a* sh { LL_PROFILE_ZONE_NAMED("glEndQuery"); - glEndQueryARB(mode); + glEndQuery(mode); } } } diff --git a/indra/newview/pipeline.cpp b/indra/newview/pipeline.cpp index 63714bd5cb..23b863aa19 100644 --- a/indra/newview/pipeline.cpp +++ b/indra/newview/pipeline.cpp @@ -719,7 +719,7 @@ void LLPipeline::destroyGL() if (mMeshDirtyQueryObject) { - glDeleteQueriesARB(1, &mMeshDirtyQueryObject); + glDeleteQueries(1, &mMeshDirtyQueryObject); mMeshDirtyQueryObject = 0; } } -- cgit v1.2.3 From 93a309edb2e824514b832f0970ca1927522afc63 Mon Sep 17 00:00:00 2001 From: Erik Kundiman Date: Wed, 6 Sep 2023 10:38:13 +0800 Subject: Some GL_VERSION_2_0 sampler implementor only code preprocessed so it doesn't get compiled on non implementors. --- indra/llrender/llglslshader.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'indra') diff --git a/indra/llrender/llglslshader.cpp b/indra/llrender/llglslshader.cpp index d18ee6d947..308ec1a771 100644 --- a/indra/llrender/llglslshader.cpp +++ b/indra/llrender/llglslshader.cpp @@ -793,7 +793,10 @@ GLint LLGLSLShader::mapUniformTextureChannel(GLint location, GLenum type) { LL_PROFILE_ZONE_SCOPED_CATEGORY_SHADER; - if ((type >= GL_SAMPLER_1D_ARB && type <= GL_SAMPLER_2D_RECT_SHADOW_ARB) || + if ( +#if GL_VERSION_2_0 + (type >= GL_SAMPLER_1D_ARB && type <= GL_SAMPLER_2D_RECT_SHADOW_ARB) || +#endif type == GL_SAMPLER_2D_MULTISAMPLE) { //this here is a texture glUniform1i(location, mActiveTextureChannels); -- cgit v1.2.3 From 6b3198347f0b48738d3ebaab2c415f1d12cd525f Mon Sep 17 00:00:00 2001 From: Erik Kundiman Date: Wed, 6 Sep 2023 10:51:41 +0800 Subject: Lose the _ARB suffix from many macros so the macros can be used on platforms that don't have ARB specs. --- indra/llrender/llatmosphere.cpp | 8 ++--- indra/llrender/llcubemap.cpp | 12 +++---- indra/llrender/llgl.cpp | 6 ++-- indra/llrender/llrender.cpp | 18 +++++----- indra/llrender/llshadermgr.cpp | 8 ++--- indra/llrender/llvertexbuffer.cpp | 76 +++++++++++++++++++-------------------- indra/llrender/llvertexbuffer.h | 2 +- 7 files changed, 65 insertions(+), 65 deletions(-) (limited to 'indra') diff --git a/indra/llrender/llatmosphere.cpp b/indra/llrender/llatmosphere.cpp index ffc17c89f8..8e37ca9b90 100644 --- a/indra/llrender/llatmosphere.cpp +++ b/indra/llrender/llatmosphere.cpp @@ -241,7 +241,7 @@ LLGLTexture* LLAtmosphere::getTransmittance() m_transmittance->generateGLTexture(); m_transmittance->setAddressMode(LLTexUnit::eTextureAddressMode::TAM_CLAMP); m_transmittance->setFilteringOption(LLTexUnit::eTextureFilterOptions::TFO_BILINEAR); - m_transmittance->setExplicitFormat(GL_RGB32F_ARB, GL_RGB, GL_FLOAT); + m_transmittance->setExplicitFormat(GL_RGB32F, GL_RGB, GL_FLOAT); m_transmittance->setTarget(GL_TEXTURE_2D, LLTexUnit::TT_TEXTURE); } return m_transmittance; @@ -255,7 +255,7 @@ LLGLTexture* LLAtmosphere::getScattering() m_scattering->generateGLTexture(); m_scattering->setAddressMode(LLTexUnit::eTextureAddressMode::TAM_CLAMP); m_scattering->setFilteringOption(LLTexUnit::eTextureFilterOptions::TFO_BILINEAR); - m_scattering->setExplicitFormat(GL_RGB16F_ARB, GL_RGB, GL_FLOAT); + m_scattering->setExplicitFormat(GL_RGB16F, GL_RGB, GL_FLOAT); m_scattering->setTarget(GL_TEXTURE_3D, LLTexUnit::TT_TEXTURE_3D); } return m_scattering; @@ -269,7 +269,7 @@ LLGLTexture* LLAtmosphere::getMieScattering() m_mie_scatter_texture->generateGLTexture(); m_mie_scatter_texture->setAddressMode(LLTexUnit::eTextureAddressMode::TAM_CLAMP); m_mie_scatter_texture->setFilteringOption(LLTexUnit::eTextureFilterOptions::TFO_BILINEAR); - m_mie_scatter_texture->setExplicitFormat(GL_RGB16F_ARB, GL_RGB, GL_FLOAT); + m_mie_scatter_texture->setExplicitFormat(GL_RGB16F, GL_RGB, GL_FLOAT); m_mie_scatter_texture->setTarget(GL_TEXTURE_3D, LLTexUnit::TT_TEXTURE_3D); } return m_mie_scatter_texture; @@ -283,7 +283,7 @@ LLGLTexture* LLAtmosphere::getIlluminance() m_illuminance->generateGLTexture(); m_illuminance->setAddressMode(LLTexUnit::eTextureAddressMode::TAM_CLAMP); m_illuminance->setFilteringOption(LLTexUnit::eTextureFilterOptions::TFO_BILINEAR); - m_illuminance->setExplicitFormat(GL_RGB32F_ARB, GL_RGB, GL_FLOAT); + m_illuminance->setExplicitFormat(GL_RGB32F, GL_RGB, GL_FLOAT); m_illuminance->setTarget(GL_TEXTURE_2D, LLTexUnit::TT_TEXTURE); } return m_illuminance; diff --git a/indra/llrender/llcubemap.cpp b/indra/llrender/llcubemap.cpp index 834084674e..ad2a4203ba 100644 --- a/indra/llrender/llcubemap.cpp +++ b/indra/llrender/llcubemap.cpp @@ -50,12 +50,12 @@ LLCubeMap::LLCubeMap(bool init_as_srgb) mMatrixStage(0), mIssRGB(init_as_srgb) { - mTargets[0] = GL_TEXTURE_CUBE_MAP_NEGATIVE_X_ARB; - mTargets[1] = GL_TEXTURE_CUBE_MAP_POSITIVE_X_ARB; - mTargets[2] = GL_TEXTURE_CUBE_MAP_NEGATIVE_Y_ARB; - mTargets[3] = GL_TEXTURE_CUBE_MAP_POSITIVE_Y_ARB; - mTargets[4] = GL_TEXTURE_CUBE_MAP_NEGATIVE_Z_ARB; - mTargets[5] = GL_TEXTURE_CUBE_MAP_POSITIVE_Z_ARB; + mTargets[0] = GL_TEXTURE_CUBE_MAP_NEGATIVE_X; + mTargets[1] = GL_TEXTURE_CUBE_MAP_POSITIVE_X; + mTargets[2] = GL_TEXTURE_CUBE_MAP_NEGATIVE_Y; + mTargets[3] = GL_TEXTURE_CUBE_MAP_POSITIVE_Y; + mTargets[4] = GL_TEXTURE_CUBE_MAP_NEGATIVE_Z; + mTargets[5] = GL_TEXTURE_CUBE_MAP_POSITIVE_Z; } LLCubeMap::~LLCubeMap() diff --git a/indra/llrender/llgl.cpp b/indra/llrender/llgl.cpp index 729e8a5f28..6ae5b0e94b 100644 --- a/indra/llrender/llgl.cpp +++ b/indra/llrender/llgl.cpp @@ -720,7 +720,7 @@ bool LLGLManager::initGL() stop_glerror(); GLint num_tex_image_units; - glGetIntegerv(GL_MAX_TEXTURE_IMAGE_UNITS_ARB, &num_tex_image_units); + glGetIntegerv(GL_MAX_TEXTURE_IMAGE_UNITS, &num_tex_image_units); mNumTextureImageUnits = llmin(num_tex_image_units, 32); if (mHasMultitexture) @@ -1593,8 +1593,8 @@ void LLGLState::initClass() // sStateMap[GL_TEXTURE_2D] = GL_TRUE; //make sure multisample defaults to disabled - sStateMap[GL_MULTISAMPLE_ARB] = GL_FALSE; - glDisable(GL_MULTISAMPLE_ARB); + sStateMap[GL_MULTISAMPLE_EXT] = GL_FALSE; + glDisable(GL_MULTISAMPLE_EXT); } //static diff --git a/indra/llrender/llrender.cpp b/indra/llrender/llrender.cpp index 84ef895ee4..7c6b091ac5 100644 --- a/indra/llrender/llrender.cpp +++ b/indra/llrender/llrender.cpp @@ -72,7 +72,7 @@ static const GLenum sGLTextureType[] = #if GL_VERSION_3_1 GL_TEXTURE_RECTANGLE_ARB, #endif - GL_TEXTURE_CUBE_MAP_ARB, + GL_TEXTURE_CUBE_MAP, #if GL_VERSION_3_2 GL_TEXTURE_2D_MULTISAMPLE, #endif @@ -126,7 +126,7 @@ void LLTexUnit::refreshState(void) gGL.flush(); - glActiveTexture(GL_TEXTURE0_ARB + mIndex); + glActiveTexture(GL_TEXTURE0 + mIndex); if (mCurrTexType != TT_NONE) { @@ -147,7 +147,7 @@ void LLTexUnit::activate(void) if ((S32)gGL.mCurrTextureUnitIndex != mIndex || gGL.mDirty) { gGL.flush(); - glActiveTexture(GL_TEXTURE0_ARB + mIndex); + glActiveTexture(GL_TEXTURE0 + mIndex); gGL.mCurrTextureUnitIndex = mIndex; } } @@ -191,7 +191,7 @@ void LLTexUnit::bindFast(LLTexture* texture) { LLImageGL* gl_tex = texture->getGLTexture(); - glActiveTexture(GL_TEXTURE0_ARB + mIndex); + glActiveTexture(GL_TEXTURE0 + mIndex); gGL.mCurrTextureUnitIndex = mIndex; mCurrTexture = gl_tex->getTexName(); if (!mCurrTexture) @@ -343,7 +343,7 @@ bool LLTexUnit::bind(LLCubeMap* cubeMap) activate(); enable(LLTexUnit::TT_CUBE_MAP); mCurrTexture = cubeMap->mImages[0]->getTexName(); - glBindTexture(GL_TEXTURE_CUBE_MAP_ARB, mCurrTexture); + glBindTexture(GL_TEXTURE_CUBE_MAP, mCurrTexture); mHasMipMaps = cubeMap->mImages[0]->mHasMipMaps; cubeMap->mImages[0]->updateBindStats(cubeMap->mImages[0]->mTextureMemory); if (cubeMap->mImages[0]->mTexOptionsDirty) @@ -473,7 +473,7 @@ void LLTexUnit::setTextureAddressMode(eTextureAddressMode mode) glTexParameteri (sGLTextureType[mCurrTexType], GL_TEXTURE_WRAP_T, sGLAddressMode[mode]); if (mCurrTexType == TT_CUBE_MAP) { - glTexParameteri (GL_TEXTURE_CUBE_MAP_ARB, GL_TEXTURE_WRAP_R, sGLAddressMode[mode]); + glTexParameteri (GL_TEXTURE_CUBE_MAP, GL_TEXTURE_WRAP_R, sGLAddressMode[mode]); } } @@ -650,10 +650,10 @@ void LLTexUnit::debugTextureUnit(void) if (mIndex < 0) return; GLint activeTexture; - glGetIntegerv(GL_ACTIVE_TEXTURE_ARB, &activeTexture); - if ((GL_TEXTURE0_ARB + mIndex) != activeTexture) + glGetIntegerv(GL_ACTIVE_TEXTURE, &activeTexture); + if ((GL_TEXTURE0 + mIndex) != activeTexture) { - U32 set_unit = (activeTexture - GL_TEXTURE0_ARB); + U32 set_unit = (activeTexture - GL_TEXTURE0); LL_WARNS() << "Incorrect Texture Unit! Expected: " << set_unit << " Actual: " << mIndex << LL_ENDL; } } diff --git a/indra/llrender/llshadermgr.cpp b/indra/llrender/llshadermgr.cpp index ff547d9d47..bb3ded0229 100644 --- a/indra/llrender/llshadermgr.cpp +++ b/indra/llrender/llshadermgr.cpp @@ -748,7 +748,7 @@ GLuint LLShaderMgr::loadShaderFile(const std::string& filename, S32 & shader_lev extra_code_text[extra_code_count++] = strdup("#define ATTRIBUTE in\n"); - if (type == GL_VERTEX_SHADER_ARB) + if (type == GL_VERTEX_SHADER) { //"varying" state is "out" in a vertex program, "in" in a fragment program // ("varying" is deprecated after version 1.20) extra_code_text[extra_code_count++] = strdup("#define VARYING out\n"); @@ -787,7 +787,7 @@ GLuint LLShaderMgr::loadShaderFile(const std::string& filename, S32 & shader_lev extra_code_text[extra_code_count++] = strdup( "#define IS_AMD_CARD 1\n" ); } - if (texture_index_channels > 0 && type == GL_FRAGMENT_SHADER_ARB) + if (texture_index_channels > 0 && type == GL_FRAGMENT_SHADER) { //use specified number of texture channels for indexed texture rendering @@ -1022,10 +1022,10 @@ GLuint LLShaderMgr::loadShaderFile(const std::string& filename, S32 & shader_lev if (ret) { // Add shader file to map - if (type == GL_VERTEX_SHADER_ARB) { + if (type == GL_VERTEX_SHADER) { mVertexShaderObjects[filename] = ret; } - else if (type == GL_FRAGMENT_SHADER_ARB) { + else if (type == GL_FRAGMENT_SHADER) { mFragmentShaderObjects[filename] = ret; } shader_level = try_gpu_class; diff --git a/indra/llrender/llvertexbuffer.cpp b/indra/llrender/llvertexbuffer.cpp index 44107d2957..1893764cab 100644 --- a/indra/llrender/llvertexbuffer.cpp +++ b/indra/llrender/llvertexbuffer.cpp @@ -83,11 +83,11 @@ const U32 LL_VBO_POOL_SEED_COUNT = vbo_block_index(LL_VBO_POOL_MAX_SEED_SIZE); //============================================================================ //static -LLVBOPool LLVertexBuffer::sStreamVBOPool(GL_STREAM_DRAW_ARB, GL_ARRAY_BUFFER_ARB); -LLVBOPool LLVertexBuffer::sDynamicVBOPool(GL_DYNAMIC_DRAW_ARB, GL_ARRAY_BUFFER_ARB); -LLVBOPool LLVertexBuffer::sDynamicCopyVBOPool(GL_DYNAMIC_COPY_ARB, GL_ARRAY_BUFFER_ARB); -LLVBOPool LLVertexBuffer::sStreamIBOPool(GL_STREAM_DRAW_ARB, GL_ELEMENT_ARRAY_BUFFER_ARB); -LLVBOPool LLVertexBuffer::sDynamicIBOPool(GL_DYNAMIC_DRAW_ARB, GL_ELEMENT_ARRAY_BUFFER_ARB); +LLVBOPool LLVertexBuffer::sStreamVBOPool(GL_STREAM_DRAW, GL_ARRAY_BUFFER); +LLVBOPool LLVertexBuffer::sDynamicVBOPool(GL_DYNAMIC_DRAW, GL_ARRAY_BUFFER); +LLVBOPool LLVertexBuffer::sDynamicCopyVBOPool(GL_DYNAMIC_COPY, GL_ARRAY_BUFFER); +LLVBOPool LLVertexBuffer::sStreamIBOPool(GL_STREAM_DRAW, GL_ELEMENT_ARRAY_BUFFER); +LLVBOPool LLVertexBuffer::sDynamicIBOPool(GL_DYNAMIC_DRAW, GL_ELEMENT_ARRAY_BUFFER); U32 LLVBOPool::sBytesPooled = 0; U32 LLVBOPool::sIndexBytesPooled = 0; @@ -183,7 +183,7 @@ U8* LLVBOPool::allocate(U32& name, U32 size, bool for_seed) mMissCount[i]++; } - if (mType == GL_ARRAY_BUFFER_ARB) + if (mType == GL_ARRAY_BUFFER) { LLVertexBuffer::sAllocatedBytes += size; } @@ -192,10 +192,10 @@ U8* LLVBOPool::allocate(U32& name, U32 size, bool for_seed) LLVertexBuffer::sAllocatedIndexBytes += size; } - if (LLVertexBuffer::sDisableVBOMapping || mUsage != GL_DYNAMIC_DRAW_ARB) + if (LLVertexBuffer::sDisableVBOMapping || mUsage != GL_DYNAMIC_DRAW) { glBufferData(mType, size, 0, mUsage); - if (mUsage != GL_DYNAMIC_COPY_ARB) + if (mUsage != GL_DYNAMIC_COPY) { //data will be provided by application ret = (U8*) ll_aligned_malloc<64>(size); if (!ret) @@ -225,7 +225,7 @@ U8* LLVBOPool::allocate(U32& name, U32 size, bool for_seed) rec.mGLName = name; rec.mClientData = ret; - if (mType == GL_ARRAY_BUFFER_ARB) + if (mType == GL_ARRAY_BUFFER) { sBytesPooled += size; } @@ -241,7 +241,7 @@ U8* LLVBOPool::allocate(U32& name, U32 size, bool for_seed) name = mFreeList[i].front().mGLName; ret = mFreeList[i].front().mClientData; - if (mType == GL_ARRAY_BUFFER_ARB) + if (mType == GL_ARRAY_BUFFER) { sBytesPooled -= size; } @@ -263,7 +263,7 @@ void LLVBOPool::release(U32 name, U8* buffer, U32 size) deleteBuffer(name); ll_aligned_free_fallback((U8*) buffer); - if (mType == GL_ARRAY_BUFFER_ARB) + if (mType == GL_ARRAY_BUFFER) { LLVertexBuffer::sAllocatedBytes -= size; } @@ -322,7 +322,7 @@ void LLVBOPool::cleanup() l.pop_front(); - if (mType == GL_ARRAY_BUFFER_ARB) + if (mType == GL_ARRAY_BUFFER) { sBytesPooled -= size; LLVertexBuffer::sAllocatedBytes -= size; @@ -606,7 +606,7 @@ void LLVertexBuffer::drawRange(U32 mode, U32 start, U32 end, U32 count, U32 indi if (gDebugGL && !mGLArray && useVBOs()) { GLint elem = 0; - glGetIntegerv(GL_ELEMENT_ARRAY_BUFFER_BINDING_ARB, &elem); + glGetIntegerv(GL_ELEMENT_ARRAY_BUFFER_BINDING, &elem); if (elem != mGLIndices) { @@ -805,32 +805,32 @@ S32 LLVertexBuffer::determineUsage(S32 usage) ret_usage = 0; } - if (ret_usage == GL_STREAM_DRAW_ARB && !sUseStreamDraw) + if (ret_usage == GL_STREAM_DRAW && !sUseStreamDraw) { ret_usage = 0; } - if (ret_usage == GL_DYNAMIC_DRAW_ARB && sPreferStreamDraw) + if (ret_usage == GL_DYNAMIC_DRAW && sPreferStreamDraw) { - ret_usage = GL_STREAM_DRAW_ARB; + ret_usage = GL_STREAM_DRAW; } if (ret_usage == 0 && LLRender::sGLCoreProfile) { //MUST use VBOs for all rendering - ret_usage = GL_STREAM_DRAW_ARB; + ret_usage = GL_STREAM_DRAW; } - if (ret_usage && ret_usage != GL_STREAM_DRAW_ARB) + if (ret_usage && ret_usage != GL_STREAM_DRAW) { //only stream_draw and dynamic_draw are supported when using VBOs, dynamic draw is the default - if (ret_usage != GL_DYNAMIC_COPY_ARB) + if (ret_usage != GL_DYNAMIC_COPY) { if (sDisableVBOMapping) { //always use stream draw if VBO mapping is disabled - ret_usage = GL_STREAM_DRAW_ARB; + ret_usage = GL_STREAM_DRAW; } else { - ret_usage = GL_DYNAMIC_DRAW_ARB; + ret_usage = GL_DYNAMIC_DRAW; } } } @@ -863,7 +863,7 @@ LLVertexBuffer::LLVertexBuffer(U32 typemask, S32 usage) mMappable(false), mFence(NULL) { - mMappable = (mUsage == GL_DYNAMIC_DRAW_ARB && !sDisableVBOMapping); + mMappable = (mUsage == GL_DYNAMIC_DRAW && !sDisableVBOMapping); //zero out offsets for (U32 i = 0; i < TYPE_MAX; i++) @@ -986,11 +986,11 @@ void LLVertexBuffer::genBuffer(U32 size) { mSize = vbo_block_size(size); - if (mUsage == GL_STREAM_DRAW_ARB) + if (mUsage == GL_STREAM_DRAW) { mMappedData = sStreamVBOPool.allocate(mGLBuffer, mSize); } - else if (mUsage == GL_DYNAMIC_DRAW_ARB) + else if (mUsage == GL_DYNAMIC_DRAW) { mMappedData = sDynamicVBOPool.allocate(mGLBuffer, mSize); } @@ -1007,7 +1007,7 @@ void LLVertexBuffer::genIndices(U32 size) { mIndicesSize = vbo_block_size(size); - if (mUsage == GL_STREAM_DRAW_ARB) + if (mUsage == GL_STREAM_DRAW) { mMappedIndexData = sStreamIBOPool.allocate(mGLIndices, mIndicesSize); } @@ -1021,7 +1021,7 @@ void LLVertexBuffer::genIndices(U32 size) void LLVertexBuffer::releaseBuffer() { - if (mUsage == GL_STREAM_DRAW_ARB) + if (mUsage == GL_STREAM_DRAW) { sStreamVBOPool.release(mGLBuffer, mMappedData, mSize); } @@ -1038,7 +1038,7 @@ void LLVertexBuffer::releaseBuffer() void LLVertexBuffer::releaseIndices() { - if (mUsage == GL_STREAM_DRAW_ARB) + if (mUsage == GL_STREAM_DRAW) { sStreamIBOPool.release(mGLIndices, mMappedIndexData, mIndicesSize); } @@ -1503,7 +1503,7 @@ U8* LLVertexBuffer::mapVertexBuffer(S32 type, S32 index, S32 count, bool map_ran #ifdef GL_ARB_map_buffer_range S32 offset = mOffsets[type] + sTypeSize[type]*index; S32 length = (sTypeSize[type]*count+0xF) & ~0xF; - src = (U8*) glMapBufferRange(GL_ARRAY_BUFFER_ARB, offset, length, + src = (U8*) glMapBufferRange(GL_ARRAY_BUFFER, offset, length, GL_MAP_WRITE_BIT | GL_MAP_FLUSH_EXPLICIT_BIT | GL_MAP_INVALIDATE_RANGE_BIT); @@ -1524,7 +1524,7 @@ U8* LLVertexBuffer::mapVertexBuffer(S32 type, S32 index, S32 count, bool map_ran } } - src = (U8*) glMapBufferRange(GL_ARRAY_BUFFER_ARB, 0, mSize, + src = (U8*) glMapBufferRange(GL_ARRAY_BUFFER, 0, mSize, GL_MAP_WRITE_BIT | GL_MAP_FLUSH_EXPLICIT_BIT); #endif @@ -1577,7 +1577,7 @@ U8* LLVertexBuffer::mapVertexBuffer(S32 type, S32 index, S32 count, bool map_ran //-------------------- GLint buff; - glGetIntegerv(GL_ARRAY_BUFFER_BINDING_ARB, &buff); + glGetIntegerv(GL_ARRAY_BUFFER_BINDING, &buff); if ((GLuint)buff != mGLBuffer) { LL_ERRS() << "Invalid GL vertex buffer bound: " << buff << LL_ENDL; @@ -1665,7 +1665,7 @@ U8* LLVertexBuffer::mapIndexBuffer(S32 index, S32 count, bool map_range) if (gDebugGL && useVBOs()) { GLint elem = 0; - glGetIntegerv(GL_ELEMENT_ARRAY_BUFFER_BINDING_ARB, &elem); + glGetIntegerv(GL_ELEMENT_ARRAY_BUFFER_BINDING, &elem); if (elem != mGLIndices) { @@ -1688,7 +1688,7 @@ U8* LLVertexBuffer::mapIndexBuffer(S32 index, S32 count, bool map_range) #ifdef GL_ARB_map_buffer_range S32 offset = sizeof(U16)*index; S32 length = sizeof(U16)*count; - src = (U8*) glMapBufferRange(GL_ELEMENT_ARRAY_BUFFER_ARB, offset, length, + src = (U8*) glMapBufferRange(GL_ELEMENT_ARRAY_BUFFER, offset, length, GL_MAP_WRITE_BIT | GL_MAP_FLUSH_EXPLICIT_BIT | GL_MAP_INVALIDATE_RANGE_BIT); @@ -1697,7 +1697,7 @@ U8* LLVertexBuffer::mapIndexBuffer(S32 index, S32 count, bool map_range) else { #ifdef GL_ARB_map_buffer_range - src = (U8*) glMapBufferRange(GL_ELEMENT_ARRAY_BUFFER_ARB, 0, sizeof(U16)*mNumIndices, + src = (U8*) glMapBufferRange(GL_ELEMENT_ARRAY_BUFFER, 0, sizeof(U16)*mNumIndices, GL_MAP_WRITE_BIT | GL_MAP_FLUSH_EXPLICIT_BIT); #endif @@ -1741,7 +1741,7 @@ U8* LLVertexBuffer::mapIndexBuffer(S32 index, S32 count, bool map_range) if(mMappable) { GLint buff; - glGetIntegerv(GL_ELEMENT_ARRAY_BUFFER_BINDING_ARB, &buff); + glGetIntegerv(GL_ELEMENT_ARRAY_BUFFER_BINDING, &buff); if ((GLuint)buff != mGLIndices) { LL_ERRS() << "Invalid GL index buffer bound: " << buff << LL_ENDL; @@ -1837,7 +1837,7 @@ void LLVertexBuffer::unmapBuffer() if (gGLManager.mHasMapBufferRange) { #ifdef GL_ARB_map_buffer_range - glFlushMappedBufferRange(GL_ARRAY_BUFFER_ARB, offset, length); + glFlushMappedBufferRange(GL_ARRAY_BUFFER, offset, length); #endif } else if (gGLManager.mHasFlushBufferRange) @@ -1917,7 +1917,7 @@ void LLVertexBuffer::unmapBuffer() if (gGLManager.mHasMapBufferRange) { #ifdef GL_ARB_map_buffer_range - glFlushMappedBufferRange(GL_ELEMENT_ARRAY_BUFFER_ARB, offset, length); + glFlushMappedBufferRange(GL_ELEMENT_ARRAY_BUFFER, offset, length); #endif } else if (gGLManager.mHasFlushBufferRange) @@ -2258,7 +2258,7 @@ void LLVertexBuffer::setBuffer(U32 data_mask) if (gDebugGL && !mGLArray) { GLint buff; - glGetIntegerv(GL_ARRAY_BUFFER_BINDING_ARB, &buff); + glGetIntegerv(GL_ARRAY_BUFFER_BINDING, &buff); if ((GLuint)buff != mGLBuffer) { if (gDebugSession) @@ -2273,7 +2273,7 @@ void LLVertexBuffer::setBuffer(U32 data_mask) if (mGLIndices) { - glGetIntegerv(GL_ELEMENT_ARRAY_BUFFER_BINDING_ARB, &buff); + glGetIntegerv(GL_ELEMENT_ARRAY_BUFFER_BINDING, &buff); if ((GLuint)buff != mGLIndices) { if (gDebugSession) diff --git a/indra/llrender/llvertexbuffer.h b/indra/llrender/llvertexbuffer.h index 3b3fe44984..1dbf271436 100644 --- a/indra/llrender/llvertexbuffer.h +++ b/indra/llrender/llvertexbuffer.h @@ -287,7 +287,7 @@ public: U8* getMappedIndices() const { return mMappedIndexData; } S32 getOffset(S32 type) const { return mOffsets[type]; } S32 getUsage() const { return mUsage; } - bool isWriteable() const { return (mMappable || mUsage == GL_STREAM_DRAW_ARB) ? true : false; } + bool isWriteable() const { return (mMappable || mUsage == GL_STREAM_DRAW) ? true : false; } void draw(U32 mode, U32 count, U32 indices_offset) const; void drawArrays(U32 mode, U32 offset, U32 count) const; -- cgit v1.2.3 From 08a5f59f058ed362e287b1655a3c8c6efccd4abd Mon Sep 17 00:00:00 2001 From: Erik Kundiman Date: Wed, 6 Sep 2023 11:00:15 +0800 Subject: Khronos debug as an alternative to ARB's --- indra/llrender/llgl.cpp | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) (limited to 'indra') diff --git a/indra/llrender/llgl.cpp b/indra/llrender/llgl.cpp index 6ae5b0e94b..88e07972ff 100644 --- a/indra/llrender/llgl.cpp +++ b/indra/llrender/llgl.cpp @@ -72,7 +72,7 @@ static const std::string HEADLESS_VERSION_STRING("1.0"); llofstream gFailLog; -#if GL_ARB_debug_output +#if GL_ARB_debug_output || GL_KHR_debug #ifndef APIENTRY #define APIENTRY @@ -86,14 +86,24 @@ void APIENTRY gl_debug_callback(GLenum source, const GLchar* message, GLvoid* userParam) { +#if GL_ARB_debug_output if (severity != GL_DEBUG_SEVERITY_HIGH_ARB && severity != GL_DEBUG_SEVERITY_MEDIUM_ARB && severity != GL_DEBUG_SEVERITY_LOW_ARB) +#elif GL_KHR_debug + if (severity != GL_DEBUG_SEVERITY_HIGH_KHR && + severity != GL_DEBUG_SEVERITY_MEDIUM_KHR && + severity != GL_DEBUG_SEVERITY_LOW_KHR) +#endif { //suppress out-of-spec messages sent by nvidia driver (mostly vertexbuffer hints) return; } +#if GL_ARB_debug_output if (severity == GL_DEBUG_SEVERITY_HIGH_ARB) +#elif GL_KHR_debug + if (severity == GL_DEBUG_SEVERITY_HIGH_KHR) +#endif { LL_WARNS() << "----- GL ERROR --------" << LL_ENDL; } @@ -106,7 +116,11 @@ void APIENTRY gl_debug_callback(GLenum source, LL_WARNS() << "Severity: " << std::hex << severity << LL_ENDL; LL_WARNS() << "Message: " << message << LL_ENDL; LL_WARNS() << "-----------------------" << LL_ENDL; +#if GL_ARB_debug_output if (severity == GL_DEBUG_SEVERITY_HIGH_ARB) +#elif GL_KHR_debug + if (severity == GL_DEBUG_SEVERITY_HIGH_KHR) +#endif { LL_ERRS() << "Halting on GL Error" << LL_ENDL; } @@ -1060,7 +1074,11 @@ void LLGLManager::initExtensions() mHasBlendFuncSeparate = ExtensionExists("GL_EXT_blend_func_separate", gGLHExts.mSysExts); mHasTextureRectangle = ExtensionExists("GL_ARB_texture_rectangle", gGLHExts.mSysExts); mHasTextureMultisample = ExtensionExists("GL_ARB_texture_multisample", gGLHExts.mSysExts); +#if GL_ARB_debug_output mHasDebugOutput = ExtensionExists("GL_ARB_debug_output", gGLHExts.mSysExts); +#else + mHasDebugOutput = ExtensionExists("GL_KHR_debug", gGLHExts.mSysExts); +#endif mHasTransformFeedback = mGLVersion >= 4.f ? TRUE : FALSE; #if !LL_DARWIN mHasPointParameters = ExtensionExists("GL_ARB_point_parameters", gGLHExts.mSysExts); -- cgit v1.2.3 From 4daff432fcc2272b8d32bd78d3ae47780cc3edca Mon Sep 17 00:00:00 2001 From: Erik Kundiman Date: Wed, 6 Sep 2023 11:07:31 +0800 Subject: Core profile glBlendFuncSeparate replacing its EXT suffixed counterpart. --- indra/llrender/llrender.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'indra') diff --git a/indra/llrender/llrender.cpp b/indra/llrender/llrender.cpp index 7c6b091ac5..eb1c7dcee9 100644 --- a/indra/llrender/llrender.cpp +++ b/indra/llrender/llrender.cpp @@ -1505,7 +1505,7 @@ void LLRender::blendFunc(eBlendFactor color_sfactor, eBlendFactor color_dfactor, mCurrBlendColorDFactor = color_dfactor; mCurrBlendAlphaDFactor = alpha_dfactor; flush(); - glBlendFuncSeparateEXT(sGLBlendFactor[color_sfactor], sGLBlendFactor[color_dfactor], + glBlendFuncSeparate(sGLBlendFactor[color_sfactor], sGLBlendFactor[color_dfactor], sGLBlendFactor[alpha_sfactor], sGLBlendFactor[alpha_dfactor]); } } -- cgit v1.2.3 From 623456626ffbb08dff208cf35dd3ac5df6755a37 Mon Sep 17 00:00:00 2001 From: Erik Kundiman Date: Wed, 6 Sep 2023 11:12:42 +0800 Subject: Always compile vertex array code So that, especially modern, GL implementations that do have vertex array but don't have the legacy GL_ARB_vertex_array_object defined have such code compiled too. --- indra/llrender/llrender.cpp | 4 ++-- indra/llrender/llvertexbuffer.cpp | 28 ++++++++++++++-------------- 2 files changed, 16 insertions(+), 16 deletions(-) (limited to 'indra') diff --git a/indra/llrender/llrender.cpp b/indra/llrender/llrender.cpp index eb1c7dcee9..f34161980a 100644 --- a/indra/llrender/llrender.cpp +++ b/indra/llrender/llrender.cpp @@ -902,11 +902,11 @@ void LLRender::init(bool needs_vertex_buffer) if (sGLCoreProfile && !LLVertexBuffer::sUseVAO) { //bind a dummy vertex array object so we're core profile compliant -#ifdef GL_ARB_vertex_array_object +//#ifdef GL_ARB_vertex_array_object U32 ret; glGenVertexArrays(1, &ret); glBindVertexArray(ret); -#endif +//#endif } if (needs_vertex_buffer) diff --git a/indra/llrender/llvertexbuffer.cpp b/indra/llrender/llvertexbuffer.cpp index 1893764cab..6cc6078ec8 100644 --- a/indra/llrender/llvertexbuffer.cpp +++ b/indra/llrender/llvertexbuffer.cpp @@ -403,9 +403,9 @@ U32 LLVertexBuffer::getVAOName() } else { -#ifdef GL_ARB_vertex_array_object +//#ifdef GL_ARB_vertex_array_object glGenVertexArrays(1, &ret); -#endif +//#endif } return ret; @@ -757,9 +757,9 @@ void LLVertexBuffer::unbind() { if (sGLRenderArray) { -#if GL_ARB_vertex_array_object +//#if GL_ARB_vertex_array_object glBindVertexArray(0); -#endif +//#endif sGLRenderArray = 0; sGLRenderIndices = 0; sIBOActive = false; @@ -927,9 +927,9 @@ LLVertexBuffer::~LLVertexBuffer() if (mGLArray) { -#if GL_ARB_vertex_array_object +//#if GL_ARB_vertex_array_object releaseVAOName(mGLArray); -#endif +//#endif } sCount--; @@ -1240,9 +1240,9 @@ bool LLVertexBuffer::allocateBuffer(S32 nverts, S32 nindices, bool create) if (gGLManager.mHasVertexArrayObject && useVBOs() && sUseVAO) { -#if GL_ARB_vertex_array_object +//#if GL_ARB_vertex_array_object mGLArray = getVAOName(); -#endif +//#endif setupVertexArray(); } } @@ -1258,9 +1258,9 @@ void LLVertexBuffer::setupVertexArray() } LL_PROFILE_ZONE_SCOPED_CATEGORY_VERTEX; -#if GL_ARB_vertex_array_object +//#if GL_ARB_vertex_array_object glBindVertexArray(mGLArray); -#endif +//#endif sGLRenderArray = mGLArray; static const U32 attrib_size[] = @@ -2064,9 +2064,9 @@ bool LLVertexBuffer::bindGLArray() { { LL_PROFILE_ZONE_SCOPED_CATEGORY_VERTEX; -#if GL_ARB_vertex_array_object +//#if GL_ARB_vertex_array_object glBindVertexArray(mGLArray); -#endif +//#endif sGLRenderArray = mGLArray; } @@ -2294,9 +2294,9 @@ void LLVertexBuffer::setBuffer(U32 data_mask) { if (sGLRenderArray) { -#if GL_ARB_vertex_array_object +//#if GL_ARB_vertex_array_object glBindVertexArray(0); -#endif +//#endif sGLRenderArray = 0; sGLRenderIndices = 0; sIBOActive = false; -- cgit v1.2.3 From 2d2ffc878a88d9f83689c39883054dbefd1ea82c Mon Sep 17 00:00:00 2001 From: Erik Kundiman Date: Wed, 6 Sep 2023 11:22:32 +0800 Subject: Disable glBufferParameteriAPPLE use --- indra/llrender/llvertexbuffer.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'indra') diff --git a/indra/llrender/llvertexbuffer.cpp b/indra/llrender/llvertexbuffer.cpp index 6cc6078ec8..4d8c850727 100644 --- a/indra/llrender/llvertexbuffer.cpp +++ b/indra/llrender/llvertexbuffer.cpp @@ -1534,11 +1534,13 @@ U8* LLVertexBuffer::mapVertexBuffer(S32 type, S32 index, S32 count, bool map_ran { if (map_range) { +/* #ifndef LL_MESA_HEADLESS glBufferParameteriAPPLE(GL_ARRAY_BUFFER_ARB, GL_BUFFER_SERIALIZED_MODIFY_APPLE, GL_FALSE); glBufferParameteriAPPLE(GL_ARRAY_BUFFER_ARB, GL_BUFFER_FLUSHING_UNMAP_APPLE, GL_FALSE); - src = (U8*) glMapBuffer(GL_ARRAY_BUFFER, GL_WRITE_ONLY); #endif +*/ + src = (U8*) glMapBuffer(GL_ARRAY_BUFFER, GL_WRITE_ONLY); } else { @@ -1707,11 +1709,13 @@ U8* LLVertexBuffer::mapIndexBuffer(S32 index, S32 count, bool map_range) { if (map_range) { +/* #ifndef LL_MESA_HEADLESS glBufferParameteriAPPLE(GL_ELEMENT_ARRAY_BUFFER_ARB, GL_BUFFER_SERIALIZED_MODIFY_APPLE, GL_FALSE); glBufferParameteriAPPLE(GL_ELEMENT_ARRAY_BUFFER_ARB, GL_BUFFER_FLUSHING_UNMAP_APPLE, GL_FALSE); - src = (U8*) glMapBuffer(GL_ELEMENT_ARRAY_BUFFER, GL_WRITE_ONLY); #endif +*/ + src = (U8*) glMapBuffer(GL_ELEMENT_ARRAY_BUFFER, GL_WRITE_ONLY); } else { -- cgit v1.2.3 From ba2d401017b6b32a7224f09671d27600da17d499 Mon Sep 17 00:00:00 2001 From: Erik Kundiman Date: Wed, 6 Sep 2023 11:28:45 +0800 Subject: GL_EXT_map_buffer_range as an alternative to ARB's --- indra/llrender/llvertexbuffer.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'indra') diff --git a/indra/llrender/llvertexbuffer.cpp b/indra/llrender/llvertexbuffer.cpp index 4d8c850727..c8d6d16c1a 100644 --- a/indra/llrender/llvertexbuffer.cpp +++ b/indra/llrender/llvertexbuffer.cpp @@ -1500,7 +1500,7 @@ U8* LLVertexBuffer::mapVertexBuffer(S32 type, S32 index, S32 count, bool map_ran { if (map_range) { -#ifdef GL_ARB_map_buffer_range +#if GL_ARB_map_buffer_range || GL_EXT_map_buffer_range S32 offset = mOffsets[type] + sTypeSize[type]*index; S32 length = (sTypeSize[type]*count+0xF) & ~0xF; src = (U8*) glMapBufferRange(GL_ARRAY_BUFFER, offset, length, @@ -1511,7 +1511,7 @@ U8* LLVertexBuffer::mapVertexBuffer(S32 type, S32 index, S32 count, bool map_ran } else { -#ifdef GL_ARB_map_buffer_range +#if GL_ARB_map_buffer_range || GL_EXT_map_buffer_range if (gDebugGL) { @@ -1687,7 +1687,7 @@ U8* LLVertexBuffer::mapIndexBuffer(S32 index, S32 count, bool map_range) { if (map_range) { -#ifdef GL_ARB_map_buffer_range +#if GL_ARB_map_buffer_range || GL_EXT_map_buffer_range S32 offset = sizeof(U16)*index; S32 length = sizeof(U16)*count; src = (U8*) glMapBufferRange(GL_ELEMENT_ARRAY_BUFFER, offset, length, @@ -1698,7 +1698,7 @@ U8* LLVertexBuffer::mapIndexBuffer(S32 index, S32 count, bool map_range) } else { -#ifdef GL_ARB_map_buffer_range +#if GL_ARB_map_buffer_range || GL_EXT_map_buffer_range src = (U8*) glMapBufferRange(GL_ELEMENT_ARRAY_BUFFER, 0, sizeof(U16)*mNumIndices, GL_MAP_WRITE_BIT | GL_MAP_FLUSH_EXPLICIT_BIT); @@ -1840,7 +1840,7 @@ void LLVertexBuffer::unmapBuffer() S32 length = sTypeSize[region.mType]*region.mCount; if (gGLManager.mHasMapBufferRange) { -#ifdef GL_ARB_map_buffer_range +#if GL_ARB_map_buffer_range || GL_EXT_map_buffer_range glFlushMappedBufferRange(GL_ARRAY_BUFFER, offset, length); #endif } @@ -1920,7 +1920,7 @@ void LLVertexBuffer::unmapBuffer() S32 length = sizeof(U16)*region.mCount; if (gGLManager.mHasMapBufferRange) { -#ifdef GL_ARB_map_buffer_range +#if GL_ARB_map_buffer_range || GL_EXT_map_buffer_range glFlushMappedBufferRange(GL_ELEMENT_ARRAY_BUFFER, offset, length); #endif } -- cgit v1.2.3 From 7dab57f52b5f34c84b5bba95d5e357e563cacb99 Mon Sep 17 00:00:00 2001 From: Erik Kundiman Date: Wed, 6 Sep 2023 11:32:48 +0800 Subject: Core profile glFlushMappedBufferRange function replacing its APPLE counterpart. --- indra/llrender/llvertexbuffer.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'indra') diff --git a/indra/llrender/llvertexbuffer.cpp b/indra/llrender/llvertexbuffer.cpp index c8d6d16c1a..57c37328c4 100644 --- a/indra/llrender/llvertexbuffer.cpp +++ b/indra/llrender/llvertexbuffer.cpp @@ -1847,7 +1847,7 @@ void LLVertexBuffer::unmapBuffer() else if (gGLManager.mHasFlushBufferRange) { #ifndef LL_MESA_HEADLESS - glFlushMappedBufferRangeAPPLE(GL_ARRAY_BUFFER_ARB, offset, length); + glFlushMappedBufferRange(GL_ARRAY_BUFFER, offset, length); #endif } } -- cgit v1.2.3 From 375a21652ffab95fd0bc65180d4c0d31b87ba264 Mon Sep 17 00:00:00 2001 From: Erik Kundiman Date: Wed, 6 Sep 2023 11:37:18 +0800 Subject: Disable glFlushMappedBufferRangeAPPLE use --- indra/llrender/llvertexbuffer.cpp | 2 ++ 1 file changed, 2 insertions(+) (limited to 'indra') diff --git a/indra/llrender/llvertexbuffer.cpp b/indra/llrender/llvertexbuffer.cpp index 57c37328c4..f71403d2f4 100644 --- a/indra/llrender/llvertexbuffer.cpp +++ b/indra/llrender/llvertexbuffer.cpp @@ -1924,6 +1924,7 @@ void LLVertexBuffer::unmapBuffer() glFlushMappedBufferRange(GL_ELEMENT_ARRAY_BUFFER, offset, length); #endif } + /* else if (gGLManager.mHasFlushBufferRange) { #ifdef GL_APPLE_flush_buffer_range @@ -1932,6 +1933,7 @@ void LLVertexBuffer::unmapBuffer() #endif #endif } + */ stop_glerror(); } -- cgit v1.2.3 From 69805644e058f999c973cc8ef8a24f130105bbe5 Mon Sep 17 00:00:00 2001 From: Erik Kundiman Date: Wed, 6 Sep 2023 11:43:59 +0800 Subject: EXT_disjoint_timer_query as alternative to ARB's --- indra/llrender/llgl.cpp | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'indra') diff --git a/indra/llrender/llgl.cpp b/indra/llrender/llgl.cpp index 88e07972ff..8b5b77196d 100644 --- a/indra/llrender/llgl.cpp +++ b/indra/llrender/llgl.cpp @@ -1033,7 +1033,11 @@ void LLGLManager::initExtensions() mHasARBEnvCombine = ExtensionExists("GL_ARB_texture_env_combine", gGLHExts.mSysExts); mHasCompressedTextures = glh_init_extensions("GL_ARB_texture_compression"); mHasOcclusionQuery = ExtensionExists("GL_ARB_occlusion_query", gGLHExts.mSysExts); +#if GL_ARB_timer_query mHasTimerQuery = ExtensionExists("GL_ARB_timer_query", gGLHExts.mSysExts); +#else + mHasTimerQuery = ExtensionExists("GL_EXT_disjoint_timer_query", gGLHExts.mSysExts); +#endif mHasOcclusionQuery2 = ExtensionExists("GL_ARB_occlusion_query2", gGLHExts.mSysExts); mHasVertexBufferObject = ExtensionExists("GL_ARB_vertex_buffer_object", gGLHExts.mSysExts); mHasVertexArrayObject = ExtensionExists("GL_ARB_vertex_array_object", gGLHExts.mSysExts); -- cgit v1.2.3 From ec43470dff035b834ec797737f12d49bade19a6a Mon Sep 17 00:00:00 2001 From: Erik Kundiman Date: Wed, 6 Sep 2023 11:49:58 +0800 Subject: GL_EXT_draw's can be used for transform feedback --- indra/llrender/llgl.cpp | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'indra') diff --git a/indra/llrender/llgl.cpp b/indra/llrender/llgl.cpp index 8b5b77196d..216b499674 100644 --- a/indra/llrender/llgl.cpp +++ b/indra/llrender/llgl.cpp @@ -1083,7 +1083,11 @@ void LLGLManager::initExtensions() #else mHasDebugOutput = ExtensionExists("GL_KHR_debug", gGLHExts.mSysExts); #endif +#if GL_EXT_draw_transform_feedback + mHasTransformFeedback = ExtensionExists("GL_EXT_draw_transform_feedback", gGLHExts.mSysExts); +#else mHasTransformFeedback = mGLVersion >= 4.f ? TRUE : FALSE; +#endif #if !LL_DARWIN mHasPointParameters = ExtensionExists("GL_ARB_point_parameters", gGLHExts.mSysExts); #endif -- cgit v1.2.3 From ddeca119875c89e42c41b55c77f317b7f6953a5a Mon Sep 17 00:00:00 2001 From: Erik Kundiman Date: Wed, 6 Sep 2023 11:55:32 +0800 Subject: Preprocess anisotropy related code --- indra/llrender/llrender.cpp | 2 ++ 1 file changed, 2 insertions(+) (limited to 'indra') diff --git a/indra/llrender/llrender.cpp b/indra/llrender/llrender.cpp index f34161980a..89de6b93ea 100644 --- a/indra/llrender/llrender.cpp +++ b/indra/llrender/llrender.cpp @@ -519,6 +519,7 @@ void LLTexUnit::setTextureFilteringOption(LLTexUnit::eTextureFilterOptions optio } } +#if GL_EXT_texture_filter_anisotropic if (gGLManager.mHasAnisotropic) { if (LLImageGL::sGlobalUseAnisotropic && option == TFO_ANISOTROPIC) @@ -537,6 +538,7 @@ void LLTexUnit::setTextureFilteringOption(LLTexUnit::eTextureFilterOptions optio glTexParameterf(sGLTextureType[mCurrTexType], GL_TEXTURE_MAX_ANISOTROPY_EXT, 1.f); } } +#endif } GLint LLTexUnit::getTextureSource(eTextureBlendSrc src) -- cgit v1.2.3 From 99eb1b6ca476a52214cf3c214dcf89785bdfa68e Mon Sep 17 00:00:00 2001 From: Erik Kundiman Date: Wed, 6 Sep 2023 12:07:24 +0800 Subject: Check texture compression implementations before compiling its code. --- indra/llrender/llimagegl.cpp | 22 ++++++++++++++++++---- 1 file changed, 18 insertions(+), 4 deletions(-) (limited to 'indra') diff --git a/indra/llrender/llimagegl.cpp b/indra/llrender/llimagegl.cpp index 34f668d1a2..06312e778c 100644 --- a/indra/llrender/llimagegl.cpp +++ b/indra/llrender/llimagegl.cpp @@ -203,12 +203,16 @@ S32 LLImageGL::dataFormatBits(S32 dataformat) { switch (dataformat) { +#if GL_EXT_texture_compression_s3tc || GL_EXT_texture_compression_dxt1 case GL_COMPRESSED_RGBA_S3TC_DXT1_EXT: return 4; - case GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT: return 4; case GL_COMPRESSED_RGBA_S3TC_DXT3_EXT: return 8; - case GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT: return 8; case GL_COMPRESSED_RGBA_S3TC_DXT5_EXT: return 8; +#endif +#if GL_EXT_texture_sRGB || GL_EXT_texture_compression_s3tc_srgb + case GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT: return 4; + case GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT: return 8; case GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT: return 8; +#endif case GL_LUMINANCE: return 8; case GL_ALPHA: return 8; case GL_RED: return 8; @@ -235,6 +239,8 @@ S32 LLImageGL::dataFormatBytes(S32 dataformat, S32 width, S32 height) { switch (dataformat) { +#if GL_EXT_texture_compression_s3tc || GL_EXT_texture_compression_dxt1 \ + || GL_EXT_texture_sRGB || GL_EXT_texture_compression_s3tc_srgb case GL_COMPRESSED_RGBA_S3TC_DXT1_EXT: case GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT: case GL_COMPRESSED_RGBA_S3TC_DXT3_EXT: @@ -244,6 +250,7 @@ S32 LLImageGL::dataFormatBytes(S32 dataformat, S32 width, S32 height) if (width < 4) width = 4; if (height < 4) height = 4; break; +#endif default: break; } @@ -257,12 +264,16 @@ S32 LLImageGL::dataFormatComponents(S32 dataformat) { switch (dataformat) { +#if GL_EXT_texture_compression_s3tc || GL_EXT_texture_compression_dxt1 case GL_COMPRESSED_RGBA_S3TC_DXT1_EXT: return 3; - case GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT: return 3; case GL_COMPRESSED_RGBA_S3TC_DXT3_EXT: return 4; - case GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT: return 4; case GL_COMPRESSED_RGBA_S3TC_DXT5_EXT: return 4; +#endif +#if GL_EXT_texture_sRGB || GL_EXT_texture_compression_s3tc_srgb + case GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT: return 3; + case GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT: return 4; case GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT: return 4; +#endif case GL_LUMINANCE: return 1; case GL_ALPHA: return 1; case GL_RED: return 1; @@ -692,6 +703,8 @@ BOOL LLImageGL::setImage(const U8* data_in, BOOL data_hasmips /* = FALSE */, S32 switch (mFormatPrimary) { +#if GL_EXT_texture_compression_s3tc || GL_EXT_texture_compression_dxt1 \ + || GL_EXT_texture_sRGB || GL_EXT_texture_compression_s3tc_srgb case GL_COMPRESSED_RGBA_S3TC_DXT1_EXT: case GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT: case GL_COMPRESSED_RGBA_S3TC_DXT3_EXT: @@ -700,6 +713,7 @@ BOOL LLImageGL::setImage(const U8* data_in, BOOL data_hasmips /* = FALSE */, S32 case GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT: is_compressed = true; break; +#endif default: break; } -- cgit v1.2.3 From 907b4f5925265a5ce7da49aa58e9df3d30c97168 Mon Sep 17 00:00:00 2001 From: Erik Kundiman Date: Wed, 6 Sep 2023 12:13:18 +0800 Subject: Check for GL_BGRA_EXT before compiling its code --- indra/llrender/llimagegl.cpp | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'indra') diff --git a/indra/llrender/llimagegl.cpp b/indra/llrender/llimagegl.cpp index 06312e778c..dbb206839a 100644 --- a/indra/llrender/llimagegl.cpp +++ b/indra/llrender/llimagegl.cpp @@ -2162,9 +2162,11 @@ void LLImageGL::calcAlphaChannelOffsetAndStride() #endif mAlphaStride = 4; break; +#if GL_EXT_bgra case GL_BGRA_EXT: mAlphaStride = 4; break; +#endif default: break; } @@ -2200,8 +2202,12 @@ void LLImageGL::calcAlphaChannelOffsetAndStride() #endif // GL_VERSION_1_2 if( mAlphaStride < 1 || //unsupported format - mAlphaOffset < 0 || //unsupported type - (mFormatPrimary == GL_BGRA_EXT && mFormatType != GL_UNSIGNED_BYTE)) //unknown situation + mAlphaOffset < 0 //unsupported type +#if GL_EXT_bgra + || + (mFormatPrimary == GL_BGRA_EXT && mFormatType != GL_UNSIGNED_BYTE) //unknown situation +#endif + ) { LL_WARNS() << "Cannot analyze alpha for image with format type " << std::hex << mFormatType << std::dec << LL_ENDL; -- cgit v1.2.3 From 3ffe942384ca99c2407c79eee782201973bcb095 Mon Sep 17 00:00:00 2001 From: Erik Kundiman Date: Wed, 6 Sep 2023 12:17:23 +0800 Subject: Suffixless GL_LUMINANCE(_ALPHA) for those that don't implement the 8 suffixed ones. --- indra/llrender/llimagegl.cpp | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'indra') diff --git a/indra/llrender/llimagegl.cpp b/indra/llrender/llimagegl.cpp index dbb206839a..56d319a0c4 100644 --- a/indra/llrender/llimagegl.cpp +++ b/indra/llrender/llimagegl.cpp @@ -1554,6 +1554,8 @@ BOOL LLImageGL::createGLTexture(S32 discard_level, const LLImageRaw* imageraw, S // Use luminance alpha (for fonts) #if GL_VERSION_1_1 mFormatInternal = GL_LUMINANCE8; +#else + mFormatInternal = GL_LUMINANCE; #endif mFormatPrimary = GL_LUMINANCE; mFormatType = GL_UNSIGNED_BYTE; @@ -1562,6 +1564,8 @@ BOOL LLImageGL::createGLTexture(S32 discard_level, const LLImageRaw* imageraw, S // Use luminance alpha (for fonts) #if GL_VERSION_1_1 mFormatInternal = GL_LUMINANCE8_ALPHA8; +#else + mFormatInternal = GL_LUMINANCE_ALPHA; #endif mFormatPrimary = GL_LUMINANCE_ALPHA; mFormatType = GL_UNSIGNED_BYTE; -- cgit v1.2.3 From 39916024f4878739a64c785cdaa16cdccc171e7f Mon Sep 17 00:00:00 2001 From: Erik Kundiman Date: Wed, 6 Sep 2023 12:21:49 +0800 Subject: glDrawBuffers instead of glDrawBuffer since the latter is less portable. I'm guessing 1st arg is 0 since the condition is when mTex is empty. --- indra/llrender/llrendertarget.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'indra') diff --git a/indra/llrender/llrendertarget.cpp b/indra/llrender/llrendertarget.cpp index 005a7cfa97..90f9253a75 100644 --- a/indra/llrender/llrendertarget.cpp +++ b/indra/llrender/llrendertarget.cpp @@ -491,7 +491,8 @@ void LLRenderTarget::bindTarget() if (mTex.empty()) { //no color buffer to draw to LL_PROFILER_GPU_ZONEC( "gl.DrawBuffer", 0x0000FF ) - glDrawBuffer(GL_NONE); + GLenum drawbuffers[] = {GL_NONE}; + glDrawBuffers(0, drawbuffers); glReadBuffer(GL_NONE); } -- cgit v1.2.3 From 211ab43ba2cd23052534ac6817309c52969590d1 Mon Sep 17 00:00:00 2001 From: Erik Kundiman Date: Wed, 6 Sep 2023 12:29:13 +0800 Subject: GL TIME_ELAPSED_EXT as alternative to TIME_ELAPSED --- indra/llrender/llglslshader.cpp | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'indra') diff --git a/indra/llrender/llglslshader.cpp b/indra/llrender/llglslshader.cpp index 308ec1a771..58a9e28270 100644 --- a/indra/llrender/llglslshader.cpp +++ b/indra/llrender/llglslshader.cpp @@ -272,6 +272,8 @@ void LLGLSLShader::placeProfileQuery() #if GL_VERSION_3_3 glBeginQuery(GL_TIME_ELAPSED, mTimerQuery); #endif // GL_VERSION_3_3 +#else + glBeginQuery(GL_TIME_ELAPSED_EXT, mTimerQuery); #endif // GL_VERSION_1_5 #endif } @@ -284,6 +286,8 @@ void LLGLSLShader::readProfileQuery(U32 count, U32 mode) glEndQuery(GL_TIME_ELAPSED); #endif // GL_VERSION_3_3 glEndQuery(GL_SAMPLES_PASSED); +#else + glEndQuery(GL_TIME_ELAPSED_EXT); #endif // GL_VERSION_1_5 GLuint64 time_elapsed = 0; -- cgit v1.2.3 From 68c8e3e8f1d66c656bd6c1c014e13945f6998749 Mon Sep 17 00:00:00 2001 From: Erik Kundiman Date: Wed, 6 Sep 2023 13:57:29 +0800 Subject: Re-exclude FBSD test on Nvidia headers to minimise difference from upstream, as it's certain it's not FreeBSD anyway due to the removal of LL_FREEBSD on the containing scope. --- indra/llrender/llgl.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'indra') diff --git a/indra/llrender/llgl.cpp b/indra/llrender/llgl.cpp index 216b499674..6449fcdf33 100644 --- a/indra/llrender/llgl.cpp +++ b/indra/llrender/llgl.cpp @@ -1312,7 +1312,7 @@ void LLGLManager::initExtensions() glDebugMessageCallbackARB = (PFNGLDEBUGMESSAGECALLBACKARBPROC) GLH_EXT_GET_PROC_ADDRESS("glDebugMessageCallbackARB"); glGetDebugMessageLogARB = (PFNGLGETDEBUGMESSAGELOGARBPROC) GLH_EXT_GET_PROC_ADDRESS("glGetDebugMessageLogARB"); } -#if (!LL_LINUX && !LL_FREEBSD) || LL_LINUX_NV_GL_HEADERS +#if (!LL_LINUX) || LL_LINUX_NV_GL_HEADERS // This is expected to be a static symbol on Linux GL implementations, except if we use the nvidia headers - bah glDrawRangeElements = (PFNGLDRAWRANGEELEMENTSPROC)GLH_EXT_GET_PROC_ADDRESS("glDrawRangeElements"); if (!glDrawRangeElements) -- cgit v1.2.3 From 520fbfac5071f74d21e46b2f07dc0ed68b098903 Mon Sep 17 00:00:00 2001 From: Erik Kundiman Date: Wed, 6 Sep 2023 14:47:00 +0800 Subject: Comment out the GL functions redefinitions for all --- indra/llrender/llgl.cpp | 2 ++ 1 file changed, 2 insertions(+) (limited to 'indra') diff --git a/indra/llrender/llgl.cpp b/indra/llrender/llgl.cpp index 6449fcdf33..f597b1a932 100644 --- a/indra/llrender/llgl.cpp +++ b/indra/llrender/llgl.cpp @@ -1213,6 +1213,7 @@ void LLGLManager::initExtensions() glGetIntegerv(GL_MAX_ELEMENTS_INDICES, (GLint*) &mGLMaxIndexRange); glGetIntegerv(GL_MAX_TEXTURE_SIZE, (GLint*) &mGLMaxTextureSize); +/* #if (LL_WINDOWS || LL_LINUX) && !LL_MESA_HEADLESS LL_DEBUGS("RenderInit") << "GL Probe: Getting symbols" << LL_ENDL; if (mHasVertexBufferObject) @@ -1476,6 +1477,7 @@ void LLGLManager::initExtensions() LL_DEBUGS("RenderInit") << "GL Probe: Got symbols" << LL_ENDL; #endif +*/ mInited = TRUE; } -- cgit v1.2.3 From 79510a184bcd529db8da2afc7c8c6327f07167ef Mon Sep 17 00:00:00 2001 From: Erik Kundiman Date: Wed, 6 Sep 2023 16:25:16 +0800 Subject: Preprocess appearance GL fixed-function features so non implementors won't try to compile the code. --- indra/llappearance/lltexlayer.cpp | 28 ++++++++++++++++++++++++++++ indra/llappearance/lltexlayerparams.cpp | 4 ++++ 2 files changed, 32 insertions(+) (limited to 'indra') diff --git a/indra/llappearance/lltexlayer.cpp b/indra/llappearance/lltexlayer.cpp index 6f23b2e04c..31a07e43ed 100644 --- a/indra/llappearance/lltexlayer.cpp +++ b/indra/llappearance/lltexlayer.cpp @@ -377,7 +377,9 @@ BOOL LLTexLayerSet::render( S32 x, S32 y, S32 width, S32 height, LLRenderTarget* // clear buffer area to ensure we don't pick up UI elements { gGL.flush(); +#if GL_VERSION_1_1 LLGLDisable no_alpha(GL_ALPHA_TEST); +#endif gAlphaMaskProgram.setMinimumAlpha(0.0f); gGL.getTexUnit(0)->unbind(LLTexUnit::TT_TEXTURE); gGL.color4f( 0.f, 0.f, 0.f, 1.f ); @@ -410,7 +412,9 @@ BOOL LLTexLayerSet::render( S32 x, S32 y, S32 width, S32 height, LLRenderTarget* gGL.flush(); gGL.setSceneBlendType(LLRender::BT_REPLACE); +#if GL_VERSION_1_1 LLGLDisable no_alpha(GL_ALPHA_TEST); +#endif gAlphaMaskProgram.setMinimumAlpha(0.f); gGL.getTexUnit(0)->unbind(LLTexUnit::TT_TEXTURE); @@ -500,7 +504,9 @@ void LLTexLayerSet::renderAlphaMaskTextures(S32 x, S32 y, S32 width, S32 height, { // Set the alpha channel to one (clean up after previous blending) gGL.flush(); +#if GL_VERSION_1_1 LLGLDisable no_alpha(GL_ALPHA_TEST); +#endif gAlphaMaskProgram.setMinimumAlpha(0.f); gGL.getTexUnit(0)->unbind(LLTexUnit::TT_TEXTURE); gGL.color4f( 0.f, 0.f, 0.f, 1.f ); @@ -1025,7 +1031,9 @@ void LLTexLayer::calculateTexLayerColor(const param_color_list_t ¶m_list, LL BOOL LLTexLayer::render(S32 x, S32 y, S32 width, S32 height, LLRenderTarget* bound_target) { +#if GL_VERSION_1_1 LLGLEnable color_mat(GL_COLOR_MATERIAL); +#endif // *TODO: Is this correct? //gPipeline.disableLights(); stop_glerror(); @@ -1112,7 +1120,9 @@ BOOL LLTexLayer::render(S32 x, S32 y, S32 width, S32 height, LLRenderTarget* bou if( tex ) { bool no_alpha_test = getInfo()->mWriteAllChannels; +#if GL_VERSION_1_1 LLGLDisable alpha_test(no_alpha_test ? GL_ALPHA_TEST : 0); +#endif if (no_alpha_test) { gAlphaMaskProgram.setMinimumAlpha(0.f); @@ -1162,7 +1172,9 @@ BOOL LLTexLayer::render(S32 x, S32 y, S32 width, S32 height, LLRenderTarget* bou getInfo()->mStaticImageFileName.empty() && color_specified ) { +#if GL_VERSION_1_1 LLGLDisable no_alpha(GL_ALPHA_TEST); +#endif gAlphaMaskProgram.setMinimumAlpha(0.000f); gGL.getTexUnit(0)->unbind(LLTexUnit::TT_TEXTURE); @@ -1260,7 +1272,9 @@ BOOL LLTexLayer::blendAlphaTexture(S32 x, S32 y, S32 width, S32 height) LLGLTexture* tex = LLTexLayerStaticImageList::getInstance()->getTexture( getInfo()->mStaticImageFileName, getInfo()->mStaticImageIsMask ); if( tex ) { +#if GL_VERSION_1_1 LLGLSNoAlphaTest gls_no_alpha_test; +#endif gAlphaMaskProgram.setMinimumAlpha(0.f); gGL.getTexUnit(0)->bind(tex, TRUE); gl_rect_2d_simple_tex( width, height ); @@ -1279,7 +1293,9 @@ BOOL LLTexLayer::blendAlphaTexture(S32 x, S32 y, S32 width, S32 height) LLGLTexture* tex = mLocalTextureObject->getImage(); if (tex) { +#if GL_VERSION_1_1 LLGLSNoAlphaTest gls_no_alpha_test; +#endif gAlphaMaskProgram.setMinimumAlpha(0.f); gGL.getTexUnit(0)->bind(tex); gl_rect_2d_simple_tex( width, height ); @@ -1316,7 +1332,9 @@ void LLTexLayer::renderMorphMasks(S32 x, S32 y, S32 width, S32 height, const LLC // Note: if the first param is a mulitply, multiply against the current buffer's alpha if( !first_param || !first_param->getMultiplyBlend() ) { +#if GL_VERSION_1_1 LLGLDisable no_alpha(GL_ALPHA_TEST); +#endif gGL.getTexUnit(0)->unbind(LLTexUnit::TT_TEXTURE); // Clear the alpha @@ -1328,7 +1346,9 @@ void LLTexLayer::renderMorphMasks(S32 x, S32 y, S32 width, S32 height, const LLC } // Accumulate alphas +#if GL_VERSION_1_1 LLGLSNoAlphaTest gls_no_alpha_test; +#endif gGL.color4f( 1.f, 1.f, 1.f, 1.f ); for (LLTexLayerParamAlpha* param : mParamAlphaList) { @@ -1350,7 +1370,9 @@ void LLTexLayer::renderMorphMasks(S32 x, S32 y, S32 width, S32 height, const LLC LLGLTexture* tex = mLocalTextureObject->getImage(); if( tex && (tex->getComponents() == 4) ) { +#if GL_VERSION_1_1 LLGLSNoAlphaTest gls_no_alpha_test; +#endif LLTexUnit::eTextureAddressMode old_mode = tex->getAddressMode(); gGL.getTexUnit(0)->bind(tex, TRUE); @@ -1370,7 +1392,9 @@ void LLTexLayer::renderMorphMasks(S32 x, S32 y, S32 width, S32 height, const LLC { if( (tex->getComponents() == 4) || (tex->getComponents() == 1) ) { +#if GL_VERSION_1_1 LLGLSNoAlphaTest gls_no_alpha_test; +#endif gGL.getTexUnit(0)->bind(tex, TRUE); gl_rect_2d_simple_tex( width, height ); gGL.getTexUnit(0)->unbind(LLTexUnit::TT_TEXTURE); @@ -1387,7 +1411,9 @@ void LLTexLayer::renderMorphMasks(S32 x, S32 y, S32 width, S32 height, const LLC // Note: we're still using gGL.blendFunc( GL_DST_ALPHA, GL_ZERO ); if ( !is_approx_equal(layer_color.mV[VW], 1.f) ) { +#if GL_VERSION_1_1 LLGLDisable no_alpha(GL_ALPHA_TEST); +#endif gGL.getTexUnit(0)->unbind(LLTexUnit::TT_TEXTURE); gGL.color4fv(layer_color.mV); gl_rect_2d_simple( width, height ); @@ -1456,7 +1482,9 @@ void LLTexLayer::renderMorphMasks(S32 x, S32 y, S32 width, S32 height, const LLC gGL.getTexUnit(0)->bindManual(LLTexUnit::TT_TEXTURE, 0); } +#if GL_VERSION_1_1 glGetTexImage(LLTexUnit::getInternalType(LLTexUnit::TT_TEXTURE), 0, GL_RGBA, GL_UNSIGNED_BYTE, temp); +#endif U8* alpha_cursor = alpha_data; U8* pixel = temp; diff --git a/indra/llappearance/lltexlayerparams.cpp b/indra/llappearance/lltexlayerparams.cpp index a288c8955a..a6b0f54c88 100644 --- a/indra/llappearance/lltexlayerparams.cpp +++ b/indra/llappearance/lltexlayerparams.cpp @@ -344,7 +344,9 @@ BOOL LLTexLayerParamAlpha::render(S32 x, S32 y, S32 width, S32 height) mCachedProcessedTexture->setAddressMode(LLTexUnit::TAM_CLAMP); } +#if GL_VERSION_1_1 LLGLSNoAlphaTest gls_no_alpha_test; +#endif gGL.getTexUnit(0)->bind(mCachedProcessedTexture); gl_rect_2d_simple_tex(width, height); gGL.getTexUnit(0)->unbind(LLTexUnit::TT_TEXTURE); @@ -361,7 +363,9 @@ BOOL LLTexLayerParamAlpha::render(S32 x, S32 y, S32 width, S32 height) } else { +#if GL_VERSION_1_1 LLGLDisable no_alpha(GL_ALPHA_TEST); +#endif gGL.getTexUnit(0)->unbind(LLTexUnit::TT_TEXTURE); gGL.color4f(0.f, 0.f, 0.f, effective_weight); gl_rect_2d_simple(width, height); -- cgit v1.2.3 From 4ff7678deb6832d39f3d7e1612ee6cf1ae24a76f Mon Sep 17 00:00:00 2001 From: Erik Kundiman Date: Wed, 6 Sep 2023 17:06:54 +0800 Subject: GL_ALPHA8_EXT as an alternative to GL_ALPHA8 --- indra/llappearance/lltexlayerparams.cpp | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'indra') diff --git a/indra/llappearance/lltexlayerparams.cpp b/indra/llappearance/lltexlayerparams.cpp index a6b0f54c88..ec02d0d7fc 100644 --- a/indra/llappearance/lltexlayerparams.cpp +++ b/indra/llappearance/lltexlayerparams.cpp @@ -321,7 +321,11 @@ BOOL LLTexLayerParamAlpha::render(S32 x, S32 y, S32 width, S32 height) // We now have something in one of our caches LLTexLayerSet::sHasCaches |= mCachedProcessedTexture ? TRUE : FALSE; +#if GL_VERSION_1_1 mCachedProcessedTexture->setExplicitFormat(GL_ALPHA8, GL_ALPHA); +#else + mCachedProcessedTexture->setExplicitFormat(GL_ALPHA8_EXT, GL_ALPHA); +#endif } // Applies domain and effective weight to data as it is decoded. Also resizes the raw image if needed. -- cgit v1.2.3 From 62626f175b6549b62ba8538800957cab613b7ffa Mon Sep 17 00:00:00 2001 From: Erik Kundiman Date: Thu, 7 Sep 2023 11:29:17 +0800 Subject: Implementations without shm_unlink can use APR --- indra/llplugin/llpluginsharedmemory.cpp | 2 ++ 1 file changed, 2 insertions(+) (limited to 'indra') diff --git a/indra/llplugin/llpluginsharedmemory.cpp b/indra/llplugin/llpluginsharedmemory.cpp index c4e70f51e0..3204bbd715 100644 --- a/indra/llplugin/llpluginsharedmemory.cpp +++ b/indra/llplugin/llpluginsharedmemory.cpp @@ -45,6 +45,8 @@ #define USE_WIN32_SHARED_MEMORY 1 #elif LL_DARWIN #define USE_SHM_OPEN_SHARED_MEMORY 1 +#elif _POSIX_SHARED_MEMORY_OBJECTS == -1 + #define USE_APR_SHARED_MEMORY 1 #elif LL_LINUX #define USE_SHM_OPEN_SHARED_MEMORY 1 #elif LL_FREEBSD -- cgit v1.2.3 From 0aa43b264a76bb46cec2381b66708052b6b0ced9 Mon Sep 17 00:00:00 2001 From: Erik Kundiman Date: Thu, 7 Sep 2023 19:11:44 +0800 Subject: Comment out the GL funcs redefinition for Darwin --- indra/llrender/llglheaders.h | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'indra') diff --git a/indra/llrender/llglheaders.h b/indra/llrender/llglheaders.h index 1a8b2f1a64..3596223a93 100644 --- a/indra/llrender/llglheaders.h +++ b/indra/llrender/llglheaders.h @@ -575,6 +575,7 @@ extern PFNGLGETDEBUGMESSAGELOGARBPROC glGetDebugMessageLogARB; #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 @@ -692,7 +693,7 @@ extern "C" { #ifndef GL_ARB_vertex_buffer_object -/* GL types for handling large vertex buffer objects */ +// GL types for handling large vertex buffer objects typedef intptr_t GLintptrARB; typedef intptr_t GLsizeiptrARB; #endif @@ -708,7 +709,7 @@ 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 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); @@ -724,7 +725,7 @@ 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 // GL_GLEXT_FUNCTION_POINTERS #endif #ifndef GL_ARB_texture_rg @@ -771,7 +772,7 @@ extern void glGetBufferPointervARB (GLenum, GLenum, 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 // GL_GLEXT_FUNCTION_POINTERS // #endif #ifdef __cplusplus @@ -779,6 +780,7 @@ extern void glGetBufferPointervARB (GLenum, GLenum, GLvoid* *); #endif #include +*/ #endif // LL_MESA / LL_WINDOWS / LL_DARWIN -- cgit v1.2.3 From e600f6504cd7edd9d2883ea7dc17c2574b1ff468 Mon Sep 17 00:00:00 2001 From: Erik Kundiman Date: Thu, 7 Sep 2023 19:46:10 +0800 Subject: Bring back GL funcs & macros that work on macOS --- indra/llrender/llatmosphere.cpp | 16 +++++++++++++ indra/llrender/llgl.cpp | 7 ++++++ indra/llrender/llglslshader.cpp | 9 +++++-- indra/llrender/llrender.cpp | 6 ++++- indra/llrender/llvertexbuffer.cpp | 49 +++++++++++++++++++++++++-------------- 5 files changed, 67 insertions(+), 20 deletions(-) (limited to 'indra') diff --git a/indra/llrender/llatmosphere.cpp b/indra/llrender/llatmosphere.cpp index 8e37ca9b90..941ffe2711 100644 --- a/indra/llrender/llatmosphere.cpp +++ b/indra/llrender/llatmosphere.cpp @@ -241,7 +241,11 @@ LLGLTexture* LLAtmosphere::getTransmittance() m_transmittance->generateGLTexture(); m_transmittance->setAddressMode(LLTexUnit::eTextureAddressMode::TAM_CLAMP); m_transmittance->setFilteringOption(LLTexUnit::eTextureFilterOptions::TFO_BILINEAR); +#if GL_ARB_texture_float + m_transmittance->setExplicitFormat(GL_RGB32F_ARB, GL_RGB, GL_FLOAT); +#else m_transmittance->setExplicitFormat(GL_RGB32F, GL_RGB, GL_FLOAT); +#endif m_transmittance->setTarget(GL_TEXTURE_2D, LLTexUnit::TT_TEXTURE); } return m_transmittance; @@ -255,7 +259,11 @@ LLGLTexture* LLAtmosphere::getScattering() m_scattering->generateGLTexture(); m_scattering->setAddressMode(LLTexUnit::eTextureAddressMode::TAM_CLAMP); m_scattering->setFilteringOption(LLTexUnit::eTextureFilterOptions::TFO_BILINEAR); +#if GL_ARB_texture_float + m_scattering->setExplicitFormat(GL_RGB16F_ARB, GL_RGB, GL_FLOAT); +#else m_scattering->setExplicitFormat(GL_RGB16F, GL_RGB, GL_FLOAT); +#endif m_scattering->setTarget(GL_TEXTURE_3D, LLTexUnit::TT_TEXTURE_3D); } return m_scattering; @@ -269,7 +277,11 @@ LLGLTexture* LLAtmosphere::getMieScattering() m_mie_scatter_texture->generateGLTexture(); m_mie_scatter_texture->setAddressMode(LLTexUnit::eTextureAddressMode::TAM_CLAMP); m_mie_scatter_texture->setFilteringOption(LLTexUnit::eTextureFilterOptions::TFO_BILINEAR); +#if GL_ARB_texture_float + m_mie_scatter_texture->setExplicitFormat(GL_RGB16F_ARB, GL_RGB, GL_FLOAT); +#else m_mie_scatter_texture->setExplicitFormat(GL_RGB16F, GL_RGB, GL_FLOAT); +#endif m_mie_scatter_texture->setTarget(GL_TEXTURE_3D, LLTexUnit::TT_TEXTURE_3D); } return m_mie_scatter_texture; @@ -283,7 +295,11 @@ LLGLTexture* LLAtmosphere::getIlluminance() m_illuminance->generateGLTexture(); m_illuminance->setAddressMode(LLTexUnit::eTextureAddressMode::TAM_CLAMP); m_illuminance->setFilteringOption(LLTexUnit::eTextureFilterOptions::TFO_BILINEAR); +#if GL_ARB_texture_float + m_illuminance->setExplicitFormat(GL_RGB32F_ARB, GL_RGB, GL_FLOAT); +#else m_illuminance->setExplicitFormat(GL_RGB32F, GL_RGB, GL_FLOAT); +#endif m_illuminance->setTarget(GL_TEXTURE_2D, LLTexUnit::TT_TEXTURE); } return m_illuminance; diff --git a/indra/llrender/llgl.cpp b/indra/llrender/llgl.cpp index f597b1a932..9c809d5bd0 100644 --- a/indra/llrender/llgl.cpp +++ b/indra/llrender/llgl.cpp @@ -777,10 +777,12 @@ bool LLGLManager::initGL() if (mHasTextureMultisample) { +#if GL_VERSION_3_2 glGetIntegerv(GL_MAX_COLOR_TEXTURE_SAMPLES, &mMaxColorTextureSamples); glGetIntegerv(GL_MAX_DEPTH_TEXTURE_SAMPLES, &mMaxDepthTextureSamples); glGetIntegerv(GL_MAX_INTEGER_SAMPLES, &mMaxIntegerSamples); glGetIntegerv(GL_MAX_SAMPLE_MASK_WORDS, &mMaxSampleMaskWords); +#endif } stop_glerror(); @@ -1621,8 +1623,13 @@ void LLGLState::initClass() // sStateMap[GL_TEXTURE_2D] = GL_TRUE; //make sure multisample defaults to disabled +#if GL_ARB_multisample + sStateMap[GL_MULTISAMPLE_ARB] = GL_FALSE; + glDisable(GL_MULTISAMPLE_ARB); +#elif GL_EXT_multisample || GL_EXT_multisample_compatibility sStateMap[GL_MULTISAMPLE_EXT] = GL_FALSE; glDisable(GL_MULTISAMPLE_EXT); +#endif } //static diff --git a/indra/llrender/llglslshader.cpp b/indra/llrender/llglslshader.cpp index 58a9e28270..f587fb414c 100644 --- a/indra/llrender/llglslshader.cpp +++ b/indra/llrender/llglslshader.cpp @@ -797,16 +797,21 @@ GLint LLGLSLShader::mapUniformTextureChannel(GLint location, GLenum type) { LL_PROFILE_ZONE_SCOPED_CATEGORY_SHADER; +#if GL_VERSION_2_0 || GL_VERSION_3_2 if ( #if GL_VERSION_2_0 - (type >= GL_SAMPLER_1D_ARB && type <= GL_SAMPLER_2D_RECT_SHADOW_ARB) || + (type >= GL_SAMPLER_1D_ARB && type <= GL_SAMPLER_2D_RECT_SHADOW_ARB) #endif - type == GL_SAMPLER_2D_MULTISAMPLE) +#if GL_VERSION_3_2 + || type == GL_SAMPLER_2D_MULTISAMPLE +#endif + ) { //this here is a texture glUniform1i(location, mActiveTextureChannels); LL_DEBUGS("ShaderUniform") << "Assigned to texture channel " << mActiveTextureChannels << LL_ENDL; return mActiveTextureChannels++; } +#endif // GL_VERSION_2_0 || GL_VERSION_3_2 return -1; } diff --git a/indra/llrender/llrender.cpp b/indra/llrender/llrender.cpp index 89de6b93ea..91ce983e5a 100644 --- a/indra/llrender/llrender.cpp +++ b/indra/llrender/llrender.cpp @@ -906,9 +906,13 @@ void LLRender::init(bool needs_vertex_buffer) { //bind a dummy vertex array object so we're core profile compliant //#ifdef GL_ARB_vertex_array_object U32 ret; +#if GL_APPLE_vertex_array_object + glGenVertexArraysAPPLE(1, &ret); + glBindVertexArrayAPPLE(ret); +#else glGenVertexArrays(1, &ret); glBindVertexArray(ret); -//#endif +#endif } if (needs_vertex_buffer) diff --git a/indra/llrender/llvertexbuffer.cpp b/indra/llrender/llvertexbuffer.cpp index f71403d2f4..0c8a8fed6a 100644 --- a/indra/llrender/llvertexbuffer.cpp +++ b/indra/llrender/llvertexbuffer.cpp @@ -404,8 +404,11 @@ U32 LLVertexBuffer::getVAOName() else { //#ifdef GL_ARB_vertex_array_object +#if GL_APPLE_vertex_array_object + glGenVertexArraysAPPLE(1, &ret); +#else glGenVertexArrays(1, &ret); -//#endif +#endif } return ret; @@ -758,8 +761,11 @@ void LLVertexBuffer::unbind() if (sGLRenderArray) { //#if GL_ARB_vertex_array_object +#if GL_APPLE_vertex_array_object + glBindVertexArrayAPPLE(0); +#else glBindVertexArray(0); -//#endif +#endif sGLRenderArray = 0; sGLRenderIndices = 0; sIBOActive = false; @@ -1259,8 +1265,11 @@ void LLVertexBuffer::setupVertexArray() LL_PROFILE_ZONE_SCOPED_CATEGORY_VERTEX; //#if GL_ARB_vertex_array_object +#if GL_APPLE_vertex_array_object + glBindVertexArrayAPPLE(mGLArray); +#else glBindVertexArray(mGLArray); -//#endif +#endif sGLRenderArray = mGLArray; static const U32 attrib_size[] = @@ -1534,12 +1543,10 @@ U8* LLVertexBuffer::mapVertexBuffer(S32 type, S32 index, S32 count, bool map_ran { if (map_range) { -/* -#ifndef LL_MESA_HEADLESS +#if !LL_MESA_HEADLESS && GL_APPLE_flush_buffer_range && LL_DARWIN glBufferParameteriAPPLE(GL_ARRAY_BUFFER_ARB, GL_BUFFER_SERIALIZED_MODIFY_APPLE, GL_FALSE); glBufferParameteriAPPLE(GL_ARRAY_BUFFER_ARB, GL_BUFFER_FLUSHING_UNMAP_APPLE, GL_FALSE); #endif -*/ src = (U8*) glMapBuffer(GL_ARRAY_BUFFER, GL_WRITE_ONLY); } else @@ -1709,12 +1716,10 @@ U8* LLVertexBuffer::mapIndexBuffer(S32 index, S32 count, bool map_range) { if (map_range) { -/* -#ifndef LL_MESA_HEADLESS +#if !LL_MESA_HEADLESS && GL_APPLE_flush_buffer_range && LL_DARWIN glBufferParameteriAPPLE(GL_ELEMENT_ARRAY_BUFFER_ARB, GL_BUFFER_SERIALIZED_MODIFY_APPLE, GL_FALSE); glBufferParameteriAPPLE(GL_ELEMENT_ARRAY_BUFFER_ARB, GL_BUFFER_FLUSHING_UNMAP_APPLE, GL_FALSE); #endif -*/ src = (U8*) glMapBuffer(GL_ELEMENT_ARRAY_BUFFER, GL_WRITE_ONLY); } else @@ -1840,13 +1845,17 @@ void LLVertexBuffer::unmapBuffer() S32 length = sTypeSize[region.mType]*region.mCount; if (gGLManager.mHasMapBufferRange) { -#if GL_ARB_map_buffer_range || GL_EXT_map_buffer_range +#if GL_APPLE_flush_buffer_range && LL_DARWIN + glFlushMappedBufferRangeAPPLE(GL_ARRAY_BUFFER, offset, length); +#elif GL_ARB_map_buffer_range || GL_EXT_map_buffer_range glFlushMappedBufferRange(GL_ARRAY_BUFFER, offset, length); #endif } else if (gGLManager.mHasFlushBufferRange) { -#ifndef LL_MESA_HEADLESS +#if !LL_MESA_HEADLESS && GL_APPLE_flush_buffer_range && LL_DARWIN + glFlushMappedBufferRangeAPPLE(GL_ARRAY_BUFFER, offset, length); +#else glFlushMappedBufferRange(GL_ARRAY_BUFFER, offset, length); #endif } @@ -1920,20 +1929,20 @@ void LLVertexBuffer::unmapBuffer() S32 length = sizeof(U16)*region.mCount; if (gGLManager.mHasMapBufferRange) { -#if GL_ARB_map_buffer_range || GL_EXT_map_buffer_range +#if GL_APPLE_flush_buffer_range && LL_DARWIN + glFlushMappedBufferRangeAPPLE(GL_ELEMENT_ARRAY_BUFFER, offset, length); +#elif GL_ARB_map_buffer_range || GL_EXT_map_buffer_range glFlushMappedBufferRange(GL_ELEMENT_ARRAY_BUFFER, offset, length); #endif } - /* else if (gGLManager.mHasFlushBufferRange) { -#ifdef GL_APPLE_flush_buffer_range +#if GL_APPLE_flush_buffer_range && LL_DARWIN #ifndef LL_MESA_HEADLESS glFlushMappedBufferRangeAPPLE(GL_ELEMENT_ARRAY_BUFFER_ARB, offset, length); #endif #endif } - */ stop_glerror(); } @@ -2071,8 +2080,11 @@ bool LLVertexBuffer::bindGLArray() { LL_PROFILE_ZONE_SCOPED_CATEGORY_VERTEX; //#if GL_ARB_vertex_array_object +#if GL_APPLE_vertex_array_object + glBindVertexArrayAPPLE(mGLArray); +#else glBindVertexArray(mGLArray); -//#endif +#endif sGLRenderArray = mGLArray; } @@ -2301,8 +2313,11 @@ void LLVertexBuffer::setBuffer(U32 data_mask) if (sGLRenderArray) { //#if GL_ARB_vertex_array_object +#if GL_APPLE_vertex_array_object + glBindVertexArrayAPPLE(0); +#else glBindVertexArray(0); -//#endif +#endif sGLRenderArray = 0; sGLRenderIndices = 0; sIBOActive = false; -- cgit v1.2.3 From 3da53b180139d2a79811c1ed7384beaad3a86a48 Mon Sep 17 00:00:00 2001 From: Erik Kundiman Date: Thu, 7 Sep 2023 21:11:07 +0800 Subject: Bring back OpenGL >= 3.0 functionalities to macOS They weren't compiled with the previous commit, and it affected a lot. --- indra/llrender/llglheaders.h | 3 +++ 1 file changed, 3 insertions(+) (limited to 'indra') diff --git a/indra/llrender/llglheaders.h b/indra/llrender/llglheaders.h index 3596223a93..4a0c76760b 100644 --- a/indra/llrender/llglheaders.h +++ b/indra/llrender/llglheaders.h @@ -573,6 +573,9 @@ extern PFNGLGETDEBUGMESSAGELOGARBPROC glGetDebugMessageLogARB; #define GL_EXT_separate_specular_color 1 #include +#define GL_DO_NOT_WARN_IF_MULTI_GL_VERSION_HEADERS_INCLUDED +#include + #include "GL/glh_extensions.h" /* -- cgit v1.2.3 From d0b773094d5a3129f5b6db7d9de0da41791b2852 Mon Sep 17 00:00:00 2001 From: Erik Kundiman Date: Thu, 7 Sep 2023 21:12:38 +0800 Subject: Revert "Bring back GL funcs & macros that work on macOS" This reverts commit e600f6504cd7edd9d2883ea7dc17c2574b1ff468. --- indra/llrender/llatmosphere.cpp | 16 ------------- indra/llrender/llgl.cpp | 7 ------ indra/llrender/llglslshader.cpp | 9 ++----- indra/llrender/llrender.cpp | 6 +---- indra/llrender/llvertexbuffer.cpp | 49 ++++++++++++++------------------------- 5 files changed, 20 insertions(+), 67 deletions(-) (limited to 'indra') diff --git a/indra/llrender/llatmosphere.cpp b/indra/llrender/llatmosphere.cpp index 941ffe2711..8e37ca9b90 100644 --- a/indra/llrender/llatmosphere.cpp +++ b/indra/llrender/llatmosphere.cpp @@ -241,11 +241,7 @@ LLGLTexture* LLAtmosphere::getTransmittance() m_transmittance->generateGLTexture(); m_transmittance->setAddressMode(LLTexUnit::eTextureAddressMode::TAM_CLAMP); m_transmittance->setFilteringOption(LLTexUnit::eTextureFilterOptions::TFO_BILINEAR); -#if GL_ARB_texture_float - m_transmittance->setExplicitFormat(GL_RGB32F_ARB, GL_RGB, GL_FLOAT); -#else m_transmittance->setExplicitFormat(GL_RGB32F, GL_RGB, GL_FLOAT); -#endif m_transmittance->setTarget(GL_TEXTURE_2D, LLTexUnit::TT_TEXTURE); } return m_transmittance; @@ -259,11 +255,7 @@ LLGLTexture* LLAtmosphere::getScattering() m_scattering->generateGLTexture(); m_scattering->setAddressMode(LLTexUnit::eTextureAddressMode::TAM_CLAMP); m_scattering->setFilteringOption(LLTexUnit::eTextureFilterOptions::TFO_BILINEAR); -#if GL_ARB_texture_float - m_scattering->setExplicitFormat(GL_RGB16F_ARB, GL_RGB, GL_FLOAT); -#else m_scattering->setExplicitFormat(GL_RGB16F, GL_RGB, GL_FLOAT); -#endif m_scattering->setTarget(GL_TEXTURE_3D, LLTexUnit::TT_TEXTURE_3D); } return m_scattering; @@ -277,11 +269,7 @@ LLGLTexture* LLAtmosphere::getMieScattering() m_mie_scatter_texture->generateGLTexture(); m_mie_scatter_texture->setAddressMode(LLTexUnit::eTextureAddressMode::TAM_CLAMP); m_mie_scatter_texture->setFilteringOption(LLTexUnit::eTextureFilterOptions::TFO_BILINEAR); -#if GL_ARB_texture_float - m_mie_scatter_texture->setExplicitFormat(GL_RGB16F_ARB, GL_RGB, GL_FLOAT); -#else m_mie_scatter_texture->setExplicitFormat(GL_RGB16F, GL_RGB, GL_FLOAT); -#endif m_mie_scatter_texture->setTarget(GL_TEXTURE_3D, LLTexUnit::TT_TEXTURE_3D); } return m_mie_scatter_texture; @@ -295,11 +283,7 @@ LLGLTexture* LLAtmosphere::getIlluminance() m_illuminance->generateGLTexture(); m_illuminance->setAddressMode(LLTexUnit::eTextureAddressMode::TAM_CLAMP); m_illuminance->setFilteringOption(LLTexUnit::eTextureFilterOptions::TFO_BILINEAR); -#if GL_ARB_texture_float - m_illuminance->setExplicitFormat(GL_RGB32F_ARB, GL_RGB, GL_FLOAT); -#else m_illuminance->setExplicitFormat(GL_RGB32F, GL_RGB, GL_FLOAT); -#endif m_illuminance->setTarget(GL_TEXTURE_2D, LLTexUnit::TT_TEXTURE); } return m_illuminance; diff --git a/indra/llrender/llgl.cpp b/indra/llrender/llgl.cpp index 9c809d5bd0..f597b1a932 100644 --- a/indra/llrender/llgl.cpp +++ b/indra/llrender/llgl.cpp @@ -777,12 +777,10 @@ bool LLGLManager::initGL() if (mHasTextureMultisample) { -#if GL_VERSION_3_2 glGetIntegerv(GL_MAX_COLOR_TEXTURE_SAMPLES, &mMaxColorTextureSamples); glGetIntegerv(GL_MAX_DEPTH_TEXTURE_SAMPLES, &mMaxDepthTextureSamples); glGetIntegerv(GL_MAX_INTEGER_SAMPLES, &mMaxIntegerSamples); glGetIntegerv(GL_MAX_SAMPLE_MASK_WORDS, &mMaxSampleMaskWords); -#endif } stop_glerror(); @@ -1623,13 +1621,8 @@ void LLGLState::initClass() // sStateMap[GL_TEXTURE_2D] = GL_TRUE; //make sure multisample defaults to disabled -#if GL_ARB_multisample - sStateMap[GL_MULTISAMPLE_ARB] = GL_FALSE; - glDisable(GL_MULTISAMPLE_ARB); -#elif GL_EXT_multisample || GL_EXT_multisample_compatibility sStateMap[GL_MULTISAMPLE_EXT] = GL_FALSE; glDisable(GL_MULTISAMPLE_EXT); -#endif } //static diff --git a/indra/llrender/llglslshader.cpp b/indra/llrender/llglslshader.cpp index f587fb414c..58a9e28270 100644 --- a/indra/llrender/llglslshader.cpp +++ b/indra/llrender/llglslshader.cpp @@ -797,21 +797,16 @@ GLint LLGLSLShader::mapUniformTextureChannel(GLint location, GLenum type) { LL_PROFILE_ZONE_SCOPED_CATEGORY_SHADER; -#if GL_VERSION_2_0 || GL_VERSION_3_2 if ( #if GL_VERSION_2_0 - (type >= GL_SAMPLER_1D_ARB && type <= GL_SAMPLER_2D_RECT_SHADOW_ARB) + (type >= GL_SAMPLER_1D_ARB && type <= GL_SAMPLER_2D_RECT_SHADOW_ARB) || #endif -#if GL_VERSION_3_2 - || type == GL_SAMPLER_2D_MULTISAMPLE -#endif - ) + type == GL_SAMPLER_2D_MULTISAMPLE) { //this here is a texture glUniform1i(location, mActiveTextureChannels); LL_DEBUGS("ShaderUniform") << "Assigned to texture channel " << mActiveTextureChannels << LL_ENDL; return mActiveTextureChannels++; } -#endif // GL_VERSION_2_0 || GL_VERSION_3_2 return -1; } diff --git a/indra/llrender/llrender.cpp b/indra/llrender/llrender.cpp index 91ce983e5a..89de6b93ea 100644 --- a/indra/llrender/llrender.cpp +++ b/indra/llrender/llrender.cpp @@ -906,13 +906,9 @@ void LLRender::init(bool needs_vertex_buffer) { //bind a dummy vertex array object so we're core profile compliant //#ifdef GL_ARB_vertex_array_object U32 ret; -#if GL_APPLE_vertex_array_object - glGenVertexArraysAPPLE(1, &ret); - glBindVertexArrayAPPLE(ret); -#else glGenVertexArrays(1, &ret); glBindVertexArray(ret); -#endif +//#endif } if (needs_vertex_buffer) diff --git a/indra/llrender/llvertexbuffer.cpp b/indra/llrender/llvertexbuffer.cpp index 0c8a8fed6a..f71403d2f4 100644 --- a/indra/llrender/llvertexbuffer.cpp +++ b/indra/llrender/llvertexbuffer.cpp @@ -404,11 +404,8 @@ U32 LLVertexBuffer::getVAOName() else { //#ifdef GL_ARB_vertex_array_object -#if GL_APPLE_vertex_array_object - glGenVertexArraysAPPLE(1, &ret); -#else glGenVertexArrays(1, &ret); -#endif +//#endif } return ret; @@ -761,11 +758,8 @@ void LLVertexBuffer::unbind() if (sGLRenderArray) { //#if GL_ARB_vertex_array_object -#if GL_APPLE_vertex_array_object - glBindVertexArrayAPPLE(0); -#else glBindVertexArray(0); -#endif +//#endif sGLRenderArray = 0; sGLRenderIndices = 0; sIBOActive = false; @@ -1265,11 +1259,8 @@ void LLVertexBuffer::setupVertexArray() LL_PROFILE_ZONE_SCOPED_CATEGORY_VERTEX; //#if GL_ARB_vertex_array_object -#if GL_APPLE_vertex_array_object - glBindVertexArrayAPPLE(mGLArray); -#else glBindVertexArray(mGLArray); -#endif +//#endif sGLRenderArray = mGLArray; static const U32 attrib_size[] = @@ -1543,10 +1534,12 @@ U8* LLVertexBuffer::mapVertexBuffer(S32 type, S32 index, S32 count, bool map_ran { if (map_range) { -#if !LL_MESA_HEADLESS && GL_APPLE_flush_buffer_range && LL_DARWIN +/* +#ifndef LL_MESA_HEADLESS glBufferParameteriAPPLE(GL_ARRAY_BUFFER_ARB, GL_BUFFER_SERIALIZED_MODIFY_APPLE, GL_FALSE); glBufferParameteriAPPLE(GL_ARRAY_BUFFER_ARB, GL_BUFFER_FLUSHING_UNMAP_APPLE, GL_FALSE); #endif +*/ src = (U8*) glMapBuffer(GL_ARRAY_BUFFER, GL_WRITE_ONLY); } else @@ -1716,10 +1709,12 @@ U8* LLVertexBuffer::mapIndexBuffer(S32 index, S32 count, bool map_range) { if (map_range) { -#if !LL_MESA_HEADLESS && GL_APPLE_flush_buffer_range && LL_DARWIN +/* +#ifndef LL_MESA_HEADLESS glBufferParameteriAPPLE(GL_ELEMENT_ARRAY_BUFFER_ARB, GL_BUFFER_SERIALIZED_MODIFY_APPLE, GL_FALSE); glBufferParameteriAPPLE(GL_ELEMENT_ARRAY_BUFFER_ARB, GL_BUFFER_FLUSHING_UNMAP_APPLE, GL_FALSE); #endif +*/ src = (U8*) glMapBuffer(GL_ELEMENT_ARRAY_BUFFER, GL_WRITE_ONLY); } else @@ -1845,17 +1840,13 @@ void LLVertexBuffer::unmapBuffer() S32 length = sTypeSize[region.mType]*region.mCount; if (gGLManager.mHasMapBufferRange) { -#if GL_APPLE_flush_buffer_range && LL_DARWIN - glFlushMappedBufferRangeAPPLE(GL_ARRAY_BUFFER, offset, length); -#elif GL_ARB_map_buffer_range || GL_EXT_map_buffer_range +#if GL_ARB_map_buffer_range || GL_EXT_map_buffer_range glFlushMappedBufferRange(GL_ARRAY_BUFFER, offset, length); #endif } else if (gGLManager.mHasFlushBufferRange) { -#if !LL_MESA_HEADLESS && GL_APPLE_flush_buffer_range && LL_DARWIN - glFlushMappedBufferRangeAPPLE(GL_ARRAY_BUFFER, offset, length); -#else +#ifndef LL_MESA_HEADLESS glFlushMappedBufferRange(GL_ARRAY_BUFFER, offset, length); #endif } @@ -1929,20 +1920,20 @@ void LLVertexBuffer::unmapBuffer() S32 length = sizeof(U16)*region.mCount; if (gGLManager.mHasMapBufferRange) { -#if GL_APPLE_flush_buffer_range && LL_DARWIN - glFlushMappedBufferRangeAPPLE(GL_ELEMENT_ARRAY_BUFFER, offset, length); -#elif GL_ARB_map_buffer_range || GL_EXT_map_buffer_range +#if GL_ARB_map_buffer_range || GL_EXT_map_buffer_range glFlushMappedBufferRange(GL_ELEMENT_ARRAY_BUFFER, offset, length); #endif } + /* else if (gGLManager.mHasFlushBufferRange) { -#if GL_APPLE_flush_buffer_range && LL_DARWIN +#ifdef GL_APPLE_flush_buffer_range #ifndef LL_MESA_HEADLESS glFlushMappedBufferRangeAPPLE(GL_ELEMENT_ARRAY_BUFFER_ARB, offset, length); #endif #endif } + */ stop_glerror(); } @@ -2080,11 +2071,8 @@ bool LLVertexBuffer::bindGLArray() { LL_PROFILE_ZONE_SCOPED_CATEGORY_VERTEX; //#if GL_ARB_vertex_array_object -#if GL_APPLE_vertex_array_object - glBindVertexArrayAPPLE(mGLArray); -#else glBindVertexArray(mGLArray); -#endif +//#endif sGLRenderArray = mGLArray; } @@ -2313,11 +2301,8 @@ void LLVertexBuffer::setBuffer(U32 data_mask) if (sGLRenderArray) { //#if GL_ARB_vertex_array_object -#if GL_APPLE_vertex_array_object - glBindVertexArrayAPPLE(0); -#else glBindVertexArray(0); -#endif +//#endif sGLRenderArray = 0; sGLRenderIndices = 0; sIBOActive = false; -- cgit v1.2.3 From b47d2a1c0e432483d93693de58956367a3c935d6 Mon Sep 17 00:00:00 2001 From: Erik Kundiman Date: Thu, 7 Sep 2023 21:14:07 +0800 Subject: Bring back GL_MULTISAMPLE_ARB to macOS since it doesn't have GL_MULTISAMPLE_EXT. --- indra/llrender/llgl.cpp | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'indra') diff --git a/indra/llrender/llgl.cpp b/indra/llrender/llgl.cpp index f597b1a932..5ad8e7f5df 100644 --- a/indra/llrender/llgl.cpp +++ b/indra/llrender/llgl.cpp @@ -1621,8 +1621,13 @@ void LLGLState::initClass() // sStateMap[GL_TEXTURE_2D] = GL_TRUE; //make sure multisample defaults to disabled +#if GL_ARB_multisample + sStateMap[GL_MULTISAMPLE_ARB] = GL_FALSE; + glDisable(GL_MULTISAMPLE_ARB); +#else sStateMap[GL_MULTISAMPLE_EXT] = GL_FALSE; glDisable(GL_MULTISAMPLE_EXT); +#endif } //static -- cgit v1.2.3 From d328f2efb2d22e690a5461f4ba2d2eeb6603ac8f Mon Sep 17 00:00:00 2001 From: Erik Kundiman Date: Thu, 7 Sep 2023 21:19:31 +0800 Subject: Bring back glBufferParameteriAPPLE GL_APPLE_flush_buffer_range is defined on other platforms such as FreeBSD but there would failure to link, hence the extra LL_DARWIN. --- indra/llrender/llvertexbuffer.cpp | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) (limited to 'indra') diff --git a/indra/llrender/llvertexbuffer.cpp b/indra/llrender/llvertexbuffer.cpp index f71403d2f4..4064d35753 100644 --- a/indra/llrender/llvertexbuffer.cpp +++ b/indra/llrender/llvertexbuffer.cpp @@ -1534,12 +1534,10 @@ U8* LLVertexBuffer::mapVertexBuffer(S32 type, S32 index, S32 count, bool map_ran { if (map_range) { -/* -#ifndef LL_MESA_HEADLESS +#if !LL_MESA_HEADLESS && GL_APPLE_flush_buffer_range && LL_DARWIN glBufferParameteriAPPLE(GL_ARRAY_BUFFER_ARB, GL_BUFFER_SERIALIZED_MODIFY_APPLE, GL_FALSE); glBufferParameteriAPPLE(GL_ARRAY_BUFFER_ARB, GL_BUFFER_FLUSHING_UNMAP_APPLE, GL_FALSE); #endif -*/ src = (U8*) glMapBuffer(GL_ARRAY_BUFFER, GL_WRITE_ONLY); } else @@ -1709,12 +1707,10 @@ U8* LLVertexBuffer::mapIndexBuffer(S32 index, S32 count, bool map_range) { if (map_range) { -/* -#ifndef LL_MESA_HEADLESS +#if !LL_MESA_HEADLESS && GL_APPLE_flush_buffer_range && LL_DARWIN glBufferParameteriAPPLE(GL_ELEMENT_ARRAY_BUFFER_ARB, GL_BUFFER_SERIALIZED_MODIFY_APPLE, GL_FALSE); glBufferParameteriAPPLE(GL_ELEMENT_ARRAY_BUFFER_ARB, GL_BUFFER_FLUSHING_UNMAP_APPLE, GL_FALSE); #endif -*/ src = (U8*) glMapBuffer(GL_ELEMENT_ARRAY_BUFFER, GL_WRITE_ONLY); } else @@ -1924,16 +1920,14 @@ void LLVertexBuffer::unmapBuffer() glFlushMappedBufferRange(GL_ELEMENT_ARRAY_BUFFER, offset, length); #endif } - /* else if (gGLManager.mHasFlushBufferRange) { -#ifdef GL_APPLE_flush_buffer_range +#if GL_APPLE_flush_buffer_range && LL_DARWIN #ifndef LL_MESA_HEADLESS glFlushMappedBufferRangeAPPLE(GL_ELEMENT_ARRAY_BUFFER_ARB, offset, length); #endif #endif } - */ stop_glerror(); } -- cgit v1.2.3 From e67022465d8189eb30135b6b7c0fe477b3b91819 Mon Sep 17 00:00:00 2001 From: Erik Kundiman Date: Sun, 10 Sep 2023 10:10:52 +0800 Subject: Lose the _ARB suffix from many macros --- indra/newview/lldrawable.cpp | 2 +- indra/newview/lldrawpoolavatar.cpp | 8 +- indra/newview/llface.cpp | 4 +- indra/newview/llglsandbox.cpp | 6 +- indra/newview/llspatialpartition.cpp | 8 +- indra/newview/llsprite.cpp | 2 +- indra/newview/llviewershadermgr.cpp | 542 +++++++++++++++++------------------ indra/newview/llvograss.cpp | 6 +- indra/newview/llvoground.cpp | 2 +- indra/newview/llvopartgroup.cpp | 4 +- indra/newview/llvosky.cpp | 6 +- indra/newview/llvosurfacepatch.cpp | 4 +- indra/newview/llvotree.cpp | 4 +- indra/newview/llvovolume.cpp | 20 +- indra/newview/llvowater.cpp | 4 +- indra/newview/llvowlsky.cpp | 4 +- indra/newview/pipeline.cpp | 26 +- 17 files changed, 327 insertions(+), 325 deletions(-) (limited to 'indra') diff --git a/indra/newview/lldrawable.cpp b/indra/newview/lldrawable.cpp index bb4174d3b6..14e667088d 100644 --- a/indra/newview/lldrawable.cpp +++ b/indra/newview/lldrawable.cpp @@ -1269,7 +1269,7 @@ LLSpatialPartition* LLDrawable::getSpatialPartition() LLSpatialBridge::LLSpatialBridge(LLDrawable* root, BOOL render_by_group, U32 data_mask, LLViewerRegion* regionp) : LLDrawable(root->getVObj(), true), - LLSpatialPartition(data_mask, render_by_group, GL_STREAM_DRAW_ARB, regionp) + LLSpatialPartition(data_mask, render_by_group, GL_STREAM_DRAW, regionp) { LL_PROFILE_ZONE_SCOPED_CATEGORY_DRAWABLE diff --git a/indra/newview/lldrawpoolavatar.cpp b/indra/newview/lldrawpoolavatar.cpp index 4ffa903cca..1072719f2e 100644 --- a/indra/newview/lldrawpoolavatar.cpp +++ b/indra/newview/lldrawpoolavatar.cpp @@ -55,7 +55,7 @@ #include "llperfstats.h" static U32 sDataMask = LLDrawPoolAvatar::VERTEX_DATA_MASK; -static U32 sBufferUsage = GL_STREAM_DRAW_ARB; +static U32 sBufferUsage = GL_STREAM_DRAW; static U32 sShaderLevel = 0; LLGLSLShader* LLDrawPoolAvatar::sVertexProgram = NULL; @@ -147,11 +147,11 @@ void LLDrawPoolAvatar::prerender() if (sShaderLevel > 0) { - sBufferUsage = GL_DYNAMIC_DRAW_ARB; + sBufferUsage = GL_DYNAMIC_DRAW; } else { - sBufferUsage = GL_STREAM_DRAW_ARB; + sBufferUsage = GL_STREAM_DRAW; } } @@ -939,7 +939,7 @@ LLColor3 LLDrawPoolAvatar::getDebugColor() const LLVertexBufferAvatar::LLVertexBufferAvatar() : LLVertexBuffer(sDataMask, - GL_STREAM_DRAW_ARB) //avatars are always stream draw due to morph targets + GL_STREAM_DRAW) //avatars are always stream draw due to morph targets { LL_PROFILE_ZONE_SCOPED_CATEGORY_AVATAR } diff --git a/indra/newview/llface.cpp b/indra/newview/llface.cpp index a7c8a0987e..6619f7d0bd 100644 --- a/indra/newview/llface.cpp +++ b/indra/newview/llface.cpp @@ -1225,7 +1225,7 @@ void LLFace::cacheFaceInVRAM(const LLVolumeFace& vf) mask |= LLVertexBuffer::MAP_WEIGHT4; } - LLVertexBuffer* buff = new LLVertexBuffer(mask, GL_STATIC_DRAW_ARB); + LLVertexBuffer* buff = new LLVertexBuffer(mask, GL_STATIC_DRAW); vf.mVertexBuffer = buff; buff->allocateBuffer(vf.mNumVertices, 0, true); @@ -1535,7 +1535,7 @@ BOOL LLFace::getGeometryVolume(const LLVolume& volume, #ifdef GL_TRANSFORM_FEEDBACK_BUFFER if (use_transform_feedback && - mVertexBuffer->getUsage() == GL_DYNAMIC_COPY_ARB && + mVertexBuffer->getUsage() == GL_DYNAMIC_COPY && gTransformPositionProgram.mProgramObject && //transform shaders are loaded mVertexBuffer->useVBOs() && //target buffer is in VRAM !rebuild_weights && //TODO: add support for weights diff --git a/indra/newview/llglsandbox.cpp b/indra/newview/llglsandbox.cpp index 03c1b6f631..7488a472ba 100644 --- a/indra/newview/llglsandbox.cpp +++ b/indra/newview/llglsandbox.cpp @@ -1007,8 +1007,8 @@ F32 gpu_benchmark() gBenchmarkProgram.mName = "Benchmark Shader"; gBenchmarkProgram.mFeatures.attachNothing = true; gBenchmarkProgram.mShaderFiles.clear(); - gBenchmarkProgram.mShaderFiles.push_back(std::make_pair("interface/benchmarkV.glsl", GL_VERTEX_SHADER_ARB)); - gBenchmarkProgram.mShaderFiles.push_back(std::make_pair("interface/benchmarkF.glsl", GL_FRAGMENT_SHADER_ARB)); + gBenchmarkProgram.mShaderFiles.push_back(std::make_pair("interface/benchmarkV.glsl", GL_VERTEX_SHADER)); + gBenchmarkProgram.mShaderFiles.push_back(std::make_pair("interface/benchmarkF.glsl", GL_FRAGMENT_SHADER)); gBenchmarkProgram.mShaderLevel = 1; if (!gBenchmarkProgram.createShader(NULL, NULL)) { @@ -1091,7 +1091,7 @@ F32 gpu_benchmark() delete [] pixels; //make a dummy triangle to draw with - LLPointer buff = new LLVertexBuffer(LLVertexBuffer::MAP_VERTEX, GL_STREAM_DRAW_ARB); + LLPointer buff = new LLVertexBuffer(LLVertexBuffer::MAP_VERTEX, GL_STREAM_DRAW); if (!buff->allocateBuffer(3, 0, true)) { diff --git a/indra/newview/llspatialpartition.cpp b/indra/newview/llspatialpartition.cpp index 17c834326c..52eef0e92f 100644 --- a/indra/newview/llspatialpartition.cpp +++ b/indra/newview/llspatialpartition.cpp @@ -1685,7 +1685,7 @@ void renderOctree(LLSpatialGroup* group) if (group->mBuilt > 0.f) { group->mBuilt -= 2.f * gFrameIntervalSeconds.value(); - if (group->mBufferUsage == GL_STATIC_DRAW_ARB) + if (group->mBufferUsage == GL_STATIC_DRAW) { col.setVec(1.0f, 0, 0, group->mBuilt*0.5f); } @@ -1695,10 +1695,12 @@ void renderOctree(LLSpatialGroup* group) //col.setVec(1.0f, 1.0f, 0, sinf(group->mBuilt*3.14159f)*0.5f); } - if (group->mBufferUsage != GL_STATIC_DRAW_ARB) + if (group->mBufferUsage != GL_STATIC_DRAW) { LLGLDepthTest gl_depth(FALSE, FALSE); +#if GL_VERSION_1_1 glPolygonMode(GL_FRONT_AND_BACK, GL_LINE); +#endif gGL.diffuseColor4f(1,0,0,group->mBuilt); gGL.flush(); @@ -1793,7 +1795,7 @@ void renderOctree(LLSpatialGroup* group) } else { - if (group->mBufferUsage == GL_STATIC_DRAW_ARB && !group->isEmpty() + if (group->mBufferUsage == GL_STATIC_DRAW && !group->isEmpty() && group->getSpatialPartition()->mRenderByGroup) { col.setVec(0.8f, 0.4f, 0.1f, 0.1f); diff --git a/indra/newview/llsprite.cpp b/indra/newview/llsprite.cpp index fd41cdf0d7..40dab61fa6 100644 --- a/indra/newview/llsprite.cpp +++ b/indra/newview/llsprite.cpp @@ -189,7 +189,7 @@ void LLSprite::updateFace(LLFace &face) { LLVertexBuffer* buff = new LLVertexBuffer(LLVertexBuffer::MAP_VERTEX | LLVertexBuffer::MAP_TEXCOORD0, - GL_STREAM_DRAW_ARB); + GL_STREAM_DRAW); buff->allocateBuffer(4, 12, TRUE); face.setGeomIndex(0); face.setIndicesIndex(0); diff --git a/indra/newview/llviewershadermgr.cpp b/indra/newview/llviewershadermgr.cpp index 779837bcf0..859f5bf9e1 100644 --- a/indra/newview/llviewershadermgr.cpp +++ b/indra/newview/llviewershadermgr.cpp @@ -948,7 +948,7 @@ std::string LLViewerShaderMgr::loadBasicShaders() 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, &attribs) == 0) + if (loadShaderFile(shaders[i].first, shaders[i].second, GL_VERTEX_SHADER, &attribs) == 0) { LL_WARNS("Shader") << "Failed to load vertex shader " << shaders[i].first << LL_ENDL; return shaders[i].first; @@ -1008,7 +1008,7 @@ std::string LLViewerShaderMgr::loadBasicShaders() for (U32 i = 0; i < shaders.size(); i++) { // Note usage of GL_FRAGMENT_SHADER_ARB - if (loadShaderFile(shaders[i].first, shaders[i].second, GL_FRAGMENT_SHADER_ARB, &attribs, index_channels[i]) == 0) + if (loadShaderFile(shaders[i].first, shaders[i].second, GL_FRAGMENT_SHADER, &attribs, index_channels[i]) == 0) { LL_WARNS("Shader") << "Failed to load fragment shader " << shaders[i].first << LL_ENDL; return shaders[i].first; @@ -1041,8 +1041,8 @@ BOOL LLViewerShaderMgr::loadShadersEnvironment() gTerrainProgram.mFeatures.disableTextureIndex = true; gTerrainProgram.mFeatures.hasGamma = true; gTerrainProgram.mShaderFiles.clear(); - gTerrainProgram.mShaderFiles.push_back(make_pair("environment/terrainV.glsl", GL_VERTEX_SHADER_ARB)); - gTerrainProgram.mShaderFiles.push_back(make_pair("environment/terrainF.glsl", GL_FRAGMENT_SHADER_ARB)); + gTerrainProgram.mShaderFiles.push_back(make_pair("environment/terrainV.glsl", GL_VERTEX_SHADER)); + gTerrainProgram.mShaderFiles.push_back(make_pair("environment/terrainF.glsl", GL_FRAGMENT_SHADER)); gTerrainProgram.mShaderLevel = mShaderLevel[SHADER_ENVIRONMENT]; success = gTerrainProgram.createShader(NULL, NULL); llassert(success); @@ -1082,8 +1082,8 @@ BOOL LLViewerShaderMgr::loadShadersWater() gWaterProgram.mFeatures.hasTransport = true; gWaterProgram.mFeatures.hasSrgb = true; gWaterProgram.mShaderFiles.clear(); - gWaterProgram.mShaderFiles.push_back(make_pair("environment/waterV.glsl", GL_VERTEX_SHADER_ARB)); - gWaterProgram.mShaderFiles.push_back(make_pair("environment/waterF.glsl", GL_FRAGMENT_SHADER_ARB)); + gWaterProgram.mShaderFiles.push_back(make_pair("environment/waterV.glsl", GL_VERTEX_SHADER)); + gWaterProgram.mShaderFiles.push_back(make_pair("environment/waterF.glsl", GL_FRAGMENT_SHADER)); gWaterProgram.mShaderGroup = LLGLSLShader::SG_WATER; gWaterProgram.mShaderLevel = mShaderLevel[SHADER_WATER]; success = gWaterProgram.createShader(NULL, NULL); @@ -1099,8 +1099,8 @@ BOOL LLViewerShaderMgr::loadShadersWater() gWaterEdgeProgram.mFeatures.hasTransport = true; gWaterEdgeProgram.mFeatures.hasSrgb = true; gWaterEdgeProgram.mShaderFiles.clear(); - gWaterEdgeProgram.mShaderFiles.push_back(make_pair("environment/waterV.glsl", GL_VERTEX_SHADER_ARB)); - gWaterEdgeProgram.mShaderFiles.push_back(make_pair("environment/waterF.glsl", GL_FRAGMENT_SHADER_ARB)); + gWaterEdgeProgram.mShaderFiles.push_back(make_pair("environment/waterV.glsl", GL_VERTEX_SHADER)); + gWaterEdgeProgram.mShaderFiles.push_back(make_pair("environment/waterF.glsl", GL_FRAGMENT_SHADER)); gWaterEdgeProgram.addPermutation("WATER_EDGE", "1"); gWaterEdgeProgram.mShaderGroup = LLGLSLShader::SG_WATER; gWaterEdgeProgram.mShaderLevel = mShaderLevel[SHADER_WATER]; @@ -1115,8 +1115,8 @@ BOOL LLViewerShaderMgr::loadShadersWater() gUnderWaterProgram.mFeatures.calculatesAtmospherics = true; gUnderWaterProgram.mFeatures.hasWaterFog = true; gUnderWaterProgram.mShaderFiles.clear(); - gUnderWaterProgram.mShaderFiles.push_back(make_pair("environment/waterV.glsl", GL_VERTEX_SHADER_ARB)); - gUnderWaterProgram.mShaderFiles.push_back(make_pair("environment/underWaterF.glsl", GL_FRAGMENT_SHADER_ARB)); + gUnderWaterProgram.mShaderFiles.push_back(make_pair("environment/waterV.glsl", GL_VERTEX_SHADER)); + gUnderWaterProgram.mShaderFiles.push_back(make_pair("environment/underWaterF.glsl", GL_FRAGMENT_SHADER)); gUnderWaterProgram.mShaderLevel = mShaderLevel[SHADER_WATER]; gUnderWaterProgram.mShaderGroup = LLGLSLShader::SG_WATER; success = gUnderWaterProgram.createShader(NULL, NULL); @@ -1134,8 +1134,8 @@ BOOL LLViewerShaderMgr::loadShadersWater() gTerrainWaterProgram.mFeatures.mIndexedTextureChannels = 0; gTerrainWaterProgram.mFeatures.disableTextureIndex = true; gTerrainWaterProgram.mShaderFiles.clear(); - gTerrainWaterProgram.mShaderFiles.push_back(make_pair("environment/terrainWaterV.glsl", GL_VERTEX_SHADER_ARB)); - gTerrainWaterProgram.mShaderFiles.push_back(make_pair("environment/terrainWaterF.glsl", GL_FRAGMENT_SHADER_ARB)); + gTerrainWaterProgram.mShaderFiles.push_back(make_pair("environment/terrainWaterV.glsl", GL_VERTEX_SHADER)); + gTerrainWaterProgram.mShaderFiles.push_back(make_pair("environment/terrainWaterF.glsl", GL_FRAGMENT_SHADER)); gTerrainWaterProgram.mShaderLevel = mShaderLevel[SHADER_ENVIRONMENT]; gTerrainWaterProgram.mShaderGroup = LLGLSLShader::SG_WATER; @@ -1193,8 +1193,8 @@ BOOL LLViewerShaderMgr::loadShadersEffects() { gGlowProgram.mName = "Glow Shader (Post)"; gGlowProgram.mShaderFiles.clear(); - gGlowProgram.mShaderFiles.push_back(make_pair("effects/glowV.glsl", GL_VERTEX_SHADER_ARB)); - gGlowProgram.mShaderFiles.push_back(make_pair("effects/glowF.glsl", GL_FRAGMENT_SHADER_ARB)); + gGlowProgram.mShaderFiles.push_back(make_pair("effects/glowV.glsl", GL_VERTEX_SHADER)); + gGlowProgram.mShaderFiles.push_back(make_pair("effects/glowF.glsl", GL_FRAGMENT_SHADER)); gGlowProgram.mShaderLevel = mShaderLevel[SHADER_EFFECT]; success = gGlowProgram.createShader(NULL, NULL); if (!success) @@ -1207,8 +1207,8 @@ BOOL LLViewerShaderMgr::loadShadersEffects() { gGlowExtractProgram.mName = "Glow Extract Shader (Post)"; gGlowExtractProgram.mShaderFiles.clear(); - gGlowExtractProgram.mShaderFiles.push_back(make_pair("effects/glowExtractV.glsl", GL_VERTEX_SHADER_ARB)); - gGlowExtractProgram.mShaderFiles.push_back(make_pair("effects/glowExtractF.glsl", GL_FRAGMENT_SHADER_ARB)); + gGlowExtractProgram.mShaderFiles.push_back(make_pair("effects/glowExtractV.glsl", GL_VERTEX_SHADER)); + gGlowExtractProgram.mShaderFiles.push_back(make_pair("effects/glowExtractF.glsl", GL_FRAGMENT_SHADER)); gGlowExtractProgram.mShaderLevel = mShaderLevel[SHADER_EFFECT]; success = gGlowExtractProgram.createShader(NULL, NULL); if (!success) @@ -1321,8 +1321,8 @@ BOOL LLViewerShaderMgr::loadShadersDeferred() { gDeferredHighlightProgram.mName = "Deferred Highlight Shader"; gDeferredHighlightProgram.mShaderFiles.clear(); - gDeferredHighlightProgram.mShaderFiles.push_back(make_pair("interface/highlightV.glsl", GL_VERTEX_SHADER_ARB)); - gDeferredHighlightProgram.mShaderFiles.push_back(make_pair("deferred/highlightF.glsl", GL_FRAGMENT_SHADER_ARB)); + gDeferredHighlightProgram.mShaderFiles.push_back(make_pair("interface/highlightV.glsl", GL_VERTEX_SHADER)); + gDeferredHighlightProgram.mShaderFiles.push_back(make_pair("deferred/highlightF.glsl", GL_FRAGMENT_SHADER)); gDeferredHighlightProgram.mShaderLevel = mShaderLevel[SHADER_INTERFACE]; success = gDeferredHighlightProgram.createShader(NULL, NULL); } @@ -1331,8 +1331,8 @@ BOOL LLViewerShaderMgr::loadShadersDeferred() { gDeferredHighlightNormalProgram.mName = "Deferred Highlight Normals Shader"; gDeferredHighlightNormalProgram.mShaderFiles.clear(); - gDeferredHighlightNormalProgram.mShaderFiles.push_back(make_pair("interface/highlightNormV.glsl", GL_VERTEX_SHADER_ARB)); - gDeferredHighlightNormalProgram.mShaderFiles.push_back(make_pair("deferred/highlightF.glsl", GL_FRAGMENT_SHADER_ARB)); + gDeferredHighlightNormalProgram.mShaderFiles.push_back(make_pair("interface/highlightNormV.glsl", GL_VERTEX_SHADER)); + gDeferredHighlightNormalProgram.mShaderFiles.push_back(make_pair("deferred/highlightF.glsl", GL_FRAGMENT_SHADER)); gDeferredHighlightNormalProgram.mShaderLevel = mShaderLevel[SHADER_INTERFACE]; success = gHighlightNormalProgram.createShader(NULL, NULL); } @@ -1341,8 +1341,8 @@ BOOL LLViewerShaderMgr::loadShadersDeferred() { gDeferredHighlightSpecularProgram.mName = "Deferred Highlight Spec Shader"; gDeferredHighlightSpecularProgram.mShaderFiles.clear(); - gDeferredHighlightSpecularProgram.mShaderFiles.push_back(make_pair("interface/highlightSpecV.glsl", GL_VERTEX_SHADER_ARB)); - gDeferredHighlightSpecularProgram.mShaderFiles.push_back(make_pair("deferred/highlightF.glsl", GL_FRAGMENT_SHADER_ARB)); + gDeferredHighlightSpecularProgram.mShaderFiles.push_back(make_pair("interface/highlightSpecV.glsl", GL_VERTEX_SHADER)); + gDeferredHighlightSpecularProgram.mShaderFiles.push_back(make_pair("deferred/highlightF.glsl", GL_FRAGMENT_SHADER)); gDeferredHighlightSpecularProgram.mShaderLevel = mShaderLevel[SHADER_INTERFACE]; success = gDeferredHighlightSpecularProgram.createShader(NULL, NULL); } @@ -1353,8 +1353,8 @@ BOOL LLViewerShaderMgr::loadShadersDeferred() gDeferredDiffuseProgram.mFeatures.encodesNormal = true; gDeferredDiffuseProgram.mFeatures.hasSrgb = true; gDeferredDiffuseProgram.mShaderFiles.clear(); - gDeferredDiffuseProgram.mShaderFiles.push_back(make_pair("deferred/diffuseV.glsl", GL_VERTEX_SHADER_ARB)); - gDeferredDiffuseProgram.mShaderFiles.push_back(make_pair("deferred/diffuseIndexedF.glsl", GL_FRAGMENT_SHADER_ARB)); + gDeferredDiffuseProgram.mShaderFiles.push_back(make_pair("deferred/diffuseV.glsl", GL_VERTEX_SHADER)); + gDeferredDiffuseProgram.mShaderFiles.push_back(make_pair("deferred/diffuseIndexedF.glsl", GL_FRAGMENT_SHADER)); gDeferredDiffuseProgram.mFeatures.mIndexedTextureChannels = LLGLSLShader::sIndexedTextureChannels; gDeferredDiffuseProgram.mShaderLevel = mShaderLevel[SHADER_DEFERRED]; success = make_rigged_variant(gDeferredDiffuseProgram, gDeferredSkinnedDiffuseProgram); @@ -1366,8 +1366,8 @@ BOOL LLViewerShaderMgr::loadShadersDeferred() gDeferredDiffuseAlphaMaskProgram.mName = "Deferred Diffuse Alpha Mask Shader"; gDeferredDiffuseAlphaMaskProgram.mFeatures.encodesNormal = true; gDeferredDiffuseAlphaMaskProgram.mShaderFiles.clear(); - gDeferredDiffuseAlphaMaskProgram.mShaderFiles.push_back(make_pair("deferred/diffuseV.glsl", GL_VERTEX_SHADER_ARB)); - gDeferredDiffuseAlphaMaskProgram.mShaderFiles.push_back(make_pair("deferred/diffuseAlphaMaskIndexedF.glsl", GL_FRAGMENT_SHADER_ARB)); + gDeferredDiffuseAlphaMaskProgram.mShaderFiles.push_back(make_pair("deferred/diffuseV.glsl", GL_VERTEX_SHADER)); + gDeferredDiffuseAlphaMaskProgram.mShaderFiles.push_back(make_pair("deferred/diffuseAlphaMaskIndexedF.glsl", GL_FRAGMENT_SHADER)); gDeferredDiffuseAlphaMaskProgram.mFeatures.mIndexedTextureChannels = LLGLSLShader::sIndexedTextureChannels; gDeferredDiffuseAlphaMaskProgram.mShaderLevel = mShaderLevel[SHADER_DEFERRED]; success = make_rigged_variant(gDeferredDiffuseAlphaMaskProgram, gDeferredSkinnedDiffuseAlphaMaskProgram); @@ -1379,8 +1379,8 @@ BOOL LLViewerShaderMgr::loadShadersDeferred() gDeferredNonIndexedDiffuseAlphaMaskProgram.mName = "Deferred Diffuse Non-Indexed Alpha Mask Shader"; gDeferredNonIndexedDiffuseAlphaMaskProgram.mFeatures.encodesNormal = true; gDeferredNonIndexedDiffuseAlphaMaskProgram.mShaderFiles.clear(); - gDeferredNonIndexedDiffuseAlphaMaskProgram.mShaderFiles.push_back(make_pair("deferred/diffuseV.glsl", GL_VERTEX_SHADER_ARB)); - gDeferredNonIndexedDiffuseAlphaMaskProgram.mShaderFiles.push_back(make_pair("deferred/diffuseAlphaMaskF.glsl", GL_FRAGMENT_SHADER_ARB)); + gDeferredNonIndexedDiffuseAlphaMaskProgram.mShaderFiles.push_back(make_pair("deferred/diffuseV.glsl", GL_VERTEX_SHADER)); + gDeferredNonIndexedDiffuseAlphaMaskProgram.mShaderFiles.push_back(make_pair("deferred/diffuseAlphaMaskF.glsl", GL_FRAGMENT_SHADER)); gDeferredNonIndexedDiffuseAlphaMaskProgram.mShaderLevel = mShaderLevel[SHADER_DEFERRED]; success = gDeferredNonIndexedDiffuseAlphaMaskProgram.createShader(NULL, NULL); llassert(success); @@ -1391,8 +1391,8 @@ BOOL LLViewerShaderMgr::loadShadersDeferred() gDeferredNonIndexedDiffuseAlphaMaskNoColorProgram.mName = "Deferred Diffuse Non-Indexed Alpha Mask Shader"; gDeferredNonIndexedDiffuseAlphaMaskNoColorProgram.mFeatures.encodesNormal = true; gDeferredNonIndexedDiffuseAlphaMaskNoColorProgram.mShaderFiles.clear(); - gDeferredNonIndexedDiffuseAlphaMaskNoColorProgram.mShaderFiles.push_back(make_pair("deferred/diffuseNoColorV.glsl", GL_VERTEX_SHADER_ARB)); - gDeferredNonIndexedDiffuseAlphaMaskNoColorProgram.mShaderFiles.push_back(make_pair("deferred/diffuseAlphaMaskNoColorF.glsl", GL_FRAGMENT_SHADER_ARB)); + gDeferredNonIndexedDiffuseAlphaMaskNoColorProgram.mShaderFiles.push_back(make_pair("deferred/diffuseNoColorV.glsl", GL_VERTEX_SHADER)); + gDeferredNonIndexedDiffuseAlphaMaskNoColorProgram.mShaderFiles.push_back(make_pair("deferred/diffuseAlphaMaskNoColorF.glsl", GL_FRAGMENT_SHADER)); gDeferredNonIndexedDiffuseAlphaMaskNoColorProgram.mShaderLevel = mShaderLevel[SHADER_DEFERRED]; success = gDeferredNonIndexedDiffuseAlphaMaskNoColorProgram.createShader(NULL, NULL); llassert(success); @@ -1404,8 +1404,8 @@ BOOL LLViewerShaderMgr::loadShadersDeferred() gDeferredNonIndexedDiffuseProgram.mShaderFiles.clear(); gDeferredNonIndexedDiffuseProgram.mFeatures.encodesNormal = true; gDeferredNonIndexedDiffuseProgram.mFeatures.hasSrgb = true; - gDeferredNonIndexedDiffuseProgram.mShaderFiles.push_back(make_pair("deferred/diffuseV.glsl", GL_VERTEX_SHADER_ARB)); - gDeferredNonIndexedDiffuseProgram.mShaderFiles.push_back(make_pair("deferred/diffuseF.glsl", GL_FRAGMENT_SHADER_ARB)); + gDeferredNonIndexedDiffuseProgram.mShaderFiles.push_back(make_pair("deferred/diffuseV.glsl", GL_VERTEX_SHADER)); + gDeferredNonIndexedDiffuseProgram.mShaderFiles.push_back(make_pair("deferred/diffuseF.glsl", GL_FRAGMENT_SHADER)); gDeferredNonIndexedDiffuseProgram.mShaderLevel = mShaderLevel[SHADER_DEFERRED]; success = gDeferredNonIndexedDiffuseProgram.createShader(NULL, NULL); llassert(success); @@ -1416,8 +1416,8 @@ BOOL LLViewerShaderMgr::loadShadersDeferred() gDeferredBumpProgram.mName = "Deferred Bump Shader"; gDeferredBumpProgram.mFeatures.encodesNormal = true; gDeferredBumpProgram.mShaderFiles.clear(); - gDeferredBumpProgram.mShaderFiles.push_back(make_pair("deferred/bumpV.glsl", GL_VERTEX_SHADER_ARB)); - gDeferredBumpProgram.mShaderFiles.push_back(make_pair("deferred/bumpF.glsl", GL_FRAGMENT_SHADER_ARB)); + gDeferredBumpProgram.mShaderFiles.push_back(make_pair("deferred/bumpV.glsl", GL_VERTEX_SHADER)); + gDeferredBumpProgram.mShaderFiles.push_back(make_pair("deferred/bumpF.glsl", GL_FRAGMENT_SHADER)); gDeferredBumpProgram.mShaderLevel = mShaderLevel[SHADER_DEFERRED]; success = make_rigged_variant(gDeferredBumpProgram, gDeferredSkinnedBumpProgram); success = success && gDeferredBumpProgram.createShader(NULL, NULL); @@ -1453,8 +1453,8 @@ BOOL LLViewerShaderMgr::loadShadersDeferred() U32 alpha_mode = i & 0x3; gDeferredMaterialProgram[i].mShaderFiles.clear(); - gDeferredMaterialProgram[i].mShaderFiles.push_back(make_pair("deferred/materialV.glsl", GL_VERTEX_SHADER_ARB)); - gDeferredMaterialProgram[i].mShaderFiles.push_back(make_pair("deferred/materialF.glsl", GL_FRAGMENT_SHADER_ARB)); + gDeferredMaterialProgram[i].mShaderFiles.push_back(make_pair("deferred/materialV.glsl", GL_VERTEX_SHADER)); + gDeferredMaterialProgram[i].mShaderFiles.push_back(make_pair("deferred/materialF.glsl", GL_FRAGMENT_SHADER)); gDeferredMaterialProgram[i].mShaderLevel = mShaderLevel[SHADER_DEFERRED]; gDeferredMaterialProgram[i].clearPermutations(); @@ -1532,8 +1532,8 @@ BOOL LLViewerShaderMgr::loadShadersDeferred() U32 alpha_mode = i & 0x3; gDeferredMaterialWaterProgram[i].mShaderFiles.clear(); - gDeferredMaterialWaterProgram[i].mShaderFiles.push_back(make_pair("deferred/materialV.glsl", GL_VERTEX_SHADER_ARB)); - gDeferredMaterialWaterProgram[i].mShaderFiles.push_back(make_pair("deferred/materialF.glsl", GL_FRAGMENT_SHADER_ARB)); + gDeferredMaterialWaterProgram[i].mShaderFiles.push_back(make_pair("deferred/materialV.glsl", GL_VERTEX_SHADER)); + gDeferredMaterialWaterProgram[i].mShaderFiles.push_back(make_pair("deferred/materialF.glsl", GL_FRAGMENT_SHADER)); gDeferredMaterialWaterProgram[i].mShaderLevel = mShaderLevel[SHADER_DEFERRED]; gDeferredMaterialWaterProgram[i].mShaderGroup = LLGLSLShader::SG_WATER; @@ -1634,8 +1634,8 @@ BOOL LLViewerShaderMgr::loadShadersDeferred() gDeferredTreeProgram.mName = "Deferred Tree Shader"; gDeferredTreeProgram.mShaderFiles.clear(); gDeferredTreeProgram.mFeatures.encodesNormal = true; - gDeferredTreeProgram.mShaderFiles.push_back(make_pair("deferred/treeV.glsl", GL_VERTEX_SHADER_ARB)); - gDeferredTreeProgram.mShaderFiles.push_back(make_pair("deferred/treeF.glsl", GL_FRAGMENT_SHADER_ARB)); + gDeferredTreeProgram.mShaderFiles.push_back(make_pair("deferred/treeV.glsl", GL_VERTEX_SHADER)); + gDeferredTreeProgram.mShaderFiles.push_back(make_pair("deferred/treeF.glsl", GL_FRAGMENT_SHADER)); gDeferredTreeProgram.mShaderLevel = mShaderLevel[SHADER_DEFERRED]; success = gDeferredTreeProgram.createShader(NULL, NULL); } @@ -1646,8 +1646,8 @@ BOOL LLViewerShaderMgr::loadShadersDeferred() gDeferredTreeShadowProgram.mShaderFiles.clear(); gDeferredTreeShadowProgram.mFeatures.isDeferred = true; gDeferredTreeShadowProgram.mFeatures.hasShadows = true; - gDeferredTreeShadowProgram.mShaderFiles.push_back(make_pair("deferred/treeShadowV.glsl", GL_VERTEX_SHADER_ARB)); - gDeferredTreeShadowProgram.mShaderFiles.push_back(make_pair("deferred/treeShadowF.glsl", GL_FRAGMENT_SHADER_ARB)); + gDeferredTreeShadowProgram.mShaderFiles.push_back(make_pair("deferred/treeShadowV.glsl", GL_VERTEX_SHADER)); + gDeferredTreeShadowProgram.mShaderFiles.push_back(make_pair("deferred/treeShadowF.glsl", GL_FRAGMENT_SHADER)); gDeferredTreeShadowProgram.mShaderLevel = mShaderLevel[SHADER_DEFERRED]; gDeferredTreeShadowProgram.mRiggedVariant = &gDeferredSkinnedTreeShadowProgram; success = gDeferredTreeShadowProgram.createShader(NULL, NULL); @@ -1661,8 +1661,8 @@ BOOL LLViewerShaderMgr::loadShadersDeferred() gDeferredSkinnedTreeShadowProgram.mFeatures.isDeferred = true; gDeferredSkinnedTreeShadowProgram.mFeatures.hasShadows = true; gDeferredSkinnedTreeShadowProgram.mFeatures.hasObjectSkinning = true; - gDeferredSkinnedTreeShadowProgram.mShaderFiles.push_back(make_pair("deferred/treeShadowSkinnedV.glsl", GL_VERTEX_SHADER_ARB)); - gDeferredSkinnedTreeShadowProgram.mShaderFiles.push_back(make_pair("deferred/treeShadowF.glsl", GL_FRAGMENT_SHADER_ARB)); + gDeferredSkinnedTreeShadowProgram.mShaderFiles.push_back(make_pair("deferred/treeShadowSkinnedV.glsl", GL_VERTEX_SHADER)); + gDeferredSkinnedTreeShadowProgram.mShaderFiles.push_back(make_pair("deferred/treeShadowF.glsl", GL_FRAGMENT_SHADER)); gDeferredSkinnedTreeShadowProgram.mShaderLevel = mShaderLevel[SHADER_DEFERRED]; success = gDeferredSkinnedTreeShadowProgram.createShader(NULL, NULL); llassert(success); @@ -1675,8 +1675,8 @@ BOOL LLViewerShaderMgr::loadShadersDeferred() gDeferredImpostorProgram.mFeatures.encodesNormal = true; //gDeferredImpostorProgram.mFeatures.isDeferred = true; gDeferredImpostorProgram.mShaderFiles.clear(); - gDeferredImpostorProgram.mShaderFiles.push_back(make_pair("deferred/impostorV.glsl", GL_VERTEX_SHADER_ARB)); - gDeferredImpostorProgram.mShaderFiles.push_back(make_pair("deferred/impostorF.glsl", GL_FRAGMENT_SHADER_ARB)); + gDeferredImpostorProgram.mShaderFiles.push_back(make_pair("deferred/impostorV.glsl", GL_VERTEX_SHADER)); + gDeferredImpostorProgram.mShaderFiles.push_back(make_pair("deferred/impostorF.glsl", GL_FRAGMENT_SHADER)); gDeferredImpostorProgram.mShaderLevel = mShaderLevel[SHADER_DEFERRED]; success = gDeferredImpostorProgram.createShader(NULL, NULL); llassert(success); @@ -1690,8 +1690,8 @@ BOOL LLViewerShaderMgr::loadShadersDeferred() gDeferredLightProgram.mFeatures.hasSrgb = true; gDeferredLightProgram.mShaderFiles.clear(); - gDeferredLightProgram.mShaderFiles.push_back(make_pair("deferred/pointLightV.glsl", GL_VERTEX_SHADER_ARB)); - gDeferredLightProgram.mShaderFiles.push_back(make_pair("deferred/pointLightF.glsl", GL_FRAGMENT_SHADER_ARB)); + gDeferredLightProgram.mShaderFiles.push_back(make_pair("deferred/pointLightV.glsl", GL_VERTEX_SHADER)); + gDeferredLightProgram.mShaderFiles.push_back(make_pair("deferred/pointLightF.glsl", GL_FRAGMENT_SHADER)); gDeferredLightProgram.mShaderLevel = mShaderLevel[SHADER_DEFERRED]; gDeferredLightProgram.clearPermutations(); @@ -1726,8 +1726,8 @@ BOOL LLViewerShaderMgr::loadShadersDeferred() gDeferredMultiLightProgram[i].clearPermutations(); gDeferredMultiLightProgram[i].mShaderFiles.clear(); - gDeferredMultiLightProgram[i].mShaderFiles.push_back(make_pair("deferred/multiPointLightV.glsl", GL_VERTEX_SHADER_ARB)); - gDeferredMultiLightProgram[i].mShaderFiles.push_back(make_pair("deferred/multiPointLightF.glsl", GL_FRAGMENT_SHADER_ARB)); + gDeferredMultiLightProgram[i].mShaderFiles.push_back(make_pair("deferred/multiPointLightV.glsl", GL_VERTEX_SHADER)); + gDeferredMultiLightProgram[i].mShaderFiles.push_back(make_pair("deferred/multiPointLightF.glsl", GL_FRAGMENT_SHADER)); gDeferredMultiLightProgram[i].mShaderLevel = mShaderLevel[SHADER_DEFERRED]; gDeferredMultiLightProgram[i].addPermutation("LIGHT_COUNT", llformat("%d", i+1)); @@ -1760,8 +1760,8 @@ BOOL LLViewerShaderMgr::loadShadersDeferred() gDeferredSpotLightProgram.mFeatures.hasShadows = true; gDeferredSpotLightProgram.clearPermutations(); - gDeferredSpotLightProgram.mShaderFiles.push_back(make_pair("deferred/pointLightV.glsl", GL_VERTEX_SHADER_ARB)); - gDeferredSpotLightProgram.mShaderFiles.push_back(make_pair("deferred/spotLightF.glsl", GL_FRAGMENT_SHADER_ARB)); + gDeferredSpotLightProgram.mShaderFiles.push_back(make_pair("deferred/pointLightV.glsl", GL_VERTEX_SHADER)); + gDeferredSpotLightProgram.mShaderFiles.push_back(make_pair("deferred/spotLightF.glsl", GL_FRAGMENT_SHADER)); gDeferredSpotLightProgram.mShaderLevel = mShaderLevel[SHADER_DEFERRED]; if (ambient_kill) @@ -1792,8 +1792,8 @@ BOOL LLViewerShaderMgr::loadShadersDeferred() gDeferredMultiSpotLightProgram.clearPermutations(); gDeferredMultiSpotLightProgram.mShaderFiles.clear(); - gDeferredMultiSpotLightProgram.mShaderFiles.push_back(make_pair("deferred/multiPointLightV.glsl", GL_VERTEX_SHADER_ARB)); - gDeferredMultiSpotLightProgram.mShaderFiles.push_back(make_pair("deferred/multiSpotLightF.glsl", GL_FRAGMENT_SHADER_ARB)); + gDeferredMultiSpotLightProgram.mShaderFiles.push_back(make_pair("deferred/multiPointLightV.glsl", GL_VERTEX_SHADER)); + gDeferredMultiSpotLightProgram.mShaderFiles.push_back(make_pair("deferred/multiSpotLightF.glsl", GL_FRAGMENT_SHADER)); gDeferredMultiSpotLightProgram.mShaderLevel = mShaderLevel[SHADER_DEFERRED]; if (local_light_kill) @@ -1832,8 +1832,8 @@ BOOL LLViewerShaderMgr::loadShadersDeferred() gDeferredSunProgram.mName = "Deferred Sun Shader"; gDeferredSunProgram.mShaderFiles.clear(); - gDeferredSunProgram.mShaderFiles.push_back(make_pair(vertex, GL_VERTEX_SHADER_ARB)); - gDeferredSunProgram.mShaderFiles.push_back(make_pair(fragment, GL_FRAGMENT_SHADER_ARB)); + gDeferredSunProgram.mShaderFiles.push_back(make_pair(vertex, GL_VERTEX_SHADER)); + gDeferredSunProgram.mShaderFiles.push_back(make_pair(fragment, GL_FRAGMENT_SHADER)); gDeferredSunProgram.mShaderLevel = mShaderLevel[SHADER_DEFERRED]; success = gDeferredSunProgram.createShader(NULL, NULL); @@ -1846,8 +1846,8 @@ BOOL LLViewerShaderMgr::loadShadersDeferred() gDeferredBlurLightProgram.mFeatures.isDeferred = true; gDeferredBlurLightProgram.mShaderFiles.clear(); - gDeferredBlurLightProgram.mShaderFiles.push_back(make_pair("deferred/blurLightV.glsl", GL_VERTEX_SHADER_ARB)); - gDeferredBlurLightProgram.mShaderFiles.push_back(make_pair("deferred/blurLightF.glsl", GL_FRAGMENT_SHADER_ARB)); + gDeferredBlurLightProgram.mShaderFiles.push_back(make_pair("deferred/blurLightV.glsl", GL_VERTEX_SHADER)); + gDeferredBlurLightProgram.mShaderFiles.push_back(make_pair("deferred/blurLightF.glsl", GL_FRAGMENT_SHADER)); gDeferredBlurLightProgram.mShaderLevel = mShaderLevel[SHADER_DEFERRED]; success = gDeferredBlurLightProgram.createShader(NULL, NULL); @@ -1895,8 +1895,8 @@ BOOL LLViewerShaderMgr::loadShadersDeferred() } shader->mShaderFiles.clear(); - shader->mShaderFiles.push_back(make_pair("deferred/alphaV.glsl", GL_VERTEX_SHADER_ARB)); - shader->mShaderFiles.push_back(make_pair("deferred/alphaF.glsl", GL_FRAGMENT_SHADER_ARB)); + shader->mShaderFiles.push_back(make_pair("deferred/alphaV.glsl", GL_VERTEX_SHADER)); + shader->mShaderFiles.push_back(make_pair("deferred/alphaF.glsl", GL_FRAGMENT_SHADER)); shader->clearPermutations(); shader->addPermutation("USE_VERTEX_COLOR", "1"); @@ -1971,8 +1971,8 @@ BOOL LLViewerShaderMgr::loadShadersDeferred() } shader->mShaderFiles.clear(); - shader->mShaderFiles.push_back(make_pair("deferred/alphaV.glsl", GL_VERTEX_SHADER_ARB)); - shader->mShaderFiles.push_back(make_pair("deferred/alphaF.glsl", GL_FRAGMENT_SHADER_ARB)); + shader->mShaderFiles.push_back(make_pair("deferred/alphaV.glsl", GL_VERTEX_SHADER)); + shader->mShaderFiles.push_back(make_pair("deferred/alphaF.glsl", GL_FRAGMENT_SHADER)); shader->clearPermutations(); shader->addPermutation("USE_INDEXED_TEX", "1"); @@ -2042,8 +2042,8 @@ BOOL LLViewerShaderMgr::loadShadersDeferred() } shader[i]->mShaderGroup = LLGLSLShader::SG_WATER; shader[i]->mShaderFiles.clear(); - shader[i]->mShaderFiles.push_back(make_pair("deferred/alphaV.glsl", GL_VERTEX_SHADER_ARB)); - shader[i]->mShaderFiles.push_back(make_pair("deferred/alphaF.glsl", GL_FRAGMENT_SHADER_ARB)); + shader[i]->mShaderFiles.push_back(make_pair("deferred/alphaV.glsl", GL_VERTEX_SHADER)); + shader[i]->mShaderFiles.push_back(make_pair("deferred/alphaF.glsl", GL_FRAGMENT_SHADER)); shader[i]->clearPermutations(); shader[i]->addPermutation("USE_INDEXED_TEX", "1"); @@ -2102,8 +2102,8 @@ BOOL LLViewerShaderMgr::loadShadersDeferred() gDeferredAvatarEyesProgram.mFeatures.hasShadows = true; gDeferredAvatarEyesProgram.mShaderFiles.clear(); - gDeferredAvatarEyesProgram.mShaderFiles.push_back(make_pair("deferred/avatarEyesV.glsl", GL_VERTEX_SHADER_ARB)); - gDeferredAvatarEyesProgram.mShaderFiles.push_back(make_pair("deferred/diffuseF.glsl", GL_FRAGMENT_SHADER_ARB)); + gDeferredAvatarEyesProgram.mShaderFiles.push_back(make_pair("deferred/avatarEyesV.glsl", GL_VERTEX_SHADER)); + gDeferredAvatarEyesProgram.mShaderFiles.push_back(make_pair("deferred/diffuseF.glsl", GL_FRAGMENT_SHADER)); gDeferredAvatarEyesProgram.mShaderLevel = mShaderLevel[SHADER_DEFERRED]; success = gDeferredAvatarEyesProgram.createShader(NULL, NULL); llassert(success); @@ -2118,8 +2118,8 @@ BOOL LLViewerShaderMgr::loadShadersDeferred() gDeferredFullbrightProgram.mFeatures.hasSrgb = true; gDeferredFullbrightProgram.mFeatures.mIndexedTextureChannels = LLGLSLShader::sIndexedTextureChannels; gDeferredFullbrightProgram.mShaderFiles.clear(); - gDeferredFullbrightProgram.mShaderFiles.push_back(make_pair("deferred/fullbrightV.glsl", GL_VERTEX_SHADER_ARB)); - gDeferredFullbrightProgram.mShaderFiles.push_back(make_pair("deferred/fullbrightF.glsl", GL_FRAGMENT_SHADER_ARB)); + gDeferredFullbrightProgram.mShaderFiles.push_back(make_pair("deferred/fullbrightV.glsl", GL_VERTEX_SHADER)); + gDeferredFullbrightProgram.mShaderFiles.push_back(make_pair("deferred/fullbrightF.glsl", GL_FRAGMENT_SHADER)); gDeferredFullbrightProgram.mShaderLevel = mShaderLevel[SHADER_DEFERRED]; success = make_rigged_variant(gDeferredFullbrightProgram, gDeferredSkinnedFullbrightProgram); success = gDeferredFullbrightProgram.createShader(NULL, NULL); @@ -2135,8 +2135,8 @@ BOOL LLViewerShaderMgr::loadShadersDeferred() gDeferredFullbrightAlphaMaskProgram.mFeatures.hasSrgb = true; gDeferredFullbrightAlphaMaskProgram.mFeatures.mIndexedTextureChannels = LLGLSLShader::sIndexedTextureChannels; gDeferredFullbrightAlphaMaskProgram.mShaderFiles.clear(); - gDeferredFullbrightAlphaMaskProgram.mShaderFiles.push_back(make_pair("deferred/fullbrightV.glsl", GL_VERTEX_SHADER_ARB)); - gDeferredFullbrightAlphaMaskProgram.mShaderFiles.push_back(make_pair("deferred/fullbrightF.glsl", GL_FRAGMENT_SHADER_ARB)); + gDeferredFullbrightAlphaMaskProgram.mShaderFiles.push_back(make_pair("deferred/fullbrightV.glsl", GL_VERTEX_SHADER)); + gDeferredFullbrightAlphaMaskProgram.mShaderFiles.push_back(make_pair("deferred/fullbrightF.glsl", GL_FRAGMENT_SHADER)); gDeferredFullbrightAlphaMaskProgram.addPermutation("HAS_ALPHA_MASK","1"); gDeferredFullbrightAlphaMaskProgram.mShaderLevel = mShaderLevel[SHADER_DEFERRED]; success = make_rigged_variant(gDeferredFullbrightAlphaMaskProgram, gDeferredSkinnedFullbrightAlphaMaskProgram); @@ -2154,8 +2154,8 @@ BOOL LLViewerShaderMgr::loadShadersDeferred() gDeferredFullbrightWaterProgram.mFeatures.hasSrgb = true; gDeferredFullbrightWaterProgram.mFeatures.mIndexedTextureChannels = LLGLSLShader::sIndexedTextureChannels; gDeferredFullbrightWaterProgram.mShaderFiles.clear(); - gDeferredFullbrightWaterProgram.mShaderFiles.push_back(make_pair("deferred/fullbrightV.glsl", GL_VERTEX_SHADER_ARB)); - gDeferredFullbrightWaterProgram.mShaderFiles.push_back(make_pair("deferred/fullbrightF.glsl", GL_FRAGMENT_SHADER_ARB)); + gDeferredFullbrightWaterProgram.mShaderFiles.push_back(make_pair("deferred/fullbrightV.glsl", GL_VERTEX_SHADER)); + gDeferredFullbrightWaterProgram.mShaderFiles.push_back(make_pair("deferred/fullbrightF.glsl", GL_FRAGMENT_SHADER)); gDeferredFullbrightWaterProgram.mShaderLevel = mShaderLevel[SHADER_DEFERRED]; gDeferredFullbrightWaterProgram.mShaderGroup = LLGLSLShader::SG_WATER; gDeferredFullbrightWaterProgram.addPermutation("WATER_FOG","1"); @@ -2174,8 +2174,8 @@ BOOL LLViewerShaderMgr::loadShadersDeferred() gDeferredFullbrightAlphaMaskWaterProgram.mFeatures.hasSrgb = true; gDeferredFullbrightAlphaMaskWaterProgram.mFeatures.mIndexedTextureChannels = LLGLSLShader::sIndexedTextureChannels; gDeferredFullbrightAlphaMaskWaterProgram.mShaderFiles.clear(); - gDeferredFullbrightAlphaMaskWaterProgram.mShaderFiles.push_back(make_pair("deferred/fullbrightV.glsl", GL_VERTEX_SHADER_ARB)); - gDeferredFullbrightAlphaMaskWaterProgram.mShaderFiles.push_back(make_pair("deferred/fullbrightF.glsl", GL_FRAGMENT_SHADER_ARB)); + gDeferredFullbrightAlphaMaskWaterProgram.mShaderFiles.push_back(make_pair("deferred/fullbrightV.glsl", GL_VERTEX_SHADER)); + gDeferredFullbrightAlphaMaskWaterProgram.mShaderFiles.push_back(make_pair("deferred/fullbrightF.glsl", GL_FRAGMENT_SHADER)); gDeferredFullbrightAlphaMaskWaterProgram.mShaderLevel = mShaderLevel[SHADER_DEFERRED]; gDeferredFullbrightAlphaMaskWaterProgram.mShaderGroup = LLGLSLShader::SG_WATER; gDeferredFullbrightAlphaMaskWaterProgram.addPermutation("HAS_ALPHA_MASK","1"); @@ -2195,8 +2195,8 @@ BOOL LLViewerShaderMgr::loadShadersDeferred() gDeferredFullbrightShinyProgram.mFeatures.hasSrgb = true; gDeferredFullbrightShinyProgram.mFeatures.mIndexedTextureChannels = LLGLSLShader::sIndexedTextureChannels-1; gDeferredFullbrightShinyProgram.mShaderFiles.clear(); - gDeferredFullbrightShinyProgram.mShaderFiles.push_back(make_pair("deferred/fullbrightShinyV.glsl", GL_VERTEX_SHADER_ARB)); - gDeferredFullbrightShinyProgram.mShaderFiles.push_back(make_pair("deferred/fullbrightShinyF.glsl", GL_FRAGMENT_SHADER_ARB)); + gDeferredFullbrightShinyProgram.mShaderFiles.push_back(make_pair("deferred/fullbrightShinyV.glsl", GL_VERTEX_SHADER)); + gDeferredFullbrightShinyProgram.mShaderFiles.push_back(make_pair("deferred/fullbrightShinyF.glsl", GL_FRAGMENT_SHADER)); gDeferredFullbrightShinyProgram.mShaderLevel = mShaderLevel[SHADER_DEFERRED]; success = make_rigged_variant(gDeferredFullbrightShinyProgram, gDeferredSkinnedFullbrightShinyProgram); success = success && gDeferredFullbrightShinyProgram.createShader(NULL, NULL); @@ -2211,8 +2211,8 @@ BOOL LLViewerShaderMgr::loadShadersDeferred() gDeferredEmissiveProgram.mFeatures.hasTransport = true; gDeferredEmissiveProgram.mFeatures.mIndexedTextureChannels = LLGLSLShader::sIndexedTextureChannels; gDeferredEmissiveProgram.mShaderFiles.clear(); - gDeferredEmissiveProgram.mShaderFiles.push_back(make_pair("deferred/emissiveV.glsl", GL_VERTEX_SHADER_ARB)); - gDeferredEmissiveProgram.mShaderFiles.push_back(make_pair("deferred/emissiveF.glsl", GL_FRAGMENT_SHADER_ARB)); + gDeferredEmissiveProgram.mShaderFiles.push_back(make_pair("deferred/emissiveV.glsl", GL_VERTEX_SHADER)); + gDeferredEmissiveProgram.mShaderFiles.push_back(make_pair("deferred/emissiveF.glsl", GL_FRAGMENT_SHADER)); gDeferredEmissiveProgram.mShaderLevel = mShaderLevel[SHADER_DEFERRED]; success = make_rigged_variant(gDeferredEmissiveProgram, gDeferredSkinnedEmissiveProgram); success = success && gDeferredEmissiveProgram.createShader(NULL, NULL); @@ -2230,8 +2230,8 @@ BOOL LLViewerShaderMgr::loadShadersDeferred() gDeferredWaterProgram.mFeatures.hasSrgb = true; gDeferredWaterProgram.mShaderFiles.clear(); - gDeferredWaterProgram.mShaderFiles.push_back(make_pair("deferred/waterV.glsl", GL_VERTEX_SHADER_ARB)); - gDeferredWaterProgram.mShaderFiles.push_back(make_pair("deferred/waterF.glsl", GL_FRAGMENT_SHADER_ARB)); + gDeferredWaterProgram.mShaderFiles.push_back(make_pair("deferred/waterV.glsl", GL_VERTEX_SHADER)); + gDeferredWaterProgram.mShaderFiles.push_back(make_pair("deferred/waterF.glsl", GL_FRAGMENT_SHADER)); gDeferredWaterProgram.mShaderLevel = mShaderLevel[SHADER_DEFERRED]; gDeferredWaterProgram.mShaderGroup = LLGLSLShader::SG_WATER; success = gDeferredWaterProgram.createShader(NULL, NULL); @@ -2251,8 +2251,8 @@ BOOL LLViewerShaderMgr::loadShadersDeferred() //gDeferredUnderWaterProgram.mFeatures.hasShadows = true; gDeferredUnderWaterProgram.mShaderFiles.clear(); - gDeferredUnderWaterProgram.mShaderFiles.push_back(make_pair("deferred/waterV.glsl", GL_VERTEX_SHADER_ARB)); - gDeferredUnderWaterProgram.mShaderFiles.push_back(make_pair("deferred/underWaterF.glsl", GL_FRAGMENT_SHADER_ARB)); + gDeferredUnderWaterProgram.mShaderFiles.push_back(make_pair("deferred/waterV.glsl", GL_VERTEX_SHADER)); + gDeferredUnderWaterProgram.mShaderFiles.push_back(make_pair("deferred/underWaterF.glsl", GL_FRAGMENT_SHADER)); gDeferredUnderWaterProgram.mShaderLevel = mShaderLevel[SHADER_DEFERRED]; gDeferredUnderWaterProgram.mShaderGroup = LLGLSLShader::SG_WATER; success = gDeferredUnderWaterProgram.createShader(NULL, NULL); @@ -2272,8 +2272,8 @@ BOOL LLViewerShaderMgr::loadShadersDeferred() gDeferredSoftenProgram.mFeatures.hasShadows = use_sun_shadow; gDeferredSoftenProgram.clearPermutations(); - gDeferredSoftenProgram.mShaderFiles.push_back(make_pair("deferred/softenLightV.glsl", GL_VERTEX_SHADER_ARB)); - gDeferredSoftenProgram.mShaderFiles.push_back(make_pair("deferred/softenLightF.glsl", GL_FRAGMENT_SHADER_ARB)); + gDeferredSoftenProgram.mShaderFiles.push_back(make_pair("deferred/softenLightV.glsl", GL_VERTEX_SHADER)); + gDeferredSoftenProgram.mShaderFiles.push_back(make_pair("deferred/softenLightF.glsl", GL_FRAGMENT_SHADER)); gDeferredSoftenProgram.mShaderLevel = mShaderLevel[SHADER_DEFERRED]; @@ -2305,8 +2305,8 @@ BOOL LLViewerShaderMgr::loadShadersDeferred() { gDeferredSoftenWaterProgram.mName = "Deferred Soften Underwater Shader"; gDeferredSoftenWaterProgram.mShaderFiles.clear(); - gDeferredSoftenWaterProgram.mShaderFiles.push_back(make_pair("deferred/softenLightV.glsl", GL_VERTEX_SHADER_ARB)); - gDeferredSoftenWaterProgram.mShaderFiles.push_back(make_pair("deferred/softenLightF.glsl", GL_FRAGMENT_SHADER_ARB)); + gDeferredSoftenWaterProgram.mShaderFiles.push_back(make_pair("deferred/softenLightV.glsl", GL_VERTEX_SHADER)); + gDeferredSoftenWaterProgram.mShaderFiles.push_back(make_pair("deferred/softenLightF.glsl", GL_FRAGMENT_SHADER)); gDeferredSoftenWaterProgram.clearPermutations(); gDeferredSoftenWaterProgram.mShaderLevel = mShaderLevel[SHADER_DEFERRED]; @@ -2351,8 +2351,8 @@ BOOL LLViewerShaderMgr::loadShadersDeferred() gDeferredShadowProgram.mFeatures.isDeferred = true; gDeferredShadowProgram.mFeatures.hasShadows = true; gDeferredShadowProgram.mShaderFiles.clear(); - gDeferredShadowProgram.mShaderFiles.push_back(make_pair("deferred/shadowV.glsl", GL_VERTEX_SHADER_ARB)); - gDeferredShadowProgram.mShaderFiles.push_back(make_pair("deferred/shadowF.glsl", GL_FRAGMENT_SHADER_ARB)); + gDeferredShadowProgram.mShaderFiles.push_back(make_pair("deferred/shadowV.glsl", GL_VERTEX_SHADER)); + gDeferredShadowProgram.mShaderFiles.push_back(make_pair("deferred/shadowF.glsl", GL_FRAGMENT_SHADER)); gDeferredShadowProgram.mShaderLevel = mShaderLevel[SHADER_DEFERRED]; if (gGLManager.mHasDepthClamp) { @@ -2370,8 +2370,8 @@ BOOL LLViewerShaderMgr::loadShadersDeferred() gDeferredSkinnedShadowProgram.mFeatures.hasShadows = true; gDeferredSkinnedShadowProgram.mFeatures.hasObjectSkinning = true; gDeferredSkinnedShadowProgram.mShaderFiles.clear(); - gDeferredSkinnedShadowProgram.mShaderFiles.push_back(make_pair("deferred/shadowSkinnedV.glsl", GL_VERTEX_SHADER_ARB)); - gDeferredSkinnedShadowProgram.mShaderFiles.push_back(make_pair("deferred/shadowF.glsl", GL_FRAGMENT_SHADER_ARB)); + gDeferredSkinnedShadowProgram.mShaderFiles.push_back(make_pair("deferred/shadowSkinnedV.glsl", GL_VERTEX_SHADER)); + gDeferredSkinnedShadowProgram.mShaderFiles.push_back(make_pair("deferred/shadowF.glsl", GL_FRAGMENT_SHADER)); gDeferredSkinnedShadowProgram.mShaderLevel = mShaderLevel[SHADER_DEFERRED]; if (gGLManager.mHasDepthClamp) { @@ -2387,8 +2387,8 @@ BOOL LLViewerShaderMgr::loadShadersDeferred() gDeferredShadowCubeProgram.mFeatures.isDeferred = true; gDeferredShadowCubeProgram.mFeatures.hasShadows = true; gDeferredShadowCubeProgram.mShaderFiles.clear(); - gDeferredShadowCubeProgram.mShaderFiles.push_back(make_pair("deferred/shadowCubeV.glsl", GL_VERTEX_SHADER_ARB)); - gDeferredShadowCubeProgram.mShaderFiles.push_back(make_pair("deferred/shadowF.glsl", GL_FRAGMENT_SHADER_ARB)); + gDeferredShadowCubeProgram.mShaderFiles.push_back(make_pair("deferred/shadowCubeV.glsl", GL_VERTEX_SHADER)); + gDeferredShadowCubeProgram.mShaderFiles.push_back(make_pair("deferred/shadowF.glsl", GL_FRAGMENT_SHADER)); if (gGLManager.mHasDepthClamp) { gDeferredShadowCubeProgram.addPermutation("DEPTH_CLAMP", "1"); @@ -2404,8 +2404,8 @@ BOOL LLViewerShaderMgr::loadShadersDeferred() gDeferredShadowFullbrightAlphaMaskProgram.mFeatures.mIndexedTextureChannels = LLGLSLShader::sIndexedTextureChannels; gDeferredShadowFullbrightAlphaMaskProgram.mShaderFiles.clear(); - gDeferredShadowFullbrightAlphaMaskProgram.mShaderFiles.push_back(make_pair("deferred/shadowAlphaMaskV.glsl", GL_VERTEX_SHADER_ARB)); - gDeferredShadowFullbrightAlphaMaskProgram.mShaderFiles.push_back(make_pair("deferred/shadowAlphaMaskF.glsl", GL_FRAGMENT_SHADER_ARB)); + gDeferredShadowFullbrightAlphaMaskProgram.mShaderFiles.push_back(make_pair("deferred/shadowAlphaMaskV.glsl", GL_VERTEX_SHADER)); + gDeferredShadowFullbrightAlphaMaskProgram.mShaderFiles.push_back(make_pair("deferred/shadowAlphaMaskF.glsl", GL_FRAGMENT_SHADER)); gDeferredShadowFullbrightAlphaMaskProgram.clearPermutations(); if (gGLManager.mHasDepthClamp) @@ -2425,8 +2425,8 @@ BOOL LLViewerShaderMgr::loadShadersDeferred() gDeferredSkinnedShadowFullbrightAlphaMaskProgram.mFeatures.mIndexedTextureChannels = LLGLSLShader::sIndexedTextureChannels; gDeferredSkinnedShadowFullbrightAlphaMaskProgram.mFeatures.hasObjectSkinning = true; gDeferredSkinnedShadowFullbrightAlphaMaskProgram.mShaderFiles.clear(); - gDeferredSkinnedShadowFullbrightAlphaMaskProgram.mShaderFiles.push_back(make_pair("deferred/shadowAlphaMaskSkinnedV.glsl", GL_VERTEX_SHADER_ARB)); - gDeferredSkinnedShadowFullbrightAlphaMaskProgram.mShaderFiles.push_back(make_pair("deferred/shadowAlphaMaskF.glsl", GL_FRAGMENT_SHADER_ARB)); + gDeferredSkinnedShadowFullbrightAlphaMaskProgram.mShaderFiles.push_back(make_pair("deferred/shadowAlphaMaskSkinnedV.glsl", GL_VERTEX_SHADER)); + gDeferredSkinnedShadowFullbrightAlphaMaskProgram.mShaderFiles.push_back(make_pair("deferred/shadowAlphaMaskF.glsl", GL_FRAGMENT_SHADER)); gDeferredSkinnedShadowFullbrightAlphaMaskProgram.clearPermutations(); if (gGLManager.mHasDepthClamp) @@ -2445,8 +2445,8 @@ BOOL LLViewerShaderMgr::loadShadersDeferred() gDeferredShadowAlphaMaskProgram.mFeatures.mIndexedTextureChannels = LLGLSLShader::sIndexedTextureChannels; gDeferredShadowAlphaMaskProgram.mShaderFiles.clear(); - gDeferredShadowAlphaMaskProgram.mShaderFiles.push_back(make_pair("deferred/shadowAlphaMaskV.glsl", GL_VERTEX_SHADER_ARB)); - gDeferredShadowAlphaMaskProgram.mShaderFiles.push_back(make_pair("deferred/shadowAlphaMaskF.glsl", GL_FRAGMENT_SHADER_ARB)); + gDeferredShadowAlphaMaskProgram.mShaderFiles.push_back(make_pair("deferred/shadowAlphaMaskV.glsl", GL_VERTEX_SHADER)); + gDeferredShadowAlphaMaskProgram.mShaderFiles.push_back(make_pair("deferred/shadowAlphaMaskF.glsl", GL_FRAGMENT_SHADER)); if (gGLManager.mHasDepthClamp) { gDeferredShadowAlphaMaskProgram.addPermutation("DEPTH_CLAMP", "1"); @@ -2463,8 +2463,8 @@ BOOL LLViewerShaderMgr::loadShadersDeferred() gDeferredSkinnedShadowAlphaMaskProgram.mFeatures.mIndexedTextureChannels = LLGLSLShader::sIndexedTextureChannels; gDeferredSkinnedShadowAlphaMaskProgram.mFeatures.hasObjectSkinning = true; gDeferredSkinnedShadowAlphaMaskProgram.mShaderFiles.clear(); - gDeferredSkinnedShadowAlphaMaskProgram.mShaderFiles.push_back(make_pair("deferred/shadowAlphaMaskSkinnedV.glsl", GL_VERTEX_SHADER_ARB)); - gDeferredSkinnedShadowAlphaMaskProgram.mShaderFiles.push_back(make_pair("deferred/shadowAlphaMaskF.glsl", GL_FRAGMENT_SHADER_ARB)); + gDeferredSkinnedShadowAlphaMaskProgram.mShaderFiles.push_back(make_pair("deferred/shadowAlphaMaskSkinnedV.glsl", GL_VERTEX_SHADER)); + gDeferredSkinnedShadowAlphaMaskProgram.mShaderFiles.push_back(make_pair("deferred/shadowAlphaMaskF.glsl", GL_FRAGMENT_SHADER)); if (gGLManager.mHasDepthClamp) { gDeferredSkinnedShadowAlphaMaskProgram.addPermutation("DEPTH_CLAMP", "1"); @@ -2480,8 +2480,8 @@ BOOL LLViewerShaderMgr::loadShadersDeferred() gDeferredAvatarShadowProgram.mFeatures.hasSkinning = true; gDeferredAvatarShadowProgram.mShaderFiles.clear(); - gDeferredAvatarShadowProgram.mShaderFiles.push_back(make_pair("deferred/avatarShadowV.glsl", GL_VERTEX_SHADER_ARB)); - gDeferredAvatarShadowProgram.mShaderFiles.push_back(make_pair("deferred/avatarShadowF.glsl", GL_FRAGMENT_SHADER_ARB)); + gDeferredAvatarShadowProgram.mShaderFiles.push_back(make_pair("deferred/avatarShadowV.glsl", GL_VERTEX_SHADER)); + gDeferredAvatarShadowProgram.mShaderFiles.push_back(make_pair("deferred/avatarShadowF.glsl", GL_FRAGMENT_SHADER)); if (gGLManager.mHasDepthClamp) { gDeferredAvatarShadowProgram.addPermutation("DEPTH_CLAMP", "1"); @@ -2496,8 +2496,8 @@ BOOL LLViewerShaderMgr::loadShadersDeferred() gDeferredAvatarAlphaShadowProgram.mName = "Deferred Avatar Alpha Shadow Shader"; gDeferredAvatarAlphaShadowProgram.mFeatures.hasSkinning = true; gDeferredAvatarAlphaShadowProgram.mShaderFiles.clear(); - gDeferredAvatarAlphaShadowProgram.mShaderFiles.push_back(make_pair("deferred/avatarAlphaShadowV.glsl", GL_VERTEX_SHADER_ARB)); - gDeferredAvatarAlphaShadowProgram.mShaderFiles.push_back(make_pair("deferred/avatarAlphaShadowF.glsl", GL_FRAGMENT_SHADER_ARB)); + gDeferredAvatarAlphaShadowProgram.mShaderFiles.push_back(make_pair("deferred/avatarAlphaShadowV.glsl", GL_VERTEX_SHADER)); + gDeferredAvatarAlphaShadowProgram.mShaderFiles.push_back(make_pair("deferred/avatarAlphaShadowF.glsl", GL_FRAGMENT_SHADER)); gDeferredAvatarAlphaShadowProgram.addPermutation("DEPTH_CLAMP", gGLManager.mHasDepthClamp ? "1" : "0"); gDeferredAvatarAlphaShadowProgram.mShaderLevel = mShaderLevel[SHADER_DEFERRED]; success = gDeferredAvatarAlphaShadowProgram.createShader(NULL, NULL); @@ -2509,8 +2509,8 @@ BOOL LLViewerShaderMgr::loadShadersDeferred() gDeferredAvatarAlphaMaskShadowProgram.mName = "Deferred Avatar Alpha Mask Shadow Shader"; gDeferredAvatarAlphaMaskShadowProgram.mFeatures.hasSkinning = true; gDeferredAvatarAlphaMaskShadowProgram.mShaderFiles.clear(); - gDeferredAvatarAlphaMaskShadowProgram.mShaderFiles.push_back(make_pair("deferred/avatarAlphaShadowV.glsl", GL_VERTEX_SHADER_ARB)); - gDeferredAvatarAlphaMaskShadowProgram.mShaderFiles.push_back(make_pair("deferred/avatarAlphaMaskShadowF.glsl", GL_FRAGMENT_SHADER_ARB)); + gDeferredAvatarAlphaMaskShadowProgram.mShaderFiles.push_back(make_pair("deferred/avatarAlphaShadowV.glsl", GL_VERTEX_SHADER)); + gDeferredAvatarAlphaMaskShadowProgram.mShaderFiles.push_back(make_pair("deferred/avatarAlphaMaskShadowF.glsl", GL_FRAGMENT_SHADER)); gDeferredAvatarAlphaMaskShadowProgram.addPermutation("DEPTH_CLAMP", gGLManager.mHasDepthClamp ? "1" : "0"); gDeferredAvatarAlphaMaskShadowProgram.mShaderLevel = mShaderLevel[SHADER_DEFERRED]; success = gDeferredAvatarAlphaMaskShadowProgram.createShader(NULL, NULL); @@ -2523,8 +2523,8 @@ BOOL LLViewerShaderMgr::loadShadersDeferred() gDeferredAttachmentShadowProgram.mFeatures.hasObjectSkinning = true; gDeferredAttachmentShadowProgram.mShaderFiles.clear(); - gDeferredAttachmentShadowProgram.mShaderFiles.push_back(make_pair("deferred/attachmentShadowV.glsl", GL_VERTEX_SHADER_ARB)); - gDeferredAttachmentShadowProgram.mShaderFiles.push_back(make_pair("deferred/attachmentShadowF.glsl", GL_FRAGMENT_SHADER_ARB)); + gDeferredAttachmentShadowProgram.mShaderFiles.push_back(make_pair("deferred/attachmentShadowV.glsl", GL_VERTEX_SHADER)); + gDeferredAttachmentShadowProgram.mShaderFiles.push_back(make_pair("deferred/attachmentShadowF.glsl", GL_FRAGMENT_SHADER)); if (gGLManager.mHasDepthClamp) { gDeferredAttachmentShadowProgram.addPermutation("DEPTH_CLAMP", "1"); @@ -2539,8 +2539,8 @@ BOOL LLViewerShaderMgr::loadShadersDeferred() gDeferredAttachmentAlphaShadowProgram.mName = "Deferred Attachment Alpha Shadow Shader"; gDeferredAttachmentAlphaShadowProgram.mFeatures.hasObjectSkinning = true; gDeferredAttachmentAlphaShadowProgram.mShaderFiles.clear(); - gDeferredAttachmentAlphaShadowProgram.mShaderFiles.push_back(make_pair("deferred/attachmentAlphaShadowV.glsl", GL_VERTEX_SHADER_ARB)); - gDeferredAttachmentAlphaShadowProgram.mShaderFiles.push_back(make_pair("deferred/attachmentAlphaShadowF.glsl", GL_FRAGMENT_SHADER_ARB)); + gDeferredAttachmentAlphaShadowProgram.mShaderFiles.push_back(make_pair("deferred/attachmentAlphaShadowV.glsl", GL_VERTEX_SHADER)); + gDeferredAttachmentAlphaShadowProgram.mShaderFiles.push_back(make_pair("deferred/attachmentAlphaShadowF.glsl", GL_FRAGMENT_SHADER)); gDeferredAttachmentAlphaShadowProgram.addPermutation("DEPTH_CLAMP", gGLManager.mHasDepthClamp ? "1" : "0"); gDeferredAttachmentAlphaShadowProgram.mShaderLevel = mShaderLevel[SHADER_DEFERRED]; success = gDeferredAttachmentAlphaShadowProgram.createShader(NULL, NULL); @@ -2552,8 +2552,8 @@ BOOL LLViewerShaderMgr::loadShadersDeferred() gDeferredAttachmentAlphaMaskShadowProgram.mName = "Deferred Attachment Alpha Mask Shadow Shader"; gDeferredAttachmentAlphaMaskShadowProgram.mFeatures.hasObjectSkinning = true; gDeferredAttachmentAlphaMaskShadowProgram.mShaderFiles.clear(); - gDeferredAttachmentAlphaMaskShadowProgram.mShaderFiles.push_back(make_pair("deferred/attachmentAlphaShadowV.glsl", GL_VERTEX_SHADER_ARB)); - gDeferredAttachmentAlphaMaskShadowProgram.mShaderFiles.push_back(make_pair("deferred/attachmentAlphaMaskShadowF.glsl", GL_FRAGMENT_SHADER_ARB)); + gDeferredAttachmentAlphaMaskShadowProgram.mShaderFiles.push_back(make_pair("deferred/attachmentAlphaShadowV.glsl", GL_VERTEX_SHADER)); + gDeferredAttachmentAlphaMaskShadowProgram.mShaderFiles.push_back(make_pair("deferred/attachmentAlphaMaskShadowF.glsl", GL_FRAGMENT_SHADER)); gDeferredAttachmentAlphaMaskShadowProgram.addPermutation("DEPTH_CLAMP", gGLManager.mHasDepthClamp ? "1" : "0"); gDeferredAttachmentAlphaMaskShadowProgram.mShaderLevel = mShaderLevel[SHADER_DEFERRED]; success = gDeferredAttachmentAlphaMaskShadowProgram.createShader(NULL, NULL); @@ -2576,8 +2576,8 @@ BOOL LLViewerShaderMgr::loadShadersDeferred() gDeferredTerrainProgram.mFeatures.hasTransport = true; gDeferredTerrainProgram.mShaderFiles.clear(); - gDeferredTerrainProgram.mShaderFiles.push_back(make_pair("deferred/terrainV.glsl", GL_VERTEX_SHADER_ARB)); - gDeferredTerrainProgram.mShaderFiles.push_back(make_pair("deferred/terrainF.glsl", GL_FRAGMENT_SHADER_ARB)); + gDeferredTerrainProgram.mShaderFiles.push_back(make_pair("deferred/terrainV.glsl", GL_VERTEX_SHADER)); + gDeferredTerrainProgram.mShaderFiles.push_back(make_pair("deferred/terrainF.glsl", GL_FRAGMENT_SHADER)); gDeferredTerrainProgram.mShaderLevel = mShaderLevel[SHADER_DEFERRED]; success = gDeferredTerrainProgram.createShader(NULL, NULL); llassert(success); @@ -2599,8 +2599,8 @@ BOOL LLViewerShaderMgr::loadShadersDeferred() gDeferredTerrainWaterProgram.mFeatures.hasTransport = true; gDeferredTerrainWaterProgram.mShaderFiles.clear(); - gDeferredTerrainWaterProgram.mShaderFiles.push_back(make_pair("deferred/terrainV.glsl", GL_VERTEX_SHADER_ARB)); - gDeferredTerrainWaterProgram.mShaderFiles.push_back(make_pair("deferred/terrainF.glsl", GL_FRAGMENT_SHADER_ARB)); + gDeferredTerrainWaterProgram.mShaderFiles.push_back(make_pair("deferred/terrainV.glsl", GL_VERTEX_SHADER)); + gDeferredTerrainWaterProgram.mShaderFiles.push_back(make_pair("deferred/terrainF.glsl", GL_FRAGMENT_SHADER)); gDeferredTerrainWaterProgram.mShaderLevel = mShaderLevel[SHADER_DEFERRED]; gDeferredTerrainWaterProgram.mShaderGroup = LLGLSLShader::SG_WATER; gDeferredTerrainWaterProgram.addPermutation("WATER_FOG", "1"); @@ -2614,8 +2614,8 @@ BOOL LLViewerShaderMgr::loadShadersDeferred() gDeferredAvatarProgram.mFeatures.hasSkinning = true; gDeferredAvatarProgram.mFeatures.encodesNormal = true; gDeferredAvatarProgram.mShaderFiles.clear(); - gDeferredAvatarProgram.mShaderFiles.push_back(make_pair("deferred/avatarV.glsl", GL_VERTEX_SHADER_ARB)); - gDeferredAvatarProgram.mShaderFiles.push_back(make_pair("deferred/avatarF.glsl", GL_FRAGMENT_SHADER_ARB)); + gDeferredAvatarProgram.mShaderFiles.push_back(make_pair("deferred/avatarV.glsl", GL_VERTEX_SHADER)); + gDeferredAvatarProgram.mShaderFiles.push_back(make_pair("deferred/avatarF.glsl", GL_FRAGMENT_SHADER)); gDeferredAvatarProgram.mShaderLevel = mShaderLevel[SHADER_DEFERRED]; success = gDeferredAvatarProgram.createShader(NULL, NULL); llassert(success); @@ -2639,8 +2639,8 @@ BOOL LLViewerShaderMgr::loadShadersDeferred() gDeferredAvatarAlphaProgram.mFeatures.hasShadows = true; gDeferredAvatarAlphaProgram.mShaderFiles.clear(); - gDeferredAvatarAlphaProgram.mShaderFiles.push_back(make_pair("deferred/alphaV.glsl", GL_VERTEX_SHADER_ARB)); - gDeferredAvatarAlphaProgram.mShaderFiles.push_back(make_pair("deferred/alphaF.glsl", GL_FRAGMENT_SHADER_ARB)); + gDeferredAvatarAlphaProgram.mShaderFiles.push_back(make_pair("deferred/alphaV.glsl", GL_VERTEX_SHADER)); + gDeferredAvatarAlphaProgram.mShaderFiles.push_back(make_pair("deferred/alphaF.glsl", GL_FRAGMENT_SHADER)); gDeferredAvatarAlphaProgram.clearPermutations(); gDeferredAvatarAlphaProgram.addPermutation("USE_DIFFUSE_TEX", "1"); @@ -2679,8 +2679,8 @@ BOOL LLViewerShaderMgr::loadShadersDeferred() gDeferredPostGammaCorrectProgram.mFeatures.hasSrgb = true; gDeferredPostGammaCorrectProgram.mFeatures.isDeferred = true; gDeferredPostGammaCorrectProgram.mShaderFiles.clear(); - gDeferredPostGammaCorrectProgram.mShaderFiles.push_back(make_pair("deferred/postDeferredNoTCV.glsl", GL_VERTEX_SHADER_ARB)); - gDeferredPostGammaCorrectProgram.mShaderFiles.push_back(make_pair("deferred/postDeferredGammaCorrect.glsl", GL_FRAGMENT_SHADER_ARB)); + gDeferredPostGammaCorrectProgram.mShaderFiles.push_back(make_pair("deferred/postDeferredNoTCV.glsl", GL_VERTEX_SHADER)); + gDeferredPostGammaCorrectProgram.mShaderFiles.push_back(make_pair("deferred/postDeferredGammaCorrect.glsl", GL_FRAGMENT_SHADER)); gDeferredPostGammaCorrectProgram.mShaderLevel = mShaderLevel[SHADER_DEFERRED]; success = gDeferredPostGammaCorrectProgram.createShader(NULL, NULL); llassert(success); @@ -2691,8 +2691,8 @@ BOOL LLViewerShaderMgr::loadShadersDeferred() gFXAAProgram.mName = "FXAA Shader"; gFXAAProgram.mFeatures.isDeferred = true; gFXAAProgram.mShaderFiles.clear(); - gFXAAProgram.mShaderFiles.push_back(make_pair("deferred/postDeferredV.glsl", GL_VERTEX_SHADER_ARB)); - gFXAAProgram.mShaderFiles.push_back(make_pair("deferred/fxaaF.glsl", GL_FRAGMENT_SHADER_ARB)); + gFXAAProgram.mShaderFiles.push_back(make_pair("deferred/postDeferredV.glsl", GL_VERTEX_SHADER)); + gFXAAProgram.mShaderFiles.push_back(make_pair("deferred/fxaaF.glsl", GL_FRAGMENT_SHADER)); gFXAAProgram.mShaderLevel = mShaderLevel[SHADER_DEFERRED]; success = gFXAAProgram.createShader(NULL, NULL); llassert(success); @@ -2703,8 +2703,8 @@ BOOL LLViewerShaderMgr::loadShadersDeferred() gDeferredPostProgram.mName = "Deferred Post Shader"; gFXAAProgram.mFeatures.isDeferred = true; gDeferredPostProgram.mShaderFiles.clear(); - gDeferredPostProgram.mShaderFiles.push_back(make_pair("deferred/postDeferredNoTCV.glsl", GL_VERTEX_SHADER_ARB)); - gDeferredPostProgram.mShaderFiles.push_back(make_pair("deferred/postDeferredF.glsl", GL_FRAGMENT_SHADER_ARB)); + gDeferredPostProgram.mShaderFiles.push_back(make_pair("deferred/postDeferredNoTCV.glsl", GL_VERTEX_SHADER)); + gDeferredPostProgram.mShaderFiles.push_back(make_pair("deferred/postDeferredF.glsl", GL_FRAGMENT_SHADER)); gDeferredPostProgram.mShaderLevel = mShaderLevel[SHADER_DEFERRED]; success = gDeferredPostProgram.createShader(NULL, NULL); llassert(success); @@ -2715,8 +2715,8 @@ BOOL LLViewerShaderMgr::loadShadersDeferred() gDeferredCoFProgram.mName = "Deferred CoF Shader"; gDeferredCoFProgram.mShaderFiles.clear(); gDeferredCoFProgram.mFeatures.isDeferred = true; - gDeferredCoFProgram.mShaderFiles.push_back(make_pair("deferred/postDeferredNoTCV.glsl", GL_VERTEX_SHADER_ARB)); - gDeferredCoFProgram.mShaderFiles.push_back(make_pair("deferred/cofF.glsl", GL_FRAGMENT_SHADER_ARB)); + gDeferredCoFProgram.mShaderFiles.push_back(make_pair("deferred/postDeferredNoTCV.glsl", GL_VERTEX_SHADER)); + gDeferredCoFProgram.mShaderFiles.push_back(make_pair("deferred/cofF.glsl", GL_FRAGMENT_SHADER)); gDeferredCoFProgram.mShaderLevel = mShaderLevel[SHADER_DEFERRED]; success = gDeferredCoFProgram.createShader(NULL, NULL); llassert(success); @@ -2727,8 +2727,8 @@ BOOL LLViewerShaderMgr::loadShadersDeferred() gDeferredDoFCombineProgram.mName = "Deferred DoFCombine Shader"; gDeferredDoFCombineProgram.mFeatures.isDeferred = true; gDeferredDoFCombineProgram.mShaderFiles.clear(); - gDeferredDoFCombineProgram.mShaderFiles.push_back(make_pair("deferred/postDeferredNoTCV.glsl", GL_VERTEX_SHADER_ARB)); - gDeferredDoFCombineProgram.mShaderFiles.push_back(make_pair("deferred/dofCombineF.glsl", GL_FRAGMENT_SHADER_ARB)); + gDeferredDoFCombineProgram.mShaderFiles.push_back(make_pair("deferred/postDeferredNoTCV.glsl", GL_VERTEX_SHADER)); + gDeferredDoFCombineProgram.mShaderFiles.push_back(make_pair("deferred/dofCombineF.glsl", GL_FRAGMENT_SHADER)); gDeferredDoFCombineProgram.mShaderLevel = mShaderLevel[SHADER_DEFERRED]; success = gDeferredDoFCombineProgram.createShader(NULL, NULL); llassert(success); @@ -2739,8 +2739,8 @@ BOOL LLViewerShaderMgr::loadShadersDeferred() gDeferredPostNoDoFProgram.mName = "Deferred Post Shader"; gDeferredPostNoDoFProgram.mFeatures.isDeferred = true; gDeferredPostNoDoFProgram.mShaderFiles.clear(); - gDeferredPostNoDoFProgram.mShaderFiles.push_back(make_pair("deferred/postDeferredNoTCV.glsl", GL_VERTEX_SHADER_ARB)); - gDeferredPostNoDoFProgram.mShaderFiles.push_back(make_pair("deferred/postDeferredNoDoFF.glsl", GL_FRAGMENT_SHADER_ARB)); + gDeferredPostNoDoFProgram.mShaderFiles.push_back(make_pair("deferred/postDeferredNoTCV.glsl", GL_VERTEX_SHADER)); + gDeferredPostNoDoFProgram.mShaderFiles.push_back(make_pair("deferred/postDeferredNoDoFF.glsl", GL_FRAGMENT_SHADER)); gDeferredPostNoDoFProgram.mShaderLevel = mShaderLevel[SHADER_DEFERRED]; success = gDeferredPostNoDoFProgram.createShader(NULL, NULL); llassert(success); @@ -2755,8 +2755,8 @@ BOOL LLViewerShaderMgr::loadShadersDeferred() gDeferredWLSkyProgram.mFeatures.hasGamma = true; gDeferredWLSkyProgram.mFeatures.hasSrgb = true; - gDeferredWLSkyProgram.mShaderFiles.push_back(make_pair("deferred/skyV.glsl", GL_VERTEX_SHADER_ARB)); - gDeferredWLSkyProgram.mShaderFiles.push_back(make_pair("deferred/skyF.glsl", GL_FRAGMENT_SHADER_ARB)); + gDeferredWLSkyProgram.mShaderFiles.push_back(make_pair("deferred/skyV.glsl", GL_VERTEX_SHADER)); + gDeferredWLSkyProgram.mShaderFiles.push_back(make_pair("deferred/skyF.glsl", GL_FRAGMENT_SHADER)); gDeferredWLSkyProgram.mShaderLevel = mShaderLevel[SHADER_DEFERRED]; gDeferredWLSkyProgram.mShaderGroup = LLGLSLShader::SG_SKY; @@ -2773,8 +2773,8 @@ BOOL LLViewerShaderMgr::loadShadersDeferred() gDeferredWLCloudProgram.mFeatures.hasGamma = true; gDeferredWLCloudProgram.mFeatures.hasSrgb = true; - gDeferredWLCloudProgram.mShaderFiles.push_back(make_pair("deferred/cloudsV.glsl", GL_VERTEX_SHADER_ARB)); - gDeferredWLCloudProgram.mShaderFiles.push_back(make_pair("deferred/cloudsF.glsl", GL_FRAGMENT_SHADER_ARB)); + gDeferredWLCloudProgram.mShaderFiles.push_back(make_pair("deferred/cloudsV.glsl", GL_VERTEX_SHADER)); + gDeferredWLCloudProgram.mShaderFiles.push_back(make_pair("deferred/cloudsF.glsl", GL_FRAGMENT_SHADER)); gDeferredWLCloudProgram.mShaderLevel = mShaderLevel[SHADER_DEFERRED]; gDeferredWLCloudProgram.mShaderGroup = LLGLSLShader::SG_SKY; success = gDeferredWLCloudProgram.createShader(NULL, NULL); @@ -2792,8 +2792,8 @@ BOOL LLViewerShaderMgr::loadShadersDeferred() gDeferredWLSunProgram.mFeatures.disableTextureIndex = true; gDeferredWLSunProgram.mFeatures.hasSrgb = true; gDeferredWLSunProgram.mShaderFiles.clear(); - gDeferredWLSunProgram.mShaderFiles.push_back(make_pair("deferred/sunDiscV.glsl", GL_VERTEX_SHADER_ARB)); - gDeferredWLSunProgram.mShaderFiles.push_back(make_pair("deferred/sunDiscF.glsl", GL_FRAGMENT_SHADER_ARB)); + gDeferredWLSunProgram.mShaderFiles.push_back(make_pair("deferred/sunDiscV.glsl", GL_VERTEX_SHADER)); + gDeferredWLSunProgram.mShaderFiles.push_back(make_pair("deferred/sunDiscF.glsl", GL_FRAGMENT_SHADER)); gDeferredWLSunProgram.mShaderLevel = mShaderLevel[SHADER_DEFERRED]; gDeferredWLSunProgram.mShaderGroup = LLGLSLShader::SG_SKY; success = gDeferredWLSunProgram.createShader(NULL, NULL); @@ -2812,8 +2812,8 @@ BOOL LLViewerShaderMgr::loadShadersDeferred() gDeferredWLMoonProgram.mFeatures.disableTextureIndex = true; gDeferredWLMoonProgram.mShaderFiles.clear(); - gDeferredWLMoonProgram.mShaderFiles.push_back(make_pair("deferred/moonV.glsl", GL_VERTEX_SHADER_ARB)); - gDeferredWLMoonProgram.mShaderFiles.push_back(make_pair("deferred/moonF.glsl", GL_FRAGMENT_SHADER_ARB)); + gDeferredWLMoonProgram.mShaderFiles.push_back(make_pair("deferred/moonV.glsl", GL_VERTEX_SHADER)); + gDeferredWLMoonProgram.mShaderFiles.push_back(make_pair("deferred/moonF.glsl", GL_FRAGMENT_SHADER)); gDeferredWLMoonProgram.mShaderLevel = mShaderLevel[SHADER_DEFERRED]; gDeferredWLMoonProgram.mShaderGroup = LLGLSLShader::SG_SKY; success = gDeferredWLMoonProgram.createShader(NULL, NULL); @@ -2824,8 +2824,8 @@ BOOL LLViewerShaderMgr::loadShadersDeferred() { gDeferredStarProgram.mName = "Deferred Star Program"; gDeferredStarProgram.mShaderFiles.clear(); - gDeferredStarProgram.mShaderFiles.push_back(make_pair("deferred/starsV.glsl", GL_VERTEX_SHADER_ARB)); - gDeferredStarProgram.mShaderFiles.push_back(make_pair("deferred/starsF.glsl", GL_FRAGMENT_SHADER_ARB)); + gDeferredStarProgram.mShaderFiles.push_back(make_pair("deferred/starsV.glsl", GL_VERTEX_SHADER)); + gDeferredStarProgram.mShaderFiles.push_back(make_pair("deferred/starsF.glsl", GL_FRAGMENT_SHADER)); gDeferredStarProgram.mShaderLevel = mShaderLevel[SHADER_DEFERRED]; gDeferredStarProgram.mShaderGroup = LLGLSLShader::SG_SKY; success = gDeferredStarProgram.createShader(NULL, NULL); @@ -2836,8 +2836,8 @@ BOOL LLViewerShaderMgr::loadShadersDeferred() { gNormalMapGenProgram.mName = "Normal Map Generation Program"; gNormalMapGenProgram.mShaderFiles.clear(); - gNormalMapGenProgram.mShaderFiles.push_back(make_pair("deferred/normgenV.glsl", GL_VERTEX_SHADER_ARB)); - gNormalMapGenProgram.mShaderFiles.push_back(make_pair("deferred/normgenF.glsl", GL_FRAGMENT_SHADER_ARB)); + gNormalMapGenProgram.mShaderFiles.push_back(make_pair("deferred/normgenV.glsl", GL_VERTEX_SHADER)); + gNormalMapGenProgram.mShaderFiles.push_back(make_pair("deferred/normgenF.glsl", GL_FRAGMENT_SHADER)); gNormalMapGenProgram.mShaderLevel = mShaderLevel[SHADER_DEFERRED]; gNormalMapGenProgram.mShaderGroup = LLGLSLShader::SG_SKY; success = gNormalMapGenProgram.createShader(NULL, NULL); @@ -2860,8 +2860,8 @@ BOOL LLViewerShaderMgr::loadShadersObject() gObjectSimpleNonIndexedTexGenProgram.mFeatures.hasLighting = true; gObjectSimpleNonIndexedTexGenProgram.mFeatures.disableTextureIndex = true; gObjectSimpleNonIndexedTexGenProgram.mShaderFiles.clear(); - gObjectSimpleNonIndexedTexGenProgram.mShaderFiles.push_back(make_pair("objects/simpleTexGenV.glsl", GL_VERTEX_SHADER_ARB)); - gObjectSimpleNonIndexedTexGenProgram.mShaderFiles.push_back(make_pair("objects/simpleF.glsl", GL_FRAGMENT_SHADER_ARB)); + gObjectSimpleNonIndexedTexGenProgram.mShaderFiles.push_back(make_pair("objects/simpleTexGenV.glsl", GL_VERTEX_SHADER)); + gObjectSimpleNonIndexedTexGenProgram.mShaderFiles.push_back(make_pair("objects/simpleF.glsl", GL_FRAGMENT_SHADER)); gObjectSimpleNonIndexedTexGenProgram.mShaderLevel = mShaderLevel[SHADER_OBJECT]; success = gObjectSimpleNonIndexedTexGenProgram.createShader(NULL, NULL); } @@ -2876,8 +2876,8 @@ BOOL LLViewerShaderMgr::loadShadersObject() gObjectSimpleNonIndexedTexGenWaterProgram.mFeatures.hasLighting = true; gObjectSimpleNonIndexedTexGenWaterProgram.mFeatures.disableTextureIndex = true; gObjectSimpleNonIndexedTexGenWaterProgram.mShaderFiles.clear(); - gObjectSimpleNonIndexedTexGenWaterProgram.mShaderFiles.push_back(make_pair("objects/simpleTexGenV.glsl", GL_VERTEX_SHADER_ARB)); - gObjectSimpleNonIndexedTexGenWaterProgram.mShaderFiles.push_back(make_pair("objects/simpleWaterF.glsl", GL_FRAGMENT_SHADER_ARB)); + gObjectSimpleNonIndexedTexGenWaterProgram.mShaderFiles.push_back(make_pair("objects/simpleTexGenV.glsl", GL_VERTEX_SHADER)); + gObjectSimpleNonIndexedTexGenWaterProgram.mShaderFiles.push_back(make_pair("objects/simpleWaterF.glsl", GL_FRAGMENT_SHADER)); gObjectSimpleNonIndexedTexGenWaterProgram.mShaderLevel = mShaderLevel[SHADER_OBJECT]; gObjectSimpleNonIndexedTexGenWaterProgram.mShaderGroup = LLGLSLShader::SG_WATER; success = gObjectSimpleNonIndexedTexGenWaterProgram.createShader(NULL, NULL); @@ -2894,8 +2894,8 @@ BOOL LLViewerShaderMgr::loadShadersObject() gObjectAlphaMaskNonIndexedProgram.mFeatures.disableTextureIndex = true; gObjectAlphaMaskNonIndexedProgram.mFeatures.hasAlphaMask = true; gObjectAlphaMaskNonIndexedProgram.mShaderFiles.clear(); - gObjectAlphaMaskNonIndexedProgram.mShaderFiles.push_back(make_pair("objects/simpleNonIndexedV.glsl", GL_VERTEX_SHADER_ARB)); - gObjectAlphaMaskNonIndexedProgram.mShaderFiles.push_back(make_pair("objects/simpleF.glsl", GL_FRAGMENT_SHADER_ARB)); + gObjectAlphaMaskNonIndexedProgram.mShaderFiles.push_back(make_pair("objects/simpleNonIndexedV.glsl", GL_VERTEX_SHADER)); + gObjectAlphaMaskNonIndexedProgram.mShaderFiles.push_back(make_pair("objects/simpleF.glsl", GL_FRAGMENT_SHADER)); gObjectAlphaMaskNonIndexedProgram.mShaderLevel = mShaderLevel[SHADER_OBJECT]; success = gObjectAlphaMaskNonIndexedProgram.createShader(NULL, NULL); } @@ -2911,8 +2911,8 @@ BOOL LLViewerShaderMgr::loadShadersObject() gObjectAlphaMaskNonIndexedWaterProgram.mFeatures.disableTextureIndex = true; gObjectAlphaMaskNonIndexedWaterProgram.mFeatures.hasAlphaMask = true; gObjectAlphaMaskNonIndexedWaterProgram.mShaderFiles.clear(); - gObjectAlphaMaskNonIndexedWaterProgram.mShaderFiles.push_back(make_pair("objects/simpleNonIndexedV.glsl", GL_VERTEX_SHADER_ARB)); - gObjectAlphaMaskNonIndexedWaterProgram.mShaderFiles.push_back(make_pair("objects/simpleWaterF.glsl", GL_FRAGMENT_SHADER_ARB)); + gObjectAlphaMaskNonIndexedWaterProgram.mShaderFiles.push_back(make_pair("objects/simpleNonIndexedV.glsl", GL_VERTEX_SHADER)); + gObjectAlphaMaskNonIndexedWaterProgram.mShaderFiles.push_back(make_pair("objects/simpleWaterF.glsl", GL_FRAGMENT_SHADER)); gObjectAlphaMaskNonIndexedWaterProgram.mShaderLevel = mShaderLevel[SHADER_OBJECT]; gObjectAlphaMaskNonIndexedWaterProgram.mShaderGroup = LLGLSLShader::SG_WATER; success = gObjectAlphaMaskNonIndexedWaterProgram.createShader(NULL, NULL); @@ -2929,8 +2929,8 @@ BOOL LLViewerShaderMgr::loadShadersObject() gObjectAlphaMaskNoColorProgram.mFeatures.disableTextureIndex = true; gObjectAlphaMaskNoColorProgram.mFeatures.hasAlphaMask = true; gObjectAlphaMaskNoColorProgram.mShaderFiles.clear(); - gObjectAlphaMaskNoColorProgram.mShaderFiles.push_back(make_pair("objects/simpleNoColorV.glsl", GL_VERTEX_SHADER_ARB)); - gObjectAlphaMaskNoColorProgram.mShaderFiles.push_back(make_pair("objects/simpleF.glsl", GL_FRAGMENT_SHADER_ARB)); + gObjectAlphaMaskNoColorProgram.mShaderFiles.push_back(make_pair("objects/simpleNoColorV.glsl", GL_VERTEX_SHADER)); + gObjectAlphaMaskNoColorProgram.mShaderFiles.push_back(make_pair("objects/simpleF.glsl", GL_FRAGMENT_SHADER)); gObjectAlphaMaskNoColorProgram.mShaderLevel = mShaderLevel[SHADER_OBJECT]; success = gObjectAlphaMaskNoColorProgram.createShader(NULL, NULL); } @@ -2946,8 +2946,8 @@ BOOL LLViewerShaderMgr::loadShadersObject() gObjectAlphaMaskNoColorWaterProgram.mFeatures.disableTextureIndex = true; gObjectAlphaMaskNoColorWaterProgram.mFeatures.hasAlphaMask = true; gObjectAlphaMaskNoColorWaterProgram.mShaderFiles.clear(); - gObjectAlphaMaskNoColorWaterProgram.mShaderFiles.push_back(make_pair("objects/simpleNoColorV.glsl", GL_VERTEX_SHADER_ARB)); - gObjectAlphaMaskNoColorWaterProgram.mShaderFiles.push_back(make_pair("objects/simpleWaterF.glsl", GL_FRAGMENT_SHADER_ARB)); + gObjectAlphaMaskNoColorWaterProgram.mShaderFiles.push_back(make_pair("objects/simpleNoColorV.glsl", GL_VERTEX_SHADER)); + gObjectAlphaMaskNoColorWaterProgram.mShaderFiles.push_back(make_pair("objects/simpleWaterF.glsl", GL_FRAGMENT_SHADER)); gObjectAlphaMaskNoColorWaterProgram.mShaderLevel = mShaderLevel[SHADER_OBJECT]; gObjectAlphaMaskNoColorWaterProgram.mShaderGroup = LLGLSLShader::SG_WATER; success = gObjectAlphaMaskNoColorWaterProgram.createShader(NULL, NULL); @@ -2964,8 +2964,8 @@ BOOL LLViewerShaderMgr::loadShadersObject() gTreeProgram.mFeatures.disableTextureIndex = true; gTreeProgram.mFeatures.hasAlphaMask = true; gTreeProgram.mShaderFiles.clear(); - gTreeProgram.mShaderFiles.push_back(make_pair("objects/treeV.glsl", GL_VERTEX_SHADER_ARB)); - gTreeProgram.mShaderFiles.push_back(make_pair("objects/simpleF.glsl", GL_FRAGMENT_SHADER_ARB)); + gTreeProgram.mShaderFiles.push_back(make_pair("objects/treeV.glsl", GL_VERTEX_SHADER)); + gTreeProgram.mShaderFiles.push_back(make_pair("objects/simpleF.glsl", GL_FRAGMENT_SHADER)); gTreeProgram.mShaderLevel = mShaderLevel[SHADER_OBJECT]; success = gTreeProgram.createShader(NULL, NULL); } @@ -2981,8 +2981,8 @@ BOOL LLViewerShaderMgr::loadShadersObject() gTreeWaterProgram.mFeatures.disableTextureIndex = true; gTreeWaterProgram.mFeatures.hasAlphaMask = true; gTreeWaterProgram.mShaderFiles.clear(); - gTreeWaterProgram.mShaderFiles.push_back(make_pair("objects/treeV.glsl", GL_VERTEX_SHADER_ARB)); - gTreeWaterProgram.mShaderFiles.push_back(make_pair("objects/simpleWaterF.glsl", GL_FRAGMENT_SHADER_ARB)); + gTreeWaterProgram.mShaderFiles.push_back(make_pair("objects/treeV.glsl", GL_VERTEX_SHADER)); + gTreeWaterProgram.mShaderFiles.push_back(make_pair("objects/simpleWaterF.glsl", GL_FRAGMENT_SHADER)); gTreeWaterProgram.mShaderLevel = mShaderLevel[SHADER_OBJECT]; gTreeWaterProgram.mShaderGroup = LLGLSLShader::SG_WATER; success = gTreeWaterProgram.createShader(NULL, NULL); @@ -2998,8 +2998,8 @@ BOOL LLViewerShaderMgr::loadShadersObject() gObjectFullbrightNoColorProgram.mFeatures.hasSrgb = true; gObjectFullbrightNoColorProgram.mFeatures.disableTextureIndex = true; gObjectFullbrightNoColorProgram.mShaderFiles.clear(); - gObjectFullbrightNoColorProgram.mShaderFiles.push_back(make_pair("objects/fullbrightNoColorV.glsl", GL_VERTEX_SHADER_ARB)); - gObjectFullbrightNoColorProgram.mShaderFiles.push_back(make_pair("objects/fullbrightF.glsl", GL_FRAGMENT_SHADER_ARB)); + gObjectFullbrightNoColorProgram.mShaderFiles.push_back(make_pair("objects/fullbrightNoColorV.glsl", GL_VERTEX_SHADER)); + gObjectFullbrightNoColorProgram.mShaderFiles.push_back(make_pair("objects/fullbrightF.glsl", GL_FRAGMENT_SHADER)); gObjectFullbrightNoColorProgram.mShaderLevel = mShaderLevel[SHADER_OBJECT]; success = gObjectFullbrightNoColorProgram.createShader(NULL, NULL); } @@ -3013,8 +3013,8 @@ BOOL LLViewerShaderMgr::loadShadersObject() gObjectFullbrightNoColorWaterProgram.mFeatures.hasTransport = true; gObjectFullbrightNoColorWaterProgram.mFeatures.disableTextureIndex = true; gObjectFullbrightNoColorWaterProgram.mShaderFiles.clear(); - gObjectFullbrightNoColorWaterProgram.mShaderFiles.push_back(make_pair("objects/fullbrightNoColorV.glsl", GL_VERTEX_SHADER_ARB)); - gObjectFullbrightNoColorWaterProgram.mShaderFiles.push_back(make_pair("objects/fullbrightWaterF.glsl", GL_FRAGMENT_SHADER_ARB)); + gObjectFullbrightNoColorWaterProgram.mShaderFiles.push_back(make_pair("objects/fullbrightNoColorV.glsl", GL_VERTEX_SHADER)); + gObjectFullbrightNoColorWaterProgram.mShaderFiles.push_back(make_pair("objects/fullbrightWaterF.glsl", GL_FRAGMENT_SHADER)); gObjectFullbrightNoColorWaterProgram.mShaderLevel = mShaderLevel[SHADER_OBJECT]; gObjectFullbrightNoColorWaterProgram.mShaderGroup = LLGLSLShader::SG_WATER; success = gObjectFullbrightNoColorWaterProgram.createShader(NULL, NULL); @@ -3026,8 +3026,8 @@ BOOL LLViewerShaderMgr::loadShadersObject() gImpostorProgram.mFeatures.disableTextureIndex = true; gImpostorProgram.mFeatures.hasSrgb = true; gImpostorProgram.mShaderFiles.clear(); - gImpostorProgram.mShaderFiles.push_back(make_pair("objects/impostorV.glsl", GL_VERTEX_SHADER_ARB)); - gImpostorProgram.mShaderFiles.push_back(make_pair("objects/impostorF.glsl", GL_FRAGMENT_SHADER_ARB)); + gImpostorProgram.mShaderFiles.push_back(make_pair("objects/impostorV.glsl", GL_VERTEX_SHADER)); + gImpostorProgram.mShaderFiles.push_back(make_pair("objects/impostorF.glsl", GL_FRAGMENT_SHADER)); gImpostorProgram.mShaderLevel = mShaderLevel[SHADER_OBJECT]; success = gImpostorProgram.createShader(NULL, NULL); } @@ -3043,8 +3043,8 @@ BOOL LLViewerShaderMgr::loadShadersObject() gObjectPreviewProgram.mFeatures.mIndexedTextureChannels = 0; gObjectPreviewProgram.mFeatures.disableTextureIndex = true; gObjectPreviewProgram.mShaderFiles.clear(); - gObjectPreviewProgram.mShaderFiles.push_back(make_pair("objects/previewV.glsl", GL_VERTEX_SHADER_ARB)); - gObjectPreviewProgram.mShaderFiles.push_back(make_pair("objects/previewF.glsl", GL_FRAGMENT_SHADER_ARB)); + gObjectPreviewProgram.mShaderFiles.push_back(make_pair("objects/previewV.glsl", GL_VERTEX_SHADER)); + gObjectPreviewProgram.mShaderFiles.push_back(make_pair("objects/previewF.glsl", GL_FRAGMENT_SHADER)); gObjectPreviewProgram.mShaderLevel = mShaderLevel[SHADER_OBJECT]; success = gObjectPreviewProgram.createShader(NULL, NULL); gObjectPreviewProgram.mFeatures.hasLighting = true; @@ -3061,8 +3061,8 @@ BOOL LLViewerShaderMgr::loadShadersObject() gPhysicsPreviewProgram.mFeatures.mIndexedTextureChannels = 0; gPhysicsPreviewProgram.mFeatures.disableTextureIndex = true; gPhysicsPreviewProgram.mShaderFiles.clear(); - gPhysicsPreviewProgram.mShaderFiles.push_back(make_pair("objects/previewPhysicsV.glsl", GL_VERTEX_SHADER_ARB)); - gPhysicsPreviewProgram.mShaderFiles.push_back(make_pair("objects/previewPhysicsF.glsl", GL_FRAGMENT_SHADER_ARB)); + gPhysicsPreviewProgram.mShaderFiles.push_back(make_pair("objects/previewPhysicsV.glsl", GL_VERTEX_SHADER)); + gPhysicsPreviewProgram.mShaderFiles.push_back(make_pair("objects/previewPhysicsF.glsl", GL_FRAGMENT_SHADER)); gPhysicsPreviewProgram.mShaderLevel = mShaderLevel[SHADER_OBJECT]; success = gPhysicsPreviewProgram.createShader(NULL, NULL); gPhysicsPreviewProgram.mFeatures.hasLighting = false; @@ -3078,8 +3078,8 @@ BOOL LLViewerShaderMgr::loadShadersObject() gObjectSimpleProgram.mFeatures.hasLighting = true; gObjectSimpleProgram.mFeatures.mIndexedTextureChannels = 0; gObjectSimpleProgram.mShaderFiles.clear(); - gObjectSimpleProgram.mShaderFiles.push_back(make_pair("objects/simpleV.glsl", GL_VERTEX_SHADER_ARB)); - gObjectSimpleProgram.mShaderFiles.push_back(make_pair("objects/simpleF.glsl", GL_FRAGMENT_SHADER_ARB)); + gObjectSimpleProgram.mShaderFiles.push_back(make_pair("objects/simpleV.glsl", GL_VERTEX_SHADER)); + gObjectSimpleProgram.mShaderFiles.push_back(make_pair("objects/simpleF.glsl", GL_FRAGMENT_SHADER)); gObjectSimpleProgram.mShaderLevel = mShaderLevel[SHADER_OBJECT]; success = make_rigged_variant(gObjectSimpleProgram, gSkinnedObjectSimpleProgram); success = success && gObjectSimpleProgram.createShader(NULL, NULL); @@ -3099,8 +3099,8 @@ BOOL LLViewerShaderMgr::loadShadersObject() // gObjectSimpleImpostorProgram.mFeatures.hasAlphaMask = true; gObjectSimpleImpostorProgram.mShaderFiles.clear(); - gObjectSimpleImpostorProgram.mShaderFiles.push_back(make_pair("objects/simpleV.glsl", GL_VERTEX_SHADER_ARB)); - gObjectSimpleImpostorProgram.mShaderFiles.push_back(make_pair("objects/simpleF.glsl", GL_FRAGMENT_SHADER_ARB)); + gObjectSimpleImpostorProgram.mShaderFiles.push_back(make_pair("objects/simpleV.glsl", GL_VERTEX_SHADER)); + gObjectSimpleImpostorProgram.mShaderFiles.push_back(make_pair("objects/simpleF.glsl", GL_FRAGMENT_SHADER)); gObjectSimpleImpostorProgram.mShaderLevel = mShaderLevel[SHADER_OBJECT]; success = make_rigged_variant(gObjectSimpleImpostorProgram, gSkinnedObjectSimpleImpostorProgram); success = success && gObjectSimpleImpostorProgram.createShader(NULL, NULL); @@ -3116,8 +3116,8 @@ BOOL LLViewerShaderMgr::loadShadersObject() gObjectSimpleWaterProgram.mFeatures.hasLighting = true; gObjectSimpleWaterProgram.mFeatures.mIndexedTextureChannels = 0; gObjectSimpleWaterProgram.mShaderFiles.clear(); - gObjectSimpleWaterProgram.mShaderFiles.push_back(make_pair("objects/simpleV.glsl", GL_VERTEX_SHADER_ARB)); - gObjectSimpleWaterProgram.mShaderFiles.push_back(make_pair("objects/simpleWaterF.glsl", GL_FRAGMENT_SHADER_ARB)); + gObjectSimpleWaterProgram.mShaderFiles.push_back(make_pair("objects/simpleV.glsl", GL_VERTEX_SHADER)); + gObjectSimpleWaterProgram.mShaderFiles.push_back(make_pair("objects/simpleWaterF.glsl", GL_FRAGMENT_SHADER)); gObjectSimpleWaterProgram.mShaderLevel = mShaderLevel[SHADER_OBJECT]; gObjectSimpleWaterProgram.mShaderGroup = LLGLSLShader::SG_WATER; make_rigged_variant(gObjectSimpleWaterProgram, gSkinnedObjectSimpleWaterProgram); @@ -3129,8 +3129,8 @@ BOOL LLViewerShaderMgr::loadShadersObject() gObjectBumpProgram.mName = "Bump Shader"; gObjectBumpProgram.mFeatures.encodesNormal = true; gObjectBumpProgram.mShaderFiles.clear(); - gObjectBumpProgram.mShaderFiles.push_back(make_pair("objects/bumpV.glsl", GL_VERTEX_SHADER_ARB)); - gObjectBumpProgram.mShaderFiles.push_back(make_pair("objects/bumpF.glsl", GL_FRAGMENT_SHADER_ARB)); + gObjectBumpProgram.mShaderFiles.push_back(make_pair("objects/bumpV.glsl", GL_VERTEX_SHADER)); + gObjectBumpProgram.mShaderFiles.push_back(make_pair("objects/bumpF.glsl", GL_FRAGMENT_SHADER)); gObjectBumpProgram.mShaderLevel = mShaderLevel[SHADER_OBJECT]; success = make_rigged_variant(gObjectBumpProgram, gSkinnedObjectBumpProgram); success = success && gObjectBumpProgram.createShader(NULL, NULL); @@ -3159,8 +3159,8 @@ BOOL LLViewerShaderMgr::loadShadersObject() gObjectSimpleAlphaMaskProgram.mFeatures.hasAlphaMask = true; gObjectSimpleAlphaMaskProgram.mFeatures.mIndexedTextureChannels = 0; gObjectSimpleAlphaMaskProgram.mShaderFiles.clear(); - gObjectSimpleAlphaMaskProgram.mShaderFiles.push_back(make_pair("objects/simpleV.glsl", GL_VERTEX_SHADER_ARB)); - gObjectSimpleAlphaMaskProgram.mShaderFiles.push_back(make_pair("objects/simpleF.glsl", GL_FRAGMENT_SHADER_ARB)); + gObjectSimpleAlphaMaskProgram.mShaderFiles.push_back(make_pair("objects/simpleV.glsl", GL_VERTEX_SHADER)); + gObjectSimpleAlphaMaskProgram.mShaderFiles.push_back(make_pair("objects/simpleF.glsl", GL_FRAGMENT_SHADER)); gObjectSimpleAlphaMaskProgram.mShaderLevel = mShaderLevel[SHADER_OBJECT]; success = make_rigged_variant(gObjectSimpleAlphaMaskProgram, gSkinnedObjectSimpleAlphaMaskProgram); success = success && gObjectSimpleAlphaMaskProgram.createShader(NULL, NULL); @@ -3177,8 +3177,8 @@ BOOL LLViewerShaderMgr::loadShadersObject() gObjectSimpleWaterAlphaMaskProgram.mFeatures.hasAlphaMask = true; gObjectSimpleWaterAlphaMaskProgram.mFeatures.mIndexedTextureChannels = 0; gObjectSimpleWaterAlphaMaskProgram.mShaderFiles.clear(); - gObjectSimpleWaterAlphaMaskProgram.mShaderFiles.push_back(make_pair("objects/simpleV.glsl", GL_VERTEX_SHADER_ARB)); - gObjectSimpleWaterAlphaMaskProgram.mShaderFiles.push_back(make_pair("objects/simpleWaterF.glsl", GL_FRAGMENT_SHADER_ARB)); + gObjectSimpleWaterAlphaMaskProgram.mShaderFiles.push_back(make_pair("objects/simpleV.glsl", GL_VERTEX_SHADER)); + gObjectSimpleWaterAlphaMaskProgram.mShaderFiles.push_back(make_pair("objects/simpleWaterF.glsl", GL_FRAGMENT_SHADER)); gObjectSimpleWaterAlphaMaskProgram.mShaderLevel = mShaderLevel[SHADER_OBJECT]; gObjectSimpleWaterAlphaMaskProgram.mShaderGroup = LLGLSLShader::SG_WATER; success = make_rigged_variant(gObjectSimpleWaterAlphaMaskProgram, gSkinnedObjectSimpleWaterAlphaMaskProgram); @@ -3195,8 +3195,8 @@ BOOL LLViewerShaderMgr::loadShadersObject() gObjectFullbrightProgram.mFeatures.hasSrgb = true; gObjectFullbrightProgram.mFeatures.mIndexedTextureChannels = 0; gObjectFullbrightProgram.mShaderFiles.clear(); - gObjectFullbrightProgram.mShaderFiles.push_back(make_pair("objects/fullbrightV.glsl", GL_VERTEX_SHADER_ARB)); - gObjectFullbrightProgram.mShaderFiles.push_back(make_pair("objects/fullbrightF.glsl", GL_FRAGMENT_SHADER_ARB)); + gObjectFullbrightProgram.mShaderFiles.push_back(make_pair("objects/fullbrightV.glsl", GL_VERTEX_SHADER)); + gObjectFullbrightProgram.mShaderFiles.push_back(make_pair("objects/fullbrightF.glsl", GL_FRAGMENT_SHADER)); gObjectFullbrightProgram.mShaderLevel = mShaderLevel[SHADER_OBJECT]; success = make_rigged_variant(gObjectFullbrightProgram, gSkinnedObjectFullbrightProgram); success = success && gObjectFullbrightProgram.createShader(NULL, NULL); @@ -3211,8 +3211,8 @@ BOOL LLViewerShaderMgr::loadShadersObject() gObjectFullbrightWaterProgram.mFeatures.hasTransport = true; gObjectFullbrightWaterProgram.mFeatures.mIndexedTextureChannels = 0; gObjectFullbrightWaterProgram.mShaderFiles.clear(); - gObjectFullbrightWaterProgram.mShaderFiles.push_back(make_pair("objects/fullbrightV.glsl", GL_VERTEX_SHADER_ARB)); - gObjectFullbrightWaterProgram.mShaderFiles.push_back(make_pair("objects/fullbrightWaterF.glsl", GL_FRAGMENT_SHADER_ARB)); + gObjectFullbrightWaterProgram.mShaderFiles.push_back(make_pair("objects/fullbrightV.glsl", GL_VERTEX_SHADER)); + gObjectFullbrightWaterProgram.mShaderFiles.push_back(make_pair("objects/fullbrightWaterF.glsl", GL_FRAGMENT_SHADER)); gObjectFullbrightWaterProgram.mShaderLevel = mShaderLevel[SHADER_OBJECT]; gObjectFullbrightWaterProgram.mShaderGroup = LLGLSLShader::SG_WATER; success = make_rigged_variant(gObjectFullbrightWaterProgram, gSkinnedObjectFullbrightWaterProgram); @@ -3229,8 +3229,8 @@ BOOL LLViewerShaderMgr::loadShadersObject() gObjectEmissiveProgram.mFeatures.hasSrgb = true; gObjectEmissiveProgram.mFeatures.mIndexedTextureChannels = 0; gObjectEmissiveProgram.mShaderFiles.clear(); - gObjectEmissiveProgram.mShaderFiles.push_back(make_pair("objects/emissiveV.glsl", GL_VERTEX_SHADER_ARB)); - gObjectEmissiveProgram.mShaderFiles.push_back(make_pair("objects/fullbrightF.glsl", GL_FRAGMENT_SHADER_ARB)); + gObjectEmissiveProgram.mShaderFiles.push_back(make_pair("objects/emissiveV.glsl", GL_VERTEX_SHADER)); + gObjectEmissiveProgram.mShaderFiles.push_back(make_pair("objects/fullbrightF.glsl", GL_FRAGMENT_SHADER)); gObjectEmissiveProgram.mShaderLevel = mShaderLevel[SHADER_OBJECT]; success = make_rigged_variant(gObjectEmissiveProgram, gSkinnedObjectEmissiveProgram); success = success && gObjectEmissiveProgram.createShader(NULL, NULL); @@ -3245,8 +3245,8 @@ BOOL LLViewerShaderMgr::loadShadersObject() gObjectEmissiveWaterProgram.mFeatures.hasTransport = true; gObjectEmissiveWaterProgram.mFeatures.mIndexedTextureChannels = 0; gObjectEmissiveWaterProgram.mShaderFiles.clear(); - gObjectEmissiveWaterProgram.mShaderFiles.push_back(make_pair("objects/emissiveV.glsl", GL_VERTEX_SHADER_ARB)); - gObjectEmissiveWaterProgram.mShaderFiles.push_back(make_pair("objects/fullbrightWaterF.glsl", GL_FRAGMENT_SHADER_ARB)); + gObjectEmissiveWaterProgram.mShaderFiles.push_back(make_pair("objects/emissiveV.glsl", GL_VERTEX_SHADER)); + gObjectEmissiveWaterProgram.mShaderFiles.push_back(make_pair("objects/fullbrightWaterF.glsl", GL_FRAGMENT_SHADER)); gObjectEmissiveWaterProgram.mShaderLevel = mShaderLevel[SHADER_OBJECT]; gObjectEmissiveWaterProgram.mShaderGroup = LLGLSLShader::SG_WATER; success = make_rigged_variant(gObjectEmissiveWaterProgram, gSkinnedObjectEmissiveWaterProgram); @@ -3264,8 +3264,8 @@ BOOL LLViewerShaderMgr::loadShadersObject() gObjectFullbrightAlphaMaskProgram.mFeatures.hasSrgb = true; gObjectFullbrightAlphaMaskProgram.mFeatures.mIndexedTextureChannels = 0; gObjectFullbrightAlphaMaskProgram.mShaderFiles.clear(); - gObjectFullbrightAlphaMaskProgram.mShaderFiles.push_back(make_pair("objects/fullbrightV.glsl", GL_VERTEX_SHADER_ARB)); - gObjectFullbrightAlphaMaskProgram.mShaderFiles.push_back(make_pair("objects/fullbrightF.glsl", GL_FRAGMENT_SHADER_ARB)); + gObjectFullbrightAlphaMaskProgram.mShaderFiles.push_back(make_pair("objects/fullbrightV.glsl", GL_VERTEX_SHADER)); + gObjectFullbrightAlphaMaskProgram.mShaderFiles.push_back(make_pair("objects/fullbrightF.glsl", GL_FRAGMENT_SHADER)); gObjectFullbrightAlphaMaskProgram.mShaderLevel = mShaderLevel[SHADER_OBJECT]; success = make_rigged_variant(gObjectFullbrightAlphaMaskProgram, gSkinnedObjectFullbrightAlphaMaskProgram); success = success && gObjectFullbrightAlphaMaskProgram.createShader(NULL, NULL); @@ -3281,8 +3281,8 @@ BOOL LLViewerShaderMgr::loadShadersObject() gObjectFullbrightWaterAlphaMaskProgram.mFeatures.hasAlphaMask = true; gObjectFullbrightWaterAlphaMaskProgram.mFeatures.mIndexedTextureChannels = 0; gObjectFullbrightWaterAlphaMaskProgram.mShaderFiles.clear(); - gObjectFullbrightWaterAlphaMaskProgram.mShaderFiles.push_back(make_pair("objects/fullbrightV.glsl", GL_VERTEX_SHADER_ARB)); - gObjectFullbrightWaterAlphaMaskProgram.mShaderFiles.push_back(make_pair("objects/fullbrightWaterF.glsl", GL_FRAGMENT_SHADER_ARB)); + gObjectFullbrightWaterAlphaMaskProgram.mShaderFiles.push_back(make_pair("objects/fullbrightV.glsl", GL_VERTEX_SHADER)); + gObjectFullbrightWaterAlphaMaskProgram.mShaderFiles.push_back(make_pair("objects/fullbrightWaterF.glsl", GL_FRAGMENT_SHADER)); gObjectFullbrightWaterAlphaMaskProgram.mShaderLevel = mShaderLevel[SHADER_OBJECT]; gObjectFullbrightWaterAlphaMaskProgram.mShaderGroup = LLGLSLShader::SG_WATER; success = make_rigged_variant(gObjectFullbrightWaterAlphaMaskProgram, gSkinnedObjectFullbrightWaterAlphaMaskProgram); @@ -3299,8 +3299,8 @@ BOOL LLViewerShaderMgr::loadShadersObject() gObjectShinyProgram.mFeatures.isShiny = true; gObjectShinyProgram.mFeatures.mIndexedTextureChannels = 0; gObjectShinyProgram.mShaderFiles.clear(); - gObjectShinyProgram.mShaderFiles.push_back(make_pair("objects/shinyV.glsl", GL_VERTEX_SHADER_ARB)); - gObjectShinyProgram.mShaderFiles.push_back(make_pair("objects/shinyF.glsl", GL_FRAGMENT_SHADER_ARB)); + gObjectShinyProgram.mShaderFiles.push_back(make_pair("objects/shinyV.glsl", GL_VERTEX_SHADER)); + gObjectShinyProgram.mShaderFiles.push_back(make_pair("objects/shinyF.glsl", GL_FRAGMENT_SHADER)); gObjectShinyProgram.mShaderLevel = mShaderLevel[SHADER_OBJECT]; success = make_rigged_variant(gObjectShinyProgram, gSkinnedObjectShinyProgram); success = success && gObjectShinyProgram.createShader(NULL, NULL); @@ -3316,8 +3316,8 @@ BOOL LLViewerShaderMgr::loadShadersObject() gObjectShinyWaterProgram.mFeatures.hasAtmospherics = true; gObjectShinyWaterProgram.mFeatures.mIndexedTextureChannels = 0; gObjectShinyWaterProgram.mShaderFiles.clear(); - gObjectShinyWaterProgram.mShaderFiles.push_back(make_pair("objects/shinyWaterF.glsl", GL_FRAGMENT_SHADER_ARB)); - gObjectShinyWaterProgram.mShaderFiles.push_back(make_pair("objects/shinyV.glsl", GL_VERTEX_SHADER_ARB)); + gObjectShinyWaterProgram.mShaderFiles.push_back(make_pair("objects/shinyWaterF.glsl", GL_FRAGMENT_SHADER)); + gObjectShinyWaterProgram.mShaderFiles.push_back(make_pair("objects/shinyV.glsl", GL_VERTEX_SHADER)); gObjectShinyWaterProgram.mShaderLevel = mShaderLevel[SHADER_OBJECT]; gObjectShinyWaterProgram.mShaderGroup = LLGLSLShader::SG_WATER; success = make_rigged_variant(gObjectShinyWaterProgram, gSkinnedObjectShinyWaterProgram); @@ -3334,8 +3334,8 @@ BOOL LLViewerShaderMgr::loadShadersObject() gObjectFullbrightShinyProgram.mFeatures.hasTransport = true; gObjectFullbrightShinyProgram.mFeatures.mIndexedTextureChannels = 0; gObjectFullbrightShinyProgram.mShaderFiles.clear(); - gObjectFullbrightShinyProgram.mShaderFiles.push_back(make_pair("objects/fullbrightShinyV.glsl", GL_VERTEX_SHADER_ARB)); - gObjectFullbrightShinyProgram.mShaderFiles.push_back(make_pair("objects/fullbrightShinyF.glsl", GL_FRAGMENT_SHADER_ARB)); + gObjectFullbrightShinyProgram.mShaderFiles.push_back(make_pair("objects/fullbrightShinyV.glsl", GL_VERTEX_SHADER)); + gObjectFullbrightShinyProgram.mShaderFiles.push_back(make_pair("objects/fullbrightShinyF.glsl", GL_FRAGMENT_SHADER)); gObjectFullbrightShinyProgram.mShaderLevel = mShaderLevel[SHADER_OBJECT]; success = make_rigged_variant(gObjectFullbrightShinyProgram, gSkinnedObjectFullbrightShinyProgram); success = success && gObjectFullbrightShinyProgram.createShader(NULL, NULL); @@ -3352,8 +3352,8 @@ BOOL LLViewerShaderMgr::loadShadersObject() gObjectFullbrightShinyWaterProgram.mFeatures.hasWaterFog = true; gObjectFullbrightShinyWaterProgram.mFeatures.mIndexedTextureChannels = 0; gObjectFullbrightShinyWaterProgram.mShaderFiles.clear(); - gObjectFullbrightShinyWaterProgram.mShaderFiles.push_back(make_pair("objects/fullbrightShinyV.glsl", GL_VERTEX_SHADER_ARB)); - gObjectFullbrightShinyWaterProgram.mShaderFiles.push_back(make_pair("objects/fullbrightShinyWaterF.glsl", GL_FRAGMENT_SHADER_ARB)); + gObjectFullbrightShinyWaterProgram.mShaderFiles.push_back(make_pair("objects/fullbrightShinyV.glsl", GL_VERTEX_SHADER)); + gObjectFullbrightShinyWaterProgram.mShaderFiles.push_back(make_pair("objects/fullbrightShinyWaterF.glsl", GL_FRAGMENT_SHADER)); gObjectFullbrightShinyWaterProgram.mShaderLevel = mShaderLevel[SHADER_OBJECT]; gObjectFullbrightShinyWaterProgram.mShaderGroup = LLGLSLShader::SG_WATER; success = make_rigged_variant(gObjectFullbrightShinyWaterProgram, gSkinnedObjectFullbrightShinyWaterProgram); @@ -3394,8 +3394,8 @@ BOOL LLViewerShaderMgr::loadShadersAvatar() gAvatarProgram.mFeatures.hasAlphaMask = true; gAvatarProgram.mFeatures.disableTextureIndex = true; gAvatarProgram.mShaderFiles.clear(); - gAvatarProgram.mShaderFiles.push_back(make_pair("avatar/avatarV.glsl", GL_VERTEX_SHADER_ARB)); - gAvatarProgram.mShaderFiles.push_back(make_pair("avatar/avatarF.glsl", GL_FRAGMENT_SHADER_ARB)); + gAvatarProgram.mShaderFiles.push_back(make_pair("avatar/avatarV.glsl", GL_VERTEX_SHADER)); + gAvatarProgram.mShaderFiles.push_back(make_pair("avatar/avatarF.glsl", GL_FRAGMENT_SHADER)); gAvatarProgram.mShaderLevel = mShaderLevel[SHADER_AVATAR]; success = gAvatarProgram.createShader(NULL, NULL); @@ -3411,8 +3411,8 @@ BOOL LLViewerShaderMgr::loadShadersAvatar() gAvatarWaterProgram.mFeatures.hasAlphaMask = true; gAvatarWaterProgram.mFeatures.disableTextureIndex = true; gAvatarWaterProgram.mShaderFiles.clear(); - gAvatarWaterProgram.mShaderFiles.push_back(make_pair("avatar/avatarV.glsl", GL_VERTEX_SHADER_ARB)); - gAvatarWaterProgram.mShaderFiles.push_back(make_pair("objects/simpleWaterF.glsl", GL_FRAGMENT_SHADER_ARB)); + gAvatarWaterProgram.mShaderFiles.push_back(make_pair("avatar/avatarV.glsl", GL_VERTEX_SHADER)); + gAvatarWaterProgram.mShaderFiles.push_back(make_pair("objects/simpleWaterF.glsl", GL_FRAGMENT_SHADER)); // Note: no cloth under water: gAvatarWaterProgram.mShaderLevel = llmin(mShaderLevel[SHADER_AVATAR], 1); gAvatarWaterProgram.mShaderGroup = LLGLSLShader::SG_WATER; @@ -3432,8 +3432,8 @@ BOOL LLViewerShaderMgr::loadShadersAvatar() gAvatarPickProgram.mFeatures.hasSkinning = true; gAvatarPickProgram.mFeatures.disableTextureIndex = true; gAvatarPickProgram.mShaderFiles.clear(); - gAvatarPickProgram.mShaderFiles.push_back(make_pair("avatar/pickAvatarV.glsl", GL_VERTEX_SHADER_ARB)); - gAvatarPickProgram.mShaderFiles.push_back(make_pair("avatar/pickAvatarF.glsl", GL_FRAGMENT_SHADER_ARB)); + gAvatarPickProgram.mShaderFiles.push_back(make_pair("avatar/pickAvatarV.glsl", GL_VERTEX_SHADER)); + gAvatarPickProgram.mShaderFiles.push_back(make_pair("avatar/pickAvatarF.glsl", GL_FRAGMENT_SHADER)); gAvatarPickProgram.mShaderLevel = mShaderLevel[SHADER_AVATAR]; success = gAvatarPickProgram.createShader(NULL, NULL); } @@ -3450,8 +3450,8 @@ BOOL LLViewerShaderMgr::loadShadersAvatar() gAvatarEyeballProgram.mFeatures.hasAlphaMask = true; gAvatarEyeballProgram.mFeatures.disableTextureIndex = true; gAvatarEyeballProgram.mShaderFiles.clear(); - gAvatarEyeballProgram.mShaderFiles.push_back(make_pair("avatar/eyeballV.glsl", GL_VERTEX_SHADER_ARB)); - gAvatarEyeballProgram.mShaderFiles.push_back(make_pair("avatar/eyeballF.glsl", GL_FRAGMENT_SHADER_ARB)); + gAvatarEyeballProgram.mShaderFiles.push_back(make_pair("avatar/eyeballV.glsl", GL_VERTEX_SHADER)); + gAvatarEyeballProgram.mShaderFiles.push_back(make_pair("avatar/eyeballF.glsl", GL_FRAGMENT_SHADER)); gAvatarEyeballProgram.mShaderLevel = mShaderLevel[SHADER_AVATAR]; success = gAvatarEyeballProgram.createShader(NULL, NULL); } @@ -3474,8 +3474,8 @@ BOOL LLViewerShaderMgr::loadShadersInterface() { gHighlightProgram.mName = "Highlight Shader"; gHighlightProgram.mShaderFiles.clear(); - gHighlightProgram.mShaderFiles.push_back(make_pair("interface/highlightV.glsl", GL_VERTEX_SHADER_ARB)); - gHighlightProgram.mShaderFiles.push_back(make_pair("interface/highlightF.glsl", GL_FRAGMENT_SHADER_ARB)); + gHighlightProgram.mShaderFiles.push_back(make_pair("interface/highlightV.glsl", GL_VERTEX_SHADER)); + gHighlightProgram.mShaderFiles.push_back(make_pair("interface/highlightF.glsl", GL_FRAGMENT_SHADER)); gHighlightProgram.mShaderLevel = mShaderLevel[SHADER_INTERFACE]; success = make_rigged_variant(gHighlightProgram, gSkinnedHighlightProgram); success = success && gHighlightProgram.createShader(NULL, NULL); @@ -3485,8 +3485,8 @@ BOOL LLViewerShaderMgr::loadShadersInterface() { gHighlightNormalProgram.mName = "Highlight Normals Shader"; gHighlightNormalProgram.mShaderFiles.clear(); - gHighlightNormalProgram.mShaderFiles.push_back(make_pair("interface/highlightNormV.glsl", GL_VERTEX_SHADER_ARB)); - gHighlightNormalProgram.mShaderFiles.push_back(make_pair("interface/highlightF.glsl", GL_FRAGMENT_SHADER_ARB)); + gHighlightNormalProgram.mShaderFiles.push_back(make_pair("interface/highlightNormV.glsl", GL_VERTEX_SHADER)); + gHighlightNormalProgram.mShaderFiles.push_back(make_pair("interface/highlightF.glsl", GL_FRAGMENT_SHADER)); gHighlightNormalProgram.mShaderLevel = mShaderLevel[SHADER_INTERFACE]; success = gHighlightNormalProgram.createShader(NULL, NULL); } @@ -3495,8 +3495,8 @@ BOOL LLViewerShaderMgr::loadShadersInterface() { gHighlightSpecularProgram.mName = "Highlight Spec Shader"; gHighlightSpecularProgram.mShaderFiles.clear(); - gHighlightSpecularProgram.mShaderFiles.push_back(make_pair("interface/highlightSpecV.glsl", GL_VERTEX_SHADER_ARB)); - gHighlightSpecularProgram.mShaderFiles.push_back(make_pair("interface/highlightF.glsl", GL_FRAGMENT_SHADER_ARB)); + gHighlightSpecularProgram.mShaderFiles.push_back(make_pair("interface/highlightSpecV.glsl", GL_VERTEX_SHADER)); + gHighlightSpecularProgram.mShaderFiles.push_back(make_pair("interface/highlightF.glsl", GL_FRAGMENT_SHADER)); gHighlightSpecularProgram.mShaderLevel = mShaderLevel[SHADER_INTERFACE]; success = gHighlightSpecularProgram.createShader(NULL, NULL); } @@ -3505,8 +3505,8 @@ BOOL LLViewerShaderMgr::loadShadersInterface() { gUIProgram.mName = "UI Shader"; gUIProgram.mShaderFiles.clear(); - gUIProgram.mShaderFiles.push_back(make_pair("interface/uiV.glsl", GL_VERTEX_SHADER_ARB)); - gUIProgram.mShaderFiles.push_back(make_pair("interface/uiF.glsl", GL_FRAGMENT_SHADER_ARB)); + gUIProgram.mShaderFiles.push_back(make_pair("interface/uiV.glsl", GL_VERTEX_SHADER)); + gUIProgram.mShaderFiles.push_back(make_pair("interface/uiF.glsl", GL_FRAGMENT_SHADER)); gUIProgram.mShaderLevel = mShaderLevel[SHADER_INTERFACE]; success = gUIProgram.createShader(NULL, NULL); } @@ -3515,8 +3515,8 @@ BOOL LLViewerShaderMgr::loadShadersInterface() { gPathfindingProgram.mName = "Pathfinding Shader"; gPathfindingProgram.mShaderFiles.clear(); - gPathfindingProgram.mShaderFiles.push_back(make_pair("interface/pathfindingV.glsl", GL_VERTEX_SHADER_ARB)); - gPathfindingProgram.mShaderFiles.push_back(make_pair("interface/pathfindingF.glsl", GL_FRAGMENT_SHADER_ARB)); + gPathfindingProgram.mShaderFiles.push_back(make_pair("interface/pathfindingV.glsl", GL_VERTEX_SHADER)); + gPathfindingProgram.mShaderFiles.push_back(make_pair("interface/pathfindingF.glsl", GL_FRAGMENT_SHADER)); gPathfindingProgram.mShaderLevel = mShaderLevel[SHADER_INTERFACE]; success = gPathfindingProgram.createShader(NULL, NULL); } @@ -3525,8 +3525,8 @@ BOOL LLViewerShaderMgr::loadShadersInterface() { gPathfindingNoNormalsProgram.mName = "PathfindingNoNormals Shader"; gPathfindingNoNormalsProgram.mShaderFiles.clear(); - gPathfindingNoNormalsProgram.mShaderFiles.push_back(make_pair("interface/pathfindingNoNormalV.glsl", GL_VERTEX_SHADER_ARB)); - gPathfindingNoNormalsProgram.mShaderFiles.push_back(make_pair("interface/pathfindingF.glsl", GL_FRAGMENT_SHADER_ARB)); + gPathfindingNoNormalsProgram.mShaderFiles.push_back(make_pair("interface/pathfindingNoNormalV.glsl", GL_VERTEX_SHADER)); + gPathfindingNoNormalsProgram.mShaderFiles.push_back(make_pair("interface/pathfindingF.glsl", GL_FRAGMENT_SHADER)); gPathfindingNoNormalsProgram.mShaderLevel = mShaderLevel[SHADER_INTERFACE]; success = gPathfindingNoNormalsProgram.createShader(NULL, NULL); } @@ -3535,8 +3535,8 @@ BOOL LLViewerShaderMgr::loadShadersInterface() { gCustomAlphaProgram.mName = "Custom Alpha Shader"; gCustomAlphaProgram.mShaderFiles.clear(); - gCustomAlphaProgram.mShaderFiles.push_back(make_pair("interface/customalphaV.glsl", GL_VERTEX_SHADER_ARB)); - gCustomAlphaProgram.mShaderFiles.push_back(make_pair("interface/customalphaF.glsl", GL_FRAGMENT_SHADER_ARB)); + gCustomAlphaProgram.mShaderFiles.push_back(make_pair("interface/customalphaV.glsl", GL_VERTEX_SHADER)); + gCustomAlphaProgram.mShaderFiles.push_back(make_pair("interface/customalphaF.glsl", GL_FRAGMENT_SHADER)); gCustomAlphaProgram.mShaderLevel = mShaderLevel[SHADER_INTERFACE]; success = gCustomAlphaProgram.createShader(NULL, NULL); } @@ -3545,8 +3545,8 @@ BOOL LLViewerShaderMgr::loadShadersInterface() { gSplatTextureRectProgram.mName = "Splat Texture Rect Shader"; gSplatTextureRectProgram.mShaderFiles.clear(); - gSplatTextureRectProgram.mShaderFiles.push_back(make_pair("interface/splattexturerectV.glsl", GL_VERTEX_SHADER_ARB)); - gSplatTextureRectProgram.mShaderFiles.push_back(make_pair("interface/splattexturerectF.glsl", GL_FRAGMENT_SHADER_ARB)); + gSplatTextureRectProgram.mShaderFiles.push_back(make_pair("interface/splattexturerectV.glsl", GL_VERTEX_SHADER)); + gSplatTextureRectProgram.mShaderFiles.push_back(make_pair("interface/splattexturerectF.glsl", GL_FRAGMENT_SHADER)); gSplatTextureRectProgram.mShaderLevel = mShaderLevel[SHADER_INTERFACE]; success = gSplatTextureRectProgram.createShader(NULL, NULL); if (success) @@ -3561,8 +3561,8 @@ BOOL LLViewerShaderMgr::loadShadersInterface() { gGlowCombineProgram.mName = "Glow Combine Shader"; gGlowCombineProgram.mShaderFiles.clear(); - gGlowCombineProgram.mShaderFiles.push_back(make_pair("interface/glowcombineV.glsl", GL_VERTEX_SHADER_ARB)); - gGlowCombineProgram.mShaderFiles.push_back(make_pair("interface/glowcombineF.glsl", GL_FRAGMENT_SHADER_ARB)); + gGlowCombineProgram.mShaderFiles.push_back(make_pair("interface/glowcombineV.glsl", GL_VERTEX_SHADER)); + gGlowCombineProgram.mShaderFiles.push_back(make_pair("interface/glowcombineF.glsl", GL_FRAGMENT_SHADER)); gGlowCombineProgram.mShaderLevel = mShaderLevel[SHADER_INTERFACE]; success = gGlowCombineProgram.createShader(NULL, NULL); if (success) @@ -3578,8 +3578,8 @@ BOOL LLViewerShaderMgr::loadShadersInterface() { gGlowCombineFXAAProgram.mName = "Glow CombineFXAA Shader"; gGlowCombineFXAAProgram.mShaderFiles.clear(); - gGlowCombineFXAAProgram.mShaderFiles.push_back(make_pair("interface/glowcombineFXAAV.glsl", GL_VERTEX_SHADER_ARB)); - gGlowCombineFXAAProgram.mShaderFiles.push_back(make_pair("interface/glowcombineFXAAF.glsl", GL_FRAGMENT_SHADER_ARB)); + gGlowCombineFXAAProgram.mShaderFiles.push_back(make_pair("interface/glowcombineFXAAV.glsl", GL_VERTEX_SHADER)); + gGlowCombineFXAAProgram.mShaderFiles.push_back(make_pair("interface/glowcombineFXAAF.glsl", GL_FRAGMENT_SHADER)); gGlowCombineFXAAProgram.mShaderLevel = mShaderLevel[SHADER_INTERFACE]; success = gGlowCombineFXAAProgram.createShader(NULL, NULL); if (success) @@ -3596,8 +3596,8 @@ BOOL LLViewerShaderMgr::loadShadersInterface() { gTwoTextureAddProgram.mName = "Two Texture Add Shader"; gTwoTextureAddProgram.mShaderFiles.clear(); - gTwoTextureAddProgram.mShaderFiles.push_back(make_pair("interface/twotextureaddV.glsl", GL_VERTEX_SHADER_ARB)); - gTwoTextureAddProgram.mShaderFiles.push_back(make_pair("interface/twotextureaddF.glsl", GL_FRAGMENT_SHADER_ARB)); + gTwoTextureAddProgram.mShaderFiles.push_back(make_pair("interface/twotextureaddV.glsl", GL_VERTEX_SHADER)); + gTwoTextureAddProgram.mShaderFiles.push_back(make_pair("interface/twotextureaddF.glsl", GL_FRAGMENT_SHADER)); gTwoTextureAddProgram.mShaderLevel = mShaderLevel[SHADER_INTERFACE]; success = gTwoTextureAddProgram.createShader(NULL, NULL); if (success) @@ -3613,8 +3613,8 @@ BOOL LLViewerShaderMgr::loadShadersInterface() { gTwoTextureCompareProgram.mName = "Two Texture Compare Shader"; gTwoTextureCompareProgram.mShaderFiles.clear(); - gTwoTextureCompareProgram.mShaderFiles.push_back(make_pair("interface/twotexturecompareV.glsl", GL_VERTEX_SHADER_ARB)); - gTwoTextureCompareProgram.mShaderFiles.push_back(make_pair("interface/twotexturecompareF.glsl", GL_FRAGMENT_SHADER_ARB)); + gTwoTextureCompareProgram.mShaderFiles.push_back(make_pair("interface/twotexturecompareV.glsl", GL_VERTEX_SHADER)); + gTwoTextureCompareProgram.mShaderFiles.push_back(make_pair("interface/twotexturecompareF.glsl", GL_FRAGMENT_SHADER)); gTwoTextureCompareProgram.mShaderLevel = mShaderLevel[SHADER_INTERFACE]; success = gTwoTextureCompareProgram.createShader(NULL, NULL); if (success) @@ -3630,8 +3630,8 @@ BOOL LLViewerShaderMgr::loadShadersInterface() { gOneTextureFilterProgram.mName = "One Texture Filter Shader"; gOneTextureFilterProgram.mShaderFiles.clear(); - gOneTextureFilterProgram.mShaderFiles.push_back(make_pair("interface/onetexturefilterV.glsl", GL_VERTEX_SHADER_ARB)); - gOneTextureFilterProgram.mShaderFiles.push_back(make_pair("interface/onetexturefilterF.glsl", GL_FRAGMENT_SHADER_ARB)); + gOneTextureFilterProgram.mShaderFiles.push_back(make_pair("interface/onetexturefilterV.glsl", GL_VERTEX_SHADER)); + gOneTextureFilterProgram.mShaderFiles.push_back(make_pair("interface/onetexturefilterF.glsl", GL_FRAGMENT_SHADER)); gOneTextureFilterProgram.mShaderLevel = mShaderLevel[SHADER_INTERFACE]; success = gOneTextureFilterProgram.createShader(NULL, NULL); if (success) @@ -3646,8 +3646,8 @@ BOOL LLViewerShaderMgr::loadShadersInterface() { gOneTextureNoColorProgram.mName = "One Texture No Color Shader"; gOneTextureNoColorProgram.mShaderFiles.clear(); - gOneTextureNoColorProgram.mShaderFiles.push_back(make_pair("interface/onetexturenocolorV.glsl", GL_VERTEX_SHADER_ARB)); - gOneTextureNoColorProgram.mShaderFiles.push_back(make_pair("interface/onetexturenocolorF.glsl", GL_FRAGMENT_SHADER_ARB)); + gOneTextureNoColorProgram.mShaderFiles.push_back(make_pair("interface/onetexturenocolorV.glsl", GL_VERTEX_SHADER)); + gOneTextureNoColorProgram.mShaderFiles.push_back(make_pair("interface/onetexturenocolorF.glsl", GL_FRAGMENT_SHADER)); gOneTextureNoColorProgram.mShaderLevel = mShaderLevel[SHADER_INTERFACE]; success = gOneTextureNoColorProgram.createShader(NULL, NULL); if (success) @@ -3661,8 +3661,8 @@ BOOL LLViewerShaderMgr::loadShadersInterface() { gSolidColorProgram.mName = "Solid Color Shader"; gSolidColorProgram.mShaderFiles.clear(); - gSolidColorProgram.mShaderFiles.push_back(make_pair("interface/solidcolorV.glsl", GL_VERTEX_SHADER_ARB)); - gSolidColorProgram.mShaderFiles.push_back(make_pair("interface/solidcolorF.glsl", GL_FRAGMENT_SHADER_ARB)); + gSolidColorProgram.mShaderFiles.push_back(make_pair("interface/solidcolorV.glsl", GL_VERTEX_SHADER)); + gSolidColorProgram.mShaderFiles.push_back(make_pair("interface/solidcolorF.glsl", GL_FRAGMENT_SHADER)); gSolidColorProgram.mShaderLevel = mShaderLevel[SHADER_INTERFACE]; success = gSolidColorProgram.createShader(NULL, NULL); if (success) @@ -3677,8 +3677,8 @@ BOOL LLViewerShaderMgr::loadShadersInterface() { gOcclusionProgram.mName = "Occlusion Shader"; gOcclusionProgram.mShaderFiles.clear(); - gOcclusionProgram.mShaderFiles.push_back(make_pair("interface/occlusionV.glsl", GL_VERTEX_SHADER_ARB)); - gOcclusionProgram.mShaderFiles.push_back(make_pair("interface/occlusionF.glsl", GL_FRAGMENT_SHADER_ARB)); + gOcclusionProgram.mShaderFiles.push_back(make_pair("interface/occlusionV.glsl", GL_VERTEX_SHADER)); + gOcclusionProgram.mShaderFiles.push_back(make_pair("interface/occlusionF.glsl", GL_FRAGMENT_SHADER)); gOcclusionProgram.mShaderLevel = mShaderLevel[SHADER_INTERFACE]; gOcclusionProgram.mRiggedVariant = &gSkinnedOcclusionProgram; success = gOcclusionProgram.createShader(NULL, NULL); @@ -3689,8 +3689,8 @@ BOOL LLViewerShaderMgr::loadShadersInterface() gSkinnedOcclusionProgram.mName = "Skinned Occlusion Shader"; gSkinnedOcclusionProgram.mFeatures.hasObjectSkinning = true; gSkinnedOcclusionProgram.mShaderFiles.clear(); - gSkinnedOcclusionProgram.mShaderFiles.push_back(make_pair("interface/occlusionSkinnedV.glsl", GL_VERTEX_SHADER_ARB)); - gSkinnedOcclusionProgram.mShaderFiles.push_back(make_pair("interface/occlusionF.glsl", GL_FRAGMENT_SHADER_ARB)); + gSkinnedOcclusionProgram.mShaderFiles.push_back(make_pair("interface/occlusionSkinnedV.glsl", GL_VERTEX_SHADER)); + gSkinnedOcclusionProgram.mShaderFiles.push_back(make_pair("interface/occlusionF.glsl", GL_FRAGMENT_SHADER)); gSkinnedOcclusionProgram.mShaderLevel = mShaderLevel[SHADER_INTERFACE]; success = gSkinnedOcclusionProgram.createShader(NULL, NULL); } @@ -3699,8 +3699,8 @@ BOOL LLViewerShaderMgr::loadShadersInterface() { gOcclusionCubeProgram.mName = "Occlusion Cube Shader"; gOcclusionCubeProgram.mShaderFiles.clear(); - gOcclusionCubeProgram.mShaderFiles.push_back(make_pair("interface/occlusionCubeV.glsl", GL_VERTEX_SHADER_ARB)); - gOcclusionCubeProgram.mShaderFiles.push_back(make_pair("interface/occlusionF.glsl", GL_FRAGMENT_SHADER_ARB)); + gOcclusionCubeProgram.mShaderFiles.push_back(make_pair("interface/occlusionCubeV.glsl", GL_VERTEX_SHADER)); + gOcclusionCubeProgram.mShaderFiles.push_back(make_pair("interface/occlusionF.glsl", GL_FRAGMENT_SHADER)); gOcclusionCubeProgram.mShaderLevel = mShaderLevel[SHADER_INTERFACE]; success = gOcclusionCubeProgram.createShader(NULL, NULL); } @@ -3709,8 +3709,8 @@ BOOL LLViewerShaderMgr::loadShadersInterface() { gDebugProgram.mName = "Debug Shader"; gDebugProgram.mShaderFiles.clear(); - gDebugProgram.mShaderFiles.push_back(make_pair("interface/debugV.glsl", GL_VERTEX_SHADER_ARB)); - gDebugProgram.mShaderFiles.push_back(make_pair("interface/debugF.glsl", GL_FRAGMENT_SHADER_ARB)); + gDebugProgram.mShaderFiles.push_back(make_pair("interface/debugV.glsl", GL_VERTEX_SHADER)); + gDebugProgram.mShaderFiles.push_back(make_pair("interface/debugF.glsl", GL_FRAGMENT_SHADER)); gDebugProgram.mRiggedVariant = &gSkinnedDebugProgram; gDebugProgram.mShaderLevel = mShaderLevel[SHADER_INTERFACE]; success = make_rigged_variant(gDebugProgram, gSkinnedDebugProgram); @@ -3721,8 +3721,8 @@ BOOL LLViewerShaderMgr::loadShadersInterface() { gClipProgram.mName = "Clip Shader"; gClipProgram.mShaderFiles.clear(); - gClipProgram.mShaderFiles.push_back(make_pair("interface/clipV.glsl", GL_VERTEX_SHADER_ARB)); - gClipProgram.mShaderFiles.push_back(make_pair("interface/clipF.glsl", GL_FRAGMENT_SHADER_ARB)); + gClipProgram.mShaderFiles.push_back(make_pair("interface/clipV.glsl", GL_VERTEX_SHADER)); + gClipProgram.mShaderFiles.push_back(make_pair("interface/clipF.glsl", GL_FRAGMENT_SHADER)); gClipProgram.mShaderLevel = mShaderLevel[SHADER_INTERFACE]; success = gClipProgram.createShader(NULL, NULL); } @@ -3731,8 +3731,8 @@ BOOL LLViewerShaderMgr::loadShadersInterface() { gDownsampleDepthProgram.mName = "DownsampleDepth Shader"; gDownsampleDepthProgram.mShaderFiles.clear(); - gDownsampleDepthProgram.mShaderFiles.push_back(make_pair("interface/downsampleDepthV.glsl", GL_VERTEX_SHADER_ARB)); - gDownsampleDepthProgram.mShaderFiles.push_back(make_pair("interface/downsampleDepthF.glsl", GL_FRAGMENT_SHADER_ARB)); + gDownsampleDepthProgram.mShaderFiles.push_back(make_pair("interface/downsampleDepthV.glsl", GL_VERTEX_SHADER)); + gDownsampleDepthProgram.mShaderFiles.push_back(make_pair("interface/downsampleDepthF.glsl", GL_FRAGMENT_SHADER)); gDownsampleDepthProgram.mShaderLevel = mShaderLevel[SHADER_INTERFACE]; success = gDownsampleDepthProgram.createShader(NULL, NULL); } @@ -3741,8 +3741,8 @@ BOOL LLViewerShaderMgr::loadShadersInterface() { gBenchmarkProgram.mName = "Benchmark Shader"; gBenchmarkProgram.mShaderFiles.clear(); - gBenchmarkProgram.mShaderFiles.push_back(make_pair("interface/benchmarkV.glsl", GL_VERTEX_SHADER_ARB)); - gBenchmarkProgram.mShaderFiles.push_back(make_pair("interface/benchmarkF.glsl", GL_FRAGMENT_SHADER_ARB)); + gBenchmarkProgram.mShaderFiles.push_back(make_pair("interface/benchmarkV.glsl", GL_VERTEX_SHADER)); + gBenchmarkProgram.mShaderFiles.push_back(make_pair("interface/benchmarkF.glsl", GL_FRAGMENT_SHADER)); gBenchmarkProgram.mShaderLevel = mShaderLevel[SHADER_INTERFACE]; success = gBenchmarkProgram.createShader(NULL, NULL); } @@ -3751,8 +3751,8 @@ BOOL LLViewerShaderMgr::loadShadersInterface() { gDownsampleDepthRectProgram.mName = "DownsampleDepthRect Shader"; gDownsampleDepthRectProgram.mShaderFiles.clear(); - gDownsampleDepthRectProgram.mShaderFiles.push_back(make_pair("interface/downsampleDepthV.glsl", GL_VERTEX_SHADER_ARB)); - gDownsampleDepthRectProgram.mShaderFiles.push_back(make_pair("interface/downsampleDepthRectF.glsl", GL_FRAGMENT_SHADER_ARB)); + gDownsampleDepthRectProgram.mShaderFiles.push_back(make_pair("interface/downsampleDepthV.glsl", GL_VERTEX_SHADER)); + gDownsampleDepthRectProgram.mShaderFiles.push_back(make_pair("interface/downsampleDepthRectF.glsl", GL_FRAGMENT_SHADER)); gDownsampleDepthRectProgram.mShaderLevel = mShaderLevel[SHADER_INTERFACE]; success = gDownsampleDepthRectProgram.createShader(NULL, NULL); } @@ -3761,8 +3761,8 @@ BOOL LLViewerShaderMgr::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.mShaderFiles.push_back(make_pair("interface/alphamaskV.glsl", GL_VERTEX_SHADER)); + gAlphaMaskProgram.mShaderFiles.push_back(make_pair("interface/alphamaskF.glsl", GL_FRAGMENT_SHADER)); gAlphaMaskProgram.mShaderLevel = mShaderLevel[SHADER_INTERFACE]; success = gAlphaMaskProgram.createShader(NULL, NULL); } @@ -3797,8 +3797,8 @@ BOOL LLViewerShaderMgr::loadShadersWindLight() gWLSkyProgram.mFeatures.hasTransport = true; gWLSkyProgram.mFeatures.hasGamma = true; gWLSkyProgram.mFeatures.hasSrgb = true; - gWLSkyProgram.mShaderFiles.push_back(make_pair("windlight/skyV.glsl", GL_VERTEX_SHADER_ARB)); - gWLSkyProgram.mShaderFiles.push_back(make_pair("windlight/skyF.glsl", GL_FRAGMENT_SHADER_ARB)); + gWLSkyProgram.mShaderFiles.push_back(make_pair("windlight/skyV.glsl", GL_VERTEX_SHADER)); + gWLSkyProgram.mShaderFiles.push_back(make_pair("windlight/skyF.glsl", GL_FRAGMENT_SHADER)); gWLSkyProgram.mShaderLevel = mShaderLevel[SHADER_WINDLIGHT]; gWLSkyProgram.mShaderGroup = LLGLSLShader::SG_SKY; success = gWLSkyProgram.createShader(NULL, NULL); @@ -3812,8 +3812,8 @@ BOOL LLViewerShaderMgr::loadShadersWindLight() gWLCloudProgram.mFeatures.hasTransport = true; gWLCloudProgram.mFeatures.hasGamma = true; gWLCloudProgram.mFeatures.hasSrgb = true; - gWLCloudProgram.mShaderFiles.push_back(make_pair("windlight/cloudsV.glsl", GL_VERTEX_SHADER_ARB)); - gWLCloudProgram.mShaderFiles.push_back(make_pair("windlight/cloudsF.glsl", GL_FRAGMENT_SHADER_ARB)); + gWLCloudProgram.mShaderFiles.push_back(make_pair("windlight/cloudsV.glsl", GL_VERTEX_SHADER)); + gWLCloudProgram.mShaderFiles.push_back(make_pair("windlight/cloudsF.glsl", GL_FRAGMENT_SHADER)); gWLCloudProgram.mShaderLevel = mShaderLevel[SHADER_WINDLIGHT]; gWLCloudProgram.mShaderGroup = LLGLSLShader::SG_SKY; success = gWLCloudProgram.createShader(NULL, NULL); @@ -3830,8 +3830,8 @@ BOOL LLViewerShaderMgr::loadShadersWindLight() gWLSunProgram.mFeatures.isFullbright = true; gWLSunProgram.mFeatures.disableTextureIndex = true; gWLSunProgram.mShaderGroup = LLGLSLShader::SG_SKY; - gWLSunProgram.mShaderFiles.push_back(make_pair("windlight/sunDiscV.glsl", GL_VERTEX_SHADER_ARB)); - gWLSunProgram.mShaderFiles.push_back(make_pair("windlight/sunDiscF.glsl", GL_FRAGMENT_SHADER_ARB)); + gWLSunProgram.mShaderFiles.push_back(make_pair("windlight/sunDiscV.glsl", GL_VERTEX_SHADER)); + gWLSunProgram.mShaderFiles.push_back(make_pair("windlight/sunDiscF.glsl", GL_FRAGMENT_SHADER)); gWLSunProgram.mShaderLevel = mShaderLevel[SHADER_WINDLIGHT]; gWLSunProgram.mShaderGroup = LLGLSLShader::SG_SKY; success = gWLSunProgram.createShader(NULL, NULL); @@ -3848,8 +3848,8 @@ BOOL LLViewerShaderMgr::loadShadersWindLight() gWLMoonProgram.mFeatures.isFullbright = true; gWLMoonProgram.mFeatures.disableTextureIndex = true; gWLMoonProgram.mShaderGroup = LLGLSLShader::SG_SKY; - gWLMoonProgram.mShaderFiles.push_back(make_pair("windlight/moonV.glsl", GL_VERTEX_SHADER_ARB)); - gWLMoonProgram.mShaderFiles.push_back(make_pair("windlight/moonF.glsl", GL_FRAGMENT_SHADER_ARB)); + gWLMoonProgram.mShaderFiles.push_back(make_pair("windlight/moonV.glsl", GL_VERTEX_SHADER)); + gWLMoonProgram.mShaderFiles.push_back(make_pair("windlight/moonF.glsl", GL_FRAGMENT_SHADER)); gWLMoonProgram.mShaderLevel = mShaderLevel[SHADER_WINDLIGHT]; gWLMoonProgram.mShaderGroup = LLGLSLShader::SG_SKY; success = gWLMoonProgram.createShader(NULL, NULL); @@ -3876,7 +3876,7 @@ BOOL LLViewerShaderMgr::loadTransformShaders() { gTransformPositionProgram.mName = "Position Transform Shader"; gTransformPositionProgram.mShaderFiles.clear(); - gTransformPositionProgram.mShaderFiles.push_back(make_pair("transform/positionV.glsl", GL_VERTEX_SHADER_ARB)); + gTransformPositionProgram.mShaderFiles.push_back(make_pair("transform/positionV.glsl", GL_VERTEX_SHADER)); gTransformPositionProgram.mShaderLevel = mShaderLevel[SHADER_TRANSFORM]; const char* varyings[] = { @@ -3891,7 +3891,7 @@ BOOL LLViewerShaderMgr::loadTransformShaders() { gTransformTexCoordProgram.mName = "TexCoord Transform Shader"; gTransformTexCoordProgram.mShaderFiles.clear(); - gTransformTexCoordProgram.mShaderFiles.push_back(make_pair("transform/texcoordV.glsl", GL_VERTEX_SHADER_ARB)); + gTransformTexCoordProgram.mShaderFiles.push_back(make_pair("transform/texcoordV.glsl", GL_VERTEX_SHADER)); gTransformTexCoordProgram.mShaderLevel = mShaderLevel[SHADER_TRANSFORM]; const char* varyings[] = { @@ -3905,7 +3905,7 @@ BOOL LLViewerShaderMgr::loadTransformShaders() { gTransformNormalProgram.mName = "Normal Transform Shader"; gTransformNormalProgram.mShaderFiles.clear(); - gTransformNormalProgram.mShaderFiles.push_back(make_pair("transform/normalV.glsl", GL_VERTEX_SHADER_ARB)); + gTransformNormalProgram.mShaderFiles.push_back(make_pair("transform/normalV.glsl", GL_VERTEX_SHADER)); gTransformNormalProgram.mShaderLevel = mShaderLevel[SHADER_TRANSFORM]; const char* varyings[] = { @@ -3919,7 +3919,7 @@ BOOL LLViewerShaderMgr::loadTransformShaders() { gTransformColorProgram.mName = "Color Transform Shader"; gTransformColorProgram.mShaderFiles.clear(); - gTransformColorProgram.mShaderFiles.push_back(make_pair("transform/colorV.glsl", GL_VERTEX_SHADER_ARB)); + gTransformColorProgram.mShaderFiles.push_back(make_pair("transform/colorV.glsl", GL_VERTEX_SHADER)); gTransformColorProgram.mShaderLevel = mShaderLevel[SHADER_TRANSFORM]; const char* varyings[] = { @@ -3933,7 +3933,7 @@ BOOL LLViewerShaderMgr::loadTransformShaders() { gTransformTangentProgram.mName = "Binormal Transform Shader"; gTransformTangentProgram.mShaderFiles.clear(); - gTransformTangentProgram.mShaderFiles.push_back(make_pair("transform/binormalV.glsl", GL_VERTEX_SHADER_ARB)); + gTransformTangentProgram.mShaderFiles.push_back(make_pair("transform/binormalV.glsl", GL_VERTEX_SHADER)); gTransformTangentProgram.mShaderLevel = mShaderLevel[SHADER_TRANSFORM]; const char* varyings[] = { diff --git a/indra/newview/llvograss.cpp b/indra/newview/llvograss.cpp index 9a41eedb54..96fa1df218 100644 --- a/indra/newview/llvograss.cpp +++ b/indra/newview/llvograss.cpp @@ -594,7 +594,7 @@ U32 LLVOGrass::getPartitionType() const } LLGrassPartition::LLGrassPartition(LLViewerRegion* regionp) -: LLSpatialPartition(LLDrawPoolAlpha::VERTEX_DATA_MASK | LLVertexBuffer::MAP_TEXTURE_INDEX, TRUE, GL_STREAM_DRAW_ARB, regionp) +: LLSpatialPartition(LLDrawPoolAlpha::VERTEX_DATA_MASK | LLVertexBuffer::MAP_TEXTURE_INDEX, TRUE, GL_STREAM_DRAW, regionp) { mDrawableType = LLPipeline::RENDER_TYPE_GRASS; mPartitionType = LLViewerRegion::PARTITION_GRASS; @@ -602,7 +602,7 @@ LLGrassPartition::LLGrassPartition(LLViewerRegion* regionp) mDepthMask = TRUE; mSlopRatio = 0.1f; mRenderPass = LLRenderPass::PASS_GRASS; - mBufferUsage = GL_DYNAMIC_DRAW_ARB; + mBufferUsage = GL_DYNAMIC_DRAW; } void LLGrassPartition::addGeometryCount(LLSpatialGroup* group, U32& vertex_count, U32& index_count) @@ -626,7 +626,7 @@ void LLGrassPartition::addGeometryCount(LLSpatialGroup* group, U32& vertex_count if (drawablep->isAnimating()) { - group->mBufferUsage = GL_STREAM_DRAW_ARB; + group->mBufferUsage = GL_STREAM_DRAW; } U32 count = 0; diff --git a/indra/newview/llvoground.cpp b/indra/newview/llvoground.cpp index 52a6395618..28bd5a3c97 100644 --- a/indra/newview/llvoground.cpp +++ b/indra/newview/llvoground.cpp @@ -93,7 +93,7 @@ BOOL LLVOGround::updateGeometry(LLDrawable *drawable) if (!face->getVertexBuffer()) { face->setSize(5, 12); - LLVertexBuffer* buff = new LLVertexBuffer(LLDrawPoolGround::VERTEX_DATA_MASK, GL_STREAM_DRAW_ARB); + LLVertexBuffer* buff = new LLVertexBuffer(LLDrawPoolGround::VERTEX_DATA_MASK, GL_STREAM_DRAW); if (!buff->allocateBuffer(face->getGeomCount(), face->getIndicesCount(), TRUE)) { LL_WARNS() << "Failed to allocate Vertex Buffer for VOGround to " diff --git a/indra/newview/llvopartgroup.cpp b/indra/newview/llvopartgroup.cpp index 51cf5f20c6..e39154d395 100644 --- a/indra/newview/llvopartgroup.cpp +++ b/indra/newview/llvopartgroup.cpp @@ -65,7 +65,7 @@ void LLVOPartGroup::restoreGL() { //TODO: optimize out binormal mask here. Specular and normal coords as well. - sVB = new LLVertexBuffer(VERTEX_DATA_MASK | LLVertexBuffer::MAP_TANGENT | LLVertexBuffer::MAP_TEXCOORD1 | LLVertexBuffer::MAP_TEXCOORD2, GL_STREAM_DRAW_ARB); + sVB = new LLVertexBuffer(VERTEX_DATA_MASK | LLVertexBuffer::MAP_TANGENT | LLVertexBuffer::MAP_TEXCOORD1 | LLVertexBuffer::MAP_TEXCOORD2, GL_STREAM_DRAW); U32 count = LL_MAX_PARTICLE_COUNT; if (!sVB->allocateBuffer(count*4, count*6, true)) { @@ -737,7 +737,7 @@ U32 LLVOPartGroup::getPartitionType() const } LLParticlePartition::LLParticlePartition(LLViewerRegion* regionp) -: LLSpatialPartition(LLDrawPoolAlpha::VERTEX_DATA_MASK | LLVertexBuffer::MAP_TEXTURE_INDEX, TRUE, GL_STREAM_DRAW_ARB, regionp) +: LLSpatialPartition(LLDrawPoolAlpha::VERTEX_DATA_MASK | LLVertexBuffer::MAP_TEXTURE_INDEX, TRUE, GL_STREAM_DRAW, regionp) { mRenderPass = LLRenderPass::PASS_ALPHA; mDrawableType = LLPipeline::RENDER_TYPE_PARTICLES; diff --git a/indra/newview/llvosky.cpp b/indra/newview/llvosky.cpp index 909588367b..efe18a78e1 100644 --- a/indra/newview/llvosky.cpp +++ b/indra/newview/llvosky.cpp @@ -1010,7 +1010,7 @@ BOOL LLVOSky::updateGeometry(LLDrawable *drawable) face->setSize(4, 6); face->setGeomIndex(0); face->setIndicesIndex(0); - LLVertexBuffer* buff = new LLVertexBuffer(LLDrawPoolSky::VERTEX_DATA_MASK, GL_STREAM_DRAW_ARB); + LLVertexBuffer* buff = new LLVertexBuffer(LLDrawPoolSky::VERTEX_DATA_MASK, GL_STREAM_DRAW); buff->allocateBuffer(4, 6, TRUE); face->setVertexBuffer(buff); @@ -1139,7 +1139,7 @@ bool LLVOSky::updateHeavenlyBodyGeometry(LLDrawable *drawable, F32 scale, const if (!facep->getVertexBuffer()) { facep->setSize(4, 6); - LLVertexBuffer* buff = new LLVertexBuffer(LLDrawPoolSky::VERTEX_DATA_MASK, GL_STREAM_DRAW_ARB); + LLVertexBuffer* buff = new LLVertexBuffer(LLDrawPoolSky::VERTEX_DATA_MASK, GL_STREAM_DRAW); if (!buff->allocateBuffer(facep->getGeomCount(), facep->getIndicesCount(), TRUE)) { LL_WARNS() << "Failed to allocate Vertex Buffer for vosky to " @@ -1379,7 +1379,7 @@ void LLVOSky::updateReflectionGeometry(LLDrawable *drawable, F32 H, if (!face->getVertexBuffer() || quads*4 != face->getGeomCount()) { face->setSize(quads * 4, quads * 6); - LLVertexBuffer* buff = new LLVertexBuffer(LLDrawPoolWater::VERTEX_DATA_MASK, GL_STREAM_DRAW_ARB); + LLVertexBuffer* buff = new LLVertexBuffer(LLDrawPoolWater::VERTEX_DATA_MASK, GL_STREAM_DRAW); if (!buff->allocateBuffer(face->getGeomCount(), face->getIndicesCount(), TRUE)) { LL_WARNS() << "Failed to allocate Vertex Buffer for vosky to " diff --git a/indra/newview/llvosurfacepatch.cpp b/indra/newview/llvosurfacepatch.cpp index 5cb7e7478b..57f728a65e 100644 --- a/indra/newview/llvosurfacepatch.cpp +++ b/indra/newview/llvosurfacepatch.cpp @@ -51,7 +51,7 @@ class LLVertexBufferTerrain : public LLVertexBuffer { public: LLVertexBufferTerrain() : - LLVertexBuffer(MAP_VERTEX | MAP_NORMAL | MAP_TEXCOORD0 | MAP_TEXCOORD1 | MAP_COLOR, GL_DYNAMIC_DRAW_ARB) + LLVertexBuffer(MAP_VERTEX | MAP_NORMAL | MAP_TEXCOORD0 | MAP_TEXCOORD1 | MAP_COLOR, GL_DYNAMIC_DRAW) { //texture coordinates 2 and 3 exist, but use the same data as texture coordinate 1 }; @@ -994,7 +994,7 @@ U32 LLVOSurfacePatch::getPartitionType() const } LLTerrainPartition::LLTerrainPartition(LLViewerRegion* regionp) -: LLSpatialPartition(LLDrawPoolTerrain::VERTEX_DATA_MASK, FALSE, GL_DYNAMIC_DRAW_ARB, regionp) +: LLSpatialPartition(LLDrawPoolTerrain::VERTEX_DATA_MASK, FALSE, GL_DYNAMIC_DRAW, regionp) { mOcclusionEnabled = FALSE; mInfiniteFarClip = TRUE; diff --git a/indra/newview/llvotree.cpp b/indra/newview/llvotree.cpp index 493162b47b..3da535dd09 100644 --- a/indra/newview/llvotree.cpp +++ b/indra/newview/llvotree.cpp @@ -921,7 +921,7 @@ void LLVOTree::updateMesh() LLFace* facep = mDrawable->getFace(0); if (!facep) return; - LLVertexBuffer* buff = new LLVertexBuffer(LLDrawPoolTree::VERTEX_DATA_MASK, GL_STATIC_DRAW_ARB); + LLVertexBuffer* buff = new LLVertexBuffer(LLDrawPoolTree::VERTEX_DATA_MASK, GL_STATIC_DRAW); if (!buff->allocateBuffer(vert_count, index_count, TRUE)) { LL_WARNS() << "Failed to allocate Vertex Buffer on mesh update to " @@ -1226,7 +1226,7 @@ U32 LLVOTree::getPartitionType() const } LLTreePartition::LLTreePartition(LLViewerRegion* regionp) -: LLSpatialPartition(0, FALSE, GL_DYNAMIC_DRAW_ARB, regionp) +: LLSpatialPartition(0, FALSE, GL_DYNAMIC_DRAW, regionp) { mDrawableType = LLPipeline::RENDER_TYPE_TREE; mPartitionType = LLViewerRegion::PARTITION_TREE; diff --git a/indra/newview/llvovolume.cpp b/indra/newview/llvovolume.cpp index 4ddba872f1..86c6567c83 100644 --- a/indra/newview/llvovolume.cpp +++ b/indra/newview/llvovolume.cpp @@ -5071,7 +5071,7 @@ U32 LLVOVolume::getPartitionType() const } LLVolumePartition::LLVolumePartition(LLViewerRegion* regionp) -: LLSpatialPartition(LLVOVolume::VERTEX_DATA_MASK, TRUE, GL_DYNAMIC_DRAW_ARB, regionp), +: LLSpatialPartition(LLVOVolume::VERTEX_DATA_MASK, TRUE, GL_DYNAMIC_DRAW, regionp), LLVolumeGeometryManager() { mLODPeriod = 32; @@ -5079,7 +5079,7 @@ LLVolumeGeometryManager() mDrawableType = LLPipeline::RENDER_TYPE_VOLUME; mPartitionType = LLViewerRegion::PARTITION_VOLUME; mSlopRatio = 0.25f; - mBufferUsage = GL_DYNAMIC_DRAW_ARB; + mBufferUsage = GL_DYNAMIC_DRAW; } LLVolumeBridge::LLVolumeBridge(LLDrawable* drawablep, LLViewerRegion* regionp) @@ -5091,7 +5091,7 @@ LLVolumeGeometryManager() mDrawableType = LLPipeline::RENDER_TYPE_VOLUME; mPartitionType = LLViewerRegion::PARTITION_BRIDGE; - mBufferUsage = GL_DYNAMIC_DRAW_ARB; + mBufferUsage = GL_DYNAMIC_DRAW; mSlopRatio = 0.25f; } @@ -5674,7 +5674,7 @@ void LLVolumeGeometryManager::rebuildGeom(LLSpatialGroup* group) if (drawablep->isAnimating()) { //fall back to stream draw for animating verts - useage = GL_STREAM_DRAW_ARB; + useage = GL_STREAM_DRAW; } LLVOVolume* vobj = drawablep->getVOVolume(); @@ -6276,10 +6276,10 @@ U32 LLVolumeGeometryManager::genDrawInfo(LLSpatialGroup* group, U32 mask, LLFace if (use_transform_feedback && gTransformPositionProgram.mProgramObject && //transform shaders are loaded - buffer_usage == GL_DYNAMIC_DRAW_ARB && //target buffer is in VRAM + buffer_usage == GL_DYNAMIC_DRAW && //target buffer is in VRAM !(mask & LLVertexBuffer::MAP_WEIGHT4)) //TODO: add support for weights { - buffer_usage = GL_DYNAMIC_COPY_ARB; + buffer_usage = GL_DYNAMIC_COPY; } #if LL_DARWIN @@ -6502,9 +6502,9 @@ U32 LLVolumeGeometryManager::genDrawInfo(LLSpatialGroup* group, U32 mask, LLFace } - if (flexi && buffer_usage && buffer_usage != GL_STREAM_DRAW_ARB) + if (flexi && buffer_usage && buffer_usage != GL_STREAM_DRAW) { - buffer_usage = GL_STREAM_DRAW_ARB; + buffer_usage = GL_STREAM_DRAW; } //create vertex buffer @@ -6914,7 +6914,7 @@ void LLVolumeGeometryManager::addGeometryCount(LLSpatialGroup* group, U32& verte if (drawablep->isAnimating()) { //fall back to stream draw for animating verts - usage = GL_STREAM_DRAW_ARB; + usage = GL_STREAM_DRAW; } } @@ -6943,7 +6943,7 @@ void LLGeometryManager::addGeometryCount(LLSpatialGroup* group, U32 &vertex_coun if (drawablep->isAnimating()) { //fall back to stream draw for animating verts - usage = GL_STREAM_DRAW_ARB; + usage = GL_STREAM_DRAW; } //for each face diff --git a/indra/newview/llvowater.cpp b/indra/newview/llvowater.cpp index 089a7712c0..6f30092326 100644 --- a/indra/newview/llvowater.cpp +++ b/indra/newview/llvowater.cpp @@ -152,7 +152,7 @@ BOOL LLVOWater::updateGeometry(LLDrawable *drawable) LLVertexBuffer* buff = face->getVertexBuffer(); if (!buff || !buff->isWriteable()) { - buff = new LLVertexBuffer(LLDrawPoolWater::VERTEX_DATA_MASK, GL_DYNAMIC_DRAW_ARB); + buff = new LLVertexBuffer(LLDrawPoolWater::VERTEX_DATA_MASK, GL_DYNAMIC_DRAW); if (!buff->allocateBuffer(face->getGeomCount(), face->getIndicesCount(), TRUE)) { LL_WARNS() << "Failed to allocate Vertex Buffer on water update to " @@ -295,7 +295,7 @@ U32 LLVOVoidWater::getPartitionType() const } LLWaterPartition::LLWaterPartition(LLViewerRegion* regionp) -: LLSpatialPartition(0, FALSE, GL_DYNAMIC_DRAW_ARB, regionp) +: LLSpatialPartition(0, FALSE, GL_DYNAMIC_DRAW, regionp) { mInfiniteFarClip = TRUE; mDrawableType = LLPipeline::RENDER_TYPE_WATER; diff --git a/indra/newview/llvowlsky.cpp b/indra/newview/llvowlsky.cpp index d1f584cbca..c7df343ad0 100644 --- a/indra/newview/llvowlsky.cpp +++ b/indra/newview/llvowlsky.cpp @@ -151,7 +151,7 @@ BOOL LLVOWLSky::updateGeometry(LLDrawable * drawable) if (mFsSkyVerts.isNull()) { - mFsSkyVerts = new LLVertexBuffer(LLDrawPoolWLSky::ADV_ATMO_SKY_VERTEX_DATA_MASK, GL_STATIC_DRAW_ARB); + mFsSkyVerts = new LLVertexBuffer(LLDrawPoolWLSky::ADV_ATMO_SKY_VERTEX_DATA_MASK, GL_STATIC_DRAW); if (!mFsSkyVerts->allocateBuffer(4, 6, TRUE)) { @@ -216,7 +216,7 @@ BOOL LLVOWLSky::updateGeometry(LLDrawable * drawable) for (U32 i = 0; i < strips_segments ;++i) { - LLVertexBuffer * segment = new LLVertexBuffer(LLDrawPoolWLSky::SKY_VERTEX_DATA_MASK, GL_STATIC_DRAW_ARB); + LLVertexBuffer * segment = new LLVertexBuffer(LLDrawPoolWLSky::SKY_VERTEX_DATA_MASK, GL_STATIC_DRAW); mStripsVerts[i] = segment; U32 num_stacks_this_seg = stacks_per_seg; diff --git a/indra/newview/pipeline.cpp b/indra/newview/pipeline.cpp index 23b863aa19..fa5a9c97eb 100644 --- a/indra/newview/pipeline.cpp +++ b/indra/newview/pipeline.cpp @@ -523,7 +523,7 @@ void LLPipeline::init() if (mCubeVB.isNull()) { - mCubeVB = ll_create_cube_vb(LLVertexBuffer::MAP_VERTEX, GL_STATIC_DRAW_ARB); + mCubeVB = ll_create_cube_vb(LLVertexBuffer::MAP_VERTEX, GL_STATIC_DRAW); } mDeferredVB = new LLVertexBuffer(DEFERRED_VB_MASK, 0); @@ -903,7 +903,7 @@ bool LLPipeline::allocateScreenBuffer(U32 resX, U32 resY, U32 samples) if (gGLManager.mGLVersion < 4.f && gGLManager.mIsNVIDIA) { - screenFormat = GL_RGBA16F_ARB; + screenFormat = GL_RGBA16F; } if (!mScreen.allocate(resX, resY, screenFormat, FALSE, FALSE, LLTexUnit::TT_RECT_TEXTURE, FALSE, samples)) return false; @@ -1282,7 +1282,7 @@ void LLPipeline::createGLBuffers() LLImageGL::generateTextures(1, &mNoiseMap); gGL.getTexUnit(0)->bindManual(LLTexUnit::TT_TEXTURE, mNoiseMap); - LLImageGL::setManualImage(LLTexUnit::getInternalType(LLTexUnit::TT_TEXTURE), 0, GL_RGB16F_ARB, noiseRes, noiseRes, GL_RGB, GL_FLOAT, noise, false); + LLImageGL::setManualImage(LLTexUnit::getInternalType(LLTexUnit::TT_TEXTURE), 0, GL_RGB16F, noiseRes, noiseRes, GL_RGB, GL_FLOAT, noise, false); gGL.getTexUnit(0)->setTextureFilteringOption(LLTexUnit::TFO_POINT); } @@ -1297,7 +1297,7 @@ void LLPipeline::createGLBuffers() LLImageGL::generateTextures(1, &mTrueNoiseMap); gGL.getTexUnit(0)->bindManual(LLTexUnit::TT_TEXTURE, mTrueNoiseMap); - LLImageGL::setManualImage(LLTexUnit::getInternalType(LLTexUnit::TT_TEXTURE), 0, GL_RGB16F_ARB, noiseRes, noiseRes, GL_RGB,GL_FLOAT, noise, false); + LLImageGL::setManualImage(LLTexUnit::getInternalType(LLTexUnit::TT_TEXTURE), 0, GL_RGB16F, noiseRes, noiseRes, GL_RGB,GL_FLOAT, noise, false); gGL.getTexUnit(0)->setTextureFilteringOption(LLTexUnit::TFO_POINT); } @@ -2399,7 +2399,7 @@ void LLPipeline::updateCull(LLCamera& camera, LLCullResult& result, LLPlane* pla { if (mCubeVB.isNull()) { //cube VB will be used for issuing occlusion queries - mCubeVB = ll_create_cube_vb(LLVertexBuffer::MAP_VERTEX, GL_STATIC_DRAW_ARB); + mCubeVB = ll_create_cube_vb(LLVertexBuffer::MAP_VERTEX, GL_STATIC_DRAW); } mCubeVB->setBuffer(LLVertexBuffer::MAP_VERTEX); } @@ -2655,7 +2655,7 @@ void LLPipeline::doOcclusion(LLCamera& camera) if (mCubeVB.isNull()) { //cube VB will be used for issuing occlusion queries - mCubeVB = ll_create_cube_vb(LLVertexBuffer::MAP_VERTEX, GL_STATIC_DRAW_ARB); + mCubeVB = ll_create_cube_vb(LLVertexBuffer::MAP_VERTEX, GL_STATIC_DRAW); } mCubeVB->setBuffer(LLVertexBuffer::MAP_VERTEX); @@ -8167,8 +8167,8 @@ void LLPipeline::bindDeferredShader(LLGLSLShader& shader, LLRenderTarget* light_ gGL.getTexUnit(channel)->setTextureAddressMode(LLTexUnit::TAM_CLAMP); stop_glerror(); - glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_COMPARE_MODE_ARB, GL_COMPARE_R_TO_TEXTURE_ARB); - glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_COMPARE_FUNC_ARB, GL_LEQUAL); + glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_COMPARE_MODE, GL_COMPARE_REF_TO_TEXTURE); + glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_COMPARE_FUNC, GL_LEQUAL); stop_glerror(); } } @@ -8189,8 +8189,8 @@ void LLPipeline::bindDeferredShader(LLGLSLShader& shader, LLRenderTarget* light_ gGL.getTexUnit(channel)->setTextureAddressMode(LLTexUnit::TAM_CLAMP); stop_glerror(); - glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_COMPARE_MODE_ARB, GL_COMPARE_R_TO_TEXTURE_ARB); - glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_COMPARE_FUNC_ARB, GL_LEQUAL); + glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_COMPARE_MODE, GL_COMPARE_REF_TO_TEXTURE); + glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_COMPARE_FUNC, GL_LEQUAL); stop_glerror(); } } @@ -8602,7 +8602,7 @@ void LLPipeline::renderDeferredLighting(LLRenderTarget *screen_target) if (mCubeVB.isNull()) { - mCubeVB = ll_create_cube_vb(LLVertexBuffer::MAP_VERTEX, GL_STATIC_DRAW_ARB); + mCubeVB = ll_create_cube_vb(LLVertexBuffer::MAP_VERTEX, GL_STATIC_DRAW); } mCubeVB->setBuffer(LLVertexBuffer::MAP_VERTEX); @@ -9104,7 +9104,7 @@ void LLPipeline::unbindDeferredShader(LLGLSLShader &shader) { if (shader.disableTexture(LLShaderMgr::DEFERRED_SHADOW0+i) > -1) { - glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_COMPARE_MODE_ARB, GL_NONE); + glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_COMPARE_MODE, GL_NONE); } } @@ -9112,7 +9112,7 @@ void LLPipeline::unbindDeferredShader(LLGLSLShader &shader) { if (shader.disableTexture(LLShaderMgr::DEFERRED_SHADOW0+i) > -1) { - glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_COMPARE_MODE_ARB, GL_NONE); + glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_COMPARE_MODE, GL_NONE); } } -- cgit v1.2.3 From 040fe22d93fe67a73fc33493057f06f07371dbdd Mon Sep 17 00:00:00 2001 From: Erik Kundiman Date: Sun, 10 Sep 2023 10:17:43 +0800 Subject: Preprocess non portable OpenGL code --- indra/newview/lldrawpool.cpp | 2 ++ indra/newview/lldrawpoolbump.cpp | 2 ++ indra/newview/lldrawpoolsimple.cpp | 6 ++++ indra/newview/lldrawpoolsky.cpp | 2 ++ indra/newview/lldrawpoolterrain.cpp | 26 +++++++++++++++++ indra/newview/lldrawpooltree.cpp | 2 ++ indra/newview/lldrawpoolwater.cpp | 16 ++++++++++ indra/newview/llface.cpp | 14 +++++++++ indra/newview/llfloaterimagepreview.cpp | 2 ++ indra/newview/llhudnametag.cpp | 2 ++ indra/newview/llhudtext.cpp | 4 +++ indra/newview/llmaniprotate.cpp | 4 +++ indra/newview/llmanipscale.cpp | 2 ++ indra/newview/llmaniptranslate.cpp | 6 ++++ indra/newview/llmodelpreview.cpp | 20 +++++++++++++ indra/newview/llselectmgr.cpp | 8 +++++ indra/newview/llspatialpartition.cpp | 50 +++++++++++++++++++++++++++++++ indra/newview/llviewerdisplay.cpp | 4 +++ indra/newview/llviewerjointmesh.cpp | 2 ++ indra/newview/llvoavatar.cpp | 8 +++++ indra/newview/pipeline.cpp | 52 +++++++++++++++++++++++++++++++++ 21 files changed, 234 insertions(+) (limited to 'indra') diff --git a/indra/newview/lldrawpool.cpp b/indra/newview/lldrawpool.cpp index 3fd15d36df..f010a98404 100644 --- a/indra/newview/lldrawpool.cpp +++ b/indra/newview/lldrawpool.cpp @@ -365,7 +365,9 @@ void LLFacePool::LLOverrideFaceColor::setColor(const LLColor4& color) void LLFacePool::LLOverrideFaceColor::setColor(const LLColor4U& color) { +#if GL_VERSION_1_1 glColor4ubv(color.mV); +#endif } void LLFacePool::LLOverrideFaceColor::setColor(F32 r, F32 g, F32 b, F32 a) diff --git a/indra/newview/lldrawpoolbump.cpp b/indra/newview/lldrawpoolbump.cpp index cc454417c6..dafc4a0a0a 100644 --- a/indra/newview/lldrawpoolbump.cpp +++ b/indra/newview/lldrawpoolbump.cpp @@ -666,7 +666,9 @@ void LLDrawPoolBump::beginBump() void LLDrawPoolBump::renderBump(U32 pass) { LL_PROFILE_ZONE_SCOPED_CATEGORY_DRAWPOOL; //LL_RECORD_BLOCK_TIME(FTM_RENDER_BUMP); +#if GL_VERSION_1_1 LLGLDisable fog(GL_FOG); +#endif LLGLDepthTest gls_depth(GL_TRUE, GL_FALSE, GL_LEQUAL); LLGLEnable blend(GL_BLEND); gGL.diffuseColor4f(1,1,1,1); diff --git a/indra/newview/lldrawpoolsimple.cpp b/indra/newview/lldrawpoolsimple.cpp index e324a663f4..12d8ec081b 100644 --- a/indra/newview/lldrawpoolsimple.cpp +++ b/indra/newview/lldrawpoolsimple.cpp @@ -87,7 +87,9 @@ void LLDrawPoolGlow::render(LLGLSLShader* shader) { LL_PROFILE_ZONE_SCOPED_CATEGORY_DRAWPOOL; //LL_RECORD_BLOCK_TIME(FTM_RENDER_GLOW); LLGLEnable blend(GL_BLEND); +#if GL_VERSION_1_1 LLGLDisable test(GL_ALPHA_TEST); +#endif gGL.flush(); /// Get rid of z-fighting with non-glow pass. LLGLEnable polyOffset(GL_POLYGON_OFFSET_FILL); @@ -289,7 +291,9 @@ void LLDrawPoolSimple::renderDeferred(S32 pass) { LL_PROFILE_ZONE_SCOPED_CATEGORY_DRAWPOOL; //LL_RECORD_BLOCK_TIME(FTM_RENDER_SIMPLE_DEFERRED); LLGLDisable blend(GL_BLEND); +#if GL_VERSION_1_1 LLGLDisable alpha_test(GL_ALPHA_TEST); +#endif //render static setup_simple_shader(&gDeferredDiffuseProgram); @@ -386,7 +390,9 @@ void LLDrawPoolGrass::render(S32 pass) { //LL_RECORD_BLOCK_TIME(FTM_RENDER_GRASS); +#if GL_VERSION_1_1 LLGLEnable test(GL_ALPHA_TEST); +#endif gGL.setSceneBlendType(LLRender::BT_ALPHA); //render grass LLRenderPass::pushBatches(LLRenderPass::PASS_GRASS, getVertexDataMask()); diff --git a/indra/newview/lldrawpoolsky.cpp b/indra/newview/lldrawpoolsky.cpp index 3a1efec91b..ffcd7835ee 100644 --- a/indra/newview/lldrawpoolsky.cpp +++ b/indra/newview/lldrawpoolsky.cpp @@ -81,7 +81,9 @@ void LLDrawPoolSky::render(S32 pass) LLGLSPipelineDepthTestSkyBox gls_skybox(true, false); +#if GL_VERSION_1_1 LLGLEnable fog_enable( (mShaderLevel < 1 && LLViewerCamera::getInstance()->cameraUnderWater()) ? GL_FOG : 0); +#endif gGL.pushMatrix(); LLVector3 origin = LLViewerCamera::getInstance()->getOrigin(); diff --git a/indra/newview/lldrawpoolterrain.cpp b/indra/newview/lldrawpoolterrain.cpp index cc5cb667f0..c59adc2cf3 100644 --- a/indra/newview/lldrawpoolterrain.cpp +++ b/indra/newview/lldrawpoolterrain.cpp @@ -459,6 +459,7 @@ void LLDrawPoolTerrain::renderFull4TU() gGL.getTexUnit(0)->activate(); gGL.getTexUnit(0)->bind(detail_texture0p); +#if GL_VERSION_1_1 glEnable(GL_TEXTURE_GEN_S); glEnable(GL_TEXTURE_GEN_T); glTexGeni(GL_S, GL_TEXTURE_GEN_MODE, GL_OBJECT_LINEAR); @@ -466,6 +467,7 @@ void LLDrawPoolTerrain::renderFull4TU() glTexGenfv(GL_S, GL_OBJECT_PLANE, tp0.mV); glTexGenfv(GL_T, GL_OBJECT_PLANE, tp1.mV); +#endif // // Stage 1: Generate alpha ramp for detail0/detail1 transition @@ -482,12 +484,14 @@ void LLDrawPoolTerrain::renderFull4TU() gGL.getTexUnit(2)->enable(LLTexUnit::TT_TEXTURE); gGL.getTexUnit(2)->activate(); +#if GL_VERSION_1_1 glEnable(GL_TEXTURE_GEN_S); glEnable(GL_TEXTURE_GEN_T); glTexGeni(GL_S, GL_TEXTURE_GEN_MODE, GL_OBJECT_LINEAR); glTexGeni(GL_T, GL_TEXTURE_GEN_MODE, GL_OBJECT_LINEAR); glTexGenfv(GL_S, GL_OBJECT_PLANE, tp0.mV); glTexGenfv(GL_T, GL_OBJECT_PLANE, tp1.mV); +#endif // // Stage 3: Modulate with primary (vertex) color for lighting @@ -509,12 +513,14 @@ void LLDrawPoolTerrain::renderFull4TU() gGL.getTexUnit(0)->activate(); gGL.getTexUnit(0)->bind(detail_texture3p); +#if GL_VERSION_1_1 glEnable(GL_TEXTURE_GEN_S); glEnable(GL_TEXTURE_GEN_T); glTexGeni(GL_S, GL_TEXTURE_GEN_MODE, GL_OBJECT_LINEAR); glTexGeni(GL_T, GL_TEXTURE_GEN_MODE, GL_OBJECT_LINEAR); glTexGenfv(GL_S, GL_OBJECT_PLANE, tp0.mV); glTexGenfv(GL_T, GL_OBJECT_PLANE, tp1.mV); +#endif // // Stage 1: Generate alpha ramp for detail2/detail3 transition @@ -535,12 +541,14 @@ void LLDrawPoolTerrain::renderFull4TU() gGL.getTexUnit(2)->enable(LLTexUnit::TT_TEXTURE); gGL.getTexUnit(2)->activate(); +#if GL_VERSION_1_1 glEnable(GL_TEXTURE_GEN_S); glEnable(GL_TEXTURE_GEN_T); glTexGeni(GL_S, GL_TEXTURE_GEN_MODE, GL_OBJECT_LINEAR); glTexGeni(GL_T, GL_TEXTURE_GEN_MODE, GL_OBJECT_LINEAR); glTexGenfv(GL_S, GL_OBJECT_PLANE, tp0.mV); glTexGenfv(GL_T, GL_OBJECT_PLANE, tp1.mV); +#endif // // Stage 3: Generate alpha ramp for detail1/detail2 transition @@ -575,8 +583,10 @@ void LLDrawPoolTerrain::renderFull4TU() gGL.getTexUnit(2)->disable(); gGL.getTexUnit(2)->activate(); +#if GL_VERSION_1_1 glDisable(GL_TEXTURE_GEN_S); glDisable(GL_TEXTURE_GEN_T); +#endif gGL.matrixMode(LLRender::MM_TEXTURE); gGL.loadIdentity(); gGL.matrixMode(LLRender::MM_MODELVIEW); @@ -599,8 +609,10 @@ void LLDrawPoolTerrain::renderFull4TU() gGL.getTexUnit(0)->unbind(LLTexUnit::TT_TEXTURE); +#if GL_VERSION_1_1 glDisable(GL_TEXTURE_GEN_S); glDisable(GL_TEXTURE_GEN_T); +#endif gGL.matrixMode(LLRender::MM_TEXTURE); gGL.loadIdentity(); gGL.matrixMode(LLRender::MM_MODELVIEW); @@ -634,6 +646,7 @@ void LLDrawPoolTerrain::renderFull2TU() // Stage 0: Render detail 0 into base // gGL.getTexUnit(0)->bind(detail_texture0p); +#if GL_VERSION_1_1 glEnable(GL_TEXTURE_GEN_S); glEnable(GL_TEXTURE_GEN_T); glTexGeni(GL_S, GL_TEXTURE_GEN_MODE, GL_OBJECT_LINEAR); @@ -641,6 +654,7 @@ void LLDrawPoolTerrain::renderFull2TU() glTexGenfv(GL_S, GL_OBJECT_PLANE, tp0.mV); glTexGenfv(GL_T, GL_OBJECT_PLANE, tp1.mV); +#endif drawLoop(); @@ -652,8 +666,10 @@ void LLDrawPoolTerrain::renderFull2TU() // gGL.getTexUnit(0)->bind(m2DAlphaRampImagep); +#if GL_VERSION_1_1 glDisable(GL_TEXTURE_GEN_S); glDisable(GL_TEXTURE_GEN_T); +#endif // // Stage 1: Write detail1 @@ -662,12 +678,14 @@ void LLDrawPoolTerrain::renderFull2TU() gGL.getTexUnit(1)->enable(LLTexUnit::TT_TEXTURE); gGL.getTexUnit(1)->activate(); +#if GL_VERSION_1_1 glEnable(GL_TEXTURE_GEN_S); glEnable(GL_TEXTURE_GEN_T); glTexGeni(GL_S, GL_TEXTURE_GEN_MODE, GL_OBJECT_LINEAR); glTexGeni(GL_T, GL_TEXTURE_GEN_MODE, GL_OBJECT_LINEAR); glTexGenfv(GL_S, GL_OBJECT_PLANE, tp0.mV); glTexGenfv(GL_T, GL_OBJECT_PLANE, tp1.mV); +#endif gGL.getTexUnit(0)->activate(); { @@ -695,12 +713,14 @@ void LLDrawPoolTerrain::renderFull2TU() gGL.getTexUnit(1)->enable(LLTexUnit::TT_TEXTURE); gGL.getTexUnit(1)->activate(); +#if GL_VERSION_1_1 glEnable(GL_TEXTURE_GEN_S); glEnable(GL_TEXTURE_GEN_T); glTexGeni(GL_S, GL_TEXTURE_GEN_MODE, GL_OBJECT_LINEAR); glTexGeni(GL_T, GL_TEXTURE_GEN_MODE, GL_OBJECT_LINEAR); glTexGenfv(GL_S, GL_OBJECT_PLANE, tp0.mV); glTexGenfv(GL_T, GL_OBJECT_PLANE, tp1.mV); +#endif { LLGLEnable blend(GL_BLEND); @@ -726,12 +746,14 @@ void LLDrawPoolTerrain::renderFull2TU() gGL.getTexUnit(1)->enable(LLTexUnit::TT_TEXTURE); gGL.getTexUnit(1)->activate(); +#if GL_VERSION_1_1 glEnable(GL_TEXTURE_GEN_S); glEnable(GL_TEXTURE_GEN_T); glTexGeni(GL_S, GL_TEXTURE_GEN_MODE, GL_OBJECT_LINEAR); glTexGeni(GL_T, GL_TEXTURE_GEN_MODE, GL_OBJECT_LINEAR); glTexGenfv(GL_S, GL_OBJECT_PLANE, tp0.mV); glTexGenfv(GL_T, GL_OBJECT_PLANE, tp1.mV); +#endif gGL.getTexUnit(0)->activate(); { @@ -748,8 +770,10 @@ void LLDrawPoolTerrain::renderFull2TU() gGL.getTexUnit(1)->disable(); gGL.getTexUnit(1)->activate(); +#if GL_VERSION_1_1 glDisable(GL_TEXTURE_GEN_S); glDisable(GL_TEXTURE_GEN_T); +#endif gGL.matrixMode(LLRender::MM_TEXTURE); gGL.loadIdentity(); gGL.matrixMode(LLRender::MM_MODELVIEW); @@ -760,8 +784,10 @@ void LLDrawPoolTerrain::renderFull2TU() gGL.getTexUnit(0)->activate(); gGL.getTexUnit(0)->unbind(LLTexUnit::TT_TEXTURE); +#if GL_VERSION_1_1 glDisable(GL_TEXTURE_GEN_S); glDisable(GL_TEXTURE_GEN_T); +#endif gGL.matrixMode(LLRender::MM_TEXTURE); gGL.loadIdentity(); gGL.matrixMode(LLRender::MM_MODELVIEW); diff --git a/indra/newview/lldrawpooltree.cpp b/indra/newview/lldrawpooltree.cpp index facfb235c9..bc6f587a3c 100644 --- a/indra/newview/lldrawpooltree.cpp +++ b/indra/newview/lldrawpooltree.cpp @@ -90,7 +90,9 @@ void LLDrawPoolTree::render(S32 pass) return; } +#if GL_VERSION_1_1 LLGLState test(GL_ALPHA_TEST, 0); +#endif gGL.getTexUnit(sDiffTex)->bindFast(mTexturep); gPipeline.touchTexture(mTexturep, 1024.f * 1024.f); // <=== keep Linden tree textures at full res diff --git a/indra/newview/lldrawpoolwater.cpp b/indra/newview/lldrawpoolwater.cpp index a84f62036e..45b5c9509b 100644 --- a/indra/newview/lldrawpoolwater.cpp +++ b/indra/newview/lldrawpoolwater.cpp @@ -227,17 +227,21 @@ void LLDrawPoolWater::render(S32 pass) gGL.diffuseColor4fv(water_color.mV); // Automatically generate texture coords for detail map +#if GL_VERSION_1_1 glEnable(GL_TEXTURE_GEN_S); //texture unit 1 glEnable(GL_TEXTURE_GEN_T); //texture unit 1 glTexGeni(GL_S, GL_TEXTURE_GEN_MODE, GL_OBJECT_LINEAR); glTexGeni(GL_T, GL_TEXTURE_GEN_MODE, GL_OBJECT_LINEAR); +#endif // Slowly move over time. F32 offset = fmod(gFrameTimeSeconds*2.f, 100.f); F32 tp0[4] = {16.f/256.f, 0.0f, 0.0f, offset*0.01f}; F32 tp1[4] = {0.0f, 16.f/256.f, 0.0f, offset*0.01f}; +#if GL_VERSION_1_1 glTexGenfv(GL_S, GL_OBJECT_PLANE, tp0); glTexGenfv(GL_T, GL_OBJECT_PLANE, tp1); +#endif gGL.getTexUnit(0)->activate(); @@ -264,15 +268,19 @@ void LLDrawPoolWater::render(S32 pass) gGL.getTexUnit(1)->unbind(LLTexUnit::TT_TEXTURE); gGL.getTexUnit(1)->disable(); +#if GL_VERSION_1_1 glDisable(GL_TEXTURE_GEN_S); //texture unit 1 glDisable(GL_TEXTURE_GEN_T); //texture unit 1 +#endif gGL.getTexUnit(2)->activate(); gGL.getTexUnit(2)->unbind(LLTexUnit::TT_TEXTURE); gGL.getTexUnit(2)->disable(); +#if GL_VERSION_1_1 glDisable(GL_TEXTURE_GEN_S); //texture unit 1 glDisable(GL_TEXTURE_GEN_T); //texture unit 1 +#endif // Disable texture coordinate and color arrays gGL.getTexUnit(0)->activate(); @@ -376,10 +384,12 @@ void LLDrawPoolWater::renderOpaqueLegacyWater() // Automatically generate texture coords for water texture if (!shader) { +#if GL_VERSION_1_1 glEnable(GL_TEXTURE_GEN_S); //texture unit 0 glEnable(GL_TEXTURE_GEN_T); //texture unit 0 glTexGenf(GL_S, GL_TEXTURE_GEN_MODE, GL_OBJECT_LINEAR); glTexGenf(GL_T, GL_TEXTURE_GEN_MODE, GL_OBJECT_LINEAR); +#endif } // Use the fact that we know all water faces are the same size @@ -405,8 +415,10 @@ void LLDrawPoolWater::renderOpaqueLegacyWater() if (!shader) { +#if GL_VERSION_1_1 glTexGenfv(GL_S, GL_OBJECT_PLANE, tp0); glTexGenfv(GL_T, GL_OBJECT_PLANE, tp1); +#endif } else { @@ -433,8 +445,10 @@ void LLDrawPoolWater::renderOpaqueLegacyWater() if (!shader) { // Reset the settings back to expected values +#if GL_VERSION_1_1 glDisable(GL_TEXTURE_GEN_S); //texture unit 0 glDisable(GL_TEXTURE_GEN_T); //texture unit 0 +#endif } gGL.getTexUnit(0)->unbind(LLTexUnit::TT_TEXTURE); @@ -462,7 +476,9 @@ void LLDrawPoolWater::renderReflection(LLFace* face) return; } +#if GL_VERSION_1_1 LLGLSNoFog noFog; +#endif gGL.getTexUnit(0)->bind((dr == 0) ? voskyp->getSunTex() : voskyp->getMoonTex()); diff --git a/indra/newview/llface.cpp b/indra/newview/llface.cpp index 6619f7d0bd..85abec6cc8 100644 --- a/indra/newview/llface.cpp +++ b/indra/newview/llface.cpp @@ -579,16 +579,22 @@ void LLFace::renderSelected(LLViewerTexture *imagep, const LLColor4& color) gGL.multMatrix((F32*) volume->getRelativeXform().mMatrix); const LLVolumeFace& vol_face = rigged->getVolumeFace(getTEOffset()); LLVertexBuffer::unbind(); +#if GL_VERSION_1_1 glVertexPointer(3, GL_FLOAT, 16, vol_face.mPositions); +#endif if (vol_face.mTexCoords) { +#if GL_VERSION_1_1 glEnableClientState(GL_TEXTURE_COORD_ARRAY); glTexCoordPointer(2, GL_FLOAT, 8, vol_face.mTexCoords); +#endif } gGL.syncMatrices(); LL_PROFILER_GPU_ZONEC( "gl.DrawElements", 0x00FF00 ); glDrawElements(GL_TRIANGLES, vol_face.mNumIndices, GL_UNSIGNED_SHORT, vol_face.mIndices); +#if GL_VERSION_1_1 glDisableClientState(GL_TEXTURE_COORD_ARRAY); +#endif } } } @@ -644,13 +650,17 @@ void LLFace::renderOneWireframe(const LLColor4 &color, F32 fogCfx, bool wirefram } else { +#if GL_VERSION_1_1 LLGLEnable fog(GL_FOG); glFogi(GL_FOG_MODE, GL_LINEAR); +#endif float d = (LLViewerCamera::getInstance()->getPointOfInterest() - LLViewerCamera::getInstance()->getOrigin()).magVec(); LLColor4 fogCol = color * fogCfx; +#if GL_VERSION_1_1 glFogf(GL_FOG_START, d); glFogf(GL_FOG_END, d*(1 + (LLViewerCamera::getInstance()->getView() / LLViewerCamera::getInstance()->getDefaultFOV()))); glFogfv(GL_FOG_COLOR, fogCol.mV); +#endif gGL.flush(); { @@ -675,10 +685,14 @@ void LLFace::renderOneWireframe(const LLColor4 &color, F32 fogCfx, bool wirefram glStencilOp(GL_KEEP, GL_KEEP, GL_KEEP); } +#if GL_VERSION_1_1 LLGLEnable offset(GL_POLYGON_OFFSET_LINE); +#endif glPolygonOffset(3.f, 3.f); glLineWidth(5.f); +#if GL_VERSION_1_1 glPolygonMode(GL_FRONT_AND_BACK, GL_LINE); +#endif renderFace(mDrawablep, this); } } diff --git a/indra/newview/llfloaterimagepreview.cpp b/indra/newview/llfloaterimagepreview.cpp index 89ba687d25..a31f709969 100644 --- a/indra/newview/llfloaterimagepreview.cpp +++ b/indra/newview/llfloaterimagepreview.cpp @@ -251,7 +251,9 @@ void LLFloaterImagePreview::draw() if (selected <= 0) { gl_rect_2d_checkerboard(mPreviewRect); +#if GL_VERSION_1_1 LLGLDisable gls_alpha(GL_ALPHA_TEST); +#endif if(mImagep.notNull()) { diff --git a/indra/newview/llhudnametag.cpp b/indra/newview/llhudnametag.cpp index ab6a64157c..d75d341c69 100644 --- a/indra/newview/llhudnametag.cpp +++ b/indra/newview/llhudnametag.cpp @@ -258,7 +258,9 @@ void LLHUDNameTag::renderText(BOOL for_select) } LLGLState gls_blend(GL_BLEND, for_select ? FALSE : TRUE); +#if GL_VERSION_1_1 LLGLState gls_alpha(GL_ALPHA_TEST, for_select ? FALSE : TRUE); +#endif LLColor4 shadow_color(0.f, 0.f, 0.f, 1.f); F32 alpha_factor = 1.f; diff --git a/indra/newview/llhudtext.cpp b/indra/newview/llhudtext.cpp index 5952edfc44..75cfb45555 100644 --- a/indra/newview/llhudtext.cpp +++ b/indra/newview/llhudtext.cpp @@ -117,7 +117,9 @@ void LLHUDText::renderText() gGL.getTexUnit(0)->enable(LLTexUnit::TT_TEXTURE); LLGLState gls_blend(GL_BLEND, TRUE); +#if GL_VERSION_1_1 LLGLState gls_alpha(GL_ALPHA_TEST, TRUE); +#endif LLColor4 shadow_color(0.f, 0.f, 0.f, 1.f); F32 alpha_factor = 1.f; @@ -572,7 +574,9 @@ void LLHUDText::renderAllHUD() LLGLState::checkTextureChannels(); { +#if GL_VERSION_1_1 LLGLEnable color_mat(GL_COLOR_MATERIAL); +#endif LLGLDepthTest depth(GL_FALSE, GL_FALSE); VisibleTextObjectIterator text_it; diff --git a/indra/newview/llmaniprotate.cpp b/indra/newview/llmaniprotate.cpp index d85a846f4d..2f332e86cf 100644 --- a/indra/newview/llmaniprotate.cpp +++ b/indra/newview/llmaniprotate.cpp @@ -118,7 +118,9 @@ void LLManipRotate::render() gGL.getTexUnit(0)->bind(LLViewerFetchedTexture::sWhiteImagep); LLGLDepthTest gls_depth(GL_TRUE); LLGLEnable gl_blend(GL_BLEND); +#if GL_VERSION_1_1 LLGLEnable gls_alpha_test(GL_ALPHA_TEST); +#endif // You can rotate if you can move LLViewerObject* first_object = mObjectSelection->getFirstMoveableObject(TRUE); @@ -275,7 +277,9 @@ void LLManipRotate::render() } LLGLEnable cull_face(GL_CULL_FACE); +#if GL_VERSION_1_1 LLGLEnable clip_plane0(GL_CLIP_PLANE0); +#endif LLGLDepthTest gls_depth(GL_FALSE); LLGLDisable gls_stencil(GL_STENCIL_TEST); diff --git a/indra/newview/llmanipscale.cpp b/indra/newview/llmanipscale.cpp index e74fd1241b..a28118ff23 100644 --- a/indra/newview/llmanipscale.cpp +++ b/indra/newview/llmanipscale.cpp @@ -212,7 +212,9 @@ void LLManipScale::render() gGL.getTexUnit(0)->unbind(LLTexUnit::TT_TEXTURE); LLGLDepthTest gls_depth(GL_TRUE); LLGLEnable gl_blend(GL_BLEND); +#if GL_VERSION_1_1 LLGLEnable gls_alpha_test(GL_ALPHA_TEST); +#endif LLBBox bbox = LLSelectMgr::getInstance()->getBBoxOfSelection(); if( canAffectSelection() ) diff --git a/indra/newview/llmaniptranslate.cpp b/indra/newview/llmaniptranslate.cpp index 0b2a1ef389..8d1476e418 100644 --- a/indra/newview/llmaniptranslate.cpp +++ b/indra/newview/llmaniptranslate.cpp @@ -1541,7 +1541,9 @@ void LLManipTranslate::renderSnapGuides() } { +#if GL_VERSION_1_1 LLGLDisable alpha_test(GL_ALPHA_TEST); +#endif //draw black overlay gGL.getTexUnit(0)->unbind(LLTexUnit::TT_TEXTURE); renderGrid(u,v,tiles,0.0f, 0.0f, 0.0f,a*0.16f); @@ -1562,7 +1564,9 @@ void LLManipTranslate::renderSnapGuides() { LLGLDepthTest gls_depth(GL_TRUE, GL_FALSE, GL_GREATER); +#if GL_VERSION_1_1 LLGLEnable stipple(GL_LINE_STIPPLE); +#endif gGL.flush(); switch (mManipPart) @@ -2184,7 +2188,9 @@ void LLManipTranslate::renderArrow(S32 which_arrow, S32 selected_arrow, F32 box_ { gGL.getTexUnit(0)->unbind(LLTexUnit::TT_TEXTURE); LLGLEnable gls_blend(GL_BLEND); +#if GL_VERSION_1_1 LLGLEnable gls_color_material(GL_COLOR_MATERIAL); +#endif for (S32 pass = 1; pass <= 2; pass++) { diff --git a/indra/newview/llmodelpreview.cpp b/indra/newview/llmodelpreview.cpp index cfc30e49a1..858a3c3827 100644 --- a/indra/newview/llmodelpreview.cpp +++ b/indra/newview/llmodelpreview.cpp @@ -3063,7 +3063,9 @@ BOOL LLModelPreview::render() LLGLDisable no_blend(GL_BLEND); LLGLEnable cull(GL_CULL_FACE); LLGLDepthTest depth(GL_FALSE); // SL-12781 disable z-buffer to render background color +#if GL_VERSION_1_1 LLGLDisable fog(GL_FOG); +#endif { gUIProgram.bind(); @@ -3267,7 +3269,9 @@ BOOL LLModelPreview::render() const U32 type_mask = LLVertexBuffer::MAP_VERTEX | LLVertexBuffer::MAP_NORMAL | LLVertexBuffer::MAP_TEXCOORD0; +#if GL_VERSION_1_1 LLGLEnable normalize(GL_NORMALIZE); +#endif if (!mBaseModel.empty() && mVertexBuffer[5].empty()) { @@ -3361,9 +3365,13 @@ BOOL LLModelPreview::render() if (edges) { glLineWidth(PREVIEW_EDGE_WIDTH); +#if GL_VERSION_1_1 glPolygonMode(GL_FRONT_AND_BACK, GL_LINE); +#endif buffer->drawRange(LLRender::TRIANGLES, 0, buffer->getNumVerts() - 1, buffer->getNumIndices(), 0); +#if GL_VERSION_1_1 glPolygonMode(GL_FRONT_AND_BACK, GL_FILL); +#endif glLineWidth(1.f); } buffer->flush(); @@ -3485,10 +3493,14 @@ BOOL LLModelPreview::render() gGL.diffuseColor4fv(PREVIEW_PSYH_EDGE_COL.mV); glLineWidth(PREVIEW_PSYH_EDGE_WIDTH); +#if GL_VERSION_1_1 glPolygonMode(GL_FRONT_AND_BACK, GL_LINE); +#endif buffer->drawRange(LLRender::TRIANGLES, 0, buffer->getNumVerts() - 1, buffer->getNumIndices(), 0); +#if GL_VERSION_1_1 glPolygonMode(GL_FRONT_AND_BACK, GL_FILL); +#endif glLineWidth(1.f); buffer->flush(); @@ -3502,7 +3514,9 @@ BOOL LLModelPreview::render() if (mHasDegenerate) { glLineWidth(PREVIEW_DEG_EDGE_WIDTH); +#if GL_VERSION_1_1 glPointSize(PREVIEW_DEG_POINT_SIZE); +#endif gPipeline.enableLightsFullbright(); //show degenerate triangles LLGLDepthTest depth(GL_TRUE, GL_TRUE, GL_ALWAYS); @@ -3571,7 +3585,9 @@ BOOL LLModelPreview::render() gGL.popMatrix(); } glLineWidth(1.f); +#if GL_VERSION_1_1 glPointSize(1.f); +#endif gPipeline.enableLightsPreview(); gGL.setSceneBlendType(LLRender::BT_ALPHA); } @@ -3712,9 +3728,13 @@ BOOL LLModelPreview::render() { gGL.diffuseColor4fv(PREVIEW_EDGE_COL.mV); glLineWidth(PREVIEW_EDGE_WIDTH); +#if GL_VERSION_1_1 glPolygonMode(GL_FRONT_AND_BACK, GL_LINE); +#endif buffer->draw(LLRender::TRIANGLES, buffer->getNumIndices(), 0); +#if GL_VERSION_1_1 glPolygonMode(GL_FRONT_AND_BACK, GL_FILL); +#endif glLineWidth(1.f); } } diff --git a/indra/newview/llselectmgr.cpp b/indra/newview/llselectmgr.cpp index 195b172102..cab0b74cd0 100644 --- a/indra/newview/llselectmgr.cpp +++ b/indra/newview/llselectmgr.cpp @@ -6140,7 +6140,9 @@ void LLSelectMgr::renderSilhouettes(BOOL for_hud) } } +#if GL_VERSION_1_1 glPolygonMode(GL_FRONT_AND_BACK, GL_LINE); +#endif S32 num_tes = llmin((S32)objectp->getNumTEs(), (S32)objectp->getNumFaces()); // avatars have TEs but no faces for (S32 te = 0; te < num_tes; ++te) @@ -6155,7 +6157,9 @@ void LLSelectMgr::renderSilhouettes(BOOL for_hud) gGL.popMatrix(); glLineWidth(1.f); +#if GL_VERSION_1_1 glPolygonMode(GL_FRONT_AND_BACK, GL_FILL); +#endif if (shader) { @@ -6731,13 +6735,17 @@ void LLSelectNode::renderOneSilhouette(const LLColor4 &color) { gGL.flush(); gGL.blendFunc(LLRender::BF_SOURCE_COLOR, LLRender::BF_ONE); +#if GL_VERSION_1_1 LLGLEnable fog(GL_FOG); glFogi(GL_FOG_MODE, GL_LINEAR); +#endif float d = (LLViewerCamera::getInstance()->getPointOfInterest()-LLViewerCamera::getInstance()->getOrigin()).magVec(); LLColor4 fogCol = color * (F32)llclamp((LLSelectMgr::getInstance()->getSelectionCenterGlobal()-gAgentCamera.getCameraPositionGlobal()).magVec()/(LLSelectMgr::getInstance()->getBBoxOfSelection().getExtentLocal().magVec()*4), 0.0, 1.0); +#if GL_VERSION_1_1 glFogf(GL_FOG_START, d); glFogf(GL_FOG_END, d*(1 + (LLViewerCamera::getInstance()->getView() / LLViewerCamera::getInstance()->getDefaultFOV()))); glFogfv(GL_FOG_COLOR, fogCol.mV); +#endif LLGLDepthTest gls_depth(GL_TRUE, GL_FALSE, GL_GEQUAL); gGL.flush(); diff --git a/indra/newview/llspatialpartition.cpp b/indra/newview/llspatialpartition.cpp index 52eef0e92f..18eccea066 100644 --- a/indra/newview/llspatialpartition.cpp +++ b/indra/newview/llspatialpartition.cpp @@ -1788,7 +1788,9 @@ void renderOctree(LLSpatialGroup* group) gGL.popMatrix(); } } +#if GL_VERSION_1_1 glPolygonMode(GL_FRONT_AND_BACK, GL_FILL); +#endif gDebugProgram.bind(); // make sure non-rigged variant is bound gGL.diffuseColor4f(1,1,1,1); } @@ -2122,7 +2124,9 @@ void renderComplexityDisplay(LLDrawable* drawablep) // don't highlight objects below the threshold if (cost > gSavedSettings.getS32("RenderComplexityThreshold")) { +#if GL_VERSION_1_1 glColor4f(color[0],color[1],color[2],0.5f); +#endif S32 num_faces = drawablep->getNumFaces(); @@ -2393,10 +2397,14 @@ void renderMeshBaseHull(LLVOVolume* volume, U32 data_mask, LLColor4& color, LLCo gGL.diffuseColor4fv(color.mV); LLVertexBuffer::drawArrays(LLRender::TRIANGLES, decomp->mBaseHullMesh.mPositions); +#if GL_VERSION_1_1 glPolygonMode(GL_FRONT_AND_BACK, GL_LINE); +#endif gGL.diffuseColor4fv(line_color.mV); LLVertexBuffer::drawArrays(LLRender::TRIANGLES, decomp->mBaseHullMesh.mPositions); +#if GL_VERSION_1_1 glPolygonMode(GL_FRONT_AND_BACK, GL_FILL); +#endif } else { @@ -2417,12 +2425,16 @@ void render_hull(LLModel::PhysicsMesh& mesh, const LLColor4& color, const LLColo { gGL.diffuseColor4fv(color.mV); LLVertexBuffer::drawArrays(LLRender::TRIANGLES, mesh.mPositions); +#if GL_VERSION_1_1 glPolygonMode(GL_FRONT_AND_BACK, GL_LINE); +#endif glLineWidth(3.f); gGL.diffuseColor4fv(line_color.mV); LLVertexBuffer::drawArrays(LLRender::TRIANGLES, mesh.mPositions); glLineWidth(1.f); +#if GL_VERSION_1_1 glPolygonMode(GL_FRONT_AND_BACK, GL_FILL); +#endif } void renderPhysicsShape(LLDrawable* drawable, LLVOVolume* volume) @@ -2475,7 +2487,9 @@ void renderPhysicsShape(LLDrawable* drawable, LLVOVolume* volume) gGL.pushMatrix(); gGL.multMatrix((F32*) volume->getRelativeXform().mMatrix); +#if GL_VERSION_1_1 LLGLEnable(GL_POLYGON_OFFSET_LINE); +#endif glPolygonOffset(3.f, 3.f); if (type == LLPhysicsShapeBuilderUtil::PhysicsShapeSpecification::USER_MESH) @@ -2507,10 +2521,14 @@ void renderPhysicsShape(LLDrawable* drawable, LLVOVolume* volume) gGL.diffuseColor4fv(color.mV); LLVertexBuffer::drawArrays(LLRender::TRIANGLES, decomp->mPhysicsShapeMesh.mPositions); +#if GL_VERSION_1_1 glPolygonMode(GL_FRONT_AND_BACK, GL_LINE); +#endif gGL.diffuseColor4fv(line_color.mV); LLVertexBuffer::drawArrays(LLRender::TRIANGLES, decomp->mPhysicsShapeMesh.mPositions); +#if GL_VERSION_1_1 glPolygonMode(GL_FRONT_AND_BACK, GL_FILL); +#endif } else { //no mesh or decomposition, render base hull @@ -2631,7 +2649,9 @@ void renderPhysicsShape(LLDrawable* drawable, LLVOVolume* volume) { //render hull +#if GL_VERSION_1_1 glPolygonMode(GL_FRONT_AND_BACK, GL_LINE); +#endif gGL.diffuseColor4fv(line_color.mV); LLVertexBuffer::unbind(); @@ -2641,7 +2661,9 @@ void renderPhysicsShape(LLDrawable* drawable, LLVOVolume* volume) LLVertexBuffer::drawElements(LLRender::TRIANGLES, phys_volume->mHullPoints, NULL, phys_volume->mNumHullIndices, phys_volume->mHullIndices); gGL.diffuseColor4fv(color.mV); +#if GL_VERSION_1_1 glPolygonMode(GL_FRONT_AND_BACK, GL_FILL); +#endif LLVertexBuffer::drawElements(LLRender::TRIANGLES, phys_volume->mHullPoints, NULL, phys_volume->mNumHullIndices, phys_volume->mHullIndices); } @@ -2698,13 +2720,17 @@ void renderPhysicsShape(LLDrawable* drawable, LLVOVolume* volume) S32 detail = get_physics_detail(volume_params, volume->getScale()); LLVolume* phys_volume = LLPrimitive::sVolumeManager->refVolume(volume_params, detail); +#if GL_VERSION_1_1 glPolygonMode(GL_FRONT_AND_BACK, GL_LINE); +#endif gGL.diffuseColor4fv(line_color.mV); pushVerts(phys_volume); gGL.diffuseColor4fv(color.mV); +#if GL_VERSION_1_1 glPolygonMode(GL_FRONT_AND_BACK, GL_FILL); +#endif pushVerts(phys_volume); LLPrimitive::sVolumeManager->unrefVolume(phys_volume); } @@ -2717,10 +2743,14 @@ void renderPhysicsShape(LLDrawable* drawable, LLVOVolume* volume) if (phys_volume->mHullPoints && phys_volume->mHullIndices) { +#if GL_VERSION_1_1 glPolygonMode(GL_FRONT_AND_BACK, GL_LINE); +#endif llassert(LLGLSLShader::sCurBoundShader != 0); LLVertexBuffer::unbind(); +#if GL_VERSION_1_1 glVertexPointer(3, GL_FLOAT, 16, phys_volume->mHullPoints); +#endif gGL.diffuseColor4fv(line_color.mV); gGL.syncMatrices(); { @@ -2729,7 +2759,9 @@ void renderPhysicsShape(LLDrawable* drawable, LLVOVolume* volume) } gGL.diffuseColor4fv(color.mV); +#if GL_VERSION_1_1 glPolygonMode(GL_FRONT_AND_BACK, GL_FILL); +#endif { LL_PROFILER_GPU_ZONEC( "gl.DrawElements", 0x40FF40 ) glDrawElements(GL_TRIANGLES, phys_volume->mNumHullIndices, GL_UNSIGNED_SHORT, phys_volume->mHullIndices); @@ -2811,14 +2843,18 @@ void renderPhysicsShapes(LLSpatialGroup* group) LLVertexBuffer* buff = face->getVertexBuffer(); if (buff) { +#if GL_VERSION_1_1 glPolygonMode(GL_FRONT_AND_BACK, GL_LINE); +#endif buff->setBuffer(LLVertexBuffer::MAP_VERTEX); gGL.diffuseColor3f(0.2f, 0.5f, 0.3f); buff->draw(LLRender::TRIANGLES, buff->getNumIndices(), 0); gGL.diffuseColor3f(0.2f, 1.f, 0.3f); +#if GL_VERSION_1_1 glPolygonMode(GL_FRONT_AND_BACK, GL_FILL); +#endif buff->draw(LLRender::TRIANGLES, buff->getNumIndices(), 0); } } @@ -2923,7 +2959,9 @@ void renderTextureAnim(LLDrawInfo* params) void renderBatchSize(LLDrawInfo* params) { +#if GL_VERSION_1_1 LLGLEnable offset(GL_POLYGON_OFFSET_FILL); +#endif glPolygonOffset(-1.f, 1.f); LLGLSLShader* old_shader = LLGLSLShader::sCurBoundShaderPtr; U32 mask = LLVertexBuffer::MAP_VERTEX; @@ -3262,13 +3300,17 @@ void renderRaycast(LLDrawable* drawablep) dir.setSub(end, start); gGL.flush(); +#if GL_VERSION_1_1 glPolygonMode(GL_FRONT_AND_BACK, GL_LINE); +#endif { //render face positions LLVertexBuffer::unbind(); gGL.diffuseColor4f(0,1,1,0.5f); +#if GL_VERSION_1_1 glVertexPointer(3, GL_FLOAT, sizeof(LLVector4a), face.mPositions); +#endif gGL.syncMatrices(); LL_PROFILER_GPU_ZONEC( "gl.DrawElements", 0x60FF60 ); glDrawElements(GL_TRIANGLES, face.mNumIndices, GL_UNSIGNED_SHORT, face.mIndices); @@ -3289,7 +3331,9 @@ void renderRaycast(LLDrawable* drawablep) } gGL.popMatrix(); +#if GL_VERSION_1_1 glPolygonMode(GL_FRONT_AND_BACK, GL_FILL); +#endif } } } @@ -3860,16 +3904,22 @@ void LLSpatialPartition::renderDebug() LLGLEnable blend(GL_BLEND); LLGLDepthTest depth_under(GL_TRUE, GL_FALSE, GL_GREATER); +#if GL_VERSION_1_1 glPolygonMode(GL_FRONT_AND_BACK, GL_LINE); +#endif gGL.diffuseColor4f(0.5f, 0.0f, 0, 0.25f); +#if GL_VERSION_1_1 LLGLEnable offset(GL_POLYGON_OFFSET_LINE); +#endif glPolygonOffset(-1.f, -1.f); LLOctreeRenderXRay xray(camera); xray.traverse(mOctree); +#if GL_VERSION_1_1 glPolygonMode(GL_FRONT_AND_BACK, GL_FILL); +#endif } } gDebugProgram.unbind(); diff --git a/indra/newview/llviewerdisplay.cpp b/indra/newview/llviewerdisplay.cpp index b40cf4acec..6dbd728461 100644 --- a/indra/newview/llviewerdisplay.cpp +++ b/indra/newview/llviewerdisplay.cpp @@ -899,7 +899,9 @@ void display(BOOL rebuild, F32 zoom_factor, int subfield, BOOL for_snapshot) { glClearColor(0.5f, 0.5f, 0.5f, 0.f); glClear(GL_COLOR_BUFFER_BIT); +#if GL_VERSION_1_1 glPolygonMode(GL_FRONT_AND_BACK, GL_LINE); +#endif } LLAppViewer::instance()->pingMainloopTimeout("Display:RenderStart"); @@ -1490,7 +1492,9 @@ void render_ui_2d() // Render 2D UI elements that overlay the world (no z compare) // Disable wireframe mode below here, as this is HUD/menus +#if GL_VERSION_1_1 glPolygonMode(GL_FRONT_AND_BACK, GL_FILL); +#endif // Menu overlays, HUD, etc gViewerWindow->setup2DRender(); diff --git a/indra/newview/llviewerjointmesh.cpp b/indra/newview/llviewerjointmesh.cpp index d9cdde8d6d..d5231b49be 100644 --- a/indra/newview/llviewerjointmesh.cpp +++ b/indra/newview/llviewerjointmesh.cpp @@ -257,7 +257,9 @@ U32 LLViewerJointMesh::drawShape( F32 pixelArea, BOOL first_pass, BOOL is_dummy) stop_glerror(); +#if GL_VERSION_1_1 LLGLSSpecular specular(LLColor4(1.f,1.f,1.f,1.f), 0.f); +#endif //---------------------------------------------------------------- // setup current texture diff --git a/indra/newview/llvoavatar.cpp b/indra/newview/llvoavatar.cpp index 305c489cc8..4a53f2b2cd 100644 --- a/indra/newview/llvoavatar.cpp +++ b/indra/newview/llvoavatar.cpp @@ -5107,7 +5107,9 @@ U32 LLVOAvatar::renderSkinned() //-------------------------------------------------------------------- bool should_alpha_mask = shouldAlphaMask(); +#if GL_VERSION_1_1 LLGLState test(GL_ALPHA_TEST, should_alpha_mask); +#endif BOOL first_pass = TRUE; if (!LLDrawPoolAvatar::sSkipOpaque) @@ -5158,7 +5160,9 @@ U32 LLVOAvatar::renderSkinned() if (!LLDrawPoolAvatar::sSkipTransparent || LLPipeline::sImpostorRender) { LLGLState blend(GL_BLEND, !mIsDummy); +#if GL_VERSION_1_1 LLGLState test(GL_ALPHA_TEST, !mIsDummy); +#endif num_indices += renderTransparent(first_pass); } @@ -5237,7 +5241,9 @@ U32 LLVOAvatar::renderRigid() } bool should_alpha_mask = shouldAlphaMask(); +#if GL_VERSION_1_1 LLGLState test(GL_ALPHA_TEST, should_alpha_mask); +#endif if (isTextureVisible(TEX_EYES_BAKED) || (getOverallAppearance() == AOA_JELLYDOLL && !isControlAvatar()) || isUIAvatar()) { @@ -5302,7 +5308,9 @@ U32 LLVOAvatar::renderImpostor(LLColor4U color, S32 diffuse_channel) gGL.flush(); } { +#if GL_VERSION_1_1 LLGLEnable test(GL_ALPHA_TEST); +#endif gGL.flush(); gGL.color4ubv(color.mV); diff --git a/indra/newview/pipeline.cpp b/indra/newview/pipeline.cpp index fa5a9c97eb..1a465763e3 100644 --- a/indra/newview/pipeline.cpp +++ b/indra/newview/pipeline.cpp @@ -2382,7 +2382,9 @@ void LLPipeline::updateCull(LLCamera& camera, LLCullResult& result, LLPlane* pla gGL.loadMatrix(gGLLastModelView); LLGLDisable blend(GL_BLEND); +#if GL_VERSION_1_1 LLGLDisable test(GL_ALPHA_TEST); +#endif gGL.getTexUnit(0)->unbind(LLTexUnit::TT_TEXTURE); LLGLDepthTest depth(GL_TRUE, GL_FALSE); @@ -2633,7 +2635,9 @@ void LLPipeline::doOcclusion(LLCamera& camera) gGL.setColorMask(false, false); } LLGLDisable blend(GL_BLEND); +#if GL_VERSION_1_1 LLGLDisable test(GL_ALPHA_TEST); +#endif gGL.getTexUnit(0)->unbind(LLTexUnit::TT_TEXTURE); LLGLDepthTest depth(GL_TRUE, GL_FALSE); @@ -4000,7 +4004,9 @@ void render_hud_elements() LL_PROFILE_ZONE_SCOPED_CATEGORY_UI; //LL_RECORD_BLOCK_TIME(FTM_RENDER_UI); gPipeline.disableLights(); +#if GL_VERSION_1_1 LLGLDisable fog(GL_FOG); +#endif LLGLSUIDefault gls_ui; LLGLEnable stencil(GL_STENCIL_TEST); @@ -4054,14 +4060,18 @@ void LLPipeline::renderHighlights() // Render highlighted faces. LLGLSPipelineAlpha gls_pipeline_alpha; LLColor4 color(1.f, 1.f, 1.f, 0.5f); +#if GL_VERSION_1_1 LLGLEnable color_mat(GL_COLOR_MATERIAL); +#endif disableLights(); if (!hasRenderType(LLPipeline::RENDER_TYPE_HUD) && !mHighlightSet.empty()) { //draw blurry highlight image over screen LLGLEnable blend(GL_BLEND); LLGLDepthTest depth(GL_TRUE, GL_FALSE, GL_ALWAYS); +#if GL_VERSION_1_1 LLGLDisable test(GL_ALPHA_TEST); +#endif LLGLEnable stencil(GL_STENCIL_TEST); gGL.flush(); @@ -4325,14 +4335,18 @@ void LLPipeline::renderGeom(LLCamera& camera, bool forceVBOUpdate) LLGLSPipeline gls_pipeline; LLGLEnable multisample(RenderFSAASamples > 0 ? GL_MULTISAMPLE_ARB : 0); +#if GL_VERSION_1_1 LLGLState gls_color_material(GL_COLOR_MATERIAL, mLightingDetail < 2); +#endif // Toggle backface culling for debugging LLGLEnable cull_face(mBackfaceCull ? GL_CULL_FACE : 0); // Set fog bool use_fog = hasRenderDebugFeatureMask(LLPipeline::RENDER_DEBUG_FEATURE_FOG); +#if GL_VERSION_1_1 LLGLEnable fog_enable(use_fog && !gPipeline.canUseWindLightShadersOnObjects() ? GL_FOG : 0); +#endif gSky.updateFog(camera.getFar()); if (!use_fog) { @@ -4922,7 +4936,9 @@ void LLPipeline::renderDebug() glClearColor(clearColor.mV[0],clearColor.mV[1],clearColor.mV[2],0); glClear(GL_DEPTH_BUFFER_BIT | GL_COLOR_BUFFER_BIT | GL_STENCIL_BUFFER_BIT); gGL.setColorMask(true, false); +#if GL_VERSION_1_1 glPolygonMode( GL_FRONT_AND_BACK, GL_FILL ); +#endif } //NavMesh @@ -4952,7 +4968,9 @@ void LLPipeline::renderDebug() gPathfindingProgram.bind(); gGL.flush(); +#if GL_VERSION_1_1 glPolygonMode( GL_FRONT_AND_BACK, GL_FILL ); +#endif glLineWidth(1.0f); gGL.flush(); } @@ -5009,7 +5027,9 @@ void LLPipeline::renderDebug() LLGLDisable cull(i >= 2 ? GL_CULL_FACE : 0); gGL.flush(); +#if GL_VERSION_1_1 glPolygonMode( GL_FRONT_AND_BACK, GL_FILL ); +#endif //get rid of some z-fighting LLGLEnable polyOffset(GL_POLYGON_OFFSET_FILL); @@ -5034,8 +5054,10 @@ void LLPipeline::renderDebug() gGL.flush(); } +#if GL_VERSION_1_1 LLGLEnable lineOffset(GL_POLYGON_OFFSET_LINE); glPolygonMode( GL_FRONT_AND_BACK, GL_LINE ); +#endif F32 offset = gSavedSettings.getF32("PathfindingLineOffset"); @@ -5055,10 +5077,14 @@ void LLPipeline::renderDebug() } else { +#if GL_VERSION_1_1 glPolygonMode( GL_FRONT_AND_BACK, GL_FILL ); +#endif gPathfindingProgram.uniform1f(sAmbiance, ambiance); llPathingLibInstance->renderNavMeshShapesVBO( render_order[i] ); +#if GL_VERSION_1_1 glPolygonMode(GL_FRONT_AND_BACK, GL_LINE); +#endif } } @@ -5075,7 +5101,9 @@ void LLPipeline::renderDebug() glLineWidth(1.f); } +#if GL_VERSION_1_1 glPolygonMode( GL_FRONT_AND_BACK, GL_FILL ); +#endif } } } @@ -5086,7 +5114,9 @@ void LLPipeline::renderDebug() { //render navmesh xray F32 ambiance = gSavedSettings.getF32("PathfindingAmbiance"); +#if GL_VERSION_1_1 LLGLEnable lineOffset(GL_POLYGON_OFFSET_LINE); +#endif LLGLEnable polyOffset(GL_POLYGON_OFFSET_FILL); F32 offset = gSavedSettings.getF32("PathfindingLineOffset"); @@ -5103,10 +5133,14 @@ void LLPipeline::renderDebug() if (gSavedSettings.getBOOL("PathfindingXRayWireframe")) { //draw hidden wireframe as darker and less opaque +#if GL_VERSION_1_1 glPolygonMode( GL_FRONT_AND_BACK, GL_LINE ); +#endif gPathfindingProgram.uniform1f(sAmbiance, 1.f); llPathingLibInstance->renderNavMesh(); +#if GL_VERSION_1_1 glPolygonMode( GL_FRONT_AND_BACK, GL_FILL ); +#endif } else { @@ -5147,7 +5181,9 @@ void LLPipeline::renderDebug() gGL.getTexUnit(0)->bind(LLViewerFetchedTexture::sWhiteImagep, true); +#if GL_VERSION_1_1 glPointSize(8.f); +#endif LLGLDepthTest depth(GL_TRUE, GL_TRUE, GL_ALWAYS); gGL.begin(LLRender::POINTS); @@ -5172,7 +5208,9 @@ void LLPipeline::renderDebug() } gGL.end(); gGL.flush(); +#if GL_VERSION_1_1 glPointSize(1.f); +#endif } @@ -5335,7 +5373,9 @@ void LLPipeline::renderDebug() { //render visible point cloud gGL.flush(); +#if GL_VERSION_1_1 glPointSize(8.f); +#endif gGL.begin(LLRender::POINTS); F32* c = col+i*4; @@ -5349,7 +5389,9 @@ void LLPipeline::renderDebug() gGL.end(); gGL.flush(); +#if GL_VERSION_1_1 glPointSize(1.f); +#endif LLVector3* ext = mShadowExtents[i]; LLVector3 pos = (ext[0]+ext[1])*0.5f; @@ -7481,7 +7523,9 @@ void LLPipeline::renderFinalize() if (gUseWireframe) { +#if GL_VERSION_1_1 glPolygonMode(GL_FRONT_AND_BACK, GL_FILL); +#endif } LLVector2 tc1(0, 0); @@ -7502,7 +7546,9 @@ void LLPipeline::renderFinalize() gGL.pushMatrix(); gGL.loadIdentity(); +#if GL_VERSION_1_1 LLGLDisable test(GL_ALPHA_TEST); +#endif gGL.setColorMask(true, true); glClearColor(0, 0, 0, 0); @@ -7529,7 +7575,9 @@ void LLPipeline::renderFinalize() { LLGLEnable blend_on(GL_BLEND); +#if GL_VERSION_1_1 LLGLEnable test(GL_ALPHA_TEST); +#endif gGL.setSceneBlendType(LLRender::BT_ADD_WITH_ALPHA); @@ -8541,7 +8589,9 @@ void LLPipeline::renderDeferredLighting(LLRenderTarget *screen_target) { LLGLDepthTest depth(GL_FALSE); LLGLDisable blend(GL_BLEND); +#if GL_VERSION_1_1 LLGLDisable test(GL_ALPHA_TEST); +#endif // full screen blit gGL.pushMatrix(); @@ -9961,7 +10011,9 @@ void LLPipeline::generateHighlight(LLCamera& camera) { F32 transition = gFrameIntervalSeconds.value()/RenderHighlightFadeTime; +#if GL_VERSION_1_1 LLGLDisable test(GL_ALPHA_TEST); +#endif LLGLDepthTest depth(GL_FALSE); mHighlight.bindTarget(); disableLights(); -- cgit v1.2.3 From b7bb44714f9305bb4bc93291f5706a92b5aeaae8 Mon Sep 17 00:00:00 2001 From: Erik Kundiman Date: Sun, 10 Sep 2023 10:19:36 +0800 Subject: Missing parameter for non file picker implementors --- indra/newview/llfilepicker.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'indra') diff --git a/indra/newview/llfilepicker.cpp b/indra/newview/llfilepicker.cpp index 57874c966e..dee576440b 100644 --- a/indra/newview/llfilepicker.cpp +++ b/indra/newview/llfilepicker.cpp @@ -1650,13 +1650,13 @@ BOOL LLFilePicker::getMultipleOpenFilesModeless(ELoadFilter filter, #else // not implemented -BOOL LLFilePicker::getSaveFile( ESaveFilter filter, const std::string& filename ) +BOOL LLFilePicker::getSaveFile( ESaveFilter filter, const std::string& filename, bool blocking ) { reset(); return FALSE; } -BOOL LLFilePicker::getOpenFile( ELoadFilter filter ) +BOOL LLFilePicker::getOpenFile( ELoadFilter filter, bool blocking ) { reset(); return FALSE; -- cgit v1.2.3 From 40cff2fdf26aec70ee02fd91777e697d77a9c11d Mon Sep 17 00:00:00 2001 From: Erik Kundiman Date: Sun, 10 Sep 2023 10:22:24 +0800 Subject: Preprocess GLU implementors only code --- indra/newview/llhudrender.cpp | 2 ++ indra/newview/llviewercamera.cpp | 8 ++++++++ 2 files changed, 10 insertions(+) (limited to 'indra') diff --git a/indra/newview/llhudrender.cpp b/indra/newview/llhudrender.cpp index dff310ecf9..4e17f2fb5b 100644 --- a/indra/newview/llhudrender.cpp +++ b/indra/newview/llhudrender.cpp @@ -117,9 +117,11 @@ void hud_render_text(const LLWString &wstr, const LLVector3 &pos_agent, proj[i] = (F64) gGLProjection[i]; } +#if GLU_VERSION_1_1 gluProject(render_pos.mV[0], render_pos.mV[1], render_pos.mV[2], mdlv, proj, (GLint*) viewport, &winX, &winY, &winZ); +#endif //fonts all render orthographically, set up projection`` gGL.matrixMode(LLRender::MM_PROJECTION); diff --git a/indra/newview/llviewercamera.cpp b/indra/newview/llviewercamera.cpp index 5d8e80cc41..9ca122b25f 100644 --- a/indra/newview/llviewercamera.cpp +++ b/indra/newview/llviewercamera.cpp @@ -191,6 +191,7 @@ void LLViewerCamera::calcProjection(const F32 far_distance) const //static void LLViewerCamera::updateFrustumPlanes(LLCamera& camera, BOOL ortho, BOOL zflip, BOOL no_hacks) { +#if GLU_VERSION_1_1 GLint* viewport = (GLint*) gGLViewport; F64 model[16]; F64 proj[16]; @@ -283,6 +284,7 @@ void LLViewerCamera::updateFrustumPlanes(LLCamera& camera, BOOL ortho, BOOL zfli } camera.calcAgentFrustumPlanes(frust); +#endif // GLU_VERSION_1_1 } void LLViewerCamera::setPerspective(BOOL for_selection, @@ -425,12 +427,14 @@ void LLViewerCamera::projectScreenToPosAgent(const S32 screen_x, const S32 scree proj[i] = (F64) gGLProjection[i]; } +#if GLU_VERSION_1_1 gluUnProject( GLdouble(screen_x), GLdouble(screen_y), 0.0, mdlv, proj, (GLint*)gGLViewport, &x, &y, &z ); +#endif pos_agent->setVec( (F32)x, (F32)y, (F32)z ); } @@ -473,6 +477,7 @@ BOOL LLViewerCamera::projectPosAgentToScreen(const LLVector3 &pos_agent, LLCoord proj[i] = (F64) gGLProjection[i]; } +#if GLU_VERSION_1_1 if (GL_TRUE == gluProject(pos_agent.mV[VX], pos_agent.mV[VY], pos_agent.mV[VZ], mdlv, proj, (GLint*)viewport, &x, &y, &z)) @@ -549,6 +554,7 @@ BOOL LLViewerCamera::projectPosAgentToScreen(const LLVector3 &pos_agent, LLCoord } } else +#endif // GLU_VERSION_1_1 { return FALSE; } @@ -560,6 +566,7 @@ BOOL LLViewerCamera::projectPosAgentToScreen(const LLVector3 &pos_agent, LLCoord BOOL LLViewerCamera::projectPosAgentToScreenEdge(const LLVector3 &pos_agent, LLCoordGL &out_point) const { +#if GLU_VERSION_1_1 LLVector3 dir_to_point = pos_agent - getOrigin(); dir_to_point /= dir_to_point.magVec(); @@ -706,6 +713,7 @@ BOOL LLViewerCamera::projectPosAgentToScreenEdge(const LLVector3 &pos_agent, out_point.mY = int_y + world_rect.mBottom; return TRUE; } +#endif // GLU_VERSION_1_1 return FALSE; } -- cgit v1.2.3 From 60f60670bf2dad116cf80b673c88668e8102d610 Mon Sep 17 00:00:00 2001 From: Erik Kundiman Date: Sun, 10 Sep 2023 10:24:36 +0800 Subject: Always compile vertex array code So that, especially modern, GL implementations that do have vertex array but don't have the legacy GL_ARB_vertex_array_object defined have such code compiled too. --- indra/newview/llglsandbox.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'indra') diff --git a/indra/newview/llglsandbox.cpp b/indra/newview/llglsandbox.cpp index 7488a472ba..b50e1d6d3c 100644 --- a/indra/newview/llglsandbox.cpp +++ b/indra/newview/llglsandbox.cpp @@ -1122,7 +1122,7 @@ F32 gpu_benchmark() // ensure matched pair of bind() and unbind() calls ShaderBinder binder(gBenchmarkProgram); -#ifdef GL_ARB_vertex_array_object +//#ifdef GL_ARB_vertex_array_object U32 glarray = 0; if (LLRender::sGLCoreProfile) @@ -1130,7 +1130,7 @@ F32 gpu_benchmark() glGenVertexArrays(1, &glarray); glBindVertexArray(glarray); } -#endif +//#endif buff->setBuffer(LLVertexBuffer::MAP_VERTEX); glFinish(); @@ -1164,13 +1164,13 @@ F32 gpu_benchmark() } } -#ifdef GL_ARB_vertex_array_object +//#ifdef GL_ARB_vertex_array_object if (LLRender::sGLCoreProfile) { glBindVertexArray(0); glDeleteVertexArrays(1, &glarray); } -#endif +//#endif std::sort(results.begin(), results.end()); -- cgit v1.2.3 From ce8972461cfd435c6259e23c37a99173230f3633 Mon Sep 17 00:00:00 2001 From: Erik Kundiman Date: Sun, 10 Sep 2023 10:43:18 +0800 Subject: Lose the _EXT from GL_FRAMEBUFFER macro --- indra/newview/pipeline.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'indra') diff --git a/indra/newview/pipeline.cpp b/indra/newview/pipeline.cpp index 1a465763e3..5181279633 100644 --- a/indra/newview/pipeline.cpp +++ b/indra/newview/pipeline.cpp @@ -7482,7 +7482,7 @@ void apply_cube_face_rotation(U32 face) void validate_framebuffer_object() { GLenum status; - status = glCheckFramebufferStatus(GL_FRAMEBUFFER_EXT); + status = glCheckFramebufferStatus(GL_FRAMEBUFFER); switch(status) { case GL_FRAMEBUFFER_COMPLETE: -- cgit v1.2.3 From 89ff99264b6ae4db949e8539fea9582b6f7ebe97 Mon Sep 17 00:00:00 2001 From: Erik Kundiman Date: Sun, 10 Sep 2023 10:47:55 +0800 Subject: GL_RGBA16F is used when there's no GL_RGBA16 --- indra/newview/pipeline.cpp | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'indra') diff --git a/indra/newview/pipeline.cpp b/indra/newview/pipeline.cpp index 5181279633..7b379da2a9 100644 --- a/indra/newview/pipeline.cpp +++ b/indra/newview/pipeline.cpp @@ -895,11 +895,15 @@ bool LLPipeline::allocateScreenBuffer(U32 resX, U32 resY, U32 samples) if (!mOcclusionDepth.allocate(resX/occlusion_divisor, resY/occlusion_divisor, 0, TRUE, FALSE, LLTexUnit::TT_RECT_TEXTURE, FALSE, samples)) return false; if (!addDeferredAttachments(mDeferredScreen)) return false; +#if GL_VERSION_1_1 GLuint screenFormat = GL_RGBA16; if (gGLManager.mIsAMD) { screenFormat = GL_RGBA12; } +#else + GLuint screenFormat = GL_RGBA16F; +#endif if (gGLManager.mGLVersion < 4.f && gGLManager.mIsNVIDIA) { -- cgit v1.2.3 From 6e365caf80d38b792fd74f8c9b54253268d6b24c Mon Sep 17 00:00:00 2001 From: Erik Kundiman Date: Sun, 10 Sep 2023 11:00:12 +0800 Subject: Darwin hasn't been using llwindowmacosx --- indra/llwindow/llwindow.cpp | 2 ++ 1 file changed, 2 insertions(+) (limited to 'indra') diff --git a/indra/llwindow/llwindow.cpp b/indra/llwindow/llwindow.cpp index ece334b8cf..9b9b32f711 100644 --- a/indra/llwindow/llwindow.cpp +++ b/indra/llwindow/llwindow.cpp @@ -33,8 +33,10 @@ #include "llwindowsdl.h" #elif LL_WINDOWS #include "llwindowwin32.h" +/* #elif LL_DARWIN #include "llwindowmacosx.h" +*/ #endif #include "llerror.h" -- cgit v1.2.3 From 929c658fcaf5f8d9ffce1cafc9e52d62788841e4 Mon Sep 17 00:00:00 2001 From: Erik Kundiman Date: Sun, 10 Sep 2023 11:48:38 +0800 Subject: GL_ALPHA8_EXT as an alternative to GL_ALPHA8 --- indra/newview/lldrawpoolbump.cpp | 4 ++++ indra/newview/llviewertexturelist.cpp | 10 ++++++++++ indra/newview/llvoavatar.cpp | 4 ++++ 3 files changed, 18 insertions(+) (limited to 'indra') diff --git a/indra/newview/lldrawpoolbump.cpp b/indra/newview/lldrawpoolbump.cpp index dafc4a0a0a..58a78f508c 100644 --- a/indra/newview/lldrawpoolbump.cpp +++ b/indra/newview/lldrawpoolbump.cpp @@ -1207,7 +1207,11 @@ void LLBumpImageList::onSourceLoaded( BOOL success, LLViewerTexture *src_vi, LLI if (!LLPipeline::sRenderDeferred) { +#if GL_VERSION_1_1 bump->setExplicitFormat(GL_ALPHA8, GL_ALPHA); +#else + bump->setExplicitFormat(GL_ALPHA8_EXT, GL_ALPHA); +#endif #if LL_BUMPLIST_MULTITHREADED auto tex_queue = LLImageGLThread::sEnabled ? sTexUpdateQueue.lock() : nullptr; diff --git a/indra/newview/llviewertexturelist.cpp b/indra/newview/llviewertexturelist.cpp index e6d4b0d026..b48290776a 100644 --- a/indra/newview/llviewertexturelist.cpp +++ b/indra/newview/llviewertexturelist.cpp @@ -166,15 +166,25 @@ void LLViewerTextureList::doPreloadImages() image->setAddressMode(LLTexUnit::TAM_WRAP); mImagePreloads.insert(image); } +#if GL_VERSION_1_1 image = LLViewerTextureManager::getFetchedTextureFromFile("alpha_gradient.tga", FTT_LOCAL_FILE, MIPMAP_YES, LLViewerFetchedTexture::BOOST_UI, LLViewerTexture::FETCHED_TEXTURE, GL_ALPHA8, GL_ALPHA, IMG_ALPHA_GRAD); +#else + image = LLViewerTextureManager::getFetchedTextureFromFile("alpha_gradient.tga", FTT_LOCAL_FILE, MIPMAP_YES, LLViewerFetchedTexture::BOOST_UI, LLViewerTexture::FETCHED_TEXTURE, + GL_ALPHA8_EXT, GL_ALPHA, IMG_ALPHA_GRAD); +#endif if (image) { image->setAddressMode(LLTexUnit::TAM_CLAMP); mImagePreloads.insert(image); } +#if GL_VERSION_1_1 image = LLViewerTextureManager::getFetchedTextureFromFile("alpha_gradient_2d.j2c", FTT_LOCAL_FILE, MIPMAP_YES, LLViewerFetchedTexture::BOOST_UI, LLViewerTexture::FETCHED_TEXTURE, GL_ALPHA8, GL_ALPHA, IMG_ALPHA_GRAD_2D); +#else + image = LLViewerTextureManager::getFetchedTextureFromFile("alpha_gradient_2d.j2c", FTT_LOCAL_FILE, MIPMAP_YES, LLViewerFetchedTexture::BOOST_UI, LLViewerTexture::FETCHED_TEXTURE, + GL_ALPHA8_EXT, GL_ALPHA, IMG_ALPHA_GRAD_2D); +#endif if (image) { image->setAddressMode(LLTexUnit::TAM_CLAMP); diff --git a/indra/newview/llvoavatar.cpp b/indra/newview/llvoavatar.cpp index 4a53f2b2cd..348442cf18 100644 --- a/indra/newview/llvoavatar.cpp +++ b/indra/newview/llvoavatar.cpp @@ -9765,7 +9765,11 @@ void LLVOAvatar::onBakedTextureMasksLoaded( BOOL success, LLViewerFetchedTexture stop_glerror(); LLImageGL::setManualImage( +#if GL_VERSION_1_1 GL_TEXTURE_2D, 0, GL_ALPHA8, +#else + GL_TEXTURE_2D, 0, GL_ALPHA8_EXT, +#endif aux_src->getWidth(), aux_src->getHeight(), GL_ALPHA, GL_UNSIGNED_BYTE, aux_src->getData()); stop_glerror(); -- cgit v1.2.3 From 9bb3c0124ec50b9e68bdce3370096668c2da984d Mon Sep 17 00:00:00 2001 From: Erik Kundiman Date: Sun, 10 Sep 2023 12:24:46 +0800 Subject: The header for CFBundleRef & CFBundleCreate --- indra/newview/llfloateruipreview.cpp | 1 + 1 file changed, 1 insertion(+) (limited to 'indra') diff --git a/indra/newview/llfloateruipreview.cpp b/indra/newview/llfloateruipreview.cpp index e67c79a3a0..795cb144a1 100644 --- a/indra/newview/llfloateruipreview.cpp +++ b/indra/newview/llfloateruipreview.cpp @@ -73,6 +73,7 @@ #if LL_DARWIN #include +#include #endif // Static initialization -- cgit v1.2.3 From 157410f867e9906d43f80235751778c134c330ab Mon Sep 17 00:00:00 2001 From: Erik Kundiman Date: Sun, 10 Sep 2023 12:47:21 +0800 Subject: macOS still uses viewer_manifest for now until we're ready with CPack for it. --- indra/newview/CMakeLists.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'indra') diff --git a/indra/newview/CMakeLists.txt b/indra/newview/CMakeLists.txt index 92e8018bf5..1e2fcaa3ad 100644 --- a/indra/newview/CMakeLists.txt +++ b/indra/newview/CMakeLists.txt @@ -2034,6 +2034,8 @@ if (LINUX) endif (PACKAGE) endif (LINUX) +endif (NOT USESYSTEMLIBS) + if (DARWIN) # These all get set with PROPERTIES. It's not that the property names are # magically known to CMake -- it's that these names are referenced in the @@ -2143,8 +2145,6 @@ if (DARWIN) endif (PACKAGE) endif (DARWIN) -endif (NOT USESYSTEMLIBS) - if (INSTALL) include(${CMAKE_CURRENT_SOURCE_DIR}/ViewerInstall.cmake) endif (INSTALL) -- cgit v1.2.3 From 0797257992ee7f88456d3083ebf214485b75c139 Mon Sep 17 00:00:00 2001 From: Erik Kundiman Date: Sun, 10 Sep 2023 12:50:44 +0800 Subject: Use prebuilt OpenJPEG for now until we figure out what's causing crashes with vanilla OpenJPEG. --- indra/cmake/OpenJPEG.cmake | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) (limited to 'indra') diff --git a/indra/cmake/OpenJPEG.cmake b/indra/cmake/OpenJPEG.cmake index 3f86bfd025..83b959e140 100644 --- a/indra/cmake/OpenJPEG.cmake +++ b/indra/cmake/OpenJPEG.cmake @@ -4,17 +4,17 @@ include(Prebuilt) include_guard() add_library( ll::openjpeg INTERFACE IMPORTED ) -if (NOT (USE_AUTOBUILD_3P OR USE_CONAN)) - include(FindPkgConfig) - pkg_check_modules(Openjpeg REQUIRED libopenjp2) - target_include_directories(ll::openjpeg SYSTEM INTERFACE ${Openjpeg_INCLUDE_DIRS}) - target_link_directories(ll::openjpeg INTERFACE ${Openjpeg_LIBRARY_DIRS}) - target_link_libraries(ll::openjpeg INTERFACE ${Openjpeg_LIBRARIES}) - return () -endif () +#if (USESYSTEMLIBS) +# include(FindPkgConfig) +# pkg_check_modules(Openjpeg REQUIRED libopenjp2) +# target_include_directories(ll::openjpeg SYSTEM INTERFACE ${Openjpeg_INCLUDE_DIRS}) +# target_link_directories(ll::openjpeg INTERFACE ${Openjpeg_LIBRARY_DIRS}) +# target_link_libraries(ll::openjpeg INTERFACE ${Openjpeg_LIBRARIES}) +# return () +#endif () -use_system_binary(openjpeg) -use_prebuilt_binary(openjpeg) +#use_system_binary(openjpeg) +#use_prebuilt_binary(openjpeg) target_link_libraries(ll::openjpeg INTERFACE openjp2 ) target_include_directories( ll::openjpeg SYSTEM INTERFACE ${LIBS_PREBUILT_DIR}/include/openjpeg) -- cgit v1.2.3