aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/linden/indra/newview/lldrawpool.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'linden/indra/newview/lldrawpool.cpp')
-rw-r--r--linden/indra/newview/lldrawpool.cpp51
1 files changed, 27 insertions, 24 deletions
diff --git a/linden/indra/newview/lldrawpool.cpp b/linden/indra/newview/lldrawpool.cpp
index 0ab5b54..f1feb4a 100644
--- a/linden/indra/newview/lldrawpool.cpp
+++ b/linden/indra/newview/lldrawpool.cpp
@@ -469,12 +469,14 @@ LLDrawPool* LLRenderPass::instancePool()
469 469
470void LLRenderPass::renderGroup(LLSpatialGroup* group, U32 type, U32 mask, BOOL texture) 470void LLRenderPass::renderGroup(LLSpatialGroup* group, U32 type, U32 mask, BOOL texture)
471{ 471{
472 std::vector<LLDrawInfo*>& draw_info = group->mDrawMap[type]; 472 LLSpatialGroup::drawmap_elem_t& draw_info = group->mDrawMap[type];
473 473
474 for (std::vector<LLDrawInfo*>::const_iterator k = draw_info.begin(); k != draw_info.end(); ++k) 474 for (LLSpatialGroup::drawmap_elem_t::iterator k = draw_info.begin(); k != draw_info.end(); ++k)
475 { 475 {
476 LLDrawInfo& params = **k; 476 LLDrawInfo *pparams = *k;
477 pushBatch(params, mask, texture); 477 if (pparams) {
478 pushBatch(*pparams, mask, texture);
479 }
478 } 480 }
479} 481}
480 482
@@ -484,14 +486,15 @@ void LLRenderPass::renderInvisible(U32 mask)
484 LLGLState::checkClientArrays(mask); 486 LLGLState::checkClientArrays(mask);
485#endif 487#endif
486 488
487 std::vector<LLDrawInfo*>& draw_info = gPipeline.mRenderMap[LLRenderPass::PASS_INVISIBLE]; 489 LLSpatialGroup::drawmap_elem_t& draw_info = gPipeline.mRenderMap[LLRenderPass::PASS_INVISIBLE];
488 490
489 for (std::vector<LLDrawInfo*>::iterator i = draw_info.begin(); i != draw_info.end(); ++i) 491 for (LLSpatialGroup::drawmap_elem_t::iterator i = draw_info.begin(); i != draw_info.end(); ++i)
490 { 492 {
491 LLDrawInfo& params = **i; 493
494 LLDrawInfo *pparams = *i;
495 if (pparams && pparams->mVertexBuffer.notNull()) {
496 LLDrawInfo &params = *pparams;
492 497
493 if (params.mVertexBuffer)
494 {
495 params.mVertexBuffer->setBuffer(mask); 498 params.mVertexBuffer->setBuffer(mask);
496 U32 *indices_pointer = 499 U32 *indices_pointer =
497 (U32 *) params.mVertexBuffer->getIndicesPointer(); 500 (U32 *) params.mVertexBuffer->getIndicesPointer();
@@ -509,22 +512,19 @@ void LLRenderPass::renderTexture(U32 type, U32 mask)
509 LLGLState::checkClientArrays(mask); 512 LLGLState::checkClientArrays(mask);
510#endif 513#endif
511 514
512 std::vector<LLDrawInfo*>& draw_info = gPipeline.mRenderMap[type]; 515 LLSpatialGroup::drawmap_elem_t& draw_info = gPipeline.mRenderMap[type];
513 516
514 for (std::vector<LLDrawInfo*>::iterator i = draw_info.begin(); i != draw_info.end(); ++i) 517 for (LLSpatialGroup::drawmap_elem_t::iterator i = draw_info.begin(); i != draw_info.end(); ++i)
515 { 518 {
516 LLDrawInfo& params = **i; 519 LLDrawInfo* pparams = *i;
517 pushBatch(params, mask, TRUE); 520 if (pparams) {
521 pushBatch(*pparams, mask, TRUE);
522 }
518 } 523 }
519} 524}
520 525
521void LLRenderPass::pushBatch(LLDrawInfo& params, U32 mask, BOOL texture) 526void LLRenderPass::pushBatch(LLDrawInfo& params, U32 mask, BOOL texture)
522{ 527{
523 if (params.mVertexBuffer.isNull())
524 {
525 return;
526 }
527
528 if (texture) 528 if (texture)
529 { 529 {
530 if (params.mTexture.notNull()) 530 if (params.mTexture.notNull())
@@ -542,12 +542,15 @@ void LLRenderPass::pushBatch(LLDrawInfo& params, U32 mask, BOOL texture)
542 LLImageGL::unbindTexture(0); 542 LLImageGL::unbindTexture(0);
543 } 543 }
544 } 544 }
545 545
546 params.mVertexBuffer->setBuffer(mask); 546 if (params.mVertexBuffer.notNull())
547 U32* indices_pointer = (U32*) params.mVertexBuffer->getIndicesPointer(); 547 {
548 glDrawRangeElements(GL_TRIANGLES, params.mStart, params.mEnd, params.mCount, 548 params.mVertexBuffer->setBuffer(mask);
549 GL_UNSIGNED_INT, indices_pointer+params.mOffset); 549 U32* indices_pointer = (U32*) params.mVertexBuffer->getIndicesPointer();
550 gPipeline.mTrianglesDrawn += params.mCount/3; 550 glDrawRangeElements(GL_TRIANGLES, params.mStart, params.mEnd, params.mCount,
551 GL_UNSIGNED_INT, indices_pointer+params.mOffset);
552 gPipeline.mTrianglesDrawn += params.mCount/3;
553 }
551 554
552 if (params.mTextureMatrix && texture && params.mTexture.notNull()) 555 if (params.mTextureMatrix && texture && params.mTexture.notNull())
553 { 556 {