summaryrefslogtreecommitdiff
path: root/indra/llrender
diff options
context:
space:
mode:
authorPalmer Truelson <palmer@lindenlab.com>2009-11-25 09:42:58 -0800
committerPalmer Truelson <palmer@lindenlab.com>2009-11-25 09:42:58 -0800
commitbb614fa887ec7cadc5b370c1dcf412ae5cf662e1 (patch)
tree2ee594428704e0f4774f717d71485ee0bdde8748 /indra/llrender
parent6d66910c6e2fbb25bf8b5c7b90e795f350342104 (diff)
parent57bc7dc44f31ef132a4abec228459c490c425eed (diff)
Merge of viewer 2
Diffstat (limited to 'indra/llrender')
-rw-r--r--indra/llrender/llrendertarget.cpp52
-rw-r--r--indra/llrender/llrendertarget.h7
2 files changed, 4 insertions, 55 deletions
diff --git a/indra/llrender/llrendertarget.cpp b/indra/llrender/llrendertarget.cpp
index f0df3bcf90..d9520b3bf6 100644
--- a/indra/llrender/llrendertarget.cpp
+++ b/indra/llrender/llrendertarget.cpp
@@ -61,11 +61,8 @@ BOOL LLRenderTarget::sUseFBO = FALSE;
LLRenderTarget::LLRenderTarget() :
mResX(0),
mResY(0),
- mViewportWidth(0),
- mViewportHeight(0),
mTex(0),
mFBO(0),
- mColorFmt(0),
mDepth(0),
mStencil(0),
mUseDepth(FALSE),
@@ -89,31 +86,13 @@ void LLRenderTarget::setSampleBuffer(LLMultisampleBuffer* buffer)
void LLRenderTarget::allocate(U32 resx, U32 resy, U32 color_fmt, BOOL depth, BOOL stencil, LLTexUnit::eTextureType usage, BOOL use_fbo)
{
- // only reallocate if something changed
- if (mResX == resx
- && mResY == resy
- && mUseDepth == depth
- && mStencil == stencil
- && mUsage == usage
- && (mFBO != 0) == ((sUseFBO || use_fbo) && gGLManager.mHasFramebufferObject)
- && mColorFmt == color_fmt)
- {
- // nothing to do
- return;
- }
-
stop_glerror();
mResX = resx;
mResY = resy;
- // default viewport to entire texture
- mViewportWidth = mResX;
- mViewportHeight = mResY;
mStencil = stencil;
mUsage = usage;
mUseDepth = depth;
- mFBO = 0;
- mColorFmt = color_fmt;
release();
@@ -333,7 +312,7 @@ void LLRenderTarget::bindTarget()
}
}
- glViewport(0, 0, mViewportWidth, mViewportHeight);
+ glViewport(0, 0, mResX, mResY);
sBoundTarget = this;
}
@@ -536,18 +515,12 @@ BOOL LLRenderTarget::isComplete() const
return (!mTex.empty() || mDepth) ? TRUE : FALSE;
}
-void LLRenderTarget::setViewport(U32 width, U32 height)
-{
- mViewportWidth = llmin(width, mResX);
- mViewportHeight = llmin(height, mResY);
-}
-
void LLRenderTarget::getViewport(S32* viewport)
{
viewport[0] = 0;
viewport[1] = 0;
- viewport[2] = mViewportWidth;
- viewport[3] = mViewportHeight;
+ viewport[2] = mResX;
+ viewport[3] = mResY;
}
//==================================================
@@ -608,7 +581,7 @@ void LLMultisampleBuffer::bindTarget(LLRenderTarget* ref)
check_framebuffer_status();
- glViewport(0, 0, mViewportWidth, mViewportHeight);
+ glViewport(0, 0, mResX, mResY);
sBoundTarget = this;
}
@@ -620,30 +593,13 @@ void LLMultisampleBuffer::allocate(U32 resx, U32 resy, U32 color_fmt, BOOL depth
void LLMultisampleBuffer::allocate(U32 resx, U32 resy, U32 color_fmt, BOOL depth, BOOL stencil, LLTexUnit::eTextureType usage, BOOL use_fbo, U32 samples )
{
- if (mResX == resx
- && mResY == resy
- && mUseDepth == depth
- && mStencil == stencil
- && mUsage == usage
- && (mFBO != 0) == ((sUseFBO || use_fbo) && gGLManager.mHasFramebufferObject)
- && mColorFmt == color_fmt
- && mSamples == samples)
- {
- // nothing to do
- return;
- }
-
stop_glerror();
mResX = resx;
mResY = resy;
- mViewportWidth = mResX;
- mViewportHeight = mResY;
mUsage = usage;
mUseDepth = depth;
mStencil = stencil;
- mFBO = 0;
- mColorFmt = color_fmt;
releaseSampleBuffer();
diff --git a/indra/llrender/llrendertarget.h b/indra/llrender/llrendertarget.h
index 125747424c..b7ebfc8f7f 100644
--- a/indra/llrender/llrendertarget.h
+++ b/indra/llrender/llrendertarget.h
@@ -107,9 +107,6 @@ public:
//uses scissor rect if in copy-to-texture mode
void clear(U32 mask = 0xFFFFFFFF);
- // override default viewport to a smaller size
- void setViewport(U32 width, U32 height);
-
//get applied viewport
void getViewport(S32* viewport);
@@ -153,16 +150,12 @@ protected:
friend class LLMultisampleBuffer;
U32 mResX;
U32 mResY;
- U32 mViewportWidth;
- U32 mViewportHeight;
std::vector<U32> mTex;
U32 mFBO;
- U32 mColorFmt;
U32 mDepth;
BOOL mStencil;
BOOL mUseDepth;
BOOL mRenderDepth;
-
LLTexUnit::eTextureType mUsage;
U32 mSamples;
LLMultisampleBuffer* mSampleBuffer;