From ddbe1ff98159e5eae3153067e3ca6f90c10bceb4 Mon Sep 17 00:00:00 2001 From: Andrey Lihatskiy Date: Thu, 13 Feb 2025 16:13:50 +0200 Subject: Fix xcode16 build errors --- indra/llcommon/fsyspath.h | 6 +++++- 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 | 18 ++++++++++-------- indra/newview/llviewermedia.cpp | 4 ++-- indra/newview/llviewerwindow.cpp | 2 +- indra/newview/llvoicewebrtc.cpp | 20 ++++++++++---------- indra/viewer_components/login/lllogin.cpp | 2 +- 14 files changed, 44 insertions(+), 38 deletions(-) diff --git a/indra/llcommon/fsyspath.h b/indra/llcommon/fsyspath.h index 1b4aec09b4..e9c96edce3 100644 --- a/indra/llcommon/fsyspath.h +++ b/indra/llcommon/fsyspath.h @@ -68,7 +68,11 @@ public: } // shadow base-class string() method with UTF-8 aware method - std::string string() const { return super::u8string(); } + std::string string() const + { + auto u8 = super::u8string(); + return std::string(u8.begin(), u8.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..c8cfe88ec3 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 " << static_cast(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..087761cbd0 100644 --- a/indra/newview/lltexturefetch.cpp +++ b/indra/newview/lltexturefetch.cpp @@ -29,6 +29,7 @@ #include #include #include +#include #include "lltexturefetch.h" @@ -2843,7 +2844,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,29 +3572,30 @@ TFReqSendMetrics::doWork(LLTextureFetch * fetcher) //if (! gViewerAssetStatsThread1) // return true; - static volatile bool reporting_started(false); - static volatile S32 report_sequence(0); + static std::atomic reporting_started(false); + static std::atomic 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. static const S32 metrics_data_version = 2; - bool initial_report = !reporting_started; + bool initial_report = !reporting_started.load(); mStatsSD["session_id"] = mSessionID; mStatsSD["agent_id"] = mAgentID; mStatsSD["message"] = "ViewerAssetMetrics"; - mStatsSD["sequence"] = report_sequence; + mStatsSD["sequence"] = report_sequence.load(); mStatsSD["initial"] = initial_report; mStatsSD["version"] = metrics_data_version; mStatsSD["break"] = static_cast(LLTextureFetch::svMetricsDataBreak); // Update sequence number - if (S32_MAX == ++report_sequence) + if (S32_MAX == report_sequence.fetch_add(1)) { - report_sequence = 0; + report_sequence.store(0); } - reporting_started = true; + + reporting_started.store(true); // Limit the size of the stats report if necessary. 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..93c217a7ba 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) { @@ -2888,7 +2888,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 +3044,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 34c3eed88ab21bf3c8419a051dfc41853a831ca7 Mon Sep 17 00:00:00 2001 From: Andrey Lihatskiy Date: Thu, 13 Feb 2025 17:40:40 +0200 Subject: Bump macos runner to os version 15 with xcode 16.1 --- .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 7d6bcd2bc4..60ad7e8fe5 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -42,7 +42,7 @@ jobs: needs: setup strategy: matrix: - runner: [windows-large, macos-12-large] + runner: [windows-large, macos-15-xlarge] configuration: ${{ fromJSON(needs.setup.outputs.configurations) }} runs-on: ${{ matrix.runner }} outputs: @@ -64,7 +64,7 @@ jobs: # autobuild-package.xml. AUTOBUILD_VCS_INFO: "true" AUTOBUILD_VSVER: "170" - DEVELOPER_DIR: "/Applications/Xcode_14.0.1.app/Contents/Developer" + DEVELOPER_DIR: "/Applications/Xcode_16.1.app/Contents/Developer" # Ensure that Linden viewer builds engage Bugsplat. BUGSPLAT_DB: ${{ needs.setup.outputs.bugsplat_db }} build_coverity: false -- cgit v1.2.3 From d74b30b4ec3b1974ee0d781fb34b1c9518b9985d Mon Sep 17 00:00:00 2001 From: Andrey Lihatskiy Date: Thu, 13 Feb 2025 17:53:06 +0200 Subject: Follow-up fixes from develop --- indra/CMakeLists.txt | 5 +++++ indra/llrender/llfontfreetype.cpp | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/indra/CMakeLists.txt b/indra/CMakeLists.txt index 422927704a..3170dbc180 100644 --- a/indra/CMakeLists.txt +++ b/indra/CMakeLists.txt @@ -29,6 +29,11 @@ else() set( USE_AUTOBUILD_3P ON ) endif() +if (NOT DEFINED CMAKE_CXX_STANDARD) + set(CMAKE_CXX_STANDARD 20) +endif() +set(CMAKE_CXX_STANDARD_REQUIRED ON) + include(Variables) include(BuildVersion) diff --git a/indra/llrender/llfontfreetype.cpp b/indra/llrender/llfontfreetype.cpp index c8cfe88ec3..38dc23d1dc 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 " << static_cast(wch) << LL_ENDL; + LL_ERRS() << "Out of memory loading glyph for character " << llformat("U+%xu", U32(wch)) << LL_ENDL; } std::string message = llformat( -- cgit v1.2.3 From c60061b504c7d72e627cdf24ba1c9131c4057286 Mon Sep 17 00:00:00 2001 From: "Jonathan \"Geenz\" Goodman" Date: Fri, 14 Feb 2025 13:16:35 -0500 Subject: Switch from GL_RGB16F to GL_R11F_G11F_B10F for probes (#3562) * #3561 Switch from GL_RGB16F to GL_R11F_G11F_B10F for reflection probes to help reduce memory bandwidth and VRAM pressure. --- indra/llrender/llcubemaparray.cpp | 2 +- indra/llrender/llimagegl.cpp | 1 + indra/newview/llreflectionmapmanager.cpp | 4 ++-- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/indra/llrender/llcubemaparray.cpp b/indra/llrender/llcubemaparray.cpp index 635f079581..d0a97dc2c6 100644 --- a/indra/llrender/llcubemaparray.cpp +++ b/indra/llrender/llcubemaparray.cpp @@ -127,7 +127,7 @@ void LLCubeMapArray::allocate(U32 resolution, U32 components, U32 count, bool us bind(0); free_cur_tex_image(); - U32 format = components == 4 ? GL_RGBA16F : GL_RGB16F; + U32 format = components == 4 ? GL_RGBA16F : GL_R11F_G11F_B10F; if (!hdr) { format = components == 4 ? GL_RGBA8 : GL_RGB8; diff --git a/indra/llrender/llimagegl.cpp b/indra/llrender/llimagegl.cpp index 0bfcb5d9d2..3f8903ca09 100644 --- a/indra/llrender/llimagegl.cpp +++ b/indra/llrender/llimagegl.cpp @@ -330,6 +330,7 @@ S32 LLImageGL::dataFormatBits(S32 dataformat) case GL_RGB: return 24; case GL_SRGB: return 24; case GL_RGB8: return 24; + case GL_R11F_G11F_B10F: return 32; case GL_RGBA: return 32; case GL_RGBA8: return 32; case GL_RGB10_A2: return 32; diff --git a/indra/newview/llreflectionmapmanager.cpp b/indra/newview/llreflectionmapmanager.cpp index 4760ab376e..9a20977652 100644 --- a/indra/newview/llreflectionmapmanager.cpp +++ b/indra/newview/llreflectionmapmanager.cpp @@ -227,7 +227,7 @@ void LLReflectionMapManager::update() if (!mRenderTarget.isComplete()) { - U32 color_fmt = render_hdr ? GL_RGBA16F : GL_RGBA8; + U32 color_fmt = render_hdr ? GL_R11F_G11F_B10F : GL_RGB8; U32 targetRes = mProbeResolution * 4; // super sample mRenderTarget.allocate(targetRes, targetRes, color_fmt, true); } @@ -240,7 +240,7 @@ void LLReflectionMapManager::update() mMipChain.resize(count); for (U32 i = 0; i < count; ++i) { - mMipChain[i].allocate(res, res, render_hdr ? GL_RGB16F : GL_RGB8); + mMipChain[i].allocate(res, res, render_hdr ? GL_R11F_G11F_B10F : GL_RGB8); res /= 2; } } -- cgit v1.2.3 From b0d80552b3177269eb24ef9a1e0d58a98d95a96f Mon Sep 17 00:00:00 2001 From: Andrey Kleshchev <117672381+akleshchev@users.noreply.github.com> Date: Sat, 15 Feb 2025 09:51:22 +0200 Subject: #2639 GPU test twice to fix misreported bandwidth (#3558) A workaround, hopefully temporary. First test returns half the throughput, do two tests. May be caused by driver, may be some 'energy saving', will need to be checked later. It was working the same way prior to ExtraFPS, but viewer was running an extra CPU test. --- indra/newview/llglsandbox.cpp | 66 +++++++++++++++++++++++++------------------ 1 file changed, 39 insertions(+), 27 deletions(-) diff --git a/indra/newview/llglsandbox.cpp b/indra/newview/llglsandbox.cpp index 112008172e..5484ce6276 100644 --- a/indra/newview/llglsandbox.cpp +++ b/indra/newview/llglsandbox.cpp @@ -903,6 +903,39 @@ private: }; +F32 shader_timer_benchmark(std::vector & dest, TextureHolder & texHolder, U32 textures_count, LLVertexBuffer * buff, F32 &seconds) +{ + // run GPU timer benchmark + + //number of samples to take + const S32 samples = 64; + + { + ShaderProfileHelper initProfile; + dest[0].bindTarget(); + gBenchmarkProgram.bind(); + for (S32 c = 0; c < samples; ++c) + { + for (U32 i = 0; i < textures_count; ++i) + { + texHolder.bind(i); + buff->setBuffer(); + buff->drawArrays(LLRender::TRIANGLES, 0, 3); + } + } + gBenchmarkProgram.unbind(); + dest[0].flush(); + } + + F32 ms = gBenchmarkProgram.mTimeElapsed / 1000000.f; + seconds = ms / 1000.f; + + F64 samples_drawn = (F64)gBenchmarkProgram.mSamplesDrawn; + F64 gpixels_drawn = samples_drawn / 1000000000.0; + F32 samples_sec = (F32)(gpixels_drawn / seconds); + return samples_sec * 4; // 4 bytes per sample +} + //----------------------------------------------------------------------------- // gpu_benchmark() // returns measured memory bandwidth of GPU in gigabytes per second @@ -944,9 +977,6 @@ F32 gpu_benchmark() //number of textures const U32 count = 32; - //number of samples to take - const S32 samples = 64; - //time limit, allocation operations shouldn't take longer then 30 seconds, same for actual benchmark. const F32 time_limit = 30; @@ -1036,33 +1066,15 @@ F32 gpu_benchmark() LLGLSLShader::unbind(); - // run GPU timer benchmark - { - ShaderProfileHelper initProfile; - dest[0].bindTarget(); - gBenchmarkProgram.bind(); - for (S32 c = 0; c < samples; ++c) - { - for (U32 i = 0; i < count; ++i) - { - texHolder.bind(i); - buff->setBuffer(); - buff->drawArrays(LLRender::TRIANGLES, 0, 3); - } - } - gBenchmarkProgram.unbind(); - dest[0].flush(); - } + // run GPU timer benchmark twice + F32 seconds = 0; + F32 gbps = shader_timer_benchmark(dest, texHolder, count, buff.get(), seconds); - F32 ms = gBenchmarkProgram.mTimeElapsed/1000000.f; - F32 seconds = ms/1000.f; + LL_INFOS("Benchmark") << "Memory bandwidth, 1st run is " << llformat("%.3f", gbps) << " GB/sec according to ARB_timer_query, total time " << seconds << " seconds" << LL_ENDL; - F64 samples_drawn = (F64)gBenchmarkProgram.mSamplesDrawn; - F64 gpixels_drawn = samples_drawn / 1000000000.0; - F32 samples_sec = (F32)(gpixels_drawn/seconds); - F32 gbps = samples_sec*4; // 4 bytes per sample + gbps = shader_timer_benchmark(dest, texHolder, count, buff.get(), seconds); - LL_INFOS("Benchmark") << "Memory bandwidth is " << llformat("%.3f", gbps) << " GB/sec according to ARB_timer_query, total time " << seconds << " seconds" << LL_ENDL; + LL_INFOS("Benchmark") << "Memory bandwidth, final run is " << llformat("%.3f", gbps) << " GB/sec according to ARB_timer_query, total time " << seconds << " seconds" << LL_ENDL; return gbps; } -- cgit v1.2.3 From 9b0c167b84f4f5a1f691ab57270dc30fa58bc800 Mon Sep 17 00:00:00 2001 From: Andrey Kleshchev Date: Mon, 17 Feb 2025 22:22:37 +0200 Subject: #3557 Waves not applying without Transparent Water --- indra/newview/app_settings/shaders/class3/environment/waterF.glsl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/indra/newview/app_settings/shaders/class3/environment/waterF.glsl b/indra/newview/app_settings/shaders/class3/environment/waterF.glsl index c56e38d016..35b2f8bd10 100644 --- a/indra/newview/app_settings/shaders/class3/environment/waterF.glsl +++ b/indra/newview/app_settings/shaders/class3/environment/waterF.glsl @@ -256,7 +256,7 @@ void main() #endif vec3 sunlit_linear = srgb_to_linear(sunlit); - float fade = 0; + float fade = 1; #ifdef TRANSPARENT_WATER float depth = texture(depthMap, distort).r; -- cgit v1.2.3 From 8114850e947f2a76e54912524722c48f22851228 Mon Sep 17 00:00:00 2001 From: Maxim Nikolenko Date: Tue, 18 Feb 2025 11:33:32 +0200 Subject: #3511 fix for PBR skies being too bright on Low Graphics --- indra/llinventory/llsettingssky.cpp | 3 ++- indra/llinventory/llsettingssky.h | 1 + indra/newview/llsettingsvo.cpp | 4 ++++ 3 files changed, 7 insertions(+), 1 deletion(-) diff --git a/indra/llinventory/llsettingssky.cpp b/indra/llinventory/llsettingssky.cpp index be64578d54..ff28c30563 100644 --- a/indra/llinventory/llsettingssky.cpp +++ b/indra/llinventory/llsettingssky.cpp @@ -137,7 +137,8 @@ const std::string LLSettingsSky::SETTING_REFLECTION_PROBE_AMBIANCE("reflection_p const LLUUID LLSettingsSky::DEFAULT_ASSET_ID("651510b8-5f4d-8991-1592-e7eeab2a5a06"); -F32 LLSettingsSky::sAutoAdjustProbeAmbiance = 1.f; +const F32 LLSettingsSky::DEFAULT_AUTO_ADJUST_PROBE_AMBIANCE = 1.f; +F32 LLSettingsSky::sAutoAdjustProbeAmbiance = DEFAULT_AUTO_ADJUST_PROBE_AMBIANCE; static const LLUUID DEFAULT_SUN_ID("32bfbcea-24b1-fb9d-1ef9-48a28a63730f"); // dataserver static const LLUUID DEFAULT_MOON_ID("d07f6eed-b96a-47cd-b51d-400ad4a1c428"); // dataserver diff --git a/indra/llinventory/llsettingssky.h b/indra/llinventory/llsettingssky.h index 801fafff4b..ff75aea549 100644 --- a/indra/llinventory/llsettingssky.h +++ b/indra/llinventory/llsettingssky.h @@ -103,6 +103,7 @@ public: static const LLUUID DEFAULT_ASSET_ID; + static const F32 DEFAULT_AUTO_ADJUST_PROBE_AMBIANCE; static F32 sAutoAdjustProbeAmbiance; typedef PTR_NAMESPACE::shared_ptr ptr_t; diff --git a/indra/newview/llsettingsvo.cpp b/indra/newview/llsettingsvo.cpp index 62df6cd275..6023f6885d 100644 --- a/indra/newview/llsettingsvo.cpp +++ b/indra/newview/llsettingsvo.cpp @@ -832,6 +832,10 @@ void LLSettingsVOSky::applySpecial(void *ptarget, bool force) { shader->uniform3fv(LLShaderMgr::AMBIENT, LLVector3(ambient.mV)); shader->uniform1f(LLShaderMgr::SKY_HDR_SCALE, sqrtf(g)*2.0f); // use a modifier here so 1.0 maps to the "most desirable" default and the maximum value doesn't go off the rails + + // Low quality setting + if (!LLPipeline::sReflectionProbesEnabled) + probe_ambiance = DEFAULT_AUTO_ADJUST_PROBE_AMBIANCE; } else if (psky->canAutoAdjust() && should_auto_adjust) { // auto-adjust legacy sky to take advantage of probe ambiance -- cgit v1.2.3 From 60121683eab4085e7d7b0e364c3c4c0089eebf32 Mon Sep 17 00:00:00 2001 From: Andrey Kleshchev Date: Tue, 18 Feb 2025 17:22:04 +0200 Subject: #3520 Name name cache based on grid --- indra/newview/llappviewer.cpp | 35 +++++++++++++++++++++++++++-------- 1 file changed, 27 insertions(+), 8 deletions(-) diff --git a/indra/newview/llappviewer.cpp b/indra/newview/llappviewer.cpp index c770b7c917..e1568c40c3 100644 --- a/indra/newview/llappviewer.cpp +++ b/indra/newview/llappviewer.cpp @@ -4464,11 +4464,32 @@ void LLAppViewer::saveFinalSnapshot() } } +static const char PRODUCTION_CACHE_FORMAT_STRING[] = "%s.%s"; +static const char GRID_CACHE_FORMAT_STRING[] = "%s.%s.%s"; +std::string get_name_cache_filename(const std::string &base_file, const std::string& extention) +{ + std::string filename; + std::string path(gDirUtilp->getExpandedFilename(LL_PATH_CACHE, base_file)); + if (LLGridManager::getInstance()->isInProductionGrid()) + { + filename = llformat(PRODUCTION_CACHE_FORMAT_STRING, path.c_str(), extention.c_str()); + } + else + { + // NOTE: The inventory cache filenames now include the grid name. + // Add controls against directory traversal or problematic pathname lengths + // if your viewer uses grid names from an untrusted source. + const std::string& grid_id_str = LLGridManager::getInstance()->getGridId(); + const std::string& grid_id_lower = utf8str_tolower(grid_id_str); + filename = llformat(GRID_CACHE_FORMAT_STRING, path.c_str(), grid_id_lower.c_str(), extention.c_str()); + } + return filename; +} + void LLAppViewer::loadNameCache() { // display names cache - std::string filename = - gDirUtilp->getExpandedFilename(LL_PATH_CACHE, "avatar_name_cache.xml"); + std::string filename = get_name_cache_filename("avatar_name_cache", "xml"); LL_INFOS("AvNameCache") << filename << LL_ENDL; llifstream name_cache_stream(filename.c_str()); if(name_cache_stream.is_open()) @@ -4483,8 +4504,8 @@ void LLAppViewer::loadNameCache() if (!gCacheName) return; - std::string name_cache; - name_cache = gDirUtilp->getExpandedFilename(LL_PATH_CACHE, "name.cache"); + // is there a reason for the "cache" extention? + std::string name_cache = get_name_cache_filename("name", "cache"); llifstream cache_file(name_cache.c_str()); if(cache_file.is_open()) { @@ -4495,8 +4516,7 @@ void LLAppViewer::loadNameCache() void LLAppViewer::saveNameCache() { // display names cache - std::string filename = - gDirUtilp->getExpandedFilename(LL_PATH_CACHE, "avatar_name_cache.xml"); + std::string filename = get_name_cache_filename("avatar_name_cache", "xml"); llofstream name_cache_stream(filename.c_str()); if(name_cache_stream.is_open()) { @@ -4506,8 +4526,7 @@ void LLAppViewer::saveNameCache() // real names cache if (gCacheName) { - std::string name_cache; - name_cache = gDirUtilp->getExpandedFilename(LL_PATH_CACHE, "name.cache"); + std::string name_cache = get_name_cache_filename("name", "cache"); llofstream cache_file(name_cache.c_str()); if(cache_file.is_open()) { -- cgit v1.2.3 From fd0227c52c1e45fc3ae7abd90a14d7077b1cfdd1 Mon Sep 17 00:00:00 2001 From: Andrey Kleshchev Date: Tue, 18 Feb 2025 17:22:58 +0200 Subject: #3551 Crash at findItemByID --- indra/newview/llchiclet.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/indra/newview/llchiclet.cpp b/indra/newview/llchiclet.cpp index e8a069dfdb..0cad51137c 100644 --- a/indra/newview/llchiclet.cpp +++ b/indra/newview/llchiclet.cpp @@ -240,10 +240,11 @@ void LLNotificationChiclet::setCounter(S32 counter) bool LLNotificationChiclet::ChicletNotificationChannel::filterNotification( LLNotificationPtr notification ) { bool displayNotification; + LLFloaterNotificationsTabbed* floater = LLFloaterNotificationsTabbed::getInstance(); if ( (notification->getName() == "ScriptDialog") // special case for scripts // if there is no toast window for the notification, filter it //|| (!LLNotificationWellWindow::getInstance()->findItemByID(notification->getID())) - || (!LLFloaterNotificationsTabbed::getInstance()->findItemByID(notification->getID(), notification->getName())) + || (floater && !floater->findItemByID(notification->getID(), notification->getName())) ) { displayNotification = false; -- cgit v1.2.3