diff options
author | William Todd Stinson <stinson@lindenlab.com> | 2012-10-09 12:32:45 -0700 |
---|---|---|
committer | William Todd Stinson <stinson@lindenlab.com> | 2012-10-09 12:32:45 -0700 |
commit | 9b05e5f35baeaace95dbbbb1fbccb9b79f7da847 (patch) | |
tree | 1c904fd6f0bb23371a47d246cb7dc823c5fccf2b /indra/llrender/llshadermgr.cpp | |
parent | 38a565f71a54aaa66300a0ab593e366731aac769 (diff) | |
parent | 1991d95e852b3798ab3e41706525c843dd54914a (diff) |
Pull and merge from ssh://hg@bitbucket.org/lindenlab/viewer-development-materials.
Diffstat (limited to 'indra/llrender/llshadermgr.cpp')
-rw-r--r-- | indra/llrender/llshadermgr.cpp | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/indra/llrender/llshadermgr.cpp b/indra/llrender/llshadermgr.cpp index b6a9a6b653..3b1ec281c9 100644 --- a/indra/llrender/llshadermgr.cpp +++ b/indra/llrender/llshadermgr.cpp @@ -521,7 +521,7 @@ void LLShaderMgr::dumpObjectLog(GLhandleARB ret, BOOL warns) } } -GLhandleARB LLShaderMgr::loadShaderFile(const std::string& filename, S32 & shader_level, GLenum type, S32 texture_index_channels) +GLhandleARB LLShaderMgr::loadShaderFile(const std::string& filename, S32 & shader_level, GLenum type, boost::unordered_map<std::string, std::string> defines, S32 texture_index_channels) { GLenum error = GL_NO_ERROR; if (gDebugGL) @@ -657,6 +657,12 @@ GLhandleARB LLShaderMgr::loadShaderFile(const std::string& filename, S32 & shade std::string define = "#define " + iter->first + " " + iter->second + "\n"; text[count++] = (GLcharARB *) strdup(define.c_str()); } + + for (boost::unordered_map<std::string,std::string>::iterator iter = defines.begin(); iter != defines.end(); ++iter) + { + std::string define = "#define " + iter->first + " " + iter->second + "\n"; + text[count++] = (GLcharARB *) strdup(define.c_str()); + } if (texture_index_channels > 0 && type == GL_FRAGMENT_SHADER_ARB) { @@ -854,7 +860,7 @@ GLhandleARB LLShaderMgr::loadShaderFile(const std::string& filename, S32 & shade if (shader_level > 1) { shader_level--; - return loadShaderFile(filename,shader_level,type,texture_index_channels); + return loadShaderFile(filename,shader_level,type, defines, texture_index_channels); } LL_WARNS("ShaderLoading") << "Failed to load " << filename << LL_ENDL; } |