#define SETUP_CODE \
GET_XRB(xrb); \
const GLubyte *color = vert1->color; \
- GLuint pixel = PACK_8B8G8R( color[0], color[1], color[2] );
+ GLuint pixel = PACK_8A8B8G8R(color[0], color[1], color[2], color[3]);
#define PIXEL_TYPE GLuint
#define BYTES_PER_ROW (xrb->ximage->bytes_per_line)
#define PIXEL_ADDRESS(X,Y) PIXEL_ADDR4(xrb, X, Y)
#define SETUP_CODE \
GET_XRB(xrb); \
const GLubyte *color = vert1->color; \
- GLuint pixel = PACK_8R8G8B( color[0], color[1], color[2] );
+ GLuint pixel = PACK_8A8R8G8B(color[0], color[1], color[2], color[3]);
#define PIXEL_TYPE GLuint
#define BYTES_PER_ROW (xrb->ximage->bytes_per_line)
#define PIXEL_ADDRESS(X,Y) PIXEL_ADDR4(xrb, X, Y)
#define SETUP_CODE \
GET_XRB(xrb); \
const GLubyte *color = vert1->color; \
- GLuint pixel = PACK_8B8G8R( color[0], color[1], color[2] );
+ GLuint pixel = PACK_8A8B8G8R(color[0], color[1], color[2], color[3]);
#define INTERP_Z 1
#define DEPTH_TYPE DEFAULT_SOFTWARE_DEPTH_TYPE
#define PIXEL_TYPE GLuint
#define SETUP_CODE \
GET_XRB(xrb); \
const GLubyte *color = vert1->color; \
- GLuint pixel = PACK_8R8G8B( color[0], color[1], color[2] );
+ GLuint pixel = PACK_8A8R8G8B(color[0], color[1], color[2], color[3]);
#define INTERP_Z 1
#define DEPTH_TYPE DEFAULT_SOFTWARE_DEPTH_TYPE
#define PIXEL_TYPE GLuint
get_line_func(GLcontext *ctx)
{
#if CHAN_BITS == 8
- XMesaContext xmesa = XMESA_CONTEXT(ctx);
SWcontext *swrast = SWRAST_CONTEXT(ctx);
- int depth = GET_VISUAL_DEPTH(xmesa->xm_visual);
- struct xmesa_renderbuffer *xrb;
-
- if (CHAN_BITS != 8)
- return NULL;
+ XMesaContext xmesa = XMESA_CONTEXT(ctx);
+ XMesaBuffer xmbuf = XMESA_BUFFER(ctx->DrawBuffer);
+ const int depth = GET_VISUAL_DEPTH(xmesa->xm_visual);
+ const struct xmesa_renderbuffer *xrb;
if ((ctx->DrawBuffer->_ColorDrawBufferMask[0]
& (BUFFER_BIT_FRONT_LEFT | BUFFER_BIT_BACK_LEFT)) == 0)
if (ctx->Light.ShadeModel != GL_FLAT) return (swrast_line_func) NULL;
if (ctx->Line.StippleFlag) return (swrast_line_func) NULL;
if (swrast->_RasterMask & MULTI_DRAW_BIT) return (swrast_line_func) NULL;
+ if (xmbuf->swAlpha) return (swrast_line_func) NULL;
xrb = xmesa_renderbuffer(ctx->DrawBuffer->_ColorDrawBuffers[0][0]->Wrapped);
#define INTERP_Z 1
#define DEPTH_TYPE DEFAULT_SOFTWARE_DEPTH_TYPE
#define INTERP_RGB 1
+#define INTERP_ALPHA 1
#define PIXEL_ADDRESS(X,Y) PIXEL_ADDR4(xrb, X, Y)
#define PIXEL_TYPE GLuint
#define BYTES_PER_ROW (xrb->ximage->bytes_per_line)
for (i = 0; i < span.end; i++) { \
const DEPTH_TYPE z = FixedToDepth(span.z); \
if (z < zRow[i]) { \
- pRow[i] = PACK_8B8G8R(FixedToInt(span.red), \
- FixedToInt(span.green), FixedToInt(span.blue)); \
+ pRow[i] = PACK_8A8B8G8R(FixedToInt(span.red), \
+ FixedToInt(span.green), FixedToInt(span.blue), \
+ FixedToInt(span.alpha)); \
zRow[i] = z; \
} \
span.red += span.redStep; \
span.green += span.greenStep; \
span.blue += span.blueStep; \
+ span.alpha += span.alphaStep; \
span.z += span.zStep; \
}
#define INTERP_Z 1
#define DEPTH_TYPE DEFAULT_SOFTWARE_DEPTH_TYPE
#define INTERP_RGB 1
+#define INTERP_ALPHA 1
#define PIXEL_ADDRESS(X,Y) PIXEL_ADDR4(xrb, X, Y)
#define PIXEL_TYPE GLuint
#define BYTES_PER_ROW (xrb->ximage->bytes_per_line)
for (i = 0; i < span.end; i++) { \
const DEPTH_TYPE z = FixedToDepth(span.z); \
if (z < zRow[i]) { \
- pRow[i] = PACK_8R8G8B(FixedToInt(span.red), \
- FixedToInt(span.green), FixedToInt(span.blue)); \
+ pRow[i] = PACK_8A8R8G8B(FixedToInt(span.red), \
+ FixedToInt(span.green), FixedToInt(span.blue), \
+ FixedToInt(span.alpha)); \
zRow[i] = z; \
} \
span.red += span.redStep; \
span.green += span.greenStep; \
span.blue += span.blueStep; \
+ span.alpha += span.alphaStep; \
span.z += span.zStep; \
}
#define BYTES_PER_ROW (xrb->ximage->bytes_per_line)
#define SETUP_CODE \
GET_XRB(xrb); \
- GLuint p = PACK_8B8G8R( v2->color[0], v2->color[1], v2->color[2] );
+ GLuint p = PACK_8A8B8G8R( v2->color[0], v2->color[1],\
+ v2->color[2], v2->color[3]);
#define RENDER_SPAN( span ) \
GLuint i; \
for (i = 0; i < span.end; i++) { \
#define BYTES_PER_ROW (xrb->ximage->bytes_per_line)
#define SETUP_CODE \
GET_XRB(xrb); \
- GLuint p = PACK_8R8G8B( v2->color[0], v2->color[1], v2->color[2] );
+ GLuint p = PACK_8A8R8G8B(v2->color[0], v2->color[1], \
+ v2->color[2], v2->color[3]);
#define RENDER_SPAN( span ) \
GLuint i; \
for (i = 0; i < span.end; i++) { \
*/
#define NAME smooth_8A8B8G8R_triangle
#define INTERP_RGB 1
+#define INTERP_ALPHA 1
#define PIXEL_ADDRESS(X,Y) PIXEL_ADDR4(xrb, X, Y)
#define PIXEL_TYPE GLuint
#define BYTES_PER_ROW (xrb->ximage->bytes_per_line)
#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) ); \
+ pRow[i] = PACK_8A8B8G8R(FixedToInt(span.red), \
+ FixedToInt(span.green), FixedToInt(span.blue), \
+ FixedToInt(span.alpha)); \
span.red += span.redStep; \
span.green += span.greenStep; \
span.blue += span.blueStep; \
+ span.alpha += span.alphaStep; \
}
#include "swrast/s_tritemp.h"
*/
#define NAME smooth_8A8R8G8B_triangle
#define INTERP_RGB 1
+#define INTERP_ALPHA 1
#define PIXEL_ADDRESS(X,Y) PIXEL_ADDR4(xrb, X, Y)
#define PIXEL_TYPE GLuint
#define BYTES_PER_ROW (xrb->ximage->bytes_per_line)
#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) ); \
+ pRow[i] = PACK_8A8R8G8B(FixedToInt(span.red), \
+ FixedToInt(span.green), FixedToInt(span.blue), \
+ FixedToInt(span.alpha)); \
span.red += span.redStep; \
span.green += span.greenStep; \
span.blue += span.blueStep; \
+ span.alpha += span.alphaStep; \
}
#include "swrast/s_tritemp.h"
#define USE(triFunc) \
do { \
triFuncName = #triFunc; \
+ printf("%s\n", triFuncName);\
return triFunc; \
} while (0)
static swrast_tri_func
get_triangle_func(GLcontext *ctx)
{
+#if CHAN_BITS == 8
SWcontext *swrast = SWRAST_CONTEXT(ctx);
XMesaContext xmesa = XMESA_CONTEXT(ctx);
- int depth = GET_VISUAL_DEPTH(xmesa->xm_visual);
- struct xmesa_renderbuffer *xrb;
+ XMesaBuffer xmbuf = XMESA_BUFFER(ctx->DrawBuffer);
+ const int depth = GET_VISUAL_DEPTH(xmesa->xm_visual);
+ const struct xmesa_renderbuffer *xrb;
#ifdef DEBUG
triFuncName = NULL;
#endif
-#if CHAN_BITS == 8
/* trivial fallback tests */
if ((ctx->DrawBuffer->_ColorDrawBufferMask[0]
& (BUFFER_BIT_FRONT_LEFT | BUFFER_BIT_BACK_LEFT)) == 0)
if (ctx->Polygon.CullFlag &&
ctx->Polygon.CullFaceMode == GL_FRONT_AND_BACK)
return (swrast_tri_func) NULL;
+ if (xmbuf->swAlpha)
+ return (swrast_tri_func) NULL;
xrb = xmesa_renderbuffer(ctx->DrawBuffer->_ColorDrawBuffers[0][0]->Wrapped);