Merge remote branch 'origin/gallium-0.2' into gallium-0.2
[mesa.git] / src / mesa / drivers / dri / sis / sis_fog.c
index da36b3d795fe0283f87ffdf911298e15b9747a38..517d5722e6a86285bd70d7736c4b3ec7af1a42de 100644 (file)
@@ -24,7 +24,6 @@ OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
 USE OR OTHER DEALINGS IN THE SOFTWARE.
 
 **************************************************************************/
-/* $XFree86: xc/lib/GL/mesa/src/drv/sis/sis_fog.c,v 1.3 2000/09/26 15:56:48 tsi Exp $ */
 
 /*
  * Authors:
@@ -36,7 +35,7 @@ USE OR OTHER DEALINGS IN THE SOFTWARE.
 #include "sis_state.h"
 #include "swrast/swrast.h"
 
-#include "macros.h"
+#include "main/macros.h"
 
 static GLint convertFtToFogFt( GLfloat dwInValue );
 static GLint doFPtoFixedNoRound( GLfloat dwInValue, int nFraction );
@@ -53,6 +52,22 @@ sisDDFogfv( GLcontext *ctx, GLenum pname, const GLfloat *params )
 
    switch (pname)
    {
+   case GL_FOG_COORDINATE_SOURCE_EXT:
+      current->hwFog &= ~MASK_FogMode;
+      switch (ctx->Fog.FogCoordinateSource)
+      {
+      case GL_FOG_COORDINATE_EXT:
+         current->hwFog &= ~MASK_FogZLookup;
+         break;
+      case GL_FRAGMENT_DEPTH_EXT:
+         current->hwFog |= MASK_FogZLookup;
+         break;
+      }
+      if (current->hwFog != prev->hwFog) {
+         prev->hwFog = current->hwFog;
+         smesa->GlobalFlag |= GFLAG_FOGSETTING;
+      }
+      break;
    case GL_FOG_MODE:
       current->hwFog &= ~MASK_FogMode;
       switch (ctx->Fog.Mode)