diff options
| author | Oz Linden <oz@lindenlab.com> | 2020-06-15 15:29:04 -0400 |
|---|---|---|
| committer | Oz Linden <oz@lindenlab.com> | 2020-06-15 15:29:04 -0400 |
| commit | 86009f885efc796850d3e5b612c896a9d737fb86 (patch) | |
| tree | 404923800dbc6d09ea72b10de0c7f4bb103d1e62 /indra/llrender/llrendertarget.cpp | |
| parent | 17598f936bb6b099f21fc32aa80b68258cdfd0b9 (diff) | |
| parent | 1702a65665879d0c68df4c6b4fdb60f815ab7abb (diff) | |
SL-10297: merge up to master at 6.4.3
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) |
