From 90f9078d1f931774b5a6e866e26f4e0294f1e2d1 Mon Sep 17 00:00:00 2001 From: Graham Linden Date: Thu, 7 Feb 2019 16:00:21 -0800 Subject: SL-10486, SL-10501, SL-10487 Make moon texture from default daycycle the default moon texture id and use it for the default and blank assets in the picker. Fix handling of MM_TEXTURE to correctly detect when texture units outside the range 0-3 are used with texture matrix ops to prevent mem overwrite bug and/or asserts. --- indra/llrender/llrender.cpp | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'indra/llrender') diff --git a/indra/llrender/llrender.cpp b/indra/llrender/llrender.cpp index 173444f708..de04ea601a 100644 --- a/indra/llrender/llrender.cpp +++ b/indra/llrender/llrender.cpp @@ -1477,6 +1477,13 @@ void LLRender::matrixMode(U32 mode) { if (mode == MM_TEXTURE) { + U32 tex_index = gGL.getCurrentTexUnitIndex(); + // the shaders don't actually reference anything beyond texture_matrix0/1 + if (tex_index > 3) + { + LL_WARNS_ONCE("render") << "Cannot use texture matrix with texture unit " << tex_index << " forcing texture matrix 3!" << LL_ENDL; + tex_index = 3; + } mode = MM_TEXTURE0 + gGL.getCurrentTexUnitIndex(); } -- cgit v1.2.3