diff --git a/indra/llappearance/lltexlayer.cpp b/indra/llappearance/lltexlayer.cpp index 59765b3833773ae5905bdd9c3c4558c61e929ef9..510d8ce879a0df81e14ea938aa629201b67f8c17 100644 --- a/indra/llappearance/lltexlayer.cpp +++ b/indra/llappearance/lltexlayer.cpp @@ -1776,13 +1776,11 @@ LLTexLayer* LLTexLayerTemplate::getLayer(U32 i) const /*virtual*/ void LLTexLayerTemplate::gatherAlphaMasks(U8 *data, S32 originX, S32 originY, S32 width, S32 height) { U32 num_wearables = updateWearableCache(); - for (U32 i = 0; i < num_wearables; i++) + U32 i = num_wearables - 1; // For rendering morph masks, we only want to use the top wearable + LLTexLayer *layer = getLayer(i); + if (layer) { - LLTexLayer *layer = getLayer(i); - if (layer) - { - layer->addAlphaMask(data, originX, originY, width, height); - } + layer->addAlphaMask(data, originX, originY, width, height); } }