added div by zero check for Fog.End/Start (from gallium-0.1)

This commit is contained in:
Brian Paul 2008-05-18 15:41:36 -06:00
parent 4b6b0fd526
commit 5976a6a75c

View file

@ -253,7 +253,8 @@ _mesa_fetch_state(GLcontext *ctx, const gl_state_index state[],
value[0] = ctx->Fog.Density;
value[1] = ctx->Fog.Start;
value[2] = ctx->Fog.End;
value[3] = 1.0F / (ctx->Fog.End - ctx->Fog.Start);
value[3] = (ctx->Fog.End == ctx->Fog.Start)
? 1.0 : 1.0F / (ctx->Fog.End - ctx->Fog.Start);
return;
case STATE_CLIPPLANE:
{