diff options
author | Keith Whitwell <keith@tungstengraphics.com> | 2003-04-27 14:42:55 +0000 |
---|---|---|
committer | Keith Whitwell <keith@tungstengraphics.com> | 2003-04-27 14:42:55 +0000 |
commit | ec0c259d0dd9b4103afaceb8a0a37abcea63a9ca (patch) | |
tree | 498c009493261d4917e1572b70f46d9cc5c8db69 | |
parent | 24a598b5affb8be8e04fc539c59f305677f53705 (diff) |
Fix vertex copying calcs for tris, quads
-rw-r--r-- | src/mesa/drivers/dri/radeon/radeon_subset_vtx.c | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/src/mesa/drivers/dri/radeon/radeon_subset_vtx.c b/src/mesa/drivers/dri/radeon/radeon_subset_vtx.c index abc984bc0f..1caaaec203 100644 --- a/src/mesa/drivers/dri/radeon/radeon_subset_vtx.c +++ b/src/mesa/drivers/dri/radeon/radeon_subset_vtx.c @@ -248,14 +248,18 @@ static GLuint copy_dma_verts( radeonContextPtr rmesa, return 2; } case GL_TRIANGLES: + ovf = nr % 3; + for (i = 0 ; i < ovf ; i++) + copy_vertex( rmesa, nr-ovf+i, tmp[i] ); + return i; + case GL_QUADS: + ovf = nr % 4; + for (i = 0 ; i < ovf ; i++) + copy_vertex( rmesa, nr-ovf+i, tmp[i] ); + return i; case GL_TRIANGLE_STRIP: case GL_QUAD_STRIP: - case GL_QUADS: - switch (nr) { - case 0: ovf = 0; break; - case 1: ovf = 1; break; - default: ovf = 2; break; - } + ovf = MIN2(nr, 2); for (i = 0 ; i < ovf ; i++) copy_vertex( rmesa, nr-ovf+i, tmp[i] ); return i; |