Merge pull request #206 from secondlife/SL-19644

SL-19644: De-virtualize pushBatch
master
cosmic-linden 2023-05-08 11:05:24 -07:00 committed by GitHub
commit 06be53fef7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 21 additions and 18 deletions

View File

@ -349,15 +349,18 @@ public:
void resetDrawOrders() { }
static void applyModelMatrix(const LLDrawInfo& params);
virtual void pushBatches(U32 type, bool texture = true, bool batch_textures = false);
virtual void pushRiggedBatches(U32 type, bool texture = true, bool batch_textures = false);
// Use before a non-GLTF batch if it is interleaved with GLTF batches that share the same shader
static void resetGLTFTextureTransform();
void pushBatches(U32 type, bool texture = true, bool batch_textures = false);
void pushRiggedBatches(U32 type, bool texture = true, bool batch_textures = false);
void pushGLTFBatches(U32 type);
void pushGLTFBatch(LLDrawInfo& params);
void pushRiggedGLTFBatches(U32 type);
void pushRiggedGLTFBatch(LLDrawInfo& params, LLVOAvatar*& lastAvatar, U64& lastMeshId);
virtual void pushMaskBatches(U32 type, bool texture = true, bool batch_textures = false);
virtual void pushRiggedMaskBatches(U32 type, bool texture = true, bool batch_textures = false);
virtual void pushBatch(LLDrawInfo& params, bool texture, bool batch_textures = false);
void pushMaskBatches(U32 type, bool texture = true, bool batch_textures = false);
void pushRiggedMaskBatches(U32 type, bool texture = true, bool batch_textures = false);
void pushBatch(LLDrawInfo& params, bool texture, bool batch_textures = false);
void pushBumpBatch(LLDrawInfo& params, bool texture, bool batch_textures = false);
static bool uploadMatrixPalette(LLDrawInfo& params);
static bool uploadMatrixPalette(LLVOAvatar* avatar, LLMeshSkinInfo* skinInfo);
virtual void renderGroup(LLSpatialGroup* group, U32 type, bool texture = true);

View File

@ -77,6 +77,7 @@ static LLGLSLShader* shader = NULL;
static S32 cube_channel = -1;
static S32 diffuse_channel = -1;
static S32 bump_channel = -1;
static BOOL shiny = FALSE;
// Enabled after changing LLViewerTexture::mNeedsCreateTexture to an
// LLAtomicBool; this should work just fine, now. HB
@ -197,7 +198,7 @@ void LLStandardBumpmap::destroyGL()
LLDrawPoolBump::LLDrawPoolBump()
: LLRenderPass(LLDrawPool::POOL_BUMP)
{
mShiny = FALSE;
shiny = FALSE;
}
@ -346,7 +347,7 @@ void LLDrawPoolBump::beginFullbrightShiny()
diffuse_channel = 0;
}
mShiny = TRUE;
shiny = TRUE;
}
void LLDrawPoolBump::renderFullbrightShiny()
@ -398,7 +399,7 @@ void LLDrawPoolBump::endFullbrightShiny()
diffuse_channel = -1;
cube_channel = 0;
mShiny = FALSE;
shiny = FALSE;
}
void LLDrawPoolBump::renderGroup(LLSpatialGroup* group, U32 type, bool texture = true)
@ -541,7 +542,7 @@ void LLDrawPoolBump::renderDeferred(S32 pass)
{
LL_PROFILE_ZONE_SCOPED_CATEGORY_DRAWPOOL; //LL_RECORD_BLOCK_TIME(FTM_RENDER_BUMP);
mShiny = TRUE;
shiny = TRUE;
for (int i = 0; i < 2; ++i)
{
bool rigged = i == 1;
@ -575,11 +576,11 @@ void LLDrawPoolBump::renderDeferred(S32 pass)
avatar = params.mAvatar;
skin = params.mSkinInfo->mHash;
}
pushBatch(params, true, false);
pushBumpBatch(params, true, false);
}
else
{
pushBatch(params, true, false);
pushBumpBatch(params, true, false);
}
}
@ -589,7 +590,7 @@ void LLDrawPoolBump::renderDeferred(S32 pass)
gGL.getTexUnit(0)->activate();
}
mShiny = FALSE;
shiny = FALSE;
}
@ -1213,12 +1214,12 @@ void LLDrawPoolBump::pushBumpBatches(U32 type)
}
}
}
pushBatch(params, false);
pushBumpBatch(params, false);
}
}
}
void LLDrawPoolBump::pushBatch(LLDrawInfo& params, bool texture, bool batch_textures)
void LLRenderPass::pushBumpBatch(LLDrawInfo& params, bool texture, bool batch_textures)
{
LL_PROFILE_ZONE_SCOPED_CATEGORY_DRAWPOOL;
applyModelMatrix(params);
@ -1239,7 +1240,7 @@ void LLDrawPoolBump::pushBatch(LLDrawInfo& params, bool texture, bool batch_text
{ //not batching textures or batch has only 1 texture -- might need a texture matrix
if (params.mTextureMatrix)
{
if (mShiny)
if (shiny)
{
gGL.getTexUnit(0)->activate();
gGL.matrixMode(LLRender::MM_TEXTURE);
@ -1258,7 +1259,7 @@ void LLDrawPoolBump::pushBatch(LLDrawInfo& params, bool texture, bool batch_text
tex_setup = true;
}
if (mShiny && mShaderLevel > 1 && texture)
if (shiny && mShaderLevel > 1 && texture)
{
if (params.mTexture.notNull())
{
@ -1276,7 +1277,7 @@ void LLDrawPoolBump::pushBatch(LLDrawInfo& params, bool texture, bool batch_text
if (tex_setup)
{
if (mShiny)
if (shiny)
{
gGL.getTexUnit(0)->activate();
}

View File

@ -53,7 +53,6 @@ public:
LLDrawPoolBump();
/*virtual*/ void prerender() override;
void pushBatch(LLDrawInfo& params, bool texture, bool batch_textures = false) override;
void pushBumpBatches(U32 type);
void renderGroup(LLSpatialGroup* group, U32 type, bool texture) override;