diff options
author | Jacek Antonelli | 2008-08-15 23:45:44 -0500 |
---|---|---|
committer | Jacek Antonelli | 2008-08-15 23:45:44 -0500 |
commit | acfdcf2b1deeb04698174c78e8cb22b093445bb1 (patch) | |
tree | 811293650bcf81d01ea7c54d7c2cf263110aa329 /linden/indra/newview/pipeline.cpp | |
parent | Second Life viewer sources 1.20.2 (diff) | |
download | meta-impy-acfdcf2b1deeb04698174c78e8cb22b093445bb1.zip meta-impy-acfdcf2b1deeb04698174c78e8cb22b093445bb1.tar.gz meta-impy-acfdcf2b1deeb04698174c78e8cb22b093445bb1.tar.bz2 meta-impy-acfdcf2b1deeb04698174c78e8cb22b093445bb1.tar.xz |
Second Life viewer sources 1.20.3
Diffstat (limited to '')
-rw-r--r-- | linden/indra/newview/pipeline.cpp | 58 |
1 files changed, 33 insertions, 25 deletions
diff --git a/linden/indra/newview/pipeline.cpp b/linden/indra/newview/pipeline.cpp index 5f45e26..92a9811 100644 --- a/linden/indra/newview/pipeline.cpp +++ b/linden/indra/newview/pipeline.cpp | |||
@@ -168,7 +168,7 @@ glh::matrix4f glh_get_current_projection() | |||
168 | return glh_copy_matrix(gGLProjection); | 168 | return glh_copy_matrix(gGLProjection); |
169 | } | 169 | } |
170 | 170 | ||
171 | void glh_copy_matrix(glh::matrix4f& src, GLdouble* dst) | 171 | void glh_copy_matrix(const glh::matrix4f& src, GLdouble* dst) |
172 | { | 172 | { |
173 | for (U32 i = 0; i < 16; i++) | 173 | for (U32 i = 0; i < 16; i++) |
174 | { | 174 | { |
@@ -176,7 +176,7 @@ void glh_copy_matrix(glh::matrix4f& src, GLdouble* dst) | |||
176 | } | 176 | } |
177 | } | 177 | } |
178 | 178 | ||
179 | void glh_set_current_modelview(glh::matrix4f& mat) | 179 | void glh_set_current_modelview(const glh::matrix4f& mat) |
180 | { | 180 | { |
181 | glh_copy_matrix(mat, gGLModelView); | 181 | glh_copy_matrix(mat, gGLModelView); |
182 | } | 182 | } |
@@ -2144,9 +2144,9 @@ void render_hud_elements() | |||
2144 | LLViewerParcelMgr::getInstance()->renderParcelCollision(); | 2144 | LLViewerParcelMgr::getInstance()->renderParcelCollision(); |
2145 | 2145 | ||
2146 | // Render debugging beacons. | 2146 | // Render debugging beacons. |
2147 | gObjectList.renderObjectBeacons(); | 2147 | //gObjectList.renderObjectBeacons(); |
2148 | LLHUDObject::renderAll(); | 2148 | //LLHUDObject::renderAll(); |
2149 | gObjectList.resetObjectBeacons(); | 2149 | //gObjectList.resetObjectBeacons(); |
2150 | } | 2150 | } |
2151 | else if (gForceRenderLandFence) | 2151 | else if (gForceRenderLandFence) |
2152 | { | 2152 | { |
@@ -2253,11 +2253,11 @@ void LLPipeline::renderGeom(LLCamera& camera, BOOL forceVBOUpdate) | |||
2253 | // | 2253 | // |
2254 | // | 2254 | // |
2255 | 2255 | ||
2256 | glEnableClientState(GL_VERTEX_ARRAY); | ||
2257 | |||
2258 | stop_glerror(); | 2256 | stop_glerror(); |
2259 | gFrameStats.start(LLFrameStats::RENDER_SYNC); | 2257 | gFrameStats.start(LLFrameStats::RENDER_SYNC); |
2260 | 2258 | ||
2259 | glEnableClientState(GL_VERTEX_ARRAY); | ||
2260 | |||
2261 | // Do verification of GL state | 2261 | // Do verification of GL state |
2262 | #ifndef LL_RELEASE_FOR_DOWNLOAD | 2262 | #ifndef LL_RELEASE_FOR_DOWNLOAD |
2263 | LLGLState::checkStates(); | 2263 | LLGLState::checkStates(); |
@@ -2377,10 +2377,10 @@ void LLPipeline::renderGeom(LLCamera& camera, BOOL forceVBOUpdate) | |||
2377 | break; | 2377 | break; |
2378 | } | 2378 | } |
2379 | 2379 | ||
2380 | p->resetTrianglesDrawn(); | ||
2381 | p->render(i); | 2380 | p->render(i); |
2382 | } | 2381 | } |
2383 | poolp->endRenderPass(i); | 2382 | poolp->endRenderPass(i); |
2383 | LLVertexBuffer::unbind(); | ||
2384 | #ifndef LL_RELEASE_FOR_DOWNLOAD | 2384 | #ifndef LL_RELEASE_FOR_DOWNLOAD |
2385 | # if LL_DEBUG_GL | 2385 | # if LL_DEBUG_GL |
2386 | GLint depth; | 2386 | GLint depth; |
@@ -2413,6 +2413,7 @@ void LLPipeline::renderGeom(LLCamera& camera, BOOL forceVBOUpdate) | |||
2413 | } | 2413 | } |
2414 | } | 2414 | } |
2415 | 2415 | ||
2416 | LLVertexBuffer::unbind(); | ||
2416 | #ifndef LL_RELEASE_FOR_DOWNLOAD | 2417 | #ifndef LL_RELEASE_FOR_DOWNLOAD |
2417 | LLGLState::checkStates(); | 2418 | LLGLState::checkStates(); |
2418 | LLGLState::checkTextureChannels(); | 2419 | LLGLState::checkTextureChannels(); |
@@ -2452,6 +2453,15 @@ void LLPipeline::renderGeom(LLCamera& camera, BOOL forceVBOUpdate) | |||
2452 | LLVertexBuffer::stopRender(); | 2453 | LLVertexBuffer::stopRender(); |
2453 | LLVertexBuffer::unbind(); | 2454 | LLVertexBuffer::unbind(); |
2454 | 2455 | ||
2456 | if (!LLPipeline::sReflectionRender && gPipeline.hasRenderDebugFeatureMask(LLPipeline::RENDER_DEBUG_FEATURE_UI)) | ||
2457 | { | ||
2458 | gGL.start(); | ||
2459 | // Render debugging beacons. | ||
2460 | gObjectList.renderObjectBeacons(); | ||
2461 | LLHUDObject::renderAll(); | ||
2462 | gObjectList.resetObjectBeacons(); | ||
2463 | gGL.stop(); | ||
2464 | } | ||
2455 | 2465 | ||
2456 | //HACK: preserve/restore matrices around HUD render | 2466 | //HACK: preserve/restore matrices around HUD render |
2457 | if (gPipeline.hasRenderType(LLPipeline::RENDER_TYPE_HUD)) | 2467 | if (gPipeline.hasRenderType(LLPipeline::RENDER_TYPE_HUD)) |
@@ -2472,15 +2482,9 @@ void LLPipeline::renderGeom(LLCamera& camera, BOOL forceVBOUpdate) | |||
2472 | 2482 | ||
2473 | void LLPipeline::renderGeomDeferred() | 2483 | void LLPipeline::renderGeomDeferred() |
2474 | { | 2484 | { |
2475 | glEnableClientState(GL_TEXTURE_COORD_ARRAY); | ||
2476 | glEnableClientState(GL_NORMAL_ARRAY); | ||
2477 | glEnableClientState(GL_COLOR_ARRAY); | ||
2478 | gDeferredDiffuseProgram.bind(); | 2485 | gDeferredDiffuseProgram.bind(); |
2479 | gPipeline.renderObjects(LLRenderPass::PASS_SIMPLE, LLVertexBuffer::MAP_VERTEX | LLVertexBuffer::MAP_TEXCOORD | LLVertexBuffer::MAP_COLOR | LLVertexBuffer::MAP_NORMAL, TRUE); | 2486 | gPipeline.renderObjects(LLRenderPass::PASS_SIMPLE, LLVertexBuffer::MAP_VERTEX | LLVertexBuffer::MAP_TEXCOORD | LLVertexBuffer::MAP_COLOR | LLVertexBuffer::MAP_NORMAL, TRUE); |
2480 | gDeferredDiffuseProgram.unbind(); | 2487 | gDeferredDiffuseProgram.unbind(); |
2481 | glDisableClientState(GL_COLOR_ARRAY); | ||
2482 | glDisableClientState(GL_NORMAL_ARRAY); | ||
2483 | glDisableClientState(GL_TEXTURE_COORD_ARRAY); | ||
2484 | } | 2488 | } |
2485 | 2489 | ||
2486 | void LLPipeline::addTrianglesDrawn(S32 count) | 2490 | void LLPipeline::addTrianglesDrawn(S32 count) |
@@ -2506,11 +2510,6 @@ void LLPipeline::renderDebug() | |||
2506 | 2510 | ||
2507 | gGL.start(); | 2511 | gGL.start(); |
2508 | 2512 | ||
2509 | // Disable all client state | ||
2510 | //glDisableClientState(GL_TEXTURE_COORD_ARRAY); | ||
2511 | //glDisableClientState(GL_NORMAL_ARRAY); | ||
2512 | //glDisableClientState(GL_COLOR_ARRAY); | ||
2513 | |||
2514 | gGLLastMatrix = NULL; | 2513 | gGLLastMatrix = NULL; |
2515 | glLoadMatrixd(gGLModelView); | 2514 | glLoadMatrixd(gGLModelView); |
2516 | glColorMask(GL_TRUE, GL_TRUE, GL_TRUE, GL_FALSE); | 2515 | glColorMask(GL_TRUE, GL_TRUE, GL_TRUE, GL_FALSE); |
@@ -2603,8 +2602,6 @@ void LLPipeline::renderForSelect(std::set<LLViewerObject*>& objects) | |||
2603 | LLGLDepthTest gls_depth(GL_TRUE,GL_TRUE); | 2602 | LLGLDepthTest gls_depth(GL_TRUE,GL_TRUE); |
2604 | disableLights(); | 2603 | disableLights(); |
2605 | 2604 | ||
2606 | glEnableClientState ( GL_VERTEX_ARRAY ); | ||
2607 | |||
2608 | //for each drawpool | 2605 | //for each drawpool |
2609 | #ifndef LL_RELEASE_FOR_DOWNLOAD | 2606 | #ifndef LL_RELEASE_FOR_DOWNLOAD |
2610 | LLGLState::checkStates(); | 2607 | LLGLState::checkStates(); |
@@ -2619,7 +2616,7 @@ void LLPipeline::renderForSelect(std::set<LLViewerObject*>& objects) | |||
2619 | { | 2616 | { |
2620 | LLFacePool* face_pool = (LLFacePool*) poolp; | 2617 | LLFacePool* face_pool = (LLFacePool*) poolp; |
2621 | face_pool->renderForSelect(); | 2618 | face_pool->renderForSelect(); |
2622 | 2619 | LLVertexBuffer::unbind(); | |
2623 | gGLLastMatrix = NULL; | 2620 | gGLLastMatrix = NULL; |
2624 | glLoadMatrixd(gGLModelView); | 2621 | glLoadMatrixd(gGLModelView); |
2625 | 2622 | ||
@@ -2635,7 +2632,6 @@ void LLPipeline::renderForSelect(std::set<LLViewerObject*>& objects) | |||
2635 | } | 2632 | } |
2636 | } | 2633 | } |
2637 | 2634 | ||
2638 | glEnableClientState(GL_TEXTURE_COORD_ARRAY); | ||
2639 | LLGLEnable alpha_test(GL_ALPHA_TEST); | 2635 | LLGLEnable alpha_test(GL_ALPHA_TEST); |
2640 | if (gPickTransparent) | 2636 | if (gPickTransparent) |
2641 | { | 2637 | { |
@@ -2759,10 +2755,10 @@ void LLPipeline::renderForSelect(std::set<LLViewerObject*>& objects) | |||
2759 | } | 2755 | } |
2760 | 2756 | ||
2761 | glTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE); | 2757 | glTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE); |
2762 | glDisableClientState( GL_TEXTURE_COORD_ARRAY ); | ||
2763 | 2758 | ||
2759 | LLVertexBuffer::unbind(); | ||
2764 | LLVertexBuffer::stopRender(); | 2760 | LLVertexBuffer::stopRender(); |
2765 | 2761 | ||
2766 | glColorMask(GL_TRUE, GL_TRUE, GL_TRUE, GL_TRUE); | 2762 | glColorMask(GL_TRUE, GL_TRUE, GL_TRUE, GL_TRUE); |
2767 | } | 2763 | } |
2768 | 2764 | ||
@@ -4866,6 +4862,12 @@ void LLPipeline::generateWaterReflection(LLCamera& camera_in) | |||
4866 | { | 4862 | { |
4867 | if (LLPipeline::sWaterReflections && assertInitialized() && LLDrawPoolWater::sNeedsReflectionUpdate) | 4863 | if (LLPipeline::sWaterReflections && assertInitialized() && LLDrawPoolWater::sNeedsReflectionUpdate) |
4868 | { | 4864 | { |
4865 | #ifndef LL_RELEASE_FOR_DOWNLOAD | ||
4866 | LLGLState::checkStates(); | ||
4867 | LLGLState::checkTextureChannels(); | ||
4868 | LLGLState::checkClientArrays(); | ||
4869 | #endif | ||
4870 | |||
4869 | LLCamera camera = camera_in; | 4871 | LLCamera camera = camera_in; |
4870 | camera.setFar(camera.getFar()*0.87654321f); | 4872 | camera.setFar(camera.getFar()*0.87654321f); |
4871 | LLPipeline::sReflectionRender = TRUE; | 4873 | LLPipeline::sReflectionRender = TRUE; |
@@ -5052,6 +5054,12 @@ void LLPipeline::generateWaterReflection(LLCamera& camera_in) | |||
5052 | LLDrawPoolWater::sNeedsDistortionUpdate = FALSE; | 5054 | LLDrawPoolWater::sNeedsDistortionUpdate = FALSE; |
5053 | LLViewerCamera::getInstance()->setUserClipPlane(LLPlane(-pnorm, -pd)); | 5055 | LLViewerCamera::getInstance()->setUserClipPlane(LLPlane(-pnorm, -pd)); |
5054 | LLPipeline::sUseOcclusion = occlusion; | 5056 | LLPipeline::sUseOcclusion = occlusion; |
5057 | |||
5058 | #ifndef LL_RELEASE_FOR_DOWNLOAD | ||
5059 | LLGLState::checkStates(); | ||
5060 | LLGLState::checkTextureChannels(); | ||
5061 | LLGLState::checkClientArrays(); | ||
5062 | #endif | ||
5055 | } | 5063 | } |
5056 | } | 5064 | } |
5057 | 5065 | ||