SL-20606: Refactor model matrix code
parent
7c2c49dd26
commit
42dafa5f09
|
|
@ -567,14 +567,19 @@ void LLRenderPass::pushRiggedMaskBatches(U32 type, bool texture, bool batch_text
|
|||
|
||||
void LLRenderPass::applyModelMatrix(const LLDrawInfo& params)
|
||||
{
|
||||
if (params.mModelMatrix != gGLLastMatrix)
|
||||
applyModelMatrix(params.mModelMatrix);
|
||||
}
|
||||
|
||||
void LLRenderPass::applyModelMatrix(const LLMatrix4* model_matrix)
|
||||
{
|
||||
if (model_matrix != gGLLastMatrix)
|
||||
{
|
||||
gGLLastMatrix = params.mModelMatrix;
|
||||
gGLLastMatrix = model_matrix;
|
||||
gGL.matrixMode(LLRender::MM_MODELVIEW);
|
||||
gGL.loadMatrix(gGLModelView);
|
||||
if (params.mModelMatrix)
|
||||
if (model_matrix)
|
||||
{
|
||||
gGL.multMatrix((GLfloat*) params.mModelMatrix->mMatrix);
|
||||
gGL.multMatrix((GLfloat*) model_matrix->mMatrix);
|
||||
}
|
||||
gPipeline.mMatrixOpCount++;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -349,6 +349,8 @@ public:
|
|||
void resetDrawOrders() { }
|
||||
|
||||
static void applyModelMatrix(const LLDrawInfo& params);
|
||||
// For rendering that doesn't use LLDrawInfo for some reason
|
||||
static void applyModelMatrix(const LLMatrix4* model_matrix);
|
||||
void pushBatches(U32 type, bool texture = true, bool batch_textures = false);
|
||||
void pushUntexturedBatches(U32 type);
|
||||
|
||||
|
|
|
|||
|
|
@ -204,19 +204,8 @@ void LLDrawPoolTerrain::drawLoop()
|
|||
{
|
||||
LLFace *facep = *iter;
|
||||
|
||||
LLMatrix4* model_matrix = &(facep->getDrawable()->getRegion()->mRenderMatrix);
|
||||
|
||||
if (model_matrix != gGLLastMatrix)
|
||||
{
|
||||
llassert(gGL.getMatrixMode() == LLRender::MM_MODELVIEW);
|
||||
gGLLastMatrix = model_matrix;
|
||||
gGL.loadMatrix(gGLModelView);
|
||||
if (model_matrix)
|
||||
{
|
||||
gGL.multMatrix((GLfloat*) model_matrix->mMatrix);
|
||||
}
|
||||
gPipeline.mMatrixOpCount++;
|
||||
}
|
||||
llassert(gGL.getMatrixMode() == LLRender::MM_MODELVIEW);
|
||||
LLRenderPass::applyModelMatrix(&facep->getDrawable()->getRegion()->mRenderMatrix);
|
||||
|
||||
facep->renderIndexed();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -85,17 +85,8 @@ void LLDrawPoolTree::renderDeferred(S32 pass)
|
|||
{
|
||||
LLMatrix4* model_matrix = &(face->getDrawable()->getRegion()->mRenderMatrix);
|
||||
|
||||
if (model_matrix != gGLLastMatrix)
|
||||
{
|
||||
gGLLastMatrix = model_matrix;
|
||||
gGL.loadMatrix(gGLModelView);
|
||||
if (model_matrix)
|
||||
{
|
||||
llassert(gGL.getMatrixMode() == LLRender::MM_MODELVIEW);
|
||||
gGL.multMatrix((GLfloat*)model_matrix->mMatrix);
|
||||
}
|
||||
gPipeline.mMatrixOpCount++;
|
||||
}
|
||||
llassert(gGL.getMatrixMode() == LLRender::MM_MODELVIEW);
|
||||
LLRenderPass::applyModelMatrix(model_matrix);
|
||||
|
||||
buff->setBuffer();
|
||||
buff->drawRange(LLRender::TRIANGLES, 0, buff->getNumVerts() - 1, buff->getNumIndices(), 0);
|
||||
|
|
|
|||
Loading…
Reference in New Issue