diff options
author | Howard (Aech Linden) Stearns <howard.stearns@gmail.com> | 2022-09-19 12:16:49 -0700 |
---|---|---|
committer | Howard (Aech Linden) Stearns <howard.stearns@gmail.com> | 2022-09-19 12:16:49 -0700 |
commit | 718073717c70b1f7e7284a02641c0a0a7bf50367 (patch) | |
tree | 45481ad9514c5ea91d8357615909e0c4fc73bd4d /indra/llappearance | |
parent | 4f7c86a145877bdaae3e74900076b6790b7abc0e (diff) |
SL-18128, SL-18128 - No glerror on Mac!
Diffstat (limited to 'indra/llappearance')
-rw-r--r-- | indra/llappearance/lltexlayer.cpp | 9 |
1 files changed, 8 insertions, 1 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 |