diff options
author | Geenz <geenz@geenzo.com> | 2019-04-10 02:11:07 -0700 |
---|---|---|
committer | Geenz <geenz@geenzo.com> | 2019-04-10 02:11:07 -0700 |
commit | 08812cbe060e62cb8b61e91bc2f878a74a0015e5 (patch) | |
tree | 50e6cd88845b96a7b457bc3f81c56f4d17a114b8 /indra/llrender/llglslshader.cpp | |
parent | dcd8117b85f45886f78a1a2e9756cb1709d6572a (diff) |
Separate out vertex program objects from fragment program objects and use it.
Given that mShaderObjects only ever expects one copy of a given shader object (leading to lots of "shaderV" and "shaderF"), it made having utility shaders a bit more difficult to incorporate.
This change makes sure the two are separated. Using this over a multimap largely for readibility.
Also, actually, you know, use this functionality.
--HG--
branch : OPEN-340
Diffstat (limited to 'indra/llrender/llglslshader.cpp')
-rw-r--r-- | indra/llrender/llglslshader.cpp | 21 |
1 files changed, 18 insertions, 3 deletions
diff --git a/indra/llrender/llglslshader.cpp b/indra/llrender/llglslshader.cpp index f8b5dd0559..babf649ece 100644 --- a/indra/llrender/llglslshader.cpp +++ b/indra/llrender/llglslshader.cpp @@ -485,12 +485,27 @@ BOOL LLGLSLShader::createShader(std::vector<LLStaticHashedString> * attributes, return success; } -BOOL LLGLSLShader::attachObject(std::string object_path) +BOOL LLGLSLShader::attachVertexObject(std::string object_path) { + if (LLShaderMgr::instance()->mVertexShaderObjects.count(object_path) > 0) + { + stop_glerror(); + glAttachObjectARB(mProgramObject, LLShaderMgr::instance()->mVertexShaderObjects[object_path]); + stop_glerror(); + return TRUE; + } + else + { + LL_SHADER_LOADING_WARNS() << "Attempting to attach shader object: '" << object_path << "' that hasn't been compiled." << LL_ENDL; + return FALSE; + } +} + +BOOL LLGLSLShader::attachFragmentObject(std::string object_path) { - if (LLShaderMgr::instance()->mShaderObjects.count(object_path) > 0) + if (LLShaderMgr::instance()->mFragmentShaderObjects.count(object_path) > 0) { stop_glerror(); - glAttachObjectARB(mProgramObject, LLShaderMgr::instance()->mShaderObjects[object_path]); + glAttachObjectARB(mProgramObject, LLShaderMgr::instance()->mFragmentShaderObjects[object_path]); stop_glerror(); return TRUE; } |