SH-2244 Fix for crash when transparent water disabled (silently ignore setting when basic shaders enabled)

master
Dave Parks 2011-09-24 23:29:38 -05:00
parent c70026499a
commit f49e7014ca
3 changed files with 10 additions and 5 deletions

View File

@ -534,7 +534,7 @@ void gl_draw_scaled_image_with_border(S32 x, S32 y, S32 width, S32 height, LLTex
}
}
gGL.getTexUnit(0)->bind(image);
gGL.getTexUnit(0)->bind(image, true);
gGL.color4fv(color.mV);
@ -732,7 +732,7 @@ void gl_draw_scaled_rotated_image(S32 x, S32 y, S32 width, S32 height, F32 degre
LLGLSUIDefault gls_ui;
gGL.getTexUnit(0)->bind(image);
gGL.getTexUnit(0)->bind(image, true);
gGL.color4fv(color.mV);
@ -785,7 +785,7 @@ void gl_draw_scaled_rotated_image(S32 x, S32 y, S32 width, S32 height, F32 degre
LLMatrix3 quat(0.f, 0.f, degrees*DEG_TO_RAD);
gGL.getTexUnit(0)->bind(image);
gGL.getTexUnit(0)->bind(image, true);
gGL.color4fv(color.mV);

View File

@ -167,7 +167,7 @@ void LLDrawPoolWater::render(S32 pass)
std::sort(mDrawFace.begin(), mDrawFace.end(), LLFace::CompareDistanceGreater());
// See if we are rendering water as opaque or not
if (!gSavedSettings.getBOOL("RenderTransparentWater"))
if (!gSavedSettings.getBOOL("RenderTransparentWater") && !LLGLSLShader::sNoFixedFunction)
{
// render water for low end hardware
renderOpaqueLegacyWater();
@ -332,6 +332,11 @@ void LLDrawPoolWater::renderOpaqueLegacyWater()
{
LLVOSky *voskyp = gSky.mVOSkyp;
if (LLGLSLShader::sNoFixedFunction)
{
gObjectSimpleProgram.bind();
}
stop_glerror();
// Depth sorting and write to depth buffer

View File

@ -160,7 +160,7 @@ BOOL LLVOWater::updateGeometry(LLDrawable *drawable)
static const unsigned int vertices_per_quad = 4;
static const unsigned int indices_per_quad = 6;
const S32 size = gSavedSettings.getBOOL("RenderTransparentWater") ? 16 : 1;
const S32 size = gSavedSettings.getBOOL("RenderTransparentWater") && !LLGLSLShader::sNoFixedFunction ? 16 : 1;
const S32 num_quads = size * size;
face->setSize(vertices_per_quad * num_quads,