From a80f2ba9a3bc475f618646ccb3600c08e0055734 Mon Sep 17 00:00:00 2001 From: Rye Date: Sun, 27 Oct 2024 19:02:55 -0700 Subject: Update KDU to 8.4.1 and fix kdu tests, also fix llimage_libtest utility --- autobuild.xml | 14 ++--- indra/cmake/LLKDU.cmake | 1 + indra/integration_tests/CMakeLists.txt | 7 +-- .../llimage_libtest/CMakeLists.txt | 68 +------------------- .../llimage_libtest/llimage_libtest.cpp | 18 +++--- indra/llkdu/CMakeLists.txt | 7 +-- indra/llkdu/llimagej2ckdu.cpp | 73 +++++++++++----------- indra/llkdu/llimagej2ckdu.h | 2 - indra/llkdu/llkdumem.h | 10 +-- indra/llkdu/tests/llimagej2ckdu_test.cpp | 29 +++++---- 10 files changed, 80 insertions(+), 149 deletions(-) diff --git a/autobuild.xml b/autobuild.xml index 95ee34439b..c3df05a223 100644 --- a/autobuild.xml +++ b/autobuild.xml @@ -1036,11 +1036,11 @@ creds github hash - ad72fa1d103df777906f0d98f3e882b9916aeada + 243709fbbb58a91dca81d16df650e9c6ff910d0d hash_algorithm sha1 url - https://api.github.com/repos/secondlife/3p-kdu/releases/assets/136774118 + https://api.github.com/repos/secondlife/3p-kdu/releases/assets/202118207 name darwin64 @@ -1052,11 +1052,11 @@ creds github hash - e46e4ac93a237b5c4a14183766f76ba5d58935a2 + 7fd0a7ee71a4e76b49e31b75f8622852324d58a4 hash_algorithm sha1 url - https://api.github.com/repos/secondlife/3p-kdu/releases/assets/136774125 + https://api.github.com/repos/secondlife/3p-kdu/releases/assets/202118208 name linux64 @@ -1068,11 +1068,11 @@ creds github hash - bb37557f78c72b26580a521f8b8dabfa1b34e6e6 + 8c475dd9616c7e0e3029cc38aefc1e0ab34d2e73 hash_algorithm sha1 url - https://api.github.com/repos/secondlife/3p-kdu/releases/assets/136774126 + https://api.github.com/repos/secondlife/3p-kdu/releases/assets/202118209 name windows64 @@ -1101,7 +1101,7 @@ copyright Kakadu software version - 7.10.4.4b9ec5f + 8.4.1.11540433907 name kdu description diff --git a/indra/cmake/LLKDU.cmake b/indra/cmake/LLKDU.cmake index 668b07ffab..6d27dcc286 100644 --- a/indra/cmake/LLKDU.cmake +++ b/indra/cmake/LLKDU.cmake @@ -23,4 +23,5 @@ if (USE_KDU) ${AUTOBUILD_INSTALL_DIR}/include/kdu ${LIBS_OPEN_DIR}/llkdu ) + target_compile_definitions(ll::kdu INTERFACE KDU_X86_INTRINSICS=1 KDU_NO_THREADS=1) endif (USE_KDU) diff --git a/indra/integration_tests/CMakeLists.txt b/indra/integration_tests/CMakeLists.txt index ced2b3dbcf..1d5f0772b5 100644 --- a/indra/integration_tests/CMakeLists.txt +++ b/indra/integration_tests/CMakeLists.txt @@ -1,8 +1,3 @@ # -*- cmake -*- add_subdirectory(llui_libtest) -IF (LLIMAGE_LIBTEST) - MESSAGE(STATUS "Build llimage_libtest") - add_subdirectory(llimage_libtest) -ELSE (LLIMAGE_LIBTEST) - MESSAGE(STATUS "Skip llimage_libtest") -ENDIF (LLIMAGE_LIBTEST) +add_subdirectory(llimage_libtest) diff --git a/indra/integration_tests/llimage_libtest/CMakeLists.txt b/indra/integration_tests/llimage_libtest/CMakeLists.txt index ee2890778b..84d1feb758 100644 --- a/indra/integration_tests/llimage_libtest/CMakeLists.txt +++ b/indra/integration_tests/llimage_libtest/CMakeLists.txt @@ -1,6 +1,7 @@ # -*- cmake -*- # Integration tests of the llimage library (JPEG2000, PNG, jpeg, etc... images reading and writing) +if (LL_TESTS) project (llimage_libtest) @@ -8,9 +9,7 @@ include(00-Common) include(LLCommon) include(LLImage) include(LLMath) -include(LLImageJ2COJ) include(LLKDU) -include(LLFileSystem) set(llimage_libtest_SOURCE_FILES llimage_libtest.cpp @@ -24,17 +23,9 @@ set(llimage_libtest_HEADER_FILES list(APPEND llimage_libtest_SOURCE_FILES ${llimage_libtest_HEADER_FILES}) add_executable(llimage_libtest - WIN32 - MACOSX_BUNDLE ${llimage_libtest_SOURCE_FILES} ) -set_target_properties(llimage_libtest - PROPERTIES - WIN32_EXECUTABLE - FALSE -) - # Libraries on which this application depends on # Sort by high-level to low-level target_link_libraries(llimage_libtest @@ -45,61 +36,8 @@ target_link_libraries(llimage_libtest llkdu llimagej2coj ) - -if (DARWIN) - # Path inside the app bundle where we'll need to copy libraries - set(LLIMAGE_LIBTEST_DESTINATION_DIR - ${CMAKE_CURRENT_BINARY_DIR}/$,$,>/llimage_libtest.app/Contents/Resources - ) - # Create the Contents/Resources directory - add_custom_command( - TARGET llimage_libtest POST_BUILD - COMMAND ${CMAKE_COMMAND} - ARGS - -E - make_directory - ${LLIMAGE_LIBTEST_DESTINATION_DIR} - COMMENT "Creating Resources directory in app bundle." - ) -else (DARWIN) - set(LLIMAGE_LIBTEST_DESTINATION_DIR - ${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR}/ - ) -endif (DARWIN) - -get_target_property(BUILT_LLCOMMON llcommon LOCATION) -add_custom_command(TARGET llimage_libtest POST_BUILD - COMMAND ${CMAKE_COMMAND} -E copy ${BUILT_LLCOMMON} ${LLIMAGE_LIBTEST_DESTINATION_DIR} - DEPENDS ${BUILT_LLCOMMON} -) - -if (DARWIN) - # Copy the required libraries to the package app - add_custom_command(TARGET llimage_libtest POST_BUILD - COMMAND ${CMAKE_COMMAND} -E copy ${AUTOBUILD_INSTALL_DIR}/lib/release/libapr-1.0.dylib ${LLIMAGE_LIBTEST_DESTINATION_DIR} - DEPENDS ${AUTOBUILD_INSTALL_DIR}/lib/release/libapr-1.0.dylib - ) - add_custom_command(TARGET llimage_libtest POST_BUILD - COMMAND ${CMAKE_COMMAND} -E copy ${AUTOBUILD_INSTALL_DIR}/lib/release/libaprutil-1.0.dylib ${LLIMAGE_LIBTEST_DESTINATION_DIR} - DEPENDS ${AUTOBUILD_INSTALL_DIR}/lib/release/libaprutil-1.0.dylib - ) - add_custom_command(TARGET llimage_libtest POST_BUILD - COMMAND ${CMAKE_COMMAND} -E copy ${AUTOBUILD_INSTALL_DIR}/lib/release/libexception_handler.dylib ${LLIMAGE_LIBTEST_DESTINATION_DIR} - DEPENDS ${AUTOBUILD_INSTALL_DIR}/lib/release/libexception_handler.dylib - ) - foreach(expat ${EXPAT_COPY}) - add_custom_command(TARGET llimage_libtest POST_BUILD - COMMAND ${CMAKE_COMMAND} -E copy ${AUTOBUILD_INSTALL_DIR}/lib/release/${expat} ${LLIMAGE_LIBTEST_DESTINATION_DIR} - DEPENDS ${AUTOBUILD_INSTALL_DIR}/lib/release/${expat} - ) - endforeach(expat) -endif (DARWIN) - -if (WINDOWS) - # Check indra/test_apps/llplugintest/CMakeLists.txt for an example of what to copy over for Windows and how -endif (WINDOWS) # Ensure people working on the viewer don't break this library -# *NOTE: This could be removed, or only built by TeamCity, if the build -# and link times become too long. add_dependencies(viewer llimage_libtest) + +endif(LL_TESTS) diff --git a/indra/integration_tests/llimage_libtest/llimage_libtest.cpp b/indra/integration_tests/llimage_libtest/llimage_libtest.cpp index 95102094ae..c45bd6fd01 100644 --- a/indra/integration_tests/llimage_libtest/llimage_libtest.cpp +++ b/indra/integration_tests/llimage_libtest/llimage_libtest.cpp @@ -43,6 +43,8 @@ #include "v4coloru.h" #include "llsdserialize.h" #include "llcleanup.h" +#include "lltrace.h" +#include "llfasttimer.h" // system libraries #include @@ -573,10 +575,10 @@ int main(int argc, char** argv) // Create the logging thread if required - if (LLFastTimer::sMetricLog) + if (LLTrace::BlockTimer::sMetricLog) { - LLFastTimer::sLogLock = new LLMutex(NULL); - fast_timer_log_thread = new LogThread(LLFastTimer::sLogName); + LLTrace::BlockTimer::setLogLock(new LLMutex()); + fast_timer_log_thread = new LogThread(LLTrace::BlockTimer::sLogName); fast_timer_log_thread->start(); } @@ -618,9 +620,9 @@ int main(int argc, char** argv) // Output perf data if requested by user if (analyze_performance) { - std::string baseline_name = LLFastTimer::sLogName + "_baseline.slp"; - std::string current_name = LLFastTimer::sLogName + ".slp"; - std::string report_name = LLFastTimer::sLogName + "_report.csv"; + std::string baseline_name = LLTrace::BlockTimer::sLogName + "_baseline.slp"; + std::string current_name = LLTrace::BlockTimer::sLogName + ".slp"; + std::string report_name = LLTrace::BlockTimer::sLogName + "_report.csv"; std::cout << "Analyzing performance, check report in : " << report_name << std::endl; @@ -628,9 +630,9 @@ int main(int argc, char** argv) } // Stop the perf gathering system if needed - if (LLFastTimer::sMetricLog) + if (LLTrace::BlockTimer::sMetricLog) { - LLMetricPerformanceTesterBasic::deleteTester(LLFastTimer::sLogName); + LLMetricPerformanceTesterBasic::deleteTester(LLTrace::BlockTimer::sLogName); sAllDone = true; } diff --git a/indra/llkdu/CMakeLists.txt b/indra/llkdu/CMakeLists.txt index 7cd9f5eb24..230803a630 100644 --- a/indra/llkdu/CMakeLists.txt +++ b/indra/llkdu/CMakeLists.txt @@ -42,10 +42,7 @@ if (USE_KDU) target_include_directories( llkdu INTERFACE ${CMAKE_CURRENT_SOURCE_DIR}) # Add tests - # ND: llkdu tests are very strange as they include stubs for KDU classes/methods - # if not having access to the right KDU version this test will fail to compile, incidentally I do not - # have access to a matching version of KDU and thus cannot get this tests to compile - if (LL_TESTS_KDU) + if (LL_TESTS) include(LLAddBuildTest) include(Tut) SET(llkdu_TEST_SOURCE_FILES @@ -62,6 +59,6 @@ if (USE_KDU) set_property( SOURCE ${llkdu_TEST_SOURCE_FILES} PROPERTY LL_TEST_ADDITIONAL_INCLUDE_DIRS ${llimage_include_dir}) LL_ADD_PROJECT_UNIT_TESTS(llkdu "${llkdu_TEST_SOURCE_FILES}") - endif (LL_TESTS_KDU) + endif (LL_TESTS) endif (USE_KDU) diff --git a/indra/llkdu/llimagej2ckdu.cpp b/indra/llkdu/llimagej2ckdu.cpp index bf7cfbe071..8e2bd5b2d9 100644 --- a/indra/llkdu/llimagej2ckdu.cpp +++ b/indra/llkdu/llimagej2ckdu.cpp @@ -163,6 +163,7 @@ private: S32 mNumComponents; bool mUseYCC; kdu_dims mDims; + kdu_push_pull_params mParams; kdu_sample_allocator mAllocator; kdu_tile_comp mComps[4]; kdu_line_buf mLines[4]; @@ -255,7 +256,7 @@ LLImageJ2CKDU::LLImageJ2CKDU() : LLImageJ2CImpl(), mCodeStreamp(), mTPosp(), mTileIndicesp(), - mRawImagep(NULL), + mRawImagep(nullptr), mDecodeState(), mBlocksSize(-1), mPrecinctsSize(-1), @@ -292,17 +293,17 @@ void LLImageJ2CKDU::setupCodeStream(LLImageJ2C &base, bool keep_codestream, ECod // two U32s and a pointer, so it's not as if it would be a huge overhead // to allocate a new one every time. // Also -- why is base.getData() tested specifically here? If that returns - // NULL, shouldn't we bail out of the whole method? + // nullptr, shouldn't we bail out of the whole method? if (!mInputp && base.getData()) { // The compressed data has been loaded // Setup the source for the codestream - mInputp.reset(new LLKDUMemSource(base.getData(), data_size)); + mInputp = std::make_unique(base.getData(), data_size); } if (mInputp) { - // This is LLKDUMemSource::reset(), not boost::scoped_ptr::reset(). + // This is LLKDUMemSource::reset(), not std::unique_ptr::reset(). mInputp->reset(); } @@ -312,7 +313,7 @@ void LLImageJ2CKDU::setupCodeStream(LLImageJ2C &base, bool keep_codestream, ECod // *TODO: This seems to be wrong. The base class should have no idea of // how j2c compression works so no good way of computing what's the byte // range to be used. - mCodeStreamp->set_max_bytes(max_bytes,true); + mCodeStreamp->set_max_bytes(max_bytes); // If you want to flip or rotate the image for some reason, change // the resolution, or identify a restricted region of interest, this is @@ -446,8 +447,8 @@ bool LLImageJ2CKDU::initDecode(LLImageJ2C &base, LLImageRaw &raw_image, F32 deco mCodeStreamp->change_appearance(false, true, false); // Apply loading discard level and cropping if required - kdu_dims* region_kdu = NULL; - if (region != NULL) + kdu_dims* region_kdu = nullptr; + if (region != nullptr) { region_kdu = new kdu_dims; region_kdu->pos.x = region[0]; @@ -464,7 +465,7 @@ bool LLImageJ2CKDU::initDecode(LLImageJ2C &base, LLImageRaw &raw_image, F32 deco if (region_kdu) { delete region_kdu; - region_kdu = NULL; + region_kdu = nullptr; } // Resize raw_image according to the image to be decoded @@ -475,12 +476,12 @@ bool LLImageJ2CKDU::initDecode(LLImageJ2C &base, LLImageRaw &raw_image, F32 deco if (!mTileIndicesp) { - mTileIndicesp.reset(new kdu_dims); + mTileIndicesp = std::make_unique(); } mCodeStreamp->get_valid_tiles(*mTileIndicesp); if (!mTPosp) { - mTPosp.reset(new kdu_coords); + mTPosp = std::make_unique(); mTPosp->y = 0; mTPosp->x = 0; } @@ -490,7 +491,7 @@ bool LLImageJ2CKDU::initDecode(LLImageJ2C &base, LLImageRaw &raw_image, F32 deco base.setLastError(msg.what()); return false; } - catch (kdu_exception kdu_value) + catch (const kdu_exception& kdu_value) { // KDU internally throws kdu_exception. It's possible that such an // exception might leak out into our code. Catch kdu_exception @@ -581,8 +582,7 @@ bool LLImageJ2CKDU::decodeImpl(LLImageJ2C &base, LLImageRaw &raw_image, F32 deco kdu_coords offset = tile_dims.pos - dims.pos; int row_gap = channels*dims.size.x; // inter-row separation kdu_byte *buf = buffer + offset.y*row_gap + offset.x*channels; - mDecodeState.reset(new LLKDUDecodeState(tile, buf, row_gap, - mCodeStreamp.get())); + mDecodeState = std::make_unique(tile, buf, row_gap, mCodeStreamp.get()); } // Do the actual processing F32 remaining_time = limit_time ? decode_time - decode_timer.getElapsedTimeF32().value() : 0.0f; @@ -607,7 +607,7 @@ bool LLImageJ2CKDU::decodeImpl(LLImageJ2C &base, LLImageRaw &raw_image, F32 deco cleanupCodeStream(); return true; // done } - catch (kdu_exception kdu_value) + catch (const kdu_exception& kdu_value) { // KDU internally throws kdu_exception. It's possible that such an // exception might leak out into our code. Catch kdu_exception @@ -810,7 +810,7 @@ bool LLImageJ2CKDU::encodeImpl(LLImageJ2C &base, const LLImageRaw &raw_image, co base.setLastError(msg.what()); return false; } - catch (kdu_exception kdu_value) + catch (const kdu_exception& kdu_value) { // KDU internally throws kdu_exception. It's possible that such an // exception might leak out into our code. Catch kdu_exception @@ -844,7 +844,7 @@ bool LLImageJ2CKDU::getMetadata(LLImageJ2C &base) base.setLastError(msg.what()); return false; } - catch (kdu_exception kdu_value) + catch (const kdu_exception& kdu_value) { // KDU internally throws kdu_exception. It's possible that such an // exception might leak out into our code. Catch kdu_exception @@ -976,8 +976,8 @@ void LLImageJ2CKDU::findDiscardLevelsBoundaries(LLImageJ2C &base) //std::cout << "Parsing discard level = " << discard_level << std::endl; // Create the input codestream object. setupCodeStream(base, true, MODE_FAST); - mCodeStreamp->apply_input_restrictions(0, 4, discard_level, 0, NULL); - mCodeStreamp->set_max_bytes(KDU_LONG_MAX,true); + mCodeStreamp->apply_input_restrictions(0, 4, discard_level, 0, nullptr); + mCodeStreamp->set_max_bytes(KDU_LONG_MAX,false); siz_params *siz_in = mCodeStreamp->access_siz(); // Create the output codestream object. @@ -1073,8 +1073,10 @@ void LLImageJ2CKDU::findDiscardLevelsBoundaries(LLImageJ2C &base) void set_default_colour_weights(kdu_params *siz) { + kdu_params *enc = siz->access_cluster(ENC_params); + assert(enc != nullptr); kdu_params *cod = siz->access_cluster(COD_params); - assert(cod != NULL); + assert(cod != nullptr); bool can_use_ycc = true; bool rev0 = false; @@ -1111,7 +1113,7 @@ void set_default_colour_weights(kdu_params *siz) return; } float weight; - if (cod->get(Clev_weights,0,0,weight) || cod->get(Cband_weights,0,0,weight)) + if (enc->get(Clev_weights,0,0,weight) || enc->get(Cband_weights,0,0,weight)) { // Weights already specified explicitly -> nothing to do return; @@ -1120,17 +1122,16 @@ void set_default_colour_weights(kdu_params *siz) // These example weights are adapted from numbers generated by Marcus Nadenau // at EPFL, for a viewing distance of 15 cm and a display resolution of // 300 DPI. - - cod->parse_string("Cband_weights:C0=" + enc->parse_string("Cband_weights:C0=" "{0.0901},{0.2758},{0.2758}," "{0.7018},{0.8378},{0.8378},{1}"); - cod->parse_string("Cband_weights:C1=" + enc->parse_string("Cband_weights:C1=" "{0.0263},{0.0863},{0.0863}," "{0.1362},{0.2564},{0.2564}," "{0.3346},{0.4691},{0.4691}," "{0.5444},{0.6523},{0.6523}," "{0.7078},{0.7797},{0.7797},{1}"); - cod->parse_string("Cband_weights:C2=" + enc->parse_string("Cband_weights:C2=" "{0.0773},{0.1835},{0.1835}," "{0.2598},{0.4130},{0.4130}," "{0.5040},{0.6464},{0.6464}," @@ -1149,7 +1150,7 @@ byte buffer, spacing successive output samples apart by `gap' bytes all necessary level shifting, type conversion, rounding and truncation. */ { int width = src.get_width(); - if (src.get_buf32() != NULL) + if (src.get_buf32() != nullptr) { // Decompressed samples have a 32-bit representation (integer or float) assert(precision >= 8); // Else would have used 16 bit representation kdu_sample32 *sp = src.get_buf32(); @@ -1312,11 +1313,11 @@ LLKDUDecodeState::LLKDUDecodeState(kdu_tile tile, kdu_byte *buf, S32 row_gap, mLines[c].pre_create(&mAllocator,mDims.size.x,mReversible[c],use_shorts,0,0); if (res.which() == 0) // No DWT levels used { - mEngines[c] = kdu_decoder(res.access_subband(LL_BAND),&mAllocator,use_shorts); + mEngines[c] = kdu_decoder(res.access_subband(LL_BAND), &mAllocator, mParams, use_shorts); } else { - mEngines[c] = kdu_synthesis(res,&mAllocator,use_shorts); + mEngines[c] = kdu_synthesis(res, &mAllocator, mParams, use_shorts); } } mAllocator.finalize(*codestreamp); // Actually creates buffering resources @@ -1394,7 +1395,7 @@ kdc_flow_control::kdc_flow_control (kdu_supp::kdu_image_in_base *img_in, kdu_cod this->codestream = codestream; codestream.get_valid_tiles(valid_tile_indices); tile_idx = valid_tile_indices.pos; - tile = codestream.open_tile(tile_idx,NULL); + tile = codestream.open_tile(tile_idx, nullptr); // Set up the individual components num_components = codestream.get_num_components(true); @@ -1403,7 +1404,7 @@ kdc_flow_control::kdc_flow_control (kdu_supp::kdu_image_in_base *img_in, kdu_cod kdc_component_flow_control *comp = components; for (n = 0; n < num_components; n++, comp++) { - comp->line = NULL; + comp->line = nullptr; comp->reader = img_in; kdu_coords subsampling; codestream.get_subsampling(n,subsampling,true); @@ -1420,12 +1421,12 @@ kdc_flow_control::kdc_flow_control (kdu_supp::kdu_image_in_base *img_in, kdu_cod assert(num_components >= 0); tile.set_components_of_interest(num_components); - max_buffer_memory = engine.create(codestream,tile,false,NULL,false,1,NULL,NULL,false); + max_buffer_memory = engine.create(codestream, tile, false, nullptr, false, 1, nullptr, nullptr,false); } kdc_flow_control::~kdc_flow_control() { - if (components != NULL) + if (components != nullptr) { delete[] components; } @@ -1452,8 +1453,8 @@ bool kdc_flow_control::advance_components() if (comp->ratio_counter < 0) { found_line = true; - comp->line = engine.exchange_line(n,NULL,NULL); - assert(comp->line != NULL); + comp->line = engine.exchange_line(n,nullptr,nullptr); + assert(comp->line != nullptr); if (comp->line->get_width()) { comp->reader->get(n,*(comp->line),0); @@ -1480,9 +1481,9 @@ void kdc_flow_control::process_components() assert(comp->ratio_counter >= 0); assert(comp->remaining_lines > 0); comp->remaining_lines--; - assert(comp->line != NULL); - engine.exchange_line(n,comp->line,NULL); - comp->line = NULL; + assert(comp->line != nullptr); + engine.exchange_line(n,comp->line,nullptr); + comp->line = nullptr; } } } diff --git a/indra/llkdu/llimagej2ckdu.h b/indra/llkdu/llimagej2ckdu.h index 8037c81868..8481201cbc 100644 --- a/indra/llkdu/llimagej2ckdu.h +++ b/indra/llkdu/llimagej2ckdu.h @@ -32,7 +32,6 @@ // // KDU core header files // -#define KDU_NO_THREADS #include "kdu_elementary.h" #include "kdu_messaging.h" #include "kdu_params.h" @@ -41,7 +40,6 @@ #include "include_kdu_xxxx.h" #include "kdu_sample_processing.h" -#include #include class LLKDUDecodeState; diff --git a/indra/llkdu/llkdumem.h b/indra/llkdu/llkdumem.h index 177a8ea976..0ad67a3f92 100644 --- a/indra/llkdu/llkdumem.h +++ b/indra/llkdu/llkdumem.h @@ -28,8 +28,6 @@ #define LL_LLKDUMEM_H // Support classes for reading and writing from memory buffers in KDU -#define KDU_NO_THREADS - #define kdu_xxxx "kdu_image.h" #include "include_kdu_xxxx.h" @@ -54,9 +52,7 @@ public: mCurPos = 0; } - ~LLKDUMemSource() - { - } + ~LLKDUMemSource() = default; int read(kdu_core::kdu_byte *buf, int num_bytes) { @@ -94,9 +90,7 @@ public: mOutputSize = &output_size; } - ~LLKDUMemTarget() - { - } + ~LLKDUMemTarget() = default; bool write(const kdu_core::kdu_byte *buf, int num_bytes) { diff --git a/indra/llkdu/tests/llimagej2ckdu_test.cpp b/indra/llkdu/tests/llimagej2ckdu_test.cpp index db81d60d9e..36b79047b6 100644 --- a/indra/llkdu/tests/llimagej2ckdu_test.cpp +++ b/indra/llkdu/tests/llimagej2ckdu_test.cpp @@ -139,18 +139,19 @@ int kdu_tile_comp::get_bit_depth(bool ) { return 8; } bool kdu_tile_comp::get_reversible() { return false; } int kdu_tile_comp::get_num_resolutions() { return 1; } kdu_subband kdu_resolution::access_subband(int ) { kdu_subband a; return a; } -void kdu_resolution::get_dims(kdu_dims& ) { } -int kdu_resolution::which() { return 0; } -int kdu_resolution::get_valid_band_indices(int &) { return 1; } -kdu_synthesis::kdu_synthesis(kdu_resolution, kdu_sample_allocator*, bool, float, kdu_thread_env*, kdu_thread_queue*) { } +void kdu_resolution::get_dims(kdu_dims& ) const { } +int kdu_resolution::which() const { return 0; } +int kdu_resolution::get_valid_band_indices(int &) const { return 1; } +kdu_synthesis::kdu_synthesis(kdu_resolution, kdu_sample_allocator*, kdu_push_pull_params&, bool, float, kdu_thread_env*, kdu_thread_queue*) { } //kdu_params::kdu_params(const char*, bool, bool, bool, bool, bool) { } -kdu_params::kdu_params(const char*, bool, bool, bool, bool, bool, kd_core_local::kd_coremem*) {} +kdu_params::kdu_params(const char*, bool, bool, bool, bool, bool) {} kdu_params::~kdu_params() { } +void kdu_params::destroy() { } void kdu_params::set(const char* , int , int , bool ) { } void kdu_params::set(const char* , int , int , int ) { } void kdu_params::finalize_all(bool ) { } void kdu_params::finalize_all(int, bool ) { } -void kdu_params::copy_from(kdu_params*, int, int, int, int, int, bool, bool, bool) { } +void kdu_params::copy_from(kdu_params*, int, int, int, int, int, bool, bool, bool, bool) { } bool kdu_params::parse_string(const char*) { return false; } bool kdu_params::get(const char*, int, int, bool&, bool, bool, bool) { return false; } bool kdu_params::get(const char*, int, int, float&, bool, bool, bool) { return false; } @@ -159,13 +160,13 @@ kdu_params* kdu_params::access_relation(int, int, int, bool) { return NULL; } kdu_params* kdu_params::access_cluster(const char*) { return NULL; } void kdu_codestream::set_fast() { } void kdu_codestream::set_fussy() { } -void kdu_codestream::get_dims(int, kdu_dims&, bool ) { } +void kdu_codestream::get_dims(int, kdu_dims&, bool ) const { } int kdu_codestream::get_min_dwt_levels() { return 5; } int kdu_codestream::get_max_tile_layers() { return 1; } void kdu_codestream::change_appearance(bool, bool, bool, kdu_thread_env *) {} void kdu_codestream::get_tile_dims(kdu_coords, int, kdu_dims&, bool ) { } void kdu_codestream::destroy() { } -void kdu_codestream::collect_timing_stats(int ) { } +void kdu_codestream::collect_timing_stats(int ) const { } void kdu_codestream::set_max_bytes(kdu_long, bool, bool ) { } void kdu_codestream::get_valid_tiles(kdu_dims& ) { } void kdu_codestream::create( @@ -182,19 +183,21 @@ void kdu_codestream::get_subsampling(int , kdu_coords&, bool ) { } void kdu_codestream::flush(kdu_long *, int, kdu_uint16 *, bool, bool, double, kdu_thread_env*, int) { } void kdu_codestream::set_resilient(bool ) { } int kdu_codestream::get_num_components(bool ) { return 0; } -kdu_long kdu_codestream::get_total_bytes(bool ) { return 0; } +kdu_long kdu_codestream::get_total_bytes(bool ) const { return 0; } kdu_long kdu_codestream::get_compressed_data_memory(bool ) const {return 0; } void kdu_codestream::share_buffering(kdu_codestream ) { } -int kdu_codestream::get_num_tparts() { return 0; } +int kdu_codestream::get_num_tparts() const { return 0; } int kdu_codestream::trans_out(kdu_long, kdu_long*, int, bool, kdu_thread_env* ) { return 0; } bool kdu_codestream::ready_for_flush(kdu_thread_env*) { return false; } siz_params* kdu_codestream::access_siz() { return NULL; } kdu_tile kdu_codestream::open_tile(kdu_coords , kdu_thread_env* ) { kdu_tile a; return a; } kdu_codestream_comment kdu_codestream::add_comment(kdu_thread_env*) { kdu_codestream_comment a; return a; } +kdu_codestream_comment kdu_codestream::get_comment(kdu_codestream_comment) { kdu_codestream_comment a; return a; }; void kdu_subband::close_block(kdu_block*, kdu_thread_env*) { } void kdu_subband::get_valid_blocks(kdu_dims &indices) const { } kdu_block * kdu_subband::open_block(kdu_coords, int *, kdu_thread_env *, int, bool) { return NULL; } bool kdu_codestream_comment::put_text(const char*) { return false; } +const char *kdu_codestream_comment::get_text() { return nullptr; }; void kdu_customize_warnings(kdu_message*) { } void kdu_customize_errors(kdu_message*) { } kdu_long kdu_multi_analysis::create( @@ -209,16 +212,18 @@ kdu_long kdu_multi_analysis::create( const kdu_push_pull_params*, kdu_membroker*) { return kdu_long(0); } void kdu_multi_analysis::destroy(kdu_thread_env *) {} +siz_params::siz_params() : kdu_params(NULL, false, false, false, false, false) { } siz_params::siz_params(kd_core_local::kd_coremem*) : kdu_params(NULL, false, false, false, false, false) { } siz_params::~siz_params() {} void siz_params::finalize(bool ) { } void siz_params::copy_with_xforms(kdu_params*, int, int, bool, bool, bool) { } -int siz_params::write_marker_segment(kdu_output*, kdu_params*, int) { return 0; } +int siz_params::write_marker_segment(kdu_output*, kdu_params*, int, int&) { return 0; } bool siz_params::check_marker_segment(kdu_uint16, int, kdu_byte a[], int&) { return false; } -bool siz_params::read_marker_segment(kdu_uint16, int, kdu_byte a[], int) { return false; } +int siz_params::read_marker_segment(kdu_uint16 code, int num_bytes, kdu_byte bytes[], int tpart_idx) { return false; } kdu_decoder::kdu_decoder( kdu_subband subband, kdu_sample_allocator*, + kdu_push_pull_params&, bool, float, int, kdu_thread_env*, kdu_thread_queue*, -- cgit v1.2.3 From 94a44426601a2cada343f7a211ea5a9a742982ef Mon Sep 17 00:00:00 2001 From: Rye Date: Tue, 21 Jan 2025 01:18:03 -0500 Subject: Enable OpenAL by default --- indra/cmake/OPENAL.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/indra/cmake/OPENAL.cmake b/indra/cmake/OPENAL.cmake index 347dd02cd7..0a7529c6c3 100644 --- a/indra/cmake/OPENAL.cmake +++ b/indra/cmake/OPENAL.cmake @@ -8,7 +8,7 @@ include_guard() # to have memory leaks, has no option to play music streams # It probably makes sense to to completely remove it -set(USE_OPENAL OFF CACHE BOOL "Enable OpenAL") +set(USE_OPENAL ON CACHE BOOL "Enable OpenAL") # ND: To streamline arguments passed, switch from OPENAL to USE_OPENAL # To not break all old build scripts convert old arguments but warn about it if(OPENAL) -- cgit v1.2.3 From 635c34a17bad6435f6981163660947dbf13ee763 Mon Sep 17 00:00:00 2001 From: Rye Date: Tue, 21 Jan 2025 01:19:18 -0500 Subject: Fix build with C++20 including nat's changes to fsyspath --- indra/llaudio/llvorbisencode.cpp | 32 ------------------ indra/llcommon/fsyspath.h | 56 ++++++++++++++++++++----------- indra/llcommon/llqueuedthread.cpp | 4 +-- indra/llrender/llfontfreetype.cpp | 2 +- indra/llrender/llimagegl.cpp | 2 +- indra/llwindow/llwindowmacosx.cpp | 8 ++--- indra/newview/gltfscenemanager.cpp | 2 +- indra/newview/llmeshrepository.cpp | 6 ++-- indra/newview/llmeshrepository.h | 4 +-- indra/newview/llpanelemojicomplete.cpp | 2 +- indra/newview/lltexturefetch.cpp | 6 ++-- indra/newview/llviewermedia.cpp | 4 +-- indra/newview/llviewerwindow.cpp | 2 +- indra/newview/llvoicewebrtc.cpp | 24 +++++++------ indra/viewer_components/login/lllogin.cpp | 2 +- 15 files changed, 72 insertions(+), 84 deletions(-) diff --git a/indra/llaudio/llvorbisencode.cpp b/indra/llaudio/llvorbisencode.cpp index 83e7fad92f..d115dc309d 100644 --- a/indra/llaudio/llvorbisencode.cpp +++ b/indra/llaudio/llvorbisencode.cpp @@ -34,38 +34,6 @@ #include "llmath.h" #include "llapr.h" -//#if LL_DARWIN -// MBW -- XXX -- Getting rid of SecondLifeVorbis for now -#if 0 -#include "VorbisFramework.h" - -#define vorbis_analysis mac_vorbis_analysis -#define vorbis_analysis_headerout mac_vorbis_analysis_headerout -#define vorbis_analysis_init mac_vorbis_analysis_init -#define vorbis_encode_ctl mac_vorbis_encode_ctl -#define vorbis_encode_setup_init mac_vorbis_encode_setup_init -#define vorbis_encode_setup_managed mac_vorbis_encode_setup_managed - -#define vorbis_info_init mac_vorbis_info_init -#define vorbis_info_clear mac_vorbis_info_clear -#define vorbis_comment_init mac_vorbis_comment_init -#define vorbis_comment_clear mac_vorbis_comment_clear -#define vorbis_block_init mac_vorbis_block_init -#define vorbis_block_clear mac_vorbis_block_clear -#define vorbis_dsp_clear mac_vorbis_dsp_clear -#define vorbis_analysis_buffer mac_vorbis_analysis_buffer -#define vorbis_analysis_wrote mac_vorbis_analysis_wrote -#define vorbis_analysis_blockout mac_vorbis_analysis_blockout - -#define ogg_stream_packetin mac_ogg_stream_packetin -#define ogg_stream_init mac_ogg_stream_init -#define ogg_stream_flush mac_ogg_stream_flush -#define ogg_stream_pageout mac_ogg_stream_pageout -#define ogg_page_eos mac_ogg_page_eos -#define ogg_stream_clear mac_ogg_stream_clear - -#endif - S32 check_for_invalid_wav_formats(const std::string& in_fname, std::string& error_msg) { U16 num_channels = 0; diff --git a/indra/llcommon/fsyspath.h b/indra/llcommon/fsyspath.h index 1b4aec09b4..f66970ed8f 100644 --- a/indra/llcommon/fsyspath.h +++ b/indra/llcommon/fsyspath.h @@ -12,7 +12,10 @@ #if ! defined(LL_FSYSPATH_H) #define LL_FSYSPATH_H +#include #include +#include +#include // While std::filesystem::path can be directly constructed from std::string on // both Posix and Windows, that's not what we want on Windows. Per @@ -33,42 +36,55 @@ // char"), the "native narrow encoding" isn't UTF-8, so file paths containing // non-ASCII characters get mangled. // -// Once we're building with C++20, we could pass a UTF-8 std::string through a -// vector to engage std::filesystem::path's own UTF-8 conversion. But -// sigh, as of 2024-04-03 we're not yet there. -// -// Anyway, encapsulating the important UTF-8 conversions in our own subclass -// allows us to migrate forward to C++20 conventions without changing -// referencing code. +// Encapsulating the important UTF-8 conversions in our own subclass allows us +// to migrate forward to C++20 conventions without changing referencing code. class fsyspath: public std::filesystem::path { using super = std::filesystem::path; + // In C++20 (__cpp_lib_char8_t), std::filesystem::u8path() is deprecated. + // std::filesystem::path(iter, iter) performs UTF-8 conversions when the + // value_type of the iterators is char8_t. While we could copy into a + // temporary std::u8string and from there into std::filesystem::path, to + // minimize string copying we'll define a transform_iterator that accepts + // a std::string_view::iterator and dereferences to char8_t. + struct u8ify + { + char8_t operator()(char c) const { return char8_t(c); } + }; + using u8iter = boost::transform_iterator; + public: // default fsyspath() {} - // construct from UTF-8 encoded std::string - fsyspath(const std::string& path): super(std::filesystem::u8path(path)) {} - // construct from UTF-8 encoded const char* - fsyspath(const char* path): super(std::filesystem::u8path(path)) {} + // construct from UTF-8 encoded string + fsyspath(const std::string& path): fsyspath(std::string_view(path)) {} + fsyspath(const char* path): fsyspath(std::string_view(path)) {} + fsyspath(std::string_view path): + super(u8iter(path.begin(), u8ify()), u8iter(path.end(), u8ify())) + {} // construct from existing path fsyspath(const super& path): super(path) {} - fsyspath& operator=(const super& p) { super::operator=(p); return *this; } - fsyspath& operator=(const std::string& p) - { - super::operator=(std::filesystem::u8path(p)); - return *this; - } - fsyspath& operator=(const char* p) + fsyspath& operator=(const super& p) { super::operator=(p); return *this; } + fsyspath& operator=(const std::string& p) { return (*this) = std::string_view(p); } + fsyspath& operator=(const char* p) { return (*this) = std::string_view(p); } + fsyspath& operator=(std::string_view p) { - super::operator=(std::filesystem::u8path(p)); + assign(u8iter(p.begin(), u8ify()), u8iter(p.end(), u8ify())); return *this; } // shadow base-class string() method with UTF-8 aware method - std::string string() const { return super::u8string(); } + std::string string() const + { + // Short of forbidden type punning, I see no way to avoid copying this + // std::u8string to a std::string. + auto u8str{ super::u8string() }; + // from https://github.com/tahonermann/char8_t-remediation/blob/master/char8_t-remediation.h#L180-L182 + return { u8str.begin(), u8str.end() }; + } // On Posix systems, where value_type is already char, this operator // std::string() method shadows the base class operator string_type() // method. But on Windows, where value_type is wchar_t, the base class diff --git a/indra/llcommon/llqueuedthread.cpp b/indra/llcommon/llqueuedthread.cpp index 1c4ac5a7bf..0196a24b18 100644 --- a/indra/llcommon/llqueuedthread.cpp +++ b/indra/llcommon/llqueuedthread.cpp @@ -146,7 +146,7 @@ size_t LLQueuedThread::updateQueue(F32 max_time_ms) // schedule a call to threadedUpdate for every call to updateQueue if (!isQuitting()) { - mRequestQueue.post([=]() + mRequestQueue.post([=, this]() { LL_PROFILE_ZONE_NAMED_CATEGORY_THREAD("qt - update"); mIdleThread = false; @@ -474,7 +474,7 @@ void LLQueuedThread::processRequest(LLQueuedThread::QueuedRequest* req) #else using namespace std::chrono_literals; auto retry_time = LL::WorkQueue::TimePoint::clock::now() + 16ms; - mRequestQueue.post([=] + mRequestQueue.post([=, this] { LL_PROFILE_ZONE_NAMED("processRequest - retry"); if (LL::WorkQueue::TimePoint::clock::now() < retry_time) diff --git a/indra/llrender/llfontfreetype.cpp b/indra/llrender/llfontfreetype.cpp index 1f14d82bf1..fa249902af 100644 --- a/indra/llrender/llfontfreetype.cpp +++ b/indra/llrender/llfontfreetype.cpp @@ -715,7 +715,7 @@ void LLFontFreetype::renderGlyph(EFontGlyphType bitmap_type, U32 glyph_index, ll if (error == FT_Err_Out_Of_Memory) { LLError::LLUserWarningMsg::showOutOfMemory(); - LL_ERRS() << "Out of memory loading glyph for character " << wch << LL_ENDL; + LL_ERRS() << "Out of memory loading glyph for character " << U32(wch) << LL_ENDL; } std::string message = llformat( diff --git a/indra/llrender/llimagegl.cpp b/indra/llrender/llimagegl.cpp index 3858811a50..0bfcb5d9d2 100644 --- a/indra/llrender/llimagegl.cpp +++ b/indra/llrender/llimagegl.cpp @@ -1773,7 +1773,7 @@ void LLImageGL::syncToMainThread(LLGLuint new_tex_name) ref(); LL::WorkQueue::postMaybe( mMainQueue, - [=]() + [=, this]() { LL_PROFILE_ZONE_NAMED("cglt - delete callback"); syncTexName(new_tex_name); diff --git a/indra/llwindow/llwindowmacosx.cpp b/indra/llwindow/llwindowmacosx.cpp index f26d692363..6c3be3eef8 100644 --- a/indra/llwindow/llwindowmacosx.cpp +++ b/indra/llwindow/llwindowmacosx.cpp @@ -1060,7 +1060,7 @@ F32 LLWindowMacOSX::getGamma() &greenGamma, &blueMin, &blueMax, - &blueGamma) == noErr) + &blueGamma) == kCGErrorSuccess) { // So many choices... // Let's just return the green channel gamma for now. @@ -1111,7 +1111,7 @@ bool LLWindowMacOSX::setGamma(const F32 gamma) &greenGamma, &blueMin, &blueMax, - &blueGamma) != noErr) + &blueGamma) != kCGErrorSuccess) { return false; } @@ -1126,7 +1126,7 @@ bool LLWindowMacOSX::setGamma(const F32 gamma) gamma, blueMin, blueMax, - gamma) != noErr) + gamma) != kCGErrorSuccess) { return false; } @@ -1178,7 +1178,7 @@ bool LLWindowMacOSX::setCursorPosition(const LLCoordWindow position) newPosition.y = screen_pos.mY; CGSetLocalEventsSuppressionInterval(0.0); - if(CGWarpMouseCursorPosition(newPosition) == noErr) + if(CGWarpMouseCursorPosition(newPosition) == kCGErrorSuccess) { result = true; } diff --git a/indra/newview/gltfscenemanager.cpp b/indra/newview/gltfscenemanager.cpp index 2d6d9a153e..7863d25696 100644 --- a/indra/newview/gltfscenemanager.cpp +++ b/indra/newview/gltfscenemanager.cpp @@ -500,7 +500,7 @@ void GLTFSceneManager::update() LLNewBufferedResourceUploadInfo::uploadFinish_f finish = [this, buffer](LLUUID assetId, LLSD response) { LLAppViewer::instance()->postToMainCoro( - [=]() + [=, this]() { if (mUploadingAsset) { diff --git a/indra/newview/llmeshrepository.cpp b/indra/newview/llmeshrepository.cpp index a5bed1dbe6..93453f507c 100644 --- a/indra/newview/llmeshrepository.cpp +++ b/indra/newview/llmeshrepository.cpp @@ -548,8 +548,8 @@ LLViewerFetchedTexture* LLMeshUploadThread::FindViewerTexture(const LLImportMate return ppTex ? (*ppTex).get() : NULL; } -volatile S32 LLMeshRepoThread::sActiveHeaderRequests = 0; -volatile S32 LLMeshRepoThread::sActiveLODRequests = 0; +std::atomic LLMeshRepoThread::sActiveHeaderRequests = 0; +std::atomic LLMeshRepoThread::sActiveLODRequests = 0; U32 LLMeshRepoThread::sMaxConcurrentRequests = 1; S32 LLMeshRepoThread::sRequestLowWater = REQUEST2_LOW_WATER_MIN; S32 LLMeshRepoThread::sRequestHighWater = REQUEST2_HIGH_WATER_MIN; @@ -3916,7 +3916,7 @@ void LLMeshRepository::notifyLoadedMeshes() } // erase from background thread - mThread->mWorkQueue.post([=]() + mThread->mWorkQueue.post([=, this]() { mThread->mSkinMap.erase(id); }); diff --git a/indra/newview/llmeshrepository.h b/indra/newview/llmeshrepository.h index b5c2424578..3d25a4dd78 100644 --- a/indra/newview/llmeshrepository.h +++ b/indra/newview/llmeshrepository.h @@ -256,8 +256,8 @@ class LLMeshRepoThread : public LLThread { public: - volatile static S32 sActiveHeaderRequests; - volatile static S32 sActiveLODRequests; + static std::atomic sActiveHeaderRequests; + static std::atomic sActiveLODRequests; static U32 sMaxConcurrentRequests; static S32 sRequestLowWater; static S32 sRequestHighWater; diff --git a/indra/newview/llpanelemojicomplete.cpp b/indra/newview/llpanelemojicomplete.cpp index cb89a5910e..fc1bf6ca93 100644 --- a/indra/newview/llpanelemojicomplete.cpp +++ b/indra/newview/llpanelemojicomplete.cpp @@ -438,7 +438,7 @@ void LLPanelEmojiComplete::updateConstraints() { mRenderRect = getLocalRect(); - mEmojiWidth = (U16)(mIconFont->getWidthF32(u8"\U0001F431") + mPadding * 2); + mEmojiWidth = (U16)(mIconFont->getWidthF32(LLWString(1, 0x1F431).c_str()) + mPadding * 2); if (mVertical) { mEmojiHeight = mIconFont->getLineHeight() + mPadding * 2; diff --git a/indra/newview/lltexturefetch.cpp b/indra/newview/lltexturefetch.cpp index bac0c736b1..9f7d09c794 100644 --- a/indra/newview/lltexturefetch.cpp +++ b/indra/newview/lltexturefetch.cpp @@ -2843,7 +2843,7 @@ bool LLTextureFetch::getRequestFinished(const LLUUID& id, S32& discard_level, S3 bool LLTextureFetch::updateRequestPriority(const LLUUID& id, F32 priority) { LL_PROFILE_ZONE_SCOPED; - mRequestQueue.tryPost([=]() + mRequestQueue.tryPost([=, this]() { LLTextureFetchWorker* worker = getWorker(id); if (worker) @@ -3571,8 +3571,8 @@ TFReqSendMetrics::doWork(LLTextureFetch * fetcher) //if (! gViewerAssetStatsThread1) // return true; - static volatile bool reporting_started(false); - static volatile S32 report_sequence(0); + static std::atomic_bool reporting_started(false); + static std::atomic_int report_sequence(0); // In mStatsSD, we have a copy we own of the LLSD representation // of the asset stats. Add some additional fields and ship it off. diff --git a/indra/newview/llviewermedia.cpp b/indra/newview/llviewermedia.cpp index 4e7416bb63..d688d5930c 100644 --- a/indra/newview/llviewermedia.cpp +++ b/indra/newview/llviewermedia.cpp @@ -2902,14 +2902,14 @@ void LLViewerMediaImpl::update() media_tex->ref(); main_queue->postTo( mTexUpdateQueue, // Worker thread queue - [=]() // work done on update worker thread + [=, this]() // work done on update worker thread { #if LL_IMAGEGL_THREAD_CHECK media_tex->getGLTexture()->mActiveThread = LLThread::currentID(); #endif doMediaTexUpdate(media_tex, data, data_width, data_height, x_pos, y_pos, width, height, true); }, - [=]() // callback to main thread + [=, this]() // callback to main thread { #if LL_IMAGEGL_THREAD_CHECK media_tex->getGLTexture()->mActiveThread = LLThread::currentID(); diff --git a/indra/newview/llviewerwindow.cpp b/indra/newview/llviewerwindow.cpp index 5a7d507b74..1795d62adc 100644 --- a/indra/newview/llviewerwindow.cpp +++ b/indra/newview/llviewerwindow.cpp @@ -1331,7 +1331,7 @@ LLWindowCallbacks::DragNDropResult LLViewerWindow::handleDragNDrop( LLWindow *wi // Check the whitelist, if there's media (otherwise just show it) if (te->getMediaData() == NULL || te->getMediaData()->checkCandidateUrl(url)) { - if ( obj != mDragHoveredObject) + if ( obj != mDragHoveredObject.get()) { // Highlight the dragged object LLSelectMgr::getInstance()->unhighlightObjectOnly(mDragHoveredObject); diff --git a/indra/newview/llvoicewebrtc.cpp b/indra/newview/llvoicewebrtc.cpp index 0bb65f7431..3dc3a74062 100644 --- a/indra/newview/llvoicewebrtc.cpp +++ b/indra/newview/llvoicewebrtc.cpp @@ -556,7 +556,7 @@ void LLWebRTCVoiceClient::voiceConnectionCoro() } } LL::WorkQueue::postMaybe(mMainQueue, - [=] { + [=, this] { if (sShuttingDown) { return; @@ -674,7 +674,7 @@ void LLWebRTCVoiceClient::OnDevicesChanged(const llwebrtc::LLWebRTCVoiceDeviceLi { LL::WorkQueue::postMaybe(mMainQueue, - [=] + [=, this] { OnDevicesChangedImpl(render_devices, capture_devices); }); @@ -2211,7 +2211,7 @@ LLVoiceWebRTCConnection::~LLVoiceWebRTCConnection() void LLVoiceWebRTCConnection::OnIceGatheringState(llwebrtc::LLWebRTCSignalingObserver::EIceGatheringState state) { LL::WorkQueue::postMaybe(mMainQueue, - [=] { + [=, this] { LL_DEBUGS("Voice") << "Ice Gathering voice account. " << state << LL_ENDL; switch (state) @@ -2234,7 +2234,7 @@ void LLVoiceWebRTCConnection::OnIceGatheringState(llwebrtc::LLWebRTCSignalingObs // callback from llwebrtc void LLVoiceWebRTCConnection::OnIceCandidate(const llwebrtc::LLWebRTCIceCandidate& candidate) { - LL::WorkQueue::postMaybe(mMainQueue, [=] { mIceCandidates.push_back(candidate); }); + LL::WorkQueue::postMaybe(mMainQueue, [=, this] { mIceCandidates.push_back(candidate); }); } void LLVoiceWebRTCConnection::processIceUpdates() @@ -2352,7 +2352,7 @@ void LLVoiceWebRTCConnection::processIceUpdatesCoro(connectionPtr_t connection) void LLVoiceWebRTCConnection::OnOfferAvailable(const std::string &sdp) { LL::WorkQueue::postMaybe(mMainQueue, - [=] { + [=, this] { if (mShutDown) { return; @@ -2379,7 +2379,7 @@ void LLVoiceWebRTCConnection::OnOfferAvailable(const std::string &sdp) void LLVoiceWebRTCConnection::OnAudioEstablished(llwebrtc::LLWebRTCAudioInterface* audio_interface) { LL::WorkQueue::postMaybe(mMainQueue, - [=] { + [=, this] { if (mShutDown) { return; @@ -2401,7 +2401,7 @@ void LLVoiceWebRTCConnection::OnAudioEstablished(llwebrtc::LLWebRTCAudioInterfac void LLVoiceWebRTCConnection::OnRenegotiationNeeded() { LL::WorkQueue::postMaybe(mMainQueue, - [=] { + [=, this] { LL_DEBUGS("Voice") << "Voice channel requires renegotiation." << LL_ENDL; if (!mShutDown) { @@ -2415,7 +2415,7 @@ void LLVoiceWebRTCConnection::OnRenegotiationNeeded() void LLVoiceWebRTCConnection::OnPeerConnectionClosed() { LL::WorkQueue::postMaybe(mMainQueue, - [=] { + [=, this] { LL_DEBUGS("Voice") << "Peer connection has closed." << LL_ENDL; if (mVoiceConnectionState == VOICE_STATE_WAIT_FOR_CLOSE) { @@ -2843,9 +2843,13 @@ bool LLVoiceWebRTCConnection::connectionStateMachine() } // else was already posted by llwebrtc::terminate(). break; + } + case VOICE_STATE_WAIT_FOR_CLOSE: break; + case VOICE_STATE_CLOSED: + { if (!mShutDown) { mVoiceConnectionState = VOICE_STATE_START_SESSION; @@ -2888,7 +2892,7 @@ bool LLVoiceWebRTCConnection::connectionStateMachine() // llwebrtc callback void LLVoiceWebRTCConnection::OnDataReceived(const std::string& data, bool binary) { - LL::WorkQueue::postMaybe(mMainQueue, [=] { LLVoiceWebRTCConnection::OnDataReceivedImpl(data, binary); }); + LL::WorkQueue::postMaybe(mMainQueue, [=, this] { LLVoiceWebRTCConnection::OnDataReceivedImpl(data, binary); }); } // @@ -3044,7 +3048,7 @@ void LLVoiceWebRTCConnection::OnDataReceivedImpl(const std::string &data, bool b void LLVoiceWebRTCConnection::OnDataChannelReady(llwebrtc::LLWebRTCDataInterface *data_interface) { LL::WorkQueue::postMaybe(mMainQueue, - [=] { + [=, this] { if (mShutDown) { return; diff --git a/indra/viewer_components/login/lllogin.cpp b/indra/viewer_components/login/lllogin.cpp index feebecf4cb..425df0e0f9 100644 --- a/indra/viewer_components/login/lllogin.cpp +++ b/indra/viewer_components/login/lllogin.cpp @@ -128,7 +128,7 @@ void LLLogin::Impl::connect(const std::string& uri, const LLSD& login_params) // Launch a coroutine with our login_() method. Run the coroutine until // its first wait; at that point, return here. std::string coroname = - LLCoros::instance().launch("LLLogin::Impl::login_", [=]() { loginCoro(uri, login_params); }); + LLCoros::instance().launch("LLLogin::Impl::login_", [=, this]() { loginCoro(uri, login_params); }); LL_DEBUGS("LLLogin") << " connected with uri '" << uri << "', login_params " << login_params << LL_ENDL; } -- cgit v1.2.3 From 51ed6b5424a626499ddb7f95e6da7cf34b375f6a Mon Sep 17 00:00:00 2001 From: Rye Date: Tue, 21 Jan 2025 01:20:11 -0500 Subject: Update to use universal build flags and fix cmake deprecations --- indra/cmake/00-Common.cmake | 50 +++++++++++++++++++------------------------ indra/cmake/Linking.cmake | 1 - indra/cmake/Variables.cmake | 48 ++++++++++++----------------------------- indra/doxygen/CMakeLists.txt | 14 ------------ indra/llwindow/CMakeLists.txt | 7 +++--- 5 files changed, 39 insertions(+), 81 deletions(-) diff --git a/indra/cmake/00-Common.cmake b/indra/cmake/00-Common.cmake index 39f26ced5d..69eeff0a79 100644 --- a/indra/cmake/00-Common.cmake +++ b/indra/cmake/00-Common.cmake @@ -155,46 +155,40 @@ if (LINUX) set(CMAKE_CXX_FLAGS_DEBUG "-fno-inline ${CMAKE_CXX_FLAGS_DEBUG}") endif (LINUX) - if (DARWIN) + # Use rpath loading on macos + set(CMAKE_MACOSX_RPATH TRUE) + # Warnings should be fatal -- thanks, Nicky Perian, for spotting reversed default set(CLANG_DISABLE_FATAL_WARNINGS OFF) set(CMAKE_CXX_LINK_FLAGS "-Wl,-headerpad_max_install_names,-search_paths_first") set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_CXX_LINK_FLAGS}") - set(DARWIN_extra_cstar_flags "-Wno-unused-local-typedef -Wno-deprecated-declarations") - # Ensure that CMAKE_CXX_FLAGS has the correct -g debug information format -- - # see Variables.cmake. - string(REPLACE "-gdwarf-2" "-g${CMAKE_XCODE_ATTRIBUTE_DEBUG_INFORMATION_FORMAT}" - CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}") - set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${DARWIN_extra_cstar_flags}") - set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${DARWIN_extra_cstar_flags}") - # NOTE: it's critical that the optimization flag is put in front. - # NOTE: it's critical to have both CXX_FLAGS and C_FLAGS covered. -## Really?? On developer machines too? -##set(ENABLE_SIGNING TRUE) -##set(SIGNING_IDENTITY "Developer ID Application: Linden Research, Inc.") - - # required for clang-15/xcode-15 since our boost package still uses deprecated std::unary_function/binary_function - # see https://developer.apple.com/documentation/xcode-release-notes/xcode-15-release-notes#C++-Standard-Library - add_compile_definitions(_LIBCPP_ENABLE_CXX17_REMOVED_UNARY_BINARY_FUNCTION) -endif (DARWIN) -if (LINUX OR DARWIN) - set(GCC_WARNINGS -Wall -Wno-sign-compare -Wno-trigraphs) + # Ensure debug symbols are always generated + add_compile_options(-g --debug) # --debug is a clang synonym for -g that bypasses cmake behaviors - if (NOT GCC_DISABLE_FATAL_WARNINGS) - list(APPEND GCC_WARNINGS -Werror) - endif (NOT GCC_DISABLE_FATAL_WARNINGS) + # Silence GL deprecation warnings + add_compile_definitions(GL_SILENCE_DEPRECATION=1) +endif(DARWIN) - list(APPEND GCC_WARNINGS -Wno-reorder -Wno-non-virtual-dtor ) +if (LINUX OR DARWIN) + add_compile_options(-Wall -Wno-sign-compare -Wno-trigraphs -Wno-reorder -Wno-unused-but-set-variable -Wno-unused-variable) - if (CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 13) - list(APPEND GCC_WARNINGS -Wno-unused-but-set-variable -Wno-unused-variable ) + if (CMAKE_CXX_COMPILER_ID STREQUAL "Clang" OR CMAKE_CXX_COMPILER_ID STREQUAL "AppleClang") + # libstdc++ headers contain deprecated declarations that fail on clang + # macOS currently has many deprecated calls + add_compile_options(-Wno-unused-local-typedef -Wno-deprecated-declarations) endif() + if (CMAKE_CXX_COMPILER_ID STREQUAL "GNU") + add_compile_options(-Wno-stringop-truncation -Wno-parentheses -Wno-maybe-uninitialized) + endif() + + if (NOT GCC_DISABLE_FATAL_WARNINGS AND NOT CLANG_DISABLE_FATAL_WARNINGS) + add_compile_options(-Werror) + endif () + add_compile_options(${GCC_WARNINGS}) add_compile_options(-m${ADDRESS_SIZE}) endif (LINUX OR DARWIN) - - diff --git a/indra/cmake/Linking.cmake b/indra/cmake/Linking.cmake index 1d757abeff..1093fc7f71 100644 --- a/indra/cmake/Linking.cmake +++ b/indra/cmake/Linking.cmake @@ -67,7 +67,6 @@ elseif (WINDOWS) legacy_stdio_definitions ) else() - include(CMakeFindFrameworks) find_library(COREFOUNDATION_LIBRARY CoreFoundation) find_library(CARBON_LIBRARY Carbon) find_library(COCOA_LIBRARY Cocoa) diff --git a/indra/cmake/Variables.cmake b/indra/cmake/Variables.cmake index 5b3aeb8b7f..a315943a90 100644 --- a/indra/cmake/Variables.cmake +++ b/indra/cmake/Variables.cmake @@ -147,49 +147,29 @@ if (${CMAKE_SYSTEM_NAME} MATCHES "Darwin") set(CMAKE_OSX_DEPLOYMENT_TARGET "${CMAKE_MATCH_1}") message(STATUS "CMAKE_OSX_DEPLOYMENT_TARGET = '${CMAKE_OSX_DEPLOYMENT_TARGET}'") - string(REGEX MATCH "-stdlib=([^ ]+)" scratch "$ENV{LL_BUILD}") - set(CMAKE_XCODE_ATTRIBUTE_CLANG_CXX_LIBRARY "${CMAKE_MATCH_1}") - message(STATUS "CMAKE_XCODE_ATTRIBUTE_CLANG_CXX_LIBRARY = '${CMAKE_XCODE_ATTRIBUTE_CLANG_CXX_LIBRARY}'") - - string(REGEX MATCH " -g([^ ]*)" scratch "$ENV{LL_BUILD}") - set(CMAKE_XCODE_ATTRIBUTE_DEBUG_INFORMATION_FORMAT "${CMAKE_MATCH_1}") - # -gdwarf-2 is passed in LL_BUILD according to 00-COMPILE-LINK-RUN.txt. - # However, when CMake 3.9.2 sees -gdwarf-2, it silently deletes the whole -g - # switch, producing no symbols at all! The same thing happens if we specify - # plain -g ourselves, i.e. CMAKE_XCODE_ATTRIBUTE_DEBUG_INFORMATION_FORMAT is - # the empty string. Specifying -gdwarf-with-dsym or just -gdwarf drives a - # different CMake behavior: it substitutes plain -g. As of 2017-09-19, - # viewer-build-variables/variables still passes -gdwarf-2, which is the - # no-symbols case. Set -gdwarf, triggering CMake to substitute plain -g -- - # at least that way we should get symbols, albeit mangled ones. It Would Be - # Nice if CMake's behavior could be predicted from a consistent mental - # model, instead of only observed experimentally. - string(REPLACE "dwarf-2" "dwarf" - CMAKE_XCODE_ATTRIBUTE_DEBUG_INFORMATION_FORMAT - "${CMAKE_XCODE_ATTRIBUTE_DEBUG_INFORMATION_FORMAT}") - message(STATUS "CMAKE_XCODE_ATTRIBUTE_DEBUG_INFORMATION_FORMAT = '${CMAKE_XCODE_ATTRIBUTE_DEBUG_INFORMATION_FORMAT}'") + # Use dwarf symbols for most libraries for compilation speed + set(CMAKE_XCODE_ATTRIBUTE_DEBUG_INFORMATION_FORMAT "dwarf") string(REGEX MATCH "-O([^ ]*)" scratch "$ENV{LL_BUILD}") set(CMAKE_XCODE_ATTRIBUTE_GCC_OPTIMIZATION_LEVEL "${CMAKE_MATCH_1}") message(STATUS "CMAKE_XCODE_ATTRIBUTE_GCC_OPTIMIZATION_LEVEL = '${CMAKE_XCODE_ATTRIBUTE_GCC_OPTIMIZATION_LEVEL}'") # allow disabling this check by setting LL_SKIP_REQUIRE_SYSROOT either ON as cmake cache var or non-empty as environment var - set(LL_SKIP_REQUIRE_SYSROOT OFF CACHE BOOL "Skip requirement to set toolchain sysroot ahead of time. Not skipped by default for consistency, but skipping can be useful for selecting alternative xcode versions side by side") - if("$ENV{LL_SKIP_REQUIRE_SYSROOT}" STREQUAL "" AND NOT ${LL_SKIP_REQUIRE_SYSROOT}) - string(REGEX MATCHALL "[^ ]+" LL_BUILD_LIST "$ENV{LL_BUILD}") - list(FIND LL_BUILD_LIST "-iwithsysroot" sysroot_idx) - if ("${sysroot_idx}" LESS 0) - message(FATAL_ERROR "Environment variable LL_BUILD must contain '-iwithsysroot'") - endif () - math(EXPR sysroot_idx "${sysroot_idx} + 1") - list(GET LL_BUILD_LIST "${sysroot_idx}" CMAKE_OSX_SYSROOT) - endif() - message(STATUS "CMAKE_OSX_SYSROOT = '${CMAKE_OSX_SYSROOT}'") + # set(LL_SKIP_REQUIRE_SYSROOT OFF CACHE BOOL "Skip requirement to set toolchain sysroot ahead of time. Not skipped by default for consistency, but skipping can be useful for selecting alternative xcode versions side by side") + # if("$ENV{LL_SKIP_REQUIRE_SYSROOT}" STREQUAL "" AND NOT ${LL_SKIP_REQUIRE_SYSROOT}) + # string(REGEX MATCHALL "[^ ]+" LL_BUILD_LIST "$ENV{LL_BUILD}") + # list(FIND LL_BUILD_LIST "-iwithsysroot" sysroot_idx) + # if ("${sysroot_idx}" LESS 0) + # message(FATAL_ERROR "Environment variable LL_BUILD must contain '-iwithsysroot'") + # endif () + # math(EXPR sysroot_idx "${sysroot_idx} + 1") + # list(GET LL_BUILD_LIST "${sysroot_idx}" CMAKE_OSX_SYSROOT) + # endif() + # message(STATUS "CMAKE_OSX_SYSROOT = '${CMAKE_OSX_SYSROOT}'") - set(CMAKE_XCODE_ATTRIBUTE_GCC_VERSION "com.apple.compilers.llvm.clang.1_0") set(CMAKE_XCODE_ATTRIBUTE_GCC_STRICT_ALIASING NO) set(CMAKE_XCODE_ATTRIBUTE_GCC_FAST_MATH NO) - set(CMAKE_XCODE_ATTRIBUTE_CLANG_X86_VECTOR_INSTRUCTIONS ssse3) + set(CMAKE_XCODE_ATTRIBUTE_CLANG_X86_VECTOR_INSTRUCTIONS sse4.2) # we must hard code this to off for now. xcode's built in signing does not # handle embedded app bundles such as CEF and others. Any signing for local # development must be done after the build as we do in viewer_manifest.py for diff --git a/indra/doxygen/CMakeLists.txt b/indra/doxygen/CMakeLists.txt index 616b5cd09c..43ebf4ae26 100644 --- a/indra/doxygen/CMakeLists.txt +++ b/indra/doxygen/CMakeLists.txt @@ -1,19 +1,5 @@ # -*- cmake -*- -# cmake_minimum_required should appear before any -# other commands to guarantee full compatibility -# with the version specified -## prior to 2.8, the add_custom_target commands used in setting the version did not work correctly -cmake_minimum_required(VERSION 3.8.0 FATAL_ERROR) - -set(ROOT_PROJECT_NAME "SecondLife" CACHE STRING - "The root project/makefile/solution name. Defaults to SecondLife.") -project(${ROOT_PROJECT_NAME}) - -set(CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake") - -include(Variables) - # add a target to generate API documentation with Doxygen find_package(Doxygen) if(DOXYGEN_FOUND) diff --git a/indra/llwindow/CMakeLists.txt b/indra/llwindow/CMakeLists.txt index 2996f58fe0..006132b0ba 100644 --- a/indra/llwindow/CMakeLists.txt +++ b/indra/llwindow/CMakeLists.txt @@ -63,8 +63,8 @@ set(llwindow_LINK_LIBRARIES # Libraries on which this library depends, needed for Linux builds # Sort by high-level to low-level if (LINUX) - list(APPEND viewer_SOURCE_FILES - llkeyboardsdl.cpp + list(APPEND viewer_SOURCE_FILES + llkeyboardsdl.cpp llwindowsdl.cpp ) list(APPEND viewer_HEADER_FILES @@ -180,9 +180,8 @@ endif (SDL_FOUND) target_link_libraries (llwindow ${llwindow_LINK_LIBRARIES}) target_include_directories(llwindow INTERFACE ${CMAKE_CURRENT_SOURCE_DIR}) - + if (DARWIN) - include(CMakeFindFrameworks) find_library(CARBON_LIBRARY Carbon) target_link_libraries(llwindow ${CARBON_LIBRARY}) endif (DARWIN) -- cgit v1.2.3 From 6fcd349f374710a3f4e0e0585bb6d7af86ebb66d Mon Sep 17 00:00:00 2001 From: Rye Date: Sun, 2 Feb 2025 02:43:46 -0500 Subject: Fix Tracy memory profiling overloads for aligned allocations Fix disabling renderdoc support Improve ll_aligned_alloc functions on darwin for 32 and 64byte aligned by utilizing posix_memalign --- autobuild.xml | 14 +++---- indra/cmake/CMakeLists.txt | 1 + indra/cmake/Tracy.cmake | 6 +-- indra/llcommon/linden_common.h | 6 --- indra/llcommon/llcommon.cpp | 72 ++++++++++++++++---------------- indra/llcommon/llmemory.h | 49 +++++++++++++++++----- indra/llcommon/llprofiler.h | 32 +++++--------- indra/llrender/llglslshader.cpp | 4 +- indra/llrender/llglslshader.h | 4 +- indra/llrender/llvertexbuffer.cpp | 2 +- indra/llrender/llvertexbuffer.h | 4 +- indra/llwindow/llwindowwin32.cpp | 7 +++- indra/newview/llappviewer.cpp | 37 ++++++++-------- indra/newview/llappviewerlinux.cpp | 5 +++ indra/newview/llappviewermacosx.cpp | 5 +++ indra/newview/lldrawpool.h | 4 +- indra/newview/llheroprobemanager.cpp | 11 +++-- indra/newview/llreflectionmapmanager.cpp | 4 ++ indra/newview/llviewerdisplay.cpp | 2 + indra/newview/pipeline.cpp | 21 ++++++---- 20 files changed, 166 insertions(+), 124 deletions(-) diff --git a/autobuild.xml b/autobuild.xml index c3df05a223..653762da9e 100644 --- a/autobuild.xml +++ b/autobuild.xml @@ -2433,11 +2433,11 @@ Copyright (c) 2012, 2014, 2015, 2016 nghttp2 contributors archive hash - 226225ec049826c35adc5e897e0398ed64d4bedb + 0c3d01b7e9e39c23f0f40c56a1a04d1fba08ead0 hash_algorithm sha1 url - https://github.com/secondlife/3p-tracy/releases/download/v0.11.0%2Br1/tracy-v0.11.0.10376230034-darwin64-10376230034.tar.zst + https://github.com/secondlife/3p-tracy/releases/download/v0.11.1-r1/tracy-v0.11.1.11706699176-darwin64-11706699176.tar.zst name darwin64 @@ -2447,11 +2447,11 @@ Copyright (c) 2012, 2014, 2015, 2016 nghttp2 contributors archive hash - 8c5429d1a1486f40cf7e5e88a232222d1fa4f78e + b46cef5646a8d0471ab6256fe5119220fa238772 hash_algorithm sha1 url - https://github.com/secondlife/3p-tracy/releases/download/v0.11.0%2Br1/tracy-v0.11.0.10376230034-windows64-10376230034.tar.zst + https://github.com/secondlife/3p-tracy/releases/download/v0.11.1-r1/tracy-v0.11.1.11706699176-windows64-11706699176.tar.zst name windows64 @@ -2461,11 +2461,11 @@ Copyright (c) 2012, 2014, 2015, 2016 nghttp2 contributors archive hash - ed0664a009aba1dcf1246d845839f524e857162e + beab04c9ea6036b1851a485b65c66cf6a38f0be4 hash_algorithm sha1 url - https://github.com/secondlife/3p-tracy/releases/download/v0.11.0%2Br1/tracy-v0.11.0.10376230034-linux64-10376230034.tar.zst + https://github.com/secondlife/3p-tracy/releases/download/v0.11.1-r1/tracy-v0.11.1.11706699176-linux64-11706699176.tar.zst name linux64 @@ -2478,7 +2478,7 @@ Copyright (c) 2012, 2014, 2015, 2016 nghttp2 contributors copyright Copyright (c) 2017-2024, Bartosz Taudul (wolf@nereid.pl) version - v0.11.0.10376230034 + v0.11.1.11706699176 name tracy canonical_repo diff --git a/indra/cmake/CMakeLists.txt b/indra/cmake/CMakeLists.txt index cc217b0563..8d55cc4bbe 100644 --- a/indra/cmake/CMakeLists.txt +++ b/indra/cmake/CMakeLists.txt @@ -55,6 +55,7 @@ set(cmake_SOURCE_FILES TemplateCheck.cmake TinyEXR.cmake TinyGLTF.cmake + Tracy.cmake Tut.cmake UI.cmake UnixInstall.cmake diff --git a/indra/cmake/Tracy.cmake b/indra/cmake/Tracy.cmake index a7eac2711f..cb09337d15 100644 --- a/indra/cmake/Tracy.cmake +++ b/indra/cmake/Tracy.cmake @@ -15,6 +15,7 @@ endif() if (USE_TRACY) option(USE_TRACY_ON_DEMAND "Use on-demand Tracy profiling." ON) option(USE_TRACY_LOCAL_ONLY "Disallow remote Tracy profiling." OFF) + option(USE_TRACY_GPU "Use Tracy GPU profiling" OFF) use_system_binary(tracy) use_prebuilt_binary(tracy) @@ -31,9 +32,8 @@ if (USE_TRACY) target_compile_definitions(ll::tracy INTERFACE -DTRACY_NO_BROADCAST=1 -DTRACY_ONLY_LOCALHOST=1) endif () - # GHA runners don't always provide invariant TSC support, but always build with LL_TESTS enabled - if (DARWIN AND LL_TESTS) - target_compile_definitions(ll::tracy INTERFACE -DTRACY_TIMER_FALLBACK=1) + if (USE_TRACY_GPU AND NOT DARWIN) # Tracy OpenGL mode is incompatible with macOS/iOS + target_compile_definitions(ll::tracy INTERFACE -DLL_PROFILER_ENABLE_TRACY_OPENGL=1) endif () # See: indra/llcommon/llprofiler.h diff --git a/indra/llcommon/linden_common.h b/indra/llcommon/linden_common.h index a918caa2e8..a41af153fe 100644 --- a/indra/llcommon/linden_common.h +++ b/indra/llcommon/linden_common.h @@ -28,12 +28,6 @@ #define LL_LINDEN_COMMON_H #include "llprofiler.h" -#if TRACY_ENABLE && !defined(LL_PROFILER_ENABLE_TRACY_OPENGL) // hooks for memory profiling -void *tracy_aligned_malloc(size_t size, size_t alignment); -void tracy_aligned_free(void *memblock); -#define _aligned_malloc(X, Y) tracy_aligned_malloc((X), (Y)) -#define _aligned_free(X) tracy_aligned_free((X)) -#endif // *NOTE: Please keep includes here to a minimum! // diff --git a/indra/llcommon/llcommon.cpp b/indra/llcommon/llcommon.cpp index 84b35749cc..7a22eaf203 100644 --- a/indra/llcommon/llcommon.cpp +++ b/indra/llcommon/llcommon.cpp @@ -33,23 +33,23 @@ #include "lltracethreadrecorder.h" #include "llcleanup.h" -thread_local bool gProfilerEnabled = false; - -#if (TRACY_ENABLE) +#if LL_PROFILER_CONFIGURATION >= LL_PROFILER_CONFIG_TRACY && TRACY_ENABLE // Override new/delete for tracy memory profiling void* ll_tracy_new(size_t size) { - void* ptr; - if (gProfilerEnabled) - { - //LL_PROFILE_ZONE_SCOPED_CATEGORY_MEMORY; - ptr = (malloc)(size); - } - else + void* ptr = (malloc)(size); + if (!ptr) { - ptr = (malloc)(size); + throw std::bad_alloc(); } + LL_PROFILE_ALLOC(ptr, size); + return ptr; +} + +void* ll_tracy_aligned_new(size_t size, size_t alignment) +{ + void* ptr = ll_aligned_malloc_fallback(size, alignment); if (!ptr) { throw std::bad_alloc(); @@ -58,6 +58,18 @@ void* ll_tracy_new(size_t size) return ptr; } +void ll_tracy_delete(void* ptr) +{ + LL_PROFILE_FREE(ptr); + (free)(ptr); +} + +void ll_tracy_aligned_delete(void* ptr) +{ + LL_PROFILE_FREE(ptr); + ll_aligned_free_fallback(ptr); +} + void* operator new(size_t size) { return ll_tracy_new(size); @@ -68,18 +80,14 @@ void* operator new[](std::size_t count) return ll_tracy_new(count); } -void ll_tracy_delete(void* ptr) +void* operator new(size_t size, std::align_val_t align) { - LL_PROFILE_FREE(ptr); - if (gProfilerEnabled) - { - //LL_PROFILE_ZONE_SCOPED_CATEGORY_MEMORY; - (free)(ptr); - } - else - { - (free)(ptr); - } + return ll_tracy_aligned_new(size, (size_t)align); +} + +void* operator new[](std::size_t count, std::align_val_t align) +{ + return ll_tracy_aligned_new(count, (size_t)align); } void operator delete(void *ptr) noexcept @@ -92,27 +100,17 @@ void operator delete[](void* ptr) noexcept ll_tracy_delete(ptr); } -// C-style malloc/free can't be so easily overridden, so we define tracy versions and use -// a pre-processor #define in linden_common.h to redirect to them. The parens around the native -// functions below prevents recursive substitution by the preprocessor. -// -// Unaligned mallocs are rare in LL code but hooking them causes problems in 3p lib code (looking at -// you, Havok), so we'll only capture the aligned version. - -void *tracy_aligned_malloc(size_t size, size_t alignment) +void operator delete(void *ptr, std::align_val_t align) noexcept { - auto ptr = ll_aligned_malloc_fallback(size, alignment); - if (ptr) LL_PROFILE_ALLOC(ptr, size); - return ptr; + ll_tracy_aligned_delete(ptr); } -void tracy_aligned_free(void *memblock) +void operator delete[](void* ptr, std::align_val_t align) noexcept { - LL_PROFILE_FREE(memblock); - ll_aligned_free_fallback(memblock); + ll_tracy_aligned_delete(ptr); } -#endif +#endif // TRACY_ENABLE && !LL_PROFILER_ENABLE_TRACY_OPENGL //static bool LLCommon::sAprInitialized = false; diff --git a/indra/llcommon/llmemory.h b/indra/llcommon/llmemory.h index b616edfde7..72aec57080 100644 --- a/indra/llcommon/llmemory.h +++ b/indra/llcommon/llmemory.h @@ -231,8 +231,6 @@ inline void* ll_aligned_malloc_32(size_t size) // returned hunk MUST be freed wi LL_PROFILE_ZONE_SCOPED_CATEGORY_MEMORY; #if defined(LL_WINDOWS) void* ret = _aligned_malloc(size, 32); -#elif defined(LL_DARWIN) - void* ret = ll_aligned_malloc_fallback( size, 32 ); #else void *ret; if (0 != posix_memalign(&ret, 32, size)) @@ -248,8 +246,31 @@ inline void ll_aligned_free_32(void *p) LL_PROFILE_FREE(p); #if defined(LL_WINDOWS) _aligned_free(p); -#elif defined(LL_DARWIN) - ll_aligned_free_fallback( p ); +#else + free(p); // posix_memalign() is compatible with heap deallocator +#endif +} + +inline void* ll_aligned_malloc_64(size_t size) // returned hunk MUST be freed with ll_aligned_free_32(). +{ + LL_PROFILE_ZONE_SCOPED_CATEGORY_MEMORY; +#if defined(LL_WINDOWS) + void* ret = _aligned_malloc(size, 64); +#else + void *ret; + if (0 != posix_memalign(&ret, 64, size)) + return nullptr; +#endif + LL_PROFILE_ALLOC(ret, size); + return ret; +} + +inline void ll_aligned_free_64(void *p) +{ + LL_PROFILE_ZONE_SCOPED_CATEGORY_MEMORY; + LL_PROFILE_FREE(p); +#if defined(LL_WINDOWS) + _aligned_free(p); #else free(p); // posix_memalign() is compatible with heap deallocator #endif @@ -261,19 +282,23 @@ LL_FORCE_INLINE void* ll_aligned_malloc(size_t size) { LL_PROFILE_ZONE_SCOPED_CATEGORY_MEMORY; void* ret; - if (LL_DEFAULT_HEAP_ALIGN % ALIGNMENT == 0) + if constexpr (LL_DEFAULT_HEAP_ALIGN % ALIGNMENT == 0) { ret = malloc(size); LL_PROFILE_ALLOC(ret, size); } - else if (ALIGNMENT == 16) + else if constexpr (ALIGNMENT == 16) { ret = ll_aligned_malloc_16(size); } - else if (ALIGNMENT == 32) + else if constexpr (ALIGNMENT == 32) { ret = ll_aligned_malloc_32(size); } + else if constexpr (ALIGNMENT == 64) + { + ret = ll_aligned_malloc_64(size); + } else { ret = ll_aligned_malloc_fallback(size, ALIGNMENT); @@ -285,16 +310,20 @@ template LL_FORCE_INLINE void ll_aligned_free(void* ptr) { LL_PROFILE_ZONE_SCOPED_CATEGORY_MEMORY; - if (ALIGNMENT == LL_DEFAULT_HEAP_ALIGN) + if constexpr (ALIGNMENT == LL_DEFAULT_HEAP_ALIGN) { LL_PROFILE_FREE(ptr); free(ptr); } - else if (ALIGNMENT == 16) + else if constexpr (ALIGNMENT == 16) { ll_aligned_free_16(ptr); } - else if (ALIGNMENT == 32) + else if constexpr (ALIGNMENT == 32) + { + return ll_aligned_free_32(ptr); + } + else if constexpr (ALIGNMENT == 64) { return ll_aligned_free_32(ptr); } diff --git a/indra/llcommon/llprofiler.h b/indra/llcommon/llprofiler.h index f6a4d24747..5fb32d6280 100644 --- a/indra/llcommon/llprofiler.h +++ b/indra/llcommon/llprofiler.h @@ -74,23 +74,18 @@ #define LL_PROFILER_CONFIGURATION LL_PROFILER_CONFIG_FAST_TIMER #endif -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 #include "tracy/Tracy.hpp" - // Enable OpenGL profiling - #define LL_PROFILER_ENABLE_TRACY_OPENGL 0 - // Enable RenderDoc labeling - #define LL_PROFILER_ENABLE_RENDER_DOC 0 + //#define LL_PROFILER_ENABLE_RENDER_DOC 0 #endif #if LL_PROFILER_CONFIGURATION == LL_PROFILER_CONFIG_TRACY #define LL_PROFILER_FRAME_END FrameMark - #define LL_PROFILER_SET_THREAD_NAME( name ) tracy::SetThreadName( name ); gProfilerEnabled = true; + #define LL_PROFILER_SET_THREAD_NAME( name ) tracy::SetThreadName( name ); #define LL_RECORD_BLOCK_TIME(name) ZoneScoped // Want descriptive names; was: ZoneNamedN( ___tracy_scoped_zone, #name, true ); #define LL_PROFILE_ZONE_NAMED(name) ZoneNamedN( ___tracy_scoped_zone, name, true ); #define LL_PROFILE_ZONE_NAMED_COLOR(name,color) ZoneNamedNC( ___tracy_scopped_zone, name, color, true ) // RGB @@ -133,7 +128,7 @@ extern thread_local bool gProfilerEnabled; #endif #if LL_PROFILER_CONFIGURATION == LL_PROFILER_CONFIG_TRACY_FAST_TIMER #define LL_PROFILER_FRAME_END FrameMark - #define LL_PROFILER_SET_THREAD_NAME( name ) tracy::SetThreadName( name ); gProfilerEnabled = true; + #define LL_PROFILER_SET_THREAD_NAME( name ) tracy::SetThreadName( name ); #define LL_RECORD_BLOCK_TIME(name) ZoneNamedN(___tracy_scoped_zone, #name, true); const LLTrace::BlockTimer& LL_GLUE_TOKENS(block_time_recorder, __LINE__)(LLTrace::timeThisBlock(name)); (void)LL_GLUE_TOKENS(block_time_recorder, __LINE__); #define LL_PROFILE_ZONE_NAMED(name) ZoneNamedN( ___tracy_scoped_zone, #name, true ); #define LL_PROFILE_ZONE_NAMED_COLOR(name,color) ZoneNamedNC( ___tracy_scopped_zone, name, color, true ) // RGB @@ -158,23 +153,20 @@ extern thread_local bool gProfilerEnabled; #endif // LL_PROFILER #if LL_PROFILER_ENABLE_TRACY_OPENGL -#define LL_PROFILE_GPU_ZONE(name) TracyGpuZone(name) -#define LL_PROFILE_GPU_ZONEC(name,color) TracyGpuZoneC(name,color) +#define LL_PROFILE_GPU_ZONE(name) TracyGpuZone(name) +#define LL_PROFILE_GPU_ZONEC(name,color) TracyGpuZoneC(name,color) #define LL_PROFILER_GPU_COLLECT TracyGpuCollect #define LL_PROFILER_GPU_CONTEXT TracyGpuContext - -// disable memory tracking (incompatible with GPU tracing -#define LL_PROFILE_ALLOC(ptr, size) (void)(ptr); (void)(size); -#define LL_PROFILE_FREE(ptr) (void)(ptr); +#define LL_PROFILER_GPU_CONTEXT_NAMED TracyGpuContextName #else -#define LL_PROFILE_GPU_ZONE(name) (void)name; -#define LL_PROFILE_GPU_ZONEC(name,color) (void)name;(void)color; +#define LL_PROFILE_GPU_ZONE(name) (void)name; +#define LL_PROFILE_GPU_ZONEC(name,color) (void)name;(void)color; #define LL_PROFILER_GPU_COLLECT #define LL_PROFILER_GPU_CONTEXT +#define LL_PROFILER_GPU_CONTEXT_NAMED(name) (void)name; +#endif // LL_PROFILER_ENABLE_TRACY_OPENGL -#define LL_LABEL_OBJECT_GL(type, name, length, label) - -#if !LL_DARWIN && LL_PROFILER_CONFIGURATION > 1 +#if LL_PROFILER_CONFIGURATION >= LL_PROFILER_CONFIG_TRACY #define LL_PROFILE_ALLOC(ptr, size) TracyAlloc(ptr, size) #define LL_PROFILE_FREE(ptr) TracyFree(ptr) #else @@ -182,8 +174,6 @@ extern thread_local bool gProfilerEnabled; #define LL_PROFILE_FREE(ptr) (void)(ptr); #endif -#endif - #if LL_PROFILER_ENABLE_RENDER_DOC #define LL_LABEL_OBJECT_GL(type, name, length, label) glObjectLabel(type, name, length, label) #else diff --git a/indra/llrender/llglslshader.cpp b/indra/llrender/llglslshader.cpp index b3f32fdc83..0841c0e943 100644 --- a/indra/llrender/llglslshader.cpp +++ b/indra/llrender/llglslshader.cpp @@ -543,7 +543,7 @@ bool LLGLSLShader::createShader() } } -#ifdef LL_PROFILER_ENABLE_RENDER_DOC +#if LL_PROFILER_ENABLE_RENDER_DOC setLabel(mName.c_str()); #endif @@ -2061,7 +2061,7 @@ LLUUID LLGLSLShader::hash() return hash_obj.digest(); } -#ifdef LL_PROFILER_ENABLE_RENDER_DOC +#if LL_PROFILER_ENABLE_RENDER_DOC void LLGLSLShader::setLabel(const char* label) { LL_LABEL_OBJECT_GL(GL_PROGRAM, mProgramObject, strlen(label), label); } diff --git a/indra/llrender/llglslshader.h b/indra/llrender/llglslshader.h index 58c456f134..cade888a83 100644 --- a/indra/llrender/llglslshader.h +++ b/indra/llrender/llglslshader.h @@ -360,7 +360,7 @@ public: // hacky flag used for optimization in LLDrawPoolAlpha bool mCanBindFast = false; -#ifdef LL_PROFILER_ENABLE_RENDER_DOC +#if LL_PROFILER_ENABLE_RENDER_DOC void setLabel(const char* label); #endif @@ -380,7 +380,7 @@ extern LLGLSLShader gSolidColorProgram; //Alpha mask shader (declared here so llappearance can access properly) extern LLGLSLShader gAlphaMaskProgram; -#ifdef LL_PROFILER_ENABLE_RENDER_DOC +#if LL_PROFILER_ENABLE_RENDER_DOC #define LL_SET_SHADER_LABEL(shader) shader.setLabel(#shader) #else #define LL_SET_SHADER_LABEL(shader, label) diff --git a/indra/llrender/llvertexbuffer.cpp b/indra/llrender/llvertexbuffer.cpp index 1f0c424188..86ec9a453b 100644 --- a/indra/llrender/llvertexbuffer.cpp +++ b/indra/llrender/llvertexbuffer.cpp @@ -885,7 +885,7 @@ bool LLVertexBuffer::validateRange(U32 start, U32 end, U32 count, U32 indices_of return true; } -#ifdef LL_PROFILER_ENABLE_RENDER_DOC +#if LL_PROFILER_ENABLE_RENDER_DOC void LLVertexBuffer::setLabel(const char* label) { LL_LABEL_OBJECT_GL(GL_BUFFER, mGLBuffer, strlen(label), label); } diff --git a/indra/llrender/llvertexbuffer.h b/indra/llrender/llvertexbuffer.h index 375ad76fb8..faaa6ba0f0 100644 --- a/indra/llrender/llvertexbuffer.h +++ b/indra/llrender/llvertexbuffer.h @@ -279,7 +279,7 @@ public: //for debugging, validate data in given range is valid bool validateRange(U32 start, U32 end, U32 count, U32 offset) const; - #ifdef LL_PROFILER_ENABLE_RENDER_DOC + #if LL_PROFILER_ENABLE_RENDER_DOC void setLabel(const char* label); #endif @@ -340,7 +340,7 @@ public: static U32 sVertexCount; }; -#ifdef LL_PROFILER_ENABLE_RENDER_DOC +#if LL_PROFILER_ENABLE_RENDER_DOC #define LL_LABEL_VERTEX_BUFFER(buf, name) buf->setLabel(name) #else #define LL_LABEL_VERTEX_BUFFER(buf, name) diff --git a/indra/llwindow/llwindowwin32.cpp b/indra/llwindow/llwindowwin32.cpp index 832cf254d1..90713a6653 100644 --- a/indra/llwindow/llwindowwin32.cpp +++ b/indra/llwindow/llwindowwin32.cpp @@ -1666,6 +1666,11 @@ const S32 max_format = (S32)num_formats - 1; return false; } + // Setup Tracy gpu context + { + LL_PROFILER_GPU_CONTEXT; + } + // Disable vertical sync for swap toggleVSync(enable_vsync); @@ -1697,8 +1702,6 @@ const S32 max_format = (S32)num_formats - 1; swapBuffers(); } - LL_PROFILER_GPU_CONTEXT; - return true; } diff --git a/indra/newview/llappviewer.cpp b/indra/newview/llappviewer.cpp index 9889765fff..84cce2348a 100644 --- a/indra/newview/llappviewer.cpp +++ b/indra/newview/llappviewer.cpp @@ -1324,6 +1324,7 @@ bool LLAppViewer::frame() bool LLAppViewer::doFrame() { LL_RECORD_BLOCK_TIME(FTM_FRAME); + LL_PROFILE_GPU_ZONE("Frame"); { // and now adjust the visuals from previous frame. if(LLPerfStats::tunables.userAutoTuneEnabled && LLPerfStats::tunables.tuningFlag != LLPerfStats::Tunables::Nothing) @@ -1413,24 +1414,26 @@ bool LLAppViewer::doFrame() if (!LLApp::isExiting()) { - LL_PROFILE_ZONE_NAMED_CATEGORY_APP("df JoystickKeyboard"); - pingMainloopTimeout("Main:JoystickKeyboard"); - - // Scan keyboard for movement keys. Command keys and typing - // are handled by windows callbacks. Don't do this until we're - // done initializing. JC - if (gViewerWindow - && (gHeadlessClient || gViewerWindow->getWindow()->getVisible()) - && gViewerWindow->getActive() - && !gViewerWindow->getWindow()->getMinimized() - && LLStartUp::getStartupState() == STATE_STARTED - && (gHeadlessClient || !gViewerWindow->getShowProgress()) - && !gFocusMgr.focusLocked()) { - LLPerfStats::RecordSceneTime T (LLPerfStats::StatType_t::RENDER_IDLE); - joystick->scanJoystick(); - gKeyboard->scanKeyboard(); - gViewerInput.scanMouse(); + LL_PROFILE_ZONE_NAMED_CATEGORY_APP("df JoystickKeyboard"); + pingMainloopTimeout("Main:JoystickKeyboard"); + + // Scan keyboard for movement keys. Command keys and typing + // are handled by windows callbacks. Don't do this until we're + // done initializing. JC + if (gViewerWindow + && (gHeadlessClient || gViewerWindow->getWindow()->getVisible()) + && gViewerWindow->getActive() + && !gViewerWindow->getWindow()->getMinimized() + && LLStartUp::getStartupState() == STATE_STARTED + && (gHeadlessClient || !gViewerWindow->getShowProgress()) + && !gFocusMgr.focusLocked()) + { + LLPerfStats::RecordSceneTime T(LLPerfStats::StatType_t::RENDER_IDLE); + joystick->scanJoystick(); + gKeyboard->scanKeyboard(); + gViewerInput.scanMouse(); + } } // Update state based on messages, user input, object idle. diff --git a/indra/newview/llappviewerlinux.cpp b/indra/newview/llappviewerlinux.cpp index 1709970156..89d19d180b 100644 --- a/indra/newview/llappviewerlinux.cpp +++ b/indra/newview/llappviewerlinux.cpp @@ -73,6 +73,11 @@ static void exceptionTerminateHandler() int main( int argc, char **argv ) { + // Call Tracy first thing to have it allocate memory + // https://github.com/wolfpld/tracy/issues/196 + LL_PROFILER_FRAME_END; + LL_PROFILER_SET_THREAD_NAME("App"); + gArgC = argc; gArgV = argv; diff --git a/indra/newview/llappviewermacosx.cpp b/indra/newview/llappviewermacosx.cpp index 4162c0479a..f497a3cdf3 100644 --- a/indra/newview/llappviewermacosx.cpp +++ b/indra/newview/llappviewermacosx.cpp @@ -231,6 +231,11 @@ void infos(const std::string& message) int main( int argc, char **argv ) { + // Call Tracy first thing to have it allocate memory + // https://github.com/wolfpld/tracy/issues/196 + LL_PROFILER_FRAME_END; + LL_PROFILER_SET_THREAD_NAME("App"); + // Store off the command line args for use later. gArgC = argc; gArgV = argv; diff --git a/indra/newview/lldrawpool.h b/indra/newview/lldrawpool.h index 1c8864a9df..46696fc4a4 100644 --- a/indra/newview/lldrawpool.h +++ b/indra/newview/lldrawpool.h @@ -204,7 +204,7 @@ public: NUM_RENDER_TYPES, }; - #ifdef LL_PROFILER_ENABLE_RENDER_DOC + #if LL_PROFILER_ENABLE_RENDER_DOC static inline const char* lookupPassName(U32 pass) { switch (pass) @@ -340,7 +340,7 @@ public: } } #else - static inline const char* lookupPass(U32 pass) { return ""; } + static inline const char* lookupPassName(U32 pass) { return ""; } #endif LLRenderPass(const U32 type); diff --git a/indra/newview/llheroprobemanager.cpp b/indra/newview/llheroprobemanager.cpp index e754de2fd1..2ec161c093 100644 --- a/indra/newview/llheroprobemanager.cpp +++ b/indra/newview/llheroprobemanager.cpp @@ -81,6 +81,7 @@ void LLHeroProbeManager::update() } LL_PROFILE_ZONE_SCOPED_CATEGORY_DISPLAY; + LL_PROFILE_GPU_ZONE("hero manager update"); llassert(!gCubeSnapshot); // assert a snapshot is not in progress if (LLAppViewer::instance()->logoutRequestSent()) { @@ -282,6 +283,9 @@ void LLHeroProbeManager::renderProbes() // In effect this simulates single-bounce lighting. void LLHeroProbeManager::updateProbeFace(LLReflectionMap* probe, U32 face, bool is_dynamic, F32 near_clip) { + LL_PROFILE_ZONE_SCOPED_CATEGORY_DISPLAY; + LL_PROFILE_GPU_ZONE("hero probe update"); + // hacky hot-swap of camera specific render targets gPipeline.mRT = &gPipeline.mHeroProbeRT; @@ -352,7 +356,7 @@ void LLHeroProbeManager::updateProbeFace(LLReflectionMap* probe, U32 face, bool for (int i = 0; i < mMipChain.size(); ++i) { - LL_PROFILE_GPU_ZONE("probe mip"); + LL_PROFILE_GPU_ZONE("hero probe mip"); mMipChain[i].bindTarget(); if (i == 0) { @@ -379,7 +383,7 @@ void LLHeroProbeManager::updateProbeFace(LLReflectionMap* probe, U32 face, bool if (mip >= 0) { - LL_PROFILE_GPU_ZONE("probe mip copy"); + LL_PROFILE_GPU_ZONE("hero probe mip copy"); mTexture->bind(0); glCopyTexSubImage3D(GL_TEXTURE_CUBE_MAP_ARRAY, mip, 0, 0, sourceIdx * 6 + face, 0, 0, res, res); @@ -427,7 +431,7 @@ void LLHeroProbeManager::generateRadiance(LLReflectionMap* probe) for (int i = 0; i < mMipChain.size() / 4; ++i) { - LL_PROFILE_GPU_ZONE("probe radiance gen"); + LL_PROFILE_GPU_ZONE("hero probe radiance gen"); static LLStaticHashedString sMipLevel("mipLevel"); static LLStaticHashedString sRoughness("roughness"); static LLStaticHashedString sWidth("u_width"); @@ -474,6 +478,7 @@ void LLHeroProbeManager::updateUniforms() } LL_PROFILE_ZONE_SCOPED_CATEGORY_DISPLAY; + LL_PROFILE_GPU_ZONE("hpmu - uniforms") LLMatrix4a modelview; modelview.loadu(gGLModelView); diff --git a/indra/newview/llreflectionmapmanager.cpp b/indra/newview/llreflectionmapmanager.cpp index 4760ab376e..ae5ade5f24 100644 --- a/indra/newview/llreflectionmapmanager.cpp +++ b/indra/newview/llreflectionmapmanager.cpp @@ -210,6 +210,7 @@ void LLReflectionMapManager::update() } LL_PROFILE_ZONE_SCOPED_CATEGORY_DISPLAY; + LL_PROFILE_GPU_ZONE("reflection manager update"); llassert(!gCubeSnapshot); // assert a snapshot is not in progress if (LLAppViewer::instance()->logoutRequestSent()) { @@ -696,6 +697,8 @@ void LLReflectionMapManager::doProbeUpdate() // In effect this simulates single-bounce lighting. void LLReflectionMapManager::updateProbeFace(LLReflectionMap* probe, U32 face) { + LL_PROFILE_ZONE_SCOPED_CATEGORY_DISPLAY; + LL_PROFILE_GPU_ZONE("probe update"); // hacky hot-swap of camera specific render targets gPipeline.mRT = &gPipeline.mAuxillaryRT; @@ -1011,6 +1014,7 @@ void LLReflectionMapManager::updateUniforms() } LL_PROFILE_ZONE_SCOPED_CATEGORY_DISPLAY; + LL_PROFILE_GPU_ZONE("rmmu - uniforms") // structure for packing uniform buffer object // see class3/deferred/reflectionProbeF.glsl diff --git a/indra/newview/llviewerdisplay.cpp b/indra/newview/llviewerdisplay.cpp index 32019f860d..b34c8600f7 100644 --- a/indra/newview/llviewerdisplay.cpp +++ b/indra/newview/llviewerdisplay.cpp @@ -407,6 +407,7 @@ static void update_tp_display(bool minimized) void display(bool rebuild, F32 zoom_factor, int subfield, bool for_snapshot) { LL_PROFILE_ZONE_NAMED_CATEGORY_DISPLAY("Render"); + LL_PROFILE_GPU_ZONE("Render"); LLPerfStats::RecordSceneTime T (LLPerfStats::StatType_t::RENDER_DISPLAY); // render time capture - This is the main stat for overall rendering. @@ -709,6 +710,7 @@ void display(bool rebuild, F32 zoom_factor, int subfield, bool for_snapshot) if (gPipeline.RenderMirrors && !gSnapshot) { LL_PROFILE_ZONE_NAMED_CATEGORY_DISPLAY("Update hero probes"); + LL_PROFILE_GPU_ZONE("hero manager") gPipeline.mHeroProbeManager.update(); gPipeline.mHeroProbeManager.renderProbes(); } diff --git a/indra/newview/pipeline.cpp b/indra/newview/pipeline.cpp index 18dd694246..ddfb5a5621 100644 --- a/indra/newview/pipeline.cpp +++ b/indra/newview/pipeline.cpp @@ -7182,11 +7182,11 @@ extern LLPointer gEXRImage; void LLPipeline::tonemap(LLRenderTarget* src, LLRenderTarget* dst) { + LL_PROFILE_GPU_ZONE("tonemap"); + dst->bindTarget(); // gamma correct lighting { - LL_PROFILE_GPU_ZONE("tonemap"); - static LLCachedControl buildNoPost(gSavedSettings, "RenderDisablePostProcessing", false); LLGLDepthTest depth(GL_FALSE, GL_FALSE); @@ -7235,11 +7235,11 @@ void LLPipeline::tonemap(LLRenderTarget* src, LLRenderTarget* dst) void LLPipeline::gammaCorrect(LLRenderTarget* src, LLRenderTarget* dst) { + LL_PROFILE_GPU_ZONE("gamma correct"); + dst->bindTarget(); // gamma correct lighting { - LL_PROFILE_GPU_ZONE("gamma correct"); - LLGLDepthTest depth(GL_FALSE, GL_FALSE); static LLCachedControl buildNoPost(gSavedSettings, "RenderDisablePostProcessing", false); @@ -7290,9 +7290,9 @@ void LLPipeline::copyScreenSpaceReflections(LLRenderTarget* src, LLRenderTarget* void LLPipeline::generateGlow(LLRenderTarget* src) { + LL_PROFILE_GPU_ZONE("glow generate"); if (sRenderGlow) { - LL_PROFILE_GPU_ZONE("glow"); mGlow[2].bindTarget(); mGlow[2].clear(); @@ -7401,6 +7401,7 @@ void LLPipeline::generateGlow(LLRenderTarget* src) void LLPipeline::applyCAS(LLRenderTarget* src, LLRenderTarget* dst) { static LLCachedControl cas_sharpness(gSavedSettings, "RenderCASSharpness", 0.4f); + LL_PROFILE_GPU_ZONE("cas"); if (cas_sharpness == 0.0f || !gCASProgram.isComplete()) { gPipeline.copyRenderTarget(src, dst); @@ -7445,6 +7446,7 @@ void LLPipeline::applyCAS(LLRenderTarget* src, LLRenderTarget* dst) void LLPipeline::applyFXAA(LLRenderTarget* src, LLRenderTarget* dst) { + LL_PROFILE_GPU_ZONE("FXAA"); { llassert(!gCubeSnapshot); bool multisample = RenderFSAAType == 1 && gFXAAProgram[0].isComplete() && mFXAAMap.isComplete(); @@ -7536,7 +7538,7 @@ void LLPipeline::generateSMAABuffers(LLRenderTarget* src) // Present everything. if (multisample) { - LL_PROFILE_GPU_ZONE("aa"); + LL_PROFILE_GPU_ZONE("SMAA Edge"); static LLCachedControl aa_quality(gSavedSettings, "RenderFSAASamples", 0U); U32 fsaa_quality = std::clamp(aa_quality(), 0U, 3U); @@ -7648,13 +7650,13 @@ void LLPipeline::generateSMAABuffers(LLRenderTarget* src) void LLPipeline::applySMAA(LLRenderTarget* src, LLRenderTarget* dst) { + LL_PROFILE_GPU_ZONE("SMAA"); llassert(!gCubeSnapshot); bool multisample = RenderFSAAType == 2 && gSMAAEdgeDetectProgram[0].isComplete() && mFXAAMap.isComplete() && mSMAABlendBuffer.isComplete(); // Present everything. if (multisample) { - LL_PROFILE_GPU_ZONE("aa"); static LLCachedControl aa_quality(gSavedSettings, "RenderFSAASamples", 0U); U32 fsaa_quality = std::clamp(aa_quality(), 0U, 3U); @@ -7732,8 +7734,9 @@ void LLPipeline::copyRenderTarget(LLRenderTarget* src, LLRenderTarget* dst) void LLPipeline::combineGlow(LLRenderTarget* src, LLRenderTarget* dst) { - // Go ahead and do our glow combine here in our destination. We blit this later into the front buffer. + LL_PROFILE_GPU_ZONE("glow combine"); + // Go ahead and do our glow combine here in our destination. We blit this later into the front buffer. dst->bindTarget(); { @@ -7752,6 +7755,7 @@ void LLPipeline::combineGlow(LLRenderTarget* src, LLRenderTarget* dst) void LLPipeline::renderDoF(LLRenderTarget* src, LLRenderTarget* dst) { + LL_PROFILE_GPU_ZONE("dof"); { bool dof_enabled = (RenderDepthOfFieldInEditMode || !LLToolMgr::getInstance()->inBuildMode()) && @@ -7762,7 +7766,6 @@ void LLPipeline::renderDoF(LLRenderTarget* src, LLRenderTarget* dst) if (dof_enabled) { - LL_PROFILE_GPU_ZONE("dof"); LLGLDisable blend(GL_BLEND); // depth of field focal plane calculations -- cgit v1.2.3 From 39a13e4088db6e4023d196de07765363ddce2c4f Mon Sep 17 00:00:00 2001 From: Rye Date: Sun, 2 Feb 2025 03:40:21 -0500 Subject: Restore math types to trivially copyable and add static asserts --- indra/llmath/llbbox.h | 4 ++++ indra/llmath/llbboxlocal.h | 3 +++ indra/llmath/llcoordframe.cpp | 1 - indra/llmath/llline.h | 5 ++++- indra/llmath/llmatrix3a.h | 8 ++++++-- indra/llmath/llmatrix4a.h | 7 +++---- indra/llmath/llplane.h | 3 ++- indra/llmath/llquaternion.h | 4 ++++ indra/llmath/llquaternion2.h | 4 +++- indra/llmath/llrect.h | 8 ++++---- indra/llmath/llsimdtypes.h | 12 ++++++++---- indra/llmath/llvector4a.cpp | 2 ++ indra/llmath/llvector4a.h | 11 ++++------- indra/llmath/llvector4a.inl | 6 ------ indra/llmath/llvector4logical.h | 6 ++++-- indra/llmath/m3math.h | 4 ++++ indra/llmath/m4math.cpp | 4 ---- indra/llmath/m4math.h | 6 ++++-- indra/llmath/v2math.h | 3 +++ indra/llmath/v3color.h | 5 ++++- indra/llmath/v3dmath.h | 4 ++++ indra/llmath/v3math.h | 4 ++++ indra/llmath/v4color.h | 3 +++ indra/llmath/v4coloru.h | 3 +++ indra/llmath/v4math.h | 4 ++++ 25 files changed, 84 insertions(+), 40 deletions(-) diff --git a/indra/llmath/llbbox.h b/indra/llmath/llbbox.h index 5617eaebde..3a4e09a598 100644 --- a/indra/llmath/llbbox.h +++ b/indra/llmath/llbbox.h @@ -95,6 +95,10 @@ private: bool mEmpty; // Nothing has been added to this bbox yet }; +static_assert(std::is_trivially_copyable::value, "LLBBox must be trivial copy"); +static_assert(std::is_trivially_move_assignable::value, "LLBBox must be trivial move"); +static_assert(std::is_standard_layout::value, "LLBBox must be a standard layout type"); + //LLBBox operator*(const LLBBox &a, const LLMatrix4 &b); diff --git a/indra/llmath/llbboxlocal.h b/indra/llmath/llbboxlocal.h index e215e55460..f743bc0ee4 100644 --- a/indra/llmath/llbboxlocal.h +++ b/indra/llmath/llbboxlocal.h @@ -61,5 +61,8 @@ private: LLBBoxLocal operator*(const LLBBoxLocal &a, const LLMatrix4 &b); +static_assert(std::is_trivially_copyable::value, "LLBBoxLocal must be trivial copy"); +static_assert(std::is_trivially_move_assignable::value, "LLBBoxLocal must be trivial move"); +static_assert(std::is_standard_layout::value, "LLBBoxLocal must be a standard layout type"); #endif // LL_BBOXLOCAL_H diff --git a/indra/llmath/llcoordframe.cpp b/indra/llmath/llcoordframe.cpp index 4d6276b2cd..15c9f6ff3f 100644 --- a/indra/llmath/llcoordframe.cpp +++ b/indra/llmath/llcoordframe.cpp @@ -26,7 +26,6 @@ #include "linden_common.h" -//#include "vmath.h" #include "v3math.h" #include "m3math.h" #include "v4math.h" diff --git a/indra/llmath/llline.h b/indra/llmath/llline.h index 33c1eb61a4..2c66f2267d 100644 --- a/indra/llmath/llline.h +++ b/indra/llmath/llline.h @@ -40,7 +40,7 @@ class LLLine public: LLLine(); LLLine( const LLVector3& first_point, const LLVector3& second_point ); - virtual ~LLLine() {}; + ~LLLine() = default; void setPointDirection( const LLVector3& first_point, const LLVector3& second_point ); void setPoints( const LLVector3& first_point, const LLVector3& second_point ); @@ -76,5 +76,8 @@ protected: LLVector3 mDirection; }; +static_assert(std::is_trivially_copyable::value, "LLLine must be trivial copy"); +static_assert(std::is_trivially_move_assignable::value, "LLLine must be trivial move"); +static_assert(std::is_standard_layout::value, "LLLine must be a standard layout type"); #endif diff --git a/indra/llmath/llmatrix3a.h b/indra/llmath/llmatrix3a.h index dff6604ae5..9b173c22ed 100644 --- a/indra/llmath/llmatrix3a.h +++ b/indra/llmath/llmatrix3a.h @@ -56,7 +56,7 @@ public: ////////////////////////// // Ctor - LLMatrix3a() {} + LLMatrix3a() = default; // Ctor for setting by columns inline LLMatrix3a( const LLVector4a& c0, const LLVector4a& c1, const LLVector4a& c2 ); @@ -115,14 +115,18 @@ protected: }; +static_assert(std::is_trivial::value, "LLMatrix3a must be a trivial type"); + class LLRotation : public LLMatrix3a { public: - LLRotation() {} + LLRotation() = default; // Returns true if this rotation is orthonormal with det ~= 1 inline bool isOkRotation() const; }; +static_assert(std::is_trivial::value, "LLRotation must be a trivial type"); + #endif diff --git a/indra/llmath/llmatrix4a.h b/indra/llmath/llmatrix4a.h index 3b423f783a..377203098e 100644 --- a/indra/llmath/llmatrix4a.h +++ b/indra/llmath/llmatrix4a.h @@ -36,10 +36,7 @@ class LLMatrix4a public: LL_ALIGN_16(LLVector4a mMatrix[4]); - LLMatrix4a() - { - - } + LLMatrix4a() = default; explicit LLMatrix4a(const LLMatrix4& val) { @@ -228,6 +225,8 @@ public: const LLVector4a& getTranslation() const { return mMatrix[3]; } }; +static_assert(std::is_trivial::value, "LLMatrix4a must be a trivial type"); + inline LLVector4a rowMul(const LLVector4a &row, const LLMatrix4a &mat) { LLVector4a result; diff --git a/indra/llmath/llplane.h b/indra/llmath/llplane.h index 4e8546e32b..832004bb64 100644 --- a/indra/llmath/llplane.h +++ b/indra/llmath/llplane.h @@ -43,7 +43,7 @@ class LLPlane public: // Constructors - LLPlane() {}; // no default constructor + LLPlane() = default; LLPlane(const LLVector3 &p0, F32 d) { setVec(p0, d); } LLPlane(const LLVector3 &p0, const LLVector3 &n) { setVec(p0, n); } inline void setVec(const LLVector3 &p0, F32 d) { mV.set(p0[0], p0[1], p0[2], d); } @@ -104,6 +104,7 @@ private: LLVector4a mV; } LL_ALIGN_POSTFIX(16); +static_assert(std::is_trivial::value, "LLPlane must be a trivial type"); #endif // LL_LLPLANE_H diff --git a/indra/llmath/llquaternion.h b/indra/llmath/llquaternion.h index 762d13eded..472d7ca62d 100644 --- a/indra/llmath/llquaternion.h +++ b/indra/llmath/llquaternion.h @@ -174,6 +174,10 @@ public: //static U32 mMultCount; }; +static_assert(std::is_trivially_copyable::value, "LLQuaternion must be trivial copy"); +static_assert(std::is_trivially_move_assignable::value, "LLQuaternion must be trivial move"); +static_assert(std::is_standard_layout::value, "LLQuaternion must be a standard layout type"); + inline LLSD LLQuaternion::getValue() const { LLSD ret; diff --git a/indra/llmath/llquaternion2.h b/indra/llmath/llquaternion2.h index 902bfb7134..c9dcc4573f 100644 --- a/indra/llmath/llquaternion2.h +++ b/indra/llmath/llquaternion2.h @@ -49,7 +49,7 @@ public: ////////////////////////// // Ctor - LLQuaternion2() {} + LLQuaternion2() = default; // Ctor from LLQuaternion explicit LLQuaternion2( const class LLQuaternion& quat ); @@ -102,4 +102,6 @@ protected: }; +static_assert(std::is_trivial::value, "LLQuaternion2 must be a trivial type"); + #endif diff --git a/indra/llmath/llrect.h b/indra/llmath/llrect.h index 317578da06..0a3da2fee0 100644 --- a/indra/llmath/llrect.h +++ b/indra/llmath/llrect.h @@ -51,10 +51,6 @@ public: LLRectBase(): mLeft(0), mTop(0), mRight(0), mBottom(0) {} - LLRectBase(const LLRectBase &r): - mLeft(r.mLeft), mTop(r.mTop), mRight(r.mRight), mBottom(r.mBottom) - {} - LLRectBase(Type left, Type top, Type right, Type bottom): mLeft(left), mTop(top), mRight(right), mBottom(bottom) {} @@ -295,4 +291,8 @@ template LLRectBase LLRectBase::null(0,0,0,0); typedef LLRectBase LLRect; typedef LLRectBase LLRectf; +static_assert(std::is_trivially_copyable::value, "LLRect must be trivial copy"); +static_assert(std::is_trivially_move_assignable::value, "LLRect must be trivial move"); +static_assert(std::is_standard_layout::value, "LLRect must be a standard layout type"); + #endif diff --git a/indra/llmath/llsimdtypes.h b/indra/llmath/llsimdtypes.h index a407f51029..6c4f55b0c0 100644 --- a/indra/llmath/llsimdtypes.h +++ b/indra/llmath/llsimdtypes.h @@ -36,7 +36,7 @@ typedef __m128 LLQuad; class LLBool32 { public: - inline LLBool32() {} + inline LLBool32() = default; inline LLBool32(int rhs) : m_bool(rhs) {} inline LLBool32(unsigned int rhs) : m_bool(rhs) {} inline LLBool32(bool rhs) { m_bool = static_cast(rhs); } @@ -46,13 +46,15 @@ public: inline operator bool() const { return static_cast(m_bool); } private: - int m_bool{ 0 }; + int m_bool; }; +static_assert(std::is_trivial::value, "LLBool32 must be a standard layout type"); + class LLSimdScalar { public: - inline LLSimdScalar() {} + inline LLSimdScalar() = default; inline LLSimdScalar(LLQuad q) { mQ = q; @@ -100,7 +102,9 @@ public: } private: - LLQuad mQ{}; + LLQuad mQ; }; +static_assert(std::is_trivial::value, "LLSimdScalar must be a standard layout type"); + #endif //LL_SIMD_TYPES_H diff --git a/indra/llmath/llvector4a.cpp b/indra/llmath/llvector4a.cpp index 0ac91366b6..b81d50f0f9 100644 --- a/indra/llmath/llvector4a.cpp +++ b/indra/llmath/llvector4a.cpp @@ -24,6 +24,8 @@ * $/LicenseInfo$ */ +#include "linden_common.h" + #include "llmemory.h" #include "llmath.h" #include "llquantize.h" diff --git a/indra/llmath/llvector4a.h b/indra/llmath/llvector4a.h index 4004852e06..764a3b94e6 100644 --- a/indra/llmath/llvector4a.h +++ b/indra/llmath/llvector4a.h @@ -95,10 +95,7 @@ public: //////////////////////////////////// //LLVector4a is plain data which should never have a default constructor or destructor(malloc&free won't trigger it) - LLVector4a() - { //DO NOT INITIALIZE -- The overhead is completely unnecessary - ll_assert_aligned(this,16); - } + LLVector4a() = default; LLVector4a(F32 x, F32 y, F32 z, F32 w = 0.f) { @@ -361,8 +358,6 @@ public: //////////////////////////////////// // Do NOT add aditional operators without consulting someone with SSE experience - inline const LLVector4a& operator= ( const LLVector4a& rhs ); - inline const LLVector4a& operator= ( const LLQuad& rhs ); inline operator LLQuad() const; @@ -378,9 +373,11 @@ public: }; private: - LLQuad mQ{}; + LLQuad mQ; }; +static_assert(std::is_trivial::value, "LLVector4a must be a trivial type"); + inline void update_min_max(LLVector4a& min, LLVector4a& max, const LLVector4a& p) { min.setMin(min, p); diff --git a/indra/llmath/llvector4a.inl b/indra/llmath/llvector4a.inl index 36dbec078c..77a0257fbf 100644 --- a/indra/llmath/llvector4a.inl +++ b/indra/llmath/llvector4a.inl @@ -593,12 +593,6 @@ inline bool LLVector4a::equals3(const LLVector4a& rhs, F32 tolerance ) const //////////////////////////////////// // Do NOT add aditional operators without consulting someone with SSE experience -inline const LLVector4a& LLVector4a::operator= ( const LLVector4a& rhs ) -{ - mQ = rhs.mQ; - return *this; -} - inline const LLVector4a& LLVector4a::operator= ( const LLQuad& rhs ) { mQ = rhs; diff --git a/indra/llmath/llvector4logical.h b/indra/llmath/llvector4logical.h index 70759eef5c..77cb5862e5 100644 --- a/indra/llmath/llvector4logical.h +++ b/indra/llmath/llvector4logical.h @@ -61,7 +61,7 @@ public: }; // Empty default ctor - LLVector4Logical() {} + LLVector4Logical() = default; LLVector4Logical( const LLQuad& quad ) { @@ -120,7 +120,9 @@ public: private: - LLQuad mQ{}; + LLQuad mQ; }; +static_assert(std::is_trivial::value, "LLVector4Logical must be a standard layout type"); + #endif //LL_VECTOR4ALOGICAL_H diff --git a/indra/llmath/m3math.h b/indra/llmath/m3math.h index cd14290246..36661d2cb0 100644 --- a/indra/llmath/m3math.h +++ b/indra/llmath/m3math.h @@ -142,6 +142,10 @@ class LLMatrix3 friend std::ostream& operator<<(std::ostream& s, const LLMatrix3 &a); // Stream a }; +static_assert(std::is_trivially_copyable::value, "LLMatrix3 must be trivial copy"); +static_assert(std::is_trivially_move_assignable::value, "LLMatrix3 must be trivial move"); +static_assert(std::is_standard_layout::value, "LLMatrix3 must be a standard layout type"); + inline LLMatrix3::LLMatrix3(void) { mMatrix[0][0] = 1.f; diff --git a/indra/llmath/m4math.cpp b/indra/llmath/m4math.cpp index c46ee587cb..2a6e52798b 100644 --- a/indra/llmath/m4math.cpp +++ b/indra/llmath/m4math.cpp @@ -157,10 +157,6 @@ LLMatrix4::LLMatrix4(const F32 roll, const F32 pitch, const F32 yaw) mMatrix[3][3] = 1.f; } -LLMatrix4::~LLMatrix4(void) -{ -} - // Clear and Assignment Functions const LLMatrix4& LLMatrix4::setZero() diff --git a/indra/llmath/m4math.h b/indra/llmath/m4math.h index b0f8c90cdf..f164779283 100644 --- a/indra/llmath/m4math.h +++ b/indra/llmath/m4math.h @@ -119,8 +119,6 @@ public: const LLVector4 &pos); // Initializes Matrix with Euler angles LLMatrix4(const F32 roll, const F32 pitch, const F32 yaw); // Initializes Matrix with Euler angles - ~LLMatrix4(void); // Destructor - LLSD getValue() const; void setValue(const LLSD&); @@ -242,6 +240,10 @@ public: friend std::ostream& operator<<(std::ostream& s, const LLMatrix4 &a); // Stream a }; +static_assert(std::is_trivially_copyable::value, "LLMatrix4 must be trivial copy"); +static_assert(std::is_trivially_move_assignable::value, "LLMatrix4 must be trivial move"); +static_assert(std::is_standard_layout::value, "LLMatrix4 must be a standard layout type"); + inline const LLMatrix4& LLMatrix4::setIdentity() { mMatrix[0][0] = 1.f; diff --git a/indra/llmath/v2math.h b/indra/llmath/v2math.h index a61c946304..c84c441492 100644 --- a/indra/llmath/v2math.h +++ b/indra/llmath/v2math.h @@ -110,6 +110,9 @@ class LLVector2 friend std::ostream& operator<<(std::ostream& s, const LLVector2 &a); // Stream a }; +static_assert(std::is_trivially_copyable::value, "LLVector2 must be trivial copy"); +static_assert(std::is_trivially_move_assignable::value, "LLVector2 must be trivial move"); +static_assert(std::is_standard_layout::value, "LLVector2 must be a standard layout type"); // Non-member functions diff --git a/indra/llmath/v3color.h b/indra/llmath/v3color.h index f7af469e66..139db9539f 100644 --- a/indra/llmath/v3color.h +++ b/indra/llmath/v3color.h @@ -151,8 +151,11 @@ public: inline void exp(); // Do an exponential on the color }; -LLColor3 lerp(const LLColor3 &a, const LLColor3 &b, F32 u); +static_assert(std::is_trivially_copyable::value, "LLColor3 must be trivial copy"); +static_assert(std::is_trivially_move_assignable::value, "LLColor3 must be trivial move"); +static_assert(std::is_standard_layout::value, "LLColor3 must be a standard layout type"); +LLColor3 lerp(const LLColor3& a, const LLColor3& b, F32 u); void LLColor3::clamp() { diff --git a/indra/llmath/v3dmath.h b/indra/llmath/v3dmath.h index ece8c54ea4..d261e9de88 100644 --- a/indra/llmath/v3dmath.h +++ b/indra/llmath/v3dmath.h @@ -130,6 +130,10 @@ class LLVector3d }; +static_assert(std::is_trivially_copyable::value, "LLVector3d must be trivial copy"); +static_assert(std::is_trivially_move_assignable::value, "LLVector3d must be trivial move"); +static_assert(std::is_standard_layout::value, "LLVector3d must be a standard layout type"); + typedef LLVector3d LLGlobalVec; inline const LLVector3d &LLVector3d::set(const LLVector3 &vec) diff --git a/indra/llmath/v3math.h b/indra/llmath/v3math.h index a3bfa68060..8f0d00270d 100644 --- a/indra/llmath/v3math.h +++ b/indra/llmath/v3math.h @@ -164,6 +164,10 @@ class LLVector3 static bool parseVector3(const std::string& buf, LLVector3* value); }; +static_assert(std::is_trivially_copyable::value, "LLVector3 must be trivial copy"); +static_assert(std::is_trivially_move_assignable::value, "LLVector3 must be trivial move"); +static_assert(std::is_standard_layout::value, "LLVector3 must be a standard layout type"); + typedef LLVector3 LLSimLocalVec; // Non-member functions diff --git a/indra/llmath/v4color.h b/indra/llmath/v4color.h index cafdbd9d7c..97ffead7a0 100644 --- a/indra/llmath/v4color.h +++ b/indra/llmath/v4color.h @@ -232,6 +232,9 @@ class LLColor4 inline void clamp(); }; +static_assert(std::is_trivially_copyable::value, "LLColor4 must be trivial copy"); +static_assert(std::is_trivially_move_assignable::value, "LLColor4 must be trivial move"); +static_assert(std::is_standard_layout::value, "LLColor4 must be a standard layout type"); // Non-member functions F32 distVec(const LLColor4 &a, const LLColor4 &b); // Returns distance between a and b diff --git a/indra/llmath/v4coloru.h b/indra/llmath/v4coloru.h index 29128a08a7..e17db7704a 100644 --- a/indra/llmath/v4coloru.h +++ b/indra/llmath/v4coloru.h @@ -134,6 +134,9 @@ public: static LLColor4U blue; }; +static_assert(std::is_trivially_copyable::value, "LLColor4U must be trivial copy"); +static_assert(std::is_trivially_move_assignable::value, "LLColor4U must be trivial move"); +static_assert(std::is_standard_layout::value, "LLColor4U must be a standard layout type"); // Non-member functions F32 distVec(const LLColor4U &a, const LLColor4U &b); // Returns distance between a and b diff --git a/indra/llmath/v4math.h b/indra/llmath/v4math.h index a4c9668fdd..f5b79759b0 100644 --- a/indra/llmath/v4math.h +++ b/indra/llmath/v4math.h @@ -146,6 +146,10 @@ class LLVector4 friend LLVector4 operator-(const LLVector4 &a); // Return vector -a }; +static_assert(std::is_trivially_copyable::value, "LLVector4 must be trivial copy"); +static_assert(std::is_trivially_move_assignable::value, "LLVector4 must be trivial move"); +static_assert(std::is_standard_layout::value, "LLVector4 must be a standard layout type"); + // Non-member functions F32 angle_between(const LLVector4 &a, const LLVector4 &b); // Returns angle (radians) between a and b bool are_parallel(const LLVector4 &a, const LLVector4 &b, F32 epsilon = F_APPROXIMATELY_ZERO); // Returns true if a and b are very close to parallel -- cgit v1.2.3 From 7bba6b835f2a64367399931b06597046b6f9e004 Mon Sep 17 00:00:00 2001 From: Rye Date: Sun, 2 Feb 2025 07:08:40 -0500 Subject: Update dependencies with support for apple silicon --- autobuild.xml | 326 +++++++++++++++++------------------- indra/cmake/APR.cmake | 52 +++--- indra/cmake/Audio.cmake | 44 ++--- indra/cmake/Boost.cmake | 92 ++++++---- indra/cmake/CURL.cmake | 24 +-- indra/cmake/Copy3rdPartyLibs.cmake | 21 --- indra/cmake/EXPAT.cmake | 23 +-- indra/cmake/FreeType.cmake | 11 +- indra/cmake/Hunspell.cmake | 20 +-- indra/cmake/JPEG.cmake | 20 +-- indra/cmake/LLPrimitive.cmake | 39 +++-- indra/cmake/LibVLCPlugin.cmake | 30 ++-- indra/cmake/Meshoptimizer.cmake | 16 +- indra/cmake/NDOF.cmake | 15 +- indra/cmake/NGHTTP2.cmake | 13 +- indra/cmake/OPENAL.cmake | 29 ++-- indra/cmake/OpenJPEG.cmake | 10 +- indra/cmake/OpenSSL.cmake | 24 ++- indra/cmake/PNG.cmake | 15 +- indra/cmake/ZLIBNG.cmake | 13 +- indra/llimagej2coj/llimagej2coj.cpp | 74 +++----- indra/llwebrtc/CMakeLists.txt | 6 +- indra/newview/CMakeLists.txt | 10 +- indra/newview/viewer_manifest.py | 45 +++-- 24 files changed, 477 insertions(+), 495 deletions(-) diff --git a/autobuild.xml b/autobuild.xml index 653762da9e..f298b21d27 100644 --- a/autobuild.xml +++ b/autobuild.xml @@ -46,11 +46,11 @@ archive hash - 579a46d77802e301856c93792d39d43bbf939987 + a21487f4e3a68721fd97edef117795a1b7212a77 hash_algorithm sha1 url - https://github.com/secondlife/3p-apr_suite/releases/download/v1.7.4-r2/apr_suite-1.7.4-10338381102-darwin64-10338381102.tar.zst + https://github.com/secondlife/3p-apr_suite/releases/download/v1.7.5-r1/apr_suite-1.7.5-12259255574-darwin64-12259255574.tar.zst name darwin64 @@ -60,11 +60,11 @@ archive hash - 2e5cf11f8774023408402df860d3d1f4a6668500 + 45baf82d3366734e542a2a3749f495b64f5513b4 hash_algorithm sha1 url - https://github.com/secondlife/3p-apr_suite/releases/download/v1.7.4-r2/apr_suite-1.7.4-10338381102-linux64-10338381102.tar.zst + https://github.com/secondlife/3p-apr_suite/releases/download/v1.7.5-r1/apr_suite-1.7.5-12259255574-linux64-12259255574.tar.zst name linux64 @@ -74,11 +74,11 @@ archive hash - 7eb6b8f294c4563a07fec3578be2d04af17a60cb + bdd35d3b9580d3cdcb98afae639936aaa40e24c4 hash_algorithm sha1 url - https://github.com/secondlife/3p-apr_suite/releases/download/v1.7.4-r2/apr_suite-1.7.4-10338381102-windows64-10338381102.tar.zst + https://github.com/secondlife/3p-apr_suite/releases/download/v1.7.5-r1/apr_suite-1.7.5-12259255574-windows64-12259255574.tar.zst name windows64 @@ -91,7 +91,7 @@ copyright Copyright © 2012 The Apache Software Foundation, Licensed under the Apache License, Version 2.0. version - 1.7.4-10338381102 + 1.7.5-12259255574 name apr_suite description @@ -116,11 +116,11 @@ archive hash - 6bf5f4afddf87d48c069d781b5ef2d44d6ddf2d5 + 320a8b76b1d30e5c1e7095c0c8315e8d0b68cbc5 hash_algorithm sha1 url - https://github.com/secondlife/3p-boost/releases/download/v1.86.0-e2bee1e/boost-1.86-darwin64-10475904468.tar.zst + https://github.com/secondlife/3p-boost/releases/download/v1.86.0-dfe318c/boost-1.86-darwin64-11977000894.tar.zst name darwin64 @@ -130,11 +130,11 @@ archive hash - 3c0ba2a87e78d76c81da95fa87579bf4964242e1 + 589a3577448190f87dc1c3bb8149ff57780772d8 hash_algorithm sha1 url - https://github.com/secondlife/3p-boost/releases/download/v1.86.0-e2bee1e/boost-1.86-linux64-10475904468.tar.zst + https://github.com/secondlife/3p-boost/releases/download/v1.86.0-dfe318c/boost-1.86-linux64-11977000894.tar.zst name linux64 @@ -144,11 +144,11 @@ archive hash - d1dd5d629b254d1b361c5a0fa210b5f3283e8a20 + 28a268d88e26f081bc2341400ca6a5bc72ac78a8 hash_algorithm sha1 url - https://github.com/secondlife/3p-boost/releases/download/v1.86.0-e2bee1e/boost-1.86-windows64-10475904468.tar.zst + https://github.com/secondlife/3p-boost/releases/download/v1.86.0-dfe318c/boost-1.86-windows64-11977000894.tar.zst name windows64 @@ -220,11 +220,11 @@ archive hash - 18b46ce8ebb5ae6ef6527b4e95408433e29ad3f4 + 3a8de0ed0611279bd393df1cb224dfd3bbb907b7 hash_algorithm sha1 url - https://github.com/secondlife/3p-colladadom/releases/download/v2.3-r8/colladadom-2.3.0-r8-darwin64-10476582237.tar.zst + https://github.com/secondlife/3p-colladadom/releases/download/v2.3-r9/colladadom-2.3.0-r9-darwin64-12258978859.tar.zst name darwin64 @@ -234,11 +234,11 @@ archive hash - c088fe0be9ce7e42983c3c7708abe4ac8bd5a894 + c2cc015c86536cb4a77d909af1644e54a031ee6f hash_algorithm sha1 url - https://github.com/secondlife/3p-colladadom/releases/download/v2.3-r8/colladadom-2.3.0-r8-linux64-10476582237.tar.zst + https://github.com/secondlife/3p-colladadom/releases/download/v2.3-r9/colladadom-2.3.0-r9-linux64-12258978859.tar.zst name linux64 @@ -248,18 +248,18 @@ archive hash - 8bfa9f1a78d077f3bd422f14ae360150b98c82f9 + c4807fd3352e6c175f7a28128e0269e524b051cb hash_algorithm sha1 url - https://github.com/secondlife/3p-colladadom/releases/download/v2.3-r8/colladadom-2.3.0-r8-windows64-10476582237.tar.zst + https://github.com/secondlife/3p-colladadom/releases/download/v2.3-r9/colladadom-2.3.0-r9-windows64-12258978859.tar.zst name windows64 version - 2.3.0-r8 + 2.3.0-r9 cubemaptoequirectangular @@ -290,6 +290,8 @@ url https://github.com/secondlife/3p-cubemap_to_eqr_js/releases/download/v1.1.0-d7afe27/cubemaptoequirectangular-1.1.0-linux64-d7afe27.tar.zst + name + linux64 windows64 @@ -326,11 +328,11 @@ archive hash - 9c74adfd217fcc04869ef574078bc56a4a1380f3 + 4f2f5ea4de2891d2ffcc707f984729ddb523d5e1 hash_algorithm sha1 url - https://github.com/secondlife/3p-curl/releases/download/v7.54.1-r1/curl-7.54.1-10342910827-darwin64-10342910827.tar.zst + https://github.com/secondlife/3p-curl/releases/download/v7.54.1-r2/curl-7.54.1-12258966289-darwin64-12258966289.tar.zst name darwin64 @@ -340,11 +342,11 @@ archive hash - 325ad581a1ba99fbc1e74d48481e07546eaf1e0e + a4d6303c59f9c9760c5243b6d4d7b7b199ba9356 hash_algorithm sha1 url - https://github.com/secondlife/3p-curl/releases/download/v7.54.1-r1/curl-7.54.1-10342910827-linux64-10342910827.tar.zst + https://github.com/secondlife/3p-curl/releases/download/v7.54.1-r2/curl-7.54.1-12258966289-linux64-12258966289.tar.zst name linux64 @@ -354,11 +356,11 @@ archive hash - 794480208e72a928552760cd048438b90aa1c80d + ec0d4717e4b841107b19cab7bd705f327a89f397 hash_algorithm sha1 url - https://github.com/secondlife/3p-curl/releases/download/v7.54.1-r1/curl-7.54.1-10342910827-windows64-10342910827.tar.zst + https://github.com/secondlife/3p-curl/releases/download/v7.54.1-r2/curl-7.54.1-12258966289-windows64-12258966289.tar.zst name windows64 @@ -371,7 +373,7 @@ copyright Copyright (c) 1996 - 2014, Daniel Stenberg, (daniel@haxx.se). version - 7.54.1-10342910827 + 7.54.1-12258966289 name curl description @@ -542,11 +544,11 @@ archive hash - 8cc4f38fd809d9ff5d8ca617d7e068eb236f4162 + e0ba69946f2203c03faf89c1f6d5bbc48d88d2a9 hash_algorithm sha1 url - https://github.com/secondlife/3p-expat/releases/download/v2.6.2-r5/expat-2.6.2-r5-darwin64-10337781902.tar.zst + https://github.com/secondlife/3p-expat/releases/download/v2.6.4-r1/expat-2.6.4-r1-darwin64-11943227858.tar.zst name darwin64 @@ -556,11 +558,11 @@ archive hash - d7f3bbfd65fce365c3cd5be9ab72072580408dec + 13483477c1f8b4bad9055fba561c64137453c3da hash_algorithm sha1 url - https://github.com/secondlife/3p-expat/releases/download/v2.6.2-r5/expat-2.6.2-r5-linux64-10337781902.tar.zst + https://github.com/secondlife/3p-expat/releases/download/v2.6.4-r1/expat-2.6.4-r1-linux64-11943227858.tar.zst name linux64 @@ -570,11 +572,11 @@ archive hash - f11d91205bb753d7389a73e629627b200219c62f + 542af7d8bb8de3297c80c23a771bbcb513a630b7 hash_algorithm sha1 url - https://github.com/secondlife/3p-expat/releases/download/v2.6.2-r5/expat-2.6.2-r5-windows64-10337781902.tar.zst + https://github.com/secondlife/3p-expat/releases/download/v2.6.4-r1/expat-2.6.4-r1-windows64-11943227858.tar.zst name windows64 @@ -587,7 +589,7 @@ copyright Copyright (c) 1998-2000 Thai Open Source Software Center Ltd and Clark Cooper - Copyright (c) 2001-2022 Expat maintainers. version - 2.6.2-r5 + 2.6.4-r1 name expat description @@ -642,11 +644,11 @@ archive hash - 51ad743c8943602913eedd2b6e2309abf46849d8 + e079a1b6f47d02ed63ca5cffec79ac75532f6eaf hash_algorithm sha1 url - https://github.com/secondlife/3p-freetype/releases/download/v2.13.3-cb2e120/freetype-2.13.3-cb2e120-darwin64-10475886095.tar.zst + https://github.com/secondlife/3p-freetype/releases/download/v2.13.3-r2/freetype-2.13.3-r2-darwin64-12259007838.tar.zst name darwin64 @@ -656,11 +658,11 @@ archive hash - bc27e272e004dc2fc573550e8c1cd8b4ad07f5b2 + 6e33a17fb9360a670dfbac51efbe5f4c2bb88c81 hash_algorithm sha1 url - https://github.com/secondlife/3p-freetype/releases/download/v2.13.3-cb2e120/freetype-2.13.3-cb2e120-linux64-10475886095.tar.zst + https://github.com/secondlife/3p-freetype/releases/download/v2.13.3-r2/freetype-2.13.3-r2-linux64-12259007838.tar.zst name linux64 @@ -670,18 +672,18 @@ archive hash - 01971b998122a17c97e3616c428cc77077a0c39a + 6a543ab76d8e2095f811e46cf4e8a2f454934f77 hash_algorithm sha1 url - https://github.com/secondlife/3p-freetype/releases/download/v2.13.3-cb2e120/freetype-2.13.3-cb2e120-windows64-10475886095.tar.zst + https://github.com/secondlife/3p-freetype/releases/download/v2.13.3-r2/freetype-2.13.3-r2-windows64-12259007838.tar.zst name windows64 version - 2.13.3-cb2e120 + 2.13.3-r2 glext @@ -916,11 +918,11 @@ archive hash - f271809c0d4244128fb52a71226a4d7674e14e0a + b05374300cdd40c381614f2ee4497de340eda991 hash_algorithm sha1 url - https://github.com/secondlife/3p-jpeg_encoder_js/releases/download/v1.0-9165e47/jpegencoderbasic-1.0-darwin64-9165e47.tar.zst + https://github.com/secondlife/3p-jpeg_encoder_js/releases/download/v1.0-790015a/jpegencoderbasic-1.0-darwin64-790015a.tar.zst name darwin64 @@ -930,23 +932,25 @@ archive hash - 35d6a617444fde9c8a5e998ef29dc43b95747637 + 23daab838f4b8f92e5dc1a2f6c568cb7b0cb43b7 hash_algorithm sha1 url - https://github.com/secondlife/3p-jpeg_encoder_js/releases/download/v1.0-9165e47/jpegencoderbasic-1.0-linux64-9165e47.tar.zst + https://github.com/secondlife/3p-jpeg_encoder_js/releases/download/v1.0-790015a/jpegencoderbasic-1.0-linux64-790015a.tar.zst + name + linux64 windows64 archive hash - 8ec22e9fc8734ba3d1826f4b88171a6017cc8676 + 23e8ba22aadf88d249a21844bfcdd01138c05937 hash_algorithm sha1 url - https://github.com/secondlife/3p-jpeg_encoder_js/releases/download/v1.0-9165e47/jpegencoderbasic-1.0-windows64-9165e47.tar.zst + https://github.com/secondlife/3p-jpeg_encoder_js/releases/download/v1.0-790015a/jpegencoderbasic-1.0-windows64-790015a.tar.zst name windows64 @@ -972,11 +976,11 @@ archive hash - 34cf4fdbbc999e67b0528f7ca3c7f31f35267ecf + 10f14875ce5c7f5028217c8b7468733190fd333d hash_algorithm sha1 url - https://github.com/secondlife/3p-libjpeg-turbo/releases/download/v3.0.3-r2/libjpeg_turbo-3.0.3-r2-windows64-10341191820.tar.zst + https://github.com/secondlife/3p-libjpeg-turbo/releases/download/v3.0.4-r1/libjpeg_turbo-3.0.4-r1-windows64-11968659895.tar.zst name windows64 @@ -986,11 +990,11 @@ archive hash - 5ff05a0e5ed0aba1514b84d3c2edaf70c18738b5 + d3b1b0fde28c8cf0c33fed167dba87bba5c6cc64 hash_algorithm sha1 url - https://github.com/secondlife/3p-libjpeg-turbo/releases/download/v3.0.3-r2/libjpeg_turbo-3.0.3-r2-linux64-10341191820.tar.zst + https://github.com/secondlife/3p-libjpeg-turbo/releases/download/v3.0.4-r1/libjpeg_turbo-3.0.4-r1-linux64-11968659895.tar.zst name linux64 @@ -1000,11 +1004,11 @@ archive hash - 7c38eabc050b4a6bdb183a1d7a38da885341049c + 79e78cbaaec9a99c0ae4a5cdd4a98535c8fa3c6d hash_algorithm sha1 url - https://github.com/secondlife/3p-libjpeg-turbo/releases/download/v3.0.3-r2/libjpeg_turbo-3.0.3-r2-darwin64-10341191820.tar.zst + https://github.com/secondlife/3p-libjpeg-turbo/releases/download/v3.0.4-r1/libjpeg_turbo-3.0.4-r1-darwin64-11968659895.tar.zst name darwin64 @@ -1017,7 +1021,7 @@ copyright Copyright (C)2009-2024 D. R. Commander. All Rights Reserved. Copyright (C)2015 Viktor Szathmáry. All Rights Reserved. version - 3.0.3-r2 + 3.0.4-r1 name libjpeg-turbo canonical_repo @@ -1077,22 +1081,6 @@ name windows64 - linux - - archive - - creds - github - hash - 711b82f9f588d3a125af7dcd8c81f93d9c343a7d - hash_algorithm - sha1 - url - https://api.github.com/repos/secondlife/3p-kdu/releases/assets/136774121 - - name - linux - license Kakadu @@ -1116,11 +1104,11 @@ archive hash - e71ae7a645603fe967a69aa5beb5b3009185e177 + 91acd05f450162b07ca2f68094778c483d28128d hash_algorithm sha1 url - https://github.com/secondlife/3p-libhunspell/releases/download/v1.7.2-r1/libhunspell-1.7.2.10207243663-darwin64-10207243663.tar.zst + https://github.com/secondlife/3p-libhunspell/releases/download/v1.7.2-r2/libhunspell-1.7.2.11968900321-darwin64-11968900321.tar.zst name darwin64 @@ -1130,11 +1118,11 @@ archive hash - 275ffb7f60064d8008aed8406f80f34229f651fc + 10e5b5d793c3c5cb5335dea89734302bda5a9f59 hash_algorithm sha1 url - https://github.com/secondlife/3p-libhunspell/releases/download/v1.7.2-r1/libhunspell-1.7.2.10207243663-linux64-10207243663.tar.zst + https://github.com/secondlife/3p-libhunspell/releases/download/v1.7.2-r2/libhunspell-1.7.2.11968900321-linux64-11968900321.tar.zst name linux64 @@ -1144,11 +1132,11 @@ archive hash - 89ff24e93eaeca7949ccdb5cc368f938f5b1f307 + 0f7b9c46dc4e81a6296e4836467f5fe52aa5761d hash_algorithm sha1 url - https://github.com/secondlife/3p-libhunspell/releases/download/v1.7.2-r1/libhunspell-1.7.2.10207243663-windows64-10207243663.tar.zst + https://github.com/secondlife/3p-libhunspell/releases/download/v1.7.2-r2/libhunspell-1.7.2.11968900321-windows64-11968900321.tar.zst name windows64 @@ -1161,7 +1149,7 @@ copyright LGPL 2.1 version - 1.7.2.10207243663 + 1.7.2.11968900321 name libhunspell description @@ -1176,11 +1164,11 @@ archive hash - e3dd320c90e67e0c80caf4d4df23257b0196dfb6 + d1638886671b31935ea7e3c824e015ea1a45b12e hash_algorithm sha1 url - https://github.com/secondlife/3p-libndofdev/releases/download/v0.1.8e9edc7/libndofdev-0.1.8e9edc7-darwin64-8e9edc7.tar.zst + https://github.com/secondlife/3p-libndofdev/releases/download/v0.1.a0b7d99/libndofdev-0.1.11968678219-darwin64-11968678219.tar.zst name darwin64 @@ -1190,11 +1178,11 @@ archive hash - ae9d554e8839f42230b8ed6c850445d54654a38f + 7b3e504885c4c0cc75db298e682f408c4f2e95f7 hash_algorithm sha1 url - https://github.com/secondlife/3p-libndofdev/releases/download/v0.1.8e9edc7/libndofdev-0.1.8e9edc7-windows64-8e9edc7.tar.zst + https://github.com/secondlife/3p-libndofdev/releases/download/v0.1.a0b7d99/libndofdev-0.1.11968678219-windows64-11968678219.tar.zst name windows64 @@ -1207,7 +1195,7 @@ copyright Copyright (c) 2007, 3Dconnexion, Inc. - All rights reserved. version - 0.1.8e9edc7 + 0.1.11968678219 name libndofdev description @@ -1222,11 +1210,11 @@ archive hash - 6fe46ed1e2e40616abdacf7115e510645d5f62e7 + 75ff1513c5527a541bac0b685a90a49afb086156 hash_algorithm sha1 url - https://github.com/secondlife/3p-libpng/releases/download/v1.6.43-r2/libpng-1.6.43-r2-darwin64-10329429325.tar.zst + https://github.com/secondlife/3p-libpng/releases/download/v1.6.44-r1/libpng-1.6.44-r1-darwin64-11965237099.tar.zst name darwin64 @@ -1236,11 +1224,11 @@ archive hash - b54a4710d9c3ddfa044e1d29f9c38974e9fc645d + 23967758d45afc1e2243c3669ca045945de588a7 hash_algorithm sha1 url - https://github.com/secondlife/3p-libpng/releases/download/v1.6.43-r2/libpng-1.6.43-r2-linux64-10329429325.tar.zst + https://github.com/secondlife/3p-libpng/releases/download/v1.6.44-r1/libpng-1.6.44-r1-linux64-11965237099.tar.zst name linux64 @@ -1250,11 +1238,11 @@ archive hash - eddb96c73c8916bf71eaa5d0edb812d20e72c255 + 19ac0a301438a0cbe8cb65179ce9e130f5fd827a hash_algorithm sha1 url - https://github.com/secondlife/3p-libpng/releases/download/v1.6.43-r2/libpng-1.6.43-r2-windows64-10329429325.tar.zst + https://github.com/secondlife/3p-libpng/releases/download/v1.6.44-r1/libpng-1.6.44-r1-windows64-11965237099.tar.zst name windows64 @@ -1267,7 +1255,7 @@ copyright Copyright (c) 2004, 2006-2013 Glenn Randers-Pehrson version - 1.6.43-r2 + 1.6.44-r1 name libpng description @@ -1312,11 +1300,11 @@ archive hash - b2bf9adc84841b6fcf48d4c00787b221607cdea3 + a7062e4feef42461b9acb4bfcef99bea5c89945e hash_algorithm sha1 url - https://github.com/secondlife/3p-libxml2/releases/download/v2.13.3-r1/libxml2-2.13.3-r1-darwin64-10329675166.tar.zst + https://github.com/secondlife/3p-libxml2/releases/download/v2.13.5-r1/libxml2-2.13.5-r1-darwin64-11967192668.tar.zst name darwin64 @@ -1326,11 +1314,11 @@ archive hash - 6ab8108ea0a42e0bd462568c495e5ce5c4cdc0ff + 991aad5931d5f05e43b8750ad81ae59ac6013e59 hash_algorithm sha1 url - https://github.com/secondlife/3p-libxml2/releases/download/v2.13.3-r1/libxml2-2.13.3-r1-linux64-10329675166.tar.zst + https://github.com/secondlife/3p-libxml2/releases/download/v2.13.5-r1/libxml2-2.13.5-r1-linux64-11967192668.tar.zst name linux64 @@ -1340,11 +1328,11 @@ archive hash - 5181bd267de3ad4466227f91c7e2cbed7e8b85d9 + 4c00019229adc761673808567b8dcd64c7ba4a85 hash_algorithm sha1 url - https://github.com/secondlife/3p-libxml2/releases/download/v2.13.3-r1/libxml2-2.13.3-r1-windows64-10329675166.tar.zst + https://github.com/secondlife/3p-libxml2/releases/download/v2.13.5-r1/libxml2-2.13.5-r1-windows64-11967192668.tar.zst name windows64 @@ -1357,7 +1345,7 @@ copyright Copyright (C) 1998-2012 Daniel Veillard. All Rights Reserved. version - 2.13.3-r1 + 2.13.5-r1 name libxml2 description @@ -1627,42 +1615,42 @@ archive hash - d79631d845e2b5e4a9e6f6b660310795fd49023e + 874a7d2bc843554aa4facd03b3a6d681f2b5150c hash_algorithm sha1 url - https://github.com/secondlife/3p-meshoptimizer/releases/download/v210-r2/meshoptimizer-210.0.0-r2-darwin64-10341021290.tar.zst + https://github.com/secondlife/3p-meshoptimizer/releases/download/v220-r1/meshoptimizer-220.0.0-r1-darwin64-11968851109.tar.zst name darwin64 - windows64 + linux64 archive hash - 024ce689a6f13e66d0c7e431ac34071434e2365a + 31a537f1a3d38ef85443214315111dd56a534d9a hash_algorithm sha1 url - https://github.com/secondlife/3p-meshoptimizer/releases/download/v210-r2/meshoptimizer-210.0.0-r2-windows64-10341021290.tar.zst + https://github.com/secondlife/3p-meshoptimizer/releases/download/v220-r1/meshoptimizer-220.0.0-r1-linux64-11968851109.tar.zst name - windows64 + linux64 - linux64 + windows64 archive hash - c947107c0aca46e94e22f66328a3cbbd01d99b36 + 6fd727a9ccb3e7a6c6b4ffef8179e266c032eb3e hash_algorithm sha1 url - https://github.com/secondlife/3p-meshoptimizer/releases/download/v210-r2/meshoptimizer-210.0.0-r2-linux64-10341021290.tar.zst + https://github.com/secondlife/3p-meshoptimizer/releases/download/v220-r1/meshoptimizer-220.0.0-r1-windows64-11968851109.tar.zst name - linux64 + windows64 license @@ -1672,7 +1660,7 @@ copyright Copyright (c) 2016-2021 Arseny Kapoulkine version - 210.0.0-r2 + 220.0.0-r1 name meshoptimizer canonical_repo @@ -1751,11 +1739,11 @@ archive hash - 6bedaa9d770ef0ae6147f49a26fc3209fde9cb80 + 40ef787f43a47acb18fd06cb9605f2f1ec6273fd hash_algorithm sha1 url - https://github.com/secondlife/3p-minizip-ng/releases/download/v4.0.7-r1/minizip_ng-4.0.7-r1-darwin64-10324657515.tar.zst + https://github.com/secondlife/3p-minizip-ng/releases/download/v4.0.7-r2/minizip_ng-4.0.7-r2-darwin64-11967198844.tar.zst name darwin64 @@ -1765,11 +1753,11 @@ archive hash - ce2c91b8c4f89af252ce1b6a96af6985fe54f509 + 2c403efb5c59e7189b5e86a9001bb4f9e0647f6e hash_algorithm sha1 url - https://github.com/secondlife/3p-minizip-ng/releases/download/v4.0.7-r1/minizip_ng-4.0.7-r1-linux64-10324657515.tar.zst + https://github.com/secondlife/3p-minizip-ng/releases/download/v4.0.7-r2/minizip_ng-4.0.7-r2-linux64-11967198844.tar.zst name linux64 @@ -1779,11 +1767,11 @@ archive hash - 9cee9d85f9a7c6fb051125775f0122a926da5cc9 + 18a3d4adf09074f4ed97f7d086b30ce828d3508b hash_algorithm sha1 url - https://github.com/secondlife/3p-minizip-ng/releases/download/v4.0.7-r1/minizip_ng-4.0.7-r1-windows64-10324657515.tar.zst + https://github.com/secondlife/3p-minizip-ng/releases/download/v4.0.7-r2/minizip_ng-4.0.7-r2-windows64-11967198844.tar.zst name windows64 @@ -1796,7 +1784,7 @@ copyright This project uses the zlib license. Copyright (C) 1995-2013 Jean-loup Gailly and Mark Adler version - 4.0.7-r1 + 4.0.7-r2 name minizip-ng canonical_repo @@ -1869,11 +1857,11 @@ archive hash - 3f3374a5d97803bf78acf20847c2900c7d68ce2b + dd0c79ac49e5e81cd153d44061c044d1db950fdc hash_algorithm sha1 url - https://github.com/secondlife/3p-nghttp2/releases/download/v1.62.1/nghttp2-1.62.1-darwin64-10329456052.tar.zst + https://github.com/secondlife/3p-nghttp2/releases/download/v1.64.0-r1/nghttp2-1.64.0-r1-darwin64-11965382595.tar.zst name darwin64 @@ -1883,11 +1871,11 @@ archive hash - bd9c211f9f53c04821f0ab0e1268a691926331b6 + 0ba810156e0f1ceee8fcc9f9115b91111323fabd hash_algorithm sha1 url - https://github.com/secondlife/3p-nghttp2/releases/download/v1.62.1/nghttp2-1.62.1-linux64-10329456052.tar.zst + https://github.com/secondlife/3p-nghttp2/releases/download/v1.64.0-r1/nghttp2-1.64.0-r1-linux64-11965382595.tar.zst name linux64 @@ -1897,11 +1885,11 @@ archive hash - c23e25a7c47f5233f543a90f1a9ccf4da9282379 + 182e03f4ef36eff082c571c33b13111d4cd6c8dd hash_algorithm sha1 url - https://github.com/secondlife/3p-nghttp2/releases/download/v1.62.1/nghttp2-1.62.1-windows64-10329456052.tar.zst + https://github.com/secondlife/3p-nghttp2/releases/download/v1.64.0-r1/nghttp2-1.64.0-r1-windows64-11965382595.tar.zst name windows64 @@ -1915,7 +1903,7 @@ Copyright (c) 2012, 2014, 2015, 2016 Tatsuhiro Tsujikawa Copyright (c) 2012, 2014, 2015, 2016 nghttp2 contributors version - 1.62.1 + 1.64.0-r1 name nghttp2 description @@ -1964,11 +1952,11 @@ Copyright (c) 2012, 2014, 2015, 2016 nghttp2 contributors archive hash - 3abb5d21655aeca9d6a4de37704e8475821c28d9 + 68657c5c161c3fe8ff64eac3787172fcb06da972 hash_algorithm sha1 url - https://github.com/secondlife/3p-ogg_vorbis/releases/download/v1.3.5-1.3.7-r1/ogg_vorbis-1.3.5-1.3.7.10341271136-darwin64-10341271136.tar.zst + https://github.com/secondlife/3p-ogg_vorbis/releases/download/v1.3.5-1.3.7-r2/ogg_vorbis-1.3.5-1.3.7.11968798109-darwin64-11968798109.tar.zst name darwin64 @@ -1978,11 +1966,11 @@ Copyright (c) 2012, 2014, 2015, 2016 nghttp2 contributors archive hash - d89dff615c51b46ebdb3d42ac6bd9e0faae5ddf1 + 9a6ffad7b4186a158c019c5a5a5d7b8badb441da hash_algorithm sha1 url - https://github.com/secondlife/3p-ogg_vorbis/releases/download/v1.3.5-1.3.7-r1/ogg_vorbis-1.3.5-1.3.7.10341271136-linux64-10341271136.tar.zst + https://github.com/secondlife/3p-ogg_vorbis/releases/download/v1.3.5-1.3.7-r2/ogg_vorbis-1.3.5-1.3.7.11968798109-linux64-11968798109.tar.zst name linux64 @@ -1992,11 +1980,11 @@ Copyright (c) 2012, 2014, 2015, 2016 nghttp2 contributors archive hash - 0dc0f5334d1c882d5d7bce6d2cfaecf2f7ab1ae6 + 5f4cbb928ebfe774a9c07d3f2c255fd38bd6b4d6 hash_algorithm sha1 url - https://github.com/secondlife/3p-ogg_vorbis/releases/download/v1.3.5-1.3.7-r1/ogg_vorbis-1.3.5-1.3.7.10341271136-windows64-10341271136.tar.zst + https://github.com/secondlife/3p-ogg_vorbis/releases/download/v1.3.5-1.3.7-r2/ogg_vorbis-1.3.5-1.3.7.11968798109-windows64-11968798109.tar.zst name windows64 @@ -2009,7 +1997,7 @@ Copyright (c) 2012, 2014, 2015, 2016 nghttp2 contributors copyright Copyright (c) 2002, Xiph.org Foundation version - 1.3.5-1.3.7.10341271136 + 1.3.5-1.3.7.11968798109 name ogg_vorbis description @@ -2024,7 +2012,7 @@ Copyright (c) 2012, 2014, 2015, 2016 nghttp2 contributors copyright Copyright (c) 2008, Jan Ciger (jan.ciger (at) gmail.com) version - 0.3 + 0.14.11968684513 name open-libndofdev description @@ -2039,11 +2027,11 @@ Copyright (c) 2012, 2014, 2015, 2016 nghttp2 contributors archive hash - 191e4ef07a35f7147708415465191ce7622e3012 + 9250e12d4d88f0a437e49be2b32d107f6b4270d0 hash_algorithm sha1 url - https://github.com/secondlife/3p-openal-soft/releases/download/v1.23.1-8668009/openal-1.23.1-darwin64-8979520327.tar.zst + https://github.com/secondlife/3p-openal-soft/releases/download/v1.24.0-r1/openal-1.24.0-r1-darwin64-11968917548.tar.zst name darwin64 @@ -2053,11 +2041,11 @@ Copyright (c) 2012, 2014, 2015, 2016 nghttp2 contributors archive hash - 3bd8c9028ef42bdb43c7422e7d324e213fdb081e + 1e50db24586fba434a2be62f94fdc687569379ca hash_algorithm sha1 url - https://github.com/secondlife/3p-openal-soft/releases/download/v1.23.1-8668009/openal-1.23.1-linux64-8979520327.tar.zst + https://github.com/secondlife/3p-openal-soft/releases/download/v1.24.0-r1/openal-1.24.0-r1-linux64-11968917548.tar.zst name linux64 @@ -2067,11 +2055,11 @@ Copyright (c) 2012, 2014, 2015, 2016 nghttp2 contributors archive hash - 4b849609abec790e89be5fad8ddee3717ee301c4 + 2ec7b2b1f4c37e5bd1b473e4a26935ec374ee208 hash_algorithm sha1 url - https://github.com/secondlife/3p-openal-soft/releases/download/v1.23.1-8668009/openal-1.23.1-windows64-8979520327.tar.zst + https://github.com/secondlife/3p-openal-soft/releases/download/v1.24.0-r1/openal-1.24.0-r1-windows64-11968917548.tar.zst name windows64 @@ -2084,7 +2072,7 @@ Copyright (c) 2012, 2014, 2015, 2016 nghttp2 contributors copyright Copyright (C) 1999-2007 by authors. version - 1.23.1 + 1.24.0-r1 name openal description @@ -2099,11 +2087,11 @@ Copyright (c) 2012, 2014, 2015, 2016 nghttp2 contributors archive hash - 76444e37be0cfccdbb5921370ba150ded2bf3c59 + 39007a526bffffd0bde691f616491b70cf284496 hash_algorithm sha1 url - https://github.com/secondlife/3p-openjpeg/releases/download/v2.5.2-r1/openjpeg-2.5.2.10604495243-darwin64-10604495243.tar.zst + https://github.com/secondlife/3p-openjpeg/releases/download/v2.5.2-r2/openjpeg-2.5.2.11968808495-darwin64-11968808495.tar.zst name darwin64 @@ -2113,11 +2101,11 @@ Copyright (c) 2012, 2014, 2015, 2016 nghttp2 contributors archive hash - 6bd289a9c4564b80369ce40ecbb24a213c2732ff + 066e7b1ee58d5aff8efe065d598d56226c249a94 hash_algorithm sha1 url - https://github.com/secondlife/3p-openjpeg/releases/download/v2.5.2-r1/openjpeg-2.5.2.10604495243-linux64-10604495243.tar.zst + https://github.com/secondlife/3p-openjpeg/releases/download/v2.5.2-r2/openjpeg-2.5.2.11968808495-linux64-11968808495.tar.zst name linux64 @@ -2127,11 +2115,11 @@ Copyright (c) 2012, 2014, 2015, 2016 nghttp2 contributors archive hash - 5e6e0180adc01e07438cb98daec96543b5d85019 + fe98fc9f4f3d94399c3078cad1bdcfdb37ce397b hash_algorithm sha1 url - https://github.com/secondlife/3p-openjpeg/releases/download/v2.5.2-r1/openjpeg-2.5.2.10604495243-windows64-10604495243.tar.zst + https://github.com/secondlife/3p-openjpeg/releases/download/v2.5.2-r2/openjpeg-2.5.2.11968808495-windows64-11968808495.tar.zst name windows64 @@ -2144,7 +2132,7 @@ Copyright (c) 2012, 2014, 2015, 2016 nghttp2 contributors copyright Copyright (c) 2002-2007, Communications and Remote Sensing Laboratory, Universite catholique de Louvain (UCL), Belgium; Copyright (c) 2002-2007, Professor Benoit Macq; Copyright (c) 2001-2003, David Janssens; Copyright (c) 2002-2003, Yannick Verschueren; Copyright (c) 2003-2007, Francois-Olivier Devaux and Antonin Descampe; Copyright (c) 2005, Herve Drolon, FreeImage Team; Copyright (c) 2006-2007, Parvatha Elangovan; Copyright (c) 2008, Jerome Fimes, Communications & Systemes <jerome.fimes@c-s.fr>; Copyright (c) 2010-2011, Kaori Hagihara; Copyright (c) 2011-2012, Centre National d'Etudes Spatiales (CNES), France; Copyright (c) 2012, CS Systemes d'Information, France; version - 2.5.0.ea12248 + 2.5.2.11968808495 name openjpeg description @@ -2159,11 +2147,11 @@ Copyright (c) 2012, 2014, 2015, 2016 nghttp2 contributors archive hash - a20277991043a4a00fb8280a27a41fbd87c4b840 + f6fdad42168b30932384310866642b072465af11 hash_algorithm sha1 url - https://github.com/secondlife/3p-openssl/releases/download/v1.1.1w-r1/openssl-1.1.1w-darwin64-10329796904.tar.zst + https://github.com/secondlife/3p-openssl/releases/download/v1.1.1w-r2/openssl-1.1.1w-r2-darwin64-11965633361.tar.zst name darwin64 @@ -2173,11 +2161,11 @@ Copyright (c) 2012, 2014, 2015, 2016 nghttp2 contributors archive hash - 0f2cd519431b11cacf85971c66c49e5b4d26c56f + 7a5048c806b053768c461d6dbac854324a597ee0 hash_algorithm sha1 url - https://github.com/secondlife/3p-openssl/releases/download/v1.1.1w-r1/openssl-1.1.1w-linux64-10329796904.tar.zst + https://github.com/secondlife/3p-openssl/releases/download/v1.1.1w-r2/openssl-1.1.1w-r2-linux64-11965633361.tar.zst name linux64 @@ -2187,11 +2175,11 @@ Copyright (c) 2012, 2014, 2015, 2016 nghttp2 contributors archive hash - 5e396eedf1492d18126b7281367123c1d64b89aa + 3d16fa02ca44a6a1eeeb7c83d62af2dc8ef2e7e9 hash_algorithm sha1 url - https://github.com/secondlife/3p-openssl/releases/download/v1.1.1w-r1/openssl-1.1.1w-windows64-10329796904.tar.zst + https://github.com/secondlife/3p-openssl/releases/download/v1.1.1w-r2/openssl-1.1.1w-r2-windows64-11965633361.tar.zst name windows64 @@ -2204,7 +2192,7 @@ Copyright (c) 2012, 2014, 2015, 2016 nghttp2 contributors copyright Copyright (c) 1998-2011 The OpenSSL Project. All rights reserved; Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) version - 1.1.1w + 1.1.1w-r2 name openssl description @@ -2635,11 +2623,11 @@ Copyright (c) 2012, 2014, 2015, 2016 nghttp2 contributors archive hash - f13c82042ef8311e57dd75a3b2bda02d70f711b5 + 6d72afd5cc21446c65899615909b1f09f155585d hash_algorithm sha1 url - https://github.com/secondlife/3p-vlc-bin/releases/download/v3.0.21.e60ee26/vlc_bin-3.0.21.10218721728-darwin64-10218721728.tar.zst + https://github.com/secondlife/3p-vlc-bin/releases/download/v3.0.21.296d9f4/vlc_bin-3.0.21.11968962952-darwin64-11968962952.tar.zst name darwin64 @@ -2649,18 +2637,18 @@ Copyright (c) 2012, 2014, 2015, 2016 nghttp2 contributors archive hash - bd995441c1a229ed1432ddd837d7d1663b8c5548 + f986e6e93acf8a32a8be5b638f0bd0e2e07d7507 hash_algorithm sha1 url - https://github.com/secondlife/3p-vlc-bin/releases/download/v3.0.21.e60ee26/vlc_bin-3.0.21.10218721728-windows64-10218721728.tar.zst + https://github.com/secondlife/3p-vlc-bin/releases/download/v3.0.21.296d9f4/vlc_bin-3.0.21.11968962952-windows64-11968962952.tar.zst name windows64 version - 3.0.21.10218721728 + 3.0.21.11968962952 vulkan_gltf @@ -2705,11 +2693,11 @@ Copyright (c) 2012, 2014, 2015, 2016 nghttp2 contributors archive hash - 3570b6442d472cd97bad8622c2ec2571d72218a0 + 6314fdcee81a3538a7d960178ade66301c2fa002 hash_algorithm sha1 url - https://github.com/secondlife/3p-webrtc-build/releases/download/m114.5735.08.72-test/webrtc-m114.5735.08.72-test.10444682919-darwin64-10444682919.tar.zst + https://github.com/secondlife/3p-webrtc-build/releases/download/m114.5735.08.73-alpha/webrtc-m114.5735.08.73-alpha.11958809572-darwin64-11958809572.tar.zst name darwin64 @@ -2719,11 +2707,11 @@ Copyright (c) 2012, 2014, 2015, 2016 nghttp2 contributors archive hash - eadf6aa99313940ded11801d42c11375669f1628 + 95d7730a3d6955697e043f3fdf20ebdcc0c71fc0 hash_algorithm sha1 url - https://github.com/secondlife/3p-webrtc-build/releases/download/m114.5735.08.72-test/webrtc-m114.5735.08.72-test.10444682919-linux64-10444682919.tar.zst + https://github.com/secondlife/3p-webrtc-build/releases/download/m114.5735.08.73-alpha/webrtc-m114.5735.08.73-alpha.11958809572-linux64-11958809572.tar.zst name linux64 @@ -2733,11 +2721,11 @@ Copyright (c) 2012, 2014, 2015, 2016 nghttp2 contributors archive hash - 0081fd35290adbc8e66dd366535fb6cd8a966f1e + c7b329d6409576af6eb5b80655b007f52639c43b hash_algorithm sha1 url - https://github.com/secondlife/3p-webrtc-build/releases/download/m114.5735.08.72-test/webrtc-m114.5735.08.72-test.10444682919-windows64-10444682919.tar.zst + https://github.com/secondlife/3p-webrtc-build/releases/download/m114.5735.08.73-alpha/webrtc-m114.5735.08.73-alpha.11958809572-windows64-11958809572.tar.zst name windows64 @@ -2750,7 +2738,7 @@ Copyright (c) 2012, 2014, 2015, 2016 nghttp2 contributors copyright Copyright (c) 2011, The WebRTC project authors. All rights reserved. version - m114.5735.08.72-test.10444682919 + m114.5735.08.73-alpha.11958809572 name webrtc vcs_branch @@ -2803,11 +2791,11 @@ Copyright (c) 2012, 2014, 2015, 2016 nghttp2 contributors archive hash - 3a6593c71c59ace76d1349483759fcde4b719a76 + 4d437afc7fc3988cf0c78ed05853a211cc6bf8b8 hash_algorithm sha1 url - https://github.com/secondlife/3p-zlib-ng/releases/download/v2.2.1-r2/zlib_ng-2.2.1-r2-darwin64-10324415171.tar.zst + https://github.com/secondlife/3p-zlib-ng/releases/download/v2.2.2-r1/zlib_ng-2.2.2-dev0.gcaa101e.d20241120-darwin64-11943461931.tar.zst name darwin64 @@ -2817,11 +2805,11 @@ Copyright (c) 2012, 2014, 2015, 2016 nghttp2 contributors archive hash - fbadeb0b8c771cb06c0055c9fab6d40c6764dacd + 70c1d8728b85481bd42904c1213ed50264e77be1 hash_algorithm sha1 url - https://github.com/secondlife/3p-zlib-ng/releases/download/v2.2.1-r2/zlib_ng-2.2.1-r2-linux64-10324415171.tar.zst + https://github.com/secondlife/3p-zlib-ng/releases/download/v2.2.2-r1/zlib_ng-2.2.2-dev0.gcaa101e.d20241120-linux64-11943461931.tar.zst name linux64 @@ -2831,11 +2819,11 @@ Copyright (c) 2012, 2014, 2015, 2016 nghttp2 contributors archive hash - 0094031715662be626f5106ff6c814f4fc3dacfa + f98c30b20120511ecceab8bf1b5eba048b10aade hash_algorithm sha1 url - https://github.com/secondlife/3p-zlib-ng/releases/download/v2.2.1-r2/zlib_ng-2.2.1-r2-windows64-10324415171.tar.zst + https://github.com/secondlife/3p-zlib-ng/releases/download/v2.2.2-r1/zlib_ng-2.2.2-dev0.gcaa101e.d20241120-windows64-11943461931.tar.zst name windows64 @@ -2848,7 +2836,7 @@ Copyright (c) 2012, 2014, 2015, 2016 nghttp2 contributors copyright Copyright (C) 1995-2013 Jean-loup Gailly and Mark Adler version - 2.2.1-r2 + 2.2.2-dev0.gcaa101e.d20241120 name zlib-ng canonical_repo diff --git a/indra/cmake/APR.cmake b/indra/cmake/APR.cmake index 97b316c4c7..e0807a7d19 100644 --- a/indra/cmake/APR.cmake +++ b/indra/cmake/APR.cmake @@ -9,35 +9,25 @@ use_system_binary( apr apr-util ) use_prebuilt_binary(apr_suite) if (WINDOWS) - if (LLCOMMON_LINK_SHARED) - set(APR_selector "lib") - else (LLCOMMON_LINK_SHARED) - set(APR_selector "") - endif (LLCOMMON_LINK_SHARED) - target_link_libraries( ll::apr INTERFACE - ${ARCH_PREBUILT_DIRS_RELEASE}/${APR_selector}apr-1.lib - ${ARCH_PREBUILT_DIRS_RELEASE}/${APR_selector}aprutil-1.lib - ) - target_compile_definitions( ll::apr INTERFACE APR_DECLARE_STATIC=1 APU_DECLARE_STATIC=1 API_DECLARE_STATIC=1) -elseif (DARWIN) - if (LLCOMMON_LINK_SHARED) - set(APR_selector "0.dylib") - set(APRUTIL_selector "0.dylib") - else (LLCOMMON_LINK_SHARED) - set(APR_selector "a") - set(APRUTIL_selector "a") - endif (LLCOMMON_LINK_SHARED) - - target_link_libraries( ll::apr INTERFACE - ${ARCH_PREBUILT_DIRS_RELEASE}/libapr-1.${APR_selector} - ${ARCH_PREBUILT_DIRS_RELEASE}/libaprutil-1.${APR_selector} - iconv - ) -else() - target_link_libraries( ll::apr INTERFACE - ${ARCH_PREBUILT_DIRS_RELEASE}/libapr-1.a - ${ARCH_PREBUILT_DIRS_RELEASE}/libaprutil-1.a - rt - ) + target_compile_definitions(ll::apr INTERFACE APR_DECLARE_STATIC=1 APU_DECLARE_STATIC=1 API_DECLARE_STATIC=1) endif () -target_include_directories( ll::apr SYSTEM INTERFACE ${LIBS_PREBUILT_DIR}/include/apr-1 ) + +find_library(APR_LIBRARY + NAMES + apr-1.lib + libapr-1.a + PATHS "${ARCH_PREBUILT_DIRS_RELEASE}" REQUIRED NO_DEFAULT_PATH) + +find_library(APRUTIL_LIBRARY + NAMES + aprutil-1.lib + libaprutil-1.a + PATHS "${ARCH_PREBUILT_DIRS_RELEASE}" REQUIRED NO_DEFAULT_PATH) + +target_link_libraries(ll::apr INTERFACE ${APR_LIBRARY} ${APRUTIL_LIBRARY}) + +if(DARWIN) + target_link_libraries(ll::apr INTERFACE iconv) +endif() + +target_include_directories(ll::apr SYSTEM INTERFACE ${LIBS_PREBUILT_DIR}/include/apr-1) diff --git a/indra/cmake/Audio.cmake b/indra/cmake/Audio.cmake index 8c82749cab..6f61b056e0 100644 --- a/indra/cmake/Audio.cmake +++ b/indra/cmake/Audio.cmake @@ -9,23 +9,29 @@ use_system_binary(vorbis) use_prebuilt_binary(ogg_vorbis) target_include_directories( ll::vorbis SYSTEM INTERFACE ${LIBS_PREBUILT_DIR}/include ) -if (WINDOWS) - target_link_libraries(ll::vorbis INTERFACE - optimized ${ARCH_PREBUILT_DIRS_RELEASE}/libogg.lib - debug ${ARCH_PREBUILT_DIRS_DEBUG}/libogg.lib - optimized ${ARCH_PREBUILT_DIRS_RELEASE}/libvorbisenc.lib - debug ${ARCH_PREBUILT_DIRS_DEBUG}/libvorbisenc.lib - optimized ${ARCH_PREBUILT_DIRS_RELEASE}/libvorbisfile.lib - debug ${ARCH_PREBUILT_DIRS_DEBUG}/libvorbisfile.lib - optimized ${ARCH_PREBUILT_DIRS_RELEASE}/libvorbis.lib - debug ${ARCH_PREBUILT_DIRS_DEBUG}/libvorbis.lib - ) -else (WINDOWS) - target_link_libraries(ll::vorbis INTERFACE - ${ARCH_PREBUILT_DIRS_RELEASE}/libogg.a - ${ARCH_PREBUILT_DIRS_RELEASE}/libvorbisenc.a - ${ARCH_PREBUILT_DIRS_RELEASE}/libvorbisfile.a - ${ARCH_PREBUILT_DIRS_RELEASE}/libvorbis.a - ) -endif (WINDOWS) +find_library(OGG_LIBRARY + NAMES + libogg.lib + libogg.a + PATHS "${ARCH_PREBUILT_DIRS_RELEASE}" REQUIRED NO_DEFAULT_PATH) + +find_library(VORBIS_LIBRARY + NAMES + libvorbis.lib + libvorbis.a + PATHS "${ARCH_PREBUILT_DIRS_RELEASE}" REQUIRED NO_DEFAULT_PATH) + +find_library(VORBISENC_LIBRARY + NAMES + libvorbisenc.lib + libvorbisenc.a + PATHS "${ARCH_PREBUILT_DIRS_RELEASE}" REQUIRED NO_DEFAULT_PATH) + +find_library(VORBISFILE_LIBRARY + NAMES + libvorbisfile.lib + libvorbisfile.a + PATHS "${ARCH_PREBUILT_DIRS_RELEASE}" REQUIRED NO_DEFAULT_PATH) + +target_link_libraries(ll::vorbis INTERFACE ${OGG_LIBRARY} ${VORBISENC_LIBRARY} ${VORBISFILE_LIBRARY} ${VORBIS_LIBRARY}) diff --git a/indra/cmake/Boost.cmake b/indra/cmake/Boost.cmake index 8c5b946753..518e678585 100644 --- a/indra/cmake/Boost.cmake +++ b/indra/cmake/Boost.cmake @@ -16,41 +16,65 @@ use_prebuilt_binary(boost) # with the address size. set(addrsfx "-x${ADDRESS_SIZE}") -if (WINDOWS) - target_link_libraries( ll::boost INTERFACE - libboost_context-mt${addrsfx} - libboost_fiber-mt${addrsfx} - libboost_filesystem-mt${addrsfx} - libboost_program_options-mt${addrsfx} - libboost_regex-mt${addrsfx} - libboost_system-mt${addrsfx} - libboost_thread-mt${addrsfx} - libboost_url-mt${addrsfx}) -elseif (LINUX) - target_link_libraries( ll::boost INTERFACE - boost_context-mt${addrsfx} - boost_fiber-mt${addrsfx} - boost_filesystem-mt${addrsfx} - boost_program_options-mt${addrsfx} - boost_regex-mt${addrsfx} - boost_signals-mt${addrsfx} - boost_system-mt${addrsfx} - boost_thread-mt${addrsfx} - boost_url-mt${addrsfx}) -elseif (DARWIN) - target_link_libraries( ll::boost INTERFACE - boost_context-mt${addrsfx} - boost_fiber-mt${addrsfx} - boost_filesystem-mt${addrsfx} - boost_program_options-mt${addrsfx} - boost_regex-mt${addrsfx} - boost_system-mt${addrsfx} - boost_thread-mt${addrsfx} - boost_url-mt${addrsfx}) -endif (WINDOWS) +find_library(BOOST_CONTEXT_LIBRARY + NAMES + boost_context-mt + boost_context-mt${addrsfx} + PATHS "${ARCH_PREBUILT_DIRS_RELEASE}" REQUIRED NO_DEFAULT_PATH) + +find_library(BOOST_FIBER_LIBRARY + NAMES + boost_fiber-mt + boost_fiber-mt${addrsfx} + PATHS "${ARCH_PREBUILT_DIRS_RELEASE}" REQUIRED NO_DEFAULT_PATH) + +find_library(BOOST_FILESYSTEM_LIBRARY + NAMES + boost_filesystem-mt + boost_filesystem-mt${addrsfx} + PATHS "${ARCH_PREBUILT_DIRS_RELEASE}" REQUIRED NO_DEFAULT_PATH) + +find_library(BOOST_PROGRAMOPTIONS_LIBRARY + NAMES + boost_program_options-mt + boost_program_options-mt${addrsfx} + PATHS "${ARCH_PREBUILT_DIRS_RELEASE}" REQUIRED NO_DEFAULT_PATH) + +find_library(BOOST_REGEX_LIBRARY + NAMES + boost_regex-mt + boost_regex-mt${addrsfx} + PATHS "${ARCH_PREBUILT_DIRS_RELEASE}" REQUIRED NO_DEFAULT_PATH) + +find_library(BOOST_SYSTEM_LIBRARY + NAMES + boost_system-mt + boost_system-mt${addrsfx} + PATHS "${ARCH_PREBUILT_DIRS_RELEASE}" REQUIRED NO_DEFAULT_PATH) + +find_library(BOOST_THREAD_LIBRARY + NAMES + boost_thread-mt + boost_thread-mt${addrsfx} + PATHS "${ARCH_PREBUILT_DIRS_RELEASE}" REQUIRED NO_DEFAULT_PATH) + +find_library(BOOST_URL_LIBRARY + NAMES + boost_url-mt + boost_url-mt${addrsfx} + PATHS "${ARCH_PREBUILT_DIRS_RELEASE}" REQUIRED NO_DEFAULT_PATH) + +target_link_libraries(ll::boost INTERFACE + ${BOOST_CONTEXT_LIBRARY} + ${BOOST_FIBER_LIBRARY} + ${BOOST_FILESYSTEM_LIBRARY} + ${BOOST_PROGRAMOPTIONS_LIBRARY} + ${BOOST_REGEX_LIBRARY} + ${BOOST_SYSTEM_LIBRARY} + ${BOOST_THREAD_LIBRARY} + ${BOOST_URL_LIBRARY}) if (LINUX) - set(BOOST_SYSTEM_LIBRARY ${BOOST_SYSTEM_LIBRARY} rt) - set(BOOST_THREAD_LIBRARY ${BOOST_THREAD_LIBRARY} rt) + target_link_libraries(ll::boost INTERFACE rt) endif (LINUX) diff --git a/indra/cmake/CURL.cmake b/indra/cmake/CURL.cmake index eea0a2da62..b1595d57a8 100644 --- a/indra/cmake/CURL.cmake +++ b/indra/cmake/CURL.cmake @@ -7,19 +7,13 @@ add_library( ll::libcurl INTERFACE IMPORTED ) use_system_binary(libcurl) use_prebuilt_binary(curl) -if (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 () + +find_library(CURL_LIBRARY + NAMES + libcurl.lib + libcurl.a + PATHS "${ARCH_PREBUILT_DIRS_RELEASE}" REQUIRED NO_DEFAULT_PATH) + +target_link_libraries(ll::libcurl INTERFACE ${CURL_LIBRARY} ll::openssl ll::nghttp2 ll::zlib-ng) + target_include_directories( ll::libcurl SYSTEM INTERFACE ${LIBS_PREBUILT_DIR}/include) diff --git a/indra/cmake/Copy3rdPartyLibs.cmake b/indra/cmake/Copy3rdPartyLibs.cmake index 6ac00fd131..2ac82308cf 100644 --- a/indra/cmake/Copy3rdPartyLibs.cmake +++ b/indra/cmake/Copy3rdPartyLibs.cmake @@ -56,11 +56,6 @@ if(WINDOWS) openjp2.dll ) - if(LLCOMMON_LINK_SHARED) - set(release_files ${release_files} libapr-1.dll) - set(release_files ${release_files} libaprutil-1.dll) - endif() - # Filenames are different for 32/64 bit BugSplat file and we don't # have any control over them so need to branch. if (USE_BUGSPLAT) @@ -171,15 +166,6 @@ elseif(DARWIN) libndofdev.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 () @@ -225,13 +211,6 @@ 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 1a0b8789dc..fe6dced795 100644 --- a/indra/cmake/EXPAT.cmake +++ b/indra/cmake/EXPAT.cmake @@ -2,18 +2,21 @@ include(Prebuilt) include_guard() -add_library( ll::expat INTERFACE IMPORTED ) +add_library(ll::expat INTERFACE IMPORTED) use_system_binary(expat) use_prebuilt_binary(expat) + if (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) + target_compile_definitions(ll::expat INTERFACE XML_STATIC=1) endif () -target_include_directories( ll::expat SYSTEM INTERFACE ${LIBS_PREBUILT_DIR}/include ) + +find_library(EXPAT_LIBRARY + NAMES + libexpat.lib + libexpat.a + PATHS "${ARCH_PREBUILT_DIRS_RELEASE}" REQUIRED NO_DEFAULT_PATH) + +target_link_libraries(ll::expat INTERFACE ${EXPAT_LIBRARY}) + +target_include_directories(ll::expat SYSTEM INTERFACE ${LIBS_PREBUILT_DIR}/include) diff --git a/indra/cmake/FreeType.cmake b/indra/cmake/FreeType.cmake index 563491556d..3c635e851b 100644 --- a/indra/cmake/FreeType.cmake +++ b/indra/cmake/FreeType.cmake @@ -9,9 +9,10 @@ use_system_binary(freetype) use_prebuilt_binary(freetype) target_include_directories( ll::freetype SYSTEM INTERFACE ${LIBS_PREBUILT_DIR}/include/freetype2/) -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() +find_library(FREETYPE_LIBRARY + NAMES + freetype.lib + libfreetype.a + PATHS "${ARCH_PREBUILT_DIRS_RELEASE}" REQUIRED NO_DEFAULT_PATH) +target_link_libraries(ll::freetype INTERFACE ${FREETYPE_LIBRARY}) diff --git a/indra/cmake/Hunspell.cmake b/indra/cmake/Hunspell.cmake index 129679febd..b063363bc0 100644 --- a/indra/cmake/Hunspell.cmake +++ b/indra/cmake/Hunspell.cmake @@ -8,17 +8,17 @@ use_prebuilt_binary(dictionaries) add_library( ll::hunspell INTERFACE IMPORTED ) use_system_binary(hunspell) use_prebuilt_binary(libhunspell) + if (WINDOWS) target_compile_definitions( ll::hunspell INTERFACE HUNSPELL_STATIC=1) - target_link_libraries( ll::hunspell INTERFACE - debug ${ARCH_PREBUILT_DIRS_DEBUG}/libhunspell.lib - optimized ${ARCH_PREBUILT_DIRS_RELEASE}/libhunspell.lib - ) -elseif(DARWIN) - target_link_libraries( ll::hunspell INTERFACE ${ARCH_PREBUILT_DIRS_RELEASE}/libhunspell-1.7.a - ) -elseif(LINUX) - target_link_libraries( ll::hunspell INTERFACE ${ARCH_PREBUILT_DIRS_RELEASE}/libhunspell-1.7.a - ) endif() + +find_library(HUNSPELL_LIBRARY + NAMES + libhunspell.lib + libhunspell-1.7.a + PATHS "${ARCH_PREBUILT_DIRS_RELEASE}" REQUIRED NO_DEFAULT_PATH) + +target_link_libraries(ll::hunspell INTERFACE ${HUNSPELL_LIBRARY}) + target_include_directories( ll::hunspell SYSTEM INTERFACE ${LIBS_PREBUILT_DIR}/include/hunspell) diff --git a/indra/cmake/JPEG.cmake b/indra/cmake/JPEG.cmake index ade5a070cc..f864ca7f8d 100644 --- a/indra/cmake/JPEG.cmake +++ b/indra/cmake/JPEG.cmake @@ -8,13 +8,13 @@ add_library( ll::libjpeg INTERFACE IMPORTED ) use_system_binary(libjpeg) use_prebuilt_binary(libjpeg-turbo) -if (LINUX) - target_link_libraries( ll::libjpeg INTERFACE ${ARCH_PREBUILT_DIRS_RELEASE}/libjpeg.a) -elseif (DARWIN) - target_link_libraries( ll::libjpeg INTERFACE ${ARCH_PREBUILT_DIRS_RELEASE}/libjpeg.a) -elseif (WINDOWS) - target_link_libraries( ll::libjpeg INTERFACE - debug ${ARCH_PREBUILT_DIRS_DEBUG}/jpeg.lib - optimized ${ARCH_PREBUILT_DIRS_RELEASE}/jpeg.lib) -endif (LINUX) -target_include_directories( ll::libjpeg SYSTEM INTERFACE ${LIBS_PREBUILT_DIR}/include) + +find_library(JPEG_LIBRARY + NAMES + jpeg.lib + libjpeg.a + PATHS "${ARCH_PREBUILT_DIRS_RELEASE}" REQUIRED NO_DEFAULT_PATH) + +target_link_libraries(ll::libjpeg INTERFACE ${JPEG_LIBRARY}) + +target_include_directories(ll::libjpeg SYSTEM INTERFACE ${LIBS_PREBUILT_DIR}/include) diff --git a/indra/cmake/LLPrimitive.cmake b/indra/cmake/LLPrimitive.cmake index d0a52ffb63..2699f8efee 100644 --- a/indra/cmake/LLPrimitive.cmake +++ b/indra/cmake/LLPrimitive.cmake @@ -24,26 +24,35 @@ use_prebuilt_binary(colladadom) use_prebuilt_binary(minizip-ng) # needed for colladadom use_prebuilt_binary(libxml2) -if (WINDOWS) - target_link_libraries( ll::minizip-ng INTERFACE ${ARCH_PREBUILT_DIRS_RELEASE}/minizip.lib ) -else() - target_link_libraries( ll::minizip-ng INTERFACE ${ARCH_PREBUILT_DIRS_RELEASE}/libminizip.a ) -endif() +find_library(MINIZIPNG_LIBRARY + NAMES + minizip.lib + libminizip.a + PATHS "${ARCH_PREBUILT_DIRS_RELEASE}" REQUIRED NO_DEFAULT_PATH) + +target_link_libraries(ll::minizip-ng INTERFACE ${MINIZIPNG_LIBRARY}) + +find_library(LIBXML2_LIBRARY + NAMES + libxml2.lib + libxml2.a + PATHS "${ARCH_PREBUILT_DIRS_RELEASE}" REQUIRED NO_DEFAULT_PATH) + +target_link_libraries(ll::libxml INTERFACE ${LIBXML2_LIBRARY}) if (WINDOWS) - target_link_libraries( ll::libxml INTERFACE ${ARCH_PREBUILT_DIRS_RELEASE}/libxml2.lib Bcrypt.lib) -else() - target_link_libraries( ll::libxml INTERFACE ${ARCH_PREBUILT_DIRS_RELEASE}/libxml2.a) + target_link_libraries( ll::libxml INTERFACE Bcrypt.lib) endif() target_include_directories( ll::colladadom SYSTEM INTERFACE ${LIBS_PREBUILT_DIR}/include/collada ${LIBS_PREBUILT_DIR}/include/collada/1.4 ) -if (WINDOWS) - target_link_libraries(ll::colladadom INTERFACE ${ARCH_PREBUILT_DIRS_RELEASE}/libcollada14dom23-s.lib ll::libxml ll::minizip-ng ) -elseif (DARWIN) - target_link_libraries(ll::colladadom INTERFACE collada14dom ll::boost ll::libxml ll::minizip-ng) -elseif (LINUX) - target_link_libraries(ll::colladadom INTERFACE collada14dom ll::boost ll::libxml ll::minizip-ng) -endif() + +find_library(COLLADADOM_LIBRARY + NAMES + libcollada14dom23-s.lib + collada14dom + PATHS "${ARCH_PREBUILT_DIRS_RELEASE}" REQUIRED NO_DEFAULT_PATH) + +target_link_libraries(ll::colladadom INTERFACE ${COLLADADOM_LIBRARY} ll::boost ll::libxml ll::minizip-ng) diff --git a/indra/cmake/LibVLCPlugin.cmake b/indra/cmake/LibVLCPlugin.cmake index 599ce02844..6361028c0c 100644 --- a/indra/cmake/LibVLCPlugin.cmake +++ b/indra/cmake/LibVLCPlugin.cmake @@ -9,20 +9,16 @@ use_prebuilt_binary(vlc-bin) set(LIBVLCPLUGIN ON CACHE BOOL "LIBVLCPLUGIN support for the llplugin/llmedia test apps.") -if (WINDOWS) - target_link_libraries( ll::libvlc INTERFACE - libvlc.lib - libvlccore.lib - ) -elseif (DARWIN) - target_link_libraries( ll::libvlc INTERFACE - libvlc.dylib - libvlccore.dylib - ) -elseif (LINUX) - # Specify a full path to make sure we get a static link - target_link_libraries( ll::libvlc INTERFACE - ${LIBS_PREBUILT_DIR}/lib/libvlc.a - ${LIBS_PREBUILT_DIR}/lib/libvlccore.a - ) -endif (WINDOWS) +find_library(VLC_LIBRARY + NAMES + libvlc.lib + libvlc.dylib + PATHS "${ARCH_PREBUILT_DIRS_RELEASE}" REQUIRED NO_DEFAULT_PATH) + +find_library(VLCCORE_LIBRARY + NAMES + libvlccore.lib + libvlccore.dylib + PATHS "${ARCH_PREBUILT_DIRS_RELEASE}" REQUIRED NO_DEFAULT_PATH) + +target_link_libraries(ll::libvlc INTERFACE ${VLC_LIBRARY} ${VLCCORE_LIBRARY}) diff --git a/indra/cmake/Meshoptimizer.cmake b/indra/cmake/Meshoptimizer.cmake index fd144d2b97..af1c51f032 100644 --- a/indra/cmake/Meshoptimizer.cmake +++ b/indra/cmake/Meshoptimizer.cmake @@ -9,12 +9,12 @@ add_library( ll::meshoptimizer INTERFACE IMPORTED ) use_system_binary(meshoptimizer) use_prebuilt_binary(meshoptimizer) -if (WINDOWS) - target_link_libraries( ll::meshoptimizer INTERFACE meshoptimizer.lib) -elseif (LINUX) - target_link_libraries( ll::meshoptimizer INTERFACE meshoptimizer.o) -elseif (DARWIN) - target_link_libraries( ll::meshoptimizer INTERFACE libmeshoptimizer.a) -endif (WINDOWS) +find_library(MESHOPTIMIZER_LIBRARY + NAMES + meshoptimizer.lib + libmeshoptimizer.a + PATHS "${ARCH_PREBUILT_DIRS_RELEASE}" REQUIRED NO_DEFAULT_PATH) -target_include_directories( ll::meshoptimizer SYSTEM INTERFACE ${LIBS_PREBUILT_DIR}/include/meshoptimizer) +target_link_libraries(ll::meshoptimizer INTERFACE ${MESHOPTIMIZER_LIBRARY}) + +target_include_directories(ll::meshoptimizer SYSTEM INTERFACE ${LIBS_PREBUILT_DIR}/include/meshoptimizer) diff --git a/indra/cmake/NDOF.cmake b/indra/cmake/NDOF.cmake index b88fbccf2a..a8f63f945b 100644 --- a/indra/cmake/NDOF.cmake +++ b/indra/cmake/NDOF.cmake @@ -13,12 +13,15 @@ if (NDOF) use_prebuilt_binary(open-libndofdev) endif (WINDOWS OR DARWIN) - if (WINDOWS) - target_link_libraries( ll::ndof INTERFACE libndofdev) - elseif (DARWIN OR LINUX) - target_link_libraries( ll::ndof INTERFACE ndofdev) - endif (WINDOWS) - target_compile_definitions( ll::ndof INTERFACE LIB_NDOF=1) + find_library(NDOF_LIBRARY + NAMES + libndofdev + ndofdev + PATHS "${ARCH_PREBUILT_DIRS_RELEASE}" REQUIRED NO_DEFAULT_PATH) + + target_link_libraries(ll::ndof INTERFACE ${NDOF_LIBRARY}) + + target_compile_definitions(ll::ndof INTERFACE LIB_NDOF=1) endif (NDOF) diff --git a/indra/cmake/NGHTTP2.cmake b/indra/cmake/NGHTTP2.cmake index 7b2aa5971f..e81204d716 100644 --- a/indra/cmake/NGHTTP2.cmake +++ b/indra/cmake/NGHTTP2.cmake @@ -6,9 +6,12 @@ add_library( ll::nghttp2 INTERFACE IMPORTED ) use_system_binary(nghttp2) use_prebuilt_binary(nghttp2) -if (WINDOWS) - target_link_libraries( ll::nghttp2 INTERFACE ${ARCH_PREBUILT_DIRS_RELEASE}/nghttp2.lib) -else () - target_link_libraries( ll::nghttp2 INTERFACE ${ARCH_PREBUILT_DIRS_RELEASE}/libnghttp2.a) -endif () + +find_library(NGHTTP2_LIBRARY + NAMES + nghttp2.lib + libnghttp2.a + PATHS "${ARCH_PREBUILT_DIRS_RELEASE}" REQUIRED NO_DEFAULT_PATH) + +target_link_libraries(ll::nghttp2 INTERFACE ${NGHTTP2_LIBRARY}) target_include_directories( ll::nghttp2 SYSTEM INTERFACE ${LIBS_PREBUILT_DIR}/include/nghttp2) diff --git a/indra/cmake/OPENAL.cmake b/indra/cmake/OPENAL.cmake index 0a7529c6c3..2566a08189 100644 --- a/indra/cmake/OPENAL.cmake +++ b/indra/cmake/OPENAL.cmake @@ -22,20 +22,17 @@ if (USE_OPENAL) target_compile_definitions( ll::openal INTERFACE LL_OPENAL=1) use_prebuilt_binary(openal) - if(WINDOWS) - target_link_libraries( ll::openal INTERFACE - OpenAL32 - alut - ) - elseif(LINUX) - target_link_libraries( ll::openal INTERFACE - openal - alut - ) - else() - target_link_libraries( ll::openal INTERFACE - openal - alut - ) - endif() + find_library(OPENAL_LIBRARY + NAMES + OpenAL32 + openal + PATHS "${ARCH_PREBUILT_DIRS_RELEASE}" REQUIRED NO_DEFAULT_PATH) + + find_library(ALUT_LIBRARY + NAMES + alut + PATHS "${ARCH_PREBUILT_DIRS_RELEASE}" REQUIRED NO_DEFAULT_PATH) + + target_link_libraries(ll::openal INTERFACE ${OPENAL_LIBRARY} ${ALUT_LIBRARY}) + endif () diff --git a/indra/cmake/OpenJPEG.cmake b/indra/cmake/OpenJPEG.cmake index c4aab2e9e5..d31df57689 100644 --- a/indra/cmake/OpenJPEG.cmake +++ b/indra/cmake/OpenJPEG.cmake @@ -7,5 +7,11 @@ add_library( ll::openjpeg INTERFACE IMPORTED ) use_system_binary(openjpeg) use_prebuilt_binary(openjpeg) -target_link_libraries(ll::openjpeg INTERFACE openjp2 ) -target_include_directories( ll::openjpeg SYSTEM INTERFACE ${LIBS_PREBUILT_DIR}/include/openjpeg) +find_library(OPENJPEG_LIBRARY + NAMES + openjp2 + PATHS "${ARCH_PREBUILT_DIRS_RELEASE}" REQUIRED NO_DEFAULT_PATH) + +target_link_libraries(ll::openjpeg INTERFACE ${OPENJPEG_LIBRARY}) + +target_include_directories(ll::openjpeg SYSTEM INTERFACE ${LIBS_PREBUILT_DIR}/include/openjpeg) diff --git a/indra/cmake/OpenSSL.cmake b/indra/cmake/OpenSSL.cmake index 67a84e14af..9d33f2e0de 100644 --- a/indra/cmake/OpenSSL.cmake +++ b/indra/cmake/OpenSSL.cmake @@ -7,12 +7,24 @@ add_library( ll::openssl INTERFACE IMPORTED ) use_system_binary(openssl) use_prebuilt_binary(openssl) + +find_library(SSL_LIBRARY + NAMES + libssl.lib + libssl.a + PATHS "${ARCH_PREBUILT_DIRS_RELEASE}" REQUIRED NO_DEFAULT_PATH) + +find_library(CRYPTO_LIBRARY + NAMES + libcrypto.lib + libcrypto.a + PATHS "${ARCH_PREBUILT_DIRS_RELEASE}" REQUIRED NO_DEFAULT_PATH) + +target_link_libraries(ll::openssl INTERFACE ${SSL_LIBRARY} ${CRYPTO_LIBRARY}) + if (WINDOWS) - target_link_libraries(ll::openssl INTERFACE ${ARCH_PREBUILT_DIRS_RELEASE}/libssl.lib ${ARCH_PREBUILT_DIRS_RELEASE}/libcrypto.lib Crypt32.lib) -elseif (LINUX) - target_link_libraries(ll::openssl INTERFACE ${ARCH_PREBUILT_DIRS_RELEASE}/libssl.a ${ARCH_PREBUILT_DIRS_RELEASE}/libcrypto.a dl) -else() - target_link_libraries(ll::openssl INTERFACE ssl crypto) + target_link_libraries(ll::openssl INTERFACE Crypt32.lib) endif (WINDOWS) -target_include_directories( ll::openssl SYSTEM INTERFACE ${LIBS_PREBUILT_DIR}/include) + +target_include_directories(ll::openssl SYSTEM INTERFACE ${LIBS_PREBUILT_DIR}/include) diff --git a/indra/cmake/PNG.cmake b/indra/cmake/PNG.cmake index e5893e9a20..0c01e5ee78 100644 --- a/indra/cmake/PNG.cmake +++ b/indra/cmake/PNG.cmake @@ -6,9 +6,12 @@ add_library( ll::libpng INTERFACE IMPORTED ) use_system_binary(libpng) use_prebuilt_binary(libpng) -if (WINDOWS) - target_link_libraries(ll::libpng INTERFACE ${ARCH_PREBUILT_DIRS_RELEASE}/libpng16.lib) -else() - 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) + +find_library(LIBPNG_LIBRARY + NAMES + libpng16.lib + libpng16.a + PATHS "${ARCH_PREBUILT_DIRS_RELEASE}" REQUIRED NO_DEFAULT_PATH) + +target_link_libraries(ll::libpng INTERFACE ${LIBPNG_LIBRARY}) +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 d7b920da26..a6d67489e7 100644 --- a/indra/cmake/ZLIBNG.cmake +++ b/indra/cmake/ZLIBNG.cmake @@ -11,11 +11,14 @@ if(USE_CONAN ) endif() use_prebuilt_binary(zlib-ng) -if (WINDOWS) - target_link_libraries( ll::zlib-ng INTERFACE ${ARCH_PREBUILT_DIRS_RELEASE}/zlib.lib ) -else() - target_link_libraries( ll::zlib-ng INTERFACE ${ARCH_PREBUILT_DIRS_RELEASE}/libz.a ) -endif (WINDOWS) + +find_library(ZLIBNG_LIBRARY + NAMES + zlib.lib + libz.a + PATHS "${ARCH_PREBUILT_DIRS_RELEASE}" REQUIRED NO_DEFAULT_PATH) + +target_link_libraries(ll::zlib-ng INTERFACE ${ZLIBNG_LIBRARY}) if( NOT LINUX ) target_include_directories( ll::zlib-ng SYSTEM INTERFACE ${LIBS_PREBUILT_DIR}/include/zlib-ng) diff --git a/indra/llimagej2coj/llimagej2coj.cpp b/indra/llimagej2coj/llimagej2coj.cpp index f4bcb97a5d..a5943fc0ef 100644 --- a/indra/llimagej2coj/llimagej2coj.cpp +++ b/indra/llimagej2coj/llimagej2coj.cpp @@ -29,8 +29,6 @@ // this is defined so that we get static linking. #include "openjpeg.h" -#include "event.h" -#include "cio.h" #define MAX_ENCODED_DISCARD_LEVELS 5 @@ -50,6 +48,7 @@ std::string LLImageJ2COJ::getEngineInfo() const #endif } +#if WANT_VERBOSE_OPJ_SPAM // Return string from message, eliminating final \n if present static std::string chomp(const char* msg) { @@ -65,27 +64,34 @@ static std::string chomp(const char* msg) } return message; } +#endif /** sample error callback expecting a LLFILE* client object */ void error_callback(const char* msg, void*) { - LL_DEBUGS() << "LLImageJ2COJ: " << chomp(msg) << LL_ENDL; +#if WANT_VERBOSE_OPJ_SPAM + LL_WARNS() << "LLImageJ2COJ: " << chomp(msg) << LL_ENDL; +#endif } /** sample warning callback expecting a LLFILE* client object */ void warning_callback(const char* msg, void*) { - LL_DEBUGS() << "LLImageJ2COJ: " << chomp(msg) << LL_ENDL; +#if WANT_VERBOSE_OPJ_SPAM + LL_WARNS() << "LLImageJ2COJ: " << chomp(msg) << LL_ENDL; +#endif } /** sample debug callback expecting no client object */ void info_callback(const char* msg, void*) { - LL_DEBUGS() << "LLImageJ2COJ: " << chomp(msg) << LL_ENDL; +#if WANT_VERBOSE_OPJ_SPAM + LL_INFOS() << "LLImageJ2COJ: " << chomp(msg) << LL_ENDL; +#endif } // Divide a by 2 to the power of b and round upwards @@ -97,39 +103,13 @@ int ceildivpow2(int a, int b) class JPEG2KBase { public: - JPEG2KBase() {} + JPEG2KBase() = default; U8* buffer = nullptr; OPJ_SIZE_T size = 0; OPJ_OFF_T offset = 0; }; -#define WANT_VERBOSE_OPJ_SPAM LL_DEBUG - -static void opj_info(const char* msg, void* user_data) -{ - llassert(user_data); -#if WANT_VERBOSE_OPJ_SPAM - LL_INFOS("OpenJPEG") << msg << LL_ENDL; -#endif -} - -static void opj_warn(const char* msg, void* user_data) -{ - llassert(user_data); -#if WANT_VERBOSE_OPJ_SPAM - LL_WARNS("OpenJPEG") << msg << LL_ENDL; -#endif -} - -static void opj_error(const char* msg, void* user_data) -{ - llassert(user_data); -#if WANT_VERBOSE_OPJ_SPAM - LL_WARNS("OpenJPEG") << msg << LL_ENDL; -#endif -} - static OPJ_SIZE_T opj_read(void * buffer, OPJ_SIZE_T bytes, void* user_data) { llassert(user_data); @@ -222,11 +202,7 @@ public: JPEG2KDecode(S8 discardLevel) { - memset(&event_mgr, 0, sizeof(opj_event_mgr_t)); memset(¶meters, 0, sizeof(opj_dparameters_t)); - event_mgr.error_handler = error_callback; - event_mgr.warning_handler = warning_callback; - event_mgr.info_handler = info_callback; opj_set_default_decoder_parameters(¶meters); parameters.cp_reduce = discardLevel; } @@ -270,6 +246,11 @@ public: decoder = opj_create_decompress(OPJ_CODEC_J2K); + /* catch events using our callbacks and give a local context */ + opj_set_error_handler(decoder, error_callback, nullptr); + opj_set_warning_handler(decoder, warning_callback, nullptr); + opj_set_info_handler(decoder, info_callback, nullptr); + if (!opj_setup_decoder(decoder, ¶meters)) { return false; @@ -340,9 +321,9 @@ public: decoder = opj_create_decompress(OPJ_CODEC_J2K); opj_setup_decoder(decoder, ¶meters); - opj_set_info_handler(decoder, opj_info, this); - opj_set_warning_handler(decoder, opj_warn, this); - opj_set_error_handler(decoder, opj_error, this); + opj_set_info_handler(decoder, info_callback, this); + opj_set_warning_handler(decoder, warning_callback, this); + opj_set_error_handler(decoder, error_callback, this); if (stream) { @@ -408,7 +389,6 @@ public: private: opj_dparameters_t parameters; - opj_event_mgr_t event_mgr; opj_image_t* image = nullptr; opj_codec_t* decoder = nullptr; opj_stream_t* stream = nullptr; @@ -423,10 +403,6 @@ public: JPEG2KEncode(const char* comment_text_in, bool reversible) { memset(¶meters, 0, sizeof(opj_cparameters_t)); - memset(&event_mgr, 0, sizeof(opj_event_mgr_t)); - event_mgr.error_handler = error_callback; - event_mgr.warning_handler = warning_callback; - event_mgr.info_handler = info_callback; opj_set_default_encoder_parameters(¶meters); parameters.cod_format = OPJ_CODEC_J2K; @@ -493,6 +469,11 @@ public: encoder = opj_create_compress(OPJ_CODEC_J2K); + /* catch events using our callbacks and give a local context */ + opj_set_error_handler(encoder, error_callback, nullptr); + opj_set_warning_handler(encoder, warning_callback, nullptr); + opj_set_info_handler(encoder, info_callback, nullptr); + parameters.tcp_mct = (image->numcomps >= 3) ? 1 : 0; parameters.cod_format = OPJ_CODEC_J2K; parameters.prog_order = OPJ_RLCP; @@ -547,10 +528,6 @@ public: return false; } - opj_set_info_handler(encoder, opj_info, this); - opj_set_warning_handler(encoder, opj_warn, this); - opj_set_error_handler(encoder, opj_error, this); - U32 tile_count = (rawImageIn.getWidth() >> 6) * (rawImageIn.getHeight() >> 6); U32 data_size_guess = tile_count * TILE_SIZE; @@ -744,7 +721,6 @@ public: private: opj_cparameters_t parameters; - opj_event_mgr_t event_mgr; opj_image_t* image = nullptr; opj_codec_t* encoder = nullptr; opj_stream_t* stream = nullptr; diff --git a/indra/llwebrtc/CMakeLists.txt b/indra/llwebrtc/CMakeLists.txt index a18b716003..4fde489942 100644 --- a/indra/llwebrtc/CMakeLists.txt +++ b/indra/llwebrtc/CMakeLists.txt @@ -10,10 +10,6 @@ include(WebRTC) project(llwebrtc) -if (LINUX) - add_compile_options(-Wno-deprecated-declarations) # webrtc::CreateAudioDeviceWithDataObserver is deprecated -endif (LINUX) - set(llwebrtc_SOURCE_FILES llwebrtc.cpp ) @@ -65,6 +61,8 @@ target_include_directories( llwebrtc INTERFACE ${CMAKE_CURRENT_SOURCE_DIR}) if (WINDOWS) set_property(TARGET llwebrtc PROPERTY MSVC_RUNTIME_LIBRARY "MultiThreadedDebug") +else() + target_compile_options(llwebrtc PRIVATE -Wno-deprecated-declarations) # webrtc::CreateAudioDeviceWithDataObserver is deprecated endif (WINDOWS) ADD_CUSTOM_COMMAND(TARGET llwebrtc POST_BUILD diff --git a/indra/newview/CMakeLists.txt b/indra/newview/CMakeLists.txt index d2736c7c12..061738daae 100644 --- a/indra/newview/CMakeLists.txt +++ b/indra/newview/CMakeLists.txt @@ -1965,12 +1965,12 @@ target_link_libraries(${VIEWER_BINARY_NAME} llcommon llmeshoptimizer llwebrtc - ll::ndof lllogin llprimitive llappearance ${LLPHYSICSEXTENSIONS_LIBRARIES} ll::bugsplat + ll::ndof ll::tracy ll::openxr ) @@ -2104,16 +2104,14 @@ if (DARWIN) # https://blog.kitware.com/upcoming-in-cmake-2-8-12-osx-rpath-support/ set(CMAKE_MACOSX_RPATH 1) - + set_target_properties( ${VIEWER_BINARY_NAME} PROPERTIES OUTPUT_NAME "${product}" # From Contents/MacOS/SecondLife, look in Contents/Frameworks - INSTALL_RPATH "@loader_path/../Frameworks" - # SIGH, as of 2018-05-24 (cmake 3.11.1) the INSTALL_RPATH property simply - # does not work. Try this: - LINK_FLAGS "-rpath @loader_path/../Frameworks" + BUILD_WITH_INSTALL_RPATH 1 + INSTALL_RPATH "@executable_path/../Frameworks" MACOSX_BUNDLE_INFO_PLIST "${CMAKE_CURRENT_SOURCE_DIR}/Info-SecondLife.plist" XCODE_ATTRIBUTE_PRODUCT_BUNDLE_IDENTIFIER "${MACOSX_BUNDLE_GUI_IDENTIFIER}" ) diff --git a/indra/newview/viewer_manifest.py b/indra/newview/viewer_manifest.py index f9aaeabbfb..b92c9f931b 100755 --- a/indra/newview/viewer_manifest.py +++ b/indra/newview/viewer_manifest.py @@ -859,7 +859,9 @@ class Darwin_x86_64_Manifest(ViewerManifest): # CEF framework goes inside Contents/Frameworks. # Remember where we parked this car. - with self.prefix(src="", dst="Frameworks"): + with self.prefix(src=relpkgdir, dst="Frameworks"): + self.path("libndofdev.dylib") + CEF_framework = "Chromium Embedded Framework.framework" self.path2basename(relpkgdir, CEF_framework) CEF_framework = self.dst_path_of(CEF_framework) @@ -867,6 +869,22 @@ class Darwin_x86_64_Manifest(ViewerManifest): if self.args.get('bugsplat'): self.path2basename(relpkgdir, "BugsplatMac.framework") + # OpenAL dylibs + if self.args['openal'] == 'ON': + for libfile in ( + "libopenal.dylib", + "libalut.dylib", + ): + self.path(libfile) + + # WebRTC libraries + with self.prefix(src=os.path.join(self.args['build'], os.pardir, + 'sharedlibs', self.args['buildtype'], 'Resources')): + for libfile in ( + 'libllwebrtc.dylib', + ): + self.path(libfile) + with self.prefix(dst="MacOS"): executable = self.dst_path_of(self.channel()) if self.args.get('bugsplat'): @@ -926,9 +944,6 @@ class Darwin_x86_64_Manifest(ViewerManifest): self.path("*.png") self.path("*.gif") - with self.prefix(src=relpkgdir, dst=""): - self.path("libndofdev.dylib") - with self.prefix(src_dst="cursors_mac"): self.path("*.tif") @@ -988,20 +1003,6 @@ class Darwin_x86_64_Manifest(ViewerManifest): print("Skipping %s" % dst) return added - # WebRTC libraries - with self.prefix(src=os.path.join(self.args['build'], os.pardir, - 'sharedlibs', self.args['buildtype'], 'Resources')): - for libfile in ( - 'libllwebrtc.dylib', - ): - self.path(libfile) - - oldpath = os.path.join("@rpath", libfile) - self.run_command( - ['install_name_tool', '-change', oldpath, - '@executable_path/../Resources/%s' % libfile, - executable]) - # dylibs is a list of all the .dylib files we expect to need # in our bundled sub-apps. For each of these we'll create a # symlink from sub-app/Contents/Resources to the real .dylib. @@ -1019,14 +1020,6 @@ class Darwin_x86_64_Manifest(ViewerManifest): ): self.path2basename(relpkgdir, libfile) - # OpenAL dylibs - if self.args['openal'] == 'ON': - for libfile in ( - "libopenal.dylib", - "libalut.dylib", - ): - dylibs += path_optional(os.path.join(relpkgdir, libfile), libfile) - # our apps executable_path = {} embedded_apps = [ (os.path.join("llplugin", "slplugin"), "SLPlugin.app") ] -- cgit v1.2.3 From d5460dad48b407fd022025e8f7f69f47903afff1 Mon Sep 17 00:00:00 2001 From: Rye Date: Sun, 2 Feb 2025 07:09:05 -0500 Subject: Update macOS xib file and compile as part of build process --- indra/newview/CMakeLists.txt | 3 +- indra/newview/SecondLife.nib | Bin 12345 -> 0 bytes indra/newview/SecondLife.xib | 1327 ++++++-------------------------------- indra/newview/viewer_manifest.py | 1 - 4 files changed, 194 insertions(+), 1137 deletions(-) delete mode 100644 indra/newview/SecondLife.nib diff --git a/indra/newview/CMakeLists.txt b/indra/newview/CMakeLists.txt index 061738daae..6858b1d773 100644 --- a/indra/newview/CMakeLists.txt +++ b/indra/newview/CMakeLists.txt @@ -1436,7 +1436,7 @@ if (DARWIN) set(viewer_RESOURCE_FILES secondlife.icns Info-SecondLife.plist - SecondLife.xib/ + SecondLife.xib # CMake doesn't seem to support Xcode language variants well just yet English.lproj/InfoPlist.strings English.lproj/language.txt @@ -1909,6 +1909,7 @@ if (WINDOWS) elseif (DARWIN) set_target_properties(${VIEWER_BINARY_NAME} PROPERTIES + RESOURCE SecondLife.xib LINK_FLAGS_RELEASE "${LINK_FLAGS_RELEASE} -Xlinker -dead_strip -Xlinker -map -Xlinker ${CMAKE_CURRENT_BINARY_DIR}/${VIEWER_BINARY_NAME}.MAP" ) else (WINDOWS) diff --git a/indra/newview/SecondLife.nib b/indra/newview/SecondLife.nib deleted file mode 100644 index c4ddca50dc..0000000000 Binary files a/indra/newview/SecondLife.nib and /dev/null differ diff --git a/indra/newview/SecondLife.xib b/indra/newview/SecondLife.xib index fbff8fe307..781a390673 100644 --- a/indra/newview/SecondLife.xib +++ b/indra/newview/SecondLife.xib @@ -1,1136 +1,193 @@ - - - 1060 - 12E55 - 4457.6 - 1187.39 - 626.00 - - com.apple.InterfaceBuilder.CocoaPlugin - 4457.6 - - - NSCustomObject - NSMenu - NSMenuItem - NSScrollView - NSScroller - NSTextView - NSView - NSWindowTemplate - - - com.apple.InterfaceBuilder.CocoaPlugin - - - PluginDependencyRecalculationVersion - - - - - NSApplication - - - FirstResponder - - - NSApplication - - - Main Menu - - - - Second Life - - 2147483647 - - NSImage - NSMenuCheckmark - - - NSImage - NSMenuMixedState - - submenuAction: - - Second Life - - - - About Second Life - - 2147483647 - - - - - - YES - YES - - - 2147483647 - - - - - - Preferences… - , - 1048576 - 2147483647 - - - - - - YES - YES - - - 2147483647 - - - - - - Services - - 2147483647 - - - submenuAction: - - Services - - _NSServicesMenu - - - - - YES - YES - - - 2147483647 - - - - - - Hide Second Life - h - 1048576 - 2147483647 - - - - - - Hide Others - h - 1572864 - 2147483647 - - - - - - Show All - - 2147483647 - - - - - - YES - YES - - - 2147483647 - - - - - - Quit Second Life - q - 1048576 - 2147483647 - - - - - _NSAppleMenu - - - - - Edit - - 2147483647 - - - submenuAction: - - Edit - - - - Undo - z - 1048576 - 2147483647 - - - - - - Redo - Z - 1048576 - 2147483647 - - - - - - YES - YES - - - 2147483647 - - - - - - Cut - x - 1048576 - 2147483647 - - - - - - Copy - c - 1048576 - 2147483647 - - - - - - Paste - v - 1048576 - 2147483647 - - - - - - Select All - a - 1048576 - 2147483647 - - - - - - - - - Window - - 2147483647 - - - submenuAction: - - Window - - - - Minimize - m - 1048576 - 2147483647 - - - - - - Zoom - - 2147483647 - - - - - - Enter Full Screen - f - 1310720 - 2147483647 - - - - - - YES - YES - - - 2147483647 - - - - - - Bring All to Front - - 2147483647 - - - - - _NSWindowsMenu - - - - - Help - - 2147483647 - - - - - _NSMainMenu - - - LLAppDelegate - - - 15 - 2 - {{196, 240}, {1024, 600}} - 74974208 - Second Life - LLNSWindow - - - - - 256 - - {1024, 600} - - - _NS:20 - - {{0, 0}, {2560, 1418}} - {10000000000000, 10000000000000} - Second Life - 128 - NO - - - 31 - 2 - {{272, 176}, {938, 42}} - -1535638528 - Input Window - LLUserInputWindow - - - - - 256 - - - - 256 - - - - 2322 - - - - 2322 - - Apple HTML pasteboard type - Apple PDF pasteboard type - Apple PICT pasteboard type - Apple PNG pasteboard type - Apple URL pasteboard type - CorePasteboardFlavorType 0x6D6F6F76 - NSColor pasteboard type - NSFilenamesPboardType - NSStringPboardType - NeXT Encapsulated PostScript v1.2 pasteboard type - NeXT RTFD pasteboard type - NeXT Rich Text Format v1.0 pasteboard type - NeXT TIFF v4.0 pasteboard type - NeXT font pasteboard type - NeXT ruler pasteboard type - WebURLsWithTitlesPboardType - public.url - - {938, 42} - - - - _NS:13 - - - - - - - - - - - - 166 - - - - 938 - 1 - - - 67121127 - 0 - - - 3 - MQA - - - - 6 - System - selectedTextBackgroundColor - - 3 - MC42NjY2NjY2NjY3AA - - - - 6 - System - selectedTextColor - - 3 - MAA - - - - - - - 1 - MCAwIDEAA - - - {8, -8} - 13 - - - - - - 1 - - 6 - {939, 10000000} - - - - {{1, 1}, {938, 42}} - - - - _NS:11 - - - - {4, 5} - - 79691776 - - - - - - file://localhost/Applications/Xcode.app/Contents/SharedFrameworks/DVTKit.framework/Resources/DVTIbeamCursor.tiff - - - - - 3 - MCAwAA - - - - 4 - - - - 256 - {{923, 1}, {16, 42}} - - - - _NS:83 - NO - - _doScroller: - 0.96666666666666667 - - - - -2147483392 - {{-100, -100}, {87, 18}} - - - - _NS:33 - NO - 1 - - _doScroller: - 1 - 0.94565218687057495 - - - {{-1, -1}, {940, 44}} - - - - _NS:9 - 133138 - - - - 0.25 - 4 - 1 - - - {938, 42} - - - - _NS:21 - - {{0, 0}, {2560, 1418}} - {10000000000000, 10000000000000} - YES - - - - - - - terminate: - - - - 823 - - - - orderFrontStandardAboutPanel: - - - - 142 - - - - delegate - - - - 845 - - - - performMiniaturize: - - - - 37 - - - - arrangeInFront: - - - - 39 - - - - performZoom: - - - - 240 - - - - hide: - - - - 369 - - - - hideOtherApplications: - - - - 370 - - - - unhideAllApplications: - - - - 372 - - - - cut: - - - - 768 - - - - paste: - - - - 769 - - - - undo: - - - - 776 - - - - copy: - - - - 782 - - - - selectAll: - - - - 785 - - - - toggleFullScreen: - - - - 842 - - - - window - - - - 850 - - - - inputWindow - - - - 953 - - - - inputView - - - - 954 - - - - - - 0 - - - - - - -2 - - - File's Owner - - - -1 - - - First Responder - - - -3 - - - Application - - - 29 - - - - - - - - - Main Menu - - - 19 - - - - - - - - 56 - - - - - - - - 103 - - - - - - 57 - - - - - - - - - - - - - - - - - - 58 - - - - - 134 - - - - - 150 - - - - - 136 - - - - - 144 - - - - - 129 - - - - - 143 - - - - - 236 - - - - - 131 - - - - - - - - 149 - - - - - 145 - - - - - 130 - - - - - 24 - - - - - - - - - - - - 92 - - - - - 5 - - - - - 239 - - - - - 23 - - - - - 711 - - - - - - - - 712 - - - - - - - - - - - - - - 716 - - - - - 717 - - - - - 718 - - - - - 721 - - - - - 824 - - - - - 841 - - - - - 828 - - - - - - - - 829 - - - - - - 713 - - - - - 714 - - - - - 715 - - - - - 941 - - - - - - - - 942 - - - - - - - - 943 - - - - - - - - - - 944 - - - - - 945 - - - - - 946 - - - - - - - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - - - com.apple.InterfaceBuilder.CocoaPlugin - - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - LLNonInlineTextView - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - - - - - - 954 - - - - - LLAppDelegate - NSObject - - LLNonInlineTextView - NSWindow - LLNSWindow - - - - inputView - LLNonInlineTextView - - - inputWindow - NSWindow - - - window - LLNSWindow - - - - IBProjectSource - ./Classes/LLAppDelegate.h - - - - LLNSWindow - NSWindow - - IBProjectSource - ./Classes/LLNSWindow.h - - - - LLNonInlineTextView - NSTextView - - IBProjectSource - ./Classes/LLNonInlineTextView.h - - - - LLUserInputWindow - NSPanel - - IBProjectSource - ./Classes/LLUserInputWindow.h - - - - NSTextView - - id - id - - - - orderFrontSharingServicePicker: - id - - - toggleQuickLookPreviewPanel: - id - - - - IBProjectSource - ./Classes/NSTextView.h - - - - - 0 - IBCocoaFramework - - com.apple.InterfaceBuilder.CocoaPlugin.macosx - - - - com.apple.InterfaceBuilder.CocoaPlugin.InterfaceBuilder3 - - - YES - 3 - - {11, 11} - {10, 3} - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/indra/newview/viewer_manifest.py b/indra/newview/viewer_manifest.py index b92c9f931b..7fdd803d33 100755 --- a/indra/newview/viewer_manifest.py +++ b/indra/newview/viewer_manifest.py @@ -950,7 +950,6 @@ class Darwin_x86_64_Manifest(ViewerManifest): self.path("licenses-mac.txt", dst="licenses.txt") self.path("featuretable_mac.txt") self.path("cube.dae") - self.path("SecondLife.nib") with self.prefix(src=pkgdir,dst=""): self.path("ca-bundle.crt") -- cgit v1.2.3 From 8acac2cde102c5d0f28a866cf1fc298c6d021f24 Mon Sep 17 00:00:00 2001 From: Rye Date: Sun, 2 Feb 2025 07:09:27 -0500 Subject: Fix openal leak causing crash during shutdown --- indra/llaudio/llaudioengine_openal.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/indra/llaudio/llaudioengine_openal.cpp b/indra/llaudio/llaudioengine_openal.cpp index 18d682b554..755547bfaa 100644 --- a/indra/llaudio/llaudioengine_openal.cpp +++ b/indra/llaudio/llaudioengine_openal.cpp @@ -79,7 +79,7 @@ bool LLAudioEngine_OpenAL::init(void* userdata, const std::string &app_title) ALCdevice *device = alcGetContextsDevice(alcGetCurrentContext()); alcGetIntegerv(device, ALC_MAJOR_VERSION, 1, &major); - alcGetIntegerv(device, ALC_MAJOR_VERSION, 1, &minor); + alcGetIntegerv(device, ALC_MINOR_VERSION, 1, &minor); LL_INFOS() << "ALC version: " << major << "." << minor << LL_ENDL; LL_INFOS() << "ALC default device: " @@ -190,6 +190,8 @@ LLAudioChannelOpenAL::~LLAudioChannelOpenAL() void LLAudioChannelOpenAL::cleanup() { alSourceStop(mALSource); + alSourcei(mALSource, AL_BUFFER, AL_NONE); + mCurrentBufferp = NULL; } -- cgit v1.2.3 From 2f39d381efaa77f27f6daf10b782066e426872b6 Mon Sep 17 00:00:00 2001 From: Rye Date: Sat, 16 Nov 2024 03:51:33 -0500 Subject: Restore support for anistropic filtering on macos --- indra/llrender/llgl.cpp | 7 ++++++- indra/llrender/llrender.cpp | 2 +- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/indra/llrender/llgl.cpp b/indra/llrender/llgl.cpp index 1bc5e79835..008ee8d450 100644 --- a/indra/llrender/llgl.cpp +++ b/indra/llrender/llgl.cpp @@ -1266,7 +1266,7 @@ bool LLGLManager::initGL() // there's some implementation that reports a crazy value mMaxUniformBlockSize = llmin(mMaxUniformBlockSize, 65536); - if (mGLVersion >= 4.59f) + if (mHasAnisotropic) { glGetFloatv(GL_MAX_TEXTURE_MAX_ANISOTROPY, &mMaxAnisotropy); } @@ -1430,6 +1430,11 @@ void LLGLManager::initExtensions() mHasCubeMapArray = mGLVersion >= 3.99f; mHasTransformFeedback = mGLVersion >= 3.99f; mHasDebugOutput = mGLVersion >= 4.29f; + mHasAnisotropic = mGLVersion >= 4.59f; + if(!mHasAnisotropic && gGLHExts.mSysExts) + { + mHasAnisotropic = ExtensionExists("GL_EXT_texture_filter_anisotropic", gGLHExts.mSysExts); + } // Misc glGetIntegerv(GL_MAX_ELEMENTS_VERTICES, (GLint*) &mGLMaxVertexRange); diff --git a/indra/llrender/llrender.cpp b/indra/llrender/llrender.cpp index 1dc87a66ce..ec76aa4f36 100644 --- a/indra/llrender/llrender.cpp +++ b/indra/llrender/llrender.cpp @@ -511,7 +511,7 @@ void LLTexUnit::setTextureFilteringOption(LLTexUnit::eTextureFilterOptions optio } } - if (gGLManager.mGLVersion >= 4.59f) + if (gGLManager.mHasAnisotropic) { if (LLImageGL::sGlobalUseAnisotropic && option == TFO_ANISOTROPIC) { -- cgit v1.2.3 From e83aea5e959075ac6c324e77752cb1b48709eab0 Mon Sep 17 00:00:00 2001 From: Rye Date: Sun, 2 Feb 2025 19:05:59 -0500 Subject: Introduce SSE2NEON package for handling sse to neon intrinsic compatibility --- .gitignore | 1 - autobuild.xml | 34 ++++++++++++++++++++++++++++++++++ indra/cmake/CMakeLists.txt | 1 + indra/cmake/SSE2NEON.cmake | 12 ++++++++++++ indra/llcommon/CMakeLists.txt | 3 ++- indra/llmath/CMakeLists.txt | 4 +++- 6 files changed, 52 insertions(+), 3 deletions(-) create mode 100644 indra/cmake/SSE2NEON.cmake diff --git a/.gitignore b/.gitignore index 3b3666af84..c4accf37b5 100755 --- a/.gitignore +++ b/.gitignore @@ -26,7 +26,6 @@ debian/files debian/secondlife-appearance-utility* debian/secondlife-viewer* indra/.distcc -indra/cmake/* indra/out/* indra/packages/* diff --git a/autobuild.xml b/autobuild.xml index f298b21d27..ad563eccc6 100644 --- a/autobuild.xml +++ b/autobuild.xml @@ -2318,6 +2318,40 @@ Copyright (c) 2012, 2014, 2015, 2016 nghttp2 contributors description Vivox SDK components + sse2neon + + platforms + + common + + archive + + hash + c578c2a7f4355197d0ce8544310bc5e785531018 + hash_algorithm + sha1 + url + https://github.com/secondlife/3p-sse2neon/releases/download/v1.7.0-r2/sse2neon-1.7.0-dev0.gc8ad5f1.d20241212-common-12287325635.tar.zst + + name + common + + + license + MIT + license_file + LICENSES/sse2neon.txt + copyright + Copyright (c) 2015-2024 SSE2NEON Contributors. + version + 1.7.0-dev0.gc8ad5f1.d20241212 + name + sse2neon + canonical_repo + https://github.com/secondlife/3p-sse2neon + description + A translator from Intel SSE intrinsics to Arm/Aarch64 NEON implementation + threejs platforms diff --git a/indra/cmake/CMakeLists.txt b/indra/cmake/CMakeLists.txt index 8d55cc4bbe..6c1b1f4d1d 100644 --- a/indra/cmake/CMakeLists.txt +++ b/indra/cmake/CMakeLists.txt @@ -52,6 +52,7 @@ set(cmake_SOURCE_FILES Prebuilt.cmake PulseAudio.cmake Python.cmake + SSE2NEON.cmake TemplateCheck.cmake TinyEXR.cmake TinyGLTF.cmake diff --git a/indra/cmake/SSE2NEON.cmake b/indra/cmake/SSE2NEON.cmake new file mode 100644 index 0000000000..797f2af80e --- /dev/null +++ b/indra/cmake/SSE2NEON.cmake @@ -0,0 +1,12 @@ +# -*- cmake -*- + +include(Prebuilt) + +add_library(ll::sse2neon INTERFACE IMPORTED) + +if (DARWIN) + use_system_binary(sse2neon) + use_prebuilt_binary(sse2neon) + + target_include_directories( ll::sse2neon SYSTEM INTERFACE ${LIBS_PREBUILT_DIR}/include/sse2neon) +endif() diff --git a/indra/llcommon/CMakeLists.txt b/indra/llcommon/CMakeLists.txt index a504e71340..2de9deea70 100644 --- a/indra/llcommon/CMakeLists.txt +++ b/indra/llcommon/CMakeLists.txt @@ -11,7 +11,7 @@ include(LLSharedLibs) include(Copy3rdPartyLibs) include(ZLIBNG) include(Tracy) - +include(SSE2NEON) set(llcommon_SOURCE_FILES apply.cpp @@ -277,6 +277,7 @@ target_link_libraries( ll::boost ll::oslibraries ll::tracy + ll::sse2neon ) target_include_directories(llcommon INTERFACE ${CMAKE_CURRENT_SOURCE_DIR}) diff --git a/indra/llmath/CMakeLists.txt b/indra/llmath/CMakeLists.txt index eb29df245a..bd860adc31 100644 --- a/indra/llmath/CMakeLists.txt +++ b/indra/llmath/CMakeLists.txt @@ -6,6 +6,7 @@ include(00-Common) include(LLCommon) include(bugsplat) include(Boost) +include(SSE2NEON) set(llmath_SOURCE_FILES llbbox.cpp @@ -59,6 +60,7 @@ set(llmath_HEADER_FILES llmath.h llmatrix3a.h llmatrix3a.inl + llmatrix4a.h llmodularmath.h lloctree.h llperlin.h @@ -99,7 +101,7 @@ list(APPEND llmath_SOURCE_FILES ${llmath_HEADER_FILES}) add_library (llmath ${llmath_SOURCE_FILES}) -target_link_libraries(llmath llcommon llmeshoptimizer) +target_link_libraries(llmath llcommon llmeshoptimizer ll::sse2neon) target_include_directories( llmath INTERFACE ${CMAKE_CURRENT_SOURCE_DIR}) # Add tests -- cgit v1.2.3 From 0fbc30df543293697597a9a46cca611d596a443a Mon Sep 17 00:00:00 2001 From: Andrey Lihatskiy Date: Wed, 2 Oct 2024 19:57:27 +0300 Subject: Merge pull request #2758 from Nicky-D/feature/fontcache Port Fontcache from Firestorm. --- indra/llrender/llfontfreetype.cpp | 201 +++++++++++++++++--------------------- indra/llrender/llfontfreetype.h | 23 +++-- 2 files changed, 105 insertions(+), 119 deletions(-) diff --git a/indra/llrender/llfontfreetype.cpp b/indra/llrender/llfontfreetype.cpp index fa249902af..bab721615b 100644 --- a/indra/llrender/llfontfreetype.cpp +++ b/indra/llrender/llfontfreetype.cpp @@ -56,9 +56,9 @@ FT_Render_Mode gFontRenderMode = FT_RENDER_MODE_NORMAL; -LLFontManager *gFontManagerp = NULL; +LLFontManager *gFontManagerp = nullptr; -FT_Library gFTLibrary = NULL; +FT_Library gFTLibrary = nullptr; //static void LLFontManager::initClass() @@ -73,7 +73,7 @@ void LLFontManager::initClass() void LLFontManager::cleanupClass() { delete gFontManagerp; - gFontManagerp = NULL; + gFontManagerp = nullptr; } LLFontManager::LLFontManager() @@ -101,6 +101,7 @@ LLFontManager::LLFontManager() LLFontManager::~LLFontManager() { FT_Done_FreeType(gFTLibrary); + unloadAllFonts(); } @@ -139,12 +140,8 @@ LLFontFreetype::LLFontFreetype() mAscender(0.f), mDescender(0.f), mLineHeight(0.f), -#ifdef LL_WINDOWS - pFileStream(NULL), - pFtStream(NULL), -#endif mIsFallback(false), - mFTFace(NULL), + mFTFace(nullptr), mRenderGlyphCount(0), mAddGlyphCount(0), mStyle(0), @@ -158,35 +155,16 @@ LLFontFreetype::~LLFontFreetype() // Clean up freetype libs. if (mFTFace) FT_Done_Face(mFTFace); - mFTFace = NULL; + mFTFace = nullptr; // Delete glyph info std::for_each(mCharGlyphInfoMap.begin(), mCharGlyphInfoMap.end(), DeletePairedPointer()); mCharGlyphInfoMap.clear(); -#ifdef LL_WINDOWS - delete pFileStream; // closed by FT_Done_Face - delete pFtStream; -#endif delete mFontBitmapCachep; // mFallbackFonts cleaned up by LLPointer destructor } -#ifdef LL_WINDOWS -unsigned long ft_read_cb(FT_Stream stream, unsigned long offset, unsigned char *buffer, unsigned long count) { - if (count <= 0) return count; - llifstream *file_stream = static_cast(stream->descriptor.pointer); - file_stream->seekg(offset, std::ios::beg); - file_stream->read((char*)buffer, count); - return (unsigned long)file_stream->gcount(); -} - -void ft_close_cb(FT_Stream stream) { - llifstream *file_stream = static_cast(stream->descriptor.pointer); - file_stream->close(); -} -#endif - bool LLFontFreetype::loadFace(const std::string& filename, F32 point_size, F32 vert_dpi, F32 horz_dpi, bool is_fallback, S32 face_n) { // Don't leak face objects. This is also needed to deal with @@ -194,26 +172,21 @@ bool LLFontFreetype::loadFace(const std::string& filename, F32 point_size, F32 v if (mFTFace) { FT_Done_Face(mFTFace); - mFTFace = NULL; + mFTFace = nullptr; } - int error; -#ifdef LL_WINDOWS - error = ftOpenFace(filename, face_n); -#else - error = FT_New_Face( gFTLibrary, - filename.c_str(), - 0, - &mFTFace); -#endif + FT_Open_Args openArgs; + memset( &openArgs, 0, sizeof( openArgs ) ); + openArgs.memory_base = gFontManagerp->loadFont( filename, openArgs.memory_size ); + + if( !openArgs.memory_base ) + return false; + + openArgs.flags = FT_OPEN_MEMORY; + int error = FT_Open_Face( gFTLibrary, &openArgs, 0, &mFTFace ); if (error) - { -#ifdef LL_WINDOWS - clearFontStreams(); -#endif return false; - } mIsFallback = is_fallback; F32 pixels_per_em = (point_size / 72.f)*vert_dpi; // Size in inches * dpi @@ -228,10 +201,8 @@ bool LLFontFreetype::loadFace(const std::string& filename, F32 point_size, F32 v { // Clean up freetype libs. FT_Done_Face(mFTFace); -#ifdef LL_WINDOWS - clearFontStreams(); -#endif - mFTFace = NULL; + + mFTFace = nullptr; return false; } @@ -287,73 +258,30 @@ S32 LLFontFreetype::getNumFaces(const std::string& filename) if (mFTFace) { FT_Done_Face(mFTFace); - mFTFace = NULL; + mFTFace = nullptr; } S32 num_faces = 1; -#ifdef LL_WINDOWS - int error = ftOpenFace(filename, 0); + FT_Open_Args openArgs; + memset( &openArgs, 0, sizeof( openArgs ) ); + openArgs.memory_base = gFontManagerp->loadFont( filename, openArgs.memory_size ); + if( !openArgs.memory_base ) + return 0; + openArgs.flags = FT_OPEN_MEMORY; + int error = FT_Open_Face( gFTLibrary, &openArgs, 0, &mFTFace ); if (error) - { return 0; - } else - { num_faces = mFTFace->num_faces; - } FT_Done_Face(mFTFace); - clearFontStreams(); - mFTFace = NULL; -#endif + mFTFace = nullptr; return num_faces; } -#ifdef LL_WINDOWS -S32 LLFontFreetype::ftOpenFace(const std::string& filename, S32 face_n) -{ - S32 error = -1; - pFileStream = new llifstream(filename, std::ios::binary); - if (pFileStream->is_open()) - { - std::streampos beg = pFileStream->tellg(); - pFileStream->seekg(0, std::ios::end); - std::streampos end = pFileStream->tellg(); - std::size_t file_size = end - beg; - pFileStream->seekg(0, std::ios::beg); - - pFtStream = new LLFT_Stream(); - pFtStream->base = 0; - pFtStream->pos = 0; - pFtStream->size = static_cast(file_size); - pFtStream->descriptor.pointer = pFileStream; - pFtStream->read = ft_read_cb; - pFtStream->close = ft_close_cb; - - FT_Open_Args args; - args.flags = FT_OPEN_STREAM; - args.stream = (FT_StreamRec*)pFtStream; - error = FT_Open_Face(gFTLibrary, &args, face_n, &mFTFace); - } - return error; -} - -void LLFontFreetype::clearFontStreams() -{ - if (pFileStream) - { - pFileStream->close(); - } - delete pFileStream; - delete pFtStream; - pFileStream = NULL; - pFtStream = NULL; -} -#endif - void LLFontFreetype::addFallbackFont(const LLPointer& fallback_font, const char_functor_t& functor) { @@ -377,7 +305,7 @@ F32 LLFontFreetype::getDescenderHeight() const F32 LLFontFreetype::getXAdvance(llwchar wch) const { - if (mFTFace == NULL) + if (mFTFace == nullptr) return 0.0; // Return existing info only if it is current @@ -401,7 +329,7 @@ F32 LLFontFreetype::getXAdvance(llwchar wch) const F32 LLFontFreetype::getXAdvance(const LLFontGlyphInfo* glyph) const { - if (mFTFace == NULL) + if (mFTFace == nullptr) return 0.0; return glyph->mXAdvance; @@ -409,7 +337,7 @@ F32 LLFontFreetype::getXAdvance(const LLFontGlyphInfo* glyph) const F32 LLFontFreetype::getXKerning(llwchar char_left, llwchar char_right) const { - if (mFTFace == NULL) + if (mFTFace == nullptr) return 0.0; //llassert(!mIsFallback); @@ -428,7 +356,7 @@ F32 LLFontFreetype::getXKerning(llwchar char_left, llwchar char_right) const F32 LLFontFreetype::getXKerning(const LLFontGlyphInfo* left_glyph_info, const LLFontGlyphInfo* right_glyph_info) const { - if (mFTFace == NULL) + if (mFTFace == nullptr) return 0.0; U32 left_glyph = left_glyph_info ? left_glyph_info->mGlyphIndex : 0; @@ -451,7 +379,7 @@ LLFontGlyphInfo* LLFontFreetype::addGlyph(llwchar wch, EFontGlyphType glyph_type { if (!mFTFace) { - return NULL; + return nullptr; } llassert(!mIsFallback); @@ -542,14 +470,14 @@ LLFontGlyphInfo* LLFontFreetype::addGlyph(llwchar wch, EFontGlyphType glyph_type { return addGlyphFromFont(this, wch, glyph_index, glyph_type); } - return NULL; + return nullptr; } LLFontGlyphInfo* LLFontFreetype::addGlyphFromFont(const LLFontFreetype *fontp, llwchar wch, U32 glyph_index, EFontGlyphType requested_glyph_type) const { LL_PROFILE_ZONE_SCOPED; - if (mFTFace == NULL) - return NULL; + if (mFTFace == nullptr) + return nullptr; llassert(!mIsFallback); fontp->renderGlyph(requested_glyph_type, glyph_index, wch); @@ -602,7 +530,7 @@ LLFontGlyphInfo* LLFontFreetype::addGlyphFromFont(const LLFontFreetype *fontp, l { U8 *buffer_data = fontp->mFTFace->glyph->bitmap.buffer; S32 buffer_row_stride = fontp->mFTFace->glyph->bitmap.pitch; - U8 *tmp_graydata = NULL; + U8 *tmp_graydata = nullptr; if (fontp->mFTFace->glyph->bitmap.pixel_mode == FT_PIXEL_MODE_MONO) @@ -699,7 +627,7 @@ void LLFontFreetype::insertGlyphInfo(llwchar wch, LLFontGlyphInfo* gi) const void LLFontFreetype::renderGlyph(EFontGlyphType bitmap_type, U32 glyph_index, llwchar wch) const { - if (mFTFace == NULL) + if (mFTFace == nullptr) return; FT_Int32 load_flags = FT_LOAD_FORCE_AUTOHINT; @@ -901,3 +829,58 @@ void LLFontFreetype::setSubImageLuminanceAlpha(U32 x, U32 y, U32 bitmap_num, U32 } } + +namespace ll +{ + namespace fonts + { + class LoadedFont + { + public: + LoadedFont( std::string aName , std::string const &aAddress, std::size_t aSize ) + : mAddress( aAddress ) + { + mName = aName; + mSize = aSize; + mRefs = 1; + } + std::string mName; + std::string mAddress; + std::size_t mSize; + U32 mRefs; + }; + } +} + +U8 const* LLFontManager::loadFont( std::string const &aFilename, long &a_Size) +{ + a_Size = 0; + std::map< std::string, std::shared_ptr >::iterator itr = m_LoadedFonts.find( aFilename ); + if( itr != m_LoadedFonts.end() ) + { + ++itr->second->mRefs; + // A possible overflow cannot happen here, as it is asserted that the size is less than std::numeric_limits::max() a few lines below. + a_Size = static_cast(itr->second->mSize); + return reinterpret_cast(itr->second->mAddress.c_str()); + } + + auto strContent = LLFile::getContents(aFilename); + + if( strContent.empty() ) + return nullptr; + + // For fontconfig a type of long is required, std::string::size() returns size_t. I think it is safe to limit this to 2GiB and not support fonts that huge (can that even be a thing?) + llassert_always( strContent.size() < std::numeric_limits::max() ); + + a_Size = static_cast(strContent.size()); + + auto pCache = std::make_shared( aFilename, strContent, a_Size ); + itr = m_LoadedFonts.insert( std::make_pair( aFilename, pCache ) ).first; + + return reinterpret_cast(itr->second->mAddress.c_str()); +} + +void LLFontManager::unloadAllFonts() +{ + m_LoadedFonts.clear(); +} diff --git a/indra/llrender/llfontfreetype.h b/indra/llrender/llfontfreetype.h index 1ad795060a..3977911fe5 100644 --- a/indra/llrender/llfontfreetype.h +++ b/indra/llrender/llfontfreetype.h @@ -43,15 +43,28 @@ typedef struct FT_FaceRec_* LLFT_Face; struct FT_StreamRec_; typedef struct FT_StreamRec_ LLFT_Stream; +namespace ll +{ + namespace fonts + { + class LoadedFont; + } +} + class LLFontManager { public: static void initClass(); static void cleanupClass(); + U8 const *loadFont( std::string const &aFilename, long &a_Size ); + private: LLFontManager(); ~LLFontManager(); + + void unloadAllFonts(); + std::map< std::string, std::shared_ptr > m_LoadedFonts; }; struct LLFontGlyphInfo @@ -90,11 +103,6 @@ public: S32 getNumFaces(const std::string& filename); -#ifdef LL_WINDOWS - S32 ftOpenFace(const std::string& filename, S32 face_n); - void clearFontStreams(); -#endif - typedef std::function char_functor_t; void addFallbackFont(const LLPointer& fallback_font, const char_functor_t& functor = nullptr); @@ -170,11 +178,6 @@ private: LLFT_Face mFTFace; -#ifdef LL_WINDOWS - llifstream *pFileStream; - LLFT_Stream *pFtStream; -#endif - bool mIsFallback; typedef std::pair, char_functor_t> fallback_font_t; typedef std::vector fallback_font_vector_t; -- cgit v1.2.3 From 465fbf69464c562004a28e91408265e34a7a6c2d Mon Sep 17 00:00:00 2001 From: Rye Date: Mon, 4 Nov 2024 04:13:57 -0500 Subject: Fix crash from socket creation failure in media plugin system --- indra/llplugin/llpluginprocessparent.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/indra/llplugin/llpluginprocessparent.cpp b/indra/llplugin/llpluginprocessparent.cpp index 908f3c8ff5..19a0ce639a 100644 --- a/indra/llplugin/llpluginprocessparent.cpp +++ b/indra/llplugin/llpluginprocessparent.cpp @@ -400,9 +400,14 @@ void LLPluginProcessParent::idle(void) apr_sockaddr_t* addr = NULL; mListenSocket = LLSocket::create(gAPRPoolp, LLSocket::STREAM_TCP); mBoundPort = 0; + if (!mListenSocket) + { + killSockets(); + errorState(); + break; + } // This code is based on parts of LLSocket::create() in lliosocket.cpp. - status = apr_sockaddr_info_get( &addr, "127.0.0.1", -- cgit v1.2.3 From a455d3ee7d5ddefcdf008fa86ecc7c80aba758aa Mon Sep 17 00:00:00 2001 From: Rye Date: Mon, 3 Feb 2025 11:35:22 -0500 Subject: Introduce build system and preprocessor support for ARM64 --- indra/CMakeLists.txt | 2 ++ indra/cmake/00-Common.cmake | 2 +- indra/cmake/LLAddBuildTest.cmake | 12 ++++++- indra/cmake/LLKDU.cmake | 14 ++++---- indra/cmake/Linking.cmake | 11 ++++-- indra/cmake/WebRTC.cmake | 32 +++++++----------- indra/cmake/xxHash.cmake | 5 +-- indra/llcommon/llpreprocessor.h | 34 ++++++++++++++++--- indra/llcommon/llprocessor.h | 15 +-------- indra/llkdu/CMakeLists.txt | 8 ----- indra/llkdu/llimagej2ckdu.h | 2 ++ indra/llkdu/llkdumem.h | 2 ++ indra/llplugin/CMakeLists.txt | 8 ----- indra/llplugin/slplugin/CMakeLists.txt | 29 ++++++++-------- indra/llwindow/CMakeLists.txt | 1 - indra/media_plugins/base/CMakeLists.txt | 9 +---- indra/media_plugins/base/media_plugin_base.cpp | 4 +-- indra/media_plugins/cef/CMakeLists.txt | 8 ----- indra/media_plugins/example/CMakeLists.txt | 8 ----- indra/media_plugins/libvlc/CMakeLists.txt | 7 ---- indra/newview/CMakeLists.txt | 46 +++++++++++++++----------- indra/test/CMakeLists.txt | 2 +- 22 files changed, 123 insertions(+), 138 deletions(-) diff --git a/indra/CMakeLists.txt b/indra/CMakeLists.txt index 422927704a..a96545e3a4 100644 --- a/indra/CMakeLists.txt +++ b/indra/CMakeLists.txt @@ -11,6 +11,8 @@ ## We're not there yet, but once done, there is a kludge in Linking.cmake # "if(${CMAKE_VERSION} VERSION_LESS "3.20.0")" that can also be removed cmake_minimum_required(VERSION 3.16.0 FATAL_ERROR) +cmake_policy(SET CMP0156 NEW) +cmake_policy(SET CMP0179 NEW) set(ROOT_PROJECT_NAME "SecondLife" CACHE STRING "The root project/makefile/solution name. Defaults to SecondLife.") diff --git a/indra/cmake/00-Common.cmake b/indra/cmake/00-Common.cmake index 69eeff0a79..167964fa16 100644 --- a/indra/cmake/00-Common.cmake +++ b/indra/cmake/00-Common.cmake @@ -34,7 +34,7 @@ add_compile_definitions(BOOST_BIND_GLOBAL_PLACEHOLDERS) # Force enable SSE2 instructions in GLM per the manual # https://github.com/g-truc/glm/blob/master/manual.md#section2_10 -add_compile_definitions(GLM_FORCE_DEFAULT_ALIGNED_GENTYPES=1 GLM_FORCE_SSE2=1) +add_compile_definitions(GLM_FORCE_DEFAULT_ALIGNED_GENTYPES=1 GLM_ENABLE_EXPERIMENTAL=1) # Configure crash reporting set(RELEASE_CRASH_REPORTING OFF CACHE BOOL "Enable use of crash reporting in release builds") diff --git a/indra/cmake/LLAddBuildTest.cmake b/indra/cmake/LLAddBuildTest.cmake index 6408f1200c..83725ffd1b 100644 --- a/indra/cmake/LLAddBuildTest.cmake +++ b/indra/cmake/LLAddBuildTest.cmake @@ -92,6 +92,13 @@ MACRO(LL_ADD_PROJECT_UNIT_TESTS project sources) target_include_directories (PROJECT_${project}_TEST_${name} PRIVATE ${LIBS_OPEN_DIR}/test ) set_target_properties(PROJECT_${project}_TEST_${name} PROPERTIES RUNTIME_OUTPUT_DIRECTORY "${EXE_STAGING_DIR}") + if (DARWIN) + set_target_properties(PROJECT_${project}_TEST_${name} + PROPERTIES + BUILD_WITH_INSTALL_RPATH 1 + INSTALL_RPATH "@executable_path/Resources" + ) + endif(DARWIN) # # Per-codefile additional / external project dep and lib dep property extraction @@ -225,7 +232,10 @@ FUNCTION(LL_ADD_INTEGRATION_TEST # test binaries always need to be signed for local development set_target_properties(INTEGRATION_TEST_${testname} PROPERTIES - XCODE_ATTRIBUTE_CODE_SIGN_IDENTITY "-") + XCODE_ATTRIBUTE_CODE_SIGN_IDENTITY "-" + BUILD_WITH_INSTALL_RPATH 1 + INSTALL_RPATH "@executable_path/Resources" + ) endif () # Add link deps to the executable diff --git a/indra/cmake/LLKDU.cmake b/indra/cmake/LLKDU.cmake index 6d27dcc286..dc98335a28 100644 --- a/indra/cmake/LLKDU.cmake +++ b/indra/cmake/LLKDU.cmake @@ -13,15 +13,17 @@ add_library( ll::kdu INTERFACE IMPORTED ) if (USE_KDU) include(Prebuilt) use_prebuilt_binary(kdu) - if (WINDOWS) - target_link_libraries( ll::kdu INTERFACE kdu.lib) - else (WINDOWS) - target_link_libraries( ll::kdu INTERFACE libkdu.a) - endif (WINDOWS) + + find_library(KDU_LIBRARY + NAMES + kdu + PATHS "${ARCH_PREBUILT_DIRS_RELEASE}" REQUIRED NO_DEFAULT_PATH) + + target_link_libraries(ll::kdu INTERFACE ${KDU_LIBRARY}) target_include_directories( ll::kdu SYSTEM INTERFACE ${AUTOBUILD_INSTALL_DIR}/include/kdu ${LIBS_OPEN_DIR}/llkdu ) - target_compile_definitions(ll::kdu INTERFACE KDU_X86_INTRINSICS=1 KDU_NO_THREADS=1) + target_compile_definitions(ll::kdu INTERFACE KDU_NO_THREADS=1) endif (USE_KDU) diff --git a/indra/cmake/Linking.cmake b/indra/cmake/Linking.cmake index 1093fc7f71..3f4d0ed534 100644 --- a/indra/cmake/Linking.cmake +++ b/indra/cmake/Linking.cmake @@ -38,9 +38,10 @@ endif () # windows) and CMAKE_BUILD_TYPE on Makefile based generators (like linux). The reason for this is # that CMAKE_BUILD_TYPE is essentially meaningless at configuration time for IDE generators and # CMAKE_CFG_INTDIR is meaningless at build time for Makefile generators - -link_directories(${AUTOBUILD_INSTALL_DIR}/lib/$>) -link_directories(${AUTOBUILD_INSTALL_DIR}/lib/release) +if(NOT DARWIN) + link_directories(${AUTOBUILD_INSTALL_DIR}/lib/$>) + link_directories(${AUTOBUILD_INSTALL_DIR}/lib/release) +endif(NOT DARWIN) add_library( ll::oslibraries INTERFACE IMPORTED ) @@ -75,6 +76,8 @@ else() find_library(AGL_LIBRARY AGL) find_library(APPKIT_LIBRARY AppKit) find_library(COREAUDIO_LIBRARY CoreAudio) + find_library(COREGRAPHICS_LIBRARY CoreGraphics) + find_library(AUDIOTOOLBOX_LIBRARY AudioToolbox) target_link_libraries( ll::oslibraries INTERFACE ${COCOA_LIBRARY} @@ -84,6 +87,8 @@ else() ${AGL_LIBRARY} ${APPKIT_LIBRARY} ${COREAUDIO_LIBRARY} + ${AUDIOTOOLBOX_LIBRARY} + ${COREGRAPHICS_LIBRARY} ) endif() diff --git a/indra/cmake/WebRTC.cmake b/indra/cmake/WebRTC.cmake index 230522a40a..7fefaa4152 100644 --- a/indra/cmake/WebRTC.cmake +++ b/indra/cmake/WebRTC.cmake @@ -1,32 +1,24 @@ # -*- cmake -*- +include_guard() + include(Linking) include(Prebuilt) -include_guard() - add_library( ll::webrtc INTERFACE IMPORTED ) target_include_directories( ll::webrtc SYSTEM INTERFACE "${LIBS_PREBUILT_DIR}/include/webrtc" "${LIBS_PREBUILT_DIR}/include/webrtc/third_party/abseil-cpp") use_prebuilt_binary(webrtc) -if (WINDOWS) - target_link_libraries( ll::webrtc INTERFACE webrtc.lib ) -elseif (DARWIN) - FIND_LIBRARY(COREAUDIO_LIBRARY CoreAudio) - FIND_LIBRARY(COREGRAPHICS_LIBRARY CoreGraphics) - FIND_LIBRARY(AUDIOTOOLBOX_LIBRARY AudioToolbox) - FIND_LIBRARY(COREFOUNDATION_LIBRARY CoreFoundation) - FIND_LIBRARY(COCOA_LIBRARY Cocoa) +find_library(WEBRTC_LIBRARY + NAMES + webrtc + PATHS "${ARCH_PREBUILT_DIRS_RELEASE}" REQUIRED NO_DEFAULT_PATH) + +target_link_libraries( ll::webrtc INTERFACE ${WEBRTC_LIBRARY} ) - target_link_libraries( ll::webrtc INTERFACE - libwebrtc.a - ${COREAUDIO_LIBRARY} - ${AUDIOTOOLBOX_LIBRARY} - ${COREGRAPHICS_LIBRARY} - ${COREFOUNDATION_LIBRARY} - ${COCOA_LIBRARY} - ) +if (DARWIN) + target_link_libraries( ll::webrtc INTERFACE ll::oslibraries ) elseif (LINUX) - target_link_libraries( ll::webrtc INTERFACE libwebrtc.a X11 ) -endif (WINDOWS) + target_link_libraries( ll::webrtc INTERFACE X11 ) +endif () diff --git a/indra/cmake/xxHash.cmake b/indra/cmake/xxHash.cmake index a7c1cba62c..e4f8517d9b 100644 --- a/indra/cmake/xxHash.cmake +++ b/indra/cmake/xxHash.cmake @@ -1,8 +1,5 @@ # -*- cmake -*- -if (XXHASH_CMAKE_INCLUDED) - return() -endif (XXHASH_CMAKE_INCLUDED) -set (XXHASH_CMAKE_INCLUDED TRUE) +include_guard() include(Prebuilt) use_prebuilt_binary(xxhash) diff --git a/indra/llcommon/llpreprocessor.h b/indra/llcommon/llpreprocessor.h index b499a9ce10..d2a29d06b4 100644 --- a/indra/llcommon/llpreprocessor.h +++ b/indra/llcommon/llpreprocessor.h @@ -76,6 +76,23 @@ #endif #endif +// Set up CPU architecture defines +#if LL_MSVC && defined(_M_ARM64) +# define LL_ARM64 1 +#elif LL_GNUC && (defined(__arm64__) || defined(__aarch64__)) +# define LL_ARM64 1 +#elif LL_MSVC && _M_X64 +# define LL_X86_64 1 +# define LL_X86 1 +#elif LL_MSVC && _M_IX86 +# define LL_X86 1 +#elif LL_GNUC && ( defined(__amd64__) || defined(__x86_64__) ) +# define LL_X86_64 1 +# define LL_X86 1 +#elif LL_GNUC && ( defined(__i386__) ) +# define LL_X86 1 +#endif + // Deal with minor differences on Unixy OSes. #if LL_DARWIN || LL_LINUX // Different name, same functionality. @@ -118,11 +135,8 @@ #if LL_WINDOWS #define LL_DLLEXPORT __declspec(dllexport) #define LL_DLLIMPORT __declspec(dllimport) -#elif LL_LINUX -#define LL_DLLEXPORT __attribute__ ((visibility("default"))) -#define LL_DLLIMPORT #else -#define LL_DLLEXPORT +#define LL_DLLEXPORT __attribute__ ((visibility("default"))) #define LL_DLLIMPORT #endif // LL_WINDOWS @@ -187,4 +201,16 @@ #define LL_PRETTY_FUNCTION __PRETTY_FUNCTION__ #endif +#if LL_ARM64 +#define GLM_FORCE_NEON 1 +#else +#define GLM_FORCE_SSE2 1 +#endif + +#if LL_ARM64 +#define KDU_NEON_INTRINSICS 1 +#else +#define KDU_X86_INTRINSICS 1 +#endif + #endif // not LL_LINDEN_PREPROCESSOR_H diff --git a/indra/llcommon/llprocessor.h b/indra/llcommon/llprocessor.h index f8ccf686c8..b955f7f55c 100644 --- a/indra/llcommon/llprocessor.h +++ b/indra/llcommon/llprocessor.h @@ -28,20 +28,7 @@ #ifndef LLPROCESSOR_H #define LLPROCESSOR_H #include "llunits.h" - -#if LL_MSVC && _M_X64 -# define LL_X86_64 1 -# define LL_X86 1 -#elif LL_MSVC && _M_IX86 -# define LL_X86 1 -#elif LL_GNUC && ( defined(__amd64__) || defined(__x86_64__) ) -# define LL_X86_64 1 -# define LL_X86 1 -#elif LL_GNUC && ( defined(__i386__) ) -# define LL_X86 1 -#elif LL_GNUC && ( defined(__powerpc__) || defined(__ppc__) ) -# define LL_PPC 1 -#endif +#include "llpreprocessor.h" class LLProcessorInfoImpl; diff --git a/indra/llkdu/CMakeLists.txt b/indra/llkdu/CMakeLists.txt index 230803a630..411fff34ae 100644 --- a/indra/llkdu/CMakeLists.txt +++ b/indra/llkdu/CMakeLists.txt @@ -27,14 +27,6 @@ set(llkdu_HEADER_FILES list(APPEND llkdu_SOURCE_FILES ${llkdu_HEADER_FILES}) -# Our KDU package is built with KDU_X86_INTRINSICS in its .vcxproj file. -# Unless that macro is also set for every consumer build, KDU freaks out, -# spamming the viewer log with alignment FUD. -set_source_files_properties(${llkdu_SOURCE_FILES} - PROPERTIES - COMPILE_DEFINITIONS - "KDU_X86_INTRINSICS") - if (USE_KDU) add_library (llkdu ${llkdu_SOURCE_FILES}) diff --git a/indra/llkdu/llimagej2ckdu.h b/indra/llkdu/llimagej2ckdu.h index 8481201cbc..c9aa0c5250 100644 --- a/indra/llkdu/llimagej2ckdu.h +++ b/indra/llkdu/llimagej2ckdu.h @@ -27,6 +27,8 @@ #ifndef LL_LLIMAGEJ2CKDU_H #define LL_LLIMAGEJ2CKDU_H +#include "llpreprocessor.h" + #include "llimagej2c.h" // diff --git a/indra/llkdu/llkdumem.h b/indra/llkdu/llkdumem.h index 0ad67a3f92..56aff13c76 100644 --- a/indra/llkdu/llkdumem.h +++ b/indra/llkdu/llkdumem.h @@ -27,6 +27,8 @@ #ifndef LL_LLKDUMEM_H #define LL_LLKDUMEM_H +#include "llpreprocessor.h" + // Support classes for reading and writing from memory buffers in KDU #define kdu_xxxx "kdu_image.h" #include "include_kdu_xxxx.h" diff --git a/indra/llplugin/CMakeLists.txt b/indra/llplugin/CMakeLists.txt index 14a69afe6e..005426acde 100644 --- a/indra/llplugin/CMakeLists.txt +++ b/indra/llplugin/CMakeLists.txt @@ -31,14 +31,6 @@ set(llplugin_HEADER_FILES llpluginsharedmemory.h ) -if(NOT ADDRESS_SIZE EQUAL 32) - if(WINDOWS) - ##add_definitions(/FIXED:NO) - else(WINDOWS) # not windows therefore gcc LINUX and DARWIN - add_definitions(-fPIC) - endif(WINDOWS) -endif(NOT ADDRESS_SIZE EQUAL 32) - list(APPEND llplugin_SOURCE_FILES ${llplugin_HEADER_FILES}) add_library (llplugin ${llplugin_SOURCE_FILES}) diff --git a/indra/llplugin/slplugin/CMakeLists.txt b/indra/llplugin/slplugin/CMakeLists.txt index 0ea6495eac..4df3e306cb 100644 --- a/indra/llplugin/slplugin/CMakeLists.txt +++ b/indra/llplugin/slplugin/CMakeLists.txt @@ -30,18 +30,6 @@ add_executable(SLPlugin ${SLPlugin_SOURCE_FILES} ) -if (WINDOWS) -set_target_properties(SLPlugin - PROPERTIES - LINK_FLAGS_DEBUG "/NODEFAULTLIB:\"LIBCMTD\"" - ) -else () -set_target_properties(SLPlugin - PROPERTIES - MACOSX_BUNDLE_INFO_PLIST ${CMAKE_CURRENT_SOURCE_DIR}/slplugin_info.plist - ) -endif () - target_link_libraries(SLPlugin llplugin llmessage @@ -49,7 +37,20 @@ target_link_libraries(SLPlugin ll::pluginlibraries ) -if (DARWIN) +if (WINDOWS) + set_target_properties(SLPlugin + PROPERTIES + LINK_FLAGS_DEBUG "/NODEFAULTLIB:\"LIBCMTD\"" + ) +elseif (DARWIN) + set_target_properties(SLPlugin + PROPERTIES + BUILD_WITH_INSTALL_RPATH 1 + INSTALL_RPATH "@executable_path/../../../../Frameworks;@executable_path/../Frameworks;@executable_path/../Frameworks/plugins" + MACOSX_BUNDLE_INFO_PLIST ${CMAKE_CURRENT_SOURCE_DIR}/slplugin_info.plist + XCODE_ATTRIBUTE_DEBUG_INFORMATION_FORMAT "dwarf-with-dsym" + ) + # Make sure the app bundle has a Resources directory (it will get populated by viewer-manifest.py later) add_custom_command( TARGET SLPlugin POST_BUILD @@ -58,7 +59,7 @@ if (DARWIN) -p ${CMAKE_CURRENT_BINARY_DIR}/$,$,>/SLPlugin.app/Contents/Resources ) -endif (DARWIN) +endif () if (LL_TESTS) ll_deploy_sharedlibs_command(SLPlugin) diff --git a/indra/llwindow/CMakeLists.txt b/indra/llwindow/CMakeLists.txt index 006132b0ba..01a7c303a9 100644 --- a/indra/llwindow/CMakeLists.txt +++ b/indra/llwindow/CMakeLists.txt @@ -182,6 +182,5 @@ endif (SDL_FOUND) target_include_directories(llwindow INTERFACE ${CMAKE_CURRENT_SOURCE_DIR}) if (DARWIN) - find_library(CARBON_LIBRARY Carbon) target_link_libraries(llwindow ${CARBON_LIBRARY}) endif (DARWIN) diff --git a/indra/media_plugins/base/CMakeLists.txt b/indra/media_plugins/base/CMakeLists.txt index 64b6a4228d..b6748abd47 100644 --- a/indra/media_plugins/base/CMakeLists.txt +++ b/indra/media_plugins/base/CMakeLists.txt @@ -12,13 +12,6 @@ include(PluginAPI) ### media_plugin_base -if(NOT ADDRESS_SIZE EQUAL 32) - if(WINDOWS) - ##add_definitions(/FIXED:NO) - else(WINDOWS) # not windows therefore gcc LINUX and DARWIN - add_definitions(-fPIC) - endif(WINDOWS) -endif(NOT ADDRESS_SIZE EQUAL 32) set(media_plugin_base_SOURCE_FILES media_plugin_base.cpp @@ -34,5 +27,5 @@ add_library(media_plugin_base ${media_plugin_base_SOURCE_FILES} ) -target_link_libraries( media_plugin_base llplugin ) +target_link_libraries( media_plugin_base llplugin ll::pluginlibraries) target_include_directories( media_plugin_base INTERFACE ${CMAKE_CURRENT_SOURCE_DIR}) diff --git a/indra/media_plugins/base/media_plugin_base.cpp b/indra/media_plugins/base/media_plugin_base.cpp index 545eee25a9..ccaa43cfb5 100644 --- a/indra/media_plugins/base/media_plugin_base.cpp +++ b/indra/media_plugins/base/media_plugin_base.cpp @@ -170,10 +170,8 @@ void MediaPluginBase::sendStatus() #if LL_WINDOWS # define LLSYMEXPORT __declspec(dllexport) -#elif LL_LINUX -# define LLSYMEXPORT __attribute__ ((visibility("default"))) #else -# define LLSYMEXPORT /**/ +# define LLSYMEXPORT __attribute__ ((visibility("default"))) #endif extern "C" diff --git a/indra/media_plugins/cef/CMakeLists.txt b/indra/media_plugins/cef/CMakeLists.txt index 0d1a833936..dbd888a1d2 100644 --- a/indra/media_plugins/cef/CMakeLists.txt +++ b/indra/media_plugins/cef/CMakeLists.txt @@ -14,14 +14,6 @@ include(CEFPlugin) ### media_plugin_cef -if(NOT ADDRESS_SIZE EQUAL 32) - if(WINDOWS) - ##add_definitions(/FIXED:NO) - else(WINDOWS) # not windows therefore gcc LINUX and DARWIN - add_definitions(-fPIC) - endif(WINDOWS) -endif(NOT ADDRESS_SIZE EQUAL 32) - set(media_plugin_cef_SOURCE_FILES media_plugin_cef.cpp ) diff --git a/indra/media_plugins/example/CMakeLists.txt b/indra/media_plugins/example/CMakeLists.txt index 41e2353f31..71343d5f85 100644 --- a/indra/media_plugins/example/CMakeLists.txt +++ b/indra/media_plugins/example/CMakeLists.txt @@ -13,14 +13,6 @@ include(ExamplePlugin) ### media_plugin_example -if(NOT ADDRESS_SIZE EQUAL 32) - if(WINDOWS) - ##add_definitions(/FIXED:NO) - else(WINDOWS) # not windows therefore gcc LINUX and DARWIN - add_definitions(-fPIC) - endif(WINDOWS) -endif(NOT ADDRESS_SIZE EQUAL 32) - set(media_plugin_example_SOURCE_FILES media_plugin_example.cpp ) diff --git a/indra/media_plugins/libvlc/CMakeLists.txt b/indra/media_plugins/libvlc/CMakeLists.txt index 202cbed96e..863b4617e9 100644 --- a/indra/media_plugins/libvlc/CMakeLists.txt +++ b/indra/media_plugins/libvlc/CMakeLists.txt @@ -13,13 +13,6 @@ include(LibVLCPlugin) ### media_plugin_libvlc -if(NOT ADDRESS_SIZE EQUAL 32) - if(WINDOWS) - ##add_definitions(/FIXED:NO) - else(WINDOWS) # not windows therefore gcc LINUX and DARWIN - add_definitions(-fPIC) - endif(WINDOWS) -endif(NOT ADDRESS_SIZE EQUAL 32) set(media_plugin_libvlc_SOURCE_FILES media_plugin_libvlc.cpp diff --git a/indra/newview/CMakeLists.txt b/indra/newview/CMakeLists.txt index 6858b1d773..45a8f0983b 100644 --- a/indra/newview/CMakeLists.txt +++ b/indra/newview/CMakeLists.txt @@ -1405,7 +1405,7 @@ file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/viewer_version.txt" "${VIEWER_SHORT_VERSION}.${VIEWER_VERSION_REVISION}\n") set_source_files_properties( - llversioninfo.cpp tests/llversioninfo_test.cpp + llversioninfo.cpp tests/llversioninfo_test.cpp PROPERTIES COMPILE_DEFINITIONS "${VIEWER_CHANNEL_VERSION_DEFINES}" # see BuildVersion.cmake ) @@ -1417,11 +1417,24 @@ if (DARWIN) LIST(APPEND viewer_SOURCE_FILES llfilepicker_mac.mm) LIST(APPEND viewer_HEADER_FILES llfilepicker_mac.h) + set_source_files_properties( + llappviewermacosx-objc.mm + PROPERTIES + SKIP_PRECOMPILE_HEADERS TRUE + ) + + set_source_files_properties( + llfilepicker_mac.mm + PROPERTIES + SKIP_PRECOMPILE_HEADERS TRUE + ) + # This should be compiled with the viewer. LIST(APPEND viewer_SOURCE_FILES llappdelegate-objc.mm) set_source_files_properties( llappdelegate-objc.mm PROPERTIES + SKIP_PRECOMPILE_HEADERS TRUE COMPILE_DEFINITIONS "${VIEWER_CHANNEL_VERSION_DEFINES}" # BugsplatMac is a module, imported with @import. That language feature # demands these -f switches. @@ -1606,7 +1619,7 @@ endif (WINDOWS) file(GLOB_RECURSE viewer_XUI_FILES LIST_DIRECTORIES FALSE ${CMAKE_CURRENT_SOURCE_DIR}/skins/*.xml) source_group(TREE ${CMAKE_CURRENT_SOURCE_DIR}/skins PREFIX "XUI Files" FILES ${viewer_XUI_FILES}) -set_source_files_properties(${viewer_XUI_FILES} +set_source_files_properties(${viewer_XUI_FILES} PROPERTIES HEADER_FILE_ONLY TRUE) list(APPEND viewer_SOURCE_FILES ${viewer_XUI_FILES}) @@ -1614,7 +1627,7 @@ list(APPEND viewer_SOURCE_FILES ${viewer_XUI_FILES}) file(GLOB_RECURSE viewer_SHADER_FILES LIST_DIRECTORIES FALSE ${CMAKE_CURRENT_SOURCE_DIR}/app_settings/shaders/*.glsl) source_group(TREE ${CMAKE_CURRENT_SOURCE_DIR}/app_settings/shaders PREFIX "Shaders" FILES ${viewer_SHADER_FILES}) -set_source_files_properties(${viewer_SHADER_FILES} +set_source_files_properties(${viewer_SHADER_FILES} PROPERTIES HEADER_FILE_ONLY TRUE) list(APPEND viewer_SOURCE_FILES ${viewer_SHADER_FILES}) @@ -1705,6 +1718,10 @@ list(APPEND EVENT_HOST_SCRIPTS ${EVENT_HOST_SCRIPT_GLOB_LIST}) set(PACKAGE ON CACHE BOOL "Add a package target that builds an installer package.") +if(USE_PRECOMPILED_HEADERS) + target_precompile_headers( ${VIEWER_BINARY_NAME} PRIVATE llviewerprecompiledheaders.h ) +endif(USE_PRECOMPILED_HEADERS) + if (WINDOWS) set_target_properties(${VIEWER_BINARY_NAME} PROPERTIES @@ -1715,10 +1732,6 @@ if (WINDOWS) ) target_compile_options(${VIEWER_BINARY_NAME} PRIVATE /bigobj) - if(USE_PRECOMPILED_HEADERS) - target_precompile_headers( ${VIEWER_BINARY_NAME} PRIVATE llviewerprecompiledheaders.h ) - endif(USE_PRECOMPILED_HEADERS) - # If adding a file to viewer_manifest.py in the WindowsManifest.construct() method, be sure to add the dependency # here. # *NOTE:Mani - This is a crappy hack to have important dependencies for the viewer_manifest copy action @@ -1732,7 +1745,7 @@ if (WINDOWS) # And of course it's straightforward to read a text file in Python. set(COPY_INPUT_DEPENDENCIES - # The following commented dependencies are determined at variably at build time. Can't do this here. + # The following commented dependencies are determined variably at build time. Can't do this here. ${CMAKE_SOURCE_DIR}/../etc/message.xml ${CMAKE_SOURCE_DIR}/../scripts/messages/message_template.msg ${SHARED_LIB_STAGING_DIR}/openjp2.dll @@ -1933,7 +1946,7 @@ endif (WINDOWS) # one of these being libz where you can find four or more versions in play # at once. On Linux, libz can be found at link and run time via a number # of paths: -# +# # => -lfreetype # => libz.so.1 (on install machine, not build) # => -lSDL @@ -2005,7 +2018,7 @@ foreach(elem ${country_codes}) set(emoji_mapping_src_file "${emoji_mapping_src_folder}/${elem}/emoji_characters.xml") set(emoji_mapping_dst_file - "${emoji_mapping_dst_folder}/${elem}/emoji_characters.xml") + "${emoji_mapping_dst_folder}/${elem}/emoji_characters.xml") configure_file(${emoji_mapping_src_file} ${emoji_mapping_dst_file} COPYONLY) endforeach() @@ -2145,9 +2158,6 @@ if (DARWIN) --grid=${GRID} --source=${CMAKE_CURRENT_SOURCE_DIR} --versionfile=${CMAKE_CURRENT_BINARY_DIR}/viewer_version.txt - DEPENDS - ${VIEWER_BINARY_NAME} - ${CMAKE_CURRENT_SOURCE_DIR}/viewer_manifest.py ) add_dependencies(${VIEWER_BINARY_NAME} SLPlugin media_plugin_libvlc media_plugin_cef) @@ -2181,8 +2191,6 @@ if (DARWIN) --touch=${CMAKE_CURRENT_BINARY_DIR}/$,$,>/.${product}.bat --versionfile=${CMAKE_CURRENT_BINARY_DIR}/viewer_version.txt ${SIGNING_SETTING} - DEPENDS - ${CMAKE_CURRENT_SOURCE_DIR}/viewer_manifest.py ) endif (PACKAGE) endif (DARWIN) @@ -2222,7 +2230,7 @@ if (PACKAGE AND (RELEASE_CRASH_REPORTING OR NON_RELEASE_CRASH_REPORTING) AND VIE PROPERTIES XCODE_ATTRIBUTE_DEBUG_INFORMATION_FORMAT "dwarf-with-dsym" XCODE_ATTRIBUTE_DWARF_DSYM_FOLDER_PATH "${SYMBOLS_STAGING_DIR}/dSYMs") - + add_custom_command(OUTPUT "${VIEWER_APP_XCARCHIVE}" COMMAND "zip" ARGS @@ -2257,7 +2265,7 @@ if (LL_TESTS) # llremoteparcelrequest.cpp llviewerhelputil.cpp llversioninfo.cpp -# llvocache.cpp +# llvocache.cpp llworldmap.cpp llworldmipmap.cpp ) @@ -2266,7 +2274,7 @@ if (LL_TESTS) llworldmap.cpp llworldmipmap.cpp PROPERTIES - LL_TEST_ADDITIONAL_SOURCE_FILES + LL_TEST_ADDITIONAL_SOURCE_FILES tests/llviewertexture_stub.cpp #llviewertexturelist.cpp ) @@ -2300,7 +2308,7 @@ if (LL_TESTS) llworldmap.cpp llworldmipmap.cpp PROPERTIES - LL_TEST_ADDITIONAL_SOURCE_FILES + LL_TEST_ADDITIONAL_SOURCE_FILES tests/llviewertexture_stub.cpp ) diff --git a/indra/test/CMakeLists.txt b/indra/test/CMakeLists.txt index 745c0eedf8..f80286a630 100644 --- a/indra/test/CMakeLists.txt +++ b/indra/test/CMakeLists.txt @@ -114,7 +114,7 @@ if (LL_TESTS) # but the CMake $ generator expression isn't evaluated by # CREATE_LINK, so fudge it. add_custom_command( TARGET lltest POST_BUILD - COMMAND cmake -E create_symlink ${SHARED_LIB_STAGING_DIR} ${CMAKE_BINARY_DIR}/test/Resources + COMMAND ${CMAKE_COMMAND} -E create_symlink ${SHARED_LIB_STAGING_DIR} ${CMAKE_BINARY_DIR}/test/Resources ) endif() endif (LL_TESTS) -- cgit v1.2.3 From 36d4dc4e2be8ac6c6d042b0a1e5c130b6544ef7f Mon Sep 17 00:00:00 2001 From: Rye Date: Mon, 3 Feb 2025 11:37:08 -0500 Subject: Fix uninitialized variable warnings being emitted by current clang --- indra/llmessage/llxfermanager.cpp | 2 +- indra/llrender/llgl.cpp | 13 +------------ indra/llxml/llxmlnode.cpp | 6 +++--- indra/newview/llpanelprimmediacontrols.cpp | 2 +- 4 files changed, 6 insertions(+), 17 deletions(-) diff --git a/indra/llmessage/llxfermanager.cpp b/indra/llmessage/llxfermanager.cpp index f6ed43a4e4..a2d09f4f36 100644 --- a/indra/llmessage/llxfermanager.cpp +++ b/indra/llmessage/llxfermanager.cpp @@ -1051,7 +1051,7 @@ void LLXferManager::retransmitUnackedPackets() // Re-build mOutgoingHosts data updateHostStatus(); - F32 et; + F32 et = 0.f; iter = mSendList.begin(); while (iter != mSendList.end()) { diff --git a/indra/llrender/llgl.cpp b/indra/llrender/llgl.cpp index 008ee8d450..fbd4b0f9c4 100644 --- a/indra/llrender/llgl.cpp +++ b/indra/llrender/llgl.cpp @@ -1123,17 +1123,6 @@ bool LLGLManager::initGL() if (mGLVersion >= 2.f) { parse_glsl_version(mGLSLVersionMajor, mGLSLVersionMinor); - -#if 0 && LL_DARWIN - // TODO maybe switch to using a core profile for GL 3.2? - // https://stackoverflow.com/a/19868861 - //never use GLSL greater than 1.20 on OSX - if (mGLSLVersionMajor > 1 || mGLSLVersionMinor > 30) - { - mGLSLVersionMajor = 1; - mGLSLVersionMinor = 30; - } -#endif } if (mGLVersion >= 2.1f && LLImageGL::sCompressTextures) @@ -2749,7 +2738,7 @@ void LLGLUserClipPlane::setPlane(F32 a, F32 b, F32 c, F32 d) if(cplane[2] < 0) cplane *= -1; - glm::mat4 suffix; + glm::mat4 suffix = glm::identity(); suffix = glm::row(suffix, 2, cplane); glm::mat4 newP = suffix * P; gGL.matrixMode(LLRender::MM_PROJECTION); diff --git a/indra/llxml/llxmlnode.cpp b/indra/llxml/llxmlnode.cpp index 92bcb1a2ae..da69e11f87 100644 --- a/indra/llxml/llxmlnode.cpp +++ b/indra/llxml/llxmlnode.cpp @@ -1281,7 +1281,7 @@ bool LLXMLNode::getAttributeU8(const char* name, U8& value ) bool LLXMLNode::getAttributeS8(const char* name, S8& value ) { LLXMLNodePtr node; - S32 val; + S32 val{}; if (!(getAttribute(name, node) && node->getIntValue(1, &val))) { return false; @@ -1293,7 +1293,7 @@ bool LLXMLNode::getAttributeS8(const char* name, S8& value ) bool LLXMLNode::getAttributeU16(const char* name, U16& value ) { LLXMLNodePtr node; - U32 val; + U32 val{}; if (!(getAttribute(name, node) && node->getUnsignedValue(1, &val))) { return false; @@ -1305,7 +1305,7 @@ bool LLXMLNode::getAttributeU16(const char* name, U16& value ) bool LLXMLNode::getAttributeS16(const char* name, S16& value ) { LLXMLNodePtr node; - S32 val; + S32 val{}; if (!(getAttribute(name, node) && node->getIntValue(1, &val))) { return false; diff --git a/indra/newview/llpanelprimmediacontrols.cpp b/indra/newview/llpanelprimmediacontrols.cpp index b8c12ce0b9..18f8934f9d 100644 --- a/indra/newview/llpanelprimmediacontrols.cpp +++ b/indra/newview/llpanelprimmediacontrols.cpp @@ -645,7 +645,7 @@ void LLPanelPrimMediaControls::updateShape() vert_it = vect_face.begin(); vert_end = vect_face.end(); - glm::mat4 mat; + glm::mat4 mat = glm::identity(); if (!is_hud) { mat = get_current_projection() * get_current_modelview(); -- cgit v1.2.3 From 594a7afce6a8b2e6a658d14881b8247b3a63efd8 Mon Sep 17 00:00:00 2001 From: Rye Date: Mon, 3 Feb 2025 11:42:21 -0500 Subject: Fix pessimizing move warning being emitted by the compiler --- indra/llcommon/llthreadsafequeue.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/indra/llcommon/llthreadsafequeue.h b/indra/llcommon/llthreadsafequeue.h index 034e3f7897..1a1d06a6fd 100644 --- a/indra/llcommon/llthreadsafequeue.h +++ b/indra/llcommon/llthreadsafequeue.h @@ -452,7 +452,9 @@ ElementT LLThreadSafeQueue::pop(void) // so we can finish draining the queue. pop_result popped = pop_(lock1, value); if (popped == POPPED) - return std::move(value); + // don't use std::move when returning local value because + // it prevents the compiler from optimizing with copy elision + return value; // Once the queue is DONE, there will never be any more coming. if (popped == DONE) -- cgit v1.2.3 From 9fef2a114ea7eb6c42dd29e94ba5dc3451eb4560 Mon Sep 17 00:00:00 2001 From: Rye Date: Mon, 3 Feb 2025 11:48:18 -0500 Subject: Fix timer support on macOS under ARM64 --- indra/llcommon/llfasttimer.cpp | 2 +- indra/llcommon/llfasttimer.h | 62 +++++++++++++++++++----------------------- indra/llcommon/llprocessor.cpp | 57 ++++++++++++++++++++++++++++++++++++-- 3 files changed, 83 insertions(+), 38 deletions(-) diff --git a/indra/llcommon/llfasttimer.cpp b/indra/llcommon/llfasttimer.cpp index 722743f453..1c5fe9d2f5 100644 --- a/indra/llcommon/llfasttimer.cpp +++ b/indra/llcommon/llfasttimer.cpp @@ -64,7 +64,7 @@ bool BlockTimer::sLog = false; std::string BlockTimer::sLogName = ""; bool BlockTimer::sMetricLog = false; -#if LL_LINUX +#if LL_LINUX || (LL_DARWIN && LL_ARM64) U64 BlockTimer::sClockResolution = 1000000000; // Nanosecond resolution #else U64 BlockTimer::sClockResolution = 1000000; // Microsecond resolution diff --git a/indra/llcommon/llfasttimer.h b/indra/llcommon/llfasttimer.h index 09fcf8a1af..271dade097 100644 --- a/indra/llcommon/llfasttimer.h +++ b/indra/llcommon/llfasttimer.h @@ -30,9 +30,14 @@ #include "llinstancetracker.h" #include "lltrace.h" #include "lltreeiterators.h" +#include "llprocessor.h" +#if LL_X86 || LL_X86_64 #if LL_WINDOWS #include +#else +#include +#endif #endif #define LL_FAST_TIMER_ON 1 @@ -68,35 +73,10 @@ public: // // Windows implementation of CPU clock // - - // - // NOTE: put back in when we aren't using platform sdk anymore - // - // because MS has different signatures for these functions in winnt.h - // need to rename them to avoid conflicts - //#define _interlockedbittestandset _renamed_interlockedbittestandset - //#define _interlockedbittestandreset _renamed_interlockedbittestandreset - //#include - //#undef _interlockedbittestandset - //#undef _interlockedbittestandreset - - //inline U32 getCPUClockCount32() - //{ - // U64 time_stamp = __rdtsc(); - // return (U32)(time_stamp >> 8); - //} - // - //// return full timer value, *not* shifted by 8 bits - //inline U64 getCPUClockCount64() - //{ - // return __rdtsc(); - //} - - +#if LL_FASTTIMER_USE_RDTSC // shift off lower 8 bits for lower resolution but longer term timing // on 1Ghz machine, a 32-bit word will hold ~1000 seconds of timing -#if LL_FASTTIMER_USE_RDTSC static U32 getCPUClockCount32() { unsigned __int64 val = __rdtsc(); @@ -159,23 +139,37 @@ public: #endif // (LL_LINUX) && !(defined(__i386__) || defined(__amd64__)) -#if (LL_LINUX || LL_DARWIN) && (defined(__i386__) || defined(__amd64__)) +#if LL_DARWIN && LL_ARM64 + // + // Mac implementation of CPU clock - non-x86. + // + static U64 getCPUClockCount64() + { + return clock_gettime_nsec_np(CLOCK_UPTIME_RAW); + } + + static U32 getCPUClockCount32() + { + return (U32)(getCPUClockCount64() >> 8); + } +#endif // LL_DARWIN && LL_ARM64 + +#if (LL_LINUX || LL_DARWIN) && (LL_X86 || LL_X86_64) // // Mac+Linux FAST x86 implementation of CPU clock + // +#if LL_FASTTIMER_USE_RDTSC static U32 getCPUClockCount32() { - U32 low(0),high(0); - __asm__ volatile (".byte 0x0f, 0x31": "=a"(low), "=d"(high) ); - return (low>>8) | (high<<24); + U64 time_stamp = __rdtsc() >> 8U; + return static_cast(time_stamp); } static U64 getCPUClockCount64() { - U32 low(0),high(0); - __asm__ volatile (".byte 0x0f, 0x31": "=a"(low), "=d"(high) ); - return (U64)low | ( ((U64)high) << 32); + return static_cast(__rdtsc()); } - +#endif #endif static BlockTimerStatHandle& getRootTimeBlock(); diff --git a/indra/llcommon/llprocessor.cpp b/indra/llcommon/llprocessor.cpp index a783e18e49..a6ecad2cf7 100644 --- a/indra/llcommon/llprocessor.cpp +++ b/indra/llcommon/llprocessor.cpp @@ -628,6 +628,8 @@ private: #elif LL_DARWIN +#include +#include #include #include @@ -638,17 +640,58 @@ public: { getCPUIDInfo(); uint64_t frequency = getSysctlInt64("hw.cpufrequency"); + if(frequency == 0) // Attempt to query IO Services for pcore frequency + { + CFMutableDictionaryRef arm_io_matching = IOServiceMatching("AppleARMIODevice"); + io_iterator_t iter; + kern_return_t ret = IOServiceGetMatchingServices(kIOMasterPortDefault, arm_io_matching, &iter); + if(ret == KERN_SUCCESS) + { + io_object_t obj; + while ((obj = IOIteratorNext(iter))) + { + io_name_t obj_class; + ret = IOObjectGetClass(obj, obj_class); + if(ret == KERN_SUCCESS) + { + io_name_t obj_name; + ret = IORegistryEntryGetName(obj, obj_name); + if(ret == KERN_SUCCESS) + { + if (strncmp(obj_name, "pmgr", sizeof(obj_name)) == 0) + { + CFTypeRef cfData = IORegistryEntryCreateCFProperty(obj, CFSTR("voltage-states5-sram"), kCFAllocatorDefault, 0); // pcore frequency + if(cfData) + { + CFIndex size = CFDataGetLength((CFDataRef)cfData); + std::vector databuf(size); + CFDataGetBytes((CFDataRef)cfData, CFRangeMake(0, size), databuf.data()); + + frequency = 0x00000000FFFFFFFF & ((databuf[size-5] << 24) | (databuf[size-6] << 16) | (databuf[size-7] << 8) | (databuf[size-8])); + CFRelease(cfData); + } + break; + } + } + } + } + } + } + if (frequency == 0) // fallback to clockrate and tbfrequency + { + frequency = getSysctlClockrate() * getSysctlInt64("hw.tbfrequency"); + } setInfo(eFrequency, (F64)frequency / (F64)1000000); } - virtual ~LLProcessorInfoDarwinImpl() {} + virtual ~LLProcessorInfoDarwinImpl() = default; private: int getSysctlInt(const char* name) { int result = 0; size_t len = sizeof(int); - int error = sysctlbyname(name, (void*)&result, &len, NULL, 0); + int error = sysctlbyname(name, (void*)&result, &len, nullptr, 0); return error == -1 ? 0 : result; } @@ -656,7 +699,7 @@ private: { uint64_t value = 0; size_t size = sizeof(value); - int result = sysctlbyname(name, (void*)&value, &size, NULL, 0); + int result = sysctlbyname(name, (void*)&value, &size, nullptr, 0); if ( result == 0 ) { if ( size == sizeof( uint64_t ) ) @@ -676,6 +719,14 @@ private: return result == -1 ? 0 : value; } + uint64_t getSysctlClockrate() + { + struct clockinfo clockrate{}; + size_t size = sizeof(clockrate); + int error = sysctlbyname("kern.clockrate", &clockrate, &size, nullptr, 0); + return error == -1 ? 0 : clockrate.hz; + } + void getCPUIDInfo() { size_t len = 0; -- cgit v1.2.3 From 4ab2a80e6c8ab6c183143fbbca2c3386088caeb6 Mon Sep 17 00:00:00 2001 From: Rye Date: Mon, 10 Feb 2025 14:08:56 -0500 Subject: Use SSE2NEON to emulate SSE intrinsics when building against an ARM target --- indra/llcommon/llmemory.h | 8 ++++++++ indra/llmath/llsimdmath.h | 14 ++++++++++++-- indra/llmath/llvector4a.inl | 18 +++++++++++++++++- indra/llmath/tests/llquaternion_test.cpp | 6 +++--- indra/newview/llappviewer.cpp | 11 ++++++++++- 5 files changed, 50 insertions(+), 7 deletions(-) diff --git a/indra/llcommon/llmemory.h b/indra/llcommon/llmemory.h index 72aec57080..adc556d180 100644 --- a/indra/llcommon/llmemory.h +++ b/indra/llcommon/llmemory.h @@ -71,7 +71,11 @@ LL_COMMON_API void ll_assert_aligned_func(uintptr_t ptr,U32 alignment); #define ll_assert_aligned(ptr,alignment) #endif +#if LL_ARM64 +#include "sse2neon.h" +#else #include +#endif template T* LL_NEXT_ALIGNED_ADDRESS(T* address) { @@ -339,6 +343,9 @@ LL_FORCE_INLINE void ll_aligned_free(void* ptr) inline void ll_memcpy_nonaliased_aligned_16(char* __restrict dst, const char* __restrict src, size_t bytes) { LL_PROFILE_ZONE_SCOPED_CATEGORY_MEMORY; +#if defined(LL_ARM64) + memcpy(dst, src, bytes); +#else assert(src != NULL); assert(dst != NULL); assert(bytes > 0); @@ -404,6 +411,7 @@ inline void ll_memcpy_nonaliased_aligned_16(char* __restrict dst, const char* __ dst += 16; src += 16; } +#endif } #ifndef __DEBUG_PRIVATE_MEM__ diff --git a/indra/llmath/llsimdmath.h b/indra/llmath/llsimdmath.h index 40953dc2e8..b27b034cf3 100644 --- a/indra/llmath/llsimdmath.h +++ b/indra/llmath/llsimdmath.h @@ -31,16 +31,26 @@ #error "Please include llmath.h before this file." #endif -#if ( ( LL_DARWIN || LL_LINUX ) && !(__SSE2__) ) || ( LL_WINDOWS && ( _M_IX86_FP < 2 && ADDRESS_SIZE == 32 ) ) -#error SSE2 not enabled. LLVector4a and related class will not compile. +// the check for this error case must be split into multiple parts +// because some versions of VS complain about '__SSE2__' +#if ( ( LL_DARWIN || LL_LINUX ) ) + #if !(__SSE2__) && !(__arm64__) && !(__aarch64__) + #error SSE2 not enabled. LLVector4a and related class will not compile. + #endif +#elif ( LL_WINDOWS && ( _M_IX86_FP < 2 && ADDRESS_SIZE == 32 ) ) + #error SSE2 not enabled. LLVector4a and related class will not compile. #endif #if !LL_WINDOWS #include #endif +#if defined(__arm64__) || defined(__aarch64__) +#include "sse2neon.h" +#else #include #include +#endif #include "llmemory.h" #include "llsimdtypes.h" diff --git a/indra/llmath/llvector4a.inl b/indra/llmath/llvector4a.inl index 77a0257fbf..443a46c317 100644 --- a/indra/llmath/llvector4a.inl +++ b/indra/llmath/llvector4a.inl @@ -115,7 +115,7 @@ inline void LLVector4a::set(F32 x, F32 y, F32 z, F32 w) // Set to all zeros inline void LLVector4a::clear() { - mQ = LLVector4a::getZero().mQ; + mQ = _mm_setzero_ps(); } inline void LLVector4a::splat(const F32 x) @@ -272,6 +272,9 @@ inline void LLVector4a::setCross3(const LLVector4a& a, const LLVector4a& b) // Set all elements to the dot product of the x, y, and z elements in a and b inline void LLVector4a::setAllDot3(const LLVector4a& a, const LLVector4a& b) { +#if (defined(__arm64__) || defined(__aarch64__)) + mQ = _mm_dp_ps(a.mQ, b.mQ, 0x7f); +#else // ab = { a[W]*b[W], a[Z]*b[Z], a[Y]*b[Y], a[X]*b[X] } const LLQuad ab = _mm_mul_ps( a.mQ, b.mQ ); // yzxw = { a[W]*b[W], a[Z]*b[Z], a[X]*b[X], a[Y]*b[Y] } @@ -284,11 +287,15 @@ inline void LLVector4a::setAllDot3(const LLVector4a& a, const LLVector4a& b) const __m128i zSplat = _mm_shuffle_epi32(_mm_castps_si128(ab), _MM_SHUFFLE( 2, 2, 2, 2 )); // mQ = { a[Z] * b[Z] + a[Y] * b[Y] + a[X] * b[X], same, same, same } mQ = _mm_add_ps(_mm_castsi128_ps(zSplat), xPlusYSplat); +#endif } // Set all elements to the dot product of the x, y, z, and w elements in a and b inline void LLVector4a::setAllDot4(const LLVector4a& a, const LLVector4a& b) { +#if (defined(__arm64__) || defined(__aarch64__)) + mQ = _mm_dp_ps(a.mQ, b.mQ, 0xff); +#else // ab = { a[W]*b[W], a[Z]*b[Z], a[Y]*b[Y], a[X]*b[X] } const LLQuad ab = _mm_mul_ps( a.mQ, b.mQ ); // yzxw = { a[W]*b[W], a[Z]*b[Z], a[X]*b[X], a[Y]*b[Y] } @@ -301,21 +308,29 @@ inline void LLVector4a::setAllDot4(const LLVector4a& a, const LLVector4a& b) // mQ = { a[W]*b[W] + a[Z] * b[Z] + a[Y] * b[Y] + a[X] * b[X], same, same, same } mQ = _mm_add_ps(xPlusYSplat, zPlusWSplat); +#endif } // Return the 3D dot product of this vector and b inline LLSimdScalar LLVector4a::dot3(const LLVector4a& b) const { +#if (defined(__arm64__) || defined(__aarch64__)) + return _mm_dp_ps(mQ, b.mQ, 0x7f); +#else const LLQuad ab = _mm_mul_ps( mQ, b.mQ ); const LLQuad splatY = _mm_castsi128_ps( _mm_shuffle_epi32( _mm_castps_si128(ab), _MM_SHUFFLE(1, 1, 1, 1) ) ); const LLQuad splatZ = _mm_castsi128_ps( _mm_shuffle_epi32( _mm_castps_si128(ab), _MM_SHUFFLE(2, 2, 2, 2) ) ); const LLQuad xPlusY = _mm_add_ps( ab, splatY ); return _mm_add_ps( xPlusY, splatZ ); +#endif } // Return the 4D dot product of this vector and b inline LLSimdScalar LLVector4a::dot4(const LLVector4a& b) const { +#if (defined(__arm64__) || defined(__aarch64__)) + return _mm_dp_ps(mQ, b.mQ, 0xff); +#else // ab = { w, z, y, x } const LLQuad ab = _mm_mul_ps( mQ, b.mQ ); // upperProdsInLowerElems = { y, x, y, x } @@ -325,6 +340,7 @@ inline LLSimdScalar LLVector4a::dot4(const LLVector4a& b) const // shuffled = { z+x, z+x, z+x, z+x } const LLQuad shuffled = _mm_castsi128_ps( _mm_shuffle_epi32( _mm_castps_si128( sumOfPairs ), _MM_SHUFFLE(1, 1, 1, 1) ) ); return _mm_add_ss( sumOfPairs, shuffled ); +#endif } // Normalize this vector with respect to the x, y, and z components only. Accurate to 22 bites of precision. W component is destroyed diff --git a/indra/llmath/tests/llquaternion_test.cpp b/indra/llmath/tests/llquaternion_test.cpp index aa3c0ad843..ba18d54d55 100644 --- a/indra/llmath/tests/llquaternion_test.cpp +++ b/indra/llmath/tests/llquaternion_test.cpp @@ -349,9 +349,9 @@ namespace tut ensure( "2. LLVector4 operator*(const LLVector4 &a, const LLQuaternion &rot) failed", is_approx_equal(-58153.5390f, result.mV[0]) && - (183787.8125f == result.mV[1]) && - (116864.164063f == result.mV[2]) && - (78.099998f == result.mV[3])); + is_approx_equal(183787.8125f, result.mV[1]) && + is_approx_equal(116864.164063f, result.mV[2]) && + is_approx_equal(78.099998f, result.mV[3])); } //test case for LLVector3 operator*(const LLVector3 &a, const LLQuaternion &rot) fn. diff --git a/indra/newview/llappviewer.cpp b/indra/newview/llappviewer.cpp index 84cce2348a..9392d111f2 100644 --- a/indra/newview/llappviewer.cpp +++ b/indra/newview/llappviewer.cpp @@ -972,6 +972,7 @@ bool LLAppViewer::init() return false; } +#if defined(LL_X86) || defined(LL_X86_64) // Without SSE2 support we will crash almost immediately, warn here. if (!gSysCPU.hasSSE2()) { @@ -983,6 +984,7 @@ bool LLAppViewer::init() // quit immediately return false; } +#endif // alert the user if they are using unsupported hardware if (!gSavedSettings.getBOOL("AlertedUnsupportedHardware")) @@ -1268,7 +1270,7 @@ void LLAppViewer::initMaxHeapSize() //------------------------------------------------------------------------------------------ //currently SL is built under 32-bit setting, we set its max heap size no more than 1.6 GB. - #ifndef LL_X86_64 + #if !defined(LL_X86_64) && !defined(LL_ARM64) F32Gigabytes max_heap_size_gb = (F32Gigabytes)gSavedSettings.getF32("MaxHeapSize") ; #else F32Gigabytes max_heap_size_gb = (F32Gigabytes)gSavedSettings.getF32("MaxHeapSize64"); @@ -3246,6 +3248,11 @@ LLSD LLAppViewer::getViewerInfo() const info["VIEWER_VERSION_STR"] = versionInfo.getVersion(); info["CHANNEL"] = versionInfo.getChannel(); info["ADDRESS_SIZE"] = ADDRESS_SIZE; +#if LL_ARM64 + info["ARCHITECTURE"] = "ARM"; +#else + info["ARCHITECTURE"] = "x86"; +#endif std::string build_config = versionInfo.getBuildConfig(); if (build_config != "Release") { @@ -5538,7 +5545,9 @@ void LLAppViewer::forceErrorBreakpoint() #ifdef LL_WINDOWS DebugBreak(); #else +#if defined(LL_X86) || defined(LL_X86_64) asm ("int $3"); +#endif #endif return; } -- cgit v1.2.3 From 0ea0edb5d97453225130fbd261e718fb633cc56e Mon Sep 17 00:00:00 2001 From: Rye Date: Mon, 10 Feb 2025 14:09:49 -0500 Subject: Fix llcorehttp tests building under macos --- indra/llcorehttp/examples/http_texture_load.cpp | 52 +--------------------- indra/llcorehttp/tests/llcorehttp_test.cpp | 57 ------------------------- indra/llcorehttp/tests/test_httprequest.hpp | 7 +++ indra/llcorehttp/tests/test_refcounted.hpp | 3 -- 4 files changed, 8 insertions(+), 111 deletions(-) diff --git a/indra/llcorehttp/examples/http_texture_load.cpp b/indra/llcorehttp/examples/http_texture_load.cpp index 72e0c29a24..986e675d00 100644 --- a/indra/llcorehttp/examples/http_texture_load.cpp +++ b/indra/llcorehttp/examples/http_texture_load.cpp @@ -52,8 +52,6 @@ void init_curl(); void term_curl(); -void ssl_thread_id_callback(CRYPTO_THREADID*); -void ssl_locking_callback(int mode, int type, const char * file, int line); void usage(std::ostream & out); // Default command line settings @@ -606,63 +604,15 @@ void WorkingSet::loadAssetUuids(FILE * in) } -int ssl_mutex_count(0); -LLCoreInt::HttpMutex ** ssl_mutex_list = NULL; - void init_curl() { curl_global_init(CURL_GLOBAL_ALL); - - ssl_mutex_count = CRYPTO_num_locks(); - if (ssl_mutex_count > 0) - { - ssl_mutex_list = new LLCoreInt::HttpMutex * [ssl_mutex_count]; - - for (int i(0); i < ssl_mutex_count; ++i) - { - ssl_mutex_list[i] = new LLCoreInt::HttpMutex; - } - - CRYPTO_set_locking_callback(ssl_locking_callback); - CRYPTO_THREADID_set_callback(ssl_thread_id_callback); - } } void term_curl() { - CRYPTO_set_locking_callback(NULL); - for (int i(0); i < ssl_mutex_count; ++i) - { - delete ssl_mutex_list[i]; - } - delete [] ssl_mutex_list; -} - - -void ssl_thread_id_callback(CRYPTO_THREADID* pthreadid) -{ -#if defined(WIN32) - CRYPTO_THREADID_set_pointer(pthreadid, GetCurrentThread()); -#else - CRYPTO_THREADID_set_pointer(pthreadid, pthread_self()); -#endif -} - - -void ssl_locking_callback(int mode, int type, const char * /* file */, int /* line */) -{ - if (type >= 0 && type < ssl_mutex_count) - { - if (mode & CRYPTO_LOCK) - { - ssl_mutex_list[type]->lock(); - } - else - { - ssl_mutex_list[type]->unlock(); - } - } + curl_global_cleanup(); } diff --git a/indra/llcorehttp/tests/llcorehttp_test.cpp b/indra/llcorehttp/tests/llcorehttp_test.cpp index c0cc2c8030..c7c50e6166 100755 --- a/indra/llcorehttp/tests/llcorehttp_test.cpp +++ b/indra/llcorehttp/tests/llcorehttp_test.cpp @@ -41,11 +41,7 @@ #include "test_httpstatus.hpp" #include "test_refcounted.hpp" #include "test_httpoperation.hpp" -// As of 2019-06-28, test_httprequest.hpp consistently crashes on Mac Release -// builds for reasons not yet diagnosed. -#if ! (LL_DARWIN && LL_RELEASE) #include "test_httprequest.hpp" -#endif #include "test_httpheaders.hpp" #include "test_httprequestqueue.hpp" #include "_httpservice.h" @@ -53,9 +49,6 @@ #include "llproxy.h" #include "llcleanup.h" -void ssl_thread_id_callback(CRYPTO_THREADID*); -void ssl_locking_callback(int mode, int type, const char * file, int line); - #if 0 // lltut provides main and runner namespace tut @@ -80,27 +73,10 @@ int main() #endif // 0 -int ssl_mutex_count(0); -LLCoreInt::HttpMutex ** ssl_mutex_list = NULL; - void init_curl() { curl_global_init(CURL_GLOBAL_ALL); - ssl_mutex_count = CRYPTO_num_locks(); - if (ssl_mutex_count > 0) - { - ssl_mutex_list = new LLCoreInt::HttpMutex * [ssl_mutex_count]; - - for (int i(0); i < ssl_mutex_count; ++i) - { - ssl_mutex_list[i] = new LLCoreInt::HttpMutex; - } - - CRYPTO_set_locking_callback(ssl_locking_callback); - CRYPTO_THREADID_set_callback(ssl_thread_id_callback); - } - LLProxy::getInstance(); } @@ -108,39 +84,6 @@ void init_curl() void term_curl() { SUBSYSTEM_CLEANUP(LLProxy); - - CRYPTO_set_locking_callback(NULL); - for (int i(0); i < ssl_mutex_count; ++i) - { - delete ssl_mutex_list[i]; - } - delete [] ssl_mutex_list; -} - - -void ssl_thread_id_callback(CRYPTO_THREADID* pthreadid) -{ -#if defined(WIN32) - CRYPTO_THREADID_set_pointer(pthreadid, GetCurrentThread()); -#else - CRYPTO_THREADID_set_pointer(pthreadid, pthread_self()); -#endif -} - - -void ssl_locking_callback(int mode, int type, const char * /* file */, int /* line */) -{ - if (type >= 0 && type < ssl_mutex_count) - { - if (mode & CRYPTO_LOCK) - { - ssl_mutex_list[type]->lock(); - } - else - { - ssl_mutex_list[type]->unlock(); - } - } } diff --git a/indra/llcorehttp/tests/test_httprequest.hpp b/indra/llcorehttp/tests/test_httprequest.hpp index aed906bb8f..1afc08a108 100644 --- a/indra/llcorehttp/tests/test_httprequest.hpp +++ b/indra/llcorehttp/tests/test_httprequest.hpp @@ -454,6 +454,10 @@ void HttpRequestTestObjectType::test<4>() template <> template <> void HttpRequestTestObjectType::test<5>() { +#ifndef LL_WINDOWS + skip("Skip due to issues with testing pthread cancellation"); +#endif + ScopedCurlInit ready; set_test_name("HttpRequest Spin (soft) + NoOp + hard termination"); @@ -517,6 +521,9 @@ void HttpRequestTestObjectType::test<5>() template <> template <> void HttpRequestTestObjectType::test<6>() { +#ifndef LL_WINDOWS + skip("Skip due to issues with testing pthread cancellation"); +#endif ScopedCurlInit ready; set_test_name("HttpRequest Spin + NoOp + hard termination"); diff --git a/indra/llcorehttp/tests/test_refcounted.hpp b/indra/llcorehttp/tests/test_refcounted.hpp index c0c8e78413..eb23a25545 100644 --- a/indra/llcorehttp/tests/test_refcounted.hpp +++ b/indra/llcorehttp/tests/test_refcounted.hpp @@ -28,8 +28,6 @@ #include "_refcounted.h" -// disable all of this because it's hanging win64 builds? -#if ! (LL_WINDOWS && ADDRESS_SIZE == 64) using namespace LLCoreInt; namespace tut @@ -122,5 +120,4 @@ namespace tut ensure(rc->getRefCount() == RefCounted::NOT_REF_COUNTED); } } -#endif // disabling on Win64 #endif // TEST_LLCOREINT_REF_COUNTED_H_ -- cgit v1.2.3 From fd94dc0cd0afbca1446945522805dd833d45be7f Mon Sep 17 00:00:00 2001 From: Rye Date: Mon, 10 Feb 2025 14:10:47 -0500 Subject: Disable old GPU hacks on macos when running against Apple GPU --- indra/llrender/llglslshader.cpp | 7 +++++-- indra/llrender/llshadermgr.cpp | 2 +- indra/llrender/llvertexbuffer.cpp | 6 ------ indra/newview/pipeline.cpp | 9 ++++++--- 4 files changed, 12 insertions(+), 12 deletions(-) diff --git a/indra/llrender/llglslshader.cpp b/indra/llrender/llglslshader.cpp index 0841c0e943..66f38c9281 100644 --- a/indra/llrender/llglslshader.cpp +++ b/indra/llrender/llglslshader.cpp @@ -421,8 +421,11 @@ bool LLGLSLShader::createShader() llassert_always(!mShaderFiles.empty()); #if LL_DARWIN - // work-around missing mix(vec3,vec3,bvec3) - mDefines["OLD_SELECT"] = "1"; + if(!gGLManager.mIsApple) + { + // work-around missing mix(vec3,vec3,bvec3) + mDefines["OLD_SELECT"] = "1"; + } #endif mShaderHash = hash(); diff --git a/indra/llrender/llshadermgr.cpp b/indra/llrender/llshadermgr.cpp index 25d8ccd4b3..b1e2114156 100644 --- a/indra/llrender/llshadermgr.cpp +++ b/indra/llrender/llshadermgr.cpp @@ -450,7 +450,7 @@ GLuint LLShaderMgr::loadShaderFile(const std::string& filename, S32 & shader_lev // endsure work-around for missing GLSL funcs gets propogated to feature shader files (e.g. srgbF.glsl) #if LL_DARWIN - if (defines) + if (!gGLManager.mIsApple && defines) { (*defines)["OLD_SELECT"] = "1"; } diff --git a/indra/llrender/llvertexbuffer.cpp b/indra/llrender/llvertexbuffer.cpp index 86ec9a453b..d59ddd0fec 100644 --- a/indra/llrender/llvertexbuffer.cpp +++ b/indra/llrender/llvertexbuffer.cpp @@ -787,12 +787,6 @@ void LLVertexBuffer::drawElements(U32 mode, const LLVector4a* pos, const LLVecto gGL.syncMatrices(); - U32 mask = LLVertexBuffer::MAP_VERTEX; - if (tc) - { - mask = mask | LLVertexBuffer::MAP_TEXCOORD0; - } - unbind(); gGL.begin(mode); diff --git a/indra/newview/pipeline.cpp b/indra/newview/pipeline.cpp index ddfb5a5621..4a4b938152 100644 --- a/indra/newview/pipeline.cpp +++ b/indra/newview/pipeline.cpp @@ -1440,9 +1440,12 @@ void LLPipeline::createLUTBuffers() U32 pix_format = GL_R16F; #if LL_DARWIN - // Need to work around limited precision with 10.6.8 and older drivers - // - pix_format = GL_R32F; + if(!gGLManager.mIsApple) + { + // Need to work around limited precision with 10.6.8 and older drivers + // + pix_format = GL_R32F; + } #endif LLImageGL::generateTextures(1, &mLightFunc); gGL.getTexUnit(0)->bindManual(LLTexUnit::TT_TEXTURE, mLightFunc); -- cgit v1.2.3 From 4a56738e4fb3242374a624bf744bb98e37ea9623 Mon Sep 17 00:00:00 2001 From: Rye Date: Mon, 10 Feb 2025 14:13:21 -0500 Subject: Disable LLImageJPEG setjmp hack when building on ARM to avoid crash --- indra/llimage/llimagejpeg.cpp | 13 +++++++++++-- indra/llimage/llimagejpeg.h | 2 ++ 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/indra/llimage/llimagejpeg.cpp b/indra/llimage/llimagejpeg.cpp index 0e7ec365d4..50536a2798 100644 --- a/indra/llimage/llimagejpeg.cpp +++ b/indra/llimage/llimagejpeg.cpp @@ -31,7 +31,9 @@ #include "llerror.h" #include "llexception.h" +#if !LL_ARM64 jmp_buf LLImageJPEG::sSetjmpBuffer ; +#endif LLImageJPEG::LLImageJPEG(S32 quality) : LLImageFormatted(IMG_CODEC_JPEG), mOutputBuffer( NULL ), @@ -78,12 +80,15 @@ bool LLImageJPEG::updateData() // //try/catch will crash on Mac and Linux if LLImageJPEG::errorExit throws an error //so as instead, we use setjmp/longjmp to avoid this crash, which is the best we can get. --bao + //except in the case of AARCH64/ARM64 where setjmp will crash // +#if !LL_ARM64 if(setjmp(sSetjmpBuffer)) { jpeg_destroy_decompress(&cinfo); return false; } +#endif try { // Now we can initialize the JPEG decompression object. @@ -223,11 +228,13 @@ bool LLImageJPEG::decode(LLImageRaw* raw_image, F32 decode_time) //try/catch will crash on Mac and Linux if LLImageJPEG::errorExit throws an error //so as instead, we use setjmp/longjmp to avoid this crash, which is the best we can get. --bao // +#if !LL_ARM64 if(setjmp(sSetjmpBuffer)) { jpeg_destroy_decompress(&cinfo); return true; // done } +#endif try { // Now we can initialize the JPEG decompression object. @@ -431,9 +438,10 @@ void LLImageJPEG::errorExit( j_common_ptr cinfo ) // Let the memory manager delete any temp files jpeg_destroy(cinfo); - +#if !LL_ARM64 // Return control to the setjmp point longjmp(sSetjmpBuffer, 1) ; +#endif } // Decide whether to emit a trace or warning message. @@ -545,6 +553,7 @@ bool LLImageJPEG::encode( const LLImageRaw* raw_image, F32 encode_time ) //try/catch will crash on Mac and Linux if LLImageJPEG::errorExit throws an error //so as instead, we use setjmp/longjmp to avoid this crash, which is the best we can get. --bao // +#if !LL_ARM64 if( setjmp(sSetjmpBuffer) ) { // If we get here, the JPEG code has signaled an error. @@ -555,7 +564,7 @@ bool LLImageJPEG::encode( const LLImageRaw* raw_image, F32 encode_time ) mOutputBufferSize = 0; return false; } - +#endif try { diff --git a/indra/llimage/llimagejpeg.h b/indra/llimage/llimagejpeg.h index 012b87a42d..ee0a8815e8 100644 --- a/indra/llimage/llimagejpeg.h +++ b/indra/llimage/llimagejpeg.h @@ -78,7 +78,9 @@ protected: S32 mEncodeQuality; // on a scale from 1 to 100 private: +#if !LL_ARM64 static jmp_buf sSetjmpBuffer; // To allow the library to abort. +#endif }; #endif // LL_LLIMAGEJPEG_H -- cgit v1.2.3 From 0f4aa87caca779d77c19dfef06fe8a276f7d0eb6 Mon Sep 17 00:00:00 2001 From: Rye Date: Mon, 10 Feb 2025 16:11:39 -0500 Subject: Vectorize LLRender UI scale and offset stack to resolve perf hotspot on arm --- indra/llrender/llrender.cpp | 53 +++++++++++++++------------------------------ indra/llrender/llrender.h | 9 +++----- 2 files changed, 21 insertions(+), 41 deletions(-) diff --git a/indra/llrender/llrender.cpp b/indra/llrender/llrender.cpp index ec76aa4f36..c26e9b15b8 100644 --- a/indra/llrender/llrender.cpp +++ b/indra/llrender/llrender.cpp @@ -118,7 +118,7 @@ static const GLenum sGLBlendFactor[] = LLTexUnit::LLTexUnit(S32 index) : mCurrTexType(TT_NONE), - mCurrColorScale(1), mCurrAlphaScale(1), mCurrTexture(0), + mCurrTexture(0), mHasMipMaps(false), mIndex(index) { @@ -600,26 +600,6 @@ GLint LLTexUnit::getTextureSourceType(eTextureBlendSrc src, bool isAlpha) } } -void LLTexUnit::setColorScale(S32 scale) -{ - if (mCurrColorScale != scale || gGL.mDirty) - { - mCurrColorScale = scale; - gGL.flush(); - glTexEnvi( GL_TEXTURE_ENV, GL_RGB_SCALE, scale ); - } -} - -void LLTexUnit::setAlphaScale(S32 scale) -{ - if (mCurrAlphaScale != scale || gGL.mDirty) - { - mCurrAlphaScale = scale; - gGL.flush(); - glTexEnvi( GL_TEXTURE_ENV, GL_ALPHA_SCALE, scale ); - } -} - // Useful for debugging that you've manually assigned a texture operation to the correct // texture unit based on the currently set active texture in opengl. void LLTexUnit::debugTextureUnit(void) @@ -1283,9 +1263,7 @@ void LLRender::translateUI(F32 x, F32 y, F32 z) LL_ERRS() << "Need to push a UI translation frame before offsetting" << LL_ENDL; } - mUIOffset.back().mV[0] += x; - mUIOffset.back().mV[1] += y; - mUIOffset.back().mV[2] += z; + mUIOffset.back().add(LLVector4a(x, y, z)); } void LLRender::scaleUI(F32 x, F32 y, F32 z) @@ -1295,14 +1273,14 @@ void LLRender::scaleUI(F32 x, F32 y, F32 z) LL_ERRS() << "Need to push a UI transformation frame before scaling." << LL_ENDL; } - mUIScale.back().scaleVec(LLVector3(x,y,z)); + mUIScale.back().mul(LLVector4a(x, y, z)); } void LLRender::pushUIMatrix() { if (mUIOffset.empty()) { - mUIOffset.emplace_back(0.f,0.f,0.f); + mUIOffset.emplace_back(0.f); } else { @@ -1311,7 +1289,7 @@ void LLRender::pushUIMatrix() if (mUIScale.empty()) { - mUIScale.emplace_back(1.f,1.f,1.f); + mUIScale.emplace_back(1.f); } else { @@ -1333,18 +1311,20 @@ LLVector3 LLRender::getUITranslation() { if (mUIOffset.empty()) { - return LLVector3(0,0,0); + return LLVector3::zero; } - return mUIOffset.back(); + + return LLVector3(mUIOffset.back().getF32ptr()); } LLVector3 LLRender::getUIScale() { if (mUIScale.empty()) { - return LLVector3(1,1,1); + return LLVector3::all_one; } - return mUIScale.back(); + + return LLVector3(mUIScale.back().getF32ptr()); } @@ -1354,8 +1334,9 @@ void LLRender::loadUIIdentity() { LL_ERRS() << "Need to push UI translation frame before clearing offset." << LL_ENDL; } - mUIOffset.back().setVec(0,0,0); - mUIScale.back().setVec(1,1,1); + + mUIOffset.back().clear(); + mUIScale.back().splat(1); } void LLRender::setColorMask(bool writeColor, bool writeAlpha) @@ -1783,8 +1764,10 @@ void LLRender::vertex3f(const GLfloat& x, const GLfloat& y, const GLfloat& z) } else { - LLVector3 vert = (LLVector3(x,y,z)+mUIOffset.back()).scaledVec(mUIScale.back()); - mVerticesp[mCount].set(vert.mV[VX], vert.mV[VY], vert.mV[VZ]); + LLVector4a vert(x, y, z); + vert.add(mUIOffset.back()); + vert.mul(mUIScale.back()); + mVerticesp[mCount] = vert; } mCount++; diff --git a/indra/llrender/llrender.h b/indra/llrender/llrender.h index 7b6bd4198b..9e68c2dcd1 100644 --- a/indra/llrender/llrender.h +++ b/indra/llrender/llrender.h @@ -43,6 +43,7 @@ #include "llglheaders.h" #include "llmatrix4a.h" #include "glm/mat4x4.hpp" +#include #include #include @@ -227,13 +228,9 @@ protected: S32 mIndex; U32 mCurrTexture; eTextureType mCurrTexType; - S32 mCurrColorScale; - S32 mCurrAlphaScale; bool mHasMipMaps; void debugTextureUnit(void); - void setColorScale(S32 scale); - void setAlphaScale(S32 scale); GLint getTextureSource(eTextureBlendSrc src); GLint getTextureSourceType(eTextureBlendSrc src, bool isAlpha = false); }; @@ -526,8 +523,8 @@ private: eBlendFactor mCurrBlendAlphaSFactor; eBlendFactor mCurrBlendAlphaDFactor; - std::vector mUIOffset; - std::vector mUIScale; + std::vector > mUIOffset; + std::vector > mUIScale; }; extern F32 gGLModelView[16]; -- cgit v1.2.3 From ded94713550ef10642dbd3ca77660023e9e15fcc Mon Sep 17 00:00:00 2001 From: Rye Date: Mon, 10 Feb 2025 16:18:15 -0500 Subject: Disable MSAA buffers on macos during GL context init --- indra/llwindow/llopenglview-objc.mm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/indra/llwindow/llopenglview-objc.mm b/indra/llwindow/llopenglview-objc.mm index 0bd4e506a2..4e5b882011 100644 --- a/indra/llwindow/llopenglview-objc.mm +++ b/indra/llwindow/llopenglview-objc.mm @@ -255,8 +255,8 @@ attributedStringInfo getSegments(NSAttributedString *str) NSOpenGLPFADoubleBuffer, NSOpenGLPFAClosestPolicy, NSOpenGLPFAAccelerated, - NSOpenGLPFASampleBuffers, static_cast(samples > 0 ? 1 : 0), - NSOpenGLPFASamples, static_cast(samples), + NSOpenGLPFASampleBuffers, 0, + NSOpenGLPFASamples, 0, NSOpenGLPFAStencilSize, 8, NSOpenGLPFADepthSize, 24, NSOpenGLPFAAlphaSize, 8, -- cgit v1.2.3 From 9b060f7fccfed39a7c24dafaa4c66da0cfc4984d Mon Sep 17 00:00:00 2001 From: Rye Date: Tue, 11 Feb 2025 05:03:13 -0500 Subject: Fix deprecation warnings under C++20 on MSVC --- indra/cmake/00-Common.cmake | 2 ++ indra/llcommon/llsys.cpp | 5 +++++ indra/newview/llface.cpp | 6 ------ indra/newview/llgltfmateriallist.cpp | 7 ++++--- indra/newview/llmaterialeditor.cpp | 5 +++-- 5 files changed, 14 insertions(+), 11 deletions(-) diff --git a/indra/cmake/00-Common.cmake b/indra/cmake/00-Common.cmake index 167964fa16..ad88107719 100644 --- a/indra/cmake/00-Common.cmake +++ b/indra/cmake/00-Common.cmake @@ -73,6 +73,8 @@ if (WINDOWS) NOMINMAX # DOM_DYNAMIC # For shared library colladadom _CRT_SECURE_NO_WARNINGS # Allow use of sprintf etc + _CRT_NONSTDC_NO_DEPRECATE # Allow use of sprintf etc + _CRT_OBSOLETE_NO_WARNINGS _WINSOCK_DEPRECATED_NO_WARNINGS # Disable deprecated WinSock API warnings ) add_compile_options( diff --git a/indra/llcommon/llsys.cpp b/indra/llcommon/llsys.cpp index 3f33ad61c5..b38b3725be 100644 --- a/indra/llcommon/llsys.cpp +++ b/indra/llcommon/llsys.cpp @@ -192,6 +192,9 @@ LLOSInfo::LLOSInfo() : GetSystemInfo(&si); //if it fails get regular system info //(Warning: If GetSystemInfo it may result in incorrect information in a WOW64 machine, if the kernel fails to load) +#pragma warning(push) +#pragma warning(disable : 4996) // ignore 'deprecated.' GetVersionEx is deprecated + // Try calling GetVersionEx using the OSVERSIONINFOEX structure. OSVERSIONINFOEX osvi; ZeroMemory(&osvi, sizeof(OSVERSIONINFOEX)); @@ -210,6 +213,8 @@ LLOSInfo::LLOSInfo() : } } +#pragma warning(pop) + S32 ubr = 0; // Windows 10 Update Build Revision, can be retrieved from a registry if (mMajorVer == 10) { diff --git a/indra/newview/llface.cpp b/indra/newview/llface.cpp index 811aacb2ed..77a6e20b07 100644 --- a/indra/newview/llface.cpp +++ b/indra/newview/llface.cpp @@ -767,9 +767,6 @@ static void xform4a(LLVector4a &tex_coord, const LLVector4a& trans, const LLVect // Texture transforms are done about the center of the face. st.setAdd(tex_coord, trans); - // Handle rotation - LLVector4a rot_st; - // LLVector4a s0; s0.splat(st, 0); @@ -842,7 +839,6 @@ bool LLFace::genVolumeBBoxes(const LLVolume &volume, S32 f, //VECTORIZE THIS LLMatrix4a mat_vert; mat_vert.loadu(mat_vert_in); - LLVector4a new_extents[2]; llassert(less_than_max_mag(face.mExtents[0])); llassert(less_than_max_mag(face.mExtents[1])); @@ -2255,8 +2251,6 @@ bool LLFace::calcPixelArea(F32& cos_angle_to_view_dir, F32& radius) if (joint) { - LLVector4a jointPos; - LLMatrix4a worldMat; worldMat.loadu((F32*)&joint->getWorldMatrix().mMatrix[0][0]); diff --git a/indra/newview/llgltfmateriallist.cpp b/indra/newview/llgltfmateriallist.cpp index 25438eae5e..d7b088b56d 100644 --- a/indra/newview/llgltfmateriallist.cpp +++ b/indra/newview/llgltfmateriallist.cpp @@ -45,7 +45,9 @@ #include "llworld.h" #include "tinygltf/tiny_gltf.h" -#include + +#include +#include #include @@ -539,8 +541,7 @@ void LLGLTFMaterialList::onAssetLoadComplete(const LLUUID& id, LLAssetType::ETyp LLSD asset; // read file into buffer - std::istrstream str(&buffer[0], static_cast(buffer.size())); - + boost::iostreams::stream str(buffer.data(), buffer.size()); if (LLSDSerialize::deserialize(asset, str, buffer.size())) { if (asset.has("version") && LLGLTFMaterial::isAcceptedVersion(asset["version"].asString())) diff --git a/indra/newview/llmaterialeditor.cpp b/indra/newview/llmaterialeditor.cpp index 1e3a328464..d58f5d5285 100644 --- a/indra/newview/llmaterialeditor.cpp +++ b/indra/newview/llmaterialeditor.cpp @@ -63,8 +63,9 @@ #include "tinygltf/tiny_gltf.h" #include "lltinygltfhelper.h" -#include +#include +#include const std::string MATERIAL_BASE_COLOR_DEFAULT_NAME = "Base Color"; const std::string MATERIAL_NORMAL_DEFAULT_NAME = "Normal"; @@ -1245,7 +1246,7 @@ bool LLMaterialEditor::decodeAsset(const std::vector& buffer) { LLSD asset; - std::istrstream str(&buffer[0], buffer.size()); + boost::iostreams::stream str(buffer.data(), buffer.size()); if (LLSDSerialize::deserialize(asset, str, buffer.size())) { if (asset.has("version") && LLGLTFMaterial::isAcceptedVersion(asset["version"].asString())) -- cgit v1.2.3 From 179b29252d8bb28e11686a1852c8e8ffcd98ecc0 Mon Sep 17 00:00:00 2001 From: Rye Date: Tue, 11 Feb 2025 05:02:45 -0500 Subject: Rework windows to use zc:wchar_t for better c++ conformance and compatibility with modern libraries --- autobuild.xml | 150 ++++++++++++++++---------------- indra/llcommon/llapp.cpp | 4 +- indra/llcommon/llerror.cpp | 2 +- indra/llcommon/llfile.cpp | 38 +++----- indra/llcommon/llsys.cpp | 4 +- indra/llcommon/tests/stringize_test.cpp | 12 +++ indra/llcrashlogger/llcrashlock.cpp | 4 +- indra/llfilesystem/lldir.cpp | 4 +- indra/llfilesystem/lldir_win32.cpp | 12 +-- indra/llfilesystem/lldir_win32.h | 2 +- indra/llfilesystem/lldirguard.h | 7 +- indra/llfilesystem/lldiriterator.cpp | 2 +- indra/llfilesystem/lldiskcache.cpp | 8 +- indra/llfilesystem/llfilesystem.cpp | 4 +- indra/llwindow/lldxhardware.cpp | 6 +- indra/llwindow/llwindowwin32.cpp | 37 ++++---- indra/newview/llappviewerwin32.cpp | 20 ++--- indra/newview/llfilepicker.cpp | 10 +-- indra/newview/llfloaterjoystick.cpp | 2 +- indra/newview/lllocalbitmaps.cpp | 2 +- indra/newview/lllocalgltfmaterials.cpp | 2 +- indra/newview/llmachineid.cpp | 4 +- indra/newview/llviewerjoystick.cpp | 6 +- indra/newview/llviewerwindow.cpp | 2 +- 24 files changed, 174 insertions(+), 170 deletions(-) diff --git a/autobuild.xml b/autobuild.xml index ad563eccc6..2d2f221fa0 100644 --- a/autobuild.xml +++ b/autobuild.xml @@ -116,11 +116,11 @@ archive hash - 320a8b76b1d30e5c1e7095c0c8315e8d0b68cbc5 + a4553df5b8fde2e9cd54ebb94c6efb8eb5fe3c38 hash_algorithm sha1 url - https://github.com/secondlife/3p-boost/releases/download/v1.86.0-dfe318c/boost-1.86-darwin64-11977000894.tar.zst + https://github.com/secondlife/3p-boost/releases/download/v1.86.0-be1a669/boost-1.86-darwin64-13246092114.tar.zst name darwin64 @@ -130,11 +130,11 @@ archive hash - 589a3577448190f87dc1c3bb8149ff57780772d8 + 4a2a19dc5cb555e157ad894ba917f5a83a35b20d hash_algorithm sha1 url - https://github.com/secondlife/3p-boost/releases/download/v1.86.0-dfe318c/boost-1.86-linux64-11977000894.tar.zst + https://github.com/secondlife/3p-boost/releases/download/v1.86.0-be1a669/boost-1.86-linux64-13246092114.tar.zst name linux64 @@ -144,11 +144,11 @@ archive hash - 28a268d88e26f081bc2341400ca6a5bc72ac78a8 + 8a1fa9366bfe49009286e4805d7aaedb7c3df82e hash_algorithm sha1 url - https://github.com/secondlife/3p-boost/releases/download/v1.86.0-dfe318c/boost-1.86-windows64-11977000894.tar.zst + https://github.com/secondlife/3p-boost/releases/download/v1.86.0-be1a669/boost-1.86-windows64-13246092114.tar.zst name windows64 @@ -220,11 +220,11 @@ archive hash - 3a8de0ed0611279bd393df1cb224dfd3bbb907b7 + bf2fe4e8272e990bc8687b3b37bf4bb2b2ad6eb4 hash_algorithm sha1 url - https://github.com/secondlife/3p-colladadom/releases/download/v2.3-r9/colladadom-2.3.0-r9-darwin64-12258978859.tar.zst + https://github.com/secondlife/3p-colladadom/releases/download/v2.3-r10/colladadom-2.3.0-r10-darwin64-13259816660.tar.zst name darwin64 @@ -234,11 +234,11 @@ archive hash - c2cc015c86536cb4a77d909af1644e54a031ee6f + 118e509ca464182ef4b94ee8c4aa5b14a6c52a94 hash_algorithm sha1 url - https://github.com/secondlife/3p-colladadom/releases/download/v2.3-r9/colladadom-2.3.0-r9-linux64-12258978859.tar.zst + https://github.com/secondlife/3p-colladadom/releases/download/v2.3-r10/colladadom-2.3.0-r10-linux64-13259816660.tar.zst name linux64 @@ -248,18 +248,18 @@ archive hash - c4807fd3352e6c175f7a28128e0269e524b051cb + d7aee1b2ec17bd88a2c27359281b58a11ec52d48 hash_algorithm sha1 url - https://github.com/secondlife/3p-colladadom/releases/download/v2.3-r9/colladadom-2.3.0-r9-windows64-12258978859.tar.zst + https://github.com/secondlife/3p-colladadom/releases/download/v2.3-r10/colladadom-2.3.0-r10-windows64-13259816660.tar.zst name windows64 version - 2.3.0-r9 + 2.3.0-r10 cubemaptoequirectangular @@ -328,11 +328,11 @@ archive hash - 4f2f5ea4de2891d2ffcc707f984729ddb523d5e1 + e742b1e2d0a58d607b023bf55411041ac65e8a76 hash_algorithm sha1 url - https://github.com/secondlife/3p-curl/releases/download/v7.54.1-r2/curl-7.54.1-12258966289-darwin64-12258966289.tar.zst + https://github.com/secondlife/3p-curl/releases/download/v7.54.1-r3/curl-7.54.1-13259824618-darwin64-13259824618.tar.zst name darwin64 @@ -342,11 +342,11 @@ archive hash - a4d6303c59f9c9760c5243b6d4d7b7b199ba9356 + 49621c70f385d37c95bcb69a9a24d86ac25f4781 hash_algorithm sha1 url - https://github.com/secondlife/3p-curl/releases/download/v7.54.1-r2/curl-7.54.1-12258966289-linux64-12258966289.tar.zst + https://github.com/secondlife/3p-curl/releases/download/v7.54.1-r3/curl-7.54.1-13259824618-linux64-13259824618.tar.zst name linux64 @@ -356,11 +356,11 @@ archive hash - ec0d4717e4b841107b19cab7bd705f327a89f397 + 2522201692116cf0adb7203e169be9126885108c hash_algorithm sha1 url - https://github.com/secondlife/3p-curl/releases/download/v7.54.1-r2/curl-7.54.1-12258966289-windows64-12258966289.tar.zst + https://github.com/secondlife/3p-curl/releases/download/v7.54.1-r3/curl-7.54.1-13259824618-windows64-13259824618.tar.zst name windows64 @@ -373,7 +373,7 @@ copyright Copyright (c) 1996 - 2014, Daniel Stenberg, (daniel@haxx.se). version - 7.54.1-12258966289 + 7.54.1-13259824618 name curl description @@ -644,11 +644,11 @@ archive hash - e079a1b6f47d02ed63ca5cffec79ac75532f6eaf + 5e6c7b9aaf73d90d7feab846a4024193c48eff6c hash_algorithm sha1 url - https://github.com/secondlife/3p-freetype/releases/download/v2.13.3-r2/freetype-2.13.3-r2-darwin64-12259007838.tar.zst + https://github.com/secondlife/3p-freetype/releases/download/v2.13.3-r3/freetype-2.13.3-r3-darwin64-13259804885.tar.zst name darwin64 @@ -658,11 +658,11 @@ archive hash - 6e33a17fb9360a670dfbac51efbe5f4c2bb88c81 + a9a3c371958e64a49b07d7be8f59218dfd6b0352 hash_algorithm sha1 url - https://github.com/secondlife/3p-freetype/releases/download/v2.13.3-r2/freetype-2.13.3-r2-linux64-12259007838.tar.zst + https://github.com/secondlife/3p-freetype/releases/download/v2.13.3-r3/freetype-2.13.3-r3-linux64-13259804885.tar.zst name linux64 @@ -672,18 +672,18 @@ archive hash - 6a543ab76d8e2095f811e46cf4e8a2f454934f77 + ad7fbc4a01607ec43d86035a49dadd43d6f2a4e5 hash_algorithm sha1 url - https://github.com/secondlife/3p-freetype/releases/download/v2.13.3-r2/freetype-2.13.3-r2-windows64-12259007838.tar.zst + https://github.com/secondlife/3p-freetype/releases/download/v2.13.3-r3/freetype-2.13.3-r3-windows64-13259804885.tar.zst name windows64 version - 2.13.3-r2 + 2.13.3-r3 glext @@ -1210,11 +1210,11 @@ archive hash - 75ff1513c5527a541bac0b685a90a49afb086156 + a453355ee032f79aea4142218a957085a22c7656 hash_algorithm sha1 url - https://github.com/secondlife/3p-libpng/releases/download/v1.6.44-r1/libpng-1.6.44-r1-darwin64-11965237099.tar.zst + https://github.com/secondlife/3p-libpng/releases/download/v1.6.44-r2/libpng-1.6.44-r2-darwin64-13246065198.tar.zst name darwin64 @@ -1224,11 +1224,11 @@ archive hash - 23967758d45afc1e2243c3669ca045945de588a7 + 75c7608646c9f5b99b1a9e3946326e2804a304d7 hash_algorithm sha1 url - https://github.com/secondlife/3p-libpng/releases/download/v1.6.44-r1/libpng-1.6.44-r1-linux64-11965237099.tar.zst + https://github.com/secondlife/3p-libpng/releases/download/v1.6.44-r2/libpng-1.6.44-r2-linux64-13246065198.tar.zst name linux64 @@ -1238,11 +1238,11 @@ archive hash - 19ac0a301438a0cbe8cb65179ce9e130f5fd827a + 09af51774c4ee7c03fe67a87dfc52e846aa625ea hash_algorithm sha1 url - https://github.com/secondlife/3p-libpng/releases/download/v1.6.44-r1/libpng-1.6.44-r1-windows64-11965237099.tar.zst + https://github.com/secondlife/3p-libpng/releases/download/v1.6.44-r2/libpng-1.6.44-r2-windows64-13246065198.tar.zst name windows64 @@ -1255,7 +1255,7 @@ copyright Copyright (c) 2004, 2006-2013 Glenn Randers-Pehrson version - 1.6.44-r1 + 1.6.44-r2 name libpng description @@ -1300,11 +1300,11 @@ archive hash - a7062e4feef42461b9acb4bfcef99bea5c89945e + 372c92936d940b1cfb5ba34310691d4bb435c161 hash_algorithm sha1 url - https://github.com/secondlife/3p-libxml2/releases/download/v2.13.5-r1/libxml2-2.13.5-r1-darwin64-11967192668.tar.zst + https://github.com/secondlife/3p-libxml2/releases/download/v2.13.5-r2/libxml2-2.13.5-r2-darwin64-13246071272.tar.zst name darwin64 @@ -1314,11 +1314,11 @@ archive hash - 991aad5931d5f05e43b8750ad81ae59ac6013e59 + ba6fbc34112b1acab1c8615dcd13de983f3678d3 hash_algorithm sha1 url - https://github.com/secondlife/3p-libxml2/releases/download/v2.13.5-r1/libxml2-2.13.5-r1-linux64-11967192668.tar.zst + https://github.com/secondlife/3p-libxml2/releases/download/v2.13.5-r2/libxml2-2.13.5-r2-linux64-13246071272.tar.zst name linux64 @@ -1328,11 +1328,11 @@ archive hash - 4c00019229adc761673808567b8dcd64c7ba4a85 + 71968c4b621636e8ae0c5680e631f4aa67561944 hash_algorithm sha1 url - https://github.com/secondlife/3p-libxml2/releases/download/v2.13.5-r1/libxml2-2.13.5-r1-windows64-11967192668.tar.zst + https://github.com/secondlife/3p-libxml2/releases/download/v2.13.5-r2/libxml2-2.13.5-r2-windows64-13246071272.tar.zst name windows64 @@ -1345,7 +1345,7 @@ copyright Copyright (C) 1998-2012 Daniel Veillard. All Rights Reserved. version - 2.13.5-r1 + 2.13.5-r2 name libxml2 description @@ -1739,11 +1739,11 @@ archive hash - 40ef787f43a47acb18fd06cb9605f2f1ec6273fd + b628d088e1f368a0cd51a6b66292aaf9a025e2d4 hash_algorithm sha1 url - https://github.com/secondlife/3p-minizip-ng/releases/download/v4.0.7-r2/minizip_ng-4.0.7-r2-darwin64-11967198844.tar.zst + https://github.com/secondlife/3p-minizip-ng/releases/download/v4.0.7-r3/minizip_ng-4.0.7-r3-darwin64-13246046977.tar.zst name darwin64 @@ -1753,11 +1753,11 @@ archive hash - 2c403efb5c59e7189b5e86a9001bb4f9e0647f6e + 492ce9175b730d43df63821c4481685e035af623 hash_algorithm sha1 url - https://github.com/secondlife/3p-minizip-ng/releases/download/v4.0.7-r2/minizip_ng-4.0.7-r2-linux64-11967198844.tar.zst + https://github.com/secondlife/3p-minizip-ng/releases/download/v4.0.7-r3/minizip_ng-4.0.7-r3-linux64-13246046977.tar.zst name linux64 @@ -1767,11 +1767,11 @@ archive hash - 18a3d4adf09074f4ed97f7d086b30ce828d3508b + 58773e707ff3490822b7b8217d7729ade2186632 hash_algorithm sha1 url - https://github.com/secondlife/3p-minizip-ng/releases/download/v4.0.7-r2/minizip_ng-4.0.7-r2-windows64-11967198844.tar.zst + https://github.com/secondlife/3p-minizip-ng/releases/download/v4.0.7-r3/minizip_ng-4.0.7-r3-windows64-13246046977.tar.zst name windows64 @@ -1784,7 +1784,7 @@ copyright This project uses the zlib license. Copyright (C) 1995-2013 Jean-loup Gailly and Mark Adler version - 4.0.7-r2 + 4.0.7-r3 name minizip-ng canonical_repo @@ -1857,11 +1857,11 @@ archive hash - dd0c79ac49e5e81cd153d44061c044d1db950fdc + f45ea5a42d6a419f9b605dd3f976fbcb3850d736 hash_algorithm sha1 url - https://github.com/secondlife/3p-nghttp2/releases/download/v1.64.0-r1/nghttp2-1.64.0-r1-darwin64-11965382595.tar.zst + https://github.com/secondlife/3p-nghttp2/releases/download/v1.64.0-r2/nghttp2-1.64.0-r1-darwin64-13184359419.tar.zst name darwin64 @@ -1871,11 +1871,11 @@ archive hash - 0ba810156e0f1ceee8fcc9f9115b91111323fabd + c6e450fa41f24f1b4103d2006d706595f2a36c59 hash_algorithm sha1 url - https://github.com/secondlife/3p-nghttp2/releases/download/v1.64.0-r1/nghttp2-1.64.0-r1-linux64-11965382595.tar.zst + https://github.com/secondlife/3p-nghttp2/releases/download/v1.64.0-r2/nghttp2-1.64.0-r1-linux64-13184359419.tar.zst name linux64 @@ -1885,11 +1885,11 @@ archive hash - 182e03f4ef36eff082c571c33b13111d4cd6c8dd + 3bd92f892e155104740570fe244ea4dbb0b57d4b hash_algorithm sha1 url - https://github.com/secondlife/3p-nghttp2/releases/download/v1.64.0-r1/nghttp2-1.64.0-r1-windows64-11965382595.tar.zst + https://github.com/secondlife/3p-nghttp2/releases/download/v1.64.0-r2/nghttp2-1.64.0-r1-windows64-13184359419.tar.zst name windows64 @@ -2027,11 +2027,11 @@ Copyright (c) 2012, 2014, 2015, 2016 nghttp2 contributors archive hash - 9250e12d4d88f0a437e49be2b32d107f6b4270d0 + a3cc405d48a48a474d05b3de3d28da2005d80037 hash_algorithm sha1 url - https://github.com/secondlife/3p-openal-soft/releases/download/v1.24.0-r1/openal-1.24.0-r1-darwin64-11968917548.tar.zst + https://github.com/secondlife/3p-openal-soft/releases/download/v1.24.2-r1/openal-1.24.2-r1-darwin64-13245988487.tar.zst name darwin64 @@ -2041,11 +2041,11 @@ Copyright (c) 2012, 2014, 2015, 2016 nghttp2 contributors archive hash - 1e50db24586fba434a2be62f94fdc687569379ca + a2b63f0f85ca156c59ee1d34ef96c8e50b89153c hash_algorithm sha1 url - https://github.com/secondlife/3p-openal-soft/releases/download/v1.24.0-r1/openal-1.24.0-r1-linux64-11968917548.tar.zst + https://github.com/secondlife/3p-openal-soft/releases/download/v1.24.2-r1/openal-1.24.2-r1-linux64-13245988487.tar.zst name linux64 @@ -2055,11 +2055,11 @@ Copyright (c) 2012, 2014, 2015, 2016 nghttp2 contributors archive hash - 2ec7b2b1f4c37e5bd1b473e4a26935ec374ee208 + 8ad24fba1191c9cb0d2ab36e64b04b4648a99f43 hash_algorithm sha1 url - https://github.com/secondlife/3p-openal-soft/releases/download/v1.24.0-r1/openal-1.24.0-r1-windows64-11968917548.tar.zst + https://github.com/secondlife/3p-openal-soft/releases/download/v1.24.2-r1/openal-1.24.2-r1-windows64-13245988487.tar.zst name windows64 @@ -2072,7 +2072,7 @@ Copyright (c) 2012, 2014, 2015, 2016 nghttp2 contributors copyright Copyright (C) 1999-2007 by authors. version - 1.24.0-r1 + 1.24.2-r1 name openal description @@ -2147,11 +2147,11 @@ Copyright (c) 2012, 2014, 2015, 2016 nghttp2 contributors archive hash - f6fdad42168b30932384310866642b072465af11 + 157193699127ac5056c5fc1a410f9c98d39731e2 hash_algorithm sha1 url - https://github.com/secondlife/3p-openssl/releases/download/v1.1.1w-r2/openssl-1.1.1w-r2-darwin64-11965633361.tar.zst + https://github.com/secondlife/3p-openssl/releases/download/v1.1.1w-r3/openssl-1.1.1w-r3-darwin64-13246054022.tar.zst name darwin64 @@ -2161,11 +2161,11 @@ Copyright (c) 2012, 2014, 2015, 2016 nghttp2 contributors archive hash - 7a5048c806b053768c461d6dbac854324a597ee0 + 2e29c127dbd002d64ae55bc000f8b6ed0249fad7 hash_algorithm sha1 url - https://github.com/secondlife/3p-openssl/releases/download/v1.1.1w-r2/openssl-1.1.1w-r2-linux64-11965633361.tar.zst + https://github.com/secondlife/3p-openssl/releases/download/v1.1.1w-r3/openssl-1.1.1w-r3-linux64-13246054022.tar.zst name linux64 @@ -2175,11 +2175,11 @@ Copyright (c) 2012, 2014, 2015, 2016 nghttp2 contributors archive hash - 3d16fa02ca44a6a1eeeb7c83d62af2dc8ef2e7e9 + ae9ced89051e03a99628c99b9ac78530fdea1e5a hash_algorithm sha1 url - https://github.com/secondlife/3p-openssl/releases/download/v1.1.1w-r2/openssl-1.1.1w-r2-windows64-11965633361.tar.zst + https://github.com/secondlife/3p-openssl/releases/download/v1.1.1w-r3/openssl-1.1.1w-r3-windows64-13246054022.tar.zst name windows64 @@ -2192,7 +2192,7 @@ Copyright (c) 2012, 2014, 2015, 2016 nghttp2 contributors copyright Copyright (c) 1998-2011 The OpenSSL Project. All rights reserved; Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) version - 1.1.1w-r2 + 1.1.1w-r3 name openssl description @@ -2825,11 +2825,11 @@ Copyright (c) 2012, 2014, 2015, 2016 nghttp2 contributors archive hash - 4d437afc7fc3988cf0c78ed05853a211cc6bf8b8 + e363e3b889c52fda7601d7aeaa9832307034651e hash_algorithm sha1 url - https://github.com/secondlife/3p-zlib-ng/releases/download/v2.2.2-r1/zlib_ng-2.2.2-dev0.gcaa101e.d20241120-darwin64-11943461931.tar.zst + https://github.com/secondlife/3p-zlib-ng/releases/download/v2.2.3-r1/zlib_ng-2.2.3-dev0.g8aa13e3.d20250206-darwin64-13183604450.tar.zst name darwin64 @@ -2839,11 +2839,11 @@ Copyright (c) 2012, 2014, 2015, 2016 nghttp2 contributors archive hash - 70c1d8728b85481bd42904c1213ed50264e77be1 + 3cdd52f7fb3691789d50f0b40ed6f5642321ff32 hash_algorithm sha1 url - https://github.com/secondlife/3p-zlib-ng/releases/download/v2.2.2-r1/zlib_ng-2.2.2-dev0.gcaa101e.d20241120-linux64-11943461931.tar.zst + https://github.com/secondlife/3p-zlib-ng/releases/download/v2.2.3-r1/zlib_ng-2.2.3-dev0.g8aa13e3.d20250206-linux64-13183604450.tar.zst name linux64 @@ -2853,11 +2853,11 @@ Copyright (c) 2012, 2014, 2015, 2016 nghttp2 contributors archive hash - f98c30b20120511ecceab8bf1b5eba048b10aade + e802a28139328bb2421ad39e13d996d350d8106d hash_algorithm sha1 url - https://github.com/secondlife/3p-zlib-ng/releases/download/v2.2.2-r1/zlib_ng-2.2.2-dev0.gcaa101e.d20241120-windows64-11943461931.tar.zst + https://github.com/secondlife/3p-zlib-ng/releases/download/v2.2.3-r1/zlib_ng-2.2.3-dev0.g8aa13e3.d20250206-windows64-13183604450.tar.zst name windows64 @@ -2870,7 +2870,7 @@ Copyright (c) 2012, 2014, 2015, 2016 nghttp2 contributors copyright Copyright (C) 1995-2013 Jean-loup Gailly and Mark Adler version - 2.2.2-dev0.gcaa101e.d20241120 + 2.2.3-dev0.g8aa13e3.d20250206 name zlib-ng canonical_repo diff --git a/indra/llcommon/llapp.cpp b/indra/llcommon/llapp.cpp index 08a43983d3..c532620daa 100644 --- a/indra/llcommon/llapp.cpp +++ b/indra/llcommon/llapp.cpp @@ -229,7 +229,7 @@ bool LLApp::parseCommandOptions(int argc, wchar_t** wargv) if(wargv[ii][1] == '-') ++offset; #if LL_WINDOWS - name.assign(utf16str_to_utf8str(&wargv[ii][offset])); + name.assign(ll_convert_wide_to_string(&wargv[ii][offset])); #else name.assign(wstring_to_utf8str(&wargv[ii][offset])); #endif @@ -253,7 +253,7 @@ bool LLApp::parseCommandOptions(int argc, wchar_t** wargv) ++ii; #if LL_WINDOWS - value.assign(utf16str_to_utf8str((wargv[ii]))); + value.assign(ll_convert_wide_to_string((wargv[ii]))); #else value.assign(wstring_to_utf8str((wargv[ii]))); #endif diff --git a/indra/llcommon/llerror.cpp b/indra/llcommon/llerror.cpp index d834098994..3411e9c6bb 100644 --- a/indra/llcommon/llerror.cpp +++ b/indra/llcommon/llerror.cpp @@ -79,7 +79,7 @@ namespace { // if (s.size()) { - OutputDebugString(utf8str_to_utf16str(s).c_str()); + OutputDebugString(ll_convert(s).c_str()); OutputDebugString(TEXT("\n")); } } diff --git a/indra/llcommon/llfile.cpp b/indra/llcommon/llfile.cpp index d0bc8f7652..53659ac13f 100644 --- a/indra/llcommon/llfile.cpp +++ b/indra/llcommon/llfile.cpp @@ -178,8 +178,7 @@ int LLFile::mkdir(const std::string& dirname, int perms) { #if LL_WINDOWS // permissions are ignored on Windows - std::string utf8dirname = dirname; - llutf16string utf16dirname = utf8str_to_utf16str(utf8dirname); + std::wstring utf16dirname = ll_convert(dirname); int rc = _wmkdir(utf16dirname.c_str()); #else int rc = ::mkdir(dirname.c_str(), (mode_t)perms); @@ -201,8 +200,7 @@ int LLFile::rmdir(const std::string& dirname) { #if LL_WINDOWS // permissions are ignored on Windows - std::string utf8dirname = dirname; - llutf16string utf16dirname = utf8str_to_utf16str(utf8dirname); + std::wstring utf16dirname = ll_convert(dirname); int rc = _wrmdir(utf16dirname.c_str()); #else int rc = ::rmdir(dirname.c_str()); @@ -214,10 +212,8 @@ int LLFile::rmdir(const std::string& dirname) LLFILE* LLFile::fopen(const std::string& filename, const char* mode) /* Flawfinder: ignore */ { #if LL_WINDOWS - std::string utf8filename = filename; - std::string utf8mode = std::string(mode); - llutf16string utf16filename = utf8str_to_utf16str(utf8filename); - llutf16string utf16mode = utf8str_to_utf16str(utf8mode); + std::wstring utf16filename = ll_convert(filename); + std::wstring utf16mode = ll_convert(std::string(mode)); return _wfopen(utf16filename.c_str(),utf16mode.c_str()); #else return ::fopen(filename.c_str(),mode); /* Flawfinder: ignore */ @@ -227,10 +223,8 @@ LLFILE* LLFile::fopen(const std::string& filename, const char* mode) /* Flawf LLFILE* LLFile::_fsopen(const std::string& filename, const char* mode, int sharingFlag) { #if LL_WINDOWS - std::string utf8filename = filename; - std::string utf8mode = std::string(mode); - llutf16string utf16filename = utf8str_to_utf16str(utf8filename); - llutf16string utf16mode = utf8str_to_utf16str(utf8mode); + std::wstring utf16filename = ll_convert(filename); + std::wstring utf16mode = ll_convert(std::string(mode)); return _wfsopen(utf16filename.c_str(),utf16mode.c_str(),sharingFlag); #else llassert(0);//No corresponding function on non-windows @@ -270,8 +264,7 @@ std::string LLFile::getContents(const std::string& filename) int LLFile::remove(const std::string& filename, int supress_error) { #if LL_WINDOWS - std::string utf8filename = filename; - llutf16string utf16filename = utf8str_to_utf16str(utf8filename); + std::wstring utf16filename = ll_convert(filename); int rc = _wremove(utf16filename.c_str()); #else int rc = ::remove(filename.c_str()); @@ -282,10 +275,8 @@ int LLFile::remove(const std::string& filename, int supress_error) int LLFile::rename(const std::string& filename, const std::string& newname, int supress_error) { #if LL_WINDOWS - std::string utf8filename = filename; - std::string utf8newname = newname; - llutf16string utf16filename = utf8str_to_utf16str(utf8filename); - llutf16string utf16newname = utf8str_to_utf16str(utf8newname); + std::wstring utf16filename = ll_convert(filename); + std::wstring utf16newname = ll_convert(newname); int rc = _wrename(utf16filename.c_str(),utf16newname.c_str()); #else int rc = ::rename(filename.c_str(),newname.c_str()); @@ -327,8 +318,7 @@ bool LLFile::copy(const std::string& from, const std::string& to) int LLFile::stat(const std::string& filename, llstat* filestatus) { #if LL_WINDOWS - std::string utf8filename = filename; - llutf16string utf16filename = utf8str_to_utf16str(utf8filename); + std::wstring utf16filename = ll_convert(filename); int rc = _wstat(utf16filename.c_str(),filestatus); #else int rc = ::stat(filename.c_str(),filestatus); @@ -453,14 +443,14 @@ llifstream::llifstream() {} // explicit llifstream::llifstream(const std::string& _Filename, ios_base::openmode _Mode): - std::ifstream(utf8str_to_utf16str( _Filename ).c_str(), + std::ifstream(ll_convert( _Filename ).c_str(), _Mode | ios_base::in) { } void llifstream::open(const std::string& _Filename, ios_base::openmode _Mode) { - std::ifstream::open(utf8str_to_utf16str(_Filename).c_str(), + std::ifstream::open(ll_convert(_Filename).c_str(), _Mode | ios_base::in); } @@ -472,14 +462,14 @@ llofstream::llofstream() {} // explicit llofstream::llofstream(const std::string& _Filename, ios_base::openmode _Mode): - std::ofstream(utf8str_to_utf16str( _Filename ).c_str(), + std::ofstream(ll_convert( _Filename ).c_str(), _Mode | ios_base::out) { } void llofstream::open(const std::string& _Filename, ios_base::openmode _Mode) { - std::ofstream::open(utf8str_to_utf16str( _Filename ).c_str(), + std::ofstream::open(ll_convert( _Filename ).c_str(), _Mode | ios_base::out); } diff --git a/indra/llcommon/llsys.cpp b/indra/llcommon/llsys.cpp index b38b3725be..21b11c5311 100644 --- a/indra/llcommon/llsys.cpp +++ b/indra/llcommon/llsys.cpp @@ -1328,7 +1328,7 @@ bool gunzip_file(const std::string& srcfile, const std::string& dstfile) S32 bytes = 0; tmpfile = dstfile + ".t"; #ifdef LL_WINDOWS - llutf16string utf16filename = utf8str_to_utf16str(srcfile); + std::wstring utf16filename = ll_convert(srcfile); src = gzopen_w(utf16filename.c_str(), "rb"); #else src = gzopen(srcfile.c_str(), "rb"); @@ -1372,7 +1372,7 @@ bool gzip_file(const std::string& srcfile, const std::string& dstfile) tmpfile = dstfile + ".t"; #ifdef LL_WINDOWS - llutf16string utf16filename = utf8str_to_utf16str(tmpfile); + std::wstring utf16filename = ll_convert(tmpfile); dst = gzopen_w(utf16filename.c_str(), "wb"); #else dst = gzopen(tmpfile.c_str(), "wb"); diff --git a/indra/llcommon/tests/stringize_test.cpp b/indra/llcommon/tests/stringize_test.cpp index a3ce7f8e3d..3f99041592 100644 --- a/indra/llcommon/tests/stringize_test.cpp +++ b/indra/llcommon/tests/stringize_test.cpp @@ -110,6 +110,17 @@ namespace tut void stringize_object::test<3>() { //Tests rely on validity of wstring_to_utf8str() +#if LL_WINDOWS // Windows wstring is a 2byte UTF16 type + ensure_equals(ll_convert(wstringize(c)), ll_convert(std::wstring(L"c"))); + ensure_equals(ll_convert(wstringize(s)), ll_convert(std::wstring(L"17"))); + ensure_equals(ll_convert(wstringize(i)), ll_convert(std::wstring(L"34"))); + ensure_equals(ll_convert(wstringize(l)), ll_convert(std::wstring(L"68"))); + ensure_equals(ll_convert(wstringize(f)), ll_convert(std::wstring(L"3.14159"))); + ensure_equals(ll_convert(wstringize(d)), ll_convert(std::wstring(L"3.14159"))); + ensure_equals(ll_convert(wstringize(abc)), ll_convert(std::wstring(L"abc def"))); + ensure_equals(ll_convert(wstringize(abc)), ll_convert(wstringize(abc.c_str()))); + ensure_equals(ll_convert(wstringize(def)), ll_convert(std::wstring(L"def ghi"))); +#else ensure_equals(wstring_to_utf8str(wstringize(c)), wstring_to_utf8str(L"c")); ensure_equals(wstring_to_utf8str(wstringize(s)), wstring_to_utf8str(L"17")); ensure_equals(wstring_to_utf8str(wstringize(i)), wstring_to_utf8str(L"34")); @@ -119,6 +130,7 @@ namespace tut ensure_equals(wstring_to_utf8str(wstringize(abc)), wstring_to_utf8str(L"abc def")); ensure_equals(wstring_to_utf8str(wstringize(abc)), wstring_to_utf8str(wstringize(abc.c_str()))); ensure_equals(wstring_to_utf8str(wstringize(def)), wstring_to_utf8str(L"def ghi")); +#endif // ensure_equals(wstring_to_utf8str(wstringize(llsd)), wstring_to_utf8str(L"{'abc':'abc def','d':r3.14159,'i':i34}")); } } // namespace tut diff --git a/indra/llcrashlogger/llcrashlock.cpp b/indra/llcrashlogger/llcrashlock.cpp index ecd197b2c1..bc34f6798f 100644 --- a/indra/llcrashlogger/llcrashlock.cpp +++ b/indra/llcrashlogger/llcrashlock.cpp @@ -189,7 +189,7 @@ LLSD LLCrashLock::getProcessList() bool LLCrashLock::fileExists(std::string filename) { #ifdef LL_WINDOWS // or BOOST_WINDOWS_API - boost::filesystem::path file_path(utf8str_to_utf16str(filename)); + boost::filesystem::path file_path(ll_convert(filename)); #else boost::filesystem::path file_path(filename); #endif @@ -199,7 +199,7 @@ bool LLCrashLock::fileExists(std::string filename) void LLCrashLock::cleanupProcess(std::string proc_dir) { #ifdef LL_WINDOWS // or BOOST_WINDOWS_API - boost::filesystem::path dir_path(utf8str_to_utf16str(proc_dir)); + boost::filesystem::path dir_path(ll_convert(proc_dir)); #else boost::filesystem::path dir_path(proc_dir); #endif diff --git a/indra/llfilesystem/lldir.cpp b/indra/llfilesystem/lldir.cpp index 99d4850610..9c61c25ada 100644 --- a/indra/llfilesystem/lldir.cpp +++ b/indra/llfilesystem/lldir.cpp @@ -103,7 +103,7 @@ std::vector LLDir::getFilesInDir(const std::string &dirname) //Returns a vector of fullpath filenames. #ifdef LL_WINDOWS // or BOOST_WINDOWS_API - boost::filesystem::path p(utf8str_to_utf16str(dirname)); + boost::filesystem::path p(ll_convert(dirname)); #else boost::filesystem::path p(dirname); #endif @@ -196,7 +196,7 @@ U32 LLDir::deleteDirAndContents(const std::string& dir_name) try { #ifdef LL_WINDOWS // or BOOST_WINDOWS_API - boost::filesystem::path dir_path(utf8str_to_utf16str(dir_name)); + boost::filesystem::path dir_path(ll_convert(dir_name)); #else boost::filesystem::path dir_path(dir_name); #endif diff --git a/indra/llfilesystem/lldir_win32.cpp b/indra/llfilesystem/lldir_win32.cpp index a607c70b44..58c080c982 100644 --- a/indra/llfilesystem/lldir_win32.cpp +++ b/indra/llfilesystem/lldir_win32.cpp @@ -172,7 +172,7 @@ LLDir_Win32::LLDir_Win32() { w_str[wcslen(w_str)-1] = '\0'; /* Flawfinder: ignore */ // remove trailing slash } - mTempDir = utf16str_to_utf8str(llutf16string(w_str)); + mTempDir = ll_convert(std::wstring(w_str)); if (mOSUserDir.empty()) { @@ -225,14 +225,14 @@ LLDir_Win32::LLDir_Win32() // Set working directory, for LLDir::getWorkingDir() GetCurrentDirectory(MAX_PATH, w_str); - mWorkingDir = utf16str_to_utf8str(llutf16string(w_str)); + mWorkingDir = ll_convert(std::wstring(w_str)); // Set the executable directory S32 size = GetModuleFileName(NULL, w_str, MAX_PATH); if (size) { w_str[size] = '\0'; - mExecutablePathAndName = utf16str_to_utf8str(llutf16string(w_str)); + mExecutablePathAndName = ll_convert(std::wstring(w_str)); auto path_end = mExecutablePathAndName.find_last_of('\\'); if (path_end != std::string::npos) { @@ -347,8 +347,8 @@ U32 LLDir_Win32::countFilesInDir(const std::string &dirname, const std::string & WIN32_FIND_DATA FileData; - llutf16string pathname = utf8str_to_utf16str(dirname); - pathname += utf8str_to_utf16str(mask); + std::wstring pathname = ll_convert(dirname); + pathname += ll_convert(mask); if ((count_search_h = FindFirstFile(pathname.c_str(), &FileData)) != INVALID_HANDLE_VALUE) { @@ -370,7 +370,7 @@ std::string LLDir_Win32::getCurPath() WCHAR w_str[MAX_PATH]; GetCurrentDirectory(MAX_PATH, w_str); - return utf16str_to_utf8str(llutf16string(w_str)); + return ll_convert(std::wstring(w_str)); } diff --git a/indra/llfilesystem/lldir_win32.h b/indra/llfilesystem/lldir_win32.h index ab2726f1a0..21a3f1213b 100644 --- a/indra/llfilesystem/lldir_win32.h +++ b/indra/llfilesystem/lldir_win32.h @@ -51,7 +51,7 @@ public: private: void* mDirSearch_h{ nullptr }; - llutf16string mCurrentDir; + std::wstring mCurrentDir; }; #endif // LL_LLDIR_WIN32_H diff --git a/indra/llfilesystem/lldirguard.h b/indra/llfilesystem/lldirguard.h index fcb179bbc8..c6ce13efb4 100644 --- a/indra/llfilesystem/lldirguard.h +++ b/indra/llfilesystem/lldirguard.h @@ -31,6 +31,9 @@ #include "llerror.h" #if LL_WINDOWS + +#include "llwin32headers.h" + class LLDirectoryGuard { public: @@ -46,8 +49,8 @@ public: (wcsncmp(mOrigDir,mFinalDir,mOrigDirLen)!=0)) { // Dir has changed - std::string mOrigDirUtf8 = utf16str_to_utf8str(llutf16string(mOrigDir)); - std::string mFinalDirUtf8 = utf16str_to_utf8str(llutf16string(mFinalDir)); + std::string mOrigDirUtf8 = ll_convert(std::wstring(mOrigDir)); + std::string mFinalDirUtf8 = ll_convert(std::wstring(mFinalDir)); LL_INFOS() << "Resetting working dir from " << mFinalDirUtf8 << " to " << mOrigDirUtf8 << LL_ENDL; SetCurrentDirectory(mOrigDir); } diff --git a/indra/llfilesystem/lldiriterator.cpp b/indra/llfilesystem/lldiriterator.cpp index 61f768c512..e8c37389d2 100644 --- a/indra/llfilesystem/lldiriterator.cpp +++ b/indra/llfilesystem/lldiriterator.cpp @@ -52,7 +52,7 @@ LLDirIterator::Impl::Impl(const std::string &dirname, const std::string &mask) : mIsValid(false) { #ifdef LL_WINDOWS // or BOOST_WINDOWS_API - fs::path dir_path(utf8str_to_utf16str(dirname)); + fs::path dir_path(ll_convert(dirname)); #else fs::path dir_path(dirname); #endif diff --git a/indra/llfilesystem/lldiskcache.cpp b/indra/llfilesystem/lldiskcache.cpp index 49904911a9..e971e1885a 100644 --- a/indra/llfilesystem/lldiskcache.cpp +++ b/indra/llfilesystem/lldiskcache.cpp @@ -103,7 +103,7 @@ void LLDiskCache::purge() std::vector file_info; #if LL_WINDOWS - std::wstring cache_path(utf8str_to_utf16str(sCacheDir)); + std::wstring cache_path(ll_convert(sCacheDir)); #else std::string cache_path(sCacheDir); #endif @@ -226,7 +226,7 @@ void LLDiskCache::clearCache() */ boost::system::error_code ec; #if LL_WINDOWS - std::wstring cache_path(utf8str_to_utf16str(sCacheDir)); + std::wstring cache_path(ll_convert(sCacheDir)); #else std::string cache_path(sCacheDir); #endif @@ -259,7 +259,7 @@ void LLDiskCache::removeOldVFSFiles() boost::system::error_code ec; #if LL_WINDOWS - std::wstring cache_path(utf8str_to_utf16str(gDirUtilp->getExpandedFilename(LL_PATH_CACHE, ""))); + std::wstring cache_path(ll_convert(gDirUtilp->getExpandedFilename(LL_PATH_CACHE, ""))); #else std::string cache_path(gDirUtilp->getExpandedFilename(LL_PATH_CACHE, "")); #endif @@ -300,7 +300,7 @@ uintmax_t LLDiskCache::dirFileSize(const std::string& dir) */ boost::system::error_code ec; #if LL_WINDOWS - std::wstring dir_path(utf8str_to_utf16str(dir)); + std::wstring dir_path(ll_convert(dir)); #else std::string dir_path(dir); #endif diff --git a/indra/llfilesystem/llfilesystem.cpp b/indra/llfilesystem/llfilesystem.cpp index c8ce9531c2..5ce5244107 100644 --- a/indra/llfilesystem/llfilesystem.cpp +++ b/indra/llfilesystem/llfilesystem.cpp @@ -316,7 +316,7 @@ void LLFileSystem::updateFileAccessTime(const std::string& file_path) 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); + const std::time_t last_write_time = boost::filesystem::last_write_time(ll_convert(file_path), ec); if (ec.failed()) { LL_WARNS() << "Failed to read last write time for cache file " << file_path << ": " << ec.message() << LL_ENDL; @@ -330,7 +330,7 @@ void LLFileSystem::updateFileAccessTime(const std::string& file_path) // before the last one if (delta_time > time_threshold) { - boost::filesystem::last_write_time(utf8str_to_utf16str(file_path), cur_time, ec); + boost::filesystem::last_write_time(ll_convert(file_path), cur_time, ec); } #else // file last write time diff --git a/indra/llwindow/lldxhardware.cpp b/indra/llwindow/lldxhardware.cpp index 4bc069c5a4..fc51979eaf 100644 --- a/indra/llwindow/lldxhardware.cpp +++ b/indra/llwindow/lldxhardware.cpp @@ -477,7 +477,7 @@ std::string get_string(IDxDiagContainer *containerp, const WCHAR *wszPropName) WCHAR wszPropValue[256]; get_wstring(containerp, wszPropName, wszPropValue, 256); - return utf16str_to_utf8str(wszPropValue); + return ll_convert(std::wstring(wszPropValue)); } @@ -784,7 +784,7 @@ bool LLDXHardware::getInfo(bool vram_only) else { get_wstring(device_containerp, L"szKeyDeviceID", deviceID, 512); - LL_WARNS() << "szDeviceID" << deviceID << LL_ENDL; + LL_WARNS() << "szDeviceID" << ll_convert(std::wstring(deviceID)) << LL_ENDL; // '+9' to avoid ENUM\\PCI\\ prefix // Returns string like Enum\\PCI\\VEN_10DE&DEV_1F06&SUBSYS... // and since GetVideoMemoryViaWMI searches by PNPDeviceID it is sufficient @@ -1087,7 +1087,7 @@ LLSD LLDXHardware::getDisplayInfo() // print the value // windows doesn't guarantee to be null terminated release_version[RV_SIZE - 1] = NULL; - ret["DriverVersion"] = utf16str_to_utf8str(release_version); + ret["DriverVersion"] = ll_convert(std::wstring(release_version)); } RegCloseKey(hKey); diff --git a/indra/llwindow/llwindowwin32.cpp b/indra/llwindow/llwindowwin32.cpp index 90713a6653..c7d09f6737 100644 --- a/indra/llwindow/llwindowwin32.cpp +++ b/indra/llwindow/llwindowwin32.cpp @@ -786,7 +786,7 @@ LLWindowWin32::LLWindowWin32(LLWindowCallbacks* callbacks, // } // SL-12971 dual GPU display - DISPLAY_DEVICEA display_device; + DISPLAY_DEVICE display_device; int display_index = -1; DWORD display_flags = 0; // EDD_GET_DEVICE_INTERFACE_NAME ? const size_t display_bytes = sizeof(display_device); @@ -797,23 +797,23 @@ LLWindowWin32::LLWindowWin32(LLWindowCallbacks* callbacks, { // CHAR DeviceName [ 32] Adapter name // CHAR DeviceString[128] - CHAR text[256]; + WCHAR text[256]; - size_t name_len = strlen(display_device.DeviceName ); - size_t desc_len = strlen(display_device.DeviceString); + size_t name_len = lstrlen(display_device.DeviceName ); + size_t desc_len = lstrlen(display_device.DeviceString); - const CHAR *name = name_len ? display_device.DeviceName : "???"; - const CHAR *desc = desc_len ? display_device.DeviceString : "???"; + const WCHAR *name = name_len ? display_device.DeviceName : TEXT("???"); + const WCHAR *desc = desc_len ? display_device.DeviceString : TEXT("???"); - sprintf(text, "Display Device %d: %s, %s", display_index, name, desc); - LL_INFOS("Window") << text << LL_ENDL; + wsprintf(text, TEXT("Display Device %d: %s, %s"), display_index, name, desc); + LL_INFOS("Window") << ll_convert(std::wstring(text)) << LL_ENDL; } ::ZeroMemory(&display_device,display_bytes); display_device.cb = display_bytes; display_index++; - } while( EnumDisplayDevicesA(NULL, display_index, &display_device, display_flags )); + } while( EnumDisplayDevices(NULL, display_index, &display_device, display_flags )); LL_INFOS("Window") << "Total Display Devices: " << display_index << LL_ENDL; @@ -1934,7 +1934,7 @@ void LLWindowWin32::setTitle(const std::string title) // to support non-ascii usernames (and region names?) mWindowThread->post([=]() { - SetWindowTextA(mWindowHandle, title.c_str()); + SetWindowText(mWindowHandle, ll_convert(title).c_str()); }); } @@ -3244,7 +3244,7 @@ bool LLWindowWin32::pasteTextFromClipboard(LLWString &dst) WCHAR *utf16str = (WCHAR*) GlobalLock(h_data); if (utf16str) { - dst = utf16str_to_wstring(utf16str); + dst = ll_convert(std::wstring(utf16str)); LLWStringUtil::removeWindowsCR(dst); GlobalUnlock(h_data); success = true; @@ -3269,8 +3269,8 @@ bool LLWindowWin32::copyTextToClipboard(const LLWString& wstr) // Provide a copy of the data in Unicode format. LLWString sanitized_string(wstr); LLWStringUtil::addCRLF(sanitized_string); - llutf16string out_utf16 = wstring_to_utf16str(sanitized_string); - const size_t size_utf16 = (out_utf16.length() + 1) * sizeof(WCHAR); + std::wstring out_utf16 = ll_convert(sanitized_string); + const size_t size_utf16 = (out_utf16.length() + 1) * sizeof(wchar_t); // Memory is allocated and then ownership of it is transfered to the system. HGLOBAL hglobal_copy_utf16 = GlobalAlloc(GMEM_MOVEABLE, size_utf16); @@ -3632,7 +3632,7 @@ void LLSplashScreenWin32::showImpl() ShowWindow(mWindow, SW_SHOW); // Should set taskbar text without creating a header for the window (caption) - SetWindowTextA(mWindow, "Second Life"); + SetWindowText(mWindow, TEXT("Second Life")); } @@ -3769,8 +3769,7 @@ void LLWindowWin32::spawnWebBrowser(const std::string& escaped_url, bool async) // reliablly on Vista. // this is madness.. no, this is.. - LLWString url_wstring = utf8str_to_wstring( escaped_url ); - llutf16string url_utf16 = wstring_to_utf16str( url_wstring ); + std::wstring url_utf16 = ll_convert(escaped_url); // let the OS decide what to use to open the URL SHELLEXECUTEINFO sei = { sizeof( sei ) }; @@ -4050,7 +4049,7 @@ void LLWindowWin32::fillCompositionLogfont(LOGFONT *logfont) U32 LLWindowWin32::fillReconvertString(const LLWString &text, S32 focus, S32 focus_length, RECONVERTSTRING *reconvert_string) { - const llutf16string text_utf16 = wstring_to_utf16str(text); + const std::wstring text_utf16 = ll_convert(text); const DWORD required_size = sizeof(RECONVERTSTRING) + (static_cast(text_utf16.length()) + 1) * sizeof(WCHAR); if (reconvert_string && reconvert_string->dwSize >= required_size) { @@ -4150,7 +4149,7 @@ void LLWindowWin32::handleCompositionMessage(const U32 indexes) size = LLWinImm::getCompositionString(himc, GCS_RESULTSTR, data, size); if (size > 0) { - result_string = utf16str_to_wstring(llutf16string(data, size / sizeof(WCHAR))); + result_string = ll_convert_wide_to_wstring(std::wstring(data, size / sizeof(WCHAR))); } delete[] data; needs_update = true; @@ -4167,7 +4166,7 @@ void LLWindowWin32::handleCompositionMessage(const U32 indexes) if (size > 0) { preedit_string_utf16_length = size / sizeof(WCHAR); - preedit_string = utf16str_to_wstring(llutf16string(data, size / sizeof(WCHAR))); + preedit_string = ll_convert_wide_to_wstring(std::wstring(data, size / sizeof(WCHAR))); } delete[] data; needs_update = true; diff --git a/indra/newview/llappviewerwin32.cpp b/indra/newview/llappviewerwin32.cpp index 023ec3410a..724182a929 100644 --- a/indra/newview/llappviewerwin32.cpp +++ b/indra/newview/llappviewerwin32.cpp @@ -253,8 +253,8 @@ void ll_nvapi_init(NvDRSSessionHandle hSession) NvAPI_UnicodeString profile_name; std::string app_name = LLTrans::getString("APP_NAME"); - llutf16string w_app_name = utf8str_to_utf16str(app_name); - wsprintf(profile_name, L"%s", w_app_name.c_str()); + std::wstring w_app_name = ll_convert(app_name); + wsprintf(reinterpret_cast(profile_name), L"%s", w_app_name.c_str()); NvDRSProfileHandle hProfile = 0; // (3) Check if we already have an application profile for the viewer status = NvAPI_DRS_FindProfileByName(hSession, profile_name, &hProfile); @@ -271,7 +271,7 @@ void ll_nvapi_init(NvDRSSessionHandle hSession) NVDRS_PROFILE profileInfo; profileInfo.version = NVDRS_PROFILE_VER; profileInfo.isPredefined = 0; - wsprintf(profileInfo.profileName, L"%s", w_app_name.c_str()); + wsprintf(reinterpret_cast(profileInfo.profileName), L"%s", w_app_name.c_str()); status = NvAPI_DRS_CreateProfile(hSession, &profileInfo, &hProfile); if (status != NVAPI_OK) @@ -286,9 +286,9 @@ void ll_nvapi_init(NvDRSSessionHandle hSession) NVDRS_APPLICATION profile_application; profile_application.version = NVDRS_APPLICATION_VER; - llutf16string w_exe_name = utf8str_to_utf16str(exe_name); + std::wstring w_exe_name = ll_convert(exe_name); NvAPI_UnicodeString profile_app_name; - wsprintf(profile_app_name, L"%s", w_exe_name.c_str()); + wsprintf(reinterpret_cast(profile_app_name), L"%s", w_exe_name.c_str()); status = NvAPI_DRS_GetApplicationInfo(hSession, hProfile, profile_app_name, &profile_application); if (status != NVAPI_OK && status != NVAPI_EXECUTABLE_NOT_FOUND) @@ -304,10 +304,10 @@ void ll_nvapi_init(NvDRSSessionHandle hSession) NVDRS_APPLICATION application; application.version = NVDRS_APPLICATION_VER; application.isPredefined = 0; - wsprintf(application.appName, L"%s", w_exe_name.c_str()); - wsprintf(application.userFriendlyName, L"%s", w_exe_name.c_str()); - wsprintf(application.launcher, L"%s", w_exe_name.c_str()); - wsprintf(application.fileInFolder, L"%s", ""); + wsprintf(reinterpret_cast(application.appName), L"%s", w_exe_name.c_str()); + wsprintf(reinterpret_cast(application.userFriendlyName), L"%s", w_exe_name.c_str()); + wsprintf(reinterpret_cast(application.launcher), L"%s", w_exe_name.c_str()); + wsprintf(reinterpret_cast(application.fileInFolder), L"%s", ""); status = NvAPI_DRS_CreateApplication(hSession, hProfile, &application); if (status != NVAPI_OK) @@ -580,7 +580,7 @@ void LLAppViewerWin32::disableWinErrorReporting() { std::string executable_name = gDirUtilp->getExecutableFilename(); - if( S_OK == WerAddExcludedApplication( utf8str_to_utf16str(executable_name).c_str(), FALSE ) ) + if( S_OK == WerAddExcludedApplication(ll_convert(executable_name).c_str(), FALSE ) ) { LL_INFOS() << "WerAddExcludedApplication() succeeded for " << executable_name << LL_ENDL; } diff --git a/indra/newview/llfilepicker.cpp b/indra/newview/llfilepicker.cpp index 0afb275d13..0dd2c13bb8 100644 --- a/indra/newview/llfilepicker.cpp +++ b/indra/newview/llfilepicker.cpp @@ -285,7 +285,7 @@ bool LLFilePicker::getOpenFile(ELoadFilter filter, bool blocking) success = GetOpenFileName(&mOFN); if (success) { - std::string filename = utf16str_to_utf8str(llutf16string(mFilesW)); + std::string filename = ll_convert(std::wstring(mFilesW)); mFiles.push_back(filename); } @@ -351,7 +351,7 @@ bool LLFilePicker::getMultipleOpenFiles(ELoadFilter filter, bool blocking) // lengths. if( wcslen(mOFN.lpstrFile) > mOFN.nFileOffset ) /*Flawfinder: ignore*/ { - std::string filename = utf16str_to_utf8str(llutf16string(mFilesW)); + std::string filename = ll_convert(std::wstring(mFilesW)); mFiles.push_back(filename); } else @@ -365,7 +365,7 @@ bool LLFilePicker::getMultipleOpenFiles(ELoadFilter filter, bool blocking) break; if (*tptrw == 0) tptrw++; // shouldn't happen? - std::string filename = utf16str_to_utf8str(llutf16string(tptrw)); + std::string filename = ll_convert(std::wstring(tptrw)); if (dirname.empty()) dirname = filename + "\\"; else @@ -411,7 +411,7 @@ bool LLFilePicker::getSaveFile(ESaveFilter filter, const std::string& filename, mOFN.lpstrFile = mFilesW; if (!filename.empty()) { - llutf16string tstring = utf8str_to_utf16str(filename); + std::wstring tstring = ll_convert(filename); wcsncpy(mFilesW, tstring.c_str(), FILENAME_BUFFER_SIZE); } /*Flawfinder: ignore*/ else { @@ -593,7 +593,7 @@ bool LLFilePicker::getSaveFile(ESaveFilter filter, const std::string& filename, success = GetSaveFileName(&mOFN); if (success) { - std::string filename = utf16str_to_utf8str(llutf16string(mFilesW)); + std::string filename = ll_convert(std::wstring(mFilesW)); mFiles.push_back(filename); } } diff --git a/indra/newview/llfloaterjoystick.cpp b/indra/newview/llfloaterjoystick.cpp index 68b11ec92b..871f924316 100644 --- a/indra/newview/llfloaterjoystick.cpp +++ b/indra/newview/llfloaterjoystick.cpp @@ -78,7 +78,7 @@ BOOL CALLBACK di8_list_devices_callback(LPCDIDEVICEINSTANCE device_instance_ptr, // Capable of detecting devices like Oculus Rift if (device_instance_ptr && pvRef) { - std::string product_name = utf16str_to_utf8str(llutf16string(device_instance_ptr->tszProductName)); + std::string product_name = ll_convert(std::wstring(device_instance_ptr->tszProductName)); S32 size = sizeof(GUID); LLSD::Binary data; //just an std::vector data.resize(size); diff --git a/indra/newview/lllocalbitmaps.cpp b/indra/newview/lllocalbitmaps.cpp index 31c9eb8966..dbddf8e72a 100644 --- a/indra/newview/lllocalbitmaps.cpp +++ b/indra/newview/lllocalbitmaps.cpp @@ -191,7 +191,7 @@ bool LLLocalBitmap::updateSelf(EUpdateType optional_firstupdate) #ifndef LL_WINDOWS const std::time_t temp_time = boost::filesystem::last_write_time(boost::filesystem::path(mFilename)); #else - const std::time_t temp_time = boost::filesystem::last_write_time(boost::filesystem::path(utf8str_to_utf16str(mFilename))); + const std::time_t temp_time = boost::filesystem::last_write_time(boost::filesystem::path(ll_convert(mFilename))); #endif LLSD new_last_modified = asctime(localtime(&temp_time)); diff --git a/indra/newview/lllocalgltfmaterials.cpp b/indra/newview/lllocalgltfmaterials.cpp index fab18f2d26..d6facad23d 100644 --- a/indra/newview/lllocalgltfmaterials.cpp +++ b/indra/newview/lllocalgltfmaterials.cpp @@ -134,7 +134,7 @@ bool LLLocalGLTFMaterial::updateSelf() #ifndef LL_WINDOWS const std::time_t temp_time = boost::filesystem::last_write_time(boost::filesystem::path(mFilename)); #else - const std::time_t temp_time = boost::filesystem::last_write_time(boost::filesystem::path(utf8str_to_utf16str(mFilename))); + const std::time_t temp_time = boost::filesystem::last_write_time(boost::filesystem::path(ll_convert(mFilename))); #endif LLSD new_last_modified = asctime(localtime(&temp_time)); diff --git a/indra/newview/llmachineid.cpp b/indra/newview/llmachineid.cpp index aa03001389..51c38aba3a 100644 --- a/indra/newview/llmachineid.cpp +++ b/indra/newview/llmachineid.cpp @@ -293,7 +293,7 @@ bool LLWMIMethods::getGenericSerialNumber(const BSTR &select, const LPCWSTR &var if (validate_as_uuid) { std::wstring ws(serialNumber, serial_size); - std::string str = ll_convert_wide_to_string(ws); + std::string str = ll_convert(ws); if (!LLUUID::validate(str)) { @@ -315,7 +315,7 @@ bool LLWMIMethods::getGenericSerialNumber(const BSTR &select, const LPCWSTR &var continue; } } - LL_INFOS("AppInit") << " Serial Number : " << vtProp.bstrVal << LL_ENDL; + LL_INFOS("AppInit") << " Serial Number : " << ll_convert_wide_to_string(std::wstring(vtProp.bstrVal, SysStringLen(vtProp.bstrVal))) << LL_ENDL; unsigned int j = 0; diff --git a/indra/newview/llviewerjoystick.cpp b/indra/newview/llviewerjoystick.cpp index 7543fb3743..13d101f881 100644 --- a/indra/newview/llviewerjoystick.cpp +++ b/indra/newview/llviewerjoystick.cpp @@ -144,7 +144,7 @@ BOOL CALLBACK di8_devices_callback(LPCDIDEVICEINSTANCE device_instance_ptr, LPVO // Capable of detecting devices like Oculus Rift if (device_instance_ptr) { - std::string product_name = utf16str_to_utf8str(llutf16string(device_instance_ptr->tszProductName)); + std::string product_name = ll_convert(std::wstring(device_instance_ptr->tszProductName)); LLSD guid = LLViewerJoystick::getInstance()->getDeviceUUID(); @@ -211,7 +211,7 @@ BOOL CALLBACK di8_devices_callback(LPCDIDEVICEINSTANCE device_instance_ptr, LPVO // This is GUID2 so teoretically it can be memcpy copied into LLUUID void guid_from_string(GUID &guid, const std::string &input) { - CLSIDFromString(utf8str_to_utf16str(input).c_str(), &guid); + CLSIDFromString(ll_convert(input).c_str(), &guid); } std::string string_from_guid(const GUID &guid) @@ -221,7 +221,7 @@ std::string string_from_guid(const GUID &guid) // use guidString... - std::string res = utf16str_to_utf8str(llutf16string(guidString)); + std::string res = ll_convert(std::wstring(guidString)); // ensure memory is freed ::CoTaskMemFree(guidString); diff --git a/indra/newview/llviewerwindow.cpp b/indra/newview/llviewerwindow.cpp index 1795d62adc..b8404ec249 100644 --- a/indra/newview/llviewerwindow.cpp +++ b/indra/newview/llviewerwindow.cpp @@ -4773,7 +4773,7 @@ void LLViewerWindow::saveImageLocal(LLImageFormatted *image, const snapshot_save // Check if there is enough free space to save snapshot #ifdef LL_WINDOWS - boost::filesystem::path b_path(utf8str_to_utf16str(lastSnapshotDir)); + boost::filesystem::path b_path(ll_convert(lastSnapshotDir)); #else boost::filesystem::path b_path(lastSnapshotDir); #endif -- cgit v1.2.3 From 6bdc56c7af3ea8e3335145927cb505249e71491c Mon Sep 17 00:00:00 2001 From: "Jonathan \"Geenz\" Goodman" Date: Tue, 11 Mar 2025 22:47:38 -0400 Subject: Another attempt at adding rye to the whitelist. --- .github/workflows/cla.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/cla.yaml b/.github/workflows/cla.yaml index 7866f943b5..627ba512c4 100644 --- a/.github/workflows/cla.yaml +++ b/.github/workflows/cla.yaml @@ -23,4 +23,4 @@ jobs: path-to-signatures: signatures.json remote-organization-name: secondlife remote-repository-name: cla-signatures - allowlist: callum@mbp.localdomain,rye@lindenlab.com + allowlist: callum@mbp.localdomain,rye@lindenlab.com,rye -- cgit v1.2.3 From 9311b522d8979cfe6e7a751f9447df8e0c3d1e96 Mon Sep 17 00:00:00 2001 From: AtlasLinden <114031241+AtlasLinden@users.noreply.github.com> Date: Wed, 30 Jul 2025 13:56:44 -0700 Subject: Add new runners to QA workflow --- .github/workflows/qatest.yaml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/.github/workflows/qatest.yaml b/.github/workflows/qatest.yaml index 4e10900441..457e915726 100644 --- a/.github/workflows/qatest.yaml +++ b/.github/workflows/qatest.yaml @@ -43,7 +43,11 @@ jobs: artifact: Windows-installer install-path: 'C:\viewer-automation-main' - os: windows - runner: qa-dan-asus + runner: qa-windows-asus-dan + artifact: Windows-installer + install-path: 'C:\viewer-automation-main' + - os: windows + runner: qa-windows-z600-dan artifact: Windows-installer install-path: 'C:\viewer-automation-main' - os: mac -- cgit v1.2.3 From 356b682f617c708c08de9f87b6f25e7683e701fb Mon Sep 17 00:00:00 2001 From: Callum Prentice Date: Thu, 7 Aug 2025 15:28:48 -0700 Subject: First part of work for #4498. This change forces each CEF instance to have it's own cache/cookie folder underneath the parent cef_cache folder. The whole cef_cache folder structure is purged at startup (before the parent being created at the first media instance creation) --- indra/media_plugins/cef/media_plugin_cef.cpp | 40 ++++++++++++++++++++++------ indra/newview/llappviewer.cpp | 24 ++++++++++++----- indra/newview/llappviewer.h | 1 + 3 files changed, 51 insertions(+), 14 deletions(-) diff --git a/indra/media_plugins/cef/media_plugin_cef.cpp b/indra/media_plugins/cef/media_plugin_cef.cpp index 64fc7e452b..a96187119e 100644 --- a/indra/media_plugins/cef/media_plugin_cef.cpp +++ b/indra/media_plugins/cef/media_plugin_cef.cpp @@ -38,6 +38,13 @@ #include "volume_catcher.h" #include "media_plugin_base.h" +// _getpid()/getpid() +#if LL_WINDOWS +#include +#else +#include +#endif + #include "dullahan.h" //////////////////////////////////////////////////////////////////////////////// @@ -729,17 +736,34 @@ void MediaPluginCEF::receiveMessage(const char* message_string) std::string user_data_path_cache = message_in.getValue("cache_path"); std::string subfolder = message_in.getValue("username"); - mRootCachePath = user_data_path_cache + "cef_cache"; - if (!subfolder.empty()) - { - std::string delim; + // media plugin doesn't have access to gDirUtilp + std::string path_separator; #if LL_WINDOWS - // media plugin doesn't have access to gDirUtilp - delim = "\\"; + path_separator = "\\"; #else - delim = "/"; + path_separator = "/"; #endif - mCachePath = mRootCachePath + delim + subfolder; + + mRootCachePath = user_data_path_cache + "cef_cache"; + + // Issue #4498 Introduce an additional sub-folder underneath the main cache + // folder so that each CEF media instance gets its own (as per the CEF API + // official position). These folders will be removed at startup by Viewer code + // so that their non-trivial size does not exhaust available disk space. This + // begs the question - why turn on the cache at all? There are 2 reasons - firstly + // some of the instances will benefit from per Viewer session caching and will + // use the injected SL cookie and secondly, it's not clear how having no cache + // interacts with the multiple simultaneous paradigm we use. + mRootCachePath += path_separator; +# if LL_WINDOWS + mRootCachePath += std::to_string(_getpid()); +# else + mRootCachePath += std::to_string(getpid()); +# endif + + if (!subfolder.empty()) + { + mCachePath = mRootCachePath + path_separator + subfolder; } else { diff --git a/indra/newview/llappviewer.cpp b/indra/newview/llappviewer.cpp index 28b40543e9..f7168598dc 100644 --- a/indra/newview/llappviewer.cpp +++ b/indra/newview/llappviewer.cpp @@ -4411,6 +4411,9 @@ bool LLAppViewer::initCache() const U32 CACHE_NUMBER_OF_REGIONS_FOR_OBJECTS = 128; LLVOCache::getInstance()->initCache(LL_PATH_CACHE, CACHE_NUMBER_OF_REGIONS_FOR_OBJECTS, getObjectCacheVersion()); + // Remove old, stale CEF cache folders + purgeCefStaleCaches(); + return true; } @@ -4435,18 +4438,27 @@ void LLAppViewer::loadKeyBindings() LLUrlRegistry::instance().setKeybindingHandler(&gViewerInput); } +// As per GHI #4498, remove old, stale CEF cache folders from previous sessions +void LLAppViewer::purgeCefStaleCaches() +{ + // TODO: we really shouldn't use a hard coded name for the cache folder here... + const std::string browser_parent_cache = gDirUtilp->getExpandedFilename(LL_PATH_CACHE, "cef_cache"); + if (LLFile::isdir(browser_parent_cache)) + { + // This is a sledgehammer approach - nukes the cef_cache dir entirely + // which is then recreated the first time a CEF instance creates an + // individual cache folder. If we ever decide to retain some folders + // e.g. Search UI cache - then we will need a more granular approach. + gDirUtilp->deleteDirAndContents(browser_parent_cache); + } +} + void LLAppViewer::purgeCache() { LL_INFOS("AppCache") << "Purging Cache and Texture Cache..." << LL_ENDL; LLAppViewer::getTextureCache()->purgeCache(LL_PATH_CACHE); LLVOCache::getInstance()->removeCache(LL_PATH_CACHE); LLViewerShaderMgr::instance()->clearShaderCache(); - std::string browser_cache = gDirUtilp->getExpandedFilename(LL_PATH_CACHE, "cef_cache"); - if (LLFile::isdir(browser_cache)) - { - // cef does not support clear_cache and clear_cookies, so clear what we can manually. - gDirUtilp->deleteDirAndContents(browser_cache); - } gDirUtilp->deleteFilesInDir(gDirUtilp->getExpandedFilename(LL_PATH_CACHE, ""), "*"); } diff --git a/indra/newview/llappviewer.h b/indra/newview/llappviewer.h index 14e96afe94..918300f6e5 100644 --- a/indra/newview/llappviewer.h +++ b/indra/newview/llappviewer.h @@ -220,6 +220,7 @@ public: void initGeneralThread(); void purgeUserDataOnExit() { mPurgeUserDataOnExit = true; } + void purgeCefStaleCaches(); // Remove old, stale CEF cache folders void purgeCache(); // Clear the local cache. void purgeCacheImmediate(); //clear local cache immediately. S32 updateTextureThreads(F32 max_time); -- cgit v1.2.3 From 7f276f81ed8c8ef4f2208f5e43b817e1a258988e Mon Sep 17 00:00:00 2001 From: Andrey Kleshchev Date: Thu, 7 Aug 2025 20:53:19 +0300 Subject: #4474 Zoom in to Object From Chat Url based handler for compact chat Normal handling for expanded chat. --- indra/llui/lltextbase.cpp | 1 + indra/llui/llurlaction.cpp | 10 ++++++++++ indra/llui/llurlaction.h | 4 ++++ indra/newview/llchathistory.cpp | 18 +++++++++++++++++- indra/newview/llchatitemscontainerctrl.cpp | 19 +++++++++++++++++++ indra/newview/llviewermenu.cpp | 8 +++++--- indra/newview/llviewermenu.h | 2 +- .../newview/skins/default/xui/en/menu_object_icon.xml | 11 +++++++++++ .../skins/default/xui/en/menu_url_objectim.xml | 7 +++++++ 9 files changed, 75 insertions(+), 5 deletions(-) diff --git a/indra/llui/lltextbase.cpp b/indra/llui/lltextbase.cpp index 7007049e1c..d5755ae4b6 100644 --- a/indra/llui/lltextbase.cpp +++ b/indra/llui/lltextbase.cpp @@ -2227,6 +2227,7 @@ void LLTextBase::createUrlContextMenu(S32 x, S32 y, const std::string &in_url) registrar.add("Url.RemoveFriend", boost::bind(&LLUrlAction::removeFriend, url)); registrar.add("Url.ReportAbuse", boost::bind(&LLUrlAction::reportAbuse, url)); registrar.add("Url.SendIM", boost::bind(&LLUrlAction::sendIM, url)); + registrar.add("Url.ZoomInObject", boost::bind(&LLUrlAction::zoomInObject, url)); registrar.add("Url.ShowOnMap", boost::bind(&LLUrlAction::showLocationOnMap, url)); registrar.add("Url.ShowParcelOnMap", boost::bind(&LLUrlAction::showParcelOnMap, url)); registrar.add("Url.CopyLabel", boost::bind(&LLUrlAction::copyLabelToClipboard, url)); diff --git a/indra/llui/llurlaction.cpp b/indra/llui/llurlaction.cpp index ce599a7552..e86a02d1df 100644 --- a/indra/llui/llurlaction.cpp +++ b/indra/llui/llurlaction.cpp @@ -117,6 +117,16 @@ void LLUrlAction::teleportToLocation(std::string url) } } +void LLUrlAction::zoomInObject(std::string url) +{ + LLUrlMatch match; + std::string object_id = getObjectId(url); + if (LLUUID::validate(object_id) && LLUrlRegistry::instance().findUrl(url, match)) + { + executeSLURL("secondlife:///app/object/" + object_id + "/zoomin/" + match.getLocation()); + } +} + void LLUrlAction::showLocationOnMap(std::string url) { LLUrlMatch match; diff --git a/indra/llui/llurlaction.h b/indra/llui/llurlaction.h index c960d61ca0..9d1cfba2d6 100644 --- a/indra/llui/llurlaction.h +++ b/indra/llui/llurlaction.h @@ -60,6 +60,10 @@ public: /// if the Url specifies an SL location, teleport there static void teleportToLocation(std::string url); + /// If the Url specifies an object id, attempt to zoom in. + /// If not possible to zoom in, show on map + static void zoomInObject(std::string url); + /// if the Url specifies an SL location, show it on a map static void showLocationOnMap(std::string url); diff --git a/indra/newview/llchathistory.cpp b/indra/newview/llchathistory.cpp index a48e22bc73..4d8a49ac0e 100644 --- a/indra/newview/llchathistory.cpp +++ b/indra/newview/llchathistory.cpp @@ -189,7 +189,14 @@ public: std::string url = "secondlife://" + mObjectData["slurl"].asString(); LLUrlAction::teleportToLocation(url); } - + else if (level == "obj_zoom_in") + { + LLUUID obj_id = mObjectData["object_id"]; + if (obj_id.notNull()) + { + handle_zoom_to_object(obj_id); + } + } } bool onObjectIconContextMenuItemVisible(const LLSD& userdata) @@ -203,6 +210,15 @@ public: { return !LLMuteList::getInstance()->isMuted(getAvatarId(), mFrom, LLMute::flagTextChat); } + else if (level == "obj_zoom_in") + { + LLUUID obj_id = mObjectData["object_id"]; + if (obj_id.notNull()) + { + return nullptr != gObjectList.findObject(mAvatarID); + } + return false; + } return false; } diff --git a/indra/newview/llchatitemscontainerctrl.cpp b/indra/newview/llchatitemscontainerctrl.cpp index 550dfeb802..5ac4ce0d52 100644 --- a/indra/newview/llchatitemscontainerctrl.cpp +++ b/indra/newview/llchatitemscontainerctrl.cpp @@ -37,6 +37,8 @@ #include "lllocalcliprect.h" #include "lltrans.h" #include "llfloaterimnearbychat.h" +#include "llfloaterworldmap.h" +#include "llviewermenu.h" #include "llviewercontrol.h" #include "llagentdata.h" @@ -75,6 +77,23 @@ public: return true; } + if (verb == "zoomin") + { + if (!handle_zoom_to_object(object_id) && params.size() > 2) + { + // zoom faled, show location + // secondlife:///app/object/object_id/zoomin/{LOCATION}/{COORDS} SLapp + const std::string region_name = LLURI::unescape(params[0].asString()); + S32 x = (params.size() > 1) ? params[1].asInteger() : 128; + S32 y = (params.size() > 2) ? params[2].asInteger() : 128; + S32 z = (params.size() > 3) ? params[3].asInteger() : 0; + + LLFloaterWorldMap::getInstance()->trackURL(region_name, x, y, z); + LLFloaterReg::showInstance("world_map", "center"); + } + return true; + } + return false; } }; diff --git a/indra/newview/llviewermenu.cpp b/indra/newview/llviewermenu.cpp index 44157d2d2d..9625df5b7b 100644 --- a/indra/newview/llviewermenu.cpp +++ b/indra/newview/llviewermenu.cpp @@ -6485,7 +6485,7 @@ void handle_look_at_selection(const LLSD& param) } } -void handle_zoom_to_object(const LLUUID& object_id) +bool handle_zoom_to_object(const LLUUID& object_id) { const F32 PADDING_FACTOR = 2.f; @@ -6503,12 +6503,14 @@ void handle_zoom_to_object(const LLUUID& object_id) obj_to_cam.normVec(); - LLVector3d object_center_global = gAgent.getPosGlobalFromAgent(bbox.getCenterAgent()); + LLVector3d object_center_global = gAgent.getPosGlobalFromAgent(bbox.getCenterAgent()); - gAgentCamera.setCameraPosAndFocusGlobal(object_center_global + LLVector3d(obj_to_cam * distance), + gAgentCamera.setCameraPosAndFocusGlobal(object_center_global + LLVector3d(obj_to_cam * distance), object_center_global, object_id ); + return true; } + return false; } class LLAvatarInviteToGroup : public view_listener_t diff --git a/indra/newview/llviewermenu.h b/indra/newview/llviewermenu.h index 68c3dbc126..522c7e8109 100644 --- a/indra/newview/llviewermenu.h +++ b/indra/newview/llviewermenu.h @@ -73,7 +73,7 @@ void handle_buy(); void handle_take(bool take_separate = false); void handle_take_copy(); void handle_look_at_selection(const LLSD& param); -void handle_zoom_to_object(const LLUUID& object_id); +bool handle_zoom_to_object(const LLUUID& object_id); void handle_object_return(); void handle_object_delete(); void handle_object_edit(); diff --git a/indra/newview/skins/default/xui/en/menu_object_icon.xml b/indra/newview/skins/default/xui/en/menu_object_icon.xml index f3e520700b..d43ce26e56 100644 --- a/indra/newview/skins/default/xui/en/menu_object_icon.xml +++ b/indra/newview/skins/default/xui/en/menu_object_icon.xml @@ -40,6 +40,17 @@ + + + + + + + Date: Sat, 9 Aug 2025 01:45:26 +0800 Subject: Discord without auth & "Hidden Region" instead of blank (#4496) * Rich Presence w/o requiring access to friends list Thank you Signal Linden for the pointer from https://discord.com/developers/docs/social-sdk/classdiscordpp_1_1Client.html#af0a85e30f2b3d8a0b502fd23744ee58e "Note: On Desktop, rich presence can be set before calling Client::Connect, but it will be cleared if the Client connects. When Client is not connected, this sets the rich presence in the current user's Discord client when available." This lead me to setting the Application ID here https://discord.com/developers/docs/social-sdk/classdiscordpp_1_1Client.html#ad452335c06b28be0406dab824acccc49 in place of setting it on https://discord.com/developers/docs/social-sdk/classdiscordpp_1_1AuthorizationArgs.html which would lead Authorize, GetToken, UpdateToken, Connect, and so on. This means we don't even need the SecAPI saveCredential, loadCredential and deleteCredential parts now. * Discord integration is enabled by default per spec now that we don't need the user to authorise Discord SDK to have any access to the user's friends list, etc. (which are Discord Relationships related, and not needed just for Rich Presence). * "Hidden Region" if Discord location sharing is off instead of blank. The coords are hidden too, but the Party numbers are still shown, for consistency with TPVs' implementations. * Remove toggleDiscordIntegration declaration The definition had already been removed, I had forgotten to remove this one. --- indra/newview/app_settings/settings.xml | 2 +- indra/newview/llappviewer.cpp | 153 ++++++++------------------------ indra/newview/llappviewer.h | 1 - indra/newview/llfloaterpreference.cpp | 2 +- 4 files changed, 40 insertions(+), 118 deletions(-) diff --git a/indra/newview/app_settings/settings.xml b/indra/newview/app_settings/settings.xml index 0614be8bf6..f939e94fc3 100644 --- a/indra/newview/app_settings/settings.xml +++ b/indra/newview/app_settings/settings.xml @@ -1159,7 +1159,7 @@ Type Boolean Value - 0 + 1 ShowDiscordActivityDetails diff --git a/indra/newview/llappviewer.cpp b/indra/newview/llappviewer.cpp index 28b40543e9..f507be9225 100644 --- a/indra/newview/llappviewer.cpp +++ b/indra/newview/llappviewer.cpp @@ -5914,100 +5914,21 @@ void LLAppViewer::initDiscordSocial() gDiscordPartyMaxSize = 0; gDiscordTimestampsStart = time(nullptr); gDiscordClient = std::make_shared(); - gDiscordClient->SetStatusChangedCallback([](discordpp::Client::Status status, discordpp::Client::Error, int32_t) { - if (status == discordpp::Client::Status::Ready) - { - updateDiscordActivity(); - } - }); - if (gSavedSettings.getBOOL("EnableDiscord")) - { - auto credential = gSecAPIHandler->loadCredential("Discord"); - if (credential.notNull()) - { - gDiscordClient->UpdateToken(discordpp::AuthorizationTokenType::Bearer, credential->getAuthenticator()["token"].asString(), [](discordpp::ClientResult result) { - if (result.Successful()) - gDiscordClient->Connect(); - else - LL_WARNS("Discord") << result.Error() << LL_ENDL; - }); - } - else - { - LL_WARNS("Discord") << "Integration was enabled, but no credentials. Disabling integration." << LL_ENDL; - gSavedSettings.setBOOL("EnableDiscord", false); - } - } + gDiscordClient->SetApplicationId(1394782217405862001); + updateDiscordActivity(); } -void LLAppViewer::toggleDiscordIntegration(const LLSD& value) +void LLAppViewer::updateDiscordActivity() { - static const uint64_t APPLICATION_ID = 1394782217405862001; - if (value.asBoolean()) - { - discordpp::AuthorizationArgs args{}; - args.SetClientId(APPLICATION_ID); - args.SetScopes(discordpp::Client::GetDefaultPresenceScopes()); - auto codeVerifier = gDiscordClient->CreateAuthorizationCodeVerifier(); - args.SetCodeChallenge(codeVerifier.Challenge()); - gDiscordClient->Authorize(args, [codeVerifier](auto result, auto code, auto redirectUri) { - if (result.Successful()) - { - gDiscordClient->GetToken(APPLICATION_ID, code, codeVerifier.Verifier(), redirectUri, [](discordpp::ClientResult result, std::string accessToken, std::string, discordpp::AuthorizationTokenType, int32_t, std::string) { - if (result.Successful()) - { - gDiscordClient->UpdateToken(discordpp::AuthorizationTokenType::Bearer, accessToken, [accessToken](discordpp::ClientResult result) { - if (result.Successful()) - { - LLSD authenticator = LLSD::emptyMap(); - authenticator["token"] = accessToken; - gSecAPIHandler->saveCredential(gSecAPIHandler->createCredential("Discord", LLSD::emptyMap(), authenticator), true); - gDiscordClient->Connect(); - } - else - { - LL_WARNS("Discord") << result.Error() << LL_ENDL; - } - }); - } - else - { - LL_WARNS("Discord") << result.Error() << LL_ENDL; - } - }); - } - else - { - LL_WARNS("Discord") << result.Error() << LL_ENDL; - gSavedSettings.setBOOL("EnableDiscord", false); - } - }); - } - else + LL_PROFILE_ZONE_SCOPED; + + static LLCachedControl integration_enabled(gSavedSettings, "EnableDiscord", true); + if (!integration_enabled) { - gDiscordClient->Disconnect(); - auto credential = gSecAPIHandler->loadCredential("Discord"); - if (credential.notNull()) - { - gDiscordClient->RevokeToken(APPLICATION_ID, credential->getAuthenticator()["token"].asString(), [](discordpp::ClientResult result) { - if (result.Successful()) - LL_INFOS("Discord") << "Access token successfully revoked." << LL_ENDL; - else - LL_WARNS("Discord") << "No access token to revoke." << LL_ENDL; - }); - auto cred = new LLCredential("Discord"); - gSecAPIHandler->deleteCredential(cred); - } - else - { - LL_WARNS("Discord") << "Credentials are already nonexistent." << LL_ENDL; - } + gDiscordClient->ClearRichPresence(); + return; } -} -void LLAppViewer::updateDiscordActivity() -{ - LL_PROFILE_ZONE_SCOPED; discordpp::Activity activity; activity.SetType(discordpp::ActivityTypes::Playing); discordpp::ActivityTimestamps timestamps; @@ -6035,37 +5956,39 @@ void LLAppViewer::updateDiscordActivity() activity.SetDetails(gDiscordActivityDetails); } + auto agent_pos_region = gAgent.getPositionAgent(); + S32 pos_x = S32(agent_pos_region.mV[VX] + 0.5f); + S32 pos_y = S32(agent_pos_region.mV[VY] + 0.5f); + S32 pos_z = S32(agent_pos_region.mV[VZ] + 0.5f); + F32 velocity_mag_sq = gAgent.getVelocity().magVecSquared(); + const F32 FLY_CUTOFF = 6.f; + const F32 FLY_CUTOFF_SQ = FLY_CUTOFF * FLY_CUTOFF; + const F32 WALK_CUTOFF = 1.5f; + const F32 WALK_CUTOFF_SQ = WALK_CUTOFF * WALK_CUTOFF; + if (velocity_mag_sq > FLY_CUTOFF_SQ) + { + pos_x -= pos_x % 4; + pos_y -= pos_y % 4; + } + else if (velocity_mag_sq > WALK_CUTOFF_SQ) + { + pos_x -= pos_x % 2; + pos_y -= pos_y % 2; + } + + std::string location = "Hidden Region"; static LLCachedControl show_state(gSavedSettings, "ShowDiscordActivityState", false); if (show_state) { - auto agent_pos_region = gAgent.getPositionAgent(); - S32 pos_x = S32(agent_pos_region.mV[VX] + 0.5f); - S32 pos_y = S32(agent_pos_region.mV[VY] + 0.5f); - S32 pos_z = S32(agent_pos_region.mV[VZ] + 0.5f); - F32 velocity_mag_sq = gAgent.getVelocity().magVecSquared(); - const F32 FLY_CUTOFF = 6.f; - const F32 FLY_CUTOFF_SQ = FLY_CUTOFF * FLY_CUTOFF; - const F32 WALK_CUTOFF = 1.5f; - const F32 WALK_CUTOFF_SQ = WALK_CUTOFF * WALK_CUTOFF; - if (velocity_mag_sq > FLY_CUTOFF_SQ) - { - pos_x -= pos_x % 4; - pos_y -= pos_y % 4; - } - else if (velocity_mag_sq > WALK_CUTOFF_SQ) - { - pos_x -= pos_x % 2; - pos_y -= pos_y % 2; - } - auto location = llformat("%s (%d, %d, %d)", gAgent.getRegion()->getName().c_str(), pos_x, pos_y, pos_z); - activity.SetState(location); - - discordpp::ActivityParty party; - party.SetId(location); - party.SetCurrentSize(gDiscordPartyCurrentSize); - party.SetMaxSize(gDiscordPartyMaxSize); - activity.SetParty(party); + location = llformat("%s (%d, %d, %d)", gAgent.getRegion()->getName().c_str(), pos_x, pos_y, pos_z); } + activity.SetState(location); + + discordpp::ActivityParty party; + party.SetId(location); + party.SetCurrentSize(gDiscordPartyCurrentSize); + party.SetMaxSize(gDiscordPartyMaxSize); + activity.SetParty(party); gDiscordClient->UpdateRichPresence(activity, [](discordpp::ClientResult) {}); } diff --git a/indra/newview/llappviewer.h b/indra/newview/llappviewer.h index 14e96afe94..132d7bfe25 100644 --- a/indra/newview/llappviewer.h +++ b/indra/newview/llappviewer.h @@ -253,7 +253,6 @@ public: #ifdef LL_DISCORD static void initDiscordSocial(); - static void toggleDiscordIntegration(const LLSD& value); static void updateDiscordActivity(); static void updateDiscordPartyCurrentSize(int32_t size); static void updateDiscordPartyMaxSize(int32_t size); diff --git a/indra/newview/llfloaterpreference.cpp b/indra/newview/llfloaterpreference.cpp index c84728248c..42d45719f5 100644 --- a/indra/newview/llfloaterpreference.cpp +++ b/indra/newview/llfloaterpreference.cpp @@ -367,7 +367,7 @@ LLFloaterPreference::LLFloaterPreference(const LLSD& key) mCommitCallbackRegistrar.add("Pref.DeleteTranscripts", boost::bind(&LLFloaterPreference::onDeleteTranscripts, this)); mCommitCallbackRegistrar.add("UpdateFilter", boost::bind(&LLFloaterPreference::onUpdateFilterTerm, this, false)); // Hook up for filtering #ifdef LL_DISCORD - gSavedSettings.getControl("EnableDiscord")->getCommitSignal()->connect(boost::bind(&LLAppViewer::toggleDiscordIntegration, _2)); + gSavedSettings.getControl("EnableDiscord")->getCommitSignal()->connect(boost::bind(&LLAppViewer::updateDiscordActivity)); gSavedSettings.getControl("ShowDiscordActivityDetails")->getCommitSignal()->connect(boost::bind(&LLAppViewer::updateDiscordActivity)); gSavedSettings.getControl("ShowDiscordActivityState")->getCommitSignal()->connect(boost::bind(&LLAppViewer::updateDiscordActivity)); #endif -- cgit v1.2.3 From 1f441b11586f8e4ab8e1d034fd69ceb59432b1d4 Mon Sep 17 00:00:00 2001 From: Remmy Date: Fri, 8 Aug 2025 11:57:01 -0600 Subject: Nearby tab slider (#4490) * Nearby tab slider Add slider allowing users to adjust NearMeRange * panel_people.xml adjustment Add "m" after the NearMeRange slider distance. * panel_people.xml avatar list fix Adding NearMeRange slider caused avatar at the bottom of the nearby list to be cut off. Fix by reducing height. * avatar list stepper adjustment Noticed later that the bottom scrollbar stepper was still slightly cut-off. Reduce list height again by 3. --- indra/newview/skins/default/xui/en/panel_people.xml | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/indra/newview/skins/default/xui/en/panel_people.xml b/indra/newview/skins/default/xui/en/panel_people.xml index c31e6c94ea..1be34550fa 100644 --- a/indra/newview/skins/default/xui/en/panel_people.xml +++ b/indra/newview/skins/default/xui/en/panel_people.xml @@ -177,6 +177,25 @@ Learn about [https://community.secondlife.com/knowledgebase/joining-and-particip function="People.DelFriend" /> + + + m + Date: Fri, 8 Aug 2025 20:08:57 +0300 Subject: #4472 Permit going below ground if camera isn't constrained Basically a revert of SL-20206, 25388312cf28f8b30934ac3885783a96a3b2ed69 --- indra/newview/llagentcamera.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/indra/newview/llagentcamera.cpp b/indra/newview/llagentcamera.cpp index d4767e18af..86909b6989 100644 --- a/indra/newview/llagentcamera.cpp +++ b/indra/newview/llagentcamera.cpp @@ -1753,7 +1753,6 @@ F32 LLAgentCamera::calcCameraFOVZoomFactor() LLVector3d LLAgentCamera::calcCameraPositionTargetGlobal(bool *hit_limit) { // Compute base camera position and look-at points. - F32 camera_land_height; LLVector3d frame_center_global = !isAgentAvatarValid() ? gAgent.getPositionGlobal() : gAgent.getPosGlobalFromAgent(getAvatarRootPosition()); @@ -1990,10 +1989,11 @@ LLVector3d LLAgentCamera::calcCameraPositionTargetGlobal(bool *hit_limit) } } - // Don't let camera go underground - F32 camera_min_off_ground = getCameraMinOffGround(); - camera_land_height = LLWorld::getInstance()->resolveLandHeightGlobal(camera_position_global); - F32 minZ = llmax(F_ALMOST_ZERO, camera_land_height + camera_min_off_ground); + // Don't let camera go underground if constrained + // If not constrained, permit going 1000m below 0, use case: retrieving objects + F32 camera_min_off_ground = getCameraMinOffGround(); // checks isDisableCameraConstraints + F32 camera_land_height = LLWorld::getInstance()->resolveLandHeightGlobal(camera_position_global); + F32 minZ = camera_land_height + camera_min_off_ground; if (camera_position_global.mdV[VZ] < minZ) { camera_position_global.mdV[VZ] = minZ; -- cgit v1.2.3 From 1bbad3fd00a9db28944bab1ec9c0e10fd5d1c2f2 Mon Sep 17 00:00:00 2001 From: Callum Prentice Date: Mon, 11 Aug 2025 18:45:15 -0700 Subject: This commit introduces CEF 139 which works now that each media instance has its own cache/cookies folder (previous commit). It also changes the Test Bookmarks page to a heavily updated one with new links and a filter/search mechanism --- autobuild.xml | 148 ++++++++++----------- indra/media_plugins/cef/media_plugin_cef.cpp | 21 ++- .../skins/default/xui/en/floater_web_content.xml | 2 +- indra/newview/viewer_manifest.py | 8 +- 4 files changed, 95 insertions(+), 84 deletions(-) diff --git a/autobuild.xml b/autobuild.xml index 56c66b163f..5dcc9a980a 100644 --- a/autobuild.xml +++ b/autobuild.xml @@ -99,16 +99,6 @@ boost - copyright - (see individual source files) - description - Boost C++ Libraries - license - boost 1.0 - license_file - LICENSES/boost.txt - name - boost platforms darwin64 @@ -154,8 +144,18 @@ windows64 + license + boost 1.0 + license_file + LICENSES/boost.txt + copyright + (see individual source files) version 1.86 + name + boost + description + Boost C++ Libraries bugsplat @@ -205,14 +205,6 @@ colladadom - copyright - Copyright 2006 Sony Computer Entertainment Inc. - license - SCEA - license_file - LICENSES/collada.txt - name - colladadom platforms darwin64 @@ -258,8 +250,16 @@ windows64 + license + SCEA + license_file + LICENSES/collada.txt + copyright + Copyright 2006 Sony Computer Entertainment Inc. version 2.3.0-r8 + name + colladadom cubemaptoequirectangular @@ -441,16 +441,6 @@ 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 @@ -458,11 +448,11 @@ archive hash - 7fde76e3f0e62d0e0593b6157f4d740ecef2429d + 8f3672e548c140a48296669b65cb4ce9a54154e2 hash_algorithm sha1 url - 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 + https://github.com/secondlife/dullahan/releases/download/v1.16.0-CEF_139.0.17/dullahan-1.16.0.202508120105_139.0.17_g6c347eb_chromium-139.0.7258.31-darwin64-16896111303.tar.zst name darwin64 @@ -486,18 +476,28 @@ archive hash - 4124c79d8b0e319877ffa4c12581d5c1318b4d93 + ec077eb13edf0b69324d73b49bb434e69e67d2d0 hash_algorithm sha1 url - 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 + https://github.com/secondlife/dullahan/releases/download/v1.16.0-CEF_139.0.17/dullahan-1.16.0.202508120105_139.0.17_g6c347eb_chromium-139.0.7258.31-windows64-16896111303.tar.zst name windows64 + license + MPL + license_file + LICENSES/LICENSE.txt + copyright + Copyright (c) 2017, Linden Research, Inc. version - 1.14.0.202408091639_118.4.1_g3dd6078_chromium-118.0.5993.54 + 1.16.0.202508120105_139.0.17_g6c347eb_chromium-139.0.7258.31 + 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. emoji_shortcodes @@ -625,16 +625,6 @@ freetype - copyright - Copyright 2006, 2007, 2008, 2009, 2010 by David Turner, Robert Wilhelm, and Werner Lemberg. - description - Font rendering library - license - FreeType - license_file - LICENSES/freetype.txt - name - freetype platforms darwin64 @@ -680,8 +670,18 @@ windows64 + license + FreeType + license_file + LICENSES/freetype.txt + copyright + Copyright 2006, 2007, 2008, 2009, 2010 by David Turner, Robert Wilhelm, and Werner Lemberg. version 2.13.3-cb2e120 + name + freetype + description + Font rendering library glext @@ -1395,15 +1395,6 @@ llca - copyright - Copyright (c) 2016, Linden Research, Inc.; data provided by the Mozilla NSS Project. - - license - mit - license_file - LICENSES/ca-license.txt - name - llca platforms common @@ -1421,8 +1412,17 @@ common + license + mit + license_file + LICENSES/ca-license.txt + copyright + Copyright (c) 2016, Linden Research, Inc.; data provided by the Mozilla NSS Project. + version 202407221423.0 + name + llca llphysicsextensions_source @@ -2620,14 +2620,6 @@ Copyright (c) 2012, 2014, 2015, 2016 nghttp2 contributors vlc-bin - copyright - Copyright (C) 1998-2016 VLC authors and VideoLAN - license - GPL2 - license_file - LICENSES/vlc.txt - name - vlc-bin platforms darwin64 @@ -2659,8 +2651,16 @@ Copyright (c) 2012, 2014, 2015, 2016 nghttp2 contributors windows64 + license + GPL2 + license_file + LICENSES/vlc.txt + copyright + Copyright (C) 1998-2016 VLC authors and VideoLAN version 3.0.21.10218721728 + name + vlc-bin vulkan_gltf @@ -2858,16 +2858,6 @@ Copyright (c) 2012, 2014, 2015, 2016 nghttp2 contributors tinyexr - copyright - Copyright (c) 2014 - 2021, Syoyo Fujita and many contributors. - description - tinyexr import library - license - 3-clause BSD - license_file - LICENSES/tinyexr_license.txt - name - tinyexr platforms common @@ -2885,16 +2875,26 @@ Copyright (c) 2012, 2014, 2015, 2016 nghttp2 contributors common - source_type - git + license + 3-clause BSD + license_file + LICENSES/tinyexr_license.txt + copyright + Copyright (c) 2014 - 2021, Syoyo Fujita and many contributors. + version + 1.0.9-5e8947c + name + tinyexr vcs_branch dependabot/github_actions/secondlife/action-autobuild-4 vcs_revision 4dc4d1d90d82a22843e2adf5130f9ecb5ee5769e vcs_url https://github.com/secondlife/3p-tinyexr - version - 1.0.9-5e8947c + description + tinyexr import library + source_type + git discord_sdk diff --git a/indra/media_plugins/cef/media_plugin_cef.cpp b/indra/media_plugins/cef/media_plugin_cef.cpp index a96187119e..d77eb83b00 100644 --- a/indra/media_plugins/cef/media_plugin_cef.cpp +++ b/indra/media_plugins/cef/media_plugin_cef.cpp @@ -71,7 +71,7 @@ private: void onLoadStartCallback(); void onRequestExitCallback(); void onLoadEndCallback(int httpStatusCode, std::string url); - void onLoadError(int status, const std::string error_text); + void onLoadError(int status, const std::string error_text, const std::string error_url); void onAddressChangeCallback(std::string url); void onOpenPopupCallback(std::string url, std::string target); bool onHTTPAuthCallback(const std::string host, const std::string realm, std::string& username, std::string& password); @@ -249,15 +249,17 @@ void MediaPluginCEF::onLoadStartCallback() ///////////////////////////////////////////////////////////////////////////////// // -void MediaPluginCEF::onLoadError(int status, const std::string error_text) +void MediaPluginCEF::onLoadError(int status, const std::string error_text, const std::string error_url) { std::stringstream msg; - msg << "Loading error!"; + msg << "Loading error"; msg << "

"; - msg << "Message: " << error_text; - msg << "
"; - msg << "Code: " << status; + msg << "Error message: " << error_text; + msg << "

"; + msg << "Error URL: " << error_url << ""; + msg << "

"; + msg << "Error code: " << status; mCEFLib->showBrowserMessage(msg.str()); } @@ -614,7 +616,12 @@ void MediaPluginCEF::receiveMessage(const char* message_string) mCEFLib->setOnTooltipCallback(std::bind(&MediaPluginCEF::onTooltipCallback, this, std::placeholders::_1)); mCEFLib->setOnLoadStartCallback(std::bind(&MediaPluginCEF::onLoadStartCallback, this)); mCEFLib->setOnLoadEndCallback(std::bind(&MediaPluginCEF::onLoadEndCallback, this, std::placeholders::_1, std::placeholders::_2)); - mCEFLib->setOnLoadErrorCallback(std::bind(&MediaPluginCEF::onLoadError, this, std::placeholders::_1, std::placeholders::_2)); + + // CEF 139 seems to have introduced a loading failure at the login page (only??) I haven't seen it on + // any other page and it only happens about 1 in 8 times. Without this handler for the error page + // (red box, error message/code/url) the page load recovers after display a brief built in error. + // Not ideal but better than stopping altgoether. Will restore this once I discover the error. + //mCEFLib->setOnLoadErrorCallback(std::bind(&MediaPluginCEF::onLoadError, this, std::placeholders::_1, std::placeholders::_2, std::placeholders::_3)); mCEFLib->setOnAddressChangeCallback(std::bind(&MediaPluginCEF::onAddressChangeCallback, this, std::placeholders::_1)); mCEFLib->setOnOpenPopupCallback(std::bind(&MediaPluginCEF::onOpenPopupCallback, this, std::placeholders::_1, std::placeholders::_2)); mCEFLib->setOnHTTPAuthCallback(std::bind(&MediaPluginCEF::onHTTPAuthCallback, this, std::placeholders::_1, std::placeholders::_2, std::placeholders::_3, std::placeholders::_4)); diff --git a/indra/newview/skins/default/xui/en/floater_web_content.xml b/indra/newview/skins/default/xui/en/floater_web_content.xml index 2e1dfa00c7..53796f0959 100644 --- a/indra/newview/skins/default/xui/en/floater_web_content.xml +++ b/indra/newview/skins/default/xui/en/floater_web_content.xml @@ -178,7 +178,7 @@ width="22"> + parameter="https://sl-viewer-media-system.s3.amazonaws.com/bookmarks/index.html"/> Date: Mon, 11 Aug 2025 18:50:34 -0700 Subject: A ??) sequence was mis-interpreted by the pre-commit hooks as a trigraph sequence. --- indra/media_plugins/cef/media_plugin_cef.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/indra/media_plugins/cef/media_plugin_cef.cpp b/indra/media_plugins/cef/media_plugin_cef.cpp index d77eb83b00..3f45ac971a 100644 --- a/indra/media_plugins/cef/media_plugin_cef.cpp +++ b/indra/media_plugins/cef/media_plugin_cef.cpp @@ -617,7 +617,7 @@ void MediaPluginCEF::receiveMessage(const char* message_string) mCEFLib->setOnLoadStartCallback(std::bind(&MediaPluginCEF::onLoadStartCallback, this)); mCEFLib->setOnLoadEndCallback(std::bind(&MediaPluginCEF::onLoadEndCallback, this, std::placeholders::_1, std::placeholders::_2)); - // CEF 139 seems to have introduced a loading failure at the login page (only??) I haven't seen it on + // CEF 139 seems to have introduced a loading failure at the login page (only?) I haven't seen it on // any other page and it only happens about 1 in 8 times. Without this handler for the error page // (red box, error message/code/url) the page load recovers after display a brief built in error. // Not ideal but better than stopping altgoether. Will restore this once I discover the error. -- cgit v1.2.3 From f03cd219a91740de9f406cfae5bbc15194156c78 Mon Sep 17 00:00:00 2001 From: Ansariel Date: Mon, 11 Aug 2025 18:40:16 +0200 Subject: Fix clang compiler issues due to unused variables --- indra/llrender/llrendertarget.cpp | 16 ---------------- indra/newview/gltf/asset.cpp | 4 ++++ indra/newview/lldrawpoolwater.cpp | 2 -- indra/newview/llstartup.cpp | 2 -- indra/newview/llviewertexture.cpp | 2 -- indra/newview/llvoavatar.cpp | 8 -------- indra/newview/llvoicewebrtc.cpp | 4 ---- 7 files changed, 4 insertions(+), 34 deletions(-) diff --git a/indra/llrender/llrendertarget.cpp b/indra/llrender/llrendertarget.cpp index 38bc5ff331..0b0d69812f 100644 --- a/indra/llrender/llrendertarget.cpp +++ b/indra/llrender/llrendertarget.cpp @@ -492,22 +492,6 @@ U32 LLRenderTarget::getNumTextures() const void LLRenderTarget::bindTexture(U32 index, S32 channel, LLTexUnit::eTextureFilterOptions filter_options) { gGL.getTexUnit(channel)->bindManual(mUsage, getTexture(index), filter_options == LLTexUnit::TFO_TRILINEAR || filter_options == LLTexUnit::TFO_ANISOTROPIC); - - bool isSRGB = false; - llassert(mInternalFormat.size() > index); - switch (mInternalFormat[index]) - { - case GL_SRGB: - case GL_SRGB8: - case GL_SRGB_ALPHA: - case GL_SRGB8_ALPHA8: - isSRGB = true; - break; - - default: - break; - } - gGL.getTexUnit(channel)->setTextureFilteringOption(filter_options); } diff --git a/indra/newview/gltf/asset.cpp b/indra/newview/gltf/asset.cpp index e24aea4a28..28f30ae1c9 100644 --- a/indra/newview/gltf/asset.cpp +++ b/indra/newview/gltf/asset.cpp @@ -589,7 +589,9 @@ bool Asset::prep() for (U32 variant = 0; variant < LLGLSLShader::NUM_GLTF_VARIANTS; ++variant) { +#ifdef SHOW_ASSERT U32 attribute_mask = 0; +#endif // for each mesh for (auto& mesh : mMeshes) { @@ -607,7 +609,9 @@ bool Asset::prep() // all primitives of a given variant and material should all have the same attribute mask llassert(attribute_mask == 0 || primitive.mAttributeMask == attribute_mask); +#ifdef SHOW_ASSERT attribute_mask |= primitive.mAttributeMask; +#endif } } } diff --git a/indra/newview/lldrawpoolwater.cpp b/indra/newview/lldrawpoolwater.cpp index 7d58511d41..cdf3244389 100644 --- a/indra/newview/lldrawpoolwater.cpp +++ b/indra/newview/lldrawpoolwater.cpp @@ -143,7 +143,6 @@ void LLDrawPoolWater::renderPostDeferred(S32 pass) gGL.setColorMask(true, true); LLColor3 light_diffuse(0, 0, 0); - F32 light_exp = 0.0f; LLEnvironment& environment = LLEnvironment::instance(); LLSettingsWater::ptr_t pwater = environment.getCurrentWater(); @@ -170,7 +169,6 @@ void LLDrawPoolWater::renderPostDeferred(S32 pass) // Apply magic numbers translating light direction into intensities light_dir.normalize(); F32 ground_proj_sq = light_dir.mV[0] * light_dir.mV[0] + light_dir.mV[1] * light_dir.mV[1]; - light_exp = llmax(32.f, 256.f * powf(ground_proj_sq, 16.0f)); if (0.f < light_diffuse.normalize()) // Normalizing a color? Puzzling... { light_diffuse *= (1.5f + (6.f * ground_proj_sq)); diff --git a/indra/newview/llstartup.cpp b/indra/newview/llstartup.cpp index 2409b71f00..ba7437798a 100644 --- a/indra/newview/llstartup.cpp +++ b/indra/newview/llstartup.cpp @@ -342,13 +342,11 @@ void pump_idle_startup_network(void) { // while there are message to process: // process one then call display_startup() - S32 num_messages = 0; { LockMessageChecker lmc(gMessageSystem); while (lmc.checkAllMessages(gFrameCount, gServicePump)) { display_startup(); - ++num_messages; } lmc.processAcks(); } diff --git a/indra/newview/llviewertexture.cpp b/indra/newview/llviewertexture.cpp index 4a9dd1c1b6..1c3674de1d 100644 --- a/indra/newview/llviewertexture.cpp +++ b/indra/newview/llviewertexture.cpp @@ -524,7 +524,6 @@ void LLViewerTexture::updateClass() bool is_low = is_sys_low || over_pct > 0.f; static bool was_low = false; - static bool was_sys_low = false; if (is_low && !was_low) { @@ -542,7 +541,6 @@ void LLViewerTexture::updateClass() } was_low = is_low; - was_sys_low = is_sys_low; if (is_low) { diff --git a/indra/newview/llvoavatar.cpp b/indra/newview/llvoavatar.cpp index dd59979a6c..283a80a1ed 100644 --- a/indra/newview/llvoavatar.cpp +++ b/indra/newview/llvoavatar.cpp @@ -4766,14 +4766,6 @@ bool LLVOAvatar::updateCharacter(LLAgent &agent) } bool visible = isVisible(); - bool is_control_avatar = isControlAvatar(); // capture state to simplify tracing - bool is_attachment = false; - - if (is_control_avatar) - { - LLControlAvatar *cav = dynamic_cast(this); - is_attachment = cav && cav->mRootVolp && cav->mRootVolp->isAttachment(); // For attached animated objects - } // For fading out the names above heads, only let the timer // run if we're visible. diff --git a/indra/newview/llvoicewebrtc.cpp b/indra/newview/llvoicewebrtc.cpp index 627d759df4..72baa393cf 100644 --- a/indra/newview/llvoicewebrtc.cpp +++ b/indra/newview/llvoicewebrtc.cpp @@ -2264,7 +2264,6 @@ void LLVoiceWebRTCConnection::processIceUpdatesCoro(connectionPtr_t connection) return; } - bool iceCompleted = false; LLSD body; if (!connection->mIceCandidates.empty() || connection->mIceCompleted) { @@ -2303,7 +2302,6 @@ void LLVoiceWebRTCConnection::processIceUpdatesCoro(connectionPtr_t connection) LLSD body_candidate; body_candidate["completed"] = true; body["candidate"] = body_candidate; - iceCompleted = connection->mIceCompleted; connection->mIceCompleted = false; } @@ -2926,7 +2924,6 @@ void LLVoiceWebRTCConnection::OnDataReceivedImpl(const std::string &data, bool b return; } boost::json::object voice_data = voice_data_parsed.as_object(); - bool new_participant = false; boost::json::object mute; boost::json::object user_gain; for (auto &participant_elem : voice_data) @@ -2979,7 +2976,6 @@ void LLVoiceWebRTCConnection::OnDataReceivedImpl(const std::string &data, bool b } } - new_participant |= joined; if (!participant && joined && (primary || !isSpatial())) { participant = LLWebRTCVoiceClient::getInstance()->addParticipantByID(mChannelID, agent_id, mRegionID); -- cgit v1.2.3 From e3d15a9146d375368066cdbcf2a45f40165175f1 Mon Sep 17 00:00:00 2001 From: Signal Linden Date: Tue, 12 Aug 2025 09:02:07 -0700 Subject: Chore: Move message.xml to scripts/messages (#4501) * Move message.xml to scripts/messages Get rid of the top-level etc/ directory by moving its only contents: message.xml to scripts/messages * Move message.xml to app_settings * Remove unneeded inclusion in viewer_manifest.py --- etc/message.xml | 751 --------------------------------- indra/newview/CMakeLists.txt | 4 +- indra/newview/app_settings/message.xml | 751 +++++++++++++++++++++++++++++++++ indra/newview/viewer_manifest.py | 1 - 4 files changed, 753 insertions(+), 754 deletions(-) delete mode 100755 etc/message.xml create mode 100755 indra/newview/app_settings/message.xml diff --git a/etc/message.xml b/etc/message.xml deleted file mode 100755 index dee3fd72dd..0000000000 --- a/etc/message.xml +++ /dev/null @@ -1,751 +0,0 @@ - - - - serverDefaults - - - simulator - template - - spaceserver - template - - dataserver - template - - logDataserver - template - - inventoryDataserver - template - - rpcserver - template - - mapserver - template - - viewer - template - - - messages - - - - PacketAck - - flavor - template - trusted-sender - false - - - OpenCircuit - - flavor - llsd - trusted-sender - false - - - CloseCircuit - - flavor - template - trusted-sender - false - - - StartPingCheck - - flavor - template - trusted-sender - false - - - CompletePingCheck - - flavor - template - trusted-sender - false - - - AddCircuitCode - - flavor - template - trusted-sender - true - - - UseCircuitCode - - flavor - template - trusted-sender - false - - - CreateTrustedCircuit - - flavor - template - trusted-sender - false - - - RequestTrustedCircuit - - flavor - template - trusted-sender - true - - - - ReportAutosaveCrash - - flavor - template - trusted-sender - false - - - SetCPURatio - - flavor - template - trusted-sender - false - - - - CompleteAgentMovement - - flavor - template - trusted-sender - false - - - EconomyDataRequest - - flavor - template - trusted-sender - false - - - ViewerEffect - - flavor - template - trusted-sender - false - - - RegionHandshakeReply - - flavor - template - trusted-sender - false - - - - AgentUpdate - - flavor - template - trusted-sender - false - - - - ImagePacket - - flavor - template - trusted-sender - false - - - LayerData - - flavor - template - trusted-sender - false - - - ObjectUpdateCached - - flavor - template - trusted-sender - false - - - ObjectUpdateCompressed - - flavor - template - trusted-sender - false - - - ObjectUpdate - - flavor - template - trusted-sender - false - - - ImprovedTerseObjectUpdate - - flavor - template - trusted-sender - false - - - AvatarAnimation - - flavor - template - trusted-sender - false - - - ObjectAnimation - - flavor - template - trusted-sender - false - - - AvatarAppearance - - flavor - template - trusted-sender - false - - - - GodKickUser - - flavor - llsd - trusted-sender - false - - - RoutedMoneyBalanceReply - - flavor - llsd - trusted-sender - false - - - - EdgeDataPacket - - flavor - template - trusted-sender - true - - - CoarseLocationUpdate - - flavor - template - trusted-sender - true - only-send-latest - true - - - SimulatorLoad - - flavor - template - trusted-sender - true - - - EstablishAgentCommunication - - flavor - llsd - trusted-sender - true - - - AgentGroupDataUpdate - - flavor - llsd - trusted-sender - true - - - AgentDropGroup - - flavor - llsd - trusted-sender - true - - - ChatterBoxSessionStartReply - - flavor - llsd - trusted-sender - true - - - ChatterBoxSessionEventReply - - flavor - llsd - trusted-sender - true - - - ForceCloseChatterBoxSession - - flavor - llsd - trusted-sender - true - - - ChatterBoxSessionAgentListUpdates - - flavor - llsd - trusted-sender - true - - - ChatterBoxSessionUpdate - - flavor - llsd - trusted-sender - true - - - ChatterBoxInvitation - - flavor - llsd - trusted-sender - true - - - - ParcelVoiceInfoRequest - - flavor - llsd - trusted-sender - false - - - - DisplayNameUpdate - - flavor - llsd - trusted-sender - true - - - ParcelVoiceInfo - - flavor - llsd - trusted-sender - true - - - ParcelNavigateMedia - - flavor - llsd - trusted-sender - false - - - ParcelObjectOwnersReply - - flavor - llsd - trusted-sender - true - - - ParcelProperties - - flavor - llsd - trusted-sender - true - - - LandStatReply - - flavor - llsd - trusted-sender - true - - - PlacesReply - - flavor - llsd - trusted-sender - true - - - SetDisplayNameReply - - flavor - llsd - trusted-sender - true - - - SimConsoleResponse - - flavor - llsd - trusted-sender - true - - - DirLandReply - - flavor - llsd - trusted-sender - true - - - avatarnotesrequest - - service_name - avatar-notes - builder - template - trusted-sender - false - - - avatarclassifiedsrequest - - service_name - avatar-classifieds - builder - template - trusted-sender - false - - - avatarpicksrequest - - service_name - avatar-pick - builder - template - trusted-sender - false - - - pickinforequest - - service_name - pick-info - builder - template - trusted-sender - false - - - ProvisionVoiceAccountRequest - - flavor - llsd - trusted-sender - false - - - VoiceSignalingRequest - - flavor - llsd - trusted-sender - false - - - RequiredVoiceVersion - - flavor - llsd - trusted-sender - true - - - EnableSimulator - - flavor - llsd - trusted-sender - true - - - TeleportFinish - - flavor - llsd - trusted-sender - true - - - TeleportFailed - - flavor - llsd - trusted-sender - true - - - CrossedRegion - - flavor - llsd - trusted-sender - true - - - NavMeshStatusUpdate - - flavor - llsd - trusted-sender - true - - - AgentStateUpdate - - flavor - llsd - trusted-sender - true - - - - ScriptRunningReply - - flavor - llsd - trusted-sender - false - - - LandStatReply - - flavor - llsd - trusted-sender - false - - - StartGroupProposal - - flavor - llsd - trusted-sender - false - - - FetchInventoryDescendents - - flavor - template - trusted-sender - false - - - GroupProposalBallot - - flavor - llsd - trusted-sender - false - - - RpcScriptRequestInboundForward - - flavor - llsd - trusted-sender - false - - - ObjectPhysicsProperties - - flavor - llsd - trusted-sender - true - - - - capBans - - MapLayer - false - - MapLayerGod - false - - NewFileAgentInventory - false - - UpdateGestureAgentInventory - false - - UpdateNotecardAgentInventory - false - - UpdateScriptAgentInventory - false - - UpdateGestureTaskInventory - false - - UpdateNotecardTaskInventory - false - - UpdateScriptTaskInventory - false - - ViewerStartAuction - true - - ParcelGodReserveForNewbie - true - - SendUserReport - false - - SendUserReportWithScreenshot - false - - RequestTextureDownload - true - - EventQueueGet - false - - UntrustedSimulatorMessage - false - - SendPostcard - false - - SendPostcard2 - true - - SendPostcard3 - true - - ParcelVoiceInfoRequest - false - - ChatSessionRequest - false - - ProvisionVoiceAccountRequest - false - - VoiceSignalingRequest - false - - RemoteParcelRequest - false - - SearchStatTracking - false - - ParcelPropertiesUpdate - false - - EstateChangeInfo - true - - FetchInventoryDescendents2 - false - - FetchInventory2 - false - - FetchLibDescendents2 - false - - FetchLib2 - false - - UploadBakedTexture - true - - ObjectMedia - false - - ObjectMediaNavigate - false - - - - messageBans - - trusted - - - - untrusted - - - - - maxQueuedEvents - 100 - - diff --git a/indra/newview/CMakeLists.txt b/indra/newview/CMakeLists.txt index 759a40fc08..8ed7876da1 100644 --- a/indra/newview/CMakeLists.txt +++ b/indra/newview/CMakeLists.txt @@ -1664,7 +1664,7 @@ set(viewer_APPSETTINGS_FILES app_settings/toolbars.xml app_settings/trees.xml app_settings/viewerart.xml - ${CMAKE_SOURCE_DIR}/../etc/message.xml + app_settings/message.xml ${CMAKE_SOURCE_DIR}/../scripts/messages/message_template.msg packages-info.txt featuretable.txt @@ -1758,7 +1758,7 @@ if (WINDOWS) set(COPY_INPUT_DEPENDENCIES # The following commented dependencies are determined at variably at build time. Can't do this here. - ${CMAKE_SOURCE_DIR}/../etc/message.xml + app_settings/message.xml ${CMAKE_SOURCE_DIR}/../scripts/messages/message_template.msg ${SHARED_LIB_STAGING_DIR}/openjp2.dll ${SHARED_LIB_STAGING_DIR}/llwebrtc.dll diff --git a/indra/newview/app_settings/message.xml b/indra/newview/app_settings/message.xml new file mode 100755 index 0000000000..dee3fd72dd --- /dev/null +++ b/indra/newview/app_settings/message.xml @@ -0,0 +1,751 @@ + + + + serverDefaults + + + simulator + template + + spaceserver + template + + dataserver + template + + logDataserver + template + + inventoryDataserver + template + + rpcserver + template + + mapserver + template + + viewer + template + + + messages + + + + PacketAck + + flavor + template + trusted-sender + false + + + OpenCircuit + + flavor + llsd + trusted-sender + false + + + CloseCircuit + + flavor + template + trusted-sender + false + + + StartPingCheck + + flavor + template + trusted-sender + false + + + CompletePingCheck + + flavor + template + trusted-sender + false + + + AddCircuitCode + + flavor + template + trusted-sender + true + + + UseCircuitCode + + flavor + template + trusted-sender + false + + + CreateTrustedCircuit + + flavor + template + trusted-sender + false + + + RequestTrustedCircuit + + flavor + template + trusted-sender + true + + + + ReportAutosaveCrash + + flavor + template + trusted-sender + false + + + SetCPURatio + + flavor + template + trusted-sender + false + + + + CompleteAgentMovement + + flavor + template + trusted-sender + false + + + EconomyDataRequest + + flavor + template + trusted-sender + false + + + ViewerEffect + + flavor + template + trusted-sender + false + + + RegionHandshakeReply + + flavor + template + trusted-sender + false + + + + AgentUpdate + + flavor + template + trusted-sender + false + + + + ImagePacket + + flavor + template + trusted-sender + false + + + LayerData + + flavor + template + trusted-sender + false + + + ObjectUpdateCached + + flavor + template + trusted-sender + false + + + ObjectUpdateCompressed + + flavor + template + trusted-sender + false + + + ObjectUpdate + + flavor + template + trusted-sender + false + + + ImprovedTerseObjectUpdate + + flavor + template + trusted-sender + false + + + AvatarAnimation + + flavor + template + trusted-sender + false + + + ObjectAnimation + + flavor + template + trusted-sender + false + + + AvatarAppearance + + flavor + template + trusted-sender + false + + + + GodKickUser + + flavor + llsd + trusted-sender + false + + + RoutedMoneyBalanceReply + + flavor + llsd + trusted-sender + false + + + + EdgeDataPacket + + flavor + template + trusted-sender + true + + + CoarseLocationUpdate + + flavor + template + trusted-sender + true + only-send-latest + true + + + SimulatorLoad + + flavor + template + trusted-sender + true + + + EstablishAgentCommunication + + flavor + llsd + trusted-sender + true + + + AgentGroupDataUpdate + + flavor + llsd + trusted-sender + true + + + AgentDropGroup + + flavor + llsd + trusted-sender + true + + + ChatterBoxSessionStartReply + + flavor + llsd + trusted-sender + true + + + ChatterBoxSessionEventReply + + flavor + llsd + trusted-sender + true + + + ForceCloseChatterBoxSession + + flavor + llsd + trusted-sender + true + + + ChatterBoxSessionAgentListUpdates + + flavor + llsd + trusted-sender + true + + + ChatterBoxSessionUpdate + + flavor + llsd + trusted-sender + true + + + ChatterBoxInvitation + + flavor + llsd + trusted-sender + true + + + + ParcelVoiceInfoRequest + + flavor + llsd + trusted-sender + false + + + + DisplayNameUpdate + + flavor + llsd + trusted-sender + true + + + ParcelVoiceInfo + + flavor + llsd + trusted-sender + true + + + ParcelNavigateMedia + + flavor + llsd + trusted-sender + false + + + ParcelObjectOwnersReply + + flavor + llsd + trusted-sender + true + + + ParcelProperties + + flavor + llsd + trusted-sender + true + + + LandStatReply + + flavor + llsd + trusted-sender + true + + + PlacesReply + + flavor + llsd + trusted-sender + true + + + SetDisplayNameReply + + flavor + llsd + trusted-sender + true + + + SimConsoleResponse + + flavor + llsd + trusted-sender + true + + + DirLandReply + + flavor + llsd + trusted-sender + true + + + avatarnotesrequest + + service_name + avatar-notes + builder + template + trusted-sender + false + + + avatarclassifiedsrequest + + service_name + avatar-classifieds + builder + template + trusted-sender + false + + + avatarpicksrequest + + service_name + avatar-pick + builder + template + trusted-sender + false + + + pickinforequest + + service_name + pick-info + builder + template + trusted-sender + false + + + ProvisionVoiceAccountRequest + + flavor + llsd + trusted-sender + false + + + VoiceSignalingRequest + + flavor + llsd + trusted-sender + false + + + RequiredVoiceVersion + + flavor + llsd + trusted-sender + true + + + EnableSimulator + + flavor + llsd + trusted-sender + true + + + TeleportFinish + + flavor + llsd + trusted-sender + true + + + TeleportFailed + + flavor + llsd + trusted-sender + true + + + CrossedRegion + + flavor + llsd + trusted-sender + true + + + NavMeshStatusUpdate + + flavor + llsd + trusted-sender + true + + + AgentStateUpdate + + flavor + llsd + trusted-sender + true + + + + ScriptRunningReply + + flavor + llsd + trusted-sender + false + + + LandStatReply + + flavor + llsd + trusted-sender + false + + + StartGroupProposal + + flavor + llsd + trusted-sender + false + + + FetchInventoryDescendents + + flavor + template + trusted-sender + false + + + GroupProposalBallot + + flavor + llsd + trusted-sender + false + + + RpcScriptRequestInboundForward + + flavor + llsd + trusted-sender + false + + + ObjectPhysicsProperties + + flavor + llsd + trusted-sender + true + + + + capBans + + MapLayer + false + + MapLayerGod + false + + NewFileAgentInventory + false + + UpdateGestureAgentInventory + false + + UpdateNotecardAgentInventory + false + + UpdateScriptAgentInventory + false + + UpdateGestureTaskInventory + false + + UpdateNotecardTaskInventory + false + + UpdateScriptTaskInventory + false + + ViewerStartAuction + true + + ParcelGodReserveForNewbie + true + + SendUserReport + false + + SendUserReportWithScreenshot + false + + RequestTextureDownload + true + + EventQueueGet + false + + UntrustedSimulatorMessage + false + + SendPostcard + false + + SendPostcard2 + true + + SendPostcard3 + true + + ParcelVoiceInfoRequest + false + + ChatSessionRequest + false + + ProvisionVoiceAccountRequest + false + + VoiceSignalingRequest + false + + RemoteParcelRequest + false + + SearchStatTracking + false + + ParcelPropertiesUpdate + false + + EstateChangeInfo + true + + FetchInventoryDescendents2 + false + + FetchInventory2 + false + + FetchLibDescendents2 + false + + FetchLib2 + false + + UploadBakedTexture + true + + ObjectMedia + false + + ObjectMediaNavigate + false + + + + messageBans + + trusted + + + + untrusted + + + + + maxQueuedEvents + 100 + + diff --git a/indra/newview/viewer_manifest.py b/indra/newview/viewer_manifest.py index 04c3fea93a..cf5e748513 100755 --- a/indra/newview/viewer_manifest.py +++ b/indra/newview/viewer_manifest.py @@ -63,7 +63,6 @@ class ViewerManifest(LLManifest): def construct(self): super(ViewerManifest, self).construct() self.path(src="../../scripts/messages/message_template.msg", dst="app_settings/message_template.msg") - self.path(src="../../etc/message.xml", dst="app_settings/message.xml") if self.is_packaging_viewer(): with self.prefix(src_dst="app_settings"): -- cgit v1.2.3 From 9c6fd95bdb2bfd99a01c2f2a0dadcf14d3febac0 Mon Sep 17 00:00:00 2001 From: Andrey Kleshchev <117672381+akleshchev@users.noreply.github.com> Date: Tue, 12 Aug 2025 20:35:48 +0300 Subject: Revert "Fix: ignore *pass-on* counters when detecting left-button grabs (#3990)" This reverts commit 65d70a8d8f211b462481e93f919a100c8b3b2af5. --- indra/newview/llagent.cpp | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/indra/newview/llagent.cpp b/indra/newview/llagent.cpp index 039bd4da2a..2161dbe19e 100644 --- a/indra/newview/llagent.cpp +++ b/indra/newview/llagent.cpp @@ -3469,14 +3469,11 @@ void LLAgent::initOriginGlobal(const LLVector3d &origin_global) bool LLAgent::leftButtonGrabbed() const { - if (gAgentCamera.cameraMouselook()) - { - return mControlsTakenCount[CONTROL_ML_LBUTTON_DOWN_INDEX] > 0; - } - else - { - return mControlsTakenCount[CONTROL_LBUTTON_DOWN_INDEX] > 0; - } + const bool camera_mouse_look = gAgentCamera.cameraMouselook(); + return (!camera_mouse_look && mControlsTakenCount[CONTROL_LBUTTON_DOWN_INDEX] > 0) + || (camera_mouse_look && mControlsTakenCount[CONTROL_ML_LBUTTON_DOWN_INDEX] > 0) + || (!camera_mouse_look && mControlsTakenPassedOnCount[CONTROL_LBUTTON_DOWN_INDEX] > 0) + || (camera_mouse_look && mControlsTakenPassedOnCount[CONTROL_ML_LBUTTON_DOWN_INDEX] > 0); } bool LLAgent::rotateGrabbed() const -- cgit v1.2.3 From 8145d99f80d55c4da88adb6909386bd5c25fd743 Mon Sep 17 00:00:00 2001 From: fmartian Date: Wed, 13 Aug 2025 15:25:37 +0200 Subject: #4519 Check for "://" as schema separator in a SLURL Check for "://" as schema separator when testing if the passed in address contains a schema. A ':' alone could also indicate a port separator as part of the hostname and throw off the parsing. (#4543) --- indra/newview/llslurl.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/indra/newview/llslurl.cpp b/indra/newview/llslurl.cpp index 9e567e3262..6238a1145c 100644 --- a/indra/newview/llslurl.cpp +++ b/indra/newview/llslurl.cpp @@ -71,10 +71,10 @@ LLSLURL::LLSLURL(const std::string& slurl) { LLURI slurl_uri; // parse the slurl as a uri - if (slurl.find(':') == std::string::npos) + if (slurl.find("://") == std::string::npos) { - // There may be no scheme ('secondlife:' etc.) passed in. In that case - // we want to normalize the slurl by putting the appropriate scheme + // There may be no scheme ('secondlife://', 'https://' etc.) passed in. In that + // case we want to normalize the slurl by putting the appropriate scheme // in front of the slurl. So, we grab the appropriate slurl base // from the grid manager which may be http://slurl.com/secondlife/ for maingrid, or // https:///region/ for Standalone grid (the word region, not the region name) -- cgit v1.2.3 From 4c65a43e1700f0a669006b08b1f4f10293f2e947 Mon Sep 17 00:00:00 2001 From: Brad Linden <46733234+brad-linden@users.noreply.github.com> Date: Thu, 14 Aug 2025 09:47:22 -0700 Subject: CMake 4.10 compatibility fixes (#4548) --- autobuild.xml | 18 +++++++++--------- indra/newview/CMakeLists.txt | 25 ++++++++++--------------- 2 files changed, 19 insertions(+), 24 deletions(-) diff --git a/autobuild.xml b/autobuild.xml index f792bac789..1d75fe5043 100644 --- a/autobuild.xml +++ b/autobuild.xml @@ -1435,11 +1435,11 @@ creds github hash - 9e59c93c7110e87b4ff3db330f11a23c50e5000f + 7facda95e2f00c260513f3d4db42588fa8ba703c hash_algorithm sha1 url - https://api.github.com/repos/secondlife/llphysicsextensions_source/releases/assets/178910560 + https://api.github.com/repos/secondlife/llphysicsextensions_source/releases/assets/196289774 name darwin64 @@ -1451,11 +1451,11 @@ creds github hash - 7ed994db5bafa9a7ad09a1b53da850a84715c65e + 01d08f13c7bc8d1b95b0330fa6833b7d8274e4d0 hash_algorithm sha1 url - https://api.github.com/repos/secondlife/llphysicsextensions_source/releases/assets/178910561 + https://api.github.com/repos/secondlife/llphysicsextensions_source/releases/assets/196289775 name linux64 @@ -1467,24 +1467,24 @@ creds github hash - 66824c02e0e5eabbfbe37bfb173360195f89697c + 6d00345c7d3471bc5f7c1218e014dd0f1a2c069b hash_algorithm sha1 url - https://api.github.com/repos/secondlife/llphysicsextensions_source/releases/assets/178910562 + https://api.github.com/repos/secondlife/llphysicsextensions_source/releases/assets/196289778 name windows64 + copyright + Copyright (c) 2010, Linden Research, Inc. license internal license_file LICENSES/llphysicsextensions.txt - copyright - Copyright (c) 2010, Linden Research, Inc. version - 1.0.66e6919 + 1.0.11137145495 name llphysicsextensions_source diff --git a/indra/newview/CMakeLists.txt b/indra/newview/CMakeLists.txt index 1315baf740..62af812971 100644 --- a/indra/newview/CMakeLists.txt +++ b/indra/newview/CMakeLists.txt @@ -1420,7 +1420,7 @@ file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/viewer_version.txt" "${VIEWER_SHORT_VERSION}.${VIEWER_VERSION_REVISION}\n") set_source_files_properties( - llversioninfo.cpp tests/llversioninfo_test.cpp + llversioninfo.cpp tests/llversioninfo_test.cpp PROPERTIES COMPILE_DEFINITIONS "${VIEWER_CHANNEL_VERSION_DEFINES}" # see BuildVersion.cmake ) @@ -1635,7 +1635,7 @@ endif (WINDOWS) file(GLOB_RECURSE viewer_XUI_FILES LIST_DIRECTORIES FALSE ${CMAKE_CURRENT_SOURCE_DIR}/skins/*.xml) source_group(TREE ${CMAKE_CURRENT_SOURCE_DIR}/skins PREFIX "XUI Files" FILES ${viewer_XUI_FILES}) -set_source_files_properties(${viewer_XUI_FILES} +set_source_files_properties(${viewer_XUI_FILES} PROPERTIES HEADER_FILE_ONLY TRUE) list(APPEND viewer_SOURCE_FILES ${viewer_XUI_FILES}) @@ -1643,7 +1643,7 @@ list(APPEND viewer_SOURCE_FILES ${viewer_XUI_FILES}) file(GLOB_RECURSE viewer_SHADER_FILES LIST_DIRECTORIES FALSE ${CMAKE_CURRENT_SOURCE_DIR}/app_settings/shaders/*.glsl) source_group(TREE ${CMAKE_CURRENT_SOURCE_DIR}/app_settings/shaders PREFIX "Shaders" FILES ${viewer_SHADER_FILES}) -set_source_files_properties(${viewer_SHADER_FILES} +set_source_files_properties(${viewer_SHADER_FILES} PROPERTIES HEADER_FILE_ONLY TRUE) list(APPEND viewer_SOURCE_FILES ${viewer_SHADER_FILES}) @@ -1970,7 +1970,7 @@ endif (WINDOWS) # one of these being libz where you can find four or more versions in play # at once. On Linux, libz can be found at link and run time via a number # of paths: -# +# # => -lfreetype # => libz.so.1 (on install machine, not build) # => -lSDL @@ -2046,7 +2046,7 @@ foreach(elem ${country_codes}) set(emoji_mapping_src_file "${emoji_mapping_src_folder}/${elem}/emoji_characters.xml") set(emoji_mapping_dst_file - "${emoji_mapping_dst_folder}/${elem}/emoji_characters.xml") + "${emoji_mapping_dst_folder}/${elem}/emoji_characters.xml") configure_file(${emoji_mapping_src_file} ${emoji_mapping_dst_file} COPYONLY) endforeach() @@ -2148,7 +2148,7 @@ if (DARWIN) # https://blog.kitware.com/upcoming-in-cmake-2-8-12-osx-rpath-support/ set(CMAKE_MACOSX_RPATH 1) - + set_target_properties( ${VIEWER_BINARY_NAME} PROPERTIES @@ -2191,9 +2191,6 @@ if (DARWIN) --grid=${GRID} --source=${CMAKE_CURRENT_SOURCE_DIR} --versionfile=${CMAKE_CURRENT_BINARY_DIR}/viewer_version.txt - DEPENDS - ${VIEWER_BINARY_NAME} - ${CMAKE_CURRENT_SOURCE_DIR}/viewer_manifest.py ) add_dependencies(${VIEWER_BINARY_NAME} SLPlugin media_plugin_libvlc media_plugin_cef) @@ -2228,8 +2225,6 @@ if (DARWIN) --touch=${CMAKE_CURRENT_BINARY_DIR}/$,$,>/.${product}.bat --versionfile=${CMAKE_CURRENT_BINARY_DIR}/viewer_version.txt ${SIGNING_SETTING} - DEPENDS - ${CMAKE_CURRENT_SOURCE_DIR}/viewer_manifest.py ) endif (PACKAGE) endif (DARWIN) @@ -2269,7 +2264,7 @@ if (PACKAGE AND (RELEASE_CRASH_REPORTING OR NON_RELEASE_CRASH_REPORTING) AND VIE PROPERTIES XCODE_ATTRIBUTE_DEBUG_INFORMATION_FORMAT "dwarf-with-dsym" XCODE_ATTRIBUTE_DWARF_DSYM_FOLDER_PATH "${SYMBOLS_STAGING_DIR}/dSYMs") - + add_custom_command(OUTPUT "${VIEWER_APP_XCARCHIVE}" COMMAND "zip" ARGS @@ -2304,7 +2299,7 @@ if (LL_TESTS) # llremoteparcelrequest.cpp llviewerhelputil.cpp llversioninfo.cpp -# llvocache.cpp +# llvocache.cpp llworldmap.cpp llworldmipmap.cpp ) @@ -2313,7 +2308,7 @@ if (LL_TESTS) llworldmap.cpp llworldmipmap.cpp PROPERTIES - LL_TEST_ADDITIONAL_SOURCE_FILES + LL_TEST_ADDITIONAL_SOURCE_FILES tests/llviewertexture_stub.cpp #llviewertexturelist.cpp ) @@ -2347,7 +2342,7 @@ if (LL_TESTS) llworldmap.cpp llworldmipmap.cpp PROPERTIES - LL_TEST_ADDITIONAL_SOURCE_FILES + LL_TEST_ADDITIONAL_SOURCE_FILES tests/llviewertexture_stub.cpp ) -- cgit v1.2.3 From 68d3d5cd739693dd0bf42c93c02673e2dd74accc Mon Sep 17 00:00:00 2001 From: Signal Linden Date: Fri, 15 Aug 2025 19:57:55 -0700 Subject: Remove unused vstool, files (#4500) Clean up of some unused files: - vstool - No longer used - indra/edit-me-to-trigger-new-build.txt - Shouldn't be needed... - win_crash_logger/* - Empty directory --- .gitattributes | 3 - indra/edit-me-to-trigger-new-build.txt | 1 - indra/tools/vstool/DispatchUtility.cs | 271 ------------ indra/tools/vstool/README.txt | 9 - indra/tools/vstool/VSTool.csproj | 98 ----- indra/tools/vstool/VSTool.exe | Bin 24576 -> 0 bytes indra/tools/vstool/VSTool.sln | 19 - indra/tools/vstool/app.config | 3 - indra/tools/vstool/main.cs | 733 --------------------------------- indra/win_crash_logger/README.txt | 3 - 10 files changed, 1140 deletions(-) delete mode 100644 indra/edit-me-to-trigger-new-build.txt delete mode 100644 indra/tools/vstool/DispatchUtility.cs delete mode 100644 indra/tools/vstool/README.txt delete mode 100755 indra/tools/vstool/VSTool.csproj delete mode 100755 indra/tools/vstool/VSTool.exe delete mode 100755 indra/tools/vstool/VSTool.sln delete mode 100644 indra/tools/vstool/app.config delete mode 100755 indra/tools/vstool/main.cs delete mode 100644 indra/win_crash_logger/README.txt diff --git a/.gitattributes b/.gitattributes index 30cc9de8f1..5c7f5b73b0 100644 --- a/.gitattributes +++ b/.gitattributes @@ -1,8 +1,5 @@ * text eol=lf -# VSTool (normalization disabled) -indra/tools/vstool/* -text - # Images *.bmp binary *.BMP binary diff --git a/indra/edit-me-to-trigger-new-build.txt b/indra/edit-me-to-trigger-new-build.txt deleted file mode 100644 index 8b13789179..0000000000 --- a/indra/edit-me-to-trigger-new-build.txt +++ /dev/null @@ -1 +0,0 @@ - diff --git a/indra/tools/vstool/DispatchUtility.cs b/indra/tools/vstool/DispatchUtility.cs deleted file mode 100644 index 6056ac55a1..0000000000 --- a/indra/tools/vstool/DispatchUtility.cs +++ /dev/null @@ -1,271 +0,0 @@ -#region Using Directives - -using System; -using System.Collections.Generic; -using System.Text; -using System.Runtime.InteropServices; -using System.Reflection; -using System.Security.Permissions; - -#endregion - -namespace TestDispatchUtility -{ - ///

- /// Provides helper methods for working with COM IDispatch objects that have a registered type library. - /// - public static class DispatchUtility - { - #region Private Constants - - private const int S_OK = 0; //From WinError.h - private const int LOCALE_SYSTEM_DEFAULT = 2 << 10; //From WinNT.h == 2048 == 0x800 - - #endregion - - #region Public Methods - - /// - /// Gets whether the specified object implements IDispatch. - /// - /// An object to check. - /// True if the object implements IDispatch. False otherwise. - public static bool ImplementsIDispatch(object obj) - { - bool result = obj is IDispatchInfo; - return result; - } - - /// - /// Gets a Type that can be used with reflection. - /// - /// An object that implements IDispatch. - /// Whether an exception should be thrown if a Type can't be obtained. - /// A .NET Type that can be used with reflection. - /// If doesn't implement IDispatch. - [SecurityPermission(SecurityAction.LinkDemand, Flags = SecurityPermissionFlag.UnmanagedCode)] - public static Type GetType(object obj, bool throwIfNotFound) - { - RequireReference(obj, "obj"); - Type result = GetType((IDispatchInfo)obj, throwIfNotFound); - return result; - } - - /// - /// Tries to get the DISPID for the requested member name. - /// - /// An object that implements IDispatch. - /// The name of a member to lookup. - /// If the method returns true, this holds the DISPID on output. - /// If the method returns false, this value should be ignored. - /// True if the member was found and resolved to a DISPID. False otherwise. - /// If doesn't implement IDispatch. - [SecurityPermission(SecurityAction.LinkDemand, Flags = SecurityPermissionFlag.UnmanagedCode)] - public static bool TryGetDispId(object obj, string name, out int dispId) - { - RequireReference(obj, "obj"); - bool result = TryGetDispId((IDispatchInfo)obj, name, out dispId); - return result; - } - - /// - /// Invokes a member by DISPID. - /// - /// An object that implements IDispatch. - /// The DISPID of a member. This can be obtained using - /// . - /// The arguments to pass to the member. - /// The member's return value. - /// - /// This can invoke a method or a property get accessor. - /// - public static object Invoke(object obj, int dispId, object[] args) - { - string memberName = "[DispId=" + dispId + "]"; - object result = Invoke(obj, memberName, args); - return result; - } - - /// - /// Invokes a member by name. - /// - /// An object. - /// The name of the member to invoke. - /// The arguments to pass to the member. - /// The member's return value. - /// - /// This can invoke a method or a property get accessor. - /// - public static object Invoke(object obj, string memberName, object[] args) - { - RequireReference(obj, "obj"); - Type type = obj.GetType(); - object result = type.InvokeMember(memberName, BindingFlags.InvokeMethod | BindingFlags.GetProperty, - null, obj, args, null); - return result; - } - - #endregion - - #region Private Methods - - /// - /// Requires that the value is non-null. - /// - /// The type of the value. - /// The value to check. - /// The name of the value. - private static void RequireReference(T value, string name) where T : class - { - if (value == null) - { - throw new ArgumentNullException(name); - } - } - - /// - /// Gets a Type that can be used with reflection. - /// - /// An object that implements IDispatch. - /// Whether an exception should be thrown if a Type can't be obtained. - /// A .NET Type that can be used with reflection. - private static Type GetType(IDispatchInfo dispatch, bool throwIfNotFound) - { - RequireReference(dispatch, "dispatch"); - - Type result = null; - int typeInfoCount; - int hr = dispatch.GetTypeInfoCount(out typeInfoCount); - if (hr == S_OK && typeInfoCount > 0) - { - // Type info isn't usually culture-aware for IDispatch, so we might as well pass - // the default locale instead of looking up the current thread's LCID each time - // (via CultureInfo.CurrentCulture.LCID). - dispatch.GetTypeInfo(0, LOCALE_SYSTEM_DEFAULT, out result); - } - - if (result == null && throwIfNotFound) - { - // If the GetTypeInfoCount called failed, throw an exception for that. - Marshal.ThrowExceptionForHR(hr); - - // Otherwise, throw the same exception that Type.GetType would throw. - throw new TypeLoadException(); - } - - return result; - } - - /// - /// Tries to get the DISPID for the requested member name. - /// - /// An object that implements IDispatch. - /// The name of a member to lookup. - /// If the method returns true, this holds the DISPID on output. - /// If the method returns false, this value should be ignored. - /// True if the member was found and resolved to a DISPID. False otherwise. - private static bool TryGetDispId(IDispatchInfo dispatch, string name, out int dispId) - { - RequireReference(dispatch, "dispatch"); - RequireReference(name, "name"); - - bool result = false; - - // Members names aren't usually culture-aware for IDispatch, so we might as well - // pass the default locale instead of looking up the current thread's LCID each time - // (via CultureInfo.CurrentCulture.LCID). - Guid iidNull = Guid.Empty; - int hr = dispatch.GetDispId(ref iidNull, ref name, 1, LOCALE_SYSTEM_DEFAULT, out dispId); - - const int DISP_E_UNKNOWNNAME = unchecked((int)0x80020006); //From WinError.h - const int DISPID_UNKNOWN = -1; //From OAIdl.idl - if (hr == S_OK) - { - result = true; - } - else if (hr == DISP_E_UNKNOWNNAME && dispId == DISPID_UNKNOWN) - { - // This is the only supported "error" case because it means IDispatch - // is saying it doesn't know the member we asked about. - result = false; - } - else - { - // The other documented result codes are all errors. - Marshal.ThrowExceptionForHR(hr); - } - - return result; - } - - #endregion - - #region Private Interfaces - - /// - /// A partial declaration of IDispatch used to lookup Type information and DISPIDs. - /// - /// - /// This interface only declares the first three methods of IDispatch. It omits the - /// fourth method (Invoke) because there are already plenty of ways to do dynamic - /// invocation in .NET. But the first three methods provide dynamic type metadata - /// discovery, which .NET doesn't provide normally if you have a System.__ComObject - /// RCW instead of a strongly-typed RCW. - /// - /// Note: The original declaration of IDispatch is in OAIdl.idl. - /// - [ComImport] - [InterfaceType(ComInterfaceType.InterfaceIsIUnknown)] - [Guid("00020400-0000-0000-C000-000000000046")] - private interface IDispatchInfo - { - /// - /// Gets the number of Types that the object provides (0 or 1). - /// - /// Returns 0 or 1 for the number of Types provided by . - /// - /// http://msdn.microsoft.com/en-us/library/da876d53-cb8a-465c-a43e-c0eb272e2a12(VS.85) - /// - [PreserveSig] - int GetTypeInfoCount(out int typeInfoCount); - - /// - /// Gets the Type information for an object if returned 1. - /// - /// Must be 0. - /// Typically, LOCALE_SYSTEM_DEFAULT (2048). - /// Returns the object's Type information. - /// - /// http://msdn.microsoft.com/en-us/library/cc1ec9aa-6c40-4e70-819c-a7c6dd6b8c99(VS.85) - /// - void GetTypeInfo(int typeInfoIndex, int lcid, [MarshalAs(UnmanagedType.CustomMarshaler, - MarshalTypeRef = typeof(System.Runtime.InteropServices.CustomMarshalers.TypeToTypeInfoMarshaler))] out Type typeInfo); - - /// - /// Gets the DISPID of the specified member name. - /// - /// Must be IID_NULL. Pass a copy of Guid.Empty. - /// The name of the member to look up. - /// Must be 1. - /// Typically, LOCALE_SYSTEM_DEFAULT (2048). - /// If a member with the requested - /// is found, this returns its DISPID and the method's return value is 0. - /// If the method returns a non-zero value, then this parameter's output value is - /// undefined. - /// Zero for success. Non-zero for failure. - /// - /// http://msdn.microsoft.com/en-us/library/6f6cf233-3481-436e-8d6a-51f93bf91619(VS.85) - /// - [PreserveSig] - int GetDispId(ref Guid riid, ref string name, int nameCount, int lcid, out int dispId); - - // NOTE: The real IDispatch also has an Invoke method next, but we don't need it. - // We can invoke methods using .NET's Type.InvokeMember method with the special - // [DISPID=n] syntax for member "names", or we can get a .NET Type using GetTypeInfo - // and invoke methods on that through reflection. - // Type.InvokeMember: http://msdn.microsoft.com/en-us/library/de3dhzwy.aspx - } - - #endregion - } -} diff --git a/indra/tools/vstool/README.txt b/indra/tools/vstool/README.txt deleted file mode 100644 index e419180031..0000000000 --- a/indra/tools/vstool/README.txt +++ /dev/null @@ -1,9 +0,0 @@ -VSTool is a command line utility to manipulate VisualStudio settings. - -The windows cmake project configuration uses VSTool.exe - -A handy upgrade: - figure out how to make cmake build this csharp app - - or write the app using script (jscript?!?) so it doesn't need to be built. - - diff --git a/indra/tools/vstool/VSTool.csproj b/indra/tools/vstool/VSTool.csproj deleted file mode 100755 index 7f431e85c7..0000000000 --- a/indra/tools/vstool/VSTool.csproj +++ /dev/null @@ -1,98 +0,0 @@ - - - - Local - 8.0.50727 - 2.0 - {96943E2D-1373-4617-A117-D0F997A94919} - Debug - AnyCPU - - - - - VSTool - - - JScript - Grid - IE50 - false - Exe - VSTool - Always - VSTool.VSToolMain - - - - - v2.0 - 2.0 - - - .\ - false - 285212672 - false - - - DEBUG;TRACE - - - true - 4096 - false - - - false - false - false - false - 4 - full - prompt - - - .\ - false - 285212672 - false - - - TRACE - - - false - 4096 - false - - - true - false - false - false - 4 - none - prompt - - - - System - - - System.Data - - - - - Code - - - - - - - - - - \ No newline at end of file diff --git a/indra/tools/vstool/VSTool.exe b/indra/tools/vstool/VSTool.exe deleted file mode 100755 index 751540413a..0000000000 Binary files a/indra/tools/vstool/VSTool.exe and /dev/null differ diff --git a/indra/tools/vstool/VSTool.sln b/indra/tools/vstool/VSTool.sln deleted file mode 100755 index 21e3d75971..0000000000 --- a/indra/tools/vstool/VSTool.sln +++ /dev/null @@ -1,19 +0,0 @@ -Microsoft Visual Studio Solution File, Format Version 11.00 -# Visual Studio 2010 -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "VSTool", "VSTool.csproj", "{96943E2D-1373-4617-A117-D0F997A94919}" -EndProject -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|Any CPU = Debug|Any CPU - Release|Any CPU = Release|Any CPU - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {96943E2D-1373-4617-A117-D0F997A94919}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {96943E2D-1373-4617-A117-D0F997A94919}.Debug|Any CPU.Build.0 = Debug|Any CPU - {96943E2D-1373-4617-A117-D0F997A94919}.Release|Any CPU.ActiveCfg = Release|Any CPU - {96943E2D-1373-4617-A117-D0F997A94919}.Release|Any CPU.Build.0 = Release|Any CPU - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection -EndGlobal diff --git a/indra/tools/vstool/app.config b/indra/tools/vstool/app.config deleted file mode 100644 index 8494f728ff..0000000000 --- a/indra/tools/vstool/app.config +++ /dev/null @@ -1,3 +0,0 @@ - - - diff --git a/indra/tools/vstool/main.cs b/indra/tools/vstool/main.cs deleted file mode 100755 index 1d6b2f14d1..0000000000 --- a/indra/tools/vstool/main.cs +++ /dev/null @@ -1,733 +0,0 @@ -// Code about getting running instances visual studio -// was borrowed from -// http://www.codeproject.com/KB/cs/automatingvisualstudio.aspx - - -using System; -using System.Collections; -using System.Collections.Generic; -using System.Reflection; -using System.Runtime.InteropServices; -using System.Runtime.InteropServices.ComTypes; -using Microsoft.CSharp; - -namespace VSTool -{ - // The MessageFilter class comes from: - // http://msdn.microsoft.com/en-us/library/ms228772(VS.80).aspx - // It allows vstool to get timing error messages from - // visualstudio and handle them. - public class MessageFilter : IOleMessageFilter - { - // - // Class containing the IOleMessageFilter - // thread error-handling functions. - - // Start the filter. - public static void Register() - { - IOleMessageFilter newFilter = new MessageFilter(); - IOleMessageFilter oldFilter = null; - CoRegisterMessageFilter(newFilter, out oldFilter); - } - - // Done with the filter, close it. - public static void Revoke() - { - IOleMessageFilter oldFilter = null; - CoRegisterMessageFilter(null, out oldFilter); - } - - // - // IOleMessageFilter functions. - // Handle incoming thread requests. - int IOleMessageFilter.HandleInComingCall(int dwCallType, - System.IntPtr hTaskCaller, int dwTickCount, System.IntPtr - lpInterfaceInfo) - { - //Return the flag SERVERCALL_ISHANDLED. - return 0; - } - - // Thread call was rejected, so try again. - int IOleMessageFilter.RetryRejectedCall(System.IntPtr - hTaskCallee, int dwTickCount, int dwRejectType) - { - if (dwRejectType == 2) - // flag = SERVERCALL_RETRYLATER. - { - // Retry the thread call immediately if return >=0 & - // <100. - return 99; - } - // Too busy; cancel call. - return -1; - } - - int IOleMessageFilter.MessagePending(System.IntPtr hTaskCallee, - int dwTickCount, int dwPendingType) - { - //Return the flag PENDINGMSG_WAITDEFPROCESS. - return 2; - } - - // Implement the IOleMessageFilter interface. - [DllImport("Ole32.dll")] - private static extern int - CoRegisterMessageFilter(IOleMessageFilter newFilter, out - IOleMessageFilter oldFilter); - } - - [ComImport(), Guid("00000016-0000-0000-C000-000000000046"), - InterfaceTypeAttribute(ComInterfaceType.InterfaceIsIUnknown)] - interface IOleMessageFilter - { - [PreserveSig] - int HandleInComingCall( - int dwCallType, - IntPtr hTaskCaller, - int dwTickCount, - IntPtr lpInterfaceInfo); - - [PreserveSig] - int RetryRejectedCall( - IntPtr hTaskCallee, - int dwTickCount, - int dwRejectType); - - [PreserveSig] - int MessagePending( - IntPtr hTaskCallee, - int dwTickCount, - int dwPendingType); - } - - class ViaCOM - { - public static object GetProperty(object from_obj, string prop_name) - { - try - { - Type objType = from_obj.GetType(); - return objType.InvokeMember( - prop_name, - BindingFlags.GetProperty, null, - from_obj, - null); - } - catch (Exception e) - { - Console.WriteLine("Error getting property: \"{0}\"", prop_name); - Console.WriteLine(e.Message); - throw e; - } - } - - public static object SetProperty(object from_obj, string prop_name, object new_value) - { - try - { - object[] args = { new_value }; - Type objType = from_obj.GetType(); - return objType.InvokeMember( - prop_name, - BindingFlags.DeclaredOnly | - BindingFlags.Public | - BindingFlags.NonPublic | - BindingFlags.Instance | - BindingFlags.SetProperty, - null, - from_obj, - args); - } - catch (Exception e) - { - Console.WriteLine("Error setting property: \"{0}\"", prop_name); - Console.WriteLine(e.Message); - throw e; - } - } - - public static object CallMethod(object from_obj, string method_name, params object[] args) - { - try - { - Type objType = from_obj.GetType(); - return objType.InvokeMember( - method_name, - BindingFlags.DeclaredOnly | - BindingFlags.Public | - BindingFlags.NonPublic | - BindingFlags.Instance | - BindingFlags.InvokeMethod, - null, - from_obj, - args); - } - catch (Exception e) - { - Console.WriteLine("Error calling method \"{0}\"", method_name); - Console.WriteLine(e.Message); - throw e; - } - } - }; - - /// - /// The main entry point class for VSTool. - /// - class VSToolMain - { - #region Interop imports - [DllImport("ole32.dll")] - public static extern int GetRunningObjectTable(int reserved, out IRunningObjectTable prot); - - [DllImport("ole32.dll")] - public static extern int CreateBindCtx(int reserved, out IBindCtx ppbc); - #endregion - - static System.Boolean ignore_case = true; - - static string solution_name = null; - static bool use_new_vs = false; - static Hashtable projectDict = new Hashtable(); - static string startup_project = null; - static string config = null; - - static object dte = null; - static object solution = null; - - /// - /// The main entry point for the application. - /// - [STAThread] - static int Main(string[] args) - { - int retVal = 0; - bool need_save = false; - - try - { - parse_command_line(args); - - Console.WriteLine("Editing solution: {0}", solution_name); - - bool found_open_solution = GetDTEAndSolution(); - - if (dte == null || solution == null) - { - retVal = 1; - } - else - { - MessageFilter.Register(); - - // Walk through all of the projects in the solution - // and list the type of each project. - foreach (DictionaryEntry p in projectDict) - { - string project_name = (string)p.Key; - string working_dir = (string)p.Value; - if (SetProjectWorkingDir(solution, project_name, working_dir)) - { - need_save = true; - } - } - - if (config != null) - { - need_save = SetActiveConfig(config); - } - - if (startup_project != null) - { - need_save = SetStartupProject(startup_project); - } - - if (need_save) - { - if (found_open_solution == false) - { - ViaCOM.CallMethod(solution, "Close", null); - } - } - } - } - catch (Exception e) - { - Console.WriteLine(e.Message); - retVal = 1; - } - finally - { - if (solution != null) - { - Marshal.ReleaseComObject(solution); - solution = null; - } - - if (dte != null) - { - Marshal.ReleaseComObject(dte); - dte = null; - } - - MessageFilter.Revoke(); - } - return retVal; - } - - public static bool parse_command_line(string[] args) - { - string options_desc = - "--solution : MSVC solution name. (required)\n" + - "--use_new_vs : Ignore running versions of visual studio.\n" + - "--workingdir : Set working dir of a VC project.\n" + - "--config : Set the active config for the solution.\n" + - "--startup : Set the startup project for the solution.\n"; - - try - { - // Command line param parsing loop. - int i = 0; - for (; i < args.Length; ++i) - { - if ("--solution" == args[i]) - { - if (solution_name != null) - { - throw new ApplicationException("Found second --solution option"); - } - solution_name = args[++i]; - } - else if ("--use_new_vs" == args[i]) - { - use_new_vs = true; - } - - else if ("--workingdir" == args[i]) - { - string project_name = args[++i]; - string working_dir = args[++i]; - projectDict.Add(project_name, working_dir); - } - else if ("--config" == args[i]) - { - if (config != null) - { - throw new ApplicationException("Found second --config option"); - } - config = args[++i]; - } - else if ("--startup" == args[i]) - { - if (startup_project != null) - { - throw new ApplicationException("Found second --startup option"); - } - startup_project = args[++i]; - } - else - { - throw new ApplicationException("Found unrecognized token on command line: " + args[i]); - } - } - - if (solution_name == null) - { - throw new ApplicationException("The --solution option is required."); - } - } - catch(ApplicationException e) - { - - Console.WriteLine("Oops! " + e.Message); - Console.Write("Command line:"); - foreach (string arg in args) - { - Console.Write(" " + arg); - } - Console.Write("\n\n"); - Console.WriteLine("VSTool command line usage"); - Console.Write(options_desc); - throw e; - } - return true; - } - - public static bool GetDTEAndSolution() - { - bool found_open_solution = true; - - Console.WriteLine("Looking for existing VisualStudio instance..."); - - // Get an instance of the currently running Visual Studio .NET IDE. - // dte = (EnvDTE.DTE)System.Runtime.InteropServices.Marshal.GetActiveObject("VisualStudio.DTE.7.1"); - string full_solution_name = System.IO.Path.GetFullPath(solution_name); - if (false == use_new_vs) - { - dte = GetIDEInstance(full_solution_name); - } - - if (dte == null) - { - try - { - Console.WriteLine(" Didn't find open solution, starting new background VisualStudio instance..."); - Console.WriteLine(" Reading .sln file version..."); - string version = GetSolutionVersion(full_solution_name); - - Console.WriteLine(" Using version: {0}...", version); - string progid = GetVSProgID(version); - - Type objType = Type.GetTypeFromProgID(progid); - dte = System.Activator.CreateInstance(objType); - Console.WriteLine(" Reading solution: \"{0}\"", full_solution_name); - - solution = ViaCOM.GetProperty(dte, "Solution"); - object[] openArgs = { full_solution_name }; - ViaCOM.CallMethod(solution, "Open", openArgs); - } - catch (Exception e) - { - Console.WriteLine(e.Message); - Console.WriteLine("Quitting do to error opening: {0}", full_solution_name); - solution = null; - dte = null; - return found_open_solution; - } - found_open_solution = false; - } - - if (solution == null) - { - solution = ViaCOM.GetProperty(dte, "Solution"); - } - - return found_open_solution; - } - - /// - /// Get the DTE object for the instance of Visual Studio IDE that has - /// the specified solution open. - /// - /// The absolute filename of the solution - /// Corresponding DTE object or null if no such IDE is running - public static object GetIDEInstance( string solutionFile ) - { - Hashtable runningInstances = GetIDEInstances( true ); - IDictionaryEnumerator enumerator = runningInstances.GetEnumerator(); - - while ( enumerator.MoveNext() ) - { - try - { - object ide = enumerator.Value; - if (ide != null) - { - object sol = ViaCOM.GetProperty(ide, "Solution"); - if (0 == string.Compare((string)ViaCOM.GetProperty(sol, "FullName"), solutionFile, ignore_case)) - { - return ide; - } - } - } - catch{} - } - - return null; - } - - /// - /// Get a table of the currently running instances of the Visual Studio .NET IDE. - /// - /// Only return instances that have opened a solution - /// A hashtable mapping the name of the IDE in the running object table to the corresponding DTE object - public static Hashtable GetIDEInstances( bool openSolutionsOnly ) - { - Hashtable runningIDEInstances = new Hashtable(); - Hashtable runningObjects = GetRunningObjectTable(); - - IDictionaryEnumerator rotEnumerator = runningObjects.GetEnumerator(); - while ( rotEnumerator.MoveNext() ) - { - string candidateName = (string) rotEnumerator.Key; - if (!candidateName.StartsWith("!VisualStudio.DTE")) - continue; - - object ide = rotEnumerator.Value; - if (ide == null) - continue; - - if (openSolutionsOnly) - { - try - { - object sol = ViaCOM.GetProperty(ide, "Solution"); - string solutionFile = (string)ViaCOM.GetProperty(sol, "FullName"); - if (solutionFile != String.Empty) - { - runningIDEInstances[ candidateName ] = ide; - } - } - catch {} - } - else - { - runningIDEInstances[ candidateName ] = ide; - } - } - return runningIDEInstances; - } - - /// - /// Get a snapshot of the running object table (ROT). - /// - /// A hashtable mapping the name of the object in the ROT to the corresponding object - [STAThread] - public static Hashtable GetRunningObjectTable() - { - Hashtable result = new Hashtable(); - - int numFetched = 0; - IRunningObjectTable runningObjectTable; - IEnumMoniker monikerEnumerator; - IMoniker[] monikers = new IMoniker[1]; - - GetRunningObjectTable(0, out runningObjectTable); - runningObjectTable.EnumRunning(out monikerEnumerator); - monikerEnumerator.Reset(); - - while (monikerEnumerator.Next(1, monikers, new IntPtr(numFetched)) == 0) - { - IBindCtx ctx; - CreateBindCtx(0, out ctx); - - string runningObjectName; - monikers[0].GetDisplayName(ctx, null, out runningObjectName); - - object runningObjectVal; - runningObjectTable.GetObject( monikers[0], out runningObjectVal); - - result[ runningObjectName ] = runningObjectVal; - } - - return result; - } - - public static string GetSolutionVersion(string solutionFullFileName) - { - string version; - System.IO.StreamReader solutionStreamReader = null; - string firstLine; - string format; - - try - { - solutionStreamReader = new System.IO.StreamReader(solutionFullFileName); - do - { - firstLine = solutionStreamReader.ReadLine(); - } - while (firstLine == ""); - - format = firstLine.Substring(firstLine.LastIndexOf(" ")).Trim(); - - switch(format) - { - case "7.00": - version = "VC70"; - break; - - case "8.00": - version = "VC71"; - break; - - case "9.00": - version = "VC80"; - break; - - case "10.00": - version = "VC90"; - break; - - case "11.00": - version = "VC100"; - break; - - case "12.00": - version = "VC150"; - break; - - default: - throw new ApplicationException("Unknown .sln version: " + format); - } - } - finally - { - if(solutionStreamReader != null) - { - solutionStreamReader.Close(); - } - } - - return version; - } - - public static string GetVSProgID(string version) - { - string progid = null; - switch(version) - { - case "VC70": - progid = "VisualStudio.DTE.7"; - break; - - case "VC71": - progid = "VisualStudio.DTE.7.1"; - break; - - case "VC80": - progid = "VisualStudio.DTE.8.0"; - break; - - case "VC90": - progid = "VisualStudio.DTE.9.0"; - break; - - case "VC100": - progid = "VisualStudio.DTE.10.0"; - break; - - case "VC120": - progid = "VisualStudio.DTE.12.0"; - break; - - case "VC150": - progid = "VisualStudio.DTE.15.0"; - break; - - default: - throw new ApplicationException("Can't handle VS version: " + version); - } - - return progid; - } - - public static bool SetProjectWorkingDir(object sol, string project_name, string working_dir) - { - bool made_change = false; - Console.WriteLine("Looking for project {0}...", project_name); - try - { - object prjs = ViaCOM.GetProperty(sol, "Projects"); - object count = ViaCOM.GetProperty(prjs, "Count"); - for(int i = 1; i <= (int)count; ++i) - { - object[] prjItemArgs = { (object)i }; - object prj = ViaCOM.CallMethod(prjs, "Item", prjItemArgs); - string name = (string)ViaCOM.GetProperty(prj, "Name"); - if (0 == string.Compare(name, project_name, ignore_case)) - { - Console.WriteLine("Found project: {0}", project_name); - Console.WriteLine("Setting working directory"); - - string full_project_name = (string)ViaCOM.GetProperty(prj, "FullName"); - Console.WriteLine(full_project_name); - - // *NOTE:Mani Thanks to incompatibilities between different versions of the - // VCProjectEngine.dll assembly, we can't cast the objects recevied from the DTE to - // the VCProjectEngine types from a different version than the one built - // with. ie, VisualStudio.DTE.7.1 objects can't be converted in a project built - // in VS 8.0. To avoid this problem, we can use the com object interfaces directly, - // without the type casting. Its tedious code, but it seems to work. - - // oCfgs should be assigned to a 'Project.Configurations' collection. - object oCfgs = ViaCOM.GetProperty(ViaCOM.GetProperty(prj, "Object"), "Configurations"); - - // oCount will be assigned to the number of configs present in oCfgs. - object oCount = ViaCOM.GetProperty(oCfgs, "Count"); - - for (int cfgIndex = 1; cfgIndex <= (int)oCount; ++cfgIndex) - { - object[] itemArgs = {(object)cfgIndex}; - object oCfg = ViaCOM.CallMethod(oCfgs, "Item", itemArgs); - object oDebugSettings = ViaCOM.GetProperty(oCfg, "DebugSettings"); - ViaCOM.SetProperty(oDebugSettings, "WorkingDirectory", (object)working_dir); - } - - break; - } - } - made_change = true; - } - catch( Exception e ) - { - Console.WriteLine(e.Message); - Console.WriteLine("Failed to set working dir for project, {0}.", project_name); - } - - return made_change; - } - - public static bool SetStartupProject(string startup_project) - { - bool result = false; - try - { - // You need the 'unique name of the project to set StartupProjects. - // find the project by generic name. - Console.WriteLine("Trying to set \"{0}\" to the startup project", startup_project); - object prjs = ViaCOM.GetProperty(solution, "Projects"); - object count = ViaCOM.GetProperty(prjs, "Count"); - for (int i = 1; i <= (int)count; ++i) - { - object[] itemArgs = { (object)i }; - object prj = ViaCOM.CallMethod(prjs, "Item", itemArgs); - object prjName = ViaCOM.GetProperty(prj, "Name"); - if (0 == string.Compare((string)prjName, startup_project, ignore_case)) - { - object solBuild = ViaCOM.GetProperty(solution, "SolutionBuild"); - ViaCOM.SetProperty(solBuild, "StartupProjects", ViaCOM.GetProperty(prj, "UniqueName")); - Console.WriteLine(" Success!"); - result = true; - break; - } - } - - if (result == false) - { - Console.WriteLine(" Could not find project \"{0}\" in the solution.", startup_project); - } - } - catch (Exception e) - { - Console.WriteLine(" Failed to set the startup project!"); - Console.WriteLine(e.Message); - } - return result; - } - - public static bool SetActiveConfig(string config) - { - bool result = false; - try - { - Console.WriteLine("Trying to set active config to \"{0}\"", config); - object solBuild = ViaCOM.GetProperty(solution, "SolutionBuild"); - object solCfgs = ViaCOM.GetProperty(solBuild, "SolutionConfigurations"); - object[] itemArgs = { (object)config }; - object solCfg = ViaCOM.CallMethod(solCfgs, "Item", itemArgs); - ViaCOM.CallMethod(solCfg, "Activate", null); - Console.WriteLine(" Success!"); - result = true; - } - catch (Exception e) - { - Console.WriteLine(" Failed to set \"{0}\" as the active config.", config); - Console.WriteLine(e.Message); - } - return result; - } - } -} diff --git a/indra/win_crash_logger/README.txt b/indra/win_crash_logger/README.txt deleted file mode 100644 index 6932a8d9c3..0000000000 --- a/indra/win_crash_logger/README.txt +++ /dev/null @@ -1,3 +0,0 @@ -This component is no longer used in Linden Lab builds. -Change requests to support continued use by open source -builds are welcome. -- cgit v1.2.3 From e7c506ba455f32eb8532f5e07bf83419126b5212 Mon Sep 17 00:00:00 2001 From: fmartian Date: Sun, 17 Aug 2025 02:34:50 +0200 Subject: Fix regex strings for Python 3.12+ Python 3.12 and newer does complain about single backslash in strings and is probably going to treat it as an error in some future version. Make the string constant a raw string. --- indra/newview/viewer_manifest.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/indra/newview/viewer_manifest.py b/indra/newview/viewer_manifest.py index cf5e748513..6991e0c8f2 100755 --- a/indra/newview/viewer_manifest.py +++ b/indra/newview/viewer_manifest.py @@ -273,13 +273,13 @@ class ViewerManifest(LLManifest): # All lines up to and including the first blank line are the file header; skip them lines.reverse() # so that pop will pull from first to last line - while not re.match("\s*$", lines.pop()) : + while not re.match(r"\s*$", lines.pop()) : pass # do nothing # A line that starts with a non-whitespace character is a name; all others describe contributions, so collect the names names = [] for line in lines : - if re.match("\S", line) : + if re.match(r"\S", line) : names.append(line.rstrip()) # It's not fair to always put the same people at the head of the list random.shuffle(names) -- cgit v1.2.3 From 181273f92990e5e37ca8f15c1d7d80d784b1ad77 Mon Sep 17 00:00:00 2001 From: Nicky Date: Sat, 3 Aug 2024 15:42:06 +0200 Subject: Change another case of a regex sequence needing to be a raw string --- scripts/packages-formatter.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/packages-formatter.py b/scripts/packages-formatter.py index 4449111e46..5d31702e76 100755 --- a/scripts/packages-formatter.py +++ b/scripts/packages-formatter.py @@ -42,7 +42,7 @@ _autobuild_env=os.environ.copy() # Coerce stdout encoding to utf-8 as cygwin's will be detected as cp1252 otherwise. _autobuild_env["PYTHONIOENCODING"] = "utf-8" -pkg_line=re.compile('^([\w-]+):\s+(.*)$') +pkg_line=re.compile(r'^([\w-]+):\s+(.*)$') def autobuild(*args): """ -- cgit v1.2.3 From 89c373c20b6032bab819e99cc8ace7b7e6b92360 Mon Sep 17 00:00:00 2001 From: fmartian Date: Mon, 18 Aug 2025 21:16:54 +0200 Subject: Add new LastModified option to HttpRequest handling (#4563) * Add LastModified: option to the HttpOptions and handle it properly in HttpOpRequest::prepareRequest() * grid_name could be empty if an invalid grid was passed in. --- indra/llcorehttp/_httpoprequest.cpp | 13 +++++++++++++ indra/llcorehttp/httpoptions.cpp | 6 ++++++ indra/llcorehttp/httpoptions.h | 8 ++++++++ indra/newview/llviewernetwork.cpp | 4 ++-- 4 files changed, 29 insertions(+), 2 deletions(-) diff --git a/indra/llcorehttp/_httpoprequest.cpp b/indra/llcorehttp/_httpoprequest.cpp index 6186e7a308..081a4d9bac 100644 --- a/indra/llcorehttp/_httpoprequest.cpp +++ b/indra/llcorehttp/_httpoprequest.cpp @@ -538,6 +538,7 @@ HttpStatus HttpOpRequest::prepareRequest(HttpService * service) long sslHostV(0L); long dnsCacheTimeout(-1L); long nobody(0L); + curl_off_t lastModified(0L); if (mReqOptions) { @@ -546,6 +547,7 @@ HttpStatus HttpOpRequest::prepareRequest(HttpService * service) sslHostV = mReqOptions->getSSLVerifyHost() ? 2L : 0L; dnsCacheTimeout = mReqOptions->getDNSCacheTimeout(); nobody = mReqOptions->getHeadersOnly() ? 1L : 0L; + lastModified = (curl_off_t)mReqOptions->getLastModified(); } check_curl_easy_setopt(mCurlHandle, CURLOPT_FOLLOWLOCATION, follow_redirect); @@ -554,6 +556,17 @@ HttpStatus HttpOpRequest::prepareRequest(HttpService * service) check_curl_easy_setopt(mCurlHandle, CURLOPT_NOBODY, nobody); + if (lastModified) + { + check_curl_easy_setopt(mCurlHandle, CURLOPT_TIMECONDITION, CURL_TIMECOND_IFMODSINCE); +#if (LIBCURL_VERSION_NUM >= 0x073B00) + // requires curl 7.59.0 + check_curl_easy_setopt(mCurlHandle, CURLOPT_TIMEVALUE_LARGE, lastModified); +#else + check_curl_easy_setopt(mCurlHandle, CURLOPT_TIMEVALUE, (long)lastModified); +#endif + } + // The Linksys WRT54G V5 router has an issue with frequent // DNS lookups from LAN machines. If they happen too often, // like for every HTTP request, the router gets annoyed after diff --git a/indra/llcorehttp/httpoptions.cpp b/indra/llcorehttp/httpoptions.cpp index d85f6039b1..5abd28e211 100644 --- a/indra/llcorehttp/httpoptions.cpp +++ b/indra/llcorehttp/httpoptions.cpp @@ -47,6 +47,7 @@ HttpOptions::HttpOptions() : mVerifyPeer(sDefaultVerifyPeer), mVerifyHost(false), mDNSCacheTimeout(-1L), + mLastModified(0), mNoBody(false) {} @@ -129,6 +130,11 @@ void HttpOptions::setHeadersOnly(bool nobody) } } +void HttpOptions::setLastModified(time_t lastModified) +{ + mLastModified = lastModified; +} + void HttpOptions::setDefaultSSLVerifyPeer(bool verify) { sDefaultVerifyPeer = verify; diff --git a/indra/llcorehttp/httpoptions.h b/indra/llcorehttp/httpoptions.h index 56a28013cb..fdb277c66e 100644 --- a/indra/llcorehttp/httpoptions.h +++ b/indra/llcorehttp/httpoptions.h @@ -178,6 +178,13 @@ public: return mNoBody; } + // Default: 0 + void setLastModified(time_t lastModified); + time_t getLastModified() const + { + return mLastModified; + } + /// Sets default behavior for verifying that the name in the /// security certificate matches the name of the host contacted. /// Defaults false if not set, but should be set according to @@ -199,6 +206,7 @@ protected: bool mVerifyHost; int mDNSCacheTimeout; bool mNoBody; + time_t mLastModified; static bool sDefaultVerifyPeer; }; // end class HttpOptions diff --git a/indra/newview/llviewernetwork.cpp b/indra/newview/llviewernetwork.cpp index 16ddc2f89c..f11fa09ce9 100644 --- a/indra/newview/llviewernetwork.cpp +++ b/indra/newview/llviewernetwork.cpp @@ -450,7 +450,7 @@ std::string LLGridManager::getGridLabel(const std::string& grid) { std::string grid_label; std::string grid_name = getGrid(grid); - if (!grid.empty()) + if (!grid_name.empty()) { grid_label = mGridList[grid_name][GRID_LABEL_VALUE].asString(); } @@ -466,7 +466,7 @@ std::string LLGridManager::getGridId(const std::string& grid) { std::string grid_id; std::string grid_name = getGrid(grid); - if (!grid.empty()) + if (!grid_name.empty()) { grid_id = mGridList[grid_name][GRID_ID_VALUE].asString(); } -- cgit v1.2.3 From 77514ebddd68ca47bc3751f0a6e55a83deec79a9 Mon Sep 17 00:00:00 2001 From: Rye Date: Mon, 18 Aug 2025 21:26:20 -0400 Subject: Fix macOS deprecation warnings --- indra/llprimitive/lldaeloader.cpp | 2 +- indra/llwindow/llopenglview-objc.h | 13 ------ indra/llwindow/llopenglview-objc.mm | 82 ++++++++++----------------------- indra/llwindow/llwindowmacosx-objc.mm | 3 +- indra/newview/llappdelegate-objc.mm | 2 +- indra/newview/llappviewermacosx-objc.h | 3 -- indra/newview/llappviewermacosx-objc.mm | 39 ---------------- indra/newview/llfilepicker_mac.mm | 6 +-- indra/newview/llfloateremojipicker.cpp | 4 +- indra/newview/llfloateruipreview.cpp | 3 +- 10 files changed, 36 insertions(+), 121 deletions(-) diff --git a/indra/llprimitive/lldaeloader.cpp b/indra/llprimitive/lldaeloader.cpp index 0759447902..4c028e7128 100644 --- a/indra/llprimitive/lldaeloader.cpp +++ b/indra/llprimitive/lldaeloader.cpp @@ -1314,7 +1314,7 @@ void LLDAELoader::processDomModel(LLModel* model, DAE* dae, daeElement* root, do { //Build a joint for the resolver to work with char str[64]={0}; - sprintf(str,"./%s",(*jointIt).first.c_str() ); + snprintf(str, sizeof(str), "./%s",(*jointIt).first.c_str() ); //LL_WARNS()<<"Joint "<< str < + extern BOOL gHiDPISupport; #pragma mark local functions @@ -105,20 +107,6 @@ attributedStringInfo getSegments(NSAttributedString *str) return screen; } - -- (NSPoint)convertPointToScreenCoordinates:(NSPoint)aPoint -{ - float normalizedX = fabs(fabs(self.frame.origin.x) - fabs(aPoint.x)); - float normalizedY = aPoint.y - self.frame.origin.y; - - return NSMakePoint(normalizedX, normalizedY); -} - -- (NSPoint)flipPoint:(NSPoint)aPoint -{ - return NSMakePoint(aPoint.x, self.frame.size.height - aPoint.y); -} - @end @implementation LLOpenGLView @@ -244,7 +232,7 @@ attributedStringInfo getSegments(NSAttributedString *str) - (id) initWithFrame:(NSRect)frame withSamples:(NSUInteger)samples andVsync:(BOOL)vsync { - [self registerForDraggedTypes:[NSArray arrayWithObject:NSURLPboardType]]; + [self registerForDraggedTypes:[NSArray arrayWithObject:NSPasteboardTypeURL]]; [self initWithFrame:frame]; // Initialize with a default "safe" pixel format that will work with versions dating back to OS X 10.6. @@ -295,13 +283,13 @@ attributedStringInfo getSegments(NSAttributedString *str) if (vsync) { GLint value = 1; - [glContext setValues:&value forParameter:NSOpenGLCPSwapInterval]; + [glContext setValues:&value forParameter:NSOpenGLContextParameterSwapInterval]; } else { // supress this error after move to Xcode 7: // error: null passed to a callee that requires a non-null argument [-Werror,-Wnonnull] // Tried using ObjC 'nonnull' keyword as per SO article but didn't build GLint swapInterval=0; - [glContext setValues:&swapInterval forParameter:NSOpenGLCPSwapInterval]; + [glContext setValues:&swapInterval forParameter:NSOpenGLContextParameterSwapInterval]; } mOldResize = false; @@ -355,13 +343,13 @@ attributedStringInfo getSegments(NSAttributedString *str) mMousePos[1] = mPoint.y; // Apparently people still use this? - if ([theEvent modifierFlags] & NSCommandKeyMask && - !([theEvent modifierFlags] & NSControlKeyMask) && - !([theEvent modifierFlags] & NSShiftKeyMask) && - !([theEvent modifierFlags] & NSAlternateKeyMask) && - !([theEvent modifierFlags] & NSAlphaShiftKeyMask) && - !([theEvent modifierFlags] & NSFunctionKeyMask) && - !([theEvent modifierFlags] & NSHelpKeyMask)) + if ([theEvent modifierFlags] & NSEventModifierFlagCommand && + !([theEvent modifierFlags] & NSEventModifierFlagControl) && + !([theEvent modifierFlags] & NSEventModifierFlagShift) && + !([theEvent modifierFlags] & NSEventModifierFlagOption) && + !([theEvent modifierFlags] & NSEventModifierFlagCapsLock) && + !([theEvent modifierFlags] & NSEventModifierFlagFunction) && + !([theEvent modifierFlags] & NSEventModifierFlagHelp)) { callRightMouseDown(mMousePos, [theEvent modifierFlags]); mSimulatedRightClick = true; @@ -511,7 +499,7 @@ attributedStringInfo getSegments(NSAttributedString *str) if (acceptsText && !mMarkedTextAllowed && - !(mModifiers & (NSControlKeyMask | NSCommandKeyMask)) && // commands don't invoke InputWindow + !(mModifiers & (NSEventModifierFlagControl | NSEventModifierFlagCommand)) && // commands don't invoke InputWindow ![(LLAppDelegate*)[NSApp delegate] romanScript] && ch > ' ' && ch != NSDeleteCharacter && @@ -534,14 +522,14 @@ attributedStringInfo getSegments(NSAttributedString *str) NSInteger mask = 0; switch([theEvent keyCode]) { - case 56: - mask = NSShiftKeyMask; + case kVK_Shift: + mask = NSEventModifierFlagShift; break; - case 58: - mask = NSAlternateKeyMask; + case kVK_Option: + mask = NSEventModifierFlagOption; break; - case 59: - mask = NSControlKeyMask; + case kVK_Control: + mask = NSEventModifierFlagControl; break; default: return; @@ -582,7 +570,7 @@ attributedStringInfo getSegments(NSAttributedString *str) pboard = [sender draggingPasteboard]; - if ([[pboard types] containsObject:NSURLPboardType]) + if ([[pboard types] containsObject:NSPasteboardTypeURL]) { if (sourceDragMask & NSDragOperationLink) { NSURL *fileUrl = [[pboard readObjectsForClasses:[NSArray arrayWithObject:[NSURL class]] options:[NSDictionary dictionary]] objectAtIndex:0]; @@ -657,7 +645,7 @@ attributedStringInfo getSegments(NSAttributedString *str) }; int string_length = [aString length]; - unichar text[string_length]; + unichar* text = (unichar*)malloc(sizeof(unichar) * string_length); attributedStringInfo segments; // I used 'respondsToSelector:@selector(string)' // to judge aString is an attributed string or not. @@ -675,6 +663,7 @@ attributedStringInfo getSegments(NSAttributedString *str) segments.seg_standouts.push_back(true); } setMarkedText(text, selected, replacement, string_length, segments); + free(text); if (string_length > 0) { mHasMarkedText = TRUE; @@ -783,9 +772,9 @@ attributedStringInfo getSegments(NSAttributedString *str) - (void) insertNewline:(id)sender { - if (!(mModifiers & NSCommandKeyMask) && - !(mModifiers & NSShiftKeyMask) && - !(mModifiers & NSAlternateKeyMask)) + if (!(mModifiers & NSEventModifierFlagCommand) && + !(mModifiers & NSEventModifierFlagShift) && + !(mModifiers & NSEventModifierFlagOption)) { callUnicodeCallback(13, 0); } else { @@ -904,27 +893,6 @@ attributedStringInfo getSegments(NSAttributedString *str) return self; } -- (NSPoint)convertToScreenFromLocalPoint:(NSPoint)point relativeToView:(NSView *)view -{ - NSScreen *currentScreen = [NSScreen currentScreenForMouseLocation]; - if(currentScreen) - { - NSPoint windowPoint = [view convertPoint:point toView:nil]; - NSPoint screenPoint = [[view window] convertBaseToScreen:windowPoint]; - NSPoint flippedScreenPoint = [currentScreen flipPoint:screenPoint]; - flippedScreenPoint.y += [currentScreen frame].origin.y; - - return flippedScreenPoint; - } - - return NSZeroPoint; -} - -- (NSPoint)flipPoint:(NSPoint)aPoint -{ - return NSMakePoint(aPoint.x, self.frame.size.height - aPoint.y); -} - - (BOOL) becomeFirstResponder { callFocus(); diff --git a/indra/llwindow/llwindowmacosx-objc.mm b/indra/llwindow/llwindowmacosx-objc.mm index 2e75d309ea..41b1e3195c 100644 --- a/indra/llwindow/llwindowmacosx-objc.mm +++ b/indra/llwindow/llwindowmacosx-objc.mm @@ -213,7 +213,8 @@ OSErr setImageCursor(CursorRef ref) NSWindowRef createNSWindow(int x, int y, int width, int height) { LLNSWindow *window = [[LLNSWindow alloc]initWithContentRect:NSMakeRect(x, y, width, height) - styleMask:NSTitledWindowMask | NSResizableWindowMask | NSClosableWindowMask | NSMiniaturizableWindowMask | NSTexturedBackgroundWindowMask backing:NSBackingStoreBuffered defer:NO]; + styleMask:NSWindowStyleMaskTitled | NSWindowStyleMaskResizable | NSWindowStyleMaskClosable | NSWindowStyleMaskMiniaturizable + backing:NSBackingStoreBuffered defer:NO]; [window makeKeyAndOrderFront:nil]; [window setAcceptsMouseMovedEvents:TRUE]; [window setRestorable:FALSE]; // Viewer manages state from own settings diff --git a/indra/newview/llappdelegate-objc.mm b/indra/newview/llappdelegate-objc.mm index d4b05dde72..b8fd3dc189 100644 --- a/indra/newview/llappdelegate-objc.mm +++ b/indra/newview/llappdelegate-objc.mm @@ -372,7 +372,7 @@ struct AttachmentInfo - (void)sendEvent:(NSEvent *)event { [super sendEvent:event]; - if ([event type] == NSKeyUp && ([event modifierFlags] & NSCommandKeyMask)) + if ([event type] == NSEventTypeKeyUp && ([event modifierFlags] & NSEventModifierFlagCommand)) { [[self keyWindow] sendEvent:event]; } diff --git a/indra/newview/llappviewermacosx-objc.h b/indra/newview/llappviewermacosx-objc.h index d0ae0a7fc2..3fbf4202f1 100644 --- a/indra/newview/llappviewermacosx-objc.h +++ b/indra/newview/llappviewermacosx-objc.h @@ -30,9 +30,6 @@ #include #include -//Why? Because BOOL -void launchApplication(const std::string* app_name, const std::vector* args); - void force_ns_sxeption(); #endif // LL_LLAPPVIEWERMACOSX_OBJC_H diff --git a/indra/newview/llappviewermacosx-objc.mm b/indra/newview/llappviewermacosx-objc.mm index 9b6bfe621b..2ea3f2f171 100644 --- a/indra/newview/llappviewermacosx-objc.mm +++ b/indra/newview/llappviewermacosx-objc.mm @@ -33,45 +33,6 @@ #include "llappviewermacosx-objc.h" -void launchApplication(const std::string* app_name, const std::vector* args) -{ - - NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init]; - - if (app_name->empty()) return; - - NSMutableString* app_name_ns = [NSMutableString stringWithString:[[NSBundle mainBundle] resourcePath]]; //Path to resource dir - [app_name_ns appendFormat:@"/%@", [NSString stringWithCString:app_name->c_str() - encoding:[NSString defaultCStringEncoding]]]; - - NSMutableArray *args_ns = nil; - args_ns = [[NSMutableArray alloc] init]; - - for (int i=0; i < args->size(); ++i) - { - NSLog(@"Adding string %s", (*args)[i].c_str()); - [args_ns addObject: - [NSString stringWithCString:(*args)[i].c_str() - encoding:[NSString defaultCStringEncoding]]]; - } - - NSTask *task = [[NSTask alloc] init]; - NSBundle *bundle = [NSBundle bundleWithPath:[[NSWorkspace sharedWorkspace] fullPathForApplication:app_name_ns]]; - [task setLaunchPath:[bundle executablePath]]; - [task setArguments:args_ns]; - [task launch]; - -// NSWorkspace *workspace = [NSWorkspace sharedWorkspace]; -// NSURL *url = [NSURL fileURLWithPath:[workspace fullPathForApplication:app_name_ns]]; -// -// NSError *error = nil; -// [workspace launchApplicationAtURL:url options:0 configuration:[NSDictionary dictionaryWithObject:args_ns forKey:NSWorkspaceLaunchConfigurationArguments] error:&error]; - //TODO Handle error - - [pool release]; - return; -} - void force_ns_sxeption() { NSException *exception = [NSException exceptionWithName:@"Forced NSException" reason:nullptr userInfo:nullptr]; diff --git a/indra/newview/llfilepicker_mac.mm b/indra/newview/llfilepicker_mac.mm index b21bc724fb..978069457c 100644 --- a/indra/newview/llfilepicker_mac.mm +++ b/indra/newview/llfilepicker_mac.mm @@ -86,7 +86,7 @@ std::unique_ptr> doLoadDialog(const std::vector doSaveDialog(const std::string* file, [panel setNameFieldStringValue: fileName]; [panel setDirectoryURL: url]; if([panel runModal] == - NSFileHandlingPanelOKButton) + NSModalResponseOK) { NSURL* url = [panel URL]; NSString* p = [url path]; @@ -211,7 +211,7 @@ void doSaveDialogModeless(const std::string* file, [panel beginWithCompletionHandler:^(NSModalResponse result) { - if (result == NSOKButton) + if (result == NSModalResponseOK) { NSURL* url = [panel URL]; NSString* p = [url path]; diff --git a/indra/newview/llfloateremojipicker.cpp b/indra/newview/llfloateremojipicker.cpp index 7e13503103..c5f4a2f0cf 100644 --- a/indra/newview/llfloateremojipicker.cpp +++ b/indra/newview/llfloateremojipicker.cpp @@ -1284,7 +1284,7 @@ void LLFloaterEmojiPicker::saveState() if (!recentlyUsed.empty()) recentlyUsed += ","; char buffer[32]; - sprintf(buffer, "%u", (U32)emoji); + snprintf(buffer, sizeof(buffer), "%u", (U32)emoji); recentlyUsed += buffer; if (!--maxCount) break; @@ -1301,7 +1301,7 @@ void LLFloaterEmojiPicker::saveState() if (!frequentlyUsed.empty()) frequentlyUsed += ","; char buffer[32]; - sprintf(buffer, "%u:%u", (U32)it.first, (U32)it.second); + snprintf(buffer, sizeof(buffer), "%u:%u", (U32)it.first, (U32)it.second); frequentlyUsed += buffer; if (!--maxCount) break; diff --git a/indra/newview/llfloateruipreview.cpp b/indra/newview/llfloateruipreview.cpp index 990a299c50..abffba8ffa 100644 --- a/indra/newview/llfloateruipreview.cpp +++ b/indra/newview/llfloateruipreview.cpp @@ -1042,7 +1042,7 @@ void LLFloaterUIPreview::getExecutablePath(const std::vector& filen { CFStringRef executable_cfstr = (CFStringRef)CFDictionaryGetValue(bundleInfoDict, CFSTR("CFBundleExecutable")); // get the name of the actual executable (e.g. TextEdit or firefox-bin) int max_file_length = 256; // (max file name length is 255 in OSX) - char executable_buf[max_file_length]; + char* executable_buf = (char*)malloc(sizeof(char) * max_file_length); if(CFStringGetCString(executable_cfstr, executable_buf, max_file_length, kCFStringEncodingMacRoman)) // convert CFStringRef to char* { executable_path += std::string("/Contents/MacOS/") + std::string(executable_buf); // append path to executable directory and then executable name to exec path @@ -1052,6 +1052,7 @@ void LLFloaterUIPreview::getExecutablePath(const std::vector& filen std::string warning = "Unable to get CString from CFString for executable path"; popupAndPrintWarning(warning); } + free(executable_buf); } else { -- cgit v1.2.3 From d5f748c91c650a2ec534c497b9e098ccb317d70b Mon Sep 17 00:00:00 2001 From: Andrey Kleshchev Date: Tue, 19 Aug 2025 22:17:01 +0300 Subject: #3223 Trim coroutine queues a little --- indra/llmessage/llcoproceduremanager.cpp | 23 +++++++++++++---------- indra/llmessage/llcoproceduremanager.h | 2 +- indra/llmessage/llexperiencecache.cpp | 3 ++- 3 files changed, 16 insertions(+), 12 deletions(-) diff --git a/indra/llmessage/llcoproceduremanager.cpp b/indra/llmessage/llcoproceduremanager.cpp index 6a663a8e97..563dd9459c 100644 --- a/indra/llmessage/llcoproceduremanager.cpp +++ b/indra/llmessage/llcoproceduremanager.cpp @@ -50,7 +50,7 @@ static const U32 DEFAULT_POOL_SIZE = 5; // SL-14399: When we teleport to a brand-new simulator, the coprocedure queue // gets absolutely slammed with fetch requests. Make this queue effectively // unlimited. -const U32 LLCoprocedureManager::DEFAULT_QUEUE_SIZE = 1024*1024; +const U32 LLCoprocedureManager::DEFAULT_QUEUE_SIZE = 1024*512; //========================================================================= class LLCoprocedurePool: private boost::noncopyable @@ -58,7 +58,7 @@ class LLCoprocedurePool: private boost::noncopyable public: typedef LLCoprocedureManager::CoProcedure_t CoProcedure_t; - LLCoprocedurePool(const std::string &name, size_t size); + LLCoprocedurePool(const std::string &name, size_t size, size_t queue_size); ~LLCoprocedurePool(); /// Places the coprocedure on the queue for processing. @@ -118,7 +118,7 @@ private: typedef std::shared_ptr CoprocQueuePtr; std::string mPoolName; - size_t mPoolSize, mActiveCoprocsCount, mPending; + size_t mPoolSize, mQueueSize, mActiveCoprocsCount, mPending; CoprocQueuePtr mPendingCoprocs; LLTempBoundListener mStatusListener; @@ -141,7 +141,7 @@ LLCoprocedureManager::~LLCoprocedureManager() close(); } -void LLCoprocedureManager::initializePool(const std::string &poolName) +void LLCoprocedureManager::initializePool(const std::string &poolName, size_t queue_size) { poolMap_t::iterator it = mPoolMap.find(poolName); @@ -180,7 +180,7 @@ void LLCoprocedureManager::initializePool(const std::string &poolName) LL_WARNS("CoProcMgr") << "LLCoprocedureManager: No setting for \"" << keyName << "\" setting pool size to default of " << size << LL_ENDL; } - poolPtr_t pool(new LLCoprocedurePool(poolName, size)); + poolPtr_t pool(new LLCoprocedurePool(poolName, size, queue_size)); LL_ERRS_IF(!pool, "CoprocedureManager") << "Unable to create pool named \"" << poolName << "\" FATAL!" << LL_ENDL; bool inserted = mPoolMap.emplace(poolName, pool).second; @@ -212,7 +212,8 @@ void LLCoprocedureManager::setPropertyMethods(SettingQuery_t queryfn, SettingUpd mPropertyQueryFn = queryfn; mPropertyDefineFn = updatefn; - initializePool("Upload"); + constexpr size_t UPLOAD_QUEUE_SIZE = 2048; + initializePool("Upload", UPLOAD_QUEUE_SIZE); initializePool("AIS"); // it might be better to have some kind of on-demand initialization for AIS // "ExpCache" pool gets initialized in LLExperienceCache // asset storage pool gets initialized in LLViewerAssetStorage @@ -296,17 +297,19 @@ void LLCoprocedureManager::close(const std::string &pool) } //========================================================================= -LLCoprocedurePool::LLCoprocedurePool(const std::string &poolName, size_t size): +LLCoprocedurePool::LLCoprocedurePool(const std::string &poolName, size_t size, size_t queue_size): mPoolName(poolName), mPoolSize(size), + mQueueSize(queue_size), mActiveCoprocsCount(0), mPending(0), mHTTPPolicy(LLCore::HttpRequest::DEFAULT_POLICY_ID), mCoroMapping() { + llassert_always(mQueueSize > mPoolSize); // queue should be able to fit pool try { - mPendingCoprocs = std::make_shared(LLCoprocedureManager::DEFAULT_QUEUE_SIZE); + mPendingCoprocs = std::make_shared(mQueueSize); // store in our LLTempBoundListener so that when the LLCoprocedurePool is // destroyed, we implicitly disconnect from this LLEventPump // Monitores application status @@ -357,7 +360,7 @@ LLCoprocedurePool::LLCoprocedurePool(const std::string &poolName, size_t size): mCoroMapping.insert(CoroAdapterMap_t::value_type(pooledCoro, httpAdapter)); } - LL_INFOS("CoProcMgr") << "Created coprocedure pool named \"" << mPoolName << "\" with " << size << " items, queue max " << LLCoprocedureManager::DEFAULT_QUEUE_SIZE << LL_ENDL; + LL_INFOS("CoProcMgr") << "Created coprocedure pool named \"" << mPoolName << "\" with " << size << " items, queue max " << mQueueSize << LL_ENDL; } LLCoprocedurePool::~LLCoprocedurePool() @@ -376,7 +379,7 @@ LLUUID LLCoprocedurePool::enqueueCoprocedure(const std::string &name, LLCoproced << "\" at " << mPending << LL_ENDL; - if (mPending >= (LLCoprocedureManager::DEFAULT_QUEUE_SIZE - 1)) + if (mPending >= (mQueueSize - 1)) { // If it's all used up (not supposed to happen, // fetched should cap it), we are going to crash diff --git a/indra/llmessage/llcoproceduremanager.h b/indra/llmessage/llcoproceduremanager.h index 6c6e506654..485333657c 100644 --- a/indra/llmessage/llcoproceduremanager.h +++ b/indra/llmessage/llcoproceduremanager.h @@ -79,7 +79,7 @@ public: void close(); void close(const std::string &pool); - void initializePool(const std::string &poolName); + void initializePool(const std::string &poolName, size_t queue_size = DEFAULT_QUEUE_SIZE); private: diff --git a/indra/llmessage/llexperiencecache.cpp b/indra/llmessage/llexperiencecache.cpp index 83a070df32..78cca47456 100644 --- a/indra/llmessage/llexperiencecache.cpp +++ b/indra/llmessage/llexperiencecache.cpp @@ -110,7 +110,8 @@ void LLExperienceCache::initSingleton() cache_stream >> (*this); } - LLCoprocedureManager::instance().initializePool("ExpCache"); + constexpr size_t CORO_QUEUE_SIZE = 2048; + LLCoprocedureManager::instance().initializePool("ExpCache", CORO_QUEUE_SIZE); LLCoros::instance().launch("LLExperienceCache::idleCoro", boost::bind(&LLExperienceCache::idleCoro, this)); -- cgit v1.2.3 From f0db568bf8d313a00e10c1c4ee4dd7f716a9d987 Mon Sep 17 00:00:00 2001 From: Rye Date: Wed, 20 Aug 2025 17:57:06 -0400 Subject: Rework macOS retina support to remove deprecated code and fix scaled input issues in multimonitor --- indra/llui/llui.cpp | 5 --- indra/llwindow/llopenglview-objc.mm | 32 +++++------------- indra/llwindow/llwindowmacosx-objc.h | 6 ++-- indra/llwindow/llwindowmacosx-objc.mm | 63 ++++++++++------------------------- indra/llwindow/llwindowmacosx.cpp | 19 ++++++----- 5 files changed, 38 insertions(+), 87 deletions(-) diff --git a/indra/llui/llui.cpp b/indra/llui/llui.cpp index e36dae3955..38d5720556 100644 --- a/indra/llui/llui.cpp +++ b/indra/llui/llui.cpp @@ -213,13 +213,8 @@ void LLUI::setPopupFuncs(const add_popup_t& add_popup, const remove_popup_t& rem void LLUI::setMousePositionScreen(S32 x, S32 y) { -#if defined(LL_DARWIN) - S32 screen_x = ll_round(((F32)x * getScaleFactor().mV[VX]) / LLView::getWindow()->getSystemUISize()); - S32 screen_y = ll_round(((F32)y * getScaleFactor().mV[VY]) / LLView::getWindow()->getSystemUISize()); -#else S32 screen_x = ll_round((F32)x * getScaleFactor().mV[VX]); S32 screen_y = ll_round((F32)y * getScaleFactor().mV[VY]); -#endif LLView::getWindow()->setCursorPosition(LLCoordGL(screen_x, screen_y).convert()); } diff --git a/indra/llwindow/llopenglview-objc.mm b/indra/llwindow/llopenglview-objc.mm index 36ae9c60a0..d40e549559 100644 --- a/indra/llwindow/llopenglview-objc.mm +++ b/indra/llwindow/llopenglview-objc.mm @@ -184,7 +184,7 @@ attributedStringInfo getSegments(NSAttributedString *str) { if (!mOldResize) //Maint-3288 { - NSSize dev_sz = gHiDPISupport ? [self convertSizeToBacking:[self frame].size] : [self frame].size; + NSSize dev_sz = [self convertSizeToBacking:[self frame].size]; callResize(dev_sz.width, dev_sz.height); } } @@ -338,10 +338,6 @@ attributedStringInfo getSegments(NSAttributedString *str) - (void) mouseDown:(NSEvent *)theEvent { - NSPoint mPoint = gHiDPISupport ? [self convertPointToBacking:[theEvent locationInWindow]] : [theEvent locationInWindow]; - mMousePos[0] = mPoint.x; - mMousePos[1] = mPoint.y; - // Apparently people still use this? if ([theEvent modifierFlags] & NSEventModifierFlagCommand && !([theEvent modifierFlags] & NSEventModifierFlagControl) && @@ -370,7 +366,7 @@ attributedStringInfo getSegments(NSAttributedString *str) callRightMouseUp(mMousePos, [theEvent modifierFlags]); mSimulatedRightClick = false; } else { - NSPoint mPoint = gHiDPISupport ? [self convertPointToBacking:[theEvent locationInWindow]] : [theEvent locationInWindow]; + NSPoint mPoint = [self convertPointToBacking:[theEvent locationInWindow]]; mMousePos[0] = mPoint.x; mMousePos[1] = mPoint.y; callLeftMouseUp(mMousePos, [theEvent modifierFlags]); @@ -379,32 +375,26 @@ attributedStringInfo getSegments(NSAttributedString *str) - (void) rightMouseDown:(NSEvent *)theEvent { - NSPoint mPoint = gHiDPISupport ? [self convertPointToBacking:[theEvent locationInWindow]] : [theEvent locationInWindow]; - mMousePos[0] = mPoint.x; - mMousePos[1] = mPoint.y; callRightMouseDown(mMousePos, [theEvent modifierFlags]); } - (void) rightMouseUp:(NSEvent *)theEvent { - NSPoint mPoint = gHiDPISupport ? [self convertPointToBacking:[theEvent locationInWindow]] : [theEvent locationInWindow]; - mMousePos[0] = mPoint.x; - mMousePos[1] = mPoint.y; callRightMouseUp(mMousePos, [theEvent modifierFlags]); } - (void)mouseMoved:(NSEvent *)theEvent { - NSPoint dev_delta = gHiDPISupport ? [self convertPointToBacking:NSMakePoint([theEvent deltaX], [theEvent deltaY])] : NSMakePoint([theEvent deltaX], [theEvent deltaY]); + NSPoint dev_delta = [self convertPointToBacking:NSMakePoint([theEvent deltaX], [theEvent deltaY])]; float mouseDeltas[] = { float(dev_delta.x), float(dev_delta.y) }; - + callDeltaUpdate(mouseDeltas, 0); - - NSPoint mPoint = gHiDPISupport ? [self convertPointToBacking:[theEvent locationInWindow]] : [theEvent locationInWindow]; + + NSPoint mPoint = [self convertPointToBacking:[theEvent locationInWindow]]; mMousePos[0] = mPoint.x; mMousePos[1] = mPoint.y; callMouseMoved(mMousePos, 0); @@ -419,7 +409,7 @@ attributedStringInfo getSegments(NSAttributedString *str) // The old CoreGraphics APIs we previously relied on are now flagged as obsolete. // NSEvent isn't obsolete, and provides us with the correct deltas. - NSPoint dev_delta = gHiDPISupport ? [self convertPointToBacking:NSMakePoint([theEvent deltaX], [theEvent deltaY])] : NSMakePoint([theEvent deltaX], [theEvent deltaY]); + NSPoint dev_delta = [self convertPointToBacking:NSMakePoint([theEvent deltaX], [theEvent deltaY])]; float mouseDeltas[] = { float(dev_delta.x), @@ -428,7 +418,7 @@ attributedStringInfo getSegments(NSAttributedString *str) callDeltaUpdate(mouseDeltas, 0); - NSPoint mPoint = gHiDPISupport ? [self convertPointToBacking:[theEvent locationInWindow]] : [theEvent locationInWindow]; + NSPoint mPoint = [self convertPointToBacking:[theEvent locationInWindow]]; mMousePos[0] = mPoint.x; mMousePos[1] = mPoint.y; callMouseDragged(mMousePos, 0); @@ -436,17 +426,11 @@ attributedStringInfo getSegments(NSAttributedString *str) - (void) otherMouseDown:(NSEvent *)theEvent { - NSPoint mPoint = gHiDPISupport ? [self convertPointToBacking:[theEvent locationInWindow]] : [theEvent locationInWindow]; - mMousePos[0] = mPoint.x; - mMousePos[1] = mPoint.y; callOtherMouseDown(mMousePos, [theEvent modifierFlags], [theEvent buttonNumber]); } - (void) otherMouseUp:(NSEvent *)theEvent { - NSPoint mPoint = gHiDPISupport ? [self convertPointToBacking:[theEvent locationInWindow]] : [theEvent locationInWindow]; - mMousePos[0] = mPoint.x; - mMousePos[1] = mPoint.y; callOtherMouseUp(mMousePos, [theEvent modifierFlags], [theEvent buttonNumber]); } diff --git a/indra/llwindow/llwindowmacosx-objc.h b/indra/llwindow/llwindowmacosx-objc.h index d9d8bfce1f..fa0b8b8f38 100644 --- a/indra/llwindow/llwindowmacosx-objc.h +++ b/indra/llwindow/llwindowmacosx-objc.h @@ -111,16 +111,14 @@ void glSwapBuffers(void* context); CGLContextObj getCGLContextObj(GLViewRef view); unsigned long getVramSize(GLViewRef view); float getDeviceUnitSize(GLViewRef view); -CGPoint getContentViewBoundsPosition(NSWindowRef window); -CGSize getContentViewBoundsSize(NSWindowRef window); -CGSize getDeviceContentViewSize(NSWindowRef window, GLViewRef view); +CGRect getContentViewRect(NSWindowRef window); +CGRect getBackingViewRect(NSWindowRef window, GLViewRef view); void getWindowSize(NSWindowRef window, float* size); void setWindowSize(NSWindowRef window, int width, int height); void getCursorPos(NSWindowRef window, float* pos); void makeWindowOrderFront(NSWindowRef window); void convertScreenToWindow(NSWindowRef window, float *coord); void convertWindowToScreen(NSWindowRef window, float *coord); -void convertScreenToView(NSWindowRef window, float *coord); void convertRectToScreen(NSWindowRef window, float *coord); void convertRectFromScreen(NSWindowRef window, float *coord); void setWindowPos(NSWindowRef window, float* pos); diff --git a/indra/llwindow/llwindowmacosx-objc.mm b/indra/llwindow/llwindowmacosx-objc.mm index 41b1e3195c..40341ea2e3 100644 --- a/indra/llwindow/llwindowmacosx-objc.mm +++ b/indra/llwindow/llwindowmacosx-objc.mm @@ -259,19 +259,14 @@ float getDeviceUnitSize(GLViewRef view) return [(LLOpenGLView*)view convertSizeToBacking:NSMakeSize(1, 1)].width; } -CGPoint getContentViewBoundsPosition(NSWindowRef window) +CGRect getContentViewRect(NSWindowRef window) { - return [[(LLNSWindow*)window contentView] bounds].origin; + return [[(LLNSWindow*)window contentView] bounds]; } -CGSize getContentViewBoundsSize(NSWindowRef window) +CGRect getBackingViewRect(NSWindowRef window, GLViewRef view) { - return [[(LLNSWindow*)window contentView] bounds].size; -} - -CGSize getDeviceContentViewSize(NSWindowRef window, GLViewRef view) -{ - return [(NSOpenGLView*)view convertRectToBacking:[[(LLNSWindow*)window contentView] bounds]].size; + return [(NSOpenGLView*)view convertRectToBacking:[[(LLNSWindow*)window contentView] bounds]]; } void getWindowSize(NSWindowRef window, float* size) @@ -314,9 +309,7 @@ void makeWindowOrderFront(NSWindowRef window) void convertScreenToWindow(NSWindowRef window, float *coord) { - NSRect point; - point.origin.x = coord[0]; - point.origin.y = coord[1]; + NSRect point = NSMakeRect(coord[0], coord[1], 0,0); point = [(LLNSWindow*)window convertRectFromScreen:point]; coord[0] = point.origin.x; coord[1] = point.origin.y; @@ -324,28 +317,18 @@ void convertScreenToWindow(NSWindowRef window, float *coord) void convertRectToScreen(NSWindowRef window, float *coord) { - NSRect point; - point.origin.x = coord[0]; - point.origin.y = coord[1]; - point.size.width = coord[2]; - point.size.height = coord[3]; - - point = [(LLNSWindow*)window convertRectToScreen:point]; - - coord[0] = point.origin.x; - coord[1] = point.origin.y; - coord[2] = point.size.width; - coord[3] = point.size.height; + NSRect rect = NSMakeRect(coord[0], coord[1], coord[2], coord[3]);; + rect = [(LLNSWindow*)window convertRectToScreen:rect]; + + coord[0] = rect.origin.x; + coord[1] = rect.origin.y; + coord[2] = rect.size.width; + coord[3] = rect.size.height; } void convertRectFromScreen(NSWindowRef window, float *coord) { - NSRect point; - point.origin.x = coord[0]; - point.origin.y = coord[1]; - point.size.width = coord[2]; - point.size.height = coord[3]; - + NSRect point = NSMakeRect(coord[0], coord[1], coord[2], coord[3]); point = [(LLNSWindow*)window convertRectFromScreen:point]; coord[0] = point.origin.x; @@ -354,23 +337,13 @@ void convertRectFromScreen(NSWindowRef window, float *coord) coord[3] = point.size.height; } -void convertScreenToView(NSWindowRef window, float *coord) -{ - NSRect point; - point.origin.x = coord[0]; - point.origin.y = coord[1]; - point.origin = [(LLNSWindow*)window convertScreenToBase:point.origin]; - point.origin = [[(LLNSWindow*)window contentView] convertPoint:point.origin fromView:nil]; -} - void convertWindowToScreen(NSWindowRef window, float *coord) { - NSPoint point; - point.x = coord[0]; - point.y = coord[1]; - point = [(LLNSWindow*)window convertToScreenFromLocalPoint:point relativeToView:[(LLNSWindow*)window contentView]]; - coord[0] = point.x; - coord[1] = point.y; + NSRect rect = NSMakeRect(coord[0], coord[1], 0, 0); + rect = [(LLNSWindow*)window convertRectToScreen:rect]; + + coord[0] = rect.origin.x; + coord[1] = [[NSScreen screens][0] frame].size.height - rect.origin.y; } void closeWindow(NSWindowRef window) diff --git a/indra/llwindow/llwindowmacosx.cpp b/indra/llwindow/llwindowmacosx.cpp index dadbc83f45..b3f9697867 100644 --- a/indra/llwindow/llwindowmacosx.cpp +++ b/indra/llwindow/llwindowmacosx.cpp @@ -985,7 +985,7 @@ bool LLWindowMacOSX::getPosition(LLCoordScreen *position) } else if(mWindow) { - const CGPoint & pos = getContentViewBoundsPosition(mWindow); + CGPoint pos = getContentViewRect(mWindow).origin; position->mX = pos.x; position->mY = pos.y; @@ -1012,7 +1012,7 @@ bool LLWindowMacOSX::getSize(LLCoordScreen *size) } else if(mWindow) { - const CGSize & sz = gHiDPISupport ? getDeviceContentViewSize(mWindow, mGLView) : getContentViewBoundsSize(mWindow); + CGSize sz = getBackingViewRect(mWindow, mGLView).size; size->mX = sz.width; size->mY = sz.height; @@ -1038,7 +1038,7 @@ bool LLWindowMacOSX::getSize(LLCoordWindow *size) } else if(mWindow) { - const CGSize & sz = gHiDPISupport ? getDeviceContentViewSize(mWindow, mGLView) : getContentViewBoundsSize(mWindow); + CGSize sz = getBackingViewRect(mWindow, mGLView).size; size->mX = sz.width; size->mY = sz.height; @@ -1485,8 +1485,9 @@ bool LLWindowMacOSX::convertCoords(LLCoordScreen from, LLCoordWindow* to) convertScreenToWindow(mWindow, mouse_point); - to->mX = mouse_point[0]; - to->mY = mouse_point[1]; + float scale_factor = getSystemUISize(); + to->mX = mouse_point[0] * scale_factor; + to->mY = mouse_point[1] * scale_factor; return true; } @@ -1498,9 +1499,9 @@ bool LLWindowMacOSX::convertCoords(LLCoordWindow from, LLCoordScreen *to) if(mWindow) { float mouse_point[2]; - - mouse_point[0] = from.mX; - mouse_point[1] = from.mY; + float scale_factor = getSystemUISize(); + mouse_point[0] = from.mX / scale_factor; + mouse_point[1] = from.mY / scale_factor; convertWindowToScreen(mWindow, mouse_point); @@ -2637,7 +2638,7 @@ MASK LLWindowMacOSX::modifiersToMask(S16 modifiers) F32 LLWindowMacOSX::getSystemUISize() { - return gHiDPISupport ? ::getDeviceUnitSize(mGLView) : LLWindow::getSystemUISize(); + return ::getDeviceUnitSize(mGLView); } #if LL_OS_DRAGDROP_ENABLED -- cgit v1.2.3 From fdf404c46165d4faa57678cc3b9ff6af4dda4a01 Mon Sep 17 00:00:00 2001 From: Rye Date: Wed, 20 Aug 2025 18:05:50 -0400 Subject: Speed up build and configure by only generating top level xcode project and enabling dependency buildsystem optimization --- indra/CMakeLists.txt | 2 ++ 1 file changed, 2 insertions(+) diff --git a/indra/CMakeLists.txt b/indra/CMakeLists.txt index 69dfe50553..62f8e0ff8b 100644 --- a/indra/CMakeLists.txt +++ b/indra/CMakeLists.txt @@ -35,6 +35,8 @@ if (NOT DEFINED CMAKE_CXX_STANDARD) set(CMAKE_CXX_STANDARD 20) endif() set(CMAKE_CXX_STANDARD_REQUIRED ON) +set(CMAKE_OPTIMIZE_DEPENDENCIES ON) +set(CMAKE_XCODE_GENERATE_TOP_LEVEL_PROJECT_ONLY ON) include(Variables) include(BuildVersion) -- cgit v1.2.3 From f5423d4517e2e5fb747b2141cb9b71780662c435 Mon Sep 17 00:00:00 2001 From: Andrey Kleshchev Date: Thu, 21 Aug 2025 01:27:08 +0300 Subject: #4570 Attemp to send logout message when lost network To not leave a ghost behind and for faster reconnect --- indra/newview/llappviewer.cpp | 22 ++++++++++++++++++++++ indra/newview/llappviewer.h | 4 ++++ 2 files changed, 26 insertions(+) diff --git a/indra/newview/llappviewer.cpp b/indra/newview/llappviewer.cpp index 3eb0479341..ac9464d86e 100644 --- a/indra/newview/llappviewer.cpp +++ b/indra/newview/llappviewer.cpp @@ -4530,6 +4530,7 @@ void LLAppViewer::forceDisconnect(const std::string& mesg) } else { + sendSimpleLogoutRequest(); args["MESSAGE"] = big_reason; LLNotificationsUtil::add("YouHaveBeenLoggedOut", args, LLSD(), &finish_disconnect ); } @@ -5310,6 +5311,27 @@ void LLAppViewer::sendLogoutRequest() } } +void LLAppViewer::sendSimpleLogoutRequest() +{ + if (!mLogoutRequestSent && gMessageSystem) + { + gLogoutInProgress = true; + + LLMessageSystem* msg = gMessageSystem; + msg->newMessageFast(_PREHASH_LogoutRequest); + msg->nextBlockFast(_PREHASH_AgentData); + msg->addUUIDFast(_PREHASH_AgentID, gAgent.getID()); + msg->addUUIDFast(_PREHASH_SessionID, gAgent.getSessionID()); + gAgent.sendReliableMessage(); + + LL_INFOS("Agent") << "Logging out as agent: " << gAgent.getID() << " Session: " << gAgent.getSessionID() << LL_ENDL; + + gLogoutTimer.reset(); + gLogoutMaxTime = LOGOUT_REQUEST_TIME; + mLogoutRequestSent = true; + } +} + void LLAppViewer::updateNameLookupUrl(const LLViewerRegion * regionp) { if (!regionp || !regionp->capabilitiesReceived()) diff --git a/indra/newview/llappviewer.h b/indra/newview/llappviewer.h index 132d7bfe25..e7de2d9b28 100644 --- a/indra/newview/llappviewer.h +++ b/indra/newview/llappviewer.h @@ -310,6 +310,10 @@ private: void sendLogoutRequest(); void disconnectViewer(); + // Does not create a marker file. For lost network case, + // to at least attempt to remove the ghost from the world. + void sendSimpleLogoutRequest(); + // *FIX: the app viewer class should be some sort of singleton, no? // Perhaps its child class is the singleton and this should be an abstract base. static LLAppViewer* sInstance; -- cgit v1.2.3 From 2a3fa6964507f133a599649efe58e350efc43fdf Mon Sep 17 00:00:00 2001 From: Andrey Kleshchev Date: Thu, 21 Aug 2025 19:30:52 +0300 Subject: #4591 Crash at LLWearableItemsList's ContextMenu --- indra/newview/llwearableitemslist.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/indra/newview/llwearableitemslist.cpp b/indra/newview/llwearableitemslist.cpp index 5fb22184c3..cc593fe7b4 100644 --- a/indra/newview/llwearableitemslist.cpp +++ b/indra/newview/llwearableitemslist.cpp @@ -994,8 +994,11 @@ void LLWearableItemsList::ContextMenu::updateItemsVisibility(LLContextMenu* menu LLUUID linked_id = item->getLinkedUUID(); LLViewerInventoryItem* linked_item = gInventory.getItem(linked_id); - can_favorite |= !linked_item->getIsFavorite(); - can_unfavorite |= linked_item->getIsFavorite(); + if (linked_item) + { + can_favorite |= !linked_item->getIsFavorite(); + can_unfavorite |= linked_item->getIsFavorite(); + } if (is_worn) { -- cgit v1.2.3 From e5ccf7a2a3288569eab210e9d29aeb9dd7964880 Mon Sep 17 00:00:00 2001 From: Rye Date: Fri, 22 Aug 2025 03:08:28 -0400 Subject: Remove dead code for macos versions 10.6 and older --- indra/llwindow/llopenglview-objc.h | 4 ---- indra/llwindow/llopenglview-objc.mm | 26 +++----------------------- indra/llwindow/llwindow.h | 1 - indra/llwindow/llwindowmacosx-objc.h | 1 - indra/llwindow/llwindowmacosx-objc.mm | 5 ----- indra/llwindow/llwindowmacosx.h | 3 --- indra/newview/llappviewer.cpp | 11 ----------- 7 files changed, 3 insertions(+), 48 deletions(-) diff --git a/indra/llwindow/llopenglview-objc.h b/indra/llwindow/llopenglview-objc.h index a528d7547f..028549b82e 100644 --- a/indra/llwindow/llopenglview-objc.h +++ b/indra/llwindow/llopenglview-objc.h @@ -42,7 +42,6 @@ unsigned int mMarkedTextLength; bool mMarkedTextAllowed; bool mSimulatedRightClick; - bool mOldResize; } - (id) initWithSamples:(NSUInteger)samples; - (id) initWithSamples:(NSUInteger)samples andVsync:(BOOL)vsync; @@ -50,8 +49,6 @@ - (void)commitCurrentPreedit; -- (void) setOldResize:(bool)oldresize; - // rebuildContext // Destroys and recreates a context with the view's internal format set via setPixelFormat; // Use this in event of needing to rebuild a context for whatever reason, without needing to assign a new pixel format. @@ -68,7 +65,6 @@ - (unsigned long) getVramSize; - (void) allowMarkedTextInput:(bool)allowed; -- (void) viewDidEndLiveResize; @end diff --git a/indra/llwindow/llopenglview-objc.mm b/indra/llwindow/llopenglview-objc.mm index 58a17227a7..3808418112 100644 --- a/indra/llwindow/llopenglview-objc.mm +++ b/indra/llwindow/llopenglview-objc.mm @@ -111,16 +111,6 @@ attributedStringInfo getSegments(NSAttributedString *str) @implementation LLOpenGLView -// Force a high quality update after live resizing -- (void) viewDidEndLiveResize -{ - if (mOldResize) //Maint-3135 - { - NSSize size = [self frame].size; - callResize(size.width, size.height); - } -} - - (unsigned long)getVramSize { CGLRendererInfoObj info = 0; @@ -175,18 +165,10 @@ attributedStringInfo getSegments(NSAttributedString *str) } } -- (void)setOldResize:(bool)oldresize -{ - mOldResize = oldresize; -} - - (void)windowResized:(NSNotification *)notification; { - if (!mOldResize) //Maint-3288 - { - NSSize dev_sz = [self convertSizeToBacking:[self frame].size]; - callResize(dev_sz.width, dev_sz.height); - } + NSSize dev_sz = [self convertSizeToBacking:[self frame].size]; + callResize(dev_sz.width, dev_sz.height); } - (void)windowWillMiniaturize:(NSNotification *)notification; @@ -291,9 +273,7 @@ attributedStringInfo getSegments(NSAttributedString *str) GLint swapInterval=0; [glContext setValues:&swapInterval forParameter:NSOpenGLContextParameterSwapInterval]; } - - mOldResize = false; - + return self; } diff --git a/indra/llwindow/llwindow.h b/indra/llwindow/llwindow.h index 151028113a..d0fa16b26a 100644 --- a/indra/llwindow/llwindow.h +++ b/indra/llwindow/llwindow.h @@ -147,7 +147,6 @@ public: virtual void swapBuffers() = 0; virtual void bringToFront() = 0; virtual void focusClient() { }; // this may not have meaning or be required on other platforms, therefore, it's not abstract - virtual void setOldResize(bool oldresize) { }; // handy coordinate space conversion routines // NB: screen to window and vice verse won't work on width/height coordinate pairs, // as the conversion must take into account left AND right border widths, etc. diff --git a/indra/llwindow/llwindowmacosx-objc.h b/indra/llwindow/llwindowmacosx-objc.h index fa0b8b8f38..b302a705da 100644 --- a/indra/llwindow/llwindowmacosx-objc.h +++ b/indra/llwindow/llwindowmacosx-objc.h @@ -100,7 +100,6 @@ bool isCGCursorVisible(); void hideNSCursorTillMove(bool hide); void requestUserAttention(); long showAlert(std::string title, std::string text, int type); -void setResizeMode(bool oldresize, void* glview); NSWindowRef createNSWindow(int x, int y, int width, int height); diff --git a/indra/llwindow/llwindowmacosx-objc.mm b/indra/llwindow/llwindowmacosx-objc.mm index 40341ea2e3..7f87111570 100644 --- a/indra/llwindow/llwindowmacosx-objc.mm +++ b/indra/llwindow/llwindowmacosx-objc.mm @@ -228,11 +228,6 @@ GLViewRef createOpenGLView(NSWindowRef window, unsigned int samples, bool vsync) return glview; } -void setResizeMode(bool oldresize, void* glview) -{ - [(LLOpenGLView *)glview setOldResize:oldresize]; -} - void glSwapBuffers(void* context) { [(NSOpenGLContext*)context flushBuffer]; diff --git a/indra/llwindow/llwindowmacosx.h b/indra/llwindow/llwindowmacosx.h index 7de1a40d93..110c5756d0 100644 --- a/indra/llwindow/llwindowmacosx.h +++ b/indra/llwindow/llwindowmacosx.h @@ -174,9 +174,6 @@ protected: bool shouldPostQuit() { return mPostQuit; } - //Satisfy MAINT-3135 and MAINT-3288 with a flag. - /*virtual */ void setOldResize(bool oldresize) override {setResizeMode(oldresize, mGLView); } - private: void restoreGLContext(); diff --git a/indra/newview/llappviewer.cpp b/indra/newview/llappviewer.cpp index 2c5c7b6348..88f6005dce 100644 --- a/indra/newview/llappviewer.cpp +++ b/indra/newview/llappviewer.cpp @@ -3172,17 +3172,6 @@ bool LLAppViewer::initWindow() LLNotificationsUI::LLNotificationManager::getInstance(); - -#ifdef LL_DARWIN - //Satisfy both MAINT-3135 (OSX 10.6 and earlier) MAINT-3288 (OSX 10.7 and later) - LLOSInfo& os_info = LLOSInfo::instance(); - if (os_info.mMajorVer == 10 && os_info.mMinorVer < 7) - { - if ( os_info.mMinorVer == 6 && os_info.mBuild < 8 ) - gViewerWindow->getWindow()->setOldResize(true); - } -#endif - if (gSavedSettings.getBOOL("WindowMaximized")) { gViewerWindow->getWindow()->maximize(); -- cgit v1.2.3 From a46d4f0f6923080d7c6e7d5267206e8c8d7a6ff9 Mon Sep 17 00:00:00 2001 From: Rye Date: Fri, 22 Aug 2025 03:32:02 -0400 Subject: Enable deprecation warnings and suppress a small handful that have no modern replacements --- indra/cmake/00-Common.cmake | 2 +- indra/llcommon/llmd5.cpp | 9 +++++++++ indra/llwindow/CMakeLists.txt | 2 +- indra/llwindow/llopenglview-objc.mm | 20 ++++++++++++++++++++ indra/llwindow/llwindowmacosx-objc.mm | 10 ++++++++++ indra/llwindow/llwindowmacosx.cpp | 10 ++++++++++ indra/newview/llviewerwindow.cpp | 8 ++++++++ 7 files changed, 59 insertions(+), 2 deletions(-) diff --git a/indra/cmake/00-Common.cmake b/indra/cmake/00-Common.cmake index c1f46a25a3..7ca58c7ea0 100644 --- a/indra/cmake/00-Common.cmake +++ b/indra/cmake/00-Common.cmake @@ -184,7 +184,7 @@ if (LINUX OR DARWIN) if (CMAKE_CXX_COMPILER_ID STREQUAL "Clang" OR CMAKE_CXX_COMPILER_ID STREQUAL "AppleClang") # libstdc++ headers contain deprecated declarations that fail on clang # macOS currently has many deprecated calls - add_compile_options(-Wno-unused-local-typedef -Wno-deprecated-declarations) + add_compile_options(-Wno-unused-local-typedef) endif() if (CMAKE_CXX_COMPILER_ID STREQUAL "GNU") diff --git a/indra/llcommon/llmd5.cpp b/indra/llcommon/llmd5.cpp index e999b8f597..c806c0ab2e 100644 --- a/indra/llcommon/llmd5.cpp +++ b/indra/llcommon/llmd5.cpp @@ -255,6 +255,11 @@ void LLMD5::raw_digest(unsigned char* s) const memcpy(s, digest, 16); /* Flawfinder: ignore */ } +#if LL_DARWIN +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wdeprecated-declarations" +#endif + void LLMD5::hex_digest(char* s) const { if (!finalized) @@ -273,6 +278,10 @@ void LLMD5::hex_digest(char* s) const s[32] = '\0'; } +#if LL_DARWIN +#pragma clang diagnostic push +#endif + std::ostream& operator<<(std::ostream& stream, const LLMD5& context) { char s[33]; /* Flawfinder: ignore */ diff --git a/indra/llwindow/CMakeLists.txt b/indra/llwindow/CMakeLists.txt index 01a7c303a9..08b3df87ab 100644 --- a/indra/llwindow/CMakeLists.txt +++ b/indra/llwindow/CMakeLists.txt @@ -107,7 +107,7 @@ if (DARWIN) llkeyboardmacosx.cpp llwindowmacosx.cpp PROPERTIES - COMPILE_FLAGS "-Wno-deprecated-declarations -fpascal-strings" + COMPILE_FLAGS "-fpascal-strings" ) endif (DARWIN) diff --git a/indra/llwindow/llopenglview-objc.mm b/indra/llwindow/llopenglview-objc.mm index 3808418112..f3aa164f92 100644 --- a/indra/llwindow/llopenglview-objc.mm +++ b/indra/llwindow/llopenglview-objc.mm @@ -212,6 +212,12 @@ attributedStringInfo getSegments(NSAttributedString *str) return [self initWithFrame:[self bounds] withSamples:samples andVsync:vsync]; } +#if LL_DARWIN +// For setView and opengl deprecation +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wdeprecated-declarations" +#endif + - (id) initWithFrame:(NSRect)frame withSamples:(NSUInteger)samples andVsync:(BOOL)vsync { [self registerForDraggedTypes:[NSArray arrayWithObject:NSPasteboardTypeURL]]; @@ -301,6 +307,10 @@ attributedStringInfo getSegments(NSAttributedString *str) return true; } +#if LL_DARWIN +#pragma clang diagnostic pop +#endif + - (CGLContextObj)getCGLContextObj { NSOpenGLContext *ctx = [self openGLContext]; @@ -647,6 +657,12 @@ attributedStringInfo getSegments(NSAttributedString *str) } } +#if LL_DARWIN +// For commitEditing deprecation +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wdeprecated-declarations" +#endif + - (void)commitCurrentPreedit { if (mHasMarkedText) @@ -658,6 +674,10 @@ attributedStringInfo getSegments(NSAttributedString *str) } } +#if LL_DARWIN +#pragma clang diagnostic pop +#endif + - (void)unmarkText { [[self inputContext] discardMarkedText]; diff --git a/indra/llwindow/llwindowmacosx-objc.mm b/indra/llwindow/llwindowmacosx-objc.mm index 7f87111570..42cd95be5d 100644 --- a/indra/llwindow/llwindowmacosx-objc.mm +++ b/indra/llwindow/llwindowmacosx-objc.mm @@ -162,11 +162,21 @@ void showNSCursor() [NSCursor unhide]; } +#if LL_DARWIN +// For CGCursorIsVisible no replacement in modern API +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wdeprecated-declarations" +#endif + bool isCGCursorVisible() { return CGCursorIsVisible(); } +#if LL_DARWIN +#pragma clang diagnostic pop +#endif + void hideNSCursorTillMove(bool hide) { [NSCursor setHiddenUntilMouseMoves:hide]; diff --git a/indra/llwindow/llwindowmacosx.cpp b/indra/llwindow/llwindowmacosx.cpp index b3f9697867..0e03b4e883 100644 --- a/indra/llwindow/llwindowmacosx.cpp +++ b/indra/llwindow/llwindowmacosx.cpp @@ -1224,6 +1224,12 @@ void LLWindowMacOSX::setMouseClipping( bool b ) adjustCursorDecouple(); } +#if LL_DARWIN +// For CGSetLocalEventsSuppressionInterval there is no replacement in modern API +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wdeprecated-declarations" +#endif + bool LLWindowMacOSX::setCursorPosition(const LLCoordWindow position) { bool result = false; @@ -1261,6 +1267,10 @@ bool LLWindowMacOSX::setCursorPosition(const LLCoordWindow position) return result; } +#if LL_DARWIN +#pragma clang diagnostic pop +#endif + bool LLWindowMacOSX::getCursorPosition(LLCoordWindow *position) { float cursor_point[2]; diff --git a/indra/newview/llviewerwindow.cpp b/indra/newview/llviewerwindow.cpp index fdd75f9c6c..2f943b4836 100644 --- a/indra/newview/llviewerwindow.cpp +++ b/indra/newview/llviewerwindow.cpp @@ -784,8 +784,16 @@ public: addText(xpos, ypos, "Projection Matrix"); ypos += y_inc; +#if LL_DARWIN +// For sprintf deprecation +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wdeprecated-declarations" +#endif // View last column is always <0,0,0,1> MATRIX_ROW_F32_TO_STR(gGLModelView, 12,camera_lines[3]); addText(xpos, ypos, std::string(camera_lines[3])); ypos += y_inc; +#if LL_DARWIN +#pragma clang diagnostic pop +#endif MATRIX_ROW_N32_TO_STR(gGLModelView, 8,camera_lines[2]); addText(xpos, ypos, std::string(camera_lines[2])); ypos += y_inc; MATRIX_ROW_N32_TO_STR(gGLModelView, 4,camera_lines[1]); addText(xpos, ypos, std::string(camera_lines[1])); ypos += y_inc; mBackRectCamera2.mTop = ypos + 2; MATRIX_ROW_N32_TO_STR(gGLModelView, 0,camera_lines[0]); addText(xpos, ypos, std::string(camera_lines[0])); ypos += y_inc; -- cgit v1.2.3 From 99ce597b54a9180cff0f8907e94833257b77e263 Mon Sep 17 00:00:00 2001 From: Rye Date: Thu, 27 Feb 2025 19:28:01 -0500 Subject: Fix texture filtering and address mode not updating for vast majority of textures when dirtied --- indra/llrender/llrender.cpp | 22 +++++++++++++++++++--- indra/llrender/llrender.h | 4 ++++ 2 files changed, 23 insertions(+), 3 deletions(-) diff --git a/indra/llrender/llrender.cpp b/indra/llrender/llrender.cpp index c26e9b15b8..4f646cdc33 100644 --- a/indra/llrender/llrender.cpp +++ b/indra/llrender/llrender.cpp @@ -207,6 +207,12 @@ void LLTexUnit::bindFast(LLTexture* texture) } glBindTexture(sGLTextureType[gl_tex->getTarget()], mCurrTexture); mHasMipMaps = gl_tex->mHasMipMaps; + if (gl_tex->mTexOptionsDirty) + { + gl_tex->mTexOptionsDirty = false; + setTextureAddressModeFast(gl_tex->mAddressMode); + setTextureFilteringOptionFast(gl_tex->mFilterOption); + } } bool LLTexUnit::bind(LLTexture* texture, bool for_rendering, bool forceBind) @@ -461,11 +467,16 @@ void LLTexUnit::setTextureAddressMode(eTextureAddressMode mode) activate(); - glTexParameteri (sGLTextureType[mCurrTexType], GL_TEXTURE_WRAP_S, sGLAddressMode[mode]); - glTexParameteri (sGLTextureType[mCurrTexType], GL_TEXTURE_WRAP_T, sGLAddressMode[mode]); + setTextureAddressModeFast(mode); +} + +void LLTexUnit::setTextureAddressModeFast(eTextureAddressMode mode) +{ + glTexParameteri(sGLTextureType[mCurrTexType], GL_TEXTURE_WRAP_S, sGLAddressMode[mode]); + glTexParameteri(sGLTextureType[mCurrTexType], GL_TEXTURE_WRAP_T, sGLAddressMode[mode]); if (mCurrTexType == TT_CUBE_MAP) { - glTexParameteri (GL_TEXTURE_CUBE_MAP, GL_TEXTURE_WRAP_R, sGLAddressMode[mode]); + glTexParameteri(GL_TEXTURE_CUBE_MAP, GL_TEXTURE_WRAP_R, sGLAddressMode[mode]); } } @@ -475,6 +486,11 @@ void LLTexUnit::setTextureFilteringOption(LLTexUnit::eTextureFilterOptions optio gGL.flush(); + setTextureFilteringOptionFast(option); +} + +void LLTexUnit::setTextureFilteringOptionFast(LLTexUnit::eTextureFilterOptions option) +{ if (option == TFO_POINT) { glTexParameteri(sGLTextureType[mCurrTexType], GL_TEXTURE_MAG_FILTER, GL_NEAREST); diff --git a/indra/llrender/llrender.h b/indra/llrender/llrender.h index 9e68c2dcd1..755aee4bd6 100644 --- a/indra/llrender/llrender.h +++ b/indra/llrender/llrender.h @@ -208,11 +208,15 @@ public: // Warning: this stays set for the bound texture forever, // make sure you want to permanently change the address mode for the bound texture. void setTextureAddressMode(eTextureAddressMode mode); + // MUST already be active and bound + void setTextureAddressModeFast(eTextureAddressMode mode); // Sets the filtering options used to sample the texture // Warning: this stays set for the bound texture forever, // make sure you want to permanently change the filtering for the bound texture. void setTextureFilteringOption(LLTexUnit::eTextureFilterOptions option); + // MUST already be active and bound + void setTextureFilteringOptionFast(LLTexUnit::eTextureFilterOptions option); static U32 getInternalType(eTextureType type); -- cgit v1.2.3 From f8a0878c785cdf5fbc146b9498ae126b51909f24 Mon Sep 17 00:00:00 2001 From: Rye Date: Fri, 22 Aug 2025 12:23:45 -0400 Subject: Fix Apple M GPU crash from nans slipping into the normal buffer by utilizing a non-float format --- 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 b18e01c646..4df8936d4d 100644 --- a/indra/newview/pipeline.cpp +++ b/indra/newview/pipeline.cpp @@ -346,7 +346,7 @@ void validate_framebuffer_object(); bool addDeferredAttachments(LLRenderTarget& target, bool for_impostor = false) { U32 orm = GL_RGBA; - U32 norm = GL_RGBA16F; + U32 norm = GL_RGBA16; U32 emissive = GL_RGB16F; static LLCachedControl has_emissive(gSavedSettings, "RenderEnableEmissiveBuffer", false); -- cgit v1.2.3 From 24aef9a98267ee07f3771f010b9e35de392e8355 Mon Sep 17 00:00:00 2001 From: Rye Date: Fri, 22 Aug 2025 13:12:43 -0400 Subject: Fix large performance drop when enabling AA on macOS/lower end GPU hardware --- indra/llrender/llimagegl.cpp | 1 + .../app_settings/shaders/class1/deferred/SMAA.glsl | 16 ++++- indra/newview/llgltfmaterialpreviewmgr.cpp | 10 +-- indra/newview/pipeline.cpp | 78 ++++++++++++++-------- indra/newview/pipeline.h | 3 +- 5 files changed, 72 insertions(+), 36 deletions(-) diff --git a/indra/llrender/llimagegl.cpp b/indra/llrender/llimagegl.cpp index 1db36d91f9..52738ec626 100644 --- a/indra/llrender/llimagegl.cpp +++ b/indra/llrender/llimagegl.cpp @@ -338,6 +338,7 @@ S32 LLImageGL::dataFormatBits(S32 dataformat) case GL_BGRA: return 32; // Used for QuickTime media textures on the Mac case GL_DEPTH_COMPONENT: return 24; case GL_DEPTH_COMPONENT24: return 24; + case GL_RGBA16: return 64; case GL_R16F: return 16; case GL_RG16F: return 32; case GL_RGB16F: return 48; diff --git a/indra/newview/app_settings/shaders/class1/deferred/SMAA.glsl b/indra/newview/app_settings/shaders/class1/deferred/SMAA.glsl index fdb77cce6e..5837308965 100644 --- a/indra/newview/app_settings/shaders/class1/deferred/SMAA.glsl +++ b/indra/newview/app_settings/shaders/class1/deferred/SMAA.glsl @@ -1351,6 +1351,10 @@ float4 SMAABlendingWeightCalculationPS(float2 texcoord, //----------------------------------------------------------------------------- // Neighborhood Blending Pixel Shader (Third Pass) +vec3 srgb_to_linear(vec3 cs); +vec4 srgb_to_linear4(vec4 cs); +vec3 linear_to_srgb(vec3 cl); + float4 SMAANeighborhoodBlendingPS(float2 texcoord, float4 offset, SMAATexture2D(colorTex), @@ -1369,6 +1373,7 @@ float4 SMAANeighborhoodBlendingPS(float2 texcoord, SMAA_BRANCH if (dot(a, float4(1.0, 1.0, 1.0, 1.0)) < 1e-5) { float4 color = SMAASampleLevelZero(colorTex, texcoord); + color.rgb = srgb_to_linear(color.rgb); #if SMAA_REPROJECTION float2 velocity = SMAA_DECODE_VELOCITY(SMAASampleLevelZero(velocityTex, texcoord)); @@ -1377,6 +1382,7 @@ float4 SMAANeighborhoodBlendingPS(float2 texcoord, color.a = sqrt(5.0 * length(velocity)); #endif + color.rgb = linear_to_srgb(color.rgb); return color; } else { bool h = max(a.x, a.z) > max(a.y, a.w); // max(horizontal) > max(vertical) @@ -1393,8 +1399,13 @@ float4 SMAANeighborhoodBlendingPS(float2 texcoord, // We exploit bilinear filtering to mix current pixel with the chosen // neighbor: - float4 color = blendingWeight.x * SMAASampleLevelZero(colorTex, blendingCoord.xy); - color += blendingWeight.y * SMAASampleLevelZero(colorTex, blendingCoord.zw); + float4 color = SMAASampleLevelZero(colorTex, blendingCoord.xy); + color.rgb = srgb_to_linear(color.rgb); + color = blendingWeight.x * color; + + float4 color2 = SMAASampleLevelZero(colorTex, blendingCoord.zw); + color2.rgb = srgb_to_linear(color2.rgb); + color += blendingWeight.y * color2; #if SMAA_REPROJECTION // Antialias velocity for proper reprojection in a later stage: @@ -1405,6 +1416,7 @@ float4 SMAANeighborhoodBlendingPS(float2 texcoord, color.a = sqrt(5.0 * length(velocity)); #endif + color.rgb = linear_to_srgb(color.rgb); return color; } } diff --git a/indra/newview/llgltfmaterialpreviewmgr.cpp b/indra/newview/llgltfmaterialpreviewmgr.cpp index da1f1a466f..5a6e9565ae 100644 --- a/indra/newview/llgltfmaterialpreviewmgr.cpp +++ b/indra/newview/llgltfmaterialpreviewmgr.cpp @@ -523,12 +523,12 @@ bool LLGLTFPreviewTexture::render() gPipeline.copyScreenSpaceReflections(&screen, &gPipeline.mSceneMap); gPipeline.generateLuminance(&screen, &gPipeline.mLuminanceMap); gPipeline.generateExposure(&gPipeline.mLuminanceMap, &gPipeline.mExposureMap, /*use_history = */ false); - gPipeline.gammaCorrect(&screen, &gPipeline.mPostMap); + gPipeline.gammaCorrect(&screen, &gPipeline.mPostPingMap); LLVertexBuffer::unbind(); - gPipeline.generateGlow(&gPipeline.mPostMap); - gPipeline.combineGlow(&gPipeline.mPostMap, &screen); - gPipeline.renderDoF(&screen, &gPipeline.mPostMap); - gPipeline.applyFXAA(&gPipeline.mPostMap, &screen); + gPipeline.generateGlow(&gPipeline.mPostPingMap); + gPipeline.combineGlow(&gPipeline.mPostPingMap, &screen); + gPipeline.renderDoF(&screen, &gPipeline.mPostPingMap); + gPipeline.applyFXAA(&gPipeline.mPostPingMap, &screen); // *HACK: Restore mExposureMap (it will be consumed by generateExposure next frame) gPipeline.mExposureMap.swapFBORefs(gPipeline.mLastExposure); diff --git a/indra/newview/pipeline.cpp b/indra/newview/pipeline.cpp index 4df8936d4d..0120e1487e 100644 --- a/indra/newview/pipeline.cpp +++ b/indra/newview/pipeline.cpp @@ -856,12 +856,12 @@ bool LLPipeline::allocateScreenBufferInternal(U32 resX, U32 resY) GLuint screenFormat = hdr ? GL_RGBA16F : GL_RGBA; - if (!mRT->screen.allocate(resX, resY, GL_RGBA16F)) return false; + if (!mRT->screen.allocate(resX, resY, screenFormat)) return false; mRT->deferredScreen.shareDepthBuffer(mRT->screen); - if (shadow_detail > 0 || ssao || RenderDepthOfField) - { //only need mRT->deferredLight for shadows OR ssao OR dof + if (hdr || shadow_detail > 0 || ssao || RenderDepthOfField) + { //only need mRT->deferredLight for hdr OR shadows OR ssao OR dof if (!mRT->deferredLight.allocate(resX, resY, screenFormat)) return false; } else @@ -907,7 +907,8 @@ bool LLPipeline::allocateScreenBufferInternal(U32 resX, U32 resY) mSceneMap.release(); } - mPostMap.allocate(resX, resY, screenFormat); + mPostPingMap.allocate(resX, resY, GL_RGBA); + mPostPongMap.allocate(resX, resY, GL_RGBA); // The water exclusion mask needs its own depth buffer so we can take care of the problem of multiple water planes. // Should we ever make water not just a plane, it also aids with that as well as the water planes will be rendered into the mask. @@ -1179,7 +1180,8 @@ void LLPipeline::releaseGLBuffers() mWaterExclusionMask.release(); - mPostMap.release(); + mPostPingMap.release(); + mPostPongMap.release(); mFXAAMap.release(); @@ -7585,14 +7587,14 @@ void LLPipeline::generateSMAABuffers(LLRenderTarget* src) { if (!use_sample) { - src->bindTexture(0, channel, LLTexUnit::TFO_POINT); - gGL.getTexUnit(channel)->setTextureAddressMode(LLTexUnit::TAM_CLAMP); + src->bindTexture(0, channel, LLTexUnit::TFO_BILINEAR); } else { gGL.getTexUnit(channel)->bindManual(LLTexUnit::TT_TEXTURE, mSMAASampleMap); - gGL.getTexUnit(channel)->setTextureAddressMode(LLTexUnit::TAM_CLAMP); + gGL.getTexUnit(channel)->setTextureFilteringOption(LLTexUnit::TFO_BILINEAR); } + gGL.getTexUnit(channel)->setTextureAddressMode(LLTexUnit::TAM_CLAMP); } //if (use_stencil) @@ -7986,7 +7988,7 @@ void LLPipeline::renderFinalize() static LLCachedControl has_hdr(gSavedSettings, "RenderHDREnabled", true); bool hdr = gGLManager.mGLVersion > 4.05f && has_hdr(); - + LLRenderTarget* postHDRBuffer = &mRT->screen; if (hdr) { copyScreenSpaceReflections(&mRT->screen, &mSceneMap); @@ -7995,22 +7997,31 @@ void LLPipeline::renderFinalize() generateExposure(&mLuminanceMap, &mExposureMap); - tonemap(&mRT->screen, &mPostMap); + tonemap(&mRT->screen, &mRT->deferredLight); - applyCAS(&mPostMap, &mRT->screen); + static LLCachedControl cas_sharpness(gSavedSettings, "RenderCASSharpness", 0.4f); + if (cas_sharpness != 0.0f && gCASProgram.isComplete()) + { + applyCAS(&mRT->deferredLight, &mRT->screen); + postHDRBuffer = &mRT->screen; + } + else + { + postHDRBuffer = &mRT->deferredLight; + } } - generateSMAABuffers(&mRT->screen); - - gammaCorrect(&mRT->screen, &mPostMap); + gammaCorrect(postHDRBuffer, &mPostPingMap); LLVertexBuffer::unbind(); - applySMAA(&mPostMap, &mRT->screen); + generateGlow(&mPostPingMap); - generateGlow(&mRT->screen); + LLRenderTarget* sourceBuffer = &mPostPingMap; + LLRenderTarget* targetBuffer = &mPostPongMap; - combineGlow(&mRT->screen, &mPostMap); + combineGlow(sourceBuffer, targetBuffer); + std::swap(sourceBuffer, targetBuffer); gGLViewport[0] = gViewerWindow->getWorldViewRectRaw().mLeft; gGLViewport[1] = gViewerWindow->getWorldViewRectRaw().mBottom; @@ -8018,13 +8029,24 @@ void LLPipeline::renderFinalize() gGLViewport[3] = gViewerWindow->getWorldViewRectRaw().getHeight(); glViewport(gGLViewport[0], gGLViewport[1], gGLViewport[2], gGLViewport[3]); - renderDoF(&mPostMap, &mRT->screen); + if((RenderDepthOfFieldInEditMode || !LLToolMgr::getInstance()->inBuildMode()) && + RenderDepthOfField && + !gCubeSnapshot) + { + renderDoF(sourceBuffer, targetBuffer); + std::swap(sourceBuffer, targetBuffer); + } - LLRenderTarget* finalBuffer = &mRT->screen; - if (RenderFSAAType == 1) + if (RenderFSAAType == 1) + { + applyFXAA(sourceBuffer, targetBuffer); + std::swap(sourceBuffer, targetBuffer); + } + else if (RenderFSAAType == 2) { - applyFXAA(&mRT->screen, &mPostMap); - finalBuffer = &mPostMap; + generateSMAABuffers(sourceBuffer); + applySMAA(sourceBuffer, targetBuffer); + std::swap(sourceBuffer, targetBuffer); } if (RenderBufferVisualization > -1) @@ -8035,16 +8057,16 @@ void LLPipeline::renderFinalize() case 1: case 2: case 3: - visualizeBuffers(&mRT->deferredScreen, finalBuffer, RenderBufferVisualization); + visualizeBuffers(&mRT->deferredScreen, sourceBuffer, RenderBufferVisualization); break; case 4: - visualizeBuffers(&mLuminanceMap, finalBuffer, 0); + visualizeBuffers(&mLuminanceMap, sourceBuffer, 0); break; case 5: { if (RenderFSAAType > 0) { - visualizeBuffers(&mFXAAMap, finalBuffer, 0); + visualizeBuffers(&mFXAAMap, sourceBuffer, 0); } break; } @@ -8052,7 +8074,7 @@ void LLPipeline::renderFinalize() { if (RenderFSAAType == 2) { - visualizeBuffers(&mSMAABlendBuffer, finalBuffer, 0); + visualizeBuffers(&mSMAABlendBuffer, sourceBuffer, 0); } break; } @@ -8066,10 +8088,10 @@ void LLPipeline::renderFinalize() gDeferredPostNoDoFNoiseProgram.bind(); // Add noise as part of final render to screen pass to avoid damaging other post effects // Whatever is last in the above post processing chain should _always_ be rendered directly here. If not, expect problems. - gDeferredPostNoDoFNoiseProgram.bindTexture(LLShaderMgr::DEFERRED_DIFFUSE, finalBuffer); + gDeferredPostNoDoFNoiseProgram.bindTexture(LLShaderMgr::DEFERRED_DIFFUSE, sourceBuffer); gDeferredPostNoDoFNoiseProgram.bindTexture(LLShaderMgr::DEFERRED_DEPTH, &mRT->deferredScreen, true); - gDeferredPostNoDoFNoiseProgram.uniform2f(LLShaderMgr::DEFERRED_SCREEN_RES, (GLfloat)finalBuffer->getWidth(), (GLfloat)finalBuffer->getHeight()); + gDeferredPostNoDoFNoiseProgram.uniform2f(LLShaderMgr::DEFERRED_SCREEN_RES, (GLfloat)sourceBuffer->getWidth(), (GLfloat)sourceBuffer->getHeight()); { LLGLDepthTest depth_test(GL_TRUE, GL_TRUE, GL_ALWAYS); diff --git a/indra/newview/pipeline.h b/indra/newview/pipeline.h index 315e38ed8c..b3796a6feb 100644 --- a/indra/newview/pipeline.h +++ b/indra/newview/pipeline.h @@ -730,7 +730,8 @@ public: LLRenderTarget mLastExposure; // tonemapped and gamma corrected render ready for post - LLRenderTarget mPostMap; + LLRenderTarget mPostPingMap; + LLRenderTarget mPostPongMap; // FXAA helper target LLRenderTarget mFXAAMap; -- cgit v1.2.3 From 3f65a4bfec71a9950a541f9e6195a572a0622b48 Mon Sep 17 00:00:00 2001 From: Rye Date: Fri, 22 Aug 2025 13:13:03 -0400 Subject: Fix test build on macOS --- indra/integration_tests/llimage_libtest/CMakeLists.txt | 2 -- indra/llcorehttp/tests/test_httprequest.hpp | 6 +++--- indra/llfilesystem/tests/lldir_test.cpp | 2 +- 3 files changed, 4 insertions(+), 6 deletions(-) diff --git a/indra/integration_tests/llimage_libtest/CMakeLists.txt b/indra/integration_tests/llimage_libtest/CMakeLists.txt index 84d1feb758..e6ff142626 100644 --- a/indra/integration_tests/llimage_libtest/CMakeLists.txt +++ b/indra/integration_tests/llimage_libtest/CMakeLists.txt @@ -33,8 +33,6 @@ target_link_libraries(llimage_libtest llfilesystem llmath llimage - llkdu - llimagej2coj ) # Ensure people working on the viewer don't break this library diff --git a/indra/llcorehttp/tests/test_httprequest.hpp b/indra/llcorehttp/tests/test_httprequest.hpp index 1afc08a108..77ed8df066 100644 --- a/indra/llcorehttp/tests/test_httprequest.hpp +++ b/indra/llcorehttp/tests/test_httprequest.hpp @@ -2786,7 +2786,7 @@ void HttpRequestTestObjectType::test<22>() for (int i(0); i < test_count; ++i) { char buffer[128]; - sprintf(buffer, "/bug2295/%d/", i); + snprintf(buffer, sizeof(buffer), "/bug2295/%d/", i); HttpHandle handle = req->requestGetByteRange(HttpRequest::DEFAULT_POLICY_ID, url_base + buffer, 0, @@ -2817,7 +2817,7 @@ void HttpRequestTestObjectType::test<22>() for (int i(0); i < test2_count; ++i) { char buffer[128]; - sprintf(buffer, "/bug2295/00000012/%d/", i); + snprintf(buffer, sizeof(buffer), "/bug2295/00000012/%d/", i); HttpHandle handle = req->requestGetByteRange(HttpRequest::DEFAULT_POLICY_ID, url_base + buffer, 0, @@ -2848,7 +2848,7 @@ void HttpRequestTestObjectType::test<22>() for (int i(0); i < test3_count; ++i) { char buffer[128]; - sprintf(buffer, "/bug2295/inv_cont_range/%d/", i); + snprintf(buffer, sizeof(buffer), "/bug2295/inv_cont_range/%d/", i); HttpHandle handle = req->requestGetByteRange(HttpRequest::DEFAULT_POLICY_ID, url_base + buffer, 0, diff --git a/indra/llfilesystem/tests/lldir_test.cpp b/indra/llfilesystem/tests/lldir_test.cpp index 6e191ad096..d7d57fa86f 100644 --- a/indra/llfilesystem/tests/lldir_test.cpp +++ b/indra/llfilesystem/tests/lldir_test.cpp @@ -435,7 +435,7 @@ namespace tut for (counter=0, foundUnused=false; !foundUnused; counter++ ) { char counterStr[3]; - sprintf(counterStr, "%02d", counter); + snprintf(counterStr, sizeof(counterStr), "%02d", counter); uniqueDir = dirbase + counterStr; foundUnused = ! ( LLFile::isdir(uniqueDir) || LLFile::isfile(uniqueDir) ); } -- cgit v1.2.3 From 1022be69862db187594f2971fa9602d46f13e372 Mon Sep 17 00:00:00 2001 From: Andrey Kleshchev Date: Thu, 21 Aug 2025 21:55:25 +0300 Subject: #4570 Sanity check bandwidth input Going above this will just make server throttle things and viewer's own throttlig won't be effective when viewer can't keep up. --- indra/newview/lltexturefetch.cpp | 6 +++--- indra/newview/lltextureview.cpp | 3 ++- indra/newview/llviewerthrottle.cpp | 11 ++++++++++- indra/newview/llviewerthrottle.h | 1 + 4 files changed, 16 insertions(+), 5 deletions(-) diff --git a/indra/newview/lltexturefetch.cpp b/indra/newview/lltexturefetch.cpp index cc187a1f98..93b5806acf 100644 --- a/indra/newview/lltexturefetch.cpp +++ b/indra/newview/lltexturefetch.cpp @@ -49,6 +49,7 @@ #include "llviewerregion.h" #include "llviewerstats.h" #include "llviewerstatsrecorder.h" +#include "llviewerthrottle.h" #include "llviewerassetstats.h" #include "llworld.h" #include "llsdparam.h" @@ -2434,7 +2435,7 @@ LLTextureFetch::LLTextureFetch(LLTextureCache* cache, bool threaded, bool qa_mod mOriginFetchSource(LLTextureFetch::FROM_ALL), mTextureInfoMainThread(false) { - mMaxBandwidth = gSavedSettings.getF32("ThrottleBandwidthKBPS"); + mMaxBandwidth = LLViewerThrottle::getMaxBandwidthKbps(); mTextureInfo.setLogging(true); LLAppCoreHttp & app_core_http(LLAppViewer::instance()->getAppCoreHttp()); @@ -2953,11 +2954,10 @@ void LLTextureFetch::commonUpdate() size_t LLTextureFetch::update(F32 max_time_ms) { LL_PROFILE_ZONE_SCOPED; - static LLCachedControl band_width(gSavedSettings,"ThrottleBandwidthKBPS", 3000.0); { mNetworkQueueMutex.lock(); // +Mfnq - mMaxBandwidth = band_width(); + mMaxBandwidth = LLViewerThrottle::getMaxBandwidthKbps(); add(LLStatViewer::TEXTURE_NETWORK_DATA_RECEIVED, mHTTPTextureBits); mHTTPTextureBits = (U32Bits)0; diff --git a/indra/newview/lltextureview.cpp b/indra/newview/lltextureview.cpp index 8560a01c4b..8cbede8303 100644 --- a/indra/newview/lltextureview.cpp +++ b/indra/newview/lltextureview.cpp @@ -49,6 +49,7 @@ #include "llviewerobjectlist.h" #include "llviewertexture.h" #include "llviewertexturelist.h" +#include "llviewerthrottle.h" #include "llviewerwindow.h" #include "llwindow.h" #include "llvovolume.h" @@ -633,7 +634,7 @@ void LLGLTexMemBar::draw() LLFontGL::NORMAL, LLFontGL::NO_SHADOW, S32_MAX, S32_MAX, &x_right); F32Kilobits bandwidth(LLAppViewer::getTextureFetch()->getTextureBandwidth()); - F32Kilobits max_bandwidth(gSavedSettings.getF32("ThrottleBandwidthKBPS")); + F32Kilobits max_bandwidth(LLViewerThrottle::getMaxBandwidthKbps()); color = bandwidth > max_bandwidth ? LLColor4::red : bandwidth > max_bandwidth*.75f ? LLColor4::yellow : text_color; color[VALPHA] = text_color[VALPHA]; text = llformat("BW:%.0f/%.0f",bandwidth.value(), max_bandwidth.value()); diff --git a/indra/newview/llviewerthrottle.cpp b/indra/newview/llviewerthrottle.cpp index 8d935e4243..3ccfbea6e2 100644 --- a/indra/newview/llviewerthrottle.cpp +++ b/indra/newview/llviewerthrottle.cpp @@ -225,7 +225,7 @@ void LLViewerThrottle::setMaxBandwidth(F32 kbits_per_second, bool from_event) void LLViewerThrottle::load() { - mMaxBandwidth = gSavedSettings.getF32("ThrottleBandwidthKBPS")*1024; + mMaxBandwidth = getMaxBandwidthKbps() * 1024; resetDynamicThrottle(); mCurrent.dump(); } @@ -242,6 +242,15 @@ void LLViewerThrottle::sendToSim() const mCurrent.sendToSim(); } +F32 LLViewerThrottle::getMaxBandwidthKbps() +{ + constexpr F32 MIN_BANDWIDTH = 100.0f; // 100 Kbps + constexpr F32 MAX_BANDWIDTH = 10000.0f; // 10 Mbps + + static LLCachedControl bandwidth(gSavedSettings, "ThrottleBandwidthKBPS", 3000.0); + return llclamp(bandwidth(), MIN_BANDWIDTH, MAX_BANDWIDTH); +} + LLViewerThrottleGroup LLViewerThrottle::getThrottleGroup(const F32 bandwidth_kbps) { diff --git a/indra/newview/llviewerthrottle.h b/indra/newview/llviewerthrottle.h index 9973c88549..ef898a97d7 100644 --- a/indra/newview/llviewerthrottle.h +++ b/indra/newview/llviewerthrottle.h @@ -64,6 +64,7 @@ public: void save() const; void sendToSim() const; + static F32 getMaxBandwidthKbps(); F32 getMaxBandwidth()const { return mMaxBandwidth; } F32 getCurrentBandwidth() const { return mCurrentBandwidth; } -- cgit v1.2.3 From cefee59b0e5fff683a50fe61633a9c14493d7145 Mon Sep 17 00:00:00 2001 From: Callum Linden <113564339+callumlinden@users.noreply.github.com> Date: Fri, 22 Aug 2025 16:21:31 -0700 Subject: Improved open performance for some web based UI floaters by preloading the web content during login (#4574) * First phase of some work to replace certain UI web based floaters with a much more simple floater (no more browserish web-content-floater) and then pre-load content as login is progressing. This means that after login, the floater can be opened much more rapidly than now. This first commit does this process for the Search floater * This commit brings in a new marketplace floater than hosts the marketplace web page (no more webcontent floater here either). It works as expected and opens quickly but the user is not logged in when the page is opened so that needs to be tackled before we can declare that this is a viable solution * This commit introduces a way to set the openID cookie that arrives via login.cgi into all the instances that are preloaded - the result is that when you open the preloaded floater after login, you are logged into your linden account * Fix a mac only warning as error - function overrides a member function but is not marked 'override' * Marchcat spotted left over cruft from earlier dev when we used a trimmed down URL for the pre-load search. Now we use the same search URL throughout and zero out the query parameters --- indra/newview/CMakeLists.txt | 2 + indra/newview/llfloatermarketplace.cpp | 47 ++++++ indra/newview/llfloatermarketplace.h | 40 +++++ indra/newview/llfloatersearch.cpp | 183 ++++++++------------- indra/newview/llfloatersearch.h | 82 ++------- indra/newview/llstatusbar.cpp | 8 +- indra/newview/llstatusbar.h | 1 + indra/newview/llviewerfloaterreg.cpp | 3 + indra/newview/llviewermedia.cpp | 65 +++++--- indra/newview/llviewermenu.cpp | 7 - indra/newview/llviewerwindow.cpp | 12 ++ .../skins/default/xui/da/floater_search.xml | 16 -- .../skins/default/xui/de/floater_search.xml | 16 -- .../skins/default/xui/en/floater_marketplace.xml | 26 +++ .../skins/default/xui/en/floater_search.xml | 40 +++-- .../skins/default/xui/es/floater_search.xml | 16 -- .../skins/default/xui/fr/floater_search.xml | 16 -- .../skins/default/xui/it/floater_search.xml | 16 -- .../skins/default/xui/ja/floater_search.xml | 16 -- .../skins/default/xui/pt/floater_search.xml | 16 -- .../skins/default/xui/ru/floater_search.xml | 16 -- .../skins/default/xui/tr/floater_search.xml | 16 -- .../skins/default/xui/zh/floater_search.xml | 16 -- 23 files changed, 289 insertions(+), 387 deletions(-) create mode 100644 indra/newview/llfloatermarketplace.cpp create mode 100644 indra/newview/llfloatermarketplace.h delete mode 100644 indra/newview/skins/default/xui/da/floater_search.xml delete mode 100644 indra/newview/skins/default/xui/de/floater_search.xml create mode 100644 indra/newview/skins/default/xui/en/floater_marketplace.xml delete mode 100644 indra/newview/skins/default/xui/es/floater_search.xml delete mode 100644 indra/newview/skins/default/xui/fr/floater_search.xml delete mode 100644 indra/newview/skins/default/xui/it/floater_search.xml delete mode 100644 indra/newview/skins/default/xui/ja/floater_search.xml delete mode 100644 indra/newview/skins/default/xui/pt/floater_search.xml delete mode 100644 indra/newview/skins/default/xui/ru/floater_search.xml delete mode 100644 indra/newview/skins/default/xui/tr/floater_search.xml delete mode 100644 indra/newview/skins/default/xui/zh/floater_search.xml diff --git a/indra/newview/CMakeLists.txt b/indra/newview/CMakeLists.txt index 62af812971..f2aec208a1 100644 --- a/indra/newview/CMakeLists.txt +++ b/indra/newview/CMakeLists.txt @@ -393,6 +393,7 @@ set(viewer_SOURCE_FILES llmaniprotate.cpp llmanipscale.cpp llmaniptranslate.cpp + llfloatermarketplace.cpp llmarketplacefunctions.cpp llmarketplacenotifications.cpp llmaterialeditor.cpp @@ -930,6 +931,7 @@ set(viewer_HEADER_FILES llfloaterlinkreplace.h llfloaterloadprefpreset.h llfloatermap.h + llfloatermarketplace.h llfloatermarketplacelistings.h llfloatermediasettings.h llfloatermemleak.h diff --git a/indra/newview/llfloatermarketplace.cpp b/indra/newview/llfloatermarketplace.cpp new file mode 100644 index 0000000000..889daf84ab --- /dev/null +++ b/indra/newview/llfloatermarketplace.cpp @@ -0,0 +1,47 @@ +/** + * @file llfloatermarketplace.cpp + * @brief floater for the Marketplace web site + * + * $LicenseInfo:firstyear=2011&license=viewerlgpl$ + * Second Life Viewer Source Code + * Copyright (C) 2011, Linden Research, Inc. + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; + * version 2.1 of the License only. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + * + * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA + * $/LicenseInfo$ + */ + +#include "llviewerprecompiledheaders.h" + +#include "llfloatermarketplace.h" +#include "lluictrlfactory.h" + +LLFloaterMarketplace::LLFloaterMarketplace(const LLSD& key) + : LLFloater(key) +{ +} + +LLFloaterMarketplace::~LLFloaterMarketplace() +{ +} + +bool LLFloaterMarketplace::postBuild() +{ + enableResizeCtrls(true, true, false); + return true; +} + + diff --git a/indra/newview/llfloatermarketplace.h b/indra/newview/llfloatermarketplace.h new file mode 100644 index 0000000000..2ae4d0d64a --- /dev/null +++ b/indra/newview/llfloatermarketplace.h @@ -0,0 +1,40 @@ +/** + * @file llfloatermarketplace.h + * @brief floater for the Marketplace web site + * + * $LicenseInfo:firstyear=2011&license=viewerlgpl$ + * Second Life Viewer Source Code + * Copyright (C) 2011, Linden Research, Inc. + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; + * version 2.1 of the License only. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + * + * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA + * $/LicenseInfo$ + */ + +#pragma once + +#include "llfloater.h" + +class LLFloaterMarketplace: + public LLFloater +{ + friend class LLFloaterReg; +private: + LLFloaterMarketplace(const LLSD& key); + ~LLFloaterMarketplace(); + bool postBuild() override; +}; + diff --git a/indra/newview/llfloatersearch.cpp b/indra/newview/llfloatersearch.cpp index d3c8bf3451..9762154a26 100644 --- a/indra/newview/llfloatersearch.cpp +++ b/indra/newview/llfloatersearch.cpp @@ -1,11 +1,10 @@ /** * @file llfloatersearch.cpp - * @author Martin Reddy - * @brief Search floater - uses an embedded web browser control + * @brief Floater for Search (update 2025, preload) * - * $LicenseInfo:firstyear=2009&license=viewerlgpl$ + * $LicenseInfo:firstyear=2011&license=viewerlgpl$ * Second Life Viewer Source Code - * Copyright (C) 2010, Linden Research, Inc. + * Copyright (C) 2011, Linden Research, Inc. * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -27,68 +26,34 @@ #include "llviewerprecompiledheaders.h" +#include "llfloatersearch.h" + +#include "llagent.h" #include "llcommandhandler.h" #include "llfloaterreg.h" -#include "llfloatersearch.h" -#include "llhttpconstants.h" #include "llmediactrl.h" -#include "llnotificationsutil.h" -#include "lllogininstance.h" -#include "lluri.h" -#include "llagent.h" -#include "llui.h" +#include "lluictrlfactory.h" #include "llviewercontrol.h" #include "llweb.h" // support secondlife:///app/search/{CATEGORY}/{QUERY} SLapps -class LLSearchHandler : public LLCommandHandler -{ -public: - // requires trusted browser to trigger - LLSearchHandler() : LLCommandHandler("search", UNTRUSTED_CLICK_ONLY) { } - bool handle(const LLSD& tokens, const LLSD& query_map, const std::string& grid, LLMediaCtrl* web) - { - const size_t parts = tokens.size(); - - // get the (optional) category for the search - std::string collection; - if (parts > 0) - { - collection = tokens[0].asString(); +class LLSearchHandler : public LLCommandHandler { + public: + // requires trusted browser to trigger + LLSearchHandler() : LLCommandHandler("search", UNTRUSTED_CLICK_ONLY) { } + bool handle(const LLSD& tokens, const LLSD& query_map, const std::string& grid, LLMediaCtrl* web) { + const size_t parts = tokens.size(); + + // open the search floater and perform the requested search + LLFloaterReg::showInstance("search", tokens); + return true; } - - // get the (optional) search string - std::string search_text; - if (parts > 1) - { - search_text = tokens[1].asString(); - } - - // create the LLSD arguments for the search floater - LLFloaterSearch::Params p; - p.search.collection = collection; - p.search.query = LLURI::unescape(search_text); - - // open the search floater and perform the requested search - LLFloaterReg::showInstance("search", p); - return true; - } }; LLSearchHandler gSearchHandler; -LLFloaterSearch::SearchQuery::SearchQuery() -: category("category", ""), - collection("collection", ""), - query("query") -{} - -LLFloaterSearch::LLFloaterSearch(const Params& key) : - LLFloaterWebContent(key), - mSearchGodLevel(0) +LLFloaterSearch::LLFloaterSearch(const LLSD& key) + : LLFloater(key) { - // declare a map that transforms a category name into - // the URL suffix that is used to search that category - mSearchType.insert("standard"); mSearchType.insert("land"); mSearchType.insert("classified"); @@ -100,76 +65,61 @@ LLFloaterSearch::LLFloaterSearch(const Params& key) : mCollectionType.insert("people"); } -bool LLFloaterSearch::postBuild() +LLFloaterSearch::~LLFloaterSearch() { - LLFloaterWebContent::postBuild(); - mWebBrowser->addObserver(this); - - return true; } -void LLFloaterSearch::onOpen(const LLSD& key) +void LLFloaterSearch::onOpen(const LLSD& tokens) { - Params p(key); - p.trusted_content = true; - p.allow_address_entry = false; - - LLFloaterWebContent::onOpen(p); - mWebBrowser->setFocus(true); - search(p.search); + initiateSearch(tokens); } -void LLFloaterSearch::onClose(bool app_quitting) +void LLFloaterSearch::initiateSearch(const LLSD& tokens) { - LLFloaterWebContent::onClose(app_quitting); - // tear down the web view so we don't show the previous search - // result when the floater is opened next time - destroy(); -} + std::string url = gSavedSettings.getString("SearchURL"); -void LLFloaterSearch::godLevelChanged(U8 godlevel) -{ - // search results can change based upon god level - if the user - // changes god level, then give them a warning (we don't refresh - // the search as this might undo any page navigation or - // AJAX-driven changes since the last search). + LLSD subs; - //FIXME: set status bar text + // Setting this substitution here results in a full set of collections being + // substituted into the final URL using the logic from the original search. + subs["TYPE"] = "standard"; - //getChildView("refresh_search")->setVisible( (godlevel != mSearchGodLevel)); -} + const size_t parts = tokens.size(); -void LLFloaterSearch::search(const SearchQuery &p) -{ - if (! mWebBrowser || !p.validateBlock()) + // get the (optional) category for the search + std::string collection; + if (parts > 0) { - return; + collection = tokens[0].asString(); } - // reset the god level warning as we're sending the latest state - getChildView("refresh_search")->setVisible(false); - mSearchGodLevel = gAgent.getGodLevel(); + // get the (optional) search string + std::string search_text; + if (parts > 1) + { + search_text = tokens[1].asString(); + } - // work out the subdir to use based on the requested category - LLSD subs; - if (mSearchType.find(p.category) != mSearchType.end()) + // TODO: where does category get set? I cannot find a reference to + // it in internal docs - might be conflated with values in mSearchType + std::string category; + if (mSearchType.find(category) != mSearchType.end()) { - subs["TYPE"] = p.category; + subs["TYPE"] = category; } else { subs["TYPE"] = "standard"; } - // add the search query string - subs["QUERY"] = LLURI::escape(p.query); + subs["QUERY"] = LLURI::escape(search_text); subs["COLLECTION"] = ""; if (subs["TYPE"] == "standard") { - if (mCollectionType.find(p.collection) != mCollectionType.end()) + if (mCollectionType.find(collection) != mCollectionType.end()) { - subs["COLLECTION"] = "&collection_chosen=" + std::string(p.collection); + subs["COLLECTION"] = "&collection_chosen=" + std::string(collection); } else { @@ -182,30 +132,41 @@ void LLFloaterSearch::search(const SearchQuery &p) } } - // add the user's preferred maturity (can be changed via prefs) - std::string maturity; + // Default to PG + std::string maturity = "g"; if (gAgent.prefersAdult()) { - maturity = "gma"; // PG,Mature,Adult + // PG,Mature,Adult + maturity = "gma"; } else if (gAgent.prefersMature()) { - maturity = "gm"; // PG,Mature - } - else - { - maturity = "g"; // PG + // PG,Mature + maturity = "gm"; } subs["MATURITY"] = maturity; - // add the user's god status + // God status subs["GODLIKE"] = gAgent.isGodlike() ? "1" : "0"; - // get the search URL and expand all of the substitutions - // (also adds things like [LANGUAGE], [VERSION], [OS], etc.) - std::string url = gSavedSettings.getString("SearchURL"); + // This call expands a set of generic substitutions like language, viewer version + // etc. and then also does the same with the list of subs passed in. url = LLWeb::expandURLSubstitutions(url, subs); - // and load the URL in the web view - mWebBrowser->navigateTo(url, HTTP_CONTENT_TEXT_HTML); + // Naviation to the calculated URL - we know it's HTML so we can + // tell the media system not to bother with the MIME type check. + LLMediaCtrl* search_browser = findChild("search_contents"); + search_browser->navigateTo(url, HTTP_CONTENT_TEXT_HTML); +} + +bool LLFloaterSearch::postBuild() +{ + enableResizeCtrls(true, true, false); + + // This call is actioned by the preload code in llViewerWindow + // that creates the search floater during the login process + // using a generic search with no query + initiateSearch(LLSD()); + + return true; } diff --git a/indra/newview/llfloatersearch.h b/indra/newview/llfloatersearch.h index beaac2ad2f..e8a2be4797 100644 --- a/indra/newview/llfloatersearch.h +++ b/indra/newview/llfloatersearch.h @@ -1,11 +1,10 @@ /** * @file llfloatersearch.h - * @author Martin Reddy - * @brief Search floater - uses an embedded web browser control + * @brief Floater for Search (update 2025, preload) * - * $LicenseInfo:firstyear=2009&license=viewerlgpl$ + * $LicenseInfo:firstyear=2011&license=viewerlgpl$ * Second Life Viewer Source Code - * Copyright (C) 2010, Linden Research, Inc. + * Copyright (C) 2011, Linden Research, Inc. * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -25,70 +24,23 @@ * $/LicenseInfo$ */ -#ifndef LL_LLFLOATERSEARCH_H -#define LL_LLFLOATERSEARCH_H +#pragma once -#include "llfloaterwebcontent.h" -#include "llviewermediaobserver.h" +#include "llfloater.h" -#include +class LLFloaterSearch: + public LLFloater { + friend class LLFloaterReg; -class LLMediaCtrl; + public: + void onOpen(const LLSD& key) override; -/// -/// The search floater allows users to perform all search operations. -/// All search functionality is now implemented via web services and -/// so this floater simply embeds a web view and displays the search -/// web page. The browser control is explicitly marked as "trusted" -/// so that the user can click on teleport links in search results. -/// -class LLFloaterSearch : - public LLFloaterWebContent -{ -public: - struct SearchQuery : public LLInitParam::Block - { - Optional category; - Optional collection; - Optional query; + private: + LLFloaterSearch(const LLSD& key); + ~LLFloaterSearch(); + void initiateSearch(const LLSD& tokens); + bool postBuild() override; - SearchQuery(); - }; - - struct _Params : public LLInitParam::Block<_Params, LLFloaterWebContent::Params> - { - Optional search; - }; - - typedef LLSDParamAdapter<_Params> Params; - - LLFloaterSearch(const Params& key); - - /// show the search floater with a new search - /// see search() for details on the key parameter. - /*virtual*/ void onOpen(const LLSD& key); - - /*virtual*/ void onClose(bool app_quitting); - - /// perform a search with the specific search term. - /// The key should be a map that can contain the following keys: - /// - "id": specifies the text phrase to search for - /// - "category": one of "all" (default), "people", "places", - /// "events", "groups", "wiki", "destinations", "classifieds" - void search(const SearchQuery &query); - - /// changing godmode can affect the search results that are - /// returned by the search website - use this method to tell the - /// search floater that the user has changed god level. - void godLevelChanged(U8 godlevel); - -private: - /*virtual*/ bool postBuild(); - - std::set mSearchType; - std::set mCollectionType; - U8 mSearchGodLevel; + std::set mSearchType; + std::set mCollectionType; }; - -#endif // LL_LLFLOATERSEARCH_H - diff --git a/indra/newview/llstatusbar.cpp b/indra/newview/llstatusbar.cpp index bb93e2e79e..82c959d7f7 100644 --- a/indra/newview/llstatusbar.cpp +++ b/indra/newview/llstatusbar.cpp @@ -161,7 +161,8 @@ bool LLStatusBar::postBuild() getChild("buyL")->setCommitCallback( boost::bind(&LLStatusBar::onClickBuyCurrency, this)); - getChild("goShop")->setCommitCallback(boost::bind(&LLWeb::loadURL, gSavedSettings.getString("MarketplaceURL"), LLStringUtil::null, LLStringUtil::null)); + getChild("goShop")->setCommitCallback( + boost::bind(&LLStatusBar::onClickShop, this)); mBoxBalance = getChild("balance"); mBoxBalance->setClickedCallback(&LLStatusBar::onClickRefreshBalance, this); @@ -520,6 +521,11 @@ void LLStatusBar::onClickBuyCurrency() LLFirstUse::receiveLindens(false); } +void LLStatusBar::onClickShop() +{ + LLFloaterReg::toggleInstanceOrBringToFront("marketplace"); +} + void LLStatusBar::onMouseEnterPresetsCamera() { LLView* popup_holder = gViewerWindow->getRootView()->getChildView("popup_holder"); diff --git a/indra/newview/llstatusbar.h b/indra/newview/llstatusbar.h index a8fc621ff8..eb4ca8e894 100644 --- a/indra/newview/llstatusbar.h +++ b/indra/newview/llstatusbar.h @@ -101,6 +101,7 @@ public: private: void onClickBuyCurrency(); + void onClickShop(); void onVolumeChanged(const LLSD& newvalue); void onVoiceChanged(const LLSD& newvalue); void onObscureBalanceChanged(const LLSD& newvalue); diff --git a/indra/newview/llviewerfloaterreg.cpp b/indra/newview/llviewerfloaterreg.cpp index 4b3af6d7e8..3b35ca8db1 100644 --- a/indra/newview/llviewerfloaterreg.cpp +++ b/indra/newview/llviewerfloaterreg.cpp @@ -21,6 +21,7 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA * * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA + * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA * $/LicenseInfo$ */ @@ -98,6 +99,7 @@ #include "llfloaterlinkreplace.h" #include "llfloaterloadprefpreset.h" #include "llfloatermap.h" +#include "llfloatermarketplace.h" #include "llfloatermarketplacelistings.h" #include "llfloatermediasettings.h" #include "llfloatermemleak.h" @@ -419,6 +421,7 @@ void LLViewerFloaterReg::registerFloaters() LLFloaterReg::add("mem_leaking", "floater_mem_leaking.xml", (LLFloaterBuildFunc)&LLFloaterReg::build); LLFloaterReg::add("media_settings", "floater_media_settings.xml", (LLFloaterBuildFunc)&LLFloaterReg::build); + LLFloaterReg::add("marketplace", "floater_marketplace.xml", (LLFloaterBuildFunc)&LLFloaterReg::build); LLFloaterReg::add("marketplace_listings", "floater_marketplace_listings.xml", (LLFloaterBuildFunc)&LLFloaterReg::build); LLFloaterReg::add("marketplace_validation", "floater_marketplace_validation.xml", (LLFloaterBuildFunc)&LLFloaterReg::build); LLFloaterReg::add("message_critical", "floater_critical.xml", (LLFloaterBuildFunc)&LLFloaterReg::build); diff --git a/indra/newview/llviewermedia.cpp b/indra/newview/llviewermedia.cpp index 82a52e63f6..c6bc252efd 100644 --- a/indra/newview/llviewermedia.cpp +++ b/indra/newview/llviewermedia.cpp @@ -1259,35 +1259,46 @@ void LLViewerMedia::getOpenIDCookieCoro(std::string url) { LLAppViewer::instance()->postToMainCoro([=]() { - LLMediaCtrl* media_instance = LLFloaterReg::getInstance("destinations")->getChild("destination_guide_contents"); - if (media_instance) + std::string cookie_host = authority.substr(hostStart, hostEnd - hostStart); + std::string cookie_name = ""; + std::string cookie_value = ""; + std::string cookie_path = ""; + bool httponly = true; + bool secure = true; + + LLViewerMedia* inst = getInstance(); + if (inst->parseRawCookie(inst->mOpenIDCookie, cookie_name, cookie_value, cookie_path, httponly, secure)) { - LLViewerMedia* inst = getInstance(); - std::string cookie_host = authority.substr(hostStart, hostEnd - hostStart); - std::string cookie_name = ""; - std::string cookie_value = ""; - std::string cookie_path = ""; - bool httponly = true; - bool secure = true; - if (inst->parseRawCookie(inst->mOpenIDCookie, cookie_name, cookie_value, cookie_path, httponly, secure) && - media_instance->getMediaPlugin()) + // MAINT-5711 - inexplicably, the CEF setCookie function will no longer set the cookie if the + // url and domain are not the same. This used to be my.sl.com and id.sl.com respectively and worked. + // For now, we use the URL for the OpenID POST request since it will have the same authority + // as the domain field. + // (Feels like there must be a less dirty way to construct a URL from component LLURL parts) + // MAINT-6392 - Rider: Do not change, however, the original URI requested, since it is used further + // down. + std::string cefUrl(std::string(inst->mOpenIDURL.mURI) + "://" + std::string(inst->mOpenIDURL.mAuthority)); + + // list of floater names and webbrowser therein to set the cookie that arrived via login into + struct MediaCookieInstance { + std::string floater_name; + std::string browser_name; + }; + struct MediaCookieInstance media_cookie_instances[] = { + {"search", "search_contents" }, + {"marketplace", "marketplace_contents" }, + {"destinations", "destination_guide_contents" }, + }; + for (MediaCookieInstance mci : media_cookie_instances) { - // MAINT-5711 - inexplicably, the CEF setCookie function will no longer set the cookie if the - // url and domain are not the same. This used to be my.sl.com and id.sl.com respectively and worked. - // For now, we use the URL for the OpenID POST request since it will have the same authority - // as the domain field. - // (Feels like there must be a less dirty way to construct a URL from component LLURL parts) - // MAINT-6392 - Rider: Do not change, however, the original URI requested, since it is used further - // down. - std::string cefUrl(std::string(inst->mOpenIDURL.mURI) + "://" + std::string(inst->mOpenIDURL.mAuthority)); - - media_instance->getMediaPlugin()->setCookie(cefUrl, cookie_name, cookie_value, cookie_host, - cookie_path, httponly, secure); - - // Now that we have parsed the raw cookie, we must store it so that each new media instance - // can also get a copy and faciliate logging into internal SL sites. - media_instance->getMediaPlugin()->storeOpenIDCookie(cefUrl, cookie_name, cookie_value, - cookie_host, cookie_path, httponly, secure); + LLMediaCtrl* media_instance = LLFloaterReg::getInstance(mci.floater_name)->getChild(mci.browser_name); + if (media_instance && media_instance->getMediaPlugin()) + { + media_instance->getMediaPlugin()->setCookie(cefUrl, cookie_name, cookie_value, cookie_host, + cookie_path, httponly, secure); + + media_instance->getMediaPlugin()->storeOpenIDCookie(cefUrl, cookie_name, cookie_value, + cookie_host, cookie_path, httponly, secure); + } } } }); diff --git a/indra/newview/llviewermenu.cpp b/indra/newview/llviewermenu.cpp index 7a8a57c03d..f7688b762f 100644 --- a/indra/newview/llviewermenu.cpp +++ b/indra/newview/llviewermenu.cpp @@ -4354,13 +4354,6 @@ void set_god_level(U8 god_level) // changing god-level can affect which menus we see show_debug_menus(); - - // changing god-level can invalidate search results - LLFloaterSearch *search = dynamic_cast(LLFloaterReg::getInstance("search")); - if (search) - { - search->godLevelChanged(god_level); - } } #ifdef TOGGLE_HACKED_GODLIKE_VIEWER diff --git a/indra/newview/llviewerwindow.cpp b/indra/newview/llviewerwindow.cpp index b0408b73ad..0edb7c70ea 100644 --- a/indra/newview/llviewerwindow.cpp +++ b/indra/newview/llviewerwindow.cpp @@ -2309,6 +2309,18 @@ void LLViewerWindow::initWorldUI() url = LLWeb::expandURLSubstitutions(url, LLSD()); avatar_welcome_pack->navigateTo(url, HTTP_CONTENT_TEXT_HTML); } + LLMediaCtrl* search = LLFloaterReg::getInstance("search")->findChild("search_contents"); + if (search) + { + search->setErrorPageURL(gSavedSettings.getString("GenericErrorPageURL")); + } + LLMediaCtrl* marketplace = LLFloaterReg::getInstance("marketplace")->getChild("marketplace_contents"); + if (marketplace) + { + marketplace->setErrorPageURL(gSavedSettings.getString("GenericErrorPageURL")); + std::string url = gSavedSettings.getString("MarketplaceURL"); + marketplace->navigateTo(url, HTTP_CONTENT_TEXT_HTML); + } } } diff --git a/indra/newview/skins/default/xui/da/floater_search.xml b/indra/newview/skins/default/xui/da/floater_search.xml deleted file mode 100644 index 80a30b1aa1..0000000000 --- a/indra/newview/skins/default/xui/da/floater_search.xml +++ /dev/null @@ -1,16 +0,0 @@ - - - - Henter... - - - Færdig - - - - - Gentag søgning med "God level" - - - - diff --git a/indra/newview/skins/default/xui/de/floater_search.xml b/indra/newview/skins/default/xui/de/floater_search.xml deleted file mode 100644 index bd39bf2bce..0000000000 --- a/indra/newview/skins/default/xui/de/floater_search.xml +++ /dev/null @@ -1,16 +0,0 @@ - - - - Wird geladen... - - - Fertig - - - - - Suche wiederholen, um aktuellen Gott-Level zu berücksichtigen - - - - diff --git a/indra/newview/skins/default/xui/en/floater_marketplace.xml b/indra/newview/skins/default/xui/en/floater_marketplace.xml new file mode 100644 index 0000000000..2299e02c63 --- /dev/null +++ b/indra/newview/skins/default/xui/en/floater_marketplace.xml @@ -0,0 +1,26 @@ + + + + diff --git a/indra/newview/skins/default/xui/en/floater_search.xml b/indra/newview/skins/default/xui/en/floater_search.xml index fc1e32915a..76a486e211 100644 --- a/indra/newview/skins/default/xui/en/floater_search.xml +++ b/indra/newview/skins/default/xui/en/floater_search.xml @@ -1,18 +1,26 @@ + positioning="cascading" + legacy_header_height="225" + can_minimize="true" + can_close="true" + can_resize="true" + min_height="800" + min_width="800" + height="800" + layout="topleft" + name="Search" + single_instance="true" + help_topic="search" + save_rect="true" + save_visibility="true" + title="SEARCH" + width="800"> + + diff --git a/indra/newview/skins/default/xui/es/floater_search.xml b/indra/newview/skins/default/xui/es/floater_search.xml deleted file mode 100644 index e24d8064a1..0000000000 --- a/indra/newview/skins/default/xui/es/floater_search.xml +++ /dev/null @@ -1,16 +0,0 @@ - - - - Cargando... - - - Hecho - - - - - Redo search to reflect current God level - - - - diff --git a/indra/newview/skins/default/xui/fr/floater_search.xml b/indra/newview/skins/default/xui/fr/floater_search.xml deleted file mode 100644 index 32800182ea..0000000000 --- a/indra/newview/skins/default/xui/fr/floater_search.xml +++ /dev/null @@ -1,16 +0,0 @@ - - - - Chargement... - - - Terminé - - - - - Relancer la recherche pour refléter le niveau divin actuel - - - - diff --git a/indra/newview/skins/default/xui/it/floater_search.xml b/indra/newview/skins/default/xui/it/floater_search.xml deleted file mode 100644 index ac3dc17aa3..0000000000 --- a/indra/newview/skins/default/xui/it/floater_search.xml +++ /dev/null @@ -1,16 +0,0 @@ - - - - Caricamento in corso... - - - Fine - - - - - Ripeti ricerca in modo che rifletta il livello di diritti Admin attuale - - - - diff --git a/indra/newview/skins/default/xui/ja/floater_search.xml b/indra/newview/skins/default/xui/ja/floater_search.xml deleted file mode 100644 index 531ac77f95..0000000000 --- a/indra/newview/skins/default/xui/ja/floater_search.xml +++ /dev/null @@ -1,16 +0,0 @@ - - - - 読み込んでいます…。 - - - 完了 - - - - - 現在のゴッドレベルに反映させるため、検索をやり直してください。 - - - - diff --git a/indra/newview/skins/default/xui/pt/floater_search.xml b/indra/newview/skins/default/xui/pt/floater_search.xml deleted file mode 100644 index 3509cb786d..0000000000 --- a/indra/newview/skins/default/xui/pt/floater_search.xml +++ /dev/null @@ -1,16 +0,0 @@ - - - - Carregando... - - - Pronto - - - - - Buscar novamente com status God - - - - diff --git a/indra/newview/skins/default/xui/ru/floater_search.xml b/indra/newview/skins/default/xui/ru/floater_search.xml deleted file mode 100644 index 405a6598ac..0000000000 --- a/indra/newview/skins/default/xui/ru/floater_search.xml +++ /dev/null @@ -1,16 +0,0 @@ - - - - Загрузка... - - - Готово - - - - - Повторить поиск, чтобы показать текущий уровень творца - - - - diff --git a/indra/newview/skins/default/xui/tr/floater_search.xml b/indra/newview/skins/default/xui/tr/floater_search.xml deleted file mode 100644 index 08c1e5162c..0000000000 --- a/indra/newview/skins/default/xui/tr/floater_search.xml +++ /dev/null @@ -1,16 +0,0 @@ - - - - Yükleniyor... - - - Tamamlandı - - - - - Mevcut Yönetici seviyesini dikkate alarak aramayı yenile - - - - diff --git a/indra/newview/skins/default/xui/zh/floater_search.xml b/indra/newview/skins/default/xui/zh/floater_search.xml deleted file mode 100644 index 3e85a529ae..0000000000 --- a/indra/newview/skins/default/xui/zh/floater_search.xml +++ /dev/null @@ -1,16 +0,0 @@ - - - - 載入中... - - - 完成 - - - - - 以目前具備的神階級再搜尋一次 - - - - -- cgit v1.2.3 From bebd1b208e1b342fabf59844851124a91513e83b Mon Sep 17 00:00:00 2001 From: Callum Prentice Date: Fri, 22 Aug 2025 17:10:29 -0700 Subject: Bring in Dullahan 1.20.0 and by that, CEF 139.0.28. Update the CEF media plugin accordingly to take account of Dullahan cache changes --- autobuild.xml | 10 +++++----- indra/media_plugins/cef/media_plugin_cef.cpp | 16 +--------------- 2 files changed, 6 insertions(+), 20 deletions(-) diff --git a/autobuild.xml b/autobuild.xml index 5dcc9a980a..2f2ab55012 100644 --- a/autobuild.xml +++ b/autobuild.xml @@ -448,11 +448,11 @@ archive hash - 8f3672e548c140a48296669b65cb4ce9a54154e2 + 67f6df74e64ec7706b59192dbdef1d0da2754127 hash_algorithm sha1 url - https://github.com/secondlife/dullahan/releases/download/v1.16.0-CEF_139.0.17/dullahan-1.16.0.202508120105_139.0.17_g6c347eb_chromium-139.0.7258.31-darwin64-16896111303.tar.zst + https://github.com/secondlife/dullahan/releases/download/v1.20.0-CEF_139.0.28a/dullahan-1.20.0.202508222243_139.0.28_g55ab8a8_chromium-139.0.7258.139-darwin64-17167490569.tar.zst name darwin64 @@ -476,11 +476,11 @@ archive hash - ec077eb13edf0b69324d73b49bb434e69e67d2d0 + 7fe15918eeeb5121b6c5af9427f581a775b88758 hash_algorithm sha1 url - https://github.com/secondlife/dullahan/releases/download/v1.16.0-CEF_139.0.17/dullahan-1.16.0.202508120105_139.0.17_g6c347eb_chromium-139.0.7258.31-windows64-16896111303.tar.zst + https://github.com/secondlife/dullahan/releases/download/v1.20.0-CEF_139.0.28a/dullahan-1.20.0.202508222244_139.0.28_g55ab8a8_chromium-139.0.7258.139-windows64-17167490569.tar.zst name windows64 @@ -493,7 +493,7 @@ copyright Copyright (c) 2017, Linden Research, Inc. version - 1.16.0.202508120105_139.0.17_g6c347eb_chromium-139.0.7258.31 + 1.20.0.202508222243_139.0.28_g55ab8a8_chromium-139.0.7258.139 name dullahan description diff --git a/indra/media_plugins/cef/media_plugin_cef.cpp b/indra/media_plugins/cef/media_plugin_cef.cpp index 3f45ac971a..52df4a9685 100644 --- a/indra/media_plugins/cef/media_plugin_cef.cpp +++ b/indra/media_plugins/cef/media_plugin_cef.cpp @@ -110,8 +110,6 @@ private: bool mCanCopy; bool mCanPaste; std::string mRootCachePath; - std::string mCachePath; - std::string mContextCachePath; std::string mCefLogFile; bool mCefLogVerbose; std::vector mPickedFiles; @@ -149,7 +147,6 @@ MediaPluginBase(host_send_func, host_user_data) mCanCut = false; mCanCopy = false; mCanPaste = false; - mCachePath = ""; mCefLogFile = ""; mCefLogVerbose = false; mPickedFiles.clear(); @@ -649,10 +646,7 @@ void MediaPluginCEF::receiveMessage(const char* message_string) // and set it to white settings.background_color = 0xffffffff; // white - settings.cache_enabled = true; settings.root_cache_path = mRootCachePath; - settings.cache_path = mCachePath; - settings.context_cache_path = mContextCachePath; settings.cookies_enabled = mCookiesEnabled; // configure proxy argument if enabled and valid @@ -768,15 +762,7 @@ void MediaPluginCEF::receiveMessage(const char* message_string) mRootCachePath += std::to_string(getpid()); # endif - if (!subfolder.empty()) - { - mCachePath = mRootCachePath + path_separator + subfolder; - } - else - { - mCachePath = mRootCachePath; - } - mContextCachePath = ""; // disabled by "" + mCefLogFile = message_in.getValue("cef_log_file"); mCefLogVerbose = message_in.getValueBoolean("cef_verbose_log"); } -- cgit v1.2.3 From 8a585912adab1948e250c30d8ceb3588b9148600 Mon Sep 17 00:00:00 2001 From: Andrey Kleshchev Date: Tue, 26 Aug 2025 18:18:07 +0300 Subject: #4598 Crash in LLReflectionMapManager::update Not enough data for a solid conclusion (does something create settings in a thread?), but should be avoidable if we cache settings differently. --- indra/newview/llreflectionmapmanager.cpp | 41 ++++++++++++++++++-------------- indra/newview/llreflectionmapmanager.h | 8 +++++++ indra/newview/llviewercontrol.cpp | 8 +++++++ 3 files changed, 39 insertions(+), 18 deletions(-) diff --git a/indra/newview/llreflectionmapmanager.cpp b/indra/newview/llreflectionmapmanager.cpp index 3391b7adf7..f24bb892dc 100644 --- a/indra/newview/llreflectionmapmanager.cpp +++ b/indra/newview/llreflectionmapmanager.cpp @@ -145,6 +145,7 @@ static void touch_default_probe(LLReflectionMap* probe) LLReflectionMapManager::LLReflectionMapManager() { mDynamicProbeCount = LL_MAX_REFLECTION_PROBE_COUNT; + refreshSettings(); initCubeFree(); } @@ -222,25 +223,21 @@ void LLReflectionMapManager::update() resume(); } - static LLCachedControl sDetail(gSavedSettings, "RenderReflectionProbeDetail", -1); - static LLCachedControl sLevel(gSavedSettings, "RenderReflectionProbeLevel", 3); - static LLCachedControl sReflectionProbeCount(gSavedSettings, "RenderReflectionProbeCount", 256U); - static LLCachedControl sProbeDynamicAllocation(gSavedSettings, "RenderReflectionProbeDynamicAllocation", -1); mResetFade = llmin((F32)(mResetFade + gFrameIntervalSeconds * 2.f), 1.f); { U32 probe_count_temp = mDynamicProbeCount; - if (sProbeDynamicAllocation > -1) + if (mRenderReflectionProbeDynamicAllocation > -1) { - if (sLevel == 0) + if (mRenderReflectionProbeLevel == 0) { mDynamicProbeCount = 1; } - else if (sLevel == 1) + else if (mRenderReflectionProbeLevel == 1) { mDynamicProbeCount = (U32)mProbes.size(); } - else if (sLevel == 2) + else if (mRenderReflectionProbeLevel == 2) { mDynamicProbeCount = llmax((U32)mProbes.size(), 128); } @@ -249,20 +246,20 @@ void LLReflectionMapManager::update() mDynamicProbeCount = 256; } - if (sProbeDynamicAllocation > 1) + if (mRenderReflectionProbeDynamicAllocation > 1) { // Round mDynamicProbeCount to the nearest increment of 16 - mDynamicProbeCount = ((mDynamicProbeCount + sProbeDynamicAllocation / 2) / sProbeDynamicAllocation) * 16; - mDynamicProbeCount = llclamp(mDynamicProbeCount, 1, sReflectionProbeCount); + mDynamicProbeCount = ((mDynamicProbeCount + mRenderReflectionProbeDynamicAllocation / 2) / mRenderReflectionProbeDynamicAllocation) * 16; + mDynamicProbeCount = llclamp(mDynamicProbeCount, 1, mRenderReflectionProbeCount); } else { - mDynamicProbeCount = llclamp(mDynamicProbeCount + sProbeDynamicAllocation, 1, sReflectionProbeCount); + mDynamicProbeCount = llclamp(mDynamicProbeCount + mRenderReflectionProbeDynamicAllocation, 1, mRenderReflectionProbeCount); } } else { - mDynamicProbeCount = sReflectionProbeCount; + mDynamicProbeCount = mRenderReflectionProbeCount; } mDynamicProbeCount = llmin(mDynamicProbeCount, LL_MAX_REFLECTION_PROBE_COUNT); @@ -328,7 +325,7 @@ void LLReflectionMapManager::update() bool did_update = false; - bool realtime = sDetail >= (S32)LLReflectionMapManager::DetailLevel::REALTIME; + bool realtime = mRenderReflectionProbeDetail >= (S32)LLReflectionMapManager::DetailLevel::REALTIME; LLReflectionMap* closestDynamic = nullptr; @@ -457,7 +454,7 @@ void LLReflectionMapManager::update() closestDynamic = probe; } - if (sLevel == 0) + if (mRenderReflectionProbeLevel == 0) { // only update default probe when coverage is set to none llassert(probe == mDefaultProbe); @@ -489,12 +486,12 @@ void LLReflectionMapManager::update() static LLCachedControl sUpdatePeriod(gSavedSettings, "RenderDefaultProbeUpdatePeriod", 2.f); if ((gFrameTimeSeconds - mDefaultProbe->mLastUpdateTime) < sUpdatePeriod) { - if (sLevel == 0) + if (mRenderReflectionProbeLevel == 0) { // when probes are disabled don't update the default probe more often than the prescribed update period oldestProbe = nullptr; } } - else if (sLevel > 0) + else if (mRenderReflectionProbeLevel > 0) { // when probes are enabled don't update the default probe less often than the prescribed update period oldestProbe = mDefaultProbe; } @@ -520,6 +517,14 @@ void LLReflectionMapManager::update() } } +void LLReflectionMapManager::refreshSettings() +{ + mRenderReflectionProbeDetail = gSavedSettings.getS32("RenderReflectionProbeDetail"); + mRenderReflectionProbeLevel = gSavedSettings.getS32("RenderReflectionProbeLevel"); + mRenderReflectionProbeCount = gSavedSettings.getU32("RenderReflectionProbeCount"); + mRenderReflectionProbeDynamicAllocation = gSavedSettings.getS32("RenderReflectionProbeDynamicAllocation"); +} + LLReflectionMap* LLReflectionMapManager::addProbe(LLSpatialGroup* group) { if (gGLManager.mGLVersion < 4.05f || !LLPipeline::sReflectionProbesEnabled) @@ -782,7 +787,7 @@ void LLReflectionMapManager::updateProbeFace(LLReflectionMap* probe, U32 face) } else { - llassert(gSavedSettings.getS32("RenderReflectionProbeLevel") > 0); // should never update a probe that's not the default probe if reflection coverage is none + llassert(mRenderReflectionProbeLevel > 0); // should never update a probe that's not the default probe if reflection coverage is none probe->update(mRenderTarget.getWidth(), face); } diff --git a/indra/newview/llreflectionmapmanager.h b/indra/newview/llreflectionmapmanager.h index 0719c28134..5daed7d1cf 100644 --- a/indra/newview/llreflectionmapmanager.h +++ b/indra/newview/llreflectionmapmanager.h @@ -110,6 +110,8 @@ public: // maintain reflection probes void update(); + void refreshSettings(); + // add a probe for the given spatial group LLReflectionMap* addProbe(LLSpatialGroup* group = nullptr); @@ -248,6 +250,12 @@ private: U32 mDynamicProbeCount; + // cached settings from gSavedSettings + S32 mRenderReflectionProbeDetail = -1; + S32 mRenderReflectionProbeLevel = 3; + U32 mRenderReflectionProbeCount = 256U; + S32 mRenderReflectionProbeDynamicAllocation = -1; + // resolution of reflection probes U32 mProbeResolution = 128; diff --git a/indra/newview/llviewercontrol.cpp b/indra/newview/llviewercontrol.cpp index 598ad89907..d39805f4c7 100644 --- a/indra/newview/llviewercontrol.cpp +++ b/indra/newview/llviewercontrol.cpp @@ -447,6 +447,7 @@ static bool handleRenderDynamicLODChanged(const LLSD& newvalue) static bool handleReflectionProbeDetailChanged(const LLSD& newvalue) { + gPipeline.mReflectionMapManager.refreshSettings(); if (gPipeline.isInit()) { LLPipeline::refreshCachedSettings(); @@ -459,6 +460,12 @@ static bool handleReflectionProbeDetailChanged(const LLSD& newvalue) return true; } +static bool handleReflectionProbeCountChanged(const LLSD& newvalue) +{ + gPipeline.mReflectionMapManager.refreshSettings(); + return true; +} + #if LL_DARWIN static bool handleAppleUseMultGLChanged(const LLSD& newvalue) { @@ -836,6 +843,7 @@ void settings_setup_listeners() setting_setup_signal_listener(gSavedSettings, "RenderResolutionDivisor", handleRenderResolutionDivisorChanged); setting_setup_signal_listener(gSavedSettings, "RenderReflectionProbeLevel", handleReflectionProbeDetailChanged); setting_setup_signal_listener(gSavedSettings, "RenderReflectionProbeDetail", handleReflectionProbeDetailChanged); + setting_setup_signal_listener(gSavedSettings, "RenderReflectionProbeCount", handleReflectionProbeCountChanged); setting_setup_signal_listener(gSavedSettings, "RenderReflectionsEnabled", handleReflectionProbeDetailChanged); #if LL_DARWIN setting_setup_signal_listener(gSavedSettings, "RenderAppleUseMultGL", handleAppleUseMultGLChanged); -- cgit v1.2.3 From bbdb46a833c1c3d8c26aa1a9a69bf05f4b065853 Mon Sep 17 00:00:00 2001 From: Dan Linden <119471733+Dan-Linden@users.noreply.github.com> Date: Tue, 26 Aug 2025 14:41:07 -0700 Subject: Update qatest.yaml Removed dan's z600 windows machine from the matrix. Added dan's mac, caleb's mac and kurt's windows machines. --- .github/workflows/qatest.yaml | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/.github/workflows/qatest.yaml b/.github/workflows/qatest.yaml index 457e915726..e19dce2709 100644 --- a/.github/workflows/qatest.yaml +++ b/.github/workflows/qatest.yaml @@ -47,13 +47,21 @@ jobs: artifact: Windows-installer install-path: 'C:\viewer-automation-main' - os: windows - runner: qa-windows-z600-dan + runner: qa-windows-asus-kurt artifact: Windows-installer install-path: 'C:\viewer-automation-main' + - os: mac + runner: qa-mac-dan + artifact: macOS-installer + install-path: '$HOME/Documents/viewer-automation' - os: mac runner: qa-mac-atlas artifact: macOS-installer install-path: '$HOME/Documents/viewer-automation' + - os: mac + runner: qa-mac-caleb + artifact: macOS-installer + install-path: '$HOME/Documents/viewer-automation' fail-fast: false runs-on: [self-hosted, "${{ matrix.runner }}"] -- cgit v1.2.3 From e33439e5238e9d2945aa99515c0206d827cc0910 Mon Sep 17 00:00:00 2001 From: Dan Linden <119471733+Dan-Linden@users.noreply.github.com> Date: Tue, 26 Aug 2025 15:18:10 -0700 Subject: Update qatest.yaml corrected kurt's machine name to qa-windows-kurt --- .github/workflows/qatest.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/qatest.yaml b/.github/workflows/qatest.yaml index e19dce2709..b6883d88d4 100644 --- a/.github/workflows/qatest.yaml +++ b/.github/workflows/qatest.yaml @@ -47,7 +47,7 @@ jobs: artifact: Windows-installer install-path: 'C:\viewer-automation-main' - os: windows - runner: qa-windows-asus-kurt + runner: qa-windows-kurt artifact: Windows-installer install-path: 'C:\viewer-automation-main' - os: mac -- cgit v1.2.3 From 0fc42e951f99182b080c7187455d6a4da602441b Mon Sep 17 00:00:00 2001 From: Andrey Kleshchev Date: Wed, 27 Aug 2025 01:42:36 +0300 Subject: #4608 Crash at LLJoint::findJoint 'this' is null inside findJoint according to bugsplat so likely mRoot was not initialized yet. --- indra/newview/llmeshrepository.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/indra/newview/llmeshrepository.cpp b/indra/newview/llmeshrepository.cpp index 9e8ed3bb43..997fc28333 100644 --- a/indra/newview/llmeshrepository.cpp +++ b/indra/newview/llmeshrepository.cpp @@ -2460,7 +2460,7 @@ bool LLMeshRepoThread::skinInfoReceived(const LLUUID& mesh_id, U8* data, S32 dat LLPointer info = nullptr; info = new LLMeshSkinInfo(mesh_id, skin); - if (isAgentAvatarValid()) + if (isAgentAvatarValid() && gAgentAvatarp->mInitFlags != 0) { // joint numbers are consistent inside LLVOAvatar and animations, but inconsistent inside meshes, // generate a map of mesh joint numbers to LLVOAvatar joint numbers LLSkinningUtil::initJointNums(info, gAgentAvatarp); -- cgit v1.2.3 From 87ec630053aadcb5b5f6104f7d083acf4609e2e9 Mon Sep 17 00:00:00 2001 From: Callum Prentice Date: Wed, 27 Aug 2025 15:30:32 -0700 Subject: PUll in Dullahan 1.21 that contains additional updates for the macOS version which should help with the slow media startup issue --- autobuild.xml | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/autobuild.xml b/autobuild.xml index ffea5916e9..2931b78902 100644 --- a/autobuild.xml +++ b/autobuild.xml @@ -448,11 +448,11 @@ archive hash - 67f6df74e64ec7706b59192dbdef1d0da2754127 + d44256458ff0ef4db4c91e8e8cc83e8f98b4f1b8 hash_algorithm sha1 url - https://github.com/secondlife/dullahan/releases/download/v1.20.0-CEF_139.0.28a/dullahan-1.20.0.202508222243_139.0.28_g55ab8a8_chromium-139.0.7258.139-darwin64-17167490569.tar.zst + https://github.com/secondlife/dullahan/releases/download/v1.21.0-CEF_139.0.28/dullahan-1.21.0.202508272158_139.0.28_g55ab8a8_chromium-139.0.7258.139-darwin64-17279703032.tar.zst name darwin64 @@ -476,11 +476,11 @@ archive hash - 7fe15918eeeb5121b6c5af9427f581a775b88758 + 9d5af766a87052808e4062978504e9af124fb558 hash_algorithm sha1 url - https://github.com/secondlife/dullahan/releases/download/v1.20.0-CEF_139.0.28a/dullahan-1.20.0.202508222244_139.0.28_g55ab8a8_chromium-139.0.7258.139-windows64-17167490569.tar.zst + https://github.com/secondlife/dullahan/releases/download/v1.21.0-CEF_139.0.28/dullahan-1.21.0.202508272159_139.0.28_g55ab8a8_chromium-139.0.7258.139-windows64-17279703032.tar.zst name windows64 @@ -493,7 +493,7 @@ copyright Copyright (c) 2017, Linden Research, Inc. version - 1.20.0.202508222243_139.0.28_g55ab8a8_chromium-139.0.7258.139 + 1.21.0.202508272158_139.0.28_g55ab8a8_chromium-139.0.7258.139 name dullahan description @@ -1477,12 +1477,12 @@ windows64 - copyright - Copyright (c) 2010, Linden Research, Inc. license internal license_file LICENSES/llphysicsextensions.txt + copyright + Copyright (c) 2010, Linden Research, Inc. version 1.0.11137145495 name @@ -2332,14 +2332,6 @@ Copyright (c) 2012, 2014, 2015, 2016 nghttp2 contributors threejs - copyright - Copyright © 2010-2021 three.js authors - license - MIT - license_file - LICENSES/THREEJS_LICENSE.txt - name - threejs platforms common @@ -2357,8 +2349,16 @@ Copyright (c) 2012, 2014, 2015, 2016 nghttp2 contributors common + license + MIT + license_file + LICENSES/THREEJS_LICENSE.txt + copyright + Copyright © 2010-2021 three.js authors version 0.132.2 + name + threejs tinygltf -- cgit v1.2.3 From e629bf05d6212613083c8ccb2858085926f38902 Mon Sep 17 00:00:00 2001 From: Rye Date: Wed, 27 Aug 2025 22:36:55 -0400 Subject: Changes to support dullahan 1.21 undo/redo/delete/select all edit handlers --- indra/llplugin/llpluginclassmedia.cpp | 50 ++++++++++++++ indra/llplugin/llpluginclassmedia.h | 18 +++++ indra/media_plugins/cef/media_plugin_cef.cpp | 59 +++++++++++++++- indra/newview/llmediactrl.cpp | 10 ++- indra/newview/llmediactrl.h | 1 + indra/newview/llviewermedia.cpp | 80 ++++++++++++++++++++++ indra/newview/llviewermedia.h | 12 ++++ .../skins/default/xui/en/menu_media_ctrl.xml | 8 +++ 8 files changed, 236 insertions(+), 2 deletions(-) diff --git a/indra/llplugin/llpluginclassmedia.cpp b/indra/llplugin/llpluginclassmedia.cpp index 8a356da93a..77a4b08af5 100644 --- a/indra/llplugin/llpluginclassmedia.cpp +++ b/indra/llplugin/llpluginclassmedia.cpp @@ -132,9 +132,13 @@ void LLPluginClassMedia::reset() mLastMouseY = 0; mStatus = LLPluginClassMediaOwner::MEDIA_NONE; mSleepTime = 1.0f / 100.0f; + mCanUndo = false; + mCanRedo = false; mCanCut = false; mCanCopy = false; mCanPaste = false; + mCanDoDelete = false; + mCanSelectAll = false; mMediaName.clear(); mMediaDescription.clear(); mBackgroundColor = LLColor4(1.0f, 1.0f, 1.0f, 1.0f); @@ -907,6 +911,18 @@ void LLPluginClassMedia::sendAuthResponse(bool ok, const std::string &username, sendMessage(message); } +void LLPluginClassMedia::undo() +{ + LLPluginMessage message(LLPLUGIN_MESSAGE_CLASS_MEDIA, "edit_undo"); + sendMessage(message); +} + +void LLPluginClassMedia::redo() +{ + LLPluginMessage message(LLPLUGIN_MESSAGE_CLASS_MEDIA, "edit_redo"); + sendMessage(message); +} + void LLPluginClassMedia::cut() { LLPluginMessage message(LLPLUGIN_MESSAGE_CLASS_MEDIA, "edit_cut"); @@ -925,6 +941,24 @@ void LLPluginClassMedia::paste() sendMessage(message); } +void LLPluginClassMedia::doDelete() +{ + LLPluginMessage message(LLPLUGIN_MESSAGE_CLASS_MEDIA, "edit_delete"); + sendMessage(message); +} + +void LLPluginClassMedia::selectAll() +{ + LLPluginMessage message(LLPLUGIN_MESSAGE_CLASS_MEDIA, "edit_select_all"); + sendMessage(message); +} + +void LLPluginClassMedia::showPageSource() +{ + LLPluginMessage message(LLPLUGIN_MESSAGE_CLASS_MEDIA, "edit_show_source"); + sendMessage(message); +} + void LLPluginClassMedia::setUserDataPath(const std::string &user_data_path_cache, const std::string &username, const std::string &user_data_path_cef_log) @@ -1178,6 +1212,14 @@ void LLPluginClassMedia::receivePluginMessage(const LLPluginMessage &message) } else if(message_name == "edit_state") { + if(message.hasValue("undo")) + { + mCanUndo = message.getValueBoolean("undo"); + } + if(message.hasValue("redo")) + { + mCanRedo = message.getValueBoolean("redo"); + } if(message.hasValue("cut")) { mCanCut = message.getValueBoolean("cut"); @@ -1190,6 +1232,14 @@ void LLPluginClassMedia::receivePluginMessage(const LLPluginMessage &message) { mCanPaste = message.getValueBoolean("paste"); } + if (message.hasValue("delete")) + { + mCanDoDelete = message.getValueBoolean("delete"); + } + if (message.hasValue("select_all")) + { + mCanSelectAll = message.getValueBoolean("select_all"); + } } else if(message_name == "name_text") { diff --git a/indra/llplugin/llpluginclassmedia.h b/indra/llplugin/llpluginclassmedia.h index d74b790d8f..292d934419 100644 --- a/indra/llplugin/llpluginclassmedia.h +++ b/indra/llplugin/llpluginclassmedia.h @@ -201,6 +201,12 @@ public: LLPluginClassMediaOwner::EMediaStatus getStatus() const { return mStatus; } + void undo(); + bool canUndo() const { return mCanUndo; }; + + void redo(); + bool canRedo() const { return mCanRedo; }; + void cut(); bool canCut() const { return mCanCut; }; @@ -210,6 +216,14 @@ public: void paste(); bool canPaste() const { return mCanPaste; }; + void doDelete(); + bool canDoDelete() const { return mCanDoDelete; }; + + void selectAll(); + bool canSelectAll() const { return mCanSelectAll; }; + + void showPageSource(); + // These can be called before init(), and they will be queued and sent before the media init message. void setUserDataPath(const std::string &user_data_path_cache, const std::string &username, const std::string &user_data_path_cef_log); void setLanguageCode(const std::string &language_code); @@ -419,9 +433,13 @@ protected: F64 mSleepTime; + bool mCanUndo; + bool mCanRedo; bool mCanCut; bool mCanCopy; bool mCanPaste; + bool mCanDoDelete; + bool mCanSelectAll; std::string mMediaName; std::string mMediaDescription; diff --git a/indra/media_plugins/cef/media_plugin_cef.cpp b/indra/media_plugins/cef/media_plugin_cef.cpp index 52df4a9685..caf804f915 100644 --- a/indra/media_plugins/cef/media_plugin_cef.cpp +++ b/indra/media_plugins/cef/media_plugin_cef.cpp @@ -106,9 +106,13 @@ private: std::string mAuthUsername; std::string mAuthPassword; bool mAuthOK; + bool mCanUndo; + bool mCanRedo; bool mCanCut; bool mCanCopy; bool mCanPaste; + bool mCanDelete; + bool mCanSelectAll; std::string mRootCachePath; std::string mCefLogFile; bool mCefLogVerbose; @@ -144,9 +148,13 @@ MediaPluginBase(host_send_func, host_user_data) mAuthUsername = ""; mAuthPassword = ""; mAuthOK = false; + mCanUndo = false; + mCanRedo = false; mCanCut = false; mCanCopy = false; mCanPaste = false; + mCanDelete = false; + mCanSelectAll = false; mCefLogFile = ""; mCefLogVerbose = false; mPickedFiles.clear(); @@ -940,6 +948,14 @@ void MediaPluginCEF::receiveMessage(const char* message_string) { authResponse(message_in); } + if (message_name == "edit_undo") + { + mCEFLib->editUndo(); + } + if (message_name == "edit_redo") + { + mCEFLib->editRedo(); + } if (message_name == "edit_cut") { mCEFLib->editCut(); @@ -952,6 +968,18 @@ void MediaPluginCEF::receiveMessage(const char* message_string) { mCEFLib->editPaste(); } + if (message_name == "edit_delete") + { + mCEFLib->editDelete(); + } + if (message_name == "edit_select_all") + { + mCEFLib->editSelectAll(); + } + if (message_name == "edit_show_source") + { + mCEFLib->viewSource(); + } } else if (message_class == LLPLUGIN_MESSAGE_CLASS_MEDIA_BROWSER) { @@ -1103,14 +1131,31 @@ void MediaPluginCEF::unicodeInput(std::string event, LLSD native_key_data = LLSD // void MediaPluginCEF::checkEditState() { + bool can_undo = mCEFLib->editCanUndo(); + bool can_redo = mCEFLib->editCanRedo(); bool can_cut = mCEFLib->editCanCut(); bool can_copy = mCEFLib->editCanCopy(); bool can_paste = mCEFLib->editCanPaste(); + bool can_delete = mCEFLib->editCanDelete(); + bool can_select_all = mCEFLib->editCanSelectAll(); - if ((can_cut != mCanCut) || (can_copy != mCanCopy) || (can_paste != mCanPaste)) + if ((can_undo != mCanUndo) || (can_redo != mCanRedo) || (can_cut != mCanCut) || (can_copy != mCanCopy) + || (can_paste != mCanPaste) || (can_delete != mCanDelete) || (can_select_all != mCanSelectAll)) { LLPluginMessage message(LLPLUGIN_MESSAGE_CLASS_MEDIA, "edit_state"); + if (can_undo != mCanUndo) + { + mCanUndo = can_undo; + message.setValueBoolean("undo", can_undo); + } + + if (can_redo != mCanRedo) + { + mCanRedo = can_redo; + message.setValueBoolean("redo", can_redo); + } + if (can_cut != mCanCut) { mCanCut = can_cut; @@ -1129,6 +1174,18 @@ void MediaPluginCEF::checkEditState() message.setValueBoolean("paste", can_paste); } + if (can_delete != mCanDelete) + { + mCanDelete = can_delete; + message.setValueBoolean("delete", can_delete); + } + + if (can_select_all != mCanSelectAll) + { + mCanSelectAll = can_select_all; + message.setValueBoolean("select_all", can_select_all); + } + sendMessage(message); } } diff --git a/indra/newview/llmediactrl.cpp b/indra/newview/llmediactrl.cpp index 202008f7f9..c7b60b2fd5 100644 --- a/indra/newview/llmediactrl.cpp +++ b/indra/newview/llmediactrl.cpp @@ -347,6 +347,7 @@ bool LLMediaCtrl::handleRightMouseDown( S32 x, S32 y, MASK mask ) { LLUICtrl::CommitCallbackRegistry::ScopedRegistrar registar; registar.add("Open.WebInspector", boost::bind(&LLMediaCtrl::onOpenWebInspector, this)); + registar.add("Open.ShowSource", boost::bind(&LLMediaCtrl::onShowSource, this)); // stinson 05/05/2014 : use this as the parent of the context menu if the static menu // container has yet to be created @@ -364,8 +365,9 @@ bool LLMediaCtrl::handleRightMouseDown( S32 x, S32 y, MASK mask ) { // hide/show debugging options bool media_plugin_debugging_enabled = gSavedSettings.getBOOL("MediaPluginDebugging"); + menu->setItemVisible("debug_separator", media_plugin_debugging_enabled); menu->setItemVisible("open_webinspector", media_plugin_debugging_enabled ); - menu->setItemVisible("debug_separator", media_plugin_debugging_enabled ); + menu->setItemVisible("show_page_source", media_plugin_debugging_enabled); menu->show(x, y); LLMenuGL::showPopup(this, menu, x, y); @@ -444,6 +446,12 @@ void LLMediaCtrl::onOpenWebInspector() mMediaSource->getMediaPlugin()->showWebInspector( true ); } +void LLMediaCtrl::onShowSource() +{ + if (mMediaSource && mMediaSource->hasMedia()) + mMediaSource->getMediaPlugin()->showPageSource(); +} + //////////////////////////////////////////////////////////////////////////////// // bool LLMediaCtrl::handleKeyHere( KEY key, MASK mask ) diff --git a/indra/newview/llmediactrl.h b/indra/newview/llmediactrl.h index 9f9564af46..a644ef3071 100644 --- a/indra/newview/llmediactrl.h +++ b/indra/newview/llmediactrl.h @@ -171,6 +171,7 @@ public: // right click debugging item void onOpenWebInspector(); + void onShowSource(); LLUUID getTextureID() {return mMediaTextureID;} diff --git a/indra/newview/llviewermedia.cpp b/indra/newview/llviewermedia.cpp index c6bc252efd..89861d74bc 100644 --- a/indra/newview/llviewermedia.cpp +++ b/indra/newview/llviewermedia.cpp @@ -3508,6 +3508,46 @@ void LLViewerMediaImpl::handleMediaEvent(LLPluginClassMedia* plugin, LLPluginCla } } +//////////////////////////////////////////////////////////////////////////////// +// virtual +void +LLViewerMediaImpl::undo() +{ + if (mMediaSource) + mMediaSource->undo(); +} + +//////////////////////////////////////////////////////////////////////////////// +// virtual +bool +LLViewerMediaImpl::canUndo() const +{ + if (mMediaSource) + return mMediaSource->canUndo(); + else + return FALSE; +} + +//////////////////////////////////////////////////////////////////////////////// +// virtual +void +LLViewerMediaImpl::redo() +{ + if (mMediaSource) + mMediaSource->redo(); +} + +//////////////////////////////////////////////////////////////////////////////// +// virtual +bool +LLViewerMediaImpl::canRedo() const +{ + if (mMediaSource) + return mMediaSource->canRedo(); + else + return FALSE; +} + //////////////////////////////////////////////////////////////////////////////// // virtual void @@ -3568,6 +3608,46 @@ LLViewerMediaImpl::canPaste() const return false; } +//////////////////////////////////////////////////////////////////////////////// +// virtual +void +LLViewerMediaImpl::doDelete() +{ + if (mMediaSource) + mMediaSource->doDelete(); +} + +//////////////////////////////////////////////////////////////////////////////// +// virtual +bool +LLViewerMediaImpl::canDoDelete() const +{ + if (mMediaSource) + return mMediaSource->canDoDelete(); + else + return FALSE; +} + +//////////////////////////////////////////////////////////////////////////////// +// virtual +void +LLViewerMediaImpl::selectAll() +{ + if (mMediaSource) + mMediaSource->selectAll(); +} + +//////////////////////////////////////////////////////////////////////////////// +// virtual +bool +LLViewerMediaImpl::canSelectAll() const +{ + if (mMediaSource) + return mMediaSource->canSelectAll(); + else + return FALSE; +} + void LLViewerMediaImpl::setUpdated(bool updated) { mIsUpdated = updated ; diff --git a/indra/newview/llviewermedia.h b/indra/newview/llviewermedia.h index 5753615a43..c17cf59815 100644 --- a/indra/newview/llviewermedia.h +++ b/indra/newview/llviewermedia.h @@ -341,6 +341,12 @@ public: /*virtual*/ void handleMediaEvent(LLPluginClassMedia* plugin, LLPluginClassMediaOwner::EMediaEvent); // LLEditMenuHandler overrides + /*virtual*/ void undo(); + /*virtual*/ bool canUndo() const; + + /*virtual*/ void redo(); + /*virtual*/ bool canRedo() const; + /*virtual*/ void cut(); /*virtual*/ bool canCut() const; @@ -350,6 +356,12 @@ public: /*virtual*/ void paste(); /*virtual*/ bool canPaste() const; + /*virtual*/ void doDelete(); + /*virtual*/ bool canDoDelete() const; + + /*virtual*/ void selectAll(); + /*virtual*/ bool canSelectAll() const; + void addObject(LLVOVolume* obj) ; void removeObject(LLVOVolume* obj) ; const std::list< LLVOVolume* >* getObjectList() const ; diff --git a/indra/newview/skins/default/xui/en/menu_media_ctrl.xml b/indra/newview/skins/default/xui/en/menu_media_ctrl.xml index f9864637a0..e687ae93e8 100644 --- a/indra/newview/skins/default/xui/en/menu_media_ctrl.xml +++ b/indra/newview/skins/default/xui/en/menu_media_ctrl.xml @@ -40,4 +40,12 @@ + + + -- cgit v1.2.3 From 536c821c091be7020c614857e1fd220203f6ab23 Mon Sep 17 00:00:00 2001 From: Rye Date: Wed, 27 Aug 2025 23:05:40 -0400 Subject: MacOS companion changes for dullahan 1.21 including package structure and linkage fixes --- indra/cmake/00-Common.cmake | 3 + indra/cmake/CEFPlugin.cmake | 1 - indra/cmake/PluginAPI.cmake | 4 + indra/llfilesystem/lldir_mac.cpp | 2 +- indra/llplugin/CMakeLists.txt | 2 +- indra/llplugin/llpluginclassmedia.h | 7 +- indra/llplugin/slplugin/CMakeLists.txt | 28 ++--- indra/media_plugins/base/CMakeLists.txt | 2 +- indra/media_plugins/cef/CMakeLists.txt | 10 +- indra/media_plugins/example/CMakeLists.txt | 2 +- indra/media_plugins/libvlc/CMakeLists.txt | 2 +- indra/media_plugins/libvlc/media_plugin_libvlc.cpp | 2 +- indra/newview/CMakeLists.txt | 6 +- indra/newview/viewer_manifest.py | 123 ++++----------------- 14 files changed, 52 insertions(+), 142 deletions(-) diff --git a/indra/cmake/00-Common.cmake b/indra/cmake/00-Common.cmake index c895f42362..5943e0b573 100644 --- a/indra/cmake/00-Common.cmake +++ b/indra/cmake/00-Common.cmake @@ -162,6 +162,9 @@ endif (LINUX) if (DARWIN) + # Use rpath loading on macos + set(CMAKE_MACOSX_RPATH TRUE) + # Warnings should be fatal -- thanks, Nicky Perian, for spotting reversed default set(CLANG_DISABLE_FATAL_WARNINGS OFF) set(CMAKE_CXX_LINK_FLAGS "-Wl,-headerpad_max_install_names,-search_paths_first") diff --git a/indra/cmake/CEFPlugin.cmake b/indra/cmake/CEFPlugin.cmake index 9b77becf29..e27929fa08 100644 --- a/indra/cmake/CEFPlugin.cmake +++ b/indra/cmake/CEFPlugin.cmake @@ -29,7 +29,6 @@ elseif (DARWIN) ${ARCH_PREBUILT_DIRS_RELEASE}/libcef_dll_wrapper.a ${ARCH_PREBUILT_DIRS_RELEASE}/libdullahan.a ${APPKIT_LIBRARY} - "-F ${CEF_LIBRARY}" ) elseif (LINUX) diff --git a/indra/cmake/PluginAPI.cmake b/indra/cmake/PluginAPI.cmake index 114415e514..a2bf13db2c 100644 --- a/indra/cmake/PluginAPI.cmake +++ b/indra/cmake/PluginAPI.cmake @@ -1,5 +1,7 @@ # -*- cmake -*- +include(OpenGL) + add_library( ll::pluginlibraries INTERFACE IMPORTED ) if (WINDOWS) @@ -13,4 +15,6 @@ if (WINDOWS) ) endif (WINDOWS) +target_link_libraries( ll::pluginlibraries INTERFACE OpenGL::GL) +target_include_directories( ll::pluginlibraries INTERFACE ${CMAKE_SOURCE_DIR}/llimage ${CMAKE_SOURCE_DIR}/llrender) diff --git a/indra/llfilesystem/lldir_mac.cpp b/indra/llfilesystem/lldir_mac.cpp index b9be75c528..2db1b6ec5d 100644 --- a/indra/llfilesystem/lldir_mac.cpp +++ b/indra/llfilesystem/lldir_mac.cpp @@ -149,7 +149,7 @@ LLDir_Mac::LLDir_Mac() mWorkingDir = getCurPath(); - mLLPluginDir = mAppRODataDir + mDirDelimiter + "llplugin"; + mLLPluginDir = mAppRODataDir + mDirDelimiter + "SLPlugin.app" + mDirDelimiter + "Contents" + mDirDelimiter + "Frameworks"; } } diff --git a/indra/llplugin/CMakeLists.txt b/indra/llplugin/CMakeLists.txt index 14a69afe6e..f7f8c08adb 100644 --- a/indra/llplugin/CMakeLists.txt +++ b/indra/llplugin/CMakeLists.txt @@ -43,6 +43,6 @@ list(APPEND llplugin_SOURCE_FILES ${llplugin_HEADER_FILES}) add_library (llplugin ${llplugin_SOURCE_FILES}) target_include_directories( llplugin INTERFACE ${CMAKE_CURRENT_SOURCE_DIR}) -target_link_libraries( llplugin llcommon llmath llrender llmessage ) +target_link_libraries( llplugin llcommon llmath llmessage llxml ) add_subdirectory(slplugin) diff --git a/indra/llplugin/llpluginclassmedia.h b/indra/llplugin/llpluginclassmedia.h index 292d934419..71522bcd7d 100644 --- a/indra/llplugin/llpluginclassmedia.h +++ b/indra/llplugin/llpluginclassmedia.h @@ -29,7 +29,6 @@ #ifndef LL_LLPLUGINCLASSMEDIA_H #define LL_LLPLUGINCLASSMEDIA_H -#include "llgltypes.h" #include "llpluginprocessparent.h" #include "llrect.h" #include "llpluginclassmediaowner.h" @@ -365,9 +364,9 @@ protected: bool mTextureParamsReceived; // the mRequestedTexture* fields are only valid when this is true S32 mRequestedTextureDepth; - LLGLenum mRequestedTextureInternalFormat; - LLGLenum mRequestedTextureFormat; - LLGLenum mRequestedTextureType; + U32 mRequestedTextureInternalFormat; + U32 mRequestedTextureFormat; + U32 mRequestedTextureType; bool mRequestedTextureSwapBytes; bool mRequestedTextureCoordsOpenGL; diff --git a/indra/llplugin/slplugin/CMakeLists.txt b/indra/llplugin/slplugin/CMakeLists.txt index 0ea6495eac..e639e522af 100644 --- a/indra/llplugin/slplugin/CMakeLists.txt +++ b/indra/llplugin/slplugin/CMakeLists.txt @@ -30,18 +30,6 @@ add_executable(SLPlugin ${SLPlugin_SOURCE_FILES} ) -if (WINDOWS) -set_target_properties(SLPlugin - PROPERTIES - LINK_FLAGS_DEBUG "/NODEFAULTLIB:\"LIBCMTD\"" - ) -else () -set_target_properties(SLPlugin - PROPERTIES - MACOSX_BUNDLE_INFO_PLIST ${CMAKE_CURRENT_SOURCE_DIR}/slplugin_info.plist - ) -endif () - target_link_libraries(SLPlugin llplugin llmessage @@ -49,7 +37,19 @@ target_link_libraries(SLPlugin ll::pluginlibraries ) -if (DARWIN) +if (WINDOWS) + set_target_properties(SLPlugin + PROPERTIES + LINK_FLAGS_DEBUG "/NODEFAULTLIB:\"LIBCMTD\"" + ) +elseif (DARWIN) + set_target_properties(SLPlugin + PROPERTIES + BUILD_WITH_INSTALL_RPATH 1 + INSTALL_RPATH "@executable_path/../../../../Frameworks;@executable_path/../Frameworks;@executable_path/../Frameworks/plugins" + MACOSX_BUNDLE_INFO_PLIST ${CMAKE_CURRENT_SOURCE_DIR}/slplugin_info.plist + ) + # Make sure the app bundle has a Resources directory (it will get populated by viewer-manifest.py later) add_custom_command( TARGET SLPlugin POST_BUILD @@ -58,7 +58,7 @@ if (DARWIN) -p ${CMAKE_CURRENT_BINARY_DIR}/$,$,>/SLPlugin.app/Contents/Resources ) -endif (DARWIN) +endif () if (LL_TESTS) ll_deploy_sharedlibs_command(SLPlugin) diff --git a/indra/media_plugins/base/CMakeLists.txt b/indra/media_plugins/base/CMakeLists.txt index 64b6a4228d..23f503c345 100644 --- a/indra/media_plugins/base/CMakeLists.txt +++ b/indra/media_plugins/base/CMakeLists.txt @@ -34,5 +34,5 @@ add_library(media_plugin_base ${media_plugin_base_SOURCE_FILES} ) -target_link_libraries( media_plugin_base llplugin ) +target_link_libraries( media_plugin_base llplugin ll::pluginlibraries) target_include_directories( media_plugin_base INTERFACE ${CMAKE_CURRENT_SOURCE_DIR}) diff --git a/indra/media_plugins/cef/CMakeLists.txt b/indra/media_plugins/cef/CMakeLists.txt index 0d1a833936..ebcf67576d 100644 --- a/indra/media_plugins/cef/CMakeLists.txt +++ b/indra/media_plugins/cef/CMakeLists.txt @@ -77,16 +77,8 @@ if (DARWIN) PROPERTIES PREFIX "" BUILD_WITH_INSTALL_RPATH 1 - INSTALL_NAME_DIR "@executable_path" + INSTALL_RPATH "@executable_path/../Frameworks" LINK_FLAGS "-exported_symbols_list ${CMAKE_CURRENT_SOURCE_DIR}/../base/media_plugin_base.exp" ) - add_custom_command(TARGET media_plugin_cef - POST_BUILD COMMAND ${CMAKE_INSTALL_NAME_TOOL} -change "@executable_path/Chromium Embedded Framework" - "@executable_path/../../../../Frameworks/Chromium Embedded Framework.framework/Chromium Embedded Framework" - "$" - VERBATIM - COMMENT "Fixing path to CEF Framework" - ) - endif (DARWIN) diff --git a/indra/media_plugins/example/CMakeLists.txt b/indra/media_plugins/example/CMakeLists.txt index 41e2353f31..278dac8c33 100644 --- a/indra/media_plugins/example/CMakeLists.txt +++ b/indra/media_plugins/example/CMakeLists.txt @@ -47,7 +47,7 @@ if (DARWIN) PROPERTIES PREFIX "" BUILD_WITH_INSTALL_RPATH 1 - INSTALL_NAME_DIR "@executable_path" + INSTALL_RPATH "@executable_path/../Frameworks" LINK_FLAGS "-exported_symbols_list ${CMAKE_CURRENT_SOURCE_DIR}/../base/media_plugin_base.exp" ) diff --git a/indra/media_plugins/libvlc/CMakeLists.txt b/indra/media_plugins/libvlc/CMakeLists.txt index 202cbed96e..f9e0810df2 100644 --- a/indra/media_plugins/libvlc/CMakeLists.txt +++ b/indra/media_plugins/libvlc/CMakeLists.txt @@ -50,7 +50,7 @@ if (DARWIN) PROPERTIES PREFIX "" BUILD_WITH_INSTALL_RPATH 1 - INSTALL_NAME_DIR "@executable_path" + INSTALL_RPATH "@executable_path/../Frameworks" LINK_FLAGS "-exported_symbols_list ${CMAKE_CURRENT_SOURCE_DIR}/../base/media_plugin_base.exp" ) diff --git a/indra/media_plugins/libvlc/media_plugin_libvlc.cpp b/indra/media_plugins/libvlc/media_plugin_libvlc.cpp index 4240613a0c..ad0ecaf4ab 100644 --- a/indra/media_plugins/libvlc/media_plugin_libvlc.cpp +++ b/indra/media_plugins/libvlc/media_plugin_libvlc.cpp @@ -174,7 +174,7 @@ void MediaPluginLibVLC::initVLC() }; #if LL_DARWIN - setenv("VLC_PLUGIN_PATH", ".", 1); + setenv("VLC_PLUGIN_PATH", "./plugins", 1); #endif int vlc_argc = sizeof(vlc_argv) / sizeof(*vlc_argv); diff --git a/indra/newview/CMakeLists.txt b/indra/newview/CMakeLists.txt index f2aec208a1..40b6b35704 100644 --- a/indra/newview/CMakeLists.txt +++ b/indra/newview/CMakeLists.txt @@ -2156,10 +2156,8 @@ if (DARWIN) PROPERTIES OUTPUT_NAME "${product}" # From Contents/MacOS/SecondLife, look in Contents/Frameworks - INSTALL_RPATH "@loader_path/../Frameworks" - # SIGH, as of 2018-05-24 (cmake 3.11.1) the INSTALL_RPATH property simply - # does not work. Try this: - LINK_FLAGS "-rpath @loader_path/../Frameworks" + BUILD_WITH_INSTALL_RPATH 1 + INSTALL_RPATH "@executable_path/../Frameworks" MACOSX_BUNDLE_INFO_PLIST "${CMAKE_CURRENT_SOURCE_DIR}/Info-SecondLife.plist" XCODE_ATTRIBUTE_PRODUCT_BUNDLE_IDENTIFIER "${MACOSX_BUNDLE_GUI_IDENTIFIER}" ) diff --git a/indra/newview/viewer_manifest.py b/indra/newview/viewer_manifest.py index 1146922d5d..666f7675ac 100755 --- a/indra/newview/viewer_manifest.py +++ b/indra/newview/viewer_manifest.py @@ -865,9 +865,6 @@ class Darwin_x86_64_Manifest(ViewerManifest): # CEF framework goes inside Contents/Frameworks. # Remember where we parked this car. with self.prefix(src="", dst="Frameworks"): - CEF_framework = "Chromium Embedded Framework.framework" - self.path2basename(relpkgdir, CEF_framework) - CEF_framework = self.dst_path_of(CEF_framework) if self.args.get('bugsplat'): self.path2basename(relpkgdir, "BugsplatMac.framework") @@ -1065,113 +1062,31 @@ class Darwin_x86_64_Manifest(ViewerManifest): # Dullahan helper apps go inside SLPlugin.app with self.prefix(dst=os.path.join( "SLPlugin.app", "Contents", "Frameworks")): - - frameworkname = 'Chromium Embedded Framework' - - # This code constructs a relative symlink from the - # target framework folder back to the real CEF framework. - # It needs to be relative so that the symlink still works when - # (as is normal) the user moves the app bundle out of the DMG - # and into the /Applications folder. Note we pass catch=False, - # letting the uncaught exception terminate the process, since - # without this symlink, Second Life web media can't possibly work. - - # It might seem simpler just to symlink Frameworks back to - # the parent of Chromimum Embedded Framework.framework. But - # that would create a symlink cycle, which breaks our - # packaging step. So make a symlink from Chromium Embedded - # Framework.framework to the directory of the same name, which - # is NOT an ancestor of the symlink. - - # from SLPlugin.app/Contents/Frameworks/Chromium Embedded - # Framework.framework back to - # $viewer_app/Contents/Frameworks/Chromium Embedded Framework.framework - SLPlugin_framework = self.relsymlinkf(CEF_framework, catch=False) - - # for all the multiple CEF/Dullahan (as of CEF 76) helper app bundles we need: - for helper in ( - "DullahanHelper", - "DullahanHelper (GPU)", - "DullahanHelper (Renderer)", - "DullahanHelper (Plugin)", - ): - # app is the directory name of the app bundle, with app/Contents/MacOS/helper as the executable - app = helper + ".app" - - # copy DullahanHelper.app - self.path2basename(relpkgdir, app) - - # and fix that up with a Frameworks/CEF symlink too - with self.prefix(dst=os.path.join( - app, 'Contents', 'Frameworks')): - # from Dullahan Helper *.app/Contents/Frameworks/Chromium Embedded - # Framework.framework back to - # SLPlugin.app/Contents/Frameworks/Chromium Embedded Framework.framework - # Since SLPlugin_framework is itself a - # symlink, don't let relsymlinkf() resolve -- - # explicitly call relpath(symlink=True) and - # create that symlink here. - helper_framework = \ - self.symlinkf(self.relpath(SLPlugin_framework, symlink=True), catch=False) - - # change_command includes install_name_tool, the - # -change subcommand and the old framework rpath - # stamped into the executable. To use it with - # run_command(), we must still append the new - # framework path and the pathname of the - # executable to change. - change_command = [ - 'install_name_tool', '-change', - '@rpath/Frameworks/Chromium Embedded Framework.framework/Chromium Embedded Framework'] - - with self.prefix(dst=os.path.join( - app, 'Contents', 'MacOS')): - # Now self.get_dst_prefix() is, at runtime, - # @executable_path. Locate the helper app - # framework (which is a symlink) from here. - newpath = os.path.join( - '@executable_path', - self.relpath(helper_framework, symlink=True), - frameworkname) - # and restamp the Dullahan Helper executable itself - self.run_command( - change_command + - [newpath, self.dst_path_of(helper)]) - - # SLPlugin plugins - with self.prefix(dst="llplugin"): - dylibexecutable = 'media_plugin_cef.dylib' + # copy CEF plugin self.path2basename("../media_plugins/cef/" + self.args['configuration'], - dylibexecutable) - - # Do this install_name_tool *after* media plugin is copied over. - # Locate the framework lib executable -- relative to - # SLPlugin.app/Contents/MacOS, which will be our - # @executable_path at runtime! - newpath = os.path.join( - '@executable_path', - self.relpath(SLPlugin_framework, executable_path["SLPlugin.app"], - symlink=True), - frameworkname) - # restamp media_plugin_cef.dylib - self.run_command( - change_command + - [newpath, self.dst_path_of(dylibexecutable)]) - - # copy LibVLC plugin itself - dylibexecutable = 'media_plugin_libvlc.dylib' - self.path2basename("../media_plugins/libvlc/" + self.args['configuration'], dylibexecutable) - # add @rpath for the correct LibVLC subfolder - self.run_command(['install_name_tool', '-add_rpath', '@loader_path/lib', self.dst_path_of(dylibexecutable)]) - - # copy LibVLC dynamic libraries - with self.prefix(src=relpkgdir, dst="lib"): + "media_plugin_cef.dylib") + + # copy LibVLC plugin + self.path2basename("../media_plugins/libvlc/" + self.args['configuration'], + "media_plugin_libvlc.dylib") + + # CEF framework and vlc libraries goes inside Contents/Frameworks. + with self.prefix(src=os.path.join(pkgdir, 'lib', 'release')): + self.path("Chromium Embedded Framework.framework") + self.path("DullahanHelper.app") + self.path("DullahanHelper (Alerts).app") + self.path("DullahanHelper (GPU).app") + self.path("DullahanHelper (Renderer).app") + self.path("DullahanHelper (Plugin).app") + + # Copy libvlc self.path( "libvlc*.dylib*" ) # copy LibVLC plugins folder - with self.prefix(src='plugins', dst=""): + with self.prefix(src='plugins', dst="plugins"): self.path( "*.dylib" ) self.path( "plugins.dat" ) + def package_finish(self): imagename = self.installer_base_name() self.set_github_output('imagename', imagename) -- cgit v1.2.3 From dae43ad532579e849aa191fba4fdb3478a455840 Mon Sep 17 00:00:00 2001 From: Rye Date: Wed, 27 Aug 2025 23:05:58 -0400 Subject: Fix cmake to ${CMAKE_COMMAND} to avoid cmake error --- indra/test/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/indra/test/CMakeLists.txt b/indra/test/CMakeLists.txt index 745c0eedf8..f80286a630 100644 --- a/indra/test/CMakeLists.txt +++ b/indra/test/CMakeLists.txt @@ -114,7 +114,7 @@ if (LL_TESTS) # but the CMake $ generator expression isn't evaluated by # CREATE_LINK, so fudge it. add_custom_command( TARGET lltest POST_BUILD - COMMAND cmake -E create_symlink ${SHARED_LIB_STAGING_DIR} ${CMAKE_BINARY_DIR}/test/Resources + COMMAND ${CMAKE_COMMAND} -E create_symlink ${SHARED_LIB_STAGING_DIR} ${CMAKE_BINARY_DIR}/test/Resources ) endif() endif (LL_TESTS) -- cgit v1.2.3 From 77d71dec863e28323bcafb1573cd1ecd54fe3049 Mon Sep 17 00:00:00 2001 From: Rye Date: Thu, 28 Aug 2025 00:43:38 -0400 Subject: Fix up universal build --- autobuild.xml | 2 +- build.sh | 2 +- indra/cmake/OpenJPEG.cmake | 4 +++- indra/cmake/Variables.cmake | 6 +++--- indra/newview/viewer_manifest.py | 21 --------------------- 5 files changed, 8 insertions(+), 27 deletions(-) diff --git a/autobuild.xml b/autobuild.xml index fe4caace0b..0bfb8b67f2 100644 --- a/autobuild.xml +++ b/autobuild.xml @@ -3171,7 +3171,7 @@ Copyright (c) 2012, 2014, 2015, 2016 nghttp2 contributors build_directory - build-darwin-x86_64 + build-darwin-universal name darwin64 diff --git a/build.sh b/build.sh index eb81ff319a..9118cb4346 100755 --- a/build.sh +++ b/build.sh @@ -40,7 +40,7 @@ retry_cmd() build_dir_Darwin() { - echo build-darwin-x86_64 + echo build-darwin-universal } build_dir_Linux() diff --git a/indra/cmake/OpenJPEG.cmake b/indra/cmake/OpenJPEG.cmake index d31df57689..33e9cf4898 100644 --- a/indra/cmake/OpenJPEG.cmake +++ b/indra/cmake/OpenJPEG.cmake @@ -1,7 +1,9 @@ # -*- cmake -*- +include_guard() + include(Prebuilt) +include(Linking) -include_guard() add_library( ll::openjpeg INTERFACE IMPORTED ) use_system_binary(openjpeg) diff --git a/indra/cmake/Variables.cmake b/indra/cmake/Variables.cmake index a315943a90..8dc51f6efa 100644 --- a/indra/cmake/Variables.cmake +++ b/indra/cmake/Variables.cmake @@ -184,9 +184,9 @@ if (${CMAKE_SYSTEM_NAME} MATCHES "Darwin") set(CMAKE_XCODE_ATTRIBUTE_CODE_SIGN_ENTITLEMENTS "") set(CMAKE_XCODE_ATTRIBUTE_DISABLE_MANUAL_TARGET_ORDER_BUILD_WARNING YES) set(CMAKE_XCODE_ATTRIBUTE_GCC_WARN_64_TO_32_BIT_CONVERSION NO) - set(CMAKE_OSX_ARCHITECTURES "${ARCH}") - string(REPLACE "i686" "i386" CMAKE_OSX_ARCHITECTURES "${CMAKE_OSX_ARCHITECTURES}") - string(REPLACE "AMD64" "x86_64" CMAKE_OSX_ARCHITECTURES "${CMAKE_OSX_ARCHITECTURES}") + if(NOT DEFINED CMAKE_OSX_ARCHITECTURES) + set(CMAKE_OSX_ARCHITECTURES "x86_64;arm64") + endif() endif (${CMAKE_SYSTEM_NAME} MATCHES "Darwin") # Default deploy grid diff --git a/indra/newview/viewer_manifest.py b/indra/newview/viewer_manifest.py index c69f4bd1f3..61e8d66908 100755 --- a/indra/newview/viewer_manifest.py +++ b/indra/newview/viewer_manifest.py @@ -1028,20 +1028,6 @@ class Darwin_x86_64_Manifest(ViewerManifest): ): self.path2basename(relpkgdir, libfile) - # OpenAL dylibs - if self.args['openal'] == 'ON': - for libfile in ( - "libopenal.dylib", - "libalut.dylib", - ): - dylibs += path_optional(os.path.join(relpkgdir, libfile), libfile) - - oldpath = os.path.join("@rpath", libfile) - self.run_command( - ['install_name_tool', '-change', oldpath, - '@executable_path/../Resources/%s' % libfile, - executable]) - # our apps executable_path = {} embedded_apps = [ (os.path.join("llplugin", "slplugin"), "SLPlugin.app") ] @@ -1052,13 +1038,6 @@ class Darwin_x86_64_Manifest(ViewerManifest): executable_path[app] = \ self.dst_path_of(os.path.join(app, "Contents", "MacOS")) - # our apps dependencies on shared libs - # for each app, for each dylib we collected in dylibs, - # create a symlink to the real copy of the dylib. - with self.prefix(dst=os.path.join(app, "Contents", "Resources")): - for libfile in dylibs: - self.relsymlinkf(os.path.join(libfile_parent, libfile)) - # Dullahan helper apps go inside SLPlugin.app with self.prefix(dst=os.path.join( "SLPlugin.app", "Contents", "Frameworks")): -- cgit v1.2.3 From 2b44464a143c3b32ef4d3de4456b100e34ad79ef Mon Sep 17 00:00:00 2001 From: Rye Date: Thu, 28 Aug 2025 06:08:13 -0400 Subject: Fix up windows build error in GHA --- .github/workflows/build.yaml | 4 ++-- indra/CMakeLists.txt | 8 +++++++- indra/llcommon/llpreprocessor.h | 2 +- 3 files changed, 10 insertions(+), 4 deletions(-) diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index 4bf2af644a..59a711267f 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -64,7 +64,7 @@ jobs: # autobuild-package.xml. AUTOBUILD_VCS_INFO: "true" AUTOBUILD_VSVER: "170" - DEVELOPER_DIR: "/Applications/Xcode_16.1.app/Contents/Developer" + DEVELOPER_DIR: "/Applications/Xcode_16.4.app/Contents/Developer" # Ensure that Linden viewer builds engage Bugsplat. BUGSPLAT_DB: ${{ needs.setup.outputs.bugsplat_db }} build_coverity: false @@ -98,7 +98,7 @@ jobs: uses: actions/checkout@v4 with: repository: secondlife/build-variables - ref: master + ref: universal path: .build-variables - name: Checkout master-message-template diff --git a/indra/CMakeLists.txt b/indra/CMakeLists.txt index 62f8e0ff8b..455e7980e2 100644 --- a/indra/CMakeLists.txt +++ b/indra/CMakeLists.txt @@ -10,7 +10,7 @@ ## Nicky: Ideally we want at least 3.21 for good preset support ## We're not there yet, but once done, there is a kludge in Linking.cmake # "if(${CMAKE_VERSION} VERSION_LESS "3.20.0")" that can also be removed -cmake_minimum_required(VERSION 3.16.0 FATAL_ERROR) +cmake_minimum_required(VERSION 3.16.0...4.0 FATAL_ERROR) cmake_policy(SET CMP0156 NEW) cmake_policy(SET CMP0179 NEW) @@ -35,7 +35,13 @@ if (NOT DEFINED CMAKE_CXX_STANDARD) set(CMAKE_CXX_STANDARD 20) endif() set(CMAKE_CXX_STANDARD_REQUIRED ON) +set(CMAKE_CXX_SCAN_FOR_MODULES OFF) # This slows down build massively + set(CMAKE_OPTIMIZE_DEPENDENCIES ON) + +set(CMAKE_COLOR_DIAGNOSTICS ON) + +# Speeds up cmake generation significantly in some cases set(CMAKE_XCODE_GENERATE_TOP_LEVEL_PROJECT_ONLY ON) include(Variables) diff --git a/indra/llcommon/llpreprocessor.h b/indra/llcommon/llpreprocessor.h index d2a29d06b4..b2a9734548 100644 --- a/indra/llcommon/llpreprocessor.h +++ b/indra/llcommon/llpreprocessor.h @@ -181,7 +181,7 @@ #define LL_TO_STRING_HELPER(x) #x #define LL_TO_STRING(x) LL_TO_STRING_HELPER(x) -#define LL_TO_WSTRING_HELPER(x) L#x +#define LL_TO_WSTRING_HELPER(x) L## #x #define LL_TO_WSTRING(x) LL_TO_WSTRING_HELPER(x) #define LL_FILE_LINENO_MSG(msg) __FILE__ "(" LL_TO_STRING(__LINE__) ") : " msg #define LL_GLUE_IMPL(x, y) x##y -- cgit v1.2.3 From f1014eda271aec9485ad1f54c22ca331426165a5 Mon Sep 17 00:00:00 2001 From: Rye Date: Thu, 28 Aug 2025 06:19:15 -0400 Subject: Bump openjpeg to 2.5.3-r1 --- autobuild.xml | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/autobuild.xml b/autobuild.xml index 0bfb8b67f2..7581f719dc 100644 --- a/autobuild.xml +++ b/autobuild.xml @@ -2087,11 +2087,11 @@ Copyright (c) 2012, 2014, 2015, 2016 nghttp2 contributors archive hash - 39007a526bffffd0bde691f616491b70cf284496 + 94a72c6ddbfb23796ce913c55bc47c128542a582 hash_algorithm sha1 url - https://github.com/secondlife/3p-openjpeg/releases/download/v2.5.2-r2/openjpeg-2.5.2.11968808495-darwin64-11968808495.tar.zst + https://github.com/secondlife/3p-openjpeg/releases/download/v2.5.3-r1/openjpeg-2.5.3.15590356935-darwin64-15590356935.tar.zst name darwin64 @@ -2101,11 +2101,11 @@ Copyright (c) 2012, 2014, 2015, 2016 nghttp2 contributors archive hash - 066e7b1ee58d5aff8efe065d598d56226c249a94 + 751172af405f4a47a3aebb37729d62229cab6c07 hash_algorithm sha1 url - https://github.com/secondlife/3p-openjpeg/releases/download/v2.5.2-r2/openjpeg-2.5.2.11968808495-linux64-11968808495.tar.zst + https://github.com/secondlife/3p-openjpeg/releases/download/v2.5.3-r1/openjpeg-2.5.3.15590356935-linux64-15590356935.tar.zst name linux64 @@ -2115,11 +2115,11 @@ Copyright (c) 2012, 2014, 2015, 2016 nghttp2 contributors archive hash - fe98fc9f4f3d94399c3078cad1bdcfdb37ce397b + 8aab9cf250dfee252386e1c79b5205e6d3b3e19e hash_algorithm sha1 url - https://github.com/secondlife/3p-openjpeg/releases/download/v2.5.2-r2/openjpeg-2.5.2.11968808495-windows64-11968808495.tar.zst + https://github.com/secondlife/3p-openjpeg/releases/download/v2.5.3-r1/openjpeg-2.5.3.15590356935-windows64-15590356935.tar.zst name windows64 @@ -2132,7 +2132,7 @@ Copyright (c) 2012, 2014, 2015, 2016 nghttp2 contributors copyright Copyright (c) 2002-2007, Communications and Remote Sensing Laboratory, Universite catholique de Louvain (UCL), Belgium; Copyright (c) 2002-2007, Professor Benoit Macq; Copyright (c) 2001-2003, David Janssens; Copyright (c) 2002-2003, Yannick Verschueren; Copyright (c) 2003-2007, Francois-Olivier Devaux and Antonin Descampe; Copyright (c) 2005, Herve Drolon, FreeImage Team; Copyright (c) 2006-2007, Parvatha Elangovan; Copyright (c) 2008, Jerome Fimes, Communications & Systemes <jerome.fimes@c-s.fr>; Copyright (c) 2010-2011, Kaori Hagihara; Copyright (c) 2011-2012, Centre National d'Etudes Spatiales (CNES), France; Copyright (c) 2012, CS Systemes d'Information, France; version - 2.5.2.11968808495 + 2.5.3.15590356935 name openjpeg description -- cgit v1.2.3 From d010e55b88eced851543f7afd47e6c4f24964486 Mon Sep 17 00:00:00 2001 From: Rye Date: Thu, 28 Aug 2025 06:21:38 -0400 Subject: Tabs to spaces --- indra/llwindow/llwindowmacosx.cpp | 12 ++++++------ indra/newview/llfloaterpreference.h | 2 +- indra/newview/llfloaterpreferencesgraphicsadvanced.h | 2 +- indra/newview/pipeline.cpp | 8 ++++---- 4 files changed, 12 insertions(+), 12 deletions(-) diff --git a/indra/llwindow/llwindowmacosx.cpp b/indra/llwindow/llwindowmacosx.cpp index 0e03b4e883..030bd5ee7e 100644 --- a/indra/llwindow/llwindowmacosx.cpp +++ b/indra/llwindow/llwindowmacosx.cpp @@ -1495,9 +1495,9 @@ bool LLWindowMacOSX::convertCoords(LLCoordScreen from, LLCoordWindow* to) convertScreenToWindow(mWindow, mouse_point); - float scale_factor = getSystemUISize(); - to->mX = mouse_point[0] * scale_factor; - to->mY = mouse_point[1] * scale_factor; + float scale_factor = getSystemUISize(); + to->mX = mouse_point[0] * scale_factor; + to->mY = mouse_point[1] * scale_factor; return true; } @@ -1509,9 +1509,9 @@ bool LLWindowMacOSX::convertCoords(LLCoordWindow from, LLCoordScreen *to) if(mWindow) { float mouse_point[2]; - float scale_factor = getSystemUISize(); - mouse_point[0] = from.mX / scale_factor; - mouse_point[1] = from.mY / scale_factor; + float scale_factor = getSystemUISize(); + mouse_point[0] = from.mX / scale_factor; + mouse_point[1] = from.mY / scale_factor; convertWindowToScreen(mWindow, mouse_point); diff --git a/indra/newview/llfloaterpreference.h b/indra/newview/llfloaterpreference.h index fa9c421a8f..40806c22fc 100644 --- a/indra/newview/llfloaterpreference.h +++ b/indra/newview/llfloaterpreference.h @@ -237,7 +237,7 @@ private: std::unique_ptr< ll::prefs::SearchData > mSearchData; bool mSearchDataDirty; - boost::signals2::connection mImpostorsChangedSignal; + boost::signals2::connection mImpostorsChangedSignal; boost::signals2::connection mComplexityChangedSignal; void onUpdateFilterTerm( bool force = false ); diff --git a/indra/newview/llfloaterpreferencesgraphicsadvanced.h b/indra/newview/llfloaterpreferencesgraphicsadvanced.h index a1a54f238d..6f793c1379 100644 --- a/indra/newview/llfloaterpreferencesgraphicsadvanced.h +++ b/indra/newview/llfloaterpreferencesgraphicsadvanced.h @@ -61,7 +61,7 @@ protected: void onBtnOK(const LLSD& userdata); void onBtnCancel(const LLSD& userdata); - boost::signals2::connection mImpostorsChangedSignal; + boost::signals2::connection mImpostorsChangedSignal; boost::signals2::connection mComplexityChangedSignal; boost::signals2::connection mComplexityModeChangedSignal; boost::signals2::connection mLODFactorChangedSignal; diff --git a/indra/newview/pipeline.cpp b/indra/newview/pipeline.cpp index 0120e1487e..9edfbf7a88 100644 --- a/indra/newview/pipeline.cpp +++ b/indra/newview/pipeline.cpp @@ -7419,7 +7419,7 @@ void LLPipeline::generateGlow(LLRenderTarget* src) void LLPipeline::applyCAS(LLRenderTarget* src, LLRenderTarget* dst) { static LLCachedControl cas_sharpness(gSavedSettings, "RenderCASSharpness", 0.4f); - LL_PROFILE_GPU_ZONE("cas"); + LL_PROFILE_GPU_ZONE("cas"); if (cas_sharpness == 0.0f || !gCASProgram.isComplete()) { gPipeline.copyRenderTarget(src, dst); @@ -7464,7 +7464,7 @@ void LLPipeline::applyCAS(LLRenderTarget* src, LLRenderTarget* dst) void LLPipeline::applyFXAA(LLRenderTarget* src, LLRenderTarget* dst) { - LL_PROFILE_GPU_ZONE("FXAA"); + LL_PROFILE_GPU_ZONE("FXAA"); { llassert(!gCubeSnapshot); bool multisample = RenderFSAAType == 1 && gFXAAProgram[0].isComplete() && mFXAAMap.isComplete(); @@ -7668,7 +7668,7 @@ void LLPipeline::generateSMAABuffers(LLRenderTarget* src) void LLPipeline::applySMAA(LLRenderTarget* src, LLRenderTarget* dst) { - LL_PROFILE_GPU_ZONE("SMAA"); + LL_PROFILE_GPU_ZONE("SMAA"); llassert(!gCubeSnapshot); bool multisample = RenderFSAAType == 2 && gSMAAEdgeDetectProgram[0].isComplete() && mFXAAMap.isComplete() && mSMAABlendBuffer.isComplete(); @@ -7773,7 +7773,7 @@ void LLPipeline::combineGlow(LLRenderTarget* src, LLRenderTarget* dst) void LLPipeline::renderDoF(LLRenderTarget* src, LLRenderTarget* dst) { - LL_PROFILE_GPU_ZONE("dof"); + LL_PROFILE_GPU_ZONE("dof"); { bool dof_enabled = (RenderDepthOfFieldInEditMode || !LLToolMgr::getInstance()->inBuildMode()) && -- cgit v1.2.3 From 5ffcd3dc88892a651fe9a95974280efb85e18a8b Mon Sep 17 00:00:00 2001 From: Rye Date: Thu, 28 Aug 2025 14:09:03 -0400 Subject: Fixes for GHA build --- build.sh | 3 ++- indra/cmake/Audio.cmake | 2 +- indra/cmake/Boost.cmake | 2 +- indra/cmake/OPENAL.cmake | 4 ++++ indra/cmake/OpenJPEG.cmake | 3 +++ indra/llcommon/llprocessor.cpp | 37 ------------------------------------- 6 files changed, 11 insertions(+), 40 deletions(-) diff --git a/build.sh b/build.sh index 9118cb4346..36e332cf42 100755 --- a/build.sh +++ b/build.sh @@ -158,6 +158,7 @@ pre_build() if [[ "$arch" == "Darwin" ]] then + HAVOK=OFF SIGNING=("-DENABLE_SIGNING:BOOL=YES" \ "-DSIGNING_IDENTITY:STRING=Developer ID Application: Linden Research, Inc.") fi @@ -387,7 +388,7 @@ do if `cat "$build_dir/build_ok"` then case "$variant" in - Release) + Release*) if [ -r "$build_dir/autobuild-package.xml" ] then begin_section "Autobuild metadata" diff --git a/indra/cmake/Audio.cmake b/indra/cmake/Audio.cmake index 6f61b056e0..5a7a7ab0b5 100644 --- a/indra/cmake/Audio.cmake +++ b/indra/cmake/Audio.cmake @@ -33,5 +33,5 @@ find_library(VORBISFILE_LIBRARY libvorbisfile.a PATHS "${ARCH_PREBUILT_DIRS_RELEASE}" REQUIRED NO_DEFAULT_PATH) -target_link_libraries(ll::vorbis INTERFACE ${OGG_LIBRARY} ${VORBISENC_LIBRARY} ${VORBISFILE_LIBRARY} ${VORBIS_LIBRARY}) +target_link_libraries(ll::vorbis INTERFACE ${VORBISENC_LIBRARY} ${VORBISFILE_LIBRARY} ${VORBIS_LIBRARY} ${OGG_LIBRARY} ) diff --git a/indra/cmake/Boost.cmake b/indra/cmake/Boost.cmake index 518e678585..7b3882c936 100644 --- a/indra/cmake/Boost.cmake +++ b/indra/cmake/Boost.cmake @@ -65,8 +65,8 @@ find_library(BOOST_URL_LIBRARY PATHS "${ARCH_PREBUILT_DIRS_RELEASE}" REQUIRED NO_DEFAULT_PATH) target_link_libraries(ll::boost INTERFACE - ${BOOST_CONTEXT_LIBRARY} ${BOOST_FIBER_LIBRARY} + ${BOOST_CONTEXT_LIBRARY} ${BOOST_FILESYSTEM_LIBRARY} ${BOOST_PROGRAMOPTIONS_LIBRARY} ${BOOST_REGEX_LIBRARY} diff --git a/indra/cmake/OPENAL.cmake b/indra/cmake/OPENAL.cmake index 2566a08189..ab1604aa22 100644 --- a/indra/cmake/OPENAL.cmake +++ b/indra/cmake/OPENAL.cmake @@ -26,11 +26,15 @@ if (USE_OPENAL) NAMES OpenAL32 openal + libopenal.dylib + libopenal.so PATHS "${ARCH_PREBUILT_DIRS_RELEASE}" REQUIRED NO_DEFAULT_PATH) find_library(ALUT_LIBRARY NAMES alut + libalut.dylib + libalut.so PATHS "${ARCH_PREBUILT_DIRS_RELEASE}" REQUIRED NO_DEFAULT_PATH) target_link_libraries(ll::openal INTERFACE ${OPENAL_LIBRARY} ${ALUT_LIBRARY}) diff --git a/indra/cmake/OpenJPEG.cmake b/indra/cmake/OpenJPEG.cmake index 33e9cf4898..95e71fd78e 100644 --- a/indra/cmake/OpenJPEG.cmake +++ b/indra/cmake/OpenJPEG.cmake @@ -12,6 +12,9 @@ use_prebuilt_binary(openjpeg) find_library(OPENJPEG_LIBRARY NAMES openjp2 + openjp2.lib + libopenjp2.a + libopenjp2.so PATHS "${ARCH_PREBUILT_DIRS_RELEASE}" REQUIRED NO_DEFAULT_PATH) target_link_libraries(ll::openjpeg INTERFACE ${OPENJPEG_LIBRARY}) diff --git a/indra/llcommon/llprocessor.cpp b/indra/llcommon/llprocessor.cpp index a6ecad2cf7..718f471321 100644 --- a/indra/llcommon/llprocessor.cpp +++ b/indra/llcommon/llprocessor.cpp @@ -640,43 +640,6 @@ public: { getCPUIDInfo(); uint64_t frequency = getSysctlInt64("hw.cpufrequency"); - if(frequency == 0) // Attempt to query IO Services for pcore frequency - { - CFMutableDictionaryRef arm_io_matching = IOServiceMatching("AppleARMIODevice"); - io_iterator_t iter; - kern_return_t ret = IOServiceGetMatchingServices(kIOMasterPortDefault, arm_io_matching, &iter); - if(ret == KERN_SUCCESS) - { - io_object_t obj; - while ((obj = IOIteratorNext(iter))) - { - io_name_t obj_class; - ret = IOObjectGetClass(obj, obj_class); - if(ret == KERN_SUCCESS) - { - io_name_t obj_name; - ret = IORegistryEntryGetName(obj, obj_name); - if(ret == KERN_SUCCESS) - { - if (strncmp(obj_name, "pmgr", sizeof(obj_name)) == 0) - { - CFTypeRef cfData = IORegistryEntryCreateCFProperty(obj, CFSTR("voltage-states5-sram"), kCFAllocatorDefault, 0); // pcore frequency - if(cfData) - { - CFIndex size = CFDataGetLength((CFDataRef)cfData); - std::vector databuf(size); - CFDataGetBytes((CFDataRef)cfData, CFRangeMake(0, size), databuf.data()); - - frequency = 0x00000000FFFFFFFF & ((databuf[size-5] << 24) | (databuf[size-6] << 16) | (databuf[size-7] << 8) | (databuf[size-8])); - CFRelease(cfData); - } - break; - } - } - } - } - } - } if (frequency == 0) // fallback to clockrate and tbfrequency { frequency = getSysctlClockrate() * getSysctlInt64("hw.tbfrequency"); -- cgit v1.2.3 From e23aa060494ea1ae8f01033177ec10c333f01b30 Mon Sep 17 00:00:00 2001 From: Andrey Kleshchev Date: Fri, 29 Aug 2025 00:02:04 +0300 Subject: #4604 Reduce draw distance when low on RAM --- indra/newview/llviewermessage.cpp | 23 +++++++++++++----- indra/newview/llviewertexture.cpp | 51 +++++++++++++++++++++++++++++++-------- indra/newview/llviewertexture.h | 3 +++ indra/newview/llvocache.cpp | 13 ++++++++-- 4 files changed, 72 insertions(+), 18 deletions(-) diff --git a/indra/newview/llviewermessage.cpp b/indra/newview/llviewermessage.cpp index 7d39cc6059..d0e6af799c 100644 --- a/indra/newview/llviewermessage.cpp +++ b/indra/newview/llviewermessage.cpp @@ -3364,6 +3364,17 @@ void send_agent_update(bool force_send, bool send_reliable) msg->addVector3Fast(_PREHASH_CameraUpAxis, LLViewerCamera::getInstance()->getUpAxis()); static F32 last_draw_disatance_step = 1024; + F32 memory_limited_draw_distance = gAgentCamera.mDrawDistance; + + if (LLViewerTexture::sDesiredDiscardBias > 2.f && LLViewerTexture::isSystemMemoryLow()) + { + // If we are low on memory, reduce requested draw distance + // Discard's bias is clamped to 4 so we need to check 2 to 4 range + // Factor is intended to go from 1.0 to 2.0 + F32 factor = 1.f + (LLViewerTexture::sDesiredDiscardBias - 2.f) / 2.f; + memory_limited_draw_distance = llmax(gAgentCamera.mDrawDistance / factor, gAgentCamera.mDrawDistance / 2.f); + } + if (tp_state == LLAgent::TELEPORT_ARRIVING || LLStartUp::getStartupState() < STATE_MISC) { // Inform interest list, prioritize closer area. @@ -3372,25 +3383,25 @@ void send_agent_update(bool force_send, bool send_reliable) // closer ones. // Todo: revise and remove once server gets distance sorting. last_draw_disatance_step = llmax((F32)(gAgentCamera.mDrawDistance / 2.f), 50.f); + last_draw_disatance_step = llmin(last_draw_disatance_step, memory_limited_draw_distance); msg->addF32Fast(_PREHASH_Far, last_draw_disatance_step); } - else if (last_draw_disatance_step < gAgentCamera.mDrawDistance) + else if (last_draw_disatance_step < memory_limited_draw_distance) { static LLFrameTimer last_step_time; if (last_step_time.getElapsedTimeF32() > 1.f) { // gradually increase draw distance - // Idealy this should be not per second, but based on how loaded - // mesh thread is, but hopefully this is temporary. last_step_time.reset(); - F32 step = gAgentCamera.mDrawDistance * 0.1f; - last_draw_disatance_step = llmin(last_draw_disatance_step + step, gAgentCamera.mDrawDistance); + F32 step = memory_limited_draw_distance * 0.1f; + last_draw_disatance_step = llmin(last_draw_disatance_step + step, memory_limited_draw_distance); } msg->addF32Fast(_PREHASH_Far, last_draw_disatance_step); } else { - msg->addF32Fast(_PREHASH_Far, gAgentCamera.mDrawDistance); + last_draw_disatance_step = memory_limited_draw_distance; + msg->addF32Fast(_PREHASH_Far, memory_limited_draw_distance); } msg->addU32Fast(_PREHASH_ControlFlags, control_flags); diff --git a/indra/newview/llviewertexture.cpp b/indra/newview/llviewertexture.cpp index 52939dbbae..7a25fb03a5 100644 --- a/indra/newview/llviewertexture.cpp +++ b/indra/newview/llviewertexture.cpp @@ -527,8 +527,16 @@ void LLViewerTexture::updateClass() if (is_low && !was_low) { - // slam to 1.5 bias the moment we hit low memory (discards off screen textures immediately) - sDesiredDiscardBias = llmax(sDesiredDiscardBias, 1.5f); + if (is_sys_low) + { + // Not having system memory is more serious, so discard harder + sDesiredDiscardBias = llmax(sDesiredDiscardBias, 1.5f * getSystemMemoryBudgetFactor()); + } + else + { + // Slam to 1.5 bias the moment we hit low memory (discards off screen textures immediately) + sDesiredDiscardBias = llmax(sDesiredDiscardBias, 1.5f); + } if (is_sys_low || over_pct > 2.f) { // if we're low on system memory, emergency purge off screen textures to avoid a death spiral @@ -559,8 +567,13 @@ void LLViewerTexture::updateClass() sEvaluationTimer.reset(); // lower discard bias over time when at least 10% of budget is free - const F32 FREE_PERCENTAGE_TRESHOLD = -0.1f; - if (sDesiredDiscardBias > 1.f && over_pct < FREE_PERCENTAGE_TRESHOLD) + constexpr F32 FREE_PERCENTAGE_TRESHOLD = -0.1f; + constexpr U32 FREE_SYS_MEM_TRESHOLD = 100; + static LLCachedControl min_free_main_memory(gSavedSettings, "RenderMinFreeMainMemoryThreshold", 512); + const S32Megabytes MIN_FREE_MAIN_MEMORY(min_free_main_memory() + FREE_SYS_MEM_TRESHOLD); + if (sDesiredDiscardBias > 1.f + && over_pct < FREE_PERCENTAGE_TRESHOLD + && getFreeSystemMemory() > MIN_FREE_MAIN_MEMORY) { static LLCachedControl high_mem_discard_decrement(gSavedSettings, "RenderHighMemMinDiscardDecrement", .1f); @@ -627,24 +640,42 @@ void LLViewerTexture::updateClass() } //static -bool LLViewerTexture::isSystemMemoryLow() +U32Megabytes LLViewerTexture::getFreeSystemMemory() { static LLFrameTimer timer; static U32Megabytes physical_res = U32Megabytes(U32_MAX); - static LLCachedControl min_free_main_memory(gSavedSettings, "RenderMinFreeMainMemoryThreshold", 512); - const U32Megabytes MIN_FREE_MAIN_MEMORY(min_free_main_memory); - if (timer.getElapsedTimeF32() < MEMORY_CHECK_WAIT_TIME) //call this once per second. { - return physical_res < MIN_FREE_MAIN_MEMORY; + return physical_res; } timer.reset(); LLMemory::updateMemoryInfo(); physical_res = LLMemory::getAvailableMemKB(); - return physical_res < MIN_FREE_MAIN_MEMORY; + return physical_res; +} + +//static +bool LLViewerTexture::isSystemMemoryLow() +{ + static LLCachedControl min_free_main_memory(gSavedSettings, "RenderMinFreeMainMemoryThreshold", 512); + const U32Megabytes MIN_FREE_MAIN_MEMORY(min_free_main_memory); + return getFreeSystemMemory() < MIN_FREE_MAIN_MEMORY; +} + +F32 LLViewerTexture::getSystemMemoryBudgetFactor() +{ + static LLCachedControl min_free_main_memory(gSavedSettings, "RenderMinFreeMainMemoryThreshold", 512); + const S32Megabytes MIN_FREE_MAIN_MEMORY(min_free_main_memory); + S32 free_budget = (S32Megabytes)getFreeSystemMemory() - MIN_FREE_MAIN_MEMORY; + if (free_budget < 0) + { + // Result should range from 1 (0 free budget) to 2 (-512 free budget) + return 1.f - free_budget / MIN_FREE_MAIN_MEMORY; + } + return 1.f; } //end of static functions diff --git a/indra/newview/llviewertexture.h b/indra/newview/llviewertexture.h index f9311d85cb..d32c302d8e 100644 --- a/indra/newview/llviewertexture.h +++ b/indra/newview/llviewertexture.h @@ -115,6 +115,7 @@ public: static void initClass(); static void updateClass(); static bool isSystemMemoryLow(); + static F32 getSystemMemoryBudgetFactor(); LLViewerTexture(bool usemipmaps = true); LLViewerTexture(const LLUUID& id, bool usemipmaps) ; @@ -189,6 +190,8 @@ private: friend class LLBumpImageList; friend class LLUIImageList; + static U32Megabytes getFreeSystemMemory(); + protected: friend class LLViewerTextureList; LLUUID mID; diff --git a/indra/newview/llvocache.cpp b/indra/newview/llvocache.cpp index 501828eee8..ac73c2def6 100644 --- a/indra/newview/llvocache.cpp +++ b/indra/newview/llvocache.cpp @@ -486,14 +486,23 @@ void LLVOCacheEntry::updateDebugSettings() //min radius: all objects within this radius remain loaded in memory static LLCachedControl min_radius(gSavedSettings,"SceneLoadMinRadius"); static const F32 MIN_RADIUS = 1.0f; - const F32 draw_radius = gAgentCamera.mDrawDistance; + + F32 draw_radius = gAgentCamera.mDrawDistance; + if (LLViewerTexture::sDesiredDiscardBias > 2.f && LLViewerTexture::isSystemMemoryLow()) + { + // Discard's bias maximum is 4 so we need to check 2 to 4 range + // Factor is intended to go from 1.0 to 2.0 + F32 factor = 1.f + (LLViewerTexture::sDesiredDiscardBias - 2.f) / 2.f; + // For safety cap reduction at 50%, we don't want to go below half of draw distance + draw_radius = llmax(draw_radius / factor, draw_radius / 2.f); + } const F32 clamped_min_radius = llclamp((F32) min_radius, MIN_RADIUS, draw_radius); // [1, mDrawDistance] sNearRadius = MIN_RADIUS + ((clamped_min_radius - MIN_RADIUS) * adjust_factor); // a percentage of draw distance beyond which all objects outside of view frustum will be unloaded, regardless of pixel threshold static LLCachedControl rear_max_radius_frac(gSavedSettings,"SceneLoadRearMaxRadiusFraction"); const F32 min_radius_plus_one = sNearRadius + 1.f; - const F32 max_radius = rear_max_radius_frac * gAgentCamera.mDrawDistance; + const F32 max_radius = rear_max_radius_frac * draw_radius; const F32 clamped_max_radius = llclamp(max_radius, min_radius_plus_one, draw_radius); // [sNearRadius, mDrawDistance] sRearFarRadius = min_radius_plus_one + ((clamped_max_radius - min_radius_plus_one) * adjust_factor); -- cgit v1.2.3 From 479fee984a595cab4fad0aae9157c5e168da692f Mon Sep 17 00:00:00 2001 From: Andrey Kleshchev Date: Fri, 29 Aug 2025 00:03:07 +0300 Subject: #4604 Warn user off high settings when on low-RAM hardware --- indra/newview/llfloaterpreference.cpp | 28 ++++++++++++++++++++++ indra/newview/llfloaterpreference.h | 1 + .../newview/skins/default/xui/en/notifications.xml | 11 +++++++++ 3 files changed, 40 insertions(+) diff --git a/indra/newview/llfloaterpreference.cpp b/indra/newview/llfloaterpreference.cpp index b74736a39d..291f22d78f 100644 --- a/indra/newview/llfloaterpreference.cpp +++ b/indra/newview/llfloaterpreference.cpp @@ -758,6 +758,7 @@ void LLFloaterPreference::onOpen(const LLSD& key) // Forget previous language changes. mLanguageChanged = false; + mLastQualityLevel = gSavedSettings.getU32("RenderQualityPerformance"); // Display selected maturity icons. onChangeMaturity(); @@ -1327,6 +1328,33 @@ void LLFloaterPreference::onCommitWindowedMode() void LLFloaterPreference::onChangeQuality(const LLSD& data) { U32 level = (U32)(data.asReal()); + constexpr U32 LVL_HIGH = 4; + if (level >= LVL_HIGH && mLastQualityLevel < level) + { + constexpr U32 LOW_MEM_THRESHOLD = 4097; + U32 total_mem = (U32Megabytes)LLMemory::getMaxMemKB(); + if (total_mem < LOW_MEM_THRESHOLD) + { + LLSD args; + args["TOTAL_MEM"] = LLSD::Integer(total_mem); + LLNotificationsUtil::add("PreferenceQualityWithLowMemory", args, LLSD(), [this](const LLSD& notification, const LLSD& response) + { + S32 option = LLNotificationsUtil::getSelectedOption(notification, response); + // If cancel pressed + if (option == 1) + { + constexpr U32 LVL_MED_PLUS = 3; + gSavedSettings.setU32("RenderQualityPerformance", LVL_MED_PLUS); + mLastQualityLevel = LVL_MED_PLUS; + LLFeatureManager::getInstance()->setGraphicsLevel(LVL_MED_PLUS, true); + refreshEnabledGraphics(); + refresh(); + } + } + ); + } + } + mLastQualityLevel = level; LLFeatureManager::getInstance()->setGraphicsLevel(level, true); refreshEnabledGraphics(); refresh(); diff --git a/indra/newview/llfloaterpreference.h b/indra/newview/llfloaterpreference.h index fa9c421a8f..61ac0a4d77 100644 --- a/indra/newview/llfloaterpreference.h +++ b/indra/newview/llfloaterpreference.h @@ -218,6 +218,7 @@ private: bool mGotPersonalInfo; bool mLanguageChanged; bool mAvatarDataInitialized; + U32 mLastQualityLevel = 0; std::string mPriorInstantMessageLogPath; bool mOriginalHideOnlineStatus; diff --git a/indra/newview/skins/default/xui/en/notifications.xml b/indra/newview/skins/default/xui/en/notifications.xml index b182a241d8..7fc96af55d 100644 --- a/indra/newview/skins/default/xui/en/notifications.xml +++ b/indra/newview/skins/default/xui/en/notifications.xml @@ -12145,6 +12145,17 @@ Cannot create large prims that intersect other residents. Please re-try when ot yestext="OK"/> + +Your system has [TOTAL_MEM]MB of memory, which might not be enough to run viewer at higher settings and might result in issues. + + + Date: Fri, 29 Aug 2025 20:33:32 +0300 Subject: #4598 Fix variables being inited before settings are ready --- indra/newview/llreflectionmapmanager.cpp | 1 - indra/newview/pipeline.cpp | 2 ++ 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/indra/newview/llreflectionmapmanager.cpp b/indra/newview/llreflectionmapmanager.cpp index f24bb892dc..663d8626b7 100644 --- a/indra/newview/llreflectionmapmanager.cpp +++ b/indra/newview/llreflectionmapmanager.cpp @@ -145,7 +145,6 @@ static void touch_default_probe(LLReflectionMap* probe) LLReflectionMapManager::LLReflectionMapManager() { mDynamicProbeCount = LL_MAX_REFLECTION_PROBE_COUNT; - refreshSettings(); initCubeFree(); } diff --git a/indra/newview/pipeline.cpp b/indra/newview/pipeline.cpp index 493fcd5d45..209b06fd85 100644 --- a/indra/newview/pipeline.cpp +++ b/indra/newview/pipeline.cpp @@ -426,6 +426,8 @@ void LLPipeline::init() sRenderAttachedLights = gSavedSettings.getBOOL("RenderAttachedLights"); sRenderAttachedParticles = gSavedSettings.getBOOL("RenderAttachedParticles"); + mReflectionMapManager.refreshSettings(); + mInitialized = true; stop_glerror(); -- cgit v1.2.3 From 5d50a660bc6ac480b1f92db47bcb3974104bf4d1 Mon Sep 17 00:00:00 2001 From: Andrey Kleshchev Date: Wed, 27 Aug 2025 22:03:32 +0300 Subject: #4588 Unable to direct silent installation --- .../installers/windows/installer_template.nsi | 86 +++++++++++++++++++++- indra/newview/llstartup.cpp | 1 + 2 files changed, 86 insertions(+), 1 deletion(-) diff --git a/indra/newview/installers/windows/installer_template.nsi b/indra/newview/installers/windows/installer_template.nsi index 77f24ac6a6..0e36698018 100644 --- a/indra/newview/installers/windows/installer_template.nsi +++ b/indra/newview/installers/windows/installer_template.nsi @@ -163,6 +163,74 @@ Var DO_UNINSTALL_V2 # If non-null, path to a previous Viewer 2 installation !include 'LogicLib.nsh' # for value comparison !include "x64.nsh" # for 64bit detection +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; Substring function +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +!define StrStr "!insertmacro StrStr" + +!macro StrStr ResultVar String SubString + Push `${String}` + Push `${SubString}` + Call StrStr + Pop `${ResultVar}` +!macroend + +Function StrStr + +# After this point: +# ------------------------------------------ +# $R0 = SubString (input) +# $R1 = String (input) +# $R2 = SubStringLen (temp) +# $R3 = StrLen (temp) +# $R4 = StartCharPos (temp) +# $R5 = TempStr (temp) +# function from nsis.sourceforge.io/StrStr + + ;Get input from user + Exch $R0 + Exch + Exch $R1 + Push $R2 + Push $R3 + Push $R4 + Push $R5 + + ;Get "String" and "SubString" length + StrLen $R2 $R0 + StrLen $R3 $R1 + ;Start "StartCharPos" counter + StrCpy $R4 0 + + ;Loop until "SubString" is found or "String" reaches its end + ${Do} + ;Remove everything before and after the searched part ("TempStr") + StrCpy $R5 $R1 $R2 $R4 + + ;Compare "TempStr" with "SubString" + ${IfThen} $R5 == $R0 ${|} ${ExitDo} ${|} + ;If not "SubString", this could be "String"'s end + ${IfThen} $R4 >= $R3 ${|} ${ExitDo} ${|} + ;If not, continue the loop + IntOp $R4 $R4 + 1 + ${Loop} + +# After this point: +# ------------------------------------------ +# $R0 = ResultVar (output) + + ;Remove part before "SubString" on "String" (if there has one) + StrCpy $R0 $R1 `` $R4 + + ;Return output to user + Pop $R5 + Pop $R4 + Pop $R3 + Pop $R2 + Pop $R1 + Exch $R0 +FunctionEnd + ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; Pre-directory page callback ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; @@ -190,15 +258,31 @@ Function .onInit # However, SL-10506 complains about the resulting behavior, so the logic below # is adapted from before we introduced MultiUser.nsh. +# Check if user specified /D= on the command line +System::Call 'kernel32::GetCommandLine()t .r0' +Push $0 +Push " /D=" +Call StrStr +Pop $1 +${If} $1 != "" + # /D= was specified, extract the path + # spaces are allowed in path after /D=, it's expected to be the last parameter + StrLen $2 $1 + StrCpy $INSTDIR $1 $2 4 # Skip over " /D=" + Goto after_instdir +${EndIf} + # if $0 is empty, this is the first time for this viewer name ReadRegStr $0 SHELL_CONTEXT "${INSTNAME_KEY}" "" # viewer with this name was installed before ${If} $0 != "" - # use the value we got from registry as install location + # use the value we got from registry as install location StrCpy $INSTDIR $0 ${EndIf} +after_instdir: + Call CheckCPUFlags # Make sure we have SSE2 support Call CheckWindowsVersion # Don't install On unsupported systems Push $0 diff --git a/indra/newview/llstartup.cpp b/indra/newview/llstartup.cpp index ba7437798a..5df7eca5f5 100644 --- a/indra/newview/llstartup.cpp +++ b/indra/newview/llstartup.cpp @@ -397,6 +397,7 @@ bool idle_startup() LL_WARNS_ONCE() << "gViewerWindow is not initialized" << LL_ENDL; return false; // No world yet } + LL_PROFILE_ZONE_SCOPED; const F32 PRECACHING_DELAY = gSavedSettings.getF32("PrecachingDelay"); static LLTimer timeout; -- cgit v1.2.3 From 9959f51741dc6b2eb04485b3443334e1e2e30d19 Mon Sep 17 00:00:00 2001 From: Andrey Kleshchev Date: Mon, 1 Sep 2025 22:37:46 +0300 Subject: #4619 Don't crash on LLHUDEffect::render LLHUDEffectResetSkeleton needs to override LLHUDEffect::render to not cause an LL_ERRS if it stays alive for too long. --- indra/newview/llhudeffectresetskeleton.cpp | 9 +++++++++ indra/newview/llhudeffectresetskeleton.h | 13 +++++++------ 2 files changed, 16 insertions(+), 6 deletions(-) diff --git a/indra/newview/llhudeffectresetskeleton.cpp b/indra/newview/llhudeffectresetskeleton.cpp index 31065a3e76..2bb5696f59 100644 --- a/indra/newview/llhudeffectresetskeleton.cpp +++ b/indra/newview/llhudeffectresetskeleton.cpp @@ -53,6 +53,15 @@ LLHUDEffectResetSkeleton::~LLHUDEffectResetSkeleton() { } +//----------------------------------------------------------------------------- +// packData() +//----------------------------------------------------------------------------- +void LLHUDEffectResetSkeleton::render() +{ + // HUDEffectResetSkeleton is a fake effect meant to reset skeleton only. + // Just wait for an update() call to do its work and then die. +} + //----------------------------------------------------------------------------- // packData() //----------------------------------------------------------------------------- diff --git a/indra/newview/llhudeffectresetskeleton.h b/indra/newview/llhudeffectresetskeleton.h index 39a6137054..c89516d7fc 100644 --- a/indra/newview/llhudeffectresetskeleton.h +++ b/indra/newview/llhudeffectresetskeleton.h @@ -38,20 +38,21 @@ class LLHUDEffectResetSkeleton final : public LLHUDEffect public: friend class LLHUDObject; - /*virtual*/ void markDead(); - /*virtual*/ void setSourceObject(LLViewerObject* objectp); + /*virtual*/ void markDead() override; + /*virtual*/ void setSourceObject(LLViewerObject* objectp) override; - void setTargetObject(LLViewerObject *objp); + void setTargetObject(LLViewerObject *objp) override; void setResetAnimations(bool enable){ mResetAnimations = enable; }; protected: LLHUDEffectResetSkeleton(const U8 type); ~LLHUDEffectResetSkeleton(); - /*virtual*/ void packData(LLMessageSystem *mesgsys); - /*virtual*/ void unpackData(LLMessageSystem *mesgsys, S32 blocknum); + void render() override; + void packData(LLMessageSystem *mesgsys) override; + void unpackData(LLMessageSystem *mesgsys, S32 blocknum) override; - void update(); + void update() override; private: bool mResetAnimations; }; -- cgit v1.2.3 From e5b7e8a9a822e69777e406d5be8239155a47155b Mon Sep 17 00:00:00 2001 From: Andrey Kleshchev Date: Mon, 1 Sep 2025 22:56:58 +0300 Subject: #4621 Crash at LLMeshRepoThread::run(1060) Fix a missed mutex --- indra/newview/llmeshrepository.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/indra/newview/llmeshrepository.cpp b/indra/newview/llmeshrepository.cpp index 997fc28333..8d5f94cdbb 100644 --- a/indra/newview/llmeshrepository.cpp +++ b/indra/newview/llmeshrepository.cpp @@ -2310,6 +2310,7 @@ EMeshProcessingResult LLMeshRepoThread::headerReceived(const LLVolumeParams& mes } if (request_skin) { + LLMutexLock lock(mMutex); mSkinRequests.push_back(UUIDBasedRequest(mesh_id)); } } -- cgit v1.2.3 From 0fe641a3f20997c970112df7d188510993733338 Mon Sep 17 00:00:00 2001 From: Rye Date: Wed, 27 Aug 2025 22:36:55 -0400 Subject: Changes to support dullahan 1.21 undo/redo/delete/select all edit handlers --- indra/llplugin/llpluginclassmedia.cpp | 50 ++++++++++++++ indra/llplugin/llpluginclassmedia.h | 18 +++++ indra/media_plugins/cef/media_plugin_cef.cpp | 59 +++++++++++++++- indra/newview/llmediactrl.cpp | 10 ++- indra/newview/llmediactrl.h | 1 + indra/newview/llviewermedia.cpp | 80 ++++++++++++++++++++++ indra/newview/llviewermedia.h | 12 ++++ .../skins/default/xui/en/menu_media_ctrl.xml | 8 +++ 8 files changed, 236 insertions(+), 2 deletions(-) diff --git a/indra/llplugin/llpluginclassmedia.cpp b/indra/llplugin/llpluginclassmedia.cpp index 8a356da93a..77a4b08af5 100644 --- a/indra/llplugin/llpluginclassmedia.cpp +++ b/indra/llplugin/llpluginclassmedia.cpp @@ -132,9 +132,13 @@ void LLPluginClassMedia::reset() mLastMouseY = 0; mStatus = LLPluginClassMediaOwner::MEDIA_NONE; mSleepTime = 1.0f / 100.0f; + mCanUndo = false; + mCanRedo = false; mCanCut = false; mCanCopy = false; mCanPaste = false; + mCanDoDelete = false; + mCanSelectAll = false; mMediaName.clear(); mMediaDescription.clear(); mBackgroundColor = LLColor4(1.0f, 1.0f, 1.0f, 1.0f); @@ -907,6 +911,18 @@ void LLPluginClassMedia::sendAuthResponse(bool ok, const std::string &username, sendMessage(message); } +void LLPluginClassMedia::undo() +{ + LLPluginMessage message(LLPLUGIN_MESSAGE_CLASS_MEDIA, "edit_undo"); + sendMessage(message); +} + +void LLPluginClassMedia::redo() +{ + LLPluginMessage message(LLPLUGIN_MESSAGE_CLASS_MEDIA, "edit_redo"); + sendMessage(message); +} + void LLPluginClassMedia::cut() { LLPluginMessage message(LLPLUGIN_MESSAGE_CLASS_MEDIA, "edit_cut"); @@ -925,6 +941,24 @@ void LLPluginClassMedia::paste() sendMessage(message); } +void LLPluginClassMedia::doDelete() +{ + LLPluginMessage message(LLPLUGIN_MESSAGE_CLASS_MEDIA, "edit_delete"); + sendMessage(message); +} + +void LLPluginClassMedia::selectAll() +{ + LLPluginMessage message(LLPLUGIN_MESSAGE_CLASS_MEDIA, "edit_select_all"); + sendMessage(message); +} + +void LLPluginClassMedia::showPageSource() +{ + LLPluginMessage message(LLPLUGIN_MESSAGE_CLASS_MEDIA, "edit_show_source"); + sendMessage(message); +} + void LLPluginClassMedia::setUserDataPath(const std::string &user_data_path_cache, const std::string &username, const std::string &user_data_path_cef_log) @@ -1178,6 +1212,14 @@ void LLPluginClassMedia::receivePluginMessage(const LLPluginMessage &message) } else if(message_name == "edit_state") { + if(message.hasValue("undo")) + { + mCanUndo = message.getValueBoolean("undo"); + } + if(message.hasValue("redo")) + { + mCanRedo = message.getValueBoolean("redo"); + } if(message.hasValue("cut")) { mCanCut = message.getValueBoolean("cut"); @@ -1190,6 +1232,14 @@ void LLPluginClassMedia::receivePluginMessage(const LLPluginMessage &message) { mCanPaste = message.getValueBoolean("paste"); } + if (message.hasValue("delete")) + { + mCanDoDelete = message.getValueBoolean("delete"); + } + if (message.hasValue("select_all")) + { + mCanSelectAll = message.getValueBoolean("select_all"); + } } else if(message_name == "name_text") { diff --git a/indra/llplugin/llpluginclassmedia.h b/indra/llplugin/llpluginclassmedia.h index d74b790d8f..292d934419 100644 --- a/indra/llplugin/llpluginclassmedia.h +++ b/indra/llplugin/llpluginclassmedia.h @@ -201,6 +201,12 @@ public: LLPluginClassMediaOwner::EMediaStatus getStatus() const { return mStatus; } + void undo(); + bool canUndo() const { return mCanUndo; }; + + void redo(); + bool canRedo() const { return mCanRedo; }; + void cut(); bool canCut() const { return mCanCut; }; @@ -210,6 +216,14 @@ public: void paste(); bool canPaste() const { return mCanPaste; }; + void doDelete(); + bool canDoDelete() const { return mCanDoDelete; }; + + void selectAll(); + bool canSelectAll() const { return mCanSelectAll; }; + + void showPageSource(); + // These can be called before init(), and they will be queued and sent before the media init message. void setUserDataPath(const std::string &user_data_path_cache, const std::string &username, const std::string &user_data_path_cef_log); void setLanguageCode(const std::string &language_code); @@ -419,9 +433,13 @@ protected: F64 mSleepTime; + bool mCanUndo; + bool mCanRedo; bool mCanCut; bool mCanCopy; bool mCanPaste; + bool mCanDoDelete; + bool mCanSelectAll; std::string mMediaName; std::string mMediaDescription; diff --git a/indra/media_plugins/cef/media_plugin_cef.cpp b/indra/media_plugins/cef/media_plugin_cef.cpp index 52df4a9685..caf804f915 100644 --- a/indra/media_plugins/cef/media_plugin_cef.cpp +++ b/indra/media_plugins/cef/media_plugin_cef.cpp @@ -106,9 +106,13 @@ private: std::string mAuthUsername; std::string mAuthPassword; bool mAuthOK; + bool mCanUndo; + bool mCanRedo; bool mCanCut; bool mCanCopy; bool mCanPaste; + bool mCanDelete; + bool mCanSelectAll; std::string mRootCachePath; std::string mCefLogFile; bool mCefLogVerbose; @@ -144,9 +148,13 @@ MediaPluginBase(host_send_func, host_user_data) mAuthUsername = ""; mAuthPassword = ""; mAuthOK = false; + mCanUndo = false; + mCanRedo = false; mCanCut = false; mCanCopy = false; mCanPaste = false; + mCanDelete = false; + mCanSelectAll = false; mCefLogFile = ""; mCefLogVerbose = false; mPickedFiles.clear(); @@ -940,6 +948,14 @@ void MediaPluginCEF::receiveMessage(const char* message_string) { authResponse(message_in); } + if (message_name == "edit_undo") + { + mCEFLib->editUndo(); + } + if (message_name == "edit_redo") + { + mCEFLib->editRedo(); + } if (message_name == "edit_cut") { mCEFLib->editCut(); @@ -952,6 +968,18 @@ void MediaPluginCEF::receiveMessage(const char* message_string) { mCEFLib->editPaste(); } + if (message_name == "edit_delete") + { + mCEFLib->editDelete(); + } + if (message_name == "edit_select_all") + { + mCEFLib->editSelectAll(); + } + if (message_name == "edit_show_source") + { + mCEFLib->viewSource(); + } } else if (message_class == LLPLUGIN_MESSAGE_CLASS_MEDIA_BROWSER) { @@ -1103,14 +1131,31 @@ void MediaPluginCEF::unicodeInput(std::string event, LLSD native_key_data = LLSD // void MediaPluginCEF::checkEditState() { + bool can_undo = mCEFLib->editCanUndo(); + bool can_redo = mCEFLib->editCanRedo(); bool can_cut = mCEFLib->editCanCut(); bool can_copy = mCEFLib->editCanCopy(); bool can_paste = mCEFLib->editCanPaste(); + bool can_delete = mCEFLib->editCanDelete(); + bool can_select_all = mCEFLib->editCanSelectAll(); - if ((can_cut != mCanCut) || (can_copy != mCanCopy) || (can_paste != mCanPaste)) + if ((can_undo != mCanUndo) || (can_redo != mCanRedo) || (can_cut != mCanCut) || (can_copy != mCanCopy) + || (can_paste != mCanPaste) || (can_delete != mCanDelete) || (can_select_all != mCanSelectAll)) { LLPluginMessage message(LLPLUGIN_MESSAGE_CLASS_MEDIA, "edit_state"); + if (can_undo != mCanUndo) + { + mCanUndo = can_undo; + message.setValueBoolean("undo", can_undo); + } + + if (can_redo != mCanRedo) + { + mCanRedo = can_redo; + message.setValueBoolean("redo", can_redo); + } + if (can_cut != mCanCut) { mCanCut = can_cut; @@ -1129,6 +1174,18 @@ void MediaPluginCEF::checkEditState() message.setValueBoolean("paste", can_paste); } + if (can_delete != mCanDelete) + { + mCanDelete = can_delete; + message.setValueBoolean("delete", can_delete); + } + + if (can_select_all != mCanSelectAll) + { + mCanSelectAll = can_select_all; + message.setValueBoolean("select_all", can_select_all); + } + sendMessage(message); } } diff --git a/indra/newview/llmediactrl.cpp b/indra/newview/llmediactrl.cpp index 202008f7f9..c7b60b2fd5 100644 --- a/indra/newview/llmediactrl.cpp +++ b/indra/newview/llmediactrl.cpp @@ -347,6 +347,7 @@ bool LLMediaCtrl::handleRightMouseDown( S32 x, S32 y, MASK mask ) { LLUICtrl::CommitCallbackRegistry::ScopedRegistrar registar; registar.add("Open.WebInspector", boost::bind(&LLMediaCtrl::onOpenWebInspector, this)); + registar.add("Open.ShowSource", boost::bind(&LLMediaCtrl::onShowSource, this)); // stinson 05/05/2014 : use this as the parent of the context menu if the static menu // container has yet to be created @@ -364,8 +365,9 @@ bool LLMediaCtrl::handleRightMouseDown( S32 x, S32 y, MASK mask ) { // hide/show debugging options bool media_plugin_debugging_enabled = gSavedSettings.getBOOL("MediaPluginDebugging"); + menu->setItemVisible("debug_separator", media_plugin_debugging_enabled); menu->setItemVisible("open_webinspector", media_plugin_debugging_enabled ); - menu->setItemVisible("debug_separator", media_plugin_debugging_enabled ); + menu->setItemVisible("show_page_source", media_plugin_debugging_enabled); menu->show(x, y); LLMenuGL::showPopup(this, menu, x, y); @@ -444,6 +446,12 @@ void LLMediaCtrl::onOpenWebInspector() mMediaSource->getMediaPlugin()->showWebInspector( true ); } +void LLMediaCtrl::onShowSource() +{ + if (mMediaSource && mMediaSource->hasMedia()) + mMediaSource->getMediaPlugin()->showPageSource(); +} + //////////////////////////////////////////////////////////////////////////////// // bool LLMediaCtrl::handleKeyHere( KEY key, MASK mask ) diff --git a/indra/newview/llmediactrl.h b/indra/newview/llmediactrl.h index 9f9564af46..a644ef3071 100644 --- a/indra/newview/llmediactrl.h +++ b/indra/newview/llmediactrl.h @@ -171,6 +171,7 @@ public: // right click debugging item void onOpenWebInspector(); + void onShowSource(); LLUUID getTextureID() {return mMediaTextureID;} diff --git a/indra/newview/llviewermedia.cpp b/indra/newview/llviewermedia.cpp index c6bc252efd..89861d74bc 100644 --- a/indra/newview/llviewermedia.cpp +++ b/indra/newview/llviewermedia.cpp @@ -3508,6 +3508,46 @@ void LLViewerMediaImpl::handleMediaEvent(LLPluginClassMedia* plugin, LLPluginCla } } +//////////////////////////////////////////////////////////////////////////////// +// virtual +void +LLViewerMediaImpl::undo() +{ + if (mMediaSource) + mMediaSource->undo(); +} + +//////////////////////////////////////////////////////////////////////////////// +// virtual +bool +LLViewerMediaImpl::canUndo() const +{ + if (mMediaSource) + return mMediaSource->canUndo(); + else + return FALSE; +} + +//////////////////////////////////////////////////////////////////////////////// +// virtual +void +LLViewerMediaImpl::redo() +{ + if (mMediaSource) + mMediaSource->redo(); +} + +//////////////////////////////////////////////////////////////////////////////// +// virtual +bool +LLViewerMediaImpl::canRedo() const +{ + if (mMediaSource) + return mMediaSource->canRedo(); + else + return FALSE; +} + //////////////////////////////////////////////////////////////////////////////// // virtual void @@ -3568,6 +3608,46 @@ LLViewerMediaImpl::canPaste() const return false; } +//////////////////////////////////////////////////////////////////////////////// +// virtual +void +LLViewerMediaImpl::doDelete() +{ + if (mMediaSource) + mMediaSource->doDelete(); +} + +//////////////////////////////////////////////////////////////////////////////// +// virtual +bool +LLViewerMediaImpl::canDoDelete() const +{ + if (mMediaSource) + return mMediaSource->canDoDelete(); + else + return FALSE; +} + +//////////////////////////////////////////////////////////////////////////////// +// virtual +void +LLViewerMediaImpl::selectAll() +{ + if (mMediaSource) + mMediaSource->selectAll(); +} + +//////////////////////////////////////////////////////////////////////////////// +// virtual +bool +LLViewerMediaImpl::canSelectAll() const +{ + if (mMediaSource) + return mMediaSource->canSelectAll(); + else + return FALSE; +} + void LLViewerMediaImpl::setUpdated(bool updated) { mIsUpdated = updated ; diff --git a/indra/newview/llviewermedia.h b/indra/newview/llviewermedia.h index 5753615a43..c17cf59815 100644 --- a/indra/newview/llviewermedia.h +++ b/indra/newview/llviewermedia.h @@ -341,6 +341,12 @@ public: /*virtual*/ void handleMediaEvent(LLPluginClassMedia* plugin, LLPluginClassMediaOwner::EMediaEvent); // LLEditMenuHandler overrides + /*virtual*/ void undo(); + /*virtual*/ bool canUndo() const; + + /*virtual*/ void redo(); + /*virtual*/ bool canRedo() const; + /*virtual*/ void cut(); /*virtual*/ bool canCut() const; @@ -350,6 +356,12 @@ public: /*virtual*/ void paste(); /*virtual*/ bool canPaste() const; + /*virtual*/ void doDelete(); + /*virtual*/ bool canDoDelete() const; + + /*virtual*/ void selectAll(); + /*virtual*/ bool canSelectAll() const; + void addObject(LLVOVolume* obj) ; void removeObject(LLVOVolume* obj) ; const std::list< LLVOVolume* >* getObjectList() const ; diff --git a/indra/newview/skins/default/xui/en/menu_media_ctrl.xml b/indra/newview/skins/default/xui/en/menu_media_ctrl.xml index f9864637a0..e687ae93e8 100644 --- a/indra/newview/skins/default/xui/en/menu_media_ctrl.xml +++ b/indra/newview/skins/default/xui/en/menu_media_ctrl.xml @@ -40,4 +40,12 @@ + + + -- cgit v1.2.3 From 012c0705bd30510167c3cb86343cccb72d23bf71 Mon Sep 17 00:00:00 2001 From: Rye Date: Wed, 27 Aug 2025 23:05:40 -0400 Subject: MacOS companion changes for dullahan 1.21 including package structure and linkage fixes --- indra/cmake/00-Common.cmake | 3 + indra/cmake/CEFPlugin.cmake | 1 - indra/cmake/PluginAPI.cmake | 4 + indra/llfilesystem/lldir_mac.cpp | 2 +- indra/llplugin/CMakeLists.txt | 2 +- indra/llplugin/llpluginclassmedia.h | 7 +- indra/llplugin/slplugin/CMakeLists.txt | 28 ++--- indra/media_plugins/base/CMakeLists.txt | 2 +- indra/media_plugins/cef/CMakeLists.txt | 10 +- indra/media_plugins/example/CMakeLists.txt | 2 +- indra/media_plugins/libvlc/CMakeLists.txt | 2 +- indra/media_plugins/libvlc/media_plugin_libvlc.cpp | 2 +- indra/newview/CMakeLists.txt | 6 +- indra/newview/viewer_manifest.py | 123 ++++----------------- 14 files changed, 52 insertions(+), 142 deletions(-) diff --git a/indra/cmake/00-Common.cmake b/indra/cmake/00-Common.cmake index c895f42362..5943e0b573 100644 --- a/indra/cmake/00-Common.cmake +++ b/indra/cmake/00-Common.cmake @@ -162,6 +162,9 @@ endif (LINUX) if (DARWIN) + # Use rpath loading on macos + set(CMAKE_MACOSX_RPATH TRUE) + # Warnings should be fatal -- thanks, Nicky Perian, for spotting reversed default set(CLANG_DISABLE_FATAL_WARNINGS OFF) set(CMAKE_CXX_LINK_FLAGS "-Wl,-headerpad_max_install_names,-search_paths_first") diff --git a/indra/cmake/CEFPlugin.cmake b/indra/cmake/CEFPlugin.cmake index 9b77becf29..e27929fa08 100644 --- a/indra/cmake/CEFPlugin.cmake +++ b/indra/cmake/CEFPlugin.cmake @@ -29,7 +29,6 @@ elseif (DARWIN) ${ARCH_PREBUILT_DIRS_RELEASE}/libcef_dll_wrapper.a ${ARCH_PREBUILT_DIRS_RELEASE}/libdullahan.a ${APPKIT_LIBRARY} - "-F ${CEF_LIBRARY}" ) elseif (LINUX) diff --git a/indra/cmake/PluginAPI.cmake b/indra/cmake/PluginAPI.cmake index 114415e514..a2bf13db2c 100644 --- a/indra/cmake/PluginAPI.cmake +++ b/indra/cmake/PluginAPI.cmake @@ -1,5 +1,7 @@ # -*- cmake -*- +include(OpenGL) + add_library( ll::pluginlibraries INTERFACE IMPORTED ) if (WINDOWS) @@ -13,4 +15,6 @@ if (WINDOWS) ) endif (WINDOWS) +target_link_libraries( ll::pluginlibraries INTERFACE OpenGL::GL) +target_include_directories( ll::pluginlibraries INTERFACE ${CMAKE_SOURCE_DIR}/llimage ${CMAKE_SOURCE_DIR}/llrender) diff --git a/indra/llfilesystem/lldir_mac.cpp b/indra/llfilesystem/lldir_mac.cpp index b9be75c528..2db1b6ec5d 100644 --- a/indra/llfilesystem/lldir_mac.cpp +++ b/indra/llfilesystem/lldir_mac.cpp @@ -149,7 +149,7 @@ LLDir_Mac::LLDir_Mac() mWorkingDir = getCurPath(); - mLLPluginDir = mAppRODataDir + mDirDelimiter + "llplugin"; + mLLPluginDir = mAppRODataDir + mDirDelimiter + "SLPlugin.app" + mDirDelimiter + "Contents" + mDirDelimiter + "Frameworks"; } } diff --git a/indra/llplugin/CMakeLists.txt b/indra/llplugin/CMakeLists.txt index 14a69afe6e..f7f8c08adb 100644 --- a/indra/llplugin/CMakeLists.txt +++ b/indra/llplugin/CMakeLists.txt @@ -43,6 +43,6 @@ list(APPEND llplugin_SOURCE_FILES ${llplugin_HEADER_FILES}) add_library (llplugin ${llplugin_SOURCE_FILES}) target_include_directories( llplugin INTERFACE ${CMAKE_CURRENT_SOURCE_DIR}) -target_link_libraries( llplugin llcommon llmath llrender llmessage ) +target_link_libraries( llplugin llcommon llmath llmessage llxml ) add_subdirectory(slplugin) diff --git a/indra/llplugin/llpluginclassmedia.h b/indra/llplugin/llpluginclassmedia.h index 292d934419..71522bcd7d 100644 --- a/indra/llplugin/llpluginclassmedia.h +++ b/indra/llplugin/llpluginclassmedia.h @@ -29,7 +29,6 @@ #ifndef LL_LLPLUGINCLASSMEDIA_H #define LL_LLPLUGINCLASSMEDIA_H -#include "llgltypes.h" #include "llpluginprocessparent.h" #include "llrect.h" #include "llpluginclassmediaowner.h" @@ -365,9 +364,9 @@ protected: bool mTextureParamsReceived; // the mRequestedTexture* fields are only valid when this is true S32 mRequestedTextureDepth; - LLGLenum mRequestedTextureInternalFormat; - LLGLenum mRequestedTextureFormat; - LLGLenum mRequestedTextureType; + U32 mRequestedTextureInternalFormat; + U32 mRequestedTextureFormat; + U32 mRequestedTextureType; bool mRequestedTextureSwapBytes; bool mRequestedTextureCoordsOpenGL; diff --git a/indra/llplugin/slplugin/CMakeLists.txt b/indra/llplugin/slplugin/CMakeLists.txt index 0ea6495eac..e639e522af 100644 --- a/indra/llplugin/slplugin/CMakeLists.txt +++ b/indra/llplugin/slplugin/CMakeLists.txt @@ -30,18 +30,6 @@ add_executable(SLPlugin ${SLPlugin_SOURCE_FILES} ) -if (WINDOWS) -set_target_properties(SLPlugin - PROPERTIES - LINK_FLAGS_DEBUG "/NODEFAULTLIB:\"LIBCMTD\"" - ) -else () -set_target_properties(SLPlugin - PROPERTIES - MACOSX_BUNDLE_INFO_PLIST ${CMAKE_CURRENT_SOURCE_DIR}/slplugin_info.plist - ) -endif () - target_link_libraries(SLPlugin llplugin llmessage @@ -49,7 +37,19 @@ target_link_libraries(SLPlugin ll::pluginlibraries ) -if (DARWIN) +if (WINDOWS) + set_target_properties(SLPlugin + PROPERTIES + LINK_FLAGS_DEBUG "/NODEFAULTLIB:\"LIBCMTD\"" + ) +elseif (DARWIN) + set_target_properties(SLPlugin + PROPERTIES + BUILD_WITH_INSTALL_RPATH 1 + INSTALL_RPATH "@executable_path/../../../../Frameworks;@executable_path/../Frameworks;@executable_path/../Frameworks/plugins" + MACOSX_BUNDLE_INFO_PLIST ${CMAKE_CURRENT_SOURCE_DIR}/slplugin_info.plist + ) + # Make sure the app bundle has a Resources directory (it will get populated by viewer-manifest.py later) add_custom_command( TARGET SLPlugin POST_BUILD @@ -58,7 +58,7 @@ if (DARWIN) -p ${CMAKE_CURRENT_BINARY_DIR}/$,$,>/SLPlugin.app/Contents/Resources ) -endif (DARWIN) +endif () if (LL_TESTS) ll_deploy_sharedlibs_command(SLPlugin) diff --git a/indra/media_plugins/base/CMakeLists.txt b/indra/media_plugins/base/CMakeLists.txt index 64b6a4228d..23f503c345 100644 --- a/indra/media_plugins/base/CMakeLists.txt +++ b/indra/media_plugins/base/CMakeLists.txt @@ -34,5 +34,5 @@ add_library(media_plugin_base ${media_plugin_base_SOURCE_FILES} ) -target_link_libraries( media_plugin_base llplugin ) +target_link_libraries( media_plugin_base llplugin ll::pluginlibraries) target_include_directories( media_plugin_base INTERFACE ${CMAKE_CURRENT_SOURCE_DIR}) diff --git a/indra/media_plugins/cef/CMakeLists.txt b/indra/media_plugins/cef/CMakeLists.txt index 0d1a833936..ebcf67576d 100644 --- a/indra/media_plugins/cef/CMakeLists.txt +++ b/indra/media_plugins/cef/CMakeLists.txt @@ -77,16 +77,8 @@ if (DARWIN) PROPERTIES PREFIX "" BUILD_WITH_INSTALL_RPATH 1 - INSTALL_NAME_DIR "@executable_path" + INSTALL_RPATH "@executable_path/../Frameworks" LINK_FLAGS "-exported_symbols_list ${CMAKE_CURRENT_SOURCE_DIR}/../base/media_plugin_base.exp" ) - add_custom_command(TARGET media_plugin_cef - POST_BUILD COMMAND ${CMAKE_INSTALL_NAME_TOOL} -change "@executable_path/Chromium Embedded Framework" - "@executable_path/../../../../Frameworks/Chromium Embedded Framework.framework/Chromium Embedded Framework" - "$" - VERBATIM - COMMENT "Fixing path to CEF Framework" - ) - endif (DARWIN) diff --git a/indra/media_plugins/example/CMakeLists.txt b/indra/media_plugins/example/CMakeLists.txt index 41e2353f31..278dac8c33 100644 --- a/indra/media_plugins/example/CMakeLists.txt +++ b/indra/media_plugins/example/CMakeLists.txt @@ -47,7 +47,7 @@ if (DARWIN) PROPERTIES PREFIX "" BUILD_WITH_INSTALL_RPATH 1 - INSTALL_NAME_DIR "@executable_path" + INSTALL_RPATH "@executable_path/../Frameworks" LINK_FLAGS "-exported_symbols_list ${CMAKE_CURRENT_SOURCE_DIR}/../base/media_plugin_base.exp" ) diff --git a/indra/media_plugins/libvlc/CMakeLists.txt b/indra/media_plugins/libvlc/CMakeLists.txt index 202cbed96e..f9e0810df2 100644 --- a/indra/media_plugins/libvlc/CMakeLists.txt +++ b/indra/media_plugins/libvlc/CMakeLists.txt @@ -50,7 +50,7 @@ if (DARWIN) PROPERTIES PREFIX "" BUILD_WITH_INSTALL_RPATH 1 - INSTALL_NAME_DIR "@executable_path" + INSTALL_RPATH "@executable_path/../Frameworks" LINK_FLAGS "-exported_symbols_list ${CMAKE_CURRENT_SOURCE_DIR}/../base/media_plugin_base.exp" ) diff --git a/indra/media_plugins/libvlc/media_plugin_libvlc.cpp b/indra/media_plugins/libvlc/media_plugin_libvlc.cpp index 4240613a0c..ad0ecaf4ab 100644 --- a/indra/media_plugins/libvlc/media_plugin_libvlc.cpp +++ b/indra/media_plugins/libvlc/media_plugin_libvlc.cpp @@ -174,7 +174,7 @@ void MediaPluginLibVLC::initVLC() }; #if LL_DARWIN - setenv("VLC_PLUGIN_PATH", ".", 1); + setenv("VLC_PLUGIN_PATH", "./plugins", 1); #endif int vlc_argc = sizeof(vlc_argv) / sizeof(*vlc_argv); diff --git a/indra/newview/CMakeLists.txt b/indra/newview/CMakeLists.txt index f2aec208a1..40b6b35704 100644 --- a/indra/newview/CMakeLists.txt +++ b/indra/newview/CMakeLists.txt @@ -2156,10 +2156,8 @@ if (DARWIN) PROPERTIES OUTPUT_NAME "${product}" # From Contents/MacOS/SecondLife, look in Contents/Frameworks - INSTALL_RPATH "@loader_path/../Frameworks" - # SIGH, as of 2018-05-24 (cmake 3.11.1) the INSTALL_RPATH property simply - # does not work. Try this: - LINK_FLAGS "-rpath @loader_path/../Frameworks" + BUILD_WITH_INSTALL_RPATH 1 + INSTALL_RPATH "@executable_path/../Frameworks" MACOSX_BUNDLE_INFO_PLIST "${CMAKE_CURRENT_SOURCE_DIR}/Info-SecondLife.plist" XCODE_ATTRIBUTE_PRODUCT_BUNDLE_IDENTIFIER "${MACOSX_BUNDLE_GUI_IDENTIFIER}" ) diff --git a/indra/newview/viewer_manifest.py b/indra/newview/viewer_manifest.py index 905f53e50b..df9541d1a3 100755 --- a/indra/newview/viewer_manifest.py +++ b/indra/newview/viewer_manifest.py @@ -866,9 +866,6 @@ class Darwin_x86_64_Manifest(ViewerManifest): # CEF framework goes inside Contents/Frameworks. # Remember where we parked this car. with self.prefix(src="", dst="Frameworks"): - CEF_framework = "Chromium Embedded Framework.framework" - self.path2basename(relpkgdir, CEF_framework) - CEF_framework = self.dst_path_of(CEF_framework) if self.args.get('bugsplat'): self.path2basename(relpkgdir, "BugsplatMac.framework") @@ -1066,113 +1063,31 @@ class Darwin_x86_64_Manifest(ViewerManifest): # Dullahan helper apps go inside SLPlugin.app with self.prefix(dst=os.path.join( "SLPlugin.app", "Contents", "Frameworks")): - - frameworkname = 'Chromium Embedded Framework' - - # This code constructs a relative symlink from the - # target framework folder back to the real CEF framework. - # It needs to be relative so that the symlink still works when - # (as is normal) the user moves the app bundle out of the DMG - # and into the /Applications folder. Note we pass catch=False, - # letting the uncaught exception terminate the process, since - # without this symlink, Second Life web media can't possibly work. - - # It might seem simpler just to symlink Frameworks back to - # the parent of Chromimum Embedded Framework.framework. But - # that would create a symlink cycle, which breaks our - # packaging step. So make a symlink from Chromium Embedded - # Framework.framework to the directory of the same name, which - # is NOT an ancestor of the symlink. - - # from SLPlugin.app/Contents/Frameworks/Chromium Embedded - # Framework.framework back to - # $viewer_app/Contents/Frameworks/Chromium Embedded Framework.framework - SLPlugin_framework = self.relsymlinkf(CEF_framework, catch=False) - - # for all the multiple CEF/Dullahan (as of CEF 76) helper app bundles we need: - for helper in ( - "DullahanHelper", - "DullahanHelper (GPU)", - "DullahanHelper (Renderer)", - "DullahanHelper (Plugin)", - ): - # app is the directory name of the app bundle, with app/Contents/MacOS/helper as the executable - app = helper + ".app" - - # copy DullahanHelper.app - self.path2basename(relpkgdir, app) - - # and fix that up with a Frameworks/CEF symlink too - with self.prefix(dst=os.path.join( - app, 'Contents', 'Frameworks')): - # from Dullahan Helper *.app/Contents/Frameworks/Chromium Embedded - # Framework.framework back to - # SLPlugin.app/Contents/Frameworks/Chromium Embedded Framework.framework - # Since SLPlugin_framework is itself a - # symlink, don't let relsymlinkf() resolve -- - # explicitly call relpath(symlink=True) and - # create that symlink here. - helper_framework = \ - self.symlinkf(self.relpath(SLPlugin_framework, symlink=True), catch=False) - - # change_command includes install_name_tool, the - # -change subcommand and the old framework rpath - # stamped into the executable. To use it with - # run_command(), we must still append the new - # framework path and the pathname of the - # executable to change. - change_command = [ - 'install_name_tool', '-change', - '@rpath/Frameworks/Chromium Embedded Framework.framework/Chromium Embedded Framework'] - - with self.prefix(dst=os.path.join( - app, 'Contents', 'MacOS')): - # Now self.get_dst_prefix() is, at runtime, - # @executable_path. Locate the helper app - # framework (which is a symlink) from here. - newpath = os.path.join( - '@executable_path', - self.relpath(helper_framework, symlink=True), - frameworkname) - # and restamp the Dullahan Helper executable itself - self.run_command( - change_command + - [newpath, self.dst_path_of(helper)]) - - # SLPlugin plugins - with self.prefix(dst="llplugin"): - dylibexecutable = 'media_plugin_cef.dylib' + # copy CEF plugin self.path2basename("../media_plugins/cef/" + self.args['configuration'], - dylibexecutable) - - # Do this install_name_tool *after* media plugin is copied over. - # Locate the framework lib executable -- relative to - # SLPlugin.app/Contents/MacOS, which will be our - # @executable_path at runtime! - newpath = os.path.join( - '@executable_path', - self.relpath(SLPlugin_framework, executable_path["SLPlugin.app"], - symlink=True), - frameworkname) - # restamp media_plugin_cef.dylib - self.run_command( - change_command + - [newpath, self.dst_path_of(dylibexecutable)]) - - # copy LibVLC plugin itself - dylibexecutable = 'media_plugin_libvlc.dylib' - self.path2basename("../media_plugins/libvlc/" + self.args['configuration'], dylibexecutable) - # add @rpath for the correct LibVLC subfolder - self.run_command(['install_name_tool', '-add_rpath', '@loader_path/lib', self.dst_path_of(dylibexecutable)]) - - # copy LibVLC dynamic libraries - with self.prefix(src=relpkgdir, dst="lib"): + "media_plugin_cef.dylib") + + # copy LibVLC plugin + self.path2basename("../media_plugins/libvlc/" + self.args['configuration'], + "media_plugin_libvlc.dylib") + + # CEF framework and vlc libraries goes inside Contents/Frameworks. + with self.prefix(src=os.path.join(pkgdir, 'lib', 'release')): + self.path("Chromium Embedded Framework.framework") + self.path("DullahanHelper.app") + self.path("DullahanHelper (Alerts).app") + self.path("DullahanHelper (GPU).app") + self.path("DullahanHelper (Renderer).app") + self.path("DullahanHelper (Plugin).app") + + # Copy libvlc self.path( "libvlc*.dylib*" ) # copy LibVLC plugins folder - with self.prefix(src='plugins', dst=""): + with self.prefix(src='plugins', dst="plugins"): self.path( "*.dylib" ) self.path( "plugins.dat" ) + def package_finish(self): imagename = self.installer_base_name() self.set_github_output('imagename', imagename) -- cgit v1.2.3 From 0ae3de8f1e78dc74914ea70e725c8324390f3e97 Mon Sep 17 00:00:00 2001 From: Rye Date: Wed, 27 Aug 2025 23:05:58 -0400 Subject: Fix cmake to ${CMAKE_COMMAND} to avoid cmake error --- indra/test/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/indra/test/CMakeLists.txt b/indra/test/CMakeLists.txt index 745c0eedf8..f80286a630 100644 --- a/indra/test/CMakeLists.txt +++ b/indra/test/CMakeLists.txt @@ -114,7 +114,7 @@ if (LL_TESTS) # but the CMake $ generator expression isn't evaluated by # CREATE_LINK, so fudge it. add_custom_command( TARGET lltest POST_BUILD - COMMAND cmake -E create_symlink ${SHARED_LIB_STAGING_DIR} ${CMAKE_BINARY_DIR}/test/Resources + COMMAND ${CMAKE_COMMAND} -E create_symlink ${SHARED_LIB_STAGING_DIR} ${CMAKE_BINARY_DIR}/test/Resources ) endif() endif (LL_TESTS) -- cgit v1.2.3 From 3ea1d87a42bfc6aba367b1285e7bb6bdf49f8364 Mon Sep 17 00:00:00 2001 From: Andrey Kleshchev Date: Tue, 2 Sep 2025 23:26:16 +0300 Subject: #4587 Shaders sometimes do not match the shader settings Ensure versions get matched reliably --- indra/llrender/llshadermgr.cpp | 36 ++++++++++++++++++++++++++++-------- indra/llrender/llshadermgr.h | 4 ++-- indra/newview/llviewershadermgr.cpp | 11 +++++++++-- 3 files changed, 39 insertions(+), 12 deletions(-) diff --git a/indra/llrender/llshadermgr.cpp b/indra/llrender/llshadermgr.cpp index 4807c12226..0ec532a55b 100644 --- a/indra/llrender/llshadermgr.cpp +++ b/indra/llrender/llshadermgr.cpp @@ -989,16 +989,17 @@ bool LLShaderMgr::validateProgramObject(GLuint obj) return success; } -void LLShaderMgr::initShaderCache(bool enabled, const LLUUID& old_cache_version, const LLUUID& current_cache_version) +void LLShaderMgr::initShaderCache(bool enabled, const LLUUID& old_cache_version, const LLUUID& current_cache_version, bool second_instance) { + LL_PROFILE_ZONE_SCOPED; LL_INFOS() << "Initializing shader cache" << LL_ENDL; mShaderCacheEnabled = gGLManager.mGLVersion >= 4.09 && enabled; - if(!mShaderCacheEnabled || mShaderCacheInitialized) + if(!mShaderCacheEnabled || mShaderCacheVersion.notNull()) return; - mShaderCacheInitialized = true; + mShaderCacheVersion = current_cache_version; mShaderCacheDir = gDirUtilp->getExpandedFilename(LL_PATH_CACHE, "shader_cache"); LLFile::mkdir(mShaderCacheDir); @@ -1007,16 +1008,19 @@ void LLShaderMgr::initShaderCache(bool enabled, const LLUUID& old_cache_version, std::string meta_out_path = gDirUtilp->add(mShaderCacheDir, "shaderdata.llsd"); if (gDirUtilp->fileExists(meta_out_path)) { + LL_PROFILE_ZONE_NAMED("shader_cache"); LL_INFOS() << "Loading shader cache metadata" << LL_ENDL; llifstream instream(meta_out_path); LLSD in_data; + // todo: this is likely very expensive to parse, should use binary LLSDSerialize::fromNotation(in_data, instream, LLSDSerialize::SIZE_UNLIMITED); instream.close(); - if (old_cache_version == current_cache_version) + if (old_cache_version == current_cache_version + && in_data["version"].asUUID() == current_cache_version) { - for (const auto& data_pair : llsd::inMap(in_data)) + for (const auto& data_pair : llsd::inMap(in_data["shaders"])) { ProgramBinaryData binary_info = ProgramBinaryData(); binary_info.mBinaryFormat = data_pair.second["binary_format"].asInteger(); @@ -1025,11 +1029,15 @@ void LLShaderMgr::initShaderCache(bool enabled, const LLUUID& old_cache_version, mShaderBinaryCache.insert_or_assign(LLUUID(data_pair.first), binary_info); } } - else + else if (!second_instance) { LL_INFOS() << "Shader cache version mismatch detected. Purging." << LL_ENDL; clearShaderCache(); } + else + { + LL_INFOS() << "Shader cache version mismatch detected." << LL_ENDL; + } } } } @@ -1046,10 +1054,22 @@ void LLShaderMgr::clearShaderCache() void LLShaderMgr::persistShaderCacheMetadata() { if(!mShaderCacheEnabled) return; + if (mShaderCacheVersion.isNull()) + { + LL_WARNS() << "Attempted to save shader cache with no version set" << LL_ENDL; + return; + } LL_INFOS() << "Persisting shader cache metadata to disk" << LL_ENDL; - LLSD out = LLSD::emptyMap(); + LLSD out; + // Settings and shader cache get saved at different time, thus making + // RenderShaderCacheVersion unreliable when running multiple viewer + // instances, or for cases where viewer crashes before saving settings. + // Dupplicate version to the cache itself. + out["version"] = mShaderCacheVersion; + out["shaders"] = LLSD::emptyMap(); + LLSD &shaders = out["shaders"]; static const F32 LRU_TIME = (60.f * 60.f) * 24.f * 7.f; // 14 days const F32 current_time = (F32)LLTimer::getTotalSeconds(); @@ -1068,7 +1088,7 @@ void LLShaderMgr::persistShaderCacheMetadata() data["binary_format"] = LLSD::Integer(shader_metadata.mBinaryFormat); data["binary_size"] = LLSD::Integer(shader_metadata.mBinaryLength); data["last_used"] = LLSD::Real(shader_metadata.mLastUsedTime); - out[it->first.asString()] = data; + shaders[it->first.asString()] = data; ++it; } } diff --git a/indra/llrender/llshadermgr.h b/indra/llrender/llshadermgr.h index 46788841a5..1b638e6e06 100644 --- a/indra/llrender/llshadermgr.h +++ b/indra/llrender/llshadermgr.h @@ -363,7 +363,7 @@ public: // Implemented in the application to actually update out of date uniforms for a particular shader virtual void updateShaderUniforms(LLGLSLShader * shader) = 0; // Pure Virtual - void initShaderCache(bool enabled, const LLUUID& old_cache_version, const LLUUID& current_cache_version); + void initShaderCache(bool enabled, const LLUUID& old_cache_version, const LLUUID& current_cache_version, bool second_instance); void clearShaderCache(); void persistShaderCacheMetadata(); @@ -387,7 +387,7 @@ public: F32 mLastUsedTime = 0.0; }; std::map mShaderBinaryCache; - bool mShaderCacheInitialized = false; + LLUUID mShaderCacheVersion; bool mShaderCacheEnabled = false; std::string mShaderCacheDir; diff --git a/indra/newview/llviewershadermgr.cpp b/indra/newview/llviewershadermgr.cpp index a0a9906724..a9c58d5a06 100644 --- a/indra/newview/llviewershadermgr.cpp +++ b/indra/newview/llviewershadermgr.cpp @@ -545,7 +545,11 @@ void LLViewerShaderMgr::setShaders() gSavedSettings.setString("RenderShaderCacheVersion", current_cache_version.asString()); } - initShaderCache(shader_cache_enabled, old_cache_version, current_cache_version); + initShaderCache( + shader_cache_enabled, + old_cache_version, + current_cache_version, + LLAppViewer::instance()->isSecondInstance()); } static LLCachedControl max_texture_index(gSavedSettings, "RenderMaxTextureIndex", 16); @@ -703,7 +707,10 @@ void LLViewerShaderMgr::setShaders() loaded = loaded && loadShadersDeferred(); llassert(loaded); - persistShaderCacheMetadata(); + if (!LLAppViewer::instance()->isSecondInstance()) + { + persistShaderCacheMetadata(); + } if (gViewerWindow) { -- cgit v1.2.3 From 46f325b7db41ac855d35e3ab50ad915dd075de1e Mon Sep 17 00:00:00 2001 From: Andrey Kleshchev Date: Tue, 2 Sep 2025 23:29:06 +0300 Subject: #4587 Make shader cache reading faster --- indra/llrender/llshadermgr.cpp | 27 ++++++++++++++++----------- 1 file changed, 16 insertions(+), 11 deletions(-) diff --git a/indra/llrender/llshadermgr.cpp b/indra/llrender/llshadermgr.cpp index 0ec532a55b..a4d5282b0c 100644 --- a/indra/llrender/llshadermgr.cpp +++ b/indra/llrender/llshadermgr.cpp @@ -992,7 +992,7 @@ bool LLShaderMgr::validateProgramObject(GLuint obj) void LLShaderMgr::initShaderCache(bool enabled, const LLUUID& old_cache_version, const LLUUID& current_cache_version, bool second_instance) { LL_PROFILE_ZONE_SCOPED; - LL_INFOS() << "Initializing shader cache" << LL_ENDL; + LL_INFOS("ShaderMgr") << "Initializing shader cache" << LL_ENDL; mShaderCacheEnabled = gGLManager.mGLVersion >= 4.09 && enabled; @@ -1009,12 +1009,12 @@ void LLShaderMgr::initShaderCache(bool enabled, const LLUUID& old_cache_version, if (gDirUtilp->fileExists(meta_out_path)) { LL_PROFILE_ZONE_NAMED("shader_cache"); - LL_INFOS() << "Loading shader cache metadata" << LL_ENDL; + LL_INFOS("ShaderMgr") << "Loading shader cache metadata" << LL_ENDL; - llifstream instream(meta_out_path); + llifstream instream(meta_out_path, std::ifstream::in | std::ifstream::binary); LLSD in_data; // todo: this is likely very expensive to parse, should use binary - LLSDSerialize::fromNotation(in_data, instream, LLSDSerialize::SIZE_UNLIMITED); + LLSDSerialize::fromBinary(in_data, instream, LLSDSerialize::SIZE_UNLIMITED); instream.close(); if (old_cache_version == current_cache_version @@ -1031,12 +1031,12 @@ void LLShaderMgr::initShaderCache(bool enabled, const LLUUID& old_cache_version, } else if (!second_instance) { - LL_INFOS() << "Shader cache version mismatch detected. Purging." << LL_ENDL; + LL_INFOS("ShaderMgr") << "Shader cache version mismatch detected. Purging." << LL_ENDL; clearShaderCache(); } else { - LL_INFOS() << "Shader cache version mismatch detected." << LL_ENDL; + LL_INFOS("ShaderMgr") << "Shader cache version mismatch detected." << LL_ENDL; } } } @@ -1045,7 +1045,7 @@ void LLShaderMgr::initShaderCache(bool enabled, const LLUUID& old_cache_version, void LLShaderMgr::clearShaderCache() { std::string shader_cache = gDirUtilp->getExpandedFilename(LL_PATH_CACHE, "shader_cache"); - LL_INFOS() << "Removing shader cache at " << shader_cache << LL_ENDL; + LL_INFOS("ShaderMgr") << "Removing shader cache at " << shader_cache << LL_ENDL; const std::string mask = "*"; gDirUtilp->deleteFilesInDir(shader_cache, mask); mShaderBinaryCache.clear(); @@ -1056,11 +1056,11 @@ void LLShaderMgr::persistShaderCacheMetadata() if(!mShaderCacheEnabled) return; if (mShaderCacheVersion.isNull()) { - LL_WARNS() << "Attempted to save shader cache with no version set" << LL_ENDL; + LL_WARNS("ShaderMgr") << "Attempted to save shader cache with no version set" << LL_ENDL; return; } - LL_INFOS() << "Persisting shader cache metadata to disk" << LL_ENDL; + LL_INFOS("ShaderMgr") << "Persisting shader cache metadata to disk" << LL_ENDL; LLSD out; // Settings and shader cache get saved at different time, thus making @@ -1094,8 +1094,13 @@ void LLShaderMgr::persistShaderCacheMetadata() } std::string meta_out_path = gDirUtilp->add(mShaderCacheDir, "shaderdata.llsd"); - llofstream outstream(meta_out_path); - LLSDSerialize::toNotation(out, outstream); + llofstream outstream(meta_out_path, std::ios_base::out | std::ios_base::binary); + if (!outstream.is_open()) + { + LL_WARNS("ShaderMgr") << "Failed to open file. Unable to save shader cache to: " << mShaderCacheDir << LL_ENDL; + return; + } + LLSDSerialize::toBinary(out, outstream); outstream.close(); } -- cgit v1.2.3 From a4f58810f4c4f6e66246426aa3ca120e713049e0 Mon Sep 17 00:00:00 2001 From: Andrey Kleshchev Date: Wed, 3 Sep 2025 22:29:35 +0300 Subject: #4623 Shared Media on HUDs not loading Looks like a merge between a commit that affected mScreenPixelArea and a commit that added a return value resulted in reordered calls. --- indra/newview/llviewercamera.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/indra/newview/llviewercamera.cpp b/indra/newview/llviewercamera.cpp index 511293a808..af6c78d8e5 100644 --- a/indra/newview/llviewercamera.cpp +++ b/indra/newview/llviewercamera.cpp @@ -157,9 +157,9 @@ bool LLViewerCamera::updateCameraLocation(const LLVector3 ¢er, const LLVecto // update pixel meter ratio using default fov, not modified one mPixelMeterRatio = (F32)(getViewHeightInPixels()/ (2.f*tanf(mCameraFOVDefault*0.5f))); // update screen pixel area + mScreenPixelArea =(S32)((F32)getViewHeightInPixels() * ((F32)getViewHeightInPixels() * getAspect())); return true; - mScreenPixelArea =(S32)((F32)getViewHeightInPixels() * ((F32)getViewHeightInPixels() * getAspect())); } const LLMatrix4 &LLViewerCamera::getProjection() const -- cgit v1.2.3 From f5c872a12dc5c8e47f61b80056d21f90da2cd689 Mon Sep 17 00:00:00 2001 From: Andrey Kleshchev Date: Thu, 4 Sep 2025 20:56:11 +0300 Subject: p#470 Fix wrong release notes being shown. --- indra/newview/llstartup.cpp | 24 +++++++++++++++++++++++- 1 file changed, 23 insertions(+), 1 deletion(-) diff --git a/indra/newview/llstartup.cpp b/indra/newview/llstartup.cpp index 5df7eca5f5..bf7c58a3cb 100644 --- a/indra/newview/llstartup.cpp +++ b/indra/newview/llstartup.cpp @@ -57,6 +57,7 @@ #include "lllocationhistory.h" #include "llgltfmateriallist.h" #include "llimageworker.h" +#include "llregex.h" #include "llloginflags.h" #include "llmd5.h" @@ -2558,6 +2559,27 @@ void release_notes_coro(const std::string url) LLWeb::loadURLInternal(url); } +void validate_release_notes_coro(const std::string url) +{ + LLVersionInfo& versionInfo(LLVersionInfo::instance()); + const boost::regex version_regex(R"(\b\d+\.\d+\.\d+\.\d+\b)"); + + if (url.find(versionInfo.getVersion()) == std::string::npos // has no our build version + && ll_regex_search(url, version_regex)) // has any version + { + LL_INFOS() << "Received release notes url \"" << url << "\" wwith mismatching build, falling back to locally generated url" << LL_ENDL; + // Updater only provides notes for a most recent version, if it is not + // the current one, fall back to the hardcoded URL. + LLSD info(LLAppViewer::instance()->getViewerInfo()); + std::string alt_url = info["VIEWER_RELEASE_NOTES_URL"].asString(); + release_notes_coro(alt_url); + } + else + { + release_notes_coro(url); + } +} + /** * Check if user is running a new version of the viewer. * Display the Release Notes if it's not overriden by the "UpdaterShowReleaseNotes" setting. @@ -2591,7 +2613,7 @@ void show_release_notes_if_required() "showrelnotes", [](const LLSD& url) { LLCoros::instance().launch("releaseNotesCoro", - boost::bind(&release_notes_coro, url.asString())); + boost::bind(&validate_release_notes_coro, url.asString())); return false; }); } -- cgit v1.2.3 From 94e45ca2e60b4013a4e38d8f2c1fe8dad4207c3a Mon Sep 17 00:00:00 2001 From: Andrey Kleshchev Date: Fri, 5 Sep 2025 15:09:11 +0300 Subject: Replace boost filesystem with std filesystem Build fixes, instead of resolving unclear boost filesystem errors just updated to std in affected places. --- indra/llfilesystem/lldir.cpp | 32 ++++++++--------- indra/llfilesystem/lldiriterator.cpp | 4 +-- indra/llfilesystem/lldiskcache.cpp | 70 ++++++++++++++++++------------------ 3 files changed, 53 insertions(+), 53 deletions(-) diff --git a/indra/llfilesystem/lldir.cpp b/indra/llfilesystem/lldir.cpp index ea33a3bb90..06f5dd2f77 100644 --- a/indra/llfilesystem/lldir.cpp +++ b/indra/llfilesystem/lldir.cpp @@ -43,7 +43,7 @@ #include "lldiriterator.h" #include "stringize.h" #include "llstring.h" -#include +#include #include #include #include @@ -103,24 +103,24 @@ std::vector LLDir::getFilesInDir(const std::string &dirname) //Returns a vector of fullpath filenames. #ifdef LL_WINDOWS // or BOOST_WINDOWS_API - boost::filesystem::path p(ll_convert(dirname)); + std::filesystem::path p(ll_convert(dirname)); #else - boost::filesystem::path p(dirname); + std::filesystem::path p(dirname); #endif std::vector v; - boost::system::error_code ec; - if (exists(p, ec) && !ec.failed()) + std::error_code ec; + if (std::filesystem::exists(p, ec) && ec.value() == 0) { - if (is_directory(p, ec) && !ec.failed()) + if (is_directory(p, ec) && ec.value() == 0) { - boost::filesystem::directory_iterator end_iter; - for (boost::filesystem::directory_iterator dir_itr(p); + std::filesystem::directory_iterator end_iter; + for (std::filesystem::directory_iterator dir_itr(p); dir_itr != end_iter; ++dir_itr) { - if (boost::filesystem::is_regular_file(dir_itr->status())) + if (std::filesystem::is_regular_file(dir_itr->status())) { v.push_back(dir_itr->path().filename().string()); } @@ -197,24 +197,24 @@ U32 LLDir::deleteDirAndContents(const std::string& dir_name) try { #ifdef LL_WINDOWS // or BOOST_WINDOWS_API - boost::filesystem::path dir_path(ll_convert(dir_name)); + std::filesystem::path dir_path(ll_convert(dir_name)); #else - boost::filesystem::path dir_path(dir_name); + std::filesystem::path dir_path(dir_name); #endif - if (boost::filesystem::exists(dir_path)) + if (std::filesystem::exists(dir_path)) { - if (!boost::filesystem::is_empty(dir_path)) + if (!std::filesystem::is_empty(dir_path)) { // Directory has content - num_deleted = (U32)boost::filesystem::remove_all(dir_path); + num_deleted = (U32)std::filesystem::remove_all(dir_path); } else { // Directory is empty - boost::filesystem::remove(dir_path); + std::filesystem::remove(dir_path); } } } - catch (boost::filesystem::filesystem_error &er) + catch (std::filesystem::filesystem_error &er) { LL_WARNS() << "Failed to delete " << dir_name << " with error " << er.code().message() << LL_ENDL; } diff --git a/indra/llfilesystem/lldiriterator.cpp b/indra/llfilesystem/lldiriterator.cpp index e8c37389d2..28a93f1446 100644 --- a/indra/llfilesystem/lldiriterator.cpp +++ b/indra/llfilesystem/lldiriterator.cpp @@ -28,9 +28,9 @@ #include "fix_macros.h" #include "llregex.h" -#include +#include -namespace fs = boost::filesystem; +namespace fs = std::filesystem; static std::string glob_to_regex(const std::string& glob); diff --git a/indra/llfilesystem/lldiskcache.cpp b/indra/llfilesystem/lldiskcache.cpp index e971e1885a..417577369f 100644 --- a/indra/llfilesystem/lldiskcache.cpp +++ b/indra/llfilesystem/lldiskcache.cpp @@ -34,7 +34,7 @@ #include "llapp.h" #include "llassettype.h" #include "lldir.h" -#include +#include #include #include "lldiskcache.h" @@ -83,7 +83,7 @@ LLDiskCache::LLDiskCache(const std::string& cache_dir, // garbage.) // Other situation: B is trimming the cache and A wants to read a file that is -// about to get deleted. boost::filesystem::remove does whatever it is doing +// about to get deleted. std::filesystem::remove does whatever it is doing // before actually deleting the file. If A opens the file before the file is // actually gone, the OS call from B to delete the file will fail since the OS // will prevent this. B continues with the next file. If the file is already @@ -96,10 +96,10 @@ void LLDiskCache::purge() LL_INFOS() << "Total dir size before purge is " << dirFileSize(sCacheDir) << LL_ENDL; } - boost::system::error_code ec; + std::error_code ec; auto start_time = std::chrono::high_resolution_clock::now(); - typedef std::pair> file_info_t; + typedef std::pair> file_info_t; std::vector file_info; #if LL_WINDOWS @@ -107,23 +107,23 @@ void LLDiskCache::purge() #else std::string cache_path(sCacheDir); #endif - if (boost::filesystem::is_directory(cache_path, ec) && !ec.failed()) + if (std::filesystem::is_directory(cache_path, ec) && ec.value() == 0) { - boost::filesystem::directory_iterator iter(cache_path, ec); - while (iter != boost::filesystem::directory_iterator() && !ec.failed()) + std::filesystem::directory_iterator iter(cache_path, ec); + while (iter != std::filesystem::directory_iterator() && ec.value() == 0) { - if (boost::filesystem::is_regular_file(*iter, ec) && !ec.failed()) + if (std::filesystem::is_regular_file(*iter, ec) && ec.value() == 0) { if ((*iter).path().string().find(CACHE_FILENAME_PREFIX) != std::string::npos) { - uintmax_t file_size = boost::filesystem::file_size(*iter, ec); - if (ec.failed()) + uintmax_t file_size = std::filesystem::file_size(*iter, ec); + if (ec.value() != 0) { continue; } const std::string file_path = (*iter).path().string(); - const std::time_t file_time = boost::filesystem::last_write_time(*iter, ec); - if (ec.failed()) + const std::filesystem::file_time_type file_time = std::filesystem::last_write_time(*iter, ec); + if (ec.value() != 0) { continue; } @@ -159,8 +159,8 @@ void LLDiskCache::purge() } if (should_remove) { - boost::filesystem::remove(entry.second.second, ec); - if (ec.failed()) + std::filesystem::remove(entry.second.second, ec); + if (ec.value() != 0) { LL_WARNS() << "Failed to delete cache file " << entry.second.second << ": " << ec.message() << LL_ENDL; } @@ -224,23 +224,23 @@ void LLDiskCache::clearCache() * the component files but it's called infrequently so it's * likely just fine */ - boost::system::error_code ec; + std::error_code ec; #if LL_WINDOWS std::wstring cache_path(ll_convert(sCacheDir)); #else std::string cache_path(sCacheDir); #endif - if (boost::filesystem::is_directory(cache_path, ec) && !ec.failed()) + if (std::filesystem::is_directory(cache_path, ec) && ec.value() == 0) { - boost::filesystem::directory_iterator iter(cache_path, ec); - while (iter != boost::filesystem::directory_iterator() && !ec.failed()) + std::filesystem::directory_iterator iter(cache_path, ec); + while (iter != std::filesystem::directory_iterator() && ec.value() == 0) { - if (boost::filesystem::is_regular_file(*iter, ec) && !ec.failed()) + if (std::filesystem::is_regular_file(*iter, ec) && ec.value() == 0) { if ((*iter).path().string().find(CACHE_FILENAME_PREFIX) != std::string::npos) { - boost::filesystem::remove(*iter, ec); - if (ec.failed()) + std::filesystem::remove(*iter, ec); + if (ec.value() != 0) { LL_WARNS() << "Failed to delete cache file " << *iter << ": " << ec.message() << LL_ENDL; } @@ -257,24 +257,24 @@ void LLDiskCache::removeOldVFSFiles() static const char CACHE_FORMAT[] = "inv.llsd"; static const char DB_FORMAT[] = "db2.x"; - boost::system::error_code ec; + std::error_code ec; #if LL_WINDOWS std::wstring cache_path(ll_convert(gDirUtilp->getExpandedFilename(LL_PATH_CACHE, ""))); #else std::string cache_path(gDirUtilp->getExpandedFilename(LL_PATH_CACHE, "")); #endif - if (boost::filesystem::is_directory(cache_path, ec) && !ec.failed()) + if (std::filesystem::is_directory(cache_path, ec) && ec.value() == 0) { - boost::filesystem::directory_iterator iter(cache_path, ec); - while (iter != boost::filesystem::directory_iterator() && !ec.failed()) + std::filesystem::directory_iterator iter(cache_path, ec); + while (iter != std::filesystem::directory_iterator() && ec.value() == 0) { - if (boost::filesystem::is_regular_file(*iter, ec) && !ec.failed()) + if (std::filesystem::is_regular_file(*iter, ec) && ec.value() == 0) { if (((*iter).path().string().find(CACHE_FORMAT) != std::string::npos) || ((*iter).path().string().find(DB_FORMAT) != std::string::npos)) { - boost::filesystem::remove(*iter, ec); - if (ec.failed()) + std::filesystem::remove(*iter, ec); + if (ec.value() != 0) { LL_WARNS() << "Failed to delete cache file " << *iter << ": " << ec.message() << LL_ENDL; } @@ -298,23 +298,23 @@ uintmax_t LLDiskCache::dirFileSize(const std::string& dir) * so if performance is ever an issue, optimizing this or removing it altogether, * is an easy win. */ - boost::system::error_code ec; + std::error_code ec; #if LL_WINDOWS std::wstring dir_path(ll_convert(dir)); #else std::string dir_path(dir); #endif - if (boost::filesystem::is_directory(dir_path, ec) && !ec.failed()) + if (std::filesystem::is_directory(dir_path, ec) && ec.value() == 0) { - boost::filesystem::directory_iterator iter(dir_path, ec); - while (iter != boost::filesystem::directory_iterator() && !ec.failed()) + std::filesystem::directory_iterator iter(dir_path, ec); + while (iter != std::filesystem::directory_iterator() && ec.value() == 0) { - if (boost::filesystem::is_regular_file(*iter, ec) && !ec.failed()) + if (std::filesystem::is_regular_file(*iter, ec) && ec.value() == 0) { if ((*iter).path().string().find(CACHE_FILENAME_PREFIX) != std::string::npos) { - uintmax_t file_size = boost::filesystem::file_size(*iter, ec); - if (!ec.failed()) + uintmax_t file_size = std::filesystem::file_size(*iter, ec); + if (ec.value() == 0) { total_file_size += file_size; } -- cgit v1.2.3 From 12704b941132ec6fb6ca62da007c3ec02292c872 Mon Sep 17 00:00:00 2001 From: Andrey Kleshchev Date: Fri, 5 Sep 2025 13:23:09 +0300 Subject: viewer-cef build fixes --- indra/CMakeLists.txt | 8 +- indra/cmake/Boost.cmake | 148 +++++++++++++++++++++---------- indra/cmake/LLKDU.cmake | 17 +++- indra/llkdu/tests/llimagej2ckdu_test.cpp | 1 + 4 files changed, 121 insertions(+), 53 deletions(-) diff --git a/indra/CMakeLists.txt b/indra/CMakeLists.txt index 455e7980e2..6504002dd9 100644 --- a/indra/CMakeLists.txt +++ b/indra/CMakeLists.txt @@ -11,8 +11,12 @@ ## We're not there yet, but once done, there is a kludge in Linking.cmake # "if(${CMAKE_VERSION} VERSION_LESS "3.20.0")" that can also be removed cmake_minimum_required(VERSION 3.16.0...4.0 FATAL_ERROR) -cmake_policy(SET CMP0156 NEW) -cmake_policy(SET CMP0179 NEW) +if(${CMAKE_VERSION} VERSION_GREATER_EQUAL "3.29.0") + cmake_policy(SET CMP0156 NEW) +endif() +if(${CMAKE_VERSION} VERSION_GREATER_EQUAL "3.31.0") + cmake_policy(SET CMP0179 NEW) +endif() set(ROOT_PROJECT_NAME "SecondLife" CACHE STRING "The root project/makefile/solution name. Defaults to SecondLife.") diff --git a/indra/cmake/Boost.cmake b/indra/cmake/Boost.cmake index 7b3882c936..b57c33c3e0 100644 --- a/indra/cmake/Boost.cmake +++ b/indra/cmake/Boost.cmake @@ -16,53 +16,107 @@ use_prebuilt_binary(boost) # with the address size. set(addrsfx "-x${ADDRESS_SIZE}") -find_library(BOOST_CONTEXT_LIBRARY - NAMES - boost_context-mt - boost_context-mt${addrsfx} - PATHS "${ARCH_PREBUILT_DIRS_RELEASE}" REQUIRED NO_DEFAULT_PATH) - -find_library(BOOST_FIBER_LIBRARY - NAMES - boost_fiber-mt - boost_fiber-mt${addrsfx} - PATHS "${ARCH_PREBUILT_DIRS_RELEASE}" REQUIRED NO_DEFAULT_PATH) - -find_library(BOOST_FILESYSTEM_LIBRARY - NAMES - boost_filesystem-mt - boost_filesystem-mt${addrsfx} - PATHS "${ARCH_PREBUILT_DIRS_RELEASE}" REQUIRED NO_DEFAULT_PATH) - -find_library(BOOST_PROGRAMOPTIONS_LIBRARY - NAMES - boost_program_options-mt - boost_program_options-mt${addrsfx} - PATHS "${ARCH_PREBUILT_DIRS_RELEASE}" REQUIRED NO_DEFAULT_PATH) - -find_library(BOOST_REGEX_LIBRARY - NAMES - boost_regex-mt - boost_regex-mt${addrsfx} - PATHS "${ARCH_PREBUILT_DIRS_RELEASE}" REQUIRED NO_DEFAULT_PATH) - -find_library(BOOST_SYSTEM_LIBRARY - NAMES - boost_system-mt - boost_system-mt${addrsfx} - PATHS "${ARCH_PREBUILT_DIRS_RELEASE}" REQUIRED NO_DEFAULT_PATH) - -find_library(BOOST_THREAD_LIBRARY - NAMES - boost_thread-mt - boost_thread-mt${addrsfx} - PATHS "${ARCH_PREBUILT_DIRS_RELEASE}" REQUIRED NO_DEFAULT_PATH) - -find_library(BOOST_URL_LIBRARY - NAMES - boost_url-mt - boost_url-mt${addrsfx} - PATHS "${ARCH_PREBUILT_DIRS_RELEASE}" REQUIRED NO_DEFAULT_PATH) +if (WINDOWS) + + find_library(BOOST_CONTEXT_LIBRARY + NAMES + libboost_context-mt + libboost_context-mt${addrsfx} + PATHS "${ARCH_PREBUILT_DIRS_RELEASE}" REQUIRED NO_DEFAULT_PATH) + + find_library(BOOST_FIBER_LIBRARY + NAMES + libboost_fiber-mt + libboost_fiber-mt${addrsfx} + PATHS "${ARCH_PREBUILT_DIRS_RELEASE}" REQUIRED NO_DEFAULT_PATH) + + find_library(BOOST_FILESYSTEM_LIBRARY + NAMES + libboost_filesystem-mt + libboost_filesystem-mt${addrsfx} + PATHS "${ARCH_PREBUILT_DIRS_RELEASE}" REQUIRED NO_DEFAULT_PATH) + + find_library(BOOST_PROGRAMOPTIONS_LIBRARY + NAMES + libboost_program_options-mt + libboost_program_options-mt${addrsfx} + PATHS "${ARCH_PREBUILT_DIRS_RELEASE}" REQUIRED NO_DEFAULT_PATH) + + find_library(BOOST_REGEX_LIBRARY + NAMES + libboost_regex-mt + libboost_regex-mt${addrsfx} + PATHS "${ARCH_PREBUILT_DIRS_RELEASE}" REQUIRED NO_DEFAULT_PATH) + + find_library(BOOST_SYSTEM_LIBRARY + NAMES + libboost_system-mt + libboost_system-mt${addrsfx} + PATHS "${ARCH_PREBUILT_DIRS_RELEASE}" REQUIRED NO_DEFAULT_PATH) + + find_library(BOOST_THREAD_LIBRARY + NAMES + libboost_thread-mt + libboost_thread-mt${addrsfx} + PATHS "${ARCH_PREBUILT_DIRS_RELEASE}" REQUIRED NO_DEFAULT_PATH) + + find_library(BOOST_URL_LIBRARY + NAMES + libboost_url-mt + libboost_url-mt${addrsfx} + PATHS "${ARCH_PREBUILT_DIRS_RELEASE}" REQUIRED NO_DEFAULT_PATH) + +else (WINDOWS) + + find_library(BOOST_CONTEXT_LIBRARY + NAMES + boost_context-mt + boost_context-mt${addrsfx} + PATHS "${ARCH_PREBUILT_DIRS_RELEASE}" REQUIRED NO_DEFAULT_PATH) + + find_library(BOOST_FIBER_LIBRARY + NAMES + boost_fiber-mt + boost_fiber-mt${addrsfx} + PATHS "${ARCH_PREBUILT_DIRS_RELEASE}" REQUIRED NO_DEFAULT_PATH) + + find_library(BOOST_FILESYSTEM_LIBRARY + NAMES + boost_filesystem-mt + boost_filesystem-mt${addrsfx} + PATHS "${ARCH_PREBUILT_DIRS_RELEASE}" REQUIRED NO_DEFAULT_PATH) + + find_library(BOOST_PROGRAMOPTIONS_LIBRARY + NAMES + boost_program_options-mt + boost_program_options-mt${addrsfx} + PATHS "${ARCH_PREBUILT_DIRS_RELEASE}" REQUIRED NO_DEFAULT_PATH) + + find_library(BOOST_REGEX_LIBRARY + NAMES + boost_regex-mt + boost_regex-mt${addrsfx} + PATHS "${ARCH_PREBUILT_DIRS_RELEASE}" REQUIRED NO_DEFAULT_PATH) + + find_library(BOOST_SYSTEM_LIBRARY + NAMES + boost_system-mt + boost_system-mt${addrsfx} + PATHS "${ARCH_PREBUILT_DIRS_RELEASE}" REQUIRED NO_DEFAULT_PATH) + + find_library(BOOST_THREAD_LIBRARY + NAMES + boost_thread-mt + boost_thread-mt${addrsfx} + PATHS "${ARCH_PREBUILT_DIRS_RELEASE}" REQUIRED NO_DEFAULT_PATH) + + find_library(BOOST_URL_LIBRARY + NAMES + boost_url-mt + boost_url-mt${addrsfx} + PATHS "${ARCH_PREBUILT_DIRS_RELEASE}" REQUIRED NO_DEFAULT_PATH) + +endif (WINDOWS) target_link_libraries(ll::boost INTERFACE ${BOOST_FIBER_LIBRARY} diff --git a/indra/cmake/LLKDU.cmake b/indra/cmake/LLKDU.cmake index dc98335a28..7680ab7b54 100644 --- a/indra/cmake/LLKDU.cmake +++ b/indra/cmake/LLKDU.cmake @@ -14,10 +14,19 @@ if (USE_KDU) include(Prebuilt) use_prebuilt_binary(kdu) - find_library(KDU_LIBRARY - NAMES - kdu - PATHS "${ARCH_PREBUILT_DIRS_RELEASE}" REQUIRED NO_DEFAULT_PATH) + if (WINDOWS) + find_library(KDU_LIBRARY + NAMES + kdu + PATHS "${ARCH_PREBUILT_DIRS_RELEASE}" REQUIRED NO_DEFAULT_PATH) + + else (WINDOWS) + find_library(KDU_LIBRARY + NAMES + libkdu.a + PATHS "${ARCH_PREBUILT_DIRS_RELEASE}" REQUIRED NO_DEFAULT_PATH) + + endif (WINDOWS) target_link_libraries(ll::kdu INTERFACE ${KDU_LIBRARY}) diff --git a/indra/llkdu/tests/llimagej2ckdu_test.cpp b/indra/llkdu/tests/llimagej2ckdu_test.cpp index 36b79047b6..bc52a15c4a 100644 --- a/indra/llkdu/tests/llimagej2ckdu_test.cpp +++ b/indra/llkdu/tests/llimagej2ckdu_test.cpp @@ -80,6 +80,7 @@ U8* LLImageBase::getData() { return NULL; } U8* LLImageBase::reallocateData(S32 ) { return NULL; } void LLImageBase::sanityCheck() { } void LLImageBase::setSize(S32 , S32 , S32 ) { } +bool LLImageBase::isBufferInvalid() const { return false; } LLImageJ2CImpl::~LLImageJ2CImpl() { } -- cgit v1.2.3 From 94cfce4a4d2dbc799e5e8a3495a628ae85d4cffe Mon Sep 17 00:00:00 2001 From: Callum Prentice Date: Fri, 5 Sep 2025 13:44:57 -0700 Subject: Revert "Replace boost filesystem with std filesystem" This reverts commit 94e45ca2e60b4013a4e38d8f2c1fe8dad4207c3a. --- indra/llfilesystem/lldir.cpp | 32 ++++++++--------- indra/llfilesystem/lldiriterator.cpp | 4 +-- indra/llfilesystem/lldiskcache.cpp | 70 ++++++++++++++++++------------------ 3 files changed, 53 insertions(+), 53 deletions(-) diff --git a/indra/llfilesystem/lldir.cpp b/indra/llfilesystem/lldir.cpp index 06f5dd2f77..ea33a3bb90 100644 --- a/indra/llfilesystem/lldir.cpp +++ b/indra/llfilesystem/lldir.cpp @@ -43,7 +43,7 @@ #include "lldiriterator.h" #include "stringize.h" #include "llstring.h" -#include +#include #include #include #include @@ -103,24 +103,24 @@ std::vector LLDir::getFilesInDir(const std::string &dirname) //Returns a vector of fullpath filenames. #ifdef LL_WINDOWS // or BOOST_WINDOWS_API - std::filesystem::path p(ll_convert(dirname)); + boost::filesystem::path p(ll_convert(dirname)); #else - std::filesystem::path p(dirname); + boost::filesystem::path p(dirname); #endif std::vector v; - std::error_code ec; - if (std::filesystem::exists(p, ec) && ec.value() == 0) + boost::system::error_code ec; + if (exists(p, ec) && !ec.failed()) { - if (is_directory(p, ec) && ec.value() == 0) + if (is_directory(p, ec) && !ec.failed()) { - std::filesystem::directory_iterator end_iter; - for (std::filesystem::directory_iterator dir_itr(p); + boost::filesystem::directory_iterator end_iter; + for (boost::filesystem::directory_iterator dir_itr(p); dir_itr != end_iter; ++dir_itr) { - if (std::filesystem::is_regular_file(dir_itr->status())) + if (boost::filesystem::is_regular_file(dir_itr->status())) { v.push_back(dir_itr->path().filename().string()); } @@ -197,24 +197,24 @@ U32 LLDir::deleteDirAndContents(const std::string& dir_name) try { #ifdef LL_WINDOWS // or BOOST_WINDOWS_API - std::filesystem::path dir_path(ll_convert(dir_name)); + boost::filesystem::path dir_path(ll_convert(dir_name)); #else - std::filesystem::path dir_path(dir_name); + boost::filesystem::path dir_path(dir_name); #endif - if (std::filesystem::exists(dir_path)) + if (boost::filesystem::exists(dir_path)) { - if (!std::filesystem::is_empty(dir_path)) + if (!boost::filesystem::is_empty(dir_path)) { // Directory has content - num_deleted = (U32)std::filesystem::remove_all(dir_path); + num_deleted = (U32)boost::filesystem::remove_all(dir_path); } else { // Directory is empty - std::filesystem::remove(dir_path); + boost::filesystem::remove(dir_path); } } } - catch (std::filesystem::filesystem_error &er) + catch (boost::filesystem::filesystem_error &er) { LL_WARNS() << "Failed to delete " << dir_name << " with error " << er.code().message() << LL_ENDL; } diff --git a/indra/llfilesystem/lldiriterator.cpp b/indra/llfilesystem/lldiriterator.cpp index 28a93f1446..e8c37389d2 100644 --- a/indra/llfilesystem/lldiriterator.cpp +++ b/indra/llfilesystem/lldiriterator.cpp @@ -28,9 +28,9 @@ #include "fix_macros.h" #include "llregex.h" -#include +#include -namespace fs = std::filesystem; +namespace fs = boost::filesystem; static std::string glob_to_regex(const std::string& glob); diff --git a/indra/llfilesystem/lldiskcache.cpp b/indra/llfilesystem/lldiskcache.cpp index 417577369f..e971e1885a 100644 --- a/indra/llfilesystem/lldiskcache.cpp +++ b/indra/llfilesystem/lldiskcache.cpp @@ -34,7 +34,7 @@ #include "llapp.h" #include "llassettype.h" #include "lldir.h" -#include +#include #include #include "lldiskcache.h" @@ -83,7 +83,7 @@ LLDiskCache::LLDiskCache(const std::string& cache_dir, // garbage.) // Other situation: B is trimming the cache and A wants to read a file that is -// about to get deleted. std::filesystem::remove does whatever it is doing +// about to get deleted. boost::filesystem::remove does whatever it is doing // before actually deleting the file. If A opens the file before the file is // actually gone, the OS call from B to delete the file will fail since the OS // will prevent this. B continues with the next file. If the file is already @@ -96,10 +96,10 @@ void LLDiskCache::purge() LL_INFOS() << "Total dir size before purge is " << dirFileSize(sCacheDir) << LL_ENDL; } - std::error_code ec; + boost::system::error_code ec; auto start_time = std::chrono::high_resolution_clock::now(); - typedef std::pair> file_info_t; + typedef std::pair> file_info_t; std::vector file_info; #if LL_WINDOWS @@ -107,23 +107,23 @@ void LLDiskCache::purge() #else std::string cache_path(sCacheDir); #endif - if (std::filesystem::is_directory(cache_path, ec) && ec.value() == 0) + if (boost::filesystem::is_directory(cache_path, ec) && !ec.failed()) { - std::filesystem::directory_iterator iter(cache_path, ec); - while (iter != std::filesystem::directory_iterator() && ec.value() == 0) + boost::filesystem::directory_iterator iter(cache_path, ec); + while (iter != boost::filesystem::directory_iterator() && !ec.failed()) { - if (std::filesystem::is_regular_file(*iter, ec) && ec.value() == 0) + if (boost::filesystem::is_regular_file(*iter, ec) && !ec.failed()) { if ((*iter).path().string().find(CACHE_FILENAME_PREFIX) != std::string::npos) { - uintmax_t file_size = std::filesystem::file_size(*iter, ec); - if (ec.value() != 0) + uintmax_t file_size = boost::filesystem::file_size(*iter, ec); + if (ec.failed()) { continue; } const std::string file_path = (*iter).path().string(); - const std::filesystem::file_time_type file_time = std::filesystem::last_write_time(*iter, ec); - if (ec.value() != 0) + const std::time_t file_time = boost::filesystem::last_write_time(*iter, ec); + if (ec.failed()) { continue; } @@ -159,8 +159,8 @@ void LLDiskCache::purge() } if (should_remove) { - std::filesystem::remove(entry.second.second, ec); - if (ec.value() != 0) + boost::filesystem::remove(entry.second.second, ec); + if (ec.failed()) { LL_WARNS() << "Failed to delete cache file " << entry.second.second << ": " << ec.message() << LL_ENDL; } @@ -224,23 +224,23 @@ void LLDiskCache::clearCache() * the component files but it's called infrequently so it's * likely just fine */ - std::error_code ec; + boost::system::error_code ec; #if LL_WINDOWS std::wstring cache_path(ll_convert(sCacheDir)); #else std::string cache_path(sCacheDir); #endif - if (std::filesystem::is_directory(cache_path, ec) && ec.value() == 0) + if (boost::filesystem::is_directory(cache_path, ec) && !ec.failed()) { - std::filesystem::directory_iterator iter(cache_path, ec); - while (iter != std::filesystem::directory_iterator() && ec.value() == 0) + boost::filesystem::directory_iterator iter(cache_path, ec); + while (iter != boost::filesystem::directory_iterator() && !ec.failed()) { - if (std::filesystem::is_regular_file(*iter, ec) && ec.value() == 0) + if (boost::filesystem::is_regular_file(*iter, ec) && !ec.failed()) { if ((*iter).path().string().find(CACHE_FILENAME_PREFIX) != std::string::npos) { - std::filesystem::remove(*iter, ec); - if (ec.value() != 0) + boost::filesystem::remove(*iter, ec); + if (ec.failed()) { LL_WARNS() << "Failed to delete cache file " << *iter << ": " << ec.message() << LL_ENDL; } @@ -257,24 +257,24 @@ void LLDiskCache::removeOldVFSFiles() static const char CACHE_FORMAT[] = "inv.llsd"; static const char DB_FORMAT[] = "db2.x"; - std::error_code ec; + boost::system::error_code ec; #if LL_WINDOWS std::wstring cache_path(ll_convert(gDirUtilp->getExpandedFilename(LL_PATH_CACHE, ""))); #else std::string cache_path(gDirUtilp->getExpandedFilename(LL_PATH_CACHE, "")); #endif - if (std::filesystem::is_directory(cache_path, ec) && ec.value() == 0) + if (boost::filesystem::is_directory(cache_path, ec) && !ec.failed()) { - std::filesystem::directory_iterator iter(cache_path, ec); - while (iter != std::filesystem::directory_iterator() && ec.value() == 0) + boost::filesystem::directory_iterator iter(cache_path, ec); + while (iter != boost::filesystem::directory_iterator() && !ec.failed()) { - if (std::filesystem::is_regular_file(*iter, ec) && ec.value() == 0) + if (boost::filesystem::is_regular_file(*iter, ec) && !ec.failed()) { if (((*iter).path().string().find(CACHE_FORMAT) != std::string::npos) || ((*iter).path().string().find(DB_FORMAT) != std::string::npos)) { - std::filesystem::remove(*iter, ec); - if (ec.value() != 0) + boost::filesystem::remove(*iter, ec); + if (ec.failed()) { LL_WARNS() << "Failed to delete cache file " << *iter << ": " << ec.message() << LL_ENDL; } @@ -298,23 +298,23 @@ uintmax_t LLDiskCache::dirFileSize(const std::string& dir) * so if performance is ever an issue, optimizing this or removing it altogether, * is an easy win. */ - std::error_code ec; + boost::system::error_code ec; #if LL_WINDOWS std::wstring dir_path(ll_convert(dir)); #else std::string dir_path(dir); #endif - if (std::filesystem::is_directory(dir_path, ec) && ec.value() == 0) + if (boost::filesystem::is_directory(dir_path, ec) && !ec.failed()) { - std::filesystem::directory_iterator iter(dir_path, ec); - while (iter != std::filesystem::directory_iterator() && ec.value() == 0) + boost::filesystem::directory_iterator iter(dir_path, ec); + while (iter != boost::filesystem::directory_iterator() && !ec.failed()) { - if (std::filesystem::is_regular_file(*iter, ec) && ec.value() == 0) + if (boost::filesystem::is_regular_file(*iter, ec) && !ec.failed()) { if ((*iter).path().string().find(CACHE_FILENAME_PREFIX) != std::string::npos) { - uintmax_t file_size = std::filesystem::file_size(*iter, ec); - if (ec.value() == 0) + uintmax_t file_size = boost::filesystem::file_size(*iter, ec); + if (!ec.failed()) { total_file_size += file_size; } -- cgit v1.2.3 From 789a64b0def7b404ab23b505482882f4820c42e3 Mon Sep 17 00:00:00 2001 From: Callum Prentice Date: Fri, 5 Sep 2025 13:45:47 -0700 Subject: Incorporate the latest buld of KDU 8.4.1 with the universal macos libs --- autobuild.xml | 30 +++++++++++++++++++++++------- 1 file changed, 23 insertions(+), 7 deletions(-) diff --git a/autobuild.xml b/autobuild.xml index 7581f719dc..c52fc65176 100644 --- a/autobuild.xml +++ b/autobuild.xml @@ -1040,11 +1040,11 @@ creds github hash - 243709fbbb58a91dca81d16df650e9c6ff910d0d + da318f0813e4126d90e35b22a8dce235e908707a hash_algorithm sha1 url - https://api.github.com/repos/secondlife/3p-kdu/releases/assets/202118207 + https://api.github.com/repos/secondlife/3p-kdu/releases/assets/208381808 name darwin64 @@ -1056,11 +1056,11 @@ creds github hash - 7fd0a7ee71a4e76b49e31b75f8622852324d58a4 + 1ba58cf884726dfdf02a7662d52f1befe3f16d44 hash_algorithm sha1 url - https://api.github.com/repos/secondlife/3p-kdu/releases/assets/202118208 + https://api.github.com/repos/secondlife/3p-kdu/releases/assets/208381812 name linux64 @@ -1072,15 +1072,31 @@ creds github hash - 8c475dd9616c7e0e3029cc38aefc1e0ab34d2e73 + e8d693089b9ecd15b6644f13ada7ae7c317944df hash_algorithm sha1 url - https://api.github.com/repos/secondlife/3p-kdu/releases/assets/202118209 + https://api.github.com/repos/secondlife/3p-kdu/releases/assets/208381814 name windows64 + linux + + archive + + creds + github + hash + 85e294becce8b2ac5d2e5e052b0e21ff865d1108 + hash_algorithm + sha1 + url + https://api.github.com/repos/secondlife/3p-kdu/releases/assets/208381806 + + name + linux + license Kakadu @@ -1089,7 +1105,7 @@ copyright Kakadu software version - 8.4.1.11540433907 + 8.4.1.11976899217 name kdu description -- cgit v1.2.3 From 6b0b8ce19639a587311823555d4cabf5a98a4793 Mon Sep 17 00:00:00 2001 From: Andrey Kleshchev Date: Fri, 5 Sep 2025 23:18:14 +0300 Subject: #4536 Fix clipped setting descriptions --- indra/newview/skins/default/xui/en/floater_settings_debug.xml | 1 + 1 file changed, 1 insertion(+) diff --git a/indra/newview/skins/default/xui/en/floater_settings_debug.xml b/indra/newview/skins/default/xui/en/floater_settings_debug.xml index a93be6a18d..c40ae3ea06 100644 --- a/indra/newview/skins/default/xui/en/floater_settings_debug.xml +++ b/indra/newview/skins/default/xui/en/floater_settings_debug.xml @@ -66,6 +66,7 @@ visible="false" name="comment_text" follows="left|top" + max_length="1024" width="240" top_delta="20" word_wrap="true" /> -- cgit v1.2.3 From d97cb0f18cd96027bd40ade8323b7e4a5a93a55e Mon Sep 17 00:00:00 2001 From: Andrey Kleshchev Date: Fri, 5 Sep 2025 23:47:38 +0300 Subject: #4639 Crash at getDimensionsF32 --- indra/llui/lltextbase.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/indra/llui/lltextbase.cpp b/indra/llui/lltextbase.cpp index ffaa09fd8c..3fe0df1848 100644 --- a/indra/llui/lltextbase.cpp +++ b/indra/llui/lltextbase.cpp @@ -3765,7 +3765,7 @@ bool LLNormalTextSegment::getDimensionsF32(S32 first_char, S32 num_chars, F32& w { height = 0; width = 0; - if (num_chars > 0) + if (num_chars > 0 && (mStart + first_char >= 0)) { height = mFontHeight; const LLWString &text = getWText(); -- cgit v1.2.3 From 8f43b5b77bf4b526af237217aa184215cb55731b Mon Sep 17 00:00:00 2001 From: Rye Date: Fri, 5 Sep 2025 19:35:22 -0400 Subject: Fix macos build arch and deploy target due to cmake behavior changes --- indra/cmake/Variables.cmake | 6 ++---- indra/newview/CMakeLists.txt | 3 ++- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/indra/cmake/Variables.cmake b/indra/cmake/Variables.cmake index 8dc51f6efa..c637e464fe 100644 --- a/indra/cmake/Variables.cmake +++ b/indra/cmake/Variables.cmake @@ -144,7 +144,7 @@ if (${CMAKE_SYSTEM_NAME} MATCHES "Darwin") set(DARWIN 1) string(REGEX MATCH "-mmacosx-version-min=([^ ]+)" scratch "$ENV{LL_BUILD}") - set(CMAKE_OSX_DEPLOYMENT_TARGET "${CMAKE_MATCH_1}") + set(CMAKE_OSX_DEPLOYMENT_TARGET "${CMAKE_MATCH_1}" CACHE STRING "macOS Deploy Target" FORCE) message(STATUS "CMAKE_OSX_DEPLOYMENT_TARGET = '${CMAKE_OSX_DEPLOYMENT_TARGET}'") # Use dwarf symbols for most libraries for compilation speed @@ -184,9 +184,7 @@ if (${CMAKE_SYSTEM_NAME} MATCHES "Darwin") set(CMAKE_XCODE_ATTRIBUTE_CODE_SIGN_ENTITLEMENTS "") set(CMAKE_XCODE_ATTRIBUTE_DISABLE_MANUAL_TARGET_ORDER_BUILD_WARNING YES) set(CMAKE_XCODE_ATTRIBUTE_GCC_WARN_64_TO_32_BIT_CONVERSION NO) - if(NOT DEFINED CMAKE_OSX_ARCHITECTURES) - set(CMAKE_OSX_ARCHITECTURES "x86_64;arm64") - endif() + set(CMAKE_OSX_ARCHITECTURES "arm64;x86_64" CACHE STRING "macOS Build Arch" FORCE) endif (${CMAKE_SYSTEM_NAME} MATCHES "Darwin") # Default deploy grid diff --git a/indra/newview/CMakeLists.txt b/indra/newview/CMakeLists.txt index 570c74f1cf..c727d5ae57 100644 --- a/indra/newview/CMakeLists.txt +++ b/indra/newview/CMakeLists.txt @@ -1950,7 +1950,8 @@ elseif (DARWIN) set_target_properties(${VIEWER_BINARY_NAME} PROPERTIES RESOURCE SecondLife.xib - LINK_FLAGS_RELEASE "${LINK_FLAGS_RELEASE} -Xlinker -dead_strip -Xlinker -map -Xlinker ${CMAKE_CURRENT_BINARY_DIR}/${VIEWER_BINARY_NAME}.MAP" + #LINK_FLAGS_RELEASE "${LINK_FLAGS_RELEASE} -Xlinker -dead_strip -Xlinker -map -Xlinker ${CMAKE_CURRENT_BINARY_DIR}/${VIEWER_BINARY_NAME}.MAP" + LINK_FLAGS_RELEASE "${LINK_FLAGS_RELEASE} -Xlinker -dead_strip" ) else (WINDOWS) # Linux -- cgit v1.2.3 From 79e4b7b53dc6aff5c0f81fd4aad63c4086cf4133 Mon Sep 17 00:00:00 2001 From: Andrey Kleshchev <117672381+akleshchev@users.noreply.github.com> Date: Tue, 9 Sep 2025 18:35:18 +0300 Subject: p#428 'multiple textures' sometimes not present when opening picker for the first time --- indra/newview/lltexturectrl.cpp | 49 ++++++++++++++++++++++++++++++++--------- indra/newview/lltexturectrl.h | 3 ++- 2 files changed, 41 insertions(+), 11 deletions(-) diff --git a/indra/newview/lltexturectrl.cpp b/indra/newview/lltexturectrl.cpp index 2027e958d5..5507ef517a 100644 --- a/indra/newview/lltexturectrl.cpp +++ b/indra/newview/lltexturectrl.cpp @@ -186,6 +186,7 @@ LLFloaterTexturePicker::LLFloaterTexturePicker( mOnUpdateImageStatsCallback(NULL), mBakeTextureEnabled(false), mLocalTextureEnabled(false), + mNoCopyTextureSelected(false), mInventoryPickType(pick_type) { setTentative(tentative); @@ -263,6 +264,7 @@ void LLFloaterTexturePicker::setImageID(const LLUUID& image_id, bool set_selecti if (set_selection) { + // This is going to cause a callback mInventoryPanel->setSelection(item_id, TAKE_FOCUS_NO); } } @@ -597,7 +599,6 @@ bool LLFloaterTexturePicker::postBuild() refreshInventoryFilter(); mInventoryPanel->setFilterPermMask(mImmediateFilterPermMask); - mInventoryPanel->setSelectCallback(boost::bind(&LLFloaterTexturePicker::onSelectionChange, this, _1, _2)); mInventoryPanel->setShowFolderState(LLInventoryFilter::SHOW_NON_EMPTY_FOLDERS); // Disable auto selecting first filtered item because it takes away @@ -616,8 +617,25 @@ bool LLFloaterTexturePicker::postBuild() if(!mImageAssetID.isNull() || mInventoryPickType == PICK_MATERIAL) { - mInventoryPanel->setSelection(findItemID(mImageAssetID, false), TAKE_FOCUS_NO); + LLViewerInventoryItem* itemp = findInvItem(mImageAssetID, false); + LLUUID item_id; + if (itemp) + { + item_id = itemp->getUUID(); + } + + mInventoryPanel->setSelection(item_id, TAKE_FOCUS_NO); + + if (item_id.notNull() && itemp) + { + if (!itemp->getPermissions().allowCopyBy(gAgent.getID())) + { + mNoCopyTextureSelected = true; + } + } } + // Don't call before setSelection, setSelection will mark view as dirty + mInventoryPanel->setSelectCallback(boost::bind(&LLFloaterTexturePicker::onSelectionChange, this, _1, _2)); } childSetAction("l_add_btn", LLFloaterTexturePicker::onBtnAdd, this); @@ -809,12 +827,12 @@ void LLFloaterTexturePicker::draw() } } -const LLUUID& LLFloaterTexturePicker::findItemID(const LLUUID& asset_id, bool copyable_only, bool ignore_library) +LLViewerInventoryItem* LLFloaterTexturePicker::findInvItem(const LLUUID& asset_id, bool copyable_only, bool ignore_library) const { if (asset_id.isNull()) { // null asset id means, no material or texture assigned - return LLUUID::null; + return nullptr; } LLUUID loockup_id = asset_id; @@ -854,30 +872,41 @@ const LLUUID& LLFloaterTexturePicker::findItemID(const LLUUID& asset_id, bool co // search for copyable version first for (S32 i = 0; i < items.size(); i++) { - LLInventoryItem* itemp = items[i]; + LLViewerInventoryItem* itemp = items[i]; LLPermissions item_permissions = itemp->getPermissions(); if (item_permissions.allowCopyBy(gAgent.getID(), gAgent.getGroupID())) { - if(!ignore_library || !gInventory.isObjectDescendentOf(itemp->getUUID(),gInventory.getLibraryRootFolderID())) + if (!ignore_library || !gInventory.isObjectDescendentOf(itemp->getUUID(), gInventory.getLibraryRootFolderID())) { - return itemp->getUUID(); + return itemp; } } } // otherwise just return first instance, unless copyable requested if (copyable_only) { - return LLUUID::null; + return nullptr; } else { - if(!ignore_library || !gInventory.isObjectDescendentOf(items[0]->getUUID(),gInventory.getLibraryRootFolderID())) + if (!ignore_library || !gInventory.isObjectDescendentOf(items[0]->getUUID(), gInventory.getLibraryRootFolderID())) { - return items[0]->getUUID(); + return items[0]; } } } + return nullptr; +} + +const LLUUID& LLFloaterTexturePicker::findItemID(const LLUUID& asset_id, bool copyable_only, bool ignore_library) const +{ + LLViewerInventoryItem* itemp = findInvItem(asset_id, copyable_only, ignore_library); + if (itemp) + { + return itemp->getUUID(); + } + return LLUUID::null; } diff --git a/indra/newview/lltexturectrl.h b/indra/newview/lltexturectrl.h index 79957431b7..467b8d1091 100644 --- a/indra/newview/lltexturectrl.h +++ b/indra/newview/lltexturectrl.h @@ -340,7 +340,7 @@ public: void setImageID(const LLUUID& image_asset_id, bool set_selection = true); bool updateImageStats(); // true if within limits const LLUUID& getAssetID() { return mImageAssetID; } - const LLUUID& findItemID(const LLUUID& asset_id, bool copyable_only, bool ignore_library = false); + const LLUUID& findItemID(const LLUUID& asset_id, bool copyable_only, bool ignore_library = false) const; void setCanApplyImmediately(bool b); void setActive(bool active); @@ -397,6 +397,7 @@ protected: void refreshLocalList(); void refreshInventoryFilter(); void setImageIDFromItem(const LLInventoryItem* itemp, bool set_selection = true); + LLViewerInventoryItem* findInvItem(const LLUUID& asset_id, bool copyable_only, bool ignore_library = false) const; LLPointer mTexturep; LLPointer mGLTFMaterial; -- cgit v1.2.3 From 175400230869963df7a3f126122ace14456c56cb Mon Sep 17 00:00:00 2001 From: Andrey Kleshchev <117672381+akleshchev@users.noreply.github.com> Date: Tue, 9 Sep 2025 22:51:55 +0300 Subject: Fix build failing due to missing nsis Temporary switch to windows 2022, latest 2025 doesn't have nsis --- .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 4bf2af644a..e4da631dc6 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -42,7 +42,7 @@ jobs: needs: setup strategy: matrix: - runner: ${{ fromJson((github.ref_type == 'tag' && startsWith(github.ref, 'refs/tags/Second_Life')) && '["windows-large","macos-15-xlarge"]' || '["windows-latest","macos-15"]') }} + runner: ${{ fromJson((github.ref_type == 'tag' && startsWith(github.ref, 'refs/tags/Second_Life')) && '["windows-large","macos-15-xlarge"]' || '["windows-2022","macos-15"]') }} configuration: ${{ fromJson(needs.setup.outputs.configurations) }} runs-on: ${{ matrix.runner }} outputs: @@ -306,7 +306,7 @@ jobs: AZURE_CLIENT_SECRET: ${{ secrets.AZURE_CLIENT_SECRET }} AZURE_TENANT_ID: ${{ secrets.AZURE_TENANT_ID }} needs: build - runs-on: windows-latest + runs-on: windows-2022 steps: - name: Sign and package Windows viewer if: env.AZURE_KEY_VAULT_URI && env.AZURE_CERT_NAME && env.AZURE_CLIENT_ID && env.AZURE_CLIENT_SECRET && env.AZURE_TENANT_ID -- cgit v1.2.3 From f98a61be70fe7c73d446213bb143edc4035ddef7 Mon Sep 17 00:00:00 2001 From: Brad Linden Date: Fri, 5 Sep 2025 17:58:46 -0700 Subject: Improvements found in reviewing mac_arm branch #4629 --- indra/cmake/Variables.cmake | 13 ------ indra/llcommon/llmd5.cpp | 2 +- indra/llkdu/llimagej2ckdu.cpp | 2 +- indra/llwindow/llopenglview-objc.mm | 80 ++++++++++++++++++------------------- indra/newview/llappviewer.cpp | 2 + 5 files changed, 44 insertions(+), 55 deletions(-) diff --git a/indra/cmake/Variables.cmake b/indra/cmake/Variables.cmake index c637e464fe..22c2156bb8 100644 --- a/indra/cmake/Variables.cmake +++ b/indra/cmake/Variables.cmake @@ -154,19 +154,6 @@ if (${CMAKE_SYSTEM_NAME} MATCHES "Darwin") set(CMAKE_XCODE_ATTRIBUTE_GCC_OPTIMIZATION_LEVEL "${CMAKE_MATCH_1}") message(STATUS "CMAKE_XCODE_ATTRIBUTE_GCC_OPTIMIZATION_LEVEL = '${CMAKE_XCODE_ATTRIBUTE_GCC_OPTIMIZATION_LEVEL}'") - # allow disabling this check by setting LL_SKIP_REQUIRE_SYSROOT either ON as cmake cache var or non-empty as environment var - # set(LL_SKIP_REQUIRE_SYSROOT OFF CACHE BOOL "Skip requirement to set toolchain sysroot ahead of time. Not skipped by default for consistency, but skipping can be useful for selecting alternative xcode versions side by side") - # if("$ENV{LL_SKIP_REQUIRE_SYSROOT}" STREQUAL "" AND NOT ${LL_SKIP_REQUIRE_SYSROOT}) - # string(REGEX MATCHALL "[^ ]+" LL_BUILD_LIST "$ENV{LL_BUILD}") - # list(FIND LL_BUILD_LIST "-iwithsysroot" sysroot_idx) - # if ("${sysroot_idx}" LESS 0) - # message(FATAL_ERROR "Environment variable LL_BUILD must contain '-iwithsysroot'") - # endif () - # math(EXPR sysroot_idx "${sysroot_idx} + 1") - # list(GET LL_BUILD_LIST "${sysroot_idx}" CMAKE_OSX_SYSROOT) - # endif() - # message(STATUS "CMAKE_OSX_SYSROOT = '${CMAKE_OSX_SYSROOT}'") - set(CMAKE_XCODE_ATTRIBUTE_GCC_STRICT_ALIASING NO) set(CMAKE_XCODE_ATTRIBUTE_GCC_FAST_MATH NO) set(CMAKE_XCODE_ATTRIBUTE_CLANG_X86_VECTOR_INSTRUCTIONS sse4.2) diff --git a/indra/llcommon/llmd5.cpp b/indra/llcommon/llmd5.cpp index c806c0ab2e..c8ca586e7f 100644 --- a/indra/llcommon/llmd5.cpp +++ b/indra/llcommon/llmd5.cpp @@ -279,7 +279,7 @@ void LLMD5::hex_digest(char* s) const } #if LL_DARWIN -#pragma clang diagnostic push +#pragma clang diagnostic pop #endif std::ostream& operator<<(std::ostream& stream, const LLMD5& context) diff --git a/indra/llkdu/llimagej2ckdu.cpp b/indra/llkdu/llimagej2ckdu.cpp index 598455a31a..7eba9494a6 100644 --- a/indra/llkdu/llimagej2ckdu.cpp +++ b/indra/llkdu/llimagej2ckdu.cpp @@ -316,7 +316,7 @@ void LLImageJ2CKDU::setupCodeStream(LLImageJ2C &base, bool keep_codestream, ECod // *TODO: This seems to be wrong. The base class should have no idea of // how j2c compression works so no good way of computing what's the byte // range to be used. - mCodeStreamp->set_max_bytes(max_bytes); + mCodeStreamp->set_max_bytes(max_bytes); // If you want to flip or rotate the image for some reason, change // the resolution, or identify a restricted region of interest, this is diff --git a/indra/llwindow/llopenglview-objc.mm b/indra/llwindow/llopenglview-objc.mm index f3aa164f92..c9a62eedb1 100644 --- a/indra/llwindow/llopenglview-objc.mm +++ b/indra/llwindow/llopenglview-objc.mm @@ -28,7 +28,7 @@ #import "llwindowmacosx-objc.h" #import "llappdelegate-objc.h" -#import +#import extern BOOL gHiDPISupport; @@ -66,16 +66,16 @@ attributedStringInfo getSegments(NSAttributedString *str) segment_standouts seg_standouts; NSRange effectiveRange; NSRange limitRange = NSMakeRange(0, [str length]); - + while (limitRange.length > 0) { NSNumber *attr = [str attribute:NSUnderlineStyleAttributeName atIndex:limitRange.location longestEffectiveRange:&effectiveRange inRange:limitRange]; limitRange = NSMakeRange(NSMaxRange(effectiveRange), NSMaxRange(limitRange) - NSMaxRange(effectiveRange)); - + if (effectiveRange.length <= 0) { effectiveRange.length = 1; } - + if ([attr integerValue] == 2) { seg_lengths.push_back(effectiveRange.length); @@ -98,12 +98,12 @@ attributedStringInfo getSegments(NSAttributedString *str) + (NSScreen *)currentScreenForMouseLocation { NSPoint mouseLocation = [NSEvent mouseLocation]; - + NSEnumerator *screenEnumerator = [[NSScreen screens] objectEnumerator]; NSScreen *screen; while ((screen = [screenEnumerator nextObject]) && !NSMouseInRect(mouseLocation, screen.frame, NO)) ; - + return screen; } @@ -131,7 +131,7 @@ attributedStringInfo getSegments(NSAttributedString *str) { vram_megabytes = 256; } - + return (unsigned long)vram_megabytes; // return value is in megabytes. } @@ -140,15 +140,15 @@ attributedStringInfo getSegments(NSAttributedString *str) [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(windowResized:) name:NSWindowDidResizeNotification object:[self window]]; - + [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(windowWillMiniaturize:) name:NSWindowWillMiniaturizeNotification object:[self window]]; - + [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(windowDidDeminiaturize:) name:NSWindowDidDeminiaturizeNotification object:[self window]]; - + [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(windowDidBecomeKey:) name:NSWindowDidBecomeKeyNotification object:[self window]]; @@ -222,7 +222,7 @@ attributedStringInfo getSegments(NSAttributedString *str) { [self registerForDraggedTypes:[NSArray arrayWithObject:NSPasteboardTypeURL]]; [self initWithFrame:frame]; - + // Initialize with a default "safe" pixel format that will work with versions dating back to OS X 10.6. // Any specialized pixel formats, i.e. a core profile pixel format, should be initialized through rebuildContextWithFormat. // 10.7 and 10.8 don't really care if we're defining a profile or not. If we don't explicitly request a core or legacy profile, it'll always assume a legacy profile (for compatibility reasons). @@ -240,34 +240,34 @@ attributedStringInfo getSegments(NSAttributedString *str) NSOpenGLPFAOpenGLProfile, NSOpenGLProfileVersion4_1Core, 0 }; - + NSOpenGLPixelFormat *pixelFormat = [[[NSOpenGLPixelFormat alloc] initWithAttributes:attrs] autorelease]; - + if (pixelFormat == nil) { NSLog(@"Failed to create pixel format!", nil); return nil; } - + NSOpenGLContext *glContext = [[NSOpenGLContext alloc] initWithFormat:pixelFormat shareContext:nil]; - + if (glContext == nil) { NSLog(@"Failed to create OpenGL context!", nil); return nil; } - + [self setPixelFormat:pixelFormat]; //for retina support [self setWantsBestResolutionOpenGLSurface:gHiDPISupport]; [self setOpenGLContext:glContext]; - + [glContext setView:self]; - + [glContext makeCurrentContext]; - + if (vsync) { GLint value = 1; @@ -291,16 +291,16 @@ attributedStringInfo getSegments(NSAttributedString *str) - (BOOL) rebuildContextWithFormat:(NSOpenGLPixelFormat *)format { NSOpenGLContext *ctx = [self openGLContext]; - + [ctx clearDrawable]; [ctx initWithFormat:format shareContext:nil]; - + if (ctx == nil) { NSLog(@"Failed to create OpenGL context!", nil); return false; } - + [self setOpenGLContext:ctx]; [ctx setView:self]; [ctx makeCurrentContext]; @@ -405,9 +405,9 @@ attributedStringInfo getSegments(NSAttributedString *str) float(dev_delta.x), float(dev_delta.y) }; - + callDeltaUpdate(mouseDeltas, 0); - + NSPoint mPoint = [self convertPointToBacking:[theEvent locationInWindow]]; mMousePos[0] = mPoint.x; mMousePos[1] = mPoint.y; @@ -431,7 +431,7 @@ attributedStringInfo getSegments(NSAttributedString *str) - (void) otherMouseDragged:(NSEvent *)theEvent { - [self mouseDragged:theEvent]; + [self mouseDragged:theEvent]; } - (void) scrollWheel:(NSEvent *)theEvent @@ -455,7 +455,7 @@ attributedStringInfo getSegments(NSAttributedString *str) { NativeKeyEventData eventData = extractKeyDataFromKeyEvent(theEvent); eventData.mKeyEvent = NativeKeyEventData::KEYDOWN; - + uint keycode = [theEvent keyCode]; // We must not depend on flagsChange event to detect modifier flags changed, // must depend on the modifire flags in the event parameter. @@ -489,13 +489,13 @@ attributedStringInfo getSegments(NSAttributedString *str) - (void)flagsChanged:(NSEvent *)theEvent { NativeKeyEventData eventData = extractKeyDataFromModifierEvent(theEvent); - + mModifiers = [theEvent modifierFlags]; callModifier([theEvent modifierFlags]); - + NSInteger mask = 0; switch([theEvent keyCode]) - { + { case kVK_Shift: mask = NSEventModifierFlagShift; break; @@ -506,9 +506,9 @@ attributedStringInfo getSegments(NSAttributedString *str) mask = NSEventModifierFlagControl; break; default: - return; + return; } - + if (mModifiers & mask) { eventData.mKeyEvent = NativeKeyEventData::KEYDOWN; @@ -527,7 +527,7 @@ attributedStringInfo getSegments(NSAttributedString *str) { eventData.mKeyEvent = NativeKeyEventData::KEYUP; callKeyUp(&eventData, [theEvent keyCode], 0); - } + } } - (BOOL) acceptsFirstResponder @@ -539,11 +539,11 @@ attributedStringInfo getSegments(NSAttributedString *str) { NSPasteboard *pboard; NSDragOperation sourceDragMask; - + sourceDragMask = [sender draggingSourceOperationMask]; - + pboard = [sender draggingPasteboard]; - + if ([[pboard types] containsObject:NSPasteboardTypeURL]) { if (sourceDragMask & NSDragOperationLink) { @@ -558,7 +558,7 @@ attributedStringInfo getSegments(NSAttributedString *str) - (NSDragOperation)draggingUpdated:(id )sender { callHandleDragUpdated(mLastDraggedUrl); - + return NSDragOperationLink; } @@ -612,12 +612,12 @@ attributedStringInfo getSegments(NSAttributedString *str) unsigned(selectedRange.location), unsigned(selectedRange.length) }; - + unsigned int replacement[2] = { unsigned(replacementRange.location), unsigned(replacementRange.length) }; - + int string_length = [aString length]; unichar *text = new unichar[string_length]; attributedStringInfo segments; @@ -728,7 +728,7 @@ attributedStringInfo getSegments(NSAttributedString *str) return; } } - + @try { if (!mHasMarkedText) @@ -741,7 +741,7 @@ attributedStringInfo getSegments(NSAttributedString *str) resetPreedit(); // We may never get this point since unmarkText may be called before insertText ever gets called once we submit our text. // But just in case... - + for (NSInteger i = 0; i < [aString length]; i++) { handleUnicodeCharacter([aString characterAtIndex:i]); diff --git a/indra/newview/llappviewer.cpp b/indra/newview/llappviewer.cpp index 9eb0d3fade..2dabf3355a 100644 --- a/indra/newview/llappviewer.cpp +++ b/indra/newview/llappviewer.cpp @@ -5660,6 +5660,8 @@ void LLAppViewer::forceErrorBreakpoint() #else #if defined(LL_X86) || defined(LL_X86_64) asm ("int $3"); +#else + __builtin_trap(); #endif #endif return; -- cgit v1.2.3 From 452c8e0ea40da1de684c80b84ffa9ec712f72ed2 Mon Sep 17 00:00:00 2001 From: Rye Date: Thu, 11 Sep 2025 20:54:32 -0400 Subject: Follow up fixes for Apple Silicon (#4662) * Remove GLM sse flag from cmake that was moved to llpreprocessor.h * Further reduce performance loss of HDR and Sharpening on bandwith-constrained gpu by combining gamma correction into tonemap/sharpening shader passes * Update SSE2NEON to 1.8.0 to fix random render nans * Fix occasional startup crash from LLCachedControl being declared in global scope --- autobuild.xml | 6 +- indra/cmake/00-Common.cmake | 5 +- .../app_settings/shaders/class1/deferred/CASF.glsl | 19 ++++ .../class1/deferred/postDeferredGammaCorrect.glsl | 4 +- .../class1/deferred/postDeferredTonemap.glsl | 28 +++++- indra/newview/llviewershadermgr.cpp | 105 +++++++++++++++++++++ indra/newview/llviewershadermgr.h | 5 + indra/newview/llviewerwindow.cpp | 12 ++- indra/newview/pipeline.cpp | 69 +++++++++----- indra/newview/pipeline.h | 2 +- 10 files changed, 217 insertions(+), 38 deletions(-) diff --git a/autobuild.xml b/autobuild.xml index c52fc65176..d1d2f735af 100644 --- a/autobuild.xml +++ b/autobuild.xml @@ -2343,11 +2343,11 @@ Copyright (c) 2012, 2014, 2015, 2016 nghttp2 contributors archive hash - c578c2a7f4355197d0ce8544310bc5e785531018 + e51fb1d24836d897ce90b8a72010635915b959d6 hash_algorithm sha1 url - https://github.com/secondlife/3p-sse2neon/releases/download/v1.7.0-r2/sse2neon-1.7.0-dev0.gc8ad5f1.d20241212-common-12287325635.tar.zst + https://github.com/secondlife/3p-sse2neon/releases/download/v1.8.0/sse2neon-1.8.0-common-17657389472.tar.zst name common @@ -2360,7 +2360,7 @@ Copyright (c) 2012, 2014, 2015, 2016 nghttp2 contributors copyright Copyright (c) 2015-2024 SSE2NEON Contributors. version - 1.7.0-dev0.gc8ad5f1.d20241212 + 1.8.0 name sse2neon canonical_repo diff --git a/indra/cmake/00-Common.cmake b/indra/cmake/00-Common.cmake index 7ca58c7ea0..99ea22ab4b 100644 --- a/indra/cmake/00-Common.cmake +++ b/indra/cmake/00-Common.cmake @@ -34,7 +34,10 @@ add_compile_definitions(BOOST_BIND_GLOBAL_PLACEHOLDERS) # Force enable SSE2 instructions in GLM per the manual # https://github.com/g-truc/glm/blob/master/manual.md#section2_10 -add_compile_definitions(GLM_FORCE_DEFAULT_ALIGNED_GENTYPES=1 GLM_FORCE_SSE2=1 GLM_ENABLE_EXPERIMENTAL=1) +add_compile_definitions(GLM_FORCE_DEFAULT_ALIGNED_GENTYPES=1 GLM_ENABLE_EXPERIMENTAL=1) + +# SSE2NEON throws a pointless warning when compiler optimizations are enabled +add_compile_definitions(SSE2NEON_SUPPRESS_WARNINGS=1) # Configure crash reporting set(RELEASE_CRASH_REPORTING OFF CACHE BOOL "Enable use of crash reporting in release builds") diff --git a/indra/newview/app_settings/shaders/class1/deferred/CASF.glsl b/indra/newview/app_settings/shaders/class1/deferred/CASF.glsl index 017855325c..8e12d09443 100644 --- a/indra/newview/app_settings/shaders/class1/deferred/CASF.glsl +++ b/indra/newview/app_settings/shaders/class1/deferred/CASF.glsl @@ -2545,12 +2545,31 @@ A_STATIC void CasSetup( #endif #ifdef A_GPU + +#ifdef LEGACY_GAMMA +uniform float gamma; + +vec3 legacyGamma(vec3 color) +{ + vec3 c = 1. - clamp(color, vec3(0.), vec3(1.)); + c = 1. - pow(c, vec3(gamma)); // s/b inverted already CPU-side + + return c; +} +#endif + void main() { vec4 diff = vec4(0.f); uvec2 point = uvec2(vary_fragcoord * out_screen_res.xy); CasFilter(diff.r, diff.g, diff.b, point, cas_param_0, cas_param_1, true); diff.a = texture(diffuseRect, vary_fragcoord).a; + diff.rgb = linear_to_srgb(diff.rgb); + +#ifdef LEGACY_GAMMA + diff.rgb = legacyGamma(diff.rgb); +#endif + frag_color = diff; } #endif diff --git a/indra/newview/app_settings/shaders/class1/deferred/postDeferredGammaCorrect.glsl b/indra/newview/app_settings/shaders/class1/deferred/postDeferredGammaCorrect.glsl index 4ccc6f54a8..d7a47ef8cd 100644 --- a/indra/newview/app_settings/shaders/class1/deferred/postDeferredGammaCorrect.glsl +++ b/indra/newview/app_settings/shaders/class1/deferred/postDeferredGammaCorrect.glsl @@ -43,8 +43,6 @@ vec3 legacyGamma(vec3 color) return c; } -vec3 clampHDRRange(vec3 color); - void main() { //this is the one of the rare spots where diffuseRect contains linear color values (not sRGB) @@ -55,7 +53,7 @@ void main() diff.rgb = legacyGamma(diff.rgb); #endif - diff.rgb = clampHDRRange(diff.rgb); + diff.rgb = clamp(diff.rgb, vec3(0.0), vec3(1.0)); frag_color = diff; } diff --git a/indra/newview/app_settings/shaders/class1/deferred/postDeferredTonemap.glsl b/indra/newview/app_settings/shaders/class1/deferred/postDeferredTonemap.glsl index 1f01c7f16a..b1218d61af 100644 --- a/indra/newview/app_settings/shaders/class1/deferred/postDeferredTonemap.glsl +++ b/indra/newview/app_settings/shaders/class1/deferred/postDeferredTonemap.glsl @@ -31,11 +31,25 @@ uniform sampler2D diffuseRect; in vec2 vary_fragcoord; +#ifdef GAMMA_CORRECT +uniform float gamma; +#endif + vec3 linear_to_srgb(vec3 cl); vec3 toneMap(vec3 color); vec3 clampHDRRange(vec3 color); +#ifdef GAMMA_CORRECT +vec3 legacyGamma(vec3 color) +{ + vec3 c = 1. - clamp(color, vec3(0.), vec3(1.)); + c = 1. - pow(c, vec3(gamma)); // s/b inverted already CPU-side + + return c; +} +#endif + void main() { //this is the one of the rare spots where diffuseRect contains linear color values (not sRGB) @@ -47,8 +61,18 @@ void main() diff.rgb = clamp(diff.rgb, vec3(0.0), vec3(1.0)); #endif - diff.rgb = clampHDRRange(diff.rgb); +#ifdef GAMMA_CORRECT + diff.rgb = linear_to_srgb(diff.rgb); + +#ifdef LEGACY_GAMMA + diff.rgb = legacyGamma(diff.rgb); +#endif + +#endif + + diff.rgb = clamp(diff.rgb, vec3(0.0), vec3(1.0)); // We should always be 0-1 past this point + //debugExposure(diff.rgb); - frag_color = max(diff, vec4(0)); + frag_color = diff; } diff --git a/indra/newview/llviewershadermgr.cpp b/indra/newview/llviewershadermgr.cpp index a9c58d5a06..0c912e8dbc 100644 --- a/indra/newview/llviewershadermgr.cpp +++ b/indra/newview/llviewershadermgr.cpp @@ -196,6 +196,10 @@ LLGLSLShader gDeferredCoFProgram; LLGLSLShader gDeferredDoFCombineProgram; LLGLSLShader gDeferredPostTonemapProgram; LLGLSLShader gNoPostTonemapProgram; +LLGLSLShader gDeferredPostTonemapGammaCorrectProgram; +LLGLSLShader gNoPostTonemapGammaCorrectProgram; +LLGLSLShader gDeferredPostTonemapLegacyGammaCorrectProgram; +LLGLSLShader gNoPostTonemapLegacyGammaCorrectProgram; LLGLSLShader gDeferredPostGammaCorrectProgram; LLGLSLShader gLegacyPostGammaCorrectProgram; LLGLSLShader gExposureProgram; @@ -206,6 +210,7 @@ LLGLSLShader gSMAAEdgeDetectProgram[4]; LLGLSLShader gSMAABlendWeightsProgram[4]; LLGLSLShader gSMAANeighborhoodBlendProgram[4]; LLGLSLShader gCASProgram; +LLGLSLShader gCASLegacyGammaProgram; LLGLSLShader gDeferredPostNoDoFProgram; LLGLSLShader gDeferredPostNoDoFNoiseProgram; LLGLSLShader gDeferredWLSkyProgram; @@ -443,6 +448,11 @@ void LLViewerShaderMgr::finalizeShaderList() mShaderList.push_back(&gHUDPBRAlphaProgram); mShaderList.push_back(&gDeferredPostTonemapProgram); mShaderList.push_back(&gNoPostTonemapProgram); + mShaderList.push_back(&gDeferredPostTonemapGammaCorrectProgram); + mShaderList.push_back(&gNoPostTonemapGammaCorrectProgram); + mShaderList.push_back(&gDeferredPostTonemapLegacyGammaCorrectProgram); + mShaderList.push_back(&gNoPostTonemapLegacyGammaCorrectProgram); + mShaderList.push_back(&gCASLegacyGammaProgram); mShaderList.push_back(&gDeferredPostGammaCorrectProgram); // for gamma mShaderList.push_back(&gLegacyPostGammaCorrectProgram); mShaderList.push_back(&gDeferredDiffuseProgram); @@ -1116,6 +1126,11 @@ bool LLViewerShaderMgr::loadShadersDeferred() gLegacyPostGammaCorrectProgram.unload(); gDeferredPostTonemapProgram.unload(); gNoPostTonemapProgram.unload(); + gDeferredPostTonemapGammaCorrectProgram.unload(); + gNoPostTonemapGammaCorrectProgram.unload(); + gDeferredPostTonemapLegacyGammaCorrectProgram.unload(); + gNoPostTonemapLegacyGammaCorrectProgram.unload(); + for (auto i = 0; i < 4; ++i) { gFXAAProgram[i].unload(); @@ -1124,6 +1139,7 @@ bool LLViewerShaderMgr::loadShadersDeferred() gSMAANeighborhoodBlendProgram[i].unload(); } gCASProgram.unload(); + gCASLegacyGammaProgram.unload(); gEnvironmentMapProgram.unload(); gDeferredWLSkyProgram.unload(); gDeferredWLCloudProgram.unload(); @@ -2486,6 +2502,74 @@ bool LLViewerShaderMgr::loadShadersDeferred() llassert(success); } + if (success) + { + gDeferredPostTonemapGammaCorrectProgram.mName = "Deferred Tonemap Gamma Post Process"; + gDeferredPostTonemapGammaCorrectProgram.mFeatures.hasSrgb = true; + gDeferredPostTonemapGammaCorrectProgram.mFeatures.isDeferred = true; + gDeferredPostTonemapGammaCorrectProgram.mFeatures.hasTonemap = true; + gDeferredPostTonemapGammaCorrectProgram.mShaderFiles.clear(); + gDeferredPostTonemapGammaCorrectProgram.clearPermutations(); + gDeferredPostTonemapGammaCorrectProgram.addPermutation("GAMMA_CORRECT", "1"); + gDeferredPostTonemapGammaCorrectProgram.mShaderFiles.push_back(make_pair("deferred/postDeferredNoTCV.glsl", GL_VERTEX_SHADER)); + gDeferredPostTonemapGammaCorrectProgram.mShaderFiles.push_back(make_pair("deferred/postDeferredTonemap.glsl", GL_FRAGMENT_SHADER)); + gDeferredPostTonemapGammaCorrectProgram.mShaderLevel = mShaderLevel[SHADER_DEFERRED]; + success = gDeferredPostTonemapGammaCorrectProgram.createShader(); + llassert(success); + } + + if (success) + { + gNoPostTonemapGammaCorrectProgram.mName = "No Post Tonemap Gamma Post Process"; + gNoPostTonemapGammaCorrectProgram.mFeatures.hasSrgb = true; + gNoPostTonemapGammaCorrectProgram.mFeatures.isDeferred = true; + gNoPostTonemapGammaCorrectProgram.mFeatures.hasTonemap = true; + gNoPostTonemapGammaCorrectProgram.mShaderFiles.clear(); + gNoPostTonemapGammaCorrectProgram.clearPermutations(); + gNoPostTonemapGammaCorrectProgram.addPermutation("GAMMA_CORRECT", "1"); + gNoPostTonemapGammaCorrectProgram.addPermutation("NO_POST", "1"); + gNoPostTonemapGammaCorrectProgram.mShaderFiles.push_back(make_pair("deferred/postDeferredNoTCV.glsl", GL_VERTEX_SHADER)); + gNoPostTonemapGammaCorrectProgram.mShaderFiles.push_back(make_pair("deferred/postDeferredTonemap.glsl", GL_FRAGMENT_SHADER)); + gNoPostTonemapGammaCorrectProgram.mShaderLevel = mShaderLevel[SHADER_DEFERRED]; + success = gNoPostTonemapGammaCorrectProgram.createShader(); + llassert(success); + } + + if (success) + { + gDeferredPostTonemapLegacyGammaCorrectProgram.mName = "Deferred Tonemap Legacy Gamma Post Process"; + gDeferredPostTonemapLegacyGammaCorrectProgram.mFeatures.hasSrgb = true; + gDeferredPostTonemapProgram.mFeatures.isDeferred = true; + gDeferredPostTonemapLegacyGammaCorrectProgram.mFeatures.hasTonemap = true; + gDeferredPostTonemapLegacyGammaCorrectProgram.mShaderFiles.clear(); + gDeferredPostTonemapLegacyGammaCorrectProgram.clearPermutations(); + gDeferredPostTonemapLegacyGammaCorrectProgram.addPermutation("GAMMA_CORRECT", "1"); + gDeferredPostTonemapLegacyGammaCorrectProgram.addPermutation("LEGACY_GAMMA", "1"); + gDeferredPostTonemapLegacyGammaCorrectProgram.mShaderFiles.push_back(make_pair("deferred/postDeferredNoTCV.glsl", GL_VERTEX_SHADER)); + gDeferredPostTonemapLegacyGammaCorrectProgram.mShaderFiles.push_back(make_pair("deferred/postDeferredTonemap.glsl", GL_FRAGMENT_SHADER)); + gDeferredPostTonemapLegacyGammaCorrectProgram.mShaderLevel = mShaderLevel[SHADER_DEFERRED]; + success = gDeferredPostTonemapLegacyGammaCorrectProgram.createShader(); + llassert(success); + } + + if (success) + { + gNoPostTonemapLegacyGammaCorrectProgram.mName = "No Post Tonemap Legacy Gamma Post Process"; + gNoPostTonemapLegacyGammaCorrectProgram.mFeatures.hasSrgb = true; + gNoPostTonemapLegacyGammaCorrectProgram.mFeatures.isDeferred = true; + gNoPostTonemapLegacyGammaCorrectProgram.mFeatures.hasTonemap = true; + gNoPostTonemapLegacyGammaCorrectProgram.mShaderFiles.clear(); + gNoPostTonemapLegacyGammaCorrectProgram.clearPermutations(); + gNoPostTonemapLegacyGammaCorrectProgram.addPermutation("NO_POST", "1"); + gNoPostTonemapLegacyGammaCorrectProgram.addPermutation("GAMMA_CORRECT", "1"); + gNoPostTonemapLegacyGammaCorrectProgram.addPermutation("LEGACY_GAMMA", "1"); + gNoPostTonemapLegacyGammaCorrectProgram.mShaderFiles.push_back(make_pair("deferred/postDeferredNoTCV.glsl", GL_VERTEX_SHADER)); + gNoPostTonemapLegacyGammaCorrectProgram.mShaderFiles.push_back(make_pair("deferred/postDeferredTonemap.glsl", GL_FRAGMENT_SHADER)); + gNoPostTonemapLegacyGammaCorrectProgram.mShaderLevel = mShaderLevel[SHADER_DEFERRED]; + success = gNoPostTonemapLegacyGammaCorrectProgram.createShader(); + llassert(success); + } + if (success && gGLManager.mGLVersion > 3.9f) { std::vector> quality_levels = { {"12", "Low"}, @@ -2669,6 +2753,27 @@ bool LLViewerShaderMgr::loadShadersDeferred() } } + if (success && gGLManager.mGLVersion > 4.05f) + { + gCASLegacyGammaProgram.mName = "Contrast Adaptive Sharpening Legacy Gamma Shader"; + gCASLegacyGammaProgram.mFeatures.hasSrgb = true; + gCASLegacyGammaProgram.mShaderFiles.clear(); + gCASLegacyGammaProgram.mShaderFiles.push_back(make_pair("deferred/postDeferredNoTCV.glsl", GL_VERTEX_SHADER)); + gCASLegacyGammaProgram.mShaderFiles.push_back(make_pair("deferred/CASF.glsl", GL_FRAGMENT_SHADER)); + gCASLegacyGammaProgram.mShaderLevel = mShaderLevel[SHADER_DEFERRED]; + gCASLegacyGammaProgram.clearPermutations(); + gCASLegacyGammaProgram.addPermutation("GAMMA_CORRECT", "1"); + gCASLegacyGammaProgram.addPermutation("LEGACY_GAMMA", "1"); + success = gCASLegacyGammaProgram.createShader(); + // llassert(success); + if (!success) + { + LL_WARNS() << "Failed to create shader '" << gCASProgram.mName << "', disabling!" << LL_ENDL; + // continue as if this shader never happened + success = true; + } + } + if (success) { gDeferredPostProgram.mName = "Deferred Post Shader"; diff --git a/indra/newview/llviewershadermgr.h b/indra/newview/llviewershadermgr.h index 7ad2da9464..46da30017d 100644 --- a/indra/newview/llviewershadermgr.h +++ b/indra/newview/llviewershadermgr.h @@ -250,12 +250,17 @@ extern LLGLSLShader gSMAAEdgeDetectProgram[4]; extern LLGLSLShader gSMAABlendWeightsProgram[4]; extern LLGLSLShader gSMAANeighborhoodBlendProgram[4]; extern LLGLSLShader gCASProgram; +extern LLGLSLShader gCASLegacyGammaProgram; extern LLGLSLShader gDeferredPostNoDoFProgram; extern LLGLSLShader gDeferredPostNoDoFNoiseProgram; extern LLGLSLShader gDeferredPostGammaCorrectProgram; extern LLGLSLShader gLegacyPostGammaCorrectProgram; extern LLGLSLShader gDeferredPostTonemapProgram; extern LLGLSLShader gNoPostTonemapProgram; +extern LLGLSLShader gDeferredPostTonemapGammaCorrectProgram; +extern LLGLSLShader gNoPostTonemapGammaCorrectProgram; +extern LLGLSLShader gDeferredPostTonemapLegacyGammaCorrectProgram; +extern LLGLSLShader gNoPostTonemapLegacyGammaCorrectProgram; extern LLGLSLShader gExposureProgram; extern LLGLSLShader gExposureProgramNoFade; extern LLGLSLShader gLuminanceProgram; diff --git a/indra/newview/llviewerwindow.cpp b/indra/newview/llviewerwindow.cpp index 70498ecab4..8abced7e8f 100644 --- a/indra/newview/llviewerwindow.cpp +++ b/indra/newview/llviewerwindow.cpp @@ -261,9 +261,6 @@ static const F32 MIN_DISPLAY_SCALE = 0.75f; static const char KEY_MOUSELOOK = 'M'; -static LLCachedControl sSnapshotBaseName(LLCachedControl(gSavedPerAccountSettings, "SnapshotBaseName", "Snapshot")); -static LLCachedControl sSnapshotDir(LLCachedControl(gSavedPerAccountSettings, "SnapshotBaseDir", "")); - LLTrace::SampleStatHandle<> LLViewerWindow::sMouseVelocityStat("Mouse Velocity"); @@ -2042,6 +2039,7 @@ LLViewerWindow::LLViewerWindow(const Params& p) std::string LLViewerWindow::getLastSnapshotDir() { + static LLCachedControl sSnapshotDir(LLCachedControl(gSavedPerAccountSettings, "SnapshotBaseDir", "")); return sSnapshotDir; } @@ -4752,6 +4750,7 @@ void LLViewerWindow::saveImageNumbered(LLImageFormatted *image, bool force_picke // Get a base file location if needed. if (force_picker || !isSnapshotLocSet()) { + static LLCachedControl sSnapshotBaseName(LLCachedControl(gSavedPerAccountSettings, "SnapshotBaseName", "Snapshot")); std::string proposed_name(sSnapshotBaseName); // getSaveFile will append an appropriate extension to the proposed name, based on the ESaveFilter constant passed in. @@ -4850,6 +4849,9 @@ void LLViewerWindow::saveImageLocal(LLImageFormatted *image, const snapshot_save // Shouldn't there be a return here? } + static LLCachedControl sSnapshotBaseName(LLCachedControl(gSavedPerAccountSettings, "SnapshotBaseName", "Snapshot")); + static LLCachedControl sSnapshotDir(LLCachedControl(gSavedPerAccountSettings, "SnapshotBaseDir", "")); + // Look for an unused file name auto is_snapshot_name_loc_set = isSnapshotLocSet(); std::string filepath; @@ -4957,8 +4959,8 @@ void LLViewerWindow::playSnapshotAnimAndSound() bool LLViewerWindow::isSnapshotLocSet() const { - std::string snapshot_dir = sSnapshotDir; - return !snapshot_dir.empty(); + static LLCachedControl sSnapshotDir(LLCachedControl(gSavedPerAccountSettings, "SnapshotBaseDir", "")); + return !sSnapshotDir().empty(); } void LLViewerWindow::resetSnapshotLoc() const diff --git a/indra/newview/pipeline.cpp b/indra/newview/pipeline.cpp index 6413c08e44..2fe67a5457 100644 --- a/indra/newview/pipeline.cpp +++ b/indra/newview/pipeline.cpp @@ -7200,7 +7200,7 @@ void LLPipeline::generateExposure(LLRenderTarget* src, LLRenderTarget* dst, bool extern LLPointer gEXRImage; -void LLPipeline::tonemap(LLRenderTarget* src, LLRenderTarget* dst) +void LLPipeline::tonemap(LLRenderTarget* src, LLRenderTarget* dst, bool gamma_correct) { LL_PROFILE_GPU_ZONE("tonemap"); @@ -7218,17 +7218,33 @@ void LLPipeline::tonemap(LLRenderTarget* src, LLRenderTarget* dst) LLSettingsSky::ptr_t psky = LLEnvironment::instance().getCurrentSky(); bool no_post = gSnapshotNoPost || psky->getReflectionProbeAmbiance(should_auto_adjust) == 0.f || (buildNoPost && gFloaterTools && gFloaterTools->isAvailable()); - LLGLSLShader& shader = no_post ? gNoPostTonemapProgram : gDeferredPostTonemapProgram; + LLGLSLShader* shader = nullptr; + if(gamma_correct) + { + bool legacy_gamma = psky->getReflectionProbeAmbiance(should_auto_adjust) == 0.f; + if(legacy_gamma) + { + shader = no_post ? &gNoPostTonemapLegacyGammaCorrectProgram : &gDeferredPostTonemapLegacyGammaCorrectProgram; + } + else + { + shader = no_post ? &gNoPostTonemapGammaCorrectProgram : &gDeferredPostTonemapGammaCorrectProgram; + } + } + else + { + shader = no_post ? &gNoPostTonemapProgram : &gDeferredPostTonemapProgram; + } - shader.bind(); + shader->bind(); S32 channel = 0; - shader.bindTexture(LLShaderMgr::DEFERRED_DIFFUSE, src, false, LLTexUnit::TFO_POINT); + shader->bindTexture(LLShaderMgr::DEFERRED_DIFFUSE, src, false, LLTexUnit::TFO_POINT); - shader.bindTexture(LLShaderMgr::EXPOSURE_MAP, &mExposureMap); + shader->bindTexture(LLShaderMgr::EXPOSURE_MAP, &mExposureMap); - shader.uniform2f(LLShaderMgr::DEFERRED_SCREEN_RES, (GLfloat)src->getWidth(), (GLfloat)src->getHeight()); + shader->uniform2f(LLShaderMgr::DEFERRED_SCREEN_RES, (GLfloat)src->getWidth(), (GLfloat)src->getHeight()); static LLCachedControl exposure(gSavedSettings, "RenderExposure", 1.f); @@ -7238,17 +7254,17 @@ void LLPipeline::tonemap(LLRenderTarget* src, LLRenderTarget* dst) static LLStaticHashedString tonemap_mix("tonemap_mix"); static LLStaticHashedString tonemap_type("tonemap_type"); - shader.uniform1f(s_exposure, e); + shader->uniform1f(s_exposure, e); static LLCachedControl tonemap_type_setting(gSavedSettings, "RenderTonemapType", 0U); - shader.uniform1i(tonemap_type, tonemap_type_setting); - shader.uniform1f(tonemap_mix, psky->getTonemapMix(should_auto_adjust())); + shader->uniform1i(tonemap_type, tonemap_type_setting); + shader->uniform1f(tonemap_mix, psky->getTonemapMix(should_auto_adjust())); mScreenTriangleVB->setBuffer(); mScreenTriangleVB->drawArrays(LLRender::TRIANGLES, 0, 3); gGL.getTexUnit(channel)->unbind(src->getUsage()); - shader.unbind(); + shader->unbind(); } dst->flush(); } @@ -7422,13 +7438,21 @@ void LLPipeline::applyCAS(LLRenderTarget* src, LLRenderTarget* dst) { static LLCachedControl cas_sharpness(gSavedSettings, "RenderCASSharpness", 0.4f); LL_PROFILE_GPU_ZONE("cas"); - if (cas_sharpness == 0.0f || !gCASProgram.isComplete()) + if (cas_sharpness == 0.0f || !gCASProgram.isComplete() || !gCASLegacyGammaProgram.isComplete()) { gPipeline.copyRenderTarget(src, dst); return; } LLGLSLShader* sharpen_shader = &gCASProgram; + static LLCachedControl should_auto_adjust(gSavedSettings, "RenderSkyAutoAdjustLegacy", false); + + LLSettingsSky::ptr_t psky = LLEnvironment::instance().getCurrentSky(); + bool legacy_gamma = psky->getReflectionProbeAmbiance(should_auto_adjust) == 0.f; + if(legacy_gamma) + { + sharpen_shader = &gCASLegacyGammaProgram; + } // Bind setup: dst->bindTarget(); @@ -7990,7 +8014,6 @@ void LLPipeline::renderFinalize() static LLCachedControl has_hdr(gSavedSettings, "RenderHDREnabled", true); bool hdr = gGLManager.mGLVersion > 4.05f && has_hdr(); - LLRenderTarget* postHDRBuffer = &mRT->screen; if (hdr) { copyScreenSpaceReflections(&mRT->screen, &mSceneMap); @@ -7999,21 +8022,21 @@ void LLPipeline::renderFinalize() generateExposure(&mLuminanceMap, &mExposureMap); - tonemap(&mRT->screen, &mRT->deferredLight); - static LLCachedControl cas_sharpness(gSavedSettings, "RenderCASSharpness", 0.4f); - if (cas_sharpness != 0.0f && gCASProgram.isComplete()) - { - applyCAS(&mRT->deferredLight, &mRT->screen); - postHDRBuffer = &mRT->screen; - } - else + bool apply_cas = cas_sharpness != 0.0f && gCASProgram.isComplete() && gCASLegacyGammaProgram.isComplete(); + + tonemap(&mRT->screen, apply_cas ? &mRT->deferredLight : &mPostPingMap, !apply_cas); + + if (apply_cas) { - postHDRBuffer = &mRT->deferredLight; + // Gamma Corrects + applyCAS(&mRT->deferredLight, &mPostPingMap); } } - - gammaCorrect(postHDRBuffer, &mPostPingMap); + else + { + gammaCorrect(&mRT->screen, &mPostPingMap); + } LLVertexBuffer::unbind(); diff --git a/indra/newview/pipeline.h b/indra/newview/pipeline.h index b3796a6feb..dff0af46e2 100644 --- a/indra/newview/pipeline.h +++ b/indra/newview/pipeline.h @@ -155,7 +155,7 @@ public: void copyScreenSpaceReflections(LLRenderTarget* src, LLRenderTarget* dst); void generateLuminance(LLRenderTarget* src, LLRenderTarget* dst); void generateExposure(LLRenderTarget* src, LLRenderTarget* dst, bool use_history = true); - void tonemap(LLRenderTarget* src, LLRenderTarget* dst); + void tonemap(LLRenderTarget* src, LLRenderTarget* dst, bool gamma_correct); void gammaCorrect(LLRenderTarget* src, LLRenderTarget* dst); void generateGlow(LLRenderTarget* src); void applyCAS(LLRenderTarget* src, LLRenderTarget* dst); -- cgit v1.2.3 From cf3352e6f24630948c38db52b749a103e4d08d77 Mon Sep 17 00:00:00 2001 From: Maxim Nikolenko Date: Fri, 12 Sep 2025 15:54:21 +0300 Subject: #3957 Add indication to a folder's context menu that it is the default upload location --- indra/newview/llinventoryfunctions.cpp | 25 ++++++ indra/newview/llinventoryfunctions.h | 1 + indra/newview/llinventorygallerymenu.cpp | 7 ++ indra/newview/llinventorygallerymenu.h | 1 + indra/newview/llinventorypanel.cpp | 8 ++ indra/newview/llinventorypanel.h | 1 + .../default/xui/en/menu_gallery_inventory.xml | 98 ++++++++-------------- .../skins/default/xui/en/menu_inventory.xml | 45 ++++++---- 8 files changed, 107 insertions(+), 79 deletions(-) diff --git a/indra/newview/llinventoryfunctions.cpp b/indra/newview/llinventoryfunctions.cpp index d1fd82a7f1..e6b33453d5 100644 --- a/indra/newview/llinventoryfunctions.cpp +++ b/indra/newview/llinventoryfunctions.cpp @@ -3890,6 +3890,31 @@ void LLInventoryAction::fileUploadLocation(const LLUUID& dest_id, const std::str } } +bool LLInventoryAction::isFileUploadLocation(const LLUUID& dest_id, const std::string& action) +{ + if (action == "def_model") + { + return gInventory.findUserDefinedCategoryUUIDForType(LLFolderType::FT_OBJECT) == dest_id; + } + else if (action == "def_texture") + { + return gInventory.findUserDefinedCategoryUUIDForType(LLFolderType::FT_TEXTURE) == dest_id; + } + else if (action == "def_sound") + { + return gInventory.findUserDefinedCategoryUUIDForType(LLFolderType::FT_SOUND) == dest_id; + } + else if (action == "def_animation") + { + return gInventory.findUserDefinedCategoryUUIDForType(LLFolderType::FT_ANIMATION) == dest_id; + } + else if (action == "def_pbr_material") + { + return gInventory.findUserDefinedCategoryUUIDForType(LLFolderType::FT_MATERIAL) == dest_id; + } + return false; +} + void LLInventoryAction::onItemsRemovalConfirmation(const LLSD& notification, const LLSD& response, LLHandle root) { S32 option = LLNotificationsUtil::getSelectedOption(notification, response); diff --git a/indra/newview/llinventoryfunctions.h b/indra/newview/llinventoryfunctions.h index ae7bb8770d..77a2a18877 100644 --- a/indra/newview/llinventoryfunctions.h +++ b/indra/newview/llinventoryfunctions.h @@ -653,6 +653,7 @@ struct LLInventoryAction static void onItemsRemovalConfirmation(const LLSD& notification, const LLSD& response, LLHandle root); static void removeItemFromDND(LLFolderView* root); static void fileUploadLocation(const LLUUID& dest_id, const std::string& action); + static bool isFileUploadLocation(const LLUUID& dest_id, const std::string& action); static void saveMultipleTextures(const std::vector& filenames, std::set selected_items, LLInventoryModel* model); diff --git a/indra/newview/llinventorygallerymenu.cpp b/indra/newview/llinventorygallerymenu.cpp index 7212c4dedb..e129a1296a 100644 --- a/indra/newview/llinventorygallerymenu.cpp +++ b/indra/newview/llinventorygallerymenu.cpp @@ -110,6 +110,7 @@ LLContextMenu* LLInventoryGalleryContextMenu::createMenu() registrar.add("Inventory.Share", boost::bind(&LLAvatarActions::shareWithAvatars, uuids, gFloaterView->getParentFloater(mGallery))); enable_registrar.add("Inventory.CanSetUploadLocation", boost::bind(&LLInventoryGalleryContextMenu::canSetUploadLocation, this, _2)); + enable_registrar.add("Inventory.FileUploadLocation.Check", boost::bind(&LLInventoryGalleryContextMenu::isUploadLocationSelected, this, _2)); enable_registrar.add("Inventory.EnvironmentEnabled", [](LLUICtrl*, const LLSD&) { @@ -489,6 +490,12 @@ void LLInventoryGalleryContextMenu::fileUploadLocation(const LLSD& userdata) LLInventoryAction::fileUploadLocation(mUUIDs.front(), param); } +bool LLInventoryGalleryContextMenu::isUploadLocationSelected(const LLSD& userdata) +{ + const std::string param = userdata.asString(); + return LLInventoryAction::isFileUploadLocation(mUUIDs.front(), param); +} + bool LLInventoryGalleryContextMenu::canSetUploadLocation(const LLSD& userdata) { if (mUUIDs.size() != 1) diff --git a/indra/newview/llinventorygallerymenu.h b/indra/newview/llinventorygallerymenu.h index 7c3545432b..e90c7a19d2 100644 --- a/indra/newview/llinventorygallerymenu.h +++ b/indra/newview/llinventorygallerymenu.h @@ -47,6 +47,7 @@ protected: void updateMenuItemsVisibility(LLContextMenu* menu); void fileUploadLocation(const LLSD& userdata); + bool isUploadLocationSelected(const LLSD& userdata); bool canSetUploadLocation(const LLSD& userdata); static void onRename(const LLSD& notification, const LLSD& response); diff --git a/indra/newview/llinventorypanel.cpp b/indra/newview/llinventorypanel.cpp index 590cbbec4e..a935ede186 100644 --- a/indra/newview/llinventorypanel.cpp +++ b/indra/newview/llinventorypanel.cpp @@ -187,6 +187,7 @@ LLInventoryPanel::LLInventoryPanel(const LLInventoryPanel::Params& p) : mCommitCallbackRegistrar.add("Inventory.BeginIMSession", boost::bind(&LLInventoryPanel::beginIMSession, this)); mCommitCallbackRegistrar.add("Inventory.Share", boost::bind(&LLAvatarActions::shareWithAvatars, this)); mCommitCallbackRegistrar.add("Inventory.FileUploadLocation", boost::bind(&LLInventoryPanel::fileUploadLocation, this, _2)); + mEnableCallbackRegistrar.add("Inventory.FileUploadLocation.Check", boost::bind(&LLInventoryPanel::isUploadLocationSelected, this, _2)); mCommitCallbackRegistrar.add("Inventory.OpenNewFolderWindow", boost::bind(&LLInventoryPanel::openSingleViewInventory, this, LLUUID())); } @@ -1832,6 +1833,13 @@ void LLInventoryPanel::fileUploadLocation(const LLSD& userdata) LLInventoryAction::fileUploadLocation(dest, param); } +bool LLInventoryPanel::isUploadLocationSelected(const LLSD& userdata) +{ + const std::string param = userdata.asString(); + const LLUUID dest = LLFolderBridge::sSelf.get()->getUUID(); + return LLInventoryAction::isFileUploadLocation(dest, param); +} + void LLInventoryPanel::openSingleViewInventory(LLUUID folder_id) { LLPanelMainInventory::newFolderWindow(folder_id.isNull() ? LLFolderBridge::sSelf.get()->getUUID() : folder_id); diff --git a/indra/newview/llinventorypanel.h b/indra/newview/llinventorypanel.h index 473283352f..50333709fc 100644 --- a/indra/newview/llinventorypanel.h +++ b/indra/newview/llinventorypanel.h @@ -225,6 +225,7 @@ public: void doCreate(const LLSD& userdata); bool beginIMSession(); void fileUploadLocation(const LLSD& userdata); + bool isUploadLocationSelected(const LLSD& userdata); void openSingleViewInventory(LLUUID folder_id = LLUUID()); void purgeSelectedItems(); bool attachObject(const LLSD& userdata); diff --git a/indra/newview/skins/default/xui/en/menu_gallery_inventory.xml b/indra/newview/skins/default/xui/en/menu_gallery_inventory.xml index d8090070bd..3cfe2e0e6f 100644 --- a/indra/newview/skins/default/xui/en/menu_gallery_inventory.xml +++ b/indra/newview/skins/default/xui/en/menu_gallery_inventory.xml @@ -686,51 +686,6 @@ function="Inventory.DoToSelected" parameter="remove_from_favorites" /> - - - - - - - - - - - - - - - - - - - - - - - + + - - - - + + - - - - + + - - - - + + - - + + - - - - + + - - - + + - - - + + - - - + + - - + +
Date: Fri, 12 Sep 2025 19:17:58 -0400 Subject: Use XL mac runners due to the unibin build time. (#4674) Temporary until we can better parallelize architecture specific builds. --- .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 8689f2308e..1e5b4958e1 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -42,7 +42,7 @@ jobs: needs: setup strategy: matrix: - runner: ${{ fromJson((github.ref_type == 'tag' && startsWith(github.ref, 'refs/tags/Second_Life')) && '["windows-large","macos-15-xlarge"]' || '["windows-2022","macos-15"]') }} + runner: ${{ fromJson((github.ref_type == 'tag' && startsWith(github.ref, 'refs/tags/Second_Life')) && '["windows-large","macos-15-xlarge"]' || '["windows-2022","macos-15-xlarge"]') }} configuration: ${{ fromJson(needs.setup.outputs.configurations) }} runs-on: ${{ matrix.runner }} outputs: -- cgit v1.2.3 From a6d4c1d394eef2cea41f6c6bcd751fec746ec17d Mon Sep 17 00:00:00 2001 From: Roxanne Skelly Date: Fri, 12 Sep 2025 17:07:51 -0700 Subject: [WebRTC] Rework device handling sequence so that we can handle unplugging/re-plugging devices (#4593) * [WebRTC] Rework device handling sequence so that we can handle unplugging/re-plugging devices The device handling was not processing device updates in the proper sequence as things like AEC use both input and output devices. Devices like headsets are both so unplugging them resulted in various mute conditions and sometimes even a crash. Now, we update both capture and render devices at once in the proper sequence. Test Guidance: * Bring two users in the same place in webrtc regions. * The 'listening' one should have a headset or something set oas 'Default' * Press 'talk' on one, and verify the other can hear. * Unplug the headset from the listening one. * Validate that audio changes from the headset to the speakers. * Plug the headset back in. * Validate that audio changes from speakers to headset. * Do the same type of test with the headset viewer talking. * The microphone used should switch from the headset to the computer (it should have one) Do other various device tests, such as setting devices explicitly, messing with the device selector, etc. * Fix race condition when multiple change device requests might come in at once * Update to m137 The primary feature of this commit is to update libwebrtc from m114 to m137. This is needed to make webrtc buildable, as m114 is not buildable by the current toolset. m137 had some changes to the API, which required renaming or changing namespace of some of the calls. Additionally, this PR moves from a callback mechanism for gathering the energy levels for tuning to a wrapper AudioDeviceModule, which gives us more control over the audio stream. Finally, the new m137-based webrtc has been updated to allow for 192khz audio streams. * Properly pass the observer setting into the inner audio device module * Update to m137 and get rid of some noise This change updates to m137 from m114, which required a few API changes. Additionally, this fixes the hiss that happens shortly after someone unmutes: https://github.com/secondlife/server/issues/2094 There was also an issue with a slight amount of repeated after unmuting if there was audio right before unmuting. This is because the audio processing and buffering still had audio from the previous speaking session. Now, we inject nearly a half second of silence into the audio buffers/processor after unmuting to flush things. * Install nsis on windows * Use the newer digital AGC pipeline m137 improved the AGC pipeline and the existing analog style is going away so move to the new digital pipeline. Also, some tweaking for audio levels so that we don't see inworld bars when tuning, so one's own bars seem a reasonable size, etc. * Install NSIS during windows sisgning and package build step * Try pinning the packaging to windows 2022 to deal with missing nsis * Adjust gain calculation and audio level calculations for tuning and peer connections * Update with mac universal webrtc build * Tuning of voice indicators for both tuning mode and inworld for self. * Redo device deployment to handle cases where multiple deploy requests pile up Also, mute when leaving webrtc-enabled regions or parcels, and unmute when voice comes back. * pre commit issue --- .github/workflows/build.yaml | 1 - autobuild.xml | 14 +- indra/llwebrtc/CMakeLists.txt | 2 +- indra/llwebrtc/llwebrtc.cpp | 740 +++++++++++++++++++++------------------- indra/llwebrtc/llwebrtc.h | 5 +- indra/llwebrtc/llwebrtc_impl.h | 414 +++++++++++++++++----- indra/newview/llvoicewebrtc.cpp | 139 +++++--- indra/newview/llvoicewebrtc.h | 5 - 8 files changed, 831 insertions(+), 489 deletions(-) diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index 1e5b4958e1..42fd44cf9c 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -93,7 +93,6 @@ jobs: uses: actions/setup-python@v5 with: python-version: "3.11" - - name: Checkout build variables uses: actions/checkout@v4 with: diff --git a/autobuild.xml b/autobuild.xml index d1d2f735af..c9355c73c0 100644 --- a/autobuild.xml +++ b/autobuild.xml @@ -2717,11 +2717,11 @@ Copyright (c) 2012, 2014, 2015, 2016 nghttp2 contributors archive hash - 6314fdcee81a3538a7d960178ade66301c2fa002 + 43c5f93517794aeade550e4266b959d1f0cfcb7f hash_algorithm sha1 url - https://github.com/secondlife/3p-webrtc-build/releases/download/m114.5735.08.73-alpha/webrtc-m114.5735.08.73-alpha.11958809572-darwin64-11958809572.tar.zst + https://github.com/secondlife/3p-webrtc-build/releases/download/m137.7151.04.20-universal/webrtc-m137.7151.04.20-universal.17630578914-darwin64-17630578914.tar.zst name darwin64 @@ -2731,11 +2731,11 @@ Copyright (c) 2012, 2014, 2015, 2016 nghttp2 contributors archive hash - 95d7730a3d6955697e043f3fdf20ebdcc0c71fc0 + efc5b176d878cfc16b8f82445d82ddb96815b6ab hash_algorithm sha1 url - https://github.com/secondlife/3p-webrtc-build/releases/download/m114.5735.08.73-alpha/webrtc-m114.5735.08.73-alpha.11958809572-linux64-11958809572.tar.zst + https://github.com/secondlife/3p-webrtc-build/releases/download/m137.7151.04.20-universal/webrtc-m137.7151.04.20-universal.17630578914-linux64-17630578914.tar.zst name linux64 @@ -2745,11 +2745,11 @@ Copyright (c) 2012, 2014, 2015, 2016 nghttp2 contributors archive hash - c7b329d6409576af6eb5b80655b007f52639c43b + 1e36f100de32c7c71325497a672fb1659b3f206d hash_algorithm sha1 url - https://github.com/secondlife/3p-webrtc-build/releases/download/m114.5735.08.73-alpha/webrtc-m114.5735.08.73-alpha.11958809572-windows64-11958809572.tar.zst + https://github.com/secondlife/3p-webrtc-build/releases/download/m137.7151.04.20-universal/webrtc-m137.7151.04.20-universal.17630578914-windows64-17630578914.tar.zst name windows64 @@ -2762,7 +2762,7 @@ Copyright (c) 2012, 2014, 2015, 2016 nghttp2 contributors copyright Copyright (c) 2011, The WebRTC project authors. All rights reserved. version - m114.5735.08.73-alpha.11958809572 + m137.7151.04.20-universal.17630578914 name webrtc vcs_branch diff --git a/indra/llwebrtc/CMakeLists.txt b/indra/llwebrtc/CMakeLists.txt index 4fde489942..eb10f4eee4 100644 --- a/indra/llwebrtc/CMakeLists.txt +++ b/indra/llwebrtc/CMakeLists.txt @@ -42,7 +42,7 @@ if (WINDOWS) iphlpapi libcmt) # as the webrtc libraries are release, build this binary as release as well. - target_compile_options(llwebrtc PRIVATE "/MT") + target_compile_options(llwebrtc PRIVATE "/MT" "/Zc:wchar_t") if (USE_BUGSPLAT) set_target_properties(llwebrtc PROPERTIES PDB_OUTPUT_DIRECTORY "${SYMBOLS_STAGING_DIR}") endif (USE_BUGSPLAT) diff --git a/indra/llwebrtc/llwebrtc.cpp b/indra/llwebrtc/llwebrtc.cpp index 20951ff816..edba2bee9a 100644 --- a/indra/llwebrtc/llwebrtc.cpp +++ b/indra/llwebrtc/llwebrtc.cpp @@ -9,7 +9,7 @@ * 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. + * 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 @@ -32,41 +32,79 @@ #include "api/audio_codecs/audio_encoder_factory.h" #include "api/audio_codecs/builtin_audio_decoder_factory.h" #include "api/audio_codecs/builtin_audio_encoder_factory.h" +#include "api/audio/builtin_audio_processing_builder.h" #include "api/media_stream_interface.h" #include "api/media_stream_track.h" #include "modules/audio_processing/audio_buffer.h" #include "modules/audio_mixer/audio_mixer_impl.h" +#include "api/environment/environment_factory.h" namespace llwebrtc { +#if WEBRTC_WIN +static int16_t PLAYOUT_DEVICE_DEFAULT = webrtc::AudioDeviceModule::kDefaultDevice; +static int16_t RECORD_DEVICE_DEFAULT = webrtc::AudioDeviceModule::kDefaultDevice; +#else +static int16_t PLAYOUT_DEVICE_DEFAULT = 0; +static int16_t RECORD_DEVICE_DEFAULT = 0; +#endif -static int16_t PLAYOUT_DEVICE_DEFAULT = -1; -static int16_t PLAYOUT_DEVICE_BAD = -2; -static int16_t RECORD_DEVICE_DEFAULT = -1; -static int16_t RECORD_DEVICE_BAD = -2; -LLAudioDeviceObserver::LLAudioDeviceObserver() : mSumVector {0}, mMicrophoneEnergy(0.0) {} +// +// LLWebRTCAudioTransport implementation +// -float LLAudioDeviceObserver::getMicrophoneEnergy() { return mMicrophoneEnergy; } +LLWebRTCAudioTransport::LLWebRTCAudioTransport() : mMicrophoneEnergy(0.0) +{ + memset(mSumVector, 0, sizeof(mSumVector)); +} -// TODO: Pull smoothing/filtering code into a common helper function -// for LLAudioDeviceObserver and LLCustomProcessor +void LLWebRTCAudioTransport::SetEngineTransport(webrtc::AudioTransport* t) +{ + engine_.store(t, std::memory_order_release); +} -void LLAudioDeviceObserver::OnCaptureData(const void *audio_samples, - const size_t num_samples, - const size_t bytes_per_sample, - const size_t num_channels, - const uint32_t samples_per_sec) +int32_t LLWebRTCAudioTransport::RecordedDataIsAvailable(const void* audio_data, + size_t number_of_frames, + size_t bytes_per_frame, + size_t number_of_channels, + uint32_t samples_per_sec, + uint32_t total_delay_ms, + int32_t clock_drift, + uint32_t current_mic_level, + bool key_pressed, + uint32_t& new_mic_level) { + auto* engine = engine_.load(std::memory_order_acquire); + + // 1) Deliver to engine (authoritative). + int32_t ret = 0; + if (engine) + { + ret = engine->RecordedDataIsAvailable(audio_data, + number_of_frames, + bytes_per_frame, + number_of_channels, + samples_per_sec, + total_delay_ms, + clock_drift, + current_mic_level, + key_pressed, + new_mic_level); + } + + // 2) Calculate energy for microphone level monitoring // calculate the energy float energy = 0; - const short *samples = (const short *) audio_samples; - for (size_t index = 0; index < num_samples * num_channels; index++) + const short *samples = (const short *) audio_data; + + for (size_t index = 0; index < number_of_frames * number_of_channels; index++) { float sample = (static_cast(samples[index]) / (float) 32767); energy += sample * sample; } - + float gain = mGain.load(std::memory_order_relaxed); + energy = energy * gain * gain; // smooth it. size_t buffer_size = sizeof(mSumVector) / sizeof(mSumVector[0]); float totalSum = 0; @@ -78,18 +116,59 @@ void LLAudioDeviceObserver::OnCaptureData(const void *audio_samples, } mSumVector[i] = energy; totalSum += energy; - mMicrophoneEnergy = std::sqrt(totalSum / (num_samples * buffer_size)); + mMicrophoneEnergy = std::sqrt(totalSum / (number_of_frames * number_of_channels * buffer_size)); + + return ret; } -void LLAudioDeviceObserver::OnRenderData(const void *audio_samples, - const size_t num_samples, - const size_t bytes_per_sample, - const size_t num_channels, - const uint32_t samples_per_sec) +int32_t LLWebRTCAudioTransport::NeedMorePlayData(size_t number_of_frames, + size_t bytes_per_frame, + size_t number_of_channels, + uint32_t samples_per_sec, + void* audio_data, + size_t& number_of_samples_out, + int64_t* elapsed_time_ms, + int64_t* ntp_time_ms) { + auto* engine = engine_.load(std::memory_order_acquire); + if (!engine) + { + // No engine sink; output silence to be safe. + const size_t bytes = number_of_frames * bytes_per_frame * number_of_channels; + memset(audio_data, 0, bytes); + number_of_samples_out = bytes_per_frame; + return 0; + } + + // Only the engine should fill the buffer. + return engine->NeedMorePlayData(number_of_frames, + bytes_per_frame, + number_of_channels, + samples_per_sec, + audio_data, + number_of_samples_out, + elapsed_time_ms, + ntp_time_ms); } -LLCustomProcessor::LLCustomProcessor() : mSampleRateHz(0), mNumChannels(0), mMicrophoneEnergy(0.0), mGain(1.0) +void LLWebRTCAudioTransport::PullRenderData(int bits_per_sample, + int sample_rate, + size_t number_of_channels, + size_t number_of_frames, + void* audio_data, + int64_t* elapsed_time_ms, + int64_t* ntp_time_ms) +{ + auto* engine = engine_.load(std::memory_order_acquire); + + if (engine) + { + engine + ->PullRenderData(bits_per_sample, sample_rate, number_of_channels, number_of_frames, audio_data, elapsed_time_ms, ntp_time_ms); + } +} + +LLCustomProcessor::LLCustomProcessor(LLCustomProcessorStatePtr state) : mSampleRateHz(0), mNumChannels(0), mState(state) { memset(mSumVector, 0, sizeof(mSumVector)); } @@ -101,40 +180,61 @@ void LLCustomProcessor::Initialize(int sample_rate_hz, int num_channels) memset(mSumVector, 0, sizeof(mSumVector)); } -void LLCustomProcessor::Process(webrtc::AudioBuffer *audio_in) +void LLCustomProcessor::Process(webrtc::AudioBuffer *audio) { - webrtc::StreamConfig stream_config; - stream_config.set_sample_rate_hz(mSampleRateHz); - stream_config.set_num_channels(mNumChannels); - std::vector frame; - std::vector frame_samples; - - if (audio_in->num_channels() < 1 || audio_in->num_frames() < 480) + if (audio->num_channels() < 1 || audio->num_frames() < 480) { return; } - // grab the input audio - frame_samples.resize(stream_config.num_samples()); - frame.resize(stream_config.num_channels()); - for (size_t ch = 0; ch < stream_config.num_channels(); ++ch) + // calculate the energy + + float desired_gain = mState->getGain(); + if (mState->getDirty()) { - frame[ch] = &(frame_samples)[ch * stream_config.num_frames()]; + // We'll delay ramping by 30ms in order to clear out buffers that may + // have had content before muting. And for the last 20ms, we'll ramp + // down or up smoothly. + mRampFrames = 5; + + // we've changed our desired gain, so set the incremental + // gain change so that we smoothly step over 20ms + mGainStep = (desired_gain - mCurrentGain) / (mSampleRateHz / 50); } - audio_in->CopyTo(stream_config, &frame[0]); - - // calculate the energy - float energy = 0; - for (size_t index = 0; index < stream_config.num_samples(); index++) + if (mRampFrames) { - float sample = frame_samples[index]; - sample = sample * mGain; // apply gain - frame_samples[index] = sample; // write processed sample back to buffer. - energy += sample * sample; + if (mRampFrames-- > 2) + { + // don't change the gain if we're still in the 'don't move' phase + mGainStep = 0.0f; + } + } + else + { + // We've ramped all the way down, so don't step the gain any more and + // just maintaint he current gain. + mGainStep = 0.0f; + mCurrentGain = desired_gain; } - audio_in->CopyFrom(&frame[0], stream_config); + float energy = 0; + + auto chans = audio->channels(); + for (size_t ch = 0; ch < audio->num_channels(); ch++) + { + float* frame_samples = chans[ch]; + float gain = mCurrentGain; + for (size_t index = 0; index < audio->num_frames(); index++) + { + float sample = frame_samples[index]; + sample = sample * gain; // apply gain + frame_samples[index] = sample; // write processed sample back to buffer. + energy += sample * sample; + gain += mGainStep; + } + } + mCurrentGain += audio->num_frames() * mGainStep; // smooth it. size_t buffer_size = sizeof(mSumVector) / sizeof(mSumVector[0]); @@ -147,7 +247,7 @@ void LLCustomProcessor::Process(webrtc::AudioBuffer *audio_in) } mSumVector[i] = energy; totalSum += energy; - mMicrophoneEnergy = std::sqrt(totalSum / (stream_config.num_samples() * buffer_size)); + mState->setMicrophoneEnergy(std::sqrt(totalSum / (audio->num_channels() * audio->num_frames() * buffer_size))); } // @@ -159,89 +259,54 @@ LLWebRTCImpl::LLWebRTCImpl(LLWebRTCLogCallback* logCallback) : mPeerCustomProcessor(nullptr), mMute(true), mTuningMode(false), - mPlayoutDevice(0), - mRecordingDevice(0), - mTuningAudioDeviceObserver(nullptr) + mDevicesDeploying(0), + mGain(0.0f) { } void LLWebRTCImpl::init() { - mPlayoutDevice = 0; - mRecordingDevice = 0; - rtc::InitializeSSL(); + webrtc::InitializeSSL(); // Normal logging is rather spammy, so turn it off. - rtc::LogMessage::LogToDebug(rtc::LS_NONE); - rtc::LogMessage::SetLogToStderr(true); - rtc::LogMessage::AddLogToStream(mLogSink, rtc::LS_VERBOSE); + webrtc::LogMessage::LogToDebug(webrtc::LS_NONE); + webrtc::LogMessage::SetLogToStderr(true); + webrtc::LogMessage::AddLogToStream(mLogSink, webrtc::LS_VERBOSE); mTaskQueueFactory = webrtc::CreateDefaultTaskQueueFactory(); // Create the native threads. - mNetworkThread = rtc::Thread::CreateWithSocketServer(); + mNetworkThread = webrtc::Thread::CreateWithSocketServer(); mNetworkThread->SetName("WebRTCNetworkThread", nullptr); mNetworkThread->Start(); - mWorkerThread = rtc::Thread::Create(); + mWorkerThread = webrtc::Thread::Create(); mWorkerThread->SetName("WebRTCWorkerThread", nullptr); mWorkerThread->Start(); - mSignalingThread = rtc::Thread::Create(); + mSignalingThread = webrtc::Thread::Create(); mSignalingThread->SetName("WebRTCSignalingThread", nullptr); mSignalingThread->Start(); - mTuningAudioDeviceObserver = new LLAudioDeviceObserver; - mWorkerThread->PostTask( - [this]() - { - // Initialize the audio devices on the Worker Thread - mTuningDeviceModule = - webrtc::CreateAudioDeviceWithDataObserver(webrtc::AudioDeviceModule::AudioLayer::kPlatformDefaultAudio, - mTaskQueueFactory.get(), - std::unique_ptr(mTuningAudioDeviceObserver)); - - mTuningDeviceModule->Init(); - mTuningDeviceModule->SetPlayoutDevice(mPlayoutDevice); - mTuningDeviceModule->SetRecordingDevice(mRecordingDevice); - mTuningDeviceModule->EnableBuiltInAEC(false); - mTuningDeviceModule->SetAudioDeviceSink(this); - mTuningDeviceModule->InitMicrophone(); - mTuningDeviceModule->InitSpeaker(); - mTuningDeviceModule->SetStereoRecording(false); - mTuningDeviceModule->SetStereoPlayout(true); - mTuningDeviceModule->InitRecording(); - mTuningDeviceModule->InitPlayout(); - updateDevices(); - }); - mWorkerThread->BlockingCall( [this]() { - // the peer device module doesn't need an observer - // as we pull peer data after audio processing. - mPeerDeviceModule = webrtc::CreateAudioDeviceWithDataObserver(webrtc::AudioDeviceModule::AudioLayer::kPlatformDefaultAudio, - mTaskQueueFactory.get(), - nullptr); - mPeerDeviceModule->Init(); - mPeerDeviceModule->SetPlayoutDevice(mPlayoutDevice); - mPeerDeviceModule->SetRecordingDevice(mRecordingDevice); - mPeerDeviceModule->EnableBuiltInAEC(false); - mPeerDeviceModule->InitMicrophone(); - mPeerDeviceModule->InitSpeaker(); + webrtc::scoped_refptr realADM = + webrtc::AudioDeviceModule::Create(webrtc::AudioDeviceModule::AudioLayer::kPlatformDefaultAudio, mTaskQueueFactory.get()); + mDeviceModule = webrtc::make_ref_counted(realADM); + mDeviceModule->SetObserver(this); }); // The custom processor allows us to retrieve audio data (and levels) // from after other audio processing such as AEC, AGC, etc. - mPeerCustomProcessor = new LLCustomProcessor; - webrtc::AudioProcessingBuilder apb; - apb.SetCapturePostProcessing(std::unique_ptr(mPeerCustomProcessor)); - mAudioProcessingModule = apb.Create(); + mPeerCustomProcessor = std::make_shared(); + webrtc::BuiltinAudioProcessingBuilder apb; + apb.SetCapturePostProcessing(std::make_unique(mPeerCustomProcessor)); + mAudioProcessingModule = apb.Build(webrtc::CreateEnvironment()); webrtc::AudioProcessing::Config apm_config; apm_config.echo_canceller.enabled = false; apm_config.echo_canceller.mobile_mode = false; apm_config.gain_controller1.enabled = false; - apm_config.gain_controller1.mode = webrtc::AudioProcessing::Config::GainController1::kAdaptiveAnalog; - apm_config.gain_controller2.enabled = false; + apm_config.gain_controller2.enabled = true; apm_config.high_pass_filter.enabled = true; apm_config.noise_suppression.enabled = true; apm_config.noise_suppression.level = webrtc::AudioProcessing::Config::NoiseSuppression::kVeryHigh; @@ -252,6 +317,7 @@ void LLWebRTCImpl::init() mAudioProcessingModule->ApplyConfig(apm_config); webrtc::ProcessingConfig processing_config; + processing_config.input_stream().set_num_channels(2); processing_config.input_stream().set_sample_rate_hz(48000); processing_config.output_stream().set_num_channels(2); @@ -266,13 +332,19 @@ void LLWebRTCImpl::init() mPeerConnectionFactory = webrtc::CreatePeerConnectionFactory(mNetworkThread.get(), mWorkerThread.get(), mSignalingThread.get(), - mPeerDeviceModule, + mDeviceModule, webrtc::CreateBuiltinAudioEncoderFactory(), webrtc::CreateBuiltinAudioDecoderFactory(), nullptr /* video_encoder_factory */, nullptr /* video_decoder_factory */, nullptr /* audio_mixer */, mAudioProcessingModule); + mWorkerThread->PostTask( + [this]() + { + mDeviceModule->EnableBuiltInAEC(false); + updateDevices(); + }); } @@ -294,64 +366,16 @@ void LLWebRTCImpl::terminate() mWorkerThread->BlockingCall( [this]() { - if (mTuningDeviceModule) - { - mTuningDeviceModule->StopRecording(); - mTuningDeviceModule->Terminate(); - } - if (mPeerDeviceModule) + if (mDeviceModule) { - mPeerDeviceModule->StopRecording(); - mPeerDeviceModule->Terminate(); - } - mTuningDeviceModule = nullptr; - mPeerDeviceModule = nullptr; - mTaskQueueFactory = nullptr; - }); - rtc::LogMessage::RemoveLogToStream(mLogSink); -} - -// -// Devices functions -// -// Most device-related functionality needs to happen -// on the worker thread (the audio thread,) so those calls will be -// proxied over to that thread. -// -void LLWebRTCImpl::setRecording(bool recording) -{ - mWorkerThread->PostTask( - [this, recording]() - { - if (recording) - { - mPeerDeviceModule->SetStereoRecording(false); - mPeerDeviceModule->InitRecording(); - mPeerDeviceModule->StartRecording(); - } - else - { - mPeerDeviceModule->StopRecording(); - } - }); -} - -void LLWebRTCImpl::setPlayout(bool playing) -{ - mWorkerThread->PostTask( - [this, playing]() - { - if (playing) - { - mPeerDeviceModule->SetStereoPlayout(true); - mPeerDeviceModule->InitPlayout(); - mPeerDeviceModule->StartPlayout(); - } - else - { - mPeerDeviceModule->StopPlayout(); + mDeviceModule->StopRecording(); + mDeviceModule->StopPlayout(); + mDeviceModule->Terminate(); } + mDeviceModule = nullptr; + mTaskQueueFactory = nullptr; }); + webrtc::LogMessage::RemoveLogToStream(mLogSink); } void LLWebRTCImpl::setAudioConfig(LLWebRTCDeviceInterface::AudioConfig config) @@ -359,9 +383,9 @@ void LLWebRTCImpl::setAudioConfig(LLWebRTCDeviceInterface::AudioConfig config) webrtc::AudioProcessing::Config apm_config; apm_config.echo_canceller.enabled = config.mEchoCancellation; apm_config.echo_canceller.mobile_mode = false; - apm_config.gain_controller1.enabled = config.mAGC; - apm_config.gain_controller1.mode = webrtc::AudioProcessing::Config::GainController1::kAdaptiveAnalog; - apm_config.gain_controller2.enabled = false; + apm_config.gain_controller1.enabled = false; + apm_config.gain_controller2.enabled = config.mAGC; + apm_config.gain_controller2.adaptive_digital.enabled = true; // auto-level speech apm_config.high_pass_filter.enabled = true; apm_config.transient_suppression.enabled = true; apm_config.pipeline.multi_channel_render = true; @@ -414,142 +438,134 @@ void LLWebRTCImpl::unsetDevicesObserver(LLWebRTCDevicesObserver *observer) } } -void ll_set_device_module_capture_device(rtc::scoped_refptr device_module, int16_t device) +// must be run in the worker thread. +void LLWebRTCImpl::workerDeployDevices() { + int16_t recordingDevice = RECORD_DEVICE_DEFAULT; #if WEBRTC_WIN - if (device < 0) - { - device_module->SetRecordingDevice(webrtc::AudioDeviceModule::kDefaultDevice); - } - else - { - device_module->SetRecordingDevice(device); - } + int16_t recording_device_start = 0; #else - // passed in default is -1, but the device list - // has it at 0 - device_module->SetRecordingDevice(device + 1); + int16_t recording_device_start = 1; #endif - device_module->InitMicrophone(); -} -void LLWebRTCImpl::setCaptureDevice(const std::string &id) -{ - int16_t recordingDevice = RECORD_DEVICE_DEFAULT; - if (id != "Default") + if (mRecordingDevice != "Default") { - for (int16_t i = 0; i < mRecordingDeviceList.size(); i++) + for (int16_t i = recording_device_start; i < mRecordingDeviceList.size(); i++) { - if (mRecordingDeviceList[i].mID == id) + if (mRecordingDeviceList[i].mID == mRecordingDevice) { recordingDevice = i; break; } } } - if (recordingDevice == mRecordingDevice) - { - return; - } - mRecordingDevice = recordingDevice; - if (mTuningMode) - { - mWorkerThread->PostTask([this, recordingDevice]() - { - ll_set_device_module_capture_device(mTuningDeviceModule, recordingDevice); - }); - } - else - { - mWorkerThread->PostTask([this, recordingDevice]() - { - bool recording = mPeerDeviceModule->Recording(); - if (recording) - { - mPeerDeviceModule->StopRecording(); - } - ll_set_device_module_capture_device(mPeerDeviceModule, recordingDevice); - if (recording) - { - mPeerDeviceModule->SetStereoRecording(false); - mPeerDeviceModule->InitRecording(); - mPeerDeviceModule->StartRecording(); - } - }); - } -} - -void ll_set_device_module_render_device(rtc::scoped_refptr device_module, int16_t device) -{ + mDeviceModule->StopPlayout(); + mDeviceModule->ForceStopRecording(); #if WEBRTC_WIN - if (device < 0) + if (recordingDevice < 0) { - device_module->SetPlayoutDevice(webrtc::AudioDeviceModule::kDefaultDevice); + mDeviceModule->SetRecordingDevice((webrtc::AudioDeviceModule::WindowsDeviceType)recordingDevice); } else { - device_module->SetPlayoutDevice(device); + mDeviceModule->SetRecordingDevice(recordingDevice); } #else - device_module->SetPlayoutDevice(device + 1); + mDeviceModule->SetRecordingDevice(recordingDevice); #endif - device_module->InitSpeaker(); -} + mDeviceModule->InitMicrophone(); + mDeviceModule->SetStereoRecording(false); + mDeviceModule->InitRecording(); -void LLWebRTCImpl::setRenderDevice(const std::string &id) -{ int16_t playoutDevice = PLAYOUT_DEVICE_DEFAULT; - if (id != "Default") +#if WEBRTC_WIN + int16_t playout_device_start = 0; +#else + int16_t playout_device_start = 1; +#endif + if (mPlayoutDevice != "Default") { - for (int16_t i = 0; i < mPlayoutDeviceList.size(); i++) + for (int16_t i = playout_device_start; i < mPlayoutDeviceList.size(); i++) { - if (mPlayoutDeviceList[i].mID == id) + if (mPlayoutDeviceList[i].mID == mPlayoutDevice) { playoutDevice = i; break; } } } - if (playoutDevice == mPlayoutDevice) + +#if WEBRTC_WIN + if (playoutDevice < 0) { - return; + mDeviceModule->SetPlayoutDevice((webrtc::AudioDeviceModule::WindowsDeviceType)playoutDevice); + } + else + { + mDeviceModule->SetPlayoutDevice(playoutDevice); } - mPlayoutDevice = playoutDevice; +#else + mDeviceModule->SetPlayoutDevice(playoutDevice); +#endif + mDeviceModule->InitSpeaker(); + mDeviceModule->SetStereoPlayout(true); + mDeviceModule->InitPlayout(); - if (mTuningMode) + if ((!mMute && mPeerConnections.size()) || mTuningMode) { - mWorkerThread->PostTask( - [this, playoutDevice]() - { - ll_set_device_module_render_device(mTuningDeviceModule, playoutDevice); - }); + mDeviceModule->ForceStartRecording(); } - else + + if (!mTuningMode) { - mWorkerThread->PostTask( - [this, playoutDevice]() + mDeviceModule->StartPlayout(); + } + mSignalingThread->PostTask( + [this] + { + for (auto& connection : mPeerConnections) { - bool playing = mPeerDeviceModule->Playing(); - if (playing) + if (mTuningMode) { - mPeerDeviceModule->StopPlayout(); + connection->enableSenderTracks(false); } - ll_set_device_module_render_device(mPeerDeviceModule, playoutDevice); - if (playing) + else { - mPeerDeviceModule->SetStereoPlayout(true); - mPeerDeviceModule->InitPlayout(); - mPeerDeviceModule->StartPlayout(); + connection->resetMute(); } - }); + connection->enableReceiverTracks(!mTuningMode); + } + if (1 < mDevicesDeploying.fetch_sub(1, std::memory_order_relaxed)) + { + mWorkerThread->PostTask([this] { workerDeployDevices(); }); + } + }); +} + +void LLWebRTCImpl::setCaptureDevice(const std::string &id) +{ + + if (mRecordingDevice != id) + { + mRecordingDevice = id; + deployDevices(); + } +} + +void LLWebRTCImpl::setRenderDevice(const std::string &id) +{ + if (mPlayoutDevice != id) + { + mPlayoutDevice = id; + deployDevices(); } } // updateDevices needs to happen on the worker thread. void LLWebRTCImpl::updateDevices() { - int16_t renderDeviceCount = mTuningDeviceModule->PlayoutDevices(); + int16_t renderDeviceCount = mDeviceModule->PlayoutDevices(); mPlayoutDeviceList.clear(); #if WEBRTC_WIN @@ -563,11 +579,11 @@ void LLWebRTCImpl::updateDevices() { char name[webrtc::kAdmMaxDeviceNameSize]; char guid[webrtc::kAdmMaxGuidSize]; - mTuningDeviceModule->PlayoutDeviceName(index, name, guid); + mDeviceModule->PlayoutDeviceName(index, name, guid); mPlayoutDeviceList.emplace_back(name, guid); } - int16_t captureDeviceCount = mTuningDeviceModule->RecordingDevices(); + int16_t captureDeviceCount = mDeviceModule->RecordingDevices(); mRecordingDeviceList.clear(); #if WEBRTC_WIN @@ -581,7 +597,7 @@ void LLWebRTCImpl::updateDevices() { char name[webrtc::kAdmMaxDeviceNameSize]; char guid[webrtc::kAdmMaxGuidSize]; - mTuningDeviceModule->RecordingDeviceName(index, name, guid); + mDeviceModule->RecordingDeviceName(index, name, guid); mRecordingDeviceList.emplace_back(name, guid); } @@ -593,11 +609,7 @@ void LLWebRTCImpl::updateDevices() void LLWebRTCImpl::OnDevicesUpdated() { - // reset these to a bad value so an update is forced - mRecordingDevice = RECORD_DEVICE_BAD; - mPlayoutDevice = PLAYOUT_DEVICE_BAD; - - updateDevices(); + deployDevices(); } @@ -605,60 +617,109 @@ void LLWebRTCImpl::setTuningMode(bool enable) { mTuningMode = enable; mWorkerThread->PostTask( - [this, enable] { - if (enable) - { - mPeerDeviceModule->StopRecording(); - mPeerDeviceModule->StopPlayout(); - ll_set_device_module_render_device(mTuningDeviceModule, mPlayoutDevice); - ll_set_device_module_capture_device(mTuningDeviceModule, mRecordingDevice); - mTuningDeviceModule->InitPlayout(); - mTuningDeviceModule->InitRecording(); - mTuningDeviceModule->StartRecording(); - // TODO: Starting Playout on the TDM appears to create an audio artifact (click) - // in this case, so disabling it for now. We may have to do something different - // if we enable 'echo playback' via the TDM when tuning. - //mTuningDeviceModule->StartPlayout(); - } - else - { - mTuningDeviceModule->StopRecording(); - //mTuningDeviceModule->StopPlayout(); - ll_set_device_module_render_device(mPeerDeviceModule, mPlayoutDevice); - ll_set_device_module_capture_device(mPeerDeviceModule, mRecordingDevice); - mPeerDeviceModule->SetStereoPlayout(true); - mPeerDeviceModule->SetStereoRecording(false); - mPeerDeviceModule->InitPlayout(); - mPeerDeviceModule->InitRecording(); - mPeerDeviceModule->StartPlayout(); - mPeerDeviceModule->StartRecording(); - } - } - ); - mSignalingThread->PostTask( - [this, enable] + [this] { - for (auto &connection : mPeerConnections) - { - if (enable) + mDeviceModule->SetTuning(mTuningMode, mMute); + mSignalingThread->PostTask( + [this] { - connection->enableSenderTracks(false); - } - else - { - connection->resetMute(); - } - connection->enableReceiverTracks(!enable); - } + for (auto& connection : mPeerConnections) + { + if (mTuningMode) + { + connection->enableSenderTracks(false); + } + else + { + connection->resetMute(); + } + connection->enableReceiverTracks(!mTuningMode); + } + }); + }); +} + +void LLWebRTCImpl::deployDevices() +{ + if (0 < mDevicesDeploying.fetch_add(1, std::memory_order_relaxed)) + { + return; + } + mWorkerThread->PostTask( + [this] { + workerDeployDevices(); }); } -float LLWebRTCImpl::getTuningAudioLevel() { return -20 * log10f(mTuningAudioDeviceObserver->getMicrophoneEnergy()); } +float LLWebRTCImpl::getTuningAudioLevel() +{ + return mDeviceModule ? -20 * log10f(mDeviceModule->GetMicrophoneEnergy()) : std::numeric_limits::infinity(); +} -float LLWebRTCImpl::getPeerConnectionAudioLevel() { return -20 * log10f(mPeerCustomProcessor->getMicrophoneEnergy()); } +void LLWebRTCImpl::setTuningMicGain(float gain) +{ + if (mTuningMode && mDeviceModule) + { + mDeviceModule->SetTuningMicGain(gain); + } +} + +float LLWebRTCImpl::getPeerConnectionAudioLevel() +{ + return mTuningMode ? std::numeric_limits::infinity() + : (mPeerCustomProcessor ? -20 * log10f(mPeerCustomProcessor->getMicrophoneEnergy()) + : std::numeric_limits::infinity()); +} -void LLWebRTCImpl::setPeerConnectionGain(float gain) { mPeerCustomProcessor->setGain(gain); } +void LLWebRTCImpl::setMicGain(float gain) +{ + mGain = gain; + if (!mTuningMode && mPeerCustomProcessor) + { + mPeerCustomProcessor->setGain(gain); + } +} +void LLWebRTCImpl::setMute(bool mute, int delay_ms) +{ + if (mMute != mute) + { + mMute = mute; + intSetMute(mute, delay_ms); + } +} + +void LLWebRTCImpl::intSetMute(bool mute, int delay_ms) +{ + if (mPeerCustomProcessor) + { + mPeerCustomProcessor->setGain(mMute ? 0.0f : mGain); + } + if (mMute) + { + mWorkerThread->PostDelayedTask( + [this] + { + if (mDeviceModule) + { + mDeviceModule->ForceStopRecording(); + } + }, + webrtc::TimeDelta::Millis(delay_ms)); + } + else + { + mWorkerThread->PostTask( + [this] + { + if (mDeviceModule) + { + mDeviceModule->InitRecording(); + mDeviceModule->ForceStartRecording(); + } + }); + } +} // // Peer Connection Helpers @@ -666,34 +727,31 @@ void LLWebRTCImpl::setPeerConnectionGain(float gain) { mPeerCustomProcessor->set LLWebRTCPeerConnectionInterface *LLWebRTCImpl::newPeerConnection() { - rtc::scoped_refptr peerConnection = rtc::scoped_refptr(new rtc::RefCountedObject()); + bool empty = mPeerConnections.empty(); + webrtc::scoped_refptr peerConnection = webrtc::scoped_refptr(new webrtc::RefCountedObject()); peerConnection->init(this); - - mPeerConnections.emplace_back(peerConnection); - // Should it really start disabled? - // Seems like something doesn't get the memo and senders need to be reset later - // to remove the voice indicator from taskbar - peerConnection->enableSenderTracks(false); if (mPeerConnections.empty()) { - setRecording(true); - setPlayout(true); + intSetMute(mMute); } + mPeerConnections.emplace_back(peerConnection); + + peerConnection->enableSenderTracks(false); + peerConnection->resetMute(); return peerConnection.get(); } void LLWebRTCImpl::freePeerConnection(LLWebRTCPeerConnectionInterface* peer_connection) { - std::vector>::iterator it = + std::vector>::iterator it = std::find(mPeerConnections.begin(), mPeerConnections.end(), peer_connection); if (it != mPeerConnections.end()) { mPeerConnections.erase(it); - } - if (mPeerConnections.empty()) - { - setRecording(false); - setPlayout(false); + if (mPeerConnections.empty()) + { + intSetMute(true); + } } } @@ -729,7 +787,7 @@ void LLWebRTCPeerConnectionImpl::init(LLWebRTCImpl * webrtc_impl) } void LLWebRTCPeerConnectionImpl::terminate() { - mWebRTCImpl->SignalingBlockingCall( + mWebRTCImpl->PostSignalingTask( [this]() { if (mPeerConnection) @@ -753,7 +811,6 @@ void LLWebRTCPeerConnectionImpl::terminate() track->set_enabled(false); } } - mPeerConnection->SetAudioRecording(false); mPeerConnection->Close(); if (mLocalStream) @@ -840,7 +897,7 @@ bool LLWebRTCPeerConnectionImpl::initializeConnection(const LLWebRTCPeerConnecti mDataChannel->RegisterObserver(this); } - cricket::AudioOptions audioOptions; + webrtc::AudioOptions audioOptions; audioOptions.auto_gain_control = true; audioOptions.echo_cancellation = true; audioOptions.noise_suppression = true; @@ -848,7 +905,7 @@ bool LLWebRTCPeerConnectionImpl::initializeConnection(const LLWebRTCPeerConnecti mLocalStream = mPeerConnectionFactory->CreateLocalMediaStream("SLStream"); - rtc::scoped_refptr audio_track( + webrtc::scoped_refptr audio_track( mPeerConnectionFactory->CreateAudioTrack("SLAudio", mPeerConnectionFactory->CreateAudioSource(audioOptions).get())); audio_track->set_enabled(false); mLocalStream->AddTrack(audio_track); @@ -862,7 +919,7 @@ bool LLWebRTCPeerConnectionImpl::initializeConnection(const LLWebRTCPeerConnecti webrtc::RtpParameters params; webrtc::RtpCodecParameters codecparam; codecparam.name = "opus"; - codecparam.kind = cricket::MEDIA_TYPE_AUDIO; + codecparam.kind = webrtc::MediaType::AUDIO; codecparam.clock_rate = 48000; codecparam.num_channels = 2; codecparam.parameters["stereo"] = "1"; @@ -877,7 +934,7 @@ bool LLWebRTCPeerConnectionImpl::initializeConnection(const LLWebRTCPeerConnecti webrtc::RtpParameters params; webrtc::RtpCodecParameters codecparam; codecparam.name = "opus"; - codecparam.kind = cricket::MEDIA_TYPE_AUDIO; + codecparam.kind = webrtc::MediaType::AUDIO; codecparam.clock_rate = 48000; codecparam.num_channels = 2; codecparam.parameters["stereo"] = "1"; @@ -904,7 +961,6 @@ void LLWebRTCPeerConnectionImpl::enableSenderTracks(bool enable) // set_enabled shouldn't be done on the worker thread. if (mPeerConnection) { - mPeerConnection->SetAudioRecording(enable); auto senders = mPeerConnection->GetSenders(); for (auto &sender : senders) { @@ -938,7 +994,7 @@ void LLWebRTCPeerConnectionImpl::AnswerAvailable(const std::string &sdp) { RTC_LOG(LS_INFO) << __FUNCTION__ << " " << mPeerConnection->peer_connection_state(); mPeerConnection->SetRemoteDescription(webrtc::CreateSessionDescription(webrtc::SdpType::kAnswer, sdp), - rtc::scoped_refptr(this)); + webrtc::scoped_refptr(this)); } }); } @@ -951,22 +1007,22 @@ void LLWebRTCPeerConnectionImpl::AnswerAvailable(const std::string &sdp) void LLWebRTCPeerConnectionImpl::setMute(bool mute) { EMicMuteState new_state = mute ? MUTE_MUTED : MUTE_UNMUTED; - if (new_state == mMute) - { - return; // no change - } + + // even if mute hasn't changed, we still need to update the mute + // state on the connections to handle cases where the 'Default' device + // has changed in the OS (unplugged headset, etc.) which messes + // with the mute state. + bool force_reset = mMute == MUTE_INITIAL && mute; bool enable = !mute; mMute = new_state; + mWebRTCImpl->PostSignalingTask( [this, force_reset, enable]() { if (mPeerConnection) { - // SetAudioRecording must be called before enabling/disabling tracks. - mPeerConnection->SetAudioRecording(enable); - auto senders = mPeerConnection->GetSenders(); RTC_LOG(LS_INFO) << __FUNCTION__ << (mMute ? "disabling" : "enabling") << " streams count " << senders.size(); @@ -1046,14 +1102,14 @@ void LLWebRTCPeerConnectionImpl::setSendVolume(float volume) // PeerConnectionObserver implementation. // -void LLWebRTCPeerConnectionImpl::OnAddTrack(rtc::scoped_refptr receiver, - const std::vector> &streams) +void LLWebRTCPeerConnectionImpl::OnAddTrack(webrtc::scoped_refptr receiver, + const std::vector> &streams) { RTC_LOG(LS_INFO) << __FUNCTION__ << " " << receiver->id(); webrtc::RtpParameters params; webrtc::RtpCodecParameters codecparam; codecparam.name = "opus"; - codecparam.kind = cricket::MEDIA_TYPE_AUDIO; + codecparam.kind = webrtc::MediaType::AUDIO; codecparam.clock_rate = 48000; codecparam.num_channels = 2; codecparam.parameters["stereo"] = "1"; @@ -1062,12 +1118,12 @@ void LLWebRTCPeerConnectionImpl::OnAddTrack(rtc::scoped_refptrSetParameters(params); } -void LLWebRTCPeerConnectionImpl::OnRemoveTrack(rtc::scoped_refptr receiver) +void LLWebRTCPeerConnectionImpl::OnRemoveTrack(webrtc::scoped_refptr receiver) { RTC_LOG(LS_INFO) << __FUNCTION__ << " " << receiver->id(); } -void LLWebRTCPeerConnectionImpl::OnDataChannel(rtc::scoped_refptr channel) +void LLWebRTCPeerConnectionImpl::OnDataChannel(webrtc::scoped_refptr channel) { if (mDataChannel) { @@ -1154,23 +1210,23 @@ static std::string iceCandidateToTrickleString(const webrtc::IceCandidateInterfa candidate->candidate().address().ipaddr().ToString() << " " << candidate->candidate().address().PortAsString() << " typ "; - if (candidate->candidate().type() == cricket::LOCAL_PORT_TYPE) + if (candidate->candidate().type() == webrtc::IceCandidateType::kHost) { candidate_stream << "host"; } - else if (candidate->candidate().type() == cricket::STUN_PORT_TYPE) + else if (candidate->candidate().type() == webrtc::IceCandidateType::kSrflx) { candidate_stream << "srflx " << "raddr " << candidate->candidate().related_address().ipaddr().ToString() << " " << "rport " << candidate->candidate().related_address().PortAsString(); } - else if (candidate->candidate().type() == cricket::RELAY_PORT_TYPE) + else if (candidate->candidate().type() == webrtc::IceCandidateType::kRelay) { candidate_stream << "relay " << "raddr " << candidate->candidate().related_address().ipaddr().ToString() << " " << "rport " << candidate->candidate().related_address().PortAsString(); } - else if (candidate->candidate().type() == cricket::PRFLX_PORT_TYPE) + else if (candidate->candidate().type() == webrtc::IceCandidateType::kPrflx) { candidate_stream << "prflx " << "raddr " << candidate->candidate().related_address().ipaddr().ToString() << " " << @@ -1265,7 +1321,7 @@ void LLWebRTCPeerConnectionImpl::OnSuccess(webrtc::SessionDescriptionInterface * mPeerConnection->SetLocalDescription(std::unique_ptr( webrtc::CreateSessionDescription(webrtc::SdpType::kOffer, mangled_sdp)), - rtc::scoped_refptr(this)); + webrtc::scoped_refptr(this)); } @@ -1375,7 +1431,7 @@ void LLWebRTCPeerConnectionImpl::sendData(const std::string& data, bool binary) { if (mDataChannel) { - rtc::CopyOnWriteBuffer cowBuffer(data.data(), data.length()); + webrtc::CopyOnWriteBuffer cowBuffer(data.data(), data.length()); webrtc::DataBuffer buffer(cowBuffer, binary); mWebRTCImpl->PostNetworkTask([this, buffer]() { if (mDataChannel) diff --git a/indra/llwebrtc/llwebrtc.h b/indra/llwebrtc/llwebrtc.h index c6fdb909dd..7d06b7d2b4 100644 --- a/indra/llwebrtc/llwebrtc.h +++ b/indra/llwebrtc/llwebrtc.h @@ -159,7 +159,10 @@ class LLWebRTCDeviceInterface virtual void setTuningMode(bool enable) = 0; virtual float getTuningAudioLevel() = 0; // for use during tuning virtual float getPeerConnectionAudioLevel() = 0; // for use when not tuning - virtual void setPeerConnectionGain(float gain) = 0; + virtual void setMicGain(float gain) = 0; + virtual void setTuningMicGain(float gain) = 0; + + virtual void setMute(bool mute, int delay_ms = 0) = 0; }; // LLWebRTCAudioInterface provides the viewer with a way diff --git a/indra/llwebrtc/llwebrtc_impl.h b/indra/llwebrtc/llwebrtc_impl.h index b6294dbd4a..51d42c82b2 100644 --- a/indra/llwebrtc/llwebrtc_impl.h +++ b/indra/llwebrtc/llwebrtc_impl.h @@ -54,12 +54,12 @@ #include "rtc_base/ref_counted_object.h" #include "rtc_base/ssl_adapter.h" #include "rtc_base/thread.h" +#include "rtc_base/logging.h" #include "api/peer_connection_interface.h" #include "api/media_stream_interface.h" #include "api/create_peerconnection_factory.h" #include "modules/audio_device/include/audio_device.h" #include "modules/audio_device/include/audio_device_data_observer.h" -#include "rtc_base/task_queue.h" #include "api/task_queue/task_queue_factory.h" #include "api/task_queue/default_task_queue_factory.h" #include "modules/audio_device/include/audio_device_defines.h" @@ -69,35 +69,30 @@ namespace llwebrtc class LLWebRTCPeerConnectionImpl; -class LLWebRTCLogSink : public rtc::LogSink { +class LLWebRTCLogSink : public webrtc::LogSink +{ public: - LLWebRTCLogSink(LLWebRTCLogCallback* callback) : - mCallback(callback) - { - } + LLWebRTCLogSink(LLWebRTCLogCallback* callback) : mCallback(callback) {} // Destructor: close the log file - ~LLWebRTCLogSink() override - { - } + ~LLWebRTCLogSink() override {} - void OnLogMessage(const std::string& msg, - rtc::LoggingSeverity severity) override + void OnLogMessage(const std::string& msg, webrtc::LoggingSeverity severity) override { if (mCallback) { - switch(severity) + switch (severity) { - case rtc::LS_VERBOSE: + case webrtc::LS_VERBOSE: mCallback->LogMessage(LLWebRTCLogCallback::LOG_LEVEL_VERBOSE, msg); break; - case rtc::LS_INFO: + case webrtc::LS_INFO: mCallback->LogMessage(LLWebRTCLogCallback::LOG_LEVEL_VERBOSE, msg); break; - case rtc::LS_WARNING: + case webrtc::LS_WARNING: mCallback->LogMessage(LLWebRTCLogCallback::LOG_LEVEL_VERBOSE, msg); break; - case rtc::LS_ERROR: + case webrtc::LS_ERROR: mCallback->LogMessage(LLWebRTCLogCallback::LOG_LEVEL_VERBOSE, msg); break; default: @@ -118,73 +113,307 @@ private: LLWebRTCLogCallback* mCallback; }; -// Implements a class allowing capture of audio data -// to determine audio level of the microphone. -class LLAudioDeviceObserver : public webrtc::AudioDeviceDataObserver +// ----------------------------------------------------------------------------- +// A proxy transport that forwards capture data to two AudioTransport sinks: +// - the "engine" (libwebrtc's VoiceEngine) +// - the "user" (your app's listener) +// +// Playout (NeedMorePlayData) goes only to the engine by default to avoid +// double-writing into the output buffer. See notes below if you want a tap. +// ----------------------------------------------------------------------------- +class LLWebRTCAudioTransport : public webrtc::AudioTransport { - public: - LLAudioDeviceObserver(); - - // Retrieve the RMS audio loudness - float getMicrophoneEnergy(); - - // Data retrieved from the caputure device is - // passed in here for processing. - void OnCaptureData(const void *audio_samples, - const size_t num_samples, - const size_t bytes_per_sample, - const size_t num_channels, - const uint32_t samples_per_sec) override; - - // This is for data destined for the render device. - // not currently used. - void OnRenderData(const void *audio_samples, - const size_t num_samples, - const size_t bytes_per_sample, - const size_t num_channels, - const uint32_t samples_per_sec) override; +public: + LLWebRTCAudioTransport(); + + void SetEngineTransport(webrtc::AudioTransport* t); + + // -------- Capture path: fan out to both sinks -------- + int32_t RecordedDataIsAvailable(const void* audio_data, + size_t number_of_samples, + size_t bytes_per_sample, + size_t number_of_channels, + uint32_t samples_per_sec, + uint32_t total_delay_ms, + int32_t clock_drift, + uint32_t current_mic_level, + bool key_pressed, + uint32_t& new_mic_level) override; + + // -------- Playout path: delegate to engine only -------- + int32_t NeedMorePlayData(size_t number_of_samples, + size_t bytes_per_sample, + size_t number_of_channels, + uint32_t samples_per_sec, + void* audio_data, + size_t& number_of_samples_out, + int64_t* elapsed_time_ms, + int64_t* ntp_time_ms) override; + + // Method to pull mixed render audio data from all active VoE channels. + // The data will not be passed as reference for audio processing internally. + void PullRenderData(int bits_per_sample, + int sample_rate, + size_t number_of_channels, + size_t number_of_frames, + void* audio_data, + int64_t* elapsed_time_ms, + int64_t* ntp_time_ms) override; + + float GetMicrophoneEnergy() { return mMicrophoneEnergy.load(std::memory_order_relaxed); } + void SetGain(float gain) { mGain.store(gain, std::memory_order_relaxed); } + +private: + std::atomic engine_{ nullptr }; + static const int NUM_PACKETS_TO_FILTER = 30; // 300 ms of smoothing (30 frames) + float mSumVector[NUM_PACKETS_TO_FILTER]; + std::atomic mMicrophoneEnergy; + std::atomic mGain{ 0.0f }; - protected: - static const int NUM_PACKETS_TO_FILTER = 30; // 300 ms of smoothing (30 frames) - float mSumVector[NUM_PACKETS_TO_FILTER]; - float mMicrophoneEnergy; }; + +// ----------------------------------------------------------------------------- +// LLWebRTCAudioDeviceModule +// - Wraps a real ADM to provide microphone energy for tuning +// ----------------------------------------------------------------------------- +class LLWebRTCAudioDeviceModule : public webrtc::AudioDeviceModule +{ +public: + explicit LLWebRTCAudioDeviceModule(webrtc::scoped_refptr inner) : inner_(std::move(inner)), tuning_(false) + { + RTC_CHECK(inner_); + } + + // ----- AudioDeviceModule interface: we mostly forward to |inner_| ----- + int32_t ActiveAudioLayer(AudioLayer* audioLayer) const override { return inner_->ActiveAudioLayer(audioLayer); } + + int32_t RegisterAudioCallback(webrtc::AudioTransport* engine_transport) override + { + // The engine registers its transport here. We put our audio transport between engine and ADM. + audio_transport_.SetEngineTransport(engine_transport); + // Register our proxy with the real ADM. + return inner_->RegisterAudioCallback(&audio_transport_); + } + + int32_t Init() override { return inner_->Init(); } + int32_t Terminate() override { return inner_->Terminate(); } + bool Initialized() const override { return inner_->Initialized(); } + + // --- Device enumeration/selection (forward) --- + int16_t PlayoutDevices() override { return inner_->PlayoutDevices(); } + int16_t RecordingDevices() override { return inner_->RecordingDevices(); } + int32_t PlayoutDeviceName(uint16_t index, char name[webrtc::kAdmMaxDeviceNameSize], char guid[webrtc::kAdmMaxGuidSize]) override + { + return inner_->PlayoutDeviceName(index, name, guid); + } + int32_t RecordingDeviceName(uint16_t index, char name[webrtc::kAdmMaxDeviceNameSize], char guid[webrtc::kAdmMaxGuidSize]) override + { + return inner_->RecordingDeviceName(index, name, guid); + } + int32_t SetPlayoutDevice(uint16_t index) override { return inner_->SetPlayoutDevice(index); } + int32_t SetRecordingDevice(uint16_t index) override { return inner_->SetRecordingDevice(index); } + + // Windows default/communications selectors, if your branch exposes them: + int32_t SetPlayoutDevice(WindowsDeviceType type) override { return inner_->SetPlayoutDevice(type); } + int32_t SetRecordingDevice(WindowsDeviceType type) override { return inner_->SetRecordingDevice(type); } + + // --- Init/start/stop (forward) --- + int32_t InitPlayout() override { return inner_->InitPlayout(); } + bool PlayoutIsInitialized() const override { return inner_->PlayoutIsInitialized(); } + int32_t StartPlayout() override { + if (tuning_) return 0; // For tuning, don't allow playout + return inner_->StartPlayout(); + } + int32_t StopPlayout() override { return inner_->StopPlayout(); } + bool Playing() const override { return inner_->Playing(); } + + int32_t InitRecording() override { return inner_->InitRecording(); } + bool RecordingIsInitialized() const override { return inner_->RecordingIsInitialized(); } + int32_t StartRecording() override { + // ignore start recording as webrtc.lib will + // send one when streams first connect, resulting + // in an inadvertant 'recording' when mute is on. + // We take full control of StartRecording via + // ForceStartRecording below. + return 0; + } + int32_t StopRecording() override { + if (tuning_) return 0; // if we're tuning, disregard the StopRecording we get from disabling the streams + return inner_->StopRecording(); + } + int32_t ForceStartRecording() { return inner_->StartRecording(); } + int32_t ForceStopRecording() { return inner_->StopRecording(); } + bool Recording() const override { return inner_->Recording(); } + + // --- Stereo opts (forward if available on your branch) --- + int32_t SetStereoPlayout(bool enable) override { return inner_->SetStereoPlayout(enable); } + int32_t SetStereoRecording(bool enable) override { return inner_->SetStereoRecording(enable); } + int32_t PlayoutIsAvailable(bool* available) override { return inner_->PlayoutIsAvailable(available); } + int32_t RecordingIsAvailable(bool* available) override { return inner_->RecordingIsAvailable(available); } + + // --- AGC/Volume/Mute/etc. (forward) --- + int32_t SetMicrophoneVolume(uint32_t volume) override { return inner_->SetMicrophoneVolume(volume); } + int32_t MicrophoneVolume(uint32_t* volume) const override { return inner_->MicrophoneVolume(volume); } + + // --- Speaker/Microphone init (forward) --- + int32_t InitSpeaker() override { return inner_->InitSpeaker(); } + bool SpeakerIsInitialized() const override { return inner_->SpeakerIsInitialized(); } + int32_t InitMicrophone() override { return inner_->InitMicrophone(); } + bool MicrophoneIsInitialized() const override { return inner_->MicrophoneIsInitialized(); } + + // --- Speaker Volume (forward) --- + int32_t SpeakerVolumeIsAvailable(bool* available) override { return inner_->SpeakerVolumeIsAvailable(available); } + int32_t SetSpeakerVolume(uint32_t volume) override { return inner_->SetSpeakerVolume(volume); } + int32_t SpeakerVolume(uint32_t* volume) const override { return inner_->SpeakerVolume(volume); } + int32_t MaxSpeakerVolume(uint32_t* maxVolume) const override { return inner_->MaxSpeakerVolume(maxVolume); } + int32_t MinSpeakerVolume(uint32_t* minVolume) const override { return inner_->MinSpeakerVolume(minVolume); } + + // --- Microphone Volume (forward) --- + int32_t MicrophoneVolumeIsAvailable(bool* available) override { return inner_->MicrophoneVolumeIsAvailable(available); } + int32_t MaxMicrophoneVolume(uint32_t* maxVolume) const override { return inner_->MaxMicrophoneVolume(maxVolume); } + int32_t MinMicrophoneVolume(uint32_t* minVolume) const override { return inner_->MinMicrophoneVolume(minVolume); } + + // --- Speaker Mute (forward) --- + int32_t SpeakerMuteIsAvailable(bool* available) override { return inner_->SpeakerMuteIsAvailable(available); } + int32_t SetSpeakerMute(bool enable) override { return inner_->SetSpeakerMute(enable); } + int32_t SpeakerMute(bool* enabled) const override { return inner_->SpeakerMute(enabled); } + + // --- Microphone Mute (forward) --- + int32_t MicrophoneMuteIsAvailable(bool* available) override { return inner_->MicrophoneMuteIsAvailable(available); } + int32_t SetMicrophoneMute(bool enable) override { return inner_->SetMicrophoneMute(enable); } + int32_t MicrophoneMute(bool* enabled) const override { return inner_->MicrophoneMute(enabled); } + + // --- Stereo Support (forward) --- + int32_t StereoPlayoutIsAvailable(bool* available) const override { return inner_->StereoPlayoutIsAvailable(available); } + int32_t StereoPlayout(bool* enabled) const override { return inner_->StereoPlayout(enabled); } + int32_t StereoRecordingIsAvailable(bool* available) const override { return inner_->StereoRecordingIsAvailable(available); } + int32_t StereoRecording(bool* enabled) const override { return inner_->StereoRecording(enabled); } + + // --- Delay/Timing (forward) --- + int32_t PlayoutDelay(uint16_t* delayMS) const override { return inner_->PlayoutDelay(delayMS); } + + // --- Built-in Audio Processing (forward) --- + bool BuiltInAECIsAvailable() const override { return inner_->BuiltInAECIsAvailable(); } + bool BuiltInAGCIsAvailable() const override { return inner_->BuiltInAGCIsAvailable(); } + bool BuiltInNSIsAvailable() const override { return inner_->BuiltInNSIsAvailable(); } + int32_t EnableBuiltInAEC(bool enable) override { return inner_->EnableBuiltInAEC(enable); } + int32_t EnableBuiltInAGC(bool enable) override { return inner_->EnableBuiltInAGC(enable); } + int32_t EnableBuiltInNS(bool enable) override { return inner_->EnableBuiltInNS(enable); } + + // --- Additional AudioDeviceModule methods (forward) --- + int32_t GetPlayoutUnderrunCount() const override { return inner_->GetPlayoutUnderrunCount(); } + + // Used to generate RTC stats. If not implemented, RTCAudioPlayoutStats will + // not be present in the stats. + std::optional GetStats() const override { return inner_->GetStats(); } + +// Only supported on iOS. +#if defined(WEBRTC_IOS) + virtual int GetPlayoutAudioParameters(AudioParameters* params) const override { return inner_->GetPlayoutAudioParameters(params); } + virtual int GetRecordAudioParameters(AudioParameters* params) override { return inner_->GetRecordAudioParameters(params); } +#endif // WEBRTC_IOS + + virtual int32_t GetPlayoutDevice() const override { return inner_->GetPlayoutDevice(); } + virtual int32_t GetRecordingDevice() const override { return inner_->GetRecordingDevice(); } + virtual int32_t SetObserver(webrtc::AudioDeviceObserver* observer) override { return inner_->SetObserver(observer); } + + // tuning microphone energy calculations + float GetMicrophoneEnergy() { return audio_transport_.GetMicrophoneEnergy(); } + void SetTuningMicGain(float gain) { audio_transport_.SetGain(gain); } + void SetTuning(bool tuning, bool mute) + { + tuning_ = tuning; + if (tuning) + { + inner_->InitRecording(); + inner_->StartRecording(); + inner_->StopPlayout(); + } + else + { + if (mute) + { + inner_->StopRecording(); + } + else + { + inner_->InitRecording(); + inner_->StartRecording(); + } + inner_->StartPlayout(); + } + } + +protected: + ~LLWebRTCAudioDeviceModule() override = default; + +private: + webrtc::scoped_refptr inner_; + LLWebRTCAudioTransport audio_transport_; + + bool tuning_; +}; + +class LLCustomProcessorState +{ + +public: + float getMicrophoneEnergy() { return mMicrophoneEnergy.load(std::memory_order_relaxed); } + void setMicrophoneEnergy(float energy) { mMicrophoneEnergy.store(energy, std::memory_order_relaxed); } + + void setGain(float gain) + { + mGain.store(gain, std::memory_order_relaxed); + mDirty.store(true, std::memory_order_relaxed); + } + + float getGain() { return mGain.load(std::memory_order_relaxed); } + + bool getDirty() { return mDirty.exchange(false, std::memory_order_relaxed); } + + protected: + std::atomic mDirty{ true }; + std::atomic mMicrophoneEnergy{ 0.0f }; + std::atomic mGain{ 0.0f }; +}; + +using LLCustomProcessorStatePtr = std::shared_ptr; + // Used to process/retrieve audio levels after // all of the processing (AGC, AEC, etc.) for display in-world to the user. class LLCustomProcessor : public webrtc::CustomProcessing { - public: - LLCustomProcessor(); +public: + LLCustomProcessor(LLCustomProcessorStatePtr state); ~LLCustomProcessor() override {} // (Re-) Initializes the submodule. void Initialize(int sample_rate_hz, int num_channels) override; // Analyzes the given capture or render signal. - void Process(webrtc::AudioBuffer *audio) override; + void Process(webrtc::AudioBuffer* audio) override; // Returns a string representation of the module state. std::string ToString() const override { return ""; } - float getMicrophoneEnergy() { return mMicrophoneEnergy; } - - void setGain(float gain) { mGain = gain; } - - protected: - static const int NUM_PACKETS_TO_FILTER = 30; // 300 ms of smoothing - int mSampleRateHz; - int mNumChannels; +protected: + static const int NUM_PACKETS_TO_FILTER = 30; // 300 ms of smoothing + int mSampleRateHz{ 48000 }; + int mNumChannels{ 2 }; + int mRampFrames{ 2 }; + float mCurrentGain{ 0.0f }; + float mGainStep{ 0.0f }; float mSumVector[NUM_PACKETS_TO_FILTER]; - float mMicrophoneEnergy; - float mGain; + friend LLCustomProcessorState; + LLCustomProcessorStatePtr mState; }; // Primary singleton implementation for interfacing // with the native webrtc library. -class LLWebRTCImpl : public LLWebRTCDeviceInterface, public webrtc::AudioDeviceSink +class LLWebRTCImpl : public LLWebRTCDeviceInterface, public webrtc::AudioDeviceObserver { public: LLWebRTCImpl(LLWebRTCLogCallback* logCallback); @@ -214,10 +443,15 @@ class LLWebRTCImpl : public LLWebRTCDeviceInterface, public webrtc::AudioDeviceS float getTuningAudioLevel() override; float getPeerConnectionAudioLevel() override; - void setPeerConnectionGain(float gain) override; + void setMicGain(float gain) override; + void setTuningMicGain(float gain) override; + + void setMute(bool mute, int delay_ms = 20) override; + + void intSetMute(bool mute, int delay_ms = 20); // - // AudioDeviceSink + // AudioDeviceObserver // void OnDevicesUpdated() override; @@ -246,19 +480,19 @@ class LLWebRTCImpl : public LLWebRTCDeviceInterface, public webrtc::AudioDeviceS mNetworkThread->PostTask(std::move(task), location); } - void WorkerBlockingCall(rtc::FunctionView functor, + void WorkerBlockingCall(webrtc::FunctionView functor, const webrtc::Location& location = webrtc::Location::Current()) { mWorkerThread->BlockingCall(std::move(functor), location); } - void SignalingBlockingCall(rtc::FunctionView functor, + void SignalingBlockingCall(webrtc::FunctionView functor, const webrtc::Location& location = webrtc::Location::Current()) { mSignalingThread->BlockingCall(std::move(functor), location); } - void NetworkBlockingCall(rtc::FunctionView functor, + void NetworkBlockingCall(webrtc::FunctionView functor, const webrtc::Location& location = webrtc::Location::Current()) { mNetworkThread->BlockingCall(std::move(functor), location); @@ -266,7 +500,7 @@ class LLWebRTCImpl : public LLWebRTCDeviceInterface, public webrtc::AudioDeviceS // Allows the LLWebRTCPeerConnectionImpl class to retrieve the // native webrtc PeerConnectionFactory. - rtc::scoped_refptr getPeerConnectionFactory() + webrtc::scoped_refptr getPeerConnectionFactory() { return mPeerConnectionFactory; } @@ -275,49 +509,47 @@ class LLWebRTCImpl : public LLWebRTCDeviceInterface, public webrtc::AudioDeviceS LLWebRTCPeerConnectionInterface* newPeerConnection(); void freePeerConnection(LLWebRTCPeerConnectionInterface* peer_connection); - // enables/disables capture via the capture device - void setRecording(bool recording); - - void setPlayout(bool playing); - protected: + + void workerDeployDevices(); LLWebRTCLogSink* mLogSink; // The native webrtc threads - std::unique_ptr mNetworkThread; - std::unique_ptr mWorkerThread; - std::unique_ptr mSignalingThread; + std::unique_ptr mNetworkThread; + std::unique_ptr mWorkerThread; + std::unique_ptr mSignalingThread; // The factory that allows creation of native webrtc PeerConnections. - rtc::scoped_refptr mPeerConnectionFactory; + webrtc::scoped_refptr mPeerConnectionFactory; - rtc::scoped_refptr mAudioProcessingModule; + webrtc::scoped_refptr mAudioProcessingModule; // more native webrtc stuff - std::unique_ptr mTaskQueueFactory; + std::unique_ptr mTaskQueueFactory; // Devices void updateDevices(); - rtc::scoped_refptr mTuningDeviceModule; - rtc::scoped_refptr mPeerDeviceModule; + void deployDevices(); + std::atomic mDevicesDeploying; + webrtc::scoped_refptr mDeviceModule; std::vector mVoiceDevicesObserverList; // accessors in native webrtc for devices aren't apparently implemented yet. bool mTuningMode; - int32_t mRecordingDevice; + std::string mRecordingDevice; LLWebRTCVoiceDeviceList mRecordingDeviceList; - int32_t mPlayoutDevice; + std::string mPlayoutDevice; LLWebRTCVoiceDeviceList mPlayoutDeviceList; bool mMute; + float mGain; - LLAudioDeviceObserver * mTuningAudioDeviceObserver; - LLCustomProcessor * mPeerCustomProcessor; + LLCustomProcessorStatePtr mPeerCustomProcessor; // peer connections - std::vector> mPeerConnections; + std::vector> mPeerConnections; }; @@ -342,7 +574,7 @@ class LLWebRTCPeerConnectionImpl : public LLWebRTCPeerConnectionInterface, void terminate(); virtual void AddRef() const override = 0; - virtual rtc::RefCountReleaseStatus Release() const override = 0; + virtual webrtc::RefCountReleaseStatus Release() const override = 0; // // LLWebRTCPeerConnection @@ -373,10 +605,10 @@ class LLWebRTCPeerConnectionImpl : public LLWebRTCPeerConnectionInterface, // void OnSignalingChange(webrtc::PeerConnectionInterface::SignalingState new_state) override {} - void OnAddTrack(rtc::scoped_refptr receiver, - const std::vector> &streams) override; - void OnRemoveTrack(rtc::scoped_refptr receiver) override; - void OnDataChannel(rtc::scoped_refptr channel) override; + void OnAddTrack(webrtc::scoped_refptr receiver, + const std::vector> &streams) override; + void OnRemoveTrack(webrtc::scoped_refptr receiver) override; + void OnDataChannel(webrtc::scoped_refptr channel) override; void OnRenegotiationNeeded() override {} void OnIceConnectionChange(webrtc::PeerConnectionInterface::IceConnectionState new_state) override {}; void OnIceGatheringChange(webrtc::PeerConnectionInterface::IceGatheringState new_state) override; @@ -415,7 +647,7 @@ class LLWebRTCPeerConnectionImpl : public LLWebRTCPeerConnectionInterface, LLWebRTCImpl * mWebRTCImpl; - rtc::scoped_refptr mPeerConnectionFactory; + webrtc::scoped_refptr mPeerConnectionFactory; typedef enum { MUTE_INITIAL, @@ -429,12 +661,12 @@ class LLWebRTCPeerConnectionImpl : public LLWebRTCPeerConnectionInterface, std::vector> mCachedIceCandidates; bool mAnswerReceived; - rtc::scoped_refptr mPeerConnection; - rtc::scoped_refptr mLocalStream; + webrtc::scoped_refptr mPeerConnection; + webrtc::scoped_refptr mLocalStream; // data std::vector mDataObserverList; - rtc::scoped_refptr mDataChannel; + webrtc::scoped_refptr mDataChannel; }; } diff --git a/indra/newview/llvoicewebrtc.cpp b/indra/newview/llvoicewebrtc.cpp index 34f3e22182..b26a48fd5f 100644 --- a/indra/newview/llvoicewebrtc.cpp +++ b/indra/newview/llvoicewebrtc.cpp @@ -82,9 +82,15 @@ const std::string WEBRTC_VOICE_SERVER_TYPE = "webrtc"; namespace { - const F32 MAX_AUDIO_DIST = 50.0f; - const F32 VOLUME_SCALE_WEBRTC = 0.01f; - const F32 LEVEL_SCALE_WEBRTC = 0.008f; + const F32 MAX_AUDIO_DIST = 50.0f; + const F32 VOLUME_SCALE_WEBRTC = 0.01f; + const F32 TUNING_LEVEL_SCALE = 0.01f; + const F32 TUNING_LEVEL_START_POINT = 0.8f; + const F32 LEVEL_SCALE = 0.005f; + const F32 LEVEL_START_POINT = 0.18f; + const uint32_t SET_HIDDEN_RESTORE_DELAY_MS = 200; // 200 ms to unmute again after hiding during teleport + const uint32_t MUTE_FADE_DELAY_MS = 500; // 20ms fade followed by 480ms silence gets rid of the click just after unmuting. + // This is because the buffers and processing is cleared by the silence. const F32 SPEAKING_AUDIO_LEVEL = 0.30; @@ -201,7 +207,6 @@ bool LLWebRTCVoiceClient::sShuttingDown = false; LLWebRTCVoiceClient::LLWebRTCVoiceClient() : mHidden(false), - mTuningMode(false), mTuningMicGain(0.0), mTuningSpeakerVolume(50), // Set to 50 so the user can hear themselves when he sets his mic volume mDevicesListUpdated(false), @@ -348,25 +353,45 @@ void LLWebRTCVoiceClient::updateSettings() static LLCachedControl sOutputDevice(gSavedSettings, "VoiceOutputAudioDevice"); setRenderDevice(sOutputDevice); - LL_INFOS("Voice") << "Input device: " << std::quoted(sInputDevice()) << ", output device: " << std::quoted(sOutputDevice()) << LL_ENDL; + LL_INFOS("Voice") << "Input device: " << std::quoted(sInputDevice()) << ", output device: " << std::quoted(sOutputDevice()) + << LL_ENDL; static LLCachedControl sMicLevel(gSavedSettings, "AudioLevelMic"); setMicGain(sMicLevel); llwebrtc::LLWebRTCDeviceInterface::AudioConfig config; + bool audioConfigChanged = false; + static LLCachedControl sEchoCancellation(gSavedSettings, "VoiceEchoCancellation", true); - config.mEchoCancellation = sEchoCancellation; + if (sEchoCancellation != config.mEchoCancellation) + { + config.mEchoCancellation = sEchoCancellation; + audioConfigChanged = true; + } static LLCachedControl sAGC(gSavedSettings, "VoiceAutomaticGainControl", true); - config.mAGC = sAGC; + if (sAGC != config.mAGC) + { + config.mAGC = sAGC; + audioConfigChanged = true; + } - static LLCachedControl sNoiseSuppressionLevel(gSavedSettings, + static LLCachedControl sNoiseSuppressionLevel( + gSavedSettings, "VoiceNoiseSuppressionLevel", llwebrtc::LLWebRTCDeviceInterface::AudioConfig::ENoiseSuppressionLevel::NOISE_SUPPRESSION_LEVEL_VERY_HIGH); - config.mNoiseSuppressionLevel = (llwebrtc::LLWebRTCDeviceInterface::AudioConfig::ENoiseSuppressionLevel)(U32)sNoiseSuppressionLevel; - - mWebRTCDeviceInterface->setAudioConfig(config); + auto noiseSuppressionLevel = + (llwebrtc::LLWebRTCDeviceInterface::AudioConfig::ENoiseSuppressionLevel)(U32)sNoiseSuppressionLevel; + if (noiseSuppressionLevel != config.mNoiseSuppressionLevel) + { + config.mNoiseSuppressionLevel = noiseSuppressionLevel; + audioConfigChanged = true; + } + if (audioConfigChanged) + { + mWebRTCDeviceInterface->setAudioConfig(config); + } } } @@ -695,21 +720,38 @@ void LLWebRTCVoiceClient::OnDevicesChangedImpl(const llwebrtc::LLWebRTCVoiceDevi std::string outputDevice = gSavedSettings.getString("VoiceOutputAudioDevice"); LL_DEBUGS("Voice") << "Setting devices to-input: '" << inputDevice << "' output: '" << outputDevice << "'" << LL_ENDL; - clearRenderDevices(); - for (auto &device : render_devices) + + // only set the render device if the device list has changed. + if (mRenderDevices.size() != render_devices.size() || !std::equal(mRenderDevices.begin(), + mRenderDevices.end(), + render_devices.begin(), + [](const LLVoiceDevice& a, const llwebrtc::LLWebRTCVoiceDevice& b) { + return a.display_name == b.mDisplayName && a.full_name == b.mID; })) { - addRenderDevice(LLVoiceDevice(device.mDisplayName, device.mID)); + clearRenderDevices(); + for (auto& device : render_devices) + { + addRenderDevice(LLVoiceDevice(device.mDisplayName, device.mID)); + } + setRenderDevice(outputDevice); } - setRenderDevice(outputDevice); - clearCaptureDevices(); - for (auto &device : capture_devices) + // only set the capture device if the device list has changed. + if (mCaptureDevices.size() != capture_devices.size() ||!std::equal(mCaptureDevices.begin(), + mCaptureDevices.end(), + capture_devices.begin(), + [](const LLVoiceDevice& a, const llwebrtc::LLWebRTCVoiceDevice& b) + { return a.display_name == b.mDisplayName && a.full_name == b.mID; })) { - LL_DEBUGS("Voice") << "Checking capture device:'" << device.mID << "'" << LL_ENDL; + clearCaptureDevices(); + for (auto& device : capture_devices) + { + LL_DEBUGS("Voice") << "Checking capture device:'" << device.mID << "'" << LL_ENDL; - addCaptureDevice(LLVoiceDevice(device.mDisplayName, device.mID)); + addCaptureDevice(LLVoiceDevice(device.mDisplayName, device.mID)); + } + setCaptureDevice(inputDevice); } - setCaptureDevice(inputDevice); setDevicesListUpdated(true); } @@ -762,7 +804,14 @@ bool LLWebRTCVoiceClient::inTuningMode() void LLWebRTCVoiceClient::tuningSetMicVolume(float volume) { - mTuningMicGain = volume; + if (volume != mTuningMicGain) + { + mTuningMicGain = volume; + if (mWebRTCDeviceInterface) + { + mWebRTCDeviceInterface->setTuningMicGain(volume); + } + } } void LLWebRTCVoiceClient::tuningSetSpeakerVolume(float volume) @@ -774,21 +823,10 @@ void LLWebRTCVoiceClient::tuningSetSpeakerVolume(float volume) } } -float LLWebRTCVoiceClient::getAudioLevel() -{ - if (mIsInTuningMode) - { - return (1.0f - mWebRTCDeviceInterface->getTuningAudioLevel() * LEVEL_SCALE_WEBRTC) * mTuningMicGain / 2.1f; - } - else - { - return (1.0f - mWebRTCDeviceInterface->getPeerConnectionAudioLevel() * LEVEL_SCALE_WEBRTC) * mMicGain / 2.1f; - } -} - float LLWebRTCVoiceClient::tuningGetEnergy(void) { - return getAudioLevel(); + float rms = mWebRTCDeviceInterface->getTuningAudioLevel(); + return TUNING_LEVEL_START_POINT - TUNING_LEVEL_SCALE * rms; } bool LLWebRTCVoiceClient::deviceSettingsAvailable() @@ -824,6 +862,11 @@ void LLWebRTCVoiceClient::setHidden(bool hidden) if (inSpatialChannel()) { + if (mWebRTCDeviceInterface) + { + mWebRTCDeviceInterface->setMute(mHidden || mMuteMic, + mHidden ? 0 : SET_HIDDEN_RESTORE_DELAY_MS); // delay 200ms so as to not pile up mutes/unmutes. + } if (mHidden) { // get out of the channel entirely @@ -990,7 +1033,6 @@ void LLWebRTCVoiceClient::updatePosition(void) { if (participant->mRegion != region->getRegionID()) { participant->mRegion = region->getRegionID(); - setMuteMic(mMuteMic); } } } @@ -1115,13 +1157,14 @@ void LLWebRTCVoiceClient::sendPositionUpdate(bool force) // Update our own volume on our participant, so it'll show up // in the UI. This is done on all sessions, so switching // sessions retains consistent volume levels. -void LLWebRTCVoiceClient::updateOwnVolume() { - F32 audio_level = 0.0; - if (!mMuteMic && !mTuningMode) +void LLWebRTCVoiceClient::updateOwnVolume() +{ + F32 audio_level = 0.0f; + if (!mMuteMic) { - audio_level = getAudioLevel(); + float rms = mWebRTCDeviceInterface->getPeerConnectionAudioLevel(); + audio_level = LEVEL_START_POINT - LEVEL_SCALE * rms; } - sessionState::for_each(boost::bind(predUpdateOwnVolume, _1, audio_level)); } @@ -1518,6 +1561,17 @@ void LLWebRTCVoiceClient::setMuteMic(bool muted) } mMuteMic = muted; + + if (mIsInTuningMode) + { + return; + } + + if (mWebRTCDeviceInterface) + { + mWebRTCDeviceInterface->setMute(muted, muted ? MUTE_FADE_DELAY_MS : 0); // delay for 40ms on mute to allow buffers to empty + } + // when you're hidden, your mic is always muted. if (!mHidden) { @@ -1556,7 +1610,10 @@ void LLWebRTCVoiceClient::setMicGain(F32 gain) if (gain != mMicGain) { mMicGain = gain; - mWebRTCDeviceInterface->setPeerConnectionGain(gain); + if (mWebRTCDeviceInterface) + { + mWebRTCDeviceInterface->setMicGain(gain); + } } } diff --git a/indra/newview/llvoicewebrtc.h b/indra/newview/llvoicewebrtc.h index 71347f206a..722d81fdc2 100644 --- a/indra/newview/llvoicewebrtc.h +++ b/indra/newview/llvoicewebrtc.h @@ -444,10 +444,6 @@ public: private: - // helper function to retrieve the audio level - // Used in multiple places. - float getAudioLevel(); - // Coroutine support methods //--- void voiceConnectionCoro(); @@ -458,7 +454,6 @@ private: LL::WorkQueue::weak_t mMainQueue; - bool mTuningMode; F32 mTuningMicGain; int mTuningSpeakerVolume; bool mDevicesListUpdated; // set to true when the device list has been updated -- cgit v1.2.3 From 5c69ae1d66063ee683c5fda4da979f84bc0ce971 Mon Sep 17 00:00:00 2001 From: Andrey Kleshchev <117672381+akleshchev@users.noreply.github.com> Date: Fri, 12 Sep 2025 23:07:47 +0300 Subject: #4604 Tweak range decrease isSystemMemoryLow() and factor check were too agressive for draw range. --- indra/newview/llviewermessage.cpp | 7 ++----- indra/newview/llviewertexture.cpp | 26 +++++++++++++++++++------- indra/newview/llviewertexture.h | 1 + indra/newview/llvocache.cpp | 6 ++---- 4 files changed, 24 insertions(+), 16 deletions(-) diff --git a/indra/newview/llviewermessage.cpp b/indra/newview/llviewermessage.cpp index d0e6af799c..16b7ac33b8 100644 --- a/indra/newview/llviewermessage.cpp +++ b/indra/newview/llviewermessage.cpp @@ -3366,13 +3366,10 @@ void send_agent_update(bool force_send, bool send_reliable) static F32 last_draw_disatance_step = 1024; F32 memory_limited_draw_distance = gAgentCamera.mDrawDistance; - if (LLViewerTexture::sDesiredDiscardBias > 2.f && LLViewerTexture::isSystemMemoryLow()) + if (LLViewerTexture::isSystemMemoryCritical()) { // If we are low on memory, reduce requested draw distance - // Discard's bias is clamped to 4 so we need to check 2 to 4 range - // Factor is intended to go from 1.0 to 2.0 - F32 factor = 1.f + (LLViewerTexture::sDesiredDiscardBias - 2.f) / 2.f; - memory_limited_draw_distance = llmax(gAgentCamera.mDrawDistance / factor, gAgentCamera.mDrawDistance / 2.f); + memory_limited_draw_distance = llmax(gAgentCamera.mDrawDistance / LLViewerTexture::getSystemMemoryBudgetFactor(), gAgentCamera.mDrawDistance / 2.f); } if (tp_state == LLAgent::TELEPORT_ARRIVING || LLStartUp::getStartupState() < STATE_MISC) diff --git a/indra/newview/llviewertexture.cpp b/indra/newview/llviewertexture.cpp index 7a25fb03a5..3142c9950b 100644 --- a/indra/newview/llviewertexture.cpp +++ b/indra/newview/llviewertexture.cpp @@ -657,23 +657,35 @@ U32Megabytes LLViewerTexture::getFreeSystemMemory() return physical_res; } -//static -bool LLViewerTexture::isSystemMemoryLow() +S32Megabytes get_render_free_main_memory_treshold() { static LLCachedControl min_free_main_memory(gSavedSettings, "RenderMinFreeMainMemoryThreshold", 512); const U32Megabytes MIN_FREE_MAIN_MEMORY(min_free_main_memory); - return getFreeSystemMemory() < MIN_FREE_MAIN_MEMORY; + return MIN_FREE_MAIN_MEMORY; +} + +//static +bool LLViewerTexture::isSystemMemoryLow() +{ + return getFreeSystemMemory() < get_render_free_main_memory_treshold(); +} + +//static +bool LLViewerTexture::isSystemMemoryCritical() +{ + return getFreeSystemMemory() < get_render_free_main_memory_treshold() / 2; } F32 LLViewerTexture::getSystemMemoryBudgetFactor() { - static LLCachedControl min_free_main_memory(gSavedSettings, "RenderMinFreeMainMemoryThreshold", 512); - const S32Megabytes MIN_FREE_MAIN_MEMORY(min_free_main_memory); + const S32Megabytes MIN_FREE_MAIN_MEMORY(get_render_free_main_memory_treshold() / 2); S32 free_budget = (S32Megabytes)getFreeSystemMemory() - MIN_FREE_MAIN_MEMORY; if (free_budget < 0) { - // Result should range from 1 (0 free budget) to 2 (-512 free budget) - return 1.f - free_budget / MIN_FREE_MAIN_MEMORY; + // Leave some padding, otherwise we will crash out of memory before hitting factor 2. + const S32Megabytes PAD_BUFFER(32); + // Result should range from 1 at 0 free budget to 2 at -224 free budget, 2.14 at -256MB + return 1.f - free_budget / (MIN_FREE_MAIN_MEMORY - PAD_BUFFER); } return 1.f; } diff --git a/indra/newview/llviewertexture.h b/indra/newview/llviewertexture.h index d32c302d8e..2937651995 100644 --- a/indra/newview/llviewertexture.h +++ b/indra/newview/llviewertexture.h @@ -115,6 +115,7 @@ public: static void initClass(); static void updateClass(); static bool isSystemMemoryLow(); + static bool isSystemMemoryCritical(); static F32 getSystemMemoryBudgetFactor(); LLViewerTexture(bool usemipmaps = true); diff --git a/indra/newview/llvocache.cpp b/indra/newview/llvocache.cpp index ac73c2def6..52a6afc2d0 100644 --- a/indra/newview/llvocache.cpp +++ b/indra/newview/llvocache.cpp @@ -488,13 +488,11 @@ void LLVOCacheEntry::updateDebugSettings() static const F32 MIN_RADIUS = 1.0f; F32 draw_radius = gAgentCamera.mDrawDistance; - if (LLViewerTexture::sDesiredDiscardBias > 2.f && LLViewerTexture::isSystemMemoryLow()) + if (LLViewerTexture::isSystemMemoryCritical()) { - // Discard's bias maximum is 4 so we need to check 2 to 4 range // Factor is intended to go from 1.0 to 2.0 - F32 factor = 1.f + (LLViewerTexture::sDesiredDiscardBias - 2.f) / 2.f; // For safety cap reduction at 50%, we don't want to go below half of draw distance - draw_radius = llmax(draw_radius / factor, draw_radius / 2.f); + draw_radius = llmax(draw_radius / LLViewerTexture::getSystemMemoryBudgetFactor(), draw_radius / 2.f); } const F32 clamped_min_radius = llclamp((F32) min_radius, MIN_RADIUS, draw_radius); // [1, mDrawDistance] sNearRadius = MIN_RADIUS + ((clamped_min_radius - MIN_RADIUS) * adjust_factor); -- cgit v1.2.3 From 7ec9736200d9f1a719e15462fac0a0f94cdd83af Mon Sep 17 00:00:00 2001 From: Andrey Kleshchev <117672381+akleshchev@users.noreply.github.com> Date: Mon, 15 Sep 2025 23:47:11 +0300 Subject: #4675 Voice indicator did not reappear after tuning resume() was trigggering sOnCurrentChannelChanged which was wiping participant list with no follow up updates. --- indra/newview/llconversationview.cpp | 2 +- indra/newview/llspeakingindicatormanager.cpp | 13 +++++++++++-- indra/newview/llvoicechannel.cpp | 4 +++- indra/newview/llvoicechannel.h | 1 + 4 files changed, 16 insertions(+), 4 deletions(-) diff --git a/indra/newview/llconversationview.cpp b/indra/newview/llconversationview.cpp index 0e0ab236d6..99d770b6e2 100644 --- a/indra/newview/llconversationview.cpp +++ b/indra/newview/llconversationview.cpp @@ -543,7 +543,7 @@ void LLConversationViewSession::onCurrentVoiceSessionChanged(const LLUUID& sessi { bool old_value = mIsInActiveVoiceChannel; mIsInActiveVoiceChannel = vmi->getUUID() == session_id; - mCallIconLayoutPanel->setVisible(mIsInActiveVoiceChannel); + mCallIconLayoutPanel->setVisible(mIsInActiveVoiceChannel && !LLVoiceChannel::isSuspended()); if (old_value != mIsInActiveVoiceChannel) { refresh(); diff --git a/indra/newview/llspeakingindicatormanager.cpp b/indra/newview/llspeakingindicatormanager.cpp index 532b245ced..06458a9f3c 100644 --- a/indra/newview/llspeakingindicatormanager.cpp +++ b/indra/newview/llspeakingindicatormanager.cpp @@ -200,8 +200,17 @@ void SpeakingIndicatorManager::cleanupSingleton() void SpeakingIndicatorManager::sOnCurrentChannelChanged(const LLUUID& /*session_id*/) { - switchSpeakerIndicators(mSwitchedIndicatorsOn, false); - mSwitchedIndicatorsOn.clear(); + if (LLVoiceChannel::isSuspended()) + { + switchSpeakerIndicators(mSwitchedIndicatorsOn, false); + mSwitchedIndicatorsOn.clear(); + } + else + { + // Multiple onParticipantsChanged can arrive at the same time + // from different sources, might want to filter by some factor. + onParticipantsChanged(); + } } void SpeakingIndicatorManager::onParticipantsChanged() diff --git a/indra/newview/llvoicechannel.cpp b/indra/newview/llvoicechannel.cpp index b3ac28eb7a..fbe896ac27 100644 --- a/indra/newview/llvoicechannel.cpp +++ b/indra/newview/llvoicechannel.cpp @@ -357,6 +357,8 @@ void LLVoiceChannel::suspend() { sSuspendedVoiceChannel = sCurrentVoiceChannel; sSuspended = true; + + sCurrentVoiceChannelChangedSignal(sSuspendedVoiceChannel->mSessionID); } } @@ -365,6 +367,7 @@ void LLVoiceChannel::resume() { if (sSuspended) { + sSuspended = false; // needs to be before activate() so that observers will be able to read state if (LLVoiceClient::getInstance()->voiceEnabled()) { if (sSuspendedVoiceChannel) @@ -382,7 +385,6 @@ void LLVoiceChannel::resume() LLVoiceChannelProximal::getInstance()->activate(); } } - sSuspended = false; } } diff --git a/indra/newview/llvoicechannel.h b/indra/newview/llvoicechannel.h index 4d7bf551e1..bf119638d3 100644 --- a/indra/newview/llvoicechannel.h +++ b/indra/newview/llvoicechannel.h @@ -103,6 +103,7 @@ public: static void suspend(); static void resume(); + static bool isSuspended() { return sSuspended; } protected: virtual void setState(EState state); -- cgit v1.2.3 From c743ea2b6dc60312b29f2fb5972171ead26ee448 Mon Sep 17 00:00:00 2001 From: Roxanne Skelly Date: Tue, 16 Sep 2025 10:36:26 -0700 Subject: Fix indexing problem with mac devices (#4676) * Fix indexing problem with mac devices This resulted in the wrong device being selected. Also, fix a shutdown crash where recording was not being stopped, hence the recording thread was still running on shutdown and crashed because it lost access to resources. Fix an issue with p2p calls where they're coming up muted even though the button indicates they are unmuted. * Always refresh device list on notification of device changes Even when the selected device doesn't change, we need to re-deploy it as it might have had characteristics (sampling rate, etc.) changed. Also, we need to redeploy when the Default device has changed --- indra/llwebrtc/llwebrtc.cpp | 48 ++++++++++++++++++++++++------------------ indra/llwebrtc/llwebrtc_impl.h | 6 ++++-- 2 files changed, 31 insertions(+), 23 deletions(-) diff --git a/indra/llwebrtc/llwebrtc.cpp b/indra/llwebrtc/llwebrtc.cpp index edba2bee9a..23e1076765 100644 --- a/indra/llwebrtc/llwebrtc.cpp +++ b/indra/llwebrtc/llwebrtc.cpp @@ -350,6 +350,16 @@ void LLWebRTCImpl::init() void LLWebRTCImpl::terminate() { + mWorkerThread->BlockingCall( + [this]() + { + if (mDeviceModule) + { + mDeviceModule->ForceStopRecording(); + mDeviceModule->StopPlayout(); + } + }); + for (auto &connection : mPeerConnections) { connection->terminate(); @@ -368,8 +378,6 @@ void LLWebRTCImpl::terminate() { if (mDeviceModule) { - mDeviceModule->StopRecording(); - mDeviceModule->StopPlayout(); mDeviceModule->Terminate(); } mDeviceModule = nullptr; @@ -442,11 +450,7 @@ void LLWebRTCImpl::unsetDevicesObserver(LLWebRTCDevicesObserver *observer) void LLWebRTCImpl::workerDeployDevices() { int16_t recordingDevice = RECORD_DEVICE_DEFAULT; -#if WEBRTC_WIN int16_t recording_device_start = 0; -#else - int16_t recording_device_start = 1; -#endif if (mRecordingDevice != "Default") { @@ -455,6 +459,12 @@ void LLWebRTCImpl::workerDeployDevices() if (mRecordingDeviceList[i].mID == mRecordingDevice) { recordingDevice = i; +#if !WEBRTC_WIN + // linux and mac devices range from 1 to the end of the list, with the index 0 being the + // 'default' device. Windows has a special 'default' device and other devices are indexed + // from 0 + recordingDevice++; +#endif break; } } @@ -479,11 +489,7 @@ void LLWebRTCImpl::workerDeployDevices() mDeviceModule->InitRecording(); int16_t playoutDevice = PLAYOUT_DEVICE_DEFAULT; -#if WEBRTC_WIN int16_t playout_device_start = 0; -#else - int16_t playout_device_start = 1; -#endif if (mPlayoutDevice != "Default") { for (int16_t i = playout_device_start; i < mPlayoutDeviceList.size(); i++) @@ -491,6 +497,12 @@ void LLWebRTCImpl::workerDeployDevices() if (mPlayoutDeviceList[i].mID == mPlayoutDevice) { playoutDevice = i; +#if !WEBRTC_WIN + // linux and mac devices range from 1 to the end of the list, with the index 0 being the + // 'default' device. Windows has a special 'default' device and other devices are indexed + // from 0 + playoutDevice++; +#endif break; } } @@ -546,20 +558,14 @@ void LLWebRTCImpl::workerDeployDevices() void LLWebRTCImpl::setCaptureDevice(const std::string &id) { - if (mRecordingDevice != id) - { - mRecordingDevice = id; - deployDevices(); - } + mRecordingDevice = id; + deployDevices(); } void LLWebRTCImpl::setRenderDevice(const std::string &id) { - if (mPlayoutDevice != id) - { - mPlayoutDevice = id; - deployDevices(); - } + mPlayoutDevice = id; + deployDevices(); } // updateDevices needs to happen on the worker thread. @@ -609,7 +615,7 @@ void LLWebRTCImpl::updateDevices() void LLWebRTCImpl::OnDevicesUpdated() { - deployDevices(); + updateDevices(); } diff --git a/indra/llwebrtc/llwebrtc_impl.h b/indra/llwebrtc/llwebrtc_impl.h index 51d42c82b2..dee081119b 100644 --- a/indra/llwebrtc/llwebrtc_impl.h +++ b/indra/llwebrtc/llwebrtc_impl.h @@ -239,8 +239,10 @@ public: return 0; } int32_t StopRecording() override { - if (tuning_) return 0; // if we're tuning, disregard the StopRecording we get from disabling the streams - return inner_->StopRecording(); + // ignore stop recording as webrtc.lib will send one when streams shut down, + // even if there are other streams in place. Start/Stop recording are entirely + // controlled by the app + return 0; } int32_t ForceStartRecording() { return inner_->StartRecording(); } int32_t ForceStopRecording() { return inner_->StopRecording(); } -- cgit v1.2.3 From bf0f60039b33bb0b1f93431864fd6b51c2a20b5b Mon Sep 17 00:00:00 2001 From: Andrey Kleshchev <117672381+akleshchev@users.noreply.github.com> Date: Wed, 17 Sep 2025 17:19:45 +0300 Subject: #4691 Log WebRTC termination for diagnostic purposes --- indra/newview/llvoicewebrtc.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/indra/newview/llvoicewebrtc.cpp b/indra/newview/llvoicewebrtc.cpp index b26a48fd5f..b04f9837ec 100644 --- a/indra/newview/llvoicewebrtc.cpp +++ b/indra/newview/llvoicewebrtc.cpp @@ -288,6 +288,8 @@ void LLWebRTCVoiceClient::terminate() return; } + LL_INFOS("Voice") << "Terminating WebRTC" << LL_ENDL; + mVoiceEnabled = false; llwebrtc::terminate(); -- cgit v1.2.3 From edbb7635457f01557f1831d382bddee5c578072a Mon Sep 17 00:00:00 2001 From: Andrey Kleshchev <117672381+akleshchev@users.noreply.github.com> Date: Fri, 19 Sep 2025 14:10:38 +0300 Subject: Fix builds after update of build-variables branch --- .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 42fd44cf9c..8f89db0923 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -97,7 +97,7 @@ jobs: uses: actions/checkout@v4 with: repository: secondlife/build-variables - ref: universal + ref: master path: .build-variables - name: Checkout master-message-template -- cgit v1.2.3 From 5a0ada943de577091a9518dff651214616c3fc6a Mon Sep 17 00:00:00 2001 From: Andrey Kleshchev <117672381+akleshchev@users.noreply.github.com> Date: Fri, 19 Sep 2025 18:19:00 +0300 Subject: #4570 Make 'About' floater use real bandwidth --- indra/newview/llappviewer.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/indra/newview/llappviewer.cpp b/indra/newview/llappviewer.cpp index 2dabf3355a..63d364eaa8 100644 --- a/indra/newview/llappviewer.cpp +++ b/indra/newview/llappviewer.cpp @@ -3382,7 +3382,7 @@ LLSD LLAppViewer::getViewerInfo() const info["FONT_SIZE_ADJUSTMENT"] = gSavedSettings.getF32("FontScreenDPI"); info["UI_SCALE"] = gSavedSettings.getF32("UIScaleFactor"); info["DRAW_DISTANCE"] = gSavedSettings.getF32("RenderFarClip"); - info["NET_BANDWITH"] = gSavedSettings.getF32("ThrottleBandwidthKBPS"); + info["NET_BANDWITH"] = LLViewerThrottle::getMaxBandwidthKbps(); info["LOD_FACTOR"] = gSavedSettings.getF32("RenderVolumeLODFactor"); info["RENDER_QUALITY"] = (F32)gSavedSettings.getU32("RenderQualityPerformance"); info["TEXTURE_MEMORY"] = LLSD::Integer(gGLManager.mVRAM); -- cgit v1.2.3 From 3ff163887d49363e9d2d48ea343fa1c8da19c061 Mon Sep 17 00:00:00 2001 From: Andrey Kleshchev <117672381+akleshchev@users.noreply.github.com> Date: Fri, 19 Sep 2025 21:27:01 +0300 Subject: #4695 Fix missing voice cleanup Cleanup is in LLVoiceClient::terminate() gWebRTCImpl was never deleted Added mDeviceModule security --- indra/llwebrtc/llwebrtc.cpp | 18 ++++++++++++++++-- indra/llwebrtc/llwebrtc_impl.h | 2 +- indra/newview/llvoiceclient.cpp | 9 ++++++++- 3 files changed, 25 insertions(+), 4 deletions(-) diff --git a/indra/llwebrtc/llwebrtc.cpp b/indra/llwebrtc/llwebrtc.cpp index 23e1076765..828896f620 100644 --- a/indra/llwebrtc/llwebrtc.cpp +++ b/indra/llwebrtc/llwebrtc.cpp @@ -342,8 +342,11 @@ void LLWebRTCImpl::init() mWorkerThread->PostTask( [this]() { - mDeviceModule->EnableBuiltInAEC(false); - updateDevices(); + if (mDeviceModule) + { + mDeviceModule->EnableBuiltInAEC(false); + updateDevices(); + } }); } @@ -449,6 +452,11 @@ void LLWebRTCImpl::unsetDevicesObserver(LLWebRTCDevicesObserver *observer) // must be run in the worker thread. void LLWebRTCImpl::workerDeployDevices() { + if (!mDeviceModule) + { + return; + } + int16_t recordingDevice = RECORD_DEVICE_DEFAULT; int16_t recording_device_start = 0; @@ -571,6 +579,11 @@ void LLWebRTCImpl::setRenderDevice(const std::string &id) // updateDevices needs to happen on the worker thread. void LLWebRTCImpl::updateDevices() { + if (!mDeviceModule) + { + return; + } + int16_t renderDeviceCount = mDeviceModule->PlayoutDevices(); mPlayoutDeviceList.clear(); @@ -1491,6 +1504,7 @@ void terminate() if (gWebRTCImpl) { gWebRTCImpl->terminate(); + delete gWebRTCImpl; gWebRTCImpl = nullptr; } } diff --git a/indra/llwebrtc/llwebrtc_impl.h b/indra/llwebrtc/llwebrtc_impl.h index dee081119b..df06cb88fa 100644 --- a/indra/llwebrtc/llwebrtc_impl.h +++ b/indra/llwebrtc/llwebrtc_impl.h @@ -75,7 +75,7 @@ public: LLWebRTCLogSink(LLWebRTCLogCallback* callback) : mCallback(callback) {} // Destructor: close the log file - ~LLWebRTCLogSink() override {} + ~LLWebRTCLogSink() override { mCallback = nullptr; } void OnLogMessage(const std::string& msg, webrtc::LoggingSeverity severity) override { diff --git a/indra/newview/llvoiceclient.cpp b/indra/newview/llvoiceclient.cpp index 3edd2b473c..71a9e71a9f 100644 --- a/indra/newview/llvoiceclient.cpp +++ b/indra/newview/llvoiceclient.cpp @@ -292,7 +292,14 @@ void LLVoiceClient::setHidden(bool hidden) void LLVoiceClient::terminate() { - if (mSpatialVoiceModule) mSpatialVoiceModule->terminate(); + if (LLVivoxVoiceClient::instanceExists()) + { + LLWebRTCVoiceClient::getInstance()->terminate(); + } + if (LLVivoxVoiceClient::instanceExists()) + { + LLVivoxVoiceClient::getInstance()->terminate(); + } mSpatialVoiceModule = NULL; m_servicePump = NULL; -- cgit v1.2.3 From 1d9f87df4f1d7483c8dd68640c4138d794f71fc5 Mon Sep 17 00:00:00 2001 From: Andrey Kleshchev <117672381+akleshchev@users.noreply.github.com> Date: Mon, 22 Sep 2025 19:39:19 +0300 Subject: #4695 Fix device update causing a crash --- indra/newview/llvoicewebrtc.cpp | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/indra/newview/llvoicewebrtc.cpp b/indra/newview/llvoicewebrtc.cpp index b04f9837ec..62bab7d24a 100644 --- a/indra/newview/llvoicewebrtc.cpp +++ b/indra/newview/llvoicewebrtc.cpp @@ -691,7 +691,10 @@ LLVoiceDeviceList& LLWebRTCVoiceClient::getCaptureDevices() void LLWebRTCVoiceClient::setCaptureDevice(const std::string& name) { - mWebRTCDeviceInterface->setCaptureDevice(name); + if (mWebRTCDeviceInterface) + { + mWebRTCDeviceInterface->setCaptureDevice(name); + } } void LLWebRTCVoiceClient::setDevicesListUpdated(bool state) { @@ -778,7 +781,10 @@ LLVoiceDeviceList& LLWebRTCVoiceClient::getRenderDevices() void LLWebRTCVoiceClient::setRenderDevice(const std::string& name) { - mWebRTCDeviceInterface->setRenderDevice(name); + if (mWebRTCDeviceInterface) + { + mWebRTCDeviceInterface->setRenderDevice(name); + } } void LLWebRTCVoiceClient::tuningStart() -- cgit v1.2.3 From 6dba35d74e27125b39860f9a3df176d7f3a087b5 Mon Sep 17 00:00:00 2001 From: Maxim Nikolenko Date: Tue, 23 Sep 2025 20:20:05 +0300 Subject: #4719 use correct search query when navigating to the page --- indra/newview/llfloatersearch.cpp | 36 ++++++++++++++++++------------------ 1 file changed, 18 insertions(+), 18 deletions(-) diff --git a/indra/newview/llfloatersearch.cpp b/indra/newview/llfloatersearch.cpp index 9762154a26..8e6a47dce5 100644 --- a/indra/newview/llfloatersearch.cpp +++ b/indra/newview/llfloatersearch.cpp @@ -44,8 +44,22 @@ class LLSearchHandler : public LLCommandHandler { bool handle(const LLSD& tokens, const LLSD& query_map, const std::string& grid, LLMediaCtrl* web) { const size_t parts = tokens.size(); + // get the (optional) category for the search + std::string collection; + if (parts > 0) + { + collection = tokens[0].asString(); + } + + // get the (optional) search string + std::string search_text; + if (parts > 1) + { + search_text = tokens[1].asString(); + } + // open the search floater and perform the requested search - LLFloaterReg::showInstance("search", tokens); + LLFloaterReg::showInstance("search", llsd::map("collection", collection,"query", search_text)); return true; } }; @@ -84,25 +98,11 @@ void LLFloaterSearch::initiateSearch(const LLSD& tokens) // substituted into the final URL using the logic from the original search. subs["TYPE"] = "standard"; - const size_t parts = tokens.size(); + std::string collection = tokens.has("collection") ? tokens["collection"].asString() : ""; - // get the (optional) category for the search - std::string collection; - if (parts > 0) - { - collection = tokens[0].asString(); - } - - // get the (optional) search string - std::string search_text; - if (parts > 1) - { - search_text = tokens[1].asString(); - } + std::string search_text = tokens.has("query") ? tokens["query"].asString() : ""; - // TODO: where does category get set? I cannot find a reference to - // it in internal docs - might be conflated with values in mSearchType - std::string category; + std::string category = tokens.has("category") ? tokens["category"].asString() : ""; if (mSearchType.find(category) != mSearchType.end()) { subs["TYPE"] = category; -- cgit v1.2.3 From 79909b8a335b9fdeaefe384528284538e8dae6a4 Mon Sep 17 00:00:00 2001 From: Rye Date: Mon, 29 Sep 2025 12:23:29 -0400 Subject: Fix rendering differences observed in 2025.07 (#4747) * Fix calling setTextureAddressModeFast and setTextureFilteringOptionFast with invalid tex type during fast binds * Restore mRT->screen to GL_RGBA16F to fix lighting banding --- indra/llrender/llrender.cpp | 38 +++++++++++++++++++------------------- indra/llrender/llrender.h | 4 ++-- indra/newview/pipeline.cpp | 2 +- 3 files changed, 22 insertions(+), 22 deletions(-) diff --git a/indra/llrender/llrender.cpp b/indra/llrender/llrender.cpp index 4f646cdc33..57be8570af 100644 --- a/indra/llrender/llrender.cpp +++ b/indra/llrender/llrender.cpp @@ -210,8 +210,8 @@ void LLTexUnit::bindFast(LLTexture* texture) if (gl_tex->mTexOptionsDirty) { gl_tex->mTexOptionsDirty = false; - setTextureAddressModeFast(gl_tex->mAddressMode); - setTextureFilteringOptionFast(gl_tex->mFilterOption); + setTextureAddressModeFast(gl_tex->mAddressMode, gl_tex->getTarget()); + setTextureFilteringOptionFast(gl_tex->mFilterOption, gl_tex->getTarget()); } } @@ -467,16 +467,16 @@ void LLTexUnit::setTextureAddressMode(eTextureAddressMode mode) activate(); - setTextureAddressModeFast(mode); + setTextureAddressModeFast(mode, mCurrTexType); } -void LLTexUnit::setTextureAddressModeFast(eTextureAddressMode mode) +void LLTexUnit::setTextureAddressModeFast(eTextureAddressMode mode, eTextureType tex_type) { - glTexParameteri(sGLTextureType[mCurrTexType], GL_TEXTURE_WRAP_S, sGLAddressMode[mode]); - glTexParameteri(sGLTextureType[mCurrTexType], GL_TEXTURE_WRAP_T, sGLAddressMode[mode]); - if (mCurrTexType == TT_CUBE_MAP) + glTexParameteri(sGLTextureType[tex_type], GL_TEXTURE_WRAP_S, sGLAddressMode[mode]); + glTexParameteri(sGLTextureType[tex_type], GL_TEXTURE_WRAP_T, sGLAddressMode[mode]); + if (tex_type == TT_CUBE_MAP || tex_type == TT_CUBE_MAP_ARRAY || tex_type == TT_TEXTURE_3D) { - glTexParameteri(GL_TEXTURE_CUBE_MAP, GL_TEXTURE_WRAP_R, sGLAddressMode[mode]); + glTexParameteri(sGLTextureType[tex_type], GL_TEXTURE_WRAP_R, sGLAddressMode[mode]); } } @@ -486,44 +486,44 @@ void LLTexUnit::setTextureFilteringOption(LLTexUnit::eTextureFilterOptions optio gGL.flush(); - setTextureFilteringOptionFast(option); + setTextureFilteringOptionFast(option, mCurrTexType); } -void LLTexUnit::setTextureFilteringOptionFast(LLTexUnit::eTextureFilterOptions option) +void LLTexUnit::setTextureFilteringOptionFast(LLTexUnit::eTextureFilterOptions option, eTextureType tex_type) { if (option == TFO_POINT) { - glTexParameteri(sGLTextureType[mCurrTexType], GL_TEXTURE_MAG_FILTER, GL_NEAREST); + glTexParameteri(sGLTextureType[tex_type], GL_TEXTURE_MAG_FILTER, GL_NEAREST); } else { - glTexParameteri(sGLTextureType[mCurrTexType], GL_TEXTURE_MAG_FILTER, GL_LINEAR); + glTexParameteri(sGLTextureType[tex_type], GL_TEXTURE_MAG_FILTER, GL_LINEAR); } if (option >= TFO_TRILINEAR && mHasMipMaps) { - glTexParameteri(sGLTextureType[mCurrTexType], GL_TEXTURE_MIN_FILTER, GL_LINEAR_MIPMAP_LINEAR); + glTexParameteri(sGLTextureType[tex_type], GL_TEXTURE_MIN_FILTER, GL_LINEAR_MIPMAP_LINEAR); } else if (option >= TFO_BILINEAR) { if (mHasMipMaps) { - glTexParameteri(sGLTextureType[mCurrTexType], GL_TEXTURE_MIN_FILTER, GL_LINEAR_MIPMAP_NEAREST); + glTexParameteri(sGLTextureType[tex_type], GL_TEXTURE_MIN_FILTER, GL_LINEAR_MIPMAP_NEAREST); } else { - glTexParameteri(sGLTextureType[mCurrTexType], GL_TEXTURE_MIN_FILTER, GL_LINEAR); + glTexParameteri(sGLTextureType[tex_type], GL_TEXTURE_MIN_FILTER, GL_LINEAR); } } else { if (mHasMipMaps) { - glTexParameteri(sGLTextureType[mCurrTexType], GL_TEXTURE_MIN_FILTER, GL_NEAREST_MIPMAP_NEAREST); + glTexParameteri(sGLTextureType[tex_type], GL_TEXTURE_MIN_FILTER, GL_NEAREST_MIPMAP_NEAREST); } else { - glTexParameteri(sGLTextureType[mCurrTexType], GL_TEXTURE_MIN_FILTER, GL_NEAREST); + glTexParameteri(sGLTextureType[tex_type], GL_TEXTURE_MIN_FILTER, GL_NEAREST); } } @@ -531,11 +531,11 @@ void LLTexUnit::setTextureFilteringOptionFast(LLTexUnit::eTextureFilterOptions o { if (LLImageGL::sGlobalUseAnisotropic && option == TFO_ANISOTROPIC) { - glTexParameterf(sGLTextureType[mCurrTexType], GL_TEXTURE_MAX_ANISOTROPY, gGLManager.mMaxAnisotropy); + glTexParameterf(sGLTextureType[tex_type], GL_TEXTURE_MAX_ANISOTROPY, gGLManager.mMaxAnisotropy); } else { - glTexParameterf(sGLTextureType[mCurrTexType], GL_TEXTURE_MAX_ANISOTROPY, 1.f); + glTexParameterf(sGLTextureType[tex_type], GL_TEXTURE_MAX_ANISOTROPY, 1.f); } } } diff --git a/indra/llrender/llrender.h b/indra/llrender/llrender.h index 755aee4bd6..0801c12fb4 100644 --- a/indra/llrender/llrender.h +++ b/indra/llrender/llrender.h @@ -209,14 +209,14 @@ public: // make sure you want to permanently change the address mode for the bound texture. void setTextureAddressMode(eTextureAddressMode mode); // MUST already be active and bound - void setTextureAddressModeFast(eTextureAddressMode mode); + void setTextureAddressModeFast(eTextureAddressMode mode, eTextureType tex_type); // Sets the filtering options used to sample the texture // Warning: this stays set for the bound texture forever, // make sure you want to permanently change the filtering for the bound texture. void setTextureFilteringOption(LLTexUnit::eTextureFilterOptions option); // MUST already be active and bound - void setTextureFilteringOptionFast(LLTexUnit::eTextureFilterOptions option); + void setTextureFilteringOptionFast(LLTexUnit::eTextureFilterOptions option, eTextureType tex_type); static U32 getInternalType(eTextureType type); diff --git a/indra/newview/pipeline.cpp b/indra/newview/pipeline.cpp index 2fe67a5457..856dee3dd4 100644 --- a/indra/newview/pipeline.cpp +++ b/indra/newview/pipeline.cpp @@ -858,7 +858,7 @@ bool LLPipeline::allocateScreenBufferInternal(U32 resX, U32 resY) GLuint screenFormat = hdr ? GL_RGBA16F : GL_RGBA; - if (!mRT->screen.allocate(resX, resY, screenFormat)) return false; + if (!mRT->screen.allocate(resX, resY, GL_RGBA16F)) return false; mRT->deferredScreen.shareDepthBuffer(mRT->screen); -- cgit v1.2.3 From 420bc85f97c0c19ffca4b4f26b70d171f7d5761e Mon Sep 17 00:00:00 2001 From: Maxim Nikolenko Date: Tue, 30 Sep 2025 19:28:21 +0300 Subject: #4751 Restore navigation UI for Marketplace and Search --- indra/newview/llfloatermarketplace.cpp | 22 +- indra/newview/llfloatermarketplace.h | 8 +- indra/newview/llfloatersearch.cpp | 14 +- indra/newview/llfloatersearch.h | 4 +- indra/newview/llstatusbar.cpp | 7 +- .../skins/default/xui/en/floater_marketplace.xml | 221 +++++++++++++++++--- .../skins/default/xui/en/floater_search.xml | 222 ++++++++++++++++++--- 7 files changed, 444 insertions(+), 54 deletions(-) diff --git a/indra/newview/llfloatermarketplace.cpp b/indra/newview/llfloatermarketplace.cpp index 889daf84ab..4abea64302 100644 --- a/indra/newview/llfloatermarketplace.cpp +++ b/indra/newview/llfloatermarketplace.cpp @@ -27,10 +27,11 @@ #include "llviewerprecompiledheaders.h" #include "llfloatermarketplace.h" +#include "llviewercontrol.h" #include "lluictrlfactory.h" LLFloaterMarketplace::LLFloaterMarketplace(const LLSD& key) - : LLFloater(key) + : LLFloaterWebContent(key) { } @@ -38,10 +39,25 @@ LLFloaterMarketplace::~LLFloaterMarketplace() { } +// just to override LLFloaterWebContent +void LLFloaterMarketplace::onClose(bool app_quitting) +{ +} + bool LLFloaterMarketplace::postBuild() { - enableResizeCtrls(true, true, false); + LLFloaterWebContent::postBuild(); + mWebBrowser = getChild("marketplace_contents"); + mWebBrowser->addObserver(this); + return true; } - +void LLFloaterMarketplace::openMarketplace() +{ + std::string url = gSavedSettings.getString("MarketplaceURL"); + if (mCurrentURL != url) + { + mWebBrowser->navigateTo(url, HTTP_CONTENT_TEXT_HTML); + } +} diff --git a/indra/newview/llfloatermarketplace.h b/indra/newview/llfloatermarketplace.h index 2ae4d0d64a..9524c94eee 100644 --- a/indra/newview/llfloatermarketplace.h +++ b/indra/newview/llfloatermarketplace.h @@ -27,14 +27,20 @@ #pragma once #include "llfloater.h" +#include "llfloaterwebcontent.h" class LLFloaterMarketplace: - public LLFloater + public LLFloaterWebContent { friend class LLFloaterReg; + +public: + void openMarketplace(); + private: LLFloaterMarketplace(const LLSD& key); ~LLFloaterMarketplace(); bool postBuild() override; + void onClose(bool app_quitting) override; }; diff --git a/indra/newview/llfloatersearch.cpp b/indra/newview/llfloatersearch.cpp index 8e6a47dce5..7ee1b88f05 100644 --- a/indra/newview/llfloatersearch.cpp +++ b/indra/newview/llfloatersearch.cpp @@ -66,7 +66,7 @@ class LLSearchHandler : public LLCommandHandler { LLSearchHandler gSearchHandler; LLFloaterSearch::LLFloaterSearch(const LLSD& key) - : LLFloater(key) + : LLFloaterWebContent(key) { mSearchType.insert("standard"); mSearchType.insert("land"); @@ -86,6 +86,12 @@ LLFloaterSearch::~LLFloaterSearch() void LLFloaterSearch::onOpen(const LLSD& tokens) { initiateSearch(tokens); + mWebBrowser->setFocus(true); +} + +// just to override LLFloaterWebContent +void LLFloaterSearch::onClose(bool app_quitting) +{ } void LLFloaterSearch::initiateSearch(const LLSD& tokens) @@ -161,7 +167,11 @@ void LLFloaterSearch::initiateSearch(const LLSD& tokens) bool LLFloaterSearch::postBuild() { - enableResizeCtrls(true, true, false); + LLFloaterWebContent::postBuild(); + mWebBrowser = getChild("search_contents"); + mWebBrowser->addObserver(this); + getChildView("address")->setEnabled(false); + getChildView("popexternal")->setEnabled(false); // This call is actioned by the preload code in llViewerWindow // that creates the search floater during the login process diff --git a/indra/newview/llfloatersearch.h b/indra/newview/llfloatersearch.h index e8a2be4797..6d93474f4a 100644 --- a/indra/newview/llfloatersearch.h +++ b/indra/newview/llfloatersearch.h @@ -27,13 +27,15 @@ #pragma once #include "llfloater.h" +#include "llfloaterwebcontent.h" class LLFloaterSearch: - public LLFloater { + public LLFloaterWebContent { friend class LLFloaterReg; public: void onOpen(const LLSD& key) override; + void onClose(bool app_quitting) override; private: LLFloaterSearch(const LLSD& key); diff --git a/indra/newview/llstatusbar.cpp b/indra/newview/llstatusbar.cpp index 82c959d7f7..2727127633 100644 --- a/indra/newview/llstatusbar.cpp +++ b/indra/newview/llstatusbar.cpp @@ -41,6 +41,7 @@ #include "llpanelpresetscamerapulldown.h" #include "llpanelpresetspulldown.h" #include "llpanelvolumepulldown.h" +#include "llfloatermarketplace.h" #include "llfloaterregioninfo.h" #include "llfloaterscriptdebug.h" #include "llhints.h" @@ -523,7 +524,11 @@ void LLStatusBar::onClickBuyCurrency() void LLStatusBar::onClickShop() { - LLFloaterReg::toggleInstanceOrBringToFront("marketplace"); + LLFloaterReg::showInstanceOrBringToFront("marketplace"); + if (LLFloaterMarketplace* marketplace = LLFloaterReg::getTypedInstance("marketplace")) + { + marketplace->openMarketplace(); + } } void LLStatusBar::onMouseEnterPresetsCamera() diff --git a/indra/newview/skins/default/xui/en/floater_marketplace.xml b/indra/newview/skins/default/xui/en/floater_marketplace.xml index 2299e02c63..99fb3a1ad8 100644 --- a/indra/newview/skins/default/xui/en/floater_marketplace.xml +++ b/indra/newview/skins/default/xui/en/floater_marketplace.xml @@ -1,26 +1,201 @@ - + legacy_header_height="18" + can_minimize="true" + can_close="true" + can_resize="true" + height="775" + layout="topleft" + min_height="500" + min_width="600" + name="Marketplace" + save_rect="true" + single_instance="true" + save_visibility="true" + title="MARKETPLACE" + tab_stop="true" + width="780"> + + + + + + + + + + + + + + + + + + + + diff --git a/indra/newview/skins/default/xui/en/floater_search.xml b/indra/newview/skins/default/xui/en/floater_search.xml index 76a486e211..43c4aa1b9d 100644 --- a/indra/newview/skins/default/xui/en/floater_search.xml +++ b/indra/newview/skins/default/xui/en/floater_search.xml @@ -1,26 +1,202 @@ - + legacy_header_height="18" + can_minimize="true" + can_close="true" + can_resize="true" + height="775" + layout="topleft" + min_height="500" + min_width="600" + name="Search" + save_rect="true" + single_instance="true" + save_visibility="true" + title="SEARCH" + tab_stop="true" + width="780"> + + + + + + + + + + + + + + + + + + + + -- cgit v1.2.3 From 589498fece769446310c085e9feb08ccd8400c2c Mon Sep 17 00:00:00 2001 From: Brad Linden Date: Wed, 1 Oct 2025 17:50:28 -0700 Subject: Reenable havok llphysicsextensions on Darwin x86_64 with llphysicsextensions_stub used for aarch64 --- autobuild.xml | 40 ++++------------------------------- build.sh | 1 - indra/cmake/LLPhysicsExtensions.cmake | 9 +++++++- indra/newview/CMakeLists.txt | 9 ++++++++ 4 files changed, 21 insertions(+), 38 deletions(-) diff --git a/autobuild.xml b/autobuild.xml index c9355c73c0..280078b4c2 100644 --- a/autobuild.xml +++ b/autobuild.xml @@ -1432,53 +1432,21 @@ platforms - darwin64 - - archive - - creds - github - hash - 7facda95e2f00c260513f3d4db42588fa8ba703c - hash_algorithm - sha1 - url - https://api.github.com/repos/secondlife/llphysicsextensions_source/releases/assets/196289774 - - name - darwin64 - - linux64 - - archive - - creds - github - hash - 01d08f13c7bc8d1b95b0330fa6833b7d8274e4d0 - hash_algorithm - sha1 - url - https://api.github.com/repos/secondlife/llphysicsextensions_source/releases/assets/196289775 - - name - linux64 - - windows64 + common archive creds github hash - 6d00345c7d3471bc5f7c1218e014dd0f1a2c069b + 1949ae355a70a4cbe2f0969de636680a0b5d7b15 hash_algorithm sha1 url - https://api.github.com/repos/secondlife/llphysicsextensions_source/releases/assets/196289778 + https://api.github.com/repos/secondlife/llphysicsextensions_source/releases/assets/299453833 name - windows64 + common license diff --git a/build.sh b/build.sh index 36e332cf42..325386e7e9 100755 --- a/build.sh +++ b/build.sh @@ -158,7 +158,6 @@ pre_build() if [[ "$arch" == "Darwin" ]] then - HAVOK=OFF SIGNING=("-DENABLE_SIGNING:BOOL=YES" \ "-DSIGNING_IDENTITY:STRING=Developer ID Application: Linden Research, Inc.") fi diff --git a/indra/cmake/LLPhysicsExtensions.cmake b/indra/cmake/LLPhysicsExtensions.cmake index 80d243d9f8..6112621b5a 100644 --- a/indra/cmake/LLPhysicsExtensions.cmake +++ b/indra/cmake/LLPhysicsExtensions.cmake @@ -22,7 +22,14 @@ if (HAVOK) include(Havok) use_prebuilt_binary(llphysicsextensions_source) set(LLPHYSICSEXTENSIONS_SRC_DIR ${LIBS_PREBUILT_DIR}/llphysicsextensions/src) - target_link_libraries( llphysicsextensions_impl INTERFACE llphysicsextensions) + if(DARWIN) + set(LLPHYSICSEXTENSIONS_STUB_DIR ${LIBS_PREBUILT_DIR}/llphysicsextensions/stub) + # can't set these library dependencies per-arch here, need to do it using XCODE_ATTRIBUTE_OTHER_LDFLAGS[arch=*] in newview/CMakeLists.txt + #target_link_libraries( llphysicsextensions_impl INTERFACE llphysicsextensions) + #target_link_libraries( llphysicsextensions_impl INTERFACE llphysicsextensionsstub) + else() + target_link_libraries( llphysicsextensions_impl INTERFACE llphysicsextensions) + endif() elseif (HAVOK_TPV) use_prebuilt_binary(llphysicsextensions_tpv) target_link_libraries( llphysicsextensions_impl INTERFACE llphysicsextensions_tpv) diff --git a/indra/newview/CMakeLists.txt b/indra/newview/CMakeLists.txt index c727d5ae57..72baac73ae 100644 --- a/indra/newview/CMakeLists.txt +++ b/indra/newview/CMakeLists.txt @@ -59,6 +59,10 @@ if (NOT HAVOK_TPV) # which means we need to duct tape this togther ... add_subdirectory(${LLPHYSICSEXTENSIONS_SRC_DIR} llphysicsextensions) + if (NOT "${LLPHYSICSEXTENSIONS_STUB_DIR}" EQUAL "") + # for darwin universal builds we need both real llphysicsextensions and the stub for aarch64 fallback + add_subdirectory(${LLPHYSICSEXTENSIONS_STUB_DIR} llphysicsextensionsstub) + endif() # Another hack that works with newer cmake versions: cmake_policy( SET CMP0079 NEW) @@ -1952,6 +1956,11 @@ elseif (DARWIN) RESOURCE SecondLife.xib #LINK_FLAGS_RELEASE "${LINK_FLAGS_RELEASE} -Xlinker -dead_strip -Xlinker -map -Xlinker ${CMAKE_CURRENT_BINARY_DIR}/${VIEWER_BINARY_NAME}.MAP" LINK_FLAGS_RELEASE "${LINK_FLAGS_RELEASE} -Xlinker -dead_strip" + # arch specific flags for universal builds: https://stackoverflow.com/a/77942065 + XCODE_ATTRIBUTE_OTHER_CFLAGS[arch=x86_64] "$(inherited) -DLLPHYSICSEXTENSIONS_USE_FULL" + XCODE_ATTRIBUTE_OTHER_CFLAGS[arch=arm64] "$(inherited) -DLLPHYSICSEXTENSIONS_USE_STUB" + XCODE_ATTRIBUTE_OTHER_LDFLAGS[arch=x86_64] "$(inherited) -L${CMAKE_CURRENT_BINARY_DIR}/llphysicsextensions/$,$,${CMAKE_CFG_INTDIR}>/ -lllphysicsextensions" + XCODE_ATTRIBUTE_OTHER_LDFLAGS[arch=arm64] "$(inherited) -L${CMAKE_CURRENT_BINARY_DIR}/llphysicsextensionsstub/$,$,${CMAKE_CFG_INTDIR}>/ -lllphysicsextensionsstub" ) else (WINDOWS) # Linux -- cgit v1.2.3 From b8cf54d909263e14622d9669b192c9ad14dc7173 Mon Sep 17 00:00:00 2001 From: Brad Linden Date: Wed, 1 Oct 2025 18:17:16 -0700 Subject: Fix configurations like windows where LLPHYSICSEXTENSIONS_STUB_DIR is unset --- indra/newview/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/indra/newview/CMakeLists.txt b/indra/newview/CMakeLists.txt index 72baac73ae..1444eeaba3 100644 --- a/indra/newview/CMakeLists.txt +++ b/indra/newview/CMakeLists.txt @@ -59,7 +59,7 @@ if (NOT HAVOK_TPV) # which means we need to duct tape this togther ... add_subdirectory(${LLPHYSICSEXTENSIONS_SRC_DIR} llphysicsextensions) - if (NOT "${LLPHYSICSEXTENSIONS_STUB_DIR}" EQUAL "") + if (NOT "${LLPHYSICSEXTENSIONS_STUB_DIR}" STREQUAL "") # for darwin universal builds we need both real llphysicsextensions and the stub for aarch64 fallback add_subdirectory(${LLPHYSICSEXTENSIONS_STUB_DIR} llphysicsextensionsstub) endif() -- cgit v1.2.3 From fc41f57a06065957bc377d7a1716c5c04b8fec70 Mon Sep 17 00:00:00 2001 From: Brad Linden Date: Thu, 2 Oct 2025 11:26:48 -0700 Subject: Attempt to fix build error --- indra/newview/CMakeLists.txt | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/indra/newview/CMakeLists.txt b/indra/newview/CMakeLists.txt index 1444eeaba3..9e566096fc 100644 --- a/indra/newview/CMakeLists.txt +++ b/indra/newview/CMakeLists.txt @@ -61,6 +61,7 @@ if (NOT HAVOK_TPV) add_subdirectory(${LLPHYSICSEXTENSIONS_SRC_DIR} llphysicsextensions) if (NOT "${LLPHYSICSEXTENSIONS_STUB_DIR}" STREQUAL "") # for darwin universal builds we need both real llphysicsextensions and the stub for aarch64 fallback + # this will only be set when HAVOK is ON, otherwise the normal stub fallback will be in effect add_subdirectory(${LLPHYSICSEXTENSIONS_STUB_DIR} llphysicsextensionsstub) endif() @@ -73,6 +74,9 @@ if (NOT HAVOK_TPV) target_link_libraries(llphysicsextensions llrender ) if (DARWIN) target_compile_options( llphysicsextensions PRIVATE -Wno-unused-local-typedef) + + # TODO - move this into llphysicsextensions/CMakeLists.txt once I've proved it works + set_target_properties(llphysicsextensions PROPERTIES OSX_ARCHITECTURES "x86_64") endif (DARWIN) endif() endif (NOT HAVOK_TPV) -- cgit v1.2.3 From 99d8f22c99e54ba4c22a2b5834bba2c0de549fca Mon Sep 17 00:00:00 2001 From: Andrey Kleshchev <117672381+akleshchev@users.noreply.github.com> Date: Thu, 2 Oct 2025 22:24:59 +0300 Subject: #4757 Model uploader warning when physics library is missing --- indra/newview/llviewermenufile.cpp | 18 +++++++++++++++++- indra/newview/skins/default/xui/en/notifications.xml | 19 +++++++++++++++++++ 2 files changed, 36 insertions(+), 1 deletion(-) diff --git a/indra/newview/llviewermenufile.cpp b/indra/newview/llviewermenufile.cpp index 3695478061..801ff3c212 100644 --- a/indra/newview/llviewermenufile.cpp +++ b/indra/newview/llviewermenufile.cpp @@ -912,7 +912,23 @@ class LLFileUploadModel : public view_listener_t { bool handleEvent(const LLSD& userdata) { - LLFloaterModelPreview::showModelPreview(); + if (LLConvexDecomposition::isFunctional()) + { + LLFloaterModelPreview::showModelPreview(); + } + else + { + if (gGLManager.mIsApple) + { + LLNotificationsUtil::add("ModelUploaderMissingPhysicsApple"); + } + else + { + // TPV? + LLNotificationsUtil::add("ModelUploaderMissingPhysics"); + LLFloaterModelPreview::showModelPreview(); + } + } return true; } }; diff --git a/indra/newview/skins/default/xui/en/notifications.xml b/indra/newview/skins/default/xui/en/notifications.xml index 7fc96af55d..536008c85c 100644 --- a/indra/newview/skins/default/xui/en/notifications.xml +++ b/indra/newview/skins/default/xui/en/notifications.xml @@ -2237,6 +2237,25 @@ Couldn't open uploaded sound file for reading: fail + +Model upload is not yet available on Apple Silicon, but will be supported in an upcoming release. + +Workaround: Right-click the Second Life app in Finder, select +"Get Info", then check "Open using Rosetta" + fail + + + +Physics library is not present, some of the model uploader's functionality might not work or might not work correctly. + fail + + Date: Thu, 2 Oct 2025 13:35:54 -0700 Subject: new llphysicsextensions_source package that sets OSX_ARCHITECTURES properly and should hopefully package llphysicsextensions_tpv successfully --- autobuild.xml | 4 ++-- indra/newview/CMakeLists.txt | 3 --- 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/autobuild.xml b/autobuild.xml index 280078b4c2..56831346c1 100644 --- a/autobuild.xml +++ b/autobuild.xml @@ -1439,11 +1439,11 @@ creds github hash - 1949ae355a70a4cbe2f0969de636680a0b5d7b15 + fff82c79edb900c547c40dca9a0e3ebac5a8c7da hash_algorithm sha1 url - https://api.github.com/repos/secondlife/llphysicsextensions_source/releases/assets/299453833 + https://api.github.com/repos/secondlife/llphysicsextensions_source/releases/assets/299858950 name common diff --git a/indra/newview/CMakeLists.txt b/indra/newview/CMakeLists.txt index 9e566096fc..0d50aeca82 100644 --- a/indra/newview/CMakeLists.txt +++ b/indra/newview/CMakeLists.txt @@ -74,9 +74,6 @@ if (NOT HAVOK_TPV) target_link_libraries(llphysicsextensions llrender ) if (DARWIN) target_compile_options( llphysicsextensions PRIVATE -Wno-unused-local-typedef) - - # TODO - move this into llphysicsextensions/CMakeLists.txt once I've proved it works - set_target_properties(llphysicsextensions PROPERTIES OSX_ARCHITECTURES "x86_64") endif (DARWIN) endif() endif (NOT HAVOK_TPV) -- cgit v1.2.3 From e30bc61d9a63ed29985bd6e07405f0051bfceaf6 Mon Sep 17 00:00:00 2001 From: Brad Linden Date: Thu, 2 Oct 2025 14:51:14 -0700 Subject: Restore creation of secondlife-bin.MAP file on Darwin x86_64 for production of llphysicsextensions_tpv --- indra/newview/CMakeLists.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/indra/newview/CMakeLists.txt b/indra/newview/CMakeLists.txt index 0d50aeca82..eb40067930 100644 --- a/indra/newview/CMakeLists.txt +++ b/indra/newview/CMakeLists.txt @@ -1955,12 +1955,12 @@ elseif (DARWIN) set_target_properties(${VIEWER_BINARY_NAME} PROPERTIES RESOURCE SecondLife.xib - #LINK_FLAGS_RELEASE "${LINK_FLAGS_RELEASE} -Xlinker -dead_strip -Xlinker -map -Xlinker ${CMAKE_CURRENT_BINARY_DIR}/${VIEWER_BINARY_NAME}.MAP" LINK_FLAGS_RELEASE "${LINK_FLAGS_RELEASE} -Xlinker -dead_strip" # arch specific flags for universal builds: https://stackoverflow.com/a/77942065 XCODE_ATTRIBUTE_OTHER_CFLAGS[arch=x86_64] "$(inherited) -DLLPHYSICSEXTENSIONS_USE_FULL" XCODE_ATTRIBUTE_OTHER_CFLAGS[arch=arm64] "$(inherited) -DLLPHYSICSEXTENSIONS_USE_STUB" - XCODE_ATTRIBUTE_OTHER_LDFLAGS[arch=x86_64] "$(inherited) -L${CMAKE_CURRENT_BINARY_DIR}/llphysicsextensions/$,$,${CMAKE_CFG_INTDIR}>/ -lllphysicsextensions" + # only generate the .MAP file for llphysicsextensions_tpv on x86_64 + XCODE_ATTRIBUTE_OTHER_LDFLAGS[arch=x86_64] "$(inherited) -L${CMAKE_CURRENT_BINARY_DIR}/llphysicsextensions/$,$,${CMAKE_CFG_INTDIR}>/ -lllphysicsextensions -Xlinker -map -Xlinker ${CMAKE_CURRENT_BINARY_DIR}/${VIEWER_BINARY_NAME}.MAP" XCODE_ATTRIBUTE_OTHER_LDFLAGS[arch=arm64] "$(inherited) -L${CMAKE_CURRENT_BINARY_DIR}/llphysicsextensionsstub/$,$,${CMAKE_CFG_INTDIR}>/ -lllphysicsextensionsstub" ) else (WINDOWS) -- cgit v1.2.3 From c440843513b9d9688db019034be4d8c24a3e6f8b Mon Sep 17 00:00:00 2001 From: Brad Linden Date: Fri, 3 Oct 2025 11:39:57 -0700 Subject: disable package_llphysicsextensions_tpv for now --- build.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/build.sh b/build.sh index 325386e7e9..694b03c42e 100755 --- a/build.sh +++ b/build.sh @@ -261,8 +261,8 @@ build() done fi - # *TODO: Make this a build extension. - package_llphysicsextensions_tpv || fatal "failed building llphysicsextensions packages" + # *TODO: Make this a build extension. disabled for now + # package_llphysicsextensions_tpv || fatal "failed building llphysicsextensions packages" end_section "extensions $variant" else -- cgit v1.2.3 From 9e71e1ca3803a0a55085b954a9d795c19334c1db Mon Sep 17 00:00:00 2001 From: "Jonathan \"Geenz\" Goodman" Date: Wed, 8 Oct 2025 14:52:33 -0400 Subject: Move the irradiance gen unbind to be within the correct scope. (#4798) --- indra/newview/llreflectionmapmanager.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/indra/newview/llreflectionmapmanager.cpp b/indra/newview/llreflectionmapmanager.cpp index eb7fe06e7d..c6fa64753c 100644 --- a/indra/newview/llreflectionmapmanager.cpp +++ b/indra/newview/llreflectionmapmanager.cpp @@ -998,11 +998,11 @@ void LLReflectionMapManager::updateProbeFace(LLReflectionMap* probe, U32 face) mTexture->bind(channel); } } + + gIrradianceGenProgram.unbind(); } mMipChain[0].flush(); - - gIrradianceGenProgram.unbind(); } } -- cgit v1.2.3 From 95337dfc36113dca030c38a447b2ffa29b5bed9c Mon Sep 17 00:00:00 2001 From: Callum Linden <113564339+callumlinden@users.noreply.github.com> Date: Wed, 8 Oct 2025 12:39:23 -0700 Subject: Fix for viewer-private/issues/489 - HTTP Basic Auth dialog should not be present (#4799) --- autobuild.xml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/autobuild.xml b/autobuild.xml index 56831346c1..58c8d49c7c 100644 --- a/autobuild.xml +++ b/autobuild.xml @@ -450,11 +450,11 @@ archive hash - d44256458ff0ef4db4c91e8e8cc83e8f98b4f1b8 + 126e0fa4c16dfd433c9fb7d1d242da98f213d933 hash_algorithm sha1 url - https://github.com/secondlife/dullahan/releases/download/v1.21.0-CEF_139.0.28/dullahan-1.21.0.202508272158_139.0.28_g55ab8a8_chromium-139.0.7258.139-darwin64-17279703032.tar.zst + https://github.com/secondlife/dullahan/releases/download/v1.24.0-CEF_139.0.40/dullahan-1.24.0.202510081737_139.0.40_g465474a_chromium-139.0.7258.139-darwin64-18353103947.tar.zst name darwin64 @@ -478,11 +478,11 @@ archive hash - 9d5af766a87052808e4062978504e9af124fb558 + 20de62c9e57d9e6539c1e2437ec4b46c3ca237bc hash_algorithm sha1 url - https://github.com/secondlife/dullahan/releases/download/v1.21.0-CEF_139.0.28/dullahan-1.21.0.202508272159_139.0.28_g55ab8a8_chromium-139.0.7258.139-windows64-17279703032.tar.zst + https://github.com/secondlife/dullahan/releases/download/v1.24.0-CEF_139.0.40/dullahan-1.24.0.202510081738_139.0.40_g465474a_chromium-139.0.7258.139-windows64-18353103947.tar.zst name windows64 @@ -495,7 +495,7 @@ copyright Copyright (c) 2017, Linden Research, Inc. version - 1.21.0.202508272158_139.0.28_g55ab8a8_chromium-139.0.7258.139 + 1.24.0.202510081737_139.0.40_g465474a_chromium-139.0.7258.139 name dullahan description -- cgit v1.2.3 From 57a9e51360aebf142bbbdc2663f68ebacfb7d8f5 Mon Sep 17 00:00:00 2001 From: Andrey Kleshchev <117672381+akleshchev@users.noreply.github.com> Date: Mon, 13 Oct 2025 20:16:52 +0300 Subject: #4819 WebRTC crashes after a failed login --- indra/llwebrtc/llwebrtc.cpp | 4 ++++ indra/newview/llvoicewebrtc.cpp | 15 +++++++++++++++ indra/newview/llvoicewebrtc.h | 4 +++- 3 files changed, 22 insertions(+), 1 deletion(-) diff --git a/indra/llwebrtc/llwebrtc.cpp b/indra/llwebrtc/llwebrtc.cpp index 828896f620..d5182b16e7 100644 --- a/indra/llwebrtc/llwebrtc.cpp +++ b/indra/llwebrtc/llwebrtc.cpp @@ -1495,6 +1495,10 @@ void freePeerConnection(LLWebRTCPeerConnectionInterface* peer_connection) void init(LLWebRTCLogCallback* logCallback) { + if (gWebRTCImpl) + { + return; + } gWebRTCImpl = new LLWebRTCImpl(logCallback); gWebRTCImpl->init(); } diff --git a/indra/newview/llvoicewebrtc.cpp b/indra/newview/llvoicewebrtc.cpp index 62bab7d24a..72a60c506b 100644 --- a/indra/newview/llvoicewebrtc.cpp +++ b/indra/newview/llvoicewebrtc.cpp @@ -273,6 +273,11 @@ void LLWebRTCVoiceClient::cleanupSingleton() void LLWebRTCVoiceClient::init(LLPumpIO* pump) { // constructor will set up LLVoiceClient::getInstance() + initWebRTC(); +} + +void LLWebRTCVoiceClient::initWebRTC() +{ llwebrtc::init(this); mWebRTCDeviceInterface = llwebrtc::getDeviceInterface(); @@ -292,6 +297,7 @@ void LLWebRTCVoiceClient::terminate() mVoiceEnabled = false; llwebrtc::terminate(); + mWebRTCDeviceInterface = nullptr; sShuttingDown = true; } @@ -1805,6 +1811,15 @@ void LLWebRTCVoiceClient::onChangeDetailed(const LLMute& mute) } } +void LLWebRTCVoiceClient::userAuthorized(const std::string& user_id, const LLUUID& agentID) +{ + if (sShuttingDown) + { + sShuttingDown = false; // was terminated, restart + initWebRTC(); + } +} + void LLWebRTCVoiceClient::predSetUserMute(const LLWebRTCVoiceClient::sessionStatePtr_t &session, const LLUUID &id, bool mute) { session->setUserMute(id, mute); diff --git a/indra/newview/llvoicewebrtc.h b/indra/newview/llvoicewebrtc.h index 722d81fdc2..2ce575852a 100644 --- a/indra/newview/llvoicewebrtc.h +++ b/indra/newview/llvoicewebrtc.h @@ -204,7 +204,7 @@ public: //@} // authorize the user - void userAuthorized(const std::string &user_id, const LLUUID &agentID) override {}; + void userAuthorized(const std::string &user_id, const LLUUID &agentID) override; void OnConnectionEstablished(const std::string& channelID, const LLUUID& regionID); @@ -443,6 +443,8 @@ public: boost::signals2::connection mAvatarNameCacheConnection; private: + // init or restart the WebRTC device interface. + void initWebRTC(); // Coroutine support methods //--- -- cgit v1.2.3