summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJonathan "Geenz" Goodman <geenz@lindenlab.com>2025-11-05 11:01:05 -0500
committerGitHub <noreply@github.com>2025-11-05 11:01:05 -0500
commitfc9805fd63cccbc2d526ad803a17b43855be4aab (patch)
tree4d43823d6741f141cd70b080e833017a0370dcda
parenta5bf53ffa4152d1e1e8b65edcd1ba318ec2d2f50 (diff)
parent6fccf062fba5873c00199d84d5daf7568a7734dc (diff)
Merge pull request #4935 from RyeMutt/rye/lnxfixlines
Improve fix for line width crashes under certain Mesa GL drivers
-rw-r--r--indra/llrender/llgl.cpp6
-rw-r--r--indra/llrender/llgl.h3
-rw-r--r--indra/llrender/llrender.cpp9
3 files changed, 3 insertions, 15 deletions
diff --git a/indra/llrender/llgl.cpp b/indra/llrender/llgl.cpp
index d3720eb85c..25277f1341 100644
--- a/indra/llrender/llgl.cpp
+++ b/indra/llrender/llgl.cpp
@@ -1326,11 +1326,7 @@ bool LLGLManager::initGL()
glGetIntegerv(GL_MAX_UNIFORM_BLOCK_SIZE, &mMaxUniformBlockSize);
// If outside the allowed range, glLineWidth fails with "invalid value".
- // On Darwin, the range is [1, 1].
- GLfloat line_width_range[2]{0.f};
- glGetFloatv(GL_SMOOTH_LINE_WIDTH_RANGE, line_width_range);
- mMinSmoothLineWidth = line_width_range[0];
- mMaxSmoothLineWidth = line_width_range[1];
+ glGetFloatv(GL_ALIASED_LINE_WIDTH_RANGE, mAliasedLineRange.mV);
// sanity clamp max uniform block size to 64k just in case
// there's some implementation that reports a crazy value
diff --git a/indra/llrender/llgl.h b/indra/llrender/llgl.h
index 3a311ad03b..5098478c22 100644
--- a/indra/llrender/llgl.h
+++ b/indra/llrender/llgl.h
@@ -92,8 +92,7 @@ public:
F32 mMaxAnisotropy = 0.f;
S32 mMaxUniformBlockSize = 0;
S32 mMaxVaryingVectors = 0;
- F32 mMinSmoothLineWidth = 1.f;
- F32 mMaxSmoothLineWidth = 1.f;
+ LLVector2 mAliasedLineRange = LLVector2(1.f, 1.f);
// GL 4.x capabilities
bool mHasCubeMapArray = false;
diff --git a/indra/llrender/llrender.cpp b/indra/llrender/llrender.cpp
index 0d7ebd4a25..ab88e4868e 100644
--- a/indra/llrender/llrender.cpp
+++ b/indra/llrender/llrender.cpp
@@ -1930,14 +1930,7 @@ void LLRender::setLineWidth(F32 width)
{
gGL.flush();
- if(sGLCoreProfile)
- {
- width = 1.f;
- }
- else
- {
- width = llclamp(width, gGLManager.mMinSmoothLineWidth, gGLManager.mMaxSmoothLineWidth);
- }
+ width = llclamp(width, gGLManager.mAliasedLineRange[0], gGLManager.mAliasedLineRange[1]);
if(mLineWidth != width)
{
mLineWidth = width;