From 897525f67414f24230e410845193d336d9dece54 Mon Sep 17 00:00:00 2001 From: Ansariel Date: Fri, 2 Aug 2024 20:40:38 +0200 Subject: Fix integer underflow causing issues with wearables --- indra/newview/llappearancemgr.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/indra/newview/llappearancemgr.cpp b/indra/newview/llappearancemgr.cpp index 9dd23a5319..6411be3d4f 100644 --- a/indra/newview/llappearancemgr.cpp +++ b/indra/newview/llappearancemgr.cpp @@ -2133,11 +2133,11 @@ void LLAppearanceMgr::filterWearableItems( items.clear(); for (S32 i=0; i Date: Mon, 5 Aug 2024 20:18:24 +0300 Subject: viewer#2195 Voice morphs 'not supported' notification lacks description --- indra/newview/skins/default/xui/en/notifications.xml | 1 + 1 file changed, 1 insertion(+) diff --git a/indra/newview/skins/default/xui/en/notifications.xml b/indra/newview/skins/default/xui/en/notifications.xml index 2403082938..e9a67fb707 100644 --- a/indra/newview/skins/default/xui/en/notifications.xml +++ b/indra/newview/skins/default/xui/en/notifications.xml @@ -8839,6 +8839,7 @@ New Voice Morphs are available! Voice Morphs are not supported by this viewer. For more information about other voice morph tools, see [[FAQ_URL] this article]. voice -- cgit v1.2.3 From 293187e04b5dfbc002fd694b75ffdca4b2fdbc8e Mon Sep 17 00:00:00 2001 From: Roxie Linden Date: Mon, 5 Aug 2024 18:17:03 -0700 Subject: Build mac symbols for multiple binaries/dynamic libraries and upload them all to bugsplat --- .github/workflows/build.yaml | 16 ++++++++++++++-- build.sh | 4 ++-- indra/cmake/Linking.cmake | 1 + indra/llwebrtc/CMakeLists.txt | 2 ++ 4 files changed, 19 insertions(+), 4 deletions(-) diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index 57faafc042..c2abc503bb 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -390,15 +390,27 @@ jobs: needs: build runs-on: ubuntu-latest steps: + - name: Download Mac Symbols + if: env.BUGSPLAT_USER && env.BUGSPLAT_PASS + uses: actions/download-artifact@v4 + with: + name: macOS-symbols + path: _artifacts + - name: Unpack Mac Symbols + run: | + mkdir _extracted + tar -xJf ${{ needs.build.outputs.viewer_channel }}.sym.tar.gz -C _extracted - name: Post Mac symbols if: env.BUGSPLAT_USER && env.BUGSPLAT_PASS - uses: secondlife/viewer-build-util/post-bugsplat-mac@v2 + uses: Bugsplat-Git/symbol-upload@v9.1.1 with: username: ${{ env.BUGSPLAT_USER }} password: ${{ env.BUGSPLAT_PASS }} database: "SecondLife_Viewer_2018" - channel: ${{ needs.build.outputs.viewer_channel }} + application: ${{ needs.build.outputs.viewer_channel }} version: ${{ needs.build.outputs.viewer_version }} + directory: _extracted + files: "**/*.dSYM" release: needs: [setvar, build, sign-and-package-windows, sign-and-package-mac] diff --git a/build.sh b/build.sh index e025b73170..1a7ef1a941 100755 --- a/build.sh +++ b/build.sh @@ -527,8 +527,8 @@ then if [ "${RELEASE_CRASH_REPORTING:-}" != "OFF" ] then # BugSplat wants to see xcarchive.zip - # e.g. build-darwin-x86_64/newview/Release/Second Life Test.xcarchive.zip - symbol_file="${build_dir}/newview/${variant}/${viewer_channel}.xcarchive.zip" + # e.g. build-darwin-x86_64/newview/Release/Second Life Test.sym.tar.gz + symbol_file="${build_dir}/newview/${variant}/${viewer_channel}.sym.tar.gz if [[ ! -f "$symbol_file" ]] then # symbol tarball we prep for (e.g.) Breakpad diff --git a/indra/cmake/Linking.cmake b/indra/cmake/Linking.cmake index 0ab30d0800..a5b8767923 100644 --- a/indra/cmake/Linking.cmake +++ b/indra/cmake/Linking.cmake @@ -19,6 +19,7 @@ if (WINDOWS OR DARWIN ) endif() else() set(SHARED_LIB_STAGING_DIR ${CMAKE_BINARY_DIR}/sharedlibs/$,$,>) + set(SYMBOLS_STAGING_DIR ${CMAKE_BINARY_DIR}/symbols/$,$,>) endif() if( DARWIN ) diff --git a/indra/llwebrtc/CMakeLists.txt b/indra/llwebrtc/CMakeLists.txt index fd1788c5d4..a8d23b461a 100644 --- a/indra/llwebrtc/CMakeLists.txt +++ b/indra/llwebrtc/CMakeLists.txt @@ -41,6 +41,8 @@ if (WINDOWS) iphlpapi) elseif (DARWIN) target_link_libraries(llwebrtc PRIVATE ll::webrtc) + set_target_properties(llwebrtc PROPERTIES XCODE_ATTRIBUTE_DEBUG_INFORMATION_FORMAT "dwarf-with-dsym" + XCODE_ATTRIBUTE_DWARF_DSYM_FOLDER_PATH "${SYMBOLS_STAGING_DIR}") elseif (LINUX) target_link_libraries(llwebrtc PRIVATE ll::webrtc) endif (WINDOWS) -- cgit v1.2.3 From e96416bdd2ed20b8b5a1fc08a35c7a4ee4eee832 Mon Sep 17 00:00:00 2001 From: Roxie Linden Date: Mon, 5 Aug 2024 19:25:59 -0700 Subject: missing quotes --- build.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build.sh b/build.sh index 1a7ef1a941..26c4399ae8 100755 --- a/build.sh +++ b/build.sh @@ -528,7 +528,7 @@ then then # BugSplat wants to see xcarchive.zip # e.g. build-darwin-x86_64/newview/Release/Second Life Test.sym.tar.gz - symbol_file="${build_dir}/newview/${variant}/${viewer_channel}.sym.tar.gz + symbol_file="${build_dir}/newview/${variant}/${viewer_channel}.sym.tar.gz" if [[ ! -f "$symbol_file" ]] then # symbol tarball we prep for (e.g.) Breakpad -- cgit v1.2.3 From 946b165b99fe1cffbb756a6ee8ff3fa7af756cc6 Mon Sep 17 00:00:00 2001 From: Roxie Linden Date: Mon, 5 Aug 2024 21:34:52 -0700 Subject: Missed file --- build.sh | 1 - indra/newview/CMakeLists.txt | 40 ++++++++++++++++------------------------ 2 files changed, 16 insertions(+), 25 deletions(-) diff --git a/build.sh b/build.sh index 26c4399ae8..e09e6f9f5c 100755 --- a/build.sh +++ b/build.sh @@ -526,7 +526,6 @@ then # nat 2016-12-22: without RELEASE_CRASH_REPORTING, we have no symbol file. if [ "${RELEASE_CRASH_REPORTING:-}" != "OFF" ] then - # BugSplat wants to see xcarchive.zip # e.g. build-darwin-x86_64/newview/Release/Second Life Test.sym.tar.gz symbol_file="${build_dir}/newview/${variant}/${viewer_channel}.sym.tar.gz" if [[ ! -f "$symbol_file" ]] diff --git a/indra/newview/CMakeLists.txt b/indra/newview/CMakeLists.txt index da4060ccec..8ff96f0f3b 100644 --- a/indra/newview/CMakeLists.txt +++ b/indra/newview/CMakeLists.txt @@ -2086,7 +2086,7 @@ if (DARWIN) set(VIEWER_APP_BUNDLE "${CMAKE_CURRENT_BINARY_DIR}/$,$,>/${product}.app") set(VIEWER_APP_EXE "${VIEWER_APP_BUNDLE}/Contents/MacOS/${product}") set(VIEWER_APP_DSYM "${VIEWER_APP_EXE}.dSYM") - set(VIEWER_APP_XCARCHIVE "${VIEWER_APP_BUNDLE}/../${product}.xcarchive.zip") + set(VIEWER_APP_SYMBOLS_ARCHIVE "${VIEWER_APP_BUNDLE}/../${product}.sym.tar.gz") configure_file( "${CMAKE_CURRENT_SOURCE_DIR}/Info-SecondLife.plist" @@ -2191,41 +2191,33 @@ if (PACKAGE AND (RELEASE_CRASH_REPORTING OR NON_RELEASE_CRASH_REPORTING) AND VIE add_dependencies(generate_symbols ${VIEWER_BINARY_NAME}) endif (WINDOWS) if (DARWIN) - # Have to run dsymutil first, then pack up the resulting .dSYM directory - add_custom_command(OUTPUT "${VIEWER_APP_DSYM}" - COMMAND "dsymutil" - ARGS - ${VIEWER_APP_EXE} - COMMENT "Generating ${VIEWER_APP_DSYM}" - ) - add_custom_target(dsym_generate DEPENDS "${VIEWER_APP_DSYM}") - add_dependencies(dsym_generate ${VIEWER_BINARY_NAME}) - add_custom_command(OUTPUT "${VIEWER_APP_XCARCHIVE}" - COMMAND "zip" + set_target_properties(${VIEWER_BINARY_NAME} + PROPERTIES + XCODE_ATTRIBUTE_DEBUG_INFORMATION_FORMAT "dwarf-with-dsym" + XCODE_ATTRIBUTE_DWARF_DSYM_FOLDER_PATH "${SYMBOLS_STAGING_DIR}") + add_custom_command(OUTPUT "${VIEWER_APP_SYMBOLS_ARCHIVE}" + COMMAND "tar" ARGS - "-r" - "${VIEWER_APP_XCARCHIVE}" + "-cJf" + "${VIEWER_APP_SYMBOLS_ARCHIVE}" + "-C" + "${SYMBOLS_STAGING_DIR}" "." - WORKING_DIRECTORY "${VIEWER_APP_DSYM}/.." - DEPENDS "${VIEWER_APP_DSYM}" - COMMENT "Generating xcarchive.zip for upload to BugSplat" + DEPENDS "${VIEWER_BINARY_NAME}" + COMMENT "Generating symbols archive for upload to BugSplat" ) - add_custom_target(dsym_xcarchive DEPENDS "${VIEWER_APP_XCARCHIVE}") - add_dependencies(dsym_xcarchive dsym_generate) # Have to create a stamp file, and depend on it, to force CMake to run # the cleanup step. add_custom_command(OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/dsym.stamp" COMMAND rm -rf "${VIEWER_APP_DSYM}" COMMAND touch "${CMAKE_CURRENT_BINARY_DIR}/dsym.stamp" - DEPENDS "${VIEWER_APP_XCARCHIVE}" - COMMENT "Cleaning up dSYM" + DEPENDS "${VIEWER_APP_SYMBOLS_ARCHIVE}" + COMMENT "Cleaning up symbols archive" ) add_custom_target(generate_symbols DEPENDS - "${VIEWER_APP_DSYM}" - "${VIEWER_APP_XCARCHIVE}" + "${VIEWER_APP_SYMBOLS_ARCHIVE}" "${CMAKE_CURRENT_BINARY_DIR}/dsym.stamp" ) - add_dependencies(generate_symbols dsym_xcarchive) endif (DARWIN) if (LINUX) # TBD -- cgit v1.2.3 From 07573f7e10a9ce4df2c2a0f6c6eb5f0935da57a6 Mon Sep 17 00:00:00 2001 From: Roxie Linden Date: Mon, 5 Aug 2024 23:16:48 -0700 Subject: allow paths with spaces --- .github/workflows/build.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index c2abc503bb..cf14bac0a2 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -399,7 +399,7 @@ jobs: - name: Unpack Mac Symbols run: | mkdir _extracted - tar -xJf ${{ needs.build.outputs.viewer_channel }}.sym.tar.gz -C _extracted + tar -xJf "${{ needs.build.outputs.viewer_channel }}.sym.tar.gz" -C _extracted - name: Post Mac symbols if: env.BUGSPLAT_USER && env.BUGSPLAT_PASS uses: Bugsplat-Git/symbol-upload@v9.1.1 -- cgit v1.2.3 From 83c1f45dbacecd9a9fe2a99c8dcd307b143f2b35 Mon Sep 17 00:00:00 2001 From: Roxie Linden Date: Tue, 6 Aug 2024 00:26:43 -0700 Subject: Download osx artifacts to working directory --- .github/workflows/build.yaml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index cf14bac0a2..506dbff664 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -395,7 +395,6 @@ jobs: uses: actions/download-artifact@v4 with: name: macOS-symbols - path: _artifacts - name: Unpack Mac Symbols run: | mkdir _extracted -- cgit v1.2.3 From bf21677305f7dc725cb0872ee3bcf251efef40f7 Mon Sep 17 00:00:00 2001 From: Andrey Kleshchev Date: Tue, 6 Aug 2024 15:39:21 +0300 Subject: viewer-private#261 (Vivox) Viewer doesn't reconnect to voice chat If state was 'ringing' viewer failed to set mSessionTerminateRequested on cancel so the call kept sort of going --- indra/newview/llvoicevivox.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/indra/newview/llvoicevivox.cpp b/indra/newview/llvoicevivox.cpp index 3392e4de86..13402513ef 100644 --- a/indra/newview/llvoicevivox.cpp +++ b/indra/newview/llvoicevivox.cpp @@ -2149,7 +2149,6 @@ bool LLVivoxVoiceClient::runSession(const sessionStatePtr_t &session) mIsInChannel = true; mMuteMicDirty = true; - mSessionTerminateRequested = false; while (!sShuttingDown && mVoiceEnabled @@ -5435,8 +5434,8 @@ void LLVivoxVoiceClient::leaveChannel(void) { LL_DEBUGS("Voice") << "leaving channel for teleport/logout" << LL_ENDL; mChannelName.clear(); - sessionTerminate(); } + sessionTerminate(); } void LLVivoxVoiceClient::setMuteMic(bool muted) -- cgit v1.2.3 From c52c25e10db2b86a70929793a5d723c012a37671 Mon Sep 17 00:00:00 2001 From: Roxie Linden Date: Tue, 6 Aug 2024 12:06:40 -0700 Subject: As bugspat upload is broken for dylibs within .dSYM bundles, upload the dylibs directly --- .github/workflows/build.yaml | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index 506dbff664..21016c1015 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -399,7 +399,7 @@ jobs: run: | mkdir _extracted tar -xJf "${{ needs.build.outputs.viewer_channel }}.sym.tar.gz" -C _extracted - - name: Post Mac symbols + - name: Post Mac Executable symbols if: env.BUGSPLAT_USER && env.BUGSPLAT_PASS uses: Bugsplat-Git/symbol-upload@v9.1.1 with: @@ -409,7 +409,18 @@ jobs: application: ${{ needs.build.outputs.viewer_channel }} version: ${{ needs.build.outputs.viewer_version }} directory: _extracted - files: "**/*.dSYM" + files: "**/*.app.dSYM" + - name: Post Mac Dylib symbols + if: env.BUGSPLAT_USER && env.BUGSPLAT_PASS + uses: Bugsplat-Git/symbol-upload@v9.1.1 + with: + username: ${{ env.BUGSPLAT_USER }} + password: ${{ env.BUGSPLAT_PASS }} + database: "SecondLife_Viewer_2018" + application: ${{ needs.build.outputs.viewer_channel }} + version: ${{ needs.build.outputs.viewer_version }} + directory: _extracted + files: "**/*.dylib" release: needs: [setvar, build, sign-and-package-windows, sign-and-package-mac] -- cgit v1.2.3 From ae2ff22542a5882616778ffab50612f8ad41b71e Mon Sep 17 00:00:00 2001 From: Cosmic Linden Date: Thu, 18 Jul 2024 15:24:11 -0700 Subject: NOISSUE: Prevent potential bad matrix state in HUD render --- indra/newview/llviewerwindow.cpp | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/indra/newview/llviewerwindow.cpp b/indra/newview/llviewerwindow.cpp index f6de8377f3..4bd1b98569 100644 --- a/indra/newview/llviewerwindow.cpp +++ b/indra/newview/llviewerwindow.cpp @@ -4185,15 +4185,17 @@ void LLViewerWindow::renderSelections( bool for_gl_pick, bool pick_parcel_walls, } } } - if (selection->getSelectType() == SELECT_TYPE_HUD && selection->getObjectCount()) - { - gGL.matrixMode(LLRender::MM_PROJECTION); - gGL.popMatrix(); + } - gGL.matrixMode(LLRender::MM_MODELVIEW); - gGL.popMatrix(); - stop_glerror(); - } + // un-setup HUD render + if (selection->getSelectType() == SELECT_TYPE_HUD && selection->getObjectCount()) + { + gGL.matrixMode(LLRender::MM_PROJECTION); + gGL.popMatrix(); + + gGL.matrixMode(LLRender::MM_MODELVIEW); + gGL.popMatrix(); + stop_glerror(); } } } -- cgit v1.2.3 From 6aa9110b2ae346da1a396500cae1b41e8e2d5b75 Mon Sep 17 00:00:00 2001 From: Cosmic Linden Date: Thu, 11 Jul 2024 15:54:24 -0700 Subject: secondlife/viewer#1883: Local-only PBR terrain paintmap with developer tools --- indra/llrender/llshadermgr.cpp | 3 + indra/llrender/llshadermgr.h | 3 + indra/newview/CMakeLists.txt | 2 + indra/newview/app_settings/settings.xml | 33 +++ .../shaders/class1/deferred/pbrterrainF.glsl | 31 ++- .../shaders/class1/deferred/pbrterrainUtilF.glsl | 46 ++++ .../shaders/class1/deferred/pbrterrainV.glsl | 38 ++- .../shaders/class1/interface/pbrTerrainBakeF.glsl | 62 +++++ .../shaders/class1/interface/pbrTerrainBakeV.glsl | 42 +++ indra/newview/lldrawpoolterrain.cpp | 58 ++++- indra/newview/lldrawpoolterrain.h | 3 +- indra/newview/llsurface.h | 3 +- indra/newview/llsurfacepatch.cpp | 10 +- indra/newview/llsurfacepatch.h | 4 +- indra/newview/llterrainpaintmap.cpp | 285 +++++++++++++++++++++ indra/newview/llterrainpaintmap.h | 42 +++ indra/newview/llviewercontrol.cpp | 4 + indra/newview/llviewermenu.cpp | 82 ++++-- indra/newview/llviewershadermgr.cpp | 74 ++++-- indra/newview/llviewershadermgr.h | 11 +- indra/newview/llviewertexture.cpp | 1 + indra/newview/llvlcomposition.cpp | 11 + indra/newview/llvlcomposition.h | 12 + indra/newview/llvosurfacepatch.cpp | 74 +++--- indra/newview/llvosurfacepatch.h | 12 - indra/newview/skins/default/xui/en/menu_viewer.xml | 38 ++- 26 files changed, 848 insertions(+), 136 deletions(-) create mode 100644 indra/newview/app_settings/shaders/class1/interface/pbrTerrainBakeF.glsl create mode 100644 indra/newview/app_settings/shaders/class1/interface/pbrTerrainBakeV.glsl create mode 100644 indra/newview/llterrainpaintmap.cpp create mode 100644 indra/newview/llterrainpaintmap.h diff --git a/indra/llrender/llshadermgr.cpp b/indra/llrender/llshadermgr.cpp index bc542d325e..512ef340f9 100644 --- a/indra/llrender/llshadermgr.cpp +++ b/indra/llrender/llshadermgr.cpp @@ -1409,6 +1409,7 @@ void LLShaderMgr::initAttribsAndUniforms() mReservedUniforms.push_back("detail_3"); mReservedUniforms.push_back("alpha_ramp"); + mReservedUniforms.push_back("paint_map"); mReservedUniforms.push_back("detail_0_base_color"); mReservedUniforms.push_back("detail_1_base_color"); @@ -1433,6 +1434,8 @@ void LLShaderMgr::initAttribsAndUniforms() mReservedUniforms.push_back("emissiveColors"); mReservedUniforms.push_back("minimum_alphas"); + mReservedUniforms.push_back("region_scale"); + mReservedUniforms.push_back("origin"); mReservedUniforms.push_back("display_gamma"); diff --git a/indra/llrender/llshadermgr.h b/indra/llrender/llshadermgr.h index 921ef20997..2b76ef664b 100644 --- a/indra/llrender/llshadermgr.h +++ b/indra/llrender/llshadermgr.h @@ -267,6 +267,7 @@ public: TERRAIN_DETAIL3, // "detail_3" TERRAIN_ALPHARAMP, // "alpha_ramp" + TERRAIN_PAINTMAP, // "paint_map" TERRAIN_DETAIL0_BASE_COLOR, // "detail_0_base_color" (GLTF) TERRAIN_DETAIL1_BASE_COLOR, // "detail_1_base_color" (GLTF) @@ -291,6 +292,8 @@ public: TERRAIN_EMISSIVE_COLORS, // "emissiveColors" (GLTF) TERRAIN_MINIMUM_ALPHAS, // "minimum_alphas" (GLTF) + REGION_SCALE, // "region_scale" (GLTF) + SHINY_ORIGIN, // "origin" DISPLAY_GAMMA, // "display_gamma" diff --git a/indra/newview/CMakeLists.txt b/indra/newview/CMakeLists.txt index a34354d287..e7857ff09f 100644 --- a/indra/newview/CMakeLists.txt +++ b/indra/newview/CMakeLists.txt @@ -578,6 +578,7 @@ set(viewer_SOURCE_FILES llsyswellwindow.cpp llteleporthistory.cpp llteleporthistorystorage.cpp + llterrainpaintmap.cpp lltexturecache.cpp lltexturectrl.cpp lltexturefetch.cpp @@ -1235,6 +1236,7 @@ set(viewer_HEADER_FILES lltable.h llteleporthistory.h llteleporthistorystorage.h + llterrainpaintmap.h lltexturecache.h lltexturectrl.h lltexturefetch.h diff --git a/indra/newview/app_settings/settings.xml b/indra/newview/app_settings/settings.xml index 9e5d3f09bd..5c3706bb6c 100644 --- a/indra/newview/app_settings/settings.xml +++ b/indra/newview/app_settings/settings.xml @@ -14965,6 +14965,39 @@ F32 Value 0.0 + + LocalTerrainPaintEnabled + + Comment + Enables local paintmap if LocalTerrainAsset1, etc are set + Persist + 0 + Type + Boolean + Value + 0 + + TerrainPaintBitDepth + + Comment + Bit depth for future terrain paint map operations. Min: 1. Max: 8. Takes effect when the paint map is created or modified. Modifications to an existing paintmap of different bit depth will have lower precision. + Persist + 1 + Type + U32 + Value + 5 + + TerrainPaintResolution + + Comment + Resolution of the terrain paint map in pixels. Rounded to a power of two. Min: 16. Max: RenderMaxTextureResolution. Takes effect when the paint map is created. + Persist + 1 + Type + U32 + Value + 2048 PathfindingRetrieveNeighboringRegion diff --git a/indra/newview/app_settings/shaders/class1/deferred/pbrterrainF.glsl b/indra/newview/app_settings/shaders/class1/deferred/pbrterrainF.glsl index 6ca35419f2..410c447c64 100644 --- a/indra/newview/app_settings/shaders/class1/deferred/pbrterrainF.glsl +++ b/indra/newview/app_settings/shaders/class1/deferred/pbrterrainF.glsl @@ -30,6 +30,9 @@ #define TERRAIN_PBR_DETAIL_NORMAL -2 #define TERRAIN_PBR_DETAIL_METALLIC_ROUGHNESS -3 +#define TERRAIN_PAINT_TYPE_HEIGHTMAP_WITH_NOISE 0 +#define TERRAIN_PAINT_TYPE_PBR_PAINTMAP 1 + #if TERRAIN_PLANAR_TEXTURE_SAMPLE_COUNT == 3 #define TerrainCoord vec4[3] #elif TERRAIN_PLANAR_TEXTURE_SAMPLE_COUNT == 1 @@ -48,6 +51,7 @@ struct TerrainMix }; TerrainMix get_terrain_mix_weights(float alpha1, float alpha2, float alphaFinal); +TerrainMix get_terrain_usage_from_weight3(vec3 weight3); struct PBRMix { @@ -97,7 +101,11 @@ PBRMix mix_pbr(PBRMix mix1, PBRMix mix2, float mix2_weight); out vec4 frag_data[4]; +#if TERRAIN_PAINT_TYPE == TERRAIN_PAINT_TYPE_HEIGHTMAP_WITH_NOISE uniform sampler2D alpha_ramp; +#elif TERRAIN_PAINT_TYPE == TERRAIN_PAINT_TYPE_PBR_PAINTMAP +uniform sampler2D paint_map; +#endif // https://registry.khronos.org/glTF/specs/2.0/glTF-2.0.html#additional-textures uniform sampler2D detail_0_base_color; @@ -133,19 +141,25 @@ uniform vec3[4] emissiveColors; #endif uniform vec4 minimum_alphas; // PBR alphaMode: MASK, See: mAlphaCutoff, setAlphaCutoff() -#if TERRAIN_PLANAR_TEXTURE_SAMPLE_COUNT == 3 -in vec4[10] vary_coords; -#elif TERRAIN_PLANAR_TEXTURE_SAMPLE_COUNT == 1 -in vec4[2] vary_coords; -#endif in vec3 vary_position; in vec3 vary_normal; #if (TERRAIN_PBR_DETAIL >= TERRAIN_PBR_DETAIL_NORMAL) in vec3 vary_tangents[4]; flat in float vary_signs[4]; #endif + +// vary_texcoord* are used for terrain composition, vary_coords are used for terrain UVs +#if TERRAIN_PAINT_TYPE == TERRAIN_PAINT_TYPE_HEIGHTMAP_WITH_NOISE in vec4 vary_texcoord0; in vec4 vary_texcoord1; +#elif TERRAIN_PAINT_TYPE == TERRAIN_PAINT_TYPE_PBR_PAINTMAP +in vec2 vary_texcoord; +#endif +#if TERRAIN_PLANAR_TEXTURE_SAMPLE_COUNT == 3 +in vec4[10] vary_coords; +#elif TERRAIN_PLANAR_TEXTURE_SAMPLE_COUNT == 1 +in vec4[2] vary_coords; +#endif void mirrorClip(vec3 position); @@ -171,11 +185,16 @@ void main() // Make sure we clip the terrain if we're in a mirror. mirrorClip(vary_position); + TerrainMix tm; +#if TERRAIN_PAINT_TYPE == TERRAIN_PAINT_TYPE_HEIGHTMAP_WITH_NOISE float alpha1 = texture(alpha_ramp, vary_texcoord0.zw).a; float alpha2 = texture(alpha_ramp,vary_texcoord1.xy).a; float alphaFinal = texture(alpha_ramp, vary_texcoord1.zw).a; - TerrainMix tm = get_terrain_mix_weights(alpha1, alpha2, alphaFinal); + tm = get_terrain_mix_weights(alpha1, alpha2, alphaFinal); +#elif TERRAIN_PAINT_TYPE == TERRAIN_PAINT_TYPE_PBR_PAINTMAP + tm = get_terrain_usage_from_weight3(texture(paint_map, vary_texcoord).xyz); +#endif #if (TERRAIN_PBR_DETAIL >= TERRAIN_PBR_DETAIL_OCCLUSION) // RGB = Occlusion, Roughness, Metal diff --git a/indra/newview/app_settings/shaders/class1/deferred/pbrterrainUtilF.glsl b/indra/newview/app_settings/shaders/class1/deferred/pbrterrainUtilF.glsl index 5098de717e..dc43007dca 100644 --- a/indra/newview/app_settings/shaders/class1/deferred/pbrterrainUtilF.glsl +++ b/indra/newview/app_settings/shaders/class1/deferred/pbrterrainUtilF.glsl @@ -51,7 +51,12 @@ #define TERRAIN_PBR_DETAIL_NORMAL -2 #define TERRAIN_PBR_DETAIL_METALLIC_ROUGHNESS -3 +#define TERRAIN_PAINT_TYPE_HEIGHTMAP_WITH_NOISE 0 +#define TERRAIN_PAINT_TYPE_PBR_PAINTMAP 1 + +#if TERRAIN_PLANAR_TEXTURE_SAMPLE_COUNT == 3 in vec3 vary_vertex_normal; +#endif vec3 srgb_to_linear(vec3 c); @@ -202,6 +207,45 @@ TerrainMix get_terrain_mix_weights(float alpha1, float alpha2, float alphaFinal) return tm; } +// A paintmap weight applier for 4 swatches. The input saves a channel by not +// storing swatch 1, and assuming the weights of the 4 swatches add to 1. +// The components of weight3 should be between 0 and 1 +// The sum of the components of weight3 should be between 0 and 1 +TerrainMix get_terrain_usage_from_weight3(vec3 weight3) +{ + // These steps ensure the output weights add to between 0 and 1 + weight3.xyz = max(vec3(0.0), weight3.xyz); + weight3.xyz /= max(1.0, weight3.x + weight3.y + weight3.z); + + TerrainMix tm; + + // Extract the first weight from the other weights + tm.weight.x = 1.0 - (weight3.x + weight3.y + weight3.z); + tm.weight.yzw = weight3.xyz; + ivec4 usage = max(ivec4(0), ivec4(ceil(tm.weight))); + + tm.type = (usage.x * MIX_X) | + (usage.y * MIX_Y) | + (usage.z * MIX_Z) | + (usage.w * MIX_W); + return tm; +} + +// Inverse of get_terrain_usage_from_weight3, excluding usage flags +// The components of weight should be between 0 and 1 +// The sum of the components of weight should be 1 +vec3 get_weight3_from_terrain_weight(vec4 weight) +{ + // These steps ensure the input weights add to 1 + weight = max(vec4(0.0), weight); + weight.x += 1.0 - sign(weight.x + weight.y + weight.z + weight.w); + weight /= weight.x + weight.y + weight.z + weight.w; + + // Then return the input weights with the first weight truncated + return weight.yzw; +} + +#if TERRAIN_PLANAR_TEXTURE_SAMPLE_COUNT == 3 TerrainTriplanar _t_triplanar() { float sharpness = TERRAIN_TRIPLANAR_BLEND_FACTOR; @@ -219,6 +263,8 @@ TerrainTriplanar _t_triplanar() ((usage.z) * SAMPLE_Z); return tw; } +#endif + // Assume weights add to 1 float terrain_mix(TerrainMix tm, vec4 tms4) diff --git a/indra/newview/app_settings/shaders/class1/deferred/pbrterrainV.glsl b/indra/newview/app_settings/shaders/class1/deferred/pbrterrainV.glsl index c90b2b5926..6791a22a76 100644 --- a/indra/newview/app_settings/shaders/class1/deferred/pbrterrainV.glsl +++ b/indra/newview/app_settings/shaders/class1/deferred/pbrterrainV.glsl @@ -28,31 +28,47 @@ #define TERRAIN_PBR_DETAIL_NORMAL -2 #define TERRAIN_PBR_DETAIL_METALLIC_ROUGHNESS -3 +#define TERRAIN_PAINT_TYPE_HEIGHTMAP_WITH_NOISE 0 +#define TERRAIN_PAINT_TYPE_PBR_PAINTMAP 1 + uniform mat3 normal_matrix; uniform mat4 texture_matrix0; uniform mat4 modelview_matrix; uniform mat4 modelview_projection_matrix; +#if TERRAIN_PAINT_TYPE == TERRAIN_PAINT_TYPE_PBR_PAINTMAP +uniform float region_scale; +#endif in vec3 position; in vec3 normal; in vec4 tangent; in vec4 diffuse_color; +#if TERRAIN_PAINT_TYPE == TERRAIN_PAINT_TYPE_HEIGHTMAP_WITH_NOISE in vec2 texcoord1; +#endif -out vec3 vary_vertex_normal; // Used by pbrterrainUtilF.glsl +out vec3 vary_position; out vec3 vary_normal; +#if TERRAIN_PLANAR_TEXTURE_SAMPLE_COUNT == 3 +out vec3 vary_vertex_normal; // Used by pbrterrainUtilF.glsl +#endif #if (TERRAIN_PBR_DETAIL >= TERRAIN_PBR_DETAIL_NORMAL) out vec3 vary_tangents[4]; flat out float vary_signs[4]; #endif + +// vary_texcoord* are used for terrain composition, vary_coords are used for terrain UVs +#if TERRAIN_PAINT_TYPE == TERRAIN_PAINT_TYPE_HEIGHTMAP_WITH_NOISE out vec4 vary_texcoord0; out vec4 vary_texcoord1; +#elif TERRAIN_PAINT_TYPE == TERRAIN_PAINT_TYPE_PBR_PAINTMAP +out vec2 vary_texcoord; +#endif #if TERRAIN_PLANAR_TEXTURE_SAMPLE_COUNT == 3 out vec4[10] vary_coords; #elif TERRAIN_PLANAR_TEXTURE_SAMPLE_COUNT == 1 out vec4[2] vary_coords; #endif -out vec3 vary_position; // *HACK: Each material uses only one texture transform, but the KHR texture // transform spec allows handling texture transforms separately for each @@ -69,7 +85,9 @@ void main() vary_position = (modelview_matrix*vec4(position.xyz, 1.0)).xyz; vec3 n = normal_matrix * normal; +#if TERRAIN_PLANAR_TEXTURE_SAMPLE_COUNT == 3 vary_vertex_normal = normal; +#endif vec3 t = normal_matrix * tangent.xyz; #if (TERRAIN_PBR_DETAIL >= TERRAIN_PBR_DETAIL_NORMAL) @@ -110,9 +128,9 @@ void main() // Transform and pass tex coords { vec4[2] ttt; +#define transform_xy() terrain_texture_transform(position.xy, ttt) #if TERRAIN_PLANAR_TEXTURE_SAMPLE_COUNT == 3 // Don't care about upside-down (transform_xy_flipped()) -#define transform_xy() terrain_texture_transform(position.xy, ttt) #define transform_yz() terrain_texture_transform(position.yz, ttt) #define transform_negx_z() terrain_texture_transform(position.xz * vec2(-1, 1), ttt) #define transform_yz_flipped() terrain_texture_transform(position.yz * vec2(-1, 1), ttt) @@ -157,26 +175,30 @@ void main() ttt[0].xyz = terrain_texture_transforms[0].xyz; ttt[1].x = terrain_texture_transforms[0].w; ttt[1].y = terrain_texture_transforms[1].x; - vary_coords[0].xy = terrain_texture_transform(position.xy, ttt); + vary_coords[0].xy = transform_xy(); // material 2 ttt[0].xyz = terrain_texture_transforms[1].yzw; ttt[1].xy = terrain_texture_transforms[2].xy; - vary_coords[0].zw = terrain_texture_transform(position.xy, ttt); + vary_coords[0].zw = transform_xy(); // material 3 ttt[0].xy = terrain_texture_transforms[2].zw; ttt[0].z = terrain_texture_transforms[3].x; ttt[1].xy = terrain_texture_transforms[3].yz; - vary_coords[1].xy = terrain_texture_transform(position.xy, ttt); + vary_coords[1].xy = transform_xy(); // material 4 ttt[0].x = terrain_texture_transforms[3].w; ttt[0].yz = terrain_texture_transforms[4].xy; ttt[1].xy = terrain_texture_transforms[4].zw; - vary_coords[1].zw = terrain_texture_transform(position.xy, ttt); + vary_coords[1].zw = transform_xy(); #endif } - vec4 tc = vec4(texcoord1,0,1); +#if TERRAIN_PAINT_TYPE == TERRAIN_PAINT_TYPE_HEIGHTMAP_WITH_NOISE + vec2 tc = texcoord1.xy; vary_texcoord0.zw = tc.xy; vary_texcoord1.xy = tc.xy-vec2(2.0, 0.0); vary_texcoord1.zw = tc.xy-vec2(1.0, 0.0); +#elif TERRAIN_PAINT_TYPE == TERRAIN_PAINT_TYPE_PBR_PAINTMAP + vary_texcoord = position.xy / region_scale; +#endif } diff --git a/indra/newview/app_settings/shaders/class1/interface/pbrTerrainBakeF.glsl b/indra/newview/app_settings/shaders/class1/interface/pbrTerrainBakeF.glsl new file mode 100644 index 0000000000..cf20653a0f --- /dev/null +++ b/indra/newview/app_settings/shaders/class1/interface/pbrTerrainBakeF.glsl @@ -0,0 +1,62 @@ +/** + * @file terrainBakeF.glsl + * + * $LicenseInfo:firstyear=2007&license=viewerlgpl$ + * Second Life Viewer Source Code + * Copyright (C) 2024, 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$ + */ + +/*[EXTRA_CODE_HERE]*/ + +out vec4 frag_color; + +struct TerrainMix +{ + vec4 weight; + int type; +}; + +TerrainMix get_terrain_mix_weights(float alpha1, float alpha2, float alphaFinal); + +uniform sampler2D alpha_ramp; + +// vary_texcoord* are used for terrain composition +in vec4 vary_texcoord0; +in vec4 vary_texcoord1; + +void main() +{ + TerrainMix tm; + float alpha1 = texture(alpha_ramp, vary_texcoord0.zw).a; + float alpha2 = texture(alpha_ramp,vary_texcoord1.xy).a; + float alphaFinal = texture(alpha_ramp, vary_texcoord1.zw).a; + + tm = get_terrain_mix_weights(alpha1, alpha2, alphaFinal); + + // tm.weight.x can be ignored. The paintmap saves a channel by not storing + // swatch 1, and assuming the weights of the 4 swatches add to 1. + // TERRAIN_PAINT_PRECISION emulates loss of precision at lower bit depth + // when a corresponding low-bit image format is not available. Because + // integral values at one depth cannot be precisely represented at another + // bit depth, rounding is required. To maximize numerical stability for + // future conversions, bit depth conversions should round to the nearest + // integer, not floor or ceil. + frag_color = max(vec4(round(tm.weight.yzw * TERRAIN_PAINT_PRECISION) / TERRAIN_PAINT_PRECISION, 1.0), vec4(0)); +} diff --git a/indra/newview/app_settings/shaders/class1/interface/pbrTerrainBakeV.glsl b/indra/newview/app_settings/shaders/class1/interface/pbrTerrainBakeV.glsl new file mode 100644 index 0000000000..fd150b54ad --- /dev/null +++ b/indra/newview/app_settings/shaders/class1/interface/pbrTerrainBakeV.glsl @@ -0,0 +1,42 @@ +/** + * @file pbrTerrainBakeV.glsl + * + * $LicenseInfo:firstyear=2007&license=viewerlgpl$ + * Second Life Viewer Source Code + * Copyright (C) 2024, 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$ + */ + +uniform mat4 modelview_projection_matrix; + +in vec3 position; +in vec2 texcoord1; + +out vec4 vary_texcoord0; +out vec4 vary_texcoord1; + +void main() +{ + gl_Position = modelview_projection_matrix * vec4(position.xyz, 1.0); + vec2 tc = texcoord1.xy; + vary_texcoord0.zw = tc.xy; + vary_texcoord1.xy = tc.xy-vec2(2.0, 0.0); + vary_texcoord1.zw = tc.xy-vec2(1.0, 0.0); +} + diff --git a/indra/newview/lldrawpoolterrain.cpp b/indra/newview/lldrawpoolterrain.cpp index 7d2912d81f..5e676bc5b3 100644 --- a/indra/newview/lldrawpoolterrain.cpp +++ b/indra/newview/lldrawpoolterrain.cpp @@ -219,7 +219,9 @@ void LLDrawPoolTerrain::renderFullShader() else { // Use materials - sShader = &gDeferredPBRTerrainProgram; + U32 paint_type = use_local_materials ? gLocalTerrainMaterials.getPaintType() : compp->getPaintType(); + paint_type = llclamp(paint_type, 0, TERRAIN_PAINT_TYPE_COUNT); + sShader = &gDeferredPBRTerrainProgram[paint_type]; sShader->bind(); renderFullShaderPBR(use_local_materials); } @@ -326,7 +328,7 @@ void LLDrawPoolTerrain::renderFullShaderTextures() } // *TODO: Investigate use of bindFast for PBR terrain textures -void LLDrawPoolTerrain::renderFullShaderPBR(bool local_materials) +void LLDrawPoolTerrain::renderFullShaderPBR(bool use_local_materials) { // Hack! Get the region that this draw pool is rendering from! LLViewerRegion *regionp = mDrawFace[0]->getDrawable()->getVObj()->getRegion(); @@ -339,7 +341,7 @@ void LLDrawPoolTerrain::renderFullShaderPBR(bool local_materials) llassert(shader_material_count == terrain_material_count); #endif - if (local_materials) + if (use_local_materials) { // Override region terrain with the global local override terrain fetched_materials = &gLocalTerrainMaterials.mDetailRenderMaterials; @@ -351,6 +353,9 @@ void LLDrawPoolTerrain::renderFullShaderPBR(bool local_materials) if (!materials[i]) { materials[i] = &LLGLTFMaterial::sDefault; } } + U32 paint_type = use_local_materials ? gLocalTerrainMaterials.getPaintType() : compp->getPaintType(); + paint_type = llclamp(paint_type, 0, TERRAIN_PAINT_TYPE_COUNT); + S32 detail_basecolor[terrain_material_count]; S32 detail_normal[terrain_material_count]; S32 detail_metalrough[terrain_material_count]; @@ -481,11 +486,31 @@ void LLDrawPoolTerrain::renderFullShaderPBR(bool local_materials) LLSettingsWater::ptr_t pwater = LLEnvironment::instance().getCurrentWater(); // - // Alpha Ramp + // Alpha Ramp or paint map // - S32 alpha_ramp = sShader->enableTexture(LLViewerShaderMgr::TERRAIN_ALPHARAMP); - gGL.getTexUnit(alpha_ramp)->bind(m2DAlphaRampImagep); - gGL.getTexUnit(alpha_ramp)->setTextureAddressMode(LLTexUnit::TAM_CLAMP); + S32 alpha_ramp = -1; + S32 paint_map = -1; + if (paint_type == TERRAIN_PAINT_TYPE_HEIGHTMAP_WITH_NOISE) + { + alpha_ramp = sShader->enableTexture(LLViewerShaderMgr::TERRAIN_ALPHARAMP); + gGL.getTexUnit(alpha_ramp)->bind(m2DAlphaRampImagep); + gGL.getTexUnit(alpha_ramp)->setTextureAddressMode(LLTexUnit::TAM_CLAMP); + } + else if (paint_type == TERRAIN_PAINT_TYPE_PBR_PAINTMAP) + { + paint_map = sShader->enableTexture(LLViewerShaderMgr::TERRAIN_PAINTMAP); + LLViewerTexture* tex_paint_map = use_local_materials ? gLocalTerrainMaterials.getPaintMap() : compp->getPaintMap(); + // If no paintmap is available, fall back to rendering just material slot 1 (by binding the appropriate image) + if (!tex_paint_map) { tex_paint_map = LLViewerTexture::sBlackImagep.get(); } + // This is a paint map for four materials, but we save a channel by + // storing the paintmap as the "difference" between slot 1 and the + // other 3 slots. + llassert(tex_paint_map->getComponents() == 3); + gGL.getTexUnit(paint_map)->bind(tex_paint_map); + gGL.getTexUnit(paint_map)->setTextureAddressMode(LLTexUnit::TAM_CLAMP); + + shader->uniform1f(LLShaderMgr::REGION_SCALE, regionp->getWidth()); + } // // GLTF uniforms @@ -534,11 +559,22 @@ void LLDrawPoolTerrain::renderFullShaderPBR(bool local_materials) // Disable multitexture - sShader->disableTexture(LLViewerShaderMgr::TERRAIN_ALPHARAMP); + if (paint_type == TERRAIN_PAINT_TYPE_HEIGHTMAP_WITH_NOISE) + { + sShader->disableTexture(LLViewerShaderMgr::TERRAIN_ALPHARAMP); - gGL.getTexUnit(alpha_ramp)->unbind(LLTexUnit::TT_TEXTURE); - gGL.getTexUnit(alpha_ramp)->disable(); - gGL.getTexUnit(alpha_ramp)->activate(); + gGL.getTexUnit(alpha_ramp)->unbind(LLTexUnit::TT_TEXTURE); + gGL.getTexUnit(alpha_ramp)->disable(); + gGL.getTexUnit(alpha_ramp)->activate(); + } + else if (paint_type == TERRAIN_PAINT_TYPE_PBR_PAINTMAP) + { + sShader->disableTexture(LLViewerShaderMgr::TERRAIN_PAINTMAP); + + gGL.getTexUnit(paint_map)->unbind(LLTexUnit::TT_TEXTURE); + gGL.getTexUnit(paint_map)->disable(); + gGL.getTexUnit(paint_map)->activate(); + } for (U32 i = 0; i < terrain_material_count; ++i) { diff --git a/indra/newview/lldrawpoolterrain.h b/indra/newview/lldrawpoolterrain.h index a8097fb58b..5380463d01 100644 --- a/indra/newview/lldrawpoolterrain.h +++ b/indra/newview/lldrawpoolterrain.h @@ -38,7 +38,6 @@ public: VERTEX_DATA_MASK = LLVertexBuffer::MAP_VERTEX | LLVertexBuffer::MAP_NORMAL | LLVertexBuffer::MAP_TANGENT | // Only PBR terrain uses this currently - LLVertexBuffer::MAP_TEXCOORD0 | LLVertexBuffer::MAP_TEXCOORD1 }; @@ -80,7 +79,7 @@ protected: void renderFull4TU(); void renderFullShader(); void renderFullShaderTextures(); - void renderFullShaderPBR(bool local_materials = false); + void renderFullShaderPBR(bool use_local_materials = false); void drawLoop(); private: diff --git a/indra/newview/llsurface.h b/indra/newview/llsurface.h index 68295225b6..10a104730b 100644 --- a/indra/newview/llsurface.h +++ b/indra/newview/llsurface.h @@ -110,6 +110,7 @@ public: LLSurfacePatch *resolvePatchRegion(const F32 x, const F32 y) const; LLSurfacePatch *resolvePatchRegion(const LLVector3 &position_region) const; LLSurfacePatch *resolvePatchGlobal(const LLVector3d &position_global) const; + LLSurfacePatch *getPatch(const S32 x, const S32 y) const; // Update methods (called during idle, normally) template @@ -176,8 +177,6 @@ protected: void createPatchData(); // Allocates memory for patches. void destroyPatchData(); // Deallocates memory for patches. - LLSurfacePatch *getPatch(const S32 x, const S32 y) const; - protected: LLVector3d mOriginGlobal; // In absolute frame LLSurfacePatch *mPatchList; // Array of all patches diff --git a/indra/newview/llsurfacepatch.cpp b/indra/newview/llsurfacepatch.cpp index 0550889a9b..4315c4c6b0 100644 --- a/indra/newview/llsurfacepatch.cpp +++ b/indra/newview/llsurfacepatch.cpp @@ -201,13 +201,13 @@ LLVector2 LLSurfacePatch::getTexCoords(const U32 x, const U32 y) const void LLSurfacePatch::eval(const U32 x, const U32 y, const U32 stride, LLVector3 *vertex, LLVector3 *normal, - LLVector2 *tex0, LLVector2 *tex1) + LLVector2 *tex1) const { if (!mSurfacep || !mSurfacep->getRegion() || !mSurfacep->getGridsPerEdge() || !mVObjp) { return; // failsafe } - llassert_always(vertex && normal && tex0 && tex1); + llassert_always(vertex && normal && tex1); U32 surface_stride = mSurfacep->getGridsPerEdge(); U32 point_offset = x + y*surface_stride; @@ -220,12 +220,6 @@ void LLSurfacePatch::eval(const U32 x, const U32 y, const U32 stride, LLVector3 pos_agent.mV[VZ] = *(mDataZ + point_offset); *vertex = pos_agent-mVObjp->getRegion()->getOriginAgent(); - LLVector3 rel_pos = pos_agent - mSurfacep->getOriginAgent(); - // *NOTE: Only PBR terrain uses the UVs right now. Texture terrain just ignores it. - // *NOTE: In the future, UVs and horizontal position will no longer have a 1:1 relationship for PBR terrain - LLVector3 tex_pos = rel_pos; - tex0->mV[0] = tex_pos.mV[0]; - tex0->mV[1] = tex_pos.mV[1]; tex1->mV[0] = mSurfacep->getRegion()->getCompositionXY(llfloor(mOriginRegion.mV[0])+x, llfloor(mOriginRegion.mV[1])+y); const F32 xyScale = 4.9215f*7.f; //0.93284f; diff --git a/indra/newview/llsurfacepatch.h b/indra/newview/llsurfacepatch.h index 195250d2c0..f4831487c1 100644 --- a/indra/newview/llsurfacepatch.h +++ b/indra/newview/llsurfacepatch.h @@ -116,7 +116,7 @@ public: void calcNormalFlat(LLVector3& normal_out, const U32 x, const U32 y, const U32 index /* 0 or 1 */); void eval(const U32 x, const U32 y, const U32 stride, - LLVector3 *vertex, LLVector3 *normal, LLVector2 *tex0, LLVector2 *tex1); + LLVector3 *vertex, LLVector3 *normal, LLVector2 *tex1) const; @@ -146,6 +146,8 @@ public: void dirty(); // Mark this surface patch as dirty... void clearDirty() { mDirty = false; } + bool isHeightsGenerated() const { return mHeightsGenerated; } + void clearVObj(); public: diff --git a/indra/newview/llterrainpaintmap.cpp b/indra/newview/llterrainpaintmap.cpp new file mode 100644 index 0000000000..4381d14546 --- /dev/null +++ b/indra/newview/llterrainpaintmap.cpp @@ -0,0 +1,285 @@ +/** + * @file llterrainpaintmap.cpp + * @brief Utilities for managing terrain paint maps + * + * $LicenseInfo:firstyear=2001&license=viewerlgpl$ + * Second Life Viewer Source Code + * Copyright (C) 2024, 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 "llterrainpaintmap.h" + +#include "llviewerprecompiledheaders.h" + +// library includes +#include "llglslshader.h" +#include "llrendertarget.h" +#include "llvertexbuffer.h" + +// newview includes +#include "llrender.h" +#include "llsurface.h" +#include "llsurfacepatch.h" +#include "llviewercamera.h" +#include "llviewerregion.h" +#include "llviewershadermgr.h" +#include "llviewertexture.h" + +// static +bool LLTerrainPaintMap::bakeHeightNoiseIntoPBRPaintMapRGB(const LLViewerRegion& region, LLViewerTexture& tex) +{ + llassert(tex.getComponents() == 3); + llassert(tex.getWidth() > 0 && tex.getHeight() > 0); + llassert(tex.getWidth() == tex.getHeight()); + llassert(tex.getPrimaryFormat() == GL_RGB); + llassert(tex.getGLTexture()); + + const LLSurface& surface = region.getLand(); + const U32 patch_count = surface.getPatchesPerEdge(); + + // *TODO: mHeightsGenerated isn't guaranteed to be true. Assume terrain is + // loaded for now. Would be nice to fix the loading issue or find a better + // heuristic to determine that the terrain is sufficiently loaded. +#if 0 + // Don't proceed if the region heightmap isn't loaded + for (U32 rj = 0; rj < patch_count; ++rj) + { + for (U32 ri = 0; ri < patch_count; ++ri) + { + const LLSurfacePatch* patch = surface.getPatch(ri, rj); + if (!patch->isHeightsGenerated()) + { + LL_WARNS() << "Region heightmap not fully loaded" << LL_ENDL; + return false; + } + } + } +#endif + + // Bind the debug shader and render terrain to tex + // Use a scratch render target because its dimensions may exceed the standard bake target, and this is a one-off bake + LLRenderTarget scratch_target; + const S32 dim = llmin(tex.getWidth(), tex.getHeight()); + scratch_target.allocate(dim, dim, GL_RGB, false, LLTexUnit::eTextureType::TT_TEXTURE, + LLTexUnit::eTextureMipGeneration::TMG_NONE); + if (!scratch_target.isComplete()) + { + llassert(false); + LL_WARNS() << "Failed to allocate render target" << LL_ENDL; + return false; + } + gGL.getTexUnit(0)->disable(); + stop_glerror(); + + scratch_target.bindTarget(); + glClearColor(0, 0, 0, 0); + scratch_target.clear(); + + // Render terrain heightmap to paint map via shader + + // Set up viewport, camera, and orthographic projection matrix. Position + // the camera such that the camera points straight down, and the region + // completely covers the "screen". Since orthographic projection does not + // distort, we arbitrarily choose the near plane and far plane to cover the + // full span of region heights, plus a small amount of padding to account + // for rounding errors. + const F32 region_width = region.getWidth(); + const F32 region_half_width = region_width / 2.0f; + const F32 region_camera_height = surface.getMaxZ() + DEFAULT_NEAR_PLANE; + LLViewerCamera camera; + const LLVector3 region_center = LLVector3(region_half_width, region_half_width, 0.0) + region.getOriginAgent(); + const LLVector3 camera_origin = LLVector3(0.0f, 0.0f, region_camera_height) + region_center; + camera.lookAt(camera_origin, region_center, LLVector3::y_axis); + camera.setAspect(F32(scratch_target.getHeight()) / F32(scratch_target.getWidth())); + const LLRect texture_rect(0, scratch_target.getHeight(), scratch_target.getWidth(), 0); + glViewport(texture_rect.mLeft, texture_rect.mBottom, texture_rect.getWidth(), texture_rect.getHeight()); + // Manually get modelview matrix from camera orientation. + glh::matrix4f modelview((GLfloat *) OGL_TO_CFR_ROTATION); + GLfloat ogl_matrix[16]; + camera.getOpenGLTransform(ogl_matrix); + modelview *= glh::matrix4f(ogl_matrix); + gGL.matrixMode(LLRender::MM_MODELVIEW); + gGL.loadMatrix(modelview.m); + // Override the projection matrix from the camera + gGL.matrixMode(LLRender::MM_PROJECTION); + gGL.pushMatrix(); + gGL.loadIdentity(); + llassert(camera_origin.mV[VZ] >= surface.getMaxZ()); + const F32 region_high_near = camera_origin.mV[VZ] - surface.getMaxZ(); + constexpr F32 far_plane_delta = 0.25f; + const F32 region_low_far = camera_origin.mV[VZ] - surface.getMinZ() + far_plane_delta; + gGL.ortho(-region_half_width, region_half_width, -region_half_width, region_half_width, region_high_near, region_low_far); + // No need to call camera.setPerspective because we don't need the clip planes. It would be inaccurate due to the perspective rendering anyway. + + // Need to get the full resolution vertices in order to get an accurate + // paintmap. It's not sufficient to iterate over the surface patches, as + // they may be at lower LODs. + // The functionality here is a subset of + // LLVOSurfacePatch::getTerrainGeometry. Unlike said function, we don't + // care about stride length since we're always rendering at full + // resolution. We also don't care about normals/tangents because those + // don't contribute to the paintmap. + // *NOTE: The actual getTerrainGeometry fits the terrain vertices snugly + // under the 16-bit indices limit. For the sake of simplicity, that has not + // been replicated here. + std::vector> infos; + // Vertex and index counts adapted from LLVOSurfacePatch::getGeomSizesMain, + // with additional vertices added as we are including the north and east + // edges here. + const U32 patch_size = (U32)surface.getGridsPerPatchEdge(); + constexpr U32 stride = 1; + const U32 vert_size = (patch_size / stride) + 1; + const U32 n = vert_size * vert_size; + const U32 ni = 6 * (vert_size - 1) * (vert_size - 1); + const U32 region_vertices = n * patch_count * patch_count; + const U32 region_indices = ni * patch_count * patch_count; + if (LLGLSLShader::sCurBoundShaderPtr == nullptr) + { // make sure a shader is bound to satisfy mVertexBuffer->setBuffer + gDebugProgram.bind(); + } + LLPointer buf = new LLVertexBuffer(LLVertexBuffer::MAP_VERTEX | LLVertexBuffer::MAP_TEXCOORD1); + { + buf->allocateBuffer(region_vertices, region_indices*2); // hack double index count... TODO: find a better way to indicate 32-bit indices will be used + buf->setBuffer(); + U32 vertex_total = 0; + std::vector index_array(region_indices); + std::vector positions(region_vertices); + std::vector texcoords1(region_vertices); + auto idx = index_array.begin(); + auto pos = positions.begin(); + auto tex1 = texcoords1.begin(); + for (U32 rj = 0; rj < patch_count; ++rj) + { + for (U32 ri = 0; ri < patch_count; ++ri) + { + const U32 index_offset = vertex_total; + for (U32 j = 0; j < (vert_size - 1); ++j) + { + for (U32 i = 0; i < (vert_size - 1); ++i) + { + // y + // 2....3 + // ^ . . + // | 0....1 + // | + // -------> x + // + // triangle 1: 0,1,2 + // triangle 2: 1,3,2 + // 0: vert0 + // 1: vert0 + 1 + // 2: vert0 + vert_size + // 3: vert0 + vert_size + 1 + const U32 vert0 = index_offset + i + (j*vert_size); + *idx++ = vert0; + *idx++ = vert0 + 1; + *idx++ = vert0 + vert_size; + *idx++ = vert0 + 1; + *idx++ = vert0 + vert_size + 1; + *idx++ = vert0 + vert_size; + } + } + + const LLSurfacePatch* patch = surface.getPatch(ri, rj); + for (U32 j = 0; j < vert_size; ++j) + { + for (U32 i = 0; i < vert_size; ++i) + { + LLVector3 scratch3; + LLVector3 pos3; + LLVector2 tex1_temp; + patch->eval(i, j, stride, &pos3, &scratch3, &tex1_temp); + (*pos++).set(pos3.mV[VX], pos3.mV[VY], pos3.mV[VZ]); + *tex1++ = tex1_temp; + vertex_total++; + } + } + } + } + buf->setIndexData(index_array.data(), 0, (U32)index_array.size()); + buf->setPositionData(positions.data(), 0, (U32)positions.size()); + buf->setTexCoord1Data(texcoords1.data(), 0, (U32)texcoords1.size()); + buf->unmapBuffer(); + buf->unbind(); + } + + // Draw the region in agent space at full resolution + { + + LLGLSLShader::unbind(); + // *NOTE: A theoretical non-PBR terrain bake program would be + // *slightly* different, due the texture terrain shader not having an + // alpha ramp threshold (TERRAIN_RAMP_MIX_THRESHOLD) + LLGLSLShader& shader = gPBRTerrainBakeProgram; + shader.bind(); + + LLGLDisable stencil(GL_STENCIL_TEST); + LLGLDisable scissor(GL_SCISSOR_TEST); + LLGLEnable cull_face(GL_CULL_FACE); + LLGLDepthTest depth_test(GL_FALSE, GL_FALSE, GL_ALWAYS); + + S32 alpha_ramp = shader.enableTexture(LLViewerShaderMgr::TERRAIN_ALPHARAMP); + LLPointer alpha_ramp_texture = LLViewerTextureManager::getFetchedTexture(IMG_ALPHA_GRAD_2D); + gGL.getTexUnit(alpha_ramp)->bind(alpha_ramp_texture); + gGL.getTexUnit(alpha_ramp)->setTextureAddressMode(LLTexUnit::TAM_CLAMP); + + buf->setBuffer(); + for (U32 rj = 0; rj < patch_count; ++rj) + { + for (U32 ri = 0; ri < patch_count; ++ri) + { + const U32 patch_index = ri + (rj * patch_count); + const U32 index_offset = ni * patch_index; + const U32 vertex_offset = n * patch_index; + llassert(index_offset + ni <= region_indices); + llassert(vertex_offset + n <= region_vertices); + buf->drawRange(LLRender::TRIANGLES, vertex_offset, vertex_offset + n - 1, ni, index_offset); + } + } + + shader.disableTexture(LLViewerShaderMgr::TERRAIN_ALPHARAMP); + + gGL.getTexUnit(alpha_ramp)->unbind(LLTexUnit::TT_TEXTURE); + gGL.getTexUnit(alpha_ramp)->disable(); + gGL.getTexUnit(alpha_ramp)->activate(); + + shader.unbind(); + } + + gGL.matrixMode(LLRender::MM_PROJECTION); + gGL.popMatrix(); + + gGL.flush(); + LLVertexBuffer::unbind(); + // Final step: Copy the output to the terrain paintmap + const bool success = tex.getGLTexture()->setSubImageFromFrameBuffer(0, 0, 0, 0, dim, dim); + if (!success) + { + LL_WARNS() << "Failed to copy framebuffer to paintmap" << LL_ENDL; + } + glGenerateMipmap(GL_TEXTURE_2D); + stop_glerror(); + + scratch_target.flush(); + + LLGLSLShader::unbind(); + + return success; +} diff --git a/indra/newview/llterrainpaintmap.h b/indra/newview/llterrainpaintmap.h new file mode 100644 index 0000000000..66827862c5 --- /dev/null +++ b/indra/newview/llterrainpaintmap.h @@ -0,0 +1,42 @@ +/** + * @file llterrainpaintmap.h + * @brief Utilities for managing terrain paint maps + * + * $LicenseInfo:firstyear=2001&license=viewerlgpl$ + * Second Life Viewer Source Code + * Copyright (C) 2024, Linden Research, Inc. + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; + * version 2.1 of the License only. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + * + * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA + * $/LicenseInfo$ + */ + +#pragma once + +class LLViewerRegion; +class LLViewerTexture; + +class LLTerrainPaintMap +{ +public: + + // Convert a region's heightmap and composition into a paint map texture which + // approximates how the terrain would be rendered with the heightmap. + // In effect, this allows converting terrain of type TERRAIN_PAINT_TYPE_HEIGHTMAP_WITH_NOISE + // to type TERRAIN_PAINT_TYPE_PBR_PAINTMAP. + // Returns true if successful + static bool bakeHeightNoiseIntoPBRPaintMapRGB(const LLViewerRegion& region, LLViewerTexture& tex); +}; diff --git a/indra/newview/llviewercontrol.cpp b/indra/newview/llviewercontrol.cpp index 0e1f4c09c7..c1bf31ff9a 100644 --- a/indra/newview/llviewercontrol.cpp +++ b/indra/newview/llviewercontrol.cpp @@ -719,6 +719,8 @@ void handleLocalTerrainChanged(const LLSD& newValue) { gLocalTerrainMaterials.setMaterialOverride(i, mat_override); } + const bool paint_enabled = gSavedSettings.getBOOL("LocalTerrainPaintEnabled"); + gLocalTerrainMaterials.setPaintType(paint_enabled ? TERRAIN_PAINT_TYPE_PBR_PAINTMAP : TERRAIN_PAINT_TYPE_HEIGHTMAP_WITH_NOISE); } } //////////////////////////////////////////////////////////////////////////// @@ -909,6 +911,7 @@ void settings_setup_listeners() setting_setup_signal_listener(gSavedSettings, "AutoTuneImpostorByDistEnabled", handleUserImpostorByDistEnabledChanged); setting_setup_signal_listener(gSavedSettings, "TuningFPSStrategy", handleFPSTuningStrategyChanged); { + setting_setup_signal_listener(gSavedSettings, "LocalTerrainPaintEnabled", handleLocalTerrainChanged); const char* transform_suffixes[] = { "ScaleU", "ScaleV", @@ -927,6 +930,7 @@ void settings_setup_listeners() } } } + setting_setup_signal_listener(gSavedSettings, "TerrainPaintBitDepth", handleSetShaderChanged); setting_setup_signal_listener(gSavedPerAccountSettings, "AvatarHoverOffsetZ", handleAvatarHoverOffsetChanged); } diff --git a/indra/newview/llviewermenu.cpp b/indra/newview/llviewermenu.cpp index 0c8dd6dff9..aa14820d55 100644 --- a/indra/newview/llviewermenu.cpp +++ b/indra/newview/llviewermenu.cpp @@ -42,6 +42,7 @@ #include "llnotifications.h" #include "llnotificationsutil.h" #include "llviewereventrecorder.h" +#include "v4coloru.h" // newview includes #include "llagent.h" @@ -105,6 +106,7 @@ #include "llsidepanelappearance.h" #include "llspellcheckmenuhandler.h" #include "llstatusbar.h" +#include "llterrainpaintmap.h" #include "lltextureview.h" #include "lltoolbarview.h" #include "lltoolcomp.h" @@ -122,6 +124,7 @@ #include "llviewerparcelmgr.h" #include "llviewerstats.h" #include "llviewerstatsrecorder.h" +#include "llvlcomposition.h" #include "llvoavatarself.h" #include "llvoicevivox.h" #include "llworld.h" @@ -1387,6 +1390,65 @@ class LLAdvancedResetInterestLists : public view_listener_t }; +///////////// +// TERRAIN // +///////////// + +class LLAdvancedRebuildTerrain : public view_listener_t +{ + bool handleEvent(const LLSD& userdata) + { + gPipeline.rebuildTerrain(); + return true; + } +}; + +class LLAdvancedTerrainCreateLocalPaintMap : public view_listener_t +{ + bool handleEvent(const LLSD& userdata) + { + LLViewerRegion* region = gAgent.getRegion(); + if (!region) + { + LL_WARNS() << "Agent not in a region" << LL_ENDL; + return false; + } + + U16 dim = (U16)gSavedSettings.getU32("TerrainPaintResolution"); + // Ensure a reasonable image size of power two + const U32 max_resolution = gSavedSettings.getU32("RenderMaxTextureResolution"); + dim = llclamp(dim, 16, max_resolution); + dim = 1 << U32(std::ceil(std::log2(dim))); + LLPointer image_raw = new LLImageRaw(dim,dim,3); + LLPointer tex = LLViewerTextureManager::getLocalTexture(image_raw.get(), true); + const bool success = LLTerrainPaintMap::bakeHeightNoiseIntoPBRPaintMapRGB(*region, *tex); + // This calls gLocalTerrainMaterials.setPaintType + gSavedSettings.setBOOL("LocalTerrainPaintEnabled", true); + // If baking the paintmap failed, set the paintmap to nullptr. This + // causes LLDrawPoolTerrain to use a blank paintmap instead. + if (!success) { tex = nullptr; } + gLocalTerrainMaterials.setPaintMap(tex); + + return true; + } +}; + +class LLAdvancedTerrainDeleteLocalPaintMap : public view_listener_t +{ + bool handleEvent(const LLSD& userdata) + { + // This calls gLocalTerrainMaterials.setPaintType + gSavedSettings.setBOOL("LocalTerrainPaintEnabled", false); + gLocalTerrainMaterials.setPaintMap(nullptr); + + return true; + } +}; + + +///////////// + + class LLAdvancedBuyCurrencyTest : public view_listener_t { bool handleEvent(const LLSD& userdata) @@ -2242,20 +2304,6 @@ class LLAdvancedPurgeShaderCache : public view_listener_t } }; -///////////////////// -// REBUILD TERRAIN // -///////////////////// - - -class LLAdvancedRebuildTerrain : public view_listener_t -{ - bool handleEvent(const LLSD& userdata) - { - gPipeline.rebuildTerrain(); - return true; - } -}; - //////////////////// // EVENT Recorder // /////////////////// @@ -9851,7 +9899,6 @@ void initialize_menus() view_listener_t::addMenu(new LLAdvancedClickGLTFEdit(), "Advanced.ClickGLTFEdit"); view_listener_t::addMenu(new LLAdvancedClickResizeWindow(), "Advanced.ClickResizeWindow"); view_listener_t::addMenu(new LLAdvancedPurgeShaderCache(), "Advanced.ClearShaderCache"); - view_listener_t::addMenu(new LLAdvancedRebuildTerrain(), "Advanced.RebuildTerrain"); #ifdef TOGGLE_HACKED_GODLIKE_VIEWER view_listener_t::addMenu(new LLAdvancedHandleToggleHackedGodmode(), "Advanced.HandleToggleHackedGodmode"); @@ -9868,6 +9915,11 @@ void initialize_menus() view_listener_t::addMenu(new LLAdvancedCheckInterestList360Mode(), "Advanced.CheckInterestList360Mode"); view_listener_t::addMenu(new LLAdvancedResetInterestLists(), "Advanced.ResetInterestLists"); + // Develop > Terrain + view_listener_t::addMenu(new LLAdvancedRebuildTerrain(), "Advanced.RebuildTerrain"); + view_listener_t::addMenu(new LLAdvancedTerrainCreateLocalPaintMap(), "Advanced.TerrainCreateLocalPaintMap"); + view_listener_t::addMenu(new LLAdvancedTerrainDeleteLocalPaintMap(), "Advanced.TerrainDeleteLocalPaintMap"); + // Advanced > UI commit.add("Advanced.WebBrowserTest", boost::bind(&handle_web_browser_test, _2)); // sigh! this one opens the MEDIA browser commit.add("Advanced.WebContentTest", boost::bind(&handle_web_content_test, _2)); // this one opens the Web Content floater diff --git a/indra/newview/llviewershadermgr.cpp b/indra/newview/llviewershadermgr.cpp index 96354ea18f..073a1787d5 100644 --- a/indra/newview/llviewershadermgr.cpp +++ b/indra/newview/llviewershadermgr.cpp @@ -100,6 +100,7 @@ LLGLSLShader gBenchmarkProgram; LLGLSLShader gReflectionProbeDisplayProgram; LLGLSLShader gCopyProgram; LLGLSLShader gCopyDepthProgram; +LLGLSLShader gPBRTerrainBakeProgram; //object shaders LLGLSLShader gObjectPreviewProgram; @@ -226,7 +227,7 @@ LLGLSLShader gDeferredSkinnedPBROpaqueProgram; LLGLSLShader gHUDPBRAlphaProgram; LLGLSLShader gDeferredPBRAlphaProgram; LLGLSLShader gDeferredSkinnedPBRAlphaProgram; -LLGLSLShader gDeferredPBRTerrainProgram; +LLGLSLShader gDeferredPBRTerrainProgram[TERRAIN_PAINT_TYPE_COUNT]; LLGLSLShader gGLTFPBRMetallicRoughnessProgram; @@ -432,7 +433,10 @@ void LLViewerShaderMgr::finalizeShaderList() mShaderList.push_back(&gGLTFPBRMetallicRoughnessProgram); mShaderList.push_back(&gDeferredAvatarProgram); mShaderList.push_back(&gDeferredTerrainProgram); - mShaderList.push_back(&gDeferredPBRTerrainProgram); + for (U32 paint_type = 0; paint_type < TERRAIN_PAINT_TYPE_COUNT; ++paint_type) + { + mShaderList.push_back(&gDeferredPBRTerrainProgram[paint_type]); + } mShaderList.push_back(&gDeferredDiffuseAlphaMaskProgram); mShaderList.push_back(&gDeferredNonIndexedDiffuseAlphaMaskProgram); mShaderList.push_back(&gDeferredTreeProgram); @@ -1129,7 +1133,10 @@ bool LLViewerShaderMgr::loadShadersDeferred() gDeferredSkinnedPBROpaqueProgram.unload(); gDeferredPBRAlphaProgram.unload(); gDeferredSkinnedPBRAlphaProgram.unload(); - gDeferredPBRTerrainProgram.unload(); + for (U32 paint_type = 0; paint_type < TERRAIN_PAINT_TYPE_COUNT; ++paint_type) + { + gDeferredPBRTerrainProgram[paint_type].unload(); + } return true; } @@ -1443,25 +1450,31 @@ bool LLViewerShaderMgr::loadShadersDeferred() S32 detail = gSavedSettings.getS32("RenderTerrainPBRDetail"); detail = llclamp(detail, TERRAIN_PBR_DETAIL_MIN, TERRAIN_PBR_DETAIL_MAX); const S32 mapping = clamp_terrain_mapping(gSavedSettings.getS32("RenderTerrainPBRPlanarSampleCount")); - gDeferredPBRTerrainProgram.mName = llformat("Deferred PBR Terrain Shader %d %s", - detail, - (mapping == 1 ? "flat" : "triplanar")); - gDeferredPBRTerrainProgram.mFeatures.hasSrgb = true; - gDeferredPBRTerrainProgram.mFeatures.isAlphaLighting = true; - gDeferredPBRTerrainProgram.mFeatures.calculatesAtmospherics = true; - gDeferredPBRTerrainProgram.mFeatures.hasAtmospherics = true; - gDeferredPBRTerrainProgram.mFeatures.hasGamma = true; - gDeferredPBRTerrainProgram.mFeatures.hasTransport = true; - gDeferredPBRTerrainProgram.mFeatures.isPBRTerrain = true; + for (U32 paint_type = 0; paint_type < TERRAIN_PAINT_TYPE_COUNT; ++paint_type) + { + LLGLSLShader* shader = &gDeferredPBRTerrainProgram[paint_type]; + shader->mName = llformat("Deferred PBR Terrain Shader %d %s %s", + detail, + (paint_type == TERRAIN_PAINT_TYPE_PBR_PAINTMAP ? "paintmap" : "heightmap-with-noise"), + (mapping == 1 ? "flat" : "triplanar")); + shader->mFeatures.hasSrgb = true; + shader->mFeatures.isAlphaLighting = true; + shader->mFeatures.calculatesAtmospherics = true; + shader->mFeatures.hasAtmospherics = true; + shader->mFeatures.hasGamma = true; + shader->mFeatures.hasTransport = true; + shader->mFeatures.isPBRTerrain = true; - gDeferredPBRTerrainProgram.mShaderFiles.clear(); - gDeferredPBRTerrainProgram.mShaderFiles.push_back(make_pair("deferred/pbrterrainV.glsl", GL_VERTEX_SHADER)); - gDeferredPBRTerrainProgram.mShaderFiles.push_back(make_pair("deferred/pbrterrainF.glsl", GL_FRAGMENT_SHADER)); - gDeferredPBRTerrainProgram.mShaderLevel = mShaderLevel[SHADER_DEFERRED]; - gDeferredPBRTerrainProgram.addPermutation("TERRAIN_PBR_DETAIL", llformat("%d", detail)); - gDeferredPBRTerrainProgram.addPermutation("TERRAIN_PLANAR_TEXTURE_SAMPLE_COUNT", llformat("%d", mapping)); - success = gDeferredPBRTerrainProgram.createShader(); - llassert(success); + shader->mShaderFiles.clear(); + shader->mShaderFiles.push_back(make_pair("deferred/pbrterrainV.glsl", GL_VERTEX_SHADER)); + shader->mShaderFiles.push_back(make_pair("deferred/pbrterrainF.glsl", GL_FRAGMENT_SHADER)); + shader->mShaderLevel = mShaderLevel[SHADER_DEFERRED]; + shader->addPermutation("TERRAIN_PBR_DETAIL", llformat("%d", detail)); + shader->addPermutation("TERRAIN_PAINT_TYPE", llformat("%d", paint_type)); + shader->addPermutation("TERRAIN_PLANAR_TEXTURE_SAMPLE_COUNT", llformat("%d", mapping)); + success = success && shader->createShader(); + llassert(success); + } } if (success) @@ -2957,6 +2970,25 @@ bool LLViewerShaderMgr::loadShadersInterface() success = gCopyDepthProgram.createShader(); } + if (success) + { + LLGLSLShader* shader = &gPBRTerrainBakeProgram; + U32 bit_depth = gSavedSettings.getU32("TerrainPaintBitDepth"); + // LLTerrainPaintMap currently uses an RGB8 texture internally + bit_depth = llclamp(bit_depth, 1, 8); + shader->mName = llformat("Terrain Bake Shader RGB%o", bit_depth); + shader->mFeatures.isPBRTerrain = true; + + shader->mShaderFiles.clear(); + shader->mShaderFiles.push_back(make_pair("interface/pbrTerrainBakeV.glsl", GL_VERTEX_SHADER)); + shader->mShaderFiles.push_back(make_pair("interface/pbrTerrainBakeF.glsl", GL_FRAGMENT_SHADER)); + shader->mShaderLevel = mShaderLevel[SHADER_INTERFACE]; + const U32 value_range = (1 << bit_depth) - 1; + shader->addPermutation("TERRAIN_PAINT_PRECISION", llformat("%d", value_range)); + success = success && shader->createShader(); + llassert(success); + } + if (success) { gAlphaMaskProgram.mName = "Alpha Mask Shader"; diff --git a/indra/newview/llviewershadermgr.h b/indra/newview/llviewershadermgr.h index 60ce8c430b..af47014a43 100644 --- a/indra/newview/llviewershadermgr.h +++ b/indra/newview/llviewershadermgr.h @@ -174,6 +174,7 @@ extern LLGLSLShader gBenchmarkProgram; extern LLGLSLShader gReflectionProbeDisplayProgram; extern LLGLSLShader gCopyProgram; extern LLGLSLShader gCopyDepthProgram; +extern LLGLSLShader gPBRTerrainBakeProgram; //output tex0[tc0] - tex1[tc1] extern LLGLSLShader gTwoTextureCompareProgram; @@ -304,5 +305,13 @@ enum TerrainPBRDetail : S32 TERRAIN_PBR_DETAIL_BASE_COLOR = -4, TERRAIN_PBR_DETAIL_MIN = -4, }; -extern LLGLSLShader gDeferredPBRTerrainProgram; +enum TerrainPaintType : U32 +{ + // Use LLVLComposition::mDatap (heightmap) generated by generateHeights, plus noise from TERRAIN_ALPHARAMP + TERRAIN_PAINT_TYPE_HEIGHTMAP_WITH_NOISE = 0, + // Use paint map if PBR terrain, otherwise fall back to TERRAIN_PAINT_TYPE_HEIGHTMAP_WITH_NOISE + TERRAIN_PAINT_TYPE_PBR_PAINTMAP = 1, + TERRAIN_PAINT_TYPE_COUNT = 2, +}; +extern LLGLSLShader gDeferredPBRTerrainProgram[TERRAIN_PAINT_TYPE_COUNT]; #endif diff --git a/indra/newview/llviewertexture.cpp b/indra/newview/llviewertexture.cpp index 9648a9af18..1369e3d306 100644 --- a/indra/newview/llviewertexture.cpp +++ b/indra/newview/llviewertexture.cpp @@ -42,6 +42,7 @@ #include "llstl.h" #include "message.h" #include "lltimer.h" +#include "v4coloru.h" // viewer includes #include "llimagegl.h" diff --git a/indra/newview/llvlcomposition.cpp b/indra/newview/llvlcomposition.cpp index f5f058a080..077e6e6cb1 100644 --- a/indra/newview/llvlcomposition.cpp +++ b/indra/newview/llvlcomposition.cpp @@ -312,6 +312,17 @@ bool LLTerrainMaterials::makeMaterialsReady(bool boost, bool strict) return one_ready; } +LLViewerTexture* LLTerrainMaterials::getPaintMap() +{ + return mPaintMap.get(); +} + +void LLTerrainMaterials::setPaintMap(LLViewerTexture* paint_map) +{ + llassert(!paint_map || mPaintType == TERRAIN_PAINT_TYPE_PBR_PAINTMAP); + mPaintMap = paint_map; +} + // Boost the texture loading priority // Return true when ready to use (i.e. texture is sufficiently loaded) // static diff --git a/indra/newview/llvlcomposition.h b/indra/newview/llvlcomposition.h index 2637d77183..f15f9bff6a 100644 --- a/indra/newview/llvlcomposition.h +++ b/indra/newview/llvlcomposition.h @@ -28,6 +28,8 @@ #define LL_LLVLCOMPOSITION_H #include "llviewerlayer.h" +#include "llviewershadermgr.h" +#include "llviewertexture.h" #include "llpointer.h" #include "llimage.h" @@ -44,6 +46,7 @@ public: virtual const LLGLTFMaterial* getMaterialOverride(S32 asset) const = 0; }; +// The subset of the composition used by local terrain debug materials (gLocalTerrainMaterials) class LLTerrainMaterials : public LLModifyRegion { public: @@ -79,6 +82,12 @@ public: // strict = false -> at least one material must be loaded bool makeMaterialsReady(bool boost, bool strict); + // See TerrainPaintType + U32 getPaintType() const { return mPaintType; } + void setPaintType(U32 paint_type) { mPaintType = paint_type; } + LLViewerTexture* getPaintMap(); + void setPaintMap(LLViewerTexture* paint_map); + protected: void unboost(); static bool makeTextureReady(LLPointer& tex, bool boost); @@ -93,6 +102,9 @@ protected: LLPointer mDetailMaterialOverrides[ASSET_COUNT]; LLPointer mDetailRenderMaterials[ASSET_COUNT]; bool mMaterialTexturesSet[ASSET_COUNT]; + + U32 mPaintType = TERRAIN_PAINT_TYPE_HEIGHTMAP_WITH_NOISE; + LLPointer mPaintMap; }; // Local materials to override all regions diff --git a/indra/newview/llvosurfacepatch.cpp b/indra/newview/llvosurfacepatch.cpp index 471174cf5d..b76717e660 100644 --- a/indra/newview/llvosurfacepatch.cpp +++ b/indra/newview/llvosurfacepatch.cpp @@ -245,7 +245,6 @@ bool LLVOSurfacePatch::updateLOD() void LLVOSurfacePatch::getTerrainGeometry(LLStrider &verticesp, LLStrider &normalsp, - LLStrider &texCoords0p, LLStrider &texCoords1p, LLStrider &indicesp) { @@ -260,21 +259,18 @@ void LLVOSurfacePatch::getTerrainGeometry(LLStrider &verticesp, updateMainGeometry(facep, verticesp, normalsp, - texCoords0p, texCoords1p, indicesp, index_offset); updateNorthGeometry(facep, verticesp, normalsp, - texCoords0p, texCoords1p, indicesp, index_offset); updateEastGeometry(facep, verticesp, normalsp, - texCoords0p, texCoords1p, indicesp, index_offset); @@ -283,7 +279,6 @@ void LLVOSurfacePatch::getTerrainGeometry(LLStrider &verticesp, void LLVOSurfacePatch::updateMainGeometry(LLFace *facep, LLStrider &verticesp, LLStrider &normalsp, - LLStrider &texCoords0p, LLStrider &texCoords1p, LLStrider &indicesp, U32 &index_offset) @@ -322,10 +317,9 @@ void LLVOSurfacePatch::updateMainGeometry(LLFace *facep, { x = i * render_stride; y = j * render_stride; - mPatchp->eval(x, y, render_stride, verticesp.get(), normalsp.get(), texCoords0p.get(), texCoords1p.get()); + mPatchp->eval(x, y, render_stride, verticesp.get(), normalsp.get(), texCoords1p.get()); verticesp++; normalsp++; - texCoords0p++; texCoords1p++; } } @@ -387,7 +381,6 @@ void LLVOSurfacePatch::updateMainGeometry(LLFace *facep, void LLVOSurfacePatch::updateNorthGeometry(LLFace *facep, LLStrider &verticesp, LLStrider &normalsp, - LLStrider &texCoords0p, LLStrider &texCoords1p, LLStrider &indicesp, U32 &index_offset) @@ -421,10 +414,9 @@ void LLVOSurfacePatch::updateNorthGeometry(LLFace *facep, x = i * render_stride; y = 16 - render_stride; - mPatchp->eval(x, y, render_stride, verticesp.get(), normalsp.get(), texCoords0p.get(), texCoords1p.get()); + mPatchp->eval(x, y, render_stride, verticesp.get(), normalsp.get(), texCoords1p.get()); verticesp++; normalsp++; - texCoords0p++; texCoords1p++; } @@ -433,10 +425,9 @@ void LLVOSurfacePatch::updateNorthGeometry(LLFace *facep, { x = i * render_stride; y = 16; - mPatchp->eval(x, y, render_stride, verticesp.get(), normalsp.get(), texCoords0p.get(), texCoords1p.get()); + mPatchp->eval(x, y, render_stride, verticesp.get(), normalsp.get(), texCoords1p.get()); verticesp++; normalsp++; - texCoords0p++; texCoords1p++; } @@ -469,10 +460,9 @@ void LLVOSurfacePatch::updateNorthGeometry(LLFace *facep, x = i * render_stride; y = 16 - render_stride; - mPatchp->eval(x, y, render_stride, verticesp.get(), normalsp.get(), texCoords0p.get(), texCoords1p.get()); + mPatchp->eval(x, y, render_stride, verticesp.get(), normalsp.get(), texCoords1p.get()); verticesp++; normalsp++; - texCoords0p++; texCoords1p++; } @@ -482,10 +472,9 @@ void LLVOSurfacePatch::updateNorthGeometry(LLFace *facep, x = i * render_stride; y = 16; - mPatchp->eval(x, y, render_stride, verticesp.get(), normalsp.get(), texCoords0p.get(), texCoords1p.get()); + mPatchp->eval(x, y, render_stride, verticesp.get(), normalsp.get(), texCoords1p.get()); verticesp++; normalsp++; - texCoords0p++; texCoords1p++; } @@ -525,10 +514,9 @@ void LLVOSurfacePatch::updateNorthGeometry(LLFace *facep, x = i * north_stride; y = 16 - render_stride; - mPatchp->eval(x, y, render_stride, verticesp.get(), normalsp.get(), texCoords0p.get(), texCoords1p.get()); + mPatchp->eval(x, y, render_stride, verticesp.get(), normalsp.get(), texCoords1p.get()); verticesp++; normalsp++; - texCoords0p++; texCoords1p++; } @@ -538,10 +526,9 @@ void LLVOSurfacePatch::updateNorthGeometry(LLFace *facep, x = i * north_stride; y = 16; - mPatchp->eval(x, y, render_stride, verticesp.get(), normalsp.get(), texCoords0p.get(), texCoords1p.get()); + mPatchp->eval(x, y, render_stride, verticesp.get(), normalsp.get(), texCoords1p.get()); verticesp++; normalsp++; - texCoords0p++; texCoords1p++; } @@ -577,7 +564,6 @@ void LLVOSurfacePatch::updateNorthGeometry(LLFace *facep, void LLVOSurfacePatch::updateEastGeometry(LLFace *facep, LLStrider &verticesp, LLStrider &normalsp, - LLStrider &texCoords0p, LLStrider &texCoords1p, LLStrider &indicesp, U32 &index_offset) @@ -606,10 +592,9 @@ void LLVOSurfacePatch::updateEastGeometry(LLFace *facep, x = 16 - render_stride; y = i * render_stride; - mPatchp->eval(x, y, render_stride, verticesp.get(), normalsp.get(), texCoords0p.get(), texCoords1p.get()); + mPatchp->eval(x, y, render_stride, verticesp.get(), normalsp.get(), texCoords1p.get()); verticesp++; normalsp++; - texCoords0p++; texCoords1p++; } @@ -618,10 +603,9 @@ void LLVOSurfacePatch::updateEastGeometry(LLFace *facep, { x = 16; y = i * render_stride; - mPatchp->eval(x, y, render_stride, verticesp.get(), normalsp.get(), texCoords0p.get(), texCoords1p.get()); + mPatchp->eval(x, y, render_stride, verticesp.get(), normalsp.get(), texCoords1p.get()); verticesp++; normalsp++; - texCoords0p++; texCoords1p++; } @@ -654,10 +638,9 @@ void LLVOSurfacePatch::updateEastGeometry(LLFace *facep, x = 16 - render_stride; y = i * render_stride; - mPatchp->eval(x, y, render_stride, verticesp.get(), normalsp.get(), texCoords0p.get(), texCoords1p.get()); + mPatchp->eval(x, y, render_stride, verticesp.get(), normalsp.get(), texCoords1p.get()); verticesp++; normalsp++; - texCoords0p++; texCoords1p++; } // Iterate through the east patch's points @@ -666,10 +649,9 @@ void LLVOSurfacePatch::updateEastGeometry(LLFace *facep, x = 16; y = i * render_stride; - mPatchp->eval(x, y, render_stride, verticesp.get(), normalsp.get(), texCoords0p.get(), texCoords1p.get()); + mPatchp->eval(x, y, render_stride, verticesp.get(), normalsp.get(), texCoords1p.get()); verticesp++; normalsp++; - texCoords0p++; texCoords1p++; } @@ -708,10 +690,9 @@ void LLVOSurfacePatch::updateEastGeometry(LLFace *facep, x = 16 - render_stride; y = i * east_stride; - mPatchp->eval(x, y, render_stride, verticesp.get(), normalsp.get(), texCoords0p.get(), texCoords1p.get()); + mPatchp->eval(x, y, render_stride, verticesp.get(), normalsp.get(), texCoords1p.get()); verticesp++; normalsp++; - texCoords0p++; texCoords1p++; } // Iterate through the east patch's points @@ -720,10 +701,9 @@ void LLVOSurfacePatch::updateEastGeometry(LLFace *facep, x = 16; y = i * east_stride; - mPatchp->eval(x, y, render_stride, verticesp.get(), normalsp.get(), texCoords0p.get(), texCoords1p.get()); + mPatchp->eval(x, y, render_stride, verticesp.get(), normalsp.get(), texCoords1p.get()); verticesp++; normalsp++; - texCoords0p++; texCoords1p++; } @@ -992,8 +972,8 @@ void gen_terrain_tangents(U16 strider_vertex_count, LLStrider &verticesp, LLStrider &normalsp, LLStrider &tangentsp, - LLStrider &texCoords0p, - LLStrider &indicesp) + LLStrider &indicesp, + F32 region_width) { LL_PROFILE_ZONE_SCOPED; @@ -1010,7 +990,10 @@ void gen_terrain_tangents(U16 strider_vertex_count, F32 *n = normalsp[v].mV; normals[v] = LLVector4a(n[0], n[1], n[2], 1.f); tangents[v] = tangentsp[v]; - texcoords[v] = texCoords0p[v]; + + // Calculate texcoords on-the-fly using the terrain positions + texcoords[v].mV[VX] = verticesp[v].mV[VX] / region_width; + texcoords[v].mV[VY] = verticesp[v].mV[VY] / region_width; } for (U32 i = 0; i < strider_index_count; ++i) { @@ -1039,14 +1022,12 @@ void LLTerrainPartition::getGeometry(LLSpatialGroup* group) LLStrider vertices_start; LLStrider normals_start; LLStrider tangents_start; - LLStrider texcoords_start; LLStrider texcoords2_start; LLStrider indices_start; llassert_always(buffer->getVertexStrider(vertices_start)); llassert_always(buffer->getNormalStrider(normals_start)); llassert_always(buffer->getTangentStrider(tangents_start)); - llassert_always(buffer->getTexCoord0Strider(texcoords_start)); llassert_always(buffer->getTexCoord1Strider(texcoords2_start)); llassert_always(buffer->getIndexStrider(indices_start)); @@ -1056,7 +1037,6 @@ void LLTerrainPartition::getGeometry(LLSpatialGroup* group) { LLStrider vertices = vertices_start; LLStrider normals = normals_start; - LLStrider texcoords = texcoords_start; LLStrider texcoords2 = texcoords2_start; LLStrider indices = indices_start; @@ -1069,7 +1049,7 @@ void LLTerrainPartition::getGeometry(LLSpatialGroup* group) facep->setVertexBuffer(buffer); LLVOSurfacePatch* patchp = (LLVOSurfacePatch*) facep->getViewerObject(); - patchp->getTerrainGeometry(vertices, normals, texcoords, texcoords2, indices); + patchp->getTerrainGeometry(vertices, normals, texcoords2, indices); indices_index += facep->getIndicesCount(); index_offset += facep->getGeomCount(); @@ -1082,10 +1062,20 @@ void LLTerrainPartition::getGeometry(LLSpatialGroup* group) LLStrider vertices = vertices_start; LLStrider normals = normals_start; LLStrider tangents = tangents_start; - LLStrider texcoords = texcoords_start; LLStrider indices = indices_start; - gen_terrain_tangents(index_offset, indices_index, vertices, normals, tangents, texcoords, indices); + F32 region_width = 256.0f; + if (mFaceList.empty()) + { + llassert(false); + } + else + { + const LLViewerRegion* regionp = mFaceList[0]->getViewerObject()->getRegion(); + llassert(regionp == mFaceList.back()->getViewerObject()->getRegion()); // Assume this spatial group is confined to one region + region_width = regionp->getWidth(); + } + gen_terrain_tangents(index_offset, indices_index, vertices, normals, tangents, indices, region_width); } buffer->unmapBuffer(); diff --git a/indra/newview/llvosurfacepatch.h b/indra/newview/llvosurfacepatch.h index 2780b97a97..af5f05774b 100644 --- a/indra/newview/llvosurfacepatch.h +++ b/indra/newview/llvosurfacepatch.h @@ -41,14 +41,6 @@ class LLVOSurfacePatch : public LLStaticViewerObject public: static F32 sLODFactor; - enum - { - VERTEX_DATA_MASK = (1 << LLVertexBuffer::TYPE_VERTEX) | - (1 << LLVertexBuffer::TYPE_NORMAL) | - (1 << LLVertexBuffer::TYPE_TEXCOORD0) | - (1 << LLVertexBuffer::TYPE_TEXCOORD1) - }; - LLVOSurfacePatch(const LLUUID &id, const LLPCode pcode, LLViewerRegion *regionp); /*virtual*/ void markDead(); @@ -65,7 +57,6 @@ public: /*virtual*/ void updateFaceSize(S32 idx); void getTerrainGeometry(LLStrider &verticesp, LLStrider &normalsp, - LLStrider &texCoords0p, LLStrider &texCoords1p, LLStrider &indicesp); @@ -118,21 +109,18 @@ protected: void updateMainGeometry(LLFace *facep, LLStrider &verticesp, LLStrider &normalsp, - LLStrider &texCoords0p, LLStrider &texCoords1p, LLStrider &indicesp, U32 &index_offset); void updateNorthGeometry(LLFace *facep, LLStrider &verticesp, LLStrider &normalsp, - LLStrider &texCoords0p, LLStrider &texCoords1p, LLStrider &indicesp, U32 &index_offset); void updateEastGeometry(LLFace *facep, LLStrider &verticesp, LLStrider &normalsp, - LLStrider &texCoords0p, LLStrider &texCoords1p, LLStrider &indicesp, U32 &index_offset); diff --git a/indra/newview/skins/default/xui/en/menu_viewer.xml b/indra/newview/skins/default/xui/en/menu_viewer.xml index 941f0c6bb7..98cf03b30e 100644 --- a/indra/newview/skins/default/xui/en/menu_viewer.xml +++ b/indra/newview/skins/default/xui/en/menu_viewer.xml @@ -3435,13 +3435,6 @@ function="World.EnvPreset" - - - + + + + + + + + + + + + + + + Date: Tue, 6 Aug 2024 16:30:50 -0700 Subject: secondlife/viewer#1883: Add informal documentation for how to use the local paintmap bake and compare it to the heightmap --- doc/testplans/pbr_terrain_paintmap.md | 48 +++++++++++++++++++++++++++++++++++ 1 file changed, 48 insertions(+) create mode 100644 doc/testplans/pbr_terrain_paintmap.md diff --git a/doc/testplans/pbr_terrain_paintmap.md b/doc/testplans/pbr_terrain_paintmap.md new file mode 100644 index 0000000000..0dab5fc2eb --- /dev/null +++ b/doc/testplans/pbr_terrain_paintmap.md @@ -0,0 +1,48 @@ +# PBR Terrain Paintmap + +## Introduction/Disclaimer + +As of 2024-08-06, PBR terrain painting is **WIP**. Currently, there is only a client-side terrain paintmap, with no way to directly edit it. This document will explain how to informally explore this feature and compare it to the existing heightmap with noise. In the future, a testing document will be added for PBR terrain painting. + +## Background + +Historically, PBR terrain in a region has several parameters for controlling its composition. These are: + +- The four materials +- The elevation of the terrain, which roughly controls the material, with some noise added on top ("heightmap with noise") +- Material Elevation Ranges, which control where the materials start and end + +This allows for some coarse control over terrain composition. For example, you can have one corner of the terrain be a sandy beach and the rest of the coastline be rocky. Or you can have the peaks of your mountains be covered with snow. However, artistic control is limited due to the gradient imposed by the material elevation ranges, and the unpredictability of the noise. + +A terrain painting option would allow for more control over the terrain composition. The first step to getting that working is the paintmap. + +## How to activate the local paintmap + +The local paintmap is a good way to assess the quality of the PBR terrain paintmap. By default, the newly created local paintmap inherits its composition (i.e. where the grass and dirt goes) from the existing terrain. This allows for a direct comparison with the terrain heightmap-with-noise shader. + +Activating the local paintmap is similar to [applying local PBR terrain via the debug settings](https://wiki.secondlife.com/wiki/PBR_Terrain#How_to_apply_PBR_Terrain), but with a couple extra steps. + +You will need: + +- Four fullperm PBR material items to copy UUIDs from +- A region with a good variation of elevations which showcase the four composition layers (no special permissions needed) + +Open the Debug Settings menu (Advanced > Show Debug Settings) and search for "terrain". The following relevant options are available: + +- LocalTerrainAsset1 +- LocalTerrainAsset1 +- LocalTerrainAsset3 +- LocalTerrainAsset4 +- LocalTerrainPaintEnabled +- TerrainPaintBitDepth +- TerrainPaintResolution + +By setting LocalTerrainAsset1, etc to valid material IDs, you will override the terrain to use those materials. + +The next step is to "bake" the terrain into a paintmap (Develop > Terrain > Create Local Paintmap). This will *automatically* set LocalTerrainPaintEnabled to true. **WARNING:** LocalTerrainPaintEnabled will *not* do anything until one of LocalTerrainAsset1, etc is set. + +You are now looking at the same terrain, but rendered as a paintmap. + +To compare the quality of the paintmap version and the heightmap-with-noise version, toggle LocalTerrainPaintEnabled in Debug Settings. + +To change the bit depth and/or resolution of the paintmap, change TerrainPaintBitDepth and TerrainPaintResolution as desired, then "re-bake" the paintmap (Develop > Terrain > Create Local Paintmap). -- cgit v1.2.3 From ece9cb8022d1c889bfd02ce52f0dd470460d5a21 Mon Sep 17 00:00:00 2001 From: Roxie Linden Date: Tue, 6 Aug 2024 18:41:46 -0700 Subject: Build an xcarchive for mac symbol upload. --- build.sh | 4 ++-- indra/llwebrtc/CMakeLists.txt | 2 +- indra/newview/CMakeLists.txt | 40 ++++++++++++++++------------------------ 3 files changed, 19 insertions(+), 27 deletions(-) diff --git a/build.sh b/build.sh index e09e6f9f5c..ab78b56515 100755 --- a/build.sh +++ b/build.sh @@ -526,8 +526,8 @@ then # nat 2016-12-22: without RELEASE_CRASH_REPORTING, we have no symbol file. if [ "${RELEASE_CRASH_REPORTING:-}" != "OFF" ] then - # e.g. build-darwin-x86_64/newview/Release/Second Life Test.sym.tar.gz - symbol_file="${build_dir}/newview/${variant}/${viewer_channel}.sym.tar.gz" + # e.g. build-darwin-x86_64/symbols/Release/Second Life Test.xarchive.zip + symbol_file="${build_dir}/symbols/${variant}/${viewer_channel}.xarchive.zip" if [[ ! -f "$symbol_file" ]] then # symbol tarball we prep for (e.g.) Breakpad diff --git a/indra/llwebrtc/CMakeLists.txt b/indra/llwebrtc/CMakeLists.txt index a8d23b461a..e7c7248b0c 100644 --- a/indra/llwebrtc/CMakeLists.txt +++ b/indra/llwebrtc/CMakeLists.txt @@ -42,7 +42,7 @@ if (WINDOWS) elseif (DARWIN) target_link_libraries(llwebrtc PRIVATE ll::webrtc) set_target_properties(llwebrtc PROPERTIES XCODE_ATTRIBUTE_DEBUG_INFORMATION_FORMAT "dwarf-with-dsym" - XCODE_ATTRIBUTE_DWARF_DSYM_FOLDER_PATH "${SYMBOLS_STAGING_DIR}") + XCODE_ATTRIBUTE_DWARF_DSYM_FOLDER_PATH "${SYMBOLS_STAGING_DIR}/${VIEWER_CHANNEL}/dSYMs") elseif (LINUX) target_link_libraries(llwebrtc PRIVATE ll::webrtc) endif (WINDOWS) diff --git a/indra/newview/CMakeLists.txt b/indra/newview/CMakeLists.txt index 8ff96f0f3b..000f2e2684 100644 --- a/indra/newview/CMakeLists.txt +++ b/indra/newview/CMakeLists.txt @@ -2085,8 +2085,8 @@ if (DARWIN) set(VIEWER_APP_BUNDLE "${CMAKE_CURRENT_BINARY_DIR}/$,$,>/${product}.app") set(VIEWER_APP_EXE "${VIEWER_APP_BUNDLE}/Contents/MacOS/${product}") - set(VIEWER_APP_DSYM "${VIEWER_APP_EXE}.dSYM") set(VIEWER_APP_SYMBOLS_ARCHIVE "${VIEWER_APP_BUNDLE}/../${product}.sym.tar.gz") + set(VIEWER_APP_XCARCHIVE "${SYMBOLS_STAGING_DIR}/${VIEWER_CHANNEL}.xcarchive.zip") configure_file( "${CMAKE_CURRENT_SOURCE_DIR}/Info-SecondLife.plist" @@ -2191,32 +2191,24 @@ if (PACKAGE AND (RELEASE_CRASH_REPORTING OR NON_RELEASE_CRASH_REPORTING) AND VIE add_dependencies(generate_symbols ${VIEWER_BINARY_NAME}) endif (WINDOWS) if (DARWIN) - set_target_properties(${VIEWER_BINARY_NAME} + # we only need an xcarchive with dSYMs (including the application) + set_target_properties(${VIEWER_BINARY_NAME} PROPERTIES XCODE_ATTRIBUTE_DEBUG_INFORMATION_FORMAT "dwarf-with-dsym" - XCODE_ATTRIBUTE_DWARF_DSYM_FOLDER_PATH "${SYMBOLS_STAGING_DIR}") - add_custom_command(OUTPUT "${VIEWER_APP_SYMBOLS_ARCHIVE}" - COMMAND "tar" - ARGS - "-cJf" - "${VIEWER_APP_SYMBOLS_ARCHIVE}" - "-C" - "${SYMBOLS_STAGING_DIR}" - "." - DEPENDS "${VIEWER_BINARY_NAME}" - COMMENT "Generating symbols archive for upload to BugSplat" - ) - # Have to create a stamp file, and depend on it, to force CMake to run - # the cleanup step. - add_custom_command(OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/dsym.stamp" - COMMAND rm -rf "${VIEWER_APP_DSYM}" - COMMAND touch "${CMAKE_CURRENT_BINARY_DIR}/dsym.stamp" - DEPENDS "${VIEWER_APP_SYMBOLS_ARCHIVE}" - COMMENT "Cleaning up symbols archive" - ) + XCODE_ATTRIBUTE_DWARF_DSYM_FOLDER_PATH "${SYMBOLS_STAGING_DIR}/${product}/dSYMs") + + add_custom_command(OUTPUT "${VIEWER_APP_XCARCHIVE}" + COMMAND "zip" + ARGS + "-r" + "${VIEWER_APP_XCARCHIVE}" + "${product}" + WORKING_DIRECTORY "${SYMBOLS_STAGING_DIR}" + DEPENDS "${VIEWER_BINARY_NAME}" llwebrtc + COMMENT "Generating ${VIEWER_APP_XCARCHIVE} for upload to BugSplat" + ) add_custom_target(generate_symbols DEPENDS - "${VIEWER_APP_SYMBOLS_ARCHIVE}" - "${CMAKE_CURRENT_BINARY_DIR}/dsym.stamp" + "${VIEWER_APP_XCARCHIVE}" ) endif (DARWIN) if (LINUX) -- cgit v1.2.3 From b6cd0cd7d0e3086c10c8d98deaeda65b7d95bcb4 Mon Sep 17 00:00:00 2001 From: Roxie Linden Date: Tue, 6 Aug 2024 19:43:26 -0700 Subject: misspelled xcarchive --- build.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build.sh b/build.sh index ab78b56515..2a2227657b 100755 --- a/build.sh +++ b/build.sh @@ -527,7 +527,7 @@ then if [ "${RELEASE_CRASH_REPORTING:-}" != "OFF" ] then # e.g. build-darwin-x86_64/symbols/Release/Second Life Test.xarchive.zip - symbol_file="${build_dir}/symbols/${variant}/${viewer_channel}.xarchive.zip" + symbol_file="${build_dir}/symbols/${variant}/${viewer_channel}.xcarchive.zip" if [[ ! -f "$symbol_file" ]] then # symbol tarball we prep for (e.g.) Breakpad -- cgit v1.2.3 From fc0e70e77b44a510ad1bf2a34fa04236aa4624a2 Mon Sep 17 00:00:00 2001 From: Roxie Linden Date: Tue, 6 Aug 2024 21:00:48 -0700 Subject: upload xcarchive to bugsplat --- .github/workflows/build.yaml | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index 21016c1015..c88a23b85e 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -395,10 +395,6 @@ jobs: uses: actions/download-artifact@v4 with: name: macOS-symbols - - name: Unpack Mac Symbols - run: | - mkdir _extracted - tar -xJf "${{ needs.build.outputs.viewer_channel }}.sym.tar.gz" -C _extracted - name: Post Mac Executable symbols if: env.BUGSPLAT_USER && env.BUGSPLAT_PASS uses: Bugsplat-Git/symbol-upload@v9.1.1 @@ -408,8 +404,8 @@ jobs: database: "SecondLife_Viewer_2018" application: ${{ needs.build.outputs.viewer_channel }} version: ${{ needs.build.outputs.viewer_version }} - directory: _extracted - files: "**/*.app.dSYM" + directory: . + files: "**/*.xcarchive.zip" - name: Post Mac Dylib symbols if: env.BUGSPLAT_USER && env.BUGSPLAT_PASS uses: Bugsplat-Git/symbol-upload@v9.1.1 -- cgit v1.2.3 From b5c9a30e3da8d75b3343a79ba64b7cc81da9991e Mon Sep 17 00:00:00 2001 From: Andrey Kleshchev Date: Tue, 6 Aug 2024 21:13:33 +0300 Subject: viewer#2203 Crash at breakVoiceConnectionCoro bar webrtc's coroutines from necromancy --- indra/newview/llvoicewebrtc.cpp | 69 +++++++++++++++++++++-------------------- indra/newview/llvoicewebrtc.h | 9 +++--- 2 files changed, 40 insertions(+), 38 deletions(-) diff --git a/indra/newview/llvoicewebrtc.cpp b/indra/newview/llvoicewebrtc.cpp index 3164886494..f5105f0ca1 100644 --- a/indra/newview/llvoicewebrtc.cpp +++ b/indra/newview/llvoicewebrtc.cpp @@ -459,6 +459,7 @@ void LLWebRTCVoiceClient::voiceConnectionCoro() // Could help with voice updates making for smoother // voice when we're busy. llcoro::suspendUntilTimeout(UPDATE_THROTTLE_SECONDS); + if (sShuttingDown) return; // 'this' migh already be invalid bool voiceEnabled = mVoiceEnabled; if (!isAgentAvatarValid()) @@ -2186,47 +2187,47 @@ void LLVoiceWebRTCConnection::processIceUpdates() { mOutstandingRequests++; LLCoros::getInstance()->launch("LLVoiceWebRTCConnection::processIceUpdatesCoro", - boost::bind(&LLVoiceWebRTCConnection::processIceUpdatesCoro, this)); + boost::bind(&LLVoiceWebRTCConnection::processIceUpdatesCoro, this->shared_from_this())); } // Ice candidates may be streamed in before or after the SDP offer is available (see below) // This function determines whether candidates are available to send to the Secondlife WebRTC // server via the simulator. If so, and there are no more candidates, this code // will make the cap call to the server sending up the ICE candidates. -void LLVoiceWebRTCConnection::processIceUpdatesCoro() +void LLVoiceWebRTCConnection::processIceUpdatesCoro(connectionPtr_t connection) { LL_PROFILE_ZONE_SCOPED_CATEGORY_VOICE - if (mShutDown || LLWebRTCVoiceClient::isShuttingDown()) + if (connection->mShutDown || LLWebRTCVoiceClient::isShuttingDown()) { - mOutstandingRequests--; + connection->mOutstandingRequests--; return; } bool iceCompleted = false; LLSD body; - if (!mIceCandidates.empty() || mIceCompleted) + if (!connection->mIceCandidates.empty() || connection->mIceCompleted) { - LLViewerRegion *regionp = LLWorld::instance().getRegionFromID(mRegionID); + LLViewerRegion *regionp = LLWorld::instance().getRegionFromID(connection->mRegionID); if (!regionp || !regionp->capabilitiesReceived()) { LL_DEBUGS("Voice") << "no capabilities for ice gathering; waiting " << LL_ENDL; - mOutstandingRequests--; + connection->mOutstandingRequests--; return; } std::string url = regionp->getCapability("VoiceSignalingRequest"); if (url.empty()) { - mOutstandingRequests--; + connection->mOutstandingRequests--; return; } LL_DEBUGS("Voice") << "region ready to complete voice signaling; url=" << url << LL_ENDL; - if (!mIceCandidates.empty()) + if (!connection->mIceCandidates.empty()) { LLSD candidates = LLSD::emptyArray(); - for (auto &ice_candidate : mIceCandidates) + for (auto &ice_candidate : connection->mIceCandidates) { LLSD body_candidate; body_candidate["sdpMid"] = ice_candidate.mSdpMid; @@ -2235,18 +2236,18 @@ void LLVoiceWebRTCConnection::processIceUpdatesCoro() candidates.append(body_candidate); } body["candidates"] = candidates; - mIceCandidates.clear(); + connection->mIceCandidates.clear(); } - else if (mIceCompleted) + else if (connection->mIceCompleted) { LLSD body_candidate; body_candidate["completed"] = true; body["candidate"] = body_candidate; - iceCompleted = mIceCompleted; - mIceCompleted = false; + iceCompleted = connection->mIceCompleted; + connection->mIceCompleted = false; } - body["viewer_session"] = mViewerSession; + body["viewer_session"] = connection->mViewerSession; body["voice_server_type"] = WEBRTC_VOICE_SERVER_TYPE; LLCoreHttpUtil::HttpCoroutineAdapter::ptr_t httpAdapter( @@ -2261,7 +2262,7 @@ void LLVoiceWebRTCConnection::processIceUpdatesCoro() if (LLWebRTCVoiceClient::isShuttingDown()) { - mOutstandingRequests--; + connection->mOutstandingRequests--; return; } @@ -2271,10 +2272,10 @@ void LLVoiceWebRTCConnection::processIceUpdatesCoro() if (!status) { // couldn't trickle the candidates, so restart the session. - setVoiceConnectionState(VOICE_STATE_SESSION_RETRY); + connection->setVoiceConnectionState(VOICE_STATE_SESSION_RETRY); } } - mOutstandingRequests--; + connection->mOutstandingRequests--; } @@ -2428,31 +2429,31 @@ void LLVoiceWebRTCConnection::sendData(const std::string &data) // Tell the simulator that we're shutting down a voice connection. // The simulator will pass this on to the Secondlife WebRTC server. -void LLVoiceWebRTCConnection::breakVoiceConnectionCoro() +void LLVoiceWebRTCConnection::breakVoiceConnectionCoro(connectionPtr_t connection) { LL_PROFILE_ZONE_SCOPED_CATEGORY_VOICE LL_DEBUGS("Voice") << "Disconnecting voice." << LL_ENDL; - if (mWebRTCDataInterface) + if (connection->mWebRTCDataInterface) { - mWebRTCDataInterface->unsetDataObserver(this); - mWebRTCDataInterface = nullptr; + connection->mWebRTCDataInterface->unsetDataObserver(connection.get()); + connection->mWebRTCDataInterface = nullptr; } - mWebRTCAudioInterface = nullptr; - LLViewerRegion *regionp = LLWorld::instance().getRegionFromID(mRegionID); + connection->mWebRTCAudioInterface = nullptr; + LLViewerRegion *regionp = LLWorld::instance().getRegionFromID(connection->mRegionID); if (!regionp || !regionp->capabilitiesReceived()) { LL_DEBUGS("Voice") << "no capabilities for voice provisioning; waiting " << LL_ENDL; - setVoiceConnectionState(VOICE_STATE_SESSION_RETRY); - mOutstandingRequests--; + connection->setVoiceConnectionState(VOICE_STATE_SESSION_RETRY); + connection->mOutstandingRequests--; return; } std::string url = regionp->getCapability("ProvisionVoiceAccountRequest"); if (url.empty()) { - setVoiceConnectionState(VOICE_STATE_SESSION_RETRY); - mOutstandingRequests--; + connection->setVoiceConnectionState(VOICE_STATE_SESSION_RETRY); + connection->mOutstandingRequests--; return; } @@ -2461,7 +2462,7 @@ void LLVoiceWebRTCConnection::breakVoiceConnectionCoro() LLVoiceWebRTCStats::getInstance()->provisionAttemptStart(); LLSD body; body["logout"] = TRUE; - body["viewer_session"] = mViewerSession; + body["viewer_session"] = connection->mViewerSession; body["voice_server_type"] = WEBRTC_VOICE_SERVER_TYPE; LLCoreHttpUtil::HttpCoroutineAdapter::ptr_t httpAdapter( @@ -2472,15 +2473,15 @@ void LLVoiceWebRTCConnection::breakVoiceConnectionCoro() httpOpts->setWantHeaders(true); - mOutstandingRequests++; + connection->mOutstandingRequests++; // tell the server to shut down the connection as a courtesy. // shutdownConnection will drop the WebRTC connection which will // also shut things down. LLSD result = httpAdapter->postAndSuspend(httpRequest, url, body, httpOpts); - mOutstandingRequests--; - setVoiceConnectionState(VOICE_STATE_SESSION_EXIT); + connection->mOutstandingRequests--; + connection->setVoiceConnectionState(VOICE_STATE_SESSION_EXIT); } // Tell the simulator to tell the Secondlife WebRTC server that we want a voice @@ -2664,7 +2665,7 @@ bool LLVoiceWebRTCConnection::connectionStateMachine() // VOICE_STATE_SESSION_ESTABLISHED via a callback on a webrtc thread. setVoiceConnectionState(VOICE_STATE_CONNECTION_WAIT); LLCoros::getInstance()->launch("LLVoiceWebRTCConnection::requestVoiceConnectionCoro", - boost::bind(&LLVoiceWebRTCConnection::requestVoiceConnectionCoro, this)); + boost::bind(&LLVoiceWebRTCConnection::requestVoiceConnectionCoro, this->shared_from_this())); break; case VOICE_STATE_CONNECTION_WAIT: @@ -2744,7 +2745,7 @@ bool LLVoiceWebRTCConnection::connectionStateMachine() case VOICE_STATE_DISCONNECT: setVoiceConnectionState(VOICE_STATE_WAIT_FOR_EXIT); LLCoros::instance().launch("LLVoiceWebRTCConnection::breakVoiceConnectionCoro", - boost::bind(&LLVoiceWebRTCConnection::breakVoiceConnectionCoro, this)); + boost::bind(&LLVoiceWebRTCConnection::breakVoiceConnectionCoro, this->shared_from_this())); break; case VOICE_STATE_WAIT_FOR_EXIT: diff --git a/indra/newview/llvoicewebrtc.h b/indra/newview/llvoicewebrtc.h index 8a65ef667c..570425dc3d 100644 --- a/indra/newview/llvoicewebrtc.h +++ b/indra/newview/llvoicewebrtc.h @@ -576,7 +576,8 @@ class LLVoiceWebRTCStats : public LLSingleton class LLVoiceWebRTCConnection : public llwebrtc::LLWebRTCSignalingObserver, - public llwebrtc::LLWebRTCDataObserver + public llwebrtc::LLWebRTCDataObserver, + public boost::enable_shared_from_this { public: LLVoiceWebRTCConnection(const LLUUID ®ionID, const std::string &channelID); @@ -610,7 +611,7 @@ class LLVoiceWebRTCConnection : void processIceUpdates(); - void processIceUpdatesCoro(); + static void processIceUpdatesCoro(connectionPtr_t connection); virtual void setMuteMic(bool muted); virtual void setSpeakerVolume(F32 volume); @@ -677,9 +678,9 @@ class LLVoiceWebRTCConnection : } virtual void requestVoiceConnection() = 0; - void requestVoiceConnectionCoro() { requestVoiceConnection(); } + static void requestVoiceConnectionCoro(connectionPtr_t connection) { connection->requestVoiceConnection(); } - void breakVoiceConnectionCoro(); + static void breakVoiceConnectionCoro(connectionPtr_t connection); LLVoiceClientStatusObserver::EStatusType mCurrentStatus; -- cgit v1.2.3 From 753cf01ef0165e840d90fe9e9b943eb27c2b6f19 Mon Sep 17 00:00:00 2001 From: Roxie Linden Date: Tue, 6 Aug 2024 22:24:38 -0700 Subject: don't need to post dylib as we're using xcarchive --- .github/workflows/build.yaml | 13 +------------ 1 file changed, 1 insertion(+), 12 deletions(-) diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index c88a23b85e..03dcad2158 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -395,7 +395,7 @@ jobs: uses: actions/download-artifact@v4 with: name: macOS-symbols - - name: Post Mac Executable symbols + - name: Post Mac symbols if: env.BUGSPLAT_USER && env.BUGSPLAT_PASS uses: Bugsplat-Git/symbol-upload@v9.1.1 with: @@ -406,17 +406,6 @@ jobs: version: ${{ needs.build.outputs.viewer_version }} directory: . files: "**/*.xcarchive.zip" - - name: Post Mac Dylib symbols - if: env.BUGSPLAT_USER && env.BUGSPLAT_PASS - uses: Bugsplat-Git/symbol-upload@v9.1.1 - with: - username: ${{ env.BUGSPLAT_USER }} - password: ${{ env.BUGSPLAT_PASS }} - database: "SecondLife_Viewer_2018" - application: ${{ needs.build.outputs.viewer_channel }} - version: ${{ needs.build.outputs.viewer_version }} - directory: _extracted - files: "**/*.dylib" release: needs: [setvar, build, sign-and-package-windows, sign-and-package-mac] -- cgit v1.2.3 From ae7f7cd6701ae9fed57c687b03aabad0d954b230 Mon Sep 17 00:00:00 2001 From: Andrey Kleshchev Date: Wed, 7 Aug 2024 09:28:06 +0300 Subject: Replace boost::shared_ptr with std in voice classes --- indra/llcommon/llerrorcontrol.h | 2 +- indra/llinventory/llsettingsdaycycle.cpp | 1 - indra/llinventory/llsettingswater.cpp | 1 - indra/newview/llenvironment.cpp | 2 -- indra/newview/lleventpoll.cpp | 2 -- indra/newview/llfloatereditenvironmentbase.cpp | 2 -- indra/newview/llfloaterfixedenvironment.cpp | 2 -- indra/newview/llsculptidsize.cpp | 2 -- indra/newview/llselectmgr.h | 1 - indra/newview/llsettingsvo.cpp | 1 - indra/newview/llvoiceclient.h | 2 +- indra/newview/llvoicevivox.cpp | 2 +- indra/newview/llvoicewebrtc.cpp | 4 ++-- indra/newview/llvoicewebrtc.h | 14 +++++++------- 14 files changed, 12 insertions(+), 26 deletions(-) diff --git a/indra/llcommon/llerrorcontrol.h b/indra/llcommon/llerrorcontrol.h index bf5a6df556..cbb703e9e7 100644 --- a/indra/llcommon/llerrorcontrol.h +++ b/indra/llcommon/llerrorcontrol.h @@ -198,7 +198,7 @@ namespace LLError }; /** - * @NOTE: addRecorder() and removeRecorder() uses the boost::shared_ptr to allow for shared ownership + * @NOTE: addRecorder() and removeRecorder() uses the std::shared_ptr to allow for shared ownership * while still ensuring that the allocated memory is eventually freed */ LL_COMMON_API void addRecorder(RecorderPtr); diff --git a/indra/llinventory/llsettingsdaycycle.cpp b/indra/llinventory/llsettingsdaycycle.cpp index ef6a187d06..3050cdf953 100644 --- a/indra/llinventory/llsettingsdaycycle.cpp +++ b/indra/llinventory/llsettingsdaycycle.cpp @@ -28,7 +28,6 @@ #include "llsettingsdaycycle.h" #include "llerror.h" #include -#include #include "lltrace.h" #include "llfasttimer.h" #include "v3colorutil.h" diff --git a/indra/llinventory/llsettingswater.cpp b/indra/llinventory/llsettingswater.cpp index 4cd84970ff..161b8cda25 100644 --- a/indra/llinventory/llsettingswater.cpp +++ b/indra/llinventory/llsettingswater.cpp @@ -27,7 +27,6 @@ #include "llsettingswater.h" #include -#include #include "lltrace.h" #include "llfasttimer.h" #include "v3colorutil.h" diff --git a/indra/newview/llenvironment.cpp b/indra/newview/llenvironment.cpp index 3c0a523317..5170e9a68b 100644 --- a/indra/newview/llenvironment.cpp +++ b/indra/newview/llenvironment.cpp @@ -54,8 +54,6 @@ #include "llregioninfomodel.h" -#include - #include "llatmosphere.h" #include "llagent.h" #include "roles_constants.h" diff --git a/indra/newview/lleventpoll.cpp b/indra/newview/lleventpoll.cpp index 471bb6d478..c05a7fef44 100644 --- a/indra/newview/lleventpoll.cpp +++ b/indra/newview/lleventpoll.cpp @@ -40,8 +40,6 @@ #include "llcorehttputil.h" #include "lleventfilter.h" -#include "boost/make_shared.hpp" - namespace LLEventPolling { namespace Details diff --git a/indra/newview/llfloatereditenvironmentbase.cpp b/indra/newview/llfloatereditenvironmentbase.cpp index 109c7a286c..e63032c0d8 100644 --- a/indra/newview/llfloatereditenvironmentbase.cpp +++ b/indra/newview/llfloatereditenvironmentbase.cpp @@ -28,8 +28,6 @@ #include "llfloatereditenvironmentbase.h" -#include - // libs #include "llnotifications.h" #include "llnotificationsutil.h" diff --git a/indra/newview/llfloaterfixedenvironment.cpp b/indra/newview/llfloaterfixedenvironment.cpp index ad9f83701c..fb26f1b872 100644 --- a/indra/newview/llfloaterfixedenvironment.cpp +++ b/indra/newview/llfloaterfixedenvironment.cpp @@ -28,8 +28,6 @@ #include "llfloaterfixedenvironment.h" -#include - // libs #include "llbutton.h" #include "llnotifications.h" diff --git a/indra/newview/llsculptidsize.cpp b/indra/newview/llsculptidsize.cpp index 3bc5ad7616..6be05fb003 100644 --- a/indra/newview/llsculptidsize.cpp +++ b/indra/newview/llsculptidsize.cpp @@ -29,8 +29,6 @@ #include "llvovolume.h" #include "lldrawable.h" #include "llvoavatar.h" -//boost -#include "boost/make_shared.hpp" //........... diff --git a/indra/newview/llselectmgr.h b/indra/newview/llselectmgr.h index 02c74d0ab0..0f9c76a2a1 100644 --- a/indra/newview/llselectmgr.h +++ b/indra/newview/llselectmgr.h @@ -48,7 +48,6 @@ #include #include #include -#include // boost::make_shared class LLMessageSystem; class LLViewerTexture; diff --git a/indra/newview/llsettingsvo.cpp b/indra/newview/llsettingsvo.cpp index 76632a83ae..5008061ec8 100644 --- a/indra/newview/llsettingsvo.cpp +++ b/indra/newview/llsettingsvo.cpp @@ -33,7 +33,6 @@ #include #include -#include #include "lltrace.h" #include "llfasttimer.h" #include "v3colorutil.h" diff --git a/indra/newview/llvoiceclient.h b/indra/newview/llvoiceclient.h index c8a65378c6..a263333bd3 100644 --- a/indra/newview/llvoiceclient.h +++ b/indra/newview/llvoiceclient.h @@ -133,7 +133,7 @@ class LLVoiceP2PIncomingCallInterface virtual void declineInvite() = 0; }; -typedef boost::shared_ptr LLVoiceP2PIncomingCallInterfacePtr; +typedef std::shared_ptr LLVoiceP2PIncomingCallInterfacePtr; ////////////////////////////////// /// @class LLVoiceModuleInterface diff --git a/indra/newview/llvoicevivox.cpp b/indra/newview/llvoicevivox.cpp index 13402513ef..6be6b1d4f2 100644 --- a/indra/newview/llvoicevivox.cpp +++ b/indra/newview/llvoicevivox.cpp @@ -4973,7 +4973,7 @@ void LLVivoxVoiceClient::hangup() { leaveChannel(); } LLVoiceP2PIncomingCallInterfacePtr LLVivoxVoiceClient::getIncomingCallInterface(const LLSD &voice_call_info) { - return boost::make_shared(voice_call_info); + return std::make_shared(voice_call_info); } bool LLVivoxVoiceClient::answerInvite(const std::string &sessionHandle) diff --git a/indra/newview/llvoicewebrtc.cpp b/indra/newview/llvoicewebrtc.cpp index f5105f0ca1..e5feae17f2 100644 --- a/indra/newview/llvoicewebrtc.cpp +++ b/indra/newview/llvoicewebrtc.cpp @@ -1964,8 +1964,8 @@ bool LLWebRTCVoiceClient::estateSessionState::processConnectionStates() for (auto &connection : mWebRTCConnections) { - boost::shared_ptr spatialConnection = - boost::static_pointer_cast(connection); + std::shared_ptr spatialConnection = + std::static_pointer_cast(connection); LLUUID regionID = spatialConnection.get()->getRegionID(); diff --git a/indra/newview/llvoicewebrtc.h b/indra/newview/llvoicewebrtc.h index 570425dc3d..f4ea329cb6 100644 --- a/indra/newview/llvoicewebrtc.h +++ b/indra/newview/llvoicewebrtc.h @@ -55,7 +55,7 @@ class LLWebRTCProtocolParser; class LLAvatarName; class LLVoiceWebRTCConnection; -typedef boost::shared_ptr connectionPtr_t; +typedef std::shared_ptr connectionPtr_t; extern const std::string WEBRTC_VOICE_SERVER_TYPE; @@ -252,7 +252,7 @@ public: bool mIsModeratorMuted; LLUUID mRegion; }; - typedef boost::shared_ptr participantStatePtr_t; + typedef std::shared_ptr participantStatePtr_t; participantStatePtr_t findParticipantByID(const std::string &channelID, const LLUUID &id); participantStatePtr_t addParticipantByID(const std::string& channelID, const LLUUID &id, const LLUUID& region); @@ -265,10 +265,10 @@ public: class sessionState { public: - typedef boost::shared_ptr ptr_t; - typedef boost::weak_ptr wptr_t; + typedef std::shared_ptr ptr_t; + typedef std::weak_ptr wptr_t; - typedef boost::function sessionFunc_t; + typedef std::function sessionFunc_t; static void addSession(const std::string &channelID, ptr_t& session); virtual ~sessionState(); @@ -336,7 +336,7 @@ public: sessionFunc_t func); }; - typedef boost::shared_ptr sessionStatePtr_t; + typedef std::shared_ptr sessionStatePtr_t; typedef std::map sessionMap; class estateSessionState : public sessionState @@ -577,7 +577,7 @@ class LLVoiceWebRTCStats : public LLSingleton class LLVoiceWebRTCConnection : public llwebrtc::LLWebRTCSignalingObserver, public llwebrtc::LLWebRTCDataObserver, - public boost::enable_shared_from_this + public std::enable_shared_from_this { public: LLVoiceWebRTCConnection(const LLUUID ®ionID, const std::string &channelID); -- cgit v1.2.3 From 9094d0281d362bd2caab5a34f42222aa1e24d9c2 Mon Sep 17 00:00:00 2001 From: Andrey Kleshchev Date: Wed, 7 Aug 2024 09:54:31 +0300 Subject: Adjust some LLVoiceClient functions Feels like I should have made isParticipant and getParticipantList static to minimize singleton dependency/calls --- indra/newview/lloutputmonitorctrl.cpp | 12 +++++++----- indra/newview/llspeakers.cpp | 22 ++++++++++++---------- indra/newview/llvoicechannel.cpp | 6 +++--- indra/newview/llvoicechannel.h | 6 +++--- indra/newview/llvoiceclient.cpp | 10 +++++----- indra/newview/llvoiceclient.h | 8 ++++---- 6 files changed, 34 insertions(+), 30 deletions(-) diff --git a/indra/newview/lloutputmonitorctrl.cpp b/indra/newview/lloutputmonitorctrl.cpp index db43c57139..28433b36f4 100644 --- a/indra/newview/lloutputmonitorctrl.cpp +++ b/indra/newview/lloutputmonitorctrl.cpp @@ -126,29 +126,31 @@ void LLOutputMonitorCtrl::draw() const F32 LEVEL_1 = LLVoiceClient::OVERDRIVEN_POWER_LEVEL * 2.f / 3.f; const F32 LEVEL_2 = LLVoiceClient::OVERDRIVEN_POWER_LEVEL; + LLVoiceClient* vocie_client = LLVoiceClient::getInstance(); + if (getVisible() && mAutoUpdate && !getIsMuted() && mSpeakerId.notNull()) { - setPower(LLVoiceClient::getInstance()->getCurrentPower(mSpeakerId)); + setPower(vocie_client->getCurrentPower(mSpeakerId)); if(mIsAgentControl) { - setIsTalking(LLVoiceClient::getInstance()->getUserPTTState()); + setIsTalking(vocie_client->getUserPTTState()); } else { - setIsTalking(LLVoiceClient::getInstance()->getIsSpeaking(mSpeakerId)); + setIsTalking(vocie_client->getIsSpeaking(mSpeakerId)); } } if ((mPower == 0.f && !mIsTalking) && mShowParticipantsSpeaking) { std::set participant_uuids; - LLVoiceClient::instance().getParticipantList(participant_uuids); + vocie_client->getParticipantList(participant_uuids); std::set::const_iterator part_it = participant_uuids.begin(); F32 power = 0; for (; part_it != participant_uuids.end(); ++part_it) { - power = LLVoiceClient::instance().getCurrentPower(*part_it); + power = vocie_client->getCurrentPower(*part_it); if (power) { mPower = power; diff --git a/indra/newview/llspeakers.cpp b/indra/newview/llspeakers.cpp index b12e8d15fc..cbccc79f4e 100644 --- a/indra/newview/llspeakers.cpp +++ b/indra/newview/llspeakers.cpp @@ -377,16 +377,17 @@ void LLSpeakerMgr::update(BOOL resort_ok) } // update status of all current speakers - BOOL voice_channel_active = (!mVoiceChannel && LLVoiceClient::getInstance()->inProximalChannel()) || (mVoiceChannel && mVoiceChannel->isActive()); + LLVoiceClient* voice_client = LLVoiceClient::getInstance(); + bool voice_channel_active = (!mVoiceChannel && voice_client->inProximalChannel()) || (mVoiceChannel && mVoiceChannel->isActive()); for (speaker_map_t::iterator speaker_it = mSpeakers.begin(); speaker_it != mSpeakers.end(); speaker_it++) { LLUUID speaker_id = speaker_it->first; LLSpeaker* speakerp = speaker_it->second; - if (voice_channel_active && LLVoiceClient::getInstance()->getVoiceEnabled(speaker_id)) + if (voice_channel_active && voice_client->getVoiceEnabled(speaker_id)) { - speakerp->mSpeechVolume = LLVoiceClient::getInstance()->getCurrentPower(speaker_id); - BOOL moderator_muted_voice = LLVoiceClient::getInstance()->getIsModeratorMuted(speaker_id); + speakerp->mSpeechVolume = voice_client->getCurrentPower(speaker_id); + BOOL moderator_muted_voice = voice_client->getIsModeratorMuted(speaker_id); if (moderator_muted_voice != speakerp->mModeratorMutedVoice) { speakerp->mModeratorMutedVoice = moderator_muted_voice; @@ -394,11 +395,11 @@ void LLSpeakerMgr::update(BOOL resort_ok) speakerp->fireEvent(new LLSpeakerVoiceModerationEvent(speakerp)); } - if (LLVoiceClient::getInstance()->getOnMuteList(speaker_id) || speakerp->mModeratorMutedVoice) + if (voice_client->getOnMuteList(speaker_id) || speakerp->mModeratorMutedVoice) { speakerp->mStatus = LLSpeaker::STATUS_MUTED; } - else if (LLVoiceClient::getInstance()->getIsSpeaking(speaker_id)) + else if (voice_client->getIsSpeaking(speaker_id)) { // reset inactivity expiration if (speakerp->mStatus != LLSpeaker::STATUS_SPEAKING) @@ -481,17 +482,18 @@ void LLSpeakerMgr::update(BOOL resort_ok) void LLSpeakerMgr::updateSpeakerList() { // Are we bound to the currently active voice channel? - if ((!mVoiceChannel && LLVoiceClient::getInstance()->inProximalChannel()) || (mVoiceChannel && mVoiceChannel->isActive())) + LLVoiceClient* vocie_client = LLVoiceClient::getInstance(); + if ((!mVoiceChannel && vocie_client->inProximalChannel()) || (mVoiceChannel && mVoiceChannel->isActive())) { std::set participants; - LLVoiceClient::getInstance()->getParticipantList(participants); + vocie_client->getParticipantList(participants); // If we are, add all voice client participants to our list of known speakers for (std::set::iterator participant_it = participants.begin(); participant_it != participants.end(); ++participant_it) { setSpeaker(*participant_it, - LLVoiceClient::getInstance()->getDisplayName(*participant_it), + vocie_client->getDisplayName(*participant_it), LLSpeaker::STATUS_VOICE_ACTIVE, - (LLVoiceClient::getInstance()->isParticipantAvatar(*participant_it)?LLSpeaker::SPEAKER_AGENT:LLSpeaker::SPEAKER_EXTERNAL)); + (vocie_client->isParticipantAvatar(*participant_it)?LLSpeaker::SPEAKER_AGENT:LLSpeaker::SPEAKER_EXTERNAL)); } } else if (mVoiceChannel) diff --git a/indra/newview/llvoicechannel.cpp b/indra/newview/llvoicechannel.cpp index 5a9c0d103f..9b144048f7 100644 --- a/indra/newview/llvoicechannel.cpp +++ b/indra/newview/llvoicechannel.cpp @@ -187,13 +187,13 @@ void LLVoiceChannel::handleError(EStatusType type) setState(STATE_ERROR); } -BOOL LLVoiceChannel::isActive() +bool LLVoiceChannel::isActive() const { // only considered active when currently bound channel matches what our channel return callStarted() && LLVoiceClient::getInstance()->isCurrentChannel(mChannelInfo); } -BOOL LLVoiceChannel::callStarted() +bool LLVoiceChannel::callStarted() const { return mState >= STATE_CALL_STARTED; } @@ -662,7 +662,7 @@ LLVoiceChannelProximal::LLVoiceChannelProximal() : { } -BOOL LLVoiceChannelProximal::isActive() +bool LLVoiceChannelProximal::isActive() const { return callStarted() && LLVoiceClient::getInstance()->inProximalChannel(); } diff --git a/indra/newview/llvoicechannel.h b/indra/newview/llvoicechannel.h index eb16cc22ba..46a3f552cb 100644 --- a/indra/newview/llvoicechannel.h +++ b/indra/newview/llvoicechannel.h @@ -74,8 +74,8 @@ public: virtual void activate(); virtual void setChannelInfo(const LLSD &channelInfo); virtual void requestChannelInfo(); - virtual BOOL isActive(); - virtual BOOL callStarted(); + virtual bool isActive() const; + virtual bool callStarted() const; // Session name is a UI label used for feedback about which person, // group, or phone number you are talking to @@ -170,7 +170,7 @@ class LLVoiceChannelProximal : public LLVoiceChannel, public LLSingleton &participants) +void LLVoiceClient::getParticipantList(std::set &participants) const { LLWebRTCVoiceClient::getInstance()->getParticipantList(participants); LLVivoxVoiceClient::getInstance()->getParticipantList(participants); } -bool LLVoiceClient::isParticipant(const LLUUID &speaker_id) +bool LLVoiceClient::isParticipant(const LLUUID &speaker_id) const { return LLWebRTCVoiceClient::getInstance()->isParticipant(speaker_id) || LLVivoxVoiceClient::getInstance()->isParticipant(speaker_id); @@ -718,12 +718,12 @@ void LLVoiceClient::toggleUserPTTState(void) //------------------------------------------- // nearby speaker accessors -BOOL LLVoiceClient::getVoiceEnabled(const LLUUID& id) +bool LLVoiceClient::getVoiceEnabled(const LLUUID& id) const { - return isParticipant(id) ? TRUE : FALSE; + return isParticipant(id); } -std::string LLVoiceClient::getDisplayName(const LLUUID& id) +std::string LLVoiceClient::getDisplayName(const LLUUID& id) const { std::string result = LLWebRTCVoiceClient::getInstance()->getDisplayName(id); if (result.empty()) diff --git a/indra/newview/llvoiceclient.h b/indra/newview/llvoiceclient.h index a263333bd3..fdc00a98e8 100644 --- a/indra/newview/llvoiceclient.h +++ b/indra/newview/llvoiceclient.h @@ -452,8 +452,8 @@ public: ///////////////////////////// // Accessors for data related to nearby speakers - BOOL getVoiceEnabled(const LLUUID& id); // true if we've received data for this avatar - std::string getDisplayName(const LLUUID& id); + bool getVoiceEnabled(const LLUUID& id) const; // true if we've received data for this avatar + std::string getDisplayName(const LLUUID& id) const; BOOL isOnlineSIP(const LLUUID &id); BOOL isParticipantAvatar(const LLUUID &id); BOOL getIsSpeaking(const LLUUID& id); @@ -463,8 +463,8 @@ public: F32 getUserVolume(const LLUUID& id); ///////////////////////////// - void getParticipantList(std::set &participants); - bool isParticipant(const LLUUID& speaker_id); + void getParticipantList(std::set &participants) const; + bool isParticipant(const LLUUID& speaker_id) const; ////////////////////////// /// @name text chat -- cgit v1.2.3 From f0db41911a4b291d037f8df92f26ec8aec5d274f Mon Sep 17 00:00:00 2001 From: Andrey Kleshchev Date: Wed, 7 Aug 2024 10:06:32 +0300 Subject: viewer-private#262 viewer crashes on exit if the call is not completed --- indra/newview/llvoicewebrtc.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/indra/newview/llvoicewebrtc.cpp b/indra/newview/llvoicewebrtc.cpp index e5feae17f2..ff3c0eccd2 100644 --- a/indra/newview/llvoicewebrtc.cpp +++ b/indra/newview/llvoicewebrtc.cpp @@ -1253,7 +1253,7 @@ void LLWebRTCVoiceClient::sessionState::removeParticipant(const LLWebRTCVoiceCli LLWebRTCVoiceClient::getInstance()->notifyParticipantObservers(); } } - if (mHangupOnLastLeave && (participantID != gAgentID) && (mParticipantsByUUID.size() <= 1)) + if (mHangupOnLastLeave && (participantID != gAgentID) && (mParticipantsByUUID.size() <= 1) && LLWebRTCVoiceClient::instanceExists()) { LLWebRTCVoiceClient::getInstance()->notifyStatusObservers(LLVoiceClientStatusObserver::STATUS_LEFT_CHANNEL); } -- cgit v1.2.3 From 93164fc5605a2b3d0d7a21d39c297cd392f75b60 Mon Sep 17 00:00:00 2001 From: Alexander Gavriliuk Date: Wed, 7 Aug 2024 08:23:47 +0200 Subject: #1922 Make PBR scale and offset crosshair work (fix callbacks in LLPanelFace) --- indra/newview/llpanelface.cpp | 944 +++++++++++++++++------------------------- indra/newview/llpanelface.h | 302 +++++++------- 2 files changed, 530 insertions(+), 716 deletions(-) diff --git a/indra/newview/llpanelface.cpp b/indra/newview/llpanelface.cpp index 0afe967839..f01d327fb4 100644 --- a/indra/newview/llpanelface.cpp +++ b/indra/newview/llpanelface.cpp @@ -240,10 +240,10 @@ LLUUID LLPanelFace::getCurrentNormalMap() { return mBumpyTextureCtrl-> LLUUID LLPanelFace::getCurrentSpecularMap() { return mShinyTextureCtrl->getImageAssetID(); } U32 LLPanelFace::getCurrentShininess() { return getChild("combobox shininess")->getCurrentIndex(); } U32 LLPanelFace::getCurrentBumpiness() { return getChild("combobox bumpiness")->getCurrentIndex(); } -U8 LLPanelFace::getCurrentDiffuseAlphaMode() { return (U8)getChild("combobox alphamode")->getCurrentIndex(); } -U8 LLPanelFace::getCurrentAlphaMaskCutoff() { return (U8)getChild("maskcutoff")->getValue().asInteger(); } -U8 LLPanelFace::getCurrentEnvIntensity() { return (U8)getChild("environment")->getValue().asInteger(); } -U8 LLPanelFace::getCurrentGlossiness() { return (U8)getChild("glossiness")->getValue().asInteger(); } +U8 LLPanelFace::getCurrentDiffuseAlphaMode() { return (U8)getChild("combobox alphamode")->getCurrentIndex(); } +U8 LLPanelFace::getCurrentAlphaMaskCutoff() { return (U8)getChild("maskcutoff")->getValue().asInteger(); } +U8 LLPanelFace::getCurrentEnvIntensity() { return (U8)getChild("environment")->getValue().asInteger(); } +U8 LLPanelFace::getCurrentGlossiness() { return (U8)getChild("glossiness")->getValue().asInteger(); } F32 LLPanelFace::getCurrentBumpyRot() { return (F32)getChild("bumpyRot")->getValue().asReal(); } F32 LLPanelFace::getCurrentBumpyScaleU() { return (F32)getChild("bumpyScaleU")->getValue().asReal(); } F32 LLPanelFace::getCurrentBumpyScaleV() { return (F32)getChild("bumpyScaleV")->getValue().asReal(); } @@ -259,49 +259,49 @@ F32 LLPanelFace::getCurrentShinyOffsetV() { return (F32)getChild("gltfTextureScaleU")->setCommitCallback(boost::bind(&LLPanelFace::onCommitGLTFTextureScaleU, this, _1), nullptr); - getChild("gltfTextureScaleV")->setCommitCallback(boost::bind(&LLPanelFace::onCommitGLTFTextureScaleV, this, _1), nullptr); - getChild("gltfTextureRotation")->setCommitCallback(boost::bind(&LLPanelFace::onCommitGLTFRotation, this, _1), nullptr); - getChild("gltfTextureOffsetU")->setCommitCallback(boost::bind(&LLPanelFace::onCommitGLTFTextureOffsetU, this, _1), nullptr); - getChild("gltfTextureOffsetV")->setCommitCallback(boost::bind(&LLPanelFace::onCommitGLTFTextureOffsetV, this, _1), nullptr); +bool LLPanelFace::postBuild() +{ + childSetCommitCallback("combobox shininess", [&](LLUICtrl*, const void*) { onCommitShiny(); }, 0); + childSetCommitCallback("combobox bumpiness", [&](LLUICtrl*, const void*) { onCommitBump(); }, 0); + childSetCommitCallback("combobox alphamode", [&](LLUICtrl*, const void*) { onCommitAlphaMode(); }, 0); + childSetCommitCallback("TexScaleU", [&](LLUICtrl*, const void*) { onCommitTextureScaleX(); }, 0); + childSetCommitCallback("TexScaleV", [&](LLUICtrl*, const void*) { onCommitTextureScaleY(); }, 0); + childSetCommitCallback("TexRot", [&](LLUICtrl*, const void*) { onCommitTextureRot(); }, 0); + childSetCommitCallback("rptctrl", [&](LLUICtrl*, const void*) { onCommitRepeatsPerMeter(); }, 0); + childSetCommitCallback("checkbox planar align", [&](LLUICtrl*, const void*) { onCommitPlanarAlign(); }, 0); + childSetCommitCallback("TexOffsetU", [&](LLUICtrl*, const void*) { onCommitTextureOffsetX(); }, 0); + childSetCommitCallback("TexOffsetV", [&](LLUICtrl*, const void*) { onCommitTextureOffsetY(); }, 0); + + childSetCommitCallback("bumpyScaleU", [&](LLUICtrl*, const void*) { onCommitMaterialBumpyScaleX(); }, 0); + childSetCommitCallback("bumpyScaleV", [&](LLUICtrl*, const void*) { onCommitMaterialBumpyScaleY(); }, 0); + childSetCommitCallback("bumpyRot", [&](LLUICtrl*, const void*) { onCommitMaterialBumpyRot(); }, 0); + childSetCommitCallback("bumpyOffsetU", [&](LLUICtrl*, const void*) { onCommitMaterialBumpyOffsetX(); }, 0); + childSetCommitCallback("bumpyOffsetV", [&](LLUICtrl*, const void*) { onCommitMaterialBumpyOffsetY(); }, 0); + childSetCommitCallback("shinyScaleU", [&](LLUICtrl*, const void*) { onCommitMaterialShinyScaleX(); }, 0); + childSetCommitCallback("shinyScaleV", [&](LLUICtrl*, const void*) { onCommitMaterialShinyScaleY(); }, 0); + childSetCommitCallback("shinyRot", [&](LLUICtrl*, const void*) { onCommitMaterialShinyRot(); }, 0); + childSetCommitCallback("shinyOffsetU", [&](LLUICtrl*, const void*) { onCommitMaterialShinyOffsetX(); }, 0); + childSetCommitCallback("shinyOffsetV", [&](LLUICtrl*, const void*) { onCommitMaterialShinyOffsetY(); }, 0); + childSetCommitCallback("glossiness", [&](LLUICtrl*, const void*) { onCommitMaterialGloss(); }, 0); + childSetCommitCallback("environment", [&](LLUICtrl*, const void*) { onCommitMaterialEnv(); }, 0); + childSetCommitCallback("maskcutoff", [&](LLUICtrl*, const void*) { onCommitMaterialMaskCutoff(); }, 0); + childSetCommitCallback("add_media", [&](LLUICtrl*, const void*) { onClickBtnAddMedia(); }, 0); + childSetCommitCallback("delete_media", [&](LLUICtrl*, const void*) { onClickBtnDeleteMedia(); }, 0); + + childSetCommitCallback("gltfTextureScaleU", [&](LLUICtrl*, const void*) { onCommitGLTFTextureScaleU(); }, 0); + childSetCommitCallback("gltfTextureScaleV", [&](LLUICtrl*, const void*) { onCommitGLTFTextureScaleV(); }, 0); + childSetCommitCallback("gltfTextureRotation", [&](LLUICtrl*, const void*) { onCommitGLTFRotation(); }, 0); + childSetCommitCallback("gltfTextureOffsetU", [&](LLUICtrl*, const void*) { onCommitGLTFTextureOffsetU(); }, 0); + childSetCommitCallback("gltfTextureOffsetV", [&](LLUICtrl*, const void*) { onCommitGLTFTextureOffsetV(); }, 0); LLGLTFMaterialList::addSelectionUpdateCallback(&LLPanelFace::onMaterialOverrideReceived); sMaterialOverrideSelection.connect(); - childSetAction("button align",&LLPanelFace::onClickAutoFix,this); - childSetAction("button align textures", &LLPanelFace::onAlignTexture, this); - childSetAction("pbr_from_inventory", &LLPanelFace::onClickBtnLoadInvPBR, this); - childSetAction("edit_selected_pbr", &LLPanelFace::onClickBtnEditPBR, this); - childSetAction("save_selected_pbr", &LLPanelFace::onClickBtnSavePBR, this); + childSetAction("button align", [&](LLUICtrl*, const LLSD&) { onClickAutoFix(); }); + childSetAction("button align textures", [&](LLUICtrl*, const LLSD&) { onAlignTexture(); }); + childSetAction("pbr_from_inventory", [&](LLUICtrl*, const LLSD&) { onClickBtnLoadInvPBR(); }); + childSetAction("edit_selected_pbr", [&](LLUICtrl*, const LLSD&) { onClickBtnEditPBR(); }); + childSetAction("save_selected_pbr", [&](LLUICtrl*, const LLSD&) { onClickBtnSavePBR(); }); setMouseOpaque(false); @@ -310,12 +310,12 @@ bool LLPanelFace::postBuild() { mPBRTextureCtrl->setDefaultImageAssetID(LLUUID::null); mPBRTextureCtrl->setBlankImageAssetID(BLANK_MATERIAL_ASSET_ID); - mPBRTextureCtrl->setCommitCallback(boost::bind(&LLPanelFace::onCommitPbr, this, _2)); - mPBRTextureCtrl->setOnCancelCallback(boost::bind(&LLPanelFace::onCancelPbr, this, _2)); - mPBRTextureCtrl->setOnSelectCallback(boost::bind(&LLPanelFace::onSelectPbr, this, _2)); - mPBRTextureCtrl->setDragCallback(boost::bind(&LLPanelFace::onDragPbr, this, _2)); - mPBRTextureCtrl->setOnTextureSelectedCallback(boost::bind(&LLPanelFace::onPbrSelectionChanged, this, _1)); - mPBRTextureCtrl->setOnCloseCallback(boost::bind(&LLPanelFace::onCloseTexturePicker, this, _2)); + mPBRTextureCtrl->setCommitCallback([&](LLUICtrl*, const LLSD&) { onCommitPbr(); }); + mPBRTextureCtrl->setOnCancelCallback([&](LLUICtrl*, const LLSD&) { onCancelPbr(); }); + mPBRTextureCtrl->setOnSelectCallback([&](LLUICtrl*, const LLSD&) { onSelectPbr(); }); + mPBRTextureCtrl->setDragCallback([&](LLUICtrl*, LLInventoryItem* item) { return onDragPbr(item); }); + mPBRTextureCtrl->setOnTextureSelectedCallback([&](LLInventoryItem* item) { onPbrSelectionChanged(item); }); + mPBRTextureCtrl->setOnCloseCallback([&](LLUICtrl*, const LLSD& data) { onCloseTexturePicker(data); }); mPBRTextureCtrl->setFollowsTop(); mPBRTextureCtrl->setFollowsLeft(); @@ -326,15 +326,15 @@ bool LLPanelFace::postBuild() } mTextureCtrl = getChild("texture control"); - if(mTextureCtrl) + if (mTextureCtrl) { mTextureCtrl->setDefaultImageAssetID(DEFAULT_OBJECT_TEXTURE); - mTextureCtrl->setCommitCallback( boost::bind(&LLPanelFace::onCommitTexture, this, _2) ); - mTextureCtrl->setOnCancelCallback( boost::bind(&LLPanelFace::onCancelTexture, this, _2) ); - mTextureCtrl->setOnSelectCallback( boost::bind(&LLPanelFace::onSelectTexture, this, _2) ); - mTextureCtrl->setDragCallback(boost::bind(&LLPanelFace::onDragTexture, this, _2)); - mTextureCtrl->setOnTextureSelectedCallback(boost::bind(&LLPanelFace::onTextureSelectionChanged, this, _1)); - mTextureCtrl->setOnCloseCallback( boost::bind(&LLPanelFace::onCloseTexturePicker, this, _2) ); + mTextureCtrl->setCommitCallback([&](LLUICtrl*, const LLSD&) { onCommitTexture(); }); + mTextureCtrl->setOnCancelCallback([&](LLUICtrl*, const LLSD&) { onCancelTexture(); }); + mTextureCtrl->setOnSelectCallback([&](LLUICtrl*, const LLSD&) { onSelectTexture(); }); + mTextureCtrl->setDragCallback([&](LLUICtrl*, LLInventoryItem* item) { return onDragTexture(item); }); + mTextureCtrl->setOnTextureSelectedCallback([&](LLInventoryItem* item) { onTextureSelectionChanged(item); }); + mTextureCtrl->setOnCloseCallback([&](LLUICtrl*, const LLSD& data) { onCloseTexturePicker(data); }); mTextureCtrl->setFollowsTop(); mTextureCtrl->setFollowsLeft(); @@ -343,16 +343,16 @@ bool LLPanelFace::postBuild() } mShinyTextureCtrl = getChild("shinytexture control"); - if(mShinyTextureCtrl) + if (mShinyTextureCtrl) { mShinyTextureCtrl->setDefaultImageAssetID(DEFAULT_OBJECT_SPECULAR); - mShinyTextureCtrl->setCommitCallback( boost::bind(&LLPanelFace::onCommitSpecularTexture, this, _2) ); - mShinyTextureCtrl->setOnCancelCallback( boost::bind(&LLPanelFace::onCancelSpecularTexture, this, _2) ); - mShinyTextureCtrl->setOnSelectCallback( boost::bind(&LLPanelFace::onSelectSpecularTexture, this, _2) ); - mShinyTextureCtrl->setOnCloseCallback( boost::bind(&LLPanelFace::onCloseTexturePicker, this, _2) ); + mShinyTextureCtrl->setCommitCallback([&](LLUICtrl*, const LLSD& data) { onCommitSpecularTexture(data); }); + mShinyTextureCtrl->setOnCancelCallback([&](LLUICtrl*, const LLSD& data) { onCancelSpecularTexture(data); }); + mShinyTextureCtrl->setOnSelectCallback([&](LLUICtrl*, const LLSD& data) { onSelectSpecularTexture(data); }); + mShinyTextureCtrl->setOnCloseCallback([&](LLUICtrl*, const LLSD& data) { onCloseTexturePicker(data); }); - mShinyTextureCtrl->setDragCallback(boost::bind(&LLPanelFace::onDragTexture, this, _2)); - mShinyTextureCtrl->setOnTextureSelectedCallback(boost::bind(&LLPanelFace::onTextureSelectionChanged, this, _1)); + mShinyTextureCtrl->setDragCallback([&](LLUICtrl*, LLInventoryItem* item) { return onDragTexture(item); }); + mShinyTextureCtrl->setOnTextureSelectedCallback([&](LLInventoryItem* item) { onTextureSelectionChanged(item); }); mShinyTextureCtrl->setFollowsTop(); mShinyTextureCtrl->setFollowsLeft(); mShinyTextureCtrl->setImmediateFilterPermMask(PERM_NONE); @@ -360,17 +360,17 @@ bool LLPanelFace::postBuild() } mBumpyTextureCtrl = getChild("bumpytexture control"); - if(mBumpyTextureCtrl) + if (mBumpyTextureCtrl) { mBumpyTextureCtrl->setDefaultImageAssetID(DEFAULT_OBJECT_NORMAL); mBumpyTextureCtrl->setBlankImageAssetID(BLANK_OBJECT_NORMAL); - mBumpyTextureCtrl->setCommitCallback( boost::bind(&LLPanelFace::onCommitNormalTexture, this, _2) ); - mBumpyTextureCtrl->setOnCancelCallback( boost::bind(&LLPanelFace::onCancelNormalTexture, this, _2) ); - mBumpyTextureCtrl->setOnSelectCallback( boost::bind(&LLPanelFace::onSelectNormalTexture, this, _2) ); - mBumpyTextureCtrl->setOnCloseCallback( boost::bind(&LLPanelFace::onCloseTexturePicker, this, _2) ); + mBumpyTextureCtrl->setCommitCallback([&](LLUICtrl*, const LLSD& data) { onCommitNormalTexture(data); }); + mBumpyTextureCtrl->setOnCancelCallback([&](LLUICtrl*, const LLSD& data) { onCancelNormalTexture(data); }); + mBumpyTextureCtrl->setOnSelectCallback([&](LLUICtrl*, const LLSD& data) { onSelectNormalTexture(data); }); + mBumpyTextureCtrl->setOnCloseCallback([&](LLUICtrl*, const LLSD& data) { onCloseTexturePicker(data); }); - mBumpyTextureCtrl->setDragCallback(boost::bind(&LLPanelFace::onDragTexture, this, _2)); - mBumpyTextureCtrl->setOnTextureSelectedCallback(boost::bind(&LLPanelFace::onTextureSelectionChanged, this, _1)); + mBumpyTextureCtrl->setDragCallback([&](LLUICtrl*, LLInventoryItem* item) { return onDragTexture(item); }); + mBumpyTextureCtrl->setOnTextureSelectedCallback([&](LLInventoryItem* item) { onTextureSelectionChanged(item); }); mBumpyTextureCtrl->setFollowsTop(); mBumpyTextureCtrl->setFollowsLeft(); mBumpyTextureCtrl->setImmediateFilterPermMask(PERM_NONE); @@ -378,38 +378,38 @@ bool LLPanelFace::postBuild() } mColorSwatch = getChild("colorswatch"); - if(mColorSwatch) + if (mColorSwatch) { - mColorSwatch->setCommitCallback(boost::bind(&LLPanelFace::onCommitColor, this, _2)); - mColorSwatch->setOnCancelCallback(boost::bind(&LLPanelFace::onCancelColor, this, _2)); - mColorSwatch->setOnSelectCallback(boost::bind(&LLPanelFace::onSelectColor, this, _2)); + mColorSwatch->setCommitCallback([&](LLUICtrl*, const LLSD&) { onCommitColor(); }); + mColorSwatch->setOnCancelCallback([&](LLUICtrl*, const LLSD&) { onCancelColor(); }); + mColorSwatch->setOnSelectCallback([&](LLUICtrl*, const LLSD&) { onSelectColor(); }); mColorSwatch->setFollowsTop(); mColorSwatch->setFollowsLeft(); mColorSwatch->setCanApplyImmediately(true); } mShinyColorSwatch = getChild("shinycolorswatch"); - if(mShinyColorSwatch) + if (mShinyColorSwatch) { - mShinyColorSwatch->setCommitCallback(boost::bind(&LLPanelFace::onCommitShinyColor, this, _2)); - mShinyColorSwatch->setOnCancelCallback(boost::bind(&LLPanelFace::onCancelShinyColor, this, _2)); - mShinyColorSwatch->setOnSelectCallback(boost::bind(&LLPanelFace::onSelectShinyColor, this, _2)); + mShinyColorSwatch->setCommitCallback([&](LLUICtrl*, const LLSD&) { onCommitShinyColor(); }); + mShinyColorSwatch->setOnCancelCallback([&](LLUICtrl*, const LLSD&) { onCancelShinyColor(); }); + mShinyColorSwatch->setOnSelectCallback([&](LLUICtrl*, const LLSD&) { onSelectShinyColor(); }); mShinyColorSwatch->setFollowsTop(); mShinyColorSwatch->setFollowsLeft(); mShinyColorSwatch->setCanApplyImmediately(true); } mLabelColorTransp = getChild("color trans"); - if(mLabelColorTransp) + if (mLabelColorTransp) { mLabelColorTransp->setFollowsTop(); mLabelColorTransp->setFollowsLeft(); } mCtrlColorTransp = getChild("ColorTrans"); - if(mCtrlColorTransp) + if (mCtrlColorTransp) { - mCtrlColorTransp->setCommitCallback(boost::bind(&LLPanelFace::onCommitAlpha, this, _2)); + mCtrlColorTransp->setCommitCallback([&](LLUICtrl*, const LLSD&) { onCommitAlpha(); }); mCtrlColorTransp->setPrecision(0); mCtrlColorTransp->setFollowsTop(); mCtrlColorTransp->setFollowsLeft(); @@ -418,41 +418,41 @@ bool LLPanelFace::postBuild() mCheckFullbright = getChild("checkbox fullbright"); if (mCheckFullbright) { - mCheckFullbright->setCommitCallback(LLPanelFace::onCommitFullbright, this); + mCheckFullbright->setCommitCallback([&](LLUICtrl*, const LLSD&) { onCommitFullbright(); }); } mComboTexGen = getChild("combobox texgen"); - if(mComboTexGen) + if (mComboTexGen) { - mComboTexGen->setCommitCallback(LLPanelFace::onCommitTexGen, this); + mComboTexGen->setCommitCallback([&](LLUICtrl*, const LLSD&) { onCommitTexGen(); }); mComboTexGen->setFollows(FOLLOWS_LEFT | FOLLOWS_TOP); } mComboMatMedia = getChild("combobox matmedia"); - if(mComboMatMedia) + if (mComboMatMedia) { - mComboMatMedia->setCommitCallback(LLPanelFace::onCommitMaterialsMedia,this); + mComboMatMedia->setCommitCallback([&](LLUICtrl*, const LLSD&) { onCommitMaterialsMedia(); }); mComboMatMedia->selectNthItem(MATMEDIA_MATERIAL); } mRadioMaterialType = getChild("radio_material_type"); - if(mRadioMaterialType) + if (mRadioMaterialType) { - mRadioMaterialType->setCommitCallback(LLPanelFace::onCommitMaterialType, this); + mRadioMaterialType->setCommitCallback([&](LLUICtrl*, const LLSD&) { onCommitMaterialType(); }); mRadioMaterialType->selectNthItem(MATTYPE_DIFFUSE); } mRadioPbrType = getChild("radio_pbr_type"); if (mRadioPbrType) { - mRadioPbrType->setCommitCallback(LLPanelFace::onCommitPbrType, this); + mRadioPbrType->setCommitCallback([&](LLUICtrl*, const LLSD&) { onCommitPbrType(); }); mRadioPbrType->selectNthItem(PBRTYPE_RENDER_MATERIAL_ID); } mCtrlGlow = getChild("glow"); - if(mCtrlGlow) + if (mCtrlGlow) { - mCtrlGlow->setCommitCallback(LLPanelFace::onCommitGlow, this); + mCtrlGlow->setCommitCallback([&](LLUICtrl*, const LLSD&) { onCommitGlow(); }); } mMenuClipboardColor = getChild("clipboard_color_params_btn"); @@ -534,7 +534,7 @@ void LLPanelFace::sendTexture() void LLPanelFace::sendBump(U32 bumpiness) { if (bumpiness < BUMPY_TEXTURE) -{ + { LL_DEBUGS("Materials") << "clearing bumptexture control" << LL_ENDL; mBumpyTextureCtrl->clear(); mBumpyTextureCtrl->setImageAssetID(LLUUID()); @@ -544,12 +544,13 @@ void LLPanelFace::sendBump(U32 bumpiness) LLUUID current_normal_map = mBumpyTextureCtrl->getImageAssetID(); - U8 bump = (U8) bumpiness & TEM_BUMP_MASK; + U8 bump = (U8)bumpiness & TEM_BUMP_MASK; // Clear legacy bump to None when using an actual normal map - // if (!current_normal_map.isNull()) + { bump = 0; + } // Set the normal map or reset it to null as appropriate // @@ -560,14 +561,14 @@ void LLPanelFace::sendBump(U32 bumpiness) void LLPanelFace::sendTexGen() { - U8 tex_gen = (U8) mComboTexGen->getCurrentIndex() << TEM_TEX_GEN_SHIFT; - LLSelectMgr::getInstance()->selectionSetTexGen( tex_gen ); + U8 tex_gen = (U8)mComboTexGen->getCurrentIndex() << TEM_TEX_GEN_SHIFT; + LLSelectMgr::getInstance()->selectionSetTexGen(tex_gen); } void LLPanelFace::sendShiny(U32 shininess) { if (shininess < SHINY_TEXTURE) -{ + { mShinyTextureCtrl->clear(); mShinyTextureCtrl->setImageAssetID(LLUUID()); } @@ -576,40 +577,38 @@ void LLPanelFace::sendShiny(U32 shininess) U8 shiny = (U8) shininess & TEM_SHINY_MASK; if (!specmap.isNull()) + { shiny = 0; + } LLSelectedTEMaterial::setSpecularID(this, specmap); - LLSelectMgr::getInstance()->selectionSetShiny( shiny, mShinyTextureCtrl->getImageItemID() ); + LLSelectMgr::getInstance()->selectionSetShiny(shiny, mShinyTextureCtrl->getImageItemID()); updateShinyControls(!specmap.isNull(), true); - } void LLPanelFace::sendFullbright() { if(!mCheckFullbright)return; U8 fullbright = mCheckFullbright->get() ? TEM_FULLBRIGHT_MASK : 0; - LLSelectMgr::getInstance()->selectionSetFullbright( fullbright ); + LLSelectMgr::getInstance()->selectionSetFullbright(fullbright); } void LLPanelFace::sendColor() { if(!mColorSwatch)return; LLColor4 color = mColorSwatch->get(); - - LLSelectMgr::getInstance()->selectionSetColorOnly( color ); + LLSelectMgr::getInstance()->selectionSetColorOnly(color); } void LLPanelFace::sendAlpha() { if(!mCtrlColorTransp)return; F32 alpha = (100.f - mCtrlColorTransp->get()) / 100.f; - LLSelectMgr::getInstance()->selectionSetAlphaOnly( alpha ); } - void LLPanelFace::sendGlow() { if (mCtrlGlow) @@ -750,6 +749,7 @@ struct LLPanelFaceSetTEFunctor : public LLSelectedTEFunctor } } } + return true; } private: @@ -906,7 +906,7 @@ struct LLPanelFaceGetIsAlignedTEFunctor : public LLSelectedTEFunctor LLVector2 aligned_st_offset, aligned_st_scale; F32 aligned_st_rot; - if ( facep->calcAlignedPlanarTE(mCenterFace, &aligned_st_offset, &aligned_st_scale, &aligned_st_rot) ) + if (facep->calcAlignedPlanarTE(mCenterFace, &aligned_st_offset, &aligned_st_scale, &aligned_st_rot)) { const LLTextureEntry* tep = facep->getTextureEntry(); LLVector2 st_offset, st_scale; @@ -947,7 +947,7 @@ struct LLPanelFaceSendFunctor : public LLSelectedObjectFunctor void LLPanelFace::sendTextureInfo() { - if ((bool)childGetValue("checkbox planar align").asBoolean()) + if (childGetValue("checkbox planar align").asBoolean()) { LLFace* last_face = NULL; bool identical_face =false; @@ -1322,9 +1322,9 @@ void LLPanelFace::updateUI(bool force_set_values /*false*/) if (mShinyTextureCtrl) { - mShinyTextureCtrl->setTentative( !identical_spec ); - mShinyTextureCtrl->setEnabled( editable && !has_pbr_material); - mShinyTextureCtrl->setImageAssetID( specmap_id ); + mShinyTextureCtrl->setTentative(!identical_spec); + mShinyTextureCtrl->setEnabled(editable && !has_pbr_material); + mShinyTextureCtrl->setImageAssetID(specmap_id); if (attachment) { @@ -1338,9 +1338,9 @@ void LLPanelFace::updateUI(bool force_set_values /*false*/) if (mBumpyTextureCtrl) { - mBumpyTextureCtrl->setTentative( !identical_norm ); - mBumpyTextureCtrl->setEnabled( editable && !has_pbr_material); - mBumpyTextureCtrl->setImageAssetID( normmap_id ); + mBumpyTextureCtrl->setTentative(!identical_norm); + mBumpyTextureCtrl->setEnabled(editable && !has_pbr_material); + mBumpyTextureCtrl->setImageAssetID(normmap_id); if (attachment) { @@ -1386,10 +1386,8 @@ void LLPanelFace::updateUI(bool force_set_values /*false*/) bool identical_texgen = true; bool identical_planar_texgen = false; - { - LLSelectedTE::getTexGen(selected_texgen, identical_texgen); - identical_planar_texgen = (identical_texgen && (selected_texgen == LLTextureEntry::TEX_GEN_PLANAR)); - } + LLSelectedTE::getTexGen(selected_texgen, identical_texgen); + identical_planar_texgen = (identical_texgen && (selected_texgen == LLTextureEntry::TEX_GEN_PLANAR)); // Texture scale { @@ -1428,7 +1426,7 @@ void LLPanelFace::updateUI(bool force_set_values /*false*/) bool norm_scale_tentative = !(identical && identical_norm_scale_s); bool spec_scale_tentative = !(identical && identical_spec_scale_s); - getChild("TexScaleU")->setTentative( LLSD(diff_scale_tentative)); + getChild("TexScaleU")->setTentative(LLSD(diff_scale_tentative)); getChild("shinyScaleU")->setTentative(LLSD(spec_scale_tentative)); getChild("bumpyScaleU")->setTentative(LLSD(norm_scale_tentative)); } @@ -1550,9 +1548,9 @@ void LLPanelFace::updateUI(bool force_set_values /*false*/) F32 norm_rotation = 0.f; F32 spec_rotation = 0.f; - LLSelectedTE::getRotation(diff_rotation,identical_diff_rotation); - LLSelectedTEMaterial::getSpecularRotation(spec_rotation,identical_spec_rotation); - LLSelectedTEMaterial::getNormalRotation(norm_rotation,identical_norm_rotation); + LLSelectedTE::getRotation(diff_rotation, identical_diff_rotation); + LLSelectedTEMaterial::getSpecularRotation(spec_rotation, identical_spec_rotation); + LLSelectedTEMaterial::getNormalRotation(norm_rotation, identical_norm_rotation); bool diff_rot_tentative = !(align_planar ? identical_planar_aligned : identical_diff_rotation); bool norm_rot_tentative = !(align_planar ? identical_planar_aligned : identical_norm_rotation); @@ -1566,11 +1564,11 @@ void LLPanelFace::updateUI(bool force_set_values /*false*/) getChildView("shinyRot")->setEnabled(editable && has_material && specmap_id.notNull()); getChildView("bumpyRot")->setEnabled(editable && has_material && normmap_id.notNull()); - getChild("TexRot")->setTentative(diff_rot_tentative); - getChild("shinyRot")->setTentative(LLSD(norm_rot_tentative)); - getChild("bumpyRot")->setTentative(LLSD(spec_rot_tentative)); + getChild("TexRot")->setTentative(LLSD(diff_rot_tentative)); + getChild("shinyRot")->setTentative(LLSD(spec_rot_tentative)); + getChild("bumpyRot")->setTentative(LLSD(norm_rot_tentative)); - getChild("TexRot")->setValue( editable ? diff_rot_deg : 0.0f); + getChild("TexRot")->setValue(editable ? diff_rot_deg : 0.0f); getChild("shinyRot")->setValue(editable ? spec_rot_deg : 0.0f); getChild("bumpyRot")->setValue(editable ? norm_rot_deg : 0.0f); } @@ -1578,7 +1576,7 @@ void LLPanelFace::updateUI(bool force_set_values /*false*/) { F32 glow = 0.f; bool identical_glow = false; - LLSelectedTE::getGlow(glow,identical_glow); + LLSelectedTE::getGlow(glow, identical_glow); mCtrlGlow->setValue(glow); mCtrlGlow->setTentative(!identical_glow); mCtrlGlow->setEnabled(editable); @@ -1598,7 +1596,7 @@ void LLPanelFace::updateUI(bool force_set_values /*false*/) U8 fullbright_flag = 0; bool identical_fullbright = false; - LLSelectedTE::getFullbright(fullbright_flag,identical_fullbright); + LLSelectedTE::getFullbright(fullbright_flag, identical_fullbright); mCheckFullbright->setValue((S32)(fullbright_flag != 0)); mCheckFullbright->setEnabled(editable && !has_pbr_material); @@ -1625,7 +1623,7 @@ void LLPanelFace::updateUI(bool force_set_values /*false*/) bool enabled = editable && (index != 1); bool identical_repeats = true; S32 material_selection = mComboMatMedia->getCurrentIndex(); - F32 repeats = 1.0f; + F32 repeats = 1.0f; U32 material_type = MATTYPE_DIFFUSE; if (material_selection == MATMEDIA_MATERIAL) @@ -1642,37 +1640,29 @@ void LLPanelFace::updateUI(bool force_set_values /*false*/) { default: case MATTYPE_DIFFUSE: - { if (material_selection != MATMEDIA_PBR) { enabled = editable && !id.isNull(); } identical_repeats = identical_diff_repeats; repeats = repeats_diff; - } - break; - + break; case MATTYPE_SPECULAR: - { if (material_selection != MATMEDIA_PBR) { enabled = (editable && ((shiny == SHINY_TEXTURE) && !specmap_id.isNull())); } identical_repeats = identical_spec_repeats; repeats = repeats_spec; - } - break; - + break; case MATTYPE_NORMAL: - { if (material_selection != MATMEDIA_PBR) { enabled = (editable && ((bumpy == BUMPY_TEXTURE) && !normmap_id.isNull())); } identical_repeats = identical_norm_repeats; repeats = repeats_norm; - } - break; + break; } bool repeats_tentative = !identical_repeats; @@ -1724,6 +1714,7 @@ void LLPanelFace::updateUI(bool force_set_values /*false*/) { LL_WARNS() << "failed childGetSelectionInterface for 'combobox alphamode'" << LL_ENDL; } + getChild("maskcutoff")->setValue(material->getAlphaMaskCutoff()); updateAlphaControls(); @@ -1735,8 +1726,8 @@ void LLPanelFace::updateUI(bool force_set_values /*false*/) if (!material->getSpecularID().isNull() && (shiny == SHINY_TEXTURE)) { - material->getSpecularOffset(offset_x,offset_y); - material->getSpecularRepeat(repeat_x,repeat_y); + material->getSpecularOffset(offset_x, offset_y); + material->getSpecularRepeat(repeat_x, repeat_y); if (identical_planar_texgen) { @@ -1747,7 +1738,7 @@ void LLPanelFace::updateUI(bool force_set_values /*false*/) rot = material->getSpecularRotation(); getChild("shinyScaleU")->setValue(repeat_x); getChild("shinyScaleV")->setValue(repeat_y); - getChild("shinyRot")->setValue(rot*RAD_TO_DEG); + getChild("shinyRot")->setValue(rot * RAD_TO_DEG); getChild("shinyOffsetU")->setValue(offset_x); getChild("shinyOffsetV")->setValue(offset_y); getChild("glossiness")->setValue(material->getSpecularLightExponent()); @@ -1785,7 +1776,7 @@ void LLPanelFace::updateUI(bool force_set_values /*false*/) rot = material->getNormalRotation(); getChild("bumpyScaleU")->setValue(repeat_x); getChild("bumpyScaleV")->setValue(repeat_y); - getChild("bumpyRot")->setValue(rot*RAD_TO_DEG); + getChild("bumpyRot")->setValue(rot * RAD_TO_DEG); getChild("bumpyOffsetU")->setValue(offset_x); getChild("bumpyOffsetV")->setValue(offset_y); @@ -1793,6 +1784,7 @@ void LLPanelFace::updateUI(bool force_set_values /*false*/) } } } + S32 selected_count = LLSelectMgr::getInstance()->getSelection()->getObjectCount(); bool single_volume = (selected_count == 1); mMenuClipboardColor->setEnabled(editable && single_volume); @@ -2814,65 +2806,58 @@ void LLPanelFace::updateMediaTitle() }; } -// -// Static functions -// - // static F32 LLPanelFace::valueGlow(LLViewerObject* object, S32 face) { return (F32)(object->getTE(face)->getGlow()); } - -void LLPanelFace::onCommitColor(const LLSD& data) +void LLPanelFace::onCommitColor() { sendColor(); } -void LLPanelFace::onCommitShinyColor(const LLSD& data) +void LLPanelFace::onCommitShinyColor() { LLSelectedTEMaterial::setSpecularLightColor(this, mShinyColorSwatch->get()); } -void LLPanelFace::onCommitAlpha(const LLSD& data) +void LLPanelFace::onCommitAlpha() { sendAlpha(); } -void LLPanelFace::onCancelColor(const LLSD& data) +void LLPanelFace::onCancelColor() { LLSelectMgr::getInstance()->selectionRevertColors(); } -void LLPanelFace::onCancelShinyColor(const LLSD& data) +void LLPanelFace::onCancelShinyColor() { LLSelectMgr::getInstance()->selectionRevertShinyColors(); } -void LLPanelFace::onSelectColor(const LLSD& data) +void LLPanelFace::onSelectColor() { LLSelectMgr::getInstance()->saveSelectedObjectColors(); sendColor(); } -void LLPanelFace::onSelectShinyColor(const LLSD& data) +void LLPanelFace::onSelectShinyColor() { LLSelectedTEMaterial::setSpecularLightColor(this, mShinyColorSwatch->get()); LLSelectMgr::getInstance()->saveSelectedShinyColors(); } -// static -void LLPanelFace::onCommitMaterialsMedia(LLUICtrl* ctrl, void* userdata) +void LLPanelFace::onCommitMaterialsMedia() { - LLPanelFace* self = (LLPanelFace*) userdata; // Force to default states to side-step problems with menu contents // and generally reflecting old state when switching tabs or objects // - self->updateShinyControls(false,true); - self->updateBumpyControls(false,true); - self->updateUI(); - self->refreshMedia(); + updateShinyControls(false, true); + updateBumpyControls(false, true); + updateUI(); + refreshMedia(); } void LLPanelFace::updateVisibility(LLViewerObject* objectp /* = nullptr */) @@ -2967,62 +2952,42 @@ void LLPanelFace::updateVisibility(LLViewerObject* objectp /* = nullptr */) updateVisibilityGLTF(objectp); } -// static -void LLPanelFace::onCommitMaterialType(LLUICtrl* ctrl, void* userdata) +void LLPanelFace::onCommitMaterialType() { - LLPanelFace* self = (LLPanelFace*) userdata; // Force to default states to side-step problems with menu contents // and generally reflecting old state when switching tabs or objects // - self->updateShinyControls(false,true); - self->updateBumpyControls(false,true); - self->updateUI(); + updateShinyControls(false, true); + updateBumpyControls(false, true); + updateUI(); } -// static -void LLPanelFace::onCommitPbrType(LLUICtrl* ctrl, void* userdata) +void LLPanelFace::onCommitPbrType() { - LLPanelFace* self = (LLPanelFace*)userdata; // Force to default states to side-step problems with menu contents // and generally reflecting old state when switching tabs or objects // - self->updateUI(); + updateUI(); } -// static -void LLPanelFace::onCommitBump(LLUICtrl* ctrl, void* userdata) +void LLPanelFace::onCommitBump() { - LLPanelFace* self = (LLPanelFace*) userdata; - - LLComboBox* mComboBumpiness = self->getChild("combobox bumpiness"); - if(!mComboBumpiness) - return; - - U32 bumpiness = mComboBumpiness->getCurrentIndex(); - - self->sendBump(bumpiness); + sendBump(getChild("combobox bumpiness")->getCurrentIndex()); } -// static -void LLPanelFace::onCommitTexGen(LLUICtrl* ctrl, void* userdata) +void LLPanelFace::onCommitTexGen() { - LLPanelFace* self = (LLPanelFace*) userdata; - self->sendTexGen(); + sendTexGen(); } -// static void LLPanelFace::updateShinyControls(bool is_setting_texture, bool mess_with_shiny_combobox) { LLUUID shiny_texture_ID = mShinyTextureCtrl->getImageAssetID(); LL_DEBUGS("Materials") << "Shiny texture selected: " << shiny_texture_ID << LL_ENDL; LLComboBox* comboShiny = getChild("combobox shininess"); - if(mess_with_shiny_combobox) + if (mess_with_shiny_combobox) { - if (!comboShiny) - { - return; - } if (!shiny_texture_ID.isNull() && is_setting_texture) { if (!comboShiny->itemExists(USE_TEXTURE)) @@ -3042,7 +3007,7 @@ void LLPanelFace::updateShinyControls(bool is_setting_texture, bool mess_with_sh } else { - if (shiny_texture_ID.isNull() && comboShiny && comboShiny->itemExists(USE_TEXTURE)) + if (shiny_texture_ID.isNull() && comboShiny->itemExists(USE_TEXTURE)) { comboShiny->remove(SHINY_TEXTURE); comboShiny->selectFirstItem(); @@ -3063,16 +3028,11 @@ void LLPanelFace::updateShinyControls(bool is_setting_texture, bool mess_with_sh mShinyColorSwatch->setVisible(show_shinyctrls); } -// static void LLPanelFace::updateBumpyControls(bool is_setting_texture, bool mess_with_combobox) { LLUUID bumpy_texture_ID = mBumpyTextureCtrl->getImageAssetID(); LL_DEBUGS("Materials") << "texture: " << bumpy_texture_ID << (mess_with_combobox ? "" : " do not") << " update combobox" << LL_ENDL; LLComboBox* comboBumpy = getChild("combobox bumpiness"); - if (!comboBumpy) - { - return; - } if (mess_with_combobox) { @@ -3095,43 +3055,18 @@ void LLPanelFace::updateBumpyControls(bool is_setting_texture, bool mess_with_co } } -// static -void LLPanelFace::onCommitShiny(LLUICtrl* ctrl, void* userdata) +void LLPanelFace::onCommitShiny() { - LLPanelFace* self = (LLPanelFace*) userdata; - - - LLComboBox* mComboShininess = self->getChild("combobox shininess"); - if(!mComboShininess) - return; - - U32 shininess = mComboShininess->getCurrentIndex(); - - self->sendShiny(shininess); + sendShiny(getChild("combobox shininess")->getCurrentIndex()); } -// static void LLPanelFace::updateAlphaControls() { - LLComboBox* comboAlphaMode = getChild("combobox alphamode"); - if (!comboAlphaMode) - { - return; - } - U32 alpha_value = comboAlphaMode->getCurrentIndex(); + U32 alpha_value = getChild("combobox alphamode")->getCurrentIndex(); bool show_alphactrls = (alpha_value == ALPHAMODE_MASK); // Alpha masking - U32 mat_media = MATMEDIA_MATERIAL; - if (mComboMatMedia) - { - mat_media = mComboMatMedia->getCurrentIndex(); - } - - U32 mat_type = MATTYPE_DIFFUSE; - if(mRadioMaterialType) - { - mat_type = mRadioMaterialType->getSelectedIndex(); - } + U32 mat_media = mComboMatMedia->getCurrentIndex(); + U32 mat_type = mRadioMaterialType->getSelectedIndex(); show_alphactrls = show_alphactrls && (mat_media == MATMEDIA_MATERIAL); show_alphactrls = show_alphactrls && (mat_type == MATTYPE_DIFFUSE); @@ -3140,30 +3075,23 @@ void LLPanelFace::updateAlphaControls() getChildView("maskcutoff")->setVisible(show_alphactrls); } -// static -void LLPanelFace::onCommitAlphaMode(LLUICtrl* ctrl, void* userdata) +void LLPanelFace::onCommitAlphaMode() { - LLPanelFace* self = (LLPanelFace*) userdata; - self->updateAlphaControls(); - LLSelectedTEMaterial::setDiffuseAlphaMode(self,self->getCurrentDiffuseAlphaMode()); + updateAlphaControls(); + LLSelectedTEMaterial::setDiffuseAlphaMode(this, getCurrentDiffuseAlphaMode()); } -// static -void LLPanelFace::onCommitFullbright(LLUICtrl* ctrl, void* userdata) +void LLPanelFace::onCommitFullbright() { - LLPanelFace* self = (LLPanelFace*) userdata; - self->sendFullbright(); + sendFullbright(); } -// static -void LLPanelFace::onCommitGlow(LLUICtrl* ctrl, void* userdata) +void LLPanelFace::onCommitGlow() { - LLPanelFace* self = (LLPanelFace*) userdata; - self->sendGlow(); + sendGlow(); } -// static -bool LLPanelFace::onDragPbr(LLUICtrl*, LLInventoryItem* item) +bool LLPanelFace::onDragPbr(LLInventoryItem* item) { bool accept = true; for (LLObjectSelection::root_iterator iter = LLSelectMgr::getInstance()->getSelection()->root_begin(); @@ -3180,9 +3108,8 @@ bool LLPanelFace::onDragPbr(LLUICtrl*, LLInventoryItem* item) return accept; } -void LLPanelFace::onCommitPbr(const LLSD& data) +void LLPanelFace::onCommitPbr() { - if (!mPBRTextureCtrl) return; if (!mPBRTextureCtrl->getTentative()) { // we grab the item id first, because we want to do a @@ -3200,16 +3127,15 @@ void LLPanelFace::onCommitPbr(const LLSD& data) } } -void LLPanelFace::onCancelPbr(const LLSD& data) +void LLPanelFace::onCancelPbr() { LLSelectMgr::getInstance()->selectionRevertGLTFMaterials(); } -void LLPanelFace::onSelectPbr(const LLSD& data) +void LLPanelFace::onSelectPbr() { LLSelectMgr::getInstance()->saveSelectedObjectTextures(); - if (!mPBRTextureCtrl) return; if (!mPBRTextureCtrl->getTentative()) { // we grab the item id first, because we want to do a @@ -3226,8 +3152,7 @@ void LLPanelFace::onSelectPbr(const LLSD& data) } } -// static -bool LLPanelFace::onDragTexture(LLUICtrl*, LLInventoryItem* item) +bool LLPanelFace::onDragTexture(LLInventoryItem* item) { bool accept = true; for (LLObjectSelection::root_iterator iter = LLSelectMgr::getInstance()->getSelection()->root_begin(); @@ -3244,18 +3169,18 @@ bool LLPanelFace::onDragTexture(LLUICtrl*, LLInventoryItem* item) return accept; } -void LLPanelFace::onCommitTexture( const LLSD& data ) +void LLPanelFace::onCommitTexture() { add(LLStatViewer::EDIT_TEXTURE, 1); sendTexture(); } -void LLPanelFace::onCancelTexture(const LLSD& data) +void LLPanelFace::onCancelTexture() { LLSelectMgr::getInstance()->selectionRevertTextures(); } -void LLPanelFace::onSelectTexture(const LLSD& data) +void LLPanelFace::onSelectTexture() { LLSelectMgr::getInstance()->saveSelectedObjectTextures(); sendTexture(); @@ -3265,31 +3190,25 @@ void LLPanelFace::onSelectTexture(const LLSD& data) bool missing_asset = false; LLSelectedTE::getImageFormat(image_format, identical_image_format, missing_asset); - LLCtrlSelectionInterface* combobox_alphamode = - childGetSelectionInterface("combobox alphamode"); - U32 alpha_mode = LLMaterial::DIFFUSE_ALPHA_MODE_NONE; - if (combobox_alphamode && !missing_asset) + if (!missing_asset) { switch (image_format) { case GL_RGBA: case GL_ALPHA: - { - alpha_mode = LLMaterial::DIFFUSE_ALPHA_MODE_BLEND; - } + alpha_mode = LLMaterial::DIFFUSE_ALPHA_MODE_BLEND; + break; + case GL_RGB: break; - - case GL_RGB: break; default: - { - LL_WARNS() << "Unexpected tex format in LLPanelFace...resorting to no alpha" << LL_ENDL; - } + LL_WARNS() << "Unexpected tex format in LLPanelFace...resorting to no alpha" << LL_ENDL; break; } - combobox_alphamode->selectNthItem(alpha_mode); + childGetSelectionInterface("combobox alphamode")->selectNthItem(alpha_mode); } + LLSelectedTEMaterial::setDiffuseAlphaMode(this, getCurrentDiffuseAlphaMode()); } @@ -3299,13 +3218,13 @@ void LLPanelFace::onCloseTexturePicker(const LLSD& data) updateUI(); } -void LLPanelFace::onCommitSpecularTexture( const LLSD& data ) +void LLPanelFace::onCommitSpecularTexture(const LLSD& data) { LL_DEBUGS("Materials") << data << LL_ENDL; sendShiny(SHINY_TEXTURE); } -void LLPanelFace::onCommitNormalTexture( const LLSD& data ) +void LLPanelFace::onCommitNormalTexture(const LLSD& data) { LL_DEBUGS("Materials") << data << LL_ENDL; LLUUID nmap_id = getCurrentNormalMap(); @@ -3348,34 +3267,32 @@ void LLPanelFace::onSelectNormalTexture(const LLSD& data) ////////////////////////////////////////////////////////////////////////////// // called when a user wants to edit existing media settings on a prim or prim face // TODO: test if there is media on the item and only allow editing if present -void LLPanelFace::onClickBtnEditMedia(LLUICtrl* ctrl, void* userdata) +void LLPanelFace::onClickBtnEditMedia() { - LLPanelFace* self = (LLPanelFace*)userdata; - self->refreshMedia(); + refreshMedia(); LLFloaterReg::showInstance("media_settings"); } ////////////////////////////////////////////////////////////////////////////// // called when a user wants to delete media from a prim or prim face -void LLPanelFace::onClickBtnDeleteMedia(LLUICtrl* ctrl, void* userdata) +void LLPanelFace::onClickBtnDeleteMedia() { LLNotificationsUtil::add("DeleteMedia", LLSD(), LLSD(), deleteMediaConfirm); } ////////////////////////////////////////////////////////////////////////////// // called when a user wants to add media to a prim or prim face -void LLPanelFace::onClickBtnAddMedia(LLUICtrl* ctrl, void* userdata) +void LLPanelFace::onClickBtnAddMedia() { // check if multiple faces are selected if (LLSelectMgr::getInstance()->getSelection()->isMultipleTESelected()) { - LLPanelFace* self = (LLPanelFace*)userdata; - self->refreshMedia(); + refreshMedia(); LLNotificationsUtil::add("MultipleFacesSelected", LLSD(), LLSD(), multipleFacesSelectedConfirm); } else { - onClickBtnEditMedia(ctrl, userdata); + onClickBtnEditMedia(); } } @@ -3416,396 +3333,316 @@ bool LLPanelFace::multipleFacesSelectedConfirm(const LLSD& notification, const L return false; } -//static -void LLPanelFace::syncOffsetX(LLPanelFace* self, F32 offsetU) +void LLPanelFace::syncOffsetX(F32 offsetU) { - LLSelectedTEMaterial::setNormalOffsetX(self,offsetU); - LLSelectedTEMaterial::setSpecularOffsetX(self,offsetU); - self->getChild("TexOffsetU")->forceSetValue(offsetU); - self->sendTextureInfo(); + LLSelectedTEMaterial::setNormalOffsetX(this, offsetU); + LLSelectedTEMaterial::setSpecularOffsetX(this, offsetU); + getChild("TexOffsetU")->forceSetValue(LLSD(offsetU)); + sendTextureInfo(); } -//static -void LLPanelFace::syncOffsetY(LLPanelFace* self, F32 offsetV) +void LLPanelFace::syncOffsetY(F32 offsetV) { - LLSelectedTEMaterial::setNormalOffsetY(self,offsetV); - LLSelectedTEMaterial::setSpecularOffsetY(self,offsetV); - self->getChild("TexOffsetV")->forceSetValue(offsetV); - self->sendTextureInfo(); + LLSelectedTEMaterial::setNormalOffsetY(this, offsetV); + LLSelectedTEMaterial::setSpecularOffsetY(this, offsetV); + getChild("TexOffsetV")->forceSetValue(LLSD(offsetV)); + sendTextureInfo(); } -//static -void LLPanelFace::onCommitMaterialBumpyOffsetX(LLUICtrl* ctrl, void* userdata) +void LLPanelFace::onCommitMaterialBumpyOffsetX() { - LLPanelFace* self = (LLPanelFace*) userdata; - llassert_always(self); - if (gSavedSettings.getBOOL("SyncMaterialSettings")) { - syncOffsetX(self,self->getCurrentBumpyOffsetU()); + syncOffsetX(getCurrentBumpyOffsetU()); } else { - LLSelectedTEMaterial::setNormalOffsetX(self,self->getCurrentBumpyOffsetU()); + LLSelectedTEMaterial::setNormalOffsetX(this, getCurrentBumpyOffsetU()); } - } -//static -void LLPanelFace::onCommitMaterialBumpyOffsetY(LLUICtrl* ctrl, void* userdata) +void LLPanelFace::onCommitMaterialBumpyOffsetY() { - LLPanelFace* self = (LLPanelFace*) userdata; - llassert_always(self); - if (gSavedSettings.getBOOL("SyncMaterialSettings")) { - syncOffsetY(self,self->getCurrentBumpyOffsetV()); + syncOffsetY(getCurrentBumpyOffsetV()); } else { - LLSelectedTEMaterial::setNormalOffsetY(self,self->getCurrentBumpyOffsetV()); + LLSelectedTEMaterial::setNormalOffsetY(this, getCurrentBumpyOffsetV()); } } -//static -void LLPanelFace::onCommitMaterialShinyOffsetX(LLUICtrl* ctrl, void* userdata) +void LLPanelFace::onCommitMaterialShinyOffsetX() { - LLPanelFace* self = (LLPanelFace*) userdata; - llassert_always(self); - if (gSavedSettings.getBOOL("SyncMaterialSettings")) { - syncOffsetX(self, self->getCurrentShinyOffsetU()); + syncOffsetX(getCurrentShinyOffsetU()); } else { - LLSelectedTEMaterial::setSpecularOffsetX(self,self->getCurrentShinyOffsetU()); + LLSelectedTEMaterial::setSpecularOffsetX(this, getCurrentShinyOffsetU()); } } -//static -void LLPanelFace::onCommitMaterialShinyOffsetY(LLUICtrl* ctrl, void* userdata) +void LLPanelFace::onCommitMaterialShinyOffsetY() { - LLPanelFace* self = (LLPanelFace*) userdata; - llassert_always(self); - if (gSavedSettings.getBOOL("SyncMaterialSettings")) { - syncOffsetY(self,self->getCurrentShinyOffsetV()); + syncOffsetY(getCurrentShinyOffsetV()); } else { - LLSelectedTEMaterial::setSpecularOffsetY(self,self->getCurrentShinyOffsetV()); + LLSelectedTEMaterial::setSpecularOffsetY(this, getCurrentShinyOffsetV()); } } -//static -void LLPanelFace::syncRepeatX(LLPanelFace* self, F32 scaleU) +void LLPanelFace::syncRepeatX(F32 scaleU) { - LLSelectedTEMaterial::setNormalRepeatX(self,scaleU); - LLSelectedTEMaterial::setSpecularRepeatX(self,scaleU); - self->sendTextureInfo(); + LLSelectedTEMaterial::setNormalRepeatX(this, scaleU); + LLSelectedTEMaterial::setSpecularRepeatX(this, scaleU); + sendTextureInfo(); } -//static -void LLPanelFace::syncRepeatY(LLPanelFace* self, F32 scaleV) +void LLPanelFace::syncRepeatY(F32 scaleV) { - LLSelectedTEMaterial::setNormalRepeatY(self,scaleV); - LLSelectedTEMaterial::setSpecularRepeatY(self,scaleV); - self->sendTextureInfo(); + LLSelectedTEMaterial::setNormalRepeatY(this, scaleV); + LLSelectedTEMaterial::setSpecularRepeatY(this, scaleV); + sendTextureInfo(); } -//static -void LLPanelFace::onCommitMaterialBumpyScaleX(LLUICtrl* ctrl, void* userdata) +void LLPanelFace::onCommitMaterialBumpyScaleX() { - LLPanelFace* self = (LLPanelFace*) userdata; - llassert_always(self); - F32 bumpy_scale_u = self->getCurrentBumpyScaleU(); - if (self->isIdenticalPlanarTexgen()) + F32 bumpy_scale_u = getCurrentBumpyScaleU(); + if (isIdenticalPlanarTexgen()) { bumpy_scale_u *= 0.5f; } if (gSavedSettings.getBOOL("SyncMaterialSettings")) { - self->getChild("TexScaleU")->forceSetValue(self->getCurrentBumpyScaleU()); - syncRepeatX(self, bumpy_scale_u); + getChild("TexScaleU")->forceSetValue(getCurrentBumpyScaleU()); + syncRepeatX(bumpy_scale_u); } else { - LLSelectedTEMaterial::setNormalRepeatX(self,bumpy_scale_u); + LLSelectedTEMaterial::setNormalRepeatX(this, bumpy_scale_u); } } -//static -void LLPanelFace::onCommitMaterialBumpyScaleY(LLUICtrl* ctrl, void* userdata) +void LLPanelFace::onCommitMaterialBumpyScaleY() { - LLPanelFace* self = (LLPanelFace*) userdata; - llassert_always(self); - F32 bumpy_scale_v = self->getCurrentBumpyScaleV(); - if (self->isIdenticalPlanarTexgen()) + F32 bumpy_scale_v = getCurrentBumpyScaleV(); + if (isIdenticalPlanarTexgen()) { bumpy_scale_v *= 0.5f; } - if (gSavedSettings.getBOOL("SyncMaterialSettings")) { - self->getChild("TexScaleV")->forceSetValue(self->getCurrentBumpyScaleV()); - syncRepeatY(self, bumpy_scale_v); + getChild("TexScaleV")->forceSetValue(getCurrentBumpyScaleV()); + syncRepeatY(bumpy_scale_v); } else { - LLSelectedTEMaterial::setNormalRepeatY(self,bumpy_scale_v); + LLSelectedTEMaterial::setNormalRepeatY(this, bumpy_scale_v); } } -//static -void LLPanelFace::onCommitMaterialShinyScaleX(LLUICtrl* ctrl, void* userdata) +void LLPanelFace::onCommitMaterialShinyScaleX() { - LLPanelFace* self = (LLPanelFace*) userdata; - llassert_always(self); - F32 shiny_scale_u = self->getCurrentShinyScaleU(); - if (self->isIdenticalPlanarTexgen()) + F32 shiny_scale_u = getCurrentShinyScaleU(); + if (isIdenticalPlanarTexgen()) { shiny_scale_u *= 0.5f; } if (gSavedSettings.getBOOL("SyncMaterialSettings")) { - self->getChild("TexScaleU")->forceSetValue(self->getCurrentShinyScaleU()); - syncRepeatX(self, shiny_scale_u); + getChild("TexScaleU")->forceSetValue(LLSD(getCurrentShinyScaleU())); + syncRepeatX(shiny_scale_u); } else { - LLSelectedTEMaterial::setSpecularRepeatX(self,shiny_scale_u); + LLSelectedTEMaterial::setSpecularRepeatX(this, shiny_scale_u); } } -//static -void LLPanelFace::onCommitMaterialShinyScaleY(LLUICtrl* ctrl, void* userdata) +void LLPanelFace::onCommitMaterialShinyScaleY() { - LLPanelFace* self = (LLPanelFace*) userdata; - llassert_always(self); - F32 shiny_scale_v = self->getCurrentShinyScaleV(); - if (self->isIdenticalPlanarTexgen()) + F32 shiny_scale_v = getCurrentShinyScaleV(); + if (isIdenticalPlanarTexgen()) { shiny_scale_v *= 0.5f; } if (gSavedSettings.getBOOL("SyncMaterialSettings")) { - self->getChild("TexScaleV")->forceSetValue(self->getCurrentShinyScaleV()); - syncRepeatY(self, shiny_scale_v); + getChild("TexScaleV")->forceSetValue(LLSD(getCurrentShinyScaleV())); + syncRepeatY(shiny_scale_v); } else { - LLSelectedTEMaterial::setSpecularRepeatY(self,shiny_scale_v); + LLSelectedTEMaterial::setSpecularRepeatY(this, shiny_scale_v); } } -//static -void LLPanelFace::syncMaterialRot(LLPanelFace* self, F32 rot, int te) +void LLPanelFace::syncMaterialRot(F32 rot, int te) { - LLSelectedTEMaterial::setNormalRotation(self,rot * DEG_TO_RAD, te); - LLSelectedTEMaterial::setSpecularRotation(self,rot * DEG_TO_RAD, te); - self->sendTextureInfo(); + LLSelectedTEMaterial::setNormalRotation(this, rot * DEG_TO_RAD, te); + LLSelectedTEMaterial::setSpecularRotation(this, rot * DEG_TO_RAD, te); + sendTextureInfo(); } -//static -void LLPanelFace::onCommitMaterialBumpyRot(LLUICtrl* ctrl, void* userdata) +void LLPanelFace::onCommitMaterialBumpyRot() { - LLPanelFace* self = (LLPanelFace*) userdata; - llassert_always(self); - if (gSavedSettings.getBOOL("SyncMaterialSettings")) { - self->getChild("TexRot")->forceSetValue(self->getCurrentBumpyRot()); - syncMaterialRot(self, self->getCurrentBumpyRot()); + getChild("TexRot")->forceSetValue(LLSD(getCurrentBumpyRot())); + syncMaterialRot(getCurrentBumpyRot()); } else { - if ((bool)self->childGetValue("checkbox planar align").asBoolean()) + if (childGetValue("checkbox planar align").asBoolean()) { LLFace* last_face = NULL; bool identical_face = false; LLSelectedTE::getFace(last_face, identical_face); - LLPanelFaceSetAlignedTEFunctor setfunc(self, last_face); + LLPanelFaceSetAlignedTEFunctor setfunc(this, last_face); LLSelectMgr::getInstance()->getSelection()->applyToTEs(&setfunc); } else { - LLSelectedTEMaterial::setNormalRotation(self, self->getCurrentBumpyRot() * DEG_TO_RAD); + LLSelectedTEMaterial::setNormalRotation(this, getCurrentBumpyRot() * DEG_TO_RAD); } } } -//static -void LLPanelFace::onCommitMaterialShinyRot(LLUICtrl* ctrl, void* userdata) +void LLPanelFace::onCommitMaterialShinyRot() { - LLPanelFace* self = (LLPanelFace*) userdata; - llassert_always(self); - if (gSavedSettings.getBOOL("SyncMaterialSettings")) { - self->getChild("TexRot")->forceSetValue(self->getCurrentShinyRot()); - syncMaterialRot(self, self->getCurrentShinyRot()); + getChild("TexRot")->forceSetValue(LLSD(getCurrentShinyRot())); + syncMaterialRot(getCurrentShinyRot()); } else { - if ((bool)self->childGetValue("checkbox planar align").asBoolean()) + if (childGetValue("checkbox planar align").asBoolean()) { LLFace* last_face = NULL; bool identical_face = false; LLSelectedTE::getFace(last_face, identical_face); - LLPanelFaceSetAlignedTEFunctor setfunc(self, last_face); + LLPanelFaceSetAlignedTEFunctor setfunc(this, last_face); LLSelectMgr::getInstance()->getSelection()->applyToTEs(&setfunc); } else { - LLSelectedTEMaterial::setSpecularRotation(self, self->getCurrentShinyRot() * DEG_TO_RAD); + LLSelectedTEMaterial::setSpecularRotation(this, getCurrentShinyRot() * DEG_TO_RAD); } } } -//static -void LLPanelFace::onCommitMaterialGloss(LLUICtrl* ctrl, void* userdata) +void LLPanelFace::onCommitMaterialGloss() { - LLPanelFace* self = (LLPanelFace*) userdata; - llassert_always(self); - LLSelectedTEMaterial::setSpecularLightExponent(self,self->getCurrentGlossiness()); + LLSelectedTEMaterial::setSpecularLightExponent(this, getCurrentGlossiness()); } -//static -void LLPanelFace::onCommitMaterialEnv(LLUICtrl* ctrl, void* userdata) +void LLPanelFace::onCommitMaterialEnv() { - LLPanelFace* self = (LLPanelFace*) userdata; - llassert_always(self); - LLSelectedTEMaterial::setEnvironmentIntensity(self,self->getCurrentEnvIntensity()); + LLSelectedTEMaterial::setEnvironmentIntensity(this, getCurrentEnvIntensity()); } -//static -void LLPanelFace::onCommitMaterialMaskCutoff(LLUICtrl* ctrl, void* userdata) +void LLPanelFace::onCommitMaterialMaskCutoff() { - LLPanelFace* self = (LLPanelFace*) userdata; - LLSelectedTEMaterial::setAlphaMaskCutoff(self,self->getCurrentAlphaMaskCutoff()); + LLSelectedTEMaterial::setAlphaMaskCutoff(this, getCurrentAlphaMaskCutoff()); } -// static -void LLPanelFace::onCommitTextureInfo( LLUICtrl* ctrl, void* userdata ) +void LLPanelFace::onCommitTextureInfo() { - LLPanelFace* self = (LLPanelFace*) userdata; - self->sendTextureInfo(); + sendTextureInfo(); // vertical scale and repeats per meter depends on each other, so force set on changes - self->updateUI(true); + updateUI(true); } -// static -void LLPanelFace::onCommitTextureScaleX( LLUICtrl* ctrl, void* userdata ) +void LLPanelFace::onCommitTextureScaleX() { - LLPanelFace* self = (LLPanelFace*) userdata; if (gSavedSettings.getBOOL("SyncMaterialSettings")) { - F32 bumpy_scale_u = (F32)self->getChild("TexScaleU")->getValue().asReal(); - if (self->isIdenticalPlanarTexgen()) + F32 bumpy_scale_u = (F32)getChild("TexScaleU")->getValue().asReal(); + if (isIdenticalPlanarTexgen()) { bumpy_scale_u *= 0.5f; } - syncRepeatX(self, bumpy_scale_u); + syncRepeatX(bumpy_scale_u); } else { - self->sendTextureInfo(); + sendTextureInfo(); } - self->updateUI(true); + updateUI(true); } -// static -void LLPanelFace::onCommitTextureScaleY( LLUICtrl* ctrl, void* userdata ) +void LLPanelFace::onCommitTextureScaleY() { - LLPanelFace* self = (LLPanelFace*) userdata; if (gSavedSettings.getBOOL("SyncMaterialSettings")) { - F32 bumpy_scale_v = (F32)self->getChild("TexScaleV")->getValue().asReal(); - if (self->isIdenticalPlanarTexgen()) + F32 bumpy_scale_v = (F32)getChild("TexScaleV")->getValue().asReal(); + if (isIdenticalPlanarTexgen()) { bumpy_scale_v *= 0.5f; } - syncRepeatY(self, bumpy_scale_v); + syncRepeatY(bumpy_scale_v); } else { - self->sendTextureInfo(); + sendTextureInfo(); } - self->updateUI(true); + updateUI(true); } -// static -void LLPanelFace::onCommitTextureRot( LLUICtrl* ctrl, void* userdata ) +void LLPanelFace::onCommitTextureRot() { - LLPanelFace* self = (LLPanelFace*) userdata; - if (gSavedSettings.getBOOL("SyncMaterialSettings")) { - syncMaterialRot(self, (F32)self->getChild("TexRot")->getValue().asReal()); + syncMaterialRot((F32)getChild("TexRot")->getValue().asReal()); } else { - self->sendTextureInfo(); + sendTextureInfo(); } - self->updateUI(true); + updateUI(true); } -// static -void LLPanelFace::onCommitTextureOffsetX( LLUICtrl* ctrl, void* userdata ) +void LLPanelFace::onCommitTextureOffsetX() { - LLPanelFace* self = (LLPanelFace*) userdata; if (gSavedSettings.getBOOL("SyncMaterialSettings")) { - syncOffsetX(self, (F32)self->getChild("TexOffsetU")->getValue().asReal()); + syncOffsetX((F32)getChild("TexOffsetU")->getValue().asReal()); } else { - self->sendTextureInfo(); + sendTextureInfo(); } - self->updateUI(true); + updateUI(true); } -// static -void LLPanelFace::onCommitTextureOffsetY( LLUICtrl* ctrl, void* userdata ) +void LLPanelFace::onCommitTextureOffsetY() { - LLPanelFace* self = (LLPanelFace*) userdata; if (gSavedSettings.getBOOL("SyncMaterialSettings")) { - syncOffsetY(self, (F32)self->getChild("TexOffsetV")->getValue().asReal()); + syncOffsetY((F32)getChild("TexOffsetV")->getValue().asReal()); } else { - self->sendTextureInfo(); + sendTextureInfo(); } - self->updateUI(true); + updateUI(true); } // Commit the number of repeats per meter -// static -void LLPanelFace::onCommitRepeatsPerMeter(LLUICtrl* ctrl, void* userdata) +void LLPanelFace::onCommitRepeatsPerMeter() { - LLPanelFace *self = (LLPanelFace *) userdata; - - LLUICtrl *repeats_ctrl = self->getChild("rptctrl"); - - U32 materials_media = self->mComboMatMedia->getCurrentIndex(); - U32 material_type = 0; - if (materials_media == MATMEDIA_PBR) - { - material_type = self->mRadioPbrType->getSelectedIndex(); - } - if (materials_media == MATMEDIA_MATERIAL) - { - material_type = self->mRadioMaterialType->getSelectedIndex(); - } - - F32 repeats_per_meter = (F32) repeats_ctrl->getValue().asReal(); + F32 repeats_per_meter = (F32)getChild("rptctrl")->getValue().asReal(); F32 obj_scale_s = 1.0f; F32 obj_scale_t = 1.0f; @@ -3816,64 +3653,57 @@ void LLPanelFace::onCommitRepeatsPerMeter(LLUICtrl* ctrl, void* userdata) LLSelectedTE::getObjectScaleS(obj_scale_s, identical_scale_s); LLSelectedTE::getObjectScaleS(obj_scale_t, identical_scale_t); - LLUICtrl *bumpy_scale_u = self->getChild("bumpyScaleU"); - LLUICtrl *bumpy_scale_v = self->getChild("bumpyScaleV"); - LLUICtrl *shiny_scale_u = self->getChild("shinyScaleU"); - LLUICtrl *shiny_scale_v = self->getChild("shinyScaleV"); + LLUICtrl* bumpy_scale_u = getChild("bumpyScaleU"); + LLUICtrl* bumpy_scale_v = getChild("bumpyScaleV"); + LLUICtrl* shiny_scale_u = getChild("shinyScaleU"); + LLUICtrl* shiny_scale_v = getChild("shinyScaleV"); if (gSavedSettings.getBOOL("SyncMaterialSettings")) { - LLSelectMgr::getInstance()->selectionTexScaleAutofit( repeats_per_meter ); + LLSelectMgr::getInstance()->selectionTexScaleAutofit(repeats_per_meter); bumpy_scale_u->setValue(obj_scale_s * repeats_per_meter); bumpy_scale_v->setValue(obj_scale_t * repeats_per_meter); - LLSelectedTEMaterial::setNormalRepeatX(self,obj_scale_s * repeats_per_meter); - LLSelectedTEMaterial::setNormalRepeatY(self,obj_scale_t * repeats_per_meter); + LLSelectedTEMaterial::setNormalRepeatX(this, obj_scale_s * repeats_per_meter); + LLSelectedTEMaterial::setNormalRepeatY(this, obj_scale_t * repeats_per_meter); shiny_scale_u->setValue(obj_scale_s * repeats_per_meter); shiny_scale_v->setValue(obj_scale_t * repeats_per_meter); - LLSelectedTEMaterial::setSpecularRepeatX(self,obj_scale_s * repeats_per_meter); - LLSelectedTEMaterial::setSpecularRepeatY(self,obj_scale_t * repeats_per_meter); + LLSelectedTEMaterial::setSpecularRepeatX(this, obj_scale_s * repeats_per_meter); + LLSelectedTEMaterial::setSpecularRepeatY(this, obj_scale_t * repeats_per_meter); } else { + U32 material_type = mRadioMaterialType->getSelectedIndex(); switch (material_type) { - case MATTYPE_DIFFUSE: - { - LLSelectMgr::getInstance()->selectionTexScaleAutofit( repeats_per_meter ); - } + case MATTYPE_DIFFUSE: + LLSelectMgr::getInstance()->selectionTexScaleAutofit(repeats_per_meter); break; + case MATTYPE_NORMAL: + bumpy_scale_u->setValue(obj_scale_s * repeats_per_meter); + bumpy_scale_v->setValue(obj_scale_t * repeats_per_meter); - case MATTYPE_NORMAL: - { - bumpy_scale_u->setValue(obj_scale_s * repeats_per_meter); - bumpy_scale_v->setValue(obj_scale_t * repeats_per_meter); - - LLSelectedTEMaterial::setNormalRepeatX(self,obj_scale_s * repeats_per_meter); - LLSelectedTEMaterial::setNormalRepeatY(self,obj_scale_t * repeats_per_meter); - } + LLSelectedTEMaterial::setNormalRepeatX(this, obj_scale_s * repeats_per_meter); + LLSelectedTEMaterial::setNormalRepeatY(this, obj_scale_t * repeats_per_meter); break; + case MATTYPE_SPECULAR: + bumpy_scale_u->setValue(obj_scale_s * repeats_per_meter); + bumpy_scale_v->setValue(obj_scale_t * repeats_per_meter); - case MATTYPE_SPECULAR: - { - shiny_scale_u->setValue(obj_scale_s * repeats_per_meter); - shiny_scale_v->setValue(obj_scale_t * repeats_per_meter); - - LLSelectedTEMaterial::setSpecularRepeatX(self,obj_scale_s * repeats_per_meter); - LLSelectedTEMaterial::setSpecularRepeatY(self,obj_scale_t * repeats_per_meter); - } + LLSelectedTEMaterial::setSpecularRepeatX(this, obj_scale_s * repeats_per_meter); + LLSelectedTEMaterial::setSpecularRepeatY(this, obj_scale_t * repeats_per_meter); + break; + default: + llassert(false); break; - - default: - llassert(false); - break; } } + // vertical scale and repeats per meter depends on each other, so force set on changes - self->updateUI(true); + updateUI(true); } struct LLPanelFaceSetMediaFunctor : public LLSelectedTEFunctor @@ -3883,22 +3713,20 @@ struct LLPanelFaceSetMediaFunctor : public LLSelectedTEFunctor viewer_media_t pMediaImpl; const LLTextureEntry* tep = object->getTE(te); - const LLMediaEntry* mep = tep->hasMedia() ? tep->getMediaData() : NULL; - if ( mep ) + if (const LLMediaEntry* mep = tep->hasMedia() ? tep->getMediaData() : NULL) { pMediaImpl = LLViewerMedia::getInstance()->getMediaImplFromTextureID(mep->getMediaID()); } - if ( pMediaImpl.isNull()) + if (pMediaImpl.isNull()) { // If we didn't find face media for this face, check whether this face is showing parcel media. pMediaImpl = LLViewerMedia::getInstance()->getMediaImplFromTextureID(tep->getID()); } - if ( pMediaImpl.notNull()) + if (pMediaImpl.notNull()) { - LLPluginClassMedia *media = pMediaImpl->getMediaPlugin(); - if(media) + if (LLPluginClassMedia* media = pMediaImpl->getMediaPlugin()) { S32 media_width = media->getWidth(); S32 media_height = media->getHeight(); @@ -3908,17 +3736,17 @@ struct LLPanelFaceSetMediaFunctor : public LLSelectedTEFunctor F32 scale_t = (F32)media_height / (F32)texture_height; // set scale and adjust offset - object->setTEScaleS( te, scale_s ); - object->setTEScaleT( te, scale_t ); // don't need to flip Y anymore since QT does this for us now. - object->setTEOffsetS( te, -( 1.0f - scale_s ) / 2.0f ); - object->setTEOffsetT( te, -( 1.0f - scale_t ) / 2.0f ); + object->setTEScaleS(te, scale_s); + object->setTEScaleT(te, scale_t); // don't need to flip Y anymore since QT does this for us now. + object->setTEOffsetS(te, -( 1.0f - scale_s ) / 2.0f); + object->setTEOffsetT(te, -( 1.0f - scale_t ) / 2.0f); } } return true; }; }; -void LLPanelFace::onClickAutoFix(void* userdata) +void LLPanelFace::onClickAutoFix() { LLPanelFaceSetMediaFunctor setfunc; LLSelectMgr::getInstance()->getSelection()->applyToTEs(&setfunc); @@ -3927,25 +3755,23 @@ void LLPanelFace::onClickAutoFix(void* userdata) LLSelectMgr::getInstance()->getSelection()->applyToObjects(&sendfunc); } -void LLPanelFace::onAlignTexture(void* userdata) +void LLPanelFace::onAlignTexture() { - LLPanelFace* self = (LLPanelFace*)userdata; - self->alignTextureLayer(); + alignTextureLayer(); } -void LLPanelFace::onClickBtnLoadInvPBR(void* userdata) +void LLPanelFace::onClickBtnLoadInvPBR() { // Shouldn't this be "save to inventory?" - LLPanelFace* self = (LLPanelFace*)userdata; - self->mPBRTextureCtrl->showPicker(true); + mPBRTextureCtrl->showPicker(true); } -void LLPanelFace::onClickBtnEditPBR(void* userdata) +void LLPanelFace::onClickBtnEditPBR() { LLMaterialEditor::loadLive(); } -void LLPanelFace::onClickBtnSavePBR(void* userdata) +void LLPanelFace::onClickBtnSavePBR() { LLMaterialEditor::saveObjectsMaterialAs(); } @@ -4806,44 +4632,39 @@ bool LLPanelFace::menuEnableItem(const LLSD& userdata) return false; } - -// static -void LLPanelFace::onCommitPlanarAlign(LLUICtrl* ctrl, void* userdata) +void LLPanelFace::onCommitPlanarAlign() { - LLPanelFace* self = (LLPanelFace*) userdata; - self->getState(); - self->sendTextureInfo(); + getState(); + sendTextureInfo(); } -void LLPanelFace::updateGLTFTextureTransform(float value, U32 pbr_type, std::function edit) +void LLPanelFace::updateGLTFTextureTransform(std::function edit) { - U32 texture_info_start; - U32 texture_info_end; - const LLGLTFMaterial::TextureInfo texture_info = texture_info_from_pbrtype(pbr_type); + const LLGLTFMaterial::TextureInfo texture_info = texture_info_from_pbrtype(mRadioPbrType->getSelectedIndex()); if (texture_info == LLGLTFMaterial::GLTF_TEXTURE_INFO_COUNT) { - texture_info_start = 0; - texture_info_end = LLGLTFMaterial::GLTF_TEXTURE_INFO_COUNT; + updateSelectedGLTFMaterials([&](LLGLTFMaterial* new_override) + { + for (U32 i = 0; i < LLGLTFMaterial::GLTF_TEXTURE_INFO_COUNT; ++i) + { + LLGLTFMaterial::TextureTransform& new_transform = new_override->mTextureTransform[(LLGLTFMaterial::TextureInfo)i]; + edit(&new_transform); + } + }); } else { - texture_info_start = texture_info_from_pbrtype(pbr_type); - texture_info_end = texture_info_start + 1; + updateSelectedGLTFMaterials([&](LLGLTFMaterial* new_override) + { + LLGLTFMaterial::TextureTransform& new_transform = new_override->mTextureTransform[texture_info]; + edit(&new_transform); + }); } - updateSelectedGLTFMaterials([&](LLGLTFMaterial* new_override) - { - for (U32 ti = texture_info_start; ti < texture_info_end; ++ti) - { - LLGLTFMaterial::TextureTransform& new_transform = new_override->mTextureTransform[(LLGLTFMaterial::TextureInfo)ti]; - edit(&new_transform); - } - }); } void LLPanelFace::setMaterialOverridesFromSelection() { - const U32 pbr_type = mRadioPbrType->getSelectedIndex(); - const LLGLTFMaterial::TextureInfo texture_info = texture_info_from_pbrtype(pbr_type); + const LLGLTFMaterial::TextureInfo texture_info = texture_info_from_pbrtype(mRadioPbrType->getSelectedIndex()); U32 texture_info_start; U32 texture_info_end; if (texture_info == LLGLTFMaterial::TextureInfo::GLTF_TEXTURE_INFO_COUNT) @@ -5009,51 +4830,46 @@ bool LLPanelFace::Selection::compareSelection() return selection_changed; } -void LLPanelFace::onCommitGLTFTextureScaleU(LLUICtrl* ctrl) +void LLPanelFace::onCommitGLTFTextureScaleU() { - const float value = (F32)ctrl->getValue().asReal(); - const U32 pbr_type = mRadioPbrType->getSelectedIndex(); - updateGLTFTextureTransform(value, pbr_type, [&](LLGLTFMaterial::TextureTransform* new_transform) + F32 value = (F32)getChild("gltfTextureScaleU")->getValue().asReal(); + updateGLTFTextureTransform([&](LLGLTFMaterial::TextureTransform* new_transform) { new_transform->mScale.mV[VX] = value; }); } -void LLPanelFace::onCommitGLTFTextureScaleV(LLUICtrl* ctrl) +void LLPanelFace::onCommitGLTFTextureScaleV() { - const float value = (F32)ctrl->getValue().asReal(); - const U32 pbr_type = mRadioPbrType->getSelectedIndex(); - updateGLTFTextureTransform(value, pbr_type, [&](LLGLTFMaterial::TextureTransform* new_transform) + F32 value = (F32)getChild("gltfTextureScaleV")->getValue().asReal(); + updateGLTFTextureTransform([&](LLGLTFMaterial::TextureTransform* new_transform) { new_transform->mScale.mV[VY] = value; }); } -void LLPanelFace::onCommitGLTFRotation(LLUICtrl* ctrl) +void LLPanelFace::onCommitGLTFRotation() { - const float value = (F32)ctrl->getValue().asReal() * DEG_TO_RAD; - const U32 pbr_type = mRadioPbrType->getSelectedIndex(); - updateGLTFTextureTransform(value, pbr_type, [&](LLGLTFMaterial::TextureTransform* new_transform) + F32 value = (F32)getChild("gltfTextureRotation")->getValue().asReal() * DEG_TO_RAD; + updateGLTFTextureTransform([&](LLGLTFMaterial::TextureTransform* new_transform) { new_transform->mRotation = value; }); } -void LLPanelFace::onCommitGLTFTextureOffsetU(LLUICtrl* ctrl) +void LLPanelFace::onCommitGLTFTextureOffsetU() { - const float value = (F32)ctrl->getValue().asReal(); - const U32 pbr_type = mRadioPbrType->getSelectedIndex(); - updateGLTFTextureTransform(value, pbr_type, [&](LLGLTFMaterial::TextureTransform* new_transform) + F32 value = (F32)getChild("gltfTextureOffsetU")->getValue().asReal(); + updateGLTFTextureTransform([&](LLGLTFMaterial::TextureTransform* new_transform) { new_transform->mOffset.mV[VX] = value; }); } -void LLPanelFace::onCommitGLTFTextureOffsetV(LLUICtrl* ctrl) +void LLPanelFace::onCommitGLTFTextureOffsetV() { - const float value = (F32)ctrl->getValue().asReal(); - const U32 pbr_type = mRadioPbrType->getSelectedIndex(); - updateGLTFTextureTransform(value, pbr_type, [&](LLGLTFMaterial::TextureTransform* new_transform) + F32 value = (F32)getChild("gltfTextureOffsetV")->getValue().asReal(); + updateGLTFTextureTransform([&](LLGLTFMaterial::TextureTransform* new_transform) { new_transform->mOffset.mV[VY] = value; }); @@ -5063,20 +4879,20 @@ void LLPanelFace::onTextureSelectionChanged(LLInventoryItem* itemp) { LL_DEBUGS("Materials") << "item asset " << itemp->getAssetUUID() << LL_ENDL; + LLTextureCtrl* texture_ctrl; U32 mattype = mRadioMaterialType->getSelectedIndex(); - std::string which_control="texture control"; switch (mattype) { case MATTYPE_SPECULAR: - which_control = "shinytexture control"; + texture_ctrl = getChild("shinytexture control"); break; case MATTYPE_NORMAL: - which_control = "bumpytexture control"; + texture_ctrl = getChild("bumpytexture control"); break; - // no default needed + default: + texture_ctrl = getChild("texture control"); } - LL_DEBUGS("Materials") << "control " << which_control << LL_ENDL; - LLTextureCtrl* texture_ctrl = getChild(which_control); + if (texture_ctrl) { LLUUID obj_owner_id; diff --git a/indra/newview/llpanelface.h b/indra/newview/llpanelface.h index 6e88116a2d..ede2ef9339 100644 --- a/indra/newview/llpanelface.h +++ b/indra/newview/llpanelface.h @@ -130,54 +130,54 @@ public: LLGLTFMaterial::TextureInfo getPBRDropChannel(); protected: - void navigateToTitleMedia(const std::string url); - bool selectedMediaEditable(); - void clearMediaSettings(); - void updateMediaSettings(); - void updateMediaTitle(); - - void getState(); - - void sendTexture(); // applies and sends texture - void sendTextureInfo(); // applies and sends texture scale, offset, etc. - void sendColor(); // applies and sends color - void sendAlpha(); // applies and sends transparency - void sendBump(U32 bumpiness); // applies and sends bump map - void sendTexGen(); // applies and sends bump map - void sendShiny(U32 shininess); // applies and sends shininess - void sendFullbright(); // applies and sends full bright - - void sendGlow(); - void alignTextureLayer(); - - void updateCopyTexButton(); - - void onCommitPbr(const LLSD& data); - void onCancelPbr(const LLSD& data); - void onSelectPbr(const LLSD& data); - static bool onDragPbr(LLUICtrl* ctrl, LLInventoryItem* item); - - // this function is to return true if the drag should succeed. - static bool onDragTexture(LLUICtrl* ctrl, LLInventoryItem* item); - - void onCommitTexture(const LLSD& data); - void onCancelTexture(const LLSD& data); - void onSelectTexture(const LLSD& data); - void onCommitSpecularTexture(const LLSD& data); - void onCancelSpecularTexture(const LLSD& data); - void onSelectSpecularTexture(const LLSD& data); - void onCommitNormalTexture(const LLSD& data); - void onCancelNormalTexture(const LLSD& data); - void onSelectNormalTexture(const LLSD& data); - void onCommitColor(const LLSD& data); - void onCommitShinyColor(const LLSD& data); - void onCommitAlpha(const LLSD& data); - void onCancelColor(const LLSD& data); - void onCancelShinyColor(const LLSD& data); - void onSelectColor(const LLSD& data); - void onSelectShinyColor(const LLSD& data); - - void onCloseTexturePicker(const LLSD& data); + void navigateToTitleMedia(const std::string url); + bool selectedMediaEditable(); + void clearMediaSettings(); + void updateMediaSettings(); + void updateMediaTitle(); + + void getState(); + + void sendTexture(); // applies and sends texture + void sendTextureInfo(); // applies and sends texture scale, offset, etc. + void sendColor(); // applies and sends color + void sendAlpha(); // applies and sends transparency + void sendBump(U32 bumpiness); // applies and sends bump map + void sendTexGen(); // applies and sends bump map + void sendShiny(U32 shininess); // applies and sends shininess + void sendFullbright(); // applies and sends full bright + + void sendGlow(); + void alignTextureLayer(); + + void updateCopyTexButton(); + + void onCommitPbr(); + void onCancelPbr(); + void onSelectPbr(); + + // These functions are to return true if the drag should succeed + bool onDragPbr(LLInventoryItem* item); + bool onDragTexture(LLInventoryItem* item); + + void onCommitTexture(); + void onCancelTexture(); + void onSelectTexture(); + void onCommitSpecularTexture(const LLSD& data); + void onCancelSpecularTexture(const LLSD& data); + void onSelectSpecularTexture(const LLSD& data); + void onCommitNormalTexture(const LLSD& data); + void onCancelNormalTexture(const LLSD& data); + void onSelectNormalTexture(const LLSD& data); + void onCommitColor(); + void onCommitShinyColor(); + void onCommitAlpha(); + void onCancelColor(); + void onCancelShinyColor(); + void onSelectColor(); + void onSelectShinyColor(); + + void onCloseTexturePicker(const LLSD& data); static bool deleteMediaConfirm(const LLSD& notification, const LLSD& response); static bool multipleFacesSelectedConfirm(const LLSD& notification, const LLSD& response); @@ -195,81 +195,79 @@ protected: // Callback funcs for individual controls // - static void onCommitTextureInfo(LLUICtrl* ctrl, void* userdata); - static void onCommitTextureScaleX(LLUICtrl* ctrl, void* userdata); - static void onCommitTextureScaleY(LLUICtrl* ctrl, void* userdata); - static void onCommitTextureRot(LLUICtrl* ctrl, void* userdata); - static void onCommitTextureOffsetX(LLUICtrl* ctrl, void* userdata); - static void onCommitTextureOffsetY(LLUICtrl* ctrl, void* userdata); - - static void onCommitMaterialBumpyScaleX( LLUICtrl* ctrl, void* userdata); - static void onCommitMaterialBumpyScaleY( LLUICtrl* ctrl, void* userdata); - static void onCommitMaterialBumpyRot( LLUICtrl* ctrl, void* userdata); - static void onCommitMaterialBumpyOffsetX( LLUICtrl* ctrl, void* userdata); - static void onCommitMaterialBumpyOffsetY( LLUICtrl* ctrl, void* userdata); - - static void syncRepeatX(LLPanelFace* self, F32 scaleU); - static void syncRepeatY(LLPanelFace* self, F32 scaleV); - static void syncOffsetX(LLPanelFace* self, F32 offsetU); - static void syncOffsetY(LLPanelFace* self, F32 offsetV); - static void syncMaterialRot(LLPanelFace* self, F32 rot, int te = -1); - - static void onCommitMaterialShinyScaleX( LLUICtrl* ctrl, void* userdata); - static void onCommitMaterialShinyScaleY( LLUICtrl* ctrl, void* userdata); - static void onCommitMaterialShinyRot( LLUICtrl* ctrl, void* userdata); - static void onCommitMaterialShinyOffsetX( LLUICtrl* ctrl, void* userdata); - static void onCommitMaterialShinyOffsetY( LLUICtrl* ctrl, void* userdata); - - static void onCommitMaterialGloss( LLUICtrl* ctrl, void* userdata); - static void onCommitMaterialEnv( LLUICtrl* ctrl, void* userdata); - static void onCommitMaterialMaskCutoff( LLUICtrl* ctrl, void* userdata); - static void onCommitMaterialID( LLUICtrl* ctrl, void* userdata); - - static void onCommitMaterialsMedia( LLUICtrl* ctrl, void* userdata); - static void onCommitMaterialType( LLUICtrl* ctrl, void* userdata); - static void onCommitPbrType(LLUICtrl* ctrl, void* userdata); - static void onClickBtnEditMedia(LLUICtrl* ctrl, void* userdata); - static void onClickBtnDeleteMedia(LLUICtrl* ctrl, void* userdata); - static void onClickBtnAddMedia(LLUICtrl* ctrl, void* userdata); - static void onCommitBump( LLUICtrl* ctrl, void* userdata); - static void onCommitTexGen( LLUICtrl* ctrl, void* userdata); - static void onCommitShiny( LLUICtrl* ctrl, void* userdata); - static void onCommitAlphaMode( LLUICtrl* ctrl, void* userdata); - static void onCommitFullbright( LLUICtrl* ctrl, void* userdata); - static void onCommitGlow( LLUICtrl* ctrl, void *userdata); - static void onCommitPlanarAlign( LLUICtrl* ctrl, void* userdata); - static void onCommitRepeatsPerMeter( LLUICtrl* ctrl, void* userinfo); - - void onCommitGLTFTextureScaleU(LLUICtrl* ctrl); - void onCommitGLTFTextureScaleV(LLUICtrl* ctrl); - void onCommitGLTFRotation(LLUICtrl* ctrl); - void onCommitGLTFTextureOffsetU(LLUICtrl* ctrl); - void onCommitGLTFTextureOffsetV(LLUICtrl* ctrl); - - static void onClickAutoFix(void*); - static void onAlignTexture(void*); - static void onClickBtnLoadInvPBR(void* userdata); - static void onClickBtnEditPBR(void* userdata); - static void onClickBtnSavePBR(void* userdata); + void onCommitTextureInfo(); + void onCommitTextureScaleX(); + void onCommitTextureScaleY(); + void onCommitTextureRot(); + void onCommitTextureOffsetX(); + void onCommitTextureOffsetY(); + + void onCommitMaterialBumpyScaleX(); + void onCommitMaterialBumpyScaleY(); + void onCommitMaterialBumpyRot(); + void onCommitMaterialBumpyOffsetX(); + void onCommitMaterialBumpyOffsetY(); + + void syncRepeatX(F32 scaleU); + void syncRepeatY(F32 scaleV); + void syncOffsetX(F32 offsetU); + void syncOffsetY(F32 offsetV); + void syncMaterialRot(F32 rot, int te = -1); + + void onCommitMaterialShinyScaleX(); + void onCommitMaterialShinyScaleY(); + void onCommitMaterialShinyRot(); + void onCommitMaterialShinyOffsetX(); + void onCommitMaterialShinyOffsetY(); + + void onCommitMaterialGloss(); + void onCommitMaterialEnv(); + void onCommitMaterialMaskCutoff(); + void onCommitMaterialID(); + + void onCommitMaterialsMedia(); + void onCommitMaterialType(); + void onCommitPbrType(); + void onClickBtnEditMedia(); + void onClickBtnDeleteMedia(); + void onClickBtnAddMedia(); + void onCommitBump(); + void onCommitTexGen(); + void onCommitShiny(); + void onCommitAlphaMode(); + void onCommitFullbright(); + void onCommitGlow(); + void onCommitPlanarAlign(); + void onCommitRepeatsPerMeter(); + + void onCommitGLTFTextureScaleU(); + void onCommitGLTFTextureScaleV(); + void onCommitGLTFRotation(); + void onCommitGLTFTextureOffsetU(); + void onCommitGLTFTextureOffsetV(); + + void onClickAutoFix(); + void onAlignTexture(); + void onClickBtnLoadInvPBR(); + void onClickBtnEditPBR(); + void onClickBtnSavePBR(); public: // needs to be accessible to selection manager - void onCopyColor(); // records all selected faces - void onPasteColor(); // to specific face - void onPasteColor(LLViewerObject* objectp, S32 te); // to specific face - void onCopyTexture(); - void onPasteTexture(); - void onPasteTexture(LLViewerObject* objectp, S32 te); + void onCopyColor(); // records all selected faces + void onPasteColor(); // to specific face + void onPasteColor(LLViewerObject* objectp, S32 te); // to specific face + void onCopyTexture(); + void onPasteTexture(); + void onPasteTexture(LLViewerObject* objectp, S32 te); protected: - void menuDoToSelected(const LLSD& userdata); - bool menuEnableItem(const LLSD& userdata); - - static F32 valueGlow(LLViewerObject* object, S32 face); - + void menuDoToSelected(const LLSD& userdata); + bool menuEnableItem(const LLSD& userdata); + static F32 valueGlow(LLViewerObject* object, S32 face); private: - bool isAlpha() { return mIsAlpha; } + bool isAlpha() { return mIsAlpha; } // Convenience funcs to keep the visual flack to a minimum // @@ -483,7 +481,7 @@ private: void updateVisibilityGLTF(LLViewerObject* objectp = nullptr); void updateSelectedGLTFMaterials(std::function func); - void updateGLTFTextureTransform(float value, U32 pbr_type, std::function edit); + void updateGLTFTextureTransform(std::function edit); void setMaterialOverridesFromSelection(); @@ -578,41 +576,41 @@ public: static void getMaxNormalRepeats(F32& repeats, bool& identical); static void getCurrentDiffuseAlphaMode(U8& diffuse_alpha_mode, bool& identical, bool diffuse_texture_has_alpha); - DEF_GET_MAT_STATE(LLUUID,const LLUUID&,getNormalID,LLUUID::null, false, LLUUID::null) - DEF_GET_MAT_STATE(LLUUID,const LLUUID&,getSpecularID,LLUUID::null, false, LLUUID::null) - DEF_GET_MAT_STATE(F32,F32,getSpecularRepeatX,1.0f, true, 0.001f) - DEF_GET_MAT_STATE(F32,F32,getSpecularRepeatY,1.0f, true, 0.001f) - DEF_GET_MAT_STATE(F32,F32,getSpecularOffsetX,0.0f, true, 0.001f) - DEF_GET_MAT_STATE(F32,F32,getSpecularOffsetY,0.0f, true, 0.001f) - DEF_GET_MAT_STATE(F32,F32,getSpecularRotation,0.0f, true, 0.001f) - - DEF_GET_MAT_STATE(F32,F32,getNormalRepeatX,1.0f, true, 0.001f) - DEF_GET_MAT_STATE(F32,F32,getNormalRepeatY,1.0f, true, 0.001f) - DEF_GET_MAT_STATE(F32,F32,getNormalOffsetX,0.0f, true, 0.001f) - DEF_GET_MAT_STATE(F32,F32,getNormalOffsetY,0.0f, true, 0.001f) - DEF_GET_MAT_STATE(F32,F32,getNormalRotation,0.0f, true, 0.001f) - - DEF_EDIT_MAT_STATE(U8,U8,setDiffuseAlphaMode); - DEF_EDIT_MAT_STATE(U8,U8,setAlphaMaskCutoff); - - DEF_EDIT_MAT_STATE(F32,F32,setNormalOffsetX); - DEF_EDIT_MAT_STATE(F32,F32,setNormalOffsetY); - DEF_EDIT_MAT_STATE(F32,F32,setNormalRepeatX); - DEF_EDIT_MAT_STATE(F32,F32,setNormalRepeatY); - DEF_EDIT_MAT_STATE(F32,F32,setNormalRotation); - - DEF_EDIT_MAT_STATE(F32,F32,setSpecularOffsetX); - DEF_EDIT_MAT_STATE(F32,F32,setSpecularOffsetY); - DEF_EDIT_MAT_STATE(F32,F32,setSpecularRepeatX); - DEF_EDIT_MAT_STATE(F32,F32,setSpecularRepeatY); - DEF_EDIT_MAT_STATE(F32,F32,setSpecularRotation); - - DEF_EDIT_MAT_STATE(U8,U8,setEnvironmentIntensity); - DEF_EDIT_MAT_STATE(U8,U8,setSpecularLightExponent); - - DEF_EDIT_MAT_STATE(LLUUID,const LLUUID&,setNormalID); - DEF_EDIT_MAT_STATE(LLUUID,const LLUUID&,setSpecularID); - DEF_EDIT_MAT_STATE(LLColor4U, const LLColor4U&,setSpecularLightColor); + DEF_GET_MAT_STATE(LLUUID, const LLUUID&, getNormalID, LLUUID::null, false, LLUUID::null); + DEF_GET_MAT_STATE(LLUUID, const LLUUID&, getSpecularID, LLUUID::null, false, LLUUID::null); + DEF_GET_MAT_STATE(F32, F32, getSpecularRepeatX, 1.0f, true, 0.001f); + DEF_GET_MAT_STATE(F32, F32, getSpecularRepeatY, 1.0f, true, 0.001f); + DEF_GET_MAT_STATE(F32, F32, getSpecularOffsetX, 0.0f, true, 0.001f); + DEF_GET_MAT_STATE(F32, F32, getSpecularOffsetY, 0.0f, true, 0.001f); + DEF_GET_MAT_STATE(F32, F32, getSpecularRotation, 0.0f, true, 0.001f); + + DEF_GET_MAT_STATE(F32, F32, getNormalRepeatX, 1.0f, true, 0.001f); + DEF_GET_MAT_STATE(F32, F32, getNormalRepeatY, 1.0f, true, 0.001f); + DEF_GET_MAT_STATE(F32, F32, getNormalOffsetX, 0.0f, true, 0.001f); + DEF_GET_MAT_STATE(F32, F32, getNormalOffsetY, 0.0f, true, 0.001f); + DEF_GET_MAT_STATE(F32, F32, getNormalRotation, 0.0f, true, 0.001f); + + DEF_EDIT_MAT_STATE(U8, U8, setDiffuseAlphaMode); + DEF_EDIT_MAT_STATE(U8, U8, setAlphaMaskCutoff); + + DEF_EDIT_MAT_STATE(F32, F32, setNormalOffsetX); + DEF_EDIT_MAT_STATE(F32, F32, setNormalOffsetY); + DEF_EDIT_MAT_STATE(F32, F32, setNormalRepeatX); + DEF_EDIT_MAT_STATE(F32, F32, setNormalRepeatY); + DEF_EDIT_MAT_STATE(F32, F32, setNormalRotation); + + DEF_EDIT_MAT_STATE(F32, F32, setSpecularOffsetX); + DEF_EDIT_MAT_STATE(F32, F32, setSpecularOffsetY); + DEF_EDIT_MAT_STATE(F32, F32, setSpecularRepeatX); + DEF_EDIT_MAT_STATE(F32, F32, setSpecularRepeatY); + DEF_EDIT_MAT_STATE(F32, F32, setSpecularRotation); + + DEF_EDIT_MAT_STATE(U8, U8, setEnvironmentIntensity); + DEF_EDIT_MAT_STATE(U8, U8, setSpecularLightExponent); + + DEF_EDIT_MAT_STATE(LLUUID, const LLUUID&,setNormalID); + DEF_EDIT_MAT_STATE(LLUUID, const LLUUID&,setSpecularID); + DEF_EDIT_MAT_STATE(LLColor4U, const LLColor4U&, setSpecularLightColor); }; class LLSelectedTE -- cgit v1.2.3 From 8754ce088fd0e901ad2d9dfd7bfc70266340bc39 Mon Sep 17 00:00:00 2001 From: Andrey Kleshchev Date: Wed, 7 Aug 2024 16:06:26 +0300 Subject: viewer#2212 Bulk upload makes an incorrect cost estimate --- indra/newview/llviewermenufile.cpp | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/indra/newview/llviewermenufile.cpp b/indra/newview/llviewermenufile.cpp index c4fecf8dff..83f8e96f9a 100644 --- a/indra/newview/llviewermenufile.cpp +++ b/indra/newview/llviewermenufile.cpp @@ -547,9 +547,11 @@ void do_bulk_upload(std::vector filenames, bool allow_2k) if (asset_type == LLAssetType::AT_TEXTURE && allow_2k) { LLPointer image_frmted = LLImageFormatted::createFromType(codec); - if (gDirUtilp->fileExists(filename) && image_frmted->load(filename)) + if (gDirUtilp->fileExists(filename) && image_frmted && image_frmted->load(filename)) { - expected_upload_cost = LLAgentBenefitsMgr::current().getTextureUploadCost(image_frmted); + S32 biased_width = LLImageRaw::biasedDimToPowerOfTwo(image_frmted->getWidth(), LLViewerFetchedTexture::MAX_IMAGE_SIZE_DEFAULT); + S32 biased_height = LLImageRaw::biasedDimToPowerOfTwo(image_frmted->getHeight(), LLViewerFetchedTexture::MAX_IMAGE_SIZE_DEFAULT); + expected_upload_cost = LLAgentBenefitsMgr::current().getTextureUploadCost(biased_width, biased_height); resource_upload = true; } } @@ -643,16 +645,15 @@ bool get_bulk_upload_expected_cost( if (asset_type == LLAssetType::AT_TEXTURE && allow_2k) { LLPointer image_frmted = LLImageFormatted::createFromType(codec); - if (gDirUtilp->fileExists(filename) && image_frmted->load(filename)) + if (gDirUtilp->fileExists(filename) && image_frmted && image_frmted->load(filename)) { - total_cost += LLAgentBenefitsMgr::current().getTextureUploadCost(image_frmted); - if (image_frmted) + S32 biased_width = LLImageRaw::biasedDimToPowerOfTwo(image_frmted->getWidth(), LLViewerFetchedTexture::MAX_IMAGE_SIZE_DEFAULT); + S32 biased_height = LLImageRaw::biasedDimToPowerOfTwo(image_frmted->getHeight(), LLViewerFetchedTexture::MAX_IMAGE_SIZE_DEFAULT); + total_cost += LLAgentBenefitsMgr::current().getTextureUploadCost(biased_width, biased_height); + S32 area = biased_width * biased_height; + if (area >= LLAgentBenefits::MIN_2K_TEXTURE_AREA) { - S32 area = image_frmted->getHeight() * image_frmted->getWidth(); - if (area >= LLAgentBenefits::MIN_2K_TEXTURE_AREA) - { - textures_2k_count++; - } + textures_2k_count++; } file_count++; } -- cgit v1.2.3 From 413ece6c481e430ad380697934a20ecd95aaa7fb Mon Sep 17 00:00:00 2001 From: Alexander Gavriliuk Date: Wed, 7 Aug 2024 18:08:21 +0200 Subject: #1922 Make PBR scale and offset crosshair work (store control pointers in LLPanelFace) --- indra/newview/llpanelface.cpp | 1074 +++++++++++++++++++---------------------- indra/newview/llpanelface.h | 108 ++++- 2 files changed, 573 insertions(+), 609 deletions(-) diff --git a/indra/newview/llpanelface.cpp b/indra/newview/llpanelface.cpp index f01d327fb4..936ca273c3 100644 --- a/indra/newview/llpanelface.cpp +++ b/indra/newview/llpanelface.cpp @@ -226,7 +226,7 @@ LLRender::eTexIndex LLPanelFace::getTextureDropChannel() LLGLTFMaterial::TextureInfo LLPanelFace::getPBRDropChannel() { - if (mComboMatMedia && mComboMatMedia->getCurrentIndex() == MATMEDIA_PBR) + if (mComboMatMedia->getCurrentIndex() == MATMEDIA_PBR) { return texture_info_from_pbrtype(mRadioPbrType->getSelectedIndex()); } @@ -236,24 +236,24 @@ LLGLTFMaterial::TextureInfo LLPanelFace::getPBRDropChannel() // Things the UI provides... // -LLUUID LLPanelFace::getCurrentNormalMap() { return mBumpyTextureCtrl->getImageAssetID(); } -LLUUID LLPanelFace::getCurrentSpecularMap() { return mShinyTextureCtrl->getImageAssetID(); } -U32 LLPanelFace::getCurrentShininess() { return getChild("combobox shininess")->getCurrentIndex(); } -U32 LLPanelFace::getCurrentBumpiness() { return getChild("combobox bumpiness")->getCurrentIndex(); } -U8 LLPanelFace::getCurrentDiffuseAlphaMode() { return (U8)getChild("combobox alphamode")->getCurrentIndex(); } -U8 LLPanelFace::getCurrentAlphaMaskCutoff() { return (U8)getChild("maskcutoff")->getValue().asInteger(); } -U8 LLPanelFace::getCurrentEnvIntensity() { return (U8)getChild("environment")->getValue().asInteger(); } -U8 LLPanelFace::getCurrentGlossiness() { return (U8)getChild("glossiness")->getValue().asInteger(); } -F32 LLPanelFace::getCurrentBumpyRot() { return (F32)getChild("bumpyRot")->getValue().asReal(); } -F32 LLPanelFace::getCurrentBumpyScaleU() { return (F32)getChild("bumpyScaleU")->getValue().asReal(); } -F32 LLPanelFace::getCurrentBumpyScaleV() { return (F32)getChild("bumpyScaleV")->getValue().asReal(); } -F32 LLPanelFace::getCurrentBumpyOffsetU() { return (F32)getChild("bumpyOffsetU")->getValue().asReal(); } -F32 LLPanelFace::getCurrentBumpyOffsetV() { return (F32)getChild("bumpyOffsetV")->getValue().asReal(); } -F32 LLPanelFace::getCurrentShinyRot() { return (F32)getChild("shinyRot")->getValue().asReal(); } -F32 LLPanelFace::getCurrentShinyScaleU() { return (F32)getChild("shinyScaleU")->getValue().asReal(); } -F32 LLPanelFace::getCurrentShinyScaleV() { return (F32)getChild("shinyScaleV")->getValue().asReal(); } -F32 LLPanelFace::getCurrentShinyOffsetU() { return (F32)getChild("shinyOffsetU")->getValue().asReal(); } -F32 LLPanelFace::getCurrentShinyOffsetV() { return (F32)getChild("shinyOffsetV")->getValue().asReal(); } +LLUUID LLPanelFace::getCurrentNormalMap() { return mBumpyTextureCtrl->getImageAssetID(); } +LLUUID LLPanelFace::getCurrentSpecularMap() { return mShinyTextureCtrl->getImageAssetID(); } +U32 LLPanelFace::getCurrentShininess() { return mComboShininess->getCurrentIndex(); } +U32 LLPanelFace::getCurrentBumpiness() { return mComboBumpiness->getCurrentIndex(); } +U8 LLPanelFace::getCurrentDiffuseAlphaMode() { return (U8)mComboAlphaMode->getCurrentIndex(); } +U8 LLPanelFace::getCurrentAlphaMaskCutoff() { return (U8)mMaskCutoff->getValue().asInteger(); } +U8 LLPanelFace::getCurrentEnvIntensity() { return (U8)mEnvironment->getValue().asInteger(); } +U8 LLPanelFace::getCurrentGlossiness() { return (U8)mGlossiness->getValue().asInteger(); } +F32 LLPanelFace::getCurrentBumpyRot() { return (F32)mBumpyRotate->getValue().asReal(); } +F32 LLPanelFace::getCurrentBumpyScaleU() { return (F32)mBumpyScaleU->getValue().asReal(); } +F32 LLPanelFace::getCurrentBumpyScaleV() { return (F32)mBumpyScaleV->getValue().asReal(); } +F32 LLPanelFace::getCurrentBumpyOffsetU() { return (F32)mBumpyOffsetU->getValue().asReal(); } +F32 LLPanelFace::getCurrentBumpyOffsetV() { return (F32)mBumpyOffsetV->getValue().asReal(); } +F32 LLPanelFace::getCurrentShinyRot() { return (F32)mShinyRotate->getValue().asReal(); } +F32 LLPanelFace::getCurrentShinyScaleU() { return (F32)mShinyScaleU->getValue().asReal(); } +F32 LLPanelFace::getCurrentShinyScaleV() { return (F32)mShinyScaleV->getValue().asReal(); } +F32 LLPanelFace::getCurrentShinyOffsetU() { return (F32)mShinyOffsetU->getValue().asReal(); } +F32 LLPanelFace::getCurrentShinyOffsetV() { return (F32)mShinyOffsetV->getValue().asReal(); } // // Methods @@ -261,199 +261,156 @@ F32 LLPanelFace::getCurrentShinyOffsetV() { return (F32)getChild("pbr_control"); - if (mPBRTextureCtrl) - { - mPBRTextureCtrl->setDefaultImageAssetID(LLUUID::null); - mPBRTextureCtrl->setBlankImageAssetID(BLANK_MATERIAL_ASSET_ID); - mPBRTextureCtrl->setCommitCallback([&](LLUICtrl*, const LLSD&) { onCommitPbr(); }); - mPBRTextureCtrl->setOnCancelCallback([&](LLUICtrl*, const LLSD&) { onCancelPbr(); }); - mPBRTextureCtrl->setOnSelectCallback([&](LLUICtrl*, const LLSD&) { onSelectPbr(); }); - mPBRTextureCtrl->setDragCallback([&](LLUICtrl*, LLInventoryItem* item) { return onDragPbr(item); }); - mPBRTextureCtrl->setOnTextureSelectedCallback([&](LLInventoryItem* item) { onPbrSelectionChanged(item); }); - mPBRTextureCtrl->setOnCloseCallback([&](LLUICtrl*, const LLSD& data) { onCloseTexturePicker(data); }); - - mPBRTextureCtrl->setFollowsTop(); - mPBRTextureCtrl->setFollowsLeft(); - mPBRTextureCtrl->setImmediateFilterPermMask(PERM_NONE); - mPBRTextureCtrl->setDnDFilterPermMask(PERM_COPY | PERM_TRANSFER); - mPBRTextureCtrl->setBakeTextureEnabled(false); - mPBRTextureCtrl->setInventoryPickType(PICK_MATERIAL); - } + mPBRTextureCtrl->setDefaultImageAssetID(LLUUID::null); + mPBRTextureCtrl->setBlankImageAssetID(BLANK_MATERIAL_ASSET_ID); + mPBRTextureCtrl->setCommitCallback([&](LLUICtrl*, const LLSD&) { onCommitPbr(); }); + mPBRTextureCtrl->setOnCancelCallback([&](LLUICtrl*, const LLSD&) { onCancelPbr(); }); + mPBRTextureCtrl->setOnSelectCallback([&](LLUICtrl*, const LLSD&) { onSelectPbr(); }); + mPBRTextureCtrl->setDragCallback([&](LLUICtrl*, LLInventoryItem* item) { return onDragPbr(item); }); + mPBRTextureCtrl->setOnTextureSelectedCallback([&](LLInventoryItem* item) { onPbrSelectionChanged(item); }); + mPBRTextureCtrl->setOnCloseCallback([&](LLUICtrl*, const LLSD& data) { onCloseTexturePicker(data); }); + mPBRTextureCtrl->setFollowsTop(); + mPBRTextureCtrl->setFollowsLeft(); + mPBRTextureCtrl->setImmediateFilterPermMask(PERM_NONE); + mPBRTextureCtrl->setDnDFilterPermMask(PERM_COPY | PERM_TRANSFER); + mPBRTextureCtrl->setBakeTextureEnabled(false); + mPBRTextureCtrl->setInventoryPickType(PICK_MATERIAL); mTextureCtrl = getChild("texture control"); - if (mTextureCtrl) - { - mTextureCtrl->setDefaultImageAssetID(DEFAULT_OBJECT_TEXTURE); - mTextureCtrl->setCommitCallback([&](LLUICtrl*, const LLSD&) { onCommitTexture(); }); - mTextureCtrl->setOnCancelCallback([&](LLUICtrl*, const LLSD&) { onCancelTexture(); }); - mTextureCtrl->setOnSelectCallback([&](LLUICtrl*, const LLSD&) { onSelectTexture(); }); - mTextureCtrl->setDragCallback([&](LLUICtrl*, LLInventoryItem* item) { return onDragTexture(item); }); - mTextureCtrl->setOnTextureSelectedCallback([&](LLInventoryItem* item) { onTextureSelectionChanged(item); }); - mTextureCtrl->setOnCloseCallback([&](LLUICtrl*, const LLSD& data) { onCloseTexturePicker(data); }); - - mTextureCtrl->setFollowsTop(); - mTextureCtrl->setFollowsLeft(); - mTextureCtrl->setImmediateFilterPermMask(PERM_NONE); - mTextureCtrl->setDnDFilterPermMask(PERM_COPY | PERM_TRANSFER); - } + mTextureCtrl->setDefaultImageAssetID(DEFAULT_OBJECT_TEXTURE); + mTextureCtrl->setCommitCallback([&](LLUICtrl*, const LLSD&) { onCommitTexture(); }); + mTextureCtrl->setOnCancelCallback([&](LLUICtrl*, const LLSD&) { onCancelTexture(); }); + mTextureCtrl->setOnSelectCallback([&](LLUICtrl*, const LLSD&) { onSelectTexture(); }); + mTextureCtrl->setDragCallback([&](LLUICtrl*, LLInventoryItem* item) { return onDragTexture(item); }); + mTextureCtrl->setOnTextureSelectedCallback([&](LLInventoryItem* item) { onTextureSelectionChanged(item); }); + mTextureCtrl->setOnCloseCallback([&](LLUICtrl*, const LLSD& data) { onCloseTexturePicker(data); }); + mTextureCtrl->setFollowsTop(); + mTextureCtrl->setFollowsLeft(); + mTextureCtrl->setImmediateFilterPermMask(PERM_NONE); + mTextureCtrl->setDnDFilterPermMask(PERM_COPY | PERM_TRANSFER); mShinyTextureCtrl = getChild("shinytexture control"); - if (mShinyTextureCtrl) - { - mShinyTextureCtrl->setDefaultImageAssetID(DEFAULT_OBJECT_SPECULAR); - mShinyTextureCtrl->setCommitCallback([&](LLUICtrl*, const LLSD& data) { onCommitSpecularTexture(data); }); - mShinyTextureCtrl->setOnCancelCallback([&](LLUICtrl*, const LLSD& data) { onCancelSpecularTexture(data); }); - mShinyTextureCtrl->setOnSelectCallback([&](LLUICtrl*, const LLSD& data) { onSelectSpecularTexture(data); }); - mShinyTextureCtrl->setOnCloseCallback([&](LLUICtrl*, const LLSD& data) { onCloseTexturePicker(data); }); - - mShinyTextureCtrl->setDragCallback([&](LLUICtrl*, LLInventoryItem* item) { return onDragTexture(item); }); - mShinyTextureCtrl->setOnTextureSelectedCallback([&](LLInventoryItem* item) { onTextureSelectionChanged(item); }); - mShinyTextureCtrl->setFollowsTop(); - mShinyTextureCtrl->setFollowsLeft(); - mShinyTextureCtrl->setImmediateFilterPermMask(PERM_NONE); - mShinyTextureCtrl->setDnDFilterPermMask(PERM_COPY | PERM_TRANSFER); - } + mShinyTextureCtrl->setDefaultImageAssetID(DEFAULT_OBJECT_SPECULAR); + mShinyTextureCtrl->setCommitCallback([&](LLUICtrl*, const LLSD& data) { onCommitSpecularTexture(data); }); + mShinyTextureCtrl->setOnCancelCallback([&](LLUICtrl*, const LLSD& data) { onCancelSpecularTexture(data); }); + mShinyTextureCtrl->setOnSelectCallback([&](LLUICtrl*, const LLSD& data) { onSelectSpecularTexture(data); }); + mShinyTextureCtrl->setDragCallback([&](LLUICtrl*, LLInventoryItem* item) { return onDragTexture(item); }); + mShinyTextureCtrl->setOnTextureSelectedCallback([&](LLInventoryItem* item) { onTextureSelectionChanged(item); }); + mShinyTextureCtrl->setOnCloseCallback([&](LLUICtrl*, const LLSD& data) { onCloseTexturePicker(data); }); + mShinyTextureCtrl->setFollowsTop(); + mShinyTextureCtrl->setFollowsLeft(); + mShinyTextureCtrl->setImmediateFilterPermMask(PERM_NONE); + mShinyTextureCtrl->setDnDFilterPermMask(PERM_COPY | PERM_TRANSFER); mBumpyTextureCtrl = getChild("bumpytexture control"); - if (mBumpyTextureCtrl) - { - mBumpyTextureCtrl->setDefaultImageAssetID(DEFAULT_OBJECT_NORMAL); - mBumpyTextureCtrl->setBlankImageAssetID(BLANK_OBJECT_NORMAL); - mBumpyTextureCtrl->setCommitCallback([&](LLUICtrl*, const LLSD& data) { onCommitNormalTexture(data); }); - mBumpyTextureCtrl->setOnCancelCallback([&](LLUICtrl*, const LLSD& data) { onCancelNormalTexture(data); }); - mBumpyTextureCtrl->setOnSelectCallback([&](LLUICtrl*, const LLSD& data) { onSelectNormalTexture(data); }); - mBumpyTextureCtrl->setOnCloseCallback([&](LLUICtrl*, const LLSD& data) { onCloseTexturePicker(data); }); - - mBumpyTextureCtrl->setDragCallback([&](LLUICtrl*, LLInventoryItem* item) { return onDragTexture(item); }); - mBumpyTextureCtrl->setOnTextureSelectedCallback([&](LLInventoryItem* item) { onTextureSelectionChanged(item); }); - mBumpyTextureCtrl->setFollowsTop(); - mBumpyTextureCtrl->setFollowsLeft(); - mBumpyTextureCtrl->setImmediateFilterPermMask(PERM_NONE); - mBumpyTextureCtrl->setDnDFilterPermMask(PERM_COPY | PERM_TRANSFER); - } + mBumpyTextureCtrl->setDefaultImageAssetID(DEFAULT_OBJECT_NORMAL); + mBumpyTextureCtrl->setBlankImageAssetID(BLANK_OBJECT_NORMAL); + mBumpyTextureCtrl->setCommitCallback([&](LLUICtrl*, const LLSD& data) { onCommitNormalTexture(data); }); + mBumpyTextureCtrl->setOnCancelCallback([&](LLUICtrl*, const LLSD& data) { onCancelNormalTexture(data); }); + mBumpyTextureCtrl->setOnSelectCallback([&](LLUICtrl*, const LLSD& data) { onSelectNormalTexture(data); }); + mBumpyTextureCtrl->setDragCallback([&](LLUICtrl*, LLInventoryItem* item) { return onDragTexture(item); }); + mBumpyTextureCtrl->setOnTextureSelectedCallback([&](LLInventoryItem* item) { onTextureSelectionChanged(item); }); + mBumpyTextureCtrl->setOnCloseCallback([&](LLUICtrl*, const LLSD& data) { onCloseTexturePicker(data); }); + mBumpyTextureCtrl->setFollowsTop(); + mBumpyTextureCtrl->setFollowsLeft(); + mBumpyTextureCtrl->setImmediateFilterPermMask(PERM_NONE); + mBumpyTextureCtrl->setDnDFilterPermMask(PERM_COPY | PERM_TRANSFER); mColorSwatch = getChild("colorswatch"); - if (mColorSwatch) - { - mColorSwatch->setCommitCallback([&](LLUICtrl*, const LLSD&) { onCommitColor(); }); - mColorSwatch->setOnCancelCallback([&](LLUICtrl*, const LLSD&) { onCancelColor(); }); - mColorSwatch->setOnSelectCallback([&](LLUICtrl*, const LLSD&) { onSelectColor(); }); - mColorSwatch->setFollowsTop(); - mColorSwatch->setFollowsLeft(); - mColorSwatch->setCanApplyImmediately(true); - } + mColorSwatch->setCommitCallback([&](LLUICtrl*, const LLSD&) { onCommitColor(); }); + mColorSwatch->setOnCancelCallback([&](LLUICtrl*, const LLSD&) { onCancelColor(); }); + mColorSwatch->setOnSelectCallback([&](LLUICtrl*, const LLSD&) { onSelectColor(); }); + mColorSwatch->setFollowsTop(); + mColorSwatch->setFollowsLeft(); + mColorSwatch->setCanApplyImmediately(true); mShinyColorSwatch = getChild("shinycolorswatch"); - if (mShinyColorSwatch) - { - mShinyColorSwatch->setCommitCallback([&](LLUICtrl*, const LLSD&) { onCommitShinyColor(); }); - mShinyColorSwatch->setOnCancelCallback([&](LLUICtrl*, const LLSD&) { onCancelShinyColor(); }); - mShinyColorSwatch->setOnSelectCallback([&](LLUICtrl*, const LLSD&) { onSelectShinyColor(); }); - mShinyColorSwatch->setFollowsTop(); - mShinyColorSwatch->setFollowsLeft(); - mShinyColorSwatch->setCanApplyImmediately(true); - } + mShinyColorSwatch->setCommitCallback([&](LLUICtrl*, const LLSD&) { onCommitShinyColor(); }); + mShinyColorSwatch->setOnCancelCallback([&](LLUICtrl*, const LLSD&) { onCancelShinyColor(); }); + mShinyColorSwatch->setOnSelectCallback([&](LLUICtrl*, const LLSD&) { onSelectShinyColor(); }); + mShinyColorSwatch->setFollowsTop(); + mShinyColorSwatch->setFollowsLeft(); + mShinyColorSwatch->setCanApplyImmediately(true); mLabelColorTransp = getChild("color trans"); - if (mLabelColorTransp) - { - mLabelColorTransp->setFollowsTop(); - mLabelColorTransp->setFollowsLeft(); - } + mLabelColorTransp->setFollowsTop(); + mLabelColorTransp->setFollowsLeft(); mCtrlColorTransp = getChild("ColorTrans"); - if (mCtrlColorTransp) - { - mCtrlColorTransp->setCommitCallback([&](LLUICtrl*, const LLSD&) { onCommitAlpha(); }); - mCtrlColorTransp->setPrecision(0); - mCtrlColorTransp->setFollowsTop(); - mCtrlColorTransp->setFollowsLeft(); - } + mCtrlColorTransp->setCommitCallback([&](LLUICtrl*, const LLSD&) { onCommitAlpha(); }); + mCtrlColorTransp->setPrecision(0); + mCtrlColorTransp->setFollowsTop(); + mCtrlColorTransp->setFollowsLeft(); mCheckFullbright = getChild("checkbox fullbright"); - if (mCheckFullbright) - { - mCheckFullbright->setCommitCallback([&](LLUICtrl*, const LLSD&) { onCommitFullbright(); }); - } + mCheckFullbright->setCommitCallback([&](LLUICtrl*, const LLSD&) { onCommitFullbright(); }); + mLabelTexGen = getChild("tex gen"); mComboTexGen = getChild("combobox texgen"); - if (mComboTexGen) - { - mComboTexGen->setCommitCallback([&](LLUICtrl*, const LLSD&) { onCommitTexGen(); }); - mComboTexGen->setFollows(FOLLOWS_LEFT | FOLLOWS_TOP); - } + mComboTexGen->setCommitCallback([&](LLUICtrl*, const LLSD&) { onCommitTexGen(); }); + mComboTexGen->setFollows(FOLLOWS_LEFT | FOLLOWS_TOP); mComboMatMedia = getChild("combobox matmedia"); - if (mComboMatMedia) - { - mComboMatMedia->setCommitCallback([&](LLUICtrl*, const LLSD&) { onCommitMaterialsMedia(); }); - mComboMatMedia->selectNthItem(MATMEDIA_MATERIAL); - } + mComboMatMedia->setCommitCallback([&](LLUICtrl*, const LLSD&) { onCommitMaterialsMedia(); }); + mComboMatMedia->selectNthItem(MATMEDIA_MATERIAL); mRadioMaterialType = getChild("radio_material_type"); - if (mRadioMaterialType) - { - mRadioMaterialType->setCommitCallback([&](LLUICtrl*, const LLSD&) { onCommitMaterialType(); }); - mRadioMaterialType->selectNthItem(MATTYPE_DIFFUSE); - } + mRadioMaterialType->setCommitCallback([&](LLUICtrl*, const LLSD&) { onCommitMaterialType(); }); + mRadioMaterialType->selectNthItem(MATTYPE_DIFFUSE); mRadioPbrType = getChild("radio_pbr_type"); - if (mRadioPbrType) - { - mRadioPbrType->setCommitCallback([&](LLUICtrl*, const LLSD&) { onCommitPbrType(); }); - mRadioPbrType->selectNthItem(PBRTYPE_RENDER_MATERIAL_ID); - } + mRadioPbrType->setCommitCallback([&](LLUICtrl*, const LLSD&) { onCommitPbrType(); }); + mRadioPbrType->selectNthItem(PBRTYPE_RENDER_MATERIAL_ID); + mLabelGlow = getChild("glow label"); mCtrlGlow = getChild("glow"); - if (mCtrlGlow) - { - mCtrlGlow->setCommitCallback([&](LLUICtrl*, const LLSD&) { onCommitGlow(); }); - } + mCtrlGlow->setCommitCallback([&](LLUICtrl*, const LLSD&) { onCommitGlow(); }); mMenuClipboardColor = getChild("clipboard_color_params_btn"); mMenuClipboardTexture = getChild("clipboard_texture_params_btn"); @@ -461,6 +418,19 @@ bool LLPanelFace::postBuild() mTitleMedia = getChild("title_media"); mTitleMediaText = getChild("media_info"); + mLabelBumpiness = getChild("label bumpiness"); + mLabelShininess = getChild("label shininess"); + mLabelAlphaMode = getChild("label alphamode"); + mLabelGlossiness = getChild("label glossiness"); + mLabelEnvironment = getChild("label environment"); + mLabelMaskCutoff = getChild("label maskcutoff"); + mLabelShiniColor = getChild("label shinycolor"); + mLabelColor = getChild("color label"); + + mLabelMatPermLoading = getChild("material_permissions_loading_label"); + + mCheckSyncSettings = getChild("checkbox_sync_settings"); + clearCtrls(); return true; @@ -513,8 +483,7 @@ void LLPanelFace::draw() void LLPanelFace::sendTexture() { - if(!mTextureCtrl) return; - if( !mTextureCtrl->getTentative() ) + if (!mTextureCtrl->getTentative()) { // we grab the item id first, because we want to do a // permissions check in the selection manager. ARGH! @@ -590,32 +559,26 @@ void LLPanelFace::sendShiny(U32 shininess) void LLPanelFace::sendFullbright() { - if(!mCheckFullbright)return; U8 fullbright = mCheckFullbright->get() ? TEM_FULLBRIGHT_MASK : 0; LLSelectMgr::getInstance()->selectionSetFullbright(fullbright); } void LLPanelFace::sendColor() { - if(!mColorSwatch)return; LLColor4 color = mColorSwatch->get(); LLSelectMgr::getInstance()->selectionSetColorOnly(color); } void LLPanelFace::sendAlpha() { - if(!mCtrlColorTransp)return; F32 alpha = (100.f - mCtrlColorTransp->get()) / 100.f; LLSelectMgr::getInstance()->selectionSetAlphaOnly( alpha ); } void LLPanelFace::sendGlow() { - if (mCtrlGlow) - { - F32 glow = mCtrlGlow->get(); - LLSelectMgr::getInstance()->selectionSetGlow( glow ); - } + F32 glow = mCtrlGlow->get(); + LLSelectMgr::getInstance()->selectionSetGlow(glow); } struct LLPanelFaceSetTEFunctor : public LLSelectedTEFunctor @@ -623,47 +586,49 @@ struct LLPanelFaceSetTEFunctor : public LLSelectedTEFunctor LLPanelFaceSetTEFunctor(LLPanelFace* panel) : mPanel(panel) {} virtual bool apply(LLViewerObject* object, S32 te) { - bool valid; - F32 value; - std::string prefix; + LLSpinCtrl *ctrlTexScaleS, *ctrlTexScaleT, *ctrlTexOffsetS, *ctrlTexOffsetT, *ctrlTexRotation; // Effectively the same as MATMEDIA_PBR sans using different radio, // separate for the sake of clarity - LLRadioGroup * radio_mat_type = mPanel->getChild("radio_material_type"); - switch (radio_mat_type->getSelectedIndex()) + switch (mPanel->mRadioMaterialType->getSelectedIndex()) { case MATTYPE_DIFFUSE: - prefix = "Tex"; + ctrlTexScaleS = mPanel->mTexScaleU; + ctrlTexScaleT = mPanel->mTexScaleV; + ctrlTexOffsetS = mPanel->mTexOffsetU; + ctrlTexOffsetT = mPanel->mTexOffsetV; + ctrlTexRotation = mPanel->mTexRotate; break; case MATTYPE_NORMAL: - prefix = "bumpy"; + ctrlTexScaleS = mPanel->mBumpyScaleU; + ctrlTexScaleT = mPanel->mBumpyScaleV; + ctrlTexOffsetS = mPanel->mBumpyOffsetU; + ctrlTexOffsetT = mPanel->mBumpyOffsetV; + ctrlTexRotation = mPanel->mBumpyRotate; break; case MATTYPE_SPECULAR: - prefix = "shiny"; + ctrlTexScaleS = mPanel->mShinyScaleU; + ctrlTexScaleT = mPanel->mShinyScaleV; + ctrlTexOffsetS = mPanel->mShinyOffsetU; + ctrlTexOffsetT = mPanel->mShinyOffsetV; + ctrlTexRotation = mPanel->mShinyRotate; break; + default: + llassert(false); + return false; } - LLSpinCtrl * ctrlTexScaleS = mPanel->getChild(prefix + "ScaleU"); - LLSpinCtrl * ctrlTexScaleT = mPanel->getChild(prefix + "ScaleV"); - LLSpinCtrl * ctrlTexOffsetS = mPanel->getChild(prefix + "OffsetU"); - LLSpinCtrl * ctrlTexOffsetT = mPanel->getChild(prefix + "OffsetV"); - LLSpinCtrl * ctrlTexRotation = mPanel->getChild(prefix + "Rot"); - - LLComboBox* comboTexGen = mPanel->getChild("combobox texgen"); - LLCheckBoxCtrl* cb_planar_align = mPanel->getChild("checkbox planar align"); - bool align_planar = (cb_planar_align && cb_planar_align->get()); + bool align_planar = mPanel->mPlanarAlign->get(); - llassert(comboTexGen); llassert(object); if (ctrlTexScaleS) { - valid = !ctrlTexScaleS->getTentative(); // || !checkFlipScaleS->getTentative(); + bool valid = !ctrlTexScaleS->getTentative(); // || !checkFlipScaleS->getTentative(); if (valid || align_planar) { - value = ctrlTexScaleS->get(); - if (comboTexGen && - comboTexGen->getCurrentIndex() == 1) + F32 value = ctrlTexScaleS->get(); + if (mPanel->mComboTexGen->getCurrentIndex() == 1) { value *= 0.5f; } @@ -679,20 +644,19 @@ struct LLPanelFaceSetTEFunctor : public LLSelectedTEFunctor if (ctrlTexScaleT) { - valid = !ctrlTexScaleT->getTentative(); // || !checkFlipScaleT->getTentative(); + bool valid = !ctrlTexScaleT->getTentative(); // || !checkFlipScaleT->getTentative(); if (valid || align_planar) { - value = ctrlTexScaleT->get(); - //if( checkFlipScaleT->get() ) + F32 value = ctrlTexScaleT->get(); + //if (checkFlipScaleT->get()) //{ // value = -value; //} - if (comboTexGen && - comboTexGen->getCurrentIndex() == 1) + if (mPanel->mComboTexGen->getCurrentIndex() == 1) { value *= 0.5f; } - object->setTEScaleT( te, value ); + object->setTEScaleT(te, value); if (align_planar) { @@ -704,11 +668,11 @@ struct LLPanelFaceSetTEFunctor : public LLSelectedTEFunctor if (ctrlTexOffsetS) { - valid = !ctrlTexOffsetS->getTentative(); + bool valid = !ctrlTexOffsetS->getTentative(); if (valid || align_planar) { - value = ctrlTexOffsetS->get(); - object->setTEOffsetS( te, value ); + F32 value = ctrlTexOffsetS->get(); + object->setTEOffsetS(te, value); if (align_planar) { @@ -720,11 +684,11 @@ struct LLPanelFaceSetTEFunctor : public LLSelectedTEFunctor if (ctrlTexOffsetT) { - valid = !ctrlTexOffsetT->getTentative(); + bool valid = !ctrlTexOffsetT->getTentative(); if (valid || align_planar) { - value = ctrlTexOffsetT->get(); - object->setTEOffsetT( te, value ); + F32 value = ctrlTexOffsetT->get(); + object->setTEOffsetT(te, value); if (align_planar) { @@ -736,11 +700,11 @@ struct LLPanelFaceSetTEFunctor : public LLSelectedTEFunctor if (ctrlTexRotation) { - valid = !ctrlTexRotation->getTentative(); + bool valid = !ctrlTexRotation->getTentative(); if (valid || align_planar) { - value = ctrlTexRotation->get() * DEG_TO_RAD; - object->setTERotation( te, value ); + F32 value = ctrlTexRotation->get() * DEG_TO_RAD; + object->setTERotation(te, value); if (align_planar) { @@ -947,7 +911,7 @@ struct LLPanelFaceSendFunctor : public LLSelectedObjectFunctor void LLPanelFace::sendTextureInfo() { - if (childGetValue("checkbox planar align").asBoolean()) + if (mPlanarAlign->getValue().asBoolean()) { LLFace* last_face = NULL; bool identical_face =false; @@ -999,7 +963,7 @@ void LLPanelFace::updateUI(bool force_set_values /*false*/) const bool has_material = !has_pbr_material; // only turn on auto-adjust button if there is a media renderer and the media is loaded - childSetEnabled("button align", editable); + mBtnAlign->setEnabled(editable); if (mComboMatMedia->getCurrentIndex() < MATMEDIA_MATERIAL) { @@ -1100,30 +1064,23 @@ void LLPanelFace::updateUI(bool force_set_values /*false*/) const bool pbr_selected = mComboMatMedia->getCurrentIndex() == MATMEDIA_PBR; const bool texture_info_selected = pbr_selected && mRadioPbrType->getSelectedIndex() != PBRTYPE_RENDER_MATERIAL_ID; - getChildView("checkbox_sync_settings")->setEnabled(editable); - childSetValue("checkbox_sync_settings", gSavedSettings.getBOOL("SyncMaterialSettings")); + mCheckSyncSettings->setEnabled(editable); + mCheckSyncSettings->setValue(gSavedSettings.getBOOL("SyncMaterialSettings")); updateVisibility(objectp); // Color swatch - { - getChildView("color label")->setEnabled(editable); - } - + mLabelColor->setEnabled(editable); LLColor4 color = LLColor4::white; bool identical_color = false; - { - LLSelectedTE::getColor(color, identical_color); - LLColor4 prev_color = mColorSwatch->get(); - - mColorSwatch->setOriginal(color); - mColorSwatch->set(color, force_set_values || (prev_color != color) || !editable); - - mColorSwatch->setValid(editable && !has_pbr_material); - mColorSwatch->setEnabled( editable && !has_pbr_material); - mColorSwatch->setCanApplyImmediately( editable && !has_pbr_material); - } + LLSelectedTE::getColor(color, identical_color); + LLColor4 prev_color = mColorSwatch->get(); + mColorSwatch->setOriginal(color); + mColorSwatch->set(color, force_set_values || (prev_color != color) || !editable); + mColorSwatch->setValid(editable && !has_pbr_material); + mColorSwatch->setEnabled( editable && !has_pbr_material); + mColorSwatch->setCanApplyImmediately( editable && !has_pbr_material); // Color transparency mLabelColorTransp->setEnabled(editable); @@ -1132,65 +1089,51 @@ void LLPanelFace::updateUI(bool force_set_values /*false*/) mCtrlColorTransp->setValue(editable ? transparency : 0); mCtrlColorTransp->setEnabled(editable && has_material); + // Shiny U8 shiny = 0; - bool identical_shiny = false; + { + bool identical_shiny = false; - // Shiny - LLSelectedTE::getShiny(shiny, identical_shiny); - identical = identical && identical_shiny; + LLSelectedTE::getShiny(shiny, identical_shiny); + identical = identical && identical_shiny; - shiny = specmap_id.isNull() ? shiny : SHINY_TEXTURE; + shiny = specmap_id.isNull() ? shiny : SHINY_TEXTURE; - LLCtrlSelectionInterface* combobox_shininess = childGetSelectionInterface("combobox shininess"); - if (combobox_shininess) - { - combobox_shininess->selectNthItem((S32)shiny); - } + mComboShininess->getSelectionInterface()->selectNthItem((S32)shiny); - getChildView("label shininess")->setEnabled(editable); - getChildView("combobox shininess")->setEnabled(editable); + mLabelShininess->setEnabled(editable); + mComboShininess->setEnabled(editable); - getChildView("label glossiness")->setEnabled(editable); - getChildView("glossiness")->setEnabled(editable); + mLabelGlossiness->setEnabled(editable); + mGlossiness->setEnabled(editable); - getChildView("label environment")->setEnabled(editable); - getChildView("environment")->setEnabled(editable); - getChildView("label shinycolor")->setEnabled(editable); + mLabelEnvironment->setEnabled(editable); + mEnvironment->setEnabled(editable); + mLabelShiniColor->setEnabled(editable); - getChild("combobox shininess")->setTentative(!identical_spec); - getChild("glossiness")->setTentative(!identical_spec); - getChild("environment")->setTentative(!identical_spec); - mShinyColorSwatch->setTentative(!identical_spec); + mComboShininess->setTentative(!identical_spec); + mGlossiness->setTentative(!identical_spec); + mEnvironment->setTentative(!identical_spec); + mShinyColorSwatch->setTentative(!identical_spec); - { mShinyColorSwatch->setValid(editable); - mShinyColorSwatch->setEnabled( editable ); - mShinyColorSwatch->setCanApplyImmediately( editable ); + mShinyColorSwatch->setEnabled(editable); + mShinyColorSwatch->setCanApplyImmediately(editable); } - U8 bumpy = 0; // Bumpy + U8 bumpy = 0; { bool identical_bumpy = false; - LLSelectedTE::getBumpmap(bumpy,identical_bumpy); + LLSelectedTE::getBumpmap(bumpy, identical_bumpy); LLUUID norm_map_id = getCurrentNormalMap(); - LLCtrlSelectionInterface* combobox_bumpiness = childGetSelectionInterface("combobox bumpiness"); - bumpy = norm_map_id.isNull() ? bumpy : BUMPY_TEXTURE; + mComboBumpiness->getSelectionInterface()->selectNthItem((S32)bumpy); - if (combobox_bumpiness) - { - combobox_bumpiness->selectNthItem((S32)bumpy); - } - else - { - LL_WARNS() << "failed childGetSelectionInterface for 'combobox bumpiness'" << LL_ENDL; - } - - getChildView("combobox bumpiness")->setEnabled(editable); - getChild("combobox bumpiness")->setTentative(!identical_bumpy); - getChildView("label bumpiness")->setEnabled(editable); + mComboBumpiness->setEnabled(editable); + mComboBumpiness->setTentative(!identical_bumpy); + mLabelBumpiness->setEnabled(editable); } // Texture @@ -1228,7 +1171,7 @@ void LLPanelFace::updateUI(bool force_set_values /*false*/) if (LLViewerMedia::getInstance()->textureHasMedia(id)) { - getChildView("button align")->setEnabled(editable); + mBtnAlign->setEnabled(editable); } // Diffuse Alpha Mode @@ -1243,22 +1186,14 @@ void LLPanelFace::updateUI(bool force_set_values /*false*/) // LLSelectedTEMaterial::getCurrentDiffuseAlphaMode(alpha_mode, identical_alpha_mode, mIsAlpha); - LLCtrlSelectionInterface* combobox_alphamode = childGetSelectionInterface("combobox alphamode"); - if (combobox_alphamode) - { - //it is invalid to have any alpha mode other than blend if transparency is greater than zero ... - // Want masking? Want emissive? Tough! You get BLEND! - alpha_mode = (transparency > 0.f) ? LLMaterial::DIFFUSE_ALPHA_MODE_BLEND : alpha_mode; + // it is invalid to have any alpha mode other than blend if transparency is greater than zero ... + // Want masking? Want emissive? Tough! You get BLEND! + alpha_mode = (transparency > 0.f) ? LLMaterial::DIFFUSE_ALPHA_MODE_BLEND : alpha_mode; - // ... unless there is no alpha channel in the texture, in which case alpha mode MUST be none - alpha_mode = mIsAlpha ? alpha_mode : LLMaterial::DIFFUSE_ALPHA_MODE_NONE; + // ... unless there is no alpha channel in the texture, in which case alpha mode MUST be none + alpha_mode = mIsAlpha ? alpha_mode : LLMaterial::DIFFUSE_ALPHA_MODE_NONE; - combobox_alphamode->selectNthItem(alpha_mode); - } - else - { - LL_WARNS() << "failed childGetSelectionInterface for 'combobox alphamode'" << LL_ENDL; - } + mComboAlphaMode->getSelectionInterface()->selectNthItem(alpha_mode); updateAlphaControls(); @@ -1271,10 +1206,10 @@ void LLPanelFace::updateUI(bool force_set_values /*false*/) mTextureCtrl->setImageAssetID(id); bool can_change_alpha = editable && mIsAlpha && !missing_asset && !has_pbr_material; - getChildView("combobox alphamode")->setEnabled(can_change_alpha && transparency <= 0.f); - getChildView("label alphamode")->setEnabled(can_change_alpha); - getChildView("maskcutoff")->setEnabled(can_change_alpha); - getChildView("label maskcutoff")->setEnabled(can_change_alpha); + mComboAlphaMode->setEnabled(can_change_alpha && transparency <= 0.f); + mLabelAlphaMode->setEnabled(can_change_alpha); + mMaskCutoff->setEnabled(can_change_alpha); + mLabelMaskCutoff->setEnabled(can_change_alpha); mTextureCtrl->setBakeTextureEnabled(true); } @@ -1284,10 +1219,10 @@ void LLPanelFace::updateUI(bool force_set_values /*false*/) mTextureCtrl->setTentative(false); mTextureCtrl->setEnabled(false); mTextureCtrl->setImageAssetID(LLUUID::null); - getChildView("combobox alphamode")->setEnabled(false); - getChildView("label alphamode")->setEnabled(false); - getChildView("maskcutoff")->setEnabled(false); - getChildView("label maskcutoff")->setEnabled(false); + mComboAlphaMode->setEnabled(false); + mLabelAlphaMode->setEnabled(false); + mMaskCutoff->setEnabled(false); + mLabelMaskCutoff->setEnabled(false); mTextureCtrl->setBakeTextureEnabled(false); } @@ -1299,10 +1234,10 @@ void LLPanelFace::updateUI(bool force_set_values /*false*/) mTextureCtrl->setImageAssetID(id); bool can_change_alpha = editable && mIsAlpha && !missing_asset && !has_pbr_material; - getChildView("combobox alphamode")->setEnabled(can_change_alpha && transparency <= 0.f); - getChildView("label alphamode")->setEnabled(can_change_alpha); - getChildView("maskcutoff")->setEnabled(can_change_alpha); - getChildView("label maskcutoff")->setEnabled(can_change_alpha); + mComboAlphaMode->setEnabled(can_change_alpha && transparency <= 0.f); + mLabelAlphaMode->setEnabled(can_change_alpha); + mMaskCutoff->setEnabled(can_change_alpha); + mLabelMaskCutoff->setEnabled(can_change_alpha); mTextureCtrl->setBakeTextureEnabled(true); } @@ -1354,28 +1289,24 @@ void LLPanelFace::updateUI(bool force_set_values /*false*/) } // planar align - bool align_planar = false; + bool align_planar = mPlanarAlign->get(); bool identical_planar_aligned = false; - { - LLCheckBoxCtrl* cb_planar_align = getChild("checkbox planar align"); - align_planar = (cb_planar_align && cb_planar_align->get()); - bool enabled = (editable && isIdenticalPlanarTexgen() && !texture_info_selected); - childSetValue("checkbox planar align", align_planar && enabled); - childSetVisible("checkbox planar align", enabled); - childSetEnabled("checkbox planar align", enabled); - childSetEnabled("button align textures", enabled && LLSelectMgr::getInstance()->getSelection()->getObjectCount() > 1); + bool enabled = (editable && isIdenticalPlanarTexgen() && !texture_info_selected); + mPlanarAlign->setValue(align_planar && enabled); + mPlanarAlign->setVisible(enabled); + mPlanarAlign->setEnabled(enabled); + mBtnAlignTex->setEnabled(enabled && LLSelectMgr::getInstance()->getSelection()->getObjectCount() > 1); - if (align_planar && enabled) - { - LLFace* last_face = NULL; - bool identical_face = false; - LLSelectedTE::getFace(last_face, identical_face); + if (align_planar && enabled) + { + LLFace* last_face = NULL; + bool identical_face = false; + LLSelectedTE::getFace(last_face, identical_face); - LLPanelFaceGetIsAlignedTEFunctor get_is_aligend_func(last_face); - // this will determine if the texture param controls are tentative: - identical_planar_aligned = LLSelectMgr::getInstance()->getSelection()->applyToTEs(&get_is_aligend_func); - } + LLPanelFaceGetIsAlignedTEFunctor get_is_aligend_func(last_face); + // this will determine if the texture param controls are tentative: + identical_planar_aligned = LLSelectMgr::getInstance()->getSelection()->applyToTEs(&get_is_aligend_func); } // Needs to be public and before tex scale settings below to properly reflect @@ -1414,21 +1345,21 @@ void LLPanelFace::updateUI(bool force_set_values /*false*/) spec_scale_s = editable ? spec_scale_s : 1.0f; spec_scale_s *= identical_planar_texgen ? 2.0f : 1.0f; - getChild("TexScaleU")->setValue(diff_scale_s); - getChild("shinyScaleU")->setValue(spec_scale_s); - getChild("bumpyScaleU")->setValue(norm_scale_s); + mTexScaleU->setValue(diff_scale_s); + mShinyScaleU->setValue(spec_scale_s); + mBumpyScaleU->setValue(norm_scale_s); - getChildView("TexScaleU")->setEnabled(editable && has_material); - getChildView("shinyScaleU")->setEnabled(editable && has_material && specmap_id.notNull()); - getChildView("bumpyScaleU")->setEnabled(editable && has_material && normmap_id.notNull()); + mTexScaleU->setEnabled(editable && has_material); + mShinyScaleU->setEnabled(editable && has_material && specmap_id.notNull()); + mBumpyScaleU->setEnabled(editable && has_material && normmap_id.notNull()); bool diff_scale_tentative = !(identical && identical_diff_scale_s); bool norm_scale_tentative = !(identical && identical_norm_scale_s); bool spec_scale_tentative = !(identical && identical_spec_scale_s); - getChild("TexScaleU")->setTentative(LLSD(diff_scale_tentative)); - getChild("shinyScaleU")->setTentative(LLSD(spec_scale_tentative)); - getChild("bumpyScaleU")->setTentative(LLSD(norm_scale_tentative)); + mTexScaleU->setTentative(LLSD(diff_scale_tentative)); + mShinyScaleU->setTentative(LLSD(spec_scale_tentative)); + mBumpyScaleU->setTentative(LLSD(norm_scale_tentative)); } { @@ -1457,24 +1388,24 @@ void LLPanelFace::updateUI(bool force_set_values /*false*/) bool norm_scale_tentative = !identical_norm_scale_t; bool spec_scale_tentative = !identical_spec_scale_t; - getChildView("TexScaleV")->setEnabled(editable && has_material); - getChildView("shinyScaleV")->setEnabled(editable && has_material && specmap_id.notNull()); - getChildView("bumpyScaleV")->setEnabled(editable && has_material && normmap_id.notNull()); + mTexScaleV->setEnabled(editable && has_material); + mShinyScaleV->setEnabled(editable && has_material && specmap_id.notNull()); + mBumpyScaleV->setEnabled(editable && has_material && normmap_id.notNull()); if (force_set_values) { - getChild("TexScaleV")->forceSetValue(diff_scale_t); + mTexScaleV->forceSetValue(diff_scale_t); } else { - getChild("TexScaleV")->setValue(diff_scale_t); + mTexScaleV->setValue(diff_scale_t); } - getChild("shinyScaleV")->setValue(norm_scale_t); - getChild("bumpyScaleV")->setValue(spec_scale_t); + mShinyScaleV->setValue(norm_scale_t); + mBumpyScaleV->setValue(spec_scale_t); - getChild("TexScaleV")->setTentative(LLSD(diff_scale_tentative)); - getChild("shinyScaleV")->setTentative(LLSD(norm_scale_tentative)); - getChild("bumpyScaleV")->setTentative(LLSD(spec_scale_tentative)); + mTexScaleV->setTentative(LLSD(diff_scale_tentative)); + mShinyScaleV->setTentative(LLSD(spec_scale_tentative)); + mBumpyScaleV->setTentative(LLSD(norm_scale_tentative)); } // Texture offset @@ -1495,17 +1426,17 @@ void LLPanelFace::updateUI(bool force_set_values /*false*/) bool norm_offset_u_tentative = !(align_planar ? identical_planar_aligned : identical_norm_offset_s); bool spec_offset_u_tentative = !(align_planar ? identical_planar_aligned : identical_spec_offset_s); - getChild("TexOffsetU")->setValue( editable ? diff_offset_s : 0.0f); - getChild("bumpyOffsetU")->setValue(editable ? norm_offset_s : 0.0f); - getChild("shinyOffsetU")->setValue(editable ? spec_offset_s : 0.0f); + mTexOffsetU->setValue(editable ? diff_offset_s : 0.0f); + mBumpyOffsetU->setValue(editable ? norm_offset_s : 0.0f); + mShinyOffsetU->setValue(editable ? spec_offset_s : 0.0f); - getChild("TexOffsetU")->setTentative(LLSD(diff_offset_u_tentative)); - getChild("shinyOffsetU")->setTentative(LLSD(norm_offset_u_tentative)); - getChild("bumpyOffsetU")->setTentative(LLSD(spec_offset_u_tentative)); + mTexOffsetU->setTentative(LLSD(diff_offset_u_tentative)); + mShinyOffsetU->setTentative(LLSD(spec_offset_u_tentative)); + mBumpyOffsetU->setTentative(LLSD(norm_offset_u_tentative)); - getChildView("TexOffsetU")->setEnabled(editable && has_material); - getChildView("shinyOffsetU")->setEnabled(editable && has_material && specmap_id.notNull()); - getChildView("bumpyOffsetU")->setEnabled(editable && has_material && normmap_id.notNull()); + mTexOffsetU->setEnabled(editable && has_material); + mShinyOffsetU->setEnabled(editable && has_material && specmap_id.notNull()); + mBumpyOffsetU->setEnabled(editable && has_material && normmap_id.notNull()); } { @@ -1525,17 +1456,17 @@ void LLPanelFace::updateUI(bool force_set_values /*false*/) bool norm_offset_v_tentative = !(align_planar ? identical_planar_aligned : identical_norm_offset_t); bool spec_offset_v_tentative = !(align_planar ? identical_planar_aligned : identical_spec_offset_t); - getChild("TexOffsetV")->setValue( editable ? diff_offset_t : 0.0f); - getChild("bumpyOffsetV")->setValue(editable ? norm_offset_t : 0.0f); - getChild("shinyOffsetV")->setValue(editable ? spec_offset_t : 0.0f); + mTexOffsetV->setValue( editable ? diff_offset_t : 0.0f); + mBumpyOffsetV->setValue(editable ? norm_offset_t : 0.0f); + mShinyOffsetV->setValue(editable ? spec_offset_t : 0.0f); - getChild("TexOffsetV")->setTentative(LLSD(diff_offset_v_tentative)); - getChild("shinyOffsetV")->setTentative(LLSD(norm_offset_v_tentative)); - getChild("bumpyOffsetV")->setTentative(LLSD(spec_offset_v_tentative)); + mTexOffsetV->setTentative(LLSD(diff_offset_v_tentative)); + mBumpyOffsetV->setTentative(LLSD(norm_offset_v_tentative)); + mShinyOffsetV->setTentative(LLSD(spec_offset_v_tentative)); - getChildView("TexOffsetV")->setEnabled(editable && has_material); - getChildView("shinyOffsetV")->setEnabled(editable && has_material && specmap_id.notNull()); - getChildView("bumpyOffsetV")->setEnabled(editable && has_material && normmap_id.notNull()); + mTexOffsetV->setEnabled(editable && has_material); + mShinyOffsetV->setEnabled(editable && has_material && specmap_id.notNull()); + mBumpyOffsetV->setEnabled(editable && has_material && normmap_id.notNull()); } // Texture rotation @@ -1560,17 +1491,17 @@ void LLPanelFace::updateUI(bool force_set_values /*false*/) F32 norm_rot_deg = norm_rotation * RAD_TO_DEG; F32 spec_rot_deg = spec_rotation * RAD_TO_DEG; - getChildView("TexRot")->setEnabled(editable && has_material); - getChildView("shinyRot")->setEnabled(editable && has_material && specmap_id.notNull()); - getChildView("bumpyRot")->setEnabled(editable && has_material && normmap_id.notNull()); + mTexRotate->setEnabled(editable && has_material); + mShinyRotate->setEnabled(editable && has_material && specmap_id.notNull()); + mBumpyRotate->setEnabled(editable && has_material && normmap_id.notNull()); - getChild("TexRot")->setTentative(LLSD(diff_rot_tentative)); - getChild("shinyRot")->setTentative(LLSD(spec_rot_tentative)); - getChild("bumpyRot")->setTentative(LLSD(norm_rot_tentative)); + mTexRotate->setTentative(LLSD(diff_rot_tentative)); + mShinyRotate->setTentative(LLSD(spec_rot_tentative)); + mBumpyRotate->setTentative(LLSD(norm_rot_tentative)); - getChild("TexRot")->setValue(editable ? diff_rot_deg : 0.0f); - getChild("shinyRot")->setValue(editable ? spec_rot_deg : 0.0f); - getChild("bumpyRot")->setValue(editable ? norm_rot_deg : 0.0f); + mTexRotate->setValue(editable ? diff_rot_deg : 0.0f); + mShinyRotate->setValue(editable ? spec_rot_deg : 0.0f); + mBumpyRotate->setValue(editable ? norm_rot_deg : 0.0f); } { @@ -1580,7 +1511,7 @@ void LLPanelFace::updateUI(bool force_set_values /*false*/) mCtrlGlow->setValue(glow); mCtrlGlow->setTentative(!identical_glow); mCtrlGlow->setEnabled(editable); - getChildView("glow label")->setEnabled(editable); + mLabelGlow->setEnabled(editable); } { @@ -1589,7 +1520,7 @@ void LLPanelFace::updateUI(bool force_set_values /*false*/) mComboTexGen->setEnabled(editable); mComboTexGen->setTentative(!identical); - getChildView("tex gen")->setEnabled(editable); + mLabelTexGen->setEnabled(editable); } { @@ -1667,18 +1598,17 @@ void LLPanelFace::updateUI(bool force_set_values /*false*/) bool repeats_tentative = !identical_repeats; - LLSpinCtrl* rpt_ctrl = getChild("rptctrl"); if (force_set_values) { - //onCommit, previosly edited element updates related ones - rpt_ctrl->forceSetValue(editable ? repeats : 1.0f); + // onCommit, previosly edited element updates related ones + mTexRepeat->forceSetValue(editable ? repeats : 1.0f); } else { - rpt_ctrl->setValue(editable ? repeats : 1.0f); + mTexRepeat->setValue(editable ? repeats : 1.0f); } - rpt_ctrl->setTentative(LLSD(repeats_tentative)); - rpt_ctrl->setEnabled(has_material && !identical_planar_texgen && enabled); + mTexRepeat->setTentative(LLSD(repeats_tentative)); + mTexRepeat->setEnabled(has_material && !identical_planar_texgen && enabled); } } @@ -1692,9 +1622,6 @@ void LLPanelFace::updateUI(bool force_set_values /*false*/) LL_DEBUGS("Materials") << material->asLLSD() << LL_ENDL; // Alpha - LLCtrlSelectionInterface* combobox_alphamode = - childGetSelectionInterface("combobox alphamode"); - if (combobox_alphamode) { U32 alpha_mode = material->getDiffuseAlphaMode(); @@ -1708,14 +1635,10 @@ void LLPanelFace::updateUI(bool force_set_values /*false*/) alpha_mode = LLMaterial::DIFFUSE_ALPHA_MODE_NONE; } - combobox_alphamode->selectNthItem(alpha_mode); - } - else - { - LL_WARNS() << "failed childGetSelectionInterface for 'combobox alphamode'" << LL_ENDL; + mComboAlphaMode->getSelectionInterface()->selectNthItem(alpha_mode); } - getChild("maskcutoff")->setValue(material->getAlphaMaskCutoff()); + mMaskCutoff->setValue(material->getAlphaMaskCutoff()); updateAlphaControls(); identical_planar_texgen = isIdenticalPlanarTexgen(); @@ -1736,13 +1659,13 @@ void LLPanelFace::updateUI(bool force_set_values /*false*/) } rot = material->getSpecularRotation(); - getChild("shinyScaleU")->setValue(repeat_x); - getChild("shinyScaleV")->setValue(repeat_y); - getChild("shinyRot")->setValue(rot * RAD_TO_DEG); - getChild("shinyOffsetU")->setValue(offset_x); - getChild("shinyOffsetV")->setValue(offset_y); - getChild("glossiness")->setValue(material->getSpecularLightExponent()); - getChild("environment")->setValue(material->getEnvironmentIntensity()); + mShinyScaleU->setValue(repeat_x); + mShinyScaleV->setValue(repeat_y); + mShinyRotate->setValue(rot * RAD_TO_DEG); + mShinyOffsetU->setValue(offset_x); + mShinyOffsetV->setValue(offset_y); + mGlossiness->setValue(material->getSpecularLightExponent()); + mEnvironment->setValue(material->getEnvironmentIntensity()); updateShinyControls(!material->getSpecularID().isNull(), true); } @@ -1774,11 +1697,11 @@ void LLPanelFace::updateUI(bool force_set_values /*false*/) } rot = material->getNormalRotation(); - getChild("bumpyScaleU")->setValue(repeat_x); - getChild("bumpyScaleV")->setValue(repeat_y); - getChild("bumpyRot")->setValue(rot * RAD_TO_DEG); - getChild("bumpyOffsetU")->setValue(offset_x); - getChild("bumpyOffsetV")->setValue(offset_y); + mBumpyScaleU->setValue(repeat_x); + mBumpyScaleV->setValue(repeat_y); + mBumpyRotate->setValue(rot*RAD_TO_DEG); + mBumpyOffsetU->setValue(offset_x); + mBumpyOffsetV->setValue(offset_y); updateBumpyControls(!material->getNormalID().isNull(), true); } @@ -1791,11 +1714,11 @@ void LLPanelFace::updateUI(bool force_set_values /*false*/) // Set variable values for numeric expressions LLCalc* calcp = LLCalc::getInstance(); - calcp->setVar(LLCalc::TEX_U_SCALE, (F32)childGetValue("TexScaleU").asReal()); - calcp->setVar(LLCalc::TEX_V_SCALE, (F32)childGetValue("TexScaleV").asReal()); - calcp->setVar(LLCalc::TEX_U_OFFSET, (F32)childGetValue("TexOffsetU").asReal()); - calcp->setVar(LLCalc::TEX_V_OFFSET, (F32)childGetValue("TexOffsetV").asReal()); - calcp->setVar(LLCalc::TEX_ROTATION, (F32)childGetValue("TexRot").asReal()); + calcp->setVar(LLCalc::TEX_U_SCALE, (F32)mTexScaleU->getValue().asReal()); + calcp->setVar(LLCalc::TEX_V_SCALE, (F32)mTexScaleV->getValue().asReal()); + calcp->setVar(LLCalc::TEX_U_OFFSET, (F32)mTexOffsetU->getValue().asReal()); + calcp->setVar(LLCalc::TEX_V_OFFSET, (F32)mTexOffsetV->getValue().asReal()); + calcp->setVar(LLCalc::TEX_ROTATION, (F32)mTexRotate->getValue().asReal()); calcp->setVar(LLCalc::TEX_TRANSPARENCY, (F32)mCtrlColorTransp->getValue().asReal()); calcp->setVar(LLCalc::TEX_GLOW, (F32)mCtrlGlow->getValue().asReal()); } @@ -1830,14 +1753,14 @@ void LLPanelFace::updateUI(bool force_set_values /*false*/) mRadioMaterialType->setSelectedIndex(0); } mLabelColorTransp->setEnabled(false); - getChildView("rptctrl")->setEnabled(false); - getChildView("tex gen")->setEnabled(false); - getChildView("label shininess")->setEnabled(false); - getChildView("label bumpiness")->setEnabled(false); - getChildView("button align")->setEnabled(false); - getChildView("pbr_from_inventory")->setEnabled(false); - getChildView("edit_selected_pbr")->setEnabled(false); - getChildView("save_selected_pbr")->setEnabled(false); + mTexRepeat->setEnabled(false); + mLabelTexGen->setEnabled(false); + mLabelShininess->setEnabled(false); + mLabelBumpiness->setEnabled(false); + mBtnAlign->setEnabled(false); + mBtnPbrFromInv->setEnabled(false); + mBtnEditBbr->setEnabled(false); + mBtnSaveBbr->setEnabled(false); updateVisibility(); @@ -1960,9 +1883,9 @@ void LLPanelFace::updateUIGLTF(LLViewerObject* objectp, bool& has_pbr_material, } } - getChildView("pbr_from_inventory")->setEnabled(settable); - getChildView("edit_selected_pbr")->setEnabled(editable && !has_faces_without_pbr); - getChildView("save_selected_pbr")->setEnabled(saveable && identical_pbr); + mBtnPbrFromInv->setEnabled(settable); + mBtnEditBbr->setEnabled(editable && !has_faces_without_pbr); + mBtnSaveBbr->setEnabled(saveable && identical_pbr); if (objectp->isInventoryPending()) { // Reuse the same listener when possible @@ -1992,17 +1915,11 @@ void LLPanelFace::updateUIGLTF(LLViewerObject* objectp, bool& has_pbr_material, { const bool new_state = has_pbr_capabilities && has_pbr_material && !has_faces_without_pbr; - LLUICtrl* gltfCtrlTextureScaleU = getChild("gltfTextureScaleU"); - LLUICtrl* gltfCtrlTextureScaleV = getChild("gltfTextureScaleV"); - LLUICtrl* gltfCtrlTextureRotation = getChild("gltfTextureRotation"); - LLUICtrl* gltfCtrlTextureOffsetU = getChild("gltfTextureOffsetU"); - LLUICtrl* gltfCtrlTextureOffsetV = getChild("gltfTextureOffsetV"); - - gltfCtrlTextureScaleU->setEnabled(new_state); - gltfCtrlTextureScaleV->setEnabled(new_state); - gltfCtrlTextureRotation->setEnabled(new_state); - gltfCtrlTextureOffsetU->setEnabled(new_state); - gltfCtrlTextureOffsetV->setEnabled(new_state); + mPBRScaleU->setEnabled(new_state); + mPBRScaleV->setEnabled(new_state); + mPBRRotate->setEnabled(new_state); + mPBROffsetU->setEnabled(new_state); + mPBROffsetV->setEnabled(new_state); // Control values will be set once per frame in // setMaterialOverridesFromSelection @@ -2022,16 +1939,16 @@ void LLPanelFace::updateVisibilityGLTF(LLViewerObject* objectp /*= nullptr */) mPBRTextureCtrl->setVisible(show_pbr_render_material_id); - getChildView("pbr_from_inventory")->setVisible(show_pbr_render_material_id); - getChildView("edit_selected_pbr")->setVisible(show_pbr_render_material_id && !inventory_pending); - getChildView("save_selected_pbr")->setVisible(show_pbr_render_material_id && !inventory_pending); - getChildView("material_permissions_loading_label")->setVisible(show_pbr_render_material_id && inventory_pending); + mBtnPbrFromInv->setVisible(show_pbr_render_material_id); + mBtnEditBbr->setVisible(show_pbr_render_material_id && !inventory_pending); + mBtnSaveBbr->setVisible(show_pbr_render_material_id && !inventory_pending); + mLabelMatPermLoading->setVisible(show_pbr_render_material_id && inventory_pending); - getChildView("gltfTextureScaleU")->setVisible(show_pbr); - getChildView("gltfTextureScaleV")->setVisible(show_pbr); - getChildView("gltfTextureRotation")->setVisible(show_pbr); - getChildView("gltfTextureOffsetU")->setVisible(show_pbr); - getChildView("gltfTextureOffsetV")->setVisible(show_pbr); + mPBRScaleU->setVisible(show_pbr); + mPBRScaleV->setVisible(show_pbr); + mPBRRotate->setVisible(show_pbr); + mPBROffsetU->setVisible(show_pbr); + mPBROffsetV->setVisible(show_pbr); } void LLPanelFace::updateCopyTexButton() @@ -2061,7 +1978,7 @@ void LLPanelFace::refreshMedia() && first_object->permModify() )) { - getChildView("add_media")->setEnabled(false); + mAddMedia->setEnabled(false); mTitleMediaText->clear(); clearMediaSettings(); return; @@ -2072,7 +1989,7 @@ void LLPanelFace::refreshMedia() if (!has_media_capability) { - getChildView("add_media")->setEnabled(false); + mAddMedia->setEnabled(false); LL_WARNS("LLFloaterToolsMedia") << "Media not enabled (no capability) in this region!" << LL_ENDL; clearMediaSettings(); return; @@ -2154,7 +2071,7 @@ void LLPanelFace::refreshMedia() // update UI depending on whether "object" (prim or face) has media // and whether or not you are allowed to edit it. - getChildView("add_media")->setEnabled(editable); + mAddMedia->setEnabled(editable); // IF all the faces have media (or all dont have media) if (LLFloaterMediaSettings::getInstance()->mIdenticalHasMediaInfo) { @@ -2176,7 +2093,7 @@ void LLPanelFace::refreshMedia() media_title = multi_media_info_str; } - getChildView("delete_media")->setEnabled(bool_has_media && editable); + mDelMedia->setEnabled(bool_has_media && editable); // TODO: display a list of all media on the face - use 'identical' flag } else // not all face has media but at least one does. @@ -2198,7 +2115,7 @@ void LLPanelFace::refreshMedia() } } - getChildView("delete_media")->setEnabled(true); + mDelMedia->setEnabled(true); } U32 materials_media = mComboMatMedia->getCurrentIndex(); @@ -2862,9 +2779,7 @@ void LLPanelFace::onCommitMaterialsMedia() void LLPanelFace::updateVisibility(LLViewerObject* objectp /* = nullptr */) { - LLComboBox* combo_shininess = findChild("combobox shininess"); - LLComboBox* combo_bumpiness = findChild("combobox bumpiness"); - if (!mRadioMaterialType || !mRadioPbrType || !mComboMatMedia || !combo_shininess || !combo_bumpiness) + if (!mRadioMaterialType || !mRadioPbrType) { LL_WARNS("Materials") << "Combo box not found...exiting." << LL_ENDL; return; @@ -2884,53 +2799,53 @@ void LLPanelFace::updateVisibility(LLViewerObject* objectp /* = nullptr */) mRadioMaterialType->setVisible(show_material); // Shared material controls - getChildView("checkbox_sync_settings")->setVisible(show_material || show_media); - getChildView("tex gen")->setVisible(show_material || show_media || show_pbr_asset); + mCheckSyncSettings->setVisible(show_material || show_media); + mLabelTexGen->setVisible(show_material || show_media || show_pbr_asset); mComboTexGen->setVisible(show_material || show_media || show_pbr_asset); - getChildView("button align textures")->setVisible(show_material || show_media); + mBtnAlignTex->setVisible(show_material || show_media); // Media controls mTitleMediaText->setVisible(show_media); - getChildView("add_media")->setVisible(show_media); - getChildView("delete_media")->setVisible(show_media); - getChildView("button align")->setVisible(show_media); + mAddMedia->setVisible(show_media); + mDelMedia->setVisible(show_media); + mBtnAlign->setVisible(show_media); // Diffuse texture controls mTextureCtrl->setVisible(show_texture && show_material); - getChildView("label alphamode")->setVisible(show_texture && show_material); - getChildView("combobox alphamode")->setVisible(show_texture && show_material); - getChildView("label maskcutoff")->setVisible(false); - getChildView("maskcutoff")->setVisible(false); + mLabelAlphaMode->setVisible(show_texture && show_material); + mComboAlphaMode->setVisible(show_texture && show_material); + mLabelMaskCutoff->setVisible(false); + mMaskCutoff->setVisible(false); if (show_texture && show_material) { updateAlphaControls(); } // texture scale and position controls - getChildView("TexScaleU")->setVisible(show_texture); - getChildView("TexScaleV")->setVisible(show_texture); - getChildView("TexRot")->setVisible(show_texture); - getChildView("TexOffsetU")->setVisible(show_texture); - getChildView("TexOffsetV")->setVisible(show_texture); + mTexScaleU->setVisible(show_texture); + mTexScaleV->setVisible(show_texture); + mTexRotate->setVisible(show_texture); + mTexOffsetU->setVisible(show_texture); + mTexOffsetV->setVisible(show_texture); // Specular map controls mShinyTextureCtrl->setVisible(show_shininess); - getChildView("combobox shininess")->setVisible(show_shininess); - getChildView("label shininess")->setVisible(show_shininess); - getChildView("label glossiness")->setVisible(false); - getChildView("glossiness")->setVisible(false); - getChildView("label environment")->setVisible(false); - getChildView("environment")->setVisible(false); - getChildView("label shinycolor")->setVisible(false); + mComboShininess->setVisible(show_shininess); + mLabelShininess->setVisible(show_shininess); + mLabelGlossiness->setVisible(false); + mGlossiness->setVisible(false); + mLabelEnvironment->setVisible(false); + mEnvironment->setVisible(false); + mLabelShiniColor->setVisible(false); mShinyColorSwatch->setVisible(false); if (show_shininess) { updateShinyControls(); } - getChildView("shinyScaleU")->setVisible(show_shininess); - getChildView("shinyScaleV")->setVisible(show_shininess); - getChildView("shinyRot")->setVisible(show_shininess); - getChildView("shinyOffsetU")->setVisible(show_shininess); - getChildView("shinyOffsetV")->setVisible(show_shininess); + mShinyScaleU->setVisible(show_shininess); + mShinyScaleV->setVisible(show_shininess); + mShinyRotate->setVisible(show_shininess); + mShinyOffsetU->setVisible(show_shininess); + mShinyOffsetV->setVisible(show_shininess); // Normal map controls if (show_bumpiness) @@ -2938,15 +2853,15 @@ void LLPanelFace::updateVisibility(LLViewerObject* objectp /* = nullptr */) updateBumpyControls(); } mBumpyTextureCtrl->setVisible(show_bumpiness); - getChildView("combobox bumpiness")->setVisible(show_bumpiness); - getChildView("label bumpiness")->setVisible(show_bumpiness); - getChildView("bumpyScaleU")->setVisible(show_bumpiness); - getChildView("bumpyScaleV")->setVisible(show_bumpiness); - getChildView("bumpyRot")->setVisible(show_bumpiness); - getChildView("bumpyOffsetU")->setVisible(show_bumpiness); - getChildView("bumpyOffsetV")->setVisible(show_bumpiness); + mComboBumpiness->setVisible(show_bumpiness); + mLabelBumpiness->setVisible(show_bumpiness); + mBumpyScaleU->setVisible(show_bumpiness); + mBumpyScaleV->setVisible(show_bumpiness); + mBumpyRotate->setVisible(show_bumpiness); + mBumpyOffsetU->setVisible(show_bumpiness); + mBumpyOffsetV->setVisible(show_bumpiness); - getChild("rptctrl")->setVisible(show_material || show_media); + mTexRepeat->setVisible(show_material || show_media); // PBR controls updateVisibilityGLTF(objectp); @@ -2972,7 +2887,7 @@ void LLPanelFace::onCommitPbrType() void LLPanelFace::onCommitBump() { - sendBump(getChild("combobox bumpiness")->getCurrentIndex()); + sendBump(mComboBumpiness->getCurrentIndex()); } void LLPanelFace::onCommitTexGen() @@ -2984,33 +2899,32 @@ void LLPanelFace::updateShinyControls(bool is_setting_texture, bool mess_with_sh { LLUUID shiny_texture_ID = mShinyTextureCtrl->getImageAssetID(); LL_DEBUGS("Materials") << "Shiny texture selected: " << shiny_texture_ID << LL_ENDL; - LLComboBox* comboShiny = getChild("combobox shininess"); if (mess_with_shiny_combobox) { if (!shiny_texture_ID.isNull() && is_setting_texture) { - if (!comboShiny->itemExists(USE_TEXTURE)) + if (!mComboShininess->itemExists(USE_TEXTURE)) { - comboShiny->add(USE_TEXTURE); + mComboShininess->add(USE_TEXTURE); } - comboShiny->setSimple(USE_TEXTURE); + mComboShininess->setSimple(USE_TEXTURE); } else { - if (comboShiny->itemExists(USE_TEXTURE)) + if (mComboShininess->itemExists(USE_TEXTURE)) { - comboShiny->remove(SHINY_TEXTURE); - comboShiny->selectFirstItem(); + mComboShininess->remove(SHINY_TEXTURE); + mComboShininess->selectFirstItem(); } } } else { - if (shiny_texture_ID.isNull() && comboShiny->itemExists(USE_TEXTURE)) + if (shiny_texture_ID.isNull() && mComboShininess->itemExists(USE_TEXTURE)) { - comboShiny->remove(SHINY_TEXTURE); - comboShiny->selectFirstItem(); + mComboShininess->remove(SHINY_TEXTURE); + mComboShininess->selectFirstItem(); } } @@ -3018,13 +2932,13 @@ void LLPanelFace::updateShinyControls(bool is_setting_texture, bool mess_with_sh U32 material_type = mRadioMaterialType->getSelectedIndex(); bool show_material = (materials_media == MATMEDIA_MATERIAL); bool show_shininess = show_material && (material_type == MATTYPE_SPECULAR) && mComboMatMedia->getEnabled(); - U32 shiny_value = comboShiny->getCurrentIndex(); + U32 shiny_value = mComboShininess->getCurrentIndex(); bool show_shinyctrls = (shiny_value == SHINY_TEXTURE) && show_shininess; // Use texture - getChildView("label glossiness")->setVisible(show_shinyctrls); - getChildView("glossiness")->setVisible(show_shinyctrls); - getChildView("label environment")->setVisible(show_shinyctrls); - getChildView("environment")->setVisible(show_shinyctrls); - getChildView("label shinycolor")->setVisible(show_shinyctrls); + mLabelGlossiness->setVisible(show_shinyctrls); + mGlossiness->setVisible(show_shinyctrls); + mLabelEnvironment->setVisible(show_shinyctrls); + mEnvironment->setVisible(show_shinyctrls); + mLabelShiniColor->setVisible(show_shinyctrls); mShinyColorSwatch->setVisible(show_shinyctrls); } @@ -3032,24 +2946,23 @@ void LLPanelFace::updateBumpyControls(bool is_setting_texture, bool mess_with_co { LLUUID bumpy_texture_ID = mBumpyTextureCtrl->getImageAssetID(); LL_DEBUGS("Materials") << "texture: " << bumpy_texture_ID << (mess_with_combobox ? "" : " do not") << " update combobox" << LL_ENDL; - LLComboBox* comboBumpy = getChild("combobox bumpiness"); if (mess_with_combobox) { if (!bumpy_texture_ID.isNull() && is_setting_texture) { - if (!comboBumpy->itemExists(USE_TEXTURE)) + if (!mComboBumpiness->itemExists(USE_TEXTURE)) { - comboBumpy->add(USE_TEXTURE); + mComboBumpiness->add(USE_TEXTURE); } - comboBumpy->setSimple(USE_TEXTURE); + mComboBumpiness->setSimple(USE_TEXTURE); } else { - if (comboBumpy->itemExists(USE_TEXTURE)) + if (mComboBumpiness->itemExists(USE_TEXTURE)) { - comboBumpy->remove(BUMPY_TEXTURE); - comboBumpy->selectFirstItem(); + mComboBumpiness->remove(BUMPY_TEXTURE); + mComboBumpiness->selectFirstItem(); } } } @@ -3057,12 +2970,12 @@ void LLPanelFace::updateBumpyControls(bool is_setting_texture, bool mess_with_co void LLPanelFace::onCommitShiny() { - sendShiny(getChild("combobox shininess")->getCurrentIndex()); + sendShiny(mComboShininess->getCurrentIndex()); } void LLPanelFace::updateAlphaControls() { - U32 alpha_value = getChild("combobox alphamode")->getCurrentIndex(); + U32 alpha_value = mComboAlphaMode->getCurrentIndex(); bool show_alphactrls = (alpha_value == ALPHAMODE_MASK); // Alpha masking U32 mat_media = mComboMatMedia->getCurrentIndex(); @@ -3071,8 +2984,8 @@ void LLPanelFace::updateAlphaControls() show_alphactrls = show_alphactrls && (mat_media == MATMEDIA_MATERIAL); show_alphactrls = show_alphactrls && (mat_type == MATTYPE_DIFFUSE); - getChildView("label maskcutoff")->setVisible(show_alphactrls); - getChildView("maskcutoff")->setVisible(show_alphactrls); + mLabelMaskCutoff->setVisible(show_alphactrls); + mMaskCutoff->setVisible(show_alphactrls); } void LLPanelFace::onCommitAlphaMode() @@ -3206,7 +3119,7 @@ void LLPanelFace::onSelectTexture() break; } - childGetSelectionInterface("combobox alphamode")->selectNthItem(alpha_mode); + mComboAlphaMode->getSelectionInterface()->selectNthItem(alpha_mode); } LLSelectedTEMaterial::setDiffuseAlphaMode(this, getCurrentDiffuseAlphaMode()); @@ -3337,7 +3250,7 @@ void LLPanelFace::syncOffsetX(F32 offsetU) { LLSelectedTEMaterial::setNormalOffsetX(this, offsetU); LLSelectedTEMaterial::setSpecularOffsetX(this, offsetU); - getChild("TexOffsetU")->forceSetValue(LLSD(offsetU)); + mTexOffsetU->forceSetValue(LLSD(offsetU)); sendTextureInfo(); } @@ -3345,7 +3258,7 @@ void LLPanelFace::syncOffsetY(F32 offsetV) { LLSelectedTEMaterial::setNormalOffsetY(this, offsetV); LLSelectedTEMaterial::setSpecularOffsetY(this, offsetV); - getChild("TexOffsetV")->forceSetValue(LLSD(offsetV)); + mTexOffsetV->forceSetValue(LLSD(offsetV)); sendTextureInfo(); } @@ -3421,7 +3334,7 @@ void LLPanelFace::onCommitMaterialBumpyScaleX() if (gSavedSettings.getBOOL("SyncMaterialSettings")) { - getChild("TexScaleU")->forceSetValue(getCurrentBumpyScaleU()); + mTexScaleU->forceSetValue(LLSD(getCurrentBumpyScaleU())); syncRepeatX(bumpy_scale_u); } else @@ -3440,7 +3353,7 @@ void LLPanelFace::onCommitMaterialBumpyScaleY() if (gSavedSettings.getBOOL("SyncMaterialSettings")) { - getChild("TexScaleV")->forceSetValue(getCurrentBumpyScaleV()); + mTexScaleV->forceSetValue(LLSD(getCurrentBumpyScaleV())); syncRepeatY(bumpy_scale_v); } else @@ -3459,7 +3372,7 @@ void LLPanelFace::onCommitMaterialShinyScaleX() if (gSavedSettings.getBOOL("SyncMaterialSettings")) { - getChild("TexScaleU")->forceSetValue(LLSD(getCurrentShinyScaleU())); + mTexScaleU->forceSetValue(LLSD(getCurrentShinyScaleU())); syncRepeatX(shiny_scale_u); } else @@ -3478,7 +3391,7 @@ void LLPanelFace::onCommitMaterialShinyScaleY() if (gSavedSettings.getBOOL("SyncMaterialSettings")) { - getChild("TexScaleV")->forceSetValue(LLSD(getCurrentShinyScaleV())); + mTexScaleV->forceSetValue(LLSD(getCurrentShinyScaleV())); syncRepeatY(shiny_scale_v); } else @@ -3498,12 +3411,12 @@ void LLPanelFace::onCommitMaterialBumpyRot() { if (gSavedSettings.getBOOL("SyncMaterialSettings")) { - getChild("TexRot")->forceSetValue(LLSD(getCurrentBumpyRot())); + mTexRotate->forceSetValue(LLSD(getCurrentBumpyRot())); syncMaterialRot(getCurrentBumpyRot()); } else { - if (childGetValue("checkbox planar align").asBoolean()) + if (mPlanarAlign->getValue().asBoolean()) { LLFace* last_face = NULL; bool identical_face = false; @@ -3522,12 +3435,12 @@ void LLPanelFace::onCommitMaterialShinyRot() { if (gSavedSettings.getBOOL("SyncMaterialSettings")) { - getChild("TexRot")->forceSetValue(LLSD(getCurrentShinyRot())); + mTexRotate->forceSetValue(LLSD(getCurrentShinyRot())); syncMaterialRot(getCurrentShinyRot()); } else { - if (childGetValue("checkbox planar align").asBoolean()) + if (mPlanarAlign->getValue().asBoolean()) { LLFace* last_face = NULL; bool identical_face = false; @@ -3568,7 +3481,7 @@ void LLPanelFace::onCommitTextureScaleX() { if (gSavedSettings.getBOOL("SyncMaterialSettings")) { - F32 bumpy_scale_u = (F32)getChild("TexScaleU")->getValue().asReal(); + F32 bumpy_scale_u = (F32)mTexScaleU->getValue().asReal(); if (isIdenticalPlanarTexgen()) { bumpy_scale_u *= 0.5f; @@ -3586,7 +3499,7 @@ void LLPanelFace::onCommitTextureScaleY() { if (gSavedSettings.getBOOL("SyncMaterialSettings")) { - F32 bumpy_scale_v = (F32)getChild("TexScaleV")->getValue().asReal(); + F32 bumpy_scale_v = (F32)mTexScaleV->getValue().asReal(); if (isIdenticalPlanarTexgen()) { bumpy_scale_v *= 0.5f; @@ -3604,7 +3517,7 @@ void LLPanelFace::onCommitTextureRot() { if (gSavedSettings.getBOOL("SyncMaterialSettings")) { - syncMaterialRot((F32)getChild("TexRot")->getValue().asReal()); + syncMaterialRot((F32)mTexRotate->getValue().asReal()); } else { @@ -3617,7 +3530,7 @@ void LLPanelFace::onCommitTextureOffsetX() { if (gSavedSettings.getBOOL("SyncMaterialSettings")) { - syncOffsetX((F32)getChild("TexOffsetU")->getValue().asReal()); + syncOffsetX((F32)mTexOffsetU->getValue().asReal()); } else { @@ -3630,7 +3543,7 @@ void LLPanelFace::onCommitTextureOffsetY() { if (gSavedSettings.getBOOL("SyncMaterialSettings")) { - syncOffsetY((F32)getChild("TexOffsetV")->getValue().asReal()); + syncOffsetY((F32)mTexOffsetV->getValue().asReal()); } else { @@ -3642,7 +3555,7 @@ void LLPanelFace::onCommitTextureOffsetY() // Commit the number of repeats per meter void LLPanelFace::onCommitRepeatsPerMeter() { - F32 repeats_per_meter = (F32)getChild("rptctrl")->getValue().asReal(); + F32 repeats_per_meter = (F32)mTexRepeat->getValue().asReal(); F32 obj_scale_s = 1.0f; F32 obj_scale_t = 1.0f; @@ -3653,23 +3566,18 @@ void LLPanelFace::onCommitRepeatsPerMeter() LLSelectedTE::getObjectScaleS(obj_scale_s, identical_scale_s); LLSelectedTE::getObjectScaleS(obj_scale_t, identical_scale_t); - LLUICtrl* bumpy_scale_u = getChild("bumpyScaleU"); - LLUICtrl* bumpy_scale_v = getChild("bumpyScaleV"); - LLUICtrl* shiny_scale_u = getChild("shinyScaleU"); - LLUICtrl* shiny_scale_v = getChild("shinyScaleV"); - if (gSavedSettings.getBOOL("SyncMaterialSettings")) { LLSelectMgr::getInstance()->selectionTexScaleAutofit(repeats_per_meter); - bumpy_scale_u->setValue(obj_scale_s * repeats_per_meter); - bumpy_scale_v->setValue(obj_scale_t * repeats_per_meter); + mBumpyScaleU->setValue(obj_scale_s * repeats_per_meter); + mBumpyScaleV->setValue(obj_scale_t * repeats_per_meter); LLSelectedTEMaterial::setNormalRepeatX(this, obj_scale_s * repeats_per_meter); LLSelectedTEMaterial::setNormalRepeatY(this, obj_scale_t * repeats_per_meter); - shiny_scale_u->setValue(obj_scale_s * repeats_per_meter); - shiny_scale_v->setValue(obj_scale_t * repeats_per_meter); + mShinyScaleU->setValue(obj_scale_s * repeats_per_meter); + mShinyScaleV->setValue(obj_scale_t * repeats_per_meter); LLSelectedTEMaterial::setSpecularRepeatX(this, obj_scale_s * repeats_per_meter); LLSelectedTEMaterial::setSpecularRepeatY(this, obj_scale_t * repeats_per_meter); @@ -3683,15 +3591,15 @@ void LLPanelFace::onCommitRepeatsPerMeter() LLSelectMgr::getInstance()->selectionTexScaleAutofit(repeats_per_meter); break; case MATTYPE_NORMAL: - bumpy_scale_u->setValue(obj_scale_s * repeats_per_meter); - bumpy_scale_v->setValue(obj_scale_t * repeats_per_meter); + mBumpyScaleU->setValue(obj_scale_s * repeats_per_meter); + mBumpyScaleV->setValue(obj_scale_t * repeats_per_meter); LLSelectedTEMaterial::setNormalRepeatX(this, obj_scale_s * repeats_per_meter); LLSelectedTEMaterial::setNormalRepeatY(this, obj_scale_t * repeats_per_meter); break; case MATTYPE_SPECULAR: - bumpy_scale_u->setValue(obj_scale_s * repeats_per_meter); - bumpy_scale_v->setValue(obj_scale_t * repeats_per_meter); + mBumpyScaleU->setValue(obj_scale_s * repeats_per_meter); + mBumpyScaleV->setValue(obj_scale_t * repeats_per_meter); LLSelectedTEMaterial::setSpecularRepeatX(this, obj_scale_s * repeats_per_meter); LLSelectedTEMaterial::setSpecularRepeatY(this, obj_scale_t * repeats_per_meter); @@ -3701,7 +3609,6 @@ void LLPanelFace::onCommitRepeatsPerMeter() break; } } - // vertical scale and repeats per meter depends on each other, so force set on changes updateUI(true); } @@ -4737,23 +4644,17 @@ void LLPanelFace::setMaterialOverridesFromSelection() } } - LLUICtrl* gltfCtrlTextureScaleU = getChild("gltfTextureScaleU"); - LLUICtrl* gltfCtrlTextureScaleV = getChild("gltfTextureScaleV"); - LLUICtrl* gltfCtrlTextureRotation = getChild("gltfTextureRotation"); - LLUICtrl* gltfCtrlTextureOffsetU = getChild("gltfTextureOffsetU"); - LLUICtrl* gltfCtrlTextureOffsetV = getChild("gltfTextureOffsetV"); - - gltfCtrlTextureScaleU->setValue(transform.mScale[VX]); - gltfCtrlTextureScaleV->setValue(transform.mScale[VY]); - gltfCtrlTextureRotation->setValue(transform.mRotation * RAD_TO_DEG); - gltfCtrlTextureOffsetU->setValue(transform.mOffset[VX]); - gltfCtrlTextureOffsetV->setValue(transform.mOffset[VY]); + mPBRScaleU->setValue(transform.mScale[VX]); + mPBRScaleV->setValue(transform.mScale[VY]); + mPBRRotate->setValue(transform.mRotation * RAD_TO_DEG); + mPBROffsetU->setValue(transform.mOffset[VX]); + mPBROffsetV->setValue(transform.mOffset[VY]); - gltfCtrlTextureScaleU->setTentative(!scale_u_same); - gltfCtrlTextureScaleV->setTentative(!scale_v_same); - gltfCtrlTextureRotation->setTentative(!rotation_same); - gltfCtrlTextureOffsetU->setTentative(!offset_u_same); - gltfCtrlTextureOffsetV->setTentative(!offset_v_same); + mPBRScaleU->setTentative(!scale_u_same); + mPBRScaleV->setTentative(!scale_v_same); + mPBRRotate->setTentative(!rotation_same); + mPBROffsetU->setTentative(!offset_u_same); + mPBROffsetV->setTentative(!offset_v_same); } void LLPanelFace::Selection::connect() @@ -4832,7 +4733,7 @@ bool LLPanelFace::Selection::compareSelection() void LLPanelFace::onCommitGLTFTextureScaleU() { - F32 value = (F32)getChild("gltfTextureScaleU")->getValue().asReal(); + F32 value = (F32)mPBRScaleU->getValue().asReal(); updateGLTFTextureTransform([&](LLGLTFMaterial::TextureTransform* new_transform) { new_transform->mScale.mV[VX] = value; @@ -4841,7 +4742,7 @@ void LLPanelFace::onCommitGLTFTextureScaleU() void LLPanelFace::onCommitGLTFTextureScaleV() { - F32 value = (F32)getChild("gltfTextureScaleV")->getValue().asReal(); + F32 value = (F32)mPBRScaleV->getValue().asReal(); updateGLTFTextureTransform([&](LLGLTFMaterial::TextureTransform* new_transform) { new_transform->mScale.mV[VY] = value; @@ -4850,7 +4751,7 @@ void LLPanelFace::onCommitGLTFTextureScaleV() void LLPanelFace::onCommitGLTFRotation() { - F32 value = (F32)getChild("gltfTextureRotation")->getValue().asReal() * DEG_TO_RAD; + F32 value = (F32)mPBRRotate->getValue().asReal() * DEG_TO_RAD; updateGLTFTextureTransform([&](LLGLTFMaterial::TextureTransform* new_transform) { new_transform->mRotation = value; @@ -4859,7 +4760,7 @@ void LLPanelFace::onCommitGLTFRotation() void LLPanelFace::onCommitGLTFTextureOffsetU() { - F32 value = (F32)getChild("gltfTextureOffsetU")->getValue().asReal(); + F32 value = (F32)mPBROffsetU->getValue().asReal(); updateGLTFTextureTransform([&](LLGLTFMaterial::TextureTransform* new_transform) { new_transform->mOffset.mV[VX] = value; @@ -4868,7 +4769,7 @@ void LLPanelFace::onCommitGLTFTextureOffsetU() void LLPanelFace::onCommitGLTFTextureOffsetV() { - F32 value = (F32)getChild("gltfTextureOffsetV")->getValue().asReal(); + F32 value = (F32)mPBROffsetV->getValue().asReal(); updateGLTFTextureTransform([&](LLGLTFMaterial::TextureTransform* new_transform) { new_transform->mOffset.mV[VY] = value; @@ -4884,42 +4785,39 @@ void LLPanelFace::onTextureSelectionChanged(LLInventoryItem* itemp) switch (mattype) { case MATTYPE_SPECULAR: - texture_ctrl = getChild("shinytexture control"); + texture_ctrl = mShinyTextureCtrl; break; case MATTYPE_NORMAL: - texture_ctrl = getChild("bumpytexture control"); + texture_ctrl = mBumpyTextureCtrl; break; default: - texture_ctrl = getChild("texture control"); + texture_ctrl = mTextureCtrl; } - if (texture_ctrl) - { - LLUUID obj_owner_id; - std::string obj_owner_name; - LLSelectMgr::instance().selectGetOwner(obj_owner_id, obj_owner_name); + LLUUID obj_owner_id; + std::string obj_owner_name; + LLSelectMgr::instance().selectGetOwner(obj_owner_id, obj_owner_name); - LLSaleInfo sale_info; - LLSelectMgr::instance().selectGetSaleInfo(sale_info); + LLSaleInfo sale_info; + LLSelectMgr::instance().selectGetSaleInfo(sale_info); - bool can_copy = itemp->getPermissions().allowCopyBy(gAgentID); // do we have perm to copy this texture? - bool can_transfer = itemp->getPermissions().allowOperationBy(PERM_TRANSFER, gAgentID); // do we have perm to transfer this texture? - bool is_object_owner = gAgentID == obj_owner_id; // does object for which we are going to apply texture belong to the agent? - bool not_for_sale = !sale_info.isForSale(); // is object for which we are going to apply texture not for sale? + bool can_copy = itemp->getPermissions().allowCopyBy(gAgentID); // do we have perm to copy this texture? + bool can_transfer = itemp->getPermissions().allowOperationBy(PERM_TRANSFER, gAgentID); // do we have perm to transfer this texture? + bool is_object_owner = gAgentID == obj_owner_id; // does object for which we are going to apply texture belong to the agent? + bool not_for_sale = !sale_info.isForSale(); // is object for which we are going to apply texture not for sale? - if (can_copy && can_transfer) - { - texture_ctrl->setCanApply(true, true); - return; - } + if (can_copy && can_transfer) + { + texture_ctrl->setCanApply(true, true); + return; + } - // if texture has (no-transfer) attribute it can be applied only for object which we own and is not for sale - texture_ctrl->setCanApply(false, can_transfer ? true : is_object_owner && not_for_sale); + // if texture has (no-transfer) attribute it can be applied only for object which we own and is not for sale + texture_ctrl->setCanApply(false, can_transfer ? true : is_object_owner && not_for_sale); - if (gSavedSettings.getBOOL("TextureLivePreview")) - { - LLNotificationsUtil::add("LivePreviewUnavailable"); - } + if (gSavedSettings.getBOOL("TextureLivePreview")) + { + LLNotificationsUtil::add("LivePreviewUnavailable"); } } diff --git a/indra/newview/llpanelface.h b/indra/newview/llpanelface.h index ede2ef9339..e90453c564 100644 --- a/indra/newview/llpanelface.h +++ b/indra/newview/llpanelface.h @@ -290,27 +290,77 @@ private: F32 getCurrentShinyOffsetU(); F32 getCurrentShinyOffsetV(); - LLTextureCtrl* mPBRTextureCtrl = nullptr; - LLTextureCtrl* mTextureCtrl = nullptr; - LLTextureCtrl* mShinyTextureCtrl = nullptr; - LLTextureCtrl* mBumpyTextureCtrl = nullptr; - LLColorSwatchCtrl* mColorSwatch = nullptr; - LLColorSwatchCtrl* mShinyColorSwatch = nullptr; - - LLComboBox* mComboTexGen = nullptr; - - LLRadioGroup* mRadioMaterialType = nullptr; - LLRadioGroup* mRadioPbrType = nullptr; - - LLCheckBoxCtrl* mCheckFullbright = nullptr; - - LLTextBox* mLabelColorTransp = nullptr; - LLSpinCtrl* mCtrlColorTransp = nullptr; // transparency = 1 - alpha - - LLSpinCtrl* mCtrlGlow = nullptr; - LLComboBox *mComboMatMedia = nullptr; - LLMediaCtrl *mTitleMedia = nullptr; - LLTextBox *mTitleMediaText = nullptr; + LLTextureCtrl* mPBRTextureCtrl { nullptr }; + LLTextureCtrl* mTextureCtrl { nullptr }; + LLTextureCtrl* mShinyTextureCtrl { nullptr }; + LLTextureCtrl* mBumpyTextureCtrl { nullptr }; + LLTextBox* mLabelColor { nullptr }; + LLColorSwatchCtrl* mColorSwatch { nullptr }; + LLTextBox* mLabelShiniColor { nullptr }; + LLColorSwatchCtrl* mShinyColorSwatch { nullptr }; + + LLTextBox* mLabelTexGen { nullptr }; + LLComboBox* mComboTexGen { nullptr }; + + LLRadioGroup* mRadioMaterialType { nullptr }; + LLRadioGroup* mRadioPbrType { nullptr }; + + LLCheckBoxCtrl* mCheckFullbright { nullptr }; + + LLTextBox* mLabelColorTransp { nullptr }; + LLSpinCtrl* mCtrlColorTransp { nullptr }; // transparency = 1 - alpha + + LLTextBox* mLabelGlow { nullptr }; + LLSpinCtrl* mCtrlGlow { nullptr }; + LLComboBox* mComboMatMedia { nullptr }; + LLMediaCtrl* mTitleMedia { nullptr }; + LLTextBox* mTitleMediaText { nullptr }; + + LLTextBox* mLabelMatPermLoading { nullptr }; + LLCheckBoxCtrl* mCheckSyncSettings { nullptr }; + + LLTextBox* mLabelBumpiness { nullptr }; + LLComboBox* mComboBumpiness { nullptr }; + LLTextBox* mLabelShininess { nullptr }; + LLComboBox* mComboShininess { nullptr }; + LLTextBox* mLabelAlphaMode { nullptr }; + LLComboBox* mComboAlphaMode { nullptr }; + LLSpinCtrl* mTexScaleU { nullptr }; + LLSpinCtrl* mTexScaleV { nullptr }; + LLSpinCtrl* mTexRotate { nullptr }; + LLSpinCtrl* mTexRepeat { nullptr }; + LLSpinCtrl* mTexOffsetU { nullptr }; + LLSpinCtrl* mTexOffsetV { nullptr }; + LLCheckBoxCtrl* mPlanarAlign{ nullptr }; + LLSpinCtrl* mBumpyScaleU { nullptr }; + LLSpinCtrl* mBumpyScaleV { nullptr }; + LLSpinCtrl* mBumpyRotate { nullptr }; + LLSpinCtrl* mBumpyOffsetU { nullptr }; + LLSpinCtrl* mBumpyOffsetV { nullptr }; + LLSpinCtrl* mShinyScaleU { nullptr }; + LLSpinCtrl* mShinyScaleV { nullptr }; + LLSpinCtrl* mShinyRotate { nullptr }; + LLSpinCtrl* mShinyOffsetU { nullptr }; + LLSpinCtrl* mShinyOffsetV { nullptr }; + LLTextBox* mLabelGlossiness { nullptr }; + LLSpinCtrl* mGlossiness { nullptr }; + LLTextBox* mLabelEnvironment { nullptr }; + LLSpinCtrl* mEnvironment { nullptr }; + LLTextBox* mLabelMaskCutoff { nullptr }; + LLSpinCtrl* mMaskCutoff { nullptr }; + LLButton* mAddMedia { nullptr }; + LLButton* mDelMedia { nullptr }; + LLSpinCtrl* mPBRScaleU { nullptr }; + LLSpinCtrl* mPBRScaleV { nullptr }; + LLSpinCtrl* mPBRRotate { nullptr }; + LLSpinCtrl* mPBROffsetU { nullptr }; + LLSpinCtrl* mPBROffsetV { nullptr }; + + LLButton* mBtnAlign { nullptr }; + LLButton* mBtnAlignTex { nullptr }; + LLButton* mBtnPbrFromInv { nullptr }; + LLButton* mBtnEditBbr { nullptr }; + LLButton* mBtnSaveBbr { nullptr }; // Update visibility of controls to match current UI mode // (e.g. materials vs media editing) @@ -322,6 +372,20 @@ private: // Hey look everyone, a type-safe alternative to copy and paste! :) // + template + void getChildSetCommitCallback(T*& ctrl, std::string_view name, std::function cb) + { + ctrl = this->getChild(name); + ctrl->setCommitCallback(cb); + } + + template + void getChildSetClickedCallback(T*& ctrl, std::string_view name, std::function cb) + { + ctrl = this->getChild(name); + ctrl->setClickedCallback(cb); + } + // Update material parameters by applying 'edit_func' to selected TEs // template< @@ -636,6 +700,8 @@ public: DEF_GET_TE_STATE(LLTextureEntry::e_texgen,LLTextureEntry::e_texgen,getTexGen,LLTextureEntry::TEX_GEN_DEFAULT, false, LLTextureEntry::TEX_GEN_DEFAULT) DEF_GET_TE_STATE(LLColor4,const LLColor4&,getColor,LLColor4::white, false, LLColor4::black); }; + + friend struct LLPanelFaceSetTEFunctor; }; #endif -- cgit v1.2.3 From 399eb2104ec84272fb253c6029517f9f4935e17e Mon Sep 17 00:00:00 2001 From: Andrey Kleshchev Date: Tue, 23 Jul 2024 11:22:09 +0300 Subject: viewer#2043 bugsplat symbol upload update --- .github/workflows/build.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index aa504f51d8..68fdc3c2bf 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -395,7 +395,7 @@ jobs: password: ${{ env.BUGSPLAT_PASS }} database: "SecondLife_Viewer_2018" channel: ${{ needs.build.outputs.viewer_channel }} - version: ${{ needs.build.outputs.viewer_version }} + version: ${{ needs.build.outputs.viewer_version }} (${{ needs.build.outputs.viewer_version }}) release: needs: [setvar, build, sign-and-package-windows, sign-and-package-mac] -- cgit v1.2.3 From e20e387d481513e4e7eed570d224da19aa532fb8 Mon Sep 17 00:00:00 2001 From: Alexander Gavriliuk Date: Wed, 7 Aug 2024 19:13:40 +0200 Subject: #1922 Make PBR scale and offset crosshair work (fix PBR channels in LLPanelFace) --- indra/newview/llpanelface.cpp | 112 +++++++++++++++++++++++++----------------- indra/newview/llpanelface.h | 3 ++ 2 files changed, 71 insertions(+), 44 deletions(-) diff --git a/indra/newview/llpanelface.cpp b/indra/newview/llpanelface.cpp index 936ca273c3..94674dc557 100644 --- a/indra/newview/llpanelface.cpp +++ b/indra/newview/llpanelface.cpp @@ -117,26 +117,23 @@ const S32 PBRTYPE_METALLIC_ROUGHNESS = 2; // PBR Metallic const S32 PBRTYPE_EMISSIVE = 3; // PBR Emissive const S32 PBRTYPE_NORMAL = 4; // PBR Normal -LLGLTFMaterial::TextureInfo texture_info_from_pbrtype(S32 pbr_type) +LLGLTFMaterial::TextureInfo LLPanelFace::getPBRTextureInfo() { - switch (pbr_type) + // Radiogroup [ "Complete material", "Base color", "Metallic/roughness", "Emissive", "Normal" ] + S32 radio_group_index = mRadioPbrType->getSelectedIndex(); + switch (radio_group_index) { case PBRTYPE_BASE_COLOR: return LLGLTFMaterial::GLTF_TEXTURE_INFO_BASE_COLOR; - break; case PBRTYPE_NORMAL: return LLGLTFMaterial::GLTF_TEXTURE_INFO_NORMAL; - break; case PBRTYPE_METALLIC_ROUGHNESS: return LLGLTFMaterial::GLTF_TEXTURE_INFO_METALLIC_ROUGHNESS; - break; case PBRTYPE_EMISSIVE: return LLGLTFMaterial::GLTF_TEXTURE_INFO_EMISSIVE; - break; - default: - return LLGLTFMaterial::GLTF_TEXTURE_INFO_COUNT; - break; } + // The default value is used as a fallback + return LLGLTFMaterial::GLTF_TEXTURE_INFO_COUNT; } void LLPanelFace::updateSelectedGLTFMaterials(std::function func) @@ -195,43 +192,77 @@ std::string USE_TEXTURE; LLRender::eTexIndex LLPanelFace::getTextureChannelToEdit() { - LLRender::eTexIndex channel_to_edit = LLRender::DIFFUSE_MAP; - if (mComboMatMedia) + S32 matmedia_selection = mComboMatMedia->getCurrentIndex(); + switch (matmedia_selection) { - U32 matmedia_selection = mComboMatMedia->getCurrentIndex(); - if (matmedia_selection == MATMEDIA_MATERIAL) - { - channel_to_edit = (LLRender::eTexIndex)mRadioMaterialType->getSelectedIndex(); - } - if (matmedia_selection == MATMEDIA_PBR) - { - channel_to_edit = (LLRender::eTexIndex)mRadioPbrType->getSelectedIndex(); - } + case MATMEDIA_MATERIAL: + return getMatTextureChannel(); + case MATMEDIA_PBR: + return getPBRTextureChannel(); + } + return (LLRender::eTexIndex)0; +} + +LLRender::eTexIndex LLPanelFace::getMatTextureChannel() +{ + // Radiogroup [ "Texture (diffuse)", "Bumpiness (normal)", "Shininess (specular)" ] + S32 radio_group_index = mRadioMaterialType->getSelectedIndex(); + switch (radio_group_index) + { + case MATTYPE_DIFFUSE: // "Texture (diffuse)" + return LLRender::DIFFUSE_MAP; + case MATTYPE_NORMAL: // "Bumpiness (normal)" + if (getCurrentNormalMap().notNull()) + return LLRender::NORMAL_MAP; + break; + case MATTYPE_SPECULAR: // "Shininess (specular)" + if (getCurrentNormalMap().notNull()) + return LLRender::SPECULAR_MAP; + break; } + // The default value is used as a fallback if no required texture is chosen + return (LLRender::eTexIndex)0; +} - channel_to_edit = (channel_to_edit == LLRender::NORMAL_MAP) ? (getCurrentNormalMap().isNull() ? LLRender::DIFFUSE_MAP : channel_to_edit) : channel_to_edit; - channel_to_edit = (channel_to_edit == LLRender::SPECULAR_MAP) ? (getCurrentSpecularMap().isNull() ? LLRender::DIFFUSE_MAP : channel_to_edit) : channel_to_edit; - return channel_to_edit; +LLRender::eTexIndex LLPanelFace::getPBRTextureChannel() +{ + // Radiogroup [ "Complete material", "Base color", "Metallic/roughness", "Emissive", "Normal" ] + S32 radio_group_index = mRadioPbrType->getSelectedIndex(); + switch (radio_group_index) + { + case PBRTYPE_RENDER_MATERIAL_ID: // "Complete material" + return LLRender::NUM_TEXTURE_CHANNELS; + case PBRTYPE_BASE_COLOR: // "Base color" + return LLRender::BASECOLOR_MAP; + case PBRTYPE_METALLIC_ROUGHNESS: // "Metallic/roughness" + return LLRender::METALLIC_ROUGHNESS_MAP; + case PBRTYPE_EMISSIVE: // "Emissive" + return LLRender::EMISSIVE_MAP; + case PBRTYPE_NORMAL: // "Normal" + return LLRender::GLTF_NORMAL_MAP; + } + // The default value is used as a fallback + return LLRender::NUM_TEXTURE_CHANNELS; } LLRender::eTexIndex LLPanelFace::getTextureDropChannel() { - if (mComboMatMedia && mComboMatMedia->getCurrentIndex() == MATMEDIA_MATERIAL) + if (mComboMatMedia->getCurrentIndex() == MATMEDIA_MATERIAL) { - return LLRender::eTexIndex(mRadioMaterialType->getSelectedIndex()); + return getMatTextureChannel(); } - return LLRender::eTexIndex(MATTYPE_DIFFUSE); + return (LLRender::eTexIndex)0; } LLGLTFMaterial::TextureInfo LLPanelFace::getPBRDropChannel() { if (mComboMatMedia->getCurrentIndex() == MATMEDIA_PBR) { - return texture_info_from_pbrtype(mRadioPbrType->getSelectedIndex()); + return getPBRTextureInfo(); } - return texture_info_from_pbrtype(PBRTYPE_BASE_COLOR); + return (LLGLTFMaterial::TextureInfo)0; } // Things the UI provides... @@ -388,29 +419,23 @@ bool LLPanelFace::postBuild() mCtrlColorTransp->setFollowsTop(); mCtrlColorTransp->setFollowsLeft(); - mCheckFullbright = getChild("checkbox fullbright"); - mCheckFullbright->setCommitCallback([&](LLUICtrl*, const LLSD&) { onCommitFullbright(); }); + getChildSetCommitCallback(mCheckFullbright, "checkbox fullbright", [&](LLUICtrl*, const LLSD&) { onCommitFullbright(); }); mLabelTexGen = getChild("tex gen"); - mComboTexGen = getChild("combobox texgen"); - mComboTexGen->setCommitCallback([&](LLUICtrl*, const LLSD&) { onCommitTexGen(); }); + getChildSetCommitCallback(mComboTexGen, "combobox texgen", [&](LLUICtrl*, const LLSD&) { onCommitTexGen(); }); mComboTexGen->setFollows(FOLLOWS_LEFT | FOLLOWS_TOP); - mComboMatMedia = getChild("combobox matmedia"); - mComboMatMedia->setCommitCallback([&](LLUICtrl*, const LLSD&) { onCommitMaterialsMedia(); }); + getChildSetCommitCallback(mComboMatMedia, "combobox matmedia", [&](LLUICtrl*, const LLSD&) { onCommitMaterialsMedia(); }); mComboMatMedia->selectNthItem(MATMEDIA_MATERIAL); - mRadioMaterialType = getChild("radio_material_type"); - mRadioMaterialType->setCommitCallback([&](LLUICtrl*, const LLSD&) { onCommitMaterialType(); }); + getChildSetCommitCallback(mRadioMaterialType, "radio_material_type", [&](LLUICtrl*, const LLSD&) { onCommitMaterialType(); }); mRadioMaterialType->selectNthItem(MATTYPE_DIFFUSE); - mRadioPbrType = getChild("radio_pbr_type"); - mRadioPbrType->setCommitCallback([&](LLUICtrl*, const LLSD&) { onCommitPbrType(); }); + getChildSetCommitCallback(mRadioPbrType, "radio_pbr_type", [&](LLUICtrl*, const LLSD&) { onCommitPbrType(); }); mRadioPbrType->selectNthItem(PBRTYPE_RENDER_MATERIAL_ID); mLabelGlow = getChild("glow label"); - mCtrlGlow = getChild("glow"); - mCtrlGlow->setCommitCallback([&](LLUICtrl*, const LLSD&) { onCommitGlow(); }); + getChildSetCommitCallback(mCtrlGlow, "glow", [&](LLUICtrl*, const LLSD&) { onCommitGlow(); }); mMenuClipboardColor = getChild("clipboard_color_params_btn"); mMenuClipboardTexture = getChild("clipboard_texture_params_btn"); @@ -2792,8 +2817,7 @@ void LLPanelFace::updateVisibility(LLViewerObject* objectp /* = nullptr */) bool show_bumpiness = show_material && (material_type == MATTYPE_NORMAL) && mComboMatMedia->getEnabled(); bool show_shininess = show_material && (material_type == MATTYPE_SPECULAR) && mComboMatMedia->getEnabled(); const bool show_pbr = mComboMatMedia->getCurrentIndex() == MATMEDIA_PBR && mComboMatMedia->getEnabled(); - const U32 pbr_type = mRadioPbrType->getSelectedIndex(); - const LLGLTFMaterial::TextureInfo texture_info = texture_info_from_pbrtype(pbr_type); + const LLGLTFMaterial::TextureInfo texture_info = getPBRTextureInfo(); const bool show_pbr_asset = show_pbr && texture_info == LLGLTFMaterial::GLTF_TEXTURE_INFO_COUNT; mRadioMaterialType->setVisible(show_material); @@ -4547,7 +4571,7 @@ void LLPanelFace::onCommitPlanarAlign() void LLPanelFace::updateGLTFTextureTransform(std::function edit) { - const LLGLTFMaterial::TextureInfo texture_info = texture_info_from_pbrtype(mRadioPbrType->getSelectedIndex()); + const LLGLTFMaterial::TextureInfo texture_info = getPBRTextureInfo(); if (texture_info == LLGLTFMaterial::GLTF_TEXTURE_INFO_COUNT) { updateSelectedGLTFMaterials([&](LLGLTFMaterial* new_override) @@ -4571,7 +4595,7 @@ void LLPanelFace::updateGLTFTextureTransform(std::functiongetSelectedIndex()); + const LLGLTFMaterial::TextureInfo texture_info = getPBRTextureInfo(); U32 texture_info_start; U32 texture_info_end; if (texture_info == LLGLTFMaterial::TextureInfo::GLTF_TEXTURE_INFO_COUNT) diff --git a/indra/newview/llpanelface.h b/indra/newview/llpanelface.h index e90453c564..1caca0cf64 100644 --- a/indra/newview/llpanelface.h +++ b/indra/newview/llpanelface.h @@ -125,7 +125,10 @@ public: return new_material; } + LLGLTFMaterial::TextureInfo getPBRTextureInfo(); LLRender::eTexIndex getTextureChannelToEdit(); + LLRender::eTexIndex getMatTextureChannel(); + LLRender::eTexIndex getPBRTextureChannel(); LLRender::eTexIndex getTextureDropChannel(); LLGLTFMaterial::TextureInfo getPBRDropChannel(); -- cgit v1.2.3 From 63a4ad9b98a21b86986385398f7a93043c4f3650 Mon Sep 17 00:00:00 2001 From: Roxie Linden Date: Wed, 7 Aug 2024 14:16:11 -0700 Subject: Add Windows multi-pdb upload capability --- .github/workflows/build.yaml | 17 +++++++++++++++-- build.sh | 2 +- indra/llwebrtc/CMakeLists.txt | 9 +++++++-- indra/newview/CMakeLists.txt | 40 ++++++++++++++++------------------------ 4 files changed, 39 insertions(+), 29 deletions(-) diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index 03dcad2158..6e5d166847 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -373,15 +373,28 @@ jobs: needs: build runs-on: ubuntu-latest steps: + - name: Download Windows Symbols + if: env.BUGSPLAT_USER && env.BUGSPLAT_PASS + uses: actions/download-artifact@v4 + with: + name: Windows-symbols + - name: Extract viewer pdb + if: env.BUGSPLAT_USER && env.BUGSPLAT_PASS + shell: bash + run: | + mkdir _artifacts + tar -xJf ${{ needs.build.outputs.viewer_channel }}.sym.tar.xz -C _artifacts - name: Post Windows symbols if: env.BUGSPLAT_USER && env.BUGSPLAT_PASS - uses: secondlife/viewer-build-util/post-bugsplat-windows@v2 + uses: Bugsplat-Git/symbol-upload@v9.1.1 with: username: ${{ env.BUGSPLAT_USER }} password: ${{ env.BUGSPLAT_PASS }} database: "SecondLife_Viewer_2018" - channel: ${{ needs.build.outputs.viewer_channel }} + application: ${{ needs.build.outputs.viewer_channel }} version: ${{ needs.build.outputs.viewer_version }} + directory: _artifacts + files: "**/*.pdb" post-mac-symbols: env: diff --git a/build.sh b/build.sh index 2a2227657b..1e5e8470eb 100755 --- a/build.sh +++ b/build.sh @@ -170,7 +170,7 @@ pre_build() # This name is consumed by indra/newview/CMakeLists.txt. Make it # absolute because we've had troubles with relative pathnames. abs_build_dir="$(cd "$build_dir"; pwd)" - VIEWER_SYMBOL_FILE="$(native_path "$abs_build_dir/newview/$variant/secondlife-symbols-$symplat-${AUTOBUILD_ADDRSIZE}.tar.xz")" + VIEWER_SYMBOL_FILE="$(native_path "$abs_build_dir/symbols/$variant/${viewer_channel}.tar.xz")" fi # honor autobuild_configure_parameters same as sling-buildscripts diff --git a/indra/llwebrtc/CMakeLists.txt b/indra/llwebrtc/CMakeLists.txt index e7c7248b0c..c6f77ee848 100644 --- a/indra/llwebrtc/CMakeLists.txt +++ b/indra/llwebrtc/CMakeLists.txt @@ -39,10 +39,15 @@ if (WINDOWS) msdmo strmiids iphlpapi) + if (USE_BUGSPLAT) + set_target_properties(llwebrtc PROPERTIES PDB_OUTPUT_DIRECTORY "${SYMBOLS_STAGING_DIR}/${VIEWER_CHANNEL}") + endif (USE_BUGSPLAT) elseif (DARWIN) target_link_libraries(llwebrtc PRIVATE ll::webrtc) - set_target_properties(llwebrtc PROPERTIES XCODE_ATTRIBUTE_DEBUG_INFORMATION_FORMAT "dwarf-with-dsym" - XCODE_ATTRIBUTE_DWARF_DSYM_FOLDER_PATH "${SYMBOLS_STAGING_DIR}/${VIEWER_CHANNEL}/dSYMs") + if (USE_BUGSPLAT) + set_target_properties(llwebrtc PROPERTIES XCODE_ATTRIBUTE_DEBUG_INFORMATION_FORMAT "dwarf-with-dsym" + XCODE_ATTRIBUTE_DWARF_DSYM_FOLDER_PATH "${SYMBOLS_STAGING_DIR}/${VIEWER_CHANNEL}/dSYMs") + endif (USE_BUGSPLAT) elseif (LINUX) target_link_libraries(llwebrtc PRIVATE ll::webrtc) endif (WINDOWS) diff --git a/indra/newview/CMakeLists.txt b/indra/newview/CMakeLists.txt index 000f2e2684..c5f38a832a 100644 --- a/indra/newview/CMakeLists.txt +++ b/indra/newview/CMakeLists.txt @@ -2085,8 +2085,6 @@ if (DARWIN) set(VIEWER_APP_BUNDLE "${CMAKE_CURRENT_BINARY_DIR}/$,$,>/${product}.app") set(VIEWER_APP_EXE "${VIEWER_APP_BUNDLE}/Contents/MacOS/${product}") - set(VIEWER_APP_SYMBOLS_ARCHIVE "${VIEWER_APP_BUNDLE}/../${product}.sym.tar.gz") - set(VIEWER_APP_XCARCHIVE "${SYMBOLS_STAGING_DIR}/${VIEWER_CHANNEL}.xcarchive.zip") configure_file( "${CMAKE_CURRENT_SOURCE_DIR}/Info-SecondLife.plist" @@ -2159,38 +2157,32 @@ if (INSTALL) include(${CMAKE_CURRENT_SOURCE_DIR}/ViewerInstall.cmake) endif (INSTALL) -# Note that the conventional VIEWER_SYMBOL_FILE is set by ../../build.sh if (PACKAGE AND (RELEASE_CRASH_REPORTING OR NON_RELEASE_CRASH_REPORTING) AND VIEWER_SYMBOL_FILE) if (USE_BUGSPLAT) # BugSplat symbol-file generation if (WINDOWS) - # Just pack up a tarball containing only the .pdb file for the - # executable. Because we intend to use cygwin tar, we must render - # VIEWER_SYMBOL_FILE in cygwin path syntax. - execute_process(COMMAND "cygpath" "-u" "${VIEWER_SYMBOL_FILE}" - OUTPUT_VARIABLE VIEWER_SYMBOL_FILE_CYGWIN - OUTPUT_STRIP_TRAILING_WHITESPACE) - execute_process(COMMAND "cygpath" "-u" "${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR}" - OUTPUT_VARIABLE PARENT_DIRECTORY_CYGWIN - OUTPUT_STRIP_TRAILING_WHITESPACE) - add_custom_command(OUTPUT "${VIEWER_SYMBOL_FILE}" - # Use of 'tar ...j' here assumes VIEWER_SYMBOL_FILE endswith .tar.xz; - # testing a string suffix is painful enough in CMake language that - # we'll continue assuming it until forced to generalize. + set(VIEWER_APP_SYMBOLS_ARCHIVE "${SYMBOLS_STAGING_DIR}/${VIEWER_CHANNEL}.sym.tar.xz") + set_target_properties( ${VIEWER_BINARY_NAME} PROPERTIES PDB_OUTPUT_DIRECTORY "${SYMBOLS_STAGING_DIR}/${VIEWER_CHANNEL}") + + # Just pack up a tarball containing only the .pdb files for the + # executables. + add_custom_command(OUTPUT "${VIEWER_APP_SYMBOLS_ARCHIVE}" COMMAND "tar" ARGS "cJf" - "${VIEWER_SYMBOL_FILE_CYGWIN}" - "-C" - "${PARENT_DIRECTORY_CYGWIN}" - "secondlife-bin.pdb" - DEPENDS "${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR}/secondlife-bin.pdb" - COMMENT "Packing viewer PDB into ${VIEWER_SYMBOL_FILE_CYGWIN}" + "${VIEWER_CHANNEL}.sym.tar.xz" + "${VIEWER_CHANNEL}" + DEPENDS "${VIEWER_BINARY_NAME}" llwebrtc + WORKING_DIRECTORY "${SYMBOLS_STAGING_DIR}" + COMMENT "Packing viewer PDBs into ${VIEWER_APP_SYMBOLS_ARCHIVE}" ) - add_custom_target(generate_symbols DEPENDS "${VIEWER_SYMBOL_FILE}" ${VIEWER_BINARY_NAME}) - add_dependencies(generate_symbols ${VIEWER_BINARY_NAME}) + add_custom_target(generate_symbols DEPENDS "${VIEWER_APP_SYMBOLS_ARCHIVE}") + add_dependencies(generate_symbols ${VIEWER_BINARY_NAME} llwebrtc) + endif (WINDOWS) if (DARWIN) + set(VIEWER_APP_XCARCHIVE "${SYMBOLS_STAGING_DIR}/${VIEWER_CHANNEL}.xcarchive.zip") + # we only need an xcarchive with dSYMs (including the application) set_target_properties(${VIEWER_BINARY_NAME} PROPERTIES -- cgit v1.2.3 From f6f3d7e0480c9c695abf6c48f553ad0e01121e78 Mon Sep 17 00:00:00 2001 From: Roxie Linden Date: Wed, 7 Aug 2024 14:24:00 -0700 Subject: spacing issue --- .github/workflows/build.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index 6e5d166847..2a174e5d2c 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -382,7 +382,7 @@ jobs: if: env.BUGSPLAT_USER && env.BUGSPLAT_PASS shell: bash run: | - mkdir _artifacts + mkdir _artifacts tar -xJf ${{ needs.build.outputs.viewer_channel }}.sym.tar.xz -C _artifacts - name: Post Windows symbols if: env.BUGSPLAT_USER && env.BUGSPLAT_PASS -- cgit v1.2.3 From e0737b142362e16c78deac38c11bb24ddbe695bc Mon Sep 17 00:00:00 2001 From: Roxie Linden Date: Wed, 7 Aug 2024 15:11:03 -0700 Subject: misnamed file --- build.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build.sh b/build.sh index 1e5e8470eb..93babd9226 100755 --- a/build.sh +++ b/build.sh @@ -170,7 +170,7 @@ pre_build() # This name is consumed by indra/newview/CMakeLists.txt. Make it # absolute because we've had troubles with relative pathnames. abs_build_dir="$(cd "$build_dir"; pwd)" - VIEWER_SYMBOL_FILE="$(native_path "$abs_build_dir/symbols/$variant/${viewer_channel}.tar.xz")" + VIEWER_SYMBOL_FILE="$(native_path "$abs_build_dir/symbols/$variant/${viewer_channel}.sym.tar.xz")" fi # honor autobuild_configure_parameters same as sling-buildscripts -- cgit v1.2.3 From 530bc2975315240f6f5dda753b48790364a6312b Mon Sep 17 00:00:00 2001 From: Roxie Linden Date: Wed, 7 Aug 2024 16:33:00 -0700 Subject: build debug symbols for llwebrtc even for release --- .github/workflows/build.yaml | 2 +- indra/llwebrtc/CMakeLists.txt | 6 +++++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index 2a174e5d2c..ecd3f22a35 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -383,7 +383,7 @@ jobs: shell: bash run: | mkdir _artifacts - tar -xJf ${{ needs.build.outputs.viewer_channel }}.sym.tar.xz -C _artifacts + tar -xJf "${{ needs.build.outputs.viewer_channel }}.sym.tar.xz" -C _artifacts - name: Post Windows symbols if: env.BUGSPLAT_USER && env.BUGSPLAT_PASS uses: Bugsplat-Git/symbol-upload@v9.1.1 diff --git a/indra/llwebrtc/CMakeLists.txt b/indra/llwebrtc/CMakeLists.txt index c6f77ee848..e3404b3a23 100644 --- a/indra/llwebrtc/CMakeLists.txt +++ b/indra/llwebrtc/CMakeLists.txt @@ -31,7 +31,11 @@ add_library (llwebrtc SHARED ${llwebrtc_SOURCE_FILES}) set_target_properties(llwebrtc PROPERTIES PUBLIC_HEADER llwebrtc.h) if (WINDOWS) - target_link_libraries(llwebrtc PRIVATE ll::webrtc + set_target_properties(llwebrtc + PROPERTIES + LINK_FLAGS "/debug /LARGEADDRESSAWARE" + ) + target_link_libraries(llwebrtc PRIVATE ll::webrtc secur32 winmm dmoguids -- cgit v1.2.3 From 60003cf077866401a809905474d3369c7795109a Mon Sep 17 00:00:00 2001 From: Roxie Linden Date: Wed, 7 Aug 2024 19:09:19 -0700 Subject: include viewer exe in uploaded symbols --- .github/workflows/build.yaml | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index ecd3f22a35..72cdf01634 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -373,6 +373,11 @@ jobs: needs: build runs-on: ubuntu-latest steps: + - name: Download viewer exe + uses: actions/download-artifact@v4 + with: + name: Windows-app + path: _artifacts - name: Download Windows Symbols if: env.BUGSPLAT_USER && env.BUGSPLAT_PASS uses: actions/download-artifact@v4 @@ -382,7 +387,6 @@ jobs: if: env.BUGSPLAT_USER && env.BUGSPLAT_PASS shell: bash run: | - mkdir _artifacts tar -xJf "${{ needs.build.outputs.viewer_channel }}.sym.tar.xz" -C _artifacts - name: Post Windows symbols if: env.BUGSPLAT_USER && env.BUGSPLAT_PASS @@ -394,7 +398,7 @@ jobs: application: ${{ needs.build.outputs.viewer_channel }} version: ${{ needs.build.outputs.viewer_version }} directory: _artifacts - files: "**/*.pdb" + files: "**/{SecondLifeViewer.exe,*.pdb}" post-mac-symbols: env: -- cgit v1.2.3 From 83390094f10e0f7069676bf2bd09bd1401ca891c Mon Sep 17 00:00:00 2001 From: Roxie Linden Date: Wed, 7 Aug 2024 20:57:05 -0700 Subject: test llwebrtc.dll for additional symbols --- .github/workflows/build.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index 72cdf01634..d3a3c2ed6e 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -398,7 +398,7 @@ jobs: application: ${{ needs.build.outputs.viewer_channel }} version: ${{ needs.build.outputs.viewer_version }} directory: _artifacts - files: "**/{SecondLifeViewer.exe,*.pdb}" + files: "**/{SecondLifeViewer.exe,llwebrtc.dll,*.pdb}" post-mac-symbols: env: -- cgit v1.2.3 From 17f7b439d617bfdf4c865f1478ade662e86b61d2 Mon Sep 17 00:00:00 2001 From: Alexander Gavriliuk Date: Wed, 7 Aug 2024 20:56:10 +0200 Subject: #1922 Make PBR scale and offset crosshair work like Texture crosshair do --- indra/llrender/llrender.h | 19 +++-- indra/llrender/llvertexbuffer.cpp | 12 +++ indra/llrender/llvertexbuffer.h | 9 ++- indra/newview/llface.cpp | 116 ++++++++++++++++++++++----- indra/newview/llface.h | 4 +- indra/newview/pipeline.cpp | 159 ++++++++++++++++++++------------------ indra/newview/pipeline.h | 1 + 7 files changed, 210 insertions(+), 110 deletions(-) diff --git a/indra/llrender/llrender.h b/indra/llrender/llrender.h index e6b4118beb..010ab122b6 100644 --- a/indra/llrender/llrender.h +++ b/indra/llrender/llrender.h @@ -293,15 +293,18 @@ public: enum eTexIndex : U8 { - DIFFUSE_MAP = 0, - ALTERNATE_DIFFUSE_MAP = 1, - NORMAL_MAP = 1, - SPECULAR_MAP = 2, - BASECOLOR_MAP = 3, + // Channels for material textures + DIFFUSE_MAP = 0, + ALTERNATE_DIFFUSE_MAP = 1, + NORMAL_MAP = 1, + SPECULAR_MAP = 2, + // Channels for PBR textures + BASECOLOR_MAP = 3, METALLIC_ROUGHNESS_MAP = 4, - GLTF_NORMAL_MAP = 5, - EMISSIVE_MAP = 6, - NUM_TEXTURE_CHANNELS = 7, + GLTF_NORMAL_MAP = 5, + EMISSIVE_MAP = 6, + // Total number of channels + NUM_TEXTURE_CHANNELS = 7, }; enum eVolumeTexIndex : U8 diff --git a/indra/llrender/llvertexbuffer.cpp b/indra/llrender/llvertexbuffer.cpp index 2eb7c21f77..02afcf12c6 100644 --- a/indra/llrender/llvertexbuffer.cpp +++ b/indra/llrender/llvertexbuffer.cpp @@ -794,6 +794,18 @@ void LLVertexBuffer::setLabel(const char* label) { } #endif +void LLVertexBuffer::clone(LLVertexBuffer& target) const +{ + target.mTypeMask = mTypeMask; + target.mIndicesType = mIndicesType; + target.mIndicesStride = mIndicesStride; + if (target.getNumVerts() != getNumVerts() || + target.getNumIndices() != getNumIndices()) + { + target.allocateBuffer(getNumVerts(), getNumIndices()); + } +} + void LLVertexBuffer::drawRange(U32 mode, U32 start, U32 end, U32 count, U32 indices_offset) const { llassert(validateRange(start, end, count, indices_offset)); diff --git a/indra/llrender/llvertexbuffer.h b/indra/llrender/llvertexbuffer.h index 49500e28ce..4ada0c335b 100644 --- a/indra/llrender/llvertexbuffer.h +++ b/indra/llrender/llvertexbuffer.h @@ -163,13 +163,13 @@ public: // set for rendering // assumes (and will assert on) the following: - // - this buffer has no pending unampBuffer call + // - this buffer has no pending unmapBuffer call // - a shader is currently bound // - This buffer has sufficient attributes within it to satisfy the needs of the currently bound shader void setBuffer(); // Only call each getVertexPointer, etc, once before calling unmapBuffer() - // call unmapBuffer() after calls to getXXXStrider() before any cals to setBuffer() + // call unmapBuffer() after calls to getXXXStrider() before any calls to setBuffer() // example: // vb->getVertexBuffer(verts); // vb->getNormalStrider(norms); @@ -218,12 +218,12 @@ public: U32 getNumIndices() const { return mNumIndices; } U32 getTypeMask() const { return mTypeMask; } - bool hasDataType(AttributeType type) const { return ((1 << type) & getTypeMask()); } + bool hasDataType(AttributeType type) const { return ((1 << type) & getTypeMask()); } U32 getSize() const { return mSize; } U32 getIndicesSize() const { return mIndicesSize; } U8* getMappedData() const { return mMappedData; } U8* getMappedIndices() const { return mMappedIndexData; } - U32 getOffset(AttributeType type) const { return mOffsets[type]; } + U32 getOffset(AttributeType type) const { return mOffsets[type]; } // these functions assume (and assert on) the current VBO being bound // Detailed error checking can be enabled by setting gDebugGL to true @@ -242,6 +242,7 @@ public: void setLabel(const char* label); #endif + void clone(LLVertexBuffer& target) const; protected: U32 mGLBuffer = 0; // GL VBO handle diff --git a/indra/newview/llface.cpp b/indra/newview/llface.cpp index f73c530ff9..d14a7ffddc 100644 --- a/indra/newview/llface.cpp +++ b/indra/newview/llface.cpp @@ -514,7 +514,7 @@ void LLFace::renderSelected(LLViewerTexture *imagep, const LLColor4& color) mDrawablep->getSpatialGroup()->rebuildGeom(); mDrawablep->getSpatialGroup()->rebuildMesh(); - if(mVertexBuffer.isNull()) + if (mVertexBuffer.isNull()) { return; } @@ -567,8 +567,20 @@ void LLFace::renderSelected(LLViewerTexture *imagep, const LLColor4& color) { // cheaters sometimes prosper... // - mVertexBuffer->setBuffer(); - mVertexBuffer->draw(LLRender::TRIANGLES, mIndicesCount, mIndicesIndex); + LLVertexBuffer* vertex_buffer = mVertexBuffer.get(); + // To display selection markers (white squares with the rounded cross at the center) + // on faces with GLTF textures we use a spectal vertex buffer with other transforms + if (const LLTextureEntry* te = getTextureEntry()) + { + if (LLGLTFMaterial* gltf_mat = te->getGLTFRenderMaterial()) + { + vertex_buffer = mVertexBufferGLTF.get(); + vertex_buffer->unmapBuffer(); + } + } + // Draw the selection marker using the correctly chosen vertex buffer + vertex_buffer->setBuffer(); + vertex_buffer->draw(LLRender::TRIANGLES, mIndicesCount, mIndicesIndex); } gGL.popMatrix(); @@ -1144,7 +1156,8 @@ bool LLFace::getGeometryVolume(const LLVolume& volume, const LLMatrix3& mat_norm_in, U16 index_offset, bool force_rebuild, - bool no_debug_assert) + bool no_debug_assert, + bool rebuild_for_gltf) { LL_PROFILE_ZONE_SCOPED_CATEGORY_FACE; llassert(verify()); @@ -1202,6 +1215,58 @@ bool LLFace::getGeometryVolume(const LLVolume& volume, } } + const LLTextureEntry* tep = mVObjp->getTE(face_index); + llassert(tep); + if (!tep) + return false; + + LLGLTFMaterial* gltf_mat = tep->getGLTFRenderMaterial(); + // To display selection markers (white squares with the rounded cross at the center) + // on faces with GLTF textures we use a special vertex buffer with other transforms + if (gltf_mat && !rebuild_for_gltf && tep->isSelected() && mVertexBuffer.notNull()) + { + // Create a temporary vertex buffer to provide transforms for GLTF textures + if (mVertexBufferGLTF.isNull()) + { + mVertexBufferGLTF = new LLVertexBuffer(mVertexBuffer->getTypeMask()); + } + + // Clone the existing vertex buffer into the temporary one + mVertexBuffer->clone(*mVertexBufferGLTF); + + // Recursive call the same function with the argument rebuild_for_gltf set to true + // This call will make geometry in mVertexBuffer but in fact for mVertexBufferGLTF + mVertexBufferGLTF.swap(mVertexBufferGLTF, mVertexBuffer); + getGeometryVolume(volume, face_index, mat_vert_in, mat_norm_in, index_offset, force_rebuild, no_debug_assert, true); + mVertexBufferGLTF.swap(mVertexBufferGLTF, mVertexBuffer); + } + else if (!tep->isSelected() && mVertexBufferGLTF.notNull()) + { + // Free the temporary vertex buffer when it is not needed anymore + mVertexBufferGLTF = nullptr; + } + + LLGLTFMaterial::TextureInfo gltf_info_index = (LLGLTFMaterial::TextureInfo)0; + if (gltf_mat && rebuild_for_gltf) + { + switch (LLPipeline::sRenderHighlightTextureChannel) + { + case LLRender::BASECOLOR_MAP: + gltf_info_index = LLGLTFMaterial::GLTF_TEXTURE_INFO_BASE_COLOR; + break; + case LLRender::METALLIC_ROUGHNESS_MAP: + gltf_info_index = LLGLTFMaterial::GLTF_TEXTURE_INFO_METALLIC_ROUGHNESS; + break; + case LLRender::GLTF_NORMAL_MAP: + gltf_info_index = LLGLTFMaterial::GLTF_TEXTURE_INFO_NORMAL; + break; + case LLRender::EMISSIVE_MAP: + gltf_info_index = LLGLTFMaterial::GLTF_TEXTURE_INFO_EMISSIVE; + break; + default:; // just to make clang happy + } + } + LLStrider vert; LLStrider tex_coords0; LLStrider tex_coords1; @@ -1218,7 +1283,7 @@ bool LLFace::getGeometryVolume(const LLVolume& volume, LLVector3 scale; if (global_volume) { - scale.setVec(1,1,1); + scale.setVec(1, 1, 1); } else { @@ -1233,7 +1298,6 @@ bool LLFace::getGeometryVolume(const LLVolume& volume, bool rebuild_tangent = rebuild_pos && mVertexBuffer->hasDataType(LLVertexBuffer::TYPE_TANGENT); bool rebuild_weights = rebuild_pos && mVertexBuffer->hasDataType(LLVertexBuffer::TYPE_WEIGHT4); - const LLTextureEntry *tep = mVObjp->getTE(face_index); const U8 bump_code = tep ? tep->getBumpmap() : 0; bool is_static = mDrawablep->isStatic(); @@ -1323,7 +1387,6 @@ bool LLFace::getGeometryVolume(const LLVolume& volume, LLMaterial* mat = tep->getMaterialParams().get(); - LLGLTFMaterial* gltf_mat = tep->getGLTFRenderMaterial(); F32 r = 0, os = 0, ot = 0, ms = 0, mt = 0, cos_ang = 0, sin_ang = 0; @@ -1334,13 +1397,27 @@ bool LLFace::getGeometryVolume(const LLVolume& volume, S32 xforms = XFORM_NONE; // For GLTF, transforms will be applied later - if (rebuild_tcoord && tep && !gltf_mat) + if (rebuild_tcoord && tep && (!gltf_mat || rebuild_for_gltf)) { - r = tep->getRotation(); - os = tep->mOffsetS; - ot = tep->mOffsetT; - ms = tep->mScaleS; - mt = tep->mScaleT; + if (gltf_mat && rebuild_for_gltf) + { + // Apply special transformations for mVertexBufferGLTF + // They are used only to display a face selection marker + // (white square with a rounded cross at the center) + const auto& tt = gltf_mat->mTextureTransform[gltf_info_index]; + r = -tt.mRotation * 2; + ms = tt.mScale[VX]; + mt = tt.mScale[VY]; + os += tt.mOffset[VX] + (ms - 1) / 2; + ot -= tt.mOffset[VY] + (mt - 1) / 2; + } + else + { + r = tep->getRotation(); + tep->getOffset(&os, &ot); + tep->getScale(&ms, &mt); + } + cos_ang = cos(r); sin_ang = sin(r); @@ -1481,12 +1558,9 @@ bool LLFace::getGeometryVolume(const LLVolume& volume, break; } - F32 s_scale = 1.f; - F32 t_scale = 1.f; - if( tep ) - { - tep->getScale( &s_scale, &t_scale ); - } + F32 s_scale = tep->getScaleS(); + F32 t_scale = tep->getScaleT(); + // Use the nudged south when coming from above sun angle, such // that emboss mapping always shows up on the upward faces of cubes when // it's noon (since a lot of builders build with the sun forced to noon). @@ -1508,8 +1582,8 @@ bool LLFace::getGeometryVolume(const LLVolume& volume, bool tex_anim = false; - LLVOVolume* vobj = (LLVOVolume*) (LLViewerObject*) mVObjp; - tex_mode = vobj->mTexAnimMode; + LLVOVolume* vobj = (LLVOVolume*)mVObjp.get(); + tex_mode = vobj->mTexAnimMode; if (vobj->mTextureAnimp) { //texture animation is in play, override specular and normal map tex coords with diffuse texcoords diff --git a/indra/newview/llface.h b/indra/newview/llface.h index 917f3aa0b2..7cf256f731 100644 --- a/indra/newview/llface.h +++ b/indra/newview/llface.h @@ -161,7 +161,8 @@ public: const LLMatrix3& mat_normal, U16 index_offset, bool force_rebuild = false, - bool no_debug_assert = false); + bool no_debug_assert = false, + bool rebuild_for_gltf = false); // For avatar U16 getGeometryAvatar( @@ -266,6 +267,7 @@ public: private: LLPointer mVertexBuffer; + LLPointer mVertexBufferGLTF; U32 mState; LLFacePool* mDrawPoolp; diff --git a/indra/newview/pipeline.cpp b/indra/newview/pipeline.cpp index 2a461ca84b..1b2cffa6c9 100644 --- a/indra/newview/pipeline.cpp +++ b/indra/newview/pipeline.cpp @@ -3580,9 +3580,12 @@ void LLPipeline::postSort(LLCamera &camera) { mSelectedFaces.clear(); + bool tex_index_changed = false; if (!gNonInteractive) { - LLPipeline::setRenderHighlightTextureChannel(gFloaterTools->getPanelFace()->getTextureChannelToEdit()); + LLRender::eTexIndex tex_index = sRenderHighlightTextureChannel; + setRenderHighlightTextureChannel(gFloaterTools->getPanelFace()->getTextureChannelToEdit()); + tex_index_changed = sRenderHighlightTextureChannel != tex_index; } // Draw face highlights for selected faces. @@ -3604,6 +3607,24 @@ void LLPipeline::postSort(LLCamera &camera) } } func; LLSelectMgr::getInstance()->getSelection()->applyToTEs(&func); + + if (tex_index_changed) + { + // Rebuild geometry for all selected faces with PBR textures + for (const LLFace* face : gPipeline.mSelectedFaces) + { + if (const LLViewerObject* vobj = face->getViewerObject()) + { + if (const LLTextureEntry* tep = vobj->getTE(face->getTEOffset())) + { + if (tep->getGLTFRenderMaterial()) + { + gPipeline.markRebuild(face->getDrawable(), LLDrawable::REBUILD_VOLUME); + } + } + } + } + } } } @@ -3656,28 +3677,31 @@ void render_hud_elements() gUIProgram.unbind(); } -void LLPipeline::renderHighlights() +static inline void bindHighlightProgram(LLGLSLShader& program) { - assertInitialized(); - - // Draw 3D UI elements here (before we clear the Z buffer in POOL_HUD) - // Render highlighted faces. - LLGLSPipelineAlpha gls_pipeline_alpha; - LLColor4 color(1.f, 1.f, 1.f, 0.5f); - disableLights(); - if ((LLViewerShaderMgr::instance()->getShaderLevel(LLViewerShaderMgr::SHADER_INTERFACE) > 0)) { - gHighlightProgram.bind(); - gGL.diffuseColor4f(1,1,1,0.5f); + program.bind(); + gGL.diffuseColor4f(1, 1, 1, 0.5f); } +} - if (hasRenderDebugFeatureMask(RENDER_DEBUG_FEATURE_SELECTED) && !mFaceSelectImagep) - { - mFaceSelectImagep = LLViewerTextureManager::getFetchedTexture(IMG_FACE_SELECT); - } +static inline void unbindHighlightProgram(LLGLSLShader& program) +{ + if (LLViewerShaderMgr::instance()->getShaderLevel(LLViewerShaderMgr::SHADER_INTERFACE) > 0) + { + program.unbind(); + } +} - if (hasRenderDebugFeatureMask(RENDER_DEBUG_FEATURE_SELECTED) && (sRenderHighlightTextureChannel == LLRender::DIFFUSE_MAP)) +void LLPipeline::renderSelectedFaces(const LLColor4& color) +{ + if (!mFaceSelectImagep) + { + mFaceSelectImagep = LLViewerTextureManager::getFetchedTexture(IMG_FACE_SELECT); + } + + if (mFaceSelectImagep) { // Make sure the selection image gets downloaded and decoded mFaceSelectImagep->addTextureStats((F32)MAX_IMAGE_AREA); @@ -3693,81 +3717,61 @@ void LLPipeline::renderHighlights() facep->renderSelected(mFaceSelectImagep, color); } } +} - if (hasRenderDebugFeatureMask(RENDER_DEBUG_FEATURE_SELECTED)) - { - // Paint 'em red! - color.setVec(1.f, 0.f, 0.f, 0.5f); - - for (auto facep : mHighlightFaces) - { - facep->renderSelected(LLViewerTexture::sNullImagep, color); - } - } +void LLPipeline::renderHighlights() +{ + assertInitialized(); - // Contains a list of the faces of objects that are physical or - // have touch-handlers. - mHighlightFaces.clear(); + // Draw 3D UI elements here (before we clear the Z buffer in POOL_HUD) + // Render highlighted faces. + LLGLSPipelineAlpha gls_pipeline_alpha; + disableLights(); - if (LLViewerShaderMgr::instance()->getShaderLevel(LLViewerShaderMgr::SHADER_INTERFACE) > 0) + if (hasRenderDebugFeatureMask(RENDER_DEBUG_FEATURE_SELECTED)) { - gHighlightProgram.unbind(); - } - + bindHighlightProgram(gHighlightProgram); - if (hasRenderDebugFeatureMask(RENDER_DEBUG_FEATURE_SELECTED) && (sRenderHighlightTextureChannel == LLRender::NORMAL_MAP)) - { - color.setVec(1.0f, 0.5f, 0.5f, 0.5f); - if ((LLViewerShaderMgr::instance()->getShaderLevel(LLViewerShaderMgr::SHADER_INTERFACE) > 0)) + if (sRenderHighlightTextureChannel == LLRender::DIFFUSE_MAP || + sRenderHighlightTextureChannel == LLRender::BASECOLOR_MAP || + sRenderHighlightTextureChannel == LLRender::METALLIC_ROUGHNESS_MAP || + sRenderHighlightTextureChannel == LLRender::GLTF_NORMAL_MAP || + sRenderHighlightTextureChannel == LLRender::EMISSIVE_MAP || + sRenderHighlightTextureChannel == LLRender::NUM_TEXTURE_CHANNELS) { - gHighlightNormalProgram.bind(); - gGL.diffuseColor4f(1,1,1,0.5f); + static const LLColor4 highlight_selected_color(1.f, 1.f, 1.f, 0.5f); + renderSelectedFaces(highlight_selected_color); } - mFaceSelectImagep->addTextureStats((F32)MAX_IMAGE_AREA); - - for (auto facep : mSelectedFaces) + // Paint 'em red! + static const LLColor4 highlight_face_color(1.f, 0.f, 0.f, 0.5f); + for (auto facep : mHighlightFaces) { - if (!facep || facep->getDrawable()->isDead()) - { - LL_ERRS() << "Bad face on selection" << LL_ENDL; - return; - } - - facep->renderSelected(mFaceSelectImagep, color); + facep->renderSelected(LLViewerTexture::sNullImagep, highlight_face_color); } - if ((LLViewerShaderMgr::instance()->getShaderLevel(LLViewerShaderMgr::SHADER_INTERFACE) > 0)) - { - gHighlightNormalProgram.unbind(); - } + unbindHighlightProgram(gHighlightProgram); } - if (hasRenderDebugFeatureMask(RENDER_DEBUG_FEATURE_SELECTED) && (sRenderHighlightTextureChannel == LLRender::SPECULAR_MAP)) - { - color.setVec(0.0f, 0.3f, 1.0f, 0.8f); - if ((LLViewerShaderMgr::instance()->getShaderLevel(LLViewerShaderMgr::SHADER_INTERFACE) > 0)) - { - gHighlightSpecularProgram.bind(); - gGL.diffuseColor4f(1,1,1,0.5f); - } - - mFaceSelectImagep->addTextureStats((F32)MAX_IMAGE_AREA); + // Contains a list of the faces of objects that are physical or + // have touch-handlers. + mHighlightFaces.clear(); - for (auto facep : mSelectedFaces) + if (hasRenderDebugFeatureMask(RENDER_DEBUG_FEATURE_SELECTED)) + { + if (sRenderHighlightTextureChannel == LLRender::NORMAL_MAP) { - if (!facep || facep->getDrawable()->isDead()) - { - LL_ERRS() << "Bad face on selection" << LL_ENDL; - return; - } - - facep->renderSelected(mFaceSelectImagep, color); + static const LLColor4 highlight_normal_color(1.0f, 0.5f, 0.5f, 0.5f); + bindHighlightProgram(gHighlightNormalProgram); + renderSelectedFaces(highlight_normal_color); + unbindHighlightProgram(gHighlightNormalProgram); } - - if ((LLViewerShaderMgr::instance()->getShaderLevel(LLViewerShaderMgr::SHADER_INTERFACE) > 0)) + else if (sRenderHighlightTextureChannel == LLRender::SPECULAR_MAP) { - gHighlightSpecularProgram.unbind(); + static const LLColor4 highlight_specular_color(0.0f, 0.3f, 1.0f, 0.8f); + bindHighlightProgram(gHighlightSpecularProgram); + renderSelectedFaces(highlight_specular_color); + unbindHighlightProgram(gHighlightSpecularProgram); } } } @@ -6256,7 +6260,10 @@ bool LLPipeline::getRenderHighlights() // static void LLPipeline::setRenderHighlightTextureChannel(LLRender::eTexIndex channel) { - sRenderHighlightTextureChannel = channel; + if (channel != sRenderHighlightTextureChannel) + { + sRenderHighlightTextureChannel = channel; + } } LLVOPartGroup* LLPipeline::lineSegmentIntersectParticle(const LLVector4a& start, const LLVector4a& end, LLVector4a* intersection, diff --git a/indra/newview/pipeline.h b/indra/newview/pipeline.h index 6c79d20149..4164474238 100644 --- a/indra/newview/pipeline.h +++ b/indra/newview/pipeline.h @@ -342,6 +342,7 @@ public: void renderHighlight(const LLViewerObject* obj, F32 fade); void renderShadow(glh::matrix4f& view, glh::matrix4f& proj, LLCamera& camera, LLCullResult& result, bool depth_clamp); + void renderSelectedFaces(const LLColor4& color); void renderHighlights(); void renderDebug(); void renderPhysicsDisplay(); -- cgit v1.2.3 From 12cb787f314b690e018d4b12ac54e08570b3b677 Mon Sep 17 00:00:00 2001 From: Rye Mutt Date: Thu, 8 Aug 2024 11:57:26 -0400 Subject: Update libexpat to 2.6.2 and libapr 1.7.4 (#2214) --- autobuild.xml | 32 +++++++++++++++++--------------- indra/cmake/APR.cmake | 14 +++++++------- indra/cmake/Copy3rdPartyLibs.cmake | 30 +++++++++++++++++++++--------- indra/cmake/EXPAT.cmake | 19 +++++++++---------- indra/llcorehttp/CMakeLists.txt | 2 -- indra/newview/viewer_manifest.py | 10 ---------- 6 files changed, 54 insertions(+), 53 deletions(-) diff --git a/autobuild.xml b/autobuild.xml index bbc4cf40a9..b61629086d 100644 --- a/autobuild.xml +++ b/autobuild.xml @@ -46,11 +46,11 @@ archive hash - dc4a38439f90325b406ec3f7cc4fa66edf0eeec8 + 058ffb9080ac03abd8ecd1f57fcc1160351c71ed hash_algorithm sha1 url - https://github.com/secondlife/3p-apr_suite/releases/download/v1.7.2-e935465/apr_suite-1.7.2-e935465-darwin64-e935465.tar.zst + https://github.com/secondlife/3p-apr_suite/releases/download/v1.7.4-r1/apr_suite-1.7.4-10278668642-darwin64-10278668642.tar.zst name darwin64 @@ -60,9 +60,11 @@ archive hash - 84a1a140f20b25d714949185e854d14b + 272d97471f6ecf6e1eb4802f353d1f8c6f024eb3 + hash_algorithm + sha1 url - http://automated-builds-secondlife-com.s3.amazonaws.com/ct2/4811/15302/apr_suite-1.4.5.504800-linux64-504800.tar.bz2 + https://github.com/secondlife/3p-apr_suite/releases/download/v1.7.4-r1/apr_suite-1.7.4-10278668642-linux64-10278668642.tar.zst name linux64 @@ -72,11 +74,11 @@ archive hash - 8233de9a11f323a03d569db1043ba5198176457b + 587b0b61ecff2ac55cfbcb8e57a7b07c844a0069 hash_algorithm sha1 url - https://github.com/secondlife/3p-apr_suite/releases/download/v1.7.2-e935465/apr_suite-1.7.2-e935465-windows64-e935465.tar.zst + https://github.com/secondlife/3p-apr_suite/releases/download/v1.7.4-r1/apr_suite-1.7.4-10278668642-windows64-10278668642.tar.zst name windows64 @@ -89,7 +91,7 @@ copyright Copyright © 2012 The Apache Software Foundation, Licensed under the Apache License, Version 2.0. version - 1.7.2-e935465 + 1.7.4-10278668642 name apr_suite description @@ -524,11 +526,11 @@ archive hash - b85526ca80b6a7e73c7870285cf68d568f742095 + bd61ec7787ea96d11f735afa5a6296ed175472b6 hash_algorithm sha1 url - https://github.com/secondlife/3p-expat/releases/download/v2.1.1.1f36d02/expat-2.1.1.1f36d02-darwin64-1f36d02.tar.zst + https://github.com/secondlife/3p-expat/releases/download/v2.6.2-r4/expat-2.6.2-r4-darwin64-10278332617.tar.zst name darwin64 @@ -538,11 +540,11 @@ archive hash - 4cd82e2dec06ddff19e9b3dc0254f2593ec80452 + acf891bda4125a92f6347e69f0e7867f32cebd20 hash_algorithm sha1 url - https://github.com/secondlife/3p-expat/releases/download/v2.1.1.1f36d02/expat-2.1.1.1f36d02-linux64-1f36d02.tar.zst + https://github.com/secondlife/3p-expat/releases/download/v2.6.2-r4/expat-2.6.2-r4-linux64-10278332617.tar.zst name linux64 @@ -552,11 +554,11 @@ archive hash - 47c01a89bc32c5740efe51be43e459ffd9b7cd34 + 1b9c198626fca0f30fb2770856e65767a9951683 hash_algorithm sha1 url - https://github.com/secondlife/3p-expat/releases/download/v2.1.1.1f36d02/expat-2.1.1.1f36d02-windows64-1f36d02.tar.zst + https://github.com/secondlife/3p-expat/releases/download/v2.6.2-r4/expat-2.6.2-r4-windows64-10278332617.tar.zst name windows64 @@ -567,9 +569,9 @@ license_file LICENSES/expat.txt copyright - Copyright (c) 1998, 1999, 2000 Thai Open Source Software Center Ltd and Clark Cooper - Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006 Expat maintainers. + Copyright (c) 1998-2000 Thai Open Source Software Center Ltd and Clark Cooper - Copyright (c) 2001-2022 Expat maintainers. version - 2.1.1.1f36d02 + 2.6.2-r4 name expat description diff --git a/indra/cmake/APR.cmake b/indra/cmake/APR.cmake index 21139319c3..97b316c4c7 100644 --- a/indra/cmake/APR.cmake +++ b/indra/cmake/APR.cmake @@ -18,6 +18,7 @@ if (WINDOWS) ${ARCH_PREBUILT_DIRS_RELEASE}/${APR_selector}apr-1.lib ${ARCH_PREBUILT_DIRS_RELEASE}/${APR_selector}aprutil-1.lib ) + target_compile_definitions( ll::apr INTERFACE APR_DECLARE_STATIC=1 APU_DECLARE_STATIC=1 API_DECLARE_STATIC=1) elseif (DARWIN) if (LLCOMMON_LINK_SHARED) set(APR_selector "0.dylib") @@ -28,16 +29,15 @@ elseif (DARWIN) endif (LLCOMMON_LINK_SHARED) target_link_libraries( ll::apr INTERFACE - libapr-1.${APR_selector} - libaprutil-1.${APRUTIL_selector} + ${ARCH_PREBUILT_DIRS_RELEASE}/libapr-1.${APR_selector} + ${ARCH_PREBUILT_DIRS_RELEASE}/libaprutil-1.${APR_selector} iconv ) -else (WINDOWS) +else() target_link_libraries( ll::apr INTERFACE - apr-1 - aprutil-1 - uuid + ${ARCH_PREBUILT_DIRS_RELEASE}/libapr-1.a + ${ARCH_PREBUILT_DIRS_RELEASE}/libaprutil-1.a rt ) -endif (WINDOWS) +endif () target_include_directories( ll::apr SYSTEM INTERFACE ${LIBS_PREBUILT_DIR}/include/apr-1 ) diff --git a/indra/cmake/Copy3rdPartyLibs.cmake b/indra/cmake/Copy3rdPartyLibs.cmake index 2dc9d6080a..86c5b80fad 100644 --- a/indra/cmake/Copy3rdPartyLibs.cmake +++ b/indra/cmake/Copy3rdPartyLibs.cmake @@ -54,11 +54,14 @@ if(WINDOWS) set(release_src_dir "${ARCH_PREBUILT_DIRS_RELEASE}") set(release_files openjp2.dll - libapr-1.dll - libaprutil-1.dll nghttp2.dll ) + if(LLCOMMON_LINK_SHARED) + set(release_files ${release_files} libapr-1.dll) + set(release_files ${release_files} libaprutil-1.dll) + endif() + # OpenSSL if(ADDRESS_SIZE EQUAL 64) set(release_files ${release_files} libcrypto-1_1-x64.dll) @@ -179,16 +182,20 @@ elseif(DARWIN) ) set(release_src_dir "${ARCH_PREBUILT_DIRS_RELEASE}") set(release_files - libapr-1.0.dylib - libapr-1.dylib - libaprutil-1.0.dylib - libaprutil-1.dylib - ${EXPAT_COPY} libndofdev.dylib libnghttp2.dylib libnghttp2.14.dylib ) + if(LLCOMMON_LINK_SHARED) + set(release_files ${release_files} + libapr-1.0.dylib + libapr-1.dylib + libaprutil-1.0.dylib + libaprutil-1.dylib + ) + endif() + if (TARGET ll::openal) list(APPEND release_files libalut.dylib libopenal.dylib) endif () @@ -224,8 +231,6 @@ elseif(LINUX) if( USE_AUTOBUILD_3P ) list( APPEND release_files - libapr-1.so.0 - libaprutil-1.so.0 libatk-1.0.so libfreetype.so.6.6.2 libfreetype.so.6 @@ -237,6 +242,13 @@ elseif(LINUX) libgmodule-2.0.so libgobject-2.0.so ) + + if(LLCOMMON_LINK_SHARED) + set(release_files ${release_files} + libapr-1.so.0 + libaprutil-1.so.0 + ) + endif() endif() else(WINDOWS) diff --git a/indra/cmake/EXPAT.cmake b/indra/cmake/EXPAT.cmake index 327fe8aa72..1a0b8789dc 100644 --- a/indra/cmake/EXPAT.cmake +++ b/indra/cmake/EXPAT.cmake @@ -7,14 +7,13 @@ add_library( ll::expat INTERFACE IMPORTED ) use_system_binary(expat) use_prebuilt_binary(expat) if (WINDOWS) - target_link_libraries( ll::expat INTERFACE libexpatMT ) - set(EXPAT_COPY libexpatMT.dll) -else (WINDOWS) - target_link_libraries( ll::expat INTERFACE expat ) - if (DARWIN) - set(EXPAT_COPY libexpat.1.dylib libexpat.dylib) - else () - set(EXPAT_COPY libexpat.so.1 libexpat.so) - endif () -endif (WINDOWS) + target_compile_definitions( ll::expat INTERFACE XML_STATIC=1) + target_link_libraries( ll::expat INTERFACE + debug ${ARCH_PREBUILT_DIRS_DEBUG}/libexpatd.lib + optimized ${ARCH_PREBUILT_DIRS_RELEASE}/libexpat.lib) +else () + target_link_libraries( ll::expat INTERFACE + debug ${ARCH_PREBUILT_DIRS_DEBUG}/libexpat.a + optimized ${ARCH_PREBUILT_DIRS_RELEASE}/libexpat.a) +endif () target_include_directories( ll::expat SYSTEM INTERFACE ${LIBS_PREBUILT_DIR}/include ) diff --git a/indra/llcorehttp/CMakeLists.txt b/indra/llcorehttp/CMakeLists.txt index f7a6669825..d388883575 100644 --- a/indra/llcorehttp/CMakeLists.txt +++ b/indra/llcorehttp/CMakeLists.txt @@ -155,8 +155,6 @@ if (DARWIN) # for portability. This operation is Darwin-specific. We can count on the # 'cp' command. set(copy_dylibs - libapr-1.0.dylib - libaprutil-1.0.dylib libnghttp2*.dylib ${EXPAT_COPY} ) diff --git a/indra/newview/viewer_manifest.py b/indra/newview/viewer_manifest.py index 09397a0989..ea4b2ff4f4 100755 --- a/indra/newview/viewer_manifest.py +++ b/indra/newview/viewer_manifest.py @@ -1008,9 +1008,6 @@ class Darwin_x86_64_Manifest(ViewerManifest): libfile_parent = self.get_dst_prefix() dylibs=[] for libfile in ( - "libapr-1.0.dylib", - "libaprutil-1.0.dylib", - "libexpat.1.dylib", # libnghttp2.dylib is a symlink to # libnghttp2.major.dylib, which is a symlink to # libnghttp2.version.dylib. Get all of them. @@ -1315,14 +1312,7 @@ class Linux_i686_Manifest(LinuxManifest): debpkgdir = os.path.join(pkgdir, "lib", "debug") with self.prefix(src=relpkgdir, dst="lib"): - self.path("libapr-1.so") - self.path("libapr-1.so.0") - self.path("libapr-1.so.0.4.5") - self.path("libaprutil-1.so") - self.path("libaprutil-1.so.0") - self.path("libaprutil-1.so.0.4.1") self.path("libdb*.so") - self.path("libexpat.so.*") self.path("libuuid.so*") self.path("libSDL-1.2.so.*") self.path("libdirectfb-1.*.so.*") -- cgit v1.2.3 From 810d11c625cc71a0fbc15bb28cc770d5ea1670fd Mon Sep 17 00:00:00 2001 From: Rye Mutt Date: Thu, 8 Aug 2024 11:57:35 -0400 Subject: Update xxhash to 0.8.2 (#2217) --- autobuild.xml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/autobuild.xml b/autobuild.xml index b61629086d..ad986d47cb 100644 --- a/autobuild.xml +++ b/autobuild.xml @@ -2691,11 +2691,11 @@ Copyright (c) 2012, 2014, 2015, 2016 nghttp2 contributors archive hash - 1a73c476b371b62066d1c3eced249660e9467e53 + fc9362865e33391d55c64d6101726da0a25d924e hash_algorithm sha1 url - https://github.com/secondlife/3p-xxhash/releases/download/v0.8.1-69ff69a/xxhash-0.8.1-69ff69a-common-69ff69a.tar.zst + https://github.com/secondlife/3p-xxhash/releases/download/v0.8.2-r1/xxhash-0.8.2-10285735820-common-10285735820.tar.zst name common @@ -2708,7 +2708,7 @@ Copyright (c) 2012, 2014, 2015, 2016 nghttp2 contributors copyright Copyright (c) 2012-2021 Yann Collet version - 0.8.1-69ff69a + 0.8.2-10285735820 name xxhash description -- cgit v1.2.3 From 77d50cad495511a91ca1461d9e6f43a7e8656965 Mon Sep 17 00:00:00 2001 From: Andrey Kleshchev Date: Thu, 8 Aug 2024 14:59:41 +0300 Subject: viewer#2225 Fix Joystick Floater's FPS drops --- indra/newview/llfloaterjoystick.cpp | 33 ++++++++++++++++++++++++++------- indra/newview/llfloaterjoystick.h | 2 ++ 2 files changed, 28 insertions(+), 7 deletions(-) diff --git a/indra/newview/llfloaterjoystick.cpp b/indra/newview/llfloaterjoystick.cpp index 7db3621a4b..68b11ec92b 100644 --- a/indra/newview/llfloaterjoystick.cpp +++ b/indra/newview/llfloaterjoystick.cpp @@ -93,8 +93,9 @@ BOOL CALLBACK di8_list_devices_callback(LPCDIDEVICEINSTANCE device_instance_ptr, #endif LLFloaterJoystick::LLFloaterJoystick(const LLSD& data) - : LLFloater(data), - mHasDeviceList(false) + : LLFloater(data) + , mHasDeviceList(false) + , mJoystickInitialized(false) { if (!LLViewerJoystick::getInstance()->isJoystickInitialized()) { @@ -108,7 +109,10 @@ void LLFloaterJoystick::draw() { LLViewerJoystick* joystick(LLViewerJoystick::getInstance()); bool joystick_inited = joystick->isJoystickInitialized(); - if (joystick_inited != mHasDeviceList) + if (!mHasDeviceList + || mJoystickInitialized != joystick_inited + || (joystick->isDeviceUUIDSet() && joystick->getDeviceUUID().asUUID() != mCurrentDeviceId) + || (!joystick->isDeviceUUIDSet() && mCurrentDeviceId.notNull())) { refreshListOfDevices(); } @@ -290,15 +294,16 @@ void LLFloaterJoystick::refreshListOfDevices() mHasDeviceList = true; } - bool is_device_id_set = LLViewerJoystick::getInstance()->isDeviceUUIDSet(); + LLViewerJoystick* joystick = LLViewerJoystick::getInstance(); + bool is_device_id_set = joystick->isDeviceUUIDSet(); - if (LLViewerJoystick::getInstance()->isJoystickInitialized() && + if (joystick->isJoystickInitialized() && (!mHasDeviceList || !is_device_id_set)) { #if LL_WINDOWS && !LL_MESA_HEADLESS LL_WARNS() << "NDOF connected to device without using SL provided handle" << LL_ENDL; #endif - std::string desc = LLViewerJoystick::getInstance()->getDescription(); + std::string desc = joystick->getDescription(); if (!desc.empty()) { LLSD value = LLSD::Integer(1); // value for selection @@ -311,11 +316,13 @@ void LLFloaterJoystick::refreshListOfDevices() { if (is_device_id_set) { - LLSD guid = LLViewerJoystick::getInstance()->getDeviceUUID(); + LLSD guid = joystick->getDeviceUUID(); + mCurrentDeviceId = guid.asUUID(); mJoysticksCombo->selectByValue(guid); } else { + mCurrentDeviceId.setNull(); mJoysticksCombo->selectByValue(LLSD::Integer(1)); } } @@ -323,6 +330,18 @@ void LLFloaterJoystick::refreshListOfDevices() { mJoysticksCombo->selectByValue(LLSD::Integer(0)); } + + // Update tracking + if (is_device_id_set) + { + LLSD guid = joystick->getDeviceUUID(); + mCurrentDeviceId = guid.asUUID(); + } + else + { + mCurrentDeviceId.setNull(); + } + mJoystickInitialized = joystick->isJoystickInitialized(); } void LLFloaterJoystick::cancel() diff --git a/indra/newview/llfloaterjoystick.h b/indra/newview/llfloaterjoystick.h index b94223a738..c7e727635d 100644 --- a/indra/newview/llfloaterjoystick.h +++ b/indra/newview/llfloaterjoystick.h @@ -95,6 +95,8 @@ private: LLComboBox *mJoysticksCombo; bool mHasDeviceList; + bool mJoystickInitialized; + LLUUID mCurrentDeviceId; // stats view LLStatBar* mAxisStatsBar[6]; -- cgit v1.2.3 From fe0f1be17bfd83323f2fcda124f3327cc14b0cad Mon Sep 17 00:00:00 2001 From: Beq Janus Date: Thu, 8 Aug 2024 17:10:03 +0100 Subject: Auto-scaling amortisation of dynamic BB calcs (#2226) * Auto-scaling amortisation of dynamic BB calcs This fix limits the overhead of the dynamic BB calcs to AvatarExtentRefreshMaxPerBatch per AvatarExtentRefreshPeriodBatch frames default is 5 avatar per 4 frames. Thus a standard busy region 25 avatars would take 20 frames to refresh the BBs. * Add comments to give context to the amortised BB recalcs explain the frequency of updates given the number of avatars present as to how that limits the impact on frame rate in busy scenes --- indra/newview/app_settings/settings.xml | 22 ++++++++++++++++++++ indra/newview/llviewerobjectlist.cpp | 5 +++++ indra/newview/llviewerobjectlist.h | 2 ++ indra/newview/llvoavatar.cpp | 37 +++++++++++++++++++++++++++------ 4 files changed, 60 insertions(+), 6 deletions(-) diff --git a/indra/newview/app_settings/settings.xml b/indra/newview/app_settings/settings.xml index eb053ebaa0..887a8584d8 100644 --- a/indra/newview/app_settings/settings.xml +++ b/indra/newview/app_settings/settings.xml @@ -1874,6 +1874,28 @@ Value 64.0 + AvatarExtentRefreshPeriodBatch + + Comment + how many frames do we spread over by default when refreshing extents (default is 4) + Persist + 1 + Type + S32 + Value + 4 + + AvatarExtentRefreshMaxPerBatch + + Comment + how many avatars do we want to handle in total per batch (default is 5) + Persist + 1 + Type + S32 + Value + 5 + DebugAvatarAppearanceMessage Comment diff --git a/indra/newview/llviewerobjectlist.cpp b/indra/newview/llviewerobjectlist.cpp index ae64ee7b92..435bd60917 100644 --- a/indra/newview/llviewerobjectlist.cpp +++ b/indra/newview/llviewerobjectlist.cpp @@ -889,6 +889,7 @@ void LLViewerObjectList::update(LLAgent &agent) static std::vector idle_list; U32 idle_count = 0; + mNumAvatars = 0; { for (std::vector >::iterator active_iter = mActiveObjects.begin(); @@ -906,6 +907,10 @@ void LLViewerObjectList::update(LLAgent &agent) idle_list[idle_count] = objectp; } ++idle_count; + if (objectp->isAvatar()) + { + mNumAvatars++; + } } else { // There shouldn't be any NULL pointers in the list, but they have caused diff --git a/indra/newview/llviewerobjectlist.h b/indra/newview/llviewerobjectlist.h index ebdfd0d369..7dfa94b99f 100644 --- a/indra/newview/llviewerobjectlist.h +++ b/indra/newview/llviewerobjectlist.h @@ -145,6 +145,7 @@ public: S32 getOrphanParentCount() const { return (S32) mOrphanParents.size(); } S32 getOrphanCount() const { return mNumOrphans; } + S32 getAvatarCount() const { return mNumAvatars; } void orphanize(LLViewerObject *childp, U32 parent_id, U32 ip, U32 port); void findOrphans(LLViewerObject* objectp, U32 ip, U32 port); @@ -191,6 +192,7 @@ protected: std::vector mOrphanParents; // LocalID/ip,port of orphaned objects std::vector mOrphanChildren; // UUID's of orphaned objects S32 mNumOrphans; + S32 mNumAvatars; typedef std::vector > vobj_list_t; diff --git a/indra/newview/llvoavatar.cpp b/indra/newview/llvoavatar.cpp index d5a8ee6cf8..b3b8969faa 100644 --- a/indra/newview/llvoavatar.cpp +++ b/indra/newview/llvoavatar.cpp @@ -2631,6 +2631,29 @@ void LLVOAvatar::idleUpdate(LLAgent &agent, const F64 &time) } // Update should be happening max once per frame. + static LLCachedControl refreshPeriod(gSavedSettings, "AvatarExtentRefreshPeriodBatch"); + static LLCachedControl refreshMaxPerPeriod(gSavedSettings, "AvatarExtentRefreshMaxPerBatch"); + static S32 upd_freq = refreshPeriod; // initialise to a reasonable default of 1 batch + static S32 lastRecalibrationFrame{ 0 }; + + const S32 thisFrame = LLDrawable::getCurrentFrame(); + if (thisFrame - lastRecalibrationFrame >= upd_freq) + { + // Only update at the start of a cycle. . + // update frequency = ((Num_Avatars -1 / NumberPerPeriod) + 1 ) * Periodicity + // Given NumberPerPeriod = 5 and Periodicity = 4 + // | NumAvatars | frequency | + // +-------------+-----------+ + // | 1 | 4 | + // | 2 | 4 | + // | 5 | 4 | + // | 10 | 8 | + // | 25 | 20 | + + upd_freq = (((gObjectList.getAvatarCount() - 1) / refreshMaxPerPeriod) + 1)*refreshPeriod; + lastRecalibrationFrame = thisFrame; + } + if ((mLastAnimExtents[0]==LLVector3())|| (mLastAnimExtents[1])==LLVector3()) { @@ -2638,8 +2661,9 @@ void LLVOAvatar::idleUpdate(LLAgent &agent, const F64 &time) } else { - const S32 upd_freq = 4; // force update every upd_freq frames. - mNeedsExtentUpdate = ((LLDrawable::getCurrentFrame()+mID.mData[0])%upd_freq==0); + // Update extent if necessary. + // if the frame counnter + the first byte of the UUID % upd_freq = 0 then update the extent. + mNeedsExtentUpdate = ((thisFrame + mID.mData[0]) % upd_freq == 0); } LLScopedContextString str("avatar_idle_update " + getFullname()); @@ -10725,10 +10749,11 @@ void LLVOAvatar::updateRiggingInfo() } //LL_INFOS() << "done update rig count is " << countRigInfoTab(mJointRiggingInfoTab) << LL_ENDL; - LL_DEBUGS("RigSpammish") << getFullname() << " after update rig tab:" << LL_ENDL; - S32 joint_count, box_count; - showRigInfoTabExtents(this, mJointRiggingInfoTab, joint_count, box_count); - LL_DEBUGS("RigSpammish") << "uses " << joint_count << " joints " << " nonzero boxes: " << box_count << LL_ENDL; + // Remove debug only stuff on hot path + // LL_DEBUGS("RigSpammish") << getFullname() << " after update rig tab:" << LL_ENDL; + // S32 joint_count, box_count; + // showRigInfoTabExtents(this, mJointRiggingInfoTab, joint_count, box_count); + // LL_DEBUGS("RigSpammish") << "uses " << joint_count << " joints " << " nonzero boxes: " << box_count << LL_ENDL; } // virtual -- cgit v1.2.3 From f1f3aa42e8fcb3e1a511c08a23c50aaf291199dc Mon Sep 17 00:00:00 2001 From: Roxie Linden Date: Thu, 8 Aug 2024 09:34:48 -0700 Subject: CR fixes --- .github/workflows/build.yaml | 2 +- indra/cmake/Linking.cmake | 2 +- indra/llwebrtc/CMakeLists.txt | 4 ++-- indra/newview/CMakeLists.txt | 14 +++++++------- 4 files changed, 11 insertions(+), 11 deletions(-) diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index 72cdf01634..c998f42905 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -390,7 +390,7 @@ jobs: tar -xJf "${{ needs.build.outputs.viewer_channel }}.sym.tar.xz" -C _artifacts - name: Post Windows symbols if: env.BUGSPLAT_USER && env.BUGSPLAT_PASS - uses: Bugsplat-Git/symbol-upload@v9.1.1 + uses: Bugsplat-Git/symbol-upload@v10 with: username: ${{ env.BUGSPLAT_USER }} password: ${{ env.BUGSPLAT_PASS }} diff --git a/indra/cmake/Linking.cmake b/indra/cmake/Linking.cmake index a5b8767923..1d757abeff 100644 --- a/indra/cmake/Linking.cmake +++ b/indra/cmake/Linking.cmake @@ -19,7 +19,7 @@ if (WINDOWS OR DARWIN ) endif() else() set(SHARED_LIB_STAGING_DIR ${CMAKE_BINARY_DIR}/sharedlibs/$,$,>) - set(SYMBOLS_STAGING_DIR ${CMAKE_BINARY_DIR}/symbols/$,$,>) + set(SYMBOLS_STAGING_DIR ${CMAKE_BINARY_DIR}/symbols/$,$,>/${VIEWER_CHANNEL}) endif() if( DARWIN ) diff --git a/indra/llwebrtc/CMakeLists.txt b/indra/llwebrtc/CMakeLists.txt index e3404b3a23..30aaec1265 100644 --- a/indra/llwebrtc/CMakeLists.txt +++ b/indra/llwebrtc/CMakeLists.txt @@ -44,13 +44,13 @@ if (WINDOWS) strmiids iphlpapi) if (USE_BUGSPLAT) - set_target_properties(llwebrtc PROPERTIES PDB_OUTPUT_DIRECTORY "${SYMBOLS_STAGING_DIR}/${VIEWER_CHANNEL}") + set_target_properties(llwebrtc PROPERTIES PDB_OUTPUT_DIRECTORY "${SYMBOLS_STAGING_DIR}") endif (USE_BUGSPLAT) elseif (DARWIN) target_link_libraries(llwebrtc PRIVATE ll::webrtc) if (USE_BUGSPLAT) set_target_properties(llwebrtc PROPERTIES XCODE_ATTRIBUTE_DEBUG_INFORMATION_FORMAT "dwarf-with-dsym" - XCODE_ATTRIBUTE_DWARF_DSYM_FOLDER_PATH "${SYMBOLS_STAGING_DIR}/${VIEWER_CHANNEL}/dSYMs") + XCODE_ATTRIBUTE_DWARF_DSYM_FOLDER_PATH "${SYMBOLS_STAGING_DIR}/dSYMs") endif (USE_BUGSPLAT) elseif (LINUX) target_link_libraries(llwebrtc PRIVATE ll::webrtc) diff --git a/indra/newview/CMakeLists.txt b/indra/newview/CMakeLists.txt index c5f38a832a..517b25def5 100644 --- a/indra/newview/CMakeLists.txt +++ b/indra/newview/CMakeLists.txt @@ -2161,8 +2161,8 @@ if (PACKAGE AND (RELEASE_CRASH_REPORTING OR NON_RELEASE_CRASH_REPORTING) AND VIE if (USE_BUGSPLAT) # BugSplat symbol-file generation if (WINDOWS) - set(VIEWER_APP_SYMBOLS_ARCHIVE "${SYMBOLS_STAGING_DIR}/${VIEWER_CHANNEL}.sym.tar.xz") - set_target_properties( ${VIEWER_BINARY_NAME} PROPERTIES PDB_OUTPUT_DIRECTORY "${SYMBOLS_STAGING_DIR}/${VIEWER_CHANNEL}") + set(VIEWER_APP_SYMBOLS_ARCHIVE "${SYMBOLS_STAGING_DIR}.sym.tar.xz") + set_target_properties( ${VIEWER_BINARY_NAME} PROPERTIES PDB_OUTPUT_DIRECTORY "${SYMBOLS_STAGING_DIR}") # Just pack up a tarball containing only the .pdb files for the # executables. @@ -2173,7 +2173,7 @@ if (PACKAGE AND (RELEASE_CRASH_REPORTING OR NON_RELEASE_CRASH_REPORTING) AND VIE "${VIEWER_CHANNEL}.sym.tar.xz" "${VIEWER_CHANNEL}" DEPENDS "${VIEWER_BINARY_NAME}" llwebrtc - WORKING_DIRECTORY "${SYMBOLS_STAGING_DIR}" + WORKING_DIRECTORY "${SYMBOLS_STAGING_DIR}/.." COMMENT "Packing viewer PDBs into ${VIEWER_APP_SYMBOLS_ARCHIVE}" ) add_custom_target(generate_symbols DEPENDS "${VIEWER_APP_SYMBOLS_ARCHIVE}") @@ -2181,21 +2181,21 @@ if (PACKAGE AND (RELEASE_CRASH_REPORTING OR NON_RELEASE_CRASH_REPORTING) AND VIE endif (WINDOWS) if (DARWIN) - set(VIEWER_APP_XCARCHIVE "${SYMBOLS_STAGING_DIR}/${VIEWER_CHANNEL}.xcarchive.zip") + set(VIEWER_APP_XCARCHIVE "${SYMBOLS_STAGING_DIR}.xcarchive.zip") # we only need an xcarchive with dSYMs (including the application) set_target_properties(${VIEWER_BINARY_NAME} PROPERTIES XCODE_ATTRIBUTE_DEBUG_INFORMATION_FORMAT "dwarf-with-dsym" - XCODE_ATTRIBUTE_DWARF_DSYM_FOLDER_PATH "${SYMBOLS_STAGING_DIR}/${product}/dSYMs") + XCODE_ATTRIBUTE_DWARF_DSYM_FOLDER_PATH "${SYMBOLS_STAGING_DIR}/dSYMs") add_custom_command(OUTPUT "${VIEWER_APP_XCARCHIVE}" COMMAND "zip" ARGS "-r" "${VIEWER_APP_XCARCHIVE}" - "${product}" - WORKING_DIRECTORY "${SYMBOLS_STAGING_DIR}" + "${VIEWER_CHANNEL}" + WORKING_DIRECTORY "${SYMBOLS_STAGING_DIR}/.." DEPENDS "${VIEWER_BINARY_NAME}" llwebrtc COMMENT "Generating ${VIEWER_APP_XCARCHIVE} for upload to BugSplat" ) -- cgit v1.2.3 From cdc83801c5377c1f7a2c677b6d2e52f1e5c6d366 Mon Sep 17 00:00:00 2001 From: Roxie Linden Date: Thu, 8 Aug 2024 10:32:40 -0700 Subject: bugsplat symbol-upload does not use vMAJOR tags --- .github/workflows/build.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index 3295e5b401..bfa7c5d921 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -390,7 +390,7 @@ jobs: tar -xJf "${{ needs.build.outputs.viewer_channel }}.sym.tar.xz" -C _artifacts - name: Post Windows symbols if: env.BUGSPLAT_USER && env.BUGSPLAT_PASS - uses: Bugsplat-Git/symbol-upload@v10 + uses: Bugsplat-Git/symbol-upload@v10.0.0 with: username: ${{ env.BUGSPLAT_USER }} password: ${{ env.BUGSPLAT_PASS }} -- cgit v1.2.3 From d46c444aee3fa1b3623d8d94151af1bfdae815b1 Mon Sep 17 00:00:00 2001 From: Roxie Linden Date: Thu, 8 Aug 2024 12:03:53 -0700 Subject: Use the secondlife-3p fork of symbol upload, which has vMAJOR tags --- .github/workflows/build.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index 3295e5b401..ebbb9dea88 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -390,7 +390,7 @@ jobs: tar -xJf "${{ needs.build.outputs.viewer_channel }}.sym.tar.xz" -C _artifacts - name: Post Windows symbols if: env.BUGSPLAT_USER && env.BUGSPLAT_PASS - uses: Bugsplat-Git/symbol-upload@v10 + uses: secondlife-3p/symbol-upload@v10 with: username: ${{ env.BUGSPLAT_USER }} password: ${{ env.BUGSPLAT_PASS }} @@ -414,7 +414,7 @@ jobs: name: macOS-symbols - name: Post Mac symbols if: env.BUGSPLAT_USER && env.BUGSPLAT_PASS - uses: Bugsplat-Git/symbol-upload@v9.1.1 + uses: secondlife-3p/symbol-upload@v10 with: username: ${{ env.BUGSPLAT_USER }} password: ${{ env.BUGSPLAT_PASS }} -- cgit v1.2.3 From f782f5f5345e68e0c579e5fe78be94f749723dee Mon Sep 17 00:00:00 2001 From: Ansariel Hiller Date: Thu, 8 Aug 2024 23:21:28 +0200 Subject: Fix copy&paste error in LLPanelFace (#2233) --- indra/newview/llpanelface.cpp | 10 +++++----- indra/newview/llpanelface.h | 5 ++--- 2 files changed, 7 insertions(+), 8 deletions(-) diff --git a/indra/newview/llpanelface.cpp b/indra/newview/llpanelface.cpp index 94674dc557..544b6fbc9c 100644 --- a/indra/newview/llpanelface.cpp +++ b/indra/newview/llpanelface.cpp @@ -1425,8 +1425,8 @@ void LLPanelFace::updateUI(bool force_set_values /*false*/) { mTexScaleV->setValue(diff_scale_t); } - mShinyScaleV->setValue(norm_scale_t); - mBumpyScaleV->setValue(spec_scale_t); + mShinyScaleV->setValue(spec_scale_t); + mBumpyScaleV->setValue(norm_scale_t); mTexScaleV->setTentative(LLSD(diff_scale_tentative)); mShinyScaleV->setTentative(LLSD(spec_scale_tentative)); @@ -2181,7 +2181,7 @@ void LLPanelFace::onMaterialOverrideReceived(const LLUUID& object_id, S32 side) ////////////////////////////////////////////////////////////////////////////// // -void LLPanelFace::navigateToTitleMedia( const std::string url ) +void LLPanelFace::navigateToTitleMedia(const std::string& url) { std::string multi_media_info_str = LLTrans::getString("Multiple Media"); if (url.empty() || multi_media_info_str == url) @@ -2193,9 +2193,9 @@ void LLPanelFace::navigateToTitleMedia( const std::string url ) { LLPluginClassMedia* media_plugin = mTitleMedia->getMediaPlugin(); // check if url changed or if we need a new media source - if (mTitleMedia->getCurrentNavUrl() != url || media_plugin == NULL) + if (mTitleMedia->getCurrentNavUrl() != url || media_plugin == nullptr) { - mTitleMedia->navigateTo( url ); + mTitleMedia->navigateTo(url); LLViewerMediaImpl* impl = LLViewerMedia::getInstance()->getMediaImplFromTextureID(mTitleMedia->getTextureID()); if (impl) diff --git a/indra/newview/llpanelface.h b/indra/newview/llpanelface.h index 1caca0cf64..dfd3201533 100644 --- a/indra/newview/llpanelface.h +++ b/indra/newview/llpanelface.h @@ -133,7 +133,7 @@ public: LLGLTFMaterial::TextureInfo getPBRDropChannel(); protected: - void navigateToTitleMedia(const std::string url); + void navigateToTitleMedia(const std::string& url); bool selectedMediaEditable(); void clearMediaSettings(); void updateMediaSettings(); @@ -226,7 +226,6 @@ protected: void onCommitMaterialGloss(); void onCommitMaterialEnv(); void onCommitMaterialMaskCutoff(); - void onCommitMaterialID(); void onCommitMaterialsMedia(); void onCommitMaterialType(); @@ -270,7 +269,7 @@ protected: static F32 valueGlow(LLViewerObject* object, S32 face); private: - bool isAlpha() { return mIsAlpha; } + bool isAlpha() const { return mIsAlpha; } // Convenience funcs to keep the visual flack to a minimum // -- cgit v1.2.3 From 4e0819b2dc2f062a68cc32d5b1ec22214fb1fd28 Mon Sep 17 00:00:00 2001 From: Andrey Kleshchev Date: Fri, 9 Aug 2024 09:09:00 +0300 Subject: viewer-private#259 Chat names get mixed up in voice calls Obsolete channel was uses as a participant provider --- indra/newview/llvoicevivox.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/indra/newview/llvoicevivox.cpp b/indra/newview/llvoicevivox.cpp index 6be6b1d4f2..cf27801065 100644 --- a/indra/newview/llvoicevivox.cpp +++ b/indra/newview/llvoicevivox.cpp @@ -5097,7 +5097,9 @@ void LLVivoxVoiceClient::processChannels(bool process) bool LLVivoxVoiceClient::isCurrentChannel(const LLSD &channelInfo) { - if (!mProcessChannels || (channelInfo.has("voice_server_type") && channelInfo["voice_server_type"].asString() != VIVOX_VOICE_SERVER_TYPE)) + if (!mProcessChannels + || (channelInfo.has("voice_server_type") && channelInfo["voice_server_type"].asString() != VIVOX_VOICE_SERVER_TYPE) + || mSessionTerminateRequested) { return false; } -- cgit v1.2.3 From a6131b5652124d40e782dd6bc653a9020061cf33 Mon Sep 17 00:00:00 2001 From: Alexander Gavriliuk Date: Thu, 8 Aug 2024 22:13:57 +0200 Subject: #2229 BugSplat Crash #1502471: SecondLifeViewer!LLPolySkeletalDistortion::apply(196) --- indra/llcharacter/llcharacter.h | 18 ++++++++++++++++++ indra/newview/llvoavatar.cpp | 23 ++++------------------- indra/newview/llvoavatar.h | 2 +- 3 files changed, 23 insertions(+), 20 deletions(-) diff --git a/indra/llcharacter/llcharacter.h b/indra/llcharacter/llcharacter.h index 6da28f0692..6143ec8cd1 100644 --- a/indra/llcharacter/llcharacter.h +++ b/indra/llcharacter/llcharacter.h @@ -245,6 +245,24 @@ public: S32 getVisualParamCount() const { return (S32)mVisualParamIndexMap.size(); } LLVisualParam* getVisualParam(const char *name); + void animateTweakableVisualParams(F32 delta) + { + for (auto& it : mVisualParamIndexMap) + { + if (it.second->isTweakable()) + { + it.second->animate(delta); + } + } + } + + void applyAllVisualParams(ESex avatar_sex) + { + for (auto& it : mVisualParamIndexMap) + { + it.second->apply(avatar_sex); + } + } ESex getSex() const { return mSex; } void setSex( ESex sex ) { mSex = sex; } diff --git a/indra/newview/llvoavatar.cpp b/indra/newview/llvoavatar.cpp index b3b8969faa..f813df3fb5 100644 --- a/indra/newview/llvoavatar.cpp +++ b/indra/newview/llvoavatar.cpp @@ -3081,30 +3081,15 @@ void LLVOAvatar::idleUpdateAppearanceAnimation() } else { - F32 morph_amt = calcMorphAmount(); - LLVisualParam *param; - if (!isSelf()) { + F32 morph_amt = calcMorphAmount(); // animate only top level params for non-self avatars - for (param = getFirstVisualParam(); - param; - param = getNextVisualParam()) - { - if (param->isTweakable()) - { - param->animate(morph_amt); - } - } + animateTweakableVisualParams(morph_amt); } // apply all params - for (param = getFirstVisualParam(); - param; - param = getNextVisualParam()) - { - param->apply(avatar_sex); - } + applyAllVisualParams(avatar_sex); mLastAppearanceBlendTime = appearance_anim_time; } @@ -3112,7 +3097,7 @@ void LLVOAvatar::idleUpdateAppearanceAnimation() } } -F32 LLVOAvatar::calcMorphAmount() +F32 LLVOAvatar::calcMorphAmount() const { F32 appearance_anim_time = mAppearanceMorphTimer.getElapsedTimeF32(); F32 blend_frac = calc_bouncy_animation(appearance_anim_time / APPEARANCE_MORPH_TIME); diff --git a/indra/newview/llvoavatar.h b/indra/newview/llvoavatar.h index 2144be1ba5..aa6aee0de5 100644 --- a/indra/newview/llvoavatar.h +++ b/indra/newview/llvoavatar.h @@ -422,7 +422,7 @@ protected: bool updateIsFullyLoaded(); bool processFullyLoadedChange(bool loading); void updateRuthTimer(bool loading); - F32 calcMorphAmount(); + F32 calcMorphAmount() const; private: bool mFirstFullyVisible; -- cgit v1.2.3 From 5a1ce7974b0c58d32c047a814fa94d4072a70de7 Mon Sep 17 00:00:00 2001 From: Alexander Gavriliuk Date: Fri, 9 Aug 2024 16:32:11 +0200 Subject: #2230 BugSplat Crash #1502376: SecondLifeViewer!LLPrimitive::isAvatar(606) --- indra/newview/lldrawable.cpp | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/indra/newview/lldrawable.cpp b/indra/newview/lldrawable.cpp index 60e7171004..3b531c41d9 100644 --- a/indra/newview/lldrawable.cpp +++ b/indra/newview/lldrawable.cpp @@ -1600,18 +1600,10 @@ void LLSpatialBridge::updateDistance(LLCamera& camera_in, bool force_update) mDrawable->updateDistance(camera, force_update); - LLViewerObject::const_child_list_t& child_list = mDrawable->getVObj()->getChildren(); - for (LLViewerObject::child_list_t::const_iterator iter = child_list.begin(); - iter != child_list.end(); iter++) + for (LLViewerObject* child : mDrawable->getVObj()->getChildren()) { - LLViewerObject* child = *iter; LLDrawable* drawable = child->mDrawable; - if (!drawable) - { - continue; - } - - if (!drawable->isAvatar()) + if (drawable && !drawable->isDead() && drawable->isAvatar()) { drawable->updateDistance(camera, force_update); } -- cgit v1.2.3 From ecfa05711ecf5e331c6b5eb6e404ecf940ad014e Mon Sep 17 00:00:00 2001 From: Alexander Gavriliuk Date: Fri, 9 Aug 2024 16:41:37 +0200 Subject: #2231 BugSplat Crash #1502347: SecondLifeViewer!LLViewerObject::getBoundingBoxAgent(5858) --- indra/newview/llviewerobject.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/indra/newview/llviewerobject.cpp b/indra/newview/llviewerobject.cpp index fd85d75d98..a2abd1d930 100644 --- a/indra/newview/llviewerobject.cpp +++ b/indra/newview/llviewerobject.cpp @@ -5753,7 +5753,8 @@ LLBBox LLViewerObject::getBoundingBoxAgent() const } if (avatar_parent && avatar_parent->isAvatar() && - root_edit && root_edit->mDrawable.notNull() && root_edit->mDrawable->getXform()->getParent()) + root_edit && root_edit->mDrawable.notNull() && !root_edit->mDrawable->isDead() && + root_edit->mDrawable->getXform()->getParent()) { LLXform* parent_xform = root_edit->mDrawable->getXform()->getParent(); position_agent = (getPositionEdit() * parent_xform->getWorldRotation()) + parent_xform->getWorldPosition(); -- cgit v1.2.3 From cf160e30236226fdd3343a7ba50d05265709718d Mon Sep 17 00:00:00 2001 From: Andrey Lihatskiy Date: Fri, 9 Aug 2024 20:12:57 +0300 Subject: Update dullahan to v1.14.0-r3 (#2243) --- autobuild.xml | 44 +++++++++++++++++++++++++++++--------------- 1 file changed, 29 insertions(+), 15 deletions(-) diff --git a/autobuild.xml b/autobuild.xml index ad986d47cb..61a9d85d1a 100644 --- a/autobuild.xml +++ b/autobuild.xml @@ -439,6 +439,16 @@ dullahan + copyright + Copyright (c) 2017, Linden Research, Inc. + description + A headless browser SDK that uses the Chromium Embedded Framework (CEF). It is designed to make it easier to write applications that render modern web content directly to a memory buffer, inject synthesized mouse and keyboard events as well as interact with web based features like JavaScript or cookies. + license + MPL + license_file + LICENSES/LICENSE.txt + name + dullahan platforms darwin64 @@ -446,42 +456,46 @@ archive hash - e4d568c166049ce61b39d69887b56d2382781a1a + 7fde76e3f0e62d0e0593b6157f4d740ecef2429d hash_algorithm sha1 url - https://github.com/secondlife/dullahan/releases/download/v118.0.5993.54/dullahan-1.14.0.202310131309_118.4.1_g3dd6078_chromium-118.0.5993.54-darwin64-6b02a60.tar.zst + https://github.com/secondlife/dullahan/releases/download/v1.14.0-r3/dullahan-1.14.0.202408091638_118.4.1_g3dd6078_chromium-118.0.5993.54-darwin64-10322607516.tar.zst name darwin64 + linux64 + + archive + + hash + 209d031ae67bc66d8e8f8509c71d259014c65ceb + hash_algorithm + sha1 + url + https://github.com/secondlife/dullahan/releases/download/v1.14.0-r3/dullahan-1.14.0.202408091637_118.4.1_g3dd6078_chromium-118.0.5993.54-linux64-10322607516.tar.zst + + name + linux64 + windows64 archive hash - a00eae7f5dc430ae48389ab723ced39739b0a144 + 4124c79d8b0e319877ffa4c12581d5c1318b4d93 hash_algorithm sha1 url - https://github.com/secondlife/dullahan/releases/download/v118.0.5993.54/dullahan-1.14.0.202310131404_118.4.1_g3dd6078_chromium-118.0.5993.54-windows64-6b02a60.tar.zst + https://github.com/secondlife/dullahan/releases/download/v1.14.0-r3/dullahan-1.14.0.202408091639_118.4.1_g3dd6078_chromium-118.0.5993.54-windows64-10322607516.tar.zst name windows64 - license - MPL - license_file - LICENSES/LICENSE.txt - copyright - Copyright (c) 2017, Linden Research, Inc. version - 1.14.0.202310131404_118.4.1_g3dd6078_chromium-118.0.5993.54 - name - dullahan - description - A headless browser SDK that uses the Chromium Embedded Framework (CEF). It is designed to make it easier to write applications that render modern web content directly to a memory buffer, inject synthesized mouse and keyboard events as well as interact with web based features like JavaScript or cookies. + 1.14.0.202408091639_118.4.1_g3dd6078_chromium-118.0.5993.54 emoji_shortcodes -- cgit v1.2.3 From 227b212dc67998098d09b7f15e852ed6cd7ac83a Mon Sep 17 00:00:00 2001 From: Roxie Linden Date: Fri, 9 Aug 2024 11:59:31 -0700 Subject: Teleport to a region with a different voice server type causes failure in voice When teleporting, the viewer 'hides' voice, effectively disabling it, until the teleport has completed. It does this by instructing the voice module to hide and then unhide. The problem was, it would instruct one voice module for one voice server type to hide, and then after teleport, it would instruct the other voice module for the other voice server type to unhide, resulting in one voice module being hidden. When the user transitions back to a region with the initial voice module, it's hidden, hence voice doesn't work. The solution is to hide/unhide both voice modules. --- indra/newview/llvoiceclient.cpp | 6 ++---- indra/newview/llvoicevivox.h | 3 ++- indra/newview/llvoicewebrtc.h | 3 +-- 3 files changed, 5 insertions(+), 7 deletions(-) diff --git a/indra/newview/llvoiceclient.cpp b/indra/newview/llvoiceclient.cpp index 495d521894..5132b9bb07 100644 --- a/indra/newview/llvoiceclient.cpp +++ b/indra/newview/llvoiceclient.cpp @@ -281,10 +281,8 @@ void LLVoiceClient::setNonSpatialVoiceModule(const std::string &voice_server_typ void LLVoiceClient::setHidden(bool hidden) { - if (mSpatialVoiceModule) - { - mSpatialVoiceModule->setHidden(hidden); - } + LLWebRTCVoiceClient::getInstance()->setHidden(hidden); + LLVivoxVoiceClient::getInstance()->setHidden(hidden); } void LLVoiceClient::terminate() diff --git a/indra/newview/llvoicevivox.h b/indra/newview/llvoicevivox.h index 64c2c87db6..f3e24df281 100644 --- a/indra/newview/llvoicevivox.h +++ b/indra/newview/llvoicevivox.h @@ -89,6 +89,8 @@ public: // Returns true if vivox has successfully logged in and is not in error state bool isVoiceWorking() const override; + void setHidden(bool hidden) override; // virtual + ///////////////////// /// @name Tuning //@{ @@ -760,7 +762,6 @@ private: LLSD getAudioSessionChannelInfo(); std::string getAudioSessionHandle(); - void setHidden(bool hidden) override; //virtual void sendPositionAndVolumeUpdate(void); void sendCaptureAndRenderDevices(); diff --git a/indra/newview/llvoicewebrtc.h b/indra/newview/llvoicewebrtc.h index f4ea329cb6..f699bd6df9 100644 --- a/indra/newview/llvoicewebrtc.h +++ b/indra/newview/llvoicewebrtc.h @@ -88,6 +88,7 @@ public: std::string sipURIFromID(const LLUUID &id) const override; LLSD getP2PChannelInfoTemplate(const LLUUID& id) const override; + void setHidden(bool hidden) override; // virtual /////////////////// /// @name Logging @@ -480,8 +481,6 @@ private: LLSD getAudioSessionChannelInfo(); - void setHidden(bool hidden) override; //virtual - void enforceTether(); void updateNeighboringRegions(); -- cgit v1.2.3 From 848d0cb27d4d37078c2f2d52bcb142a215d5cd26 Mon Sep 17 00:00:00 2001 From: Andrey Kleshchev Date: Thu, 1 Aug 2024 12:40:10 +0300 Subject: viewer#2163 Crash at getReflectionProbeIsDynamic --- indra/newview/llreflectionmap.cpp | 4 ++-- indra/newview/llviewerobject.h | 4 ++++ indra/newview/llvovolume.h | 8 ++++---- 3 files changed, 10 insertions(+), 6 deletions(-) diff --git a/indra/newview/llreflectionmap.cpp b/indra/newview/llreflectionmap.cpp index 31fd6f3f07..8d164b6883 100644 --- a/indra/newview/llreflectionmap.cpp +++ b/indra/newview/llreflectionmap.cpp @@ -220,7 +220,7 @@ F32 LLReflectionMap::getNearClip() if (mViewerObject && mViewerObject->getVolume()) { - ret = ((LLVOVolume*)mViewerObject)->getReflectionProbeNearClip(); + ret = mViewerObject->getReflectionProbeNearClip(); } else if (mGroup) { @@ -240,7 +240,7 @@ bool LLReflectionMap::getIsDynamic() mViewerObject && mViewerObject->getVolume()) { - return ((LLVOVolume*)mViewerObject)->getReflectionProbeIsDynamic(); + return mViewerObject->getReflectionProbeIsDynamic(); } return false; diff --git a/indra/newview/llviewerobject.h b/indra/newview/llviewerobject.h index 09584d22a8..b6846c6716 100644 --- a/indra/newview/llviewerobject.h +++ b/indra/newview/llviewerobject.h @@ -266,7 +266,11 @@ public: virtual bool isRiggedMesh() const { return false; } virtual bool hasLightTexture() const { return false; } virtual bool isReflectionProbe() const { return false; } + virtual F32 getReflectionProbeAmbiance() const { return 0.f; } + virtual F32 getReflectionProbeNearClip() const { return 0.f; } virtual bool getReflectionProbeIsBox() const { return false; } + virtual bool getReflectionProbeIsDynamic() const { return false; }; + virtual bool getReflectionProbeIsMirror() const { return false; }; // This method returns true if the object is over land owned by // the agent, one of its groups, or it encroaches and diff --git a/indra/newview/llvovolume.h b/indra/newview/llvovolume.h index 07e02e042c..6241bf42d6 100644 --- a/indra/newview/llvovolume.h +++ b/indra/newview/llvovolume.h @@ -304,11 +304,11 @@ public: bool setReflectionProbeIsMirror(bool is_mirror); bool isReflectionProbe() const override; - F32 getReflectionProbeAmbiance() const; - F32 getReflectionProbeNearClip() const; + F32 getReflectionProbeAmbiance() const override; + F32 getReflectionProbeNearClip() const override; bool getReflectionProbeIsBox() const override; - bool getReflectionProbeIsDynamic() const; - bool getReflectionProbeIsMirror() const; + bool getReflectionProbeIsDynamic() const override; + bool getReflectionProbeIsMirror() const override; // Flexible Objects U32 getVolumeInterfaceID() const; -- cgit v1.2.3 From 048340ec1f2fd82a0fc877383d1476ec7c3c7a00 Mon Sep 17 00:00:00 2001 From: Andrey Kleshchev Date: Mon, 29 Jul 2024 21:19:57 +0300 Subject: viewer#2142 Crash at LLOutfitGalleryItem::setDefaultImage --- indra/newview/llinventorygallery.cpp | 104 ++++++++++++++++++++--------------- indra/newview/llinventorygallery.h | 1 + indra/newview/lloutfitgallery.cpp | 44 ++++++++++++--- indra/newview/lloutfitgallery.h | 3 +- 4 files changed, 101 insertions(+), 51 deletions(-) diff --git a/indra/newview/llinventorygallery.cpp b/indra/newview/llinventorygallery.cpp index c69f797868..b99dbd9eb7 100644 --- a/indra/newview/llinventorygallery.cpp +++ b/indra/newview/llinventorygallery.cpp @@ -221,9 +221,10 @@ void LLInventoryGallery::setRootFolder(const LLUUID cat_id) for (const LLUUID& id : mSelectedItemIDs) { - if (mItemMap[id]) + LLInventoryGalleryItem* item = getItem(id); + if (item) { - mItemMap[id]->setSelected(false); + item->setSelected(false); } } @@ -348,7 +349,7 @@ void LLInventoryGallery::initGallery() mScrollPanel->addChild(mGalleryPanel); for (int i = 0; i < n; i++) { - addToGallery(mItemMap[cats[i]]); + addToGallery(getItem(cats[i])); } reArrangeRows(); mGalleryCreated = true; @@ -656,6 +657,16 @@ LLInventoryGalleryItem* LLInventoryGallery::buildGalleryItem(std::string name, L return gitem; } +LLInventoryGalleryItem* LLInventoryGallery::getItem(const LLUUID& id) const +{ + auto it = mItemMap.find(id); + if (it != mItemMap.end()) + { + return it->second; + } + return nullptr; +} + void LLInventoryGallery::buildGalleryPanel(int row_count) { LLPanel::Params params; @@ -1006,14 +1017,15 @@ void LLInventoryGallery::updateItemThumbnail(LLUUID item_id) thumbnail_id = getOutfitImageID(item_id); } - if (mItemMap[item_id]) + LLInventoryGalleryItem* item = getItem(item_id); + if (item) { - mItemMap[item_id]->setLoadImmediately(mLoadThumbnailsImmediately); - mItemMap[item_id]->setThumbnail(thumbnail_id); + item->setLoadImmediately(mLoadThumbnailsImmediately); + item->setThumbnail(thumbnail_id); - bool passes_filter = checkAgainstFilters(mItemMap[item_id], mFilterSubString); - if((mItemMap[item_id]->isHidden() && passes_filter) - || (!mItemMap[item_id]->isHidden() && !passes_filter)) + bool passes_filter = checkAgainstFilters(item, mFilterSubString); + if((item->isHidden() && passes_filter) + || (!item->isHidden() && !passes_filter)) { reArrangeRows(); } @@ -1169,7 +1181,7 @@ void LLInventoryGallery::moveUp(MASK mask) if (mInventoryGalleryMenu && mSelectedItemIDs.size() > 0 && mItemsAddedCount > 1) { - LLInventoryGalleryItem* item = mItemMap[mLastInteractedUUID]; + LLInventoryGalleryItem* item = getItem(mLastInteractedUUID); if (item) { if (mask == MASK_NONE || mask == MASK_CONTROL) @@ -1214,7 +1226,7 @@ void LLInventoryGallery::moveDown(MASK mask) if (mInventoryGalleryMenu && mSelectedItemIDs.size() > 0 && mItemsAddedCount > 1) { - LLInventoryGalleryItem* item = mItemMap[mLastInteractedUUID]; + LLInventoryGalleryItem* item = getItem(mLastInteractedUUID); if (item) { if (mask == MASK_NONE || mask == MASK_CONTROL) @@ -1259,11 +1271,7 @@ void LLInventoryGallery::moveLeft(MASK mask) if (mInventoryGalleryMenu && mSelectedItemIDs.size() > 0 && mItemsAddedCount > 1) { - LLInventoryGalleryItem* item = mItemMap[mLastInteractedUUID]; - if (mask == MASK_SHIFT) - { - item = mItemMap[mLastInteractedUUID]; - } + LLInventoryGalleryItem* item = getItem(mLastInteractedUUID); if (item) { // Might be better to get item from panel @@ -1307,7 +1315,7 @@ void LLInventoryGallery::moveRight(MASK mask) if (mInventoryGalleryMenu && mSelectedItemIDs.size() > 0 && mItemsAddedCount > 1) { - LLInventoryGalleryItem* item = mItemMap[mLastInteractedUUID]; + LLInventoryGalleryItem* item = getItem(mLastInteractedUUID); if (item) { S32 n = mItemIndexMap[item]; @@ -1373,8 +1381,8 @@ void LLInventoryGallery::toggleSelectionRangeFromLast(const LLUUID target) { return; } - LLInventoryGalleryItem* last_item = mItemMap[mLastInteractedUUID]; - LLInventoryGalleryItem* next_item = mItemMap[target]; + LLInventoryGalleryItem* last_item = getItem(mLastInteractedUUID); + LLInventoryGalleryItem* next_item = getItem(target); if (last_item && next_item) { S32 last_idx = mItemIndexMap[last_item]; @@ -1417,9 +1425,10 @@ void LLInventoryGallery::onFocusLost() for (const LLUUID& id : mSelectedItemIDs) { - if (mItemMap[id]) + LLInventoryGalleryItem* item = getItem(id); + if (item) { - mItemMap[id]->setSelected(false); + item->setSelected(false); } } } @@ -1435,9 +1444,10 @@ void LLInventoryGallery::onFocusReceived() LLInventoryGalleryItem* focus_item = NULL; for (const LLUUID& id : mSelectedItemIDs) { - if (mItemMap[id] && !mItemMap[id]->isHidden()) + LLInventoryGalleryItem* item = getItem(id); + if (item && !item->isHidden()) { - focus_item = mItemMap[id]; + focus_item = item; focus_item->setSelected(true); } } @@ -1478,9 +1488,10 @@ void LLInventoryGallery::changeItemSelection(const LLUUID& item_id, bool scroll_ { for (const LLUUID& id : mSelectedItemIDs) { - if (mItemMap[id]) + LLInventoryGalleryItem* item = getItem(id); + if (item) { - mItemMap[id]->setSelected(false); + item->setSelected(false); } } mSelectedItemIDs.clear(); @@ -1499,9 +1510,10 @@ void LLInventoryGallery::changeItemSelection(const LLUUID& item_id, bool scroll_ return; } - if (mItemMap[item_id]) + LLInventoryGalleryItem* item = getItem(item_id); + if (item) { - mItemMap[item_id]->setSelected(true); + item->setSelected(true); } mSelectedItemIDs.push_back(item_id); signalSelectionItemID(item_id); @@ -1527,9 +1539,10 @@ void LLInventoryGallery::addItemSelection(const LLUUID& item_id, bool scroll_to_ return; } - if (mItemMap[item_id]) + LLInventoryGalleryItem* item = getItem(item_id); + if (item) { - mItemMap[item_id]->setSelected(true); + item->setSelected(true); } mSelectedItemIDs.push_back(item_id); signalSelectionItemID(item_id); @@ -1552,18 +1565,20 @@ bool LLInventoryGallery::toggleItemSelection(const LLUUID& item_id, bool scroll_ selection_deque::iterator found = std::find(mSelectedItemIDs.begin(), mSelectedItemIDs.end(), item_id); if (found != mSelectedItemIDs.end()) { - if (mItemMap[item_id]) + LLInventoryGalleryItem* item = getItem(item_id); + if (item) { - mItemMap[item_id]->setSelected(false); + item->setSelected(false); } mSelectedItemIDs.erase(found); result = false; } else { - if (mItemMap[item_id]) + LLInventoryGalleryItem* item = getItem(item_id); + if (item) { - mItemMap[item_id]->setSelected(true); + item->setSelected(true); } mSelectedItemIDs.push_back(item_id); signalSelectionItemID(item_id); @@ -1580,7 +1595,7 @@ bool LLInventoryGallery::toggleItemSelection(const LLUUID& item_id, bool scroll_ void LLInventoryGallery::scrollToShowItem(const LLUUID& item_id) { - LLInventoryGalleryItem* item = mItemMap[item_id]; + LLInventoryGalleryItem* item = getItem(item_id); if(item) { const LLRect visible_content_rect = mScrollPanel->getVisibleContentRect(); @@ -1610,7 +1625,7 @@ LLInventoryGalleryItem* LLInventoryGallery::getFirstSelectedItem() if (mSelectedItemIDs.size() > 0) { selection_deque::iterator iter = mSelectedItemIDs.begin(); - return mItemMap[*iter]; + return getItem(*iter); } return NULL; } @@ -1768,9 +1783,10 @@ void LLInventoryGallery::paste() { for (const LLUUID& id : mSelectedItemIDs) { - if (mItemMap[id]) + LLInventoryGalleryItem* item = getItem(id); + if (item) { - mItemMap[id]->setSelected(false); + item->setSelected(false); } } mSelectedItemIDs.clear(); @@ -2108,9 +2124,10 @@ void LLInventoryGallery::pasteAsLink() { for (const LLUUID& id : mSelectedItemIDs) { - if (mItemMap[id]) + LLInventoryGalleryItem* item = getItem(id); + if (item) { - mItemMap[id]->setSelected(false); + item->setSelected(false); } } mSelectedItemIDs.clear(); @@ -2433,10 +2450,10 @@ void LLInventoryGallery::onGesturesChanged() void LLInventoryGallery::deselectItem(const LLUUID& category_id) { // Reset selection if the item is selected. - LLInventoryGalleryItem* item = mItemMap[category_id]; + LLInventoryGalleryItem* item = getItem(category_id); if (item && item->isSelected()) { - mItemMap[category_id]->setSelected(false); + item->setSelected(false); setFocus(true); // Todo: support multiselect // signalSelectionItemID(LLUUID::null); @@ -2453,9 +2470,10 @@ void LLInventoryGallery::clearSelection() { for (const LLUUID& id: mSelectedItemIDs) { - if (mItemMap[id]) + LLInventoryGalleryItem* item = getItem(id); + if (item) { - mItemMap[id]->setSelected(false); + item->setSelected(false); } } if (!mSelectedItemIDs.empty()) diff --git a/indra/newview/llinventorygallery.h b/indra/newview/llinventorygallery.h index afc7bdc9f8..59d08d19ed 100644 --- a/indra/newview/llinventorygallery.h +++ b/indra/newview/llinventorygallery.h @@ -228,6 +228,7 @@ private: void updateGalleryWidth(); LLInventoryGalleryItem* buildGalleryItem(std::string name, LLUUID item_id, LLAssetType::EType type, LLUUID thumbnail_id, LLInventoryType::EType inventory_type, U32 flags, time_t creation_date, bool is_link, bool is_worn); + LLInventoryGalleryItem* getItem(const LLUUID& id) const; void buildGalleryPanel(int row_count); void reshapeGalleryPanel(int row_count); diff --git a/indra/newview/lloutfitgallery.cpp b/indra/newview/lloutfitgallery.cpp index 96be917019..22420e8896 100644 --- a/indra/newview/lloutfitgallery.cpp +++ b/indra/newview/lloutfitgallery.cpp @@ -128,7 +128,7 @@ void LLOutfitGallery::onOpen(const LLSD& info) mScrollPanel->addChild(mGalleryPanel); for (int i = 0; i < n; i++) { - addToGallery(mOutfitMap[cats[i]]); + addToGallery(getItem(cats[i])); } reArrangeRows(); mGalleryCreated = true; @@ -377,7 +377,7 @@ void LLOutfitGallery::onOutfitsRemovalConfirmation(const LLSD& notification, con void LLOutfitGallery::scrollToShowItem(const LLUUID& item_id) { - LLOutfitGalleryItem* item = mOutfitMap[item_id]; + LLOutfitGalleryItem* item = getItem(item_id); if (item) { const LLRect visible_content_rect = mScrollPanel->getVisibleContentRect(); @@ -524,6 +524,10 @@ LLPanel* LLOutfitGallery::addToRow(LLPanel* row_stack, LLOutfitGalleryItem* item void LLOutfitGallery::addToGallery(LLOutfitGalleryItem* item) { + if (!item) + { + return; + } if(item->isHidden()) { mHiddenItems.push_back(item); @@ -631,9 +635,19 @@ LLOutfitGalleryItem* LLOutfitGallery::buildGalleryItem(std::string name, LLUUID return gitem; } -LLOutfitGalleryItem* LLOutfitGallery::getSelectedItem() +LLOutfitGalleryItem* LLOutfitGallery::getSelectedItem() const +{ + return getItem(mSelectedOutfitUUID); +} + +LLOutfitGalleryItem* LLOutfitGallery::getItem(const LLUUID& id) const { - return mOutfitMap[mSelectedOutfitUUID]; + auto it = mOutfitMap.find(id); + if (it != mOutfitMap.end()) + { + return it->second; + } + return nullptr; } void LLOutfitGallery::buildGalleryPanel(int row_count) @@ -1264,7 +1278,15 @@ void LLOutfitGallery::refreshOutfit(const LLUUID& category_id) } if (asset_id.notNull()) { - photo_loaded |= mOutfitMap[category_id]->setImageAssetId(asset_id); + LLOutfitGalleryItem* item = getItem(category_id); + if (item) + { + photo_loaded |= item->setImageAssetId(asset_id); + } + else + { + photo_loaded = true; + } // Rename links if (!mOutfitRenamePending.isNull() && mOutfitRenamePending.asString() == item_name) { @@ -1290,13 +1312,21 @@ void LLOutfitGallery::refreshOutfit(const LLUUID& category_id) } if (!photo_loaded) { - mOutfitMap[category_id]->setDefaultImage(); + LLOutfitGalleryItem* item = getItem(category_id); + if (item) + { + item->setDefaultImage(); + } } } } else { - mOutfitMap[category_id]->setImageAssetId(asset_id); + LLOutfitGalleryItem* item = getItem(category_id); + if (item) + { + item->setImageAssetId(asset_id); + } } } diff --git a/indra/newview/lloutfitgallery.h b/indra/newview/lloutfitgallery.h index d921a7fe72..819d09dcf5 100644 --- a/indra/newview/lloutfitgallery.h +++ b/indra/newview/lloutfitgallery.h @@ -135,7 +135,8 @@ private: void updateGalleryWidth(); LLOutfitGalleryItem* buildGalleryItem(std::string name, LLUUID outfit_id); - LLOutfitGalleryItem* getSelectedItem(); + LLOutfitGalleryItem* getSelectedItem() const; + LLOutfitGalleryItem* getItem(const LLUUID& id) const; void onTextureSelectionChanged(LLInventoryItem* itemp); -- cgit v1.2.3 From b01b53b2fea478476e67252ff5a276f943f9ae47 Mon Sep 17 00:00:00 2001 From: Alexander Gavriliuk Date: Wed, 24 Jul 2024 20:21:11 +0200 Subject: #2103 BugSplat Crash #1497033: LLViewerTextureList::getImage --- indra/newview/llvovolume.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/indra/newview/llvovolume.cpp b/indra/newview/llvovolume.cpp index 71f3c2a3aa..2f03531f1d 100644 --- a/indra/newview/llvovolume.cpp +++ b/indra/newview/llvovolume.cpp @@ -5642,7 +5642,8 @@ void LLVolumeGeometryManager::rebuildGeom(LLSpatialGroup* group) } // HACK -- brute force this check every time a drawable gets rebuilt - for (S32 i = 0; i < drawablep->getNumFaces(); ++i) + S32 num_tex = llmin(vobj->getNumTEs(), drawablep->getNumFaces()); + for (S32 i = 0; i < num_tex; ++i) { vobj->updateTEMaterialTextures(i); } -- cgit v1.2.3 From cd188352700fd4d3b686c25f2307f4bd9179132f Mon Sep 17 00:00:00 2001 From: Rye Mutt Date: Mon, 22 Jul 2024 11:02:31 -0400 Subject: Fix nullptr crash in LLFloaterIMContainer::onAddButtonClicked --- indra/newview/llfloaterimcontainer.cpp | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/indra/newview/llfloaterimcontainer.cpp b/indra/newview/llfloaterimcontainer.cpp index add389748f..08e13276b3 100644 --- a/indra/newview/llfloaterimcontainer.cpp +++ b/indra/newview/llfloaterimcontainer.cpp @@ -988,11 +988,14 @@ void LLFloaterIMContainer::onAddButtonClicked() { LLView * button = findChild("conversations_pane_buttons_expanded")->findChild("add_btn"); LLFloater* root_floater = gFloaterView->getParentFloater(this); - LLFloaterAvatarPicker* picker = LLFloaterAvatarPicker::show(boost::bind(&LLFloaterIMContainer::onAvatarPicked, this, _1), true, true, true, root_floater->getName(), button); - - if (picker && root_floater) + if (button && root_floater) { - root_floater->addDependentFloater(picker); + LLFloaterAvatarPicker* picker = LLFloaterAvatarPicker::show(boost::bind(&LLFloaterIMContainer::onAvatarPicked, this, _1), true, true, true, root_floater->getName(), button); + + if (picker) + { + root_floater->addDependentFloater(picker); + } } } -- cgit v1.2.3 From ac75cd98fc526f2f2945093b611ee6e321ceecfa Mon Sep 17 00:00:00 2001 From: Rye Mutt Date: Mon, 22 Jul 2024 11:02:09 -0400 Subject: Fix null region pointer crash in LLIMView --- indra/newview/llimview.cpp | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/indra/newview/llimview.cpp b/indra/newview/llimview.cpp index 05b1fec8e5..8a428c45d0 100644 --- a/indra/newview/llimview.cpp +++ b/indra/newview/llimview.cpp @@ -3040,13 +3040,16 @@ void LLIncomingCallDialog::processCallResponse(S32 response, const LLSD &payload gIMMgr->addSession(correct_session_name, type, session_id, payload["voice_channel_info"]); - std::string url = gAgent.getRegion()->getCapability( + std::string url = gAgent.getRegionCapability( "ChatSessionRequest"); if (voice) { - LLCoros::instance().launch("chatterBoxInvitationCoro", - boost::bind(&chatterBoxInvitationCoro, url, session_id, inv_type, payload["voice_channel_info"])); + if(!url.empty()) + { + LLCoros::instance().launch("chatterBoxInvitationCoro", + boost::bind(&chatterBoxInvitationCoro, url, session_id, inv_type, payload["voice_channel_info"])); + } // send notification message to the corresponding chat if (payload["notify_box_type"].asString() == "VoiceInviteGroup" || payload["notify_box_type"].asString() == "VoiceInviteAdHoc") @@ -4061,9 +4064,12 @@ public: // Send request for chat history, if enabled. if (gSavedPerAccountSettings.getBOOL("FetchGroupChatHistory")) { - std::string url = gAgent.getRegion()->getCapability("ChatSessionRequest"); - LLCoros::instance().launch("chatterBoxHistoryCoro", - boost::bind(&chatterBoxHistoryCoro, url, session_id, "", "", 0)); + std::string url = gAgent.getRegionCapability("ChatSessionRequest"); + if (!url.empty()) + { + LLCoros::instance().launch("chatterBoxHistoryCoro", + boost::bind(&chatterBoxHistoryCoro, url, session_id, "", "", 0)); + } } } } -- cgit v1.2.3 From 68316fd0fd776d80934548fbadd90da4d88f954a Mon Sep 17 00:00:00 2001 From: Rye Mutt Date: Mon, 22 Jul 2024 11:01:24 -0400 Subject: Fix nullptr crash in LLInvFVBridge::getClipboardEntries --- indra/newview/llinventorybridge.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/indra/newview/llinventorybridge.cpp b/indra/newview/llinventorybridge.cpp index 81d738cf42..33d0ac891d 100644 --- a/indra/newview/llinventorybridge.cpp +++ b/indra/newview/llinventorybridge.cpp @@ -961,7 +961,7 @@ void LLInvFVBridge::getClipboardEntries(bool show_asset_id, } } - if (obj->getType() != LLAssetType::AT_CATEGORY) + if (obj && obj->getType() != LLAssetType::AT_CATEGORY) { items.push_back(std::string("Paste Separator")); } -- cgit v1.2.3 From 8de48c426049a4af7f4635fd09ed5976a9087f5e Mon Sep 17 00:00:00 2001 From: Rye Mutt Date: Mon, 22 Jul 2024 11:00:58 -0400 Subject: Fix nullptr crash in LLLandmarksPanel::canItemBeModified --- indra/newview/llpanellandmarks.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/indra/newview/llpanellandmarks.cpp b/indra/newview/llpanellandmarks.cpp index 99133d1fb3..25631f1e04 100644 --- a/indra/newview/llpanellandmarks.cpp +++ b/indra/newview/llpanellandmarks.cpp @@ -959,12 +959,12 @@ bool LLLandmarksPanel::canItemBeModified(const std::string& command_name, LLFold // then ask LLFolderView permissions - LLFolderView* root_folder = mCurrentSelectedList->getRootFolder(); + LLFolderView* root_folder = mCurrentSelectedList ? mCurrentSelectedList->getRootFolder() : nullptr; if ("copy" == command_name) { // we shouldn't be able to copy folders from My Inventory Panel - return can_be_modified && root_folder->canCopy(); + return can_be_modified && root_folder && root_folder->canCopy(); } else if ("collapse" == command_name) { @@ -981,7 +981,7 @@ bool LLLandmarksPanel::canItemBeModified(const std::string& command_name, LLFold if ("cut" == command_name) { - can_be_modified = root_folder->canCut(); + can_be_modified = root_folder && root_folder->canCut(); } else if ("rename" == command_name) { @@ -993,7 +993,7 @@ bool LLLandmarksPanel::canItemBeModified(const std::string& command_name, LLFold } else if("paste" == command_name) { - can_be_modified = root_folder->canPaste(); + can_be_modified = root_folder && root_folder->canPaste(); } else { -- cgit v1.2.3 From cc77728ad76e3d9a7df66b159431fd62f39f0ecc Mon Sep 17 00:00:00 2001 From: Rye Mutt Date: Mon, 22 Jul 2024 11:00:37 -0400 Subject: Fix nullptr crash in LLLandmarksPanel::isActionEnabled --- indra/newview/llpanellandmarks.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/indra/newview/llpanellandmarks.cpp b/indra/newview/llpanellandmarks.cpp index 25631f1e04..fb7ccbfe4c 100644 --- a/indra/newview/llpanellandmarks.cpp +++ b/indra/newview/llpanellandmarks.cpp @@ -647,10 +647,18 @@ bool LLLandmarksPanel::isActionEnabled(const LLSD& userdata) const if ("collapse_all" == command_name) { + if (!mCurrentSelectedList) + { + return false; + } return has_expanded_folders(mCurrentSelectedList->getRootFolder()); } else if ("expand_all" == command_name) { + if (!mCurrentSelectedList) + { + return false; + } return has_collapsed_folders(mCurrentSelectedList->getRootFolder()); } else if ("sort_by_date" == command_name) -- cgit v1.2.3 From 9e379a5578f56dca05b303707e150c2de04c0c43 Mon Sep 17 00:00:00 2001 From: Rye Mutt Date: Mon, 22 Jul 2024 10:59:59 -0400 Subject: Fix nullptr crash in LLInventoryPanel::itemChanged --- indra/newview/llinventorypanel.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/indra/newview/llinventorypanel.cpp b/indra/newview/llinventorypanel.cpp index 9dc13bcf09..442da455ef 100644 --- a/indra/newview/llinventorypanel.cpp +++ b/indra/newview/llinventorypanel.cpp @@ -643,7 +643,7 @@ void LLInventoryPanel::itemChanged(const LLUUID& item_id, U32 mask, const LLInve } // Select any newly created object that has the auto rename at top of folder root set. - if(mFolderRoot.get()->getRoot()->needsAutoRename()) + if(mFolderRoot.get() && mFolderRoot.get()->getRoot()->needsAutoRename()) { setSelection(item_id, false); } -- cgit v1.2.3 From 04fdc4f2c098dc8a5a87ffa6b85652cc8c8dad1b Mon Sep 17 00:00:00 2001 From: Rye Mutt Date: Mon, 22 Jul 2024 10:59:35 -0400 Subject: Fix nullptr crash in handleVSyncChanged --- indra/newview/llviewercontrol.cpp | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/indra/newview/llviewercontrol.cpp b/indra/newview/llviewercontrol.cpp index cd6e780aa8..862bb3dfa9 100644 --- a/indra/newview/llviewercontrol.cpp +++ b/indra/newview/llviewercontrol.cpp @@ -263,12 +263,15 @@ static bool handleAnisotropicChanged(const LLSD& newvalue) static bool handleVSyncChanged(const LLSD& newvalue) { LLPerfStats::tunables.vsyncEnabled = newvalue.asBoolean(); - gViewerWindow->getWindow()->toggleVSync(newvalue.asBoolean()); - - if (newvalue.asBoolean()) + if (gViewerWindow && gViewerWindow->getWindow()) { - U32 current_target = gSavedSettings.getU32("TargetFPS"); - gSavedSettings.setU32("TargetFPS", std::min((U32)gViewerWindow->getWindow()->getRefreshRate(), current_target)); + gViewerWindow->getWindow()->toggleVSync(newvalue.asBoolean()); + + if (newvalue.asBoolean()) + { + U32 current_target = gSavedSettings.getU32("TargetFPS"); + gSavedSettings.setU32("TargetFPS", std::min((U32)gViewerWindow->getWindow()->getRefreshRate(), current_target)); + } } return true; -- cgit v1.2.3 From 983e7772b45e061f283d3c37418bf5d2961336db Mon Sep 17 00:00:00 2001 From: Rye Mutt Date: Mon, 22 Jul 2024 10:59:07 -0400 Subject: Fix crash in LLViewerWindow::handleDragNDrop --- indra/newview/llviewerwindow.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/indra/newview/llviewerwindow.cpp b/indra/newview/llviewerwindow.cpp index cfa12bf178..48439765e4 100644 --- a/indra/newview/llviewerwindow.cpp +++ b/indra/newview/llviewerwindow.cpp @@ -1271,7 +1271,7 @@ LLWindowCallbacks::DragNDropResult LLViewerWindow::handleDragNDrop( LLWindow *wi LLTextureEntry *te = obj->getTE(object_face); // can modify URL if we can modify the object or we have navigate permissions - bool allow_modify_url = obj->permModify() || obj->hasMediaPermission( te->getMediaData(), LLVOVolume::MEDIA_PERM_INTERACT ); + bool allow_modify_url = obj->permModify() || (te && obj->hasMediaPermission( te->getMediaData(), LLVOVolume::MEDIA_PERM_INTERACT )); if (te && allow_modify_url ) { -- cgit v1.2.3 From fe76026a3fea79522083864019026e6bf01777df Mon Sep 17 00:00:00 2001 From: Rye Mutt Date: Mon, 22 Jul 2024 10:58:33 -0400 Subject: Fix nullptr crash in LLScrollListCtrl::getSelectedItemLabel --- indra/llui/llscrolllistctrl.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/indra/llui/llscrolllistctrl.cpp b/indra/llui/llscrolllistctrl.cpp index 74a9641836..1d9564d107 100644 --- a/indra/llui/llscrolllistctrl.cpp +++ b/indra/llui/llscrolllistctrl.cpp @@ -1479,7 +1479,11 @@ const std::string LLScrollListCtrl::getSelectedItemLabel(S32 column) const item = getFirstSelected(); if (item) { - return item->getColumn(column)->getValue().asString(); + auto col = item->getColumn(column); + if(col) + { + return col->getValue().asString(); + } } return LLStringUtil::null; -- cgit v1.2.3 From 9e4185bf75edbbf313735be56b1aaefcf0d31299 Mon Sep 17 00:00:00 2001 From: Rye Mutt Date: Sun, 21 Jul 2024 20:10:21 -0400 Subject: Fix rare shutdown crash in gCacheName --- indra/llmessage/llcachename.cpp | 33 ++++++++++++++++----------------- indra/llmessage/llcachename.h | 7 ++++--- indra/newview/llfloateravatarpicker.cpp | 2 +- indra/newview/llinventorybridge.cpp | 2 +- 4 files changed, 22 insertions(+), 22 deletions(-) diff --git a/indra/llmessage/llcachename.cpp b/indra/llmessage/llcachename.cpp index 63ac46722a..64f660d0ce 100644 --- a/indra/llmessage/llcachename.cpp +++ b/indra/llmessage/llcachename.cpp @@ -53,7 +53,6 @@ const U32 PENDING_TIMEOUT_SECS = 5 * 60; // Globals LLCacheName* gCacheName = NULL; -std::map LLCacheName::sCacheName; /// --------------------------------------------------------------------------- /// class LLCacheNameEntry @@ -215,7 +214,7 @@ public: Impl(LLMessageSystem* msg); ~Impl(); - bool getName(const LLUUID& id, std::string& first, std::string& last); + bool getName(const LLUUID& id, std::string& first, std::string& last, std::map& default_names); boost::signals2::connection addPending(const LLUUID& id, const LLCacheNameCallback& callback); void addPending(const LLUUID& id, const LLHost& host); @@ -247,9 +246,9 @@ LLCacheName::LLCacheName(LLMessageSystem* msg) LLCacheName::LLCacheName(LLMessageSystem* msg, const LLHost& upstream_host) : impl(* new Impl(msg)) { - sCacheName["waiting"] = "(Loading...)"; - sCacheName["nobody"] = "(nobody)"; - sCacheName["none"] = "(none)"; + mCacheName["waiting"] = "(Loading...)"; + mCacheName["nobody"] = "(nobody)"; + mCacheName["none"] = "(none)"; setUpstream(upstream_host); } @@ -274,7 +273,7 @@ LLCacheName::Impl::Impl(LLMessageSystem* msg) LLCacheName::Impl::~Impl() { - for_each(mCache.begin(), mCache.end(), DeletePairedPointer()); + std::for_each(mCache.begin(), mCache.end(), DeletePairedPointer()); mCache.clear(); for_each(mReplyQueue.begin(), mReplyQueue.end(), DeletePointer()); mReplyQueue.clear(); @@ -402,11 +401,11 @@ void LLCacheName::exportFile(std::ostream& ostr) } -bool LLCacheName::Impl::getName(const LLUUID& id, std::string& first, std::string& last) +bool LLCacheName::Impl::getName(const LLUUID& id, std::string& first, std::string& last, std::map& default_names) { if(id.isNull()) { - first = sCacheName["nobody"]; + first = default_names["nobody"]; last.clear(); return true; } @@ -420,7 +419,7 @@ bool LLCacheName::Impl::getName(const LLUUID& id, std::string& first, std::strin } else { - first = sCacheName["waiting"]; + first = default_names["waiting"]; last.clear(); if (!isRequestPending(id)) { @@ -434,8 +433,8 @@ bool LLCacheName::Impl::getName(const LLUUID& id, std::string& first, std::strin // static void LLCacheName::localizeCacheName(std::string key, std::string value) { - if (key!="" && value!= "" ) - sCacheName[key]=value; + if (!key.empty() && !value.empty()) + mCacheName[key]=value; else LL_WARNS()<< " Error localizing cache key " << key << " To "<< value< sCacheName; + void localizeCacheName(std::string key, std::string value); + private: + std::map mCacheName; class Impl; Impl& impl; diff --git a/indra/newview/llfloateravatarpicker.cpp b/indra/newview/llfloateravatarpicker.cpp index 6087e6c0ee..08a54b7369 100644 --- a/indra/newview/llfloateravatarpicker.cpp +++ b/indra/newview/llfloateravatarpicker.cpp @@ -300,7 +300,7 @@ void LLFloaterAvatarPicker::populateNearMe() if (!LLAvatarNameCache::get(av, &av_name)) { element["columns"][0]["column"] = "name"; - element["columns"][0]["value"] = LLCacheName::getDefaultName(); + element["columns"][0]["value"] = gCacheName->getDefaultName(); all_loaded = false; } else diff --git a/indra/newview/llinventorybridge.cpp b/indra/newview/llinventorybridge.cpp index 33d0ac891d..bfa8e39b70 100644 --- a/indra/newview/llinventorybridge.cpp +++ b/indra/newview/llinventorybridge.cpp @@ -6289,7 +6289,7 @@ void LLCallingCardBridge::performAction(LLInventoryModel* model, std::string act if (item && (item->getCreatorUUID() != gAgent.getID()) && (!item->getCreatorUUID().isNull())) { - std::string callingcard_name = LLCacheName::getDefaultName(); + std::string callingcard_name = gCacheName->getDefaultName(); LLAvatarName av_name; if (LLAvatarNameCache::get(item->getCreatorUUID(), &av_name)) { -- cgit v1.2.3 From c65bbadb2f6bc6828c149e3c468473a8c12d094c Mon Sep 17 00:00:00 2001 From: Rye Mutt Date: Sun, 21 Jul 2024 20:10:02 -0400 Subject: Fix rare shutdown crash in LLViewerObjectList --- indra/newview/llviewermessage.cpp | 2 +- indra/newview/llviewerobject.cpp | 10 +++++----- indra/newview/llviewerobjectlist.cpp | 24 +++++++++++------------- indra/newview/llviewerobjectlist.h | 14 +++++++------- 4 files changed, 24 insertions(+), 26 deletions(-) diff --git a/indra/newview/llviewermessage.cpp b/indra/newview/llviewermessage.cpp index 5a32f9654d..0d5482dcd1 100644 --- a/indra/newview/llviewermessage.cpp +++ b/indra/newview/llviewermessage.cpp @@ -3602,7 +3602,7 @@ void process_kill_object(LLMessageSystem *mesgsys, void **user_data) U32 local_id; mesgsys->getU32Fast(_PREHASH_ObjectData, _PREHASH_ID, local_id, i); - LLViewerObjectList::getUUIDFromLocal(id, local_id, ip, port); + gObjectList.getUUIDFromLocal(id, local_id, ip, port); if (id == LLUUID::null) { LL_DEBUGS("Messaging") << "Unknown kill for local " << local_id << LL_ENDL; diff --git a/indra/newview/llviewerobject.cpp b/indra/newview/llviewerobject.cpp index e108f9c268..9ad2474e9b 100644 --- a/indra/newview/llviewerobject.cpp +++ b/indra/newview/llviewerobject.cpp @@ -1940,14 +1940,14 @@ U32 LLViewerObject::processUpdateMessage(LLMessageSystem *mesgsys, if(mesgsys != NULL) { - LLViewerObjectList::getUUIDFromLocal(parent_uuid, + gObjectList.getUUIDFromLocal(parent_uuid, parent_id, mesgsys->getSenderIP(), mesgsys->getSenderPort()); } else { - LLViewerObjectList::getUUIDFromLocal(parent_uuid, + gObjectList.getUUIDFromLocal(parent_uuid, parent_id, mRegionp->getHost().getAddress(), mRegionp->getHost().getPort()); @@ -2062,7 +2062,7 @@ U32 LLViewerObject::processUpdateMessage(LLMessageSystem *mesgsys, // Debugging for suspected problems with local ids. //LLUUID parent_uuid; - //LLViewerObjectList::getUUIDFromLocal(parent_uuid, parent_id, mesgsys->getSenderIP(), mesgsys->getSenderPort() ); + //gObjectList.getUUIDFromLocal(parent_uuid, parent_id, mesgsys->getSenderIP(), mesgsys->getSenderPort() ); //if (parent_uuid != cur_parentp->getID() ) //{ // LL_ERRS() << "Local ID match but UUID mismatch of viewer object" << LL_ENDL; @@ -2085,14 +2085,14 @@ U32 LLViewerObject::processUpdateMessage(LLMessageSystem *mesgsys, if(mesgsys != NULL) { - LLViewerObjectList::getUUIDFromLocal(parent_uuid, + gObjectList.getUUIDFromLocal(parent_uuid, parent_id, gMessageSystem->getSenderIP(), gMessageSystem->getSenderPort()); } else { - LLViewerObjectList::getUUIDFromLocal(parent_uuid, + gObjectList.getUUIDFromLocal(parent_uuid, parent_id, mRegionp->getHost().getAddress(), mRegionp->getHost().getPort()); diff --git a/indra/newview/llviewerobjectlist.cpp b/indra/newview/llviewerobjectlist.cpp index 08a1ba0f9b..bfbb701a8e 100644 --- a/indra/newview/llviewerobjectlist.cpp +++ b/indra/newview/llviewerobjectlist.cpp @@ -99,8 +99,6 @@ extern LLPipeline gPipeline; // Statics for object lookup tables. U32 LLViewerObjectList::sSimulatorMachineIndex = 1; // Not zero deliberately, to speed up index check. -std::map LLViewerObjectList::sIPAndPortToIndex; -std::map LLViewerObjectList::sIndexAndLocalIDToUUID; LLViewerObjectList::LLViewerObjectList() { @@ -138,17 +136,17 @@ void LLViewerObjectList::getUUIDFromLocal(LLUUID &id, { U64 ipport = (((U64)ip) << 32) | (U64)port; - U32 index = sIPAndPortToIndex[ipport]; + U32 index = mIPAndPortToIndex[ipport]; if (!index) { index = sSimulatorMachineIndex++; - sIPAndPortToIndex[ipport] = index; + mIPAndPortToIndex[ipport] = index; } U64 indexid = (((U64)index) << 32) | (U64)local_id; - id = get_if_there(sIndexAndLocalIDToUUID, indexid, LLUUID::null); + id = get_if_there(mIndexAndLocalIDToUUID, indexid, LLUUID::null); } U64 LLViewerObjectList::getIndex(const U32 local_id, @@ -157,7 +155,7 @@ U64 LLViewerObjectList::getIndex(const U32 local_id, { U64 ipport = (((U64)ip) << 32) | (U64)port; - U32 index = sIPAndPortToIndex[ipport]; + U32 index = mIPAndPortToIndex[ipport]; if (!index) { @@ -177,14 +175,14 @@ bool LLViewerObjectList::removeFromLocalIDTable(const LLViewerObject* objectp) U32 ip = objectp->getRegion()->getHost().getAddress(); U32 port = objectp->getRegion()->getHost().getPort(); U64 ipport = (((U64)ip) << 32) | (U64)port; - U32 index = sIPAndPortToIndex[ipport]; + U32 index = mIPAndPortToIndex[ipport]; // LL_INFOS() << "Removing object from table, local ID " << local_id << ", ip " << ip << ":" << port << LL_ENDL; U64 indexid = (((U64)index) << 32) | (U64)local_id; - std::map::iterator iter = sIndexAndLocalIDToUUID.find(indexid); - if (iter == sIndexAndLocalIDToUUID.end()) + std::map::iterator iter = mIndexAndLocalIDToUUID.find(indexid); + if (iter == mIndexAndLocalIDToUUID.end()) { return false; } @@ -192,7 +190,7 @@ bool LLViewerObjectList::removeFromLocalIDTable(const LLViewerObject* objectp) // Found existing entry if (iter->second == objectp->getID()) { // Full UUIDs match, so remove the entry - sIndexAndLocalIDToUUID.erase(iter); + mIndexAndLocalIDToUUID.erase(iter); return true; } // UUIDs did not match - this would zap a valid entry, so don't erase it @@ -210,17 +208,17 @@ void LLViewerObjectList::setUUIDAndLocal(const LLUUID &id, { U64 ipport = (((U64)ip) << 32) | (U64)port; - U32 index = sIPAndPortToIndex[ipport]; + U32 index = mIPAndPortToIndex[ipport]; if (!index) { index = sSimulatorMachineIndex++; - sIPAndPortToIndex[ipport] = index; + mIPAndPortToIndex[ipport] = index; } U64 indexid = (((U64)index) << 32) | (U64)local_id; - sIndexAndLocalIDToUUID[indexid] = id; + mIndexAndLocalIDToUUID[indexid] = id; //LL_INFOS() << "Adding object to table, full ID " << id // << ", local ID " << local_id << ", ip " << ip << ":" << port << LL_ENDL; diff --git a/indra/newview/llviewerobjectlist.h b/indra/newview/llviewerobjectlist.h index f0f236d6ae..ebdfd0d369 100644 --- a/indra/newview/llviewerobjectlist.h +++ b/indra/newview/llviewerobjectlist.h @@ -171,18 +171,18 @@ public: // used to discount stats from this frame bool mWasPaused; - static void getUUIDFromLocal(LLUUID &id, + void getUUIDFromLocal(LLUUID &id, const U32 local_id, const U32 ip, const U32 port); - static void setUUIDAndLocal(const LLUUID &id, + void setUUIDAndLocal(const LLUUID &id, const U32 local_id, const U32 ip, const U32 port); // Requires knowledge of message system info! - static bool removeFromLocalIDTable(const LLViewerObject* objectp); + bool removeFromLocalIDTable(const LLViewerObject* objectp); // Used ONLY by the orphaned object code. - static U64 getIndex(const U32 local_id, const U32 ip, const U32 port); + U64 getIndex(const U32 local_id, const U32 ip, const U32 port); S32 mNumUnknownUpdates; S32 mNumDeadObjectUpdates; @@ -216,9 +216,9 @@ protected: S32 mCurLazyUpdateIndex; static U32 sSimulatorMachineIndex; - static std::map sIPAndPortToIndex; + std::map mIPAndPortToIndex; - static std::map sIndexAndLocalIDToUUID; + std::map mIndexAndLocalIDToUUID; friend class LLViewerObject; @@ -257,7 +257,7 @@ extern LLViewerObjectList gObjectList; */ inline LLViewerObject *LLViewerObjectList::findObject(const LLUUID &id) { - std::map >::iterator iter = mUUIDObjectMap.find(id); + auto iter = mUUIDObjectMap.find(id); if(iter != mUUIDObjectMap.end()) { return iter->second; -- cgit v1.2.3 From 04f95e78e38a682d4933ead0403e78507cbe79a6 Mon Sep 17 00:00:00 2001 From: Andrey Kleshchev Date: Thu, 18 Jul 2024 18:14:22 +0300 Subject: viewer#2061 Crash in ~LLScriptEdCore() --- indra/newview/llpreviewscript.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/indra/newview/llpreviewscript.cpp b/indra/newview/llpreviewscript.cpp index c2188ea638..b7c929f0b5 100644 --- a/indra/newview/llpreviewscript.cpp +++ b/indra/newview/llpreviewscript.cpp @@ -414,7 +414,13 @@ LLScriptEdCore::~LLScriptEdCore() if (script_search && script_search->getEditorCore() == this) { script_search->closeFloater(); - delete script_search; + // closeFloater can delete instance since it's not reusable nor single instance + // so make sure instance is still there before deleting + script_search = LLFloaterScriptSearch::getInstance(); + if (script_search) + { + delete script_search; + } } delete mLiveFile; -- cgit v1.2.3 From 9a8b2186e745f77e7f62c4cae6c620d8275c166e Mon Sep 17 00:00:00 2001 From: Andrey Kleshchev Date: Thu, 13 Jun 2024 18:37:28 +0300 Subject: viewer#1750 Crash at LLGLTFMaterial::operator= --- indra/newview/lllocalbitmaps.cpp | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/indra/newview/lllocalbitmaps.cpp b/indra/newview/lllocalbitmaps.cpp index 6ab5e05b7d..49abc7ab7d 100644 --- a/indra/newview/lllocalbitmaps.cpp +++ b/indra/newview/lllocalbitmaps.cpp @@ -671,15 +671,16 @@ void LLLocalBitmap::updateGLTFMaterials(LLUUID old_id, LLUUID new_id) if (override_mat) { // do not create a new material, reuse existing pointer - LLFetchedGLTFMaterial* render_mat = (LLFetchedGLTFMaterial*)entry->getGLTFRenderMaterial(); + LLFetchedGLTFMaterial* render_mat = dynamic_cast(entry->getGLTFRenderMaterial()); if (render_mat) { - llassert(dynamic_cast(entry->getGLTFRenderMaterial()) != nullptr); - { - *render_mat = *fetched_mat; - } + *render_mat = *fetched_mat; render_mat->applyOverride(*override_mat); } + else + { + LL_WARNS_ONCE() << "Failed to apply local material override, render material not found" << LL_ENDL; + } } } } -- cgit v1.2.3 From 105dc12980c8b90600a7a422985d067f4acbd794 Mon Sep 17 00:00:00 2001 From: Andrey Kleshchev <117672381+akleshchev@users.noreply.github.com> Date: Fri, 9 Aug 2024 19:51:13 +0300 Subject: Fix spaces in indra/newview/lllocalbitmaps.cpp Co-authored-by: Andrey Lihatskiy --- indra/newview/lllocalbitmaps.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/indra/newview/lllocalbitmaps.cpp b/indra/newview/lllocalbitmaps.cpp index 49abc7ab7d..ce0c460f5b 100644 --- a/indra/newview/lllocalbitmaps.cpp +++ b/indra/newview/lllocalbitmaps.cpp @@ -679,7 +679,7 @@ void LLLocalBitmap::updateGLTFMaterials(LLUUID old_id, LLUUID new_id) } else { - LL_WARNS_ONCE() << "Failed to apply local material override, render material not found" << LL_ENDL; + LL_WARNS_ONCE() << "Failed to apply local material override, render material not found" << LL_ENDL; } } } -- cgit v1.2.3 From ac330f63fd7ac655bbd06ce5d4ed65430aa2f42a Mon Sep 17 00:00:00 2001 From: Brad Linden Date: Fri, 9 Aug 2024 17:18:07 -0700 Subject: fix build.sh whitespace --- build.sh | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/build.sh b/build.sh index 93babd9226..5dfb4b6a74 100755 --- a/build.sh +++ b/build.sh @@ -199,14 +199,14 @@ package_llphysicsextensions_tpv() tpv_status=0 # nat 2016-12-21: without HAVOK, can't build PhysicsExtensions_TPV. if [ "$variant" = "Release" -a "${HAVOK:-}" != "OFF" ] - then + then tpvconfig="$build_dir/packages/llphysicsextensions/autobuild-tpv.xml" test -r "$tpvconfig" || fatal "No llphysicsextensions_tpv autobuild configuration found" # SL-19942: autobuild ignores -c switch if AUTOBUILD_CONFIGURATION set unset AUTOBUILD_CONFIGURATION "$autobuild" build --quiet --config-file "$(native_path "$tpvconfig")" -c Tpv \ || fatal "failed to build llphysicsextensions_tpv" - + # capture the package file name for use in upload later... PKGTMP=`mktemp -t pgktpv.XXXXXX` cleanup="$cleanup ; rm $PKGTMP* 2>/dev/null" @@ -239,7 +239,7 @@ build() || fatal "failed building $variant" echo true >"$build_dir"/build_ok end_section "autobuild $variant" - + begin_section "extensions $variant" # Run build extensions if [ -d ${build_dir}/packages/build-extensions ] @@ -312,7 +312,7 @@ begin_section "select viewer channel" # Look for a branch-specific viewer_channel setting # changeset_branch is set in the sling-buildscripts viewer_build_branch=$(echo -n "${changeset_branch:-$(repo_branch ${BUILDSCRIPTS_SRC:-$(pwd)})}" | tr -Cs 'A-Za-z0-9_' '_' | sed -E 's/^_+//; s/_+$//') -if [ -n "$viewer_build_branch" ] +if [ -n "$viewer_build_branch" ] then branch_viewer_channel_var="${viewer_build_branch}_viewer_channel" if [ -n "${!branch_viewer_channel_var}" ] @@ -434,7 +434,7 @@ do record_event "configure for $variant failed: build skipped" fi - if ! $succeeded + if ! $succeeded then record_event "remaining variants skipped due to $variant failure" break @@ -499,7 +499,7 @@ then fi done end_section "Upload Debian Repository" - + else record_event "debian build not enabled" fi -- cgit v1.2.3 From 501e92250ef61abcbbdb26f2e6f882d864113ac4 Mon Sep 17 00:00:00 2001 From: Rye Mutt Date: Sun, 11 Aug 2024 17:54:38 -0400 Subject: Fix avatar lod corruption from commit 5a1ce79 (#2247) --- indra/newview/lldrawable.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/indra/newview/lldrawable.cpp b/indra/newview/lldrawable.cpp index 3b531c41d9..ae48db24bc 100644 --- a/indra/newview/lldrawable.cpp +++ b/indra/newview/lldrawable.cpp @@ -1603,7 +1603,7 @@ void LLSpatialBridge::updateDistance(LLCamera& camera_in, bool force_update) for (LLViewerObject* child : mDrawable->getVObj()->getChildren()) { LLDrawable* drawable = child->mDrawable; - if (drawable && !drawable->isDead() && drawable->isAvatar()) + if (drawable && !drawable->isDead() && !drawable->isAvatar()) { drawable->updateDistance(camera, force_update); } -- cgit v1.2.3 From dff3fdbfd7d0b29b51d4d6b7ecfd84177e114eb8 Mon Sep 17 00:00:00 2001 From: Signal Linden Date: Sun, 11 Aug 2024 16:44:39 -0700 Subject: Adopt NSIS 3.0 (#2248) --- .github/workflows/build.yaml | 4 ---- indra/newview/installers/windows/installer_template.nsi | 1 + 2 files changed, 1 insertion(+), 4 deletions(-) diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index 00b9ccd2c9..53bfbc2c0a 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -120,10 +120,6 @@ jobs: ${{ runner.os }}-64-${{ matrix.configuration }}- ${{ runner.os }}-64- - - name: Install windows dependencies - if: runner.os == 'Windows' - run: choco install nsis-unicode - - name: Determine source branch id: which-branch uses: secondlife/viewer-build-util/which-branch@v2 diff --git a/indra/newview/installers/windows/installer_template.nsi b/indra/newview/installers/windows/installer_template.nsi index d1dab94a76..77f24ac6a6 100644 --- a/indra/newview/installers/windows/installer_template.nsi +++ b/indra/newview/installers/windows/installer_template.nsi @@ -32,6 +32,7 @@ SetCompressor /solid lzma # Compress whole installer as one block SetDatablockOptimize off # Only saves us 0.1%, not worth it XPStyle on # Add an XP manifest to the installer RequestExecutionLevel admin # For when we write to Program Files +Unicode true # Enable unicode support ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; Project flags -- cgit v1.2.3 From af2b5a3c58999c12f7c5e091cd4703e358fe844c Mon Sep 17 00:00:00 2001 From: Rye Mutt Date: Mon, 12 Aug 2024 00:15:21 -0400 Subject: Fix sculpt discard level being discarded due to shadowing outer scope discard_level (#2249) --- indra/newview/llvovolume.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/indra/newview/llvovolume.cpp b/indra/newview/llvovolume.cpp index 9ebe648680..7a7d88327b 100644 --- a/indra/newview/llvovolume.cpp +++ b/indra/newview/llvovolume.cpp @@ -1250,7 +1250,7 @@ void LLVOVolume::sculpt() if (!raw_image) { raw_image = mSculptTexture->getSavedRawImage(); - S32 discard_level = mSculptTexture->getSavedRawImageLevel(); + discard_level = mSculptTexture->getSavedRawImageLevel(); } if (!raw_image) -- cgit v1.2.3 From f982463488a35b58b86d5d76309055416eb9eaec Mon Sep 17 00:00:00 2001 From: Rye Mutt Date: Mon, 12 Aug 2024 00:30:42 -0400 Subject: Update zlib-ng libxml2 libpng freetype minizip-ng boost collada-dom tinygltf packages (#2250) Rebuild expat, apr, meshoptimizer, ogg_vorbis, libjpeg-turbo for symbol fixes --- autobuild.xml | 218 +++++++++++++++-------------- indra/cmake/00-Common.cmake | 2 - indra/cmake/CURL.cmake | 19 ++- indra/cmake/Copy3rdPartyLibs.cmake | 15 +- indra/cmake/FreeType.cmake | 8 +- indra/cmake/LLPrimitive.cmake | 15 +- indra/cmake/NGHTTP2.cmake | 8 +- indra/cmake/OpenSSL.cmake | 5 +- indra/cmake/PNG.cmake | 4 +- indra/cmake/ZLIBNG.cmake | 4 +- indra/llcorehttp/CMakeLists.txt | 37 ----- indra/media_plugins/cef/CMakeLists.txt | 2 +- indra/media_plugins/example/CMakeLists.txt | 2 +- indra/media_plugins/libvlc/CMakeLists.txt | 2 +- indra/newview/CMakeLists.txt | 4 - indra/newview/viewer_manifest.py | 15 -- 16 files changed, 155 insertions(+), 205 deletions(-) diff --git a/autobuild.xml b/autobuild.xml index 61a9d85d1a..b90d94865a 100644 --- a/autobuild.xml +++ b/autobuild.xml @@ -46,11 +46,11 @@ archive hash - 058ffb9080ac03abd8ecd1f57fcc1160351c71ed + 579a46d77802e301856c93792d39d43bbf939987 hash_algorithm sha1 url - https://github.com/secondlife/3p-apr_suite/releases/download/v1.7.4-r1/apr_suite-1.7.4-10278668642-darwin64-10278668642.tar.zst + https://github.com/secondlife/3p-apr_suite/releases/download/v1.7.4-r2/apr_suite-1.7.4-10338381102-darwin64-10338381102.tar.zst name darwin64 @@ -60,11 +60,11 @@ archive hash - 272d97471f6ecf6e1eb4802f353d1f8c6f024eb3 + 2e5cf11f8774023408402df860d3d1f4a6668500 hash_algorithm sha1 url - https://github.com/secondlife/3p-apr_suite/releases/download/v1.7.4-r1/apr_suite-1.7.4-10278668642-linux64-10278668642.tar.zst + https://github.com/secondlife/3p-apr_suite/releases/download/v1.7.4-r2/apr_suite-1.7.4-10338381102-linux64-10338381102.tar.zst name linux64 @@ -74,11 +74,11 @@ archive hash - 587b0b61ecff2ac55cfbcb8e57a7b07c844a0069 + 7eb6b8f294c4563a07fec3578be2d04af17a60cb hash_algorithm sha1 url - https://github.com/secondlife/3p-apr_suite/releases/download/v1.7.4-r1/apr_suite-1.7.4-10278668642-windows64-10278668642.tar.zst + https://github.com/secondlife/3p-apr_suite/releases/download/v1.7.4-r2/apr_suite-1.7.4-10338381102-windows64-10338381102.tar.zst name windows64 @@ -91,7 +91,7 @@ copyright Copyright © 2012 The Apache Software Foundation, Licensed under the Apache License, Version 2.0. version - 1.7.4-10278668642 + 1.7.4-10338381102 name apr_suite description @@ -106,11 +106,11 @@ archive hash - d600779da508fbb64eb85957f2866fd2b039b674 + e86c0dba9fe7ede25fe00a1435421bce62077dc1 hash_algorithm sha1 url - https://github.com/secondlife/3p-boost/releases/download/v1.85.0-r1/boost-1.85-darwin64-10124675220.tar.zst + https://github.com/secondlife/3p-boost/releases/download/v1.85.0-r3/boost-1.85-darwin64-10333387089.tar.zst name darwin64 @@ -120,11 +120,11 @@ archive hash - ce39890fe263358d99c45f1b697107b72e3b6870 + 30e1096fede786e5553a7c65b9d55dea9555bef3 hash_algorithm sha1 url - https://github.com/secondlife/3p-boost/releases/download/v1.85.0-r1/boost-1.85-linux64-10124675220.tar.zst + https://github.com/secondlife/3p-boost/releases/download/v1.85.0-r3/boost-1.85-linux64-10333387089.tar.zst name linux64 @@ -134,11 +134,11 @@ archive hash - 2b0b0b0aaf3bdb1d36809db7d08bd60ae7e8fed1 + e640611a7e4b245c8900048b995e243fb68b90c9 hash_algorithm sha1 url - https://github.com/secondlife/3p-boost/releases/download/v1.85.0-r1/boost-1.85-windows64-10124675220.tar.zst + https://github.com/secondlife/3p-boost/releases/download/v1.85.0-r3/boost-1.85-windows64-10333387089.tar.zst name windows64 @@ -212,11 +212,11 @@ archive hash - a29852f41b77a26a2c10af1d179bf7c4b6a1b12b + ebe9defd8911b1e6d8783aebd692674845095630 hash_algorithm sha1 url - https://github.com/secondlife/3p-colladadom/releases/download/v2.3-r6/colladadom-2.3.10129939866-darwin64-10129939866.tar.zst + https://github.com/secondlife/3p-colladadom/releases/download/v2.3-r7/colladadom-2.3.0-r7-darwin64-10342904699.tar.zst name darwin64 @@ -226,11 +226,11 @@ archive hash - 933c31aa8da53731c75c272b90a64dde08dc1f4d + 083f93911f6b6501fdc5a5985b2e379f3b9803cd hash_algorithm sha1 url - https://github.com/secondlife/3p-colladadom/releases/download/v2.3-r6/colladadom-2.3.10129939866-linux64-10129939866.tar.zst + https://github.com/secondlife/3p-colladadom/releases/download/v2.3-r7/colladadom-2.3.0-r7-linux64-10342904699.tar.zst name linux64 @@ -240,11 +240,11 @@ archive hash - c01f1692a48d26436297bd5ac4b54fd3c71f7651 + 6ba23076b439a62bb346ebaeb1656a645bf71177 hash_algorithm sha1 url - https://github.com/secondlife/3p-colladadom/releases/download/v2.3-r6/colladadom-2.3.10129939866-windows64-10129939866.tar.zst + https://github.com/secondlife/3p-colladadom/releases/download/v2.3-r7/colladadom-2.3.0-r7-windows64-10342904699.tar.zst name windows64 @@ -257,7 +257,7 @@ copyright Copyright 2006 Sony Computer Entertainment Inc. version - 2.3.10129939866 + 2.3.0-r7 name colladadom @@ -326,11 +326,11 @@ archive hash - d4d5f27008de1ff7e86ae852841c68849b02eaea + 9c74adfd217fcc04869ef574078bc56a4a1380f3 hash_algorithm sha1 url - https://github.com/secondlife/3p-curl/releases/download/v7.54.1-5a4a82d/curl-7.54.1-5a4a82d-darwin64-5a4a82d.tar.zst + https://github.com/secondlife/3p-curl/releases/download/v7.54.1-r1/curl-7.54.1-10342910827-darwin64-10342910827.tar.zst name darwin64 @@ -340,9 +340,11 @@ archive hash - 630a2ddf43bba6e5b6e171dc68921dcb + 325ad581a1ba99fbc1e74d48481e07546eaf1e0e + hash_algorithm + sha1 url - http://automated-builds-secondlife-com.s3.amazonaws.com/ct2/8663/36142/curl-7.54.1.508652-linux64-508652.tar.bz2 + https://github.com/secondlife/3p-curl/releases/download/v7.54.1-r1/curl-7.54.1-10342910827-linux64-10342910827.tar.zst name linux64 @@ -352,11 +354,11 @@ archive hash - 07423f41d1320ea405f493869f6460cf8c45def5 + 794480208e72a928552760cd048438b90aa1c80d hash_algorithm sha1 url - https://github.com/secondlife/3p-curl/releases/download/v7.54.1-5a4a82d/curl-7.54.1-5a4a82d-windows64-5a4a82d.tar.zst + https://github.com/secondlife/3p-curl/releases/download/v7.54.1-r1/curl-7.54.1-10342910827-windows64-10342910827.tar.zst name windows64 @@ -369,7 +371,7 @@ copyright Copyright (c) 1996 - 2014, Daniel Stenberg, (daniel@haxx.se). version - 7.54.1-5a4a82d + 7.54.1-10342910827 name curl description @@ -540,11 +542,11 @@ archive hash - bd61ec7787ea96d11f735afa5a6296ed175472b6 + 8cc4f38fd809d9ff5d8ca617d7e068eb236f4162 hash_algorithm sha1 url - https://github.com/secondlife/3p-expat/releases/download/v2.6.2-r4/expat-2.6.2-r4-darwin64-10278332617.tar.zst + https://github.com/secondlife/3p-expat/releases/download/v2.6.2-r5/expat-2.6.2-r5-darwin64-10337781902.tar.zst name darwin64 @@ -554,11 +556,11 @@ archive hash - acf891bda4125a92f6347e69f0e7867f32cebd20 + d7f3bbfd65fce365c3cd5be9ab72072580408dec hash_algorithm sha1 url - https://github.com/secondlife/3p-expat/releases/download/v2.6.2-r4/expat-2.6.2-r4-linux64-10278332617.tar.zst + https://github.com/secondlife/3p-expat/releases/download/v2.6.2-r5/expat-2.6.2-r5-linux64-10337781902.tar.zst name linux64 @@ -568,11 +570,11 @@ archive hash - 1b9c198626fca0f30fb2770856e65767a9951683 + f11d91205bb753d7389a73e629627b200219c62f hash_algorithm sha1 url - https://github.com/secondlife/3p-expat/releases/download/v2.6.2-r4/expat-2.6.2-r4-windows64-10278332617.tar.zst + https://github.com/secondlife/3p-expat/releases/download/v2.6.2-r5/expat-2.6.2-r5-windows64-10337781902.tar.zst name windows64 @@ -585,7 +587,7 @@ copyright Copyright (c) 1998-2000 Thai Open Source Software Center Ltd and Clark Cooper - Copyright (c) 2001-2022 Expat maintainers. version - 2.6.2-r4 + 2.6.2-r5 name expat description @@ -630,11 +632,11 @@ archive hash - d90a5c2fb4a729eeff3965ea6dd0a35cf146d379 + df465ce3048add93f76d1f13e0f04d21b3875b74 hash_algorithm sha1 url - https://github.com/secondlife/3p-freetype/releases/download/v.2.12.1.557becd/freetype-2.12.1.557becd-darwin64-557becd.tar.zst + https://github.com/secondlife/3p-freetype/releases/download/v2.13.2-r1/freetype-2.13.2-r1-darwin64-10342925957.tar.zst name darwin64 @@ -644,11 +646,11 @@ archive hash - 4a999279562e8f3e4ba02d3e78a844ddf6fe18f1 + 7cdc4f27dfa6424400863c746b487199b765794e hash_algorithm sha1 url - https://github.com/secondlife/3p-freetype/releases/download/v.2.12.1.557becd/freetype-2.12.1.557becd-linux64-557becd.tar.zst + https://github.com/secondlife/3p-freetype/releases/download/v2.13.2-r1/freetype-2.13.2-r1-linux64-10342925957.tar.zst name linux64 @@ -658,11 +660,11 @@ archive hash - 1837fdfd44204c78e79134944f824b0211817883 + 44788d645b3bcf9a7aaf7c3a92d609fbb2b36413 hash_algorithm sha1 url - https://github.com/secondlife/3p-freetype/releases/download/v.2.12.1.557becd/freetype-2.12.1.557becd-windows64-557becd.tar.zst + https://github.com/secondlife/3p-freetype/releases/download/v2.13.2-r1/freetype-2.13.2-r1-windows64-10342925957.tar.zst name windows64 @@ -675,7 +677,7 @@ copyright Copyright 2006, 2007, 2008, 2009, 2010 by David Turner, Robert Wilhelm, and Werner Lemberg. version - 2.12.1.557becd + 2.13.2-r1 name freetype description @@ -970,11 +972,11 @@ archive hash - 36144272e381952a7c11f1d593c2916c5c7387d0 + 34cf4fdbbc999e67b0528f7ca3c7f31f35267ecf hash_algorithm sha1 url - https://github.com/secondlife/3p-libjpeg-turbo/releases/download/v3.0.3-r1/libjpeg_turbo-3.0.3-windows64-10204037839.tar.zst + https://github.com/secondlife/3p-libjpeg-turbo/releases/download/v3.0.3-r2/libjpeg_turbo-3.0.3-r2-windows64-10341191820.tar.zst name windows64 @@ -984,11 +986,11 @@ archive hash - f853a7d4fe842e7a661dd71a56a51f65b2ec25c7 + 5ff05a0e5ed0aba1514b84d3c2edaf70c18738b5 hash_algorithm sha1 url - https://github.com/secondlife/3p-libjpeg-turbo/releases/download/v3.0.3-r1/libjpeg_turbo-3.0.3-linux64-10204037839.tar.zst + https://github.com/secondlife/3p-libjpeg-turbo/releases/download/v3.0.3-r2/libjpeg_turbo-3.0.3-r2-linux64-10341191820.tar.zst name linux64 @@ -998,11 +1000,11 @@ archive hash - 6fcbc2c3c91b5e9bfbbc57ddf27d2f3698fe7d99 + 7c38eabc050b4a6bdb183a1d7a38da885341049c hash_algorithm sha1 url - https://github.com/secondlife/3p-libjpeg-turbo/releases/download/v3.0.3-r1/libjpeg_turbo-3.0.3-darwin64-10204037839.tar.zst + https://github.com/secondlife/3p-libjpeg-turbo/releases/download/v3.0.3-r2/libjpeg_turbo-3.0.3-r2-darwin64-10341191820.tar.zst name darwin64 @@ -1015,7 +1017,7 @@ copyright Copyright (C)2009-2024 D. R. Commander. All Rights Reserved. Copyright (C)2015 Viktor Szathmáry. All Rights Reserved. version - 3.0.3 + 3.0.3-r2 name libjpeg-turbo canonical_repo @@ -1220,11 +1222,11 @@ archive hash - fea8f0684a4ed0a73343651948b13049a135a92a + 6fe46ed1e2e40616abdacf7115e510645d5f62e7 hash_algorithm sha1 url - https://github.com/secondlife/3p-libpng/releases/download/v1.6.38-ca06e99/libpng-1.6.38-ca06e99-darwin64-ca06e99.tar.zst + https://github.com/secondlife/3p-libpng/releases/download/v1.6.43-r2/libpng-1.6.43-r2-darwin64-10329429325.tar.zst name darwin64 @@ -1234,9 +1236,11 @@ archive hash - 13de93ea11544051b69f238eeb644fd3 + b54a4710d9c3ddfa044e1d29f9c38974e9fc645d + hash_algorithm + sha1 url - http://automated-builds-secondlife-com.s3.amazonaws.com/ct2/882/1946/libpng-1.6.8.500873-linux64-500873.tar.bz2 + https://github.com/secondlife/3p-libpng/releases/download/v1.6.43-r2/libpng-1.6.43-r2-linux64-10329429325.tar.zst name linux64 @@ -1246,11 +1250,11 @@ archive hash - b91c116a1fda2377954355e56517634db0137699 + eddb96c73c8916bf71eaa5d0edb812d20e72c255 hash_algorithm sha1 url - https://github.com/secondlife/3p-libpng/releases/download/v1.6.38-ca06e99/libpng-1.6.38-ca06e99-windows64-ca06e99.tar.zst + https://github.com/secondlife/3p-libpng/releases/download/v1.6.43-r2/libpng-1.6.43-r2-windows64-10329429325.tar.zst name windows64 @@ -1263,7 +1267,7 @@ copyright Copyright (c) 2004, 2006-2013 Glenn Randers-Pehrson version - 1.6.38-ca06e99 + 1.6.43-r2 name libpng description @@ -1308,11 +1312,11 @@ archive hash - 2c46547d9dc83c47f41eacc7e5092affa72f3eee + b2bf9adc84841b6fcf48d4c00787b221607cdea3 hash_algorithm sha1 url - https://github.com/secondlife/3p-libxml2/releases/download/v2.9.4.7476681/libxml2-2.9.4.7476681-darwin64-7476681.tar.zst + https://github.com/secondlife/3p-libxml2/releases/download/v2.13.3-r1/libxml2-2.13.3-r1-darwin64-10329675166.tar.zst name darwin64 @@ -1322,11 +1326,11 @@ archive hash - 4cda464277bfa6756ce4663a91cd724f3f45b8d8 + 6ab8108ea0a42e0bd462568c495e5ce5c4cdc0ff hash_algorithm sha1 url - https://github.com/secondlife/3p-libxml2/releases/download/v2.9.4.7476681/libxml2-2.9.4.7476681-linux64-7476681.tar.zst + https://github.com/secondlife/3p-libxml2/releases/download/v2.13.3-r1/libxml2-2.13.3-r1-linux64-10329675166.tar.zst name linux64 @@ -1336,11 +1340,11 @@ archive hash - 7e506d26f8cb6f205146e41d74095e7e27087e84 + 5181bd267de3ad4466227f91c7e2cbed7e8b85d9 hash_algorithm sha1 url - https://github.com/secondlife/3p-libxml2/releases/download/v2.9.4.7476681/libxml2-2.9.4.7476681-windows64-7476681.tar.zst + https://github.com/secondlife/3p-libxml2/releases/download/v2.13.3-r1/libxml2-2.13.3-r1-windows64-10329675166.tar.zst name windows64 @@ -1353,7 +1357,7 @@ copyright Copyright (C) 1998-2012 Daniel Veillard. All Rights Reserved. version - 2.9.4.7476681 + 2.13.3-r1 name libxml2 description @@ -1623,11 +1627,11 @@ archive hash - 3d173e176e9777f1b10f54fe0bd1c735a65b56e5 + d79631d845e2b5e4a9e6f6b660310795fd49023e hash_algorithm sha1 url - https://github.com/secondlife/3p-meshoptimizer/releases/download/v210-r1/meshoptimizer-210-darwin64-9846246058.tar.zst + https://github.com/secondlife/3p-meshoptimizer/releases/download/v210-r2/meshoptimizer-210.0.0-r2-darwin64-10341021290.tar.zst name darwin64 @@ -1637,11 +1641,11 @@ archive hash - 6777467d1d06064351c27f70d556fdcba8420c52 + 024ce689a6f13e66d0c7e431ac34071434e2365a hash_algorithm sha1 url - https://github.com/secondlife/3p-meshoptimizer/releases/download/v210-r1/meshoptimizer-210-windows64-9846246058.tar.zst + https://github.com/secondlife/3p-meshoptimizer/releases/download/v210-r2/meshoptimizer-210.0.0-r2-windows64-10341021290.tar.zst name windows64 @@ -1651,11 +1655,11 @@ archive hash - 17eb4a03f94d363e9ad8b096ac590e0649cf91fa + c947107c0aca46e94e22f66328a3cbbd01d99b36 hash_algorithm sha1 url - https://github.com/secondlife/3p-meshoptimizer/releases/download/v210-r1/meshoptimizer-210-linux64-9846246058.tar.zst + https://github.com/secondlife/3p-meshoptimizer/releases/download/v210-r2/meshoptimizer-210.0.0-r2-linux64-10341021290.tar.zst name linux64 @@ -1668,7 +1672,7 @@ copyright Copyright (c) 2016-2021 Arseny Kapoulkine version - 210 + 210.0.0-r2 name meshoptimizer canonical_repo @@ -1747,11 +1751,11 @@ archive hash - 303fa93a0fd6c636a65fd9d5d53beceb84752b0e + 6bedaa9d770ef0ae6147f49a26fc3209fde9cb80 hash_algorithm sha1 url - https://github.com/secondlife/3p-minizip-ng/releases/download/v3.0.2.3e9876e/minizip_ng-3.0.2.3e9876e-darwin64-3e9876e.tar.zst + https://github.com/secondlife/3p-minizip-ng/releases/download/v4.0.7-r1/minizip_ng-4.0.7-r1-darwin64-10324657515.tar.zst name darwin64 @@ -1761,11 +1765,11 @@ archive hash - d4f35ebcea53ab6e9f2e6cbc0d680b10d10b9c53 + ce2c91b8c4f89af252ce1b6a96af6985fe54f509 hash_algorithm sha1 url - https://github.com/secondlife/3p-minizip-ng/releases/download/v3.0.2.3e9876e/minizip_ng-3.0.2.3e9876e-linux64-3e9876e.tar.zst + https://github.com/secondlife/3p-minizip-ng/releases/download/v4.0.7-r1/minizip_ng-4.0.7-r1-linux64-10324657515.tar.zst name linux64 @@ -1775,11 +1779,11 @@ archive hash - 5dc469172ba4c6015d5b771e516bc88a65d769eb + 9cee9d85f9a7c6fb051125775f0122a926da5cc9 hash_algorithm sha1 url - https://github.com/secondlife/3p-minizip-ng/releases/download/v3.0.2.3e9876e/minizip_ng-3.0.2.3e9876e-windows64-3e9876e.tar.zst + https://github.com/secondlife/3p-minizip-ng/releases/download/v4.0.7-r1/minizip_ng-4.0.7-r1-windows64-10324657515.tar.zst name windows64 @@ -1792,7 +1796,7 @@ copyright This project uses the zlib license. Copyright (C) 1995-2013 Jean-loup Gailly and Mark Adler version - 3.0.2.3e9876e + 4.0.7-r1 name minizip-ng canonical_repo @@ -1865,11 +1869,11 @@ archive hash - fff611030a34e78b3a88168f64e4e33aef117bc3 + 3f3374a5d97803bf78acf20847c2900c7d68ce2b hash_algorithm sha1 url - https://github.com/secondlife/3p-nghttp2/releases/download/v1.40.0.b1526c6/nghttp2-1.40.0.b1526c6-darwin64-b1526c6.tar.zst + https://github.com/secondlife/3p-nghttp2/releases/download/v1.62.1/nghttp2-1.62.1-darwin64-10329456052.tar.zst name darwin64 @@ -1879,11 +1883,11 @@ archive hash - 5798b5f6c8579ad44f211a873c072ee8d3fd8c93 + bd9c211f9f53c04821f0ab0e1268a691926331b6 hash_algorithm sha1 url - https://github.com/secondlife/3p-nghttp2/releases/download/v1.40.0.b1526c6/nghttp2-1.40.0.b1526c6-linux64-b1526c6.tar.zst + https://github.com/secondlife/3p-nghttp2/releases/download/v1.62.1/nghttp2-1.62.1-linux64-10329456052.tar.zst name linux64 @@ -1893,11 +1897,11 @@ archive hash - 05aad7759519719a54a6100fddd35b69e57f2386 + c23e25a7c47f5233f543a90f1a9ccf4da9282379 hash_algorithm sha1 url - https://github.com/secondlife/3p-nghttp2/releases/download/v1.40.0.b1526c6/nghttp2-1.40.0.b1526c6-windows64-b1526c6.tar.zst + https://github.com/secondlife/3p-nghttp2/releases/download/v1.62.1/nghttp2-1.62.1-windows64-10329456052.tar.zst name windows64 @@ -1911,7 +1915,7 @@ Copyright (c) 2012, 2014, 2015, 2016 Tatsuhiro Tsujikawa Copyright (c) 2012, 2014, 2015, 2016 nghttp2 contributors version - 1.40.0.b1526c6 + 1.62.1 name nghttp2 description @@ -1960,11 +1964,11 @@ Copyright (c) 2012, 2014, 2015, 2016 nghttp2 contributors archive hash - 1e694e5562b8d844bc44d5f7ae4dce243ee70d23 + 3abb5d21655aeca9d6a4de37704e8475821c28d9 hash_algorithm sha1 url - https://github.com/secondlife/3p-ogg_vorbis/releases/download/v1.3.5-1.3.7/ogg_vorbis-1.3.5-1.3.7.10218872737-darwin64-10218872737.tar.zst + https://github.com/secondlife/3p-ogg_vorbis/releases/download/v1.3.5-1.3.7-r1/ogg_vorbis-1.3.5-1.3.7.10341271136-darwin64-10341271136.tar.zst name darwin64 @@ -1974,11 +1978,11 @@ Copyright (c) 2012, 2014, 2015, 2016 nghttp2 contributors archive hash - ce0c6adb6d684eb2f4b2ad8838c67186c59e151a + d89dff615c51b46ebdb3d42ac6bd9e0faae5ddf1 hash_algorithm sha1 url - https://github.com/secondlife/3p-ogg_vorbis/releases/download/v1.3.5-1.3.7/ogg_vorbis-1.3.5-1.3.7.10218872737-linux64-10218872737.tar.zst + https://github.com/secondlife/3p-ogg_vorbis/releases/download/v1.3.5-1.3.7-r1/ogg_vorbis-1.3.5-1.3.7.10341271136-linux64-10341271136.tar.zst name linux64 @@ -1988,11 +1992,11 @@ Copyright (c) 2012, 2014, 2015, 2016 nghttp2 contributors archive hash - 9434b592c5d748c5deb64ad548fd1484638e3172 + 0dc0f5334d1c882d5d7bce6d2cfaecf2f7ab1ae6 hash_algorithm sha1 url - https://github.com/secondlife/3p-ogg_vorbis/releases/download/v1.3.5-1.3.7/ogg_vorbis-1.3.5-1.3.7.10218872737-windows64-10218872737.tar.zst + https://github.com/secondlife/3p-ogg_vorbis/releases/download/v1.3.5-1.3.7-r1/ogg_vorbis-1.3.5-1.3.7.10341271136-windows64-10341271136.tar.zst name windows64 @@ -2005,7 +2009,7 @@ Copyright (c) 2012, 2014, 2015, 2016 nghttp2 contributors copyright Copyright (c) 2002, Xiph.org Foundation version - 1.3.5-1.3.7.10218872737 + 1.3.5-1.3.7.10341271136 name ogg_vorbis description @@ -2155,11 +2159,11 @@ Copyright (c) 2012, 2014, 2015, 2016 nghttp2 contributors archive hash - b286e4a10cf6b1b2710b85ff96ffc0e41fd5fde8 + a20277991043a4a00fb8280a27a41fbd87c4b840 hash_algorithm sha1 url - https://github.com/secondlife/3p-openssl/releases/download/v1.1.1q.de53f55/openssl-1.1.1q.de53f55-darwin64-de53f55.tar.zst + https://github.com/secondlife/3p-openssl/releases/download/v1.1.1w-r1/openssl-1.1.1w-darwin64-10329796904.tar.zst name darwin64 @@ -2169,11 +2173,11 @@ Copyright (c) 2012, 2014, 2015, 2016 nghttp2 contributors archive hash - 5f6953db991ef6badb0525ecc98daf28d368e9e7 + 0f2cd519431b11cacf85971c66c49e5b4d26c56f hash_algorithm sha1 url - https://github.com/secondlife/3p-openssl/releases/download/v1.1.1q.de53f55/openssl-1.1.1q.de53f55-linux64-de53f55.tar.zst + https://github.com/secondlife/3p-openssl/releases/download/v1.1.1w-r1/openssl-1.1.1w-linux64-10329796904.tar.zst name linux64 @@ -2183,11 +2187,11 @@ Copyright (c) 2012, 2014, 2015, 2016 nghttp2 contributors archive hash - 8bd3dea6d81de5e469b241a1b79e61efce6ecc05 + 5e396eedf1492d18126b7281367123c1d64b89aa hash_algorithm sha1 url - https://github.com/secondlife/3p-openssl/releases/download/v1.1.1q.de53f55/openssl-1.1.1q.de53f55-windows64-de53f55.tar.zst + https://github.com/secondlife/3p-openssl/releases/download/v1.1.1w-r1/openssl-1.1.1w-windows64-10329796904.tar.zst name windows64 @@ -2200,7 +2204,7 @@ Copyright (c) 2012, 2014, 2015, 2016 nghttp2 contributors copyright Copyright (c) 1998-2011 The OpenSSL Project. All rights reserved; Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) version - 1.1.1q.de53f55 + 1.1.1w name openssl description @@ -2329,11 +2333,11 @@ Copyright (c) 2012, 2014, 2015, 2016 nghttp2 contributors archive hash - 2c47ae2d0c38c86b8c2db8d9317f0ab15edfc74f + 005d23bb2606ae2cc9e844adc1a0edf112c69812 hash_algorithm sha1 url - https://github.com/secondlife/3p-tinygltf/releases/download/v2.5.0-1ae57fd/tinygltf-v2.5.0-common-1ae57fd.tar.zst + https://github.com/secondlife/3p-tinygltf/releases/download/v2.9.3-r1/tinygltf-2.9.3-r1-common-10341018043.tar.zst name common @@ -2346,7 +2350,7 @@ Copyright (c) 2012, 2014, 2015, 2016 nghttp2 contributors copyright // Copyright (c) 2015 - Present Syoyo Fujita, Aurélien Chatelain and many contributors. version - v2.5.0 + 2.9.3-r1 name tinygltf canonical_repo @@ -2737,11 +2741,11 @@ Copyright (c) 2012, 2014, 2015, 2016 nghttp2 contributors archive hash - dacc5f3fb307c4d1292ed1ffb1d595d83599062d + 3a6593c71c59ace76d1349483759fcde4b719a76 hash_algorithm sha1 url - https://github.com/secondlife/3p-zlib-ng/releases/download/v1.2.11.zlib-ng.32fd361/zlib_ng-1.2.11.zlib-ng.32fd361-darwin64-32fd361.tar.zst + https://github.com/secondlife/3p-zlib-ng/releases/download/v2.2.1-r2/zlib_ng-2.2.1-r2-darwin64-10324415171.tar.zst name darwin64 @@ -2751,11 +2755,11 @@ Copyright (c) 2012, 2014, 2015, 2016 nghttp2 contributors archive hash - fba88375e12454ae19f4528e11ffc7ddf7d879ec + fbadeb0b8c771cb06c0055c9fab6d40c6764dacd hash_algorithm sha1 url - https://github.com/secondlife/3p-zlib-ng/releases/download/v1.2.11.zlib-ng.32fd361/zlib_ng-1.2.11.zlib-ng.32fd361-linux64-32fd361.tar.zst + https://github.com/secondlife/3p-zlib-ng/releases/download/v2.2.1-r2/zlib_ng-2.2.1-r2-linux64-10324415171.tar.zst name linux64 @@ -2765,11 +2769,11 @@ Copyright (c) 2012, 2014, 2015, 2016 nghttp2 contributors archive hash - ccfca9451063e2d0e95baa73b1ad2054d3e38907 + 0094031715662be626f5106ff6c814f4fc3dacfa hash_algorithm sha1 url - https://github.com/secondlife/3p-zlib-ng/releases/download/v1.2.11.zlib-ng.32fd361/zlib_ng-1.2.11.zlib-ng.32fd361-windows64-32fd361.tar.zst + https://github.com/secondlife/3p-zlib-ng/releases/download/v2.2.1-r2/zlib_ng-2.2.1-r2-windows64-10324415171.tar.zst name windows64 @@ -2782,7 +2786,7 @@ Copyright (c) 2012, 2014, 2015, 2016 nghttp2 contributors copyright Copyright (C) 1995-2013 Jean-loup Gailly and Mark Adler version - 1.2.11.zlib-ng.32fd361 + 2.2.1-r2 name zlib-ng canonical_repo diff --git a/indra/cmake/00-Common.cmake b/indra/cmake/00-Common.cmake index f1fa7761c3..4b3fa00fcf 100644 --- a/indra/cmake/00-Common.cmake +++ b/indra/cmake/00-Common.cmake @@ -64,9 +64,7 @@ if (WINDOWS) # http://www.cmake.org/pipermail/cmake/2009-September/032143.html string(REPLACE "/Zm1000" " " CMAKE_CXX_FLAGS ${CMAKE_CXX_FLAGS}) - # zlib has assembly-language object files incompatible with SAFESEH add_link_options(/LARGEADDRESSAWARE - /SAFESEH:NO /NODEFAULTLIB:LIBCMT /IGNORE:4099) diff --git a/indra/cmake/CURL.cmake b/indra/cmake/CURL.cmake index b9f685f37b..eea0a2da62 100644 --- a/indra/cmake/CURL.cmake +++ b/indra/cmake/CURL.cmake @@ -1,5 +1,6 @@ # -*- cmake -*- include(Prebuilt) +include(Linking) include_guard() add_library( ll::libcurl INTERFACE IMPORTED ) @@ -7,8 +8,18 @@ add_library( ll::libcurl INTERFACE IMPORTED ) use_system_binary(libcurl) use_prebuilt_binary(curl) if (WINDOWS) - target_link_libraries(ll::libcurl INTERFACE libcurl.lib) -else (WINDOWS) - target_link_libraries(ll::libcurl INTERFACE libcurl.a) -endif (WINDOWS) + target_link_libraries(ll::libcurl INTERFACE + ${ARCH_PREBUILT_DIRS_RELEASE}/libcurl.lib + ll::openssl + ll::nghttp2 + ll::zlib-ng + ) +else () + target_link_libraries(ll::libcurl INTERFACE + ${ARCH_PREBUILT_DIRS_RELEASE}/libcurl.a + ll::openssl + ll::nghttp2 + ll::zlib-ng + ) +endif () target_include_directories( ll::libcurl SYSTEM INTERFACE ${LIBS_PREBUILT_DIR}/include) diff --git a/indra/cmake/Copy3rdPartyLibs.cmake b/indra/cmake/Copy3rdPartyLibs.cmake index 86c5b80fad..c6b89e1de3 100644 --- a/indra/cmake/Copy3rdPartyLibs.cmake +++ b/indra/cmake/Copy3rdPartyLibs.cmake @@ -54,7 +54,6 @@ if(WINDOWS) set(release_src_dir "${ARCH_PREBUILT_DIRS_RELEASE}") set(release_files openjp2.dll - nghttp2.dll ) if(LLCOMMON_LINK_SHARED) @@ -62,15 +61,6 @@ if(WINDOWS) set(release_files ${release_files} libaprutil-1.dll) endif() - # OpenSSL - if(ADDRESS_SIZE EQUAL 64) - set(release_files ${release_files} libcrypto-1_1-x64.dll) - set(release_files ${release_files} libssl-1_1-x64.dll) - else(ADDRESS_SIZE EQUAL 64) - set(release_files ${release_files} libcrypto-1_1.dll) - set(release_files ${release_files} libssl-1_1.dll) - endif(ADDRESS_SIZE EQUAL 64) - # Filenames are different for 32/64 bit BugSplat file and we don't # have any control over them so need to branch. if (USE_BUGSPLAT) @@ -183,8 +173,6 @@ elseif(DARWIN) set(release_src_dir "${ARCH_PREBUILT_DIRS_RELEASE}") set(release_files libndofdev.dylib - libnghttp2.dylib - libnghttp2.14.dylib ) if(LLCOMMON_LINK_SHARED) @@ -226,8 +214,7 @@ elseif(LINUX) set(release_src_dir "${ARCH_PREBUILT_DIRS_RELEASE}") # *FIX - figure out what to do with duplicate libalut.so here -brad set(release_files - ${EXPAT_COPY} - ) + ) if( USE_AUTOBUILD_3P ) list( APPEND release_files diff --git a/indra/cmake/FreeType.cmake b/indra/cmake/FreeType.cmake index 77140af641..563491556d 100644 --- a/indra/cmake/FreeType.cmake +++ b/indra/cmake/FreeType.cmake @@ -1,5 +1,6 @@ # -*- cmake -*- include(Prebuilt) +include(Linking) include_guard() add_library( ll::freetype INTERFACE IMPORTED ) @@ -7,5 +8,10 @@ add_library( ll::freetype INTERFACE IMPORTED ) use_system_binary(freetype) use_prebuilt_binary(freetype) target_include_directories( ll::freetype SYSTEM INTERFACE ${LIBS_PREBUILT_DIR}/include/freetype2/) -target_link_libraries( ll::freetype INTERFACE freetype ) + +if (WINDOWS) + target_link_libraries( ll::freetype INTERFACE ${ARCH_PREBUILT_DIRS_RELEASE}/freetype.lib) +else() + target_link_libraries( ll::freetype INTERFACE ${ARCH_PREBUILT_DIRS_RELEASE}/libfreetype.a) +endif() diff --git a/indra/cmake/LLPrimitive.cmake b/indra/cmake/LLPrimitive.cmake index 1e81532551..d0a52ffb63 100644 --- a/indra/cmake/LLPrimitive.cmake +++ b/indra/cmake/LLPrimitive.cmake @@ -2,6 +2,7 @@ # these should be moved to their own cmake file include(Prebuilt) +include(Linking) include(Boost) include_guard() @@ -24,15 +25,15 @@ use_prebuilt_binary(minizip-ng) # needed for colladadom use_prebuilt_binary(libxml2) if (WINDOWS) - target_link_libraries( ll::minizip-ng INTERFACE libminizip ) + target_link_libraries( ll::minizip-ng INTERFACE ${ARCH_PREBUILT_DIRS_RELEASE}/minizip.lib ) else() - target_link_libraries( ll::minizip-ng INTERFACE minizip ) + target_link_libraries( ll::minizip-ng INTERFACE ${ARCH_PREBUILT_DIRS_RELEASE}/libminizip.a ) endif() if (WINDOWS) - target_link_libraries( ll::libxml INTERFACE libxml2_a) + target_link_libraries( ll::libxml INTERFACE ${ARCH_PREBUILT_DIRS_RELEASE}/libxml2.lib Bcrypt.lib) else() - target_link_libraries( ll::libxml INTERFACE xml2) + target_link_libraries( ll::libxml INTERFACE ${ARCH_PREBUILT_DIRS_RELEASE}/libxml2.a) endif() target_include_directories( ll::colladadom SYSTEM INTERFACE @@ -40,9 +41,9 @@ target_include_directories( ll::colladadom SYSTEM INTERFACE ${LIBS_PREBUILT_DIR}/include/collada/1.4 ) if (WINDOWS) - target_link_libraries(ll::colladadom INTERFACE libcollada14dom23-s ll::libxml ll::minizip-ng ) + target_link_libraries(ll::colladadom INTERFACE ${ARCH_PREBUILT_DIRS_RELEASE}/libcollada14dom23-s.lib ll::libxml ll::minizip-ng ) elseif (DARWIN) - target_link_libraries(ll::colladadom INTERFACE collada14dom ll::libxml ll::minizip-ng) + target_link_libraries(ll::colladadom INTERFACE collada14dom ll::boost ll::libxml ll::minizip-ng) elseif (LINUX) - target_link_libraries(ll::colladadom INTERFACE collada14dom ll::libxml ll::minizip-ng) + target_link_libraries(ll::colladadom INTERFACE collada14dom ll::boost ll::libxml ll::minizip-ng) endif() diff --git a/indra/cmake/NGHTTP2.cmake b/indra/cmake/NGHTTP2.cmake index 6396a5bd01..7b2aa5971f 100644 --- a/indra/cmake/NGHTTP2.cmake +++ b/indra/cmake/NGHTTP2.cmake @@ -8,9 +8,7 @@ use_system_binary(nghttp2) use_prebuilt_binary(nghttp2) if (WINDOWS) target_link_libraries( ll::nghttp2 INTERFACE ${ARCH_PREBUILT_DIRS_RELEASE}/nghttp2.lib) -elseif (DARWIN) - target_link_libraries( ll::nghttp2 INTERFACE libnghttp2.dylib) -else (WINDOWS) - target_link_libraries( ll::nghttp2 INTERFACE libnghttp2.a ) -endif (WINDOWS) +else () + target_link_libraries( ll::nghttp2 INTERFACE ${ARCH_PREBUILT_DIRS_RELEASE}/libnghttp2.a) +endif () target_include_directories( ll::nghttp2 SYSTEM INTERFACE ${LIBS_PREBUILT_DIR}/include/nghttp2) diff --git a/indra/cmake/OpenSSL.cmake b/indra/cmake/OpenSSL.cmake index 3387c74f45..67a84e14af 100644 --- a/indra/cmake/OpenSSL.cmake +++ b/indra/cmake/OpenSSL.cmake @@ -1,5 +1,6 @@ # -*- cmake -*- include(Prebuilt) +include(Linking) include_guard() add_library( ll::openssl INTERFACE IMPORTED ) @@ -7,9 +8,9 @@ add_library( ll::openssl INTERFACE IMPORTED ) use_system_binary(openssl) use_prebuilt_binary(openssl) if (WINDOWS) - target_link_libraries(ll::openssl INTERFACE libssl libcrypto) + target_link_libraries(ll::openssl INTERFACE ${ARCH_PREBUILT_DIRS_RELEASE}/libssl.lib ${ARCH_PREBUILT_DIRS_RELEASE}/libcrypto.lib Crypt32.lib) elseif (LINUX) - target_link_libraries(ll::openssl INTERFACE ssl crypto dl) + target_link_libraries(ll::openssl INTERFACE ${ARCH_PREBUILT_DIRS_RELEASE}/libssl.a ${ARCH_PREBUILT_DIRS_RELEASE}/libcrypto.a dl) else() target_link_libraries(ll::openssl INTERFACE ssl crypto) endif (WINDOWS) diff --git a/indra/cmake/PNG.cmake b/indra/cmake/PNG.cmake index 044262bc8d..e5893e9a20 100644 --- a/indra/cmake/PNG.cmake +++ b/indra/cmake/PNG.cmake @@ -7,8 +7,8 @@ add_library( ll::libpng INTERFACE IMPORTED ) use_system_binary(libpng) use_prebuilt_binary(libpng) if (WINDOWS) - target_link_libraries(ll::libpng INTERFACE libpng16) + target_link_libraries(ll::libpng INTERFACE ${ARCH_PREBUILT_DIRS_RELEASE}/libpng16.lib) else() - target_link_libraries(ll::libpng INTERFACE png16 ) + target_link_libraries(ll::libpng INTERFACE ${ARCH_PREBUILT_DIRS_RELEASE}/libpng16.a) endif() target_include_directories( ll::libpng SYSTEM INTERFACE ${LIBS_PREBUILT_DIR}/include/libpng16) diff --git a/indra/cmake/ZLIBNG.cmake b/indra/cmake/ZLIBNG.cmake index 5d99cd9709..d7b920da26 100644 --- a/indra/cmake/ZLIBNG.cmake +++ b/indra/cmake/ZLIBNG.cmake @@ -12,9 +12,9 @@ endif() use_prebuilt_binary(zlib-ng) if (WINDOWS) - target_link_libraries( ll::zlib-ng INTERFACE zlib ) + target_link_libraries( ll::zlib-ng INTERFACE ${ARCH_PREBUILT_DIRS_RELEASE}/zlib.lib ) else() - target_link_libraries( ll::zlib-ng INTERFACE z ) + target_link_libraries( ll::zlib-ng INTERFACE ${ARCH_PREBUILT_DIRS_RELEASE}/libz.a ) endif (WINDOWS) if( NOT LINUX ) diff --git a/indra/llcorehttp/CMakeLists.txt b/indra/llcorehttp/CMakeLists.txt index d388883575..05b788a433 100644 --- a/indra/llcorehttp/CMakeLists.txt +++ b/indra/llcorehttp/CMakeLists.txt @@ -132,43 +132,6 @@ if (LL_TESTS AND LLCOREHTTP_TESTS) "${CMAKE_CURRENT_SOURCE_DIR}/tests/test_llcorehttp_peer.py" ) -if (DARWIN) - # Path inside the app bundle where we'll need to copy libraries - set(LL_TEST_DESTINATION_DIR - ${CMAKE_BINARY_DIR}/sharedlibs/$,,../>Resources - ) - - # Create the Contents/Resources directory - add_custom_command( - TARGET INTEGRATION_TEST_llcorehttp PRE_BUILD - COMMAND ${CMAKE_COMMAND} - ARGS - -E - make_directory - ${LL_TEST_DESTINATION_DIR} - COMMENT "Creating Resources directory in app bundle." - ) - - # Copy the required libraries to the package app. We used to use a sequence - # of '${CMAKE_COMMAND} -E copy' commands, but 'cmake -E copy' does only a - # single file at a time: it doesn't understand wildcards. 'cmake -E copy' is - # for portability. This operation is Darwin-specific. We can count on the - # 'cp' command. - set(copy_dylibs - libnghttp2*.dylib - ${EXPAT_COPY} - ) - - add_custom_command(TARGET INTEGRATION_TEST_llcorehttp PRE_BUILD - WORKING_DIRECTORY "${AUTOBUILD_INSTALL_DIR}/lib/release" - COMMAND cp -v - ${copy_dylibs} - ${LL_TEST_DESTINATION_DIR} - DEPENDS ${copy_dylibs} - ) - -endif (DARWIN) - # # Example Programs # diff --git a/indra/media_plugins/cef/CMakeLists.txt b/indra/media_plugins/cef/CMakeLists.txt index 410778114d..0d1a833936 100644 --- a/indra/media_plugins/cef/CMakeLists.txt +++ b/indra/media_plugins/cef/CMakeLists.txt @@ -66,7 +66,7 @@ if (WINDOWS) set_target_properties( media_plugin_cef PROPERTIES - LINK_FLAGS "/MANIFEST:NO /SAFESEH:NO /NODEFAULTLIB:LIBCMT /IGNORE:4099" + LINK_FLAGS "/MANIFEST:NO /NODEFAULTLIB:LIBCMT /IGNORE:4099" ) endif (WINDOWS) diff --git a/indra/media_plugins/example/CMakeLists.txt b/indra/media_plugins/example/CMakeLists.txt index 7d3e7f663b..41e2353f31 100644 --- a/indra/media_plugins/example/CMakeLists.txt +++ b/indra/media_plugins/example/CMakeLists.txt @@ -36,7 +36,7 @@ if (WINDOWS) set_target_properties( media_plugin_example PROPERTIES - LINK_FLAGS "/MANIFEST:NO /SAFESEH:NO /LTCG /NODEFAULTLIB:LIBCMT" + LINK_FLAGS "/MANIFEST:NO /NODEFAULTLIB:LIBCMT" ) endif (WINDOWS) diff --git a/indra/media_plugins/libvlc/CMakeLists.txt b/indra/media_plugins/libvlc/CMakeLists.txt index a3c1c4ef99..202cbed96e 100644 --- a/indra/media_plugins/libvlc/CMakeLists.txt +++ b/indra/media_plugins/libvlc/CMakeLists.txt @@ -39,7 +39,7 @@ if (WINDOWS) set_target_properties( media_plugin_libvlc PROPERTIES - LINK_FLAGS "/MANIFEST:NO /SAFESEH:NO /NODEFAULTLIB:LIBCMT" + LINK_FLAGS "/MANIFEST:NO /NODEFAULTLIB:LIBCMT" ) endif (WINDOWS) diff --git a/indra/newview/CMakeLists.txt b/indra/newview/CMakeLists.txt index f7c5010e72..87823d5e9c 100644 --- a/indra/newview/CMakeLists.txt +++ b/indra/newview/CMakeLists.txt @@ -1749,15 +1749,11 @@ if (WINDOWS) list(APPEND COPY_INPUT_DEPENDENCIES ${SHARED_LIB_STAGING_DIR}/vivoxsdk_x64.dll ${SHARED_LIB_STAGING_DIR}/ortp_x64.dll - ${ARCH_PREBUILT_DIRS_RELEASE}/libcrypto-1_1-x64.dll - ${ARCH_PREBUILT_DIRS_RELEASE}/libssl-1_1-x64.dll ) else (ADDRESS_SIZE EQUAL 64) list(APPEND COPY_INPUT_DEPENDENCIES ${SHARED_LIB_STAGING_DIR}/vivoxsdk.dll ${SHARED_LIB_STAGING_DIR}/ortp.dll - ${ARCH_PREBUILT_DIRS_RELEASE}/libcrypto-1_1.dll - ${ARCH_PREBUILT_DIRS_RELEASE}/libssl-1_1.dll ) endif (ADDRESS_SIZE EQUAL 64) diff --git a/indra/newview/viewer_manifest.py b/indra/newview/viewer_manifest.py index ea4b2ff4f4..91a9347449 100755 --- a/indra/newview/viewer_manifest.py +++ b/indra/newview/viewer_manifest.py @@ -580,13 +580,6 @@ class Windows_x86_64_Manifest(ViewerManifest): self.path("vivoxsdk_x64.dll") self.path("ortp_x64.dll") - # OpenSSL - self.path("libcrypto-1_1-x64.dll") - self.path("libssl-1_1-x64.dll") - - # HTTP/2 - self.path("nghttp2.dll") - # BugSplat if self.args.get('bugsplat'): self.path("BsSndRpt64.exe") @@ -1007,14 +1000,6 @@ class Darwin_x86_64_Manifest(ViewerManifest): # Need to get the llcommon dll from any of the build directories as well. libfile_parent = self.get_dst_prefix() dylibs=[] - for libfile in ( - # libnghttp2.dylib is a symlink to - # libnghttp2.major.dylib, which is a symlink to - # libnghttp2.version.dylib. Get all of them. - "libnghttp2.*dylib", - ): - dylibs += path_optional(os.path.join(relpkgdir, libfile), libfile) - # SLVoice executable with self.prefix(src=os.path.join(pkgdir, 'bin', 'release')): self.path("SLVoice") -- cgit v1.2.3 From 3f9a38bb4bf7514e575315c3c304e04e9b828c8b Mon Sep 17 00:00:00 2001 From: Alexander Gavriliuk Date: Mon, 12 Aug 2024 15:20:46 +0200 Subject: #2255 BugSplat Crash #1503774: SecondLifeViewer!LLViewerOctreeGroup::hasState(227) --- indra/newview/llspatialpartition.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/indra/newview/llspatialpartition.cpp b/indra/newview/llspatialpartition.cpp index ffe5fa394f..b1f80e48af 100644 --- a/indra/newview/llspatialpartition.cpp +++ b/indra/newview/llspatialpartition.cpp @@ -1051,7 +1051,8 @@ public: LLSpatialGroup* group = (LLSpatialGroup*)base_group; group->checkOcclusion(); - if (group->getOctreeNode()->getParent() && //never occlusion cull the root node + if (group->getOctreeNode() && + group->getOctreeNode()->getParent() && //never occlusion cull the root node LLPipeline::sUseOcclusion && //ignore occlusion if disabled group->isOcclusionState(LLSpatialGroup::OCCLUDED)) { -- cgit v1.2.3 From c1bc32ad42413342dfff396c7b37372619a03f72 Mon Sep 17 00:00:00 2001 From: Alexander Gavriliuk Date: Mon, 12 Aug 2024 14:40:40 +0200 Subject: #2253 BugSplat Crash #1504389: SecondLifeViewer!LLVOAvatar::updateRiggingInfo(10561) --- indra/newview/llvoavatar.cpp | 57 ++++++++++++++++++++------------------------ 1 file changed, 26 insertions(+), 31 deletions(-) diff --git a/indra/newview/llvoavatar.cpp b/indra/newview/llvoavatar.cpp index f813df3fb5..09375a6930 100644 --- a/indra/newview/llvoavatar.cpp +++ b/indra/newview/llvoavatar.cpp @@ -10634,18 +10634,19 @@ void showRigInfoTabExtents(LLVOAvatar *avatar, LLJointRiggingInfoTab& tab, S32& void LLVOAvatar::getAssociatedVolumes(std::vector& volumes) { LL_PROFILE_ZONE_SCOPED_CATEGORY_AVATAR; - for ( LLVOAvatar::attachment_map_t::iterator iter = mAttachmentPoints.begin(); iter != mAttachmentPoints.end(); ++iter ) + for (const auto& iter : mAttachmentPoints) { - LLViewerJointAttachment* attachment = iter->second; + LLViewerJointAttachment* attachment = iter.second; LLViewerJointAttachment::attachedobjs_vec_t::iterator attach_end = attachment->mAttachedObjects.end(); - for (LLViewerJointAttachment::attachedobjs_vec_t::iterator attach_iter = attachment->mAttachedObjects.begin(); - attach_iter != attach_end; ++attach_iter) + for (LLViewerObject* attached_object : attachment->mAttachedObjects) { - LLViewerObject* attached_object = attach_iter->get(); - LLVOVolume *volume = dynamic_cast(attached_object); - if (volume) + if (attached_object->isDead()) + continue; + + if (attached_object->getPCode() == LL_PCODE_VOLUME) { + LLVOVolume* volume = (LLVOVolume*)attached_object; volumes.push_back(volume); if (volume->isAnimatedObject()) { @@ -10655,15 +10656,12 @@ void LLVOAvatar::getAssociatedVolumes(std::vector& volumes) continue; } } - LLViewerObject::const_child_list_t& children = attached_object->getChildren(); - for (LLViewerObject::const_child_list_t::const_iterator it = children.begin(); - it != children.end(); ++it) + + for (LLViewerObject* childp : attached_object->getChildren()) { - LLViewerObject *childp = *it; - LLVOVolume *volume = dynamic_cast(childp); - if (volume) + if (!childp->isDead() && childp->getPCode() == LL_PCODE_VOLUME) { - volumes.push_back(volume); + volumes.push_back((LLVOVolume*)childp); } } } @@ -10702,33 +10700,30 @@ void LLVOAvatar::updateRiggingInfo() getAssociatedVolumes(volumes); - std::map curr_rigging_info_key; + std::map curr_rigging_info_key; + + // Get current rigging info key + for (LLVOVolume* vol : volumes) { - // Get current rigging info key - for (std::vector::iterator it = volumes.begin(); it != volumes.end(); ++it) + if (vol->isMesh() && vol->getVolume()) { - LLVOVolume *vol = *it; - if (vol->isMesh() && vol->getVolume()) - { - const LLUUID& mesh_id = vol->getVolume()->getParams().getSculptID(); - S32 max_lod = llmax(vol->getLOD(), vol->mLastRiggingInfoLOD); - curr_rigging_info_key[mesh_id] = max_lod; - } + const LLUUID& mesh_id = vol->getVolume()->getParams().getSculptID(); + S32 max_lod = llmax(vol->getLOD(), vol->mLastRiggingInfoLOD); + curr_rigging_info_key[mesh_id] = max_lod; } + } - // Check for key change, which indicates some change in volume composition or LOD. - if (curr_rigging_info_key == mLastRiggingInfoKey) - { - return; - } + // Check for key change, which indicates some change in volume composition or LOD. + if (curr_rigging_info_key == mLastRiggingInfoKey) + { + return; } // Something changed. Update. mLastRiggingInfoKey = curr_rigging_info_key; mJointRiggingInfoTab.clear(); - for (std::vector::iterator it = volumes.begin(); it != volumes.end(); ++it) + for (LLVOVolume* vol : volumes) { - LLVOVolume *vol = *it; vol->updateRiggingInfo(); mJointRiggingInfoTab.merge(vol->mJointRiggingInfoTab); } -- cgit v1.2.3 From 50e05c70d38c0e9da654cbc0f1758809e7159744 Mon Sep 17 00:00:00 2001 From: Beq Janus Date: Mon, 12 Aug 2024 19:01:34 +0100 Subject: Interim fix for particles no longer rezzing properly. (#2227) In a previous PR, I noted: Note this change moves the calcPixelArea() call to the top BEFORE we user getPixelArea(). Either that call is entirely redundant (i.e. if calc was called earlier in the frame) or we were using the stale pixelArea (one frame behind). If the former is true then it might be faster to just do an AABB frustum check. It turns out that by moving the calcPixelArea to the "correct place", we break the rezzing of particles which are then being downsampled as a result. Moving this back to the "incorrect" location undoes the immediate effect but this whole scenario may need to be re-examined. --- indra/newview/llviewertexturelist.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/indra/newview/llviewertexturelist.cpp b/indra/newview/llviewertexturelist.cpp index 865805f9bf..7047ce7d29 100644 --- a/indra/newview/llviewertexturelist.cpp +++ b/indra/newview/llviewertexturelist.cpp @@ -938,9 +938,9 @@ void LLViewerTextureList::updateImageDecodePriority(LLViewerFetchedTexture* imag onFace = true; F32 radius; F32 cos_angle_to_view_dir; - bool in_frustum = face->calcPixelArea(cos_angle_to_view_dir, radius); static LLCachedControl bias_unimportant_threshold(gSavedSettings, "TextureBiasUnimportantFactor", 0.25f); F32 vsize = face->getPixelArea(); + bool in_frustum = face->calcPixelArea(cos_angle_to_view_dir, radius); // Scale desired texture resolution higher or lower depending on texture scale // -- cgit v1.2.3 From dc314602d5c4b26c9d778fee439bef438721df14 Mon Sep 17 00:00:00 2001 From: Nat Goodspeed Date: Tue, 13 Aug 2024 11:30:41 -0400 Subject: Allow triggering an EDU build with a tag containing "edu" --- .github/workflows/build.yaml | 31 ++++++++++++++++++++----------- 1 file changed, 20 insertions(+), 11 deletions(-) diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index 57faafc042..dd78c46964 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -220,20 +220,29 @@ jobs: [[ "$arch" == "MINGW6" ]] && arch=CYGWIN export AUTOBUILD="$(which autobuild)" - # determine the viewer channel from the branch name - branch=$AUTOBUILD_VCS_BRANCH - IFS='/' read -ra ba <<< "$branch" - prefix=${ba[0]} - if [ "$prefix" == "project" ]; then - IFS='_' read -ra prj <<< "${ba[1]}" - # uppercase first letter of each word - export viewer_channel="Second Life Project ${prj[*]^}" - elif [[ "$prefix" == "release" || "$prefix" == "main" ]]; + # determine the viewer channel from the branch or tag name + # trigger an EDU build by including "edu" in the tag + edu=${{ github.ref_type == 'tag' && contains(github.ref_name, 'edu') }} + echo "ref_type=${{ github.ref_type }}, ref_name=${{ github.ref_name }}, edu='$edu'" + if [[ "$edu" == "true" ]] then - export viewer_channel="Second Life Release" + export viewer_channel="Second Life Release edu" else - export viewer_channel="Second Life Test" + branch=$AUTOBUILD_VCS_BRANCH + IFS='/' read -ra ba <<< "$branch" + prefix=${ba[0]} + if [ "$prefix" == "project" ]; then + IFS='_' read -ra prj <<< "${ba[1]}" + # uppercase first letter of each word + export viewer_channel="Second Life Project ${prj[*]^}" + elif [[ "$prefix" == "release" || "$prefix" == "main" ]]; + then + export viewer_channel="Second Life Release" + else + export viewer_channel="Second Life Test" + fi fi + echo "viewer_channel=$viewer_channel" echo "viewer_channel=$viewer_channel" >> "$GITHUB_OUTPUT" # On windows we need to point the build to the correct python # as neither CMake's FindPython nor our custom Python.cmake module -- cgit v1.2.3 From 54334ff6e377e35c97df3a0fe2a859795ec07b21 Mon Sep 17 00:00:00 2001 From: Andrey Lihatskiy Date: Mon, 22 Jul 2024 18:47:41 +0300 Subject: Update expired cert in integration test see fe8c976 for more info (cherry picked from commit bd6b6acf223ebeec5ada8059422473227396f6a6) --- indra/newview/tests/llsechandler_basic_test.cpp | 670 ++++++++++++------------ 1 file changed, 345 insertions(+), 325 deletions(-) diff --git a/indra/newview/tests/llsechandler_basic_test.cpp b/indra/newview/tests/llsechandler_basic_test.cpp index bfe32406cb..cf37a4713c 100644 --- a/indra/newview/tests/llsechandler_basic_test.cpp +++ b/indra/newview/tests/llsechandler_basic_test.cpp @@ -232,381 +232,402 @@ namespace tut "Certificate:\n" " Data:\n" " Version: 3 (0x2)\n" - " Serial Number:\n" - " 82:2f:8f:eb:8d:06:24:b0\n" + " Serial Number: ef:54:d8:f7:da:18:e8:19\n" " Signature Algorithm: sha256WithRSAEncryption\n" " Issuer: C=US, ST=California, L=San Francisco, O=Linden Lab, OU=Second Life Engineering, CN=Integration Test Root CA/emailAddress=noreply@lindenlab.com\n" " Validity\n" - " Not Before: May 22 22:19:45 2018 GMT\n" - " Not After : May 17 22:19:45 2038 GMT\n" + " Not Before: Jul 23 11:46:26 2024 GMT\n" + " Not After : Jul 21 11:46:26 2034 GMT\n" " Subject: C=US, ST=California, L=San Francisco, O=Linden Lab, OU=Second Life Engineering, CN=Integration Test Root CA/emailAddress=noreply@lindenlab.com\n" " Subject Public Key Info:\n" " Public Key Algorithm: rsaEncryption\n" " Public-Key: (4096 bit)\n" " Modulus:\n" - " 00:bd:e0:79:dd:3b:a6:ac:87:d0:39:f0:58:c7:a4:\n" - " 42:42:f6:5f:93:b0:36:04:b5:e2:d5:f7:2a:c0:6c:\n" - " a0:13:d2:1e:02:81:57:02:50:4c:57:b7:ef:27:9e:\n" - " f6:f1:f1:30:30:72:1e:57:34:e5:3f:82:3c:21:c4:\n" - " 66:d2:73:63:6c:91:e6:dd:49:9e:9c:b1:34:6a:81:\n" - " 45:a1:6e:c4:50:28:f2:d8:e3:fe:80:2f:83:aa:28:\n" - " 91:b4:8c:57:c9:f1:16:d9:0c:87:3c:25:80:a0:81:\n" - " 8d:71:f2:96:e2:16:f1:97:c4:b0:d8:53:bb:13:6c:\n" - " 73:54:2f:29:94:85:cf:86:6e:75:71:ad:39:e3:fc:\n" - " 39:12:53:93:1c:ce:39:e0:33:da:49:b7:3d:af:b0:\n" - " 37:ce:77:09:03:27:32:70:c0:9c:7f:9c:89:ce:90:\n" - " 45:b0:7d:94:8b:ff:13:27:ba:88:7f:ae:c4:aa:73:\n" - " d5:47:b8:87:69:89:80:0c:c1:22:18:78:c2:0d:47:\n" - " d9:10:ff:80:79:0d:46:71:ec:d9:ba:c9:f3:77:fd:\n" - " 92:6d:1f:0f:d9:54:18:6d:f6:72:24:5c:5c:3d:43:\n" - " 49:35:3e:1c:28:de:7e:44:dc:29:c3:9f:62:04:46:\n" - " aa:c4:e6:69:6a:15:f8:e3:74:1c:14:e9:f4:97:7c:\n" - " 30:6c:d4:28:fc:2a:0e:1d:6d:39:2e:1d:f9:17:43:\n" - " 35:5d:23:e7:ba:e3:a8:e9:97:6b:3c:3e:23:ef:d8:\n" - " bc:fb:7a:57:37:39:93:59:03:fc:78:ca:b1:31:ef:\n" - " 26:19:ed:56:e1:63:c3:ad:99:80:5b:47:b5:03:35:\n" - " 5f:fe:6a:a6:21:63:ec:50:fb:4e:c9:f9:ae:a5:66:\n" - " d0:55:33:8d:e6:c5:50:5a:c6:8f:5c:34:45:a7:72:\n" - " da:50:f6:66:4c:19:f5:d1:e4:fb:11:8b:a1:b5:4e:\n" - " 09:43:81:3d:39:28:86:3b:fe:07:28:97:02:b5:3a:\n" - " 07:5f:4a:20:80:1a:7d:a4:8c:f7:6c:f6:c5:9b:f6:\n" - " 61:e5:c7:b0:c3:d5:58:38:7b:bb:47:1e:34:d6:16:\n" - " 55:c5:d2:6c:b0:93:77:b1:90:69:06:b1:53:cb:1b:\n" - " 84:71:cf:b8:87:1b:1e:44:35:b4:2b:bb:04:59:58:\n" - " 0b:e8:93:d8:ae:21:9b:b1:1c:89:30:ae:11:80:77:\n" - " cc:16:f3:d6:35:ed:a1:b3:70:b3:4f:cd:a1:56:99:\n" - " ee:0e:c0:00:a4:09:70:c3:5b:0b:be:a1:07:18:dd:\n" - " c6:f4:6d:8b:58:bc:f9:bb:4b:01:2c:f6:cc:2c:9b:\n" - " 87:0e:b1:4f:9c:10:be:fc:45:e2:a4:ec:7e:fc:ff:\n" - " 45:b8:53\n" + " 00:c6:cc:07:f4:0b:17:06:4d:a6:30:b4:c7:02:6b:\n" + " 9d:a4:47:a6:09:0e:60:1a:32:d4:6b:42:88:ee:c5:\n" + " b9:e9:fb:b5:0b:60:dc:a2:45:92:a5:bb:88:12:fc:\n" + " 42:1a:80:32:79:16:62:7a:97:af:84:28:53:3c:c1:\n" + " f2:68:c0:4e:45:e4:0a:63:f9:34:1d:a2:8b:cc:70:\n" + " df:c6:65:c0:ba:31:32:d2:9d:0c:c8:ce:dc:11:12:\n" + " a4:11:fa:d3:c8:56:e2:31:8a:e3:fb:91:40:da:25:\n" + " 55:d1:f2:75:9b:4d:fa:b8:1f:b5:6d:9b:e1:fe:5d:\n" + " e8:c4:02:79:14:ef:7d:5a:b3:3a:1e:b6:d0:60:2c:\n" + " 90:dc:22:e2:c5:ae:85:1f:b4:9d:7a:20:f8:af:63:\n" + " 56:25:1a:64:f3:9c:3f:9a:cf:68:08:0a:37:db:d0:\n" + " a3:65:26:db:80:82:ff:e0:1b:51:c8:ee:f6:ad:c2:\n" + " b4:f2:ab:d2:e8:85:86:77:28:d0:63:4a:71:78:41:\n" + " e3:8c:7f:71:51:31:af:24:3f:fa:8d:d0:d8:0b:e2:\n" + " 7e:79:33:8a:bb:d2:00:9e:2e:c8:cd:d5:50:92:b8:\n" + " 5c:5a:0b:99:ef:05:39:67:da:be:70:36:51:37:37:\n" + " 20:6f:84:ab:29:11:00:7b:38:32:ba:0b:bc:34:a6:\n" + " b5:c6:a7:f0:c0:25:2d:38:0b:72:40:ab:cf:e6:ff:\n" + " 97:75:ff:e2:a9:3c:2a:57:ce:e4:52:20:8c:de:fe:\n" + " 68:ce:54:85:37:ba:b3:7f:2e:53:58:ea:9b:ac:79:\n" + " 6b:16:65:b8:11:88:5a:46:eb:9e:9e:80:3c:89:91:\n" + " 35:e0:c5:33:45:c8:86:4d:25:51:39:b1:72:97:2b:\n" + " b3:c8:c9:e8:11:cd:32:41:c8:c1:56:22:7e:33:81:\n" + " 85:61:ab:da:9e:6e:5f:24:1c:0f:9b:fa:da:9d:86:\n" + " 1a:66:f6:32:2a:10:80:ea:72:7a:4a:ef:c0:f2:7c:\n" + " 43:02:e6:70:19:6a:e1:02:0a:00:80:51:1c:a3:03:\n" + " 8b:6d:89:9f:91:37:90:d6:d8:9c:73:77:06:9e:bc:\n" + " 95:89:66:ee:43:40:a3:ee:43:a3:f6:2d:43:dd:7b:\n" + " f0:2f:0b:12:37:49:b7:81:5a:e2:54:6d:71:88:ff:\n" + " fe:7e:41:25:35:4c:b4:b9:62:65:dd:9f:1f:7a:06:\n" + " 6e:2b:20:58:78:da:08:66:a8:f1:89:de:8f:7f:5c:\n" + " 5e:c2:72:33:7f:b6:8e:41:4c:26:f6:4c:d4:0e:11:\n" + " 44:da:c7:14:f7:8b:79:4e:53:29:87:15:b1:12:e9:\n" + " 19:2b:54:33:d6:2e:7f:bd:42:20:be:fc:d7:9c:b4:\n" + " 7a:0a:db\n" " Exponent: 65537 (0x10001)\n" " X509v3 extensions:\n" - " X509v3 Subject Key Identifier: \n" - " 8A:22:C6:9C:2E:11:F3:40:0C:CE:82:0C:22:59:FF:F8:7F:D0:B9:13\n" - " X509v3 Authority Key Identifier: \n" - " keyid:8A:22:C6:9C:2E:11:F3:40:0C:CE:82:0C:22:59:FF:F8:7F:D0:B9:13\n" + " X509v3 Subject Key Identifier:\n" + " 4D:7D:AE:0D:A5:5E:22:5A:6A:8F:19:61:54:B3:58:CB:7B:C0:BD:DA\n" + " X509v3 Authority Key Identifier:\n" + " keyid:4D:7D:AE:0D:A5:5E:22:5A:6A:8F:19:61:54:B3:58:CB:7B:C0:BD:DA\n" "\n" - " X509v3 Basic Constraints: critical\n" + " X509v3 Basic Constraints:\n" " CA:TRUE\n" - " X509v3 Key Usage: critical\n" - " Digital Signature, Certificate Sign, CRL Sign\n" " Signature Algorithm: sha256WithRSAEncryption\n" - " b3:cb:33:eb:0e:02:64:f4:55:9a:3d:03:9a:cf:6a:4c:18:43:\n" - " f7:42:cb:65:dc:61:52:e5:9f:2f:42:97:3c:93:16:22:d4:af:\n" - " ae:b2:0f:c3:9b:ef:e0:cc:ee:b6:b1:69:a3:d8:da:26:c3:ad:\n" - " 3b:c5:64:dc:9f:d4:c2:53:4b:91:6d:c4:92:09:0b:ac:f0:99:\n" - " be:6f:b9:3c:03:4a:6d:9f:01:5d:ec:5a:9a:f3:a7:e5:3b:2c:\n" - " 99:57:7d:7e:25:15:68:20:12:30:96:16:86:f5:db:74:90:60:\n" - " fe:8b:df:99:f6:f7:62:49:9f:bc:8d:45:23:0a:c8:73:b8:79:\n" - " 80:3c:b9:e5:72:85:4b:b3:81:66:74:a2:72:92:4c:44:fd:7b:\n" - " 46:2e:21:a2:a9:81:a2:f3:26:4d:e3:89:7d:78:b0:c6:6f:b5:\n" - " 87:cb:ee:25:ed:27:1f:75:13:fa:6d:e9:37:73:ad:07:bb:af:\n" - " d3:6c:87:ea:02:01:70:bd:53:aa:ce:39:2c:d4:66:39:33:aa:\n" - " d1:9c:ee:67:e3:a9:45:d2:7b:2e:54:09:af:70:5f:3f:5a:67:\n" - " 2e:6c:72:ef:e0:9d:92:28:4a:df:ba:0b:b7:23:ca:5b:04:11:\n" - " 45:d1:51:e9:ea:c9:ec:54:fa:34:46:ae:fc:dc:6c:f8:1e:2c:\n" - " 9e:f4:71:51:8d:b5:a1:26:9a:13:30:be:1e:41:25:59:58:05:\n" - " 2c:64:c8:f9:5e:38:ae:dc:93:b0:8a:d6:38:74:02:cb:ce:ce:\n" - " 95:31:76:f6:7c:bf:a4:a1:8e:27:fd:ca:74:82:d1:e1:4d:b6:\n" - " 48:51:fa:c5:17:59:22:a3:84:be:82:c8:83:ec:61:a0:f4:ee:\n" - " 2c:e3:a3:ea:e5:51:c9:d3:4f:db:85:bd:ba:7a:52:14:b6:03:\n" - " ed:43:17:d8:d7:1c:22:5e:c9:56:d9:d6:81:96:11:e3:5e:01:\n" - " 40:91:30:09:da:a3:5f:d3:27:60:e5:9d:6c:da:d0:f0:39:01:\n" - " 23:4a:a6:15:7a:4a:82:eb:ec:72:4a:1d:36:dc:6f:83:c4:85:\n" - " 84:b5:8d:cd:09:e5:12:63:f3:21:56:c8:64:6b:db:b8:cf:d4:\n" - " df:ca:a8:24:8e:df:8d:63:a5:96:84:bf:ff:8b:7e:46:7a:f0:\n" - " c7:73:7c:70:8a:f5:17:d0:ac:c8:89:1e:d7:89:42:0f:4d:66:\n" - " c4:d8:bb:36:a8:ae:ca:e1:cf:e2:88:f6:cf:b0:44:4a:5f:81:\n" - " 50:4b:d6:28:81:cd:6c:f0:ec:e6:09:08:f2:59:91:a2:69:ac:\n" - " c7:81:fa:ab:61:3e:db:6f:f6:7f:db:1a:9e:b9:5d:cc:cc:33:\n" - " fa:95:c6:f7:8d:4b:30:f3\n" + " 5b:40:71:96:c8:d1:57:3f:fc:f2:3c:75:fb:c9:a6:a7:63:8a:\n" + " 22:23:96:0f:40:77:77:e2:7f:76:fc:5f:7b:1c:bd:ea:ca:f0:\n" + " be:1a:fd:59:e6:0e:00:d1:78:44:01:28:f4:01:68:67:78:cf:\n" + " 78:43:36:ac:b2:5c:13:0e:2a:94:59:88:9e:64:46:42:0a:9b:\n" + " be:7d:2d:10:11:fe:8b:64:01:fb:00:c5:2e:47:63:c0:93:3a:\n" + " 4a:f8:6c:fc:a9:16:58:ab:bc:7b:6b:20:31:9d:d7:d8:84:01:\n" + " cc:ce:52:7f:a1:18:2f:5c:c9:59:58:9a:98:b9:ef:54:d7:a0:\n" + " 56:79:28:ba:ad:f5:e5:fd:7e:d8:d6:be:dd:25:76:6f:fa:8a:\n" + " 07:f6:8e:0f:83:43:19:ee:96:c4:c9:54:df:19:5a:4c:ae:25:\n" + " 57:a2:5d:d5:e8:0a:66:d8:19:e9:c4:44:ba:6a:3b:b3:86:ae:\n" + " 44:c0:7c:6e:e5:a0:6c:45:bb:7f:34:94:e9:d3:d4:f4:04:0b:\n" + " eb:fc:9a:fa:67:d4:e5:83:5e:08:09:9c:70:a9:d3:0d:8a:08:\n" + " ed:3c:04:33:4f:ac:02:d9:5c:99:62:12:fc:0e:8d:55:8a:ce:\n" + " ca:28:5a:1a:9e:c9:59:8e:f0:f5:19:c7:30:1e:59:1f:3c:77:\n" + " 6d:fc:a2:31:ec:bf:83:fd:14:26:91:68:88:05:4c:87:82:e0:\n" + " 33:f4:ee:d8:56:97:23:3a:00:9b:e7:a2:10:c2:83:28:c6:c0:\n" + " c1:92:49:95:c1:d3:e1:43:e8:8f:0c:d0:ae:e3:50:17:1a:8d:\n" + " 0f:4a:60:71:76:8e:9e:fb:15:76:cd:cd:69:2c:59:24:69:d2:\n" + " 0f:f2:d5:0e:96:95:2b:2e:d7:81:ed:b3:7b:6f:ce:60:32:b5:\n" + " f0:f6:74:ea:27:3a:ee:2c:96:7b:e0:06:6c:33:25:c4:60:da:\n" + " 76:de:c4:a1:22:b6:b1:63:57:10:3c:62:60:98:47:39:9e:38:\n" + " ce:c7:ef:75:75:19:d3:26:2a:cf:46:e3:b0:72:38:49:ee:c3:\n" + " 4e:52:97:e5:e5:b8:bc:b1:45:56:98:54:0a:63:c8:87:ff:a0:\n" + " cb:28:12:5c:8f:a2:6e:a7:f9:50:98:2d:a5:26:08:df:16:29:\n" + " 19:63:7f:6c:b4:41:20:f7:5d:ef:6a:90:fd:1a:08:1c:c2:4c:\n" + " 3e:77:ea:e0:df:c0:dd:aa:a2:36:e7:e8:be:98:39:0a:68:59:\n" + " 8e:a0:71:2f:7c:92:ab:e0:c4:c1:c2:eb:89:b6:34:ce:44:ab:\n" + " f9:f6:a4:c8:7b:ad:a8:bc:c9:04:7c:d5:4c:a4:d2:8b:54:23:\n" + " 89:68:86:4e:07:36:d9:bc\n" "-----BEGIN CERTIFICATE-----\n" - "MIIGXDCCBESgAwIBAgIJAIIvj+uNBiSwMA0GCSqGSIb3DQEBCwUAMIG6MQswCQYD\n" + "MIIGSTCCBDGgAwIBAgIJAO9U2PfaGOgZMA0GCSqGSIb3DQEBCwUAMIG6MQswCQYD\n" "VQQGEwJVUzETMBEGA1UECAwKQ2FsaWZvcm5pYTEWMBQGA1UEBwwNU2FuIEZyYW5j\n" "aXNjbzETMBEGA1UECgwKTGluZGVuIExhYjEgMB4GA1UECwwXU2Vjb25kIExpZmUg\n" "RW5naW5lZXJpbmcxITAfBgNVBAMMGEludGVncmF0aW9uIFRlc3QgUm9vdCBDQTEk\n" - "MCIGCSqGSIb3DQEJARYVbm9yZXBseUBsaW5kZW5sYWIuY29tMB4XDTE4MDUyMjIy\n" - "MTk0NVoXDTM4MDUxNzIyMTk0NVowgboxCzAJBgNVBAYTAlVTMRMwEQYDVQQIDApD\n" + "MCIGCSqGSIb3DQEJARYVbm9yZXBseUBsaW5kZW5sYWIuY29tMB4XDTI0MDcyMzEx\n" + "NDYyNloXDTM0MDcyMTExNDYyNlowgboxCzAJBgNVBAYTAlVTMRMwEQYDVQQIDApD\n" "YWxpZm9ybmlhMRYwFAYDVQQHDA1TYW4gRnJhbmNpc2NvMRMwEQYDVQQKDApMaW5k\n" "ZW4gTGFiMSAwHgYDVQQLDBdTZWNvbmQgTGlmZSBFbmdpbmVlcmluZzEhMB8GA1UE\n" "AwwYSW50ZWdyYXRpb24gVGVzdCBSb290IENBMSQwIgYJKoZIhvcNAQkBFhVub3Jl\n" "cGx5QGxpbmRlbmxhYi5jb20wggIiMA0GCSqGSIb3DQEBAQUAA4ICDwAwggIKAoIC\n" - "AQC94HndO6ash9A58FjHpEJC9l+TsDYEteLV9yrAbKAT0h4CgVcCUExXt+8nnvbx\n" - "8TAwch5XNOU/gjwhxGbSc2NskebdSZ6csTRqgUWhbsRQKPLY4/6AL4OqKJG0jFfJ\n" - "8RbZDIc8JYCggY1x8pbiFvGXxLDYU7sTbHNULymUhc+GbnVxrTnj/DkSU5Mczjng\n" - "M9pJtz2vsDfOdwkDJzJwwJx/nInOkEWwfZSL/xMnuoh/rsSqc9VHuIdpiYAMwSIY\n" - "eMINR9kQ/4B5DUZx7Nm6yfN3/ZJtHw/ZVBht9nIkXFw9Q0k1Phwo3n5E3CnDn2IE\n" - "RqrE5mlqFfjjdBwU6fSXfDBs1Cj8Kg4dbTkuHfkXQzVdI+e646jpl2s8PiPv2Lz7\n" - "elc3OZNZA/x4yrEx7yYZ7VbhY8OtmYBbR7UDNV/+aqYhY+xQ+07J+a6lZtBVM43m\n" - "xVBaxo9cNEWnctpQ9mZMGfXR5PsRi6G1TglDgT05KIY7/gcolwK1OgdfSiCAGn2k\n" - "jPds9sWb9mHlx7DD1Vg4e7tHHjTWFlXF0mywk3exkGkGsVPLG4Rxz7iHGx5ENbQr\n" - "uwRZWAvok9iuIZuxHIkwrhGAd8wW89Y17aGzcLNPzaFWme4OwACkCXDDWwu+oQcY\n" - "3cb0bYtYvPm7SwEs9swsm4cOsU+cEL78ReKk7H78/0W4UwIDAQABo2MwYTAdBgNV\n" - "HQ4EFgQUiiLGnC4R80AMzoIMIln/+H/QuRMwHwYDVR0jBBgwFoAUiiLGnC4R80AM\n" - "zoIMIln/+H/QuRMwDwYDVR0TAQH/BAUwAwEB/zAOBgNVHQ8BAf8EBAMCAYYwDQYJ\n" - "KoZIhvcNAQELBQADggIBALPLM+sOAmT0VZo9A5rPakwYQ/dCy2XcYVLlny9ClzyT\n" - "FiLUr66yD8Ob7+DM7raxaaPY2ibDrTvFZNyf1MJTS5FtxJIJC6zwmb5vuTwDSm2f\n" - "AV3sWprzp+U7LJlXfX4lFWggEjCWFob123SQYP6L35n292JJn7yNRSMKyHO4eYA8\n" - "ueVyhUuzgWZ0onKSTET9e0YuIaKpgaLzJk3jiX14sMZvtYfL7iXtJx91E/pt6Tdz\n" - "rQe7r9Nsh+oCAXC9U6rOOSzUZjkzqtGc7mfjqUXSey5UCa9wXz9aZy5scu/gnZIo\n" - "St+6C7cjylsEEUXRUenqyexU+jRGrvzcbPgeLJ70cVGNtaEmmhMwvh5BJVlYBSxk\n" - "yPleOK7ck7CK1jh0AsvOzpUxdvZ8v6Shjif9ynSC0eFNtkhR+sUXWSKjhL6CyIPs\n" - "YaD07izjo+rlUcnTT9uFvbp6UhS2A+1DF9jXHCJeyVbZ1oGWEeNeAUCRMAnao1/T\n" - "J2DlnWza0PA5ASNKphV6SoLr7HJKHTbcb4PEhYS1jc0J5RJj8yFWyGRr27jP1N/K\n" - "qCSO341jpZaEv/+LfkZ68MdzfHCK9RfQrMiJHteJQg9NZsTYuzaorsrhz+KI9s+w\n" - "REpfgVBL1iiBzWzw7OYJCPJZkaJprMeB+qthPttv9n/bGp65XczMM/qVxveNSzDz\n" + "AQDGzAf0CxcGTaYwtMcCa52kR6YJDmAaMtRrQojuxbnp+7ULYNyiRZKlu4gS/EIa\n" + "gDJ5FmJ6l6+EKFM8wfJowE5F5Apj+TQdoovMcN/GZcC6MTLSnQzIztwREqQR+tPI\n" + "VuIxiuP7kUDaJVXR8nWbTfq4H7Vtm+H+XejEAnkU731aszoettBgLJDcIuLFroUf\n" + "tJ16IPivY1YlGmTznD+az2gICjfb0KNlJtuAgv/gG1HI7vatwrTyq9LohYZ3KNBj\n" + "SnF4QeOMf3FRMa8kP/qN0NgL4n55M4q70gCeLsjN1VCSuFxaC5nvBTln2r5wNlE3\n" + "NyBvhKspEQB7ODK6C7w0prXGp/DAJS04C3JAq8/m/5d1/+KpPCpXzuRSIIze/mjO\n" + "VIU3urN/LlNY6puseWsWZbgRiFpG656egDyJkTXgxTNFyIZNJVE5sXKXK7PIyegR\n" + "zTJByMFWIn4zgYVhq9qebl8kHA+b+tqdhhpm9jIqEIDqcnpK78DyfEMC5nAZauEC\n" + "CgCAURyjA4ttiZ+RN5DW2JxzdwaevJWJZu5DQKPuQ6P2LUPde/AvCxI3SbeBWuJU\n" + "bXGI//5+QSU1TLS5YmXdnx96Bm4rIFh42ghmqPGJ3o9/XF7CcjN/to5BTCb2TNQO\n" + "EUTaxxT3i3lOUymHFbES6RkrVDPWLn+9QiC+/NectHoK2wIDAQABo1AwTjAdBgNV\n" + "HQ4EFgQUTX2uDaVeIlpqjxlhVLNYy3vAvdowHwYDVR0jBBgwFoAUTX2uDaVeIlpq\n" + "jxlhVLNYy3vAvdowDAYDVR0TBAUwAwEB/zANBgkqhkiG9w0BAQsFAAOCAgEAW0Bx\n" + "lsjRVz/88jx1+8mmp2OKIiOWD0B3d+J/dvxfexy96srwvhr9WeYOANF4RAEo9AFo\n" + "Z3jPeEM2rLJcEw4qlFmInmRGQgqbvn0tEBH+i2QB+wDFLkdjwJM6Svhs/KkWWKu8\n" + "e2sgMZ3X2IQBzM5Sf6EYL1zJWViamLnvVNegVnkouq315f1+2Na+3SV2b/qKB/aO\n" + "D4NDGe6WxMlU3xlaTK4lV6Jd1egKZtgZ6cREumo7s4auRMB8buWgbEW7fzSU6dPU\n" + "9AQL6/ya+mfU5YNeCAmccKnTDYoI7TwEM0+sAtlcmWIS/A6NVYrOyihaGp7JWY7w\n" + "9RnHMB5ZHzx3bfyiMey/g/0UJpFoiAVMh4LgM/Tu2FaXIzoAm+eiEMKDKMbAwZJJ\n" + "lcHT4UPojwzQruNQFxqND0pgcXaOnvsVds3NaSxZJGnSD/LVDpaVKy7Xge2ze2/O\n" + "YDK18PZ06ic67iyWe+AGbDMlxGDadt7EoSK2sWNXEDxiYJhHOZ44zsfvdXUZ0yYq\n" + "z0bjsHI4Se7DTlKX5eW4vLFFVphUCmPIh/+gyygSXI+ibqf5UJgtpSYI3xYpGWN/\n" + "bLRBIPdd72qQ/RoIHMJMPnfq4N/A3aqiNufovpg5CmhZjqBxL3ySq+DEwcLribY0\n" + "zkSr+fakyHutqLzJBHzVTKTSi1QjiWiGTgc22bw=\n" "-----END CERTIFICATE-----\n" - ); + ); + const std::string mPemIntermediateCert( "Certificate:\n" " Data:\n" " Version: 3 (0x2)\n" - " Serial Number: 4096 (0x1000)\n" + " Serial Number: 85:bb:4b:66:26:db:9a:c6\n" " Signature Algorithm: sha256WithRSAEncryption\n" " Issuer: C=US, ST=California, L=San Francisco, O=Linden Lab, OU=Second Life Engineering, CN=Integration Test Root CA/emailAddress=noreply@lindenlab.com\n" " Validity\n" - " Not Before: May 22 22:39:08 2018 GMT\n" - " Not After : May 19 22:39:08 2028 GMT\n" - " Subject: C=US, ST=California, O=Linden Lab, OU=Second Life Engineering, CN=Integration Test Intermediate CA/emailAddress=noreply@lindenlab.com\n" + " Not Before: Jul 23 11:46:33 2024 GMT\n" + " Not After : Jul 21 11:46:33 2034 GMT\n" + " Subject: C=US, ST=California, L=San Francisco, O=Linden Lab, OU=Second Life Engineering, CN=Integration Test Intermediate CA/emailAddress=noreply@lindenlab.com\n" " Subject Public Key Info:\n" " Public Key Algorithm: rsaEncryption\n" " Public-Key: (4096 bit)\n" " Modulus:\n" - " 00:ce:a3:70:e2:c4:fb:4b:97:90:a1:30:bb:c1:1b:\n" - " 13:b9:aa:7e:46:17:a3:26:8d:69:3f:5e:73:95:e8:\n" - " 6a:b1:0a:b4:8f:50:65:e3:c6:5c:39:24:34:df:0b:\n" - " b7:cc:ce:62:0c:36:5a:12:2c:fe:35:4c:e9:1c:ac:\n" - " 80:5e:24:99:d7:aa:bd:be:48:c0:62:64:77:36:88:\n" - " 66:ce:f4:a8:dd:d2:76:24:62:90:55:41:fc:1d:13:\n" - " 4e:a7:4e:57:bc:a8:a4:59:4b:2c:5a:1c:d8:cc:16:\n" - " de:e8:88:30:c9:95:df:2f:a6:14:28:0f:eb:34:46:\n" - " 12:58:ba:da:0e:e6:de:9c:15:f6:f4:e3:9f:74:aa:\n" - " 70:89:79:8b:e9:5a:7b:18:54:15:94:3a:23:0a:65:\n" - " 78:05:d9:33:90:2a:ce:15:18:0d:52:fc:5c:31:65:\n" - " 20:d0:12:37:8c:11:80:ba:d4:b0:82:73:00:4b:49:\n" - " be:cb:d6:bc:e7:cd:61:f3:00:98:99:74:5a:37:81:\n" - " 49:96:7e:14:01:1b:86:d2:d0:06:94:40:63:63:46:\n" - " 11:fc:33:5c:bd:3a:5e:d4:e5:44:47:64:50:bd:a6:\n" - " 97:55:70:64:9b:26:cc:de:20:82:90:6a:83:41:9c:\n" - " 6f:71:47:14:be:cb:68:7c:85:be:ef:2e:76:12:19:\n" - " d3:c9:87:32:b4:ac:60:20:16:28:2d:af:bc:e8:01:\n" - " c6:7f:fb:d8:11:d5:f4:b7:14:bd:27:08:5b:72:be:\n" - " 09:e0:91:c8:9c:7b:b4:b3:12:ef:32:36:be:b1:b9:\n" - " a2:b7:e3:69:47:30:76:ba:9c:9b:19:99:4d:53:dd:\n" - " 5c:e8:2c:f1:b2:64:69:cf:15:bd:f8:bb:58:95:73:\n" - " 58:38:95:b4:7a:cf:84:29:a6:c2:db:f0:bd:ef:97:\n" - " 26:d4:99:ac:d7:c7:be:b0:0d:11:f4:26:86:2d:77:\n" - " 42:52:25:d7:56:c7:e3:97:b1:36:5c:97:71:d0:9b:\n" - " f5:b5:50:8d:f9:ff:fb:10:77:3c:b5:53:6d:a1:43:\n" - " 35:a9:03:32:05:ab:d7:f5:d1:19:bd:5f:92:a3:00:\n" - " 2a:79:37:a4:76:4f:e9:32:0d:e4:86:bb:ea:c3:1a:\n" - " c5:33:e8:16:d4:a5:d8:e0:e8:bb:c2:f0:22:15:e2:\n" - " d9:8c:ae:ac:7d:2b:bf:eb:a3:4c:3b:29:1d:94:ac:\n" - " a3:bb:6d:ba:6d:03:91:03:cf:46:12:c4:66:21:c5:\n" - " c6:67:d8:11:19:79:01:0e:6e:84:1c:76:6f:11:3d:\n" - " eb:94:89:c5:6a:26:1f:cd:e0:11:8b:51:ee:99:35:\n" - " 69:e5:7f:0b:77:2a:94:e4:4b:64:b9:83:04:30:05:\n" - " e4:a2:e3\n" + " 00:be:f7:d2:cb:e4:5c:46:7b:e2:11:22:89:72:da:\n" + " 77:72:ec:05:87:19:f7:77:07:fd:67:d7:af:13:d5:\n" + " 76:12:92:dd:69:4d:22:47:b0:3d:94:8a:6a:95:85:\n" + " 34:b8:78:c3:9d:63:32:b1:4b:0a:b6:0e:05:7b:ab:\n" + " 06:23:fc:0d:21:b5:fc:c6:6a:5a:36:be:6e:fc:c7:\n" + " 47:97:a3:18:2e:33:cd:0e:8a:75:2b:b7:29:e9:68:\n" + " 4a:90:53:45:db:73:ff:b3:e5:c1:d4:6b:dd:3a:b1:\n" + " ef:53:9f:23:e9:c6:87:ce:67:b9:fb:a4:d5:76:21:\n" + " 03:cb:c5:72:6b:c5:a6:07:55:fb:47:90:e8:92:38:\n" + " 73:14:11:8e:ff:21:b9:35:64:5a:61:c7:fc:1f:e4:\n" + " 4d:47:e5:03:cc:0b:c3:69:66:71:84:0c:18:2f:61:\n" + " 7f:34:dd:f2:91:e3:b7:9d:a8:b8:db:3f:6e:6f:96:\n" + " fa:34:06:82:04:c8:18:cc:de:8b:7f:26:b5:48:53:\n" + " fb:fb:15:7b:0e:38:60:fe:da:21:98:8d:73:07:b2:\n" + " 6b:fd:ad:21:59:e7:84:66:e1:04:16:1c:be:13:34:\n" + " 28:43:2c:09:3d:e4:77:2a:a4:ad:6d:f9:26:04:f7:\n" + " 43:73:9b:d9:ea:1a:43:6a:b4:db:88:f8:f9:bd:34:\n" + " f8:a6:e8:7a:ab:b4:b2:e1:29:47:a6:ba:b8:65:9c:\n" + " c6:b3:af:13:43:38:ef:2a:05:77:9f:8f:f0:0c:56:\n" + " 21:c2:92:d2:2c:c3:32:50:d1:62:ae:51:fc:99:e6:\n" + " b8:38:f8:83:1d:8d:40:11:e0:1d:51:5d:3f:fa:55:\n" + " 61:b6:18:09:1e:71:af:95:64:9c:ea:c6:11:64:f0:\n" + " a8:02:7d:bb:c8:54:2e:57:48:32:7c:51:66:0d:d6:\n" + " 3e:0e:ed:5e:30:a8:a6:47:03:64:5c:89:21:45:90:\n" + " e1:4c:91:bc:bd:81:6e:73:a9:14:27:e6:0d:6d:38:\n" + " dc:50:9d:b2:56:66:60:6c:66:b9:5d:bb:8c:96:2d:\n" + " 89:5e:0d:2b:ed:b8:03:31:ce:0a:ff:82:03:f5:b2:\n" + " 3b:e5:27:de:61:d8:8f:bf:a2:6a:64:b0:4a:87:23:\n" + " 40:28:a3:f1:ec:96:50:cd:83:50:2d:78:71:92:f2:\n" + " 88:75:b0:9d:cd:0b:e4:62:a6:a5:63:11:fc:b4:ba:\n" + " 9f:c6:67:40:2c:ad:a4:ef:94:f0:f9:a0:ba:e1:52:\n" + " 2e:27:d9:6b:1d:82:23:ed:3c:0b:0b:d2:bc:14:be:\n" + " 6d:b1:69:ad:3e:25:3a:66:d2:d1:af:9f:88:45:25:\n" + " 6b:6e:be:1f:a0:e7:b2:9f:6d:24:94:0d:f4:c2:75:\n" + " f9:1f:5d\n" " Exponent: 65537 (0x10001)\n" " X509v3 extensions:\n" - " X509v3 Subject Key Identifier: \n" - " 83:21:DE:EC:C0:79:03:6D:1E:83:F3:E5:97:29:D5:5A:C0:96:40:FA\n" - " X509v3 Authority Key Identifier: \n" - " keyid:8A:22:C6:9C:2E:11:F3:40:0C:CE:82:0C:22:59:FF:F8:7F:D0:B9:13\n" - "\n" - " X509v3 Basic Constraints: critical\n" + " X509v3 Basic Constraints:\n" " CA:TRUE, pathlen:0\n" - " X509v3 Key Usage: critical\n" + " X509v3 Key Usage:\n" " Digital Signature, Certificate Sign, CRL Sign\n" + " X509v3 Subject Key Identifier:\n" + " 56:98:DC:45:25:11:E2:8C:2B:EA:D6:C6:E2:C8:BE:2C:C8:69:FF:FF\n" + " X509v3 Authority Key Identifier:\n" + " keyid:4D:7D:AE:0D:A5:5E:22:5A:6A:8F:19:61:54:B3:58:CB:7B:C0:BD:DA\n" + " DirName:/C=US/ST=California/L=San Francisco/O=Linden Lab/OU=Second Life Engineering/CN=Integration Test Root CA/emailAddress=noreply@lindenlab.com\n" + " serial:EF:54:D8:F7:DA:18:E8:19\n" " Signature Algorithm: sha256WithRSAEncryption\n" - " a3:6c:85:9a:2e:4e:7e:5d:83:63:0f:f5:4f:a9:7d:ec:0e:6f:\n" - " ae:d7:ba:df:64:e0:46:0e:3d:da:18:15:2c:f3:73:ca:81:b1:\n" - " 10:d9:53:14:21:7d:72:5c:94:88:a5:9d:ad:ab:45:42:c6:64:\n" - " a9:d9:2e:4e:29:47:2c:b1:95:07:b7:62:48:68:1f:68:13:1c:\n" - " d2:a0:fb:5e:38:24:4a:82:0a:87:c9:93:20:43:7e:e9:f9:79:\n" - " ef:03:a2:bd:9e:24:6b:0a:01:5e:4a:36:c5:7d:7a:fe:d6:aa:\n" - " 2f:c2:8c:38:8a:99:3c:b0:6a:e5:60:be:56:d6:eb:60:03:55:\n" - " 24:42:a0:1a:fa:91:24:a3:53:15:75:5d:c8:eb:7c:1e:68:5a:\n" - " 7e:13:34:e3:85:37:1c:76:3f:77:67:1b:ed:1b:52:17:fc:4a:\n" - " a3:e2:74:84:80:2c:69:fc:dd:7d:26:97:c4:2a:69:7d:9c:dc:\n" - " 61:97:70:29:a7:3f:2b:5b:2b:22:51:fd:fe:6a:5d:f9:e7:14:\n" - " 48:b7:2d:c8:33:58:fc:f2:5f:27:f7:26:16:be:be:b5:aa:a2:\n" - " 64:53:3c:69:e8:b5:61:eb:ab:91:a5:b4:09:9b:f6:98:b8:5c:\n" - " 5b:24:2f:93:f5:2b:9c:8c:58:fb:26:3f:67:53:d7:42:64:e8:\n" - " 79:77:73:41:4e:e3:02:39:0b:b6:68:97:8b:84:e8:1d:83:a8:\n" - " 15:f1:06:46:47:80:42:5e:14:e2:61:8a:76:84:d5:d4:71:7f:\n" - " 4e:ff:d9:74:87:ff:32:c5:87:20:0a:d4:59:40:3e:d8:17:ef:\n" - " da:65:e9:0a:51:fe:1e:c3:46:91:d2:ee:e4:23:57:97:87:d4:\n" - " a6:a5:eb:ef:81:6a:d8:8c:d6:1f:8e:b1:18:4c:6b:89:32:55:\n" - " 53:68:26:9e:bb:03:be:2c:e9:8b:ff:97:9c:1c:ac:28:c3:9f:\n" - " 0b:b7:93:23:24:31:63:e4:19:13:f2:bb:08:71:b7:c5:c5:c4:\n" - " 10:ff:dc:fc:33:54:a4:5e:ec:a3:fe:0a:80:ca:9c:bc:95:6f:\n" - " 5f:39:91:3b:61:69:16:94:0f:57:4b:fc:4b:b1:be:72:98:5d:\n" - " 10:f9:08:a7:d6:e0:e8:3d:5d:54:7d:fa:4b:6a:dd:98:41:ed:\n" - " 84:a1:39:67:5c:6c:7f:0c:b0:e1:98:c1:14:ed:fe:1e:e8:05:\n" - " 8d:7f:6a:24:cb:1b:05:42:0d:7f:13:ba:ca:b5:91:db:a5:f0:\n" - " 40:2b:70:7a:2a:a5:5d:ed:56:0c:f0:c2:72:ee:63:dd:cb:5d:\n" - " 76:f6:08:e6:e6:30:ef:3a:b2:16:34:41:a4:e1:30:14:bc:c7:\n" - " f9:23:3a:1a:70:df:b8:cc\n" + " ae:d0:30:ac:31:49:20:86:0b:34:01:58:08:94:68:cc:38:9c:\n" + " f7:13:5c:46:19:33:ed:54:5e:e4:43:f3:59:33:5c:50:d9:89:\n" + " 8b:ee:75:67:a8:c7:0e:d1:30:c2:4e:a3:2e:a8:64:2d:6a:a8:\n" + " f4:bd:b1:32:dc:bc:46:48:5d:1a:18:d8:e8:0b:8c:fe:7b:51:\n" + " d9:dd:b9:e3:4b:d1:f9:e0:22:46:dd:37:5b:b2:cb:72:8e:9c:\n" + " 4b:da:67:df:fd:ce:86:49:21:31:4e:99:b6:d4:38:0b:14:5d:\n" + " ad:97:ba:8f:e2:08:15:85:73:eb:4a:7d:01:49:af:63:ae:2d:\n" + " e3:9d:0a:d7:11:c2:03:d3:15:21:97:be:3d:d2:ea:ab:cc:93:\n" + " 16:98:64:80:72:eb:c2:78:0a:09:69:c4:2b:5d:df:30:7b:be:\n" + " 9b:02:34:73:62:9f:95:b1:cf:08:e8:9e:57:a8:37:31:cf:2c:\n" + " 8c:18:b1:d5:7a:25:90:d6:b6:76:28:1b:e2:b1:cf:1b:f1:ef:\n" + " dd:2f:d3:07:af:81:e3:5f:fc:5a:e7:3c:a9:37:0d:9c:78:5b:\n" + " 58:dc:89:54:70:a4:5b:ff:9f:64:30:a3:85:12:32:69:a5:02:\n" + " 73:d9:1d:ff:69:1f:d4:97:8f:d0:a8:90:8c:dd:2e:45:a1:b1:\n" + " e3:8a:82:fc:fc:08:41:01:51:92:87:9a:09:7b:35:c3:cc:48:\n" + " 81:39:30:a9:f4:41:3b:06:a3:06:21:cc:4b:bc:1b:76:58:94:\n" + " d1:e4:22:70:7f:20:7e:7a:b4:fa:7f:e8:79:c1:8c:89:9e:e9:\n" + " e3:72:2a:43:72:47:9e:bb:26:ed:64:2c:c8:54:f7:b4:95:c2:\n" + " c4:e9:8b:df:d5:10:a7:ed:a5:7a:94:97:c4:76:45:e3:6c:c0:\n" + " 0e:a6:2a:76:d5:1d:2f:ad:99:32:c6:7b:f6:41:e0:65:37:0f:\n" + " c0:1f:c5:99:4a:75:fd:6c:e0:f1:f0:58:49:2d:81:10:ca:d8:\n" + " eb:2b:c3:9b:a9:d9:a9:f5:6c:6d:26:fd:b8:32:92:58:f4:65:\n" + " 0b:d1:8e:03:1e:d5:6a:95:d4:46:9e:65:dd:e5:85:36:e6:31:\n" + " 77:3a:1a:20:2b:07:b7:f1:9a:4e:8d:54:22:5a:54:1c:72:5c:\n" + " 1f:b4:1a:5b:21:ed:06:5a:9a:e5:3c:01:c9:9b:af:50:61:f2:\n" + " 29:6b:ec:6d:19:bb:2e:02:94:ca:36:71:ef:45:39:f1:a5:25:\n" + " 10:0e:90:bc:a7:b3:5b:ab:af:f1:19:88:6a:09:2f:1f:d0:24:\n" + " a8:62:ed:d9:1a:65:89:65:16:a5:55:de:33:e8:7a:81:66:72:\n" + " 91:17:5e:1d:22:72:f7:b8\n" "-----BEGIN CERTIFICATE-----\n" - "MIIGSDCCBDCgAwIBAgICEAAwDQYJKoZIhvcNAQELBQAwgboxCzAJBgNVBAYTAlVT\n" - "MRMwEQYDVQQIDApDYWxpZm9ybmlhMRYwFAYDVQQHDA1TYW4gRnJhbmNpc2NvMRMw\n" - "EQYDVQQKDApMaW5kZW4gTGFiMSAwHgYDVQQLDBdTZWNvbmQgTGlmZSBFbmdpbmVl\n" - "cmluZzEhMB8GA1UEAwwYSW50ZWdyYXRpb24gVGVzdCBSb290IENBMSQwIgYJKoZI\n" - "hvcNAQkBFhVub3JlcGx5QGxpbmRlbmxhYi5jb20wHhcNMTgwNTIyMjIzOTA4WhcN\n" - "MjgwNTE5MjIzOTA4WjCBqjELMAkGA1UEBhMCVVMxEzARBgNVBAgMCkNhbGlmb3Ju\n" - "aWExEzARBgNVBAoMCkxpbmRlbiBMYWIxIDAeBgNVBAsMF1NlY29uZCBMaWZlIEVu\n" - "Z2luZWVyaW5nMSkwJwYDVQQDDCBJbnRlZ3JhdGlvbiBUZXN0IEludGVybWVkaWF0\n" - "ZSBDQTEkMCIGCSqGSIb3DQEJARYVbm9yZXBseUBsaW5kZW5sYWIuY29tMIICIjAN\n" - "BgkqhkiG9w0BAQEFAAOCAg8AMIICCgKCAgEAzqNw4sT7S5eQoTC7wRsTuap+Rhej\n" - "Jo1pP15zlehqsQq0j1Bl48ZcOSQ03wu3zM5iDDZaEiz+NUzpHKyAXiSZ16q9vkjA\n" - "YmR3NohmzvSo3dJ2JGKQVUH8HRNOp05XvKikWUssWhzYzBbe6IgwyZXfL6YUKA/r\n" - "NEYSWLraDubenBX29OOfdKpwiXmL6Vp7GFQVlDojCmV4BdkzkCrOFRgNUvxcMWUg\n" - "0BI3jBGAutSwgnMAS0m+y9a8581h8wCYmXRaN4FJln4UARuG0tAGlEBjY0YR/DNc\n" - "vTpe1OVER2RQvaaXVXBkmybM3iCCkGqDQZxvcUcUvstofIW+7y52EhnTyYcytKxg\n" - "IBYoLa+86AHGf/vYEdX0txS9Jwhbcr4J4JHInHu0sxLvMja+sbmit+NpRzB2upyb\n" - "GZlNU91c6CzxsmRpzxW9+LtYlXNYOJW0es+EKabC2/C975cm1Jms18e+sA0R9CaG\n" - "LXdCUiXXVsfjl7E2XJdx0Jv1tVCN+f/7EHc8tVNtoUM1qQMyBavX9dEZvV+SowAq\n" - "eTekdk/pMg3khrvqwxrFM+gW1KXY4Oi7wvAiFeLZjK6sfSu/66NMOykdlKyju226\n" - "bQORA89GEsRmIcXGZ9gRGXkBDm6EHHZvET3rlInFaiYfzeARi1HumTVp5X8LdyqU\n" - "5EtkuYMEMAXkouMCAwEAAaNmMGQwHQYDVR0OBBYEFIMh3uzAeQNtHoPz5Zcp1VrA\n" - "lkD6MB8GA1UdIwQYMBaAFIoixpwuEfNADM6CDCJZ//h/0LkTMBIGA1UdEwEB/wQI\n" - "MAYBAf8CAQAwDgYDVR0PAQH/BAQDAgGGMA0GCSqGSIb3DQEBCwUAA4ICAQCjbIWa\n" - "Lk5+XYNjD/VPqX3sDm+u17rfZOBGDj3aGBUs83PKgbEQ2VMUIX1yXJSIpZ2tq0VC\n" - "xmSp2S5OKUcssZUHt2JIaB9oExzSoPteOCRKggqHyZMgQ37p+XnvA6K9niRrCgFe\n" - "SjbFfXr+1qovwow4ipk8sGrlYL5W1utgA1UkQqAa+pEko1MVdV3I63weaFp+EzTj\n" - "hTccdj93ZxvtG1IX/Eqj4nSEgCxp/N19JpfEKml9nNxhl3Appz8rWysiUf3+al35\n" - "5xRIty3IM1j88l8n9yYWvr61qqJkUzxp6LVh66uRpbQJm/aYuFxbJC+T9SucjFj7\n" - "Jj9nU9dCZOh5d3NBTuMCOQu2aJeLhOgdg6gV8QZGR4BCXhTiYYp2hNXUcX9O/9l0\n" - "h/8yxYcgCtRZQD7YF+/aZekKUf4ew0aR0u7kI1eXh9SmpevvgWrYjNYfjrEYTGuJ\n" - "MlVTaCaeuwO+LOmL/5ecHKwow58Lt5MjJDFj5BkT8rsIcbfFxcQQ/9z8M1SkXuyj\n" - "/gqAypy8lW9fOZE7YWkWlA9XS/xLsb5ymF0Q+Qin1uDoPV1UffpLat2YQe2EoTln\n" - "XGx/DLDhmMEU7f4e6AWNf2okyxsFQg1/E7rKtZHbpfBAK3B6KqVd7VYM8MJy7mPd\n" - "y1129gjm5jDvOrIWNEGk4TAUvMf5IzoacN+4zA==\n" + "MIIHNjCCBR6gAwIBAgIJAIW7S2Ym25rGMA0GCSqGSIb3DQEBCwUAMIG6MQswCQYD\n" + "VQQGEwJVUzETMBEGA1UECAwKQ2FsaWZvcm5pYTEWMBQGA1UEBwwNU2FuIEZyYW5j\n" + "aXNjbzETMBEGA1UECgwKTGluZGVuIExhYjEgMB4GA1UECwwXU2Vjb25kIExpZmUg\n" + "RW5naW5lZXJpbmcxITAfBgNVBAMMGEludGVncmF0aW9uIFRlc3QgUm9vdCBDQTEk\n" + "MCIGCSqGSIb3DQEJARYVbm9yZXBseUBsaW5kZW5sYWIuY29tMB4XDTI0MDcyMzEx\n" + "NDYzM1oXDTM0MDcyMTExNDYzM1owgcIxCzAJBgNVBAYTAlVTMRMwEQYDVQQIDApD\n" + "YWxpZm9ybmlhMRYwFAYDVQQHDA1TYW4gRnJhbmNpc2NvMRMwEQYDVQQKDApMaW5k\n" + "ZW4gTGFiMSAwHgYDVQQLDBdTZWNvbmQgTGlmZSBFbmdpbmVlcmluZzEpMCcGA1UE\n" + "AwwgSW50ZWdyYXRpb24gVGVzdCBJbnRlcm1lZGlhdGUgQ0ExJDAiBgkqhkiG9w0B\n" + "CQEWFW5vcmVwbHlAbGluZGVubGFiLmNvbTCCAiIwDQYJKoZIhvcNAQEBBQADggIP\n" + "ADCCAgoCggIBAL730svkXEZ74hEiiXLad3LsBYcZ93cH/WfXrxPVdhKS3WlNIkew\n" + "PZSKapWFNLh4w51jMrFLCrYOBXurBiP8DSG1/MZqWja+bvzHR5ejGC4zzQ6KdSu3\n" + "KeloSpBTRdtz/7PlwdRr3Tqx71OfI+nGh85nufuk1XYhA8vFcmvFpgdV+0eQ6JI4\n" + "cxQRjv8huTVkWmHH/B/kTUflA8wLw2lmcYQMGC9hfzTd8pHjt52ouNs/bm+W+jQG\n" + "ggTIGMzei38mtUhT+/sVew44YP7aIZiNcweya/2tIVnnhGbhBBYcvhM0KEMsCT3k\n" + "dyqkrW35JgT3Q3Ob2eoaQ2q024j4+b00+Kboequ0suEpR6a6uGWcxrOvE0M47yoF\n" + "d5+P8AxWIcKS0izDMlDRYq5R/JnmuDj4gx2NQBHgHVFdP/pVYbYYCR5xr5VknOrG\n" + "EWTwqAJ9u8hULldIMnxRZg3WPg7tXjCopkcDZFyJIUWQ4UyRvL2BbnOpFCfmDW04\n" + "3FCdslZmYGxmuV27jJYtiV4NK+24AzHOCv+CA/WyO+Un3mHYj7+iamSwSocjQCij\n" + "8eyWUM2DUC14cZLyiHWwnc0L5GKmpWMR/LS6n8ZnQCytpO+U8PmguuFSLifZax2C\n" + "I+08CwvSvBS+bbFprT4lOmbS0a+fiEUla26+H6Dnsp9tJJQN9MJ1+R9dAgMBAAGj\n" + "ggEzMIIBLzAPBgNVHRMECDAGAQH/AgEAMAsGA1UdDwQEAwIBhjAdBgNVHQ4EFgQU\n" + "VpjcRSUR4owr6tbG4si+LMhp//8wge8GA1UdIwSB5zCB5IAUTX2uDaVeIlpqjxlh\n" + "VLNYy3vAvdqhgcCkgb0wgboxCzAJBgNVBAYTAlVTMRMwEQYDVQQIDApDYWxpZm9y\n" + "bmlhMRYwFAYDVQQHDA1TYW4gRnJhbmNpc2NvMRMwEQYDVQQKDApMaW5kZW4gTGFi\n" + "MSAwHgYDVQQLDBdTZWNvbmQgTGlmZSBFbmdpbmVlcmluZzEhMB8GA1UEAwwYSW50\n" + "ZWdyYXRpb24gVGVzdCBSb290IENBMSQwIgYJKoZIhvcNAQkBFhVub3JlcGx5QGxp\n" + "bmRlbmxhYi5jb22CCQDvVNj32hjoGTANBgkqhkiG9w0BAQsFAAOCAgEArtAwrDFJ\n" + "IIYLNAFYCJRozDic9xNcRhkz7VRe5EPzWTNcUNmJi+51Z6jHDtEwwk6jLqhkLWqo\n" + "9L2xMty8RkhdGhjY6AuM/ntR2d2540vR+eAiRt03W7LLco6cS9pn3/3OhkkhMU6Z\n" + "ttQ4CxRdrZe6j+IIFYVz60p9AUmvY64t450K1xHCA9MVIZe+PdLqq8yTFphkgHLr\n" + "wngKCWnEK13fMHu+mwI0c2KflbHPCOieV6g3Mc8sjBix1XolkNa2digb4rHPG/Hv\n" + "3S/TB6+B41/8Wuc8qTcNnHhbWNyJVHCkW/+fZDCjhRIyaaUCc9kd/2kf1JeP0KiQ\n" + "jN0uRaGx44qC/PwIQQFRkoeaCXs1w8xIgTkwqfRBOwajBiHMS7wbdliU0eQicH8g\n" + "fnq0+n/oecGMiZ7p43IqQ3JHnrsm7WQsyFT3tJXCxOmL39UQp+2lepSXxHZF42zA\n" + "DqYqdtUdL62ZMsZ79kHgZTcPwB/FmUp1/Wzg8fBYSS2BEMrY6yvDm6nZqfVsbSb9\n" + "uDKSWPRlC9GOAx7VapXURp5l3eWFNuYxdzoaICsHt/GaTo1UIlpUHHJcH7QaWyHt\n" + "Blqa5TwByZuvUGHyKWvsbRm7LgKUyjZx70U58aUlEA6QvKezW6uv8RmIagkvH9Ak\n" + "qGLt2RpliWUWpVXeM+h6gWZykRdeHSJy97g=\n" "-----END CERTIFICATE-----\n" - ); + ); const std::string mPemChildCert( "Certificate:\n" " Data:\n" " Version: 3 (0x2)\n" - " Serial Number: 4096 (0x1000)\n" + " Serial Number: 9e:8d:34:13:e7:9b:f9:31\n" " Signature Algorithm: sha256WithRSAEncryption\n" - " Issuer: C=US, ST=California, O=Linden Lab, OU=Second Life Engineering, CN=Integration Test Intermediate CA/emailAddress=noreply@lindenlab.com\n" + " Issuer: C=US, ST=California, L=San Francisco, O=Linden Lab, OU=Second Life Engineering, CN=Integration Test Intermediate CA/emailAddress=noreply@lindenlab.com\n" " Validity\n" - " Not Before: May 22 22:58:15 2018 GMT\n" - " Not After : Jul 19 22:58:15 2024 GMT\n" + " Not Before: Jul 23 11:46:39 2024 GMT\n" + " Not After : Jul 21 11:46:39 2034 GMT\n" " Subject: C=US, ST=California, L=San Francisco, O=Linden Lab, OU=Second Life Engineering, CN=Integration Test Server Cert/emailAddress=noreply@lindenlab.com\n" " Subject Public Key Info:\n" " Public Key Algorithm: rsaEncryption\n" - " Public-Key: (2048 bit)\n" + " Public-Key: (4096 bit)\n" " Modulus:\n" - " 00:bf:a1:1c:76:82:4a:10:1d:25:0e:02:e2:7a:64:\n" - " 54:c7:94:c5:c0:98:d5:35:f3:cb:cb:30:ba:31:9c:\n" - " bd:4c:2f:4a:4e:24:03:4b:87:5c:c1:5c:fe:d9:89:\n" - " 3b:cb:01:bc:eb:a5:b7:78:dc:b3:58:e5:78:a7:15:\n" - " 34:50:30:aa:16:3a:b2:94:17:6d:1e:7f:b2:70:1e:\n" - " 96:41:bb:1d:e3:22:80:fa:dc:00:6a:fb:34:3e:67:\n" - " e7:c2:21:2f:1b:d3:af:04:49:91:eb:bb:60:e0:26:\n" - " 52:75:28:8a:08:5b:91:56:4e:51:50:40:51:70:af:\n" - " cb:80:66:c8:59:e9:e2:48:a8:62:d0:26:67:80:0a:\n" - " 12:16:d1:f6:15:9e:1f:f5:92:37:f3:c9:2f:03:9e:\n" - " 22:f6:60:5a:76:45:8c:01:2c:99:54:72:19:db:b7:\n" - " 72:e6:5a:69:f3:e9:31:65:5d:0f:c7:5c:9c:17:29:\n" - " 71:14:7f:db:47:c9:1e:65:a2:41:b0:2f:14:17:ec:\n" - " 4b:25:f2:43:8f:b4:a3:8d:37:1a:07:34:b3:29:bb:\n" - " 8a:44:8e:84:08:a2:1b:76:7a:cb:c2:39:2f:6e:e3:\n" - " fc:d6:91:b5:1f:ce:58:91:57:70:35:6e:25:a9:48:\n" - " 0e:07:cf:4e:dd:16:42:65:cf:8a:42:b3:27:e6:fe:\n" - " 6a:e3\n" + " 00:d8:ac:0c:27:8f:ea:c0:4d:21:e4:75:55:31:57:\n" + " 83:46:47:14:1e:f5:67:ae:98:60:c4:97:6d:e8:53:\n" + " f2:4d:3b:ec:6f:08:bc:1e:c0:e2:a6:75:b5:90:1d:\n" + " 30:a2:59:68:32:10:2b:29:67:fc:99:f1:24:6a:36:\n" + " 73:60:31:6b:c7:a0:b8:b0:38:60:b1:59:23:2c:ab:\n" + " 25:a2:c8:b0:bc:2c:c6:d7:4c:87:37:1b:5e:51:a4:\n" + " 63:3e:c4:6d:ed:da:5e:d3:ad:8a:6d:52:e4:87:38:\n" + " 33:76:cf:f2:86:58:b3:10:a4:91:8d:3d:4f:27:9a:\n" + " 8b:b4:d7:67:90:31:1c:f5:7f:78:af:6f:f2:dd:39:\n" + " d0:16:16:7b:46:ad:88:1b:3b:74:6b:10:29:8b:64:\n" + " ba:ed:9f:a7:69:99:55:8f:73:0d:18:a3:7f:40:20:\n" + " 3a:41:4a:94:39:62:8b:fe:c6:9d:79:d0:cd:1c:e2:\n" + " d4:74:bb:43:75:eb:86:8b:30:c1:8d:cc:14:ab:75:\n" + " 2e:f5:3e:0c:05:cb:e4:c3:92:d8:81:8c:df:a5:4e:\n" + " 2e:0b:ae:17:15:9b:e6:dd:9e:16:46:42:27:92:8a:\n" + " 0e:3a:74:1e:d1:3f:ee:7e:a5:d7:ec:1c:63:d4:96:\n" + " 5b:36:f9:15:ee:da:66:ac:5e:de:91:d9:08:24:fb:\n" + " 5d:fc:9b:77:dd:ff:20:a6:67:6f:48:41:5e:5a:ac:\n" + " 13:a4:2c:2a:f2:a3:15:86:e2:84:33:34:e3:91:27:\n" + " 8b:37:ba:b0:c7:5e:1a:0d:b9:f2:4e:0c:55:e6:bb:\n" + " d9:63:f5:05:7b:aa:19:e5:57:ce:a5:b1:46:4b:b3:\n" + " 04:f6:a0:97:26:ed:48:ed:97:93:a6:75:b1:a3:42:\n" + " fc:cc:57:89:da:44:e9:16:a6:30:2c:01:8e:f2:ed:\n" + " be:45:05:08:8a:af:1e:07:51:89:cf:51:4c:aa:f3:\n" + " b3:f0:6f:db:21:80:11:32:0a:23:e2:ff:cc:59:15:\n" + " eb:ff:d2:b8:d6:a1:c1:b4:96:12:82:bf:3f:68:ad:\n" + " c8:61:50:f8:88:4f:d0:be:8e:29:64:1a:16:a5:d9:\n" + " 29:76:16:cd:70:37:c4:f2:1f:4e:c6:57:36:dd:c1:\n" + " 27:19:72:ef:98:7e:34:25:3f:76:b1:ea:15:b2:38:\n" + " 6e:d3:43:03:7a:2b:78:91:9a:19:26:2a:31:b7:5e:\n" + " b7:22:c4:fd:bf:93:10:a4:23:3f:d7:79:53:28:5d:\n" + " 2e:ba:0c:b0:5e:0a:b4:c4:a1:71:75:88:1b:b2:0e:\n" + " 2c:67:08:7b:f0:f6:37:d3:aa:39:50:03:a3:7c:17:\n" + " 1d:52:52:2a:6b:d0:a2:54:2e:ba:11:bc:26:a9:16:\n" + " a6:1b:79\n" " Exponent: 65537 (0x10001)\n" " X509v3 extensions:\n" - " X509v3 Basic Constraints: \n" + " X509v3 Basic Constraints:\n" " CA:FALSE\n" - " Netscape Cert Type: \n" - " SSL Server\n" - " Netscape Comment: \n" - " OpenSSL Generated Server Certificate\n" - " X509v3 Subject Key Identifier: \n" - " BB:59:9F:DE:6B:51:A7:6C:B3:6D:5B:8B:42:F7:B1:65:77:17:A4:E4\n" - " X509v3 Authority Key Identifier: \n" - " keyid:83:21:DE:EC:C0:79:03:6D:1E:83:F3:E5:97:29:D5:5A:C0:96:40:FA\n" - " DirName:/C=US/ST=California/L=San Francisco/O=Linden Lab/OU=Second Life Engineering/CN=Integration Test Root CA/emailAddress=noreply@lindenlab.com\n" - " serial:10:00\n" - "\n" - " X509v3 Key Usage: critical\n" + " X509v3 Key Usage:\n" " Digital Signature, Key Encipherment\n" - " X509v3 Extended Key Usage: \n" + " X509v3 Extended Key Usage:\n" " TLS Web Server Authentication\n" + " X509v3 Subject Key Identifier:\n" + " 7B:1A:F9:2B:C4:B2:F6:AE:D6:F2:8E:B1:73:FB:DD:11:CA:DB:F8:87\n" + " X509v3 Authority Key Identifier:\n" + " keyid:56:98:DC:45:25:11:E2:8C:2B:EA:D6:C6:E2:C8:BE:2C:C8:69:FF:FF\n" + " DirName:/C=US/ST=California/L=San Francisco/O=Linden Lab/OU=Second Life Engineering/CN=Integration Test Root CA/emailAddress=noreply@lindenlab.com\n" + " serial:85:BB:4B:66:26:DB:9A:C6\n" " Signature Algorithm: sha256WithRSAEncryption\n" - " 18:a6:58:55:9b:d4:af:7d:8a:27:d3:28:3a:4c:4b:42:4e:f0:\n" - " 30:d6:d9:95:11:48:12:0a:96:40:d9:2b:21:39:c5:d4:8d:e5:\n" - " 10:bc:68:78:69:0b:9f:15:4a:0b:f1:ab:99:45:0c:20:5f:27:\n" - " df:e7:14:2d:4a:30:f2:c2:8d:37:73:36:1a:27:55:5a:08:5f:\n" - " 71:a1:5e:05:83:b2:59:fe:02:5e:d7:4a:30:15:23:58:04:cf:\n" - " 48:cc:b0:71:88:9c:6b:57:f0:04:0a:d3:a0:64:6b:ee:f3:5f:\n" - " ea:ac:e1:2b:b9:7f:79:b8:db:ce:72:48:72:db:c8:5c:38:72:\n" - " 31:55:d0:ff:6b:bd:73:23:a7:30:18:5d:ed:47:18:0a:67:8e:\n" - " 53:32:0e:99:9b:96:72:45:7f:c6:00:2c:5d:1a:97:53:75:3a:\n" - " 0b:49:3d:3a:00:37:14:67:0c:28:97:34:87:aa:c5:32:e4:ae:\n" - " 34:83:12:4a:10:f7:0e:74:d4:5f:73:bd:ef:0c:b7:d8:0a:7d:\n" - " 8e:8d:5a:48:bd:f4:8e:7b:f9:4a:15:3b:61:c9:5e:40:59:6e:\n" - " c7:a8:a4:02:28:72:c5:54:8c:77:f4:55:a7:86:c0:38:a0:68:\n" - " 19:da:0f:72:5a:a9:7e:69:9f:9c:3a:d6:66:aa:e1:f4:fd:f9:\n" - " b8:4b:6c:71:9e:f0:38:02:c7:6a:9e:dc:e6:fb:ef:23:59:4f:\n" - " 5c:84:0a:df:ea:86:1f:fd:0e:5c:fa:c4:e5:50:1c:10:cf:89:\n" - " 4e:08:0e:4c:4b:61:1a:49:12:f7:e9:4b:17:71:43:7b:6d:b6:\n" - " b5:9f:d4:3b:c7:88:53:48:63:b6:00:80:8f:49:0a:c5:7e:58:\n" - " ac:78:d8:b9:06:b0:bc:86:e2:2e:48:5b:c3:24:fa:aa:72:d8:\n" - " ec:f6:c7:91:9f:0f:c8:b5:fd:2b:b2:a7:bc:2f:40:20:2b:47:\n" - " e0:d1:1d:94:52:6f:6b:be:12:b6:8c:dc:11:db:71:e6:19:ef:\n" - " a8:71:8b:ad:d3:32:c0:1c:a4:3f:b3:0f:af:e5:50:e1:ff:41:\n" - " a4:b7:6f:57:71:af:fd:16:4c:e8:24:b3:99:1b:cf:12:8f:43:\n" - " 05:80:ba:18:19:0a:a5:ec:49:81:41:4c:7e:28:b2:21:f2:59:\n" - " 6e:4a:ed:de:f9:fa:99:85:60:1f:e6:c2:42:5c:08:00:3c:84:\n" - " 06:a9:24:d4:cf:7b:6e:1b:59:1d:f4:70:16:03:a1:e0:0b:00:\n" - " 95:5c:39:03:fc:9d:1c:8e:f7:59:0c:61:47:f6:7f:07:22:48:\n" - " 83:40:ac:e1:98:5f:c7:be:05:d5:29:2b:bf:0d:03:0e:e9:5e:\n" - " 2b:dd:09:18:fe:5e:30:61\n" + " ad:7c:50:12:24:62:62:83:e9:dd:81:1a:12:1c:6d:ae:1e:a6:\n" + " 01:cc:93:8b:ac:83:7c:3d:57:d7:7f:d2:13:40:82:c7:27:07:\n" + " 31:d8:c4:01:04:64:9c:dc:ae:7b:52:bd:f5:62:7a:d0:7c:13:\n" + " 1a:19:86:6a:ce:9a:ba:69:07:77:75:b6:67:56:d0:c3:8d:6f:\n" + " 59:5f:ac:31:83:32:2c:4f:8c:85:8c:f3:56:5b:e0:83:16:19:\n" + " c9:55:4d:56:2c:e0:06:f8:71:85:4b:7e:c6:20:b3:f6:5b:85:\n" + " 6a:b7:0f:0e:0c:75:38:6a:aa:53:cc:b0:bf:c1:fd:a1:01:8a:\n" + " 7e:5a:0b:4d:51:fc:1b:14:b0:8d:62:17:b7:5d:6a:64:30:80:\n" + " aa:50:9a:23:9e:19:46:11:9d:49:d1:35:81:87:80:8c:9c:71:\n" + " 61:26:07:23:5d:a7:ea:4e:0c:53:77:bd:eb:18:6d:63:8b:2c:\n" + " e1:83:bb:bb:f8:3e:7c:e8:0d:19:1e:be:35:aa:99:0f:c7:25:\n" + " 0c:a8:f9:74:02:c8:4c:8e:bb:13:18:fd:aa:21:34:bc:2d:9f:\n" + " 10:96:e2:99:e3:9a:d7:91:0e:1e:77:20:70:e9:b4:63:25:f8:\n" + " ea:14:1f:24:b0:6a:8b:2a:f4:61:b1:0d:7d:18:bc:1d:6d:04:\n" + " 11:b2:9f:a2:a7:55:be:2b:2c:2f:c1:d8:95:13:73:af:1c:96:\n" + " 49:30:9c:9c:94:81:6c:9b:a7:87:5c:cf:46:95:95:4a:6f:bf:\n" + " df:c9:3d:74:3e:24:6e:44:1e:14:8b:68:23:e4:00:b5:a5:b7:\n" + " 5b:a9:ea:16:5f:fa:b1:d3:1a:b1:9b:36:ef:a4:7a:6f:a3:b0:\n" + " 97:35:ac:70:c0:cc:8e:a2:d3:40:0e:c1:70:0b:d5:ce:cd:51:\n" + " 82:8a:40:72:04:8d:62:af:ba:a8:e7:a8:e9:b9:99:b7:5c:5d:\n" + " 27:96:b2:3d:f9:0d:26:8c:3f:db:ac:86:97:be:f1:2c:0b:ca:\n" + " 90:07:93:96:f4:75:c3:e8:4c:f6:a8:a2:3f:da:11:21:e7:b1:\n" + " 8c:62:36:ae:91:a9:2a:73:ba:67:f5:24:16:c3:ee:b7:b1:b4:\n" + " e3:8a:28:23:84:cf:38:c6:f0:8e:21:f6:b8:76:9a:6d:d1:e3:\n" + " 74:81:7a:22:20:a0:82:2a:31:8a:ba:44:0b:61:5a:aa:ba:c6:\n" + " 07:99:36:0a:24:06:2f:8e:c1:1c:4b:f0:65:72:fb:e9:b5:31:\n" + " 59:13:2c:c6:f8:5b:91:e2:d8:96:f3:1a:06:0b:2a:62:12:4d:\n" + " 5e:65:c9:e9:e4:00:99:a6:d3:60:1f:c3:d6:cc:a6:9b:a5:14:\n" + " 1b:4d:db:e7:3d:52:7e:2c\n" "-----BEGIN CERTIFICATE-----\n" - "MIIGbjCCBFagAwIBAgICEAAwDQYJKoZIhvcNAQELBQAwgaoxCzAJBgNVBAYTAlVT\n" - "MRMwEQYDVQQIDApDYWxpZm9ybmlhMRMwEQYDVQQKDApMaW5kZW4gTGFiMSAwHgYD\n" - "VQQLDBdTZWNvbmQgTGlmZSBFbmdpbmVlcmluZzEpMCcGA1UEAwwgSW50ZWdyYXRp\n" - "b24gVGVzdCBJbnRlcm1lZGlhdGUgQ0ExJDAiBgkqhkiG9w0BCQEWFW5vcmVwbHlA\n" - "bGluZGVubGFiLmNvbTAeFw0xODA1MjIyMjU4MTVaFw0yNDA3MTkyMjU4MTVaMIG+\n" - "MQswCQYDVQQGEwJVUzETMBEGA1UECAwKQ2FsaWZvcm5pYTEWMBQGA1UEBwwNU2Fu\n" - "IEZyYW5jaXNjbzETMBEGA1UECgwKTGluZGVuIExhYjEgMB4GA1UECwwXU2Vjb25k\n" - "IExpZmUgRW5naW5lZXJpbmcxJTAjBgNVBAMMHEludGVncmF0aW9uIFRlc3QgU2Vy\n" - "dmVyIENlcnQxJDAiBgkqhkiG9w0BCQEWFW5vcmVwbHlAbGluZGVubGFiLmNvbTCC\n" - "ASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAL+hHHaCShAdJQ4C4npkVMeU\n" - "xcCY1TXzy8swujGcvUwvSk4kA0uHXMFc/tmJO8sBvOult3jcs1jleKcVNFAwqhY6\n" - "spQXbR5/snAelkG7HeMigPrcAGr7ND5n58IhLxvTrwRJkeu7YOAmUnUoighbkVZO\n" - "UVBAUXCvy4BmyFnp4kioYtAmZ4AKEhbR9hWeH/WSN/PJLwOeIvZgWnZFjAEsmVRy\n" - "Gdu3cuZaafPpMWVdD8dcnBcpcRR/20fJHmWiQbAvFBfsSyXyQ4+0o403Ggc0sym7\n" - "ikSOhAiiG3Z6y8I5L27j/NaRtR/OWJFXcDVuJalIDgfPTt0WQmXPikKzJ+b+auMC\n" - "AwEAAaOCAYYwggGCMAkGA1UdEwQCMAAwEQYJYIZIAYb4QgEBBAQDAgZAMDMGCWCG\n" - "SAGG+EIBDQQmFiRPcGVuU1NMIEdlbmVyYXRlZCBTZXJ2ZXIgQ2VydGlmaWNhdGUw\n" - "HQYDVR0OBBYEFLtZn95rUadss21bi0L3sWV3F6TkMIHoBgNVHSMEgeAwgd2AFIMh\n" - "3uzAeQNtHoPz5Zcp1VrAlkD6oYHApIG9MIG6MQswCQYDVQQGEwJVUzETMBEGA1UE\n" - "CAwKQ2FsaWZvcm5pYTEWMBQGA1UEBwwNU2FuIEZyYW5jaXNjbzETMBEGA1UECgwK\n" - "TGluZGVuIExhYjEgMB4GA1UECwwXU2Vjb25kIExpZmUgRW5naW5lZXJpbmcxITAf\n" - "BgNVBAMMGEludGVncmF0aW9uIFRlc3QgUm9vdCBDQTEkMCIGCSqGSIb3DQEJARYV\n" - "bm9yZXBseUBsaW5kZW5sYWIuY29tggIQADAOBgNVHQ8BAf8EBAMCBaAwEwYDVR0l\n" - "BAwwCgYIKwYBBQUHAwEwDQYJKoZIhvcNAQELBQADggIBABimWFWb1K99iifTKDpM\n" - "S0JO8DDW2ZURSBIKlkDZKyE5xdSN5RC8aHhpC58VSgvxq5lFDCBfJ9/nFC1KMPLC\n" - "jTdzNhonVVoIX3GhXgWDsln+Al7XSjAVI1gEz0jMsHGInGtX8AQK06Bka+7zX+qs\n" - "4Su5f3m4285ySHLbyFw4cjFV0P9rvXMjpzAYXe1HGApnjlMyDpmblnJFf8YALF0a\n" - "l1N1OgtJPToANxRnDCiXNIeqxTLkrjSDEkoQ9w501F9zve8Mt9gKfY6NWki99I57\n" - "+UoVO2HJXkBZbseopAIocsVUjHf0VaeGwDigaBnaD3JaqX5pn5w61maq4fT9+bhL\n" - "bHGe8DgCx2qe3Ob77yNZT1yECt/qhh/9Dlz6xOVQHBDPiU4IDkxLYRpJEvfpSxdx\n" - "Q3tttrWf1DvHiFNIY7YAgI9JCsV+WKx42LkGsLyG4i5IW8Mk+qpy2Oz2x5GfD8i1\n" - "/Suyp7wvQCArR+DRHZRSb2u+EraM3BHbceYZ76hxi63TMsAcpD+zD6/lUOH/QaS3\n" - "b1dxr/0WTOgks5kbzxKPQwWAuhgZCqXsSYFBTH4osiHyWW5K7d75+pmFYB/mwkJc\n" - "CAA8hAapJNTPe24bWR30cBYDoeALAJVcOQP8nRyO91kMYUf2fwciSINArOGYX8e+\n" - "BdUpK78NAw7pXivdCRj+XjBh\n" + "MIIHSTCCBTGgAwIBAgIJAJ6NNBPnm/kxMA0GCSqGSIb3DQEBCwUAMIHCMQswCQYD\n" + "VQQGEwJVUzETMBEGA1UECAwKQ2FsaWZvcm5pYTEWMBQGA1UEBwwNU2FuIEZyYW5j\n" + "aXNjbzETMBEGA1UECgwKTGluZGVuIExhYjEgMB4GA1UECwwXU2Vjb25kIExpZmUg\n" + "RW5naW5lZXJpbmcxKTAnBgNVBAMMIEludGVncmF0aW9uIFRlc3QgSW50ZXJtZWRp\n" + "YXRlIENBMSQwIgYJKoZIhvcNAQkBFhVub3JlcGx5QGxpbmRlbmxhYi5jb20wHhcN\n" + "MjQwNzIzMTE0NjM5WhcNMzQwNzIxMTE0NjM5WjCBvjELMAkGA1UEBhMCVVMxEzAR\n" + "BgNVBAgMCkNhbGlmb3JuaWExFjAUBgNVBAcMDVNhbiBGcmFuY2lzY28xEzARBgNV\n" + "BAoMCkxpbmRlbiBMYWIxIDAeBgNVBAsMF1NlY29uZCBMaWZlIEVuZ2luZWVyaW5n\n" + "MSUwIwYDVQQDDBxJbnRlZ3JhdGlvbiBUZXN0IFNlcnZlciBDZXJ0MSQwIgYJKoZI\n" + "hvcNAQkBFhVub3JlcGx5QGxpbmRlbmxhYi5jb20wggIiMA0GCSqGSIb3DQEBAQUA\n" + "A4ICDwAwggIKAoICAQDYrAwnj+rATSHkdVUxV4NGRxQe9WeumGDEl23oU/JNO+xv\n" + "CLwewOKmdbWQHTCiWWgyECspZ/yZ8SRqNnNgMWvHoLiwOGCxWSMsqyWiyLC8LMbX\n" + "TIc3G15RpGM+xG3t2l7TrYptUuSHODN2z/KGWLMQpJGNPU8nmou012eQMRz1f3iv\n" + "b/LdOdAWFntGrYgbO3RrECmLZLrtn6dpmVWPcw0Yo39AIDpBSpQ5Yov+xp150M0c\n" + "4tR0u0N164aLMMGNzBSrdS71PgwFy+TDktiBjN+lTi4LrhcVm+bdnhZGQieSig46\n" + "dB7RP+5+pdfsHGPUlls2+RXu2masXt6R2Qgk+138m3fd/yCmZ29IQV5arBOkLCry\n" + "oxWG4oQzNOORJ4s3urDHXhoNufJODFXmu9lj9QV7qhnlV86lsUZLswT2oJcm7Ujt\n" + "l5OmdbGjQvzMV4naROkWpjAsAY7y7b5FBQiKrx4HUYnPUUyq87Pwb9shgBEyCiPi\n" + "/8xZFev/0rjWocG0lhKCvz9orchhUPiIT9C+jilkGhal2Sl2Fs1wN8TyH07GVzbd\n" + "wScZcu+YfjQlP3ax6hWyOG7TQwN6K3iRmhkmKjG3XrcixP2/kxCkIz/XeVMoXS66\n" + "DLBeCrTEoXF1iBuyDixnCHvw9jfTqjlQA6N8Fx1SUipr0KJULroRvCapFqYbeQID\n" + "AQABo4IBQjCCAT4wCQYDVR0TBAIwADALBgNVHQ8EBAMCBaAwEwYDVR0lBAwwCgYI\n" + "KwYBBQUHAwEwHQYDVR0OBBYEFHsa+SvEsvau1vKOsXP73RHK2/iHMIHvBgNVHSME\n" + "gecwgeSAFFaY3EUlEeKMK+rWxuLIvizIaf//oYHApIG9MIG6MQswCQYDVQQGEwJV\n" + "UzETMBEGA1UECAwKQ2FsaWZvcm5pYTEWMBQGA1UEBwwNU2FuIEZyYW5jaXNjbzET\n" + "MBEGA1UECgwKTGluZGVuIExhYjEgMB4GA1UECwwXU2Vjb25kIExpZmUgRW5naW5l\n" + "ZXJpbmcxITAfBgNVBAMMGEludGVncmF0aW9uIFRlc3QgUm9vdCBDQTEkMCIGCSqG\n" + "SIb3DQEJARYVbm9yZXBseUBsaW5kZW5sYWIuY29tggkAhbtLZibbmsYwDQYJKoZI\n" + "hvcNAQELBQADggIBAK18UBIkYmKD6d2BGhIcba4epgHMk4usg3w9V9d/0hNAgscn\n" + "BzHYxAEEZJzcrntSvfVietB8ExoZhmrOmrppB3d1tmdW0MONb1lfrDGDMixPjIWM\n" + "81Zb4IMWGclVTVYs4Ab4cYVLfsYgs/ZbhWq3Dw4MdThqqlPMsL/B/aEBin5aC01R\n" + "/BsUsI1iF7ddamQwgKpQmiOeGUYRnUnRNYGHgIyccWEmByNdp+pODFN3vesYbWOL\n" + "LOGDu7v4PnzoDRkevjWqmQ/HJQyo+XQCyEyOuxMY/aohNLwtnxCW4pnjmteRDh53\n" + "IHDptGMl+OoUHySwaosq9GGxDX0YvB1tBBGyn6KnVb4rLC/B2JUTc68clkkwnJyU\n" + "gWybp4dcz0aVlUpvv9/JPXQ+JG5EHhSLaCPkALWlt1up6hZf+rHTGrGbNu+kem+j\n" + "sJc1rHDAzI6i00AOwXAL1c7NUYKKQHIEjWKvuqjnqOm5mbdcXSeWsj35DSaMP9us\n" + "hpe+8SwLypAHk5b0dcPoTPaooj/aESHnsYxiNq6RqSpzumf1JBbD7rextOOKKCOE\n" + "zzjG8I4h9rh2mm3R43SBeiIgoIIqMYq6RAthWqq6xgeZNgokBi+OwRxL8GVy++m1\n" + "MVkTLMb4W5Hi2JbzGgYLKmISTV5lyenkAJmm02Afw9bMppulFBtN2+c9Un4s\n" "-----END CERTIFICATE-----\n" - ); + ); + // Test wrapper declaration : wrapping nothing for the moment struct sechandler_basic_test @@ -701,14 +722,13 @@ namespace tut //std::ostringstream llsd_value; //llsd_value << LLSDOStreamer(llsd_cert) << std::endl; LL_DEBUGS() << "test 1 cert " << llsd_cert << LL_ENDL; - ensure_equals("Issuer Name/commonName", (std::string)llsd_cert["issuer_name"]["commonName"], "Integration Test Intermediate CA"); ensure_equals("Issuer Name/countryName", (std::string)llsd_cert["issuer_name"]["countryName"], "US"); ensure_equals("Issuer Name/state", (std::string)llsd_cert["issuer_name"]["stateOrProvinceName"], "California"); ensure_equals("Issuer Name/org name", (std::string)llsd_cert["issuer_name"]["organizationName"], "Linden Lab"); ensure_equals("Issuer Name/org unit", (std::string)llsd_cert["issuer_name"]["organizationalUnitName"], "Second Life Engineering"); ensure_equals("Issuer name string", (std::string)llsd_cert["issuer_name_string"], - "emailAddress=noreply@lindenlab.com,CN=Integration Test Intermediate CA,OU=Second Life Engineering,O=Linden Lab,ST=California,C=US"); + "emailAddress=noreply@lindenlab.com,CN=Integration Test Intermediate CA,OU=Second Life Engineering,O=Linden Lab,L=San Francisco,ST=California,C=US"); ensure_equals("subject Name/commonName", (std::string)llsd_cert["subject_name"]["commonName"], "Integration Test Server Cert"); ensure_equals("subject Name/countryName", (std::string)llsd_cert["subject_name"]["countryName"], "US"); @@ -721,9 +741,9 @@ namespace tut ensure_equals("subject name string", (std::string)llsd_cert["subject_name_string"], "emailAddress=noreply@lindenlab.com,CN=Integration Test Server Cert,OU=Second Life Engineering,O=Linden Lab,L=San Francisco,ST=California,C=US"); - ensure_equals("serial number", (std::string)llsd_cert["serial_number"], "1000"); - ensure_equals("valid from", (std::string)llsd_cert["valid_from"], "2018-05-22T22:58:15Z"); - ensure_equals("valid to", (std::string)llsd_cert["valid_to"], "2024-07-19T22:58:15Z"); + ensure_equals("serial number", (std::string)llsd_cert["serial_number"], "9E8D3413E79BF931"); + ensure_equals("valid from", (std::string)llsd_cert["valid_from"], "2024-07-23T11:46:39Z"); + ensure_equals("valid to", (std::string)llsd_cert["valid_to"], "2034-07-21T11:46:39Z"); LLSD expectedKeyUsage = LLSD::emptyArray(); expectedKeyUsage.append(LLSD((std::string)"digitalSignature")); expectedKeyUsage.append(LLSD((std::string)"keyEncipherment")); @@ -1042,7 +1062,7 @@ namespace tut //validate find LLSD find_info = LLSD::emptyMap(); - find_info["subjectKeyIdentifier"] = "bb:59:9f:de:6b:51:a7:6c:b3:6d:5b:8b:42:f7:b1:65:77:17:a4:e4"; + find_info["subjectKeyIdentifier"] = "7b:1a:f9:2b:c4:b2:f6:ae:d6:f2:8e:b1:73:fb:dd:11:ca:db:f8:87"; LLBasicCertificateVector::iterator found_cert = test_vector->find(find_info); ensure("found some cert", found_cert != test_vector->end()); X509* found_x509 = (*found_cert).get()->getOpenSSLX509(); @@ -1225,7 +1245,7 @@ namespace tut X509_STORE_CTX_set0_untrusted(test_store, NULL); test_chain = new LLBasicCertificateChain(test_store); X509_STORE_CTX_free(test_store); - ensure_equals("two elements in store", test_chain->size(), 1); + ensure_equals("two elements in store [1]", test_chain->size(), 1); X509* test_cert = (*test_chain)[0]->getOpenSSLX509(); ensure("validate first element in store is expected cert", !X509_cmp(test_cert, mX509ChildCert)); X509_free(test_cert); @@ -1238,7 +1258,7 @@ namespace tut sk_X509_push(X509_STORE_CTX_get0_untrusted(test_store), mX509IntermediateCert); test_chain = new LLBasicCertificateChain(test_store); X509_STORE_CTX_free(test_store); - ensure_equals("two elements in store", test_chain->size(), 2); + ensure_equals("two elements in store [2]", test_chain->size(), 2); test_cert = (*test_chain)[0]->getOpenSSLX509(); ensure("validate first element in store is expected cert", !X509_cmp(test_cert, mX509ChildCert)); X509_free(test_cert); @@ -1254,7 +1274,7 @@ namespace tut sk_X509_push(X509_STORE_CTX_get0_untrusted(test_store), mX509TestCert); test_chain = new LLBasicCertificateChain(test_store); X509_STORE_CTX_free(test_store); - ensure_equals("two elements in store", test_chain->size(), 1); + ensure_equals("two elements in store [3]", test_chain->size(), 1); test_cert = (*test_chain)[0]->getOpenSSLX509(); ensure("validate first element in store is expected cert", !X509_cmp(test_cert, mX509ChildCert)); X509_free(test_cert); @@ -1267,7 +1287,7 @@ namespace tut sk_X509_push(X509_STORE_CTX_get0_untrusted(test_store), mX509TestCert); test_chain = new LLBasicCertificateChain(test_store); X509_STORE_CTX_free(test_store); - ensure_equals("two elements in store", test_chain->size(), 2); + ensure_equals("two elements in store [4]", test_chain->size(), 2); test_cert = (*test_chain)[0]->getOpenSSLX509(); ensure("validate first element in store is expected cert", !X509_cmp(test_cert, mX509ChildCert)); X509_free(test_cert); -- cgit v1.2.3 From 2cc21e982668750b237edf2c54979f58d1c52203 Mon Sep 17 00:00:00 2001 From: Dave Parks Date: Tue, 13 Aug 2024 13:14:17 -0500 Subject: Fix for coroutine assert rooted in coroRequestEnvironment (#2276) --- indra/newview/llenvironment.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/indra/newview/llenvironment.cpp b/indra/newview/llenvironment.cpp index 5dfaf176fd..6e31760e9e 100644 --- a/indra/newview/llenvironment.cpp +++ b/indra/newview/llenvironment.cpp @@ -2123,8 +2123,11 @@ void LLEnvironment::coroRequestEnvironment(S32 parcel_id, LLEnvironment::environ LLSD environment = result[KEY_ENVIRONMENT]; if (environment.isDefined() && apply) { - EnvironmentInfo::ptr_t envinfo = LLEnvironment::EnvironmentInfo::extract(environment); - apply(parcel_id, envinfo); + LLAppViewer::instance()->postToMainCoro([=]() + { + EnvironmentInfo::ptr_t envinfo = LLEnvironment::EnvironmentInfo::extract(environment); + apply(parcel_id, envinfo); + }); } } -- cgit v1.2.3 From 3cd1500801dfb0fba4a00a7162148fc8a60a1726 Mon Sep 17 00:00:00 2001 From: Alexander Gavriliuk Date: Tue, 13 Aug 2024 14:52:50 +0200 Subject: #2271 BugSplat Crash #1504299: LLFocusableElement::~LLFocusableElement(79) --- indra/llui/llfocusmgr.cpp | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/indra/llui/llfocusmgr.cpp b/indra/llui/llfocusmgr.cpp index c635d24f51..0d7c98294f 100644 --- a/indra/llui/llfocusmgr.cpp +++ b/indra/llui/llfocusmgr.cpp @@ -73,10 +73,20 @@ bool LLFocusableElement::wantsReturnKey() const // virtual LLFocusableElement::~LLFocusableElement() { - delete mFocusLostCallback; - delete mFocusReceivedCallback; - delete mFocusChangedCallback; - delete mTopLostCallback; + auto free_signal = [&](focus_signal_t*& signal) + { + if (signal) + { + signal->disconnect_all_slots(); + delete signal; + signal = nullptr; + } + }; + + free_signal(mFocusLostCallback); + free_signal(mFocusReceivedCallback); + free_signal(mFocusChangedCallback); + free_signal(mTopLostCallback); } void LLFocusableElement::onFocusReceived() -- cgit v1.2.3 From 8ce3323269d95f54e2b768c4c5aa154d4afbbb6b Mon Sep 17 00:00:00 2001 From: Signal Linden Date: Tue, 13 Aug 2024 12:12:48 -0700 Subject: CI: Upload ReleaseOS app (#2252) Upload the built app on ReleaseOS builds. Not sure why we wouldn't want this. --- .github/workflows/build.yaml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index 53bfbc2c0a..a422c73391 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -253,7 +253,7 @@ jobs: echo "artifact=$RUNNER_OS$cfg_suffix" >> $GITHUB_OUTPUT - name: Upload executable - if: matrix.configuration == 'Release' && steps.build.outputs.viewer_app + if: steps.build.outputs.viewer_app uses: actions/upload-artifact@v4 with: name: "${{ steps.build.outputs.artifact }}-app" @@ -264,7 +264,6 @@ jobs: # artifact for that too. - name: Upload symbol file uses: actions/upload-artifact@v4 - if: matrix.configuration == 'Release' with: name: "${{ steps.build.outputs.artifact }}-symbols" path: ${{ steps.build.outputs.symbolfile }} -- cgit v1.2.3 From 2921deed78af5751b3788aa8d8e1297306b2abab Mon Sep 17 00:00:00 2001 From: Brad Linden <46733234+brad-linden@users.noreply.github.com> Date: Tue, 13 Aug 2024 13:42:52 -0700 Subject: Skip windows symbol upload if there was no Release config build. (#2280) --- .github/workflows/build.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index a422c73391..a128bfdbe7 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -353,6 +353,7 @@ jobs: BUGSPLAT_USER: ${{ secrets.BUGSPLAT_USER }} BUGSPLAT_PASS: ${{ secrets.BUGSPLAT_PASS }} needs: build + if: needs.build.outputs.configuration == 'Release' runs-on: ubuntu-latest steps: - name: Download viewer exe -- cgit v1.2.3 From 183b097072015fe83c751904d8133fa105717a5b Mon Sep 17 00:00:00 2001 From: Rye Mutt Date: Tue, 13 Aug 2024 16:28:23 -0400 Subject: Update tracy integration to 0.11 and rework client library to be configurable at build time Also copy tracy profiler client next to windows binary when enabled --- autobuild.xml | 16 ++++++++-------- indra/cmake/Tracy.cmake | 16 ++++++++++++++-- indra/llcommon/CMakeLists.txt | 4 ++++ indra/llcommon/llprofiler.cpp | 30 ++++++++++++++++++++++++++++++ indra/llcommon/llprofiler.h | 6 ------ indra/newview/CMakeLists.txt | 6 ++++++ indra/newview/viewer_manifest.py | 5 +++++ 7 files changed, 67 insertions(+), 16 deletions(-) create mode 100644 indra/llcommon/llprofiler.cpp diff --git a/autobuild.xml b/autobuild.xml index b90d94865a..c39a4cd9de 100644 --- a/autobuild.xml +++ b/autobuild.xml @@ -2371,11 +2371,11 @@ Copyright (c) 2012, 2014, 2015, 2016 nghttp2 contributors archive hash - a901a14066daf8c8796c8d2914917129427fd80b + 226225ec049826c35adc5e897e0398ed64d4bedb hash_algorithm sha1 url - https://github.com/secondlife/3p-tracy/releases/download/v0.10.0%2Br1/tracy-v0.10.0.9845715133-darwin64-9845715133.tar.zst + https://github.com/secondlife/3p-tracy/releases/download/v0.11.0%2Br1/tracy-v0.11.0.10376230034-darwin64-10376230034.tar.zst name darwin64 @@ -2385,11 +2385,11 @@ Copyright (c) 2012, 2014, 2015, 2016 nghttp2 contributors archive hash - ca5fc66e3431278f20286261ffe85192bbd9a2ca + 8c5429d1a1486f40cf7e5e88a232222d1fa4f78e hash_algorithm sha1 url - https://github.com/secondlife/3p-tracy/releases/download/v0.10.0%2Br1/tracy-v0.10.0.9845715133-windows64-9845715133.tar.zst + https://github.com/secondlife/3p-tracy/releases/download/v0.11.0%2Br1/tracy-v0.11.0.10376230034-windows64-10376230034.tar.zst name windows64 @@ -2399,11 +2399,11 @@ Copyright (c) 2012, 2014, 2015, 2016 nghttp2 contributors archive hash - e6f53d513c238ad599b75a8b5f94b8b0d1315438 + ed0664a009aba1dcf1246d845839f524e857162e hash_algorithm sha1 url - https://github.com/secondlife/3p-tracy/releases/download/v0.10.0%2Br1/tracy-v0.10.0.9845715133-linux64-9845715133.tar.zst + https://github.com/secondlife/3p-tracy/releases/download/v0.11.0%2Br1/tracy-v0.11.0.10376230034-linux64-10376230034.tar.zst name linux64 @@ -2414,9 +2414,9 @@ Copyright (c) 2012, 2014, 2015, 2016 nghttp2 contributors license_file LICENSES/tracy_license.txt copyright - Copyright (c) 2017-2022, Bartosz Taudul (wolf@nereid.pl) + Copyright (c) 2017-2024, Bartosz Taudul (wolf@nereid.pl) version - v0.10.0.9845715133 + v0.11.0.10376230034 name tracy canonical_repo diff --git a/indra/cmake/Tracy.cmake b/indra/cmake/Tracy.cmake index 32c02edb93..bd3c13b06a 100644 --- a/indra/cmake/Tracy.cmake +++ b/indra/cmake/Tracy.cmake @@ -4,14 +4,26 @@ include(Prebuilt) include_guard() add_library( ll::tracy INTERFACE IMPORTED ) -set(USE_TRACY OFF CACHE BOOL "Use Tracy profiler.") +option(USE_TRACY "Use Tracy profiler." OFF) if (USE_TRACY) + option(USE_TRACY_ON_DEMAND "Use Tracy profiler." ON) + option(USE_TRACY_LOCAL_ONLY "Use Tracy profiler." OFF) + use_system_binary(tracy) use_prebuilt_binary(tracy) target_include_directories( ll::tracy SYSTEM INTERFACE ${LIBS_PREBUILT_DIR}/include/tracy) - target_link_libraries( ll::tracy INTERFACE TracyClient ) + + target_compile_definitions(ll::tracy INTERFACE -DTRACY_ENABLE=1 -DTRACY_ONLY_IPV4=1) + + if (USE_TRACY_ON_DEMAND) + target_compile_definitions(ll::tracy INTERFACE -DTRACY_ON_DEMAND=1) + endif () + + if (USE_TRACY_LOCAL_ONLY) + target_compile_definitions(ll::tracy INTERFACE -DTRACY_NO_BROADCAST=1 -DTRACY_ONLY_LOCALHOST=1) + endif () # See: indra/llcommon/llprofiler.h add_compile_definitions(LL_PROFILER_CONFIGURATION=3) diff --git a/indra/llcommon/CMakeLists.txt b/indra/llcommon/CMakeLists.txt index 8e43627a5f..165bfd52d5 100644 --- a/indra/llcommon/CMakeLists.txt +++ b/indra/llcommon/CMakeLists.txt @@ -267,6 +267,10 @@ if (DARWIN) list(APPEND llcommon_SOURCE_FILES llsys_objc.mm) endif (DARWIN) +if (USE_TRACY) + list(APPEND llcommon_SOURCE_FILES llprofiler.cpp) +endif () + list(APPEND llcommon_SOURCE_FILES ${llcommon_HEADER_FILES}) add_library (llcommon ${llcommon_SOURCE_FILES}) diff --git a/indra/llcommon/llprofiler.cpp b/indra/llcommon/llprofiler.cpp new file mode 100644 index 0000000000..bdddabf977 --- /dev/null +++ b/indra/llcommon/llprofiler.cpp @@ -0,0 +1,30 @@ +/** +* @file llprofiler.cpp +* @brief Implementation of llprofiler +* @author Rye Cogtail +* +* $LicenseInfo:firstyear=2024&license=viewerlgpl$ +* Second Life Viewer Source Code +* Copyright (C) 2024, Linden Research, Inc. +* +* This library is free software; you can redistribute it and/or +* modify it under the terms of the GNU Lesser General Public +* License as published by the Free Software Foundation; +* version 2.1 of the License only. +* +* This library is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +* Lesser General Public License for more details. +* +* You should have received a copy of the GNU Lesser General Public +* License along with this library; if not, write to the Free Software +* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA +* +* Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA +* $/LicenseInfo$ +*/ + +#include "linden_common.h" + +#include "TracyClient.cpp" diff --git a/indra/llcommon/llprofiler.h b/indra/llcommon/llprofiler.h index 732436cc4f..b7d0522336 100644 --- a/indra/llcommon/llprofiler.h +++ b/indra/llcommon/llprofiler.h @@ -78,12 +78,6 @@ extern thread_local bool gProfilerEnabled; #if defined(LL_PROFILER_CONFIGURATION) && (LL_PROFILER_CONFIGURATION > LL_PROFILER_CONFIG_NONE) #if LL_PROFILER_CONFIGURATION == LL_PROFILER_CONFIG_TRACY || LL_PROFILER_CONFIGURATION == LL_PROFILER_CONFIG_TRACY_FAST_TIMER - #define TRACY_ENABLE 1 -// Normally these would be enabled but we want to be able to build any viewer with Tracy enabled and run the Tracy server on another machine -// They must be undefined in order to work across multiple machines -// #define TRACY_NO_BROADCAST 1 -// #define TRACY_ONLY_LOCALHOST 1 - #define TRACY_ONLY_IPV4 1 #include "tracy/Tracy.hpp" // Enable OpenGL profiling diff --git a/indra/newview/CMakeLists.txt b/indra/newview/CMakeLists.txt index fbaf4e559f..7a9f3a46b5 100644 --- a/indra/newview/CMakeLists.txt +++ b/indra/newview/CMakeLists.txt @@ -1776,6 +1776,7 @@ if (WINDOWS) --artwork=${ARTWORK_DIR} "--bugsplat=${BUGSPLAT_DB}" "--openal=${USE_OPENAL}" + "--tracy=${USE_TRACY}" --build=${CMAKE_CURRENT_BINARY_DIR} --buildtype=$ "--channel=${VIEWER_CHANNEL}" @@ -1836,6 +1837,7 @@ if (WINDOWS) --artwork=${ARTWORK_DIR} "--bugsplat=${BUGSPLAT_DB}" "--openal=${USE_OPENAL}" + "--tracy=${USE_TRACY}" --build=${CMAKE_CURRENT_BINARY_DIR} --buildtype=$ "--channel=${VIEWER_CHANNEL}" @@ -1985,6 +1987,7 @@ if (LINUX) --artwork=${ARTWORK_DIR} "--bugsplat=${BUGSPLAT_DB}" "--openal=${USE_OPENAL}" + "--tracy=${USE_TRACY}" --build=${CMAKE_CURRENT_BINARY_DIR} --buildtype=${CMAKE_BUILD_TYPE} "--channel=${VIEWER_CHANNEL}" @@ -2012,6 +2015,7 @@ if (LINUX) --artwork=${ARTWORK_DIR} "--bugsplat=${BUGSPLAT_DB}" "--openal=${USE_OPENAL}" + "--tracy=${USE_TRACY}" --build=${CMAKE_CURRENT_BINARY_DIR} --buildtype=${CMAKE_BUILD_TYPE} "--channel=${VIEWER_CHANNEL}" @@ -2087,6 +2091,7 @@ if (DARWIN) --artwork=${ARTWORK_DIR} "--bugsplat=${BUGSPLAT_DB}" "--openal=${USE_OPENAL}" + "--tracy=${USE_TRACY}" --build=${CMAKE_CURRENT_BINARY_DIR} --buildtype=$ --bundleid=${MACOSX_BUNDLE_GUI_IDENTIFIER} @@ -2121,6 +2126,7 @@ if (DARWIN) --artwork=${ARTWORK_DIR} "--bugsplat=${BUGSPLAT_DB}" "--openal=${USE_OPENAL}" + "--tracy=${USE_TRACY}" --build=${CMAKE_CURRENT_BINARY_DIR} --buildtype=$ "--channel=${VIEWER_CHANNEL}" diff --git a/indra/newview/viewer_manifest.py b/indra/newview/viewer_manifest.py index 91a9347449..b2f9654eb3 100755 --- a/indra/newview/viewer_manifest.py +++ b/indra/newview/viewer_manifest.py @@ -586,6 +586,10 @@ class Windows_x86_64_Manifest(ViewerManifest): self.path("BugSplat64.dll") self.path("BugSplatRc64.dll") + if self.args['tracy'] == 'ON': + with self.prefix(src=os.path.join(pkgdir, 'bin')): + self.path("tracy-profiler.exe") + self.path(src="licenses-win32.txt", dst="licenses.txt") self.path("featuretable.txt") self.path("cube.dae") @@ -1372,6 +1376,7 @@ if __name__ == "__main__": dict(name='bugsplat', description="""BugSplat database to which to post crashes, if BugSplat crash reporting is desired""", default=''), dict(name='openal', description="""Indication openal libraries are needed""", default='OFF'), + dict(name='tracy', description="""Indication tracy profiler is enabled""", default='OFF'), ] try: main(extra=extra_arguments) -- cgit v1.2.3 From 70f455347eafa802036cf4a90d903d139a0fd7e9 Mon Sep 17 00:00:00 2001 From: Rye Mutt Date: Tue, 13 Aug 2024 17:26:19 -0400 Subject: Introduce tracy instrumentation of mutex in LLSingleton, LLInstanceTracker and logging --- indra/llcommon/llerror.cpp | 55 ++++++++++++++++++-------------------- indra/llcommon/llinstancetracker.h | 22 ++++++++------- indra/llcommon/llprofiler.h | 18 +++++++++++++ indra/llcommon/llsingleton.cpp | 5 ++-- indra/llcommon/llsingleton.h | 18 +++++++------ 5 files changed, 69 insertions(+), 49 deletions(-) diff --git a/indra/llcommon/llerror.cpp b/indra/llcommon/llerror.cpp index 6c3b9c9542..41c69ba194 100644 --- a/indra/llcommon/llerror.cpp +++ b/indra/llcommon/llerror.cpp @@ -55,6 +55,7 @@ #include "llsingleton.h" #include "llstl.h" #include "lltimer.h" +#include "llprofiler.h" // On Mac, got: // #error "Boost.Stacktrace requires `_Unwind_Backtrace` function. Define @@ -506,7 +507,7 @@ namespace LLError::TimeFunction mTimeFunction; Recorders mRecorders; - LLCoros::RMutex mRecorderMutex; + LL_PROFILE_MUTEX_NAMED(LLCoros::RMutex, mRecorderMutex, "Log Recorders"); int mShouldLogCallCounter; @@ -529,7 +530,6 @@ namespace mCrashFunction(NULL), mTimeFunction(NULL), mRecorders(), - mRecorderMutex(), mShouldLogCallCounter(0) { } @@ -1044,7 +1044,7 @@ namespace LLError return; } SettingsConfigPtr s = Globals::getInstance()->getSettingsConfig(); - std::unique_lock lock(s->mRecorderMutex); + std::unique_lock lock(s->mRecorderMutex); LL_PROFILE_MUTEX_LOCK(s->mRecorderMutex); s->mRecorders.push_back(recorder); } @@ -1055,7 +1055,7 @@ namespace LLError return; } SettingsConfigPtr s = Globals::getInstance()->getSettingsConfig(); - std::unique_lock lock(s->mRecorderMutex); + std::unique_lock lock(s->mRecorderMutex); LL_PROFILE_MUTEX_LOCK(s->mRecorderMutex); s->mRecorders.erase(std::remove(s->mRecorders.begin(), s->mRecorders.end(), recorder), s->mRecorders.end()); } @@ -1104,7 +1104,7 @@ namespace LLError std::shared_ptr findRecorder() { SettingsConfigPtr s = Globals::getInstance()->getSettingsConfig(); - std::unique_lock lock(s->mRecorderMutex); + std::unique_lock lock(s->mRecorderMutex); LL_PROFILE_MUTEX_LOCK(s->mRecorderMutex); return findRecorderPos(s).first; } @@ -1115,7 +1115,7 @@ namespace LLError bool removeRecorder() { SettingsConfigPtr s = Globals::getInstance()->getSettingsConfig(); - std::unique_lock lock(s->mRecorderMutex); + std::unique_lock lock(s->mRecorderMutex); LL_PROFILE_MUTEX_LOCK(s->mRecorderMutex); auto found = findRecorderPos(s); if (found.first) { @@ -1221,7 +1221,7 @@ namespace std::string escaped_message; - std::unique_lock lock(s->mRecorderMutex); + std::unique_lock lock(s->mRecorderMutex); LL_PROFILE_MUTEX_LOCK(s->mRecorderMutex); for (LLError::RecorderPtr& r : s->mRecorders) { if (!r->enabled()) @@ -1280,24 +1280,21 @@ namespace } namespace { - // We need a couple different mutexes, but we want to use the same mechanism - // for both. Make getMutex() a template function with different instances - // for different MutexDiscriminator values. - enum MutexDiscriminator - { - LOG_MUTEX, - STACKS_MUTEX - }; // Some logging calls happen very early in processing -- so early that our // module-static variables aren't yet initialized. getMutex() wraps a // function-static LLMutex so that early calls can still have a valid // LLMutex instance. - template - LLMutex* getMutex() + auto getLogMutex() + { + // guaranteed to be initialized the first time control reaches here + static LL_PROFILE_MUTEX_NAMED(std::recursive_mutex, sLogMutex, "Log Mutex"); + return &sLogMutex; + } + auto getStacksMutex() { // guaranteed to be initialized the first time control reaches here - static LLMutex sMutex; - return &sMutex; + static LL_PROFILE_MUTEX_NAMED(std::recursive_mutex, sStacksMutex, "Stacks Mutex"); + return &sStacksMutex; } bool checkLevelMap(const LevelMap& map, const std::string& key, @@ -1347,8 +1344,8 @@ namespace LLError bool Log::shouldLog(CallSite& site) { LL_PROFILE_ZONE_SCOPED_CATEGORY_LOGGING; - LLMutexTrylock lock(getMutex(), 5); - if (!lock.isLocked()) + std::unique_lock lock(*getLogMutex(), std::try_to_lock); LL_PROFILE_MUTEX_LOCK(*getLogMutex()); + if (!lock) { return false; } @@ -1392,8 +1389,8 @@ namespace LLError void Log::flush(const std::ostringstream& out, const CallSite& site) { LL_PROFILE_ZONE_SCOPED_CATEGORY_LOGGING; - LLMutexTrylock lock(getMutex(),5); - if (!lock.isLocked()) + std::unique_lock lock(*getLogMutex(), std::try_to_lock); LL_PROFILE_MUTEX_LOCK(*getLogMutex()); + if (!lock) { return; } @@ -1523,8 +1520,8 @@ namespace LLError //static void LLCallStacks::push(const char* function, const int line) { - LLMutexTrylock lock(getMutex(), 5); - if (!lock.isLocked()) + std::unique_lock lock(*getStacksMutex(), std::try_to_lock); LL_PROFILE_MUTEX_LOCK(*getStacksMutex()); + if (!lock) { return; } @@ -1548,8 +1545,8 @@ namespace LLError //static void LLCallStacks::end(const std::ostringstream& out) { - LLMutexTrylock lock(getMutex(), 5); - if (!lock.isLocked()) + std::unique_lock lock(*getStacksMutex(), std::try_to_lock); LL_PROFILE_MUTEX_LOCK(*getStacksMutex()); + if (!lock) { return; } @@ -1565,8 +1562,8 @@ namespace LLError //static void LLCallStacks::print() { - LLMutexTrylock lock(getMutex(), 5); - if (!lock.isLocked()) + std::unique_lock lock(*getStacksMutex(), std::try_to_lock); LL_PROFILE_MUTEX_LOCK(*getStacksMutex()); + if (!lock) { return; } diff --git a/indra/llcommon/llinstancetracker.h b/indra/llcommon/llinstancetracker.h index 3232a0e219..92b26354a1 100644 --- a/indra/llcommon/llinstancetracker.h +++ b/indra/llcommon/llinstancetracker.h @@ -52,7 +52,7 @@ namespace LLInstanceTrackerPrivate struct StaticBase { // We need to be able to lock static data while manipulating it. - std::mutex mMutex; + LL_PROFILE_MUTEX_NAMED(std::mutex, mMutex, "InstanceTracker Data"); }; void logerrs(const char* cls, const std::string&, const std::string&, const std::string&); @@ -101,7 +101,8 @@ public: static size_t instanceCount() { - return LockStatic()->mMap.size(); + LockStatic lock; LL_PROFILE_MUTEX_LOCK(lock->mMutex); + return lock->mMap.size(); } // snapshot of std::pair> pairs, for @@ -236,7 +237,7 @@ public: static ptr_t getInstance(const KEY& k) { - LockStatic lock; + LockStatic lock; LL_PROFILE_MUTEX_LOCK(lock->mMutex); const InstanceMap& map(lock->mMap); typename InstanceMap::const_iterator found = map.find(k); return (found == map.end()) ? NULL : found->second; @@ -252,19 +253,19 @@ protected: ptr_t ptr(static_cast(this), [](T*){}); // save corresponding weak_ptr for future reference mSelf = ptr; - LockStatic lock; + LockStatic lock; LL_PROFILE_MUTEX_LOCK(lock->mMutex); add_(lock, key, ptr); } public: virtual ~LLInstanceTracker() { - LockStatic lock; + LockStatic lock; LL_PROFILE_MUTEX_LOCK(lock->mMutex); remove_(lock); } protected: virtual void setKey(KEY key) { - LockStatic lock; + LockStatic lock; LL_PROFILE_MUTEX_LOCK(lock->mMutex); // Even though the shared_ptr we store in our map has a no-op deleter // for T itself, letting the use count decrement to 0 will still // delete the use-count object. Capture the shared_ptr we just removed @@ -376,7 +377,8 @@ public: static size_t instanceCount() { - return LockStatic()->mSet.size(); + LockStatic lock; LL_PROFILE_MUTEX_LOCK(lock->mMutex); + return lock->mSet.size(); } // snapshot of std::shared_ptr pointers @@ -488,14 +490,16 @@ protected: // save corresponding weak_ptr for future reference mSelf = ptr; // Also store it in our class-static set to track this instance. - LockStatic()->mSet.emplace(ptr); + LockStatic lock; LL_PROFILE_MUTEX_LOCK(lock->mMutex); + lock->mSet.emplace(ptr); } public: virtual ~LLInstanceTracker() { // convert weak_ptr to shared_ptr because that's what we store in our // InstanceSet - LockStatic()->mSet.erase(mSelf.lock()); + LockStatic lock; LL_PROFILE_MUTEX_LOCK(lock->mMutex); + lock->mSet.erase(mSelf.lock()); } protected: LLInstanceTracker(const LLInstanceTracker& other): diff --git a/indra/llcommon/llprofiler.h b/indra/llcommon/llprofiler.h index b7d0522336..f6a4d24747 100644 --- a/indra/llcommon/llprofiler.h +++ b/indra/llcommon/llprofiler.h @@ -102,6 +102,12 @@ extern thread_local bool gProfilerEnabled; #define LL_PROFILE_ZONE_ERR(name) LL_PROFILE_ZONE_NAMED_COLOR( name, 0XFF0000 ) // RGB yellow #define LL_PROFILE_ZONE_INFO(name) LL_PROFILE_ZONE_NAMED_COLOR( name, 0X00FFFF ) // RGB cyan #define LL_PROFILE_ZONE_WARN(name) LL_PROFILE_ZONE_NAMED_COLOR( name, 0x0FFFF00 ) // RGB red + + #define LL_PROFILE_MUTEX(type, varname) TracyLockable(type, varname) + #define LL_PROFILE_MUTEX_NAMED(type, varname, desc) TracyLockableN(type, varname, desc) + #define LL_PROFILE_MUTEX_SHARED(type, varname) TracySharedLockable(type, varname) + #define LL_PROFILE_MUTEX_SHARED_NAMED(type, varname, desc) TracySharedLockableN(type, varname, desc) + #define LL_PROFILE_MUTEX_LOCK(varname) { auto& mutex = varname; LockMark(mutex); } #endif #if LL_PROFILER_CONFIGURATION == LL_PROFILER_CONFIG_FAST_TIMER #define LL_PROFILER_FRAME_END @@ -118,6 +124,12 @@ extern thread_local bool gProfilerEnabled; #define LL_PROFILE_ZONE_ERR(name) (void)(name); // Not supported #define LL_PROFILE_ZONE_INFO(name) (void)(name); // Not supported #define LL_PROFILE_ZONE_WARN(name) (void)(name); // Not supported + + #define LL_PROFILE_MUTEX(type, varname) type varname + #define LL_PROFILE_MUTEX_NAMED(type, varname, desc) type varname + #define LL_PROFILE_MUTEX_SHARED(type, varname) type varname + #define LL_PROFILE_MUTEX_SHARED_NAMED(type, varname, desc) type varname + #define LL_PROFILE_MUTEX_LOCK(varname) // LL_PROFILE_MUTEX_LOCK is a no-op when Tracy is disabled #endif #if LL_PROFILER_CONFIGURATION == LL_PROFILER_CONFIG_TRACY_FAST_TIMER #define LL_PROFILER_FRAME_END FrameMark @@ -133,6 +145,12 @@ extern thread_local bool gProfilerEnabled; #define LL_PROFILE_ZONE_ERR(name) LL_PROFILE_ZONE_NAMED_COLOR( name, 0XFF0000 ) // RGB yellow #define LL_PROFILE_ZONE_INFO(name) LL_PROFILE_ZONE_NAMED_COLOR( name, 0X00FFFF ) // RGB cyan #define LL_PROFILE_ZONE_WARN(name) LL_PROFILE_ZONE_NAMED_COLOR( name, 0x0FFFF00 ) // RGB red + + #define LL_PROFILE_MUTEX(type, varname) TracyLockable(type, varname) + #define LL_PROFILE_MUTEX_NAMED(type, varname, desc) TracyLockableN(type, varname, desc) + #define LL_PROFILE_MUTEX_SHARED(type, varname) TracySharedLockable(type, varname) + #define LL_PROFILE_MUTEX_SHARED_NAMED(type, varname, desc) TracySharedLockableN(type, varname, desc) + #define LL_PROFILE_MUTEX_LOCK(varname) { auto& mutex = varname; LockMark(mutex); } // see https://github.com/wolfpld/tracy/issues/575 #endif #else #define LL_PROFILER_FRAME_END diff --git a/indra/llcommon/llsingleton.cpp b/indra/llcommon/llsingleton.cpp index d00e703a10..05dc3cde79 100644 --- a/indra/llcommon/llsingleton.cpp +++ b/indra/llcommon/llsingleton.cpp @@ -59,9 +59,8 @@ private: // it's safe to log -- which involves querying a different LLSingleton -- // which requires accessing the master list. typedef std::recursive_mutex mutex_t; - typedef std::unique_lock lock_t; - - mutex_t mMutex; + LL_PROFILE_MUTEX_NAMED(mutex_t, mMutex, "Singleton MasterList"); + typedef std::unique_lock lock_t; public: // Instantiate this to both obtain a reference to MasterList::instance() diff --git a/indra/llcommon/llsingleton.h b/indra/llcommon/llsingleton.h index 316831cd74..b5659e053c 100644 --- a/indra/llcommon/llsingleton.h +++ b/indra/llcommon/llsingleton.h @@ -35,6 +35,8 @@ #include "lockstatic.h" #include "llthread.h" // on_main_thread() #include "llmainthreadtask.h" +#include "llprofiler.h" +#include "llerror.h" #ifdef LL_WINDOWS #pragma warning(push) @@ -298,7 +300,7 @@ private: // Use a recursive_mutex in case of constructor circularity. With a // non-recursive mutex, that would result in deadlock. typedef std::recursive_mutex mutex_t; - mutex_t mMutex; // LockStatic looks for mMutex + LL_PROFILE_MUTEX_NAMED(mutex_t, mMutex, "Singleton Data"); // LockStatic looks for mMutex EInitState mInitState{UNINITIALIZED}; DERIVED_TYPE* mInstance{nullptr}; @@ -420,7 +422,7 @@ protected: // deleteSingleton() to defend against manual deletion. When we moved // cleanup to deleteSingleton(), we hit crashes due to dangling // pointers in the MasterList. - LockStatic lk; + LockStatic lk; LL_PROFILE_MUTEX_LOCK(lk->mMutex); lk->mInstance = nullptr; lk->mInitState = DELETED; @@ -448,7 +450,7 @@ public: // Hold the lock while we call cleanupSingleton() and the destructor. // Our destructor also instantiates LockStatic, requiring a recursive // mutex. - LockStatic lk; + LockStatic lk; LL_PROFILE_MUTEX_LOCK(lk->mMutex); // of course, only cleanup and delete if there's something there if (lk->mInstance) { @@ -505,7 +507,7 @@ public: { // nested scope for 'lk' // In case racing threads call getInstance() at the same moment, // serialize the calls. - LockStatic lk; + LockStatic lk; LL_PROFILE_MUTEX_LOCK(lk->mMutex); switch (lk->mInitState) { @@ -595,7 +597,7 @@ public: static bool instanceExists() { // defend any access to sData from racing threads - LockStatic lk; + LockStatic lk; LL_PROFILE_MUTEX_LOCK(lk->mMutex); return lk->mInitState == INITIALIZED; } @@ -605,7 +607,7 @@ public: static bool wasDeleted() { // defend any access to sData from racing threads - LockStatic lk; + LockStatic lk; LL_PROFILE_MUTEX_LOCK(lk->mMutex); return lk->mInitState == DELETED; } }; @@ -644,7 +646,7 @@ private: // In case racing threads both call initParamSingleton() at the same // time, serialize them. One should initialize; the other should see // mInitState already set. - LockStatic lk; + LockStatic lk; LL_PROFILE_MUTEX_LOCK(lk->mMutex); // For organizational purposes this function shouldn't be called twice if (lk->mInitState != super::UNINITIALIZED) { @@ -708,7 +710,7 @@ public: { // In case racing threads call getInstance() at the same moment as // initParamSingleton(), serialize the calls. - LockStatic lk; + LockStatic lk; LL_PROFILE_MUTEX_LOCK(lk->mMutex); switch (lk->mInitState) { -- cgit v1.2.3 From 6f0e6765218543c8e0d84931d37460026bc6bb3c Mon Sep 17 00:00:00 2001 From: Andrey Lihatskiy Date: Wed, 14 Aug 2024 06:03:39 +0300 Subject: Update indra/cmake/Tracy.cmake to stop pre-commit from complaining --- indra/cmake/Tracy.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/indra/cmake/Tracy.cmake b/indra/cmake/Tracy.cmake index bd3c13b06a..3339c51ba0 100644 --- a/indra/cmake/Tracy.cmake +++ b/indra/cmake/Tracy.cmake @@ -14,7 +14,7 @@ if (USE_TRACY) use_prebuilt_binary(tracy) target_include_directories( ll::tracy SYSTEM INTERFACE ${LIBS_PREBUILT_DIR}/include/tracy) - + target_compile_definitions(ll::tracy INTERFACE -DTRACY_ENABLE=1 -DTRACY_ONLY_IPV4=1) if (USE_TRACY_ON_DEMAND) -- cgit v1.2.3 From ad8dc13150b640ae9613e1edd8cc8c2c72b1e6b2 Mon Sep 17 00:00:00 2001 From: Rye Mutt Date: Tue, 13 Aug 2024 18:24:53 -0400 Subject: Reduce thread contention on HTTPStats singleton access via simpleton. The main thread and http thread had significant contention in asset-fetch heavy scenarios that could result in main thread and http thread stalls when the http thread was accessing the HTTPStats singleton and the master singleton dependency list had to be queried. The HTTP thread is the primary user of HTTPStats with the main thread only calling into it during shut down to query the stats for the session. --- indra/llcorehttp/httprequest.cpp | 2 ++ indra/llcorehttp/httpstats.h | 8 ++++---- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/indra/llcorehttp/httprequest.cpp b/indra/llcorehttp/httprequest.cpp index 216d407deb..2aaf71f8a4 100644 --- a/indra/llcorehttp/httprequest.cpp +++ b/indra/llcorehttp/httprequest.cpp @@ -489,6 +489,7 @@ HttpStatus HttpRequest::createService() HttpRequestQueue::init(); HttpRequestQueue * rq = HttpRequestQueue::instanceOf(); HttpService::init(rq); + HTTPStats::createInstance(); has_inited = true; } @@ -502,6 +503,7 @@ HttpStatus HttpRequest::destroyService() if (has_inited) { + HTTPStats::deleteSingleton(); HttpService::term(); HttpRequestQueue::term(); has_inited = false; diff --git a/indra/llcorehttp/httpstats.h b/indra/llcorehttp/httpstats.h index f12e59da0c..5c0f26d34e 100644 --- a/indra/llcorehttp/httpstats.h +++ b/indra/llcorehttp/httpstats.h @@ -35,12 +35,12 @@ namespace LLCore { - class HTTPStats : public LLSingleton + class HTTPStats final : public LLSimpleton { - LLSINGLETON(HTTPStats); - virtual ~HTTPStats(); - public: + HTTPStats(); + ~HTTPStats(); + void resetStats(); typedef LLStatsAccumulator StatsAccumulator; -- cgit v1.2.3 From 2cff1e217ba0df94fc50a30c8d49dc848c294ac6 Mon Sep 17 00:00:00 2001 From: Rye Mutt Date: Tue, 13 Aug 2024 18:39:57 -0400 Subject: Reduce UI draw stalls from LLSpellChecker singleton via simpleton --- indra/llui/llspellcheck.cpp | 17 +++++------------ indra/llui/llspellcheck.h | 9 ++++----- indra/llui/llui.cpp | 3 +++ indra/newview/llappviewer.cpp | 29 +++++++++++++++-------------- 4 files changed, 27 insertions(+), 31 deletions(-) diff --git a/indra/llui/llspellcheck.cpp b/indra/llui/llspellcheck.cpp index 16ffd352cf..e15616a16b 100644 --- a/indra/llui/llspellcheck.cpp +++ b/indra/llui/llspellcheck.cpp @@ -42,19 +42,13 @@ static const std::string DICT_FILE_USER = "user_dictionaries.xml"; LLSpellChecker::settings_change_signal_t LLSpellChecker::sSettingsChangeSignal; LLSpellChecker::LLSpellChecker() - : mHunspell(NULL) { + // Load initial dictionary information + refreshDictionaryMap(); } LLSpellChecker::~LLSpellChecker() { - delete mHunspell; -} - -void LLSpellChecker::initSingleton() -{ - // Load initial dictionary information - refreshDictionaryMap(); } bool LLSpellChecker::checkSpelling(const std::string& word) const @@ -300,8 +294,7 @@ void LLSpellChecker::initHunspell(const std::string& dict_language) { if (mHunspell) { - delete mHunspell; - mHunspell = NULL; + mHunspell.reset(); mDictLanguage.clear(); mDictFile.clear(); mIgnoreList.clear(); @@ -322,11 +315,11 @@ void LLSpellChecker::initHunspell(const std::string& dict_language) const std::string filename_dic = dict_entry["name"].asString() + ".dic"; if ( (gDirUtilp->fileExists(user_path + filename_aff)) && (gDirUtilp->fileExists(user_path + filename_dic)) ) { - mHunspell = new Hunspell((user_path + filename_aff).c_str(), (user_path + filename_dic).c_str()); + mHunspell = std::make_unique((user_path + filename_aff).c_str(), (user_path + filename_dic).c_str()); } else if ( (gDirUtilp->fileExists(app_path + filename_aff)) && (gDirUtilp->fileExists(app_path + filename_dic)) ) { - mHunspell = new Hunspell((app_path + filename_aff).c_str(), (app_path + filename_dic).c_str()); + mHunspell = std::make_unique((app_path + filename_aff).c_str(), (app_path + filename_dic).c_str()); } if (!mHunspell) { diff --git a/indra/llui/llspellcheck.h b/indra/llui/llspellcheck.h index e4d8a12ef1..9df2f94085 100644 --- a/indra/llui/llspellcheck.h +++ b/indra/llui/llspellcheck.h @@ -34,12 +34,12 @@ class Hunspell; -class LLSpellChecker : public LLSingleton +class LLSpellChecker : public LLSimpleton { - LLSINGLETON(LLSpellChecker); +public: + LLSpellChecker(); ~LLSpellChecker(); -public: void addToCustomDictionary(const std::string& word); void addToIgnoreList(const std::string& word); bool checkSpelling(const std::string& word) const; @@ -47,7 +47,6 @@ public: protected: void addToDictFile(const std::string& dict_path, const std::string& word); void initHunspell(const std::string& dict_language); - void initSingleton() override; public: typedef std::list dict_list_t; @@ -77,7 +76,7 @@ public: static boost::signals2::connection setSettingsChangeCallback(const settings_change_signal_t::slot_type& cb); protected: - Hunspell* mHunspell; + std::unique_ptr mHunspell; std::string mDictLanguage; std::string mDictFile; dict_list_t mDictSecondary; diff --git a/indra/llui/llui.cpp b/indra/llui/llui.cpp index 8d46422c09..e36dae3955 100644 --- a/indra/llui/llui.cpp +++ b/indra/llui/llui.cpp @@ -54,6 +54,7 @@ #include "llmenubutton.h" #include "llloadingindicator.h" #include "llwindow.h" +#include "llspellcheck.h" // for registration #include "llfiltereditor.h" @@ -157,6 +158,7 @@ mRootView(NULL), mHelpImpl(NULL) { LLRender2D::createInstance(image_provider); + LLSpellChecker::createInstance(); if ((get_ptr_in_map(mSettingGroups, std::string("config")) == NULL) || (get_ptr_in_map(mSettingGroups, std::string("floater")) == NULL) || @@ -198,6 +200,7 @@ mHelpImpl(NULL) LLUI::~LLUI() { + LLSpellChecker::deleteSingleton(); LLRender2D::deleteSingleton(); } diff --git a/indra/newview/llappviewer.cpp b/indra/newview/llappviewer.cpp index 262ab439b4..36fe5a953f 100644 --- a/indra/newview/llappviewer.cpp +++ b/indra/newview/llappviewer.cpp @@ -806,6 +806,20 @@ bool LLAppViewer::init() LLUIImageList::getInstance(), ui_audio_callback, deferred_ui_audio_callback); + + if (gSavedSettings.getBOOL("SpellCheck")) + { + std::list dict_list; + std::string dict_setting = gSavedSettings.getString("SpellCheckDictionary"); + boost::split(dict_list, dict_setting, boost::is_any_of(std::string(","))); + if (!dict_list.empty()) + { + LLSpellChecker::setUseSpellCheck(dict_list.front()); + dict_list.pop_front(); + LLSpellChecker::instance().setSecondaryDictionaries(dict_list); + } + } + LL_INFOS("InitInfo") << "UI initialized." << LL_ENDL ; // NOW LLUI::getLanguage() should work. gDirUtilp must know the language @@ -1611,7 +1625,7 @@ bool LLAppViewer::doFrame() { LL_PROFILE_ZONE_NAMED_CATEGORY_APP("df gMeshRepo"); - gMeshRepo.update() ; + gMeshRepo.update() ; } if(!total_work_pending) //pause texture fetching threads if nothing to process. @@ -2799,19 +2813,6 @@ bool LLAppViewer::initConfiguration() gSavedSettings.getString("Language")); } - if (gSavedSettings.getBOOL("SpellCheck")) - { - std::list dict_list; - std::string dict_setting = gSavedSettings.getString("SpellCheckDictionary"); - boost::split(dict_list, dict_setting, boost::is_any_of(std::string(","))); - if (!dict_list.empty()) - { - LLSpellChecker::setUseSpellCheck(dict_list.front()); - dict_list.pop_front(); - LLSpellChecker::instance().setSecondaryDictionaries(dict_list); - } - } - if (gNonInteractive) { tempSetControl("AllowMultipleViewers", "true"); -- cgit v1.2.3 From 6dbf1cafb20557722f30618e744e5ab61e9365fa Mon Sep 17 00:00:00 2001 From: Rye Mutt Date: Tue, 13 Aug 2024 18:45:50 -0400 Subject: Reduce texture fetch and main thread contention from LLViewerStatsRecorder via simpleton. --- indra/newview/llappviewer.cpp | 2 ++ indra/newview/llstartup.cpp | 1 - indra/newview/llviewerstatsrecorder.cpp | 10 +--------- indra/newview/llviewerstatsrecorder.h | 9 +++------ 4 files changed, 6 insertions(+), 16 deletions(-) diff --git a/indra/newview/llappviewer.cpp b/indra/newview/llappviewer.cpp index 36fe5a953f..ca7a300403 100644 --- a/indra/newview/llappviewer.cpp +++ b/indra/newview/llappviewer.cpp @@ -1284,6 +1284,7 @@ bool LLAppViewer::init() //LLSimpleton creations LLEnvironment::createInstance(); LLWorld::createInstance(); + LLViewerStatsRecorder::createInstance(); LLSelectMgr::createInstance(); LLViewerCamera::createInstance(); LL::GLTFSceneManager::createInstance(); @@ -2166,6 +2167,7 @@ bool LLAppViewer::cleanup() LL::GLTFSceneManager::deleteSingleton(); LLEnvironment::deleteSingleton(); LLSelectMgr::deleteSingleton(); + LLViewerStatsRecorder::deleteSingleton(); LLViewerEventRecorder::deleteSingleton(); LLWorld::deleteSingleton(); LLVoiceClient::deleteSingleton(); diff --git a/indra/newview/llstartup.cpp b/indra/newview/llstartup.cpp index b993ba16d5..7cefa21125 100644 --- a/indra/newview/llstartup.cpp +++ b/indra/newview/llstartup.cpp @@ -1285,7 +1285,6 @@ bool idle_startup() // // Initialize classes w/graphics stuff. // - LLViewerStatsRecorder::instance(); // Since textures work in threads LLSurface::initClasses(); display_startup(); diff --git a/indra/newview/llviewerstatsrecorder.cpp b/indra/newview/llviewerstatsrecorder.cpp index 88edb96fbb..58065ecce5 100644 --- a/indra/newview/llviewerstatsrecorder.cpp +++ b/indra/newview/llviewerstatsrecorder.cpp @@ -27,16 +27,13 @@ #include "llviewerprecompiledheaders.h" #include "llviewerstatsrecorder.h" - #include "llcontrol.h" #include "llfile.h" +#include "llviewercontrol.h" #include "llviewerregion.h" #include "llviewerobject.h" #include "llworld.h" -extern LLControlGroup gSavedSettings; - -LLViewerStatsRecorder* LLViewerStatsRecorder::sInstance = NULL; LLViewerStatsRecorder::LLViewerStatsRecorder() : mStatsFile(NULL), mTimer(), @@ -48,11 +45,6 @@ LLViewerStatsRecorder::LLViewerStatsRecorder() : mMaxDuration(300.f), mSkipSaveIfZeros(false) { - if (NULL != sInstance) - { - LL_ERRS() << "Attempted to create multiple instances of LLViewerStatsRecorder!" << LL_ENDL; - } - sInstance = this; clearStats(); } diff --git a/indra/newview/llviewerstatsrecorder.h b/indra/newview/llviewerstatsrecorder.h index ecc321c0a8..2108f49dc3 100644 --- a/indra/newview/llviewerstatsrecorder.h +++ b/indra/newview/llviewerstatsrecorder.h @@ -38,13 +38,12 @@ class LLMutex; class LLViewerObject; -class LLViewerStatsRecorder : public LLSingleton +class LLViewerStatsRecorder : public LLSimpleton { - LLSINGLETON(LLViewerStatsRecorder); +public: + LLViewerStatsRecorder(); LOG_CLASS(LLViewerStatsRecorder); ~LLViewerStatsRecorder(); - - public: // Enable/disable stats recording. This is broken down into two // flags so we can record stats without writing them to the log // file. This is useful to analyzing updates for scene loading. @@ -140,8 +139,6 @@ private: void closeStatsFile(); void makeStatsFileName(); - static LLViewerStatsRecorder* sInstance; - LLFILE * mStatsFile; // File to write data into std::string mStatsFileName; -- cgit v1.2.3 From 0ee528c5fdfa8d49ebd43774853880f1b2e352d8 Mon Sep 17 00:00:00 2001 From: Rye Mutt Date: Tue, 13 Aug 2024 18:35:46 -0400 Subject: Mitigate asset fetch thread stalls from LLDiskCache mutex contention and trivial cleanup Move LLDiskCache::updateFileAccessTime to LLFilesystem as it's the only user of that function. Change mCacheDir and LLDiskCache::metaDataToFilepath to statics. --- indra/llfilesystem/lldiskcache.cpp | 120 ++++++++---------------------------- indra/llfilesystem/lldiskcache.h | 23 +------ indra/llfilesystem/llfilesystem.cpp | 90 ++++++++++++++++++++++----- indra/llfilesystem/llfilesystem.h | 7 +++ 4 files changed, 108 insertions(+), 132 deletions(-) diff --git a/indra/llfilesystem/lldiskcache.cpp b/indra/llfilesystem/lldiskcache.cpp index 86b1e2ac81..e780387f4e 100644 --- a/indra/llfilesystem/lldiskcache.cpp +++ b/indra/llfilesystem/lldiskcache.cpp @@ -39,15 +39,25 @@ #include "lldiskcache.h" + /** + * The prefix inserted at the start of a cache file filename to + * help identify it as a cache file. It's probably not required + * (just the presence in the cache folder is enough) but I am + * paranoid about the cache folder being set to something bad + * like the users' OS system dir by mistake or maliciously and + * this will help to offset any damage if that happens. + */ +static const std::string CACHE_FILENAME_PREFIX("sl_cache"); + +std::string LLDiskCache::sCacheDir; + LLDiskCache::LLDiskCache(const std::string cache_dir, const uintmax_t max_size_bytes, const bool enable_cache_debug_info) : - mCacheDir(cache_dir), mMaxSizeBytes(max_size_bytes), mEnableCacheDebugInfo(enable_cache_debug_info) { - mCacheFilenamePrefix = "sl_cache"; - + sCacheDir = cache_dir; LLFile::mkdir(cache_dir); } @@ -83,7 +93,7 @@ void LLDiskCache::purge() { if (mEnableCacheDebugInfo) { - LL_INFOS() << "Total dir size before purge is " << dirFileSize(mCacheDir) << LL_ENDL; + LL_INFOS() << "Total dir size before purge is " << dirFileSize(sCacheDir) << LL_ENDL; } boost::system::error_code ec; @@ -93,9 +103,9 @@ void LLDiskCache::purge() std::vector file_info; #if LL_WINDOWS - std::wstring cache_path(utf8str_to_utf16str(mCacheDir)); + std::wstring cache_path(utf8str_to_utf16str(sCacheDir)); #else - std::string cache_path(mCacheDir); + std::string cache_path(sCacheDir); #endif if (boost::filesystem::is_directory(cache_path, ec) && !ec.failed()) { @@ -104,7 +114,7 @@ void LLDiskCache::purge() { if (boost::filesystem::is_regular_file(*iter, ec) && !ec.failed()) { - if ((*iter).path().string().find(mCacheFilenamePrefix) != std::string::npos) + if ((*iter).path().string().find(CACHE_FILENAME_PREFIX) != std::string::npos) { uintmax_t file_size = boost::filesystem::file_size(*iter, ec); if (ec.failed()) @@ -181,7 +191,7 @@ void LLDiskCache::purge() LL_INFOS() << line.str() << LL_ENDL; } - LL_INFOS() << "Total dir size after purge is " << dirFileSize(mCacheDir) << LL_ENDL; + LL_INFOS() << "Total dir size after purge is " << dirFileSize(sCacheDir) << LL_ENDL; LL_INFOS() << "Cache purge took " << execute_time << " ms to execute for " << file_info.size() << " files" << LL_ENDL; } } @@ -236,89 +246,9 @@ const std::string LLDiskCache::assetTypeToString(LLAssetType::EType at) return std::string("UNKNOWN"); } -const std::string LLDiskCache::metaDataToFilepath(const std::string id, - LLAssetType::EType at, - const std::string extra_info) +const std::string LLDiskCache::metaDataToFilepath(const std::string& id, LLAssetType::EType at) { - std::ostringstream file_path; - - file_path << mCacheDir; - file_path << gDirUtilp->getDirDelimiter(); - file_path << mCacheFilenamePrefix; - file_path << "_"; - file_path << id; - file_path << "_"; - file_path << (extra_info.empty() ? "0" : extra_info); - //file_path << "_"; - //file_path << assetTypeToString(at); // see SL-14210 Prune descriptive tag from new cache filenames - // for details of why it was removed. Note that if you put it - // back or change the format of the filename, the cache files - // files will be invalidated (and perhaps, more importantly, - // never deleted unless you delete them manually). - file_path << ".asset"; - - return file_path.str(); -} - -void LLDiskCache::updateFileAccessTime(const std::string file_path) -{ - /** - * Threshold in time_t units that is used to decide if the last access time - * time of the file is updated or not. Added as a precaution for the concern - * outlined in SL-14582 about frequent writes on older SSDs reducing their - * lifespan. I think this is the right place for the threshold value - rather - * than it being a pref - do comment on that Jira if you disagree... - * - * Let's start with 1 hour in time_t units and see how that unfolds - */ - const std::time_t time_threshold = 1 * 60 * 60; - - // current time - const std::time_t cur_time = std::time(nullptr); - - boost::system::error_code ec; -#if LL_WINDOWS - // file last write time - const std::time_t last_write_time = boost::filesystem::last_write_time(utf8str_to_utf16str(file_path), ec); - if (ec.failed()) - { - LL_WARNS() << "Failed to read last write time for cache file " << file_path << ": " << ec.message() << LL_ENDL; - return; - } - - // delta between cur time and last time the file was written - const std::time_t delta_time = cur_time - last_write_time; - - // we only write the new value if the time in time_threshold has elapsed - // before the last one - if (delta_time > time_threshold) - { - boost::filesystem::last_write_time(utf8str_to_utf16str(file_path), cur_time, ec); - } -#else - // file last write time - const std::time_t last_write_time = boost::filesystem::last_write_time(file_path, ec); - if (ec.failed()) - { - LL_WARNS() << "Failed to read last write time for cache file " << file_path << ": " << ec.message() << LL_ENDL; - return; - } - - // delta between cur time and last time the file was written - const std::time_t delta_time = cur_time - last_write_time; - - // we only write the new value if the time in time_threshold has elapsed - // before the last one - if (delta_time > time_threshold) - { - boost::filesystem::last_write_time(file_path, cur_time, ec); - } -#endif - - if (ec.failed()) - { - LL_WARNS() << "Failed to update last write time for cache file " << file_path << ": " << ec.message() << LL_ENDL; - } + return llformat("%s%s%s_%s_0.asset", sCacheDir.c_str(), gDirUtilp->getDirDelimiter().c_str(), CACHE_FILENAME_PREFIX.c_str(), id.c_str()); } const std::string LLDiskCache::getCacheInfo() @@ -326,7 +256,7 @@ const std::string LLDiskCache::getCacheInfo() std::ostringstream cache_info; F32 max_in_mb = (F32)mMaxSizeBytes / (1024.0f * 1024.0f); - F32 percent_used = ((F32)dirFileSize(mCacheDir) / (F32)mMaxSizeBytes) * 100.0f; + F32 percent_used = ((F32)dirFileSize(sCacheDir) / (F32)mMaxSizeBytes) * 100.0f; cache_info << std::fixed; cache_info << std::setprecision(1); @@ -346,9 +276,9 @@ void LLDiskCache::clearCache() */ boost::system::error_code ec; #if LL_WINDOWS - std::wstring cache_path(utf8str_to_utf16str(mCacheDir)); + std::wstring cache_path(utf8str_to_utf16str(sCacheDir)); #else - std::string cache_path(mCacheDir); + std::string cache_path(sCacheDir); #endif if (boost::filesystem::is_directory(cache_path, ec) && !ec.failed()) { @@ -357,7 +287,7 @@ void LLDiskCache::clearCache() { if (boost::filesystem::is_regular_file(*iter, ec) && !ec.failed()) { - if ((*iter).path().string().find(mCacheFilenamePrefix) != std::string::npos) + if ((*iter).path().string().find(CACHE_FILENAME_PREFIX) != std::string::npos) { boost::filesystem::remove(*iter, ec); if (ec.failed()) @@ -431,7 +361,7 @@ uintmax_t LLDiskCache::dirFileSize(const std::string dir) { if (boost::filesystem::is_regular_file(*iter, ec) && !ec.failed()) { - if ((*iter).path().string().find(mCacheFilenamePrefix) != std::string::npos) + if ((*iter).path().string().find(CACHE_FILENAME_PREFIX) != std::string::npos) { uintmax_t file_size = boost::filesystem::file_size(*iter, ec); if (!ec.failed()) diff --git a/indra/llfilesystem/lldiskcache.h b/indra/llfilesystem/lldiskcache.h index b60e74f8c9..62c19361fb 100644 --- a/indra/llfilesystem/lldiskcache.h +++ b/indra/llfilesystem/lldiskcache.h @@ -104,16 +104,9 @@ class LLDiskCache : * so many things had to be pushed back there to accomodate it, that I * decided to move it here. Still not sure that's completely right. */ - const std::string metaDataToFilepath(const std::string id, - LLAssetType::EType at, - const std::string extra_info); + static const std::string metaDataToFilepath(const std::string& id, + LLAssetType::EType at); - /** - * Update the "last write time" of a file to "now". This must be called whenever a - * file in the cache is read (not written) so that the last time the file was - * accessed is up to date (This is used in the mechanism for purging the cache) - */ - void updateFileAccessTime(const std::string file_path); /** * Purge the oldest items in the cache so that the combined size of all files @@ -170,17 +163,7 @@ class LLDiskCache : * setting could potentially point it at a non-cache directory (for example, * the Windows System dir) with disastrous results. */ - std::string mCacheDir; - - /** - * The prefix inserted at the start of a cache file filename to - * help identify it as a cache file. It's probably not required - * (just the presence in the cache folder is enough) but I am - * paranoid about the cache folder being set to something bad - * like the users' OS system dir by mistake or maliciously and - * this will help to offset any damage if that happens. - */ - std::string mCacheFilenamePrefix; + static std::string sCacheDir; /** * When enabled, displays additional debugging information in diff --git a/indra/llfilesystem/llfilesystem.cpp b/indra/llfilesystem/llfilesystem.cpp index 7d2a6bd6f5..b206aab7cf 100644 --- a/indra/llfilesystem/llfilesystem.cpp +++ b/indra/llfilesystem/llfilesystem.cpp @@ -34,6 +34,8 @@ #include "llfasttimer.h" #include "lldiskcache.h" +#include "boost/filesystem.hpp" + const S32 LLFileSystem::READ = 0x00000001; const S32 LLFileSystem::WRITE = 0x00000002; const S32 LLFileSystem::READ_WRITE = 0x00000003; // LLFileSystem::READ & LLFileSystem::WRITE @@ -56,9 +58,8 @@ LLFileSystem::LLFileSystem(const LLUUID& file_id, const LLAssetType::EType file_ { // build the filename (TODO: we do this in a few places - perhaps we should factor into a single function) std::string id; - mFileID.toString(id); - const std::string extra_info = ""; - const std::string filename = LLDiskCache::getInstance()->metaDataToFilepath(id, mFileType, extra_info); + mFileID.asString(); + const std::string filename = LLDiskCache::metaDataToFilepath(id, mFileType); // update the last access time for the file if it exists - this is required // even though we are reading and not writing because this is the @@ -67,7 +68,7 @@ LLFileSystem::LLFileSystem(const LLUUID& file_id, const LLAssetType::EType file_ bool exists = gDirUtilp->fileExists(filename); if (exists) { - LLDiskCache::getInstance()->updateFileAccessTime(filename); + updateFileAccessTime(filename); } } } @@ -82,8 +83,7 @@ bool LLFileSystem::getExists(const LLUUID& file_id, const LLAssetType::EType fil LL_PROFILE_ZONE_SCOPED; std::string id_str; file_id.toString(id_str); - const std::string extra_info = ""; - const std::string filename = LLDiskCache::getInstance()->metaDataToFilepath(id_str, file_type, extra_info); + const std::string filename = LLDiskCache::metaDataToFilepath(id_str, file_type); llifstream file(filename, std::ios::binary); if (file.is_open()) @@ -99,8 +99,7 @@ bool LLFileSystem::removeFile(const LLUUID& file_id, const LLAssetType::EType fi { std::string id_str; file_id.toString(id_str); - const std::string extra_info = ""; - const std::string filename = LLDiskCache::getInstance()->metaDataToFilepath(id_str, file_type, extra_info); + const std::string filename = LLDiskCache::metaDataToFilepath(id_str, file_type); LLFile::remove(filename.c_str(), suppress_error); @@ -113,12 +112,11 @@ bool LLFileSystem::renameFile(const LLUUID& old_file_id, const LLAssetType::ETyp { std::string old_id_str; old_file_id.toString(old_id_str); - const std::string extra_info = ""; - const std::string old_filename = LLDiskCache::getInstance()->metaDataToFilepath(old_id_str, old_file_type, extra_info); + const std::string old_filename = LLDiskCache::metaDataToFilepath(old_id_str, old_file_type); std::string new_id_str; new_file_id.toString(new_id_str); - const std::string new_filename = LLDiskCache::getInstance()->metaDataToFilepath(new_id_str, new_file_type, extra_info); + const std::string new_filename = LLDiskCache::metaDataToFilepath(new_id_str, new_file_type); // Rename needs the new file to not exist. LLFileSystem::removeFile(new_file_id, new_file_type, ENOENT); @@ -140,8 +138,7 @@ S32 LLFileSystem::getFileSize(const LLUUID& file_id, const LLAssetType::EType fi { std::string id_str; file_id.toString(id_str); - const std::string extra_info = ""; - const std::string filename = LLDiskCache::getInstance()->metaDataToFilepath(id_str, file_type, extra_info); + const std::string filename = LLDiskCache::metaDataToFilepath(id_str, file_type); S32 file_size = 0; llifstream file(filename, std::ios::binary); @@ -160,8 +157,7 @@ bool LLFileSystem::read(U8* buffer, S32 bytes) std::string id; mFileID.toString(id); - const std::string extra_info = ""; - const std::string filename = LLDiskCache::getInstance()->metaDataToFilepath(id, mFileType, extra_info); + const std::string filename = LLDiskCache::metaDataToFilepath(id, mFileType); llifstream file(filename, std::ios::binary); if (file.is_open()) @@ -205,8 +201,7 @@ bool LLFileSystem::write(const U8* buffer, S32 bytes) { std::string id_str; mFileID.toString(id_str); - const std::string extra_info = ""; - const std::string filename = LLDiskCache::getInstance()->metaDataToFilepath(id_str, mFileType, extra_info); + const std::string filename = LLDiskCache::metaDataToFilepath(id_str, mFileType); bool success = false; @@ -325,3 +320,64 @@ bool LLFileSystem::remove() return true; } + +void LLFileSystem::updateFileAccessTime(const std::string& file_path) +{ + /** + * Threshold in time_t units that is used to decide if the last access time + * time of the file is updated or not. Added as a precaution for the concern + * outlined in SL-14582 about frequent writes on older SSDs reducing their + * lifespan. I think this is the right place for the threshold value - rather + * than it being a pref - do comment on that Jira if you disagree... + * + * Let's start with 1 hour in time_t units and see how that unfolds + */ + const std::time_t time_threshold = 1 * 60 * 60; + + // current time + const std::time_t cur_time = std::time(nullptr); + + boost::system::error_code ec; +#if LL_WINDOWS + // file last write time + const std::time_t last_write_time = boost::filesystem::last_write_time(utf8str_to_utf16str(file_path), ec); + if (ec.failed()) + { + LL_WARNS() << "Failed to read last write time for cache file " << file_path << ": " << ec.message() << LL_ENDL; + return; + } + + // delta between cur time and last time the file was written + const std::time_t delta_time = cur_time - last_write_time; + + // we only write the new value if the time in time_threshold has elapsed + // before the last one + if (delta_time > time_threshold) + { + boost::filesystem::last_write_time(utf8str_to_utf16str(file_path), cur_time, ec); + } +#else + // file last write time + const std::time_t last_write_time = boost::filesystem::last_write_time(file_path, ec); + if (ec.failed()) + { + LL_WARNS() << "Failed to read last write time for cache file " << file_path << ": " << ec.message() << LL_ENDL; + return; + } + + // delta between cur time and last time the file was written + const std::time_t delta_time = cur_time - last_write_time; + + // we only write the new value if the time in time_threshold has elapsed + // before the last one + if (delta_time > time_threshold) + { + boost::filesystem::last_write_time(file_path, cur_time, ec); + } +#endif + + if (ec.failed()) + { + LL_WARNS() << "Failed to update last write time for cache file " << file_path << ": " << ec.message() << LL_ENDL; + } +} diff --git a/indra/llfilesystem/llfilesystem.h b/indra/llfilesystem/llfilesystem.h index ea1b9cf3a1..983e452981 100644 --- a/indra/llfilesystem/llfilesystem.h +++ b/indra/llfilesystem/llfilesystem.h @@ -53,6 +53,13 @@ class LLFileSystem bool rename(const LLUUID& new_id, const LLAssetType::EType new_type); bool remove(); + /** + * Update the "last write time" of a file to "now". This must be called whenever a + * file in the cache is read (not written) so that the last time the file was + * accessed is up to date (This is used in the mechanism for purging the cache) + */ + void updateFileAccessTime(const std::string& file_path); + static bool getExists(const LLUUID& file_id, const LLAssetType::EType file_type); static bool removeFile(const LLUUID& file_id, const LLAssetType::EType file_type, int suppress_error = 0); static bool renameFile(const LLUUID& old_file_id, const LLAssetType::EType old_file_type, -- cgit v1.2.3 From b5e306f7d89e82984a37824a3640bd67a5c45d61 Mon Sep 17 00:00:00 2001 From: Rye Mutt Date: Wed, 14 Aug 2024 11:01:02 -0400 Subject: Enable /permissive- on MSVC for better standards conformance (#2251) * Enable /permissive- on MSVC for better C++ conformance and fix related errors * Clean up left over warning suppressions from old library or msvc versions --- indra/cmake/00-Common.cmake | 1 + indra/llappearance/llavatarappearancedefines.cpp | 1 + indra/llcommon/llallocator_heap_profile.cpp | 7 ------- indra/llcommon/llevents.h | 10 +--------- indra/llcommon/llfindlocale.cpp | 2 +- indra/llcommon/llsdjson.cpp | 9 --------- indra/llcommon/llstacktrace.cpp | 3 --- indra/llcommon/llstring.cpp | 5 +++++ indra/llcommon/llstring.h | 5 +++-- indra/llcommon/lluuid.cpp | 1 + indra/llcommon/tests/commonmisc_test.cpp | 6 ------ indra/llimage/llimagejpeg.h | 1 - indra/llinventory/llinventorytype.cpp | 1 + indra/llmath/llsimdtypes.h | 18 ------------------ indra/llmessage/llblowfishcipher.cpp | 6 +++--- indra/llprimitive/lldaeloader.cpp | 10 ++-------- indra/llprimitive/tests/llmediaentry_test.cpp | 9 ++------- indra/llwindow/lldxhardware.cpp | 6 +++--- indra/llwindow/llwindowwin32.cpp | 4 ++-- indra/llxml/llcontrol.h | 24 ------------------------ indra/newview/llappearancemgr.cpp | 5 ----- indra/newview/llappviewer.cpp | 5 ----- indra/newview/llcommandlineparser.cpp | 14 -------------- indra/newview/llgroupmgr.cpp | 11 ----------- indra/newview/llimprocessing.cpp | 4 ---- indra/newview/lllogchat.cpp | 12 ------------ indra/newview/llmediadataclient.cpp | 5 ----- indra/newview/llsecapi.h | 4 ++++ indra/newview/llsechandler_basic.h | 9 +++++++++ indra/newview/llviewerjoystick.cpp | 2 +- indra/newview/llviewerjoystick.h | 2 +- indra/newview/llviewerprecompiledheaders.h | 5 ----- indra/newview/llvoavatarself.cpp | 11 ----------- indra/newview/llwindebug.h | 3 --- indra/test/test.cpp | 8 -------- indra/viewer_components/login/lllogin.cpp | 7 ------- 36 files changed, 41 insertions(+), 195 deletions(-) diff --git a/indra/cmake/00-Common.cmake b/indra/cmake/00-Common.cmake index 4b3fa00fcf..5087c308ee 100644 --- a/indra/cmake/00-Common.cmake +++ b/indra/cmake/00-Common.cmake @@ -83,6 +83,7 @@ if (WINDOWS) /Oy- /fp:fast /MP + /permissive- ) # Nicky: x64 implies SSE2 diff --git a/indra/llappearance/llavatarappearancedefines.cpp b/indra/llappearance/llavatarappearancedefines.cpp index c69517cb22..580e6433c5 100644 --- a/indra/llappearance/llavatarappearancedefines.cpp +++ b/indra/llappearance/llavatarappearancedefines.cpp @@ -252,6 +252,7 @@ LLAvatarAppearanceDictionary::BakedEntry::BakedEntry(ETextureIndex tex_index, LLWearableType::EType t = (LLWearableType::EType)va_arg(argp,int); mWearables.push_back(t); } + va_end(argp); } ETextureIndex LLAvatarAppearanceDictionary::bakedToLocalTextureIndex(EBakedTextureIndex index) const diff --git a/indra/llcommon/llallocator_heap_profile.cpp b/indra/llcommon/llallocator_heap_profile.cpp index 85e56b4db4..8cc44b6a01 100644 --- a/indra/llcommon/llallocator_heap_profile.cpp +++ b/indra/llcommon/llallocator_heap_profile.cpp @@ -28,13 +28,6 @@ #include "linden_common.h" #include "llallocator_heap_profile.h" -#if LL_MSVC -// disable warning about boost::lexical_cast returning uninitialized data -// when it fails to parse the string -#pragma warning (disable:4701) -#pragma warning (disable:4702) -#endif - #include #include #include diff --git a/indra/llcommon/llevents.h b/indra/llcommon/llevents.h index f97fca0a32..4bf1fa07a2 100644 --- a/indra/llcommon/llevents.h +++ b/indra/llcommon/llevents.h @@ -38,16 +38,8 @@ #include #include #include -#if LL_WINDOWS - #pragma warning (push) - #pragma warning (disable : 4263) // boost::signals2::expired_slot::what() has const mismatch - #pragma warning (disable : 4264) -#endif -#include -#if LL_WINDOWS - #pragma warning (pop) -#endif +#include #include #include // noncopyable #include diff --git a/indra/llcommon/llfindlocale.cpp b/indra/llcommon/llfindlocale.cpp index ac52f90c9f..b4bcc80ac4 100644 --- a/indra/llcommon/llfindlocale.cpp +++ b/indra/llcommon/llfindlocale.cpp @@ -185,7 +185,7 @@ canonise_fl(FL_Locale *l) { #define RML(pn,sn) MAKELANGID(LANG_##pn, SUBLANG_##sn) struct IDToCode { LANGID id; - char* code; + const char* code; }; static const IDToCode both_to_code[] = { {ML(ENGLISH,US), "en_US.ISO_8859-1"}, diff --git a/indra/llcommon/llsdjson.cpp b/indra/llcommon/llsdjson.cpp index e95d2e6c1c..5d38e55686 100644 --- a/indra/llcommon/llsdjson.cpp +++ b/indra/llcommon/llsdjson.cpp @@ -35,16 +35,7 @@ #include "llerror.h" #include "../llmath/llmath.h" -#if LL_WINDOWS -#pragma warning (push) -#pragma warning (disable : 4702) // compiler thinks unreachable code -#endif #include -#if LL_WINDOWS -#pragma warning (pop) -#endif - - //========================================================================= LLSD LlsdFromJson(const boost::json::value& val) diff --git a/indra/llcommon/llstacktrace.cpp b/indra/llcommon/llstacktrace.cpp index bda3579f60..ca8f4299d9 100644 --- a/indra/llcommon/llstacktrace.cpp +++ b/indra/llcommon/llstacktrace.cpp @@ -33,10 +33,7 @@ #include #include "llwin32headerslean.h" -#pragma warning (push) -#pragma warning (disable:4091) // a microsoft header has warnings. Very nice. #include -#pragma warning (pop) typedef USHORT NTAPI RtlCaptureStackBackTrace_Function( IN ULONG frames_to_skip, diff --git a/indra/llcommon/llstring.cpp b/indra/llcommon/llstring.cpp index c57f8b1e96..505789f9ea 100644 --- a/indra/llcommon/llstring.cpp +++ b/indra/llcommon/llstring.cpp @@ -900,6 +900,11 @@ void HeapFree_deleter(void* ptr) } // anonymous namespace +unsigned long windows_get_last_error() +{ + return GetLastError(); +} + template<> std::wstring windows_message(DWORD error) { diff --git a/indra/llcommon/llstring.h b/indra/llcommon/llstring.h index b69a068830..db716b1431 100644 --- a/indra/llcommon/llstring.h +++ b/indra/llcommon/llstring.h @@ -46,7 +46,6 @@ #endif #include -#include const char LL_UNKNOWN_CHAR = '?'; class LLSD; @@ -832,8 +831,10 @@ template<> LL_COMMON_API std::wstring windows_message(unsigned long error); /// Get Windows message string, implicitly calling GetLastError() +LL_COMMON_API unsigned long windows_get_last_error(); + template -STRING windows_message() { return windows_message(GetLastError()); } +STRING windows_message() { return windows_message(windows_get_last_error()); } //@} diff --git a/indra/llcommon/lluuid.cpp b/indra/llcommon/lluuid.cpp index 3b37365ec7..7aeabc3c4a 100644 --- a/indra/llcommon/lluuid.cpp +++ b/indra/llcommon/lluuid.cpp @@ -31,6 +31,7 @@ // ugh, this is ugly. We need to straighten out our linking for this library #pragma comment(lib, "IPHLPAPI.lib") #include +#include #endif #include "llapp.h" diff --git a/indra/llcommon/tests/commonmisc_test.cpp b/indra/llcommon/tests/commonmisc_test.cpp index 0057a1f639..b1a284225e 100644 --- a/indra/llcommon/tests/commonmisc_test.cpp +++ b/indra/llcommon/tests/commonmisc_test.cpp @@ -46,12 +46,6 @@ #include "../test/lltut.h" - -#if LL_WINDOWS -// disable overflow warnings -#pragma warning(disable: 4307) -#endif - namespace tut { struct sd_data diff --git a/indra/llimage/llimagejpeg.h b/indra/llimage/llimagejpeg.h index add6657117..012b87a42d 100644 --- a/indra/llimage/llimagejpeg.h +++ b/indra/llimage/llimagejpeg.h @@ -31,7 +31,6 @@ #include "llimage.h" -#include "llwin32headerslean.h" extern "C" { #ifdef LL_USESYSTEMLIBS # include diff --git a/indra/llinventory/llinventorytype.cpp b/indra/llinventory/llinventorytype.cpp index 3dd1a5638d..8fa8983d3c 100644 --- a/indra/llinventory/llinventorytype.cpp +++ b/indra/llinventory/llinventorytype.cpp @@ -53,6 +53,7 @@ struct InventoryEntry : public LLDictionaryEntry LLAssetType::EType t = (LLAssetType::EType)va_arg(argp,int); mAssetTypes.push_back(t); } + va_end(argp); } const std::string mHumanName; diff --git a/indra/llmath/llsimdtypes.h b/indra/llmath/llsimdtypes.h index 11462170fb..a407f51029 100644 --- a/indra/llmath/llsimdtypes.h +++ b/indra/llmath/llsimdtypes.h @@ -33,20 +33,6 @@ typedef __m128 LLQuad; - -#if LL_WINDOWS -#pragma warning(push) -#pragma warning( disable : 4800 3 ) // Disable warning about casting int to bool for this class. -#if defined(_MSC_VER) && (_MSC_VER < 1500) -// VC++ 2005 is missing these intrinsics -// __forceinline is MSVC specific and attempts to override compiler inlining judgment. This is so -// even in debug builds this call is a NOP. -__forceinline const __m128 _mm_castsi128_ps( const __m128i a ) { return reinterpret_cast(a); } -__forceinline const __m128i _mm_castps_si128( const __m128 a ) { return reinterpret_cast(a); } -#endif // _MSC_VER - -#endif // LL_WINDOWS - class LLBool32 { public: @@ -63,10 +49,6 @@ private: int m_bool{ 0 }; }; -#if LL_WINDOWS -#pragma warning(pop) -#endif - class LLSimdScalar { public: diff --git a/indra/llmessage/llblowfishcipher.cpp b/indra/llmessage/llblowfishcipher.cpp index ed036e396d..3973565e22 100644 --- a/indra/llmessage/llblowfishcipher.cpp +++ b/indra/llmessage/llblowfishcipher.cpp @@ -88,7 +88,7 @@ U32 LLBlowfishCipher::encrypt(const U8* src, U32 src_len, U8* dst, U32 dst_len) src_len)) { LL_WARNS() << "LLBlowfishCipher::encrypt EVP_EncryptUpdate failure" << LL_ENDL; - goto ERROR; + goto BF_ENCRYPT_ERROR; } // There may be some final data left to encrypt if the input is @@ -96,14 +96,14 @@ U32 LLBlowfishCipher::encrypt(const U8* src, U32 src_len, U8* dst, U32 dst_len) if (!EVP_EncryptFinal_ex(context, (unsigned char*)(dst + output_len), &temp_len)) { LL_WARNS() << "LLBlowfishCipher::encrypt EVP_EncryptFinal failure" << LL_ENDL; - goto ERROR; + goto BF_ENCRYPT_ERROR; } output_len += temp_len; EVP_CIPHER_CTX_free(context); return output_len; -ERROR: +BF_ENCRYPT_ERROR: EVP_CIPHER_CTX_free(context); return 0; } diff --git a/indra/llprimitive/lldaeloader.cpp b/indra/llprimitive/lldaeloader.cpp index 3e84eeffc2..4f47f16e33 100644 --- a/indra/llprimitive/lldaeloader.cpp +++ b/indra/llprimitive/lldaeloader.cpp @@ -24,10 +24,8 @@ * $/LicenseInfo$ */ -#if LL_MSVC -#pragma warning (disable : 4263) -#pragma warning (disable : 4264) -#endif +#include "linden_common.h" + #include "dae.h" #include "dom/domAsset.h" #include "dom/domBind_material.h" @@ -48,10 +46,6 @@ #include "dom/domScale.h" #include "dom/domTranslate.h" #include "dom/domVisual_scene.h" -#if LL_MSVC -#pragma warning (default : 4263) -#pragma warning (default : 4264) -#endif #include "lldaeloader.h" #include "llsdserialize.h" diff --git a/indra/llprimitive/tests/llmediaentry_test.cpp b/indra/llprimitive/tests/llmediaentry_test.cpp index e8f40d1ffd..414df66680 100644 --- a/indra/llprimitive/tests/llmediaentry_test.cpp +++ b/indra/llprimitive/tests/llmediaentry_test.cpp @@ -26,14 +26,9 @@ #include "linden_common.h" #include "lltut.h" -#if LL_WINDOWS -#pragma warning (push) -#pragma warning (disable : 4702) // boost::lexical_cast generates this warning -#endif + #include -#if LL_WINDOWS -#pragma warning (pop) -#endif + #include "llstring.h" #include "llsdutil.h" #include "llsdserialize.h" diff --git a/indra/llwindow/lldxhardware.cpp b/indra/llwindow/lldxhardware.cpp index 392a67b5ce..4bc069c5a4 100644 --- a/indra/llwindow/lldxhardware.cpp +++ b/indra/llwindow/lldxhardware.cpp @@ -441,7 +441,7 @@ std::string LLDXHardware::getDriverVersionWMI(EGPUVendor vendor) return mDriverVersion; } -void get_wstring(IDxDiagContainer* containerp, WCHAR* wszPropName, WCHAR* wszPropValue, int outputSize) +void get_wstring(IDxDiagContainer* containerp, const WCHAR* wszPropName, WCHAR* wszPropValue, int outputSize) { HRESULT hr; VARIANT var; @@ -472,7 +472,7 @@ void get_wstring(IDxDiagContainer* containerp, WCHAR* wszPropName, WCHAR* wszPro VariantClear( &var ); } -std::string get_string(IDxDiagContainer *containerp, WCHAR *wszPropName) +std::string get_string(IDxDiagContainer *containerp, const WCHAR *wszPropName) { WCHAR wszPropValue[256]; get_wstring(containerp, wszPropName, wszPropValue, 256); @@ -1059,7 +1059,7 @@ LLSD LLDXHardware::getDisplayInfo() // Dump the string as an int into the structure char *stopstring; - ret["VRAM"] = strtol(ram_str.c_str(), &stopstring, 10); + ret["VRAM"] = LLSD::Integer(strtol(ram_str.c_str(), &stopstring, 10)); std::string device_name = get_string(device_containerp, L"szDescription"); ret["DeviceName"] = device_name; std::string device_driver= get_string(device_containerp, L"szDriverVersion"); diff --git a/indra/llwindow/llwindowwin32.cpp b/indra/llwindow/llwindowwin32.cpp index 94762db5c5..76abf5eaa2 100644 --- a/indra/llwindow/llwindowwin32.cpp +++ b/indra/llwindow/llwindowwin32.cpp @@ -805,8 +805,8 @@ LLWindowWin32::LLWindowWin32(LLWindowCallbacks* callbacks, size_t name_len = strlen(display_device.DeviceName ); size_t desc_len = strlen(display_device.DeviceString); - CHAR *name = name_len ? display_device.DeviceName : "???"; - CHAR *desc = desc_len ? display_device.DeviceString : "???"; + const CHAR *name = name_len ? display_device.DeviceName : "???"; + const CHAR *desc = desc_len ? display_device.DeviceString : "???"; sprintf(text, "Display Device %d: %s, %s", display_index, name, desc); LL_INFOS("Window") << text << LL_ENDL; diff --git a/indra/llxml/llcontrol.h b/indra/llxml/llcontrol.h index 344352e980..4f54a9d705 100644 --- a/indra/llxml/llcontrol.h +++ b/indra/llxml/llcontrol.h @@ -36,32 +36,8 @@ #include -// *NOTE: boost::visit_each<> generates warning 4675 on .net 2003 -// Disable the warning for the boost includes. -#if LL_WINDOWS -# if (_MSC_VER >= 1300 && _MSC_VER < 1400) -# pragma warning(push) -# pragma warning( disable : 4675 ) -# endif -#endif - #include - -#if LL_WINDOWS - #pragma warning (push) - #pragma warning (disable : 4263) // boost::signals2::expired_slot::what() has const mismatch - #pragma warning (disable : 4264) -#endif #include -#if LL_WINDOWS - #pragma warning (pop) -#endif - -#if LL_WINDOWS -# if (_MSC_VER >= 1300 && _MSC_VER < 1400) -# pragma warning(pop) -# endif -#endif class LLVector3; class LLVector3d; diff --git a/indra/newview/llappearancemgr.cpp b/indra/newview/llappearancemgr.cpp index 66082d317a..946d674e8b 100644 --- a/indra/newview/llappearancemgr.cpp +++ b/indra/newview/llappearancemgr.cpp @@ -66,11 +66,6 @@ #include "llavatarpropertiesprocessor.h" -#if LL_MSVC -// disable boost::lexical_cast warning -#pragma warning (disable:4702) -#endif - namespace { const S32 BAKE_RETRY_MAX_COUNT = 5; diff --git a/indra/newview/llappviewer.cpp b/indra/newview/llappviewer.cpp index 262ab439b4..e39d9e7e20 100644 --- a/indra/newview/llappviewer.cpp +++ b/indra/newview/llappviewer.cpp @@ -269,11 +269,6 @@ using namespace LL; #include "glib.h" #endif // (LL_LINUX) && LL_GTK -#if LL_MSVC -// disable boost::lexical_cast warning -#pragma warning (disable:4702) -#endif - static LLAppViewerListener sAppViewerListener(LLAppViewer::instance); ////// Windows-specific includes to the bottom - nasty defines in these pollute the preprocessor diff --git a/indra/newview/llcommandlineparser.cpp b/indra/newview/llcommandlineparser.cpp index f301af9511..f21bae9805 100644 --- a/indra/newview/llcommandlineparser.cpp +++ b/indra/newview/llcommandlineparser.cpp @@ -28,26 +28,12 @@ #include "llcommandlineparser.h" #include "llexception.h" -// *NOTE: The boost::lexical_cast generates -// the warning C4701(local used with out assignment) in VC7.1. -// Disable the warning for the boost includes. -#if _MSC_VER -# pragma warning(push) -# pragma warning( disable : 4701 ) -#else -// NOTE: For the other platforms? -#endif - #include #include #include #include #include -#if _MSC_VER -# pragma warning(pop) -#endif - #include "llsdserialize.h" #include "llerror.h" #include "stringize.h" diff --git a/indra/newview/llgroupmgr.cpp b/indra/newview/llgroupmgr.cpp index 76d3e3e049..d53b36e59f 100644 --- a/indra/newview/llgroupmgr.cpp +++ b/indra/newview/llgroupmgr.cpp @@ -55,19 +55,8 @@ #include "llcorehttputil.h" #include "lluiusage.h" - -#if LL_MSVC -#pragma warning(push) -// disable boost::lexical_cast warning -#pragma warning (disable:4702) -#endif - #include -#if LL_MSVC -#pragma warning(pop) // Restore all warnings to the previous state -#endif - const U32 MAX_CACHED_GROUPS = 20; // diff --git a/indra/newview/llimprocessing.cpp b/indra/newview/llimprocessing.cpp index e24274650d..c1e68e0288 100644 --- a/indra/newview/llimprocessing.cpp +++ b/indra/newview/llimprocessing.cpp @@ -58,10 +58,6 @@ #include "llworld.h" #include "boost/lexical_cast.hpp" -#if LL_MSVC -// disable boost::lexical_cast warning -#pragma warning (disable:4702) -#endif extern void on_new_message(const LLSD& msg); diff --git a/indra/newview/lllogchat.cpp b/indra/newview/lllogchat.cpp index 329fb881e3..bf49f33049 100644 --- a/indra/newview/lllogchat.cpp +++ b/indra/newview/lllogchat.cpp @@ -42,19 +42,7 @@ #include #include #include - -#if LL_MSVC -#pragma warning(push) -// disable warning about boost::lexical_cast unreachable code -// when it fails to parse the string -#pragma warning (disable:4702) -#endif - #include -#if LL_MSVC -#pragma warning(pop) // Restore all warnings to the previous state -#endif - #include #include diff --git a/indra/newview/llmediadataclient.cpp b/indra/newview/llmediadataclient.cpp index 0f3e0306af..83a6e66019 100644 --- a/indra/newview/llmediadataclient.cpp +++ b/indra/newview/llmediadataclient.cpp @@ -29,11 +29,6 @@ #include "llmediadataclient.h" #include "llviewercontrol.h" -#if LL_MSVC -// disable boost::lexical_cast warning -#pragma warning (disable:4702) -#endif - #include #include diff --git a/indra/newview/llsecapi.h b/indra/newview/llsecapi.h index 5cc78d09dc..ceea11cc34 100644 --- a/indra/newview/llsecapi.h +++ b/indra/newview/llsecapi.h @@ -35,6 +35,7 @@ #include "llexception.h" #ifdef LL_WINDOWS +#pragma warning (push) #pragma warning(disable:4250) #endif // LL_WINDOWS @@ -549,5 +550,8 @@ void registerSecHandler(const std::string& handler_type, extern LLPointer gSecAPIHandler; +#ifdef LL_WINDOWS +#pragma warning (pop) +#endif // LL_WINDOWS #endif // LL_SECAPI_H diff --git a/indra/newview/llsechandler_basic.h b/indra/newview/llsechandler_basic.h index 1484c6d0e1..2dffe84775 100644 --- a/indra/newview/llsechandler_basic.h +++ b/indra/newview/llsechandler_basic.h @@ -28,6 +28,11 @@ #ifndef LLSECHANDLER_BASIC #define LLSECHANDLER_BASIC +#ifdef LL_WINDOWS +#pragma warning (push) +#pragma warning(disable:4250) +#endif // LL_WINDOWS + #include "llsecapi.h" #include #include @@ -346,6 +351,10 @@ protected: bool valueCompareLLSD(const LLSD& lhs, const LLSD& rhs); +#ifdef LL_WINDOWS +#pragma warning (pop) +#endif // LL_WINDOWS + #endif // LLSECHANDLER_BASIC diff --git a/indra/newview/llviewerjoystick.cpp b/indra/newview/llviewerjoystick.cpp index 787ea02e4c..7543fb3743 100644 --- a/indra/newview/llviewerjoystick.cpp +++ b/indra/newview/llviewerjoystick.cpp @@ -524,7 +524,7 @@ void LLViewerJoystick::initDevice(LLSD &guid) #endif } -bool LLViewerJoystick::initDevice(void * preffered_device /*LPDIRECTINPUTDEVICE8*/, std::string &name, LLSD &guid) +bool LLViewerJoystick::initDevice(void * preffered_device /*LPDIRECTINPUTDEVICE8*/, const std::string &name, const LLSD &guid) { #if LIB_NDOF mLastDeviceUUID = guid; diff --git a/indra/newview/llviewerjoystick.h b/indra/newview/llviewerjoystick.h index b459987c68..c989615653 100644 --- a/indra/newview/llviewerjoystick.h +++ b/indra/newview/llviewerjoystick.h @@ -56,7 +56,7 @@ public: void init(bool autoenable); void initDevice(LLSD &guid); bool initDevice(void * preffered_device /*LPDIRECTINPUTDEVICE8*/); - bool initDevice(void * preffered_device /*LPDIRECTINPUTDEVICE8*/, std::string &name, LLSD &guid); + bool initDevice(void * preffered_device /*LPDIRECTINPUTDEVICE8*/, const std::string &name, const LLSD &guid); void terminate(); void updateStatus(); diff --git a/indra/newview/llviewerprecompiledheaders.h b/indra/newview/llviewerprecompiledheaders.h index 8398cd8a54..6561f0d644 100644 --- a/indra/newview/llviewerprecompiledheaders.h +++ b/indra/newview/llviewerprecompiledheaders.h @@ -37,11 +37,6 @@ #include "linden_common.h" -// Work around stupid Microsoft STL warning -#ifdef LL_WINDOWS -#pragma warning (disable : 4702) // warning C4702: unreachable code -#endif - #include #include #include diff --git a/indra/newview/llvoavatarself.cpp b/indra/newview/llvoavatarself.cpp index 57f7734fea..00a7325db2 100644 --- a/indra/newview/llvoavatarself.cpp +++ b/indra/newview/llvoavatarself.cpp @@ -24,12 +24,6 @@ * $/LicenseInfo$ */ -#if LL_MSVC -// disable warning about boost::lexical_cast returning uninitialized data -// when it fails to parse the string -#pragma warning (disable:4701) -#endif - #include "llviewerprecompiledheaders.h" #include "llvoavatarself.h" @@ -69,11 +63,6 @@ #include "llcorehttputil.h" #include "lluiusage.h" -#if LL_MSVC -// disable boost::lexical_cast warning -#pragma warning (disable:4702) -#endif - #include LLPointer gAgentAvatarp = NULL; diff --git a/indra/newview/llwindebug.h b/indra/newview/llwindebug.h index d2801c86e1..770584c88d 100644 --- a/indra/newview/llwindebug.h +++ b/indra/newview/llwindebug.h @@ -30,10 +30,7 @@ #include "stdtypes.h" #include "llwin32headerslean.h" -#pragma warning (push) -#pragma warning (disable:4091) // a microsoft header has warnings. Very nice. #include -#pragma warning (pop) class LLWinDebug: public LLSingleton diff --git a/indra/test/test.cpp b/indra/test/test.cpp index 6c4a1f43b4..233eee5c31 100644 --- a/indra/test/test.cpp +++ b/indra/test/test.cpp @@ -53,16 +53,8 @@ # include "ctype_workaround.h" #endif -#if LL_MSVC -#pragma warning (push) -#pragma warning (disable : 4702) // warning C4702: unreachable code -#endif #include #include -#if LL_MSVC -#pragma warning (pop) -#endif - #include #include #include diff --git a/indra/viewer_components/login/lllogin.cpp b/indra/viewer_components/login/lllogin.cpp index 48fecb4f22..53bf97a47e 100644 --- a/indra/viewer_components/login/lllogin.cpp +++ b/indra/viewer_components/login/lllogin.cpp @@ -28,13 +28,6 @@ #include "llsd.h" #include "llsdutil.h" -/*==========================================================================*| -#ifdef LL_WINDOWS - // non-virtual destructor warning, boost::statechart does this intentionally. - #pragma warning (disable : 4265) -#endif -|*==========================================================================*/ - #include "lllogin.h" #include -- cgit v1.2.3 From b93529526b2192e5ebb63dc364c9459724728336 Mon Sep 17 00:00:00 2001 From: Andrey Lihatskiy Date: Thu, 15 Aug 2024 00:56:39 +0300 Subject: ReleaseOS build fix (#2299) --- .github/workflows/build.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index 6ebaf02b04..30f38ba3a3 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -272,6 +272,7 @@ jobs: # The other upload of nontrivial size is the symbol file. Use a distinct # artifact for that too. - name: Upload symbol file + if: steps.build.outputs.symbolfile uses: actions/upload-artifact@v4 with: name: "${{ steps.build.outputs.artifact }}-symbols" -- cgit v1.2.3 From 714c6983f4cad754661654c09e9629b9d7a0db11 Mon Sep 17 00:00:00 2001 From: Ansariel Hiller Date: Thu, 15 Aug 2024 04:49:23 +0200 Subject: Add missing va_end (#2301) --- indra/newview/pipeline.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/indra/newview/pipeline.cpp b/indra/newview/pipeline.cpp index 1b2cffa6c9..a5c7350fd8 100644 --- a/indra/newview/pipeline.cpp +++ b/indra/newview/pipeline.cpp @@ -10668,6 +10668,7 @@ bool LLPipeline::hasAnyRenderType(U32 type, ...) const { if (mRenderTypeEnabled[type]) { + va_end(args); return true; } type = va_arg(args, U32); -- cgit v1.2.3 From 75c422613fbb8718d2c5a8ac1adee14b27d82bdc Mon Sep 17 00:00:00 2001 From: Rye Mutt Date: Wed, 14 Aug 2024 22:49:51 -0400 Subject: Update nvapi to R560 (#2302) --- autobuild.xml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/autobuild.xml b/autobuild.xml index c39a4cd9de..e4dc2da201 100644 --- a/autobuild.xml +++ b/autobuild.xml @@ -1932,24 +1932,24 @@ Copyright (c) 2012, 2014, 2015, 2016 nghttp2 contributors archive hash - 1ebe715fc1096198e343c41d50654c11509cdbba + bc574ea89164387a6c12bb49e1bac091c1d4da27 hash_algorithm sha1 url - https://github.com/secondlife/3p-nvapi/releases/download/v352.aac0e19/nvapi-352.aac0e19-windows64-aac0e19.tar.zst + https://github.com/secondlife/3p-nvapi/releases/download/v560-r1/nvapi-560.0.0-r1-windows64-10390321492.tar.zst name windows64 license - NVIDIA Corporation Software License Agreement – NVAPI SDK + MIT license_file - LICENSES/NVAPI_SDK_License_Agreement.pdf + LICENSES/nvapi.txt copyright - Copyright © 2012 NVIDIA Corporation. All rights reserved. + Copyright (c) 2024 NVIDIA CORPORATION and AFFILIATES. All rights reserved. version - 352.aac0e19 + 560.0.0-r1 name nvapi description -- cgit v1.2.3 From 9daa5b000cd61c77c9bec8f837920937e4e4b0f8 Mon Sep 17 00:00:00 2001 From: Andrey Kleshchev Date: Thu, 15 Aug 2024 18:17:39 +0300 Subject: viewer-private#268 When deleting worn items, move them to trash --- indra/newview/llinventoryfunctions.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/indra/newview/llinventoryfunctions.cpp b/indra/newview/llinventoryfunctions.cpp index 8471b2cea1..57c0d57190 100644 --- a/indra/newview/llinventoryfunctions.cpp +++ b/indra/newview/llinventoryfunctions.cpp @@ -3637,11 +3637,11 @@ void LLInventoryAction::onItemsRemovalConfirmation(const LLSD& notification, con { for (const LLUUID& id : item_deletion_list) { - remove_inventory_item(id, NULL); + gInventory.removeItem(id); } for (const LLUUID& id : cat_deletion_list) { - remove_inventory_category(id, NULL); + gInventory.removeCategory(id); } }); } -- cgit v1.2.3 From ae0433f4ebba799c16d6498f8a78ccb101db9706 Mon Sep 17 00:00:00 2001 From: Andrey Kleshchev Date: Thu, 15 Aug 2024 21:02:04 +0300 Subject: Fix loose mGalleryPanel in LLInventoryGallery LLInventoryGallery::buildGalleryPanel does the creation, not postBuild() same for LLOutfitGallery. Either don't create mGalleryPanel or remove it before creating again. --- indra/newview/llfloaterimnearbychathandler.cpp | 1 - indra/newview/llinventorygallery.cpp | 2 -- indra/newview/lloutfitgallery.cpp | 2 -- 3 files changed, 5 deletions(-) diff --git a/indra/newview/llfloaterimnearbychathandler.cpp b/indra/newview/llfloaterimnearbychathandler.cpp index a614299e03..e9cd912ca9 100644 --- a/indra/newview/llfloaterimnearbychathandler.cpp +++ b/indra/newview/llfloaterimnearbychathandler.cpp @@ -152,7 +152,6 @@ protected: toast_list_t m_toast_pool; bool mStopProcessing; - bool mChannelRect; }; diff --git a/indra/newview/llinventorygallery.cpp b/indra/newview/llinventorygallery.cpp index 9e6cf7ac73..46d1e822de 100644 --- a/indra/newview/llinventorygallery.cpp +++ b/indra/newview/llinventorygallery.cpp @@ -147,8 +147,6 @@ const LLInventoryGallery::Params& LLInventoryGallery::getDefaultParams() bool LLInventoryGallery::postBuild() { mScrollPanel = getChild("gallery_scroll_panel"); - LLPanel::Params params = LLPanel::getDefaultParams(); - mGalleryPanel = LLUICtrlFactory::create(params); mMessageTextBox = getChild("empty_txt"); mInventoryGalleryMenu = new LLInventoryGalleryContextMenu(this); mRootGalleryMenu = new LLInventoryGalleryContextMenu(this); diff --git a/indra/newview/lloutfitgallery.cpp b/indra/newview/lloutfitgallery.cpp index d7df9ceadc..72fb9464d8 100644 --- a/indra/newview/lloutfitgallery.cpp +++ b/indra/newview/lloutfitgallery.cpp @@ -109,8 +109,6 @@ bool LLOutfitGallery::postBuild() { bool rv = LLOutfitListBase::postBuild(); mScrollPanel = getChild("gallery_scroll_panel"); - LLPanel::Params params = LLPanel::getDefaultParams(); // Don't parse XML when creating dummy LLPanel - mGalleryPanel = LLUICtrlFactory::create(params); mMessageTextBox = getChild("no_outfits_txt"); mOutfitGalleryMenu = new LLOutfitGalleryContextMenu(this); return rv; -- cgit v1.2.3 From 4c0f342c93b4716ad6f7fb2b2b04bf217c0b824d Mon Sep 17 00:00:00 2001 From: Ansariel Hiller Date: Fri, 16 Aug 2024 23:38:42 +0200 Subject: Remove pointless CMake status message (#2322) --- indra/cmake/Copy3rdPartyLibs.cmake | 4 ---- 1 file changed, 4 deletions(-) diff --git a/indra/cmake/Copy3rdPartyLibs.cmake b/indra/cmake/Copy3rdPartyLibs.cmake index c6b89e1de3..6ac00fd131 100644 --- a/indra/cmake/Copy3rdPartyLibs.cmake +++ b/indra/cmake/Copy3rdPartyLibs.cmake @@ -155,10 +155,6 @@ if(WINDOWS) MESSAGE(STATUS "Redist lib ${release_msvc_file} not found") endif() endforeach() - MESSAGE(STATUS "Will copy redist files for MSVC ${MSVC_VER}:") - foreach(target ${third_party_targets}) - MESSAGE(STATUS "${target}") - endforeach() elseif(DARWIN) set(vivox_lib_dir "${ARCH_PREBUILT_DIRS_RELEASE}") -- cgit v1.2.3 From d79ff40ee2bac1ddb9d721aa8a408a0f104d5a4d Mon Sep 17 00:00:00 2001 From: Rye Mutt Date: Sat, 17 Aug 2024 18:23:58 -0400 Subject: Fix hero probes not releasing resources when disabled --- indra/newview/llheroprobemanager.cpp | 4 ---- indra/newview/llheroprobemanager.h | 7 ------- indra/newview/pipeline.cpp | 4 +++- 3 files changed, 3 insertions(+), 12 deletions(-) diff --git a/indra/newview/llheroprobemanager.cpp b/indra/newview/llheroprobemanager.cpp index 91051f8235..ce419498cf 100644 --- a/indra/newview/llheroprobemanager.cpp +++ b/indra/newview/llheroprobemanager.cpp @@ -586,7 +586,6 @@ void LLHeroProbeManager::cleanup() { mVertexBuffer = nullptr; mRenderTarget.release(); - mHeroRenderTarget.release(); mMipChain.clear(); @@ -594,10 +593,7 @@ void LLHeroProbeManager::cleanup() mProbes.clear(); - mReflectionMaps.clear(); - mDefaultProbe = nullptr; - mUpdatingProbe = nullptr; } void LLHeroProbeManager::doOcclusion() diff --git a/indra/newview/llheroprobemanager.h b/indra/newview/llheroprobemanager.h index 28852770c3..58a94a3de8 100644 --- a/indra/newview/llheroprobemanager.h +++ b/indra/newview/llheroprobemanager.h @@ -104,8 +104,6 @@ private: // used to generate mipmaps without doing a copy-to-texture LLRenderTarget mRenderTarget; - LLRenderTarget mHeroRenderTarget; - std::vector mMipChain; // storage for reflection probe radiance maps (plus two scratch space cubemaps) @@ -124,11 +122,6 @@ private: // list of active reflection maps std::vector> mProbes; - // list of maps being used for rendering - std::vector mReflectionMaps; - - LLReflectionMap* mUpdatingProbe = nullptr; - LLPointer mDefaultProbe; // default reflection probe to fall back to for pixels with no probe influences (should always be at cube index 0) // number of reflection probes to use for rendering diff --git a/indra/newview/pipeline.cpp b/indra/newview/pipeline.cpp index a5c7350fd8..857af40601 100644 --- a/indra/newview/pipeline.cpp +++ b/indra/newview/pipeline.cpp @@ -777,7 +777,7 @@ bool LLPipeline::allocateScreenBuffer(U32 resX, U32 resY, U32 samples) if (mRT == &mMainRT) { // hacky -- allocate auxillary buffer - gCubeSnapshot = TRUE; + gCubeSnapshot = true; if (sReflectionProbesEnabled) { @@ -1117,6 +1117,8 @@ void LLPipeline::releaseGLBuffers() mGlow[i].release(); } + mHeroProbeManager.cleanup(); // release hero probes + releaseScreenBuffers(); gBumpImageList.destroyGL(); -- cgit v1.2.3 From 0d9ddae0c6734f8ce76a5cdb40947f6da105c0b2 Mon Sep 17 00:00:00 2001 From: Rye Mutt Date: Sat, 17 Aug 2024 19:14:40 -0400 Subject: Reduce number of full screen render targets --- indra/newview/llviewerdisplay.cpp | 6 +-- indra/newview/pipeline.cpp | 92 ++++++++++++++++++++++----------------- indra/newview/pipeline.h | 9 ++-- 3 files changed, 60 insertions(+), 47 deletions(-) diff --git a/indra/newview/llviewerdisplay.cpp b/indra/newview/llviewerdisplay.cpp index fbbcf9bd84..8c6a38876a 100644 --- a/indra/newview/llviewerdisplay.cpp +++ b/indra/newview/llviewerdisplay.cpp @@ -1603,7 +1603,7 @@ void render_ui_2d() LLView::sIsRectDirty = false; LLRect t_rect; - gPipeline.mRT->uiScreen.bindTarget(); + gPipeline.mUIScreen.bindTarget(); gGL.setColorMask(true, true); { static const S32 pad = 8; @@ -1635,7 +1635,7 @@ void render_ui_2d() gViewerWindow->draw(); } - gPipeline.mRT->uiScreen.flush(); + gPipeline.mUIScreen.flush(); gGL.setColorMask(true, false); LLView::sDirtyRect = t_rect; @@ -1645,7 +1645,7 @@ void render_ui_2d() LLGLDisable blend(GL_BLEND); S32 width = gViewerWindow->getWindowWidthScaled(); S32 height = gViewerWindow->getWindowHeightScaled(); - gGL.getTexUnit(0)->bind(&gPipeline.mRT->uiScreen); + gGL.getTexUnit(0)->bind(&gPipeline.mUIScreen); gGL.begin(LLRender::TRIANGLE_STRIP); gGL.color4f(1.f,1.f,1.f,1.f); gGL.texCoord2f(0.f, 0.f); gGL.vertex2i(0, 0); diff --git a/indra/newview/pipeline.cpp b/indra/newview/pipeline.cpp index 857af40601..2bafa6e3af 100644 --- a/indra/newview/pipeline.cpp +++ b/indra/newview/pipeline.cpp @@ -812,17 +812,6 @@ bool LLPipeline::allocateScreenBuffer(U32 resX, U32 resY, U32 samples) resY /= res_mod; } - //water reflection texture (always needed as scratch space whether or not transparent water is enabled) - mWaterDis.allocate(resX, resY, GL_RGBA16F, true); - - if (RenderUIBuffer) - { - if (!mRT->uiScreen.allocate(resX,resY, GL_RGBA)) - { - return false; - } - } - S32 shadow_detail = RenderShadowDetail; bool ssao = RenderDeferredSSAO; @@ -836,15 +825,6 @@ bool LLPipeline::allocateScreenBuffer(U32 resX, U32 resY, U32 samples) mRT->deferredScreen.shareDepthBuffer(mRT->screen); - if (samples > 0) - { - if (!mRT->fxaaBuffer.allocate(resX, resY, GL_RGBA)) return false; - } - else - { - mRT->fxaaBuffer.release(); - } - if (shadow_detail > 0 || ssao || RenderDepthOfField || samples > 0) { //only need mRT->deferredLight for shadows OR ssao OR dof OR fxaa if (!mRT->deferredLight.allocate(resX, resY, GL_RGBA16F)) return false; @@ -856,19 +836,45 @@ bool LLPipeline::allocateScreenBuffer(U32 resX, U32 resY, U32 samples) allocateShadowBuffer(resX, resY); - if (!gCubeSnapshot && RenderScreenSpaceReflections) // hack to not allocate mSceneMap for cube snapshots + if (!gCubeSnapshot) // hack to not re-allocate various targets for cube snapshots { - mSceneMap.allocate(resX, resY, GL_RGB, true); - } + if (RenderUIBuffer) + { + if (!mUIScreen.allocate(resX, resY, GL_RGBA)) + { + return false; + } + } - const bool post_hdr = gSavedSettings.getBOOL("RenderPostProcessingHDR"); - const U32 post_color_fmt = post_hdr ? GL_RGBA16F : GL_RGBA; - mPostMap.allocate(resX, resY, post_color_fmt); + if (samples > 0) + { + if (!mFXAAMap.allocate(resX, resY, GL_RGBA)) return false; + } + else + { + mFXAAMap.release(); + } - // used to scale down textures - // See LLViwerTextureList::updateImagesCreateTextures and LLImageGL::scaleDown - mDownResMap.allocate(4, 4, GL_RGBA); + //water reflection texture (always needed as scratch space whether or not transparent water is enabled) + mWaterDis.allocate(resX, resY, GL_RGBA16F, true); + if(RenderScreenSpaceReflections) + { + mSceneMap.allocate(resX, resY, GL_RGB, true); + } + else + { + mSceneMap.release(); + } + + const bool post_hdr = gSavedSettings.getBOOL("RenderPostProcessingHDR"); + const U32 post_color_fmt = post_hdr ? GL_RGBA16F : GL_RGBA; + mPostMap.allocate(resX, resY, post_color_fmt); + + // used to scale down textures + // See LLViwerTextureList::updateImagesCreateTextures and LLImageGL::scaleDown + mDownResMap.allocate(4, 4, GL_RGBA); + } //HACK make screenbuffer allocations start failing after 30 seconds if (gSavedSettings.getBOOL("SimulateFBOFailure")) { @@ -1110,6 +1116,10 @@ void LLPipeline::releaseGLBuffers() mPostMap.release(); + mFXAAMap.release(); + + mUIScreen.release(); + mDownResMap.release(); for (U32 i = 0; i < 3; i++) @@ -1149,15 +1159,15 @@ void LLPipeline::releaseShadowBuffers() void LLPipeline::releaseScreenBuffers() { - mRT->uiScreen.release(); mRT->screen.release(); - mRT->fxaaBuffer.release(); mRT->deferredScreen.release(); mRT->deferredLight.release(); - mHeroProbeRT.uiScreen.release(); + mAuxillaryRT.screen.release(); + mAuxillaryRT.deferredScreen.release(); + mAuxillaryRT.deferredLight.release(); + mHeroProbeRT.screen.release(); - mHeroProbeRT.fxaaBuffer.release(); mHeroProbeRT.deferredScreen.release(); mHeroProbeRT.deferredLight.release(); } @@ -7125,7 +7135,7 @@ void LLPipeline::applyFXAA(LLRenderTarget* src, LLRenderTarget* dst) { { llassert(!gCubeSnapshot); - bool multisample = RenderFSAASamples > 1 && mRT->fxaaBuffer.isComplete(); + bool multisample = RenderFSAASamples > 1 && mFXAAMap.isComplete(); LLGLSLShader* shader = &gGlowCombineProgram; S32 width = dst->getWidth(); @@ -7136,7 +7146,7 @@ void LLPipeline::applyFXAA(LLRenderTarget* src, LLRenderTarget* dst) { LL_PROFILE_GPU_ZONE("aa"); // bake out texture2D with RGBL for FXAA shader - mRT->fxaaBuffer.bindTarget(); + mFXAAMap.bindTarget(); shader = &gGlowCombineFXAAProgram; shader->bind(); @@ -7156,16 +7166,16 @@ void LLPipeline::applyFXAA(LLRenderTarget* src, LLRenderTarget* dst) shader->disableTexture(LLShaderMgr::DEFERRED_DIFFUSE, src->getUsage()); shader->unbind(); - mRT->fxaaBuffer.flush(); + mFXAAMap.flush(); dst->bindTarget(); shader = &gFXAAProgram; shader->bind(); - channel = shader->enableTexture(LLShaderMgr::DIFFUSE_MAP, mRT->fxaaBuffer.getUsage()); + channel = shader->enableTexture(LLShaderMgr::DIFFUSE_MAP, mFXAAMap.getUsage()); if (channel > -1) { - mRT->fxaaBuffer.bindTexture(0, channel, LLTexUnit::TFO_BILINEAR); + mFXAAMap.bindTexture(0, channel, LLTexUnit::TFO_BILINEAR); } gGLViewport[0] = gViewerWindow->getWorldViewRectRaw().mLeft; @@ -7175,8 +7185,8 @@ void LLPipeline::applyFXAA(LLRenderTarget* src, LLRenderTarget* dst) glViewport(gGLViewport[0], gGLViewport[1], gGLViewport[2], gGLViewport[3]); - F32 scale_x = (F32)width / mRT->fxaaBuffer.getWidth(); - F32 scale_y = (F32)height / mRT->fxaaBuffer.getHeight(); + F32 scale_x = (F32)width / mFXAAMap.getWidth(); + F32 scale_y = (F32)height / mFXAAMap.getHeight(); shader->uniform2f(LLShaderMgr::FXAA_TC_SCALE, scale_x, scale_y); shader->uniform2f(LLShaderMgr::FXAA_RCP_SCREEN_RES, 1.f / width * scale_x, 1.f / height * scale_y); shader->uniform4f(LLShaderMgr::FXAA_RCP_FRAME_OPT, -0.5f / width * scale_x, -0.5f / height * scale_y, @@ -7410,7 +7420,7 @@ void LLPipeline::renderDoF(LLRenderTarget* src, LLRenderTarget* dst) { // combine result based on alpha dst->bindTarget(); - if (RenderFSAASamples > 1 && mRT->fxaaBuffer.isComplete()) + if (RenderFSAASamples > 1 && mFXAAMap.isComplete()) { glViewport(0, 0, dst->getWidth(), dst->getHeight()); } diff --git a/indra/newview/pipeline.h b/indra/newview/pipeline.h index 4164474238..024303d5f0 100644 --- a/indra/newview/pipeline.h +++ b/indra/newview/pipeline.h @@ -687,10 +687,7 @@ public: //screen texture LLRenderTarget screen; - LLRenderTarget uiScreen; LLRenderTarget deferredScreen; - LLRenderTarget fxaaBuffer; - LLRenderTarget edgeMap; LLRenderTarget deferredLight; //sun shadow map @@ -726,6 +723,12 @@ public: // tonemapped and gamma corrected render ready for post LLRenderTarget mPostMap; + // FXAA helper target + LLRenderTarget mFXAAMap; + + // render ui to buffer target + LLRenderTarget mUIScreen; + // downres scratch space for GPU downscaling of textures LLRenderTarget mDownResMap; -- cgit v1.2.3 From 94aec3d1e619372b0652d298ded4d2a7ac96d131 Mon Sep 17 00:00:00 2001 From: Rye Mutt Date: Sat, 17 Aug 2024 19:23:05 -0400 Subject: Avoid scaling probe shadow maps by RenderShadowResolutionScale --- indra/newview/pipeline.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/indra/newview/pipeline.cpp b/indra/newview/pipeline.cpp index 2bafa6e3af..979d0eba7e 100644 --- a/indra/newview/pipeline.cpp +++ b/indra/newview/pipeline.cpp @@ -896,7 +896,7 @@ bool LLPipeline::allocateShadowBuffer(U32 resX, U32 resY) LL_PROFILE_ZONE_SCOPED_CATEGORY_DISPLAY; S32 shadow_detail = RenderShadowDetail; - F32 scale = llmax(0.f, RenderShadowResolutionScale); + F32 scale = gCubeSnapshot ? 1.0 : llmax(0.f, RenderShadowResolutionScale); // Don't scale probe shadow maps U32 sun_shadow_map_width = BlurHappySize(resX, scale); U32 sun_shadow_map_height = BlurHappySize(resY, scale); -- cgit v1.2.3 From 4e19b2ae34a0cd5e19068bedb8612ba4ea89e8c1 Mon Sep 17 00:00:00 2001 From: Rye Mutt Date: Sat, 17 Aug 2024 19:19:18 -0400 Subject: Fix RenderReflectionProbeResolution debug setting not updating during runtime --- indra/newview/llreflectionmapmanager.cpp | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/indra/newview/llreflectionmapmanager.cpp b/indra/newview/llreflectionmapmanager.cpp index 1efe51c1aa..3526004071 100644 --- a/indra/newview/llreflectionmapmanager.cpp +++ b/indra/newview/llreflectionmapmanager.cpp @@ -1371,13 +1371,21 @@ void LLReflectionMapManager::initReflectionMaps() { U32 count = LL_MAX_REFLECTION_PROBE_COUNT; - if (mTexture.isNull() || mReflectionProbeCount != count || mReset) + static LLCachedControl ref_probe_res(gSavedSettings, "RenderReflectionProbeResolution", 128U); + U32 probe_resolution = nhpo2(llclamp(ref_probe_res(), (U32)64, (U32)512)); + if (mTexture.isNull() || mReflectionProbeCount != count || mProbeResolution != probe_resolution || mReset) { + if(mProbeResolution != probe_resolution) + { + mRenderTarget.release(); + mMipChain.clear(); + } + gEXRImage = nullptr; mReset = false; mReflectionProbeCount = count; - mProbeResolution = nhpo2(llclamp(gSavedSettings.getU32("RenderReflectionProbeResolution"), (U32)64, (U32)512)); + mProbeResolution = probe_resolution; mMaxProbeLOD = log2f((F32)mProbeResolution) - 1.f; // number of mips - 1 if (mTexture.isNull() || -- cgit v1.2.3 From ba2b77d0882f8ca3ef0ae95ca9d388aa217f9a7a Mon Sep 17 00:00:00 2001 From: Rye Mutt Date: Sun, 18 Aug 2024 15:35:33 -0400 Subject: Fix findChild during draw in preference floater --- indra/newview/llfloaterpreference.cpp | 49 ++++++++++------------ indra/newview/llfloaterpreference.h | 7 +++- .../default/xui/en/panel_preferences_alerts.xml | 2 - 3 files changed, 28 insertions(+), 30 deletions(-) diff --git a/indra/newview/llfloaterpreference.cpp b/indra/newview/llfloaterpreference.cpp index 5e5cfcecbf..3441fff7e8 100644 --- a/indra/newview/llfloaterpreference.cpp +++ b/indra/newview/llfloaterpreference.cpp @@ -430,6 +430,13 @@ void LLFloaterPreference::saveAvatarPropertiesCoro(const std::string cap_url, bo bool LLFloaterPreference::postBuild() { + mDeleteTranscriptsBtn = getChild("delete_transcripts"); + + mEnabledPopups = getChild("enabled_popups"); + mDisabledPopups = getChild("disabled_popups"); + mEnablePopupBtn = getChild("enable_this_popup"); + mDisablePopupBtn = getChild("disable_this_popup"); + gSavedSettings.getControl("ChatFontSize")->getSignal()->connect(boost::bind(&LLFloaterIMSessionTab::processChatHistoryStyleUpdate, false)); gSavedSettings.getControl("ChatFontSize")->getSignal()->connect(boost::bind(&LLViewerChat::signalChatFontChanged)); @@ -519,7 +526,7 @@ bool LLFloaterPreference::postBuild() void LLFloaterPreference::updateDeleteTranscriptsButton() { - getChild("delete_transcripts")->setEnabled(LLLogChat::transcriptFilesExist()); + mDeleteTranscriptsBtn->setEnabled(LLLogChat::transcriptFilesExist()); } void LLFloaterPreference::onDoNotDisturbResponseChanged() @@ -540,11 +547,11 @@ LLFloaterPreference::~LLFloaterPreference() void LLFloaterPreference::draw() { - bool has_first_selected = (getChildRef("disabled_popups").getFirstSelected()!=NULL); - gSavedSettings.setBOOL("FirstSelectedDisabledPopups", has_first_selected); + bool has_first_selected = (mDisabledPopups->getFirstSelected()!=NULL); + mEnablePopupBtn->setEnabled(has_first_selected); - has_first_selected = (getChildRef("enabled_popups").getFirstSelected()!=NULL); - gSavedSettings.setBOOL("FirstSelectedEnabledPopups", has_first_selected); + has_first_selected = (mEnabledPopups->getFirstSelected()!=NULL); + mDisablePopupBtn->setEnabled(has_first_selected); LLFloater::draw(); } @@ -1171,13 +1178,8 @@ void LLFloaterPreference::refreshSkin(void* data) void LLFloaterPreference::buildPopupLists() { - LLScrollListCtrl& disabled_popups = - getChildRef("disabled_popups"); - LLScrollListCtrl& enabled_popups = - getChildRef("enabled_popups"); - - disabled_popups.deleteAllItems(); - enabled_popups.deleteAllItems(); + mDisabledPopups->deleteAllItems(); + mEnabledPopups->deleteAllItems(); for (LLNotifications::TemplateMap::const_iterator iter = LLNotifications::instance().templatesBegin(); iter != LLNotifications::instance().templatesEnd(); @@ -1219,11 +1221,11 @@ void LLFloaterPreference::buildPopupLists() } } } - item = disabled_popups.addElement(row); + item = mDisabledPopups->addElement(row); } else { - item = enabled_popups.addElement(row); + item = mEnabledPopups->addElement(row); } if (item) @@ -1324,9 +1326,7 @@ void LLFloaterPreference::onClickSetSounds() void LLFloaterPreference::onClickEnablePopup() { - LLScrollListCtrl& disabled_popups = getChildRef("disabled_popups"); - - std::vector items = disabled_popups.getAllSelected(); + std::vector items = mDisabledPopups->getAllSelected(); std::vector::iterator itor; for (itor = items.begin(); itor != items.end(); ++itor) { @@ -1345,9 +1345,7 @@ void LLFloaterPreference::onClickEnablePopup() void LLFloaterPreference::onClickDisablePopup() { - LLScrollListCtrl& enabled_popups = getChildRef("enabled_popups"); - - std::vector items = enabled_popups.getAllSelected(); + std::vector items = mEnabledPopups->getAllSelected(); std::vector::iterator itor; for (itor = items.begin(); itor != items.end(); ++itor) { @@ -1796,11 +1794,9 @@ void LLFloaterPreference::onDeleteTranscriptsResponse(const LLSD& notification, void LLFloaterPreference::onLogChatHistorySaved() { - LLButton * delete_transcripts_buttonp = getChild("delete_transcripts"); - - if (!delete_transcripts_buttonp->getEnabled()) + if (!mDeleteTranscriptsBtn->getEnabled()) { - delete_transcripts_buttonp->setEnabled(true); + mDeleteTranscriptsBtn->setEnabled(true); } } @@ -2334,7 +2330,6 @@ bool LLPanelPreferenceGraphics::postBuild() void LLPanelPreferenceGraphics::draw() { - setPresetText(); LLPanelPreference::draw(); } @@ -3315,8 +3310,8 @@ void LLFloaterPreference::onUpdateFilterTerm(bool force) void LLFloaterPreference::filterIgnorableNotifications() { - bool visible = getChildRef("enabled_popups").highlightMatchingItems(mFilterEdit->getValue()); - visible |= getChildRef("disabled_popups").highlightMatchingItems(mFilterEdit->getValue()); + bool visible = mEnabledPopups->highlightMatchingItems(mFilterEdit->getValue()); + visible |= mDisabledPopups->highlightMatchingItems(mFilterEdit->getValue()); if (visible) { diff --git a/indra/newview/llfloaterpreference.h b/indra/newview/llfloaterpreference.h index c8b98d8e1b..51ed3d8179 100644 --- a/indra/newview/llfloaterpreference.h +++ b/indra/newview/llfloaterpreference.h @@ -225,7 +225,12 @@ private: std::string mSavedGraphicsPreset; LOG_CLASS(LLFloaterPreference); - LLSearchEditor *mFilterEdit; + LLSearchEditor* mFilterEdit = nullptr; + LLScrollListCtrl* mEnabledPopups = nullptr; + LLScrollListCtrl* mDisabledPopups = nullptr; + LLButton* mDeleteTranscriptsBtn = nullptr; + LLButton* mEnablePopupBtn = nullptr; + LLButton* mDisablePopupBtn = nullptr; std::unique_ptr< ll::prefs::SearchData > mSearchData; bool mSearchDataDirty; diff --git a/indra/newview/skins/default/xui/en/panel_preferences_alerts.xml b/indra/newview/skins/default/xui/en/panel_preferences_alerts.xml index fb528bf98f..425cbb6f44 100644 --- a/indra/newview/skins/default/xui/en/panel_preferences_alerts.xml +++ b/indra/newview/skins/default/xui/en/panel_preferences_alerts.xml @@ -69,7 +69,6 @@ sort_ascending="true" width="495" />