summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPtolemy <ptolemy@lindenlab.com>2021-04-29 10:27:09 -0700
committerPtolemy <ptolemy@lindenlab.com>2021-04-29 14:17:01 -0700
commit3f4b8423a46bae4736ebcc28082ee1a9d5b71d6b (patch)
tree69631aa8ca147be0ce7779f00b12a185d3b471ab
parente371fdbf311e450ac0cc7f4d3fdacc938b489d92 (diff)
SL-14113: Merge duplicate shader constant for clarity.
-rw-r--r--indra/llrender/llglslshader.cpp12
-rw-r--r--indra/llrender/llglslshader.h5
-rw-r--r--indra/newview/app_settings/shaders/class1/deferred/cloudsF.glsl2
-rw-r--r--indra/newview/app_settings/shaders/class1/deferred/moonF.glsl2
-rw-r--r--indra/newview/app_settings/shaders/class1/environment/moonF.glsl2
-rw-r--r--indra/newview/app_settings/shaders/class1/windlight/moonF.glsl2
-rw-r--r--indra/newview/app_settings/shaders/class2/windlight/cloudsF.glsl2
-rw-r--r--indra/newview/llviewershadermgr.cpp10
8 files changed, 17 insertions, 20 deletions
diff --git a/indra/llrender/llglslshader.cpp b/indra/llrender/llglslshader.cpp
index 458f83aabe..74c8b2e448 100644
--- a/indra/llrender/llglslshader.cpp
+++ b/indra/llrender/llglslshader.cpp
@@ -62,20 +62,18 @@ U32 LLGLSLShader::sTotalDrawCalls = 0;
LLGLSLShader gUIProgram;
LLGLSLShader gSolidColorProgram;
-// NOTE:Keep gShaderConsts* and LLGLSLShader::ShaderConsts_e in sync!
+// NOTE: Keep gShaderConsts* and LLGLSLShader::ShaderConsts_e in sync!
const std::string gShaderConstsKey[ LLGLSLShader::NUM_SHADER_CONSTS ] =
{
- "LL_SHADER_CONST_CLOUD_DEPTH"
- , "LL_SHADER_CONST_MOON_DEPTH"
+ "LL_SHADER_CONST_CLOUD_MOON_DEPTH"
, "LL_SHADER_CONST_STAR_DEPTH"
};
-// NOTE:Keep gShaderConsts* and LLGLSLShader::ShaderConsts_e in sync!
+// NOTE: Keep gShaderConsts* and LLGLSLShader::ShaderConsts_e in sync!
const std::string gShaderConstsVal[ LLGLSLShader::NUM_SHADER_CONSTS ] =
{
- "0.999985" // SHADER_CONST_CLOUD_DEPTH // SL-14113
- , "0.999985" // SHADER_CONST_MOON_DEPTH // SL-14113
- , "0.999995" // SHADER_CONST_STAR_DEPTH // SL-14113
+ "0.999985" // SHADER_CONST_CLOUD_MOON_DEPTH // SL-14113
+ , "0.999995" // SHADER_CONST_STAR_DEPTH // SL-14113
};
diff --git a/indra/llrender/llglslshader.h b/indra/llrender/llglslshader.h
index 35e796e961..e2d0031740 100644
--- a/indra/llrender/llglslshader.h
+++ b/indra/llrender/llglslshader.h
@@ -67,11 +67,10 @@ public:
class LLGLSLShader
{
public:
- // NOTE:Keep gShaderConsts and LLGLSLShader::ShaderConsts_e in sync!
+ // NOTE: Keep gShaderConsts and LLGLSLShader::ShaderConsts_e in sync!
enum eShaderConsts
{
- SHADER_CONST_CLOUD_DEPTH
- , SHADER_CONST_MOON_DEPTH
+ SHADER_CONST_CLOUD_MOON_DEPTH
, SHADER_CONST_STAR_DEPTH
, NUM_SHADER_CONSTS
};
diff --git a/indra/newview/app_settings/shaders/class1/deferred/cloudsF.glsl b/indra/newview/app_settings/shaders/class1/deferred/cloudsF.glsl
index ad8ab771b8..f1187fef9a 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/cloudsF.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/cloudsF.glsl
@@ -126,6 +126,6 @@ void main()
frag_data[1] = vec4(0.0,0.0,0.0,0.0);
frag_data[2] = vec4(0,0,0,1);
- gl_FragDepth = LL_SHADER_CONST_CLOUD_DEPTH; // SL-14113 Stars and Clouds need same depth
+ gl_FragDepth = LL_SHADER_CONST_CLOUD_MOON_DEPTH; // SL-14113 Stars and Clouds need same depth
}
diff --git a/indra/newview/app_settings/shaders/class1/deferred/moonF.glsl b/indra/newview/app_settings/shaders/class1/deferred/moonF.glsl
index ffeaf2b600..e709d73bfa 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/moonF.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/moonF.glsl
@@ -74,6 +74,6 @@ void main()
frag_data[1] = vec4(0.0);
frag_data[2] = vec4(0.0f);
- gl_FragDepth = LL_SHADER_CONST_MOON_DEPTH; // SL-14113
+ gl_FragDepth = LL_SHADER_CONST_CLOUD_MOON_DEPTH; // SL-14113
}
diff --git a/indra/newview/app_settings/shaders/class1/environment/moonF.glsl b/indra/newview/app_settings/shaders/class1/environment/moonF.glsl
index 983cd17979..a220971f06 100644
--- a/indra/newview/app_settings/shaders/class1/environment/moonF.glsl
+++ b/indra/newview/app_settings/shaders/class1/environment/moonF.glsl
@@ -47,5 +47,5 @@ void main()
discard;
frag_color = color;
- gl_FragDepth = LL_SHADER_CONST_MOON_DEPTH; // SL-14113 Moon is infront of stars
+ gl_FragDepth = LL_SHADER_CONST_CLOUD_MOON_DEPTH; // SL-14113 Moon is infront of stars
}
diff --git a/indra/newview/app_settings/shaders/class1/windlight/moonF.glsl b/indra/newview/app_settings/shaders/class1/windlight/moonF.glsl
index 293e09620f..2e0932343b 100644
--- a/indra/newview/app_settings/shaders/class1/windlight/moonF.glsl
+++ b/indra/newview/app_settings/shaders/class1/windlight/moonF.glsl
@@ -68,6 +68,6 @@ void main()
c.rgb = scaleSoftClip(c.rgb);
frag_color = vec4(c.rgb, c.a);
- gl_FragDepth = LL_SHADER_CONST_MOON_DEPTH; // SL-14113
+ gl_FragDepth = LL_SHADER_CONST_CLOUD_MOON_DEPTH; // SL-14113
}
diff --git a/indra/newview/app_settings/shaders/class2/windlight/cloudsF.glsl b/indra/newview/app_settings/shaders/class2/windlight/cloudsF.glsl
index ec53ae75f9..490fde7cf6 100644
--- a/indra/newview/app_settings/shaders/class2/windlight/cloudsF.glsl
+++ b/indra/newview/app_settings/shaders/class2/windlight/cloudsF.glsl
@@ -132,6 +132,6 @@ void main()
// camera above water: class1\deferred\cloudsF.glsl
// camera below water: class2\windlight\coudsV.glsl
// See: starsV.glsl, cloudsV.glsl, moonF.glsl
- gl_FragDepth = LL_SHADER_CONST_CLOUD_DEPTH;
+ gl_FragDepth = LL_SHADER_CONST_CLOUD_MOON_DEPTH;
}
diff --git a/indra/newview/llviewershadermgr.cpp b/indra/newview/llviewershadermgr.cpp
index 1dcd9289ef..0c1ba13bb1 100644
--- a/indra/newview/llviewershadermgr.cpp
+++ b/indra/newview/llviewershadermgr.cpp
@@ -1075,7 +1075,7 @@ BOOL LLViewerShaderMgr::loadShadersEnvironment()
gMoonProgram.mShaderFiles.push_back(make_pair("environment/moonV.glsl", GL_VERTEX_SHADER_ARB));
gMoonProgram.mShaderFiles.push_back(make_pair("environment/moonF.glsl", GL_FRAGMENT_SHADER_ARB));
gMoonProgram.mShaderLevel = mShaderLevel[SHADER_ENVIRONMENT];
- gMoonProgram.addConstant( LLGLSLShader::SHADER_CONST_MOON_DEPTH ); // SL-14113
+ gMoonProgram.addConstant( LLGLSLShader::SHADER_CONST_CLOUD_MOON_DEPTH ); // SL-14113
success = gMoonProgram.createShader(NULL, NULL);
if (success)
@@ -2753,7 +2753,7 @@ BOOL LLViewerShaderMgr::loadShadersDeferred()
gDeferredWLCloudProgram.mShaderFiles.push_back(make_pair("deferred/cloudsF.glsl", GL_FRAGMENT_SHADER_ARB));
gDeferredWLCloudProgram.mShaderLevel = mShaderLevel[SHADER_DEFERRED];
gDeferredWLCloudProgram.mShaderGroup = LLGLSLShader::SG_SKY;
- gDeferredWLCloudProgram.addConstant( LLGLSLShader::SHADER_CONST_CLOUD_DEPTH ); // SL-14113
+ gDeferredWLCloudProgram.addConstant( LLGLSLShader::SHADER_CONST_CLOUD_MOON_DEPTH ); // SL-14113
success = gDeferredWLCloudProgram.createShader(NULL, NULL);
llassert(success);
}
@@ -2793,7 +2793,7 @@ BOOL LLViewerShaderMgr::loadShadersDeferred()
gDeferredWLMoonProgram.mShaderFiles.push_back(make_pair("deferred/moonF.glsl", GL_FRAGMENT_SHADER_ARB));
gDeferredWLMoonProgram.mShaderLevel = mShaderLevel[SHADER_DEFERRED];
gDeferredWLMoonProgram.mShaderGroup = LLGLSLShader::SG_SKY;
- gDeferredWLMoonProgram.addConstant( LLGLSLShader::SHADER_CONST_MOON_DEPTH ); // SL-14113
+ gDeferredWLMoonProgram.addConstant( LLGLSLShader::SHADER_CONST_CLOUD_MOON_DEPTH ); // SL-14113
success = gDeferredWLMoonProgram.createShader(NULL, NULL);
llassert(success);
}
@@ -4163,7 +4163,7 @@ BOOL LLViewerShaderMgr::loadShadersWindLight()
gWLCloudProgram.mShaderFiles.push_back(make_pair("windlight/cloudsF.glsl", GL_FRAGMENT_SHADER_ARB));
gWLCloudProgram.mShaderLevel = mShaderLevel[SHADER_WINDLIGHT];
gWLCloudProgram.mShaderGroup = LLGLSLShader::SG_SKY;
- gWLCloudProgram.addConstant( LLGLSLShader::SHADER_CONST_CLOUD_DEPTH ); // SL-14113
+ gWLCloudProgram.addConstant( LLGLSLShader::SHADER_CONST_CLOUD_MOON_DEPTH ); // SL-14113
success = gWLCloudProgram.createShader(NULL, NULL);
}
@@ -4200,7 +4200,7 @@ BOOL LLViewerShaderMgr::loadShadersWindLight()
gWLMoonProgram.mShaderFiles.push_back(make_pair("windlight/moonF.glsl", GL_FRAGMENT_SHADER_ARB));
gWLMoonProgram.mShaderLevel = mShaderLevel[SHADER_WINDLIGHT];
gWLMoonProgram.mShaderGroup = LLGLSLShader::SG_SKY;
- gWLMoonProgram.addConstant( LLGLSLShader::SHADER_CONST_MOON_DEPTH ); // SL-14113
+ gWLMoonProgram.addConstant( LLGLSLShader::SHADER_CONST_CLOUD_MOON_DEPTH ); // SL-14113
success = gWLMoonProgram.createShader(NULL, NULL);
}