summaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/softpipe
diff options
context:
space:
mode:
authorBrian Paul <[email protected]>2009-05-30 20:10:04 -0600
committerBrian Paul <[email protected]>2009-05-30 20:10:04 -0600
commitbedf7fa49f549541fde2e19d2fbb6b8fe57ec124 (patch)
treea9ce42f47045661cae3e440bda28a459447be7bb /src/gallium/drivers/softpipe
parent6c3cefdda6c98d5f0df874c7f1d8c5421cc8468b (diff)
parenta59575d8fbe8b0ca053cc8366ce7a42bc660158a (diff)
Merge branch 'mesa_7_5_branch'
Diffstat (limited to 'src/gallium/drivers/softpipe')
-rw-r--r--src/gallium/drivers/softpipe/sp_prim_vbuf.c16
1 files changed, 15 insertions, 1 deletions
diff --git a/src/gallium/drivers/softpipe/sp_prim_vbuf.c b/src/gallium/drivers/softpipe/sp_prim_vbuf.c
index eef6e5806c9..329c92b8da1 100644
--- a/src/gallium/drivers/softpipe/sp_prim_vbuf.c
+++ b/src/gallium/drivers/softpipe/sp_prim_vbuf.c
@@ -378,7 +378,6 @@ sp_vbuf_draw_arrays(struct vbuf_render *vbr, uint start, uint nr)
break;
case PIPE_PRIM_TRIANGLE_FAN:
- case PIPE_PRIM_POLYGON:
for (i = 2; i < nr; i += 1) {
setup_tri( setup_ctx,
get_vert(vertex_buffer, 0, stride),
@@ -386,6 +385,7 @@ sp_vbuf_draw_arrays(struct vbuf_render *vbr, uint start, uint nr)
get_vert(vertex_buffer, i-0, stride));
}
break;
+
case PIPE_PRIM_QUADS:
for (i = 3; i < nr; i += 4) {
setup_tri( setup_ctx,
@@ -412,6 +412,20 @@ sp_vbuf_draw_arrays(struct vbuf_render *vbr, uint start, uint nr)
get_vert(vertex_buffer, i-0, stride));
}
break;
+
+ case PIPE_PRIM_POLYGON:
+ /* Almost same as tri fan but the _first_ vertex specifies the flat
+ * shading color. Note that the first polygon vertex is passed as
+ * the last triangle vertex here.
+ */
+ for (i = 2; i < nr; i += 1) {
+ setup_tri( setup_ctx,
+ get_vert(vertex_buffer, i-0, stride),
+ get_vert(vertex_buffer, i-1, stride),
+ get_vert(vertex_buffer, 0, stride));
+ }
+ break;
+
default:
assert(0);
}