summaryrefslogtreecommitdiff
path: root/indra/llrender
diff options
context:
space:
mode:
authorDave Parks <davep@lindenlab.com>2023-01-24 12:50:17 -0600
committerDave Parks <davep@lindenlab.com>2023-01-24 12:50:17 -0600
commita851aa83e705fa4a1c78919cfcac6709cfb1a875 (patch)
treef60abae0c94e459533f4f9f8b24564d1b260a6d9 /indra/llrender
parentbc6424779cda6ad03dbb59c2c14b91a7aa82bca9 (diff)
SL-18958 Fix for broken water distortion map and depth buffer. Incidental decruft.
Diffstat (limited to 'indra/llrender')
-rw-r--r--indra/llrender/llglslshader.cpp5
-rw-r--r--indra/llrender/llglslshader.h3
-rw-r--r--indra/llrender/llrender.cpp7
3 files changed, 10 insertions, 5 deletions
diff --git a/indra/llrender/llglslshader.cpp b/indra/llrender/llglslshader.cpp
index 982b2a847a..42b7cc46b3 100644
--- a/indra/llrender/llglslshader.cpp
+++ b/indra/llrender/llglslshader.cpp
@@ -1134,6 +1134,11 @@ S32 LLGLSLShader::unbindTexture(S32 uniform, LLTexUnit::eTextureType mode)
return uniform;
}
+S32 LLGLSLShader::getTextureChannel(S32 uniform) const
+{
+ return mTexture[uniform];
+}
+
S32 LLGLSLShader::enableTexture(S32 uniform, LLTexUnit::eTextureType mode, LLTexUnit::eTextureColorSpace space)
{
LL_PROFILE_ZONE_SCOPED_CATEGORY_SHADER;
diff --git a/indra/llrender/llglslshader.h b/indra/llrender/llglslshader.h
index 0522f78614..1ec41ebd3c 100644
--- a/indra/llrender/llglslshader.h
+++ b/indra/llrender/llglslshader.h
@@ -240,6 +240,9 @@ public:
S32 enableTexture(S32 uniform, LLTexUnit::eTextureType mode = LLTexUnit::TT_TEXTURE, LLTexUnit::eTextureColorSpace space = LLTexUnit::TCS_LINEAR);
S32 disableTexture(S32 uniform, LLTexUnit::eTextureType mode = LLTexUnit::TT_TEXTURE, LLTexUnit::eTextureColorSpace space = LLTexUnit::TCS_LINEAR);
+ // get the texture channel of the given uniform, or -1 if uniform is not used as a texture
+ S32 getTextureChannel(S32 uniform) const;
+
// bindTexture returns the texture unit we've bound the texture to.
// You can reuse the return value to unbind a texture when required.
S32 bindTexture(const std::string& uniform, LLTexture* texture, LLTexUnit::eTextureType mode = LLTexUnit::TT_TEXTURE, LLTexUnit::eTextureColorSpace space = LLTexUnit::TCS_LINEAR);
diff --git a/indra/llrender/llrender.cpp b/indra/llrender/llrender.cpp
index a8db69a9a4..d6b2aa2289 100644
--- a/indra/llrender/llrender.cpp
+++ b/indra/llrender/llrender.cpp
@@ -372,11 +372,8 @@ bool LLTexUnit::bind(LLRenderTarget* renderTarget, bool bindDepth)
if (bindDepth)
{
-
- if (renderTarget->getDepth() && !renderTarget->canSampleDepth())
- {
- LL_ERRS() << "Cannot bind a render buffer for sampling. Allocate render target with depth buffer sampling enabled." << LL_ENDL;
- }
+ llassert(renderTarget->getDepth()); // target MUST have a depth buffer attachment
+ llassert(renderTarget->canSampleDepth()); // depth buffer attachment MUST be sampleable
bindManual(renderTarget->getUsage(), renderTarget->getDepth());
}