From 7f0c81918575d3f05e4eadc160b600eaa8b383d1 Mon Sep 17 00:00:00 2001 From: mobserveur Date: Sat, 30 Aug 2025 01:59:43 +0200 Subject: Performance Optimisations, Bloom effect, Visuals Panel This commit contains performance optimisations in the the pipeline, framebuffer, vertexbuffer, reflection probes, shadows. It also fixes many opengl errors, modifies the opengl debugging, and adds a visuals effects panel. --- indra/newview/llappviewer.cpp | 48 +++++++++++++++++++++++-------------------- 1 file changed, 26 insertions(+), 22 deletions(-) (limited to 'indra/newview/llappviewer.cpp') diff --git a/indra/newview/llappviewer.cpp b/indra/newview/llappviewer.cpp index 44276d8767..5d107e69db 100644 --- a/indra/newview/llappviewer.cpp +++ b/indra/newview/llappviewer.cpp @@ -592,6 +592,8 @@ static void settings_modify() LLVOSurfacePatch::sLODFactor = gSavedSettings.getF32("RenderTerrainLODFactor"); LLVOSurfacePatch::sLODFactor *= LLVOSurfacePatch::sLODFactor; //square lod factor to get exponential range of [1,4] gDebugGL = gDebugGLSession || gDebugSession; + bool noGLDebug = gSavedSettings.getBOOL("MPNoGLDebug"); + if(noGLDebug) gDebugGL = false; gDebugPipeline = gSavedSettings.getBOOL("RenderDebugPipeline"); } @@ -1351,12 +1353,11 @@ bool LLAppViewer::frame() bool LLAppViewer::doFrame() { U32 fpsLimitMaxFps = (U32)gSavedSettings.getU32("MaxFPS"); - if(fpsLimitMaxFps>120) fpsLimitMaxFps=0; + if(fpsLimitMaxFps > 120) fpsLimitMaxFps = 0; using TimePoint = std::chrono::steady_clock::time_point; - - U64 fpsLimitSleepFor = 0; - TimePoint fpsLimitFrameStartTime = std::chrono::steady_clock::now(); + U64 additionalSleepTime = 0; + TimePoint frameStartTime = std::chrono::steady_clock::now(); #ifdef LL_DISCORD { @@ -1535,18 +1536,6 @@ bool LLAppViewer::doFrame() } } - if(fpsLimitMaxFps > 0) - { - auto elapsed = std::chrono::steady_clock::now() - fpsLimitFrameStartTime; - - long long fpsLimitFrameTime = std::chrono::duration_cast(elapsed).count(); - U64 desired_time_us = (U32)(1000000.f / fpsLimitMaxFps); - if((fpsLimitFrameTime+1000) < desired_time_us) - { - fpsLimitSleepFor = (desired_time_us - fpsLimitFrameTime - 1000) * 1.0; - } - } - { LL_PROFILE_ZONE_NAMED_CATEGORY_APP("df pauseMainloopTimeout"); pingMainloopTimeout("Main:Sleep"); @@ -1559,13 +1548,25 @@ bool LLAppViewer::doFrame() //LL_RECORD_BLOCK_TIME(SLEEP2); LL_PROFILE_ZONE_WARN("Sleep2"); - if(fpsLimitSleepFor) + auto elapsed = std::chrono::steady_clock::now() - frameStartTime; + long long frameTime = std::chrono::duration_cast(elapsed).count(); + + if(fpsLimitMaxFps > 0) { -#if LL_WINDOWS - std::this_thread::sleep_for(std::chrono::microseconds(fpsLimitSleepFor)); -#else - usleep(fpsLimitSleepFor); -#endif + U64 desired_time_us = (U32)(1000000.f / fpsLimitMaxFps); + if((frameTime+1000) < desired_time_us) + { + additionalSleepTime = 0.92 * (F64)(desired_time_us - frameTime); + if(additionalSleepTime < 200) + { + additionalSleepTime = 0; + } + } + } + + if(additionalSleepTime > 0) + { + std::this_thread::sleep_for(std::chrono::microseconds(additionalSleepTime)); } // yield some time to the os based on command line option @@ -1661,6 +1662,9 @@ bool LLAppViewer::doFrame() LL_PROFILE_ZONE_NAMED_CATEGORY_APP("df resumeMainloopTimeout"); resumeMainloopTimeout(); } + + //swap(); + pingMainloopTimeout("Main:End"); } } -- cgit v1.2.3 From ccf0114f36968d6cf6dfb11e1c5a035406314924 Mon Sep 17 00:00:00 2001 From: mobserveur Date: Mon, 8 Sep 2025 17:26:53 +0200 Subject: Optimisations and experimental HDR display support on mac This commit completes the previous ones for performance optimisations, and adds HDR display support on mac --- indra/newview/llappviewer.cpp | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'indra/newview/llappviewer.cpp') diff --git a/indra/newview/llappviewer.cpp b/indra/newview/llappviewer.cpp index 5d107e69db..dfffdbf482 100644 --- a/indra/newview/llappviewer.cpp +++ b/indra/newview/llappviewer.cpp @@ -305,6 +305,7 @@ extern bool gDebugGL; #if LL_DARWIN extern bool gHiDPISupport; +extern bool gHDRDisplaySupport; #endif //////////////////////////////////////////////////////////// @@ -581,6 +582,7 @@ static void settings_to_globals() LLWindowMacOSX::sUseMultGL = gSavedSettings.getBOOL("RenderAppleUseMultGL"); #endif // LL_SDL gHiDPISupport = gSavedSettings.getBOOL("RenderHiDPI"); + gHDRDisplaySupport = gSavedSettings.getBOOL("MPHDRDisplay"); #endif } @@ -1297,11 +1299,15 @@ 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 +/* +#ifndef LL_X86_64 F32Gigabytes max_heap_size_gb = (F32Gigabytes)gSavedSettings.getF32("MaxHeapSize") ; #else - F32Gigabytes max_heap_size_gb = (F32Gigabytes)gSavedSettings.getF32("MaxHeapSize64"); +*/ +F32Gigabytes max_heap_size_gb = (F32Gigabytes)gSavedSettings.getF32("MaxHeapSize64"); +/* #endif +*/ LLMemory::initMaxHeapSizeGB(max_heap_size_gb); } -- cgit v1.2.3 From 317dcdea1ca8d1f540187af47fc23a36ad8232aa Mon Sep 17 00:00:00 2001 From: mobserveur Date: Sat, 30 Aug 2025 01:59:43 +0200 Subject: Performance Optimisations, Bloom effect, Visuals Panel This commit contains performance optimisations in the the pipeline, framebuffer, vertexbuffer, reflection probes, shadows. It also fixes many opengl errors, modifies the opengl debugging, and adds a visuals effects panel. --- indra/newview/llappviewer.cpp | 48 +++++++++++++++++++++++-------------------- 1 file changed, 26 insertions(+), 22 deletions(-) (limited to 'indra/newview/llappviewer.cpp') diff --git a/indra/newview/llappviewer.cpp b/indra/newview/llappviewer.cpp index 44276d8767..5d107e69db 100644 --- a/indra/newview/llappviewer.cpp +++ b/indra/newview/llappviewer.cpp @@ -592,6 +592,8 @@ static void settings_modify() LLVOSurfacePatch::sLODFactor = gSavedSettings.getF32("RenderTerrainLODFactor"); LLVOSurfacePatch::sLODFactor *= LLVOSurfacePatch::sLODFactor; //square lod factor to get exponential range of [1,4] gDebugGL = gDebugGLSession || gDebugSession; + bool noGLDebug = gSavedSettings.getBOOL("MPNoGLDebug"); + if(noGLDebug) gDebugGL = false; gDebugPipeline = gSavedSettings.getBOOL("RenderDebugPipeline"); } @@ -1351,12 +1353,11 @@ bool LLAppViewer::frame() bool LLAppViewer::doFrame() { U32 fpsLimitMaxFps = (U32)gSavedSettings.getU32("MaxFPS"); - if(fpsLimitMaxFps>120) fpsLimitMaxFps=0; + if(fpsLimitMaxFps > 120) fpsLimitMaxFps = 0; using TimePoint = std::chrono::steady_clock::time_point; - - U64 fpsLimitSleepFor = 0; - TimePoint fpsLimitFrameStartTime = std::chrono::steady_clock::now(); + U64 additionalSleepTime = 0; + TimePoint frameStartTime = std::chrono::steady_clock::now(); #ifdef LL_DISCORD { @@ -1535,18 +1536,6 @@ bool LLAppViewer::doFrame() } } - if(fpsLimitMaxFps > 0) - { - auto elapsed = std::chrono::steady_clock::now() - fpsLimitFrameStartTime; - - long long fpsLimitFrameTime = std::chrono::duration_cast(elapsed).count(); - U64 desired_time_us = (U32)(1000000.f / fpsLimitMaxFps); - if((fpsLimitFrameTime+1000) < desired_time_us) - { - fpsLimitSleepFor = (desired_time_us - fpsLimitFrameTime - 1000) * 1.0; - } - } - { LL_PROFILE_ZONE_NAMED_CATEGORY_APP("df pauseMainloopTimeout"); pingMainloopTimeout("Main:Sleep"); @@ -1559,13 +1548,25 @@ bool LLAppViewer::doFrame() //LL_RECORD_BLOCK_TIME(SLEEP2); LL_PROFILE_ZONE_WARN("Sleep2"); - if(fpsLimitSleepFor) + auto elapsed = std::chrono::steady_clock::now() - frameStartTime; + long long frameTime = std::chrono::duration_cast(elapsed).count(); + + if(fpsLimitMaxFps > 0) { -#if LL_WINDOWS - std::this_thread::sleep_for(std::chrono::microseconds(fpsLimitSleepFor)); -#else - usleep(fpsLimitSleepFor); -#endif + U64 desired_time_us = (U32)(1000000.f / fpsLimitMaxFps); + if((frameTime+1000) < desired_time_us) + { + additionalSleepTime = 0.92 * (F64)(desired_time_us - frameTime); + if(additionalSleepTime < 200) + { + additionalSleepTime = 0; + } + } + } + + if(additionalSleepTime > 0) + { + std::this_thread::sleep_for(std::chrono::microseconds(additionalSleepTime)); } // yield some time to the os based on command line option @@ -1661,6 +1662,9 @@ bool LLAppViewer::doFrame() LL_PROFILE_ZONE_NAMED_CATEGORY_APP("df resumeMainloopTimeout"); resumeMainloopTimeout(); } + + //swap(); + pingMainloopTimeout("Main:End"); } } -- cgit v1.2.3