summaryrefslogtreecommitdiff
path: root/indra/llrender
diff options
context:
space:
mode:
authorCosmic Linden <cosmic@lindenlab.com>2024-02-21 12:53:10 -0800
committerCosmic Linden <cosmic@lindenlab.com>2024-02-21 12:53:10 -0800
commit589910f445efa9690b543a37b9e2e14792a0e133 (patch)
tree1764a2b2f9e5e81e5101e6b59422f4a4e06868aa /indra/llrender
parentbbc7d63a79b9744acaff51315e5e9a9d7299bd12 (diff)
secondlife/viewer-issues#72: Fix material preview affecting exposure on main screen
Diffstat (limited to 'indra/llrender')
-rw-r--r--indra/llrender/llrendertarget.cpp26
-rw-r--r--indra/llrender/llrendertarget.h3
2 files changed, 29 insertions, 0 deletions
diff --git a/indra/llrender/llrendertarget.cpp b/indra/llrender/llrendertarget.cpp
index 88c48e5166..3dccb9c8fd 100644
--- a/indra/llrender/llrendertarget.cpp
+++ b/indra/llrender/llrendertarget.cpp
@@ -567,4 +567,30 @@ bool LLRenderTarget::isBoundInStack() const
return cur == this;
}
+void LLRenderTarget::swapFBORefs(LLRenderTarget& other)
+{
+ // Must be initialized
+ llassert(mFBO);
+ llassert(other.mFBO);
+ // Must be unbound
+ // *NOTE: mPreviousRT can be non-null even if this target is unbound - presumably for debugging purposes?
+ llassert(sCurFBO != mFBO);
+ llassert(sCurFBO != other.mFBO);
+ llassert(!isBoundInStack());
+ llassert(!other.isBoundInStack());
+
+ // Must be same type
+ llassert(sUseFBO == other.sUseFBO);
+ llassert(mResX == other.mResX);
+ llassert(mResY == other.mResY);
+ llassert(mInternalFormat == other.mInternalFormat);
+ llassert(mTex.size() == other.mTex.size());
+ llassert(mDepth == other.mDepth);
+ llassert(mUseDepth == other.mUseDepth);
+ llassert(mGenerateMipMaps == other.mGenerateMipMaps);
+ llassert(mMipLevels == other.mMipLevels);
+ llassert(mUsage == other.mUsage);
+
+ std::swap(mFBO, other.mFBO);
+}
diff --git a/indra/llrender/llrendertarget.h b/indra/llrender/llrendertarget.h
index 9fcea35e3d..da401572d1 100644
--- a/indra/llrender/llrendertarget.h
+++ b/indra/llrender/llrendertarget.h
@@ -169,6 +169,9 @@ public:
static LLRenderTarget* getCurrentBoundTarget() { return sBoundTarget; }
+ // *HACK
+ void swapFBORefs(LLRenderTarget& other);
+
protected:
U32 mResX;
U32 mResY;