summaryrefslogtreecommitdiff
path: root/indra
diff options
context:
space:
mode:
authorGraham Linden <graham@lindenlab.com>2013-08-15 10:07:41 -0700
committerGraham Linden <graham@lindenlab.com>2013-08-15 10:07:41 -0700
commit80256fdbf5fe444c177be793b12d0da58ce2b608 (patch)
tree78ca958dd7a82569334d35062b27445b9a737427 /indra
parentdc63061714b0872a123ca769cd3683ab233c9915 (diff)
NORSPEC-349 make render targets use original formats when resizing impostors and fix alpha for deferred impostor shader
Diffstat (limited to 'indra')
-rwxr-xr-xindra/llrender/llrendertarget.cpp6
-rwxr-xr-xindra/llrender/llrendertarget.h2
-rwxr-xr-xindra/newview/app_settings/shaders/class1/deferred/impostorF.glsl2
-rwxr-xr-xindra/newview/pipeline.cpp2
4 files changed, 7 insertions, 5 deletions
diff --git a/indra/llrender/llrendertarget.cpp b/indra/llrender/llrendertarget.cpp
index a011e81b99..731e0bc2b3 100755
--- a/indra/llrender/llrendertarget.cpp
+++ b/indra/llrender/llrendertarget.cpp
@@ -79,7 +79,7 @@ LLRenderTarget::~LLRenderTarget()
release();
}
-void LLRenderTarget::resize(U32 resx, U32 resy, U32 color_fmt)
+void LLRenderTarget::resize(U32 resx, U32 resy)
{
//for accounting, get the number of pixels added/subtracted
S32 pix_diff = (resx*resy)-(mResX*mResY);
@@ -87,10 +87,12 @@ void LLRenderTarget::resize(U32 resx, U32 resy, U32 color_fmt)
mResX = resx;
mResY = resy;
+ llassert(mInternalFormat.size() == mTex.size());
+
for (U32 i = 0; i < mTex.size(); ++i)
{ //resize color attachments
gGL.getTexUnit(0)->bindManual(mUsage, mTex[i]);
- LLImageGL::setManualImage(LLTexUnit::getInternalType(mUsage), 0, color_fmt, mResX, mResY, GL_RGBA, GL_UNSIGNED_BYTE, NULL, false);
+ LLImageGL::setManualImage(LLTexUnit::getInternalType(mUsage), 0, mInternalFormat[i], mResX, mResY, GL_RGBA, GL_UNSIGNED_BYTE, NULL, false);
sBytesAllocated += pix_diff*4;
}
diff --git a/indra/llrender/llrendertarget.h b/indra/llrender/llrendertarget.h
index 66a9874a6b..336441661c 100755
--- a/indra/llrender/llrendertarget.h
+++ b/indra/llrender/llrendertarget.h
@@ -79,7 +79,7 @@ public:
// CAUTION: if the GL runs out of memory attempting to resize, this render target will be undefined
// DO NOT use for screen space buffers or for scratch space for an image that might be uploaded
// DO use for render targets that resize often and aren't likely to ruin someone's day if they break
- void resize(U32 resx, U32 resy, U32 color_fmt);
+ void resize(U32 resx, U32 resy);
//add color buffer attachment
//limit of 4 color attachments per render target
diff --git a/indra/newview/app_settings/shaders/class1/deferred/impostorF.glsl b/indra/newview/app_settings/shaders/class1/deferred/impostorF.glsl
index 506323fdce..f8fdde43f9 100755
--- a/indra/newview/app_settings/shaders/class1/deferred/impostorF.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/impostorF.glsl
@@ -88,7 +88,7 @@ void main()
col.rgb = linear_to_srgb(col.rgb);
- frag_data[0] = vec4(col.rgb, col.a);
+ frag_data[0] = vec4(col.rgb, 0.0);
frag_data[1] = spec;
frag_data[2] = vec4(norm.xy,0,0);
}
diff --git a/indra/newview/pipeline.cpp b/indra/newview/pipeline.cpp
index bade7a9f52..1ca4115a5e 100755
--- a/indra/newview/pipeline.cpp
+++ b/indra/newview/pipeline.cpp
@@ -11384,7 +11384,7 @@ void LLPipeline::generateImpostor(LLVOAvatar* avatar)
else if(resX != avatar->mImpostor.getWidth() || resY != avatar->mImpostor.getHeight())
{
LLFastTimer t(FTM_IMPOSTOR_RESIZE);
- avatar->mImpostor.resize(resX,resY,LLPipeline::sRenderDeferred ? GL_SRGB8_ALPHA8 : GL_RGBA);
+ avatar->mImpostor.resize(resX,resY);
}
avatar->mImpostor.bindTarget();