diff options
author | Cosmic Linden <cosmic@lindenlab.com> | 2024-10-07 14:30:29 -0700 |
---|---|---|
committer | Cosmic Linden <cosmic@lindenlab.com> | 2024-10-11 10:39:22 -0700 |
commit | 81cc4fa7d61e838413b912a4ed2d957cc65bcb46 (patch) | |
tree | 2be1a5e635a58667d784715ad8218ecdf5bcc1cf /indra/newview/llviewershadermgr.cpp | |
parent | 642ace3c75d08cc55370374f5a091f0c8ff41a4c (diff) |
secondlife/viewer#1883: (WIP/Alpha/WOMM) Fix some compiler and runtime errors
Diffstat (limited to 'indra/newview/llviewershadermgr.cpp')
-rw-r--r-- | indra/newview/llviewershadermgr.cpp | 38 |
1 files changed, 24 insertions, 14 deletions
diff --git a/indra/newview/llviewershadermgr.cpp b/indra/newview/llviewershadermgr.cpp index 8e7af28d41..a6d397c039 100644 --- a/indra/newview/llviewershadermgr.cpp +++ b/indra/newview/llviewershadermgr.cpp @@ -3171,22 +3171,32 @@ bool LLViewerShaderMgr::loadShadersInterface() } } - if (success) + if (gSavedSettings.getBOOL("LocalTerrainPaintEnabled")) { - LLGLSLShader* shader = &gTerrainStampProgram; - U32 bit_depth = gSavedSettings.getU32("TerrainPaintBitDepth"); - // LLTerrainPaintMap currently uses an RGB8 texture internally - bit_depth = llclamp(bit_depth, 1, 8); - shader->mName = llformat("Terrain Stamp Shader RGB%o", bit_depth); + if (success) + { + LLGLSLShader* shader = &gTerrainStampProgram; + U32 bit_depth = gSavedSettings.getU32("TerrainPaintBitDepth"); + // LLTerrainPaintMap currently uses an RGB8 texture internally + bit_depth = llclamp(bit_depth, 1, 8); + shader->mName = llformat("Terrain Stamp Shader RGB%o", bit_depth); - shader->mShaderFiles.clear(); - shader->mShaderFiles.push_back(make_pair("interface/terrainStampV.glsl", GL_VERTEX_SHADER)); - shader->mShaderFiles.push_back(make_pair("interface/terrainStampF.glsl", GL_FRAGMENT_SHADER)); - shader->mShaderLevel = mShaderLevel[SHADER_INTERFACE]; - const U32 value_range = (1 << bit_depth) - 1; - shader->addPermutation("TERRAIN_PAINT_PRECISION", llformat("%d", value_range)); - success = success && shader->createShader(); - llassert(success); + shader->mShaderFiles.clear(); + shader->mShaderFiles.push_back(make_pair("interface/terrainStampV.glsl", GL_VERTEX_SHADER)); + shader->mShaderFiles.push_back(make_pair("interface/terrainStampF.glsl", GL_FRAGMENT_SHADER)); + shader->mShaderLevel = mShaderLevel[SHADER_INTERFACE]; + const U32 value_range = (1 << bit_depth) - 1; + shader->addPermutation("TERRAIN_PAINT_PRECISION", llformat("%d", value_range)); + success = success && shader->createShader(); + //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) |