summaryrefslogtreecommitdiff
path: root/indra/llrender
diff options
context:
space:
mode:
Diffstat (limited to 'indra/llrender')
-rw-r--r--indra/llrender/llglslshader.cpp1
-rw-r--r--indra/llrender/llglslshader.h1
-rw-r--r--indra/llrender/llshadermgr.cpp21
3 files changed, 20 insertions, 3 deletions
diff --git a/indra/llrender/llglslshader.cpp b/indra/llrender/llglslshader.cpp
index 15a018a0bb..4dae61e185 100644
--- a/indra/llrender/llglslshader.cpp
+++ b/indra/llrender/llglslshader.cpp
@@ -84,6 +84,7 @@ LLShaderFeatures::LLShaderFeatures()
, isDeferred(false)
, hasIndirect(false)
, hasShadows(false)
+ , hasAmbientOcclusion(false)
, mIndexedTextureChannels(0)
, disableTextureIndex(false)
, hasAlphaMask(false)
diff --git a/indra/llrender/llglslshader.h b/indra/llrender/llglslshader.h
index ed13106bfd..56d322fe6c 100644
--- a/indra/llrender/llglslshader.h
+++ b/indra/llrender/llglslshader.h
@@ -49,6 +49,7 @@ public:
bool hasAtmospherics;
bool hasGamma;
bool hasShadows;
+ bool hasAmbientOcclusion;
bool hasSrgb;
bool encodesNormal;
bool decodesNormal;
diff --git a/indra/llrender/llshadermgr.cpp b/indra/llrender/llshadermgr.cpp
index 3a80ff0144..29d120a135 100644
--- a/indra/llrender/llshadermgr.cpp
+++ b/indra/llrender/llshadermgr.cpp
@@ -196,8 +196,8 @@ BOOL LLShaderMgr::attachShaderFeatures(LLGLSLShader * shader)
}
}
-#if USE_DEFERRED_SHADER_API
- if (features->isDeferred || features->hasShadows)
+ // we want this BEFORE shadows and AO because those facilities use pos/norm access
+ if (features->isDeferred || features->hasShadows || features->hasAmbientOcclusion)
{
if (!shader->attachObject("deferred/deferredUtil.glsl"))
{
@@ -205,6 +205,22 @@ BOOL LLShaderMgr::attachShaderFeatures(LLGLSLShader * shader)
}
}
+ if (features->hasShadows)
+ {
+ if (!shader->attachObject("deferred/shadowUtil.glsl"))
+ {
+ return FALSE;
+ }
+ }
+
+ if (features->hasAmbientOcclusion)
+ {
+ if (!shader->attachObject("deferred/aoUtil.glsl"))
+ {
+ return FALSE;
+ }
+ }
+
if (features->hasIndirect)
{
if (!shader->attachObject("deferred/indirect.glsl"))
@@ -212,7 +228,6 @@ BOOL LLShaderMgr::attachShaderFeatures(LLGLSLShader * shader)
return FALSE;
}
}
-#endif
if (features->hasGamma)
{