Experimental volume face batching changes (Cursory testing shows: +~10% larger mean batch size).
-Drive pass selection by face pools. Doing such removes a fair bit of redundant (and often buggy) code. -Ignore irrelivant batch breakers depending on pass/pool type. -Face sorting algorithm modified to potentially allow larger batches. -Removed a few unused/broken things (bake_sunlight/no_materials) -Fullbright handling should hopefully be a little more consistent. -Prevent fullbright faces from being placed in 'simple' pool. (They are already simple-er) Fixed attribute error that popped up with bump faces when batching was disabled.
This commit is contained in:
@@ -1526,24 +1526,28 @@ U32 LLPipeline::getPoolTypeFromTE(const LLTextureEntry* te, LLViewerTexture* ima
|
||||
{
|
||||
alpha = alpha || (imagep->getComponents() == 4 && imagep->getType() != LLViewerTexture::MEDIA_TEXTURE) || (imagep->getComponents() == 2);
|
||||
}
|
||||
|
||||
|
||||
if (alpha && mat)
|
||||
{
|
||||
switch (mat->getDiffuseAlphaMode())
|
||||
{
|
||||
case 1:
|
||||
case LLMaterial::DIFFUSE_ALPHA_MODE_BLEND:
|
||||
alpha = true; // Material's alpha mode is set to blend. Toss it into the alpha draw pool.
|
||||
break;
|
||||
case 0: //alpha mode set to none, never go to alpha pool
|
||||
case 3: //alpha mode set to emissive, never go to alpha pool
|
||||
case LLMaterial::DIFFUSE_ALPHA_MODE_NONE: //alpha mode set to none, never go to alpha pool
|
||||
case LLMaterial::DIFFUSE_ALPHA_MODE_EMISSIVE: //alpha mode set to emissive, never go to alpha pool
|
||||
alpha = color_alpha;
|
||||
break;
|
||||
default: //alpha mode set to "mask", go to alpha pool if fullbright
|
||||
alpha = color_alpha; // Material's alpha mode is set to none, mask, or emissive. Toss it into the opaque material draw pool.
|
||||
alpha = color_alpha; // Material's alpha mode is set to mask, or default. Toss it into the opaque material draw pool.
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
static const LLCachedControl<bool> alt_batching("SHAltBatching",true);
|
||||
|
||||
if(!alt_batching)
|
||||
{
|
||||
if (alpha)
|
||||
{
|
||||
return LLDrawPool::POOL_ALPHA;
|
||||
@@ -1560,6 +1564,49 @@ U32 LLPipeline::getPoolTypeFromTE(const LLTextureEntry* te, LLViewerTexture* ima
|
||||
{
|
||||
return LLDrawPool::POOL_SIMPLE;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (alpha)
|
||||
{
|
||||
return LLDrawPool::POOL_ALPHA;
|
||||
}
|
||||
else if ((!LLPipeline::sRenderDeferred || !mat || mat->getNormalID().isNull()) && LLPipeline::sRenderBump && te->getBumpmap() && te->getBumpmap() < 18)
|
||||
{
|
||||
return LLDrawPool::POOL_BUMP; //Bump goes into bump pool unless using deferred and there's a normal map that takes precedence.
|
||||
}
|
||||
else if (mat && mat->getDiffuseAlphaMode() == LLMaterial::DIFFUSE_ALPHA_MODE_MASK)
|
||||
{
|
||||
if(te->getFullbright())
|
||||
{
|
||||
return LLDrawPool::POOL_FULLBRIGHT_ALPHA_MASK;
|
||||
}
|
||||
else
|
||||
{
|
||||
return LLPipeline::sRenderDeferred ? LLDrawPool::POOL_MATERIALS : LLDrawPool::POOL_ALPHA_MASK;
|
||||
}
|
||||
}
|
||||
else if(LLPipeline::sRenderDeferred && mat)
|
||||
{
|
||||
if(te->getFullbright() && mat->getEnvironmentIntensity())
|
||||
{
|
||||
return LLDrawPool::POOL_FULLBRIGHT;
|
||||
}
|
||||
return LLDrawPool::POOL_MATERIALS;
|
||||
}
|
||||
else if(te->getFullbright())
|
||||
{
|
||||
return (LLPipeline::sRenderBump && te->getShiny()) ? LLDrawPool::POOL_BUMP : LLDrawPool::POOL_FULLBRIGHT;
|
||||
}
|
||||
else if (!LLPipeline::sRenderDeferred && LLPipeline::sRenderBump && te->getShiny())
|
||||
{
|
||||
return LLDrawPool::POOL_BUMP; //Shiny goes into bump pool when not using deferred rendering.
|
||||
}
|
||||
else
|
||||
{
|
||||
return LLDrawPool::POOL_SIMPLE;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user