aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/linden/indra/newview/pipeline.cpp
diff options
context:
space:
mode:
authorJacek Antonelli2008-08-15 23:45:49 -0500
committerJacek Antonelli2008-08-15 23:45:49 -0500
commit8538c0f35dc5fb780f02930256e627e5266ede4a (patch)
tree58950646aae6534fafe680a5cf879d01cd99d254 /linden/indra/newview/pipeline.cpp
parentSecond Life viewer sources 1.20.5 (diff)
downloadmeta-impy-8538c0f35dc5fb780f02930256e627e5266ede4a.zip
meta-impy-8538c0f35dc5fb780f02930256e627e5266ede4a.tar.gz
meta-impy-8538c0f35dc5fb780f02930256e627e5266ede4a.tar.bz2
meta-impy-8538c0f35dc5fb780f02930256e627e5266ede4a.tar.xz
Second Life viewer sources 1.20.6
Diffstat (limited to 'linden/indra/newview/pipeline.cpp')
-rw-r--r--linden/indra/newview/pipeline.cpp47
1 files changed, 25 insertions, 22 deletions
diff --git a/linden/indra/newview/pipeline.cpp b/linden/indra/newview/pipeline.cpp
index c1ad4b3..5ec3310 100644
--- a/linden/indra/newview/pipeline.cpp
+++ b/linden/indra/newview/pipeline.cpp
@@ -1641,6 +1641,8 @@ void LLPipeline::stateSort(LLCamera& camera, LLCullResult &result)
1641 LLFastTimer ftm(LLFastTimer::FTM_STATESORT); 1641 LLFastTimer ftm(LLFastTimer::FTM_STATESORT);
1642 LLMemType mt(LLMemType::MTYPE_PIPELINE); 1642 LLMemType mt(LLMemType::MTYPE_PIPELINE);
1643 1643
1644 //LLVertexBuffer::unbind();
1645
1644 grabReferences(result); 1646 grabReferences(result);
1645 1647
1646 { 1648 {
@@ -2129,7 +2131,7 @@ void render_hud_elements()
2129 glStencilMask(0xFFFFFFFF); 2131 glStencilMask(0xFFFFFFFF);
2130 glStencilOp(GL_KEEP, GL_KEEP, GL_REPLACE); 2132 glStencilOp(GL_KEEP, GL_KEEP, GL_REPLACE);
2131 2133
2132 gGL.start(); 2134 gGL.color4f(1,1,1,1);
2133 if (!LLPipeline::sReflectionRender && gPipeline.hasRenderDebugFeatureMask(LLPipeline::RENDER_DEBUG_FEATURE_UI)) 2135 if (!LLPipeline::sReflectionRender && gPipeline.hasRenderDebugFeatureMask(LLPipeline::RENDER_DEBUG_FEATURE_UI))
2134 { 2136 {
2135 gViewerWindow->renderSelections(FALSE, FALSE, FALSE); // For HUD version in render_ui_3d() 2137 gViewerWindow->renderSelections(FALSE, FALSE, FALSE); // For HUD version in render_ui_3d()
@@ -2156,7 +2158,7 @@ void render_hud_elements()
2156 { 2158 {
2157 LLHUDText::renderAllHUD(); 2159 LLHUDText::renderAllHUD();
2158 } 2160 }
2159 gGL.stop(); 2161 gGL.flush();
2160} 2162}
2161 2163
2162void LLPipeline::renderHighlights() 2164void LLPipeline::renderHighlights()
@@ -2273,7 +2275,7 @@ void LLPipeline::renderGeom(LLCamera& camera, BOOL forceVBOUpdate)
2273 } 2275 }
2274 } 2276 }
2275 2277
2276 LLVertexBuffer::startRender(); 2278
2277 2279
2278 //by bao 2280 //by bao
2279 //fake vertex buffer updating 2281 //fake vertex buffer updating
@@ -2451,17 +2453,14 @@ void LLPipeline::renderGeom(LLCamera& camera, BOOL forceVBOUpdate)
2451 2453
2452 renderDebug(); 2454 renderDebug();
2453 2455
2454 LLVertexBuffer::stopRender();
2455 LLVertexBuffer::unbind(); 2456 LLVertexBuffer::unbind();
2456 2457
2457 if (!LLPipeline::sReflectionRender && gPipeline.hasRenderDebugFeatureMask(LLPipeline::RENDER_DEBUG_FEATURE_UI)) 2458 if (!LLPipeline::sReflectionRender && gPipeline.hasRenderDebugFeatureMask(LLPipeline::RENDER_DEBUG_FEATURE_UI))
2458 { 2459 {
2459 gGL.start();
2460 // Render debugging beacons. 2460 // Render debugging beacons.
2461 gObjectList.renderObjectBeacons(); 2461 gObjectList.renderObjectBeacons();
2462 LLHUDObject::renderAll(); 2462 LLHUDObject::renderAll();
2463 gObjectList.resetObjectBeacons(); 2463 gObjectList.resetObjectBeacons();
2464 gGL.stop();
2465 } 2464 }
2466 2465
2467 //HACK: preserve/restore matrices around HUD render 2466 //HACK: preserve/restore matrices around HUD render
@@ -2474,6 +2473,8 @@ void LLPipeline::renderGeom(LLCamera& camera, BOOL forceVBOUpdate)
2474 } 2473 }
2475 } 2474 }
2476 2475
2476 LLVertexBuffer::unbind();
2477
2477#ifndef LL_RELEASE_FOR_DOWNLOAD 2478#ifndef LL_RELEASE_FOR_DOWNLOAD
2478 LLGLState::checkStates(); 2479 LLGLState::checkStates();
2479 LLGLState::checkTextureChannels(); 2480 LLGLState::checkTextureChannels();
@@ -2509,7 +2510,7 @@ void LLPipeline::renderDebug()
2509 2510
2510 assertInitialized(); 2511 assertInitialized();
2511 2512
2512 gGL.start(); 2513 gGL.color4f(1,1,1,1);
2513 2514
2514 gGLLastMatrix = NULL; 2515 gGLLastMatrix = NULL;
2515 glLoadMatrixd(gGLModelView); 2516 glLoadMatrixd(gGLModelView);
@@ -2554,7 +2555,7 @@ void LLPipeline::renderDebug()
2554 2555
2555 if (gAgent.getRegion()) 2556 if (gAgent.getRegion())
2556 { 2557 {
2557 gGL.begin(GL_POINTS); 2558 gGL.begin(LLVertexBuffer::POINTS);
2558 // Draw the composition layer for the region that I'm in. 2559 // Draw the composition layer for the region that I'm in.
2559 for (x = 0; x <= 260; x++) 2560 for (x = 0; x <= 260; x++)
2560 { 2561 {
@@ -2577,7 +2578,7 @@ void LLPipeline::renderDebug()
2577 gGL.end(); 2578 gGL.end();
2578 } 2579 }
2579 } 2580 }
2580 gGL.stop(); 2581 gGL.flush();
2581} 2582}
2582 2583
2583void LLPipeline::renderForSelect(std::set<LLViewerObject*>& objects) 2584void LLPipeline::renderForSelect(std::set<LLViewerObject*>& objects)
@@ -2594,7 +2595,7 @@ void LLPipeline::renderForSelect(std::set<LLViewerObject*>& objects)
2594 2595
2595 LLMemType mt(LLMemType::MTYPE_PIPELINE); 2596 LLMemType mt(LLMemType::MTYPE_PIPELINE);
2596 2597
2597 LLVertexBuffer::startRender(); 2598
2598 2599
2599 glMatrixMode(GL_MODELVIEW); 2600 glMatrixMode(GL_MODELVIEW);
2600 2601
@@ -2603,6 +2604,8 @@ void LLPipeline::renderForSelect(std::set<LLViewerObject*>& objects)
2603 LLGLDepthTest gls_depth(GL_TRUE,GL_TRUE); 2604 LLGLDepthTest gls_depth(GL_TRUE,GL_TRUE);
2604 disableLights(); 2605 disableLights();
2605 2606
2607 LLVertexBuffer::unbind();
2608
2606 //for each drawpool 2609 //for each drawpool
2607#ifndef LL_RELEASE_FOR_DOWNLOAD 2610#ifndef LL_RELEASE_FOR_DOWNLOAD
2608 LLGLState::checkStates(); 2611 LLGLState::checkStates();
@@ -2758,7 +2761,7 @@ void LLPipeline::renderForSelect(std::set<LLViewerObject*>& objects)
2758 glTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE); 2761 glTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE);
2759 2762
2760 LLVertexBuffer::unbind(); 2763 LLVertexBuffer::unbind();
2761 LLVertexBuffer::stopRender(); 2764 LLVertexBuffer::unbind();
2762 2765
2763 glColorMask(GL_TRUE, GL_TRUE, GL_TRUE, GL_TRUE); 2766 glColorMask(GL_TRUE, GL_TRUE, GL_TRUE, GL_TRUE);
2764} 2767}
@@ -4494,7 +4497,7 @@ void LLPipeline::renderBloom(BOOL for_snapshot)
4494 glColorMask(GL_TRUE, GL_TRUE, GL_TRUE, GL_TRUE); 4497 glColorMask(GL_TRUE, GL_TRUE, GL_TRUE, GL_TRUE);
4495 4498
4496 LLFastTimer ftm(LLFastTimer::FTM_RENDER_BLOOM); 4499 LLFastTimer ftm(LLFastTimer::FTM_RENDER_BLOOM);
4497 gGL.start(); 4500 gGL.color4f(1,1,1,1);
4498 LLGLDepthTest depth(GL_FALSE); 4501 LLGLDepthTest depth(GL_FALSE);
4499 LLGLDisable blend(GL_BLEND); 4502 LLGLDisable blend(GL_BLEND);
4500 LLGLDisable cull(GL_CULL_FACE); 4503 LLGLDisable cull(GL_CULL_FACE);
@@ -4524,7 +4527,7 @@ void LLPipeline::renderBloom(BOOL for_snapshot)
4524 LLGLEnable blend(GL_BLEND); 4527 LLGLEnable blend(GL_BLEND);
4525 gGL.blendFunc(GL_ONE, GL_ONE); 4528 gGL.blendFunc(GL_ONE, GL_ONE);
4526 tc2.setVec(1,1); 4529 tc2.setVec(1,1);
4527 gGL.begin(GL_TRIANGLE_STRIP); 4530 gGL.begin(LLVertexBuffer::TRIANGLE_STRIP);
4528 gGL.color4f(1,1,1,1); 4531 gGL.color4f(1,1,1,1);
4529 gGL.texCoord2f(tc1.mV[0], tc1.mV[1]); 4532 gGL.texCoord2f(tc1.mV[0], tc1.mV[1]);
4530 gGL.vertex2f(-1,-1); 4533 gGL.vertex2f(-1,-1);
@@ -4543,7 +4546,7 @@ void LLPipeline::renderBloom(BOOL for_snapshot)
4543 gGL.blendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); 4546 gGL.blendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
4544 } 4547 }
4545 4548
4546 gGL.stop(); 4549 gGL.flush();
4547 glMatrixMode(GL_PROJECTION); 4550 glMatrixMode(GL_PROJECTION);
4548 glPopMatrix(); 4551 glPopMatrix();
4549 glMatrixMode(GL_MODELVIEW); 4552 glMatrixMode(GL_MODELVIEW);
@@ -4582,7 +4585,7 @@ void LLPipeline::renderBloom(BOOL for_snapshot)
4582 4585
4583 gGL.color4f(1,1,1,1); 4586 gGL.color4f(1,1,1,1);
4584 gPipeline.enableLightsFullbright(LLColor4(1,1,1,1)); 4587 gPipeline.enableLightsFullbright(LLColor4(1,1,1,1));
4585 gGL.begin(GL_TRIANGLE_STRIP); 4588 gGL.begin(LLVertexBuffer::TRIANGLE_STRIP);
4586 gGL.texCoord2f(tc1.mV[0], tc1.mV[1]); 4589 gGL.texCoord2f(tc1.mV[0], tc1.mV[1]);
4587 gGL.vertex2f(-1,-1); 4590 gGL.vertex2f(-1,-1);
4588 4591
@@ -4652,7 +4655,7 @@ void LLPipeline::renderBloom(BOOL for_snapshot)
4652 gGlowProgram.uniform2f("glowDelta", 0, delta); 4655 gGlowProgram.uniform2f("glowDelta", 0, delta);
4653 } 4656 }
4654 4657
4655 gGL.begin(GL_TRIANGLE_STRIP); 4658 gGL.begin(LLVertexBuffer::TRIANGLE_STRIP);
4656 gGL.texCoord2f(tc1.mV[0], tc1.mV[1]); 4659 gGL.texCoord2f(tc1.mV[0], tc1.mV[1]);
4657 gGL.vertex2f(-1,-1); 4660 gGL.vertex2f(-1,-1);
4658 4661
@@ -4686,7 +4689,7 @@ void LLPipeline::renderBloom(BOOL for_snapshot)
4686 glStencilOp(GL_KEEP, GL_KEEP, GL_KEEP); 4689 glStencilOp(GL_KEEP, GL_KEEP, GL_KEEP);
4687 LLGLDisable blend(GL_BLEND); 4690 LLGLDisable blend(GL_BLEND);
4688 4691
4689 gGL.begin(GL_TRIANGLE_STRIP); 4692 gGL.begin(LLVertexBuffer::TRIANGLE_STRIP);
4690 gGL.color4f(1,1,1,1); 4693 gGL.color4f(1,1,1,1);
4691 gGL.texCoord2f(tc1.mV[0], tc1.mV[1]); 4694 gGL.texCoord2f(tc1.mV[0], tc1.mV[1]);
4692 gGL.vertex2f(-1,-1); 4695 gGL.vertex2f(-1,-1);
@@ -4721,7 +4724,7 @@ void LLPipeline::renderBloom(BOOL for_snapshot)
4721 glEnable(GL_TEXTURE_RECTANGLE_ARB); 4724 glEnable(GL_TEXTURE_RECTANGLE_ARB);
4722 mScreen.bindTexture(); 4725 mScreen.bindTexture();
4723 4726
4724 gGL.begin(GL_TRIANGLE_STRIP); 4727 gGL.begin(LLVertexBuffer::TRIANGLE_STRIP);
4725 gGL.color4f(1,1,1,1); 4728 gGL.color4f(1,1,1,1);
4726 gGL.texCoord2f(tc1.mV[0], tc1.mV[1]); 4729 gGL.texCoord2f(tc1.mV[0], tc1.mV[1]);
4727 gGL.vertex2f(-1,-1); 4730 gGL.vertex2f(-1,-1);
@@ -4743,7 +4746,7 @@ void LLPipeline::renderBloom(BOOL for_snapshot)
4743 4746
4744 gGL.blendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); 4747 gGL.blendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
4745 }*/ 4748 }*/
4746 gGL.stop(); 4749 gGL.flush();
4747 4750
4748 { 4751 {
4749 LLVertexBuffer::unbind(); 4752 LLVertexBuffer::unbind();
@@ -5259,15 +5262,15 @@ void LLPipeline::generateImpostor(LLVOAvatar* avatar)
5259 5262
5260 LLGLDepthTest depth(GL_FALSE, GL_FALSE); 5263 LLGLDepthTest depth(GL_FALSE, GL_FALSE);
5261 5264
5262 gGL.start(); 5265 gGL.color4f(1,1,1,1);
5263 gGL.color4ub(64,64,64,1); 5266 gGL.color4ub(64,64,64,1);
5264 gGL.begin(GL_QUADS); 5267 gGL.begin(LLVertexBuffer::QUADS);
5265 gGL.vertex3fv((pos+left-up).mV); 5268 gGL.vertex3fv((pos+left-up).mV);
5266 gGL.vertex3fv((pos-left-up).mV); 5269 gGL.vertex3fv((pos-left-up).mV);
5267 gGL.vertex3fv((pos-left+up).mV); 5270 gGL.vertex3fv((pos-left+up).mV);
5268 gGL.vertex3fv((pos+left+up).mV); 5271 gGL.vertex3fv((pos+left+up).mV);
5269 gGL.end(); 5272 gGL.end();
5270 gGL.stop(); 5273 gGL.flush();
5271 5274
5272 5275
5273 gGL.blendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); 5276 gGL.blendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);