diff options
Diffstat (limited to 'indra/llappearance')
| -rw-r--r-- | indra/llappearance/lltexlayer.cpp | 9 | ||||
| -rw-r--r-- | indra/llappearance/lltexlayerparams.cpp | 2 | ||||
| -rw-r--r-- | indra/llappearance/lltexlayerparams.h | 2 | 
3 files changed, 10 insertions, 3 deletions
| diff --git a/indra/llappearance/lltexlayer.cpp b/indra/llappearance/lltexlayer.cpp index 3430a25536..e1a3a83841 100644 --- a/indra/llappearance/lltexlayer.cpp +++ b/indra/llappearance/lltexlayer.cpp @@ -1509,7 +1509,14 @@ void LLTexLayer::renderMorphMasks(S32 x, S32 y, S32 width, S32 height, const LLC                  }                  else                  { // platforms with working drivers... -				    glReadPixels(x, y, width, height, GL_ALPHA, GL_UNSIGNED_BYTE, alpha_data);                 +                    // We just want GL_ALPHA, but that isn't supported in OGL core profile 4. +                    static const size_t TEMP_BYTES_PER_PIXEL = 4; +                    U8* temp_data = (U8*)ll_aligned_malloc_32(mem_size * TEMP_BYTES_PER_PIXEL); +                    glReadPixels(x, y, width, height, GL_RGBA, GL_UNSIGNED_BYTE, temp_data); +                    for (size_t pixel = 0; pixel < pixels; pixel++) { +                        alpha_data[pixel] = temp_data[(pixel * TEMP_BYTES_PER_PIXEL) + 3]; +                    } +                    ll_aligned_free_32(temp_data);                  }  			}              else diff --git a/indra/llappearance/lltexlayerparams.cpp b/indra/llappearance/lltexlayerparams.cpp index ce5c7142d5..06b4f6c75a 100644 --- a/indra/llappearance/lltexlayerparams.cpp +++ b/indra/llappearance/lltexlayerparams.cpp @@ -151,7 +151,7 @@ LLTexLayerParamAlpha::LLTexLayerParamAlpha(const LLTexLayerParamAlpha& pOther)  	mCachedProcessedTexture(pOther.mCachedProcessedTexture),  	mStaticImageTGA(pOther.mStaticImageTGA),  	mStaticImageRaw(pOther.mStaticImageRaw), -	mNeedsCreateTexture(pOther.mNeedsCreateTexture), +	mNeedsCreateTexture(pOther.mNeedsCreateTexture.load()),  	mStaticImageInvalid(pOther.mStaticImageInvalid),  	mAvgDistortionVec(pOther.mAvgDistortionVec),  	mCachedEffectiveWeight(pOther.mCachedEffectiveWeight) diff --git a/indra/llappearance/lltexlayerparams.h b/indra/llappearance/lltexlayerparams.h index e2440998b3..000f55685e 100644 --- a/indra/llappearance/lltexlayerparams.h +++ b/indra/llappearance/lltexlayerparams.h @@ -100,7 +100,7 @@ private:  	LLPointer<LLGLTexture>	mCachedProcessedTexture;  	LLPointer<LLImageTGA>	mStaticImageTGA;  	LLPointer<LLImageRaw>	mStaticImageRaw; -	BOOL					mNeedsCreateTexture; +	std::atomic<BOOL>		mNeedsCreateTexture;  	BOOL					mStaticImageInvalid;  	LL_ALIGN_16(LLVector4a				mAvgDistortionVec);  	F32						mCachedEffectiveWeight; | 
