Browse Source

draw: trim incoming primitives

tags/mesa_20090313
Keith Whitwell 17 years ago
parent
commit
1529a2c983
1 changed files with 15 additions and 0 deletions
  1. 15
    0
      src/gallium/auxiliary/draw/draw_pt.c

+ 15
- 0
src/gallium/auxiliary/draw/draw_pt.c View File

@@ -35,6 +35,10 @@
#include "draw/draw_private.h"
#include "draw/draw_pt.h"

static unsigned trim( unsigned count, unsigned first, unsigned incr )
{
return count - (count - first) % incr;
}



@@ -54,6 +58,17 @@ draw_pt_arrays(struct draw_context *draw,
struct draw_pt_middle_end *middle = NULL;
unsigned opt = 0;

/* Sanitize primitive length:
*/
{
unsigned first, incr;
draw_pt_split_prim(prim, &first, &incr);
count = trim(count, first, incr);
if (count < first)
return TRUE;
}


if (!draw->render) {
opt |= PT_PIPELINE;
}

Loading…
Cancel
Save