summaryrefslogtreecommitdiffstats
path: root/src/mesa/swrast_setup/ss_triangle.c
diff options
context:
space:
mode:
authorKeith Whitwell <[email protected]>2001-01-05 02:26:48 +0000
committerKeith Whitwell <[email protected]>2001-01-05 02:26:48 +0000
commit58e991705392a2e17a1c8b034f4083a0adaf1943 (patch)
tree828804ca2671809e92a10642030ecd2d21a27b6d /src/mesa/swrast_setup/ss_triangle.c
parentf22c04cdaec47dfef1068af0e90822062478631b (diff)
Remove 'pv' parameter from Line/Tri/Point funcs. The provoking vertex
is always the last vertex parameter. Modify clipping to preserve pv colors. Modify swrast and X11 driver to expect the pv in the last vertex (was looking in the first vertex previously). Remove all handling of flatshading from swrast_setup. Allow drivers to override the unclipped render tabs in tnl_render_stage directly. (Like in 3.4). Removed fxsimplerender stage. Modified t_vb_rendertmp.h to remove the need for 'parity' arguments in RENDER_TRI macros.
Diffstat (limited to 'src/mesa/swrast_setup/ss_triangle.c')
-rw-r--r--src/mesa/swrast_setup/ss_triangle.c101
1 files changed, 12 insertions, 89 deletions
diff --git a/src/mesa/swrast_setup/ss_triangle.c b/src/mesa/swrast_setup/ss_triangle.c
index a3f8cd6cec5..5fd5cd0f57f 100644
--- a/src/mesa/swrast_setup/ss_triangle.c
+++ b/src/mesa/swrast_setup/ss_triangle.c
@@ -34,15 +34,13 @@
#include "ss_triangle.h"
#include "ss_context.h"
-#define SS_FLAT_BIT 0x1
+#define SS_RGBA_BIT 0x1
#define SS_OFFSET_BIT 0x2
#define SS_TWOSIDE_BIT 0x4
-#define SS_UNFILLED_BIT 0x10
-#define SS_RGBA_BIT 0x20
-#define SS_MAX_TRIFUNC 0x80
+#define SS_UNFILLED_BIT 0x8
+#define SS_MAX_TRIFUNC 0x10
static triangle_func tri_tab[SS_MAX_TRIFUNC];
-static line_func line_tab[SS_MAX_TRIFUNC];
static quad_func quad_tab[SS_MAX_TRIFUNC];
@@ -54,168 +52,88 @@ static quad_func quad_tab[SS_MAX_TRIFUNC];
#define TAG(x) x
#include "ss_tritmp.h"
-#define IND (SS_FLAT_BIT)
-#define TAG(x) x##_flat
-#include "ss_tritmp.h"
-
#define IND (SS_OFFSET_BIT)
#define TAG(x) x##_offset
#include "ss_tritmp.h"
-#define IND (SS_FLAT_BIT|SS_OFFSET_BIT)
-#define TAG(x) x##_flat_offset
-#include "ss_tritmp.h"
-
#define IND (SS_TWOSIDE_BIT)
#define TAG(x) x##_twoside
#include "ss_tritmp.h"
-#define IND (SS_FLAT_BIT|SS_TWOSIDE_BIT)
-#define TAG(x) x##_flat_twoside
-#include "ss_tritmp.h"
-
#define IND (SS_OFFSET_BIT|SS_TWOSIDE_BIT)
#define TAG(x) x##_offset_twoside
#include "ss_tritmp.h"
-#define IND (SS_FLAT_BIT|SS_OFFSET_BIT|SS_TWOSIDE_BIT)
-#define TAG(x) x##_flat_offset_twoside
-#include "ss_tritmp.h"
-
#define IND (SS_UNFILLED_BIT)
#define TAG(x) x##_unfilled
#include "ss_tritmp.h"
-#define IND (SS_FLAT_BIT|SS_UNFILLED_BIT)
-#define TAG(x) x##_flat_unfilled
-#include "ss_tritmp.h"
-
#define IND (SS_OFFSET_BIT|SS_UNFILLED_BIT)
#define TAG(x) x##_offset_unfilled
#include "ss_tritmp.h"
-#define IND (SS_FLAT_BIT|SS_OFFSET_BIT|SS_UNFILLED_BIT)
-#define TAG(x) x##_flat_offset_unfilled
-#include "ss_tritmp.h"
-
#define IND (SS_TWOSIDE_BIT|SS_UNFILLED_BIT)
#define TAG(x) x##_twoside_unfilled
#include "ss_tritmp.h"
-#define IND (SS_FLAT_BIT|SS_TWOSIDE_BIT|SS_UNFILLED_BIT)
-#define TAG(x) x##_flat_twoside_unfilled
-#include "ss_tritmp.h"
-
#define IND (SS_OFFSET_BIT|SS_TWOSIDE_BIT|SS_UNFILLED_BIT)
#define TAG(x) x##_offset_twoside_unfilled
#include "ss_tritmp.h"
-#define IND (SS_FLAT_BIT|SS_OFFSET_BIT|SS_TWOSIDE_BIT|SS_UNFILLED_BIT)
-#define TAG(x) x##_flat_offset_twoside_unfilled
-#include "ss_tritmp.h"
-
#define IND (0|SS_RGBA_BIT)
#define TAG(x) x##_rgba
#include "ss_tritmp.h"
-#define IND (SS_FLAT_BIT|SS_RGBA_BIT)
-#define TAG(x) x##_flat_rgba
-#include "ss_tritmp.h"
-
#define IND (SS_OFFSET_BIT|SS_RGBA_BIT)
#define TAG(x) x##_offset_rgba
#include "ss_tritmp.h"
-#define IND (SS_FLAT_BIT|SS_OFFSET_BIT|SS_RGBA_BIT)
-#define TAG(x) x##_flat_offset_rgba
-#include "ss_tritmp.h"
-
#define IND (SS_TWOSIDE_BIT|SS_RGBA_BIT)
#define TAG(x) x##_twoside_rgba
#include "ss_tritmp.h"
-#define IND (SS_FLAT_BIT|SS_TWOSIDE_BIT|SS_RGBA_BIT)
-#define TAG(x) x##_flat_twoside_rgba
-#include "ss_tritmp.h"
-
#define IND (SS_OFFSET_BIT|SS_TWOSIDE_BIT|SS_RGBA_BIT)
#define TAG(x) x##_offset_twoside_rgba
#include "ss_tritmp.h"
-#define IND (SS_FLAT_BIT|SS_OFFSET_BIT|SS_TWOSIDE_BIT|SS_RGBA_BIT)
-#define TAG(x) x##_flat_offset_twoside_rgba
-#include "ss_tritmp.h"
-
#define IND (SS_UNFILLED_BIT|SS_RGBA_BIT)
#define TAG(x) x##_unfilled_rgba
#include "ss_tritmp.h"
-#define IND (SS_FLAT_BIT|SS_UNFILLED_BIT|SS_RGBA_BIT)
-#define TAG(x) x##_flat_unfilled_rgba
-#include "ss_tritmp.h"
-
#define IND (SS_OFFSET_BIT|SS_UNFILLED_BIT|SS_RGBA_BIT)
#define TAG(x) x##_offset_unfilled_rgba
#include "ss_tritmp.h"
-#define IND (SS_FLAT_BIT|SS_OFFSET_BIT|SS_UNFILLED_BIT|SS_RGBA_BIT)
-#define TAG(x) x##_flat_offset_unfilled_rgba
-#include "ss_tritmp.h"
-
#define IND (SS_TWOSIDE_BIT|SS_UNFILLED_BIT|SS_RGBA_BIT)
#define TAG(x) x##_twoside_unfilled_rgba
#include "ss_tritmp.h"
-#define IND (SS_FLAT_BIT|SS_TWOSIDE_BIT|SS_UNFILLED_BIT|SS_RGBA_BIT)
-#define TAG(x) x##_flat_twoside_unfilled_rgba
-#include "ss_tritmp.h"
-
#define IND (SS_OFFSET_BIT|SS_TWOSIDE_BIT|SS_UNFILLED_BIT|SS_RGBA_BIT)
#define TAG(x) x##_offset_twoside_unfilled_rgba
#include "ss_tritmp.h"
-#define IND (SS_FLAT_BIT|SS_OFFSET_BIT|SS_TWOSIDE_BIT|SS_UNFILLED_BIT|SS_RGBA_BIT)
-#define TAG(x) x##_flat_offset_twoside_unfilled_rgba
-#include "ss_tritmp.h"
-
void _swsetup_trifuncs_init( GLcontext *ctx )
{
(void) ctx;
init();
- init_flat();
init_offset();
- init_flat_offset();
init_twoside();
- init_flat_twoside();
init_offset_twoside();
- init_flat_offset_twoside();
init_unfilled();
- init_flat_unfilled();
init_offset_unfilled();
- init_flat_offset_unfilled();
init_twoside_unfilled();
- init_flat_twoside_unfilled();
init_offset_twoside_unfilled();
- init_flat_offset_twoside_unfilled();
init_rgba();
- init_flat_rgba();
init_offset_rgba();
- init_flat_offset_rgba();
init_twoside_rgba();
- init_flat_twoside_rgba();
init_offset_twoside_rgba();
- init_flat_offset_twoside_rgba();
init_unfilled_rgba();
- init_flat_unfilled_rgba();
init_offset_unfilled_rgba();
- init_flat_offset_unfilled_rgba();
init_twoside_unfilled_rgba();
- init_flat_twoside_unfilled_rgba();
init_offset_twoside_unfilled_rgba();
- init_flat_offset_twoside_unfilled_rgba();
}
@@ -236,14 +154,19 @@ static void swsetup_points( GLcontext *ctx, GLuint first, GLuint last )
}
}
+static void swsetup_line( GLcontext *ctx, GLuint v0, GLuint v1 )
+{
+ SWvertex *verts = SWSETUP_CONTEXT(ctx)->verts;
+ _swrast_Line( ctx, &verts[v0], &verts[v1] );
+}
+
+
+
void _swsetup_choose_trifuncs( GLcontext *ctx )
{
SScontext *swsetup = SWSETUP_CONTEXT(ctx);
GLuint ind = 0;
- if (ctx->Light.ShadeModel == GL_FLAT)
- ind |= SS_FLAT_BIT;
-
if (ctx->Polygon._OffsetAny)
ind |= SS_OFFSET_BIT;
@@ -257,8 +180,8 @@ void _swsetup_choose_trifuncs( GLcontext *ctx )
ind |= SS_RGBA_BIT;
swsetup->Triangle = tri_tab[ind];
- swsetup->Line = line_tab[ind];
swsetup->Quad = quad_tab[ind];
+ swsetup->Line = swsetup_line;
swsetup->Points = swsetup_points;
}