diff options
Diffstat (limited to 'indra')
-rw-r--r-- | indra/llrender/llgl.cpp | 12 | ||||
-rw-r--r-- | indra/llrender/llgl.h | 1 | ||||
-rw-r--r-- | indra/newview/app_settings/settings.xml | 11 | ||||
-rw-r--r-- | indra/newview/app_settings/shaders/class1/deferred/deferredUtil.glsl | 11 | ||||
-rw-r--r-- | indra/newview/featuretable.txt | 2 | ||||
-rw-r--r-- | indra/newview/featuretable_mac.txt | 6 | ||||
-rw-r--r-- | indra/newview/llappviewer.cpp | 21 | ||||
-rw-r--r-- | indra/newview/llglsandbox.cpp | 6 | ||||
-rw-r--r-- | indra/newview/llviewermenu.cpp | 7 | ||||
-rw-r--r-- | indra/newview/llviewershadermgr.cpp | 9 | ||||
-rw-r--r-- | indra/newview/llviewerstats.cpp | 3 | ||||
-rw-r--r-- | indra/newview/llviewertexture.cpp | 48 | ||||
-rw-r--r-- | indra/newview/llviewertexturelist.cpp | 2 | ||||
-rw-r--r-- | indra/newview/skins/default/xui/en/menu_viewer.xml | 3 |
14 files changed, 104 insertions, 38 deletions
diff --git a/indra/llrender/llgl.cpp b/indra/llrender/llgl.cpp index c14efe8ab4..0db1e27b01 100644 --- a/indra/llrender/llgl.cpp +++ b/indra/llrender/llgl.cpp @@ -1038,6 +1038,7 @@ void LLGLManager::initWGL() GLH_EXT_NAME(wglGetGPUIDsAMD) = (PFNWGLGETGPUIDSAMDPROC)GLH_EXT_GET_PROC_ADDRESS("wglGetGPUIDsAMD"); GLH_EXT_NAME(wglGetGPUInfoAMD) = (PFNWGLGETGPUINFOAMDPROC)GLH_EXT_GET_PROC_ADDRESS("wglGetGPUInfoAMD"); } + mHasNVXGpuMemoryInfo = ExtensionExists("GL_NVX_gpu_memory_info", gGLHExts.mSysExts); if (ExtensionExists("WGL_EXT_swap_control", gGLHExts.mSysExts)) { @@ -1205,6 +1206,17 @@ bool LLGLManager::initGL() LL_WARNS("RenderInit") << "VRAM Detected (AMDAssociations):" << mVRAM << LL_ENDL; } } + else if (mHasNVXGpuMemoryInfo) + { + GLint mem_kb = 0; + glGetIntegerv(GL_GPU_MEMORY_INFO_DEDICATED_VIDMEM_NVX, &mem_kb); + mVRAM = mem_kb / 1024; + + if (mVRAM != 0) + { + LL_WARNS("RenderInit") << "VRAM Detected (NVXGpuMemoryInfo):" << mVRAM << LL_ENDL; + } + } #endif #if LL_WINDOWS diff --git a/indra/llrender/llgl.h b/indra/llrender/llgl.h index be1c0a532a..cd1ba55b16 100644 --- a/indra/llrender/llgl.h +++ b/indra/llrender/llgl.h @@ -97,6 +97,7 @@ public: // Vendor-specific extensions bool mHasAMDAssociations = false; + bool mHasNVXGpuMemoryInfo = false; bool mIsAMD; bool mIsNVIDIA; diff --git a/indra/newview/app_settings/settings.xml b/indra/newview/app_settings/settings.xml index fc896b41fd..9380b0d6f7 100644 --- a/indra/newview/app_settings/settings.xml +++ b/indra/newview/app_settings/settings.xml @@ -7183,6 +7183,17 @@ <key>Value</key> <integer>1</integer> </map> + <key>RenderCanUseTerrainBakeShaders</key> + <map> + <key>Comment</key> + <string>Hardware has support for Terrain Bake shaders</string> + <key>Persist</key> + <integer>0</integer> + <key>Type</key> + <string>Boolean</string> + <key>Value</key> + <integer>1</integer> + </map> <key>RenderClass1MemoryBandwidth</key> <map> <key>Comment</key> diff --git a/indra/newview/app_settings/shaders/class1/deferred/deferredUtil.glsl b/indra/newview/app_settings/shaders/class1/deferred/deferredUtil.glsl index ab0e4fd4d8..3319e32cdf 100644 --- a/indra/newview/app_settings/shaders/class1/deferred/deferredUtil.glsl +++ b/indra/newview/app_settings/shaders/class1/deferred/deferredUtil.glsl @@ -99,10 +99,13 @@ void calcHalfVectors(vec3 lv, vec3 n, vec3 v, { l = normalize(lv); h = normalize(l + v); - nh = clamp(dot(n, h), 0.0, 1.0); - nl = clamp(dot(n, l), 0.0, 1.0); - nv = clamp(dot(n, v), 0.0, 1.0); - vh = clamp(dot(v, h), 0.0, 1.0); + + // lower bound to avoid divide by zero + float eps = 0.000001; + nh = clamp(dot(n, h), eps, 1.0); + nl = clamp(dot(n, l), eps, 1.0); + nv = clamp(dot(n, v), eps, 1.0); + vh = clamp(dot(v, h), eps, 1.0); lightDist = length(lv); } diff --git a/indra/newview/featuretable.txt b/indra/newview/featuretable.txt index 9c585f1ef8..24fd7928a6 100644 --- a/indra/newview/featuretable.txt +++ b/indra/newview/featuretable.txt @@ -208,7 +208,7 @@ RenderFlexTimeFactor 1 1.0 RenderGlowResolutionPow 1 9 RenderMaxPartCount 1 4096 RenderLocalLightCount 1 1024 -RenderTransparentWater 1 1 +RenderTransparentWater 1 0 RenderTerrainDetail 1 1 RenderTerrainLODFactor 1 2.0 RenderTerrainPBRDetail 1 0 diff --git a/indra/newview/featuretable_mac.txt b/indra/newview/featuretable_mac.txt index d66717e2c7..2e220d2b1c 100644 --- a/indra/newview/featuretable_mac.txt +++ b/indra/newview/featuretable_mac.txt @@ -135,7 +135,7 @@ RenderTerrainDetail 1 1 RenderTerrainLODFactor 1 1.0 RenderTerrainPBRDetail 1 -1 RenderTerrainPBRPlanarSampleCount 1 1 -RenderTransparentWater 1 1 +RenderTransparentWater 1 0 RenderTreeLODFactor 1 0.5 RenderVolumeLODFactor 1 1.125 RenderDeferredSSAO 1 0 @@ -172,7 +172,7 @@ RenderTerrainDetail 1 1 RenderTerrainLODFactor 1 2.0 RenderTerrainPBRDetail 1 0 RenderTerrainPBRPlanarSampleCount 1 1 -RenderTransparentWater 1 1 +RenderTransparentWater 1 0 RenderTreeLODFactor 1 0.5 RenderVolumeLODFactor 1 1.25 RenderDeferredSSAO 1 0 @@ -209,7 +209,7 @@ RenderTerrainDetail 1 1 RenderTerrainLODFactor 1 2.0 RenderTerrainPBRDetail 1 0 RenderTerrainPBRPlanarSampleCount 1 1 -RenderTransparentWater 1 1 +RenderTransparentWater 1 0 RenderTreeLODFactor 1 0.5 RenderVolumeLODFactor 1 1.375 RenderDeferredSSAO 1 0 diff --git a/indra/newview/llappviewer.cpp b/indra/newview/llappviewer.cpp index afa701c5f2..4eb4f5ae20 100644 --- a/indra/newview/llappviewer.cpp +++ b/indra/newview/llappviewer.cpp @@ -747,7 +747,9 @@ bool LLAppViewer::init() // inits from settings.xml and from strings.xml if (!initConfiguration()) { - LL_ERRS("InitInfo") << "initConfiguration() failed." << LL_ENDL; + LL_WARNS("InitInfo") << "initConfiguration() failed." << LL_ENDL; + // quit immediately + return false; } LL_INFOS("InitInfo") << "Configuration initialized." << LL_ENDL ; @@ -914,7 +916,9 @@ bool LLAppViewer::init() if (!initHardwareTest()) { // Early out from user choice. - LL_ERRS("InitInfo") << "initHardwareTest() failed." << LL_ENDL; + LL_WARNS("InitInfo") << "initHardwareTest() failed." << LL_ENDL; + // quit immediately + return false; } LL_INFOS("InitInfo") << "Hardware test initialization done." << LL_ENDL ; @@ -930,7 +934,9 @@ bool LLAppViewer::init() { std::string msg = LLTrans::getString("MBUnableToAccessFile"); OSMessageBox(msg.c_str(), LLStringUtil::null, OSMB_OK); - LL_ERRS("InitInfo") << "Failed to init cache" << LL_ENDL; + LL_WARNS("InitInfo") << "Failed to init cache" << LL_ENDL; + // quit immediately + return false; } LL_INFOS("InitInfo") << "Cache initialization is done." << LL_ENDL ; @@ -963,7 +969,9 @@ bool LLAppViewer::init() if (!gGLManager.mHasRequirements) { // Already handled with a MBVideoDrvErr - LL_ERRS("InitInfo") << "gGLManager.mHasRequirements is false." << LL_ENDL; + LL_WARNS("InitInfo") << "gGLManager.mHasRequirements is false." << LL_ENDL; + // quit immediately + return false; } // Without SSE2 support we will crash almost immediately, warn here. @@ -973,7 +981,9 @@ bool LLAppViewer::init() // all hell breaks lose. std::string msg = LLNotifications::instance().getGlobalString("UnsupportedCPUSSE2"); OSMessageBox(msg.c_str(), LLStringUtil::null, OSMB_OK); - LL_ERRS("InitInfo") << "SSE2 is not supported" << LL_ENDL; + LL_WARNS("InitInfo") << "SSE2 is not supported" << LL_ENDL; + // quit immediately + return false; } // alert the user if they are using unsupported hardware @@ -3969,7 +3979,6 @@ void LLAppViewer::forceQuit() LLApp::setQuitting(); } -//TODO: remove void LLAppViewer::fastQuit(S32 error_code) { // finish pending transfers diff --git a/indra/newview/llglsandbox.cpp b/indra/newview/llglsandbox.cpp index 19cb4d04e2..930a8c28d9 100644 --- a/indra/newview/llglsandbox.cpp +++ b/indra/newview/llglsandbox.cpp @@ -1075,6 +1075,9 @@ F32 gpu_benchmark() return -1.f; } LLImageGL::setManualImage(GL_TEXTURE_2D, 0, GL_RGBA, res,res,GL_RGBA, GL_UNSIGNED_BYTE, pixels); + // disable mipmaps and use point filtering to cause cache misses + gGL.getTexUnit(0)->setHasMipMaps(false); + gGL.getTexUnit(0)->setTextureFilteringOption(LLTexUnit::TFO_POINT); if (alloc_timer.getElapsedTimeF32() > time_limit) { @@ -1191,7 +1194,8 @@ F32 gpu_benchmark() F32 seconds = ms/1000.f; F64 samples_drawn = (F64)gBenchmarkProgram.mSamplesDrawn; - F32 samples_sec = (F32)((samples_drawn/1000000000.0)/seconds); + F64 gpixels_drawn = samples_drawn / 1000000000.0; + F32 samples_sec = (F32)(gpixels_drawn/seconds); gbps = samples_sec*4; // 4 bytes per sample LL_INFOS("Benchmark") << "Memory bandwidth is " << llformat("%.3f", gbps) << " GB/sec according to ARB_timer_query, total time " << seconds << " seconds" << LL_ENDL; diff --git a/indra/newview/llviewermenu.cpp b/indra/newview/llviewermenu.cpp index a32e5d23e3..344a9737b1 100644 --- a/indra/newview/llviewermenu.cpp +++ b/indra/newview/llviewermenu.cpp @@ -3446,6 +3446,12 @@ bool enable_gltf_upload() return enable_gltf_save_as(); } +bool enable_terrain_local_paintmap() +{ + static LLCachedControl<bool> can_use_shaders(gSavedSettings, "RenderCanUseTerrainBakeShaders", true); + return can_use_shaders; +} + class LLSelfRemoveAllAttachments : public view_listener_t { bool handleEvent(const LLSD& userdata) @@ -10223,6 +10229,7 @@ void initialize_menus() enable.add("EnableGLTF", boost::bind(&enable_gltf)); enable.add("EnableGLTFSaveAs", boost::bind(&enable_gltf_save_as)); enable.add("EnableGLTFUpload", boost::bind(&enable_gltf_upload)); + enable.add("EnableTerrainLocalPaintMap", std::bind(&enable_terrain_local_paintmap)); view_listener_t::addMenu(new LLFloaterVisible(), "FloaterVisible"); view_listener_t::addMenu(new LLShowSidetrayPanel(), "ShowSidetrayPanel"); diff --git a/indra/newview/llviewershadermgr.cpp b/indra/newview/llviewershadermgr.cpp index c422e1d3ae..a446be8b58 100644 --- a/indra/newview/llviewershadermgr.cpp +++ b/indra/newview/llviewershadermgr.cpp @@ -3156,7 +3156,14 @@ bool LLViewerShaderMgr::loadShadersInterface() const U32 value_range = (1 << bit_depth) - 1; shader->addPermutation("TERRAIN_PAINT_PRECISION", llformat("%d", value_range)); success = success && shader->createShader(); - llassert(success); + //llassert(success); + if (!success) + { + LL_WARNS() << "Failed to create shader '" << shader->mName << "', disabling!" << LL_ENDL; + gSavedSettings.setBOOL("RenderCanUseTerrainBakeShaders", false); + // continue as if this shader never happened + success = true; + } } if (success) diff --git a/indra/newview/llviewerstats.cpp b/indra/newview/llviewerstats.cpp index 3641738d9d..73aabf49d1 100644 --- a/indra/newview/llviewerstats.cpp +++ b/indra/newview/llviewerstats.cpp @@ -541,6 +541,9 @@ void send_viewer_stats(bool include_preferences) agent["run_time"] = run_time; } + // report time the viewer has spent in the foreground + agent["foreground_time"] = gForegroundTime.getElapsedTimeF32(); + // send fps only for time app spends in foreground agent["fps"] = (F32)gForegroundFrameCount / gForegroundTime.getElapsedTimeF32(); agent["version"] = LLVersionInfo::instance().getChannelAndVersion(); diff --git a/indra/newview/llviewertexture.cpp b/indra/newview/llviewertexture.cpp index bb16fec32a..d16656abfc 100644 --- a/indra/newview/llviewertexture.cpp +++ b/indra/newview/llviewertexture.cpp @@ -511,12 +511,33 @@ void LLViewerTexture::updateClass() F32 over_pct = (used - target) / target; - bool is_low = over_pct > 0.f; + bool is_sys_low = isSystemMemoryLow(); + bool is_low = is_sys_low || over_pct > 0.f; - if (isSystemMemoryLow()) + static bool was_low = false; + static bool was_sys_low = false; + + 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) + { // if we're low on system memory, emergency purge off screen textures to avoid a death spiral + LL_WARNS() << "Low system memory detected, emergency downrezzing off screen textures" << LL_ENDL; + for (auto& image : gTextureList) + { + gTextureList.updateImageDecodePriority(image, false /*will modify gTextureList otherwise!*/); + } + } + } + + was_low = is_low; + was_sys_low = is_sys_low; + + if (is_low) { - is_low = true; - // System RAM is low -> ramp up discard bias over time to free memory + // ramp up discard bias over time to free memory if (sEvaluationTimer.getElapsedTimeF32() > MEMORY_CHECK_WAIT_TIME) { static LLCachedControl<F32> low_mem_min_discard_increment(gSavedSettings, "RenderLowMemMinDiscardIncrement", .1f); @@ -526,29 +547,16 @@ void LLViewerTexture::updateClass() } else { - sDesiredDiscardBias = llmax(sDesiredDiscardBias, 1.f + over_pct); + // don't execute above until the slam to 1.5 has a chance to take effect + sEvaluationTimer.reset(); + // lower discard bias over time when free memory is available if (sDesiredDiscardBias > 1.f && over_pct < 0.f) { sDesiredDiscardBias -= gFrameIntervalSeconds * 0.01f; } } - static bool was_low = false; - if (is_low && !was_low) - { - LL_WARNS() << "Low system memory detected, emergency downrezzing off screen textures" << LL_ENDL; - sDesiredDiscardBias = llmax(sDesiredDiscardBias, 1.5f); - - for (auto& image : gTextureList) - { - gTextureList.updateImageDecodePriority(image, false /*will modify gTextureList otherwise!*/); - } - } - - was_low = is_low; - - // set to max discard bias if the window has been backgrounded for a while static bool was_backgrounded = false; static LLFrameTimer backgrounded_timer; diff --git a/indra/newview/llviewertexturelist.cpp b/indra/newview/llviewertexturelist.cpp index 2df60dbf6c..08e9151940 100644 --- a/indra/newview/llviewertexturelist.cpp +++ b/indra/newview/llviewertexturelist.cpp @@ -964,7 +964,7 @@ void LLViewerTextureList::updateImageDecodePriority(LLViewerFetchedTexture* imag // this is an alternative to decaying mMaxVirtualSize over time // that keeps textures from continously downrezzing and uprezzing in the background - if (LLViewerTexture::sDesiredDiscardBias > 2.f || + if (LLViewerTexture::sDesiredDiscardBias > 1.5f || (!on_screen && LLViewerTexture::sDesiredDiscardBias > 1.f)) { imagep->mMaxVirtualSize = 0.f; diff --git a/indra/newview/skins/default/xui/en/menu_viewer.xml b/indra/newview/skins/default/xui/en/menu_viewer.xml index 82d2277dfa..7fe9d0efe5 100644 --- a/indra/newview/skins/default/xui/en/menu_viewer.xml +++ b/indra/newview/skins/default/xui/en/menu_viewer.xml @@ -3672,9 +3672,10 @@ function="World.EnvPreset" <menu_item_separator/> <menu_item_call - enabled="true" label="Create Local Paintmap" name="Create Local Paintmap"> + <menu_item_call.on_enable + function="EnableTerrainLocalPaintMap"/> <menu_item_call.on_click function="Advanced.TerrainCreateLocalPaintMap" /> </menu_item_call> |