fixup pci code for Jon's last checkin for changing page size
[mesa.git] / src / mesa / drivers / dri / radeon / radeon_swtcl.c
index d7f9df762e5028d4c99b1f1fc9a511d8727eb6e7..35720fd658917c52132fcfbde33526540e614eef 100644 (file)
@@ -70,8 +70,8 @@ static void flush_last_swtcl_prim( radeonContextPtr rmesa  );
 
 static struct {
    void                (*emit)( GLcontext *, GLuint, GLuint, void *, GLuint );
-   interp_func         interp;
-   copy_pv_func                copy_pv;
+   tnl_interp_func             interp;
+   tnl_copy_pv_func            copy_pv;
    GLboolean           (*check_tex_sizes)( GLcontext *ctx );
    GLuint               vertex_size;
    GLuint               vertex_format;
@@ -380,6 +380,8 @@ static void flush_last_swtcl_prim( radeonContextPtr rmesa  )
              current->ptr);
 
       if (rmesa->dma.current.start != rmesa->dma.current.ptr) {
+        radeonEnsureCmdBufSpace( rmesa, VERT_AOS_BUFSZ +
+                                 rmesa->hw.max_state_size + VBUF_BUFSZ );
         radeonEmitVertexAOS( rmesa,
                              rmesa->swtcl.vertex_size,
                              current_offset);
@@ -506,7 +508,7 @@ static __inline void radeonEltPrimitive( radeonContextPtr rmesa, GLenum prim )
 
 
 
-#define LOCAL_VARS radeonContextPtr rmesa = RADEON_CONTEXT(ctx)
+#define LOCAL_VARS radeonContextPtr rmesa = RADEON_CONTEXT(ctx); (void)rmesa
 #define ELTS_VARS( buf )  GLushort *dest = buf
 #define INIT( prim ) radeonDmaPrimitive( rmesa, prim )
 #define ELT_INIT(prim) radeonEltPrimitive( rmesa, prim )
@@ -562,9 +564,12 @@ static void *radeon_alloc_elts( radeonContextPtr rmesa, int nr )
 #define EMIT_ELT(offset, x) do {                               \
        int off = offset + ( ( (GLuint)dest & 0x2 ) >> 1 );     \
        GLushort *des = (GLushort *)( (GLuint)dest & ~0x2 );    \
-       (des)[ off + 1 - 2 * ( off & 1 ) ] = (GLushort)(x); } while (0)
+       (des)[ off + 1 - 2 * ( off & 1 ) ] = (GLushort)(x);     \
+       (void)rmesa; } while (0)
 #else
-#define EMIT_ELT(offset, x) (dest)[offset] = (GLushort) (x)
+#define EMIT_ELT(offset, x) do {                               \
+       (dest)[offset] = (GLushort) (x);                        \
+       (void)rmesa; } while (0)
 #endif
 #define EMIT_TWO_ELTS(offset, x, y)  *(GLuint *)(dest+offset) = ((y)<<16)|(x);
 #define INCR_ELTS( nr ) dest += nr
@@ -595,7 +600,7 @@ static GLboolean radeon_run_render( GLcontext *ctx,
    radeonContextPtr rmesa = RADEON_CONTEXT(ctx);
    TNLcontext *tnl = TNL_CONTEXT(ctx);
    struct vertex_buffer *VB = &tnl->vb;
-   render_func *tab = TAG(render_tab_verts);
+   tnl_render_func *tab = TAG(render_tab_verts);
    GLuint i;
 
    if (rmesa->swtcl.indexed_verts.buf && (!VB->Elts || stage->changed_inputs)) 
@@ -704,7 +709,7 @@ static GLboolean run_texrect_stage( GLcontext *ctx,
    
       if (stage->changed_inputs & VERT_BIT_TEX(i)) {
         struct gl_texture_object *texObj = ctx->Texture.Unit[i].CurrentRect;
-        struct gl_texture_image *texImage = texObj->Image[texObj->BaseLevel];
+        struct gl_texture_image *texImage = texObj->Image[0][texObj->BaseLevel];
         const GLfloat iw = 1.0/texImage->Width;
         const GLfloat ih = 1.0/texImage->Height;
         GLfloat *in = (GLfloat *)VB->TexCoordPtr[i]->data;
@@ -859,10 +864,10 @@ static void radeonResetLineStipple( GLcontext *ctx );
 
 
 static struct {
-   points_func         points;
-   line_func           line;
-   triangle_func       triangle;
-   quad_func           quad;
+   tnl_points_func             points;
+   tnl_line_func               line;
+   tnl_triangle_func   triangle;
+   tnl_quad_func               quad;
 } rast_tab[RADEON_MAX_TRIFUNC];
 
 
@@ -879,7 +884,6 @@ static struct {
 
 #define HAVE_RGBA   1
 #define HAVE_SPEC   1
-#define HAVE_INDEX  0
 #define HAVE_BACK_COLORS  0
 #define HAVE_HW_FLATSHADE 1
 #define TAB rast_tab