Skip to content
Snippets Groups Projects
Commit f2fc69c6 authored by David Parks's avatar David Parks
Browse files

SH-2240 Fix for crash when rendering beacons and Debug GL enabled -- flush...

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.
parent fba8afd7
Branches
Tags
No related merge requests found
......@@ -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();
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment