Mesa (master): draw: implement triangle strips with adjacency in geometry shader

Zack Rusin zack at kemper.freedesktop.org
Thu Jun 17 10:22:11 PDT 2010


Module: Mesa
Branch: master
Commit: 4320a451a313bbf4e145809ffb11c829ae84aa98
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=4320a451a313bbf4e145809ffb11c829ae84aa98

Author: Zack Rusin <zackr at vmware.com>
Date:   Thu Jun 17 13:21:38 2010 -0400

draw: implement triangle strips with adjacency in geometry shader

---

 src/gallium/auxiliary/draw/draw_gs_tmp.h |   13 ++++++++++++-
 1 files changed, 12 insertions(+), 1 deletions(-)

diff --git a/src/gallium/auxiliary/draw/draw_gs_tmp.h b/src/gallium/auxiliary/draw/draw_gs_tmp.h
index ff83ceb..7a8683c 100644
--- a/src/gallium/auxiliary/draw/draw_gs_tmp.h
+++ b/src/gallium/auxiliary/draw/draw_gs_tmp.h
@@ -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");



More information about the mesa-commit mailing list