New 'draw' module for primitive drawing (clipping, culling, etc).
authorBrian <brian.paul@tungstengraphics.com>
Mon, 9 Jul 2007 22:14:26 +0000 (16:14 -0600)
committerBrian <brian.paul@tungstengraphics.com>
Mon, 9 Jul 2007 22:14:26 +0000 (16:14 -0600)
21 files changed:
src/mesa/pipe/draw/draw_clip.c
src/mesa/pipe/draw/draw_context.h
src/mesa/pipe/draw/draw_cull.c
src/mesa/pipe/draw/draw_flatshade.c
src/mesa/pipe/draw/draw_offset.c
src/mesa/pipe/draw/draw_private.h
src/mesa/pipe/draw/draw_twoside.c
src/mesa/pipe/draw/draw_unfilled.c
src/mesa/pipe/draw/draw_vb.c
src/mesa/pipe/p_state.h
src/mesa/pipe/softpipe/sp_context.c
src/mesa/pipe/softpipe/sp_context.h
src/mesa/pipe/softpipe/sp_headers.h
src/mesa/pipe/softpipe/sp_prim_setup.c
src/mesa/pipe/softpipe/sp_prim_setup.h
src/mesa/pipe/softpipe/sp_state_blend.c
src/mesa/pipe/softpipe/sp_state_clip.c
src/mesa/pipe/softpipe/sp_state_derived.c
src/mesa/pipe/softpipe/sp_state_sampler.c
src/mesa/pipe/softpipe/sp_state_setup.c
src/mesa/sources

index 304c43c..10a6c1b 100644 (file)
 /* Authors:  Keith Whitwell <keith@tungstengraphics.com>
  */
 
-#include "imports.h"
-#include "macros.h"
+#include "main/macros.h"
+#include "draw_private.h"
 
-#include "sp_context.h"
-#include "sp_prim.h"
 
 struct clipper {
-   struct prim_stage stage;
+   struct prim_stage stage;      /**< base class */
 
    GLuint active_user_planes;
+   GLfloat (*plane)[4];
 };
 
+
 /* This is a bit confusing:
  */
 static INLINE struct clipper *clipper_stage( struct prim_stage *stage )
@@ -75,7 +75,7 @@ static void interp( struct clipper *clip,
                    const struct vertex_header *out, 
                    const struct vertex_header *in )
 {
-   const GLuint nr_attrs = clip->stage.softpipe->nr_attrs;
+   const GLuint nr_attrs = clip->stage.draw->nr_attrs;
    GLuint j;
 
    /* Vertex header.
@@ -96,8 +96,8 @@ static void interp( struct clipper *clip,
     */
    {
       const GLfloat *pos = dst->clip;
-      const GLfloat *scale = clip->stage.softpipe->viewport.scale;
-      const GLfloat *trans = clip->stage.softpipe->viewport.translate;
+      const GLfloat *scale = clip->stage.draw->viewport.scale;
+      const GLfloat *trans = clip->stage.draw->viewport.translate;
       GLfloat oow;
 
       oow = 1.0 / pos[3];
@@ -225,7 +225,7 @@ do_clip_tri( struct prim_stage *stage,
 
    while (clipmask && n >= 3) {
       GLuint plane_idx = ffs(clipmask)-1;
-      const GLfloat *plane = clipper->stage.softpipe->plane[plane_idx];
+      const GLfloat *plane = clipper->plane[plane_idx];
       struct vertex_header *vert_prev = inlist[0];
       GLfloat dp_prev = dot4( vert_prev->clip, plane );
       GLuint outcount = 0;
@@ -314,7 +314,7 @@ do_clip_line( struct prim_stage *stage,
 
    while (clipmask) {
       GLuint plane_idx = ffs(clipmask)-1;
-      const GLfloat *plane = clipper->stage.softpipe->plane[plane_idx];
+      const GLfloat *plane = clipper->plane[plane_idx];
 
       clipmask &= ~(1<<plane_idx);
 
@@ -353,7 +353,7 @@ do_clip_line( struct prim_stage *stage,
 static void clip_begin( struct prim_stage *stage )
 {
    struct clipper *clipper = clipper_stage(stage);
-   GLuint nr = stage->softpipe->nr_planes;
+   GLuint nr = stage->draw->nr_planes;
 
    /* Hacky bitmask to use when we hit CLIP_USER_BIT:
     */   
@@ -379,6 +379,7 @@ clip_line( struct prim_stage *stage,
                      header->v[1]->clipmask);
    
    if (clipmask == 0) {
+      /* no clipping needed */
       stage->next->line( stage->next, header );
    }
    else if ((header->v[0]->clipmask & 
@@ -397,6 +398,7 @@ clip_tri( struct prim_stage *stage,
                      header->v[2]->clipmask);
    
    if (clipmask == 0) {
+      /* no clipping needed */
       stage->next->tri( stage->next, header );
    }
    else if ((header->v[0]->clipmask & 
@@ -406,24 +408,31 @@ clip_tri( struct prim_stage *stage,
    }
 }
 
+
 static void clip_end( struct prim_stage *stage )
 {
    stage->next->end( stage->next );
 }
 
 
-struct prim_stage *prim_clip( struct softpipe_context *softpipe )
+/**
+ * Allocate a new clipper stage.
+ * \return pointer to new stage object
+ */
+struct prim_stage *prim_clip( struct draw_context *draw )
 {
    struct clipper *clipper = CALLOC_STRUCT(clipper);
 
    prim_alloc_tmps( &clipper->stage, MAX_CLIPPED_VERTICES );
 
-   clipper->stage.softpipe = softpipe;
+   clipper->stage.draw = draw;
    clipper->stage.begin = clip_begin;
    clipper->stage.point = clip_point;
    clipper->stage.line = clip_line;
    clipper->stage.tri = clip_tri;
    clipper->stage.end = clip_end;
 
+   clipper->plane = draw->plane;
+
    return &clipper->stage;
 }
index a138f81..85f2ace 100644 (file)
  * 
  **************************************************************************/
 
+/**
+ * \brief  Public interface into the drawing module.
+ */
+
 /* Authors:  Keith Whitwell <keith@tungstengraphics.com>
  */
 
-#ifndef G_DRAW_H
-#define G_DRAW_H
+
+#ifndef DRAW_CONTEXT_H
+#define DRAW_CONTEXT_H
+
 
 #include "glheader.h"
 #include "pipe/p_state.h"
 
 
+struct vertex_buffer;
 struct draw_context;
+struct prim_stage;
+
 
-struct draw_context *draw_create( struct softpipe_context *softpipe );
+struct draw_context *draw_create( void );
 
 void draw_destroy( struct draw_context *draw );
 
-void draw_set_viewport( struct draw_context *draw,
-                       const GLfloat *scale,
-                       const GLfloat *translate );
+void draw_set_viewport_state( struct draw_context *draw,
+                              const struct pipe_viewport_state *viewport );
+
+void draw_set_clip_state( struct draw_context *pipe,
+                          const struct pipe_clip_state *clip );
+
+void draw_set_setup_state( struct draw_context *draw,
+                           const struct pipe_setup_state *setup );
+
+void draw_set_setup_stage( struct draw_context *draw,
+                           struct prim_stage *stage );
 
 void draw_set_vertex_attributes( struct draw_context *draw,
                                 const GLuint *attrs,
@@ -53,4 +70,5 @@ void draw_set_vertex_attributes( struct draw_context *draw,
 void draw_vb(struct draw_context *draw,
             struct vertex_buffer *VB );
 
-#endif
+
+#endif /* DRAW_CONTEXT_H */
index 63099fb..d27d33a 100644 (file)
 
 /* Authors:  Keith Whitwell <keith@tungstengraphics.com>
  */
-#include "imports.h"
 
+#include "main/imports.h"
 #include "pipe/p_defines.h"
-#include "sp_context.h"
-#include "sp_prim.h"
+#include "draw_private.h"
 
 
 
@@ -52,7 +51,7 @@ static void cull_begin( struct prim_stage *stage )
 {
    struct cull_stage *cull = cull_stage(stage);
 
-   cull->mode = stage->softpipe->setup.cull_mode;
+   cull->mode = stage->draw->setup.cull_mode;
 
    stage->next->begin( stage->next );
 }
@@ -76,10 +75,13 @@ static void cull_tri( struct prim_stage *stage,
    _mesa_printf("%s %f\n", __FUNCTION__, header->det );
 
    if (header->det != 0) {
+      /* non-zero area */
       GLuint mode = (header->det < 0) ? PIPE_WINDING_CW : PIPE_WINDING_CCW;
 
-      if ((mode & cull_stage(stage)->mode) == 0)
+      if ((mode & cull_stage(stage)->mode) == 0) {
+         /* triangle is not culled, pass to next stage */
         stage->next->tri( stage->next, header );
+      }
    }
 }
 
@@ -97,18 +99,23 @@ static void cull_point( struct prim_stage *stage,
    stage->next->point( stage->next, header );
 }
 
+
 static void cull_end( struct prim_stage *stage )
 {
    stage->next->end( stage->next );
 }
 
-struct prim_stage *prim_cull( struct softpipe_context *softpipe )
+
+/**
+ * Create a new polygon culling stage.
+ */
+struct prim_stage *prim_cull( struct draw_context *draw )
 {
    struct cull_stage *cull = CALLOC_STRUCT(cull_stage);
 
    prim_alloc_tmps( &cull->stage, 0 );
 
-   cull->stage.softpipe = softpipe;
+   cull->stage.draw = draw;
    cull->stage.next = NULL;
    cull->stage.begin = cull_begin;
    cull->stage.point = cull_point;
index 3a7d9de..004b5bd 100644 (file)
 
 /* Authors:  Keith Whitwell <keith@tungstengraphics.com>
  */
-#include "imports.h"
 
-#include "vf/vf.h"
-
-#include "sp_context.h"
-#include "sp_prim.h"
+#include "main/imports.h"
+#include "draw_private.h"
 
 
 struct flatshade_stage {
@@ -67,11 +64,12 @@ static INLINE void copy_attr( GLuint attr,
    }
 }
 
-static void copy_colors( struct prim_stage *stage, 
-                        struct vertex_header *dst, 
-                        const struct vertex_header *src )
+
+static INLINE void copy_colors( struct prim_stage *stage, 
+                                struct vertex_header *dst, 
+                                const struct vertex_header *src )
 {
-   struct flatshade_stage *flatshade = flatshade_stage(stage);
+   const struct flatshade_stage *flatshade = flatshade_stage(stage);
    const GLuint *lookup = flatshade->lookup;
 
    copy_attr( lookup[VF_ATTRIB_COLOR0], dst, src );
@@ -81,8 +79,8 @@ static void copy_colors( struct prim_stage *stage,
 }
 
 
-
-/* Flatshade tri.  Required for clipping and when unfilled tris are
+/**
+ * Flatshade tri.  Required for clipping and when unfilled tris are
  * active, otherwise handled by hardware.
  */
 static void flatshade_tri( struct prim_stage *stage,
@@ -102,7 +100,8 @@ static void flatshade_tri( struct prim_stage *stage,
 }
 
 
-/* Flatshade line.  Required for clipping.
+/**
+ * Flatshade line.  Required for clipping.
  */
 static void flatshade_line( struct prim_stage *stage,
                            struct prim_header *header )
@@ -124,18 +123,20 @@ static void flatshade_point( struct prim_stage *stage,
    stage->next->point( stage->next, header );
 }
 
+
 static void flatshade_end( struct prim_stage *stage )
 {
    stage->next->end( stage->next );
 }
 
-struct prim_stage *prim_flatshade( struct softpipe_context *softpipe )
+
+struct prim_stage *prim_flatshade( struct draw_context *draw )
 {
    struct flatshade_stage *flatshade = CALLOC_STRUCT(flatshade_stage);
 
    prim_alloc_tmps( &flatshade->stage, 2 );
 
-   flatshade->stage.softpipe = softpipe;
+   flatshade->stage.draw = draw;
    flatshade->stage.next = NULL;
    flatshade->stage.begin = flatshade_begin;
    flatshade->stage.point = flatshade_point;
@@ -143,7 +144,7 @@ struct prim_stage *prim_flatshade( struct softpipe_context *softpipe )
    flatshade->stage.tri = flatshade_tri;
    flatshade->stage.end = flatshade_end;
 
-   flatshade->lookup = softpipe->vf_attr_to_slot;
+   flatshade->lookup = draw->vf_attr_to_slot;
 
    return &flatshade->stage;
 }
index 5fd6ac9..0fa8cf2 100644 (file)
 
 /* Authors:  Keith Whitwell <keith@tungstengraphics.com>
  */
-#include "imports.h"
-#include "macros.h"
 
-#include "sp_context.h"
-#include "sp_prim.h"
+#include "main/imports.h"
+#include "main/macros.h"
+#include "draw_private.h"
 
 
 
@@ -56,14 +55,15 @@ static void offset_begin( struct prim_stage *stage )
 {
    struct offset_stage *offset = offset_stage(stage);
 
-   offset->units = stage->softpipe->setup.offset_units;
-   offset->scale = stage->softpipe->setup.offset_scale;
+   offset->units = stage->draw->setup.offset_units;
+   offset->scale = stage->draw->setup.offset_scale;
 
    stage->next->begin( stage->next );
 }
 
 
-/* Offset tri.  Some hardware can handle this, but not usually when
+/**
+ * Offset tri Z.  Some hardware can handle this, but not usually when
  * doing unfilled rendering.
  */
 static void do_offset_tri( struct prim_stage *stage,
@@ -92,8 +92,8 @@ static void do_offset_tri( struct prim_stage *stage,
    GLfloat bc = b * inv_det;
    GLfloat zoffset;
 
-   if ( ac < 0.0f ) ac = -ac;
-   if ( bc < 0.0f ) bc = -bc;
+   ac = FABSF(ac);
+   bc = FABSF(bc);
 
    zoffset = offset->units + MAX2( ac, bc ) * offset->scale;
 
@@ -115,7 +115,7 @@ static void offset_tri( struct prim_stage *stage,
    tmp.v[1] = dup_vert(stage, header->v[1], 1);
    tmp.v[2] = dup_vert(stage, header->v[2], 2);
 
-   do_offset_tri( stage->next, &tmp );
+   do_offset_tri( stage, &tmp );
 }
 
 
@@ -139,13 +139,13 @@ static void offset_end( struct prim_stage *stage )
    stage->next->end( stage->next );
 }
 
-struct prim_stage *prim_offset( struct softpipe_context *softpipe )
+struct prim_stage *prim_offset( struct draw_context *draw )
 {
    struct offset_stage *offset = CALLOC_STRUCT(offset_stage);
 
    prim_alloc_tmps( &offset->stage, 3 );
 
-   offset->stage.softpipe = softpipe;
+   offset->stage.draw = draw;
    offset->stage.next = NULL;
    offset->stage.begin = offset_begin;
    offset->stage.point = offset_point;
index b6cbaae..ac25628 100644 (file)
  * 
  **************************************************************************/
 
-/* Authors:  Keith Whitwell <keith@tungstengraphics.com>
+/**
+ * Private data structures, etc for the draw module.
  */
 
-#ifndef G_PRIM_H
-#define G_PRIM_H
 
-#include "glheader.h"
-#include "sp_headers.h"
+/**
+ * Authors:
+ * Keith Whitwell <keith@tungstengraphics.com>
+ * Brian Paul
+ */
+
 
-struct softpipe_context;
+#ifndef DRAW_PRIVATE_H
+#define DRAW_PRIVATE_H
 
-struct prim_stage *prim_setup( struct softpipe_context *context );
-struct prim_stage *prim_unfilled( struct softpipe_context *context );
-struct prim_stage *prim_twoside( struct softpipe_context *context );
-struct prim_stage *prim_offset( struct softpipe_context *context );
-struct prim_stage *prim_clip( struct softpipe_context *context );
-struct prim_stage *prim_flatshade( struct softpipe_context *context );
-struct prim_stage *prim_cull( struct softpipe_context *context );
 
+#include "main/glheader.h"
+#include "pipe/p_state.h"
+#include "pipe/p_defines.h"
+#include "vf/vf.h"
 
-/* Internal structs and helpers for the primitive clip/setup pipeline:
+
+/**
+ * Basic vertex info.
+ * Carry some useful information around with the vertices in the prim pipe.  
  */
-struct prim_stage {
-   struct softpipe_context *softpipe;
+struct vertex_header {
+   GLuint clipmask:12;
+   GLuint edgeflag:1;
+   GLuint pad:19;
 
-   struct prim_stage *next;
+   GLfloat clip[4];
+
+   GLfloat data[][4];          /* Note variable size */
+};
+
+
+/**
+ * Basic info for a point/line/triangle primitive.
+ */
+struct prim_header {
+   GLfloat det;                 /**< front/back face determinant */
+   struct vertex_header *v[3];  /**< 1 to 3 vertex pointers */
+};
+
+
+
+struct draw_context;
+
+/**
+ * Base class for all primitive drawing stages.
+ */
+struct prim_stage
+{
+   struct draw_context *draw;   /**< parent context */
+
+   struct prim_stage *next;     /**< next stage in pipeline */
 
    struct vertex_header **tmp;
    GLuint nr_tmps;
@@ -70,8 +101,72 @@ struct prim_stage {
 };
 
 
+/**
+ * Private context for the drawing module.
+ */
+struct draw_context
+{
+   struct {
+      struct prim_stage *first;  /**< one of the following */
+
+      /* stages (in logical order) */
+      struct prim_stage *flatshade;
+      struct prim_stage *clip;
+      struct prim_stage *cull;
+      struct prim_stage *twoside;
+      struct prim_stage *offset;
+      struct prim_stage *unfilled;
+      struct prim_stage *setup;  /* aka render/rasterize */
+   } pipeline;
+
+   /* pipe state that we need: */
+   struct pipe_setup_state setup;
+   struct pipe_viewport_state viewport;
+
+   /* Clip derived state:
+    */
+   GLfloat plane[12][4];
+   GLuint nr_planes;
+
+   GLuint vf_attr_to_slot[PIPE_ATTRIB_MAX];
+
+   struct vf_attr_map attrs[VF_ATTRIB_MAX];
+   GLuint nr_attrs;
+   GLuint vertex_size;       /**< in bytes */
+   struct vertex_fetch *vf;
+
+   GLubyte *verts;
+   GLuint nr_vertices;
+   GLboolean in_vb;
+
+   GLenum prim;   /**< GL_POINTS, GL_LINE_STRIP, GL_QUADS, etc */
+
+   /* Helper for tnl:
+    */
+   GLvector4f header;   
+};
+
+
 
-/* Get a writeable copy of a vertex:
+extern struct prim_stage *prim_unfilled( struct draw_context *context );
+extern struct prim_stage *prim_twoside( struct draw_context *context );
+extern struct prim_stage *prim_offset( struct draw_context *context );
+extern struct prim_stage *prim_clip( struct draw_context *context );
+extern struct prim_stage *prim_flatshade( struct draw_context *context );
+extern struct prim_stage *prim_cull( struct draw_context *context );
+
+
+extern void prim_free_tmps( struct prim_stage *stage );
+extern void prim_alloc_tmps( struct prim_stage *stage, GLuint nr );
+
+
+
+/**
+ * Get a writeable copy of a vertex.
+ * \param stage  drawing stage info
+ * \param vert  the vertex to copy (source)
+ * \param idx  index into stage's tmp[] array to put the copy (dest)
+ * \return  pointer to the copied vertex
  */
 static INLINE struct vertex_header *
 dup_vert( struct prim_stage *stage,
@@ -79,12 +174,9 @@ dup_vert( struct prim_stage *stage,
          GLuint idx )
 {   
    struct vertex_header *tmp = stage->tmp[idx];
-   memcpy(tmp, vert, stage->softpipe->prim.vertex_size );
+   memcpy(tmp, vert, stage->draw->vertex_size );
    return tmp;
 }
 
-void prim_free_tmps( struct prim_stage *stage );
-void prim_alloc_tmps( struct prim_stage *stage, GLuint nr );
-
 
-#endif
+#endif /* DRAW_PRIVATE_H */
index 5e9f218..88e164e 100644 (file)
 
 /* Authors:  Keith Whitwell <keith@tungstengraphics.com>
  */
-#include "imports.h"
-#include "vf/vf.h"
 
+#include "main/imports.h"
 #include "pipe/p_defines.h"
-#include "sp_context.h"
-#include "sp_prim.h"
+#include "draw_private.h"
 
 
 struct twoside_stage {
@@ -53,7 +51,7 @@ static void twoside_begin( struct prim_stage *stage )
 {
    struct twoside_stage *twoside = twoside_stage(stage);
 
-   twoside->facing = (stage->softpipe->setup.front_winding == PIPE_WINDING_CW) ? -1 : 1;
+   twoside->facing = (stage->draw->setup.front_winding == PIPE_WINDING_CW) ? -1 : 1;
 
    stage->next->begin( stage->next );
 }
@@ -97,9 +95,11 @@ static void twoside_tri( struct prim_stage *stage,
    struct twoside_stage *twoside = twoside_stage(stage);
 
    if (header->det * twoside->facing < 0) {
+      /* this is a back-facing triangle */
       struct prim_header tmp;
 
       tmp.det = header->det;
+      /* copy back colors to front color slots */
       tmp.v[0] = copy_bfc(twoside, header->v[0], 0);
       tmp.v[1] = copy_bfc(twoside, header->v[1], 1);
       tmp.v[2] = copy_bfc(twoside, header->v[2], 2);
@@ -115,6 +115,7 @@ static void twoside_tri( struct prim_stage *stage,
 static void twoside_line( struct prim_stage *stage,
                       struct prim_header *header )
 {
+   /* pass-through */
    stage->next->line( stage->next, header );
 }
 
@@ -122,23 +123,28 @@ static void twoside_line( struct prim_stage *stage,
 static void twoside_point( struct prim_stage *stage,
                        struct prim_header *header )
 {
+   /* pass-through */
    stage->next->point( stage->next, header );
 }
 
+
 static void twoside_end( struct prim_stage *stage )
 {
+   /* pass-through */
    stage->next->end( stage->next );
 }
 
 
-
-struct prim_stage *prim_twoside( struct softpipe_context *softpipe )
+/**
+ * Create twoside pipeline stage.
+ */
+struct prim_stage *prim_twoside( struct draw_context *draw )
 {
    struct twoside_stage *twoside = CALLOC_STRUCT(twoside_stage);
 
    prim_alloc_tmps( &twoside->stage, 3 );
 
-   twoside->stage.softpipe = softpipe;
+   twoside->stage.draw = draw;
    twoside->stage.next = NULL;
    twoside->stage.begin = twoside_begin;
    twoside->stage.point = twoside_point;
@@ -146,7 +152,7 @@ struct prim_stage *prim_twoside( struct softpipe_context *softpipe )
    twoside->stage.tri = twoside_tri;
    twoside->stage.end = twoside_end;
 
-   twoside->lookup = softpipe->vf_attr_to_slot;
+   twoside->lookup = draw->vf_attr_to_slot;
 
    return &twoside->stage;
 }
index ab0dab0..a1d9d14 100644 (file)
 
 /* Authors:  Keith Whitwell <keith@tungstengraphics.com>
  */
-#include "imports.h"
 
-#include "sp_context.h"
-#include "sp_prim.h"
+#include "main/imports.h"
 #include "pipe/p_defines.h"
+#include "draw_private.h"
 
 
 struct unfilled_stage {
@@ -51,8 +50,8 @@ static void unfilled_begin( struct prim_stage *stage )
 {
    struct unfilled_stage *unfilled = unfilled_stage(stage);
 
-   unfilled->mode[0] = stage->softpipe->setup.fill_ccw;
-   unfilled->mode[1] = stage->softpipe->setup.fill_cw;
+   unfilled->mode[0] = stage->draw->setup.fill_ccw;
+   unfilled->mode[1] = stage->draw->setup.fill_cw;
 
    stage->next->begin( stage->next );
 }
@@ -128,14 +127,14 @@ static void unfilled_tri( struct prim_stage *stage,
 }
 
 static void unfilled_line( struct prim_stage *stage,
-                      struct prim_header *header )
+                           struct prim_header *header )
 {
    stage->next->line( stage->next, header );
 }
 
 
 static void unfilled_point( struct prim_stage *stage,
-                       struct prim_header *header )
+                            struct prim_header *header )
 {
    stage->next->point( stage->next, header );
 }
@@ -146,13 +145,13 @@ static void unfilled_end( struct prim_stage *stage )
    stage->next->end( stage->next );
 }
 
-struct prim_stage *prim_unfilled( struct softpipe_context *softpipe )
+struct prim_stage *prim_unfilled( struct draw_context *draw )
 {
    struct unfilled_stage *unfilled = CALLOC_STRUCT(unfilled_stage);
 
    prim_alloc_tmps( &unfilled->stage, 0 );
 
-   unfilled->stage.softpipe = softpipe;
+   unfilled->stage.draw = draw;
    unfilled->stage.next = NULL;
    unfilled->stage.tmp = NULL;
    unfilled->stage.begin = unfilled_begin;
index 3fc30dd..66573a9 100644 (file)
   */
 
 #include "imports.h"
+#include "macros.h"
 
 #include "tnl/t_context.h"
 #include "vf/vf.h"
 
-#include "sp_context.h"
-#include "sp_prim.h"
-#include "sp_headers.h"
-#include "sp_draw.h"
+#include "pipe/softpipe/sp_context.h"
+#include "pipe/softpipe/sp_headers.h"
+#include "draw_private.h"
+#include "draw_context.h"
+
 
 /* This file is a temporary set of hooks to allow us to use the tnl/
  * and vf/ modules until we have replacements in pipe.
  */
 
 
-struct draw_context 
-{
-   struct softpipe_context *softpipe;
-
-   struct vf_attr_map attrs[VF_ATTRIB_MAX];
-   GLuint nr_attrs;
-   GLuint vertex_size;
-   struct vertex_fetch *vf;
-
-   GLubyte *verts;
-   GLuint nr_vertices;
-   GLboolean in_vb;
-
-   GLenum prim;
-
-   /* Helper for tnl:
-    */
-   GLvector4f header;   
-};
-
-
 static struct vertex_header *get_vertex( struct draw_context *pipe,
                                               GLuint i )
 {
@@ -80,7 +61,7 @@ static void draw_allocate_vertices( struct draw_context *draw,
    draw->nr_vertices = nr_vertices;
    draw->verts = MALLOC( nr_vertices * draw->vertex_size );
 
-   draw->softpipe->prim.first->begin( draw->softpipe->prim.first );
+   draw->pipeline.first->begin( draw->pipeline.first );
 }
 
 static void draw_set_prim( struct draw_context *draw,
@@ -149,7 +130,7 @@ static void draw_indexed_prim( struct draw_context *draw,
                               const GLuint *elts,
                               GLuint count )
 {
-   struct prim_stage * const first = draw->softpipe->prim.first;
+   struct prim_stage * const first = draw->pipeline.first;
    struct prim_header prim;
    GLuint i;
 
@@ -299,7 +280,7 @@ static void draw_prim( struct draw_context *draw,
                       GLuint start,
                       GLuint count )
 {
-   struct prim_stage * const first = draw->softpipe->prim.first;
+   struct prim_stage * const first = draw->pipeline.first;
    struct prim_header prim;
    GLuint i;
 
@@ -442,7 +423,7 @@ static void draw_prim( struct draw_context *draw,
 
 static void draw_release_vertices( struct draw_context *draw )
 {
-   draw->softpipe->prim.first->end( draw->softpipe->prim.first );
+   draw->pipeline.first->end( draw->pipeline.first );
 
    FREE(draw->verts);
    draw->verts = NULL;
@@ -636,35 +617,6 @@ void draw_vb(struct draw_context *draw,
    draw->in_vb = 0;
 }
 
-void draw_set_viewport( struct draw_context *draw,
-                       const GLfloat *scale,
-                       const GLfloat *translate )
-{
-   assert(!draw->in_vb);
-   vf_set_vp_scale_translate( draw->vf, scale, translate );
-}
-
-
-
-struct draw_context *draw_create( struct softpipe_context *softpipe )
-{
-   struct draw_context *draw = CALLOC_STRUCT( draw_context );
-   draw->softpipe = softpipe;
-   draw->vf = vf_create( GL_TRUE );
-
-   return draw;
-}
-
-
-void draw_destroy( struct draw_context *draw )
-{
-   if (draw->header.storage)
-      ALIGN_FREE( draw->header.storage );
-
-   vf_destroy( draw->vf );
-
-   FREE( draw );
-}
 
 #define EMIT_ATTR( ATTR, STYLE )               \
 do {                                           \
@@ -695,3 +647,27 @@ void draw_set_vertex_attributes( struct draw_context *draw,
 }
                            
 
+#define MAX_VERTEX_SIZE ((2 + FRAG_ATTRIB_MAX) * 4 * sizeof(GLfloat))
+
+void prim_alloc_tmps( struct prim_stage *stage, GLuint nr )
+{
+   stage->nr_tmps = nr;
+
+   if (nr) {
+      GLubyte *store = MALLOC(MAX_VERTEX_SIZE * nr);
+      GLuint i;
+
+      stage->tmp = MALLOC(sizeof(struct vertex_header *) * nr);
+      
+      for (i = 0; i < nr; i++)
+        stage->tmp[i] = (struct vertex_header *)(store + i * MAX_VERTEX_SIZE);
+   }
+}
+
+void prim_free_tmps( struct prim_stage *stage )
+{
+   if (stage->tmp) {
+      FREE(stage->tmp[0]);
+      FREE(stage->tmp);
+   }
+}
index 9b4b336..581ea5d 100644 (file)
@@ -48,6 +48,8 @@
 #define PIPE_MAX_SAMPLERS     8
 #define PIPE_MAX_CLIP_PLANES  6
 #define PIPE_MAX_CONSTANT    32
+#define PIPE_ATTRIB_MAX      32
+
 
 
 /* fwd decl */
index 6bd1d9f..9becab4 100644 (file)
  *    Keith Whitwell <keith@tungstengraphics.com>
  */
 
-#include "imports.h"
-#include "macros.h"
-
+#include "main/imports.h"
+#include "main/macros.h"
+#include "pipe/draw/draw_context.h"
 #include "sp_context.h"
 #include "sp_clear.h"
-#include "sp_prim.h"
 #include "sp_state.h"
-#include "sp_draw.h"
+#include "sp_prim_setup.h"
+
 
 static void softpipe_destroy( struct pipe_context *pipe )
 {
@@ -44,7 +44,7 @@ static void softpipe_destroy( struct pipe_context *pipe )
 
    draw_destroy( softpipe->draw );
 
-   FREE( softpipe );
+   free( softpipe );
 }
 
 
@@ -59,6 +59,7 @@ static void softpipe_draw_vb( struct pipe_context *pipe,
    draw_vb( softpipe->draw, VB );
 }
 
+
 struct pipe_context *softpipe_create( void )
 {
    struct softpipe_context *softpipe = CALLOC_STRUCT(softpipe_context);
@@ -81,64 +82,17 @@ struct pipe_context *softpipe_create( void )
    softpipe->pipe.draw_vb = softpipe_draw_vb;
    softpipe->pipe.clear = softpipe_clear;
 
-
-   softpipe->prim.setup     = prim_setup( softpipe );
-   softpipe->prim.unfilled  = prim_unfilled( softpipe );
-   softpipe->prim.twoside   = prim_twoside( softpipe );
-   softpipe->prim.offset    = prim_offset( softpipe );
-   softpipe->prim.clip      = prim_clip( softpipe );
-   softpipe->prim.flatshade = prim_flatshade( softpipe );
-   softpipe->prim.cull      = prim_cull( softpipe );
-
+   softpipe->quad.shade = sp_quad_shade_stage(softpipe);
+   softpipe->quad.alpha_test = sp_quad_alpha_test_stage(softpipe);
    softpipe->quad.blend = sp_quad_blend_stage(softpipe);
    softpipe->quad.depth_test = sp_quad_depth_test_stage(softpipe);
-   softpipe->quad.shade = sp_quad_shade_stage(softpipe);
    softpipe->quad.output = sp_quad_output_stage(softpipe);
 
-   softpipe->draw = draw_create( softpipe );
-
-   ASSIGN_4V( softpipe->plane[0], -1,  0,  0, 1 );
-   ASSIGN_4V( softpipe->plane[1],  1,  0,  0, 1 );
-   ASSIGN_4V( softpipe->plane[2],  0, -1,  0, 1 );
-   ASSIGN_4V( softpipe->plane[3],  0,  1,  0, 1 );
-   ASSIGN_4V( softpipe->plane[4],  0,  0,  1, 1 ); /* yes these are correct */
-   ASSIGN_4V( softpipe->plane[5],  0,  0, -1, 1 ); /* mesa's a bit wonky */
-   softpipe->nr_planes = 6;
+   /*
+    * Create drawing context and plug our render/setup stage into it.
+    */
+   softpipe->draw = draw_create();
+   draw_set_setup_stage(softpipe->draw, prim_setup(softpipe));
 
    return &softpipe->pipe;
 }
-
-
-
-
-
-
-#define MAX_VERTEX_SIZE ((2 + FRAG_ATTRIB_MAX) * 4 * sizeof(GLfloat))
-
-void prim_alloc_tmps( struct prim_stage *stage, GLuint nr )
-{
-   stage->nr_tmps = nr;
-
-   if (nr) {
-      GLubyte *store = MALLOC(MAX_VERTEX_SIZE * nr);
-      GLuint i;
-
-      stage->tmp = MALLOC(sizeof(struct vertex_header *) * nr);
-      
-      for (i = 0; i < nr; i++)
-        stage->tmp[i] = (struct vertex_header *)(store + i * MAX_VERTEX_SIZE);
-   }
-}
-
-void prim_free_tmps( struct prim_stage *stage )
-{
-   if (stage->tmp) {
-      FREE(stage->tmp[0]);
-      FREE(stage->tmp);
-   }
-}
-
-
-
-
-
index 4068820..0c08297 100644 (file)
@@ -55,7 +55,6 @@ enum interp_mode {
 #define G_NEW_SETUP     0x2
 #define G_NEW_FS        0x4
 #define G_NEW_BLEND     0x8
-#define G_NEW_POINT     0x10
 #define G_NEW_CLIP      0x20
 #define G_NEW_SCISSOR   0x40
 #define G_NEW_STIPPLE   0x80
@@ -66,12 +65,9 @@ enum interp_mode {
 #define G_NEW_TEXTURE    0x1000
 
 
-#define PIPE_ATTRIB_MAX 32
-
 struct softpipe_context {     
    struct pipe_context pipe;
 
-
    /* The most recent drawing state as set by the driver:
     */
    struct pipe_alpha_test_state alpha_test;
@@ -90,11 +86,6 @@ struct softpipe_context {
    struct pipe_viewport_state viewport;
    GLuint dirty;
 
-   /* Clip derived state:
-    */
-   GLfloat plane[12][4];
-   GLuint nr_planes;
-
    /* Setup derived state.  TODO: this should be passed in the program
     * tokens as parameters to DECL instructions.
     * 
@@ -119,24 +110,6 @@ struct softpipe_context {
     */
    GLubyte stipple_masks[16][16];
 
-
-   /* The software clipper/setup engine.  
-    */
-   struct {
-      struct prim_stage *setup;
-      struct prim_stage *unfilled;
-      struct prim_stage *twoside;
-      struct prim_stage *clip;
-      struct prim_stage *flatshade;
-      struct prim_stage *offset;
-      struct prim_stage *cull;
-
-      struct prim_stage *first;
-
-      GLenum prim;
-      GLuint vertex_size;
-   } prim;
-
    /*
     * Software quad rendering pipeline
     */
index 96ff52a..561597d 100644 (file)
 #define PRIM_LINE  2
 #define PRIM_TRI   3
 
-struct prim_header {
-   GLfloat det;
-   struct vertex_header *v[3];
-};
-
-/* Carry some useful information around with the vertices in the prim
- * pipe.  
- */
-struct vertex_header {
-   GLuint clipmask:12;
-   GLuint edgeflag:1;
-   GLuint pad:19;
-
-   GLfloat clip[4];
-
-   GLfloat data[][4];          /* Note variable size */
-};
-
-
-
-
 
 /* The rasterizer generates 2x2 quads of fragment and feeds them to
  * the current fp_machine (see below).  
index 3f4602f..ea10ef5 100644 (file)
 #include "macros.h"
 
 #include "sp_context.h"
-#include "sp_prim.h"
+#include "sp_headers.h"
+#include "pipe/draw/draw_private.h"
 #include "sp_quad.h"
+#include "sp_prim_setup.h"
 
 
 
@@ -66,7 +68,10 @@ struct edge {
  * Also used for line drawing (taking some liberties).
  */
 struct setup_stage {
-   struct prim_stage stage; /**< This must be first */
+   struct prim_stage stage; /**< This must be first (base class) */
+
+   /*XXX NEW */
+   struct softpipe_context *softpipe;
 
    /* Vertices are just an array of floats making up each attribute in
     * turn.  Currently fixed at 4 floats, but should change in time.
@@ -119,7 +124,9 @@ static inline GLint block( GLint x )
 
 static void setup_begin( struct prim_stage *stage )
 {
-   setup_stage(stage)->quad.nr_attrs = stage->softpipe->nr_frag_attrs;
+   struct setup_stage *setup = setup_stage(stage);
+
+   setup->quad.nr_attrs = setup->softpipe->nr_frag_attrs;
 }
 
 
@@ -133,7 +140,7 @@ static void run_shader_block( struct setup_stage *setup,
    setup->quad.y0 = y;
    setup->quad.mask = mask;
 
-   quad_emit(setup->stage.softpipe, &setup->quad);
+   quad_emit(setup->/*stage.*/softpipe, &setup->quad);
 }
 
 
@@ -387,7 +394,7 @@ static void tri_persp_coeff( struct setup_stage *setup,
  */
 static void setup_tri_coefficients( struct setup_stage *setup )
 {
-   const enum interp_mode *interp = setup->stage.softpipe->interp;
+   const enum interp_mode *interp = setup->/*stage.*/softpipe->interp;
    GLuint slot, j;
 
    /* z and w are done by linear interpolation:
@@ -462,15 +469,15 @@ static void subtriangle( struct setup_stage *setup,
 
    /* scissor y:
     */
-   if (setup->stage.softpipe->setup.scissor) {
+   if (setup->/*stage.*/softpipe->setup.scissor) {
       start_y = sy;
       finish_y = start_y + lines;
 
-      if (start_y < setup->stage.softpipe->scissor.miny) 
-        start_y = setup->stage.softpipe->scissor.miny;
+      if (start_y < setup->/*stage.*/softpipe->scissor.miny) 
+        start_y = setup->/*stage.*/softpipe->scissor.miny;
 
-      if (finish_y > setup->stage.softpipe->scissor.maxy) 
-        finish_y = setup->stage.softpipe->scissor.maxy;
+      if (finish_y > setup->/*stage.*/softpipe->scissor.maxy) 
+        finish_y = setup->/*stage.*/softpipe->scissor.maxy;
 
       start_y -= sy;
       finish_y -= sy;
@@ -495,12 +502,12 @@ static void subtriangle( struct setup_stage *setup,
 
       /* scissor x: 
        */
-      if (setup->stage.softpipe->setup.scissor) {
-        if (left  < setup->stage.softpipe->scissor.minx) 
-           left  = setup->stage.softpipe->scissor.minx;
+      if (setup->/*stage.*/softpipe->setup.scissor) {
+        if (left  < setup->/*stage.*/softpipe->scissor.minx) 
+           left  = setup->/*stage.*/softpipe->scissor.minx;
 
-        if (right > setup->stage.softpipe->scissor.maxx) 
-           right = setup->stage.softpipe->scissor.maxx;
+        if (right > setup->/*stage.*/softpipe->scissor.maxx) 
+           right = setup->/*stage.*/softpipe->scissor.maxx;
       }
 
       if (left < right) {
@@ -604,7 +611,7 @@ line_persp_coeff(struct setup_stage *setup, GLuint slot, GLuint i)
 static INLINE void
 setup_line_coefficients(struct setup_stage *setup, struct prim_header *prim)
 {
-   const enum interp_mode *interp = setup->stage.softpipe->interp;
+   const enum interp_mode *interp = setup->/*stage.*/softpipe->interp;
    GLuint slot, j;
 
    /* use setup->vmin, vmax to point to vertices */
@@ -664,7 +671,7 @@ plot(struct setup_stage *setup, GLint x, GLint y)
       /* flush prev quad, start new quad */
 
       if (setup->quad.x0 != -1) 
-        quad_emit(setup->stage.softpipe, &setup->quad);
+        quad_emit(setup->/*stage.*/softpipe, &setup->quad);
 
       setup->quad.x0 = quadX;
       setup->quad.y0 = quadY;
@@ -767,7 +774,7 @@ setup_line(struct prim_stage *stage, struct prim_header *prim)
 
    /* draw final quad */
    if (setup->quad.mask) {
-      quad_emit(setup->stage.softpipe, &setup->quad);
+      quad_emit(setup->/*stage.*/softpipe, &setup->quad);
    }
 }
 
@@ -782,8 +789,8 @@ setup_point(struct prim_stage *stage, struct prim_header *prim)
 {
    struct setup_stage *setup = setup_stage( stage );
    /*XXX this should be a vertex attrib! */
-   GLfloat halfSize = 0.5 * setup->stage.softpipe->setup.point_size;
-   GLboolean round = setup->stage.softpipe->setup.point_smooth;
+   GLfloat halfSize = 0.5 * setup->/*stage.*/softpipe->setup.point_size;
+   GLboolean round = setup->/*stage.*/softpipe->setup.point_smooth;
    const struct vertex_header *v0 = prim->v[0];
    const GLfloat x = v0->data[FRAG_ATTRIB_WPOS][0];
    const GLfloat y = v0->data[FRAG_ATTRIB_WPOS][1];
@@ -822,7 +829,7 @@ setup_point(struct prim_stage *stage, struct prim_header *prim)
       setup->quad.x0 = x - ix;
       setup->quad.y0 = y - iy;
       setup->quad.mask = (1 << ix) << (2 * iy);
-      quad_emit(setup->stage.softpipe, &setup->quad);
+      quad_emit(setup->/*stage.*/softpipe, &setup->quad);
    }
    else {
       const GLint ixmin = block((GLint) (x - halfSize));
@@ -882,7 +889,7 @@ setup_point(struct prim_stage *stage, struct prim_header *prim)
             if (setup->quad.mask) {
                setup->quad.x0 = ix;
                setup->quad.y0 = iy;
-               quad_emit( setup->stage.softpipe, &setup->quad );
+               quad_emit( setup->/*stage.*/softpipe, &setup->quad );
             }
          }
       }
@@ -900,7 +907,8 @@ struct prim_stage *prim_setup( struct softpipe_context *softpipe )
 {
    struct setup_stage *setup = CALLOC_STRUCT(setup_stage);
 
-   setup->stage.softpipe = softpipe;
+   setup->softpipe = softpipe;
+   setup->stage.draw = softpipe->draw;
    setup->stage.begin = setup_begin;
    setup->stage.point = setup_point;
    setup->stage.line = setup_line;
index 40a70c5..4d26c05 100644 (file)
 
 #include "glheader.h"
 #include "imports.h"
+#if 0
 #include "s_tri_public.h"
+#endif
 #include "s_context.h"
 
 
+extern struct prim_stage *prim_setup( struct softpipe_context *softpipe );
+
 
+#if 0 /* UNUSED? */
 struct tri_context;
 struct fp_context;
 struct be_context;
@@ -119,3 +124,4 @@ void tri_rasterize_spans( struct tri_context *tri );
 
 #endif
 #endif
+#endif
index 6ca42e8..e0ff549 100644 (file)
@@ -31,8 +31,6 @@
 
 #include "sp_context.h"
 #include "sp_state.h"
-#include "sp_draw.h"
-
 
 
 void softpipe_set_blend_state( struct pipe_context *pipe,
index c907550..3b69d3e 100644 (file)
@@ -31,8 +31,7 @@
 
 #include "sp_context.h"
 #include "sp_state.h"
-#include "sp_draw.h"
-
+#include "pipe/draw/draw_context.h"
 
 
 void softpipe_set_clip_state( struct pipe_context *pipe,
@@ -40,10 +39,8 @@ void softpipe_set_clip_state( struct pipe_context *pipe,
 {
    struct softpipe_context *softpipe = softpipe_context(pipe);
 
-   memcpy(&softpipe->plane[6], clip->ucp, clip->nr * sizeof(clip->ucp[0]));
-
-   softpipe->nr_planes = 6 + clip->nr;
-   softpipe->dirty |= G_NEW_CLIP;
+   /* pass the clip state to the draw module */
+   draw_set_clip_state(softpipe->draw, clip);
 }
 
 
@@ -57,13 +54,32 @@ void softpipe_set_viewport_state( struct pipe_context *pipe,
    struct softpipe_context *softpipe = softpipe_context(pipe);
 
    softpipe->viewport = *viewport; /* struct copy */
+   softpipe->dirty |= G_NEW_VIEWPORT;
+
+   /* pass the viewport info to the draw module */
+   draw_set_viewport_state(softpipe->draw, viewport);
 
    /* Using tnl/ and vf/ modules is temporary while getting started.
     * Full pipe will have vertex shader, vertex fetch of its own.
     */
-   draw_set_viewport( softpipe->draw, viewport->scale, viewport->translate );
-   softpipe->dirty |= G_NEW_VIEWPORT;
 }
 
 
+void softpipe_set_scissor_state( struct pipe_context *pipe,
+                                 const struct pipe_scissor_state *scissor )
+{
+   struct softpipe_context *softpipe = softpipe_context(pipe);
+
+   memcpy( &softpipe->scissor, scissor, sizeof(*scissor) );
+   softpipe->dirty |= G_NEW_SCISSOR;
+}
+
+
+void softpipe_set_polygon_stipple( struct pipe_context *pipe,
+                                   const struct pipe_poly_stipple *stipple )
+{
+   struct softpipe_context *softpipe = softpipe_context(pipe);
 
+   memcpy( &softpipe->poly_stipple, stipple, sizeof(*stipple) );
+   softpipe->dirty |= G_NEW_STIPPLE;
+}
index 5aee4be..4454dd9 100644 (file)
  * 
  **************************************************************************/
 
-#include "glheader.h"
-#include "macros.h"
-#include "enums.h"
-#include "program.h"
+#include "main/glheader.h"
+#include "main/macros.h"
+#include "main/enums.h"
+#include "shader/program.h"
 
 #include "vf/vf.h"
-
+#include "pipe/draw/draw_context.h"
 #include "sp_context.h"
-#include "sp_draw.h"
 #include "sp_state.h"
 
+
 #define EMIT_ATTR( ATTR, FRAG_ATTR, INTERP )                   \
 do {                                                   \
    slot_to_vf_attr[softpipe->nr_attrs] = ATTR; \
@@ -77,8 +77,8 @@ static void calculate_vertex_layout( struct softpipe_context *softpipe )
    softpipe->nr_attrs = 0;
    memset(slot_to_vf_attr, 0, sizeof(slot_to_vf_attr));
 
-   memset(softpipe->fp_attr_to_slot, 0, sizeof(softpipe->vf_attr_to_slot));
-   memset(softpipe->vf_attr_to_slot, 0, sizeof(softpipe->fp_attr_to_slot));
+   memset(softpipe->fp_attr_to_slot, 0, sizeof(softpipe->fp_attr_to_slot));
+   memset(softpipe->vf_attr_to_slot, 0, sizeof(softpipe->vf_attr_to_slot));
 
    /* TODO - Figure out if we need to do perspective divide, etc.
     */
index 060e2c8..62ff5c5 100644 (file)
 /* Authors:
  *  Brian Paul
  */
+
 #include "imports.h"
 
 #include "sp_context.h"
 #include "sp_state.h"
-#include "sp_draw.h"
 
 
 
index 55803ae..2dea49c 100644 (file)
 #include "pipe/p_defines.h"
 #include "sp_context.h"
 #include "sp_state.h"
-#include "sp_prim.h"
-
-
+#include "pipe/draw/draw_context.h"
 
 
+#if 0
 static void validate_prim_pipe( struct softpipe_context *softpipe )
 {
    struct prim_stage *next = softpipe->prim.setup;
@@ -87,6 +86,7 @@ static void validate_prim_pipe( struct softpipe_context *softpipe )
    softpipe->prim.first = next;
 }
 
+#endif
 
 
 
@@ -95,29 +95,15 @@ void softpipe_set_setup_state( struct pipe_context *pipe,
 {
    struct softpipe_context *softpipe = softpipe_context(pipe);
 
+   /* pass-through to draw module */
+   draw_set_setup_state(softpipe->draw, setup);
+
    memcpy( &softpipe->setup, setup, sizeof(*setup) );
 
+#if 0
    validate_prim_pipe( softpipe );
+#endif
    softpipe->dirty |= G_NEW_SETUP;
 }
 
 
-
-void softpipe_set_scissor_state( struct pipe_context *pipe,
-                                 const struct pipe_scissor_state *scissor )
-{
-   struct softpipe_context *softpipe = softpipe_context(pipe);
-
-   memcpy( &softpipe->scissor, scissor, sizeof(*scissor) );
-   softpipe->dirty |= G_NEW_SCISSOR;
-}
-
-
-void softpipe_set_polygon_stipple( struct pipe_context *pipe,
-                                 const struct pipe_poly_stipple *stipple )
-{
-   struct softpipe_context *softpipe = softpipe_context(pipe);
-
-   memcpy( &softpipe->poly_stipple, stipple, sizeof(*stipple) );
-   softpipe->dirty |= G_NEW_STIPPLE;
-}
index b1ff379..5bef760 100644 (file)
@@ -157,14 +157,6 @@ VF_SOURCES = \
 SOFTPIPE_SOURCES = \
        pipe/softpipe/sp_clear.c \
        pipe/softpipe/sp_context.c \
-       pipe/softpipe/sp_draw.c \
-       pipe/softpipe/sp_prim_clip.c \
-       pipe/softpipe/sp_prim_cull.c \
-       pipe/softpipe/sp_prim_flatshade.c \
-       pipe/softpipe/sp_prim_offset.c \
-       pipe/softpipe/sp_prim_setup.c \
-       pipe/softpipe/sp_prim_twoside.c \
-       pipe/softpipe/sp_prim_unfilled.c \
        pipe/softpipe/sp_quad.c \
        pipe/softpipe/sp_quad_alpha_test.c \
        pipe/softpipe/sp_quad_blend.c \
@@ -177,7 +169,18 @@ SOFTPIPE_SOURCES = \
        pipe/softpipe/sp_state_fs.c \
        pipe/softpipe/sp_state_sampler.c \
        pipe/softpipe/sp_state_setup.c \
-       pipe/softpipe/sp_state_surface.c
+       pipe/softpipe/sp_state_surface.c \
+       pipe/softpipe/sp_prim_setup.c
+
+DRAW_SOURCES = \
+       pipe/draw/draw_clip.c \
+       pipe/draw/draw_context.c\
+       pipe/draw/draw_cull.c \
+       pipe/draw/draw_flatshade.c \
+       pipe/draw/draw_offset.c \
+       pipe/draw/draw_twoside.c \
+       pipe/draw/draw_unfilled.c \
+       pipe/draw/draw_vb.c
 
 TGSICORE_SOURCES = \
        pipe/tgsi/core/tgsi_build.c \
@@ -355,6 +358,7 @@ SOLO_SOURCES = \
        $(VBO_SOURCES)          \
        $(VF_SOURCES)           \
        $(SOFTPIPE_SOURCES)     \
+       $(DRAW_SOURCES)         \
        $(TGSICORE_SOURCES)     \
        $(TGSIMESA_SOURCES)     \
        $(STATETRACKER_SOURCES) \