diff options
author | Dave Parks <davep@lindenlab.com> | 2011-10-06 17:31:59 -0500 |
---|---|---|
committer | Dave Parks <davep@lindenlab.com> | 2011-10-06 17:31:59 -0500 |
commit | f2fc69c65650bf5db4f0ea098be7bd5fe37f224d (patch) | |
tree | ffe596d9adce88f996bda9ebfa1499f1c33899ec /indra/newview/llglsandbox.cpp | |
parent | fba8afd7b27ebc362af7b26b1f1fb2917deae920 (diff) |
SH-2240 Fix for crash when rendering beacons and Debug GL enabled -- flush every 128 beacons to keep from hitting the end of the immediate mode wrapper buffer.
Diffstat (limited to 'indra/newview/llglsandbox.cpp')
-rw-r--r-- | indra/newview/llglsandbox.cpp | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/indra/newview/llglsandbox.cpp b/indra/newview/llglsandbox.cpp index 844d7ba41c..3f773effcb 100644 --- a/indra/newview/llglsandbox.cpp +++ b/indra/newview/llglsandbox.cpp @@ -789,6 +789,8 @@ void LLViewerObjectList::renderObjectBeacons() // 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; @@ -818,6 +820,14 @@ 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(); } @@ -830,6 +840,8 @@ void LLViewerObjectList::renderObjectBeacons() // 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; @@ -858,6 +870,14 @@ void LLViewerObjectList::renderObjectBeacons() gGL.vertex3f(thisline.mV[VX],thisline.mV[VY] + 0.5f,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(); |