aboutsummaryrefslogtreecommitdiffstats
path: root/src/mesa/drivers/x11/xm_tri.c
diff options
context:
space:
mode:
authorBrian Paul <[email protected]>2006-04-27 02:47:50 +0000
committerBrian Paul <[email protected]>2006-04-27 02:47:50 +0000
commit444cd293fd69d1848b2c55f75674d563e0582fba (patch)
treece51213e692848ac0bf234e17bcf3136817ddf59 /src/mesa/drivers/x11/xm_tri.c
parente814d5e89f10de0c20a5c35e317eeab89b47749b (diff)
assorted clean-ups, fixes
Diffstat (limited to 'src/mesa/drivers/x11/xm_tri.c')
-rw-r--r--src/mesa/drivers/x11/xm_tri.c37
1 files changed, 22 insertions, 15 deletions
diff --git a/src/mesa/drivers/x11/xm_tri.c b/src/mesa/drivers/x11/xm_tri.c
index 61e8986a9b2..d08fd8f8161 100644
--- a/src/mesa/drivers/x11/xm_tri.c
+++ b/src/mesa/drivers/x11/xm_tri.c
@@ -45,7 +45,7 @@
#define GET_XRB(XRB) struct xmesa_renderbuffer *XRB = \
- (struct xmesa_renderbuffer *) ctx->DrawBuffer->_ColorDrawBuffers[0][0]->Wrapped
+ xmesa_renderbuffer(ctx->DrawBuffer->_ColorDrawBuffers[0][0]->Wrapped)
/**********************************************************************/
@@ -53,6 +53,8 @@
/**********************************************************************/
+#if CHAN_BITS == 8
+
/*
* XImage, smooth, depth-buffered, PF_TRUECOLOR triangle.
*/
@@ -1307,8 +1309,10 @@
#include "swrast/s_tritemp.h"
+#endif /* CHAN_BITS == 8 */
-#ifdef DEBUG
+
+#if defined(DEBUG) && CHAN_BITS == 8
extern void _xmesa_print_triangle_func( swrast_tri_func triFunc );
void _xmesa_print_triangle_func( swrast_tri_func triFunc )
{
@@ -1441,19 +1445,24 @@ get_triangle_func(GLcontext *ctx)
triFuncName = NULL;
#endif
+#if CHAN_BITS == 8
+ /* trivial fallback tests */
if ((ctx->DrawBuffer->_ColorDrawBufferMask[0]
& (BUFFER_BIT_FRONT_LEFT | BUFFER_BIT_BACK_LEFT)) == 0)
return (swrast_tri_func) NULL;
- if (ctx->RenderMode != GL_RENDER) return (swrast_tri_func) NULL;
- if (ctx->Polygon.SmoothFlag) return (swrast_tri_func) NULL;
- if (ctx->Texture._EnabledUnits) return (swrast_tri_func) NULL;
- if (swrast->_RasterMask & MULTI_DRAW_BIT) return (swrast_tri_func) NULL;
+ if (ctx->RenderMode != GL_RENDER)
+ return (swrast_tri_func) NULL;
+ if (ctx->Polygon.SmoothFlag)
+ return (swrast_tri_func) NULL;
+ if (ctx->Texture._EnabledUnits)
+ return (swrast_tri_func) NULL;
+ if (swrast->_RasterMask & MULTI_DRAW_BIT)
+ return (swrast_tri_func) NULL;
if (ctx->Polygon.CullFlag &&
ctx->Polygon.CullFaceMode == GL_FRONT_AND_BACK)
- return (swrast_tri_func) NULL;
+ return (swrast_tri_func) NULL;
- xrb = (struct xmesa_renderbuffer *)
- ctx->DrawBuffer->_ColorDrawBuffers[0][0]->Wrapped;
+ xrb = xmesa_renderbuffer(ctx->DrawBuffer->_ColorDrawBuffers[0][0]->Wrapped);
if (xrb->ximage) {
if ( ctx->Light.ShadeModel==GL_SMOOTH
@@ -1607,13 +1616,11 @@ get_triangle_func(GLcontext *ctx)
return (swrast_tri_func) NULL;
}
}
-
- return (swrast_tri_func) NULL;
- }
- else {
- /* draw to pixmap */
- return (swrast_tri_func) NULL;
}
+
+#else
+ return (swrast_tri_func) NULL;
+#endif /* CHAN_BITS == 8 */
}