diff options
author | Ptolemy <ptolemy@lindenlab.com> | 2021-04-29 08:41:50 -0700 |
---|---|---|
committer | Ptolemy <ptolemy@lindenlab.com> | 2021-04-29 14:07:57 -0700 |
commit | e371fdbf311e450ac0cc7f4d3fdacc938b489d92 (patch) | |
tree | ff5d1dec0a5371a661ccf103bf68ebac2f1ec3d3 /indra/llrender/llglslshader.h | |
parent | eb1e2a231410f8d2fefa4b4903b46b24f4259b04 (diff) |
SL-14113: Remove magic numbers. Take advantage of existing shader #defines injection by extending shader loading to make use of addConstant() instead of hard-coding magic number constants in each GLSL file.
Diffstat (limited to 'indra/llrender/llglslshader.h')
-rw-r--r-- | indra/llrender/llglslshader.h | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/indra/llrender/llglslshader.h b/indra/llrender/llglslshader.h index 7cf6d3c941..35e796e961 100644 --- a/indra/llrender/llglslshader.h +++ b/indra/llrender/llglslshader.h @@ -67,6 +67,14 @@ public: class LLGLSLShader { public: + // NOTE:Keep gShaderConsts and LLGLSLShader::ShaderConsts_e in sync! + enum eShaderConsts + { + SHADER_CONST_CLOUD_DEPTH + , SHADER_CONST_MOON_DEPTH + , SHADER_CONST_STAR_DEPTH + , NUM_SHADER_CONSTS + }; enum { @@ -149,7 +157,9 @@ public: void clearPermutations(); void addPermutation(std::string name, std::string value); void removePermutation(std::string name); - + + void addConstant( const LLGLSLShader::eShaderConsts shader_const ); + //enable/disable texture channel for specified uniform //if given texture uniform is active in the shader, //the corresponding channel will be active upon return |