OSDN Git Service

fixed constant fogcoord bug (#4729)
authorBrian Paul <brian.paul@tungstengraphics.com>
Mon, 10 Oct 2005 18:39:34 +0000 (18:39 +0000)
committerBrian Paul <brian.paul@tungstengraphics.com>
Mon, 10 Oct 2005 18:39:34 +0000 (18:39 +0000)
src/mesa/tnl/t_vb_fog.c

index ddf849a..f1d01bc 100644 (file)
@@ -1,8 +1,8 @@
 /*
  * Mesa 3-D graphics library
- * Version:  6.1
+ * Version:  6.5
  *
- * Copyright (C) 1999-2004  Brian Paul   All Rights Reserved.
+ * Copyright (C) 1999-2005  Brian Paul   All Rights Reserved.
  *
  * Permission is hereby granted, free of charge, to any person obtaining a
  * copy of this software and associated documentation files (the "Software"),
@@ -197,6 +197,12 @@ run_fog_stage(GLcontext *ctx, struct tnl_pipeline_stage *stage)
    else {
       /* use glFogCoord() coordinates */
       input = VB->FogCoordPtr;  /* source data */
+
+      /* input->count may be one if glFogCoord was only called once
+       * before glBegin.  But we need to compute fog for all vertices.
+       */
+      input->count = VB->ObjPtr->count;
+
       VB->FogCoordPtr = &store->fogcoord;  /* dest data */
    }