SH-2240 Better fix for beacon rendering -- let LLRender take care of optimization around joining chunks of line segments together into one draw call
parent
f2fc69c656
commit
c834bdd05a
|
|
@ -788,9 +788,6 @@ void LLViewerObjectList::renderObjectBeacons()
|
|||
S32 last_line_width = -1;
|
||||
// gGL.begin(LLRender::LINES); // Always happens in (line_width != last_line_width)
|
||||
|
||||
BOOL flush = FALSE;
|
||||
S32 flush_me = 128;
|
||||
|
||||
for (std::vector<LLDebugBeacon>::iterator iter = mDebugBeacons.begin(); iter != mDebugBeacons.end(); ++iter)
|
||||
{
|
||||
const LLDebugBeacon &debug_beacon = *iter;
|
||||
|
|
@ -799,18 +796,14 @@ void LLViewerObjectList::renderObjectBeacons()
|
|||
S32 line_width = debug_beacon.mLineWidth;
|
||||
if (line_width != last_line_width)
|
||||
{
|
||||
if (flush)
|
||||
{
|
||||
gGL.end();
|
||||
}
|
||||
flush = TRUE;
|
||||
gGL.flush();
|
||||
glLineWidth( (F32)line_width );
|
||||
last_line_width = line_width;
|
||||
gGL.begin(LLRender::LINES);
|
||||
}
|
||||
|
||||
const LLVector3 &thisline = debug_beacon.mPositionAgent;
|
||||
|
||||
gGL.begin(LLRender::LINES);
|
||||
gGL.color4fv(color.mV);
|
||||
gGL.vertex3f(thisline.mV[VX],thisline.mV[VY],thisline.mV[VZ] - 50.f);
|
||||
gGL.vertex3f(thisline.mV[VX],thisline.mV[VY],thisline.mV[VZ] + 50.f);
|
||||
|
|
@ -820,16 +813,9 @@ void LLViewerObjectList::renderObjectBeacons()
|
|||
gGL.vertex3f(thisline.mV[VX],thisline.mV[VY] + 2.f,thisline.mV[VZ]);
|
||||
|
||||
draw_line_cube(0.10f, thisline);
|
||||
|
||||
if (--flush_me <= 0)
|
||||
{
|
||||
flush_me = 128;
|
||||
gGL.end();
|
||||
gGL.flush();
|
||||
gGL.begin(LLRender::LINES);
|
||||
}
|
||||
|
||||
gGL.end();
|
||||
}
|
||||
gGL.end();
|
||||
}
|
||||
|
||||
{
|
||||
|
|
@ -839,9 +825,6 @@ void LLViewerObjectList::renderObjectBeacons()
|
|||
S32 last_line_width = -1;
|
||||
// gGL.begin(LLRender::LINES); // Always happens in (line_width != last_line_width)
|
||||
|
||||
BOOL flush = FALSE;
|
||||
S32 flush_me = 128;
|
||||
|
||||
for (std::vector<LLDebugBeacon>::iterator iter = mDebugBeacons.begin(); iter != mDebugBeacons.end(); ++iter)
|
||||
{
|
||||
const LLDebugBeacon &debug_beacon = *iter;
|
||||
|
|
@ -849,18 +832,13 @@ void LLViewerObjectList::renderObjectBeacons()
|
|||
S32 line_width = debug_beacon.mLineWidth;
|
||||
if (line_width != last_line_width)
|
||||
{
|
||||
if (flush)
|
||||
{
|
||||
gGL.end();
|
||||
}
|
||||
flush = TRUE;
|
||||
gGL.flush();
|
||||
glLineWidth( (F32)line_width );
|
||||
last_line_width = line_width;
|
||||
gGL.begin(LLRender::LINES);
|
||||
}
|
||||
|
||||
const LLVector3 &thisline = debug_beacon.mPositionAgent;
|
||||
gGL.begin(LLRender::LINES);
|
||||
gGL.color4fv(debug_beacon.mColor.mV);
|
||||
gGL.vertex3f(thisline.mV[VX],thisline.mV[VY],thisline.mV[VZ] - 0.5f);
|
||||
gGL.vertex3f(thisline.mV[VX],thisline.mV[VY],thisline.mV[VZ] + 0.5f);
|
||||
|
|
@ -871,16 +849,9 @@ void LLViewerObjectList::renderObjectBeacons()
|
|||
|
||||
draw_line_cube(0.10f, thisline);
|
||||
|
||||
if (--flush_me <= 0)
|
||||
{
|
||||
flush_me = 128;
|
||||
gGL.end();
|
||||
gGL.flush();
|
||||
gGL.begin(LLRender::LINES);
|
||||
}
|
||||
gGL.end();
|
||||
}
|
||||
|
||||
gGL.end();
|
||||
gGL.flush();
|
||||
glLineWidth(1.f);
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue