diff options
author | Zack Rusin <zackr@vmware.com> | 2010-06-17 12:05:15 -0400 |
---|---|---|
committer | Zack Rusin <zackr@vmware.com> | 2010-06-17 12:05:15 -0400 |
commit | f542a2770a5ac3eb487cd3723cf98a383779a98d (patch) | |
tree | cb3d5eaa692bb5ba4dc004a224a379a98d1dbdb8 /src/gallium/auxiliary/draw/draw_gs.c | |
parent | 06b854752f8a550ddd299610e0e22c8f929109e2 (diff) |
draw: implement triangle lists with adjacency support in gs
Diffstat (limited to 'src/gallium/auxiliary/draw/draw_gs.c')
-rw-r--r-- | src/gallium/auxiliary/draw/draw_gs.c | 24 |
1 files changed, 23 insertions, 1 deletions
diff --git a/src/gallium/auxiliary/draw/draw_gs.c b/src/gallium/auxiliary/draw/draw_gs.c index 79b0a729bc..881d8fc93b 100644 --- a/src/gallium/auxiliary/draw/draw_gs.c +++ b/src/gallium/auxiliary/draw/draw_gs.c @@ -336,7 +336,6 @@ static void gs_line_adj(struct draw_geometry_shader *shader, gs_flush(shader, 1); } - static void gs_tri(struct draw_geometry_shader *shader, int i0, int i1, int i2) { @@ -352,7 +351,27 @@ static void gs_tri(struct draw_geometry_shader *shader, gs_flush(shader, 1); } +static void gs_tri_adj(struct draw_geometry_shader *shader, + int i0, int i1, int i2, + int i3, int i4, int i5) +{ + unsigned indices[6]; + + indices[0] = i0; + indices[1] = i1; + indices[2] = i2; + indices[3] = i3; + indices[4] = i4; + indices[5] = i5; + + draw_fetch_gs_input(shader, indices, 6, 0); + ++shader->in_prim_idx; + + gs_flush(shader, 1); +} + #define TRIANGLE(gs,i0,i1,i2) gs_tri(gs,i0,i1,i2) +#define TRI_ADJ(gs,i0,i1,i2,i3,i4,i5) gs_tri_adj(gs,i0,i1,i2,i3,i4,i5) #define LINE(gs,i0,i1) gs_line(gs,i0,i1) #define LINE_ADJ(gs,i0,i1,i2,i3) gs_line_adj(gs,i0,i1,i2,i3) #define POINT(gs,i0) gs_point(gs,i0) @@ -362,6 +381,9 @@ static void gs_tri(struct draw_geometry_shader *shader, #define TRIANGLE(gs,i0,i1,i2) gs_tri(gs,elts[i0],elts[i1],elts[i2]) +#define TRI_ADJ(gs,i0,i1,i2,i3,i4,i5) \ + gs_tri_adj(gs,elts[i0],elts[i1],elts[i2],elts[i3], \ + elts[i4],elts[i5]) #define LINE(gs,i0,i1) gs_line(gs,elts[i0],elts[i1]) #define LINE_ADJ(gs,i0,i1,i2,i3) gs_line_adj(gs,elts[i0], \ elts[i1], \ |