draw: dont' compute clipmask or apply viewport when not clipping (rename bypass_clipp...
authorKeith Whitwell <keith@tungstengraphics.com>
Tue, 4 Mar 2008 16:55:02 +0000 (17:55 +0100)
committerKeith Whitwell <keith@tungstengraphics.com>
Tue, 4 Mar 2008 17:51:50 +0000 (18:51 +0100)
src/gallium/auxiliary/draw/draw_vs_exec.c

index 583812aadd2a90311119e1c165271b9242c3feb0..514303e0eac5a751bc8bec721e9cf4281d0e1ec7 100644 (file)
@@ -132,20 +132,30 @@ vs_exec_run( struct draw_vertex_shader *shader,
       z = vOut[j]->clip[2] = machine->Outputs[0].xyzw[2].f[j];
       w = vOut[j]->clip[3] = machine->Outputs[0].xyzw[3].f[j];
 
-      vOut[j]->clipmask = compute_clipmask(vOut[j]->clip, draw->plane, draw->nr_planes);
-      vOut[j]->edgeflag = 1;
-
-      /* divide by w */
-      w = 1.0f / w;
-      x *= w;
-      y *= w;
-      z *= w;
-
-      /* Viewport mapping */
-      vOut[j]->data[0][0] = x * scale[0] + trans[0];
-      vOut[j]->data[0][1] = y * scale[1] + trans[1];
-      vOut[j]->data[0][2] = z * scale[2] + trans[2];
-      vOut[j]->data[0][3] = w;
+      if (!draw->rasterizer->bypass_clipping) {
+         vOut[j]->clipmask = compute_clipmask(vOut[j]->clip, draw->plane, draw->nr_planes);
+         vOut[j]->edgeflag = 1;
+
+         /* divide by w */
+         w = 1.0f / w;
+         x *= w;
+         y *= w;
+         z *= w;
+         
+         /* Viewport mapping */
+         vOut[j]->data[0][0] = x * scale[0] + trans[0];
+         vOut[j]->data[0][1] = y * scale[1] + trans[1];
+         vOut[j]->data[0][2] = z * scale[2] + trans[2];
+         vOut[j]->data[0][3] = w;
+      }
+      else {
+         vOut[j]->clipmask = 0;
+         vOut[j]->edgeflag = 1;
+         vOut[j]->data[0][0] = x;
+         vOut[j]->data[0][1] = y;
+         vOut[j]->data[0][2] = z;
+         vOut[j]->data[0][3] = w;
+      }
 
       /* Remaining attributes are packed into sequential post-transform
        * vertex attrib slots.