summaryrefslogtreecommitdiff
path: root/indra/llrender
diff options
context:
space:
mode:
authorGraham Linden graham@lindenlab.com <Graham Linden graham@lindenlab.com>2018-03-12 16:24:16 +0100
committerGraham Linden graham@lindenlab.com <Graham Linden graham@lindenlab.com>2018-03-12 16:24:16 +0100
commitcf460b13bee894684d0ca1bcb5bbc9eb38df719c (patch)
tree18e6cd4c573966a354b6512199ca5f551eaf960c /indra/llrender
parentb6b23926340d8a2ac142b02923f04624b7c6b08e (diff)
De-duplicate sRGB conversion funcs from many shaders
and unify on using the version that works on OSX. Add more logging to shader loading about fallbacks and loading succcess. Add frag shaders for sharing sRGB and normal encode/decode via GL shader linkage.
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.cpp12
3 files changed, 13 insertions, 1 deletions
diff --git a/indra/llrender/llglslshader.cpp b/indra/llrender/llglslshader.cpp
index b09ec53bc0..6bea2e7a76 100644
--- a/indra/llrender/llglslshader.cpp
+++ b/indra/llrender/llglslshader.cpp
@@ -84,6 +84,7 @@ LLShaderFeatures::LLShaderFeatures()
, hasObjectSkinning(false)
, hasAtmospherics(false)
, hasGamma(false)
+ , hasSrgb(false)
, mIndexedTextureChannels(0)
, disableTextureIndex(false)
, hasAlphaMask(false)
diff --git a/indra/llrender/llglslshader.h b/indra/llrender/llglslshader.h
index a7a9e27fcd..b6c54a0bf8 100644
--- a/indra/llrender/llglslshader.h
+++ b/indra/llrender/llglslshader.h
@@ -48,6 +48,7 @@ public:
bool hasObjectSkinning;
bool hasAtmospherics;
bool hasGamma;
+ bool hasSrgb;
S32 mIndexedTextureChannels;
bool disableTextureIndex;
bool hasAlphaMask;
diff --git a/indra/llrender/llshadermgr.cpp b/indra/llrender/llshadermgr.cpp
index 287f22783f..6c816d0dc4 100644
--- a/indra/llrender/llshadermgr.cpp
+++ b/indra/llrender/llshadermgr.cpp
@@ -41,6 +41,8 @@
#define UNIFORM_ERRS LL_ERRS("Shader")
#endif
+#pragma optimize("", off)
+
// Lots of STL stuff in here, using namespace std to keep things more readable
using std::vector;
using std::pair;
@@ -202,7 +204,15 @@ BOOL LLShaderMgr::attachShaderFeatures(LLGLSLShader * shader)
return FALSE;
}
}
-
+
+ if (features->hasSrgb)
+ {
+ if (!shader->attachObject("environment/srgbF.glsl"))
+ {
+ return FALSE;
+ }
+ }
+
if (features->hasAtmospherics)
{
if (!shader->attachObject("windlight/atmosphericsF.glsl"))