LLDrawPoolWater::shade no longer binds diffuse texture if nonexistant or unused by shader. (was firing a warning upon bind)

This commit is contained in:
Shyotl
2011-04-23 00:59:20 -05:00
parent 0b1b7c6618
commit f190644464

View File

@@ -552,7 +552,8 @@ void LLDrawPoolWater::shade()
} }
LLVOWater* water = (LLVOWater*) face->getViewerObject(); 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; sNeedsReflectionUpdate = TRUE;
@@ -570,6 +571,8 @@ void LLDrawPoolWater::shade()
LLGLSquashToFarClip far_clip(glh_get_current_projection()); LLGLSquashToFarClip far_clip(glh_get_current_projection());
face->renderIndexed(); face->renderIndexed();
} }
if(diffTex > -1 && face->getTexture()->getHasGLTexture())
gGL.getTexUnit(diffTex)->unbind(LLTexUnit::TT_TEXTURE);
} }
} }