From 718073717c70b1f7e7284a02641c0a0a7bf50367 Mon Sep 17 00:00:00 2001 From: "Howard (Aech Linden) Stearns" Date: Mon, 19 Sep 2022 12:16:49 -0700 Subject: SL-18128, SL-18128 - No glerror on Mac! --- indra/llrender/llrender2dutils.cpp | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'indra/llrender/llrender2dutils.cpp') diff --git a/indra/llrender/llrender2dutils.cpp b/indra/llrender/llrender2dutils.cpp index 5cb1dc6b25..3d32d3ca31 100644 --- a/indra/llrender/llrender2dutils.cpp +++ b/indra/llrender/llrender2dutils.cpp @@ -1516,7 +1516,15 @@ void LLRender2D::loadIdentity() void LLRender2D::setLineWidth(F32 width) { gGL.flush(); - glLineWidth(width * lerp(LLRender::sUIGLScaleFactor.mV[VX], LLRender::sUIGLScaleFactor.mV[VY], 0.5f)); + // 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])); } LLPointer LLRender2D::getUIImageByID(const LLUUID& image_id, S32 priority) -- cgit v1.2.3