From e7830b39f01d9f9c82e9e2029634dffb8386b24e Mon Sep 17 00:00:00 2001 From: Dave Parks Date: Fri, 3 Dec 2021 15:07:31 +0000 Subject: SL-16436 and SL-16327 Fix for RenderDebugGL test failures and fix for grey textures --- indra/newview/pipeline.cpp | 28 +++++++++++++++++----------- 1 file changed, 17 insertions(+), 11 deletions(-) (limited to 'indra/newview/pipeline.cpp') diff --git a/indra/newview/pipeline.cpp b/indra/newview/pipeline.cpp index c122b4f43e..df676b30fc 100644 --- a/indra/newview/pipeline.cpp +++ b/indra/newview/pipeline.cpp @@ -3711,25 +3711,31 @@ void renderSoundHighlights(LLDrawable* drawablep) } } -void LLPipeline::touchTextures(LLDrawInfo* info) +void LLPipeline::touchTexture(LLViewerTexture* tex, F32 vsize) { - LL_PROFILE_ZONE_SCOPED; - for (auto& tex : info->mTextureList) + if (tex) { - if (tex.notNull()) + LLImageGL* gl_tex = tex->getGLTexture(); + if (gl_tex && gl_tex->updateBindStats(gl_tex->mTextureMemory)) { - LLImageGL* gl_tex = tex->getGLTexture(); - if (gl_tex && gl_tex->updateBindStats(gl_tex->mTextureMemory)) - { - tex->setActive(); - } + tex->setActive(); + tex->addTextureStats(vsize); } } - if (info->mTexture.notNull()) + +} +void LLPipeline::touchTextures(LLDrawInfo* info) +{ + LL_PROFILE_ZONE_SCOPED; + for (int i = 0; i < info->mTextureList.size(); ++i) { - info->mTexture->addTextureStats(info->mVSize); + touchTexture(info->mTextureList[i], info->mTextureListVSize[i]); } + + touchTexture(info->mTexture, info->mVSize); + touchTexture(info->mSpecularMap, info->mVSize); + touchTexture(info->mNormalMap, info->mVSize); } void LLPipeline::postSort(LLCamera& camera) -- cgit v1.2.3