SL-16386 consolidate all VertexShader capability checks to a single LLPipeline::shadersLoaded()
parent
08f0f6d833
commit
7a5ef999d0
|
|
@ -516,7 +516,7 @@ void LLDrawPoolAvatar::beginRigid()
|
|||
{
|
||||
LL_PROFILE_ZONE_SCOPED
|
||||
|
||||
if (gPipeline.canUseVertexShaders())
|
||||
if (gPipeline.shadersLoaded())
|
||||
{
|
||||
if (LLPipeline::sUnderWaterRender)
|
||||
{
|
||||
|
|
@ -664,7 +664,7 @@ void LLDrawPoolAvatar::beginSkinned()
|
|||
}
|
||||
else
|
||||
{
|
||||
if(gPipeline.canUseVertexShaders())
|
||||
if(gPipeline.shadersLoaded())
|
||||
{
|
||||
// software skinning, use a basic shader for windlight.
|
||||
// TODO: find a better fallback method for software skinning.
|
||||
|
|
@ -698,7 +698,7 @@ void LLDrawPoolAvatar::endSkinned()
|
|||
}
|
||||
else
|
||||
{
|
||||
if(gPipeline.canUseVertexShaders())
|
||||
if(gPipeline.shadersLoaded())
|
||||
{
|
||||
// software skinning, use a basic shader for windlight.
|
||||
// TODO: find a better fallback method for software skinning.
|
||||
|
|
|
|||
|
|
@ -1510,7 +1510,7 @@ void LLDrawPoolInvisible::render(S32 pass)
|
|||
{ //render invisiprims
|
||||
LL_RECORD_BLOCK_TIME(FTM_RENDER_INVISIBLE);
|
||||
|
||||
if (gPipeline.canUseVertexShaders())
|
||||
if (gPipeline.shadersLoaded())
|
||||
{
|
||||
gOcclusionProgram.bind();
|
||||
}
|
||||
|
|
@ -1522,7 +1522,7 @@ void LLDrawPoolInvisible::render(S32 pass)
|
|||
gGL.setColorMask(true, false);
|
||||
glStencilMask(0xFFFFFFFF);
|
||||
|
||||
if (gPipeline.canUseVertexShaders())
|
||||
if (gPipeline.shadersLoaded())
|
||||
{
|
||||
gOcclusionProgram.unbind();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -68,7 +68,7 @@ void LLDrawPoolTree::beginRenderPass(S32 pass)
|
|||
shader = &gTreeProgram;
|
||||
}
|
||||
|
||||
if (gPipeline.canUseVertexShaders())
|
||||
if (gPipeline.shadersLoaded())
|
||||
{
|
||||
shader->bind();
|
||||
shader->setMinimumAlpha(0.5f);
|
||||
|
|
|
|||
|
|
@ -460,7 +460,7 @@ void LLDrawPoolWLSky::renderHeavenlyBodies()
|
|||
LLFace * face = gSky.mVOSkyp->mFace[LLVOSky::FACE_SUN];
|
||||
|
||||
F32 blend_factor = LLEnvironment::instance().getCurrentSky()->getBlendFactor();
|
||||
bool can_use_vertex_shaders = gPipeline.canUseVertexShaders();
|
||||
bool can_use_vertex_shaders = gPipeline.shadersLoaded();
|
||||
bool can_use_windlight_shaders = gPipeline.canUseWindLightShaders();
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -558,7 +558,7 @@ void LLViewerShaderMgr::setShaders()
|
|||
return;
|
||||
}
|
||||
|
||||
gPipeline.mVertexShadersLoaded = 1;
|
||||
gPipeline.mShadersLoaded = true;
|
||||
|
||||
// Load all shaders to set max levels
|
||||
loaded = loadShadersEnvironment();
|
||||
|
|
@ -714,8 +714,6 @@ void LLViewerShaderMgr::setShaders()
|
|||
return;
|
||||
}
|
||||
|
||||
// gPipeline.mVertexShadersLoaded = 0;
|
||||
|
||||
if (gViewerWindow)
|
||||
{
|
||||
gViewerWindow->setCursor(UI_CURSOR_ARROW);
|
||||
|
|
@ -845,7 +843,7 @@ void LLViewerShaderMgr::unloadShaders()
|
|||
mShaderLevel[SHADER_WINDLIGHT] = 0;
|
||||
mShaderLevel[SHADER_TRANSFORM] = 0;
|
||||
|
||||
gPipeline.mVertexShadersLoaded = 0;
|
||||
gPipeline.mShadersLoaded = false;
|
||||
}
|
||||
|
||||
BOOL LLViewerShaderMgr::loadBasicShaders()
|
||||
|
|
|
|||
|
|
@ -541,7 +541,7 @@ void send_viewer_stats(bool include_preferences)
|
|||
{
|
||||
shader_level = 2;
|
||||
}
|
||||
else if (gPipeline.canUseVertexShaders())
|
||||
else if (gPipeline.shadersLoaded())
|
||||
{
|
||||
shader_level = 1;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -6567,7 +6567,7 @@ U32 LLVolumeGeometryManager::genDrawInfo(LLSpatialGroup* group, U32 mask, LLFace
|
|||
{
|
||||
registerFace(group, facep, LLRenderPass::PASS_ALPHA);
|
||||
}
|
||||
else if (gPipeline.canUseVertexShaders()
|
||||
else if (gPipeline.shadersLoaded()
|
||||
&& LLPipeline::sRenderBump
|
||||
&& te->getShiny()
|
||||
&& can_be_shiny)
|
||||
|
|
@ -6602,7 +6602,7 @@ U32 LLVolumeGeometryManager::genDrawInfo(LLSpatialGroup* group, U32 mask, LLFace
|
|||
registerFace(group, facep, LLRenderPass::PASS_ALPHA);
|
||||
}
|
||||
}
|
||||
else if (gPipeline.canUseVertexShaders()
|
||||
else if (gPipeline.shadersLoaded()
|
||||
&& LLPipeline::sRenderBump
|
||||
&& te->getShiny()
|
||||
&& can_be_shiny)
|
||||
|
|
@ -6683,7 +6683,7 @@ U32 LLVolumeGeometryManager::genDrawInfo(LLSpatialGroup* group, U32 mask, LLFace
|
|||
}
|
||||
|
||||
|
||||
if (!gPipeline.canUseVertexShaders() &&
|
||||
if (!gPipeline.shadersLoaded() &&
|
||||
!is_alpha &&
|
||||
te->getShiny() &&
|
||||
LLPipeline::sRenderBump)
|
||||
|
|
|
|||
|
|
@ -376,7 +376,7 @@ LLPipeline::LLPipeline() :
|
|||
mNumVisibleFaces(0),
|
||||
|
||||
mInitialized(false),
|
||||
mVertexShadersLoaded(0),
|
||||
mShadersLoaded(false),
|
||||
mTransformFeedbackPrimitives(0),
|
||||
mRenderDebugFeatureMask(0),
|
||||
mRenderDebugMask(0),
|
||||
|
|
@ -737,7 +737,7 @@ void LLPipeline::resizeShadowTexture()
|
|||
|
||||
void LLPipeline::resizeScreenTexture()
|
||||
{
|
||||
if (gPipeline.canUseVertexShaders() && assertInitialized())
|
||||
if (gPipeline.shadersLoaded())
|
||||
{
|
||||
GLuint resX = gViewerWindow->getWorldViewWidthRaw();
|
||||
GLuint resY = gViewerWindow->getWorldViewHeightRaw();
|
||||
|
|
@ -748,8 +748,8 @@ void LLPipeline::resizeScreenTexture()
|
|||
releaseShadowTargets();
|
||||
allocateScreenBuffer(resX,resY);
|
||||
gResizeScreenTexture = FALSE;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void LLPipeline::allocatePhysicsBuffer()
|
||||
|
|
@ -1380,17 +1380,9 @@ void LLPipeline::restoreGL()
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
bool LLPipeline::canUseVertexShaders()
|
||||
bool LLPipeline::shadersLoaded()
|
||||
{
|
||||
if ((assertInitialized() && mVertexShadersLoaded != 1) )
|
||||
{
|
||||
return false;
|
||||
}
|
||||
else
|
||||
{
|
||||
return true;
|
||||
}
|
||||
return (assertInitialized() && mShadersLoaded);
|
||||
}
|
||||
|
||||
bool LLPipeline::canUseWindLightShaders() const
|
||||
|
|
@ -1413,8 +1405,7 @@ bool LLPipeline::canUseAntiAliasing() const
|
|||
void LLPipeline::unloadShaders()
|
||||
{
|
||||
LLViewerShaderMgr::instance()->unloadShaders();
|
||||
|
||||
mVertexShadersLoaded = 0;
|
||||
mShadersLoaded = false;
|
||||
}
|
||||
|
||||
void LLPipeline::assertInitializedDoError()
|
||||
|
|
@ -2351,7 +2342,7 @@ void LLPipeline::updateCull(LLCamera& camera, LLCullResult& result, S32 water_cl
|
|||
|
||||
sCull->clear();
|
||||
|
||||
bool to_texture = LLPipeline::sUseOcclusion > 1 && gPipeline.canUseVertexShaders();
|
||||
bool to_texture = LLPipeline::sUseOcclusion > 1 && gPipeline.shadersLoaded();
|
||||
|
||||
if (to_texture)
|
||||
{
|
||||
|
|
@ -2385,7 +2376,7 @@ void LLPipeline::updateCull(LLCamera& camera, LLCullResult& result, S32 water_cl
|
|||
LLGLDepthTest depth(GL_TRUE, GL_FALSE);
|
||||
|
||||
bool bound_shader = false;
|
||||
if (gPipeline.canUseVertexShaders() && LLGLSLShader::sCurBoundShader == 0)
|
||||
if (gPipeline.shadersLoaded() && LLGLSLShader::sCurBoundShader == 0)
|
||||
{ //if no shader is currently bound, use the occlusion shader instead of fixed function if we can
|
||||
// (shadow render uses a special shader that clamps to clip planes)
|
||||
bound_shader = true;
|
||||
|
|
|
|||
|
|
@ -225,8 +225,7 @@ public:
|
|||
S32 getLightingDetail() const { return mLightingDetail; }
|
||||
S32 getMaxLightingDetail() const;
|
||||
|
||||
void setUseVertexShaders(bool use_shaders);
|
||||
bool canUseVertexShaders();
|
||||
bool shadersLoaded();
|
||||
bool canUseWindLightShaders() const;
|
||||
bool canUseWindLightShadersOnObjects() const;
|
||||
bool canUseAntiAliasing() const;
|
||||
|
|
@ -701,7 +700,7 @@ public:
|
|||
LLVector4 mTransformedMoonDir;
|
||||
|
||||
bool mInitialized;
|
||||
S32 mVertexShadersLoaded; // 0 = no, 1 = yes, -1 = failed
|
||||
bool mShadersLoaded;
|
||||
|
||||
U32 mTransformFeedbackPrimitives; //number of primitives expected to be generated by transform feedback
|
||||
protected:
|
||||
|
|
|
|||
Loading…
Reference in New Issue