check hardware type and use SETUP_SNAP if needed
authorBrian Paul <brian.paul@tungstengraphics.com>
Thu, 10 May 2001 02:59:04 +0000 (02:59 +0000)
committerBrian Paul <brian.paul@tungstengraphics.com>
Thu, 10 May 2001 02:59:04 +0000 (02:59 +0000)
src/mesa/drivers/glide/fxapi.c
src/mesa/drivers/glide/fxdrv.h
src/mesa/drivers/glide/fxvb.c

index 72f2a45..4150652 100644 (file)
@@ -400,9 +400,13 @@ fxMesaCreateContext(GLuint win,
    }
 
    /*
-    * Pixel tables are use during pixel read-back
+    * Pixel tables are used during pixel read-back
     * Either initialize them for RGB or BGR order.
+    * Also determine if we need vertex snapping.
     */
+
+   fxMesa->snapVertices = GL_TRUE; /* play it safe */
+
 #ifdef FXMESA_USE_ARGB
    useBGR = GL_FALSE;          /* Force RGB pixel order */
    system = "FXMESA_USE_ARGB";
@@ -432,6 +436,7 @@ fxMesaCreateContext(GLuint win,
         /* Voodoo 2 */
         useBGR = GL_TRUE;
         system = "Voodoo2";
+         fxMesa->snapVertices = GL_FALSE;
       }
       else if (voodoo->nTexelfx == 2 &&
               voodoo->fbiRev == 2 &&
@@ -457,22 +462,27 @@ fxMesaCreateContext(GLuint win,
         /* Presumed Voodoo3 */
         useBGR = GL_FALSE;
         system = "Voodoo3";
+         fxMesa->snapVertices = GL_FALSE;
       }
-      if (getenv("MESA_FX_INFO")) {
-        printf
-           ("Voodoo: Texelfx: %d / FBI Rev.: %d / TMU Rev.: %d / TMU RAM: %d\n",
-            voodoo->nTexelfx, voodoo->fbiRev, voodoo->tmuConfig[0].tmuRev,
-            voodoo->tmuConfig[0].tmuRam);
+      if (verbose) {
+        fprintf(stderr,
+           "Voodoo: Texelfx: %d / FBI Rev.: %d / TMU Rev.: %d / TMU RAM: %d\n",
+                 voodoo->nTexelfx, voodoo->fbiRev, voodoo->tmuConfig[0].tmuRev,
+                 voodoo->tmuConfig[0].tmuRam);
       }
    }
    else {
       useBGR = GL_FALSE;       /* use RGB pixel order otherwise */
       system = "non-voodoo";
+      fxMesa->snapVertices = GL_FALSE;
    }
 #endif /*FXMESA_USE_ARGB */
 
-   if (getenv("MESA_FX_INFO"))
-      printf("Voodoo pixel order: %s (%s)\n", useBGR ? "BGR" : "RGB", system);
+   if (verbose) {
+      fprintf(stderr, "Voodoo pixel order: %s (%s)\n",
+              useBGR ? "BGR" : "RGB", system);
+      fprintf(stderr, "Vertex snapping: %d\n", fxMesa->snapVertices);
+   }
 
    fxInitPixelTables(fxMesa, useBGR);
 
index 0a9944e..0d4c7a4 100644 (file)
@@ -439,7 +439,7 @@ struct tfxMesaContext
    GLuint setup_gone;          /* for multipass */
    GLuint stw_hint_state;      /* for grHints */
    fxVertex *verts;
-
+   GLboolean snapVertices;      /* needed for older Voodoo hardware */
 
    /* Rasterization:
     */
index 90fe9f2..e38d3c3 100644 (file)
@@ -298,10 +298,8 @@ fx_validate_BuildProjVerts(GLcontext * ctx, GLuint start, GLuint count,
    else {
       GLuint setupindex = SETUP_XYZW;
 
-#if 0
-      if (is_voodoo_graphics)
-        setupindex |= SETUP_SNAP;
-#endif
+      if (fxMesa->snapVertices)
+         setupindex |= SETUP_SNAP;
 
       fxMesa->tmu_source[0] = 0;
       fxMesa->tmu_source[1] = 1;