diff options
| author | Rye <rye@alchemyviewer.org> | 2025-10-28 22:20:37 -0400 |
|---|---|---|
| committer | Rye <rye@alchemyviewer.org> | 2025-10-31 07:46:07 -0400 |
| commit | 14bf0509efad36650e6157975cd5e0d77e64183b (patch) | |
| tree | 2a7692d99ab33cb2b217e211c73cb9750bef802b /indra/llrender/llrender2dutils.cpp | |
| parent | 3d8cb2343b113a27b856be329b4edd37c74945f1 (diff) | |
Fix invalid calls to glLineWidth on some linux GL drivers
Signed-off-by: Rye <rye@alchemyviewer.org>
Diffstat (limited to 'indra/llrender/llrender2dutils.cpp')
| -rw-r--r-- | indra/llrender/llrender2dutils.cpp | 15 |
1 files changed, 3 insertions, 12 deletions
diff --git a/indra/llrender/llrender2dutils.cpp b/indra/llrender/llrender2dutils.cpp index 5b08c29d64..e9d2212a67 100644 --- a/indra/llrender/llrender2dutils.cpp +++ b/indra/llrender/llrender2dutils.cpp @@ -833,8 +833,7 @@ void gl_line_3d( const LLVector3& start, const LLVector3& end, const LLColor4& c { gGL.color4f(color.mV[VRED], color.mV[VGREEN], color.mV[VBLUE], color.mV[VALPHA]); - gGL.flush(); - glLineWidth(2.5f); + gGL.setLineWidth(2.5f); gGL.begin(LLRender::LINES); { @@ -843,7 +842,7 @@ void gl_line_3d( const LLVector3& start, const LLVector3& end, const LLColor4& c } gGL.end(); - LLRender2D::setLineWidth(1.f); + gGL.setLineWidth(1.f); } void gl_arc_2d(F32 center_x, F32 center_y, F32 radius, S32 steps, bool filled, F32 start_angle, F32 end_angle) @@ -1798,16 +1797,8 @@ void LLRender2D::loadIdentity() // static void LLRender2D::setLineWidth(F32 width) { - gGL.flush(); - // If outside the allowed range, glLineWidth fails with "invalid value". - // On Darwin, the range is [1, 1]. - static GLfloat range[2]{0.0}; - if (range[1] == 0) - { - glGetFloatv(GL_SMOOTH_LINE_WIDTH_RANGE, range); - } width *= lerp(LLRender::sUIGLScaleFactor.mV[VX], LLRender::sUIGLScaleFactor.mV[VY], 0.5f); - glLineWidth(llclamp(width, range[0], range[1])); + gGL.setLineWidth(width); } LLPointer<LLUIImage> LLRender2D::getUIImageByID(const LLUUID& image_id, S32 priority) |
