diff options
Diffstat (limited to 'indra/llrender/llglslshader.cpp')
| -rw-r--r-- | indra/llrender/llglslshader.cpp | 26 |
1 files changed, 15 insertions, 11 deletions
diff --git a/indra/llrender/llglslshader.cpp b/indra/llrender/llglslshader.cpp index aac5e3abc8..39bd9cbfed 100644 --- a/indra/llrender/llglslshader.cpp +++ b/indra/llrender/llglslshader.cpp @@ -57,6 +57,7 @@ S32 LLGLSLShader::sIndexedTextureChannels = 0; U32 LLGLSLShader::sMaxGLTFMaterials = 0; U32 LLGLSLShader::sMaxGLTFNodes = 0; bool LLGLSLShader::sProfileEnabled = false; +bool LLGLSLShader::sCanProfile = true; std::set<LLGLSLShader*> LLGLSLShader::sInstances; LLGLSLShader::defines_map_t LLGLSLShader::sGlobalDefines; U64 LLGLSLShader::sTotalTimeElapsed = 0; @@ -273,7 +274,7 @@ void LLGLSLShader::placeProfileQuery(bool for_runtime) bool LLGLSLShader::readProfileQuery(bool for_runtime, bool force_read) { - if (sProfileEnabled || for_runtime) + if ((sProfileEnabled || for_runtime) && sCanProfile) { if (!mProfilePending) { @@ -450,8 +451,11 @@ bool LLGLSLShader::createShader() llassert_always(!mShaderFiles.empty()); #if LL_DARWIN - // work-around missing mix(vec3,vec3,bvec3) - mDefines["OLD_SELECT"] = "1"; + if(!gGLManager.mIsApple) + { + // work-around missing mix(vec3,vec3,bvec3) + mDefines["OLD_SELECT"] = "1"; + } #endif mShaderHash = hash(); @@ -572,7 +576,7 @@ bool LLGLSLShader::createShader() } } -#ifdef LL_PROFILER_ENABLE_RENDER_DOC +#if LL_PROFILER_ENABLE_RENDER_DOC setLabel(mName.c_str()); #endif @@ -1190,22 +1194,22 @@ S32 LLGLSLShader::bindTexture(S32 uniform, LLRenderTarget* texture, bool depth, return -1; } - uniform = getTextureChannel(uniform); + S32 channel = getTextureChannel(uniform); - if (uniform > -1) + if (channel > -1) { if (depth) { - gGL.getTexUnit(uniform)->bind(texture, true); + gGL.getTexUnit(channel)->bind(texture, true); } else { bool has_mips = mode == LLTexUnit::TFO_TRILINEAR || mode == LLTexUnit::TFO_ANISOTROPIC; - gGL.getTexUnit(uniform)->bindManual(texture->getUsage(), texture->getTexture(index), has_mips); + gGL.getTexUnit(channel)->bindManual(texture->getUsage(), texture->getTexture(index), has_mips); } - gGL.getTexUnit(uniform)->setTextureFilteringOption(mode); + gGL.getTexUnit(channel)->setTextureFilteringOption(mode); } - return uniform; + return channel; } S32 LLGLSLShader::bindTexture(const std::string& uniform, LLRenderTarget* texture, bool depth, LLTexUnit::eTextureFilterOptions mode) @@ -2116,7 +2120,7 @@ LLUUID LLGLSLShader::hash() return hash_obj.digest(); } -#ifdef LL_PROFILER_ENABLE_RENDER_DOC +#if LL_PROFILER_ENABLE_RENDER_DOC void LLGLSLShader::setLabel(const char* label) { LL_LABEL_OBJECT_GL(GL_PROGRAM, mProgramObject, strlen(label), label); } |
