diff options
author | Brad Linden <brad@lindenlab.com> | 2024-08-29 13:32:34 -0700 |
---|---|---|
committer | Brad Linden <brad@lindenlab.com> | 2024-08-29 13:32:34 -0700 |
commit | ecf3002a4623ebed0ed31bcc11f743000deeac84 (patch) | |
tree | a15d60759afba2596f1f159d3011e4502514ce1f /indra/newview | |
parent | e2809755c5e4a6a6d3c8f27911865efe4020d679 (diff) | |
parent | b0fefd62adbf51f32434ba077e9f52d8a9241d15 (diff) |
Merge remote-tracking branch 'origin/release/2024.08-DeltaFPS' into develop
Diffstat (limited to 'indra/newview')
-rw-r--r-- | indra/newview/app_settings/settings.xml | 11 | ||||
-rw-r--r-- | indra/newview/gltfscenemanager.cpp | 8 | ||||
-rw-r--r-- | indra/newview/llface.cpp | 12 | ||||
-rw-r--r-- | indra/newview/llviewermenu.cpp | 15 | ||||
-rw-r--r-- | indra/newview/llviewershadermgr.cpp | 9 | ||||
-rw-r--r-- | indra/newview/llvovolume.cpp | 4 | ||||
-rw-r--r-- | indra/newview/skins/default/xui/en/notifications.xml | 11 |
7 files changed, 60 insertions, 10 deletions
diff --git a/indra/newview/app_settings/settings.xml b/indra/newview/app_settings/settings.xml index ec06582d90..6b8f698b0b 100644 --- a/indra/newview/app_settings/settings.xml +++ b/indra/newview/app_settings/settings.xml @@ -7172,6 +7172,17 @@ <key>Value</key> <integer>0</integer> </map> + <key>RenderCanUseGLTFPBROpaqueShaders</key> + <map> + <key>Comment</key> + <string>Hardware has support for GLTF scene 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/gltfscenemanager.cpp b/indra/newview/gltfscenemanager.cpp index 086f41c1cb..e55d630940 100644 --- a/indra/newview/gltfscenemanager.cpp +++ b/indra/newview/gltfscenemanager.cpp @@ -45,6 +45,7 @@ #include "llfloaterreg.h" #include "llagentbenefits.h" #include "llfilesystem.h" +#include "llviewercontrol.h" #include "boost/json.hpp" #define GLTF_SIM_SUPPORT 1 @@ -618,6 +619,13 @@ void GLTFSceneManager::render(Asset& asset, U8 variant) { LL_PROFILE_ZONE_SCOPED_CATEGORY_GLTF; + static LLCachedControl<bool> can_use_shaders(gSavedSettings, "RenderCanUseGLTFPBROpaqueShaders", true); + if (!can_use_shaders) + { + // user should already have been notified of unsupported hardware + return; + } + for (U32 ds = 0; ds < 2; ++ds) { RenderData& rd = asset.mRenderData[ds]; diff --git a/indra/newview/llface.cpp b/indra/newview/llface.cpp index df08dcf503..ccfef09b09 100644 --- a/indra/newview/llface.cpp +++ b/indra/newview/llface.cpp @@ -573,12 +573,14 @@ void LLFace::renderSelected(LLViewerTexture *imagep, const LLColor4& color) if (LLGLTFMaterial* gltf_mat = te->getGLTFRenderMaterial()) { vertex_buffer = mVertexBufferGLTF.get(); - vertex_buffer->unmapBuffer(); } } // Draw the selection marker using the correctly chosen vertex buffer - vertex_buffer->setBuffer(); - vertex_buffer->draw(LLRender::TRIANGLES, mIndicesCount, mIndicesIndex); + if (vertex_buffer) + { + vertex_buffer->setBuffer(); + vertex_buffer->draw(LLRender::TRIANGLES, mIndicesCount, mIndicesIndex); + } } gGL.popMatrix(); @@ -1217,7 +1219,8 @@ bool LLFace::getGeometryVolume(const LLVolume& volume, mVertexBufferGLTF = new LLVertexBuffer(mVertexBuffer->getTypeMask()); } - // Clone the existing vertex buffer into the temporary one + // Clone the existing vertex buffer into the temporary one + // TODO: factor out the need for mVertexBufferGLTF and make selection highlight shader work with the existing vertex buffer mVertexBuffer->clone(*mVertexBufferGLTF); // Recursive call the same function with the argument rebuild_for_gltf set to true @@ -1225,6 +1228,7 @@ bool LLFace::getGeometryVolume(const LLVolume& volume, mVertexBufferGLTF.swap(mVertexBufferGLTF, mVertexBuffer); getGeometryVolume(volume, face_index, mat_vert_in, mat_norm_in, index_offset, force_rebuild, no_debug_assert, true); mVertexBufferGLTF.swap(mVertexBufferGLTF, mVertexBuffer); + mVertexBufferGLTF->unmapBuffer(); } else if (!tep->isSelected() && mVertexBufferGLTF.notNull()) { diff --git a/indra/newview/llviewermenu.cpp b/indra/newview/llviewermenu.cpp index 97d5781566..e1664752e7 100644 --- a/indra/newview/llviewermenu.cpp +++ b/indra/newview/llviewermenu.cpp @@ -3414,7 +3414,9 @@ bool enable_os_exception() bool enable_gltf() { static LLCachedControl<bool> enablegltf(gSavedSettings, "GLTFEnabled", false); - return enablegltf; + static LLCachedControl<bool> can_use(gSavedSettings, "RenderCanUseGLTFPBROpaqueShaders", true); + + return enablegltf && can_use; } bool enable_gltf_save_as() @@ -8207,7 +8209,16 @@ class LLAdvancedClickGLTFOpen: public view_listener_t { bool handleEvent(const LLSD& userdata) { - LL::GLTFSceneManager::instance().load(); + static LLCachedControl<bool> can_use_shaders(gSavedSettings, "RenderCanUseGLTFPBROpaqueShaders", true); + if (can_use_shaders) + { + LL::GLTFSceneManager::instance().load(); + } + else + { + LLNotificationsUtil::add("NoSupportGLTFShader"); + } + return true; } }; diff --git a/indra/newview/llviewershadermgr.cpp b/indra/newview/llviewershadermgr.cpp index d1dea16bc0..5ddc00f3a0 100644 --- a/indra/newview/llviewershadermgr.cpp +++ b/indra/newview/llviewershadermgr.cpp @@ -1339,7 +1339,14 @@ bool LLViewerShaderMgr::loadShadersDeferred() success = make_gltf_variants(gGLTFPBRMetallicRoughnessProgram, use_sun_shadow); - llassert(success); + //llassert(success); + if (!success) + { + LL_WARNS() << "Failed to create GLTF PBR Metallic Roughness Shader, disabling!" << LL_ENDL; + gSavedSettings.setBOOL("RenderCanUseGLTFPBROpaqueShaders", false); + // continue as if this shader never happened + success = true; + } } if (success) diff --git a/indra/newview/llvovolume.cpp b/indra/newview/llvovolume.cpp index b7738b9135..7da4358f86 100644 --- a/indra/newview/llvovolume.cpp +++ b/indra/newview/llvovolume.cpp @@ -5766,9 +5766,7 @@ void LLVolumeGeometryManager::rebuildGeom(LLSpatialGroup* group) continue; } - if (facep->hasGeometry() && - (rigged || // <-- HACK FIXME -- getPixelArea might be incorrect for rigged objects - facep->getPixelArea() > FORCE_CULL_AREA)) // <-- don't render tiny faces + if (facep->hasGeometry()) { cur_total += facep->getGeomCount(); diff --git a/indra/newview/skins/default/xui/en/notifications.xml b/indra/newview/skins/default/xui/en/notifications.xml index 4a9dd62666..848d9aca7c 100644 --- a/indra/newview/skins/default/xui/en/notifications.xml +++ b/indra/newview/skins/default/xui/en/notifications.xml @@ -12557,4 +12557,15 @@ are wearing now. yestext="OK"/> </notification> + <notification + icon="alertmodal.tga" + name="NoSupportGLTFShader" + type="notify"> + GLTF scenes are not yet supported on your graphics hardware. + <tag>fail</tag> + <usetemplate + name="okbutton" + yestext="OK"/> + </notification> + </notifications> |