draw: implement triangle strips with adjacency in geometry shader
authorZack Rusin <zackr@vmware.com>
Thu, 17 Jun 2010 17:21:38 +0000 (13:21 -0400)
committerZack Rusin <zackr@vmware.com>
Thu, 17 Jun 2010 17:21:38 +0000 (13:21 -0400)
src/gallium/auxiliary/draw/draw_gs_tmp.h

index ff83cebb45ad65d956c389c1bfd9ce60238f0fa7..7a8683cf7c2a39b988af1b67d7ee1c30ca173b33 100644 (file)
@@ -9,7 +9,7 @@ static void FUNC( struct draw_geometry_shader *shader,
 
    boolean flatfirst = (draw->rasterizer->flatshade &&
                         draw->rasterizer->flatshade_first);
-   unsigned i;
+   unsigned i, j;
    unsigned count = input_prims->count;
    LOCAL_VARS
 
@@ -124,6 +124,17 @@ static void FUNC( struct draw_geometry_shader *shader,
                   i + 3, i + 4, i + 5);
       }
       break;
+   case PIPE_PRIM_TRIANGLE_STRIP_ADJACENCY:
+      for (i = 0, j = 0; i+5 < count; i += 2, ++j) {
+         TRI_ADJ( shader,
+                  i + 0,
+                  i + 1 + 2*(j&1),
+                  i + 2 + 2*(j&1),
+                  i + 3 - 2*(j&1),
+                  i + 4 - 2*(j&1),
+                  i + 5);
+      }
+      break;
 
    default:
       debug_assert(!"Unsupported primitive in geometry shader");