diff options
author | cosmic-linden <111533034+cosmic-linden@users.noreply.github.com> | 2024-02-21 16:49:04 -0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-02-21 16:49:04 -0800 |
commit | 6a97433f3bd025fc0011bc4399b05ecbcc11d89a (patch) | |
tree | 595c349db5c0aa39992a4fb5412309d8b26ecf7a /indra/llrender | |
parent | 1552ee3a5d72a1d6b2dc536d033d4c2d8f2e74ee (diff) | |
parent | fc7abe8cb9ef737cb1ad4431e30c42f08d6e8899 (diff) |
Merge pull request #849 from secondlife/vi-72
secondlife/viewer-issues#72: Fix material preview making things disappear. General cleanup.
Diffstat (limited to 'indra/llrender')
-rw-r--r-- | indra/llrender/llrendertarget.cpp | 27 | ||||
-rw-r--r-- | indra/llrender/llrendertarget.h | 3 |
2 files changed, 30 insertions, 0 deletions
diff --git a/indra/llrender/llrendertarget.cpp b/indra/llrender/llrendertarget.cpp index 88c48e5166..9cd7527d3e 100644 --- a/indra/llrender/llrendertarget.cpp +++ b/indra/llrender/llrendertarget.cpp @@ -567,4 +567,31 @@ 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); + std::swap(mTex, other.mTex); +} 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; |