Hi,
here's simple patch that allows for building render functions with DO_UNFILLED
= 0.
I'd appreciate any comments
Maciej Cencora
From 2c4623b5d787e034a96c83da16e760ca736b450c Mon Sep 17 00:00:00 2001
From: Maciej Cencora <[email protected]>
Date: Thu, 19 Mar 2009 18:15:48 +0100
Subject: [PATCH] mesa: fix t_dd_tritmp.h when DO_UNFILLED is 0
---
src/mesa/tnl_dd/t_dd_tritmp.h | 41 +++++++++++++++++++++++++++++++++++------
1 files changed, 35 insertions(+), 6 deletions(-)
diff --git a/src/mesa/tnl_dd/t_dd_tritmp.h b/src/mesa/tnl_dd/t_dd_tritmp.h
index 1ae70f4..1994bfa 100644
--- a/src/mesa/tnl_dd/t_dd_tritmp.h
+++ b/src/mesa/tnl_dd/t_dd_tritmp.h
@@ -207,14 +207,14 @@ static void TAG(triangle)( GLcontext *ctx, GLuint e0, GLuint e1, GLuint e2 )
if (VB->ColorPtr[1]->stride) {
ASSERT(VB->ColorPtr[1]->stride == 4*sizeof(GLfloat));
- if (!DO_FLAT) {
+ if (!DO_FLAT) {
VERT_SET_RGBA( v[0], vbcolor[e0] );
VERT_SET_RGBA( v[1], vbcolor[e1] );
}
VERT_SET_RGBA( v[2], vbcolor[e2] );
}
else {
- if (!DO_FLAT) {
+ if (!DO_FLAT) {
VERT_SET_RGBA( v[0], vbcolor[0] );
VERT_SET_RGBA( v[1], vbcolor[0] );
}
@@ -293,7 +293,7 @@ static void TAG(triangle)( GLcontext *ctx, GLuint e0, GLuint e1, GLuint e2 )
VERT_COPY_IND( v[1], v[2] );
}
}
-
+#if DO_UNFILLED
if (mode == GL_POINT) {
if (DO_OFFSET && ctx->Polygon.OffsetPoint) {
VERT_Z_ADD(v[0], offset);
@@ -326,8 +326,7 @@ static void TAG(triangle)( GLcontext *ctx, GLuint e0, GLuint e1, GLuint e2 )
VERT_Z_ADD(v[1], offset);
VERT_Z_ADD(v[2], offset);
}
- if (DO_UNFILLED)
- RASTERIZE( GL_TRIANGLES );
+ RASTERIZE( GL_TRIANGLES );
if (DO_TWOSTENCIL && !HAVE_STENCIL_TWOSIDE && ctx->Stencil.TestTwoSide) {
SETUP_STENCIL(facing);
TRI( v[0], v[1], v[2] );
@@ -336,6 +335,21 @@ static void TAG(triangle)( GLcontext *ctx, GLuint e0, GLuint e1, GLuint e2 )
TRI( v[0], v[1], v[2] );
}
}
+#else
+ if (DO_OFFSET && (ctx->Polygon.OffsetFill | ctx->Polygon.OffsetLine | ctx->Polygon.OffsetPoint)) {
+ VERT_Z_ADD(v[0], offset);
+ VERT_Z_ADD(v[1], offset);
+ VERT_Z_ADD(v[2], offset);
+ }
+
+ if (DO_TWOSTENCIL && !HAVE_STENCIL_TWOSIDE && ctx->Stencil.TestTwoSide) {
+ SETUP_STENCIL(facing);
+ TRI( v[0], v[1], v[2] );
+ UNSET_STENCIL(facing);
+ } else {
+ TRI( v[0], v[1], v[2] );
+ }
+#endif
if (DO_OFFSET)
{
@@ -571,7 +585,7 @@ static void TAG(quadr)( GLcontext *ctx,
VERT_COPY_IND( v[2], v[3] );
}
}
-
+#if DO_UNFILLED
if (mode == GL_POINT) {
if (( DO_OFFSET) && ctx->Polygon.OffsetPoint) {
VERT_Z_ADD(v[0], offset);
@@ -616,6 +630,21 @@ static void TAG(quadr)( GLcontext *ctx,
QUAD( (v[0]), (v[1]), (v[2]), (v[3]) );
}
}
+#else
+ if (DO_OFFSET && (ctx->Polygon.OffsetFill | ctx->Polygon.OffsetLine | ctx->Polygon.OffsetPoint)) {
+ VERT_Z_ADD(v[0], offset);
+ VERT_Z_ADD(v[1], offset);
+ VERT_Z_ADD(v[2], offset);
+ VERT_Z_ADD(v[3], offset);
+ }
+ if (DO_TWOSTENCIL && !HAVE_STENCIL_TWOSIDE && ctx->Stencil.TestTwoSide) {
+ SETUP_STENCIL(facing);
+ QUAD( (v[0]), (v[1]), (v[2]), (v[3]) );
+ UNSET_STENCIL(facing);
+ } else {
+ QUAD( (v[0]), (v[1]), (v[2]), (v[3]) );
+ }
+#endif
if (DO_OFFSET)
{
--
1.5.6.3
------------------------------------------------------------------------------
Apps built with the Adobe(R) Flex(R) framework and Flex Builder(TM) are
powering Web 2.0 with engaging, cross-platform capabilities. Quickly and
easily build your RIAs with Flex Builder, the Eclipse(TM)based development
software that enables intelligent coding and step-through debugging.
Download the free 60 day trial. http://p.sf.net/sfu/www-adobe-com
_______________________________________________
Mesa3d-dev mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/mesa3d-dev