draw: associate rhw divide with clipping not viewport flag
authorKeith Whitwell <keith@tungstengraphics.com>
Tue, 1 Apr 2008 13:14:46 +0000 (14:14 +0100)
committerKeith Whitwell <keith@tungstengraphics.com>
Tue, 1 Apr 2008 13:51:24 +0000 (14:51 +0100)
src/gallium/auxiliary/draw/draw_vs_exec.c
src/gallium/auxiliary/draw/draw_vs_llvm.c
src/gallium/auxiliary/draw/draw_vs_sse.c

index c8ed17c00a2069bfe799b824c4c120878e8aae0c..c6e503686a6d7cd662e680d61d6390c5d13d100a 100644 (file)
@@ -143,6 +143,12 @@ vs_exec_run( struct draw_vertex_shader *shader,
 
       if (!draw->rasterizer->bypass_clipping) {
          vOut[j]->clipmask = compute_clipmask(vOut[j]->clip, draw->plane, draw->nr_planes);
+
+         /* divide by w */
+         w = 1.0f / w;
+         x *= w;
+         y *= w;
+         z *= w;         
       }
       else {
          vOut[j]->clipmask = 0;
@@ -150,12 +156,6 @@ vs_exec_run( struct draw_vertex_shader *shader,
       vOut[j]->edgeflag = 1;
 
       if (!draw->identity_viewport) {
-         /* 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];
index 8aa8a617bbbe48db538a2a04fc993a7a2cec5e38..c8268317efa57caa34b4a52710f7f84801aec916 100644 (file)
@@ -153,6 +153,12 @@ vs_llvm_run( struct draw_vertex_shader *base,
 
       if (!draw->rasterizer->bypass_clipping) {
          vOut[j]->clipmask = compute_clipmask(vOut[j]->clip, draw->plane, draw->nr_planes);
+
+         /* divide by w */
+         w = 1.0f / w;
+         x *= w;
+         y *= w;
+         z *= w;         
       }
       else {
          vOut[j]->clipmask = 0;
@@ -160,12 +166,6 @@ vs_llvm_run( struct draw_vertex_shader *base,
       vOut[j]->edgeflag = 1;
          
       if (!draw->identity_viewport) {
-         /* 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];
index 701137f90873117a641d27193bf718909e03a5f5..f40d65df08fd239e73e790cf74c485c28d625aa0 100644 (file)
@@ -168,6 +168,12 @@ vs_sse_run( struct draw_vertex_shader *base,
 
       if (!draw->rasterizer->bypass_clipping) {
          vOut[j]->clipmask = compute_clipmask(vOut[j]->clip, draw->plane, draw->nr_planes);
+
+         /* divide by w */
+         w = 1.0f / w;
+         x *= w;
+         y *= w;
+         z *= w;
       }
       else {
          vOut[j]->clipmask = 0;
@@ -175,12 +181,6 @@ vs_sse_run( struct draw_vertex_shader *base,
       vOut[j]->edgeflag = 1;
 
       if (!draw->identity_viewport) {
-         /* 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];