diff options
| author | Andrey Lihatskiy <alihatskiy@productengine.com> | 2020-04-20 21:21:12 +0300 |
|---|---|---|
| committer | Andrey Lihatskiy <alihatskiy@productengine.com> | 2020-04-20 21:21:12 +0300 |
| commit | 7a311fe30ee3c4a4de0149822b0670f612eb4a67 (patch) | |
| tree | aacf08a74bf2214c17d6de7c5edaa1a6da8d9eec /indra/llrender/llrendertarget.cpp | |
| parent | 6666fdb5d6f52df3d68bed35a4ad05139f49f93c (diff) | |
| parent | d7f1c88c35849e56f5b352f13c16a08467d1533b (diff) | |
Merge branch 'master' into DRTVWR-497
Diffstat (limited to 'indra/llrender/llrendertarget.cpp')
| -rw-r--r-- | indra/llrender/llrendertarget.cpp | 19 |
1 files changed, 18 insertions, 1 deletions
diff --git a/indra/llrender/llrendertarget.cpp b/indra/llrender/llrendertarget.cpp index cd484b4fe9..9fb4f7f2b0 100644 --- a/indra/llrender/llrendertarget.cpp +++ b/indra/llrender/llrendertarget.cpp @@ -502,9 +502,26 @@ U32 LLRenderTarget::getNumTextures() const } -void LLRenderTarget::bindTexture(U32 index, S32 channel) +void LLRenderTarget::bindTexture(U32 index, S32 channel, LLTexUnit::eTextureFilterOptions filter_options) { gGL.getTexUnit(channel)->bindManual(mUsage, getTexture(index)); + + bool isSRGB = false; + llassert(mInternalFormat.size() > index); + switch (mInternalFormat[index]) + { + case GL_SRGB_ALPHA: + case GL_SRGB: + case GL_SRGB8_ALPHA8: + isSRGB = true; + break; + + default: + break; + } + + gGL.getTexUnit(channel)->setTextureFilteringOption(filter_options); + gGL.getTexUnit(channel)->setTextureColorSpace(isSRGB ? LLTexUnit::TCS_SRGB : LLTexUnit::TCS_LINEAR); } void LLRenderTarget::flush(bool fetch_depth) |
