-/* $Id: xm_tri.c,v 1.29 2002/10/30 20:24:47 brianp Exp $ */
+/* $Id: xm_tri.c,v 1.30 2002/11/13 16:51:02 brianp Exp $ */
/*
* Mesa 3-D graphics library
- * Version: 4.1
+ * Version: 5.1
*
* Copyright (C) 1999-2002 Brian Paul All Rights Reserved.
*
/*
* XImage, smooth, depth-buffered, PF_TRUECOLOR triangle.
*/
-static void smooth_TRUECOLOR_z_triangle( GLcontext *ctx,
- const SWvertex *v0,
- const SWvertex *v1,
- const SWvertex *v2 )
-{
- XMesaContext xmesa = (XMesaContext) ctx->DriverCtx;
- XMesaImage *img = xmesa->xm_buffer->backimage;
+#define NAME smooth_TRUECOLOR_z_triangle
#define INTERP_Z 1
#define DEPTH_TYPE DEFAULT_SOFTWARE_DEPTH_TYPE
#define INTERP_RGB 1
+#define SETUP_CODE \
+ XMesaContext xmesa = (XMesaContext) ctx->DriverCtx; \
+ XMesaImage *img = xmesa->xm_buffer->backimage;
#define RENDER_SPAN( span ) \
GLint x = span.x, y = FLIP(xmesa->xm_buffer, span.y); \
}
#include "swrast/s_tritemp.h"
-}
+
/*
* XImage, smooth, depth-buffered, PF_8A8B8G8R triangle.
*/
-static void smooth_8A8B8G8R_z_triangle( GLcontext *ctx,
- const SWvertex *v0,
- const SWvertex *v1,
- const SWvertex *v2 )
-{
- XMesaContext xmesa = (XMesaContext) ctx->DriverCtx;
+#define NAME smooth_8A8B8G8R_z_triangle
#define INTERP_Z 1
#define DEPTH_TYPE DEFAULT_SOFTWARE_DEPTH_TYPE
#define INTERP_RGB 1
#define PIXEL_ADDRESS(X,Y) PIXELADDR4(xmesa->xm_buffer,X,Y)
#define PIXEL_TYPE GLuint
#define BYTES_PER_ROW (xmesa->xm_buffer->backimage->bytes_per_line)
+#define SETUP_CODE \
+ XMesaContext xmesa = (XMesaContext) ctx->DriverCtx;
#define RENDER_SPAN( span ) \
GLuint i; \
}
#include "swrast/s_tritemp.h"
-}
+
/*
* XImage, smooth, depth-buffered, PF_8R8G8B triangle.
*/
-static void smooth_8R8G8B_z_triangle( GLcontext *ctx,
- const SWvertex *v0,
- const SWvertex *v1,
- const SWvertex *v2 )
-{
- XMesaContext xmesa = (XMesaContext) ctx->DriverCtx;
+#define NAME smooth_8R8G8B_z_triangle
#define INTERP_Z 1
#define DEPTH_TYPE DEFAULT_SOFTWARE_DEPTH_TYPE
#define INTERP_RGB 1
#define PIXEL_ADDRESS(X,Y) PIXELADDR4(xmesa->xm_buffer,X,Y)
#define PIXEL_TYPE GLuint
#define BYTES_PER_ROW (xmesa->xm_buffer->backimage->bytes_per_line)
+#define SETUP_CODE \
+ XMesaContext xmesa = (XMesaContext) ctx->DriverCtx;
#define RENDER_SPAN( span ) \
GLuint i; \
}
#include "swrast/s_tritemp.h"
-}
+
/*
* XImage, smooth, depth-buffered, PF_8R8G8B24 triangle.
*/
-static void smooth_8R8G8B24_z_triangle( GLcontext *ctx,
- const SWvertex *v0,
- const SWvertex *v1,
- const SWvertex *v2 )
-{
- XMesaContext xmesa = (XMesaContext) ctx->DriverCtx;
+#define NAME smooth_8R8G8B24_z_triangle
#define INTERP_Z 1
#define DEPTH_TYPE DEFAULT_SOFTWARE_DEPTH_TYPE
#define INTERP_RGB 1
#define PIXEL_ADDRESS(X,Y) PIXELADDR3(xmesa->xm_buffer,X,Y)
#define PIXEL_TYPE bgr_t
#define BYTES_PER_ROW (xmesa->xm_buffer->backimage->bytes_per_line)
-
+#define SETUP_CODE \
+ XMesaContext xmesa = (XMesaContext) ctx->DriverCtx;
#define RENDER_SPAN( span ) \
GLuint i; \
for (i = 0; i < span.end; i++) { \
span.blue += span.blueStep; \
span.z += span.zStep; \
}
-
#include "swrast/s_tritemp.h"
-}
+
/*
* XImage, smooth, depth-buffered, PF_TRUEDITHER triangle.
*/
-static void smooth_TRUEDITHER_z_triangle( GLcontext *ctx,
- const SWvertex *v0,
- const SWvertex *v1,
- const SWvertex *v2 )
-{
- XMesaContext xmesa = (XMesaContext) ctx->DriverCtx;
- XMesaImage *img = xmesa->xm_buffer->backimage;
+#define NAME smooth_TRUEDITHER_z_triangle
#define INTERP_Z 1
#define DEPTH_TYPE DEFAULT_SOFTWARE_DEPTH_TYPE
#define INTERP_RGB 1
-
+#define SETUP_CODE \
+ XMesaContext xmesa = (XMesaContext) ctx->DriverCtx; \
+ XMesaImage *img = xmesa->xm_buffer->backimage;
#define RENDER_SPAN( span ) \
GLuint i; \
GLint x = span.x, y = FLIP(xmesa->xm_buffer, span.y); \
span.blue += span.blueStep; \
span.z += span.zStep; \
}
-
#include "swrast/s_tritemp.h"
-}
+
/*
* XImage, smooth, depth-buffered, PF_5R6G5B triangle.
*/
-static void smooth_5R6G5B_z_triangle( GLcontext *ctx,
- const SWvertex *v0,
- const SWvertex *v1,
- const SWvertex *v2 )
-{
- XMesaContext xmesa = (XMesaContext) ctx->DriverCtx;
+#define NAME smooth_5R6G5B_z_triangle
#define INTERP_Z 1
#define DEPTH_TYPE DEFAULT_SOFTWARE_DEPTH_TYPE
#define INTERP_RGB 1
#define PIXEL_ADDRESS(X,Y) PIXELADDR2(xmesa->xm_buffer,X,Y)
#define PIXEL_TYPE GLushort
#define BYTES_PER_ROW (xmesa->xm_buffer->backimage->bytes_per_line)
-
+#define SETUP_CODE \
+ XMesaContext xmesa = (XMesaContext) ctx->DriverCtx;
#define RENDER_SPAN( span ) \
GLuint i; \
for (i = 0; i < span.end; i++) { \
span.blue += span.blueStep; \
span.z += span.zStep; \
}
-
#include "swrast/s_tritemp.h"
-}
+
/*
* XImage, smooth, depth-buffered, PF_DITHER_5R6G5B triangle.
*/
-static void smooth_DITHER_5R6G5B_z_triangle( GLcontext *ctx,
- const SWvertex *v0,
- const SWvertex *v1,
- const SWvertex *v2 )
-{
- XMesaContext xmesa = (XMesaContext) ctx->DriverCtx;
+#define NAME smooth_DITHER_5R6G5B_z_triangle
#define INTERP_Z 1
#define DEPTH_TYPE DEFAULT_SOFTWARE_DEPTH_TYPE
#define INTERP_RGB 1
#define PIXEL_ADDRESS(X,Y) PIXELADDR2(xmesa->xm_buffer,X,Y)
#define PIXEL_TYPE GLushort
#define BYTES_PER_ROW (xmesa->xm_buffer->backimage->bytes_per_line)
-
+#define SETUP_CODE \
+ XMesaContext xmesa = (XMesaContext) ctx->DriverCtx;
#define RENDER_SPAN( span ) \
GLuint i; \
GLint x = span.x, y = FLIP(xmesa->xm_buffer, span.y); \
span.blue += span.blueStep; \
span.z += span.zStep; \
}
-
#include "swrast/s_tritemp.h"
-}
+
/*
* XImage, smooth, depth-buffered, 8-bit, PF_DITHER8 triangle.
*/
-static void smooth_DITHER8_z_triangle( GLcontext *ctx,
- const SWvertex *v0,
- const SWvertex *v1,
- const SWvertex *v2 )
-{
- XMesaContext xmesa = (XMesaContext) ctx->DriverCtx;
+#define NAME smooth_DITHER8_z_triangle
#define INTERP_Z 1
#define DEPTH_TYPE DEFAULT_SOFTWARE_DEPTH_TYPE
#define INTERP_RGB 1
#define PIXEL_ADDRESS(X,Y) PIXELADDR1(xmesa->xm_buffer,X,Y)
#define PIXEL_TYPE GLubyte
#define BYTES_PER_ROW (xmesa->xm_buffer->backimage->bytes_per_line)
-
+#define SETUP_CODE \
+ XMesaContext xmesa = (XMesaContext) ctx->DriverCtx;
#define RENDER_SPAN( span ) \
GLuint i; \
GLint x = span.x, y = FLIP(xmesa->xm_buffer, span.y); \
span.blue += span.blueStep; \
span.z += span.zStep; \
}
-
#include "swrast/s_tritemp.h"
-}
+
/*
* XImage, smooth, depth-buffered, PF_DITHER triangle.
*/
-static void smooth_DITHER_z_triangle( GLcontext *ctx,
- const SWvertex *v0,
- const SWvertex *v1,
- const SWvertex *v2 )
-{
- XMesaContext xmesa = (XMesaContext) ctx->DriverCtx;
- XMesaImage *img = xmesa->xm_buffer->backimage;
+#define NAME smooth_DITHER_z_triangle
#define INTERP_Z 1
#define DEPTH_TYPE DEFAULT_SOFTWARE_DEPTH_TYPE
#define INTERP_RGB 1
-
+#define SETUP_CODE \
+ XMesaContext xmesa = (XMesaContext) ctx->DriverCtx; \
+ XMesaImage *img = xmesa->xm_buffer->backimage;
#define RENDER_SPAN( span ) \
GLuint i; \
GLint x = span.x, y = FLIP(xmesa->xm_buffer, span.y); \
span.blue += span.blueStep; \
span.z += span.zStep; \
}
-
#include "swrast/s_tritemp.h"
-}
+
/*
* XImage, smooth, depth-buffered, 8-bit PF_LOOKUP triangle.
*/
-static void smooth_LOOKUP8_z_triangle( GLcontext *ctx,
- const SWvertex *v0,
- const SWvertex *v1,
- const SWvertex *v2 )
-{
- XMesaContext xmesa = (XMesaContext) ctx->DriverCtx;
+#define NAME smooth_LOOKUP8_z_triangle
#define INTERP_Z 1
#define DEPTH_TYPE DEFAULT_SOFTWARE_DEPTH_TYPE
#define INTERP_RGB 1
#define PIXEL_ADDRESS(X,Y) PIXELADDR1(xmesa->xm_buffer,X,Y)
#define PIXEL_TYPE GLubyte
#define BYTES_PER_ROW (xmesa->xm_buffer->backimage->bytes_per_line)
-
+#define SETUP_CODE \
+ XMesaContext xmesa = (XMesaContext) ctx->DriverCtx;
#define RENDER_SPAN( span ) \
GLuint i; \
LOOKUP_SETUP; \
span.blue += span.blueStep; \
span.z += span.zStep; \
}
-
#include "swrast/s_tritemp.h"
-}
/*
* XImage, smooth, depth-buffered, 8-bit PF_HPCR triangle.
*/
-static void smooth_HPCR_z_triangle( GLcontext *ctx,
- const SWvertex *v0,
- const SWvertex *v1,
- const SWvertex *v2 )
-{
- XMesaContext xmesa = (XMesaContext) ctx->DriverCtx;
+#define NAME smooth_HPCR_z_triangle
#define INTERP_Z 1
#define DEPTH_TYPE DEFAULT_SOFTWARE_DEPTH_TYPE
#define INTERP_RGB 1
#define PIXEL_ADDRESS(X,Y) PIXELADDR1(xmesa->xm_buffer,X,Y)
#define PIXEL_TYPE GLubyte
#define BYTES_PER_ROW (xmesa->xm_buffer->backimage->bytes_per_line)
-
+#define SETUP_CODE \
+ XMesaContext xmesa = (XMesaContext) ctx->DriverCtx;
#define RENDER_SPAN( span ) \
GLuint i; \
GLint x = span.x, y = FLIP(xmesa->xm_buffer, span.y); \
span.blue += span.blueStep; \
span.z += span.zStep; \
}
-
#include "swrast/s_tritemp.h"
-}
+
/*
* XImage, flat, depth-buffered, PF_TRUECOLOR triangle.
*/
-static void flat_TRUECOLOR_z_triangle( GLcontext *ctx,
- const SWvertex *v0,
- const SWvertex *v1,
- const SWvertex *v2 )
-{
- XMesaContext xmesa = (XMesaContext) ctx->DriverCtx;
- XMesaImage *img = xmesa->xm_buffer->backimage;
+#define NAME flat_TRUECOLOR_z_triangle
#define INTERP_Z 1
#define DEPTH_TYPE DEFAULT_SOFTWARE_DEPTH_TYPE
#define SETUP_CODE \
+ XMesaContext xmesa = (XMesaContext) ctx->DriverCtx; \
+ XMesaImage *img = xmesa->xm_buffer->backimage; \
unsigned long pixel; \
PACK_TRUECOLOR(pixel, v2->color[0], v2->color[1], v2->color[2]);
-
#define RENDER_SPAN( span ) \
GLuint i; \
GLint x = span.x, y = FLIP(xmesa->xm_buffer, span.y); \
} \
span.z += span.zStep; \
}
-
#include "swrast/s_tritemp.h"
-}
+
/*
* XImage, flat, depth-buffered, PF_8A8B8G8R triangle.
*/
-static void flat_8A8B8G8R_z_triangle( GLcontext *ctx,
- const SWvertex *v0,
- const SWvertex *v1,
- const SWvertex *v2 )
-{
- XMesaContext xmesa = (XMesaContext) ctx->DriverCtx;
+#define NAME flat_8A8B8G8R_z_triangle
#define INTERP_Z 1
#define DEPTH_TYPE DEFAULT_SOFTWARE_DEPTH_TYPE
#define PIXEL_ADDRESS(X,Y) PIXELADDR4(xmesa->xm_buffer,X,Y)
#define PIXEL_TYPE GLuint
#define BYTES_PER_ROW (xmesa->xm_buffer->backimage->bytes_per_line)
#define SETUP_CODE \
- unsigned long p = PACK_8B8G8R( v2->color[0], \
+ XMesaContext xmesa = (XMesaContext) ctx->DriverCtx; \
+ unsigned long p = PACK_8B8G8R( v2->color[0], \
v2->color[1], v2->color[2] );
#define RENDER_SPAN( span ) \
GLuint i; \
} \
span.z += span.zStep; \
}
-
#include "swrast/s_tritemp.h"
-}
+
/*
* XImage, flat, depth-buffered, PF_8R8G8B triangle.
*/
-static void flat_8R8G8B_z_triangle( GLcontext *ctx,
- const SWvertex *v0,
- const SWvertex *v1,
- const SWvertex *v2 )
-{
- XMesaContext xmesa = (XMesaContext) ctx->DriverCtx;
+#define NAME flat_8R8G8B_z_triangle
#define INTERP_Z 1
#define DEPTH_TYPE DEFAULT_SOFTWARE_DEPTH_TYPE
#define PIXEL_ADDRESS(X,Y) PIXELADDR4(xmesa->xm_buffer,X,Y)
#define PIXEL_TYPE GLuint
#define BYTES_PER_ROW (xmesa->xm_buffer->backimage->bytes_per_line)
-#define SETUP_CODE \
- unsigned long p = PACK_8R8G8B( v2->color[0], \
+#define SETUP_CODE \
+ XMesaContext xmesa = (XMesaContext) ctx->DriverCtx; \
+ unsigned long p = PACK_8R8G8B( v2->color[0], \
v2->color[1], v2->color[2] );
#define RENDER_SPAN( span ) \
GLuint i; \
} \
span.z += span.zStep; \
}
-
#include "swrast/s_tritemp.h"
-}
+
/*
* XImage, flat, depth-buffered, PF_8R8G8B24 triangle.
*/
-static void flat_8R8G8B24_z_triangle( GLcontext *ctx,
- const SWvertex *v0,
- const SWvertex *v1,
- const SWvertex *v2 )
-{
- XMesaContext xmesa = (XMesaContext) ctx->DriverCtx;
- const GLubyte *color = v2->color;
+#define NAME flat_8R8G8B24_z_triangle
#define INTERP_Z 1
#define DEPTH_TYPE DEFAULT_SOFTWARE_DEPTH_TYPE
#define PIXEL_ADDRESS(X,Y) PIXELADDR3(xmesa->xm_buffer,X,Y)
#define PIXEL_TYPE bgr_t
#define BYTES_PER_ROW (xmesa->xm_buffer->backimage->bytes_per_line)
+#define SETUP_CODE \
+ XMesaContext xmesa = (XMesaContext) ctx->DriverCtx; \
+ const GLubyte *color = v2->color;
#define RENDER_SPAN( span ) \
GLuint i; \
for (i = 0; i < span.end; i++) { \
} \
span.z += span.zStep; \
}
-
#include "swrast/s_tritemp.h"
-}
+
/*
* XImage, flat, depth-buffered, PF_TRUEDITHER triangle.
*/
-static void flat_TRUEDITHER_z_triangle( GLcontext *ctx,
- const SWvertex *v0,
- const SWvertex *v1,
- const SWvertex *v2 )
-{
- XMesaContext xmesa = (XMesaContext) ctx->DriverCtx;
- XMesaImage *img = xmesa->xm_buffer->backimage;
+#define NAME flat_TRUEDITHER_z_triangle
#define INTERP_Z 1
#define DEPTH_TYPE DEFAULT_SOFTWARE_DEPTH_TYPE
+#define SETUP_CODE \
+ XMesaContext xmesa = (XMesaContext) ctx->DriverCtx; \
+ XMesaImage *img = xmesa->xm_buffer->backimage;
#define RENDER_SPAN( span ) \
GLuint i; \
GLint x = span.x, y = FLIP(xmesa->xm_buffer, span.y); \
} \
span.z += span.zStep; \
}
-
#include "swrast/s_tritemp.h"
-}
+
/*
* XImage, flat, depth-buffered, PF_5R6G5B triangle.
*/
-static void flat_5R6G5B_z_triangle( GLcontext *ctx,
- const SWvertex *v0,
- const SWvertex *v1,
- const SWvertex *v2 )
-{
- XMesaContext xmesa = (XMesaContext) ctx->DriverCtx;
+#define NAME flat_5R6G5B_z_triangle
#define INTERP_Z 1
#define DEPTH_TYPE DEFAULT_SOFTWARE_DEPTH_TYPE
#define PIXEL_ADDRESS(X,Y) PIXELADDR2(xmesa->xm_buffer,X,Y)
#define PIXEL_TYPE GLushort
#define BYTES_PER_ROW (xmesa->xm_buffer->backimage->bytes_per_line)
#define SETUP_CODE \
+ XMesaContext xmesa = (XMesaContext) ctx->DriverCtx; \
unsigned long p = PACK_5R6G5B( v2->color[0], \
v2->color[1], v2->color[2] );
#define RENDER_SPAN( span ) \
} \
span.z += span.zStep; \
}
-
#include "swrast/s_tritemp.h"
-}
+
/*
* XImage, flat, depth-buffered, PF_DITHER_5R6G5B triangle.
*/
-static void flat_DITHER_5R6G5B_z_triangle( GLcontext *ctx,
- const SWvertex *v0,
- const SWvertex *v1,
- const SWvertex *v2 )
-{
- XMesaContext xmesa = (XMesaContext) ctx->DriverCtx;
- const GLubyte *color = v2->color;
+#define NAME flat_DITHER_5R6G5B_z_triangle
#define INTERP_Z 1
#define DEPTH_TYPE DEFAULT_SOFTWARE_DEPTH_TYPE
#define PIXEL_ADDRESS(X,Y) PIXELADDR2(xmesa->xm_buffer,X,Y)
#define PIXEL_TYPE GLushort
#define BYTES_PER_ROW (xmesa->xm_buffer->backimage->bytes_per_line)
+#define SETUP_CODE \
+ XMesaContext xmesa = (XMesaContext) ctx->DriverCtx; \
+ const GLubyte *color = v2->color;
#define RENDER_SPAN( span ) \
GLuint i; \
GLint x = span.x, y = FLIP(xmesa->xm_buffer, span.y); \
} \
span.z += span.zStep; \
}
-
#include "swrast/s_tritemp.h"
-}
+
/*
* XImage, flat, depth-buffered, 8-bit PF_DITHER triangle.
*/
-static void flat_DITHER8_z_triangle( GLcontext *ctx,
- const SWvertex *v0,
- const SWvertex *v1,
- const SWvertex *v2 )
-{
- XMesaContext xmesa = (XMesaContext) ctx->DriverCtx;
+#define NAME flat_DITHER8_z_triangle
#define INTERP_Z 1
#define DEPTH_TYPE DEFAULT_SOFTWARE_DEPTH_TYPE
#define PIXEL_ADDRESS(X,Y) PIXELADDR1(xmesa->xm_buffer,X,Y)
#define PIXEL_TYPE GLubyte
#define BYTES_PER_ROW (xmesa->xm_buffer->backimage->bytes_per_line)
-#define SETUP_CODE \
+#define SETUP_CODE \
+ XMesaContext xmesa = (XMesaContext) ctx->DriverCtx; \
FLAT_DITHER_SETUP( v2->color[0], v2->color[1], v2->color[2] );
-
#define RENDER_SPAN( span ) \
GLuint i; \
GLint x = span.x, y = FLIP(xmesa->xm_buffer, span.y); \
} \
span.z += span.zStep; \
}
-
#include "swrast/s_tritemp.h"
-}
+
/*
* XImage, flat, depth-buffered, PF_DITHER triangle.
*/
-static void flat_DITHER_z_triangle( GLcontext *ctx,
- const SWvertex *v0,
- const SWvertex *v1,
- const SWvertex *v2 )
-{
- XMesaContext xmesa = (XMesaContext) ctx->DriverCtx;
- XMesaImage *img = xmesa->xm_buffer->backimage;
+#define NAME flat_DITHER_z_triangle
#define INTERP_Z 1
#define DEPTH_TYPE DEFAULT_SOFTWARE_DEPTH_TYPE
-#define SETUP_CODE \
+#define SETUP_CODE \
+ XMesaContext xmesa = (XMesaContext) ctx->DriverCtx; \
+ XMesaImage *img = xmesa->xm_buffer->backimage; \
FLAT_DITHER_SETUP( v2->color[0], v2->color[1], v2->color[2] );
-
#define RENDER_SPAN( span ) \
GLuint i; \
GLint x = span.x, y = FLIP(xmesa->xm_buffer, span.y); \
} \
span.z += span.zStep; \
}
-
#include "swrast/s_tritemp.h"
-}
+
/*
* XImage, flat, depth-buffered, 8-bit PF_HPCR triangle.
*/
-static void flat_HPCR_z_triangle( GLcontext *ctx,
- const SWvertex *v0,
- const SWvertex *v1,
- const SWvertex *v2 )
-{
- XMesaContext xmesa = (XMesaContext) ctx->DriverCtx;
+#define NAME flat_HPCR_z_triangle
#define INTERP_Z 1
#define DEPTH_TYPE DEFAULT_SOFTWARE_DEPTH_TYPE
#define PIXEL_ADDRESS(X,Y) PIXELADDR1(xmesa->xm_buffer,X,Y)
#define PIXEL_TYPE GLubyte
#define BYTES_PER_ROW (xmesa->xm_buffer->backimage->bytes_per_line)
-#define SETUP_CODE \
- GLubyte r = v2->color[0]; \
- GLubyte g = v2->color[1]; \
+#define SETUP_CODE \
+ XMesaContext xmesa = (XMesaContext) ctx->DriverCtx; \
+ GLubyte r = v2->color[0]; \
+ GLubyte g = v2->color[1]; \
GLubyte b = v2->color[2];
#define RENDER_SPAN( span ) \
GLuint i; \
} \
span.z += span.zStep; \
}
-
#include "swrast/s_tritemp.h"
-}
+
/*
* XImage, flat, depth-buffered, 8-bit PF_LOOKUP triangle.
*/
-static void flat_LOOKUP8_z_triangle( GLcontext *ctx,
- const SWvertex *v0,
- const SWvertex *v1,
- const SWvertex *v2 )
-{
- XMesaContext xmesa = (XMesaContext) ctx->DriverCtx;
+#define NAME flat_LOOKUP8_z_triangle
#define INTERP_Z 1
#define DEPTH_TYPE DEFAULT_SOFTWARE_DEPTH_TYPE
#define PIXEL_ADDRESS(X,Y) PIXELADDR1(xmesa->xm_buffer,X,Y)
#define PIXEL_TYPE GLubyte
#define BYTES_PER_ROW (xmesa->xm_buffer->backimage->bytes_per_line)
-#define SETUP_CODE \
- LOOKUP_SETUP; \
- GLubyte r = v2->color[0]; \
- GLubyte g = v2->color[1]; \
- GLubyte b = v2->color[2]; \
+#define SETUP_CODE \
+ XMesaContext xmesa = (XMesaContext) ctx->DriverCtx; \
+ LOOKUP_SETUP; \
+ GLubyte r = v2->color[0]; \
+ GLubyte g = v2->color[1]; \
+ GLubyte b = v2->color[2]; \
GLubyte p = LOOKUP(r,g,b);
#define RENDER_SPAN( span ) \
GLuint i; \
} \
span.z += span.zStep; \
}
-
#include "swrast/s_tritemp.h"
-}
/*
* XImage, smooth, NON-depth-buffered, PF_TRUECOLOR triangle.
*/
-static void smooth_TRUECOLOR_triangle( GLcontext *ctx,
- const SWvertex *v0,
- const SWvertex *v1,
- const SWvertex *v2 )
-{
- XMesaContext xmesa = (XMesaContext) ctx->DriverCtx;
- XMesaImage *img = xmesa->xm_buffer->backimage;
+#define NAME smooth_TRUECOLOR_triangle
#define INTERP_RGB 1
+#define SETUP_CODE \
+ XMesaContext xmesa = (XMesaContext) ctx->DriverCtx; \
+ XMesaImage *img = xmesa->xm_buffer->backimage;
#define RENDER_SPAN( span ) \
GLuint i; \
GLint x = span.x, y = FLIP(xmesa->xm_buffer, span.y); \
PACK_TRUECOLOR(p, FixedToInt(span.red), \
FixedToInt(span.green), FixedToInt(span.blue)); \
XMesaPutPixel(img, x, y, p); \
- span.red += span.redStep; \
+ span.red += span.redStep; \
span.green += span.greenStep; \
span.blue += span.blueStep; \
}
-
#include "swrast/s_tritemp.h"
-}
+
/*
* XImage, smooth, NON-depth-buffered, PF_8A8B8G8R triangle.
*/
-static void smooth_8A8B8G8R_triangle( GLcontext *ctx,
- const SWvertex *v0,
- const SWvertex *v1,
- const SWvertex *v2 )
-{
- XMesaContext xmesa = (XMesaContext) ctx->DriverCtx;
+#define NAME smooth_8A8B8G8R_triangle
#define INTERP_RGB 1
#define PIXEL_ADDRESS(X,Y) PIXELADDR4(xmesa->xm_buffer,X,Y)
#define PIXEL_TYPE GLuint
#define BYTES_PER_ROW (xmesa->xm_buffer->backimage->bytes_per_line)
+#define SETUP_CODE \
+ XMesaContext xmesa = (XMesaContext) ctx->DriverCtx;
#define RENDER_SPAN( span ) \
GLuint i; \
for (i = 0; i < span.end; i++) { \
pRow[i] = PACK_8B8G8R(FixedToInt(span.red), \
FixedToInt(span.green), FixedToInt(span.blue) ); \
- span.red += span.redStep; \
+ span.red += span.redStep; \
span.green += span.greenStep; \
span.blue += span.blueStep; \
- } \
-
+ }
#include "swrast/s_tritemp.h"
-}
+
/*
* XImage, smooth, NON-depth-buffered, PF_8R8G8B triangle.
*/
-static void smooth_8R8G8B_triangle( GLcontext *ctx,
- const SWvertex *v0,
- const SWvertex *v1,
- const SWvertex *v2 )
-{
- XMesaContext xmesa = (XMesaContext) ctx->DriverCtx;
+#define NAME smooth_8R8G8B_triangle
#define INTERP_RGB 1
#define PIXEL_ADDRESS(X,Y) PIXELADDR4(xmesa->xm_buffer,X,Y)
#define PIXEL_TYPE GLuint
#define BYTES_PER_ROW (xmesa->xm_buffer->backimage->bytes_per_line)
+#define SETUP_CODE \
+ XMesaContext xmesa = (XMesaContext) ctx->DriverCtx;
#define RENDER_SPAN( span ) \
GLuint i; \
for (i = 0; i < span.end; i++) { \
pRow[i] = PACK_8R8G8B(FixedToInt(span.red), \
FixedToInt(span.green), FixedToInt(span.blue) ); \
- span.red += span.redStep; \
+ span.red += span.redStep; \
span.green += span.greenStep; \
span.blue += span.blueStep; \
}
-
#include "swrast/s_tritemp.h"
-}
+
/*
* XImage, smooth, NON-depth-buffered, PF_8R8G8B triangle.
*/
-static void smooth_8R8G8B24_triangle( GLcontext *ctx,
- const SWvertex *v0,
- const SWvertex *v1,
- const SWvertex *v2 )
-{
- XMesaContext xmesa = (XMesaContext) ctx->DriverCtx;
+#define NAME smooth_8R8G8B24_triangle
#define INTERP_RGB 1
#define PIXEL_ADDRESS(X,Y) PIXELADDR3(xmesa->xm_buffer,X,Y)
#define PIXEL_TYPE bgr_t
#define BYTES_PER_ROW (xmesa->xm_buffer->backimage->bytes_per_line)
+#define SETUP_CODE \
+ XMesaContext xmesa = (XMesaContext) ctx->DriverCtx;
#define RENDER_SPAN( span ) \
GLuint i; \
PIXEL_TYPE *pixel = pRow; \
for (i = 0; i < span.end; i++, pixel++) { \
pixel->r = FixedToInt(span.red); \
pixel->g = FixedToInt(span.green); \
- pixel->b = FixedToInt(span.blue); \
- span.red += span.redStep; \
+ pixel->b = FixedToInt(span.blue); \
+ span.red += span.redStep; \
span.green += span.greenStep; \
span.blue += span.blueStep; \
}
-
#include "swrast/s_tritemp.h"
-}
+
/*
* XImage, smooth, NON-depth-buffered, PF_TRUEDITHER triangle.
*/
-static void smooth_TRUEDITHER_triangle( GLcontext *ctx,
- const SWvertex *v0,
- const SWvertex *v1,
- const SWvertex *v2 )
-{
- XMesaContext xmesa = (XMesaContext) ctx->DriverCtx;
- XMesaImage *img = xmesa->xm_buffer->backimage;
+#define NAME smooth_TRUEDITHER_triangle
#define INTERP_RGB 1
+#define SETUP_CODE \
+ XMesaContext xmesa = (XMesaContext) ctx->DriverCtx; \
+ XMesaImage *img = xmesa->xm_buffer->backimage;
#define RENDER_SPAN( span ) \
GLuint i; \
GLint x = span.x, y = FLIP(xmesa->xm_buffer, span.y); \
PACK_TRUEDITHER(p, x, y, FixedToInt(span.red), \
FixedToInt(span.green), FixedToInt(span.blue)); \
XMesaPutPixel(img, x, y, p ); \
- span.red += span.redStep; \
+ span.red += span.redStep; \
span.green += span.greenStep; \
span.blue += span.blueStep; \
}
-
#include "swrast/s_tritemp.h"
-}
+
/*
* XImage, smooth, NON-depth-buffered, PF_5R6G5B triangle.
*/
-static void smooth_5R6G5B_triangle( GLcontext *ctx,
- const SWvertex *v0,
- const SWvertex *v1,
- const SWvertex *v2 )
-{
- XMesaContext xmesa = (XMesaContext) ctx->DriverCtx;
+#define NAME smooth_5R6G5B_triangle
#define INTERP_RGB 1
#define PIXEL_ADDRESS(X,Y) PIXELADDR2(xmesa->xm_buffer,X,Y)
#define PIXEL_TYPE GLushort
#define BYTES_PER_ROW (xmesa->xm_buffer->backimage->bytes_per_line)
+#define SETUP_CODE \
+ XMesaContext xmesa = (XMesaContext) ctx->DriverCtx;
#define RENDER_SPAN( span ) \
GLuint i; \
for (i = 0; i < span.end; i++) { \
pRow[i] = (PIXEL_TYPE) PACK_5R6G5B(FixedToInt(span.red), \
FixedToInt(span.green), FixedToInt(span.blue)); \
- span.red += span.redStep; \
+ span.red += span.redStep; \
span.green += span.greenStep; \
span.blue += span.blueStep; \
}
-
#include "swrast/s_tritemp.h"
-}
+
/*
* XImage, smooth, NON-depth-buffered, PF_DITHER_5R6G5B triangle.
*/
-static void smooth_DITHER_5R6G5B_triangle( GLcontext *ctx,
- const SWvertex *v0,
- const SWvertex *v1,
- const SWvertex *v2 )
-{
- XMesaContext xmesa = (XMesaContext) ctx->DriverCtx;
+#define NAME smooth_DITHER_5R6G5B_triangle
#define INTERP_RGB 1
#define PIXEL_ADDRESS(X,Y) PIXELADDR2(xmesa->xm_buffer,X,Y)
#define PIXEL_TYPE GLushort
#define BYTES_PER_ROW (xmesa->xm_buffer->backimage->bytes_per_line)
+#define SETUP_CODE \
+ XMesaContext xmesa = (XMesaContext) ctx->DriverCtx;
#define RENDER_SPAN( span ) \
GLuint i; \
GLint x = span.x, y = FLIP(xmesa->xm_buffer, span.y); \
for (i = 0; i < span.end; i++, x++) { \
PACK_TRUEDITHER(pRow[i], x, y, FixedToInt(span.red), \
FixedToInt(span.green), FixedToInt(span.blue)); \
- span.red += span.redStep; \
+ span.red += span.redStep; \
span.green += span.greenStep; \
span.blue += span.blueStep; \
}
-
#include "swrast/s_tritemp.h"
-}
+
/*
* XImage, smooth, NON-depth-buffered, 8-bit PF_DITHER triangle.
*/
-static void smooth_DITHER8_triangle( GLcontext *ctx,
- const SWvertex *v0,
- const SWvertex *v1,
- const SWvertex *v2 )
-{
- XMesaContext xmesa = (XMesaContext) ctx->DriverCtx;
+#define NAME smooth_DITHER8_triangle
#define INTERP_RGB 1
#define PIXEL_ADDRESS(X,Y) PIXELADDR1(xmesa->xm_buffer,X,Y)
#define PIXEL_TYPE GLubyte
#define BYTES_PER_ROW (xmesa->xm_buffer->backimage->bytes_per_line)
+#define SETUP_CODE \
+ XMesaContext xmesa = (XMesaContext) ctx->DriverCtx;
#define RENDER_SPAN( span ) \
GLuint i; \
GLint x = span.x, y = FLIP(xmesa->xm_buffer, span.y); \
for (i = 0; i < span.end; i++, x++) { \
pRow[i] = (PIXEL_TYPE) XDITHER(x, FixedToInt(span.red), \
FixedToInt(span.green), FixedToInt(span.blue) ); \
- span.red += span.redStep; \
+ span.red += span.redStep; \
span.green += span.greenStep; \
span.blue += span.blueStep; \
}
-
#include "swrast/s_tritemp.h"
-}
+
/*
* XImage, smooth, NON-depth-buffered, PF_DITHER triangle.
*/
-static void smooth_DITHER_triangle( GLcontext *ctx,
- const SWvertex *v0,
- const SWvertex *v1,
- const SWvertex *v2 )
-{
- XMesaContext xmesa = (XMesaContext) ctx->DriverCtx;
- XMesaImage *img = xmesa->xm_buffer->backimage;
+#define NAME smooth_DITHER_triangle
#define INTERP_RGB 1
+#define SETUP_CODE \
+ XMesaContext xmesa = (XMesaContext) ctx->DriverCtx; \
+ XMesaImage *img = xmesa->xm_buffer->backimage;
#define RENDER_SPAN( span ) \
GLuint i; \
GLint x = span.x, y = FLIP(xmesa->xm_buffer, span.y); \
unsigned long p = XDITHER(x, FixedToInt(span.red), \
FixedToInt(span.green), FixedToInt(span.blue) ); \
XMesaPutPixel(img, x, y, p); \
- span.red += span.redStep; \
+ span.red += span.redStep; \
span.green += span.greenStep; \
span.blue += span.blueStep; \
}
-
#include "swrast/s_tritemp.h"
-}
+
/*
* XImage, smooth, NON-depth-buffered, 8-bit PF_LOOKUP triangle.
*/
-static void smooth_LOOKUP8_triangle( GLcontext *ctx,
- const SWvertex *v0,
- const SWvertex *v1,
- const SWvertex *v2 )
-{
- XMesaContext xmesa = (XMesaContext) ctx->DriverCtx;
+#define NAME smooth_LOOKUP8_triangle
#define INTERP_RGB 1
#define PIXEL_ADDRESS(X,Y) PIXELADDR1(xmesa->xm_buffer,X,Y)
#define PIXEL_TYPE GLubyte
#define BYTES_PER_ROW (xmesa->xm_buffer->backimage->bytes_per_line)
-#define RENDER_SPAN( span ) \
- GLuint i; \
- LOOKUP_SETUP; \
- for (i = 0; i < span.end; i++) { \
- pRow[i] = LOOKUP(FixedToInt(span.red), \
- FixedToInt(span.green), FixedToInt(span.blue));\
- span.red += span.redStep; \
- span.green += span.greenStep; \
- span.blue += span.blueStep; \
+#define SETUP_CODE \
+ XMesaContext xmesa = (XMesaContext) ctx->DriverCtx;
+#define RENDER_SPAN( span ) \
+ GLuint i; \
+ LOOKUP_SETUP; \
+ for (i = 0; i < span.end; i++) { \
+ pRow[i] = LOOKUP(FixedToInt(span.red), \
+ FixedToInt(span.green), FixedToInt(span.blue)); \
+ span.red += span.redStep; \
+ span.green += span.greenStep; \
+ span.blue += span.blueStep; \
}
-
#include "swrast/s_tritemp.h"
-}
/*
* XImage, smooth, NON-depth-buffered, 8-bit PF_HPCR triangle.
*/
-static void smooth_HPCR_triangle( GLcontext *ctx,
- const SWvertex *v0,
- const SWvertex *v1,
- const SWvertex *v2 )
-{
- XMesaContext xmesa = (XMesaContext) ctx->DriverCtx;
+#define NAME smooth_HPCR_triangle
#define INTERP_RGB 1
#define PIXEL_ADDRESS(X,Y) PIXELADDR1(xmesa->xm_buffer,X,Y)
#define PIXEL_TYPE GLubyte
#define BYTES_PER_ROW (xmesa->xm_buffer->backimage->bytes_per_line)
+#define SETUP_CODE \
+ XMesaContext xmesa = (XMesaContext) ctx->DriverCtx;
#define RENDER_SPAN( span ) \
GLuint i; \
GLint x = span.x, y = FLIP(xmesa->xm_buffer, span.y); \
for (i = 0; i < span.end; i++, x++) { \
- pRow[i] = DITHER_HPCR(x, y, FixedToInt(span.red), \
+ pRow[i] = DITHER_HPCR(x, y, FixedToInt(span.red), \
FixedToInt(span.green), FixedToInt(span.blue)); \
- span.red += span.redStep; \
+ span.red += span.redStep; \
span.green += span.greenStep; \
span.blue += span.blueStep; \
}
-
#include "swrast/s_tritemp.h"
-}
+
/*
* XImage, flat, NON-depth-buffered, PF_TRUECOLOR triangle.
*/
-static void flat_TRUECOLOR_triangle( GLcontext *ctx,
- const SWvertex *v0,
- const SWvertex *v1,
- const SWvertex *v2 )
-{
- XMesaContext xmesa = (XMesaContext) ctx->DriverCtx;
- XMesaImage *img = xmesa->xm_buffer->backimage;
+#define NAME flat_TRUECOLOR_triangle
#define SETUP_CODE \
+ XMesaContext xmesa = (XMesaContext) ctx->DriverCtx; \
+ XMesaImage *img = xmesa->xm_buffer->backimage; \
unsigned long pixel; \
PACK_TRUECOLOR(pixel, v2->color[0], v2->color[1], v2->color[2]);
-
#define RENDER_SPAN( span ) \
GLuint i; \
GLint x = span.x, y = FLIP(xmesa->xm_buffer, span.y); \
for (i = 0; i < span.end; i++, x++) { \
XMesaPutPixel(img, x, y, pixel); \
}
-
#include "swrast/s_tritemp.h"
-}
+
/*
* XImage, flat, NON-depth-buffered, PF_8A8B8G8R triangle.
*/
-static void flat_8A8B8G8R_triangle( GLcontext *ctx,
- const SWvertex *v0,
- const SWvertex *v1,
- const SWvertex *v2 )
-{
- XMesaContext xmesa = (XMesaContext) ctx->DriverCtx;
+#define NAME flat_8A8B8G8R_triangle
#define PIXEL_ADDRESS(X,Y) PIXELADDR4(xmesa->xm_buffer,X,Y)
#define PIXEL_TYPE GLuint
#define BYTES_PER_ROW (xmesa->xm_buffer->backimage->bytes_per_line)
#define SETUP_CODE \
+ XMesaContext xmesa = (XMesaContext) ctx->DriverCtx; \
unsigned long p = PACK_8B8G8R( v2->color[0], \
v2->color[1], v2->color[2] );
-#define RENDER_SPAN( span ) \
- GLuint i; \
- for (i = 0; i < span.end; i++) { \
- pRow[i] = (PIXEL_TYPE) p; \
+#define RENDER_SPAN( span ) \
+ GLuint i; \
+ for (i = 0; i < span.end; i++) { \
+ pRow[i] = (PIXEL_TYPE) p; \
}
-
#include "swrast/s_tritemp.h"
-}
+
/*
* XImage, flat, NON-depth-buffered, PF_8R8G8B triangle.
*/
-static void flat_8R8G8B_triangle( GLcontext *ctx,
- const SWvertex *v0,
- const SWvertex *v1,
- const SWvertex *v2 )
-{
- XMesaContext xmesa = (XMesaContext) ctx->DriverCtx;
+#define NAME flat_8R8G8B_triangle
#define PIXEL_ADDRESS(X,Y) PIXELADDR4(xmesa->xm_buffer,X,Y)
#define PIXEL_TYPE GLuint
#define BYTES_PER_ROW (xmesa->xm_buffer->backimage->bytes_per_line)
-#define SETUP_CODE \
- unsigned long p = PACK_8R8G8B( v2->color[0], \
+#define SETUP_CODE \
+ XMesaContext xmesa = (XMesaContext) ctx->DriverCtx; \
+ unsigned long p = PACK_8R8G8B( v2->color[0], \
v2->color[1], v2->color[2] );
-#define RENDER_SPAN( span ) \
- GLuint i; \
- for (i = 0; i < span.end; i++) { \
- pRow[i] = (PIXEL_TYPE) p; \
+#define RENDER_SPAN( span ) \
+ GLuint i; \
+ for (i = 0; i < span.end; i++) { \
+ pRow[i] = (PIXEL_TYPE) p; \
}
-
#include "swrast/s_tritemp.h"
-}
+
/*
* XImage, flat, NON-depth-buffered, PF_8R8G8B24 triangle.
*/
-static void flat_8R8G8B24_triangle( GLcontext *ctx,
- const SWvertex *v0,
- const SWvertex *v1,
- const SWvertex *v2 )
-{
- XMesaContext xmesa = (XMesaContext) ctx->DriverCtx;
- const GLubyte *color = v2->color;
+#define NAME flat_8R8G8B24_triangle
#define PIXEL_ADDRESS(X,Y) PIXELADDR3(xmesa->xm_buffer,X,Y)
#define PIXEL_TYPE bgr_t
#define BYTES_PER_ROW (xmesa->xm_buffer->backimage->bytes_per_line)
+#define SETUP_CODE \
+ XMesaContext xmesa = (XMesaContext) ctx->DriverCtx; \
+ const GLubyte *color = v2->color;
#define RENDER_SPAN( span ) \
GLuint i; \
PIXEL_TYPE *pixel = pRow; \
pixel->g = color[GCOMP]; \
pixel->b = color[BCOMP]; \
}
-
#include "swrast/s_tritemp.h"
-}
+
+
/*
* XImage, flat, NON-depth-buffered, PF_TRUEDITHER triangle.
*/
-static void flat_TRUEDITHER_triangle( GLcontext *ctx,
- const SWvertex *v0,
- const SWvertex *v1,
- const SWvertex *v2 )
-{
- XMesaContext xmesa = (XMesaContext) ctx->DriverCtx;
+#define NAME flat_TRUEDITHER_triangle
+#define SETUP_CODE \
+ XMesaContext xmesa = (XMesaContext) ctx->DriverCtx; \
XMesaImage *img = xmesa->xm_buffer->backimage;
#define RENDER_SPAN( span ) \
GLuint i; \
v2->color[1], v2->color[2] ); \
XMesaPutPixel(img, x, y, p); \
}
-
#include "swrast/s_tritemp.h"
-}
/*
* XImage, flat, NON-depth-buffered, PF_5R6G5B triangle.
*/
-static void flat_5R6G5B_triangle( GLcontext *ctx,
- const SWvertex *v0,
- const SWvertex *v1,
- const SWvertex *v2 )
-{
- XMesaContext xmesa = (XMesaContext) ctx->DriverCtx;
+#define NAME flat_5R6G5B_triangle
#define PIXEL_ADDRESS(X,Y) PIXELADDR2(xmesa->xm_buffer,X,Y)
#define PIXEL_TYPE GLushort
#define BYTES_PER_ROW (xmesa->xm_buffer->backimage->bytes_per_line)
-#define SETUP_CODE \
- unsigned long p = PACK_5R6G5B( v2->color[0], \
+#define SETUP_CODE \
+ XMesaContext xmesa = (XMesaContext) ctx->DriverCtx; \
+ unsigned long p = PACK_5R6G5B( v2->color[0], \
v2->color[1], v2->color[2] );
-#define RENDER_SPAN( span ) \
- GLuint i; \
- for (i = 0; i < span.end; i++) { \
- pRow[i] = (PIXEL_TYPE) p; \
+#define RENDER_SPAN( span ) \
+ GLuint i; \
+ for (i = 0; i < span.end; i++) { \
+ pRow[i] = (PIXEL_TYPE) p; \
}
-
#include "swrast/s_tritemp.h"
-}
+
/*
* XImage, flat, NON-depth-buffered, PF_DITHER_5R6G5B triangle.
*/
-static void flat_DITHER_5R6G5B_triangle( GLcontext *ctx,
- const SWvertex *v0,
- const SWvertex *v1,
- const SWvertex *v2 )
-{
- XMesaContext xmesa = (XMesaContext) ctx->DriverCtx;
- const GLubyte *color = v2->color;
+#define NAME flat_DITHER_5R6G5B_triangle
#define PIXEL_ADDRESS(X,Y) PIXELADDR2(xmesa->xm_buffer,X,Y)
#define PIXEL_TYPE GLushort
#define BYTES_PER_ROW (xmesa->xm_buffer->backimage->bytes_per_line)
+#define SETUP_CODE \
+ XMesaContext xmesa = (XMesaContext) ctx->DriverCtx; \
+ const GLubyte *color = v2->color;
#define RENDER_SPAN( span ) \
GLuint i; \
GLint x = span.x, y = FLIP(xmesa->xm_buffer, span.y); \
PACK_TRUEDITHER(pRow[i], x, y, color[RCOMP], \
color[GCOMP], color[BCOMP]); \
}
-
#include "swrast/s_tritemp.h"
-}
+
/*
* XImage, flat, NON-depth-buffered, 8-bit PF_DITHER triangle.
*/
-static void flat_DITHER8_triangle( GLcontext *ctx,
- const SWvertex *v0,
- const SWvertex *v1,
- const SWvertex *v2 )
-{
- XMesaContext xmesa = (XMesaContext) ctx->DriverCtx;
+#define NAME flat_DITHER8_triangle
#define PIXEL_ADDRESS(X,Y) PIXELADDR1(xmesa->xm_buffer,X,Y)
#define PIXEL_TYPE GLubyte
#define BYTES_PER_ROW (xmesa->xm_buffer->backimage->bytes_per_line)
-#define SETUP_CODE \
+#define SETUP_CODE \
+ XMesaContext xmesa = (XMesaContext) ctx->DriverCtx; \
FLAT_DITHER_SETUP( v2->color[0], v2->color[1], v2->color[2] );
-
#define RENDER_SPAN( span ) \
GLuint i; \
GLint x = span.x, y = FLIP(xmesa->xm_buffer, span.y); \
for (i = 0; i < span.end; i++, x++) { \
pRow[i] = (PIXEL_TYPE) FLAT_DITHER(x); \
}
-
#include "swrast/s_tritemp.h"
-}
+
/*
* XImage, flat, NON-depth-buffered, PF_DITHER triangle.
*/
-static void flat_DITHER_triangle( GLcontext *ctx,
- const SWvertex *v0,
- const SWvertex *v1,
- const SWvertex *v2 )
-{
- XMesaContext xmesa = (XMesaContext) ctx->DriverCtx;
- XMesaImage *img = xmesa->xm_buffer->backimage;
-#define SETUP_CODE \
+#define NAME flat_DITHER_triangle
+#define SETUP_CODE \
+ XMesaContext xmesa = (XMesaContext) ctx->DriverCtx; \
+ XMesaImage *img = xmesa->xm_buffer->backimage; \
FLAT_DITHER_SETUP( v2->color[0], v2->color[1], v2->color[2] );
-
#define RENDER_SPAN( span ) \
GLuint i; \
GLint x = span.x, y = FLIP(xmesa->xm_buffer, span.y); \
unsigned long p = FLAT_DITHER(x); \
XMesaPutPixel(img, x, y, p ); \
}
-
#include "swrast/s_tritemp.h"
-}
+
/*
* XImage, flat, NON-depth-buffered, 8-bit PF_HPCR triangle.
*/
-static void flat_HPCR_triangle( GLcontext *ctx,
- const SWvertex *v0,
- const SWvertex *v1,
- const SWvertex *v2 )
-{
- XMesaContext xmesa = (XMesaContext) ctx->DriverCtx;
+#define NAME flat_HPCR_triangle
#define PIXEL_ADDRESS(X,Y) PIXELADDR1(xmesa->xm_buffer,X,Y)
#define PIXEL_TYPE GLubyte
#define BYTES_PER_ROW (xmesa->xm_buffer->backimage->bytes_per_line)
-#define SETUP_CODE \
- GLubyte r = v2->color[0]; \
- GLubyte g = v2->color[1]; \
+#define SETUP_CODE \
+ XMesaContext xmesa = (XMesaContext) ctx->DriverCtx; \
+ GLubyte r = v2->color[0]; \
+ GLubyte g = v2->color[1]; \
GLubyte b = v2->color[2];
#define RENDER_SPAN( span ) \
GLuint i; \
for (i = 0; i < span.end; i++, x++) { \
pRow[i] = (PIXEL_TYPE) DITHER_HPCR(x, y, r, g, b); \
}
-
#include "swrast/s_tritemp.h"
-}
+
/*
* XImage, flat, NON-depth-buffered, 8-bit PF_LOOKUP triangle.
*/
-static void flat_LOOKUP8_triangle( GLcontext *ctx,
- const SWvertex *v0,
- const SWvertex *v1,
- const SWvertex *v2 )
-{
- XMesaContext xmesa = (XMesaContext) ctx->DriverCtx;
+#define NAME flat_LOOKUP8_triangle
#define PIXEL_ADDRESS(X,Y) PIXELADDR1(xmesa->xm_buffer,X,Y)
#define PIXEL_TYPE GLubyte
#define BYTES_PER_ROW (xmesa->xm_buffer->backimage->bytes_per_line)
-#define SETUP_CODE \
- LOOKUP_SETUP; \
- GLubyte r = v2->color[0]; \
- GLubyte g = v2->color[1]; \
- GLubyte b = v2->color[2]; \
+#define SETUP_CODE \
+ XMesaContext xmesa = (XMesaContext) ctx->DriverCtx; \
+ LOOKUP_SETUP; \
+ GLubyte r = v2->color[0]; \
+ GLubyte g = v2->color[1]; \
+ GLubyte b = v2->color[2]; \
GLubyte p = LOOKUP(r,g,b);
-#define RENDER_SPAN( span ) \
- GLuint i; \
- for (i = 0; i < span.end; i++) { \
- pRow[i] = (PIXEL_TYPE) p; \
+#define RENDER_SPAN( span ) \
+ GLuint i; \
+ for (i = 0; i < span.end; i++) { \
+ pRow[i] = (PIXEL_TYPE) p; \
}
-
#include "swrast/s_tritemp.h"
-}
+
#ifdef DEBUG