From f190644464a4503240e6faba7cf6acd67c8ae379 Mon Sep 17 00:00:00 2001 From: Shyotl Date: Sat, 23 Apr 2011 00:59:20 -0500 Subject: [PATCH] LLDrawPoolWater::shade no longer binds diffuse texture if nonexistant or unused by shader. (was firing a warning upon bind) --- indra/newview/lldrawpoolwater.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/indra/newview/lldrawpoolwater.cpp b/indra/newview/lldrawpoolwater.cpp index 4b9f55946..d4e417284 100644 --- a/indra/newview/lldrawpoolwater.cpp +++ b/indra/newview/lldrawpoolwater.cpp @@ -552,7 +552,8 @@ void LLDrawPoolWater::shade() } LLVOWater* water = (LLVOWater*) face->getViewerObject(); - gGL.getTexUnit(diffTex)->bind(face->getTexture()); + if(diffTex > -1 && face->getTexture()->getHasGLTexture()) + gGL.getTexUnit(diffTex)->bind(face->getTexture()); sNeedsReflectionUpdate = TRUE; @@ -570,6 +571,8 @@ void LLDrawPoolWater::shade() LLGLSquashToFarClip far_clip(glh_get_current_projection()); face->renderIndexed(); } + if(diffTex > -1 && face->getTexture()->getHasGLTexture()) + gGL.getTexUnit(diffTex)->unbind(LLTexUnit::TT_TEXTURE); } }