summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDon Kjer <don@lindenlab.com>2012-12-06 22:54:50 +0000
committerDon Kjer <don@lindenlab.com>2012-12-06 22:54:50 +0000
commit07d05c2967fb1013a3f21c1c055ad068b2be9995 (patch)
treedc06635670b65798d824595486f314a809d7dd88
parent96ef49df75c0248e4843f9a5b53f010b819d59f3 (diff)
Alpha rendering fixes for appearance utility.
-rw-r--r--autobuild.xml4
-rw-r--r--indra/llappearance/lltexlayer.cpp85
-rw-r--r--indra/llcommon/tests/bitpack_test.cpp2
-rwxr-xr-xindra/newview/llviewertexlayer.cpp5
4 files changed, 8 insertions, 88 deletions
diff --git a/autobuild.xml b/autobuild.xml
index f5ea967b32..d13687849d 100644
--- a/autobuild.xml
+++ b/autobuild.xml
@@ -1290,9 +1290,9 @@
<key>archive</key>
<map>
<key>hash</key>
- <string>5552d94c9ef2a21273cb1fff1446a699</string>
+ <string>84aee73ab14ec7c56e54fa17f44a06f0</string>
<key>url</key>
- <string>http://s3-proxy.lindenlab.com/private-builds-secondlife-com/hg/repo/llappearanceutility-source/rev/267407/arch/Linux/installer/llappearanceutility_source-0.1-linux-20121128.tar.bz2</string>
+ <string>http://s3-proxy.lindenlab.com/private-builds-secondlife-com/hg/repo/llappearanceutility-source/rev/267783/arch/Linux/installer/llappearanceutility_source-0.1-linux-20121206.tar.bz2</string>
</map>
<key>name</key>
<string>linux</string>
diff --git a/indra/llappearance/lltexlayer.cpp b/indra/llappearance/lltexlayer.cpp
index a8bbbdbc06..d1edd4f095 100644
--- a/indra/llappearance/lltexlayer.cpp
+++ b/indra/llappearance/lltexlayer.cpp
@@ -145,17 +145,11 @@ BOOL LLTexLayerSetBuffer::renderTexLayerSet()
bool use_shaders = LLGLSLShader::sNoFixedFunction;
- LLGLEnable(GL_ALPHA_TEST);
-
if (use_shaders)
{
gAlphaMaskProgram.bind();
gAlphaMaskProgram.setMinimumAlpha(0.004f);
}
- else
- {
- gGL.setAlphaRejectSettings(LLRender::CF_GREATER, 0.004f);
- }
LLVertexBuffer::unbind();
@@ -394,7 +388,6 @@ BOOL LLTexLayerSet::render( S32 x, S32 y, S32 width, S32 height )
LLGLSUIDefault gls_ui;
LLGLDepthTest gls_depth(GL_FALSE, GL_FALSE);
gGL.setColorMask(true, true);
- LLGLEnable(GL_ALPHA_TEST);
// clear buffer area to ensure we don't pick up UI elements
{
@@ -404,11 +397,6 @@ BOOL LLTexLayerSet::render( S32 x, S32 y, S32 width, S32 height )
{
gAlphaMaskProgram.setMinimumAlpha(0.0f);
}
- else
- {
- gGL.setAlphaRejectSettings(LLRender::CF_GREATER, 0.0f);
- }
-
gGL.getTexUnit(0)->unbind(LLTexUnit::TT_TEXTURE);
gGL.color4f( 0.f, 0.f, 0.f, 1.f );
@@ -419,10 +407,6 @@ BOOL LLTexLayerSet::render( S32 x, S32 y, S32 width, S32 height )
{
gAlphaMaskProgram.setMinimumAlpha(0.004f);
}
- else
- {
- gGL.setAlphaRejectSettings(LLRender::CF_GREATER, 0.004f);
- }
}
if (mIsVisible)
@@ -453,10 +437,6 @@ BOOL LLTexLayerSet::render( S32 x, S32 y, S32 width, S32 height )
{
gAlphaMaskProgram.setMinimumAlpha(0.f);
}
- else
- {
- gGL.setAlphaRejectSettings(LLRender::CF_GREATER, 0.0f);
- }
gGL.getTexUnit(0)->unbind(LLTexUnit::TT_TEXTURE);
gGL.color4f( 0.f, 0.f, 0.f, 0.f );
@@ -469,11 +449,6 @@ BOOL LLTexLayerSet::render( S32 x, S32 y, S32 width, S32 height )
{
gAlphaMaskProgram.setMinimumAlpha(0.004f);
}
- else
- {
- gGL.setAlphaRejectSettings(LLRender::CF_GREATER, 0.004f);
- }
-
}
return success;
@@ -564,7 +539,6 @@ void LLTexLayerSet::renderAlphaMaskTextures(S32 x, S32 y, S32 width, S32 height,
gGL.setColorMask(false, true);
gGL.setSceneBlendType(LLRender::BT_REPLACE);
- LLGLEnable(GL_ALPHA_TEST);
// (Optionally) replace alpha with a single component image from a tga file.
if (!info->mStaticAlphaFileName.empty())
@@ -591,11 +565,6 @@ void LLTexLayerSet::renderAlphaMaskTextures(S32 x, S32 y, S32 width, S32 height,
{
gAlphaMaskProgram.setMinimumAlpha(0.f);
}
- else
- {
- gGL.setAlphaRejectSettings(LLRender::CF_GREATER, 0.0f);
- }
-
gGL.getTexUnit(0)->unbind(LLTexUnit::TT_TEXTURE);
gGL.color4f( 0.f, 0.f, 0.f, 1.f );
@@ -606,11 +575,6 @@ void LLTexLayerSet::renderAlphaMaskTextures(S32 x, S32 y, S32 width, S32 height,
{
gAlphaMaskProgram.setMinimumAlpha(0.004f);
}
- else
- {
- gGL.setAlphaRejectSettings(LLRender::CF_GREATER, 0.004f);
- }
-
}
// (Optional) Mask out part of the baked texture with alpha masks
@@ -1118,7 +1082,6 @@ BOOL LLTexLayer::render(S32 x, S32 y, S32 width, S32 height)
//gPipeline.disableLights();
stop_glerror();
glDisable(GL_LIGHTING);
- LLGLEnable(GL_ALPHA_TEST);
stop_glerror();
bool use_shaders = LLGLSLShader::sNoFixedFunction;
@@ -1211,10 +1174,6 @@ BOOL LLTexLayer::render(S32 x, S32 y, S32 width, S32 height)
{
gAlphaMaskProgram.setMinimumAlpha(0.f);
}
- else
- {
- gGL.setAlphaRejectSettings(LLRender::CF_GREATER, 0.0f);
- }
}
LLTexUnit::eTextureAddressMode old_mode = tex->getAddressMode();
@@ -1232,12 +1191,7 @@ BOOL LLTexLayer::render(S32 x, S32 y, S32 width, S32 height)
{
gAlphaMaskProgram.setMinimumAlpha(0.004f);
}
- else
- {
- gGL.setAlphaRejectSettings(LLRender::CF_GREATER, 0.004f);
- }
}
-
}
}
// else
@@ -1272,11 +1226,7 @@ BOOL LLTexLayer::render(S32 x, S32 y, S32 width, S32 height)
LLGLDisable no_alpha(GL_ALPHA_TEST);
if (use_shaders)
{
- gAlphaMaskProgram.setMinimumAlpha(0.f);
- }
- else
- {
- gGL.setAlphaRejectSettings(LLRender::CF_GREATER, 0.0f);
+ gAlphaMaskProgram.setMinimumAlpha(0.000f);
}
gGL.getTexUnit(0)->unbind(LLTexUnit::TT_TEXTURE);
@@ -1286,10 +1236,6 @@ BOOL LLTexLayer::render(S32 x, S32 y, S32 width, S32 height)
{
gAlphaMaskProgram.setMinimumAlpha(0.004f);
}
- else
- {
- gGL.setAlphaRejectSettings(LLRender::CF_GREATER, 0.004f);
- }
}
if( alpha_mask_specified || getInfo()->mWriteAllChannels )
@@ -1378,7 +1324,6 @@ BOOL LLTexLayer::blendAlphaTexture(S32 x, S32 y, S32 width, S32 height)
gGL.flush();
bool use_shaders = LLGLSLShader::sNoFixedFunction;
- LLGLEnable(GL_ALPHA_TEST);
if( !getInfo()->mStaticImageFileName.empty() )
{
@@ -1390,11 +1335,6 @@ BOOL LLTexLayer::blendAlphaTexture(S32 x, S32 y, S32 width, S32 height)
{
gAlphaMaskProgram.setMinimumAlpha(0.f);
}
- else
- {
- gGL.setAlphaRejectSettings(LLRender::CF_GREATER, 0.0f);
- }
-
gGL.getTexUnit(0)->bind(tex, TRUE);
gl_rect_2d_simple_tex( width, height );
gGL.getTexUnit(0)->unbind(LLTexUnit::TT_TEXTURE);
@@ -1402,10 +1342,6 @@ BOOL LLTexLayer::blendAlphaTexture(S32 x, S32 y, S32 width, S32 height)
{
gAlphaMaskProgram.setMinimumAlpha(0.004f);
}
- else
- {
- gGL.setAlphaRejectSettings(LLRender::CF_GREATER, 0.004f);
- }
}
else
{
@@ -1424,11 +1360,6 @@ BOOL LLTexLayer::blendAlphaTexture(S32 x, S32 y, S32 width, S32 height)
{
gAlphaMaskProgram.setMinimumAlpha(0.f);
}
- else
- {
- gGL.setAlphaRejectSettings(LLRender::CF_GREATER, 0.0f);
- }
-
gGL.getTexUnit(0)->bind(tex);
gl_rect_2d_simple_tex( width, height );
gGL.getTexUnit(0)->unbind(LLTexUnit::TT_TEXTURE);
@@ -1437,10 +1368,6 @@ BOOL LLTexLayer::blendAlphaTexture(S32 x, S32 y, S32 width, S32 height)
{
gAlphaMaskProgram.setMinimumAlpha(0.004f);
}
- else
- {
- gGL.setAlphaRejectSettings(LLRender::CF_GREATER, 0.0f);
- }
}
}
}
@@ -1462,17 +1389,11 @@ BOOL LLTexLayer::renderMorphMasks(S32 x, S32 y, S32 width, S32 height, const LLC
llassert( !mParamAlphaList.empty() );
bool use_shaders = LLGLSLShader::sNoFixedFunction;
- LLGLEnable(GL_ALPHA_TEST);
if (use_shaders)
{
gAlphaMaskProgram.setMinimumAlpha(0.f);
}
- else
- {
- gGL.setAlphaRejectSettings(LLRender::CF_GREATER, 0.0f);
- }
-
gGL.setColorMask(false, true);
@@ -1553,10 +1474,6 @@ BOOL LLTexLayer::renderMorphMasks(S32 x, S32 y, S32 width, S32 height, const LLC
{
gAlphaMaskProgram.setMinimumAlpha(0.004f);
}
- else
- {
- gGL.setAlphaRejectSettings(LLRender::CF_GREATER, 0.004f);
- }
LLGLSUIDefault gls_ui;
diff --git a/indra/llcommon/tests/bitpack_test.cpp b/indra/llcommon/tests/bitpack_test.cpp
index 49cae16400..7bca20c30a 100644
--- a/indra/llcommon/tests/bitpack_test.cpp
+++ b/indra/llcommon/tests/bitpack_test.cpp
@@ -94,7 +94,7 @@ namespace tut
ensure("bitPack: individual unpack: 5", unpackbuffer[0] == (U8) str[5]);
bitunpack.bitUnpack(unpackbuffer, 8*4); // Life
ensure_memory_matches("bitPack: 4 bytes unpack:", unpackbuffer, 4, str+6, 4);
- ensure("keep compiler quiet", unpack_bufsize == unpack_bufsize);
+ //ensure("keep compiler quiet", unpack_bufsize == unpack_bufsize);
}
// U32 packing
diff --git a/indra/newview/llviewertexlayer.cpp b/indra/newview/llviewertexlayer.cpp
index cd5e781d71..f3c9921819 100755
--- a/indra/newview/llviewertexlayer.cpp
+++ b/indra/newview/llviewertexlayer.cpp
@@ -416,7 +416,10 @@ void LLViewerTexLayerSetBuffer::doUpload()
BOOL valid = FALSE;
LLPointer<LLImageJ2C> integrity_test = new LLImageJ2C;
S32 file_size = 0;
- U8* data = LLVFile::readFile(gVFS, asset_id, LLAssetType::AT_TEXTURE, &file_size);
+ LLVFile file(gVFS, asset_id, LLAssetType::AT_TEXTURE);
+ file_size = file.getSize();
+ U8* data = integrity_test->allocateData(file_size);
+ file.read(data, file_size);
if (data)
{
valid = integrity_test->validate(data, file_size); // integrity_test will delete 'data'