summaryrefslogtreecommitdiff
path: root/indra/llrender/llrendertarget.cpp
diff options
context:
space:
mode:
authorAndrey Lihatskiy <alihatskiy@productengine.com>2020-04-29 19:34:39 +0300
committerAndrey Lihatskiy <alihatskiy@productengine.com>2020-04-29 19:34:39 +0300
commitb6441bf09b9058a799e7581878ee21007323ee0c (patch)
treebad6f8f26b83643dc0f603a8c774a9ddaedd13c2 /indra/llrender/llrendertarget.cpp
parentde696d0213b98110f930cae35a8db005e3d1a061 (diff)
parentf20b22e325ef15e0aa6eef950ba96538bb015568 (diff)
Merge branch 'DRTVWR-500' into DRTVWR-501-maint
Diffstat (limited to 'indra/llrender/llrendertarget.cpp')
-rw-r--r--indra/llrender/llrendertarget.cpp19
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)