summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKeith Whitwell <keith@tungstengraphics.com>2008-03-04 17:55:02 +0100
committerKeith Whitwell <keith@tungstengraphics.com>2008-03-04 18:51:50 +0100
commit19cc2e363185b50d19e4f257dd3558896b9b49d3 (patch)
tree347f43c9158f924ee45d851fd9e4f8fae8e1f5d4
parente2a91c294edb198d6ebedd30fb4a39d722c8ee9f (diff)
draw: dont' compute clipmask or apply viewport when not clipping (rename bypass_clipping to coords_in_window_space?
-rw-r--r--src/gallium/auxiliary/draw/draw_vs_exec.c38
1 files changed, 24 insertions, 14 deletions
diff --git a/src/gallium/auxiliary/draw/draw_vs_exec.c b/src/gallium/auxiliary/draw/draw_vs_exec.c
index 583812aadd..514303e0ea 100644
--- a/src/gallium/auxiliary/draw/draw_vs_exec.c
+++ b/src/gallium/auxiliary/draw/draw_vs_exec.c
@@ -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.