Some work towards making the nv10 swtcl compile
authorStephane Marchesin <marchesin@icps.u-strasbg.fr>
Sun, 17 Sep 2006 11:58:52 +0000 (11:58 +0000)
committerStephane Marchesin <marchesin@icps.u-strasbg.fr>
Sun, 17 Sep 2006 11:58:52 +0000 (11:58 +0000)
src/mesa/drivers/dri/nouveau/nouveau_context.h
src/mesa/drivers/dri/nouveau/nv10_swtcl.c

index e1c5d4d54e00f71282f9da12b698f016e3aa83f9..ad3d00f588505f89e0c9c009979f34ac6dd82137 100644 (file)
@@ -103,9 +103,9 @@ typedef struct nouveau_context {
 
        /* The drawing fallbacks */
        GLuint Fallback;
-       nouveau_tri_func* draw_tri;
-       nouveau_line_func* draw_line;
-       nouveau_point_func* draw_point;
+       nouveau_tri_func draw_tri;
+       nouveau_line_func draw_line;
+       nouveau_point_func draw_point;
 
        /* Cliprects information */
        GLuint numClipRects;
index 31a54b3e5c88e43ef3ba8746c549710ce763e77d..0ddc466d5b8348b01313cc8328a6174dd0ed029b 100644 (file)
@@ -171,7 +171,7 @@ static inline void nv10_draw_point(nouveauContextPtr nmesa,
 #define LOCAL_VARS                                             \
    nouveauContextPtr nmesa = NOUVEAU_CONTEXT(ctx);             \
    const char *nouveauverts = (char *)nmesa->verts;
-#define VERT(x) (r200Vertex *)(r200verts + ((x) * vertsize * sizeof(int)))
+#define VERT(x) (nouveauVertex *)(nouveauverts + ((x) * vertsize * sizeof(int)))
 #define VERTEX nouveauVertex
 
 #undef TAG
@@ -182,10 +182,39 @@ static inline void nv10_draw_point(nouveauContextPtr nmesa,
  *          Macros for nouveau_dd_tritmp.h to draw basic primitives        *
  ***********************************************************************/
 
-#define QUAD( a, b, c, d ) nouveau_quad( nmesa, a, b, c, d )
-#define TRI( a, b, c )     nouveau_triangle( nmesa, a, b, c )
-#define LINE( a, b )       nouveau_line( nmesa, a, b )
-#define POINT( a )         nouveau_point( nmesa, a )
+#define TRI(a, b, c)                                        \
+       do {                                                \
+               if (DO_FALLBACK)                            \
+               nmesa->draw_tri(nmesa, a, b, c);            \
+               else                                        \
+               nv10_draw_triangle(nmesa, a, b, c);         \
+       } while (0)
+
+#define QUAD(a, b, c, d)                                    \
+       do {                                                \
+               if (DO_FALLBACK) {                          \
+                       nmesa->draw_tri(nmesa, a, b, d);    \
+                       nmesa->draw_tri(nmesa, b, c, d);    \
+               }                                           \
+               else                                        \
+               nv10_draw_quad(nmesa, a, b, c, d);          \
+       } while (0)
+
+#define LINE(v0, v1)                                        \
+       do {                                                \
+               if (DO_FALLBACK)                            \
+               nmesa->draw_line(nmesa, v0, v1);            \
+               else                                        \
+               nv10_draw_line(nmesa, v0, v1);              \
+       } while (0)
+
+#define POINT(v0)                                           \
+       do {                                                \
+               if (DO_FALLBACK)                            \
+               nmesa->draw_point(nmesa, v0);               \
+               else                                        \
+               nv10_draw_point(nmesa, v0);                 \
+       } while (0)
 
 #undef TAG
 
@@ -467,7 +496,7 @@ static void nouveauRenderClippedPoly(GLcontext *ctx, const GLuint *elts,
 {
        TNLcontext *tnl = TNL_CONTEXT(ctx);
        struct vertex_buffer *VB = &TNL_CONTEXT(ctx)->vb;
-       GLuint prim = NOUVEAU_CONTEXT(ctx)->renderPrimitive;
+       GLuint prim = NOUVEAU_CONTEXT(ctx)->current_primitive;
 
        /* Render the new vertices as an unclipped polygon.
         */