summaryrefslogtreecommitdiff
path: root/indra
diff options
context:
space:
mode:
authorDave Houlton <euclid@lindenlab.com>2021-11-30 15:32:54 -0700
committerDave Houlton <euclid@lindenlab.com>2021-11-30 17:04:35 -0700
commit7a5ef999d01b05dd1574004d167dbd693cc56d1d (patch)
treea972d8818e5188d5297ebcc99fceecbd9cc993d3 /indra
parent08f0f6d8330e0eb654e1661f8c661d5222992933 (diff)
SL-16386 consolidate all VertexShader capability checks to a single LLPipeline::shadersLoaded()
Diffstat (limited to 'indra')
-rw-r--r--indra/newview/lldrawpoolavatar.cpp6
-rw-r--r--indra/newview/lldrawpoolbump.cpp4
-rw-r--r--indra/newview/lldrawpooltree.cpp2
-rw-r--r--indra/newview/lldrawpoolwlsky.cpp2
-rw-r--r--indra/newview/llviewershadermgr.cpp6
-rw-r--r--indra/newview/llviewerstats.cpp2
-rw-r--r--indra/newview/llvovolume.cpp6
-rw-r--r--indra/newview/pipeline.cpp27
-rw-r--r--indra/newview/pipeline.h5
9 files changed, 24 insertions, 36 deletions
diff --git a/indra/newview/lldrawpoolavatar.cpp b/indra/newview/lldrawpoolavatar.cpp
index f9fdbac9ab..fa67b9902d 100644
--- a/indra/newview/lldrawpoolavatar.cpp
+++ b/indra/newview/lldrawpoolavatar.cpp
@@ -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.
diff --git a/indra/newview/lldrawpoolbump.cpp b/indra/newview/lldrawpoolbump.cpp
index 9d19ff44db..dc52fc7680 100644
--- a/indra/newview/lldrawpoolbump.cpp
+++ b/indra/newview/lldrawpoolbump.cpp
@@ -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();
}
diff --git a/indra/newview/lldrawpooltree.cpp b/indra/newview/lldrawpooltree.cpp
index c84178c6cd..ac957f1cbd 100644
--- a/indra/newview/lldrawpooltree.cpp
+++ b/indra/newview/lldrawpooltree.cpp
@@ -68,7 +68,7 @@ void LLDrawPoolTree::beginRenderPass(S32 pass)
shader = &gTreeProgram;
}
- if (gPipeline.canUseVertexShaders())
+ if (gPipeline.shadersLoaded())
{
shader->bind();
shader->setMinimumAlpha(0.5f);
diff --git a/indra/newview/lldrawpoolwlsky.cpp b/indra/newview/lldrawpoolwlsky.cpp
index 44b12ceaca..80a65947f6 100644
--- a/indra/newview/lldrawpoolwlsky.cpp
+++ b/indra/newview/lldrawpoolwlsky.cpp
@@ -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();
diff --git a/indra/newview/llviewershadermgr.cpp b/indra/newview/llviewershadermgr.cpp
index 26592adc0a..8669abf284 100644
--- a/indra/newview/llviewershadermgr.cpp
+++ b/indra/newview/llviewershadermgr.cpp
@@ -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()
diff --git a/indra/newview/llviewerstats.cpp b/indra/newview/llviewerstats.cpp
index 1fda2fb20e..37b6244635 100644
--- a/indra/newview/llviewerstats.cpp
+++ b/indra/newview/llviewerstats.cpp
@@ -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;
}
diff --git a/indra/newview/llvovolume.cpp b/indra/newview/llvovolume.cpp
index 464e6efd2e..2f554bc9b8 100644
--- a/indra/newview/llvovolume.cpp
+++ b/indra/newview/llvovolume.cpp
@@ -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)
diff --git a/indra/newview/pipeline.cpp b/indra/newview/pipeline.cpp
index 63e101a290..c122b4f43e 100644
--- a/indra/newview/pipeline.cpp
+++ b/indra/newview/pipeline.cpp
@@ -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;
diff --git a/indra/newview/pipeline.h b/indra/newview/pipeline.h
index 50a730077e..3ac3e3ce01 100644
--- a/indra/newview/pipeline.h
+++ b/indra/newview/pipeline.h
@@ -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: