diff options
author | Zack Rusin <[email protected]> | 2008-04-11 19:58:22 -0400 |
---|---|---|
committer | Keith Whitwell <[email protected]> | 2008-04-14 11:00:35 +0100 |
commit | 808f968f3ad0cb32e86f517753d5715d00e9ec2c (patch) | |
tree | a75a2d4f267b8d36e668e8fd02de534ffa6e8ad6 /src/gallium/auxiliary/draw/draw_vs_llvm.c | |
parent | aadbb1d7fbbaada6e378cb60194e5861cadf98d1 (diff) |
return true if one of the vertices has been clipped
Diffstat (limited to 'src/gallium/auxiliary/draw/draw_vs_llvm.c')
-rw-r--r-- | src/gallium/auxiliary/draw/draw_vs_llvm.c | 18 |
1 files changed, 11 insertions, 7 deletions
diff --git a/src/gallium/auxiliary/draw/draw_vs_llvm.c b/src/gallium/auxiliary/draw/draw_vs_llvm.c index 7e48428cdda..6db1e65a2da 100644 --- a/src/gallium/auxiliary/draw/draw_vs_llvm.c +++ b/src/gallium/auxiliary/draw/draw_vs_llvm.c @@ -67,18 +67,19 @@ vs_llvm_prepare( struct draw_vertex_shader *base, * \param count number of vertices to shade [1..4] * \param vOut array of pointers to four output vertices */ -static void +static boolean vs_llvm_run( struct draw_vertex_shader *base, - struct draw_context *draw, - const unsigned *elts, + struct draw_context *draw, + const unsigned *elts, unsigned count, struct vertex_header *vOut[] ) { - struct draw_llvm_vertex_shader *shader = + struct draw_llvm_vertex_shader *shader = (struct draw_llvm_vertex_shader *)base; struct tgsi_exec_machine *machine = &draw->machine; unsigned int j; + unsigned int clipped = 0; ALIGN16_DECL(struct tgsi_exec_vector, inputs, PIPE_MAX_ATTRIBS); ALIGN16_DECL(struct tgsi_exec_vector, outputs, PIPE_MAX_ATTRIBS); @@ -125,19 +126,21 @@ vs_llvm_run( struct draw_vertex_shader *base, w = vOut[j]->clip[3] = machine->Outputs[0].xyzw[3].f[j]; if (!draw->rasterizer->bypass_clipping) { - vOut[j]->clipmask = compute_clipmask(vOut[j]->clip, draw->plane, draw->nr_planes); + vOut[j]->clipmask = compute_clipmask(vOut[j]->clip, draw->plane, + draw->nr_planes); + clipped += vOut[j]->clipmask; /* divide by w */ w = 1.0f / w; x *= w; y *= w; - z *= w; + z *= w; } else { vOut[j]->clipmask = 0; } vOut[j]->edgeflag = 1; - + if (!draw->identity_viewport) { /* Viewport mapping */ vOut[j]->data[0][0] = x * scale[0] + trans[0]; @@ -162,6 +165,7 @@ vs_llvm_run( struct draw_vertex_shader *base, vOut[j]->data[slot][3] = machine->Outputs[slot].xyzw[3].f[j]; } } /* loop over vertices */ + return clipped != 0; } static void |