diff options
author | Dave Parks <davep@lindenlab.com> | 2011-10-06 17:54:06 -0500 |
---|---|---|
committer | Dave Parks <davep@lindenlab.com> | 2011-10-06 17:54:06 -0500 |
commit | c834bdd05a134d6b3442a31f351a94f21965d4e9 (patch) | |
tree | 42dc1659d9b7041f5607d50c76a5a65f75eeee55 /indra/newview | |
parent | f2fc69c65650bf5db4f0ea098be7bd5fe37f224d (diff) |
SH-2240 Better fix for beacon rendering -- let LLRender take care of optimization around joining chunks of line segments together into one draw call
Diffstat (limited to 'indra/newview')
-rw-r--r-- | indra/newview/llglsandbox.cpp | 41 |
1 files changed, 6 insertions, 35 deletions
diff --git a/indra/newview/llglsandbox.cpp b/indra/newview/llglsandbox.cpp index 3f773effcb..ac87da2d71 100644 --- a/indra/newview/llglsandbox.cpp +++ b/indra/newview/llglsandbox.cpp @@ -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); |