diff options
author | Keith Whitwell <[email protected]> | 2001-01-05 02:26:48 +0000 |
---|---|---|
committer | Keith Whitwell <[email protected]> | 2001-01-05 02:26:48 +0000 |
commit | 58e991705392a2e17a1c8b034f4083a0adaf1943 (patch) | |
tree | 828804ca2671809e92a10642030ecd2d21a27b6d /src/mesa/drivers/glide/fxtris.c | |
parent | f22c04cdaec47dfef1068af0e90822062478631b (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/drivers/glide/fxtris.c')
-rw-r--r-- | src/mesa/drivers/glide/fxtris.c | 63 |
1 files changed, 63 insertions, 0 deletions
diff --git a/src/mesa/drivers/glide/fxtris.c b/src/mesa/drivers/glide/fxtris.c index 7d887133b61..11072a26012 100644 --- a/src/mesa/drivers/glide/fxtris.c +++ b/src/mesa/drivers/glide/fxtris.c @@ -11,6 +11,7 @@ #include "swrast_setup/swrast_setup.h" #include "tnl/t_context.h" +#include "tnl/t_pipeline.h" #include "fxdrv.h" #include "fxglidew.h" @@ -469,6 +470,56 @@ fx_null_tri( GLcontext *ctx, + +/**********************************************************************/ +/* Render whole begin/end objects */ +/**********************************************************************/ + + +/* Vertices, no clipping. + */ +#define RENDER_POINTS( start, count ) \ + for ( ; start < count ; start++) \ + grDrawPoint( &v[ELT(start)].v ); + +#define RENDER_LINE( i1, i ) \ + grDrawLine( &v[i1].v, &v[i].v ) + +#define RENDER_TRI( i2, i1, i ) \ + grDrawTriangle( &v[i2].v, &v[i1].v, &v[i].v ) + +#define RENDER_QUAD( i3, i2, i1, i ) \ + grDrawTriangle( &v[i3].v, &v[i2].v, &v[i].v ); \ + grDrawTriangle( &v[i2].v, &v[i1].v, &v[i].v ) + +#define TAG(x) fx_##x##_verts +#define LOCAL_VARS \ + fxVertex *v = FX_CONTEXT(ctx)->verts; + +/* Verts, no clipping. + */ +#define ELT(x) x +#define RESET_STIPPLE +#define RESET_OCCLUSION +#define PRESERVE_VB_DEFS +#include "tnl/t_vb_rendertmp.h" + + +/* Elts, no clipping. + */ +#undef ELT +#undef TAG +#undef LOCAL_VARS +#define TAG(x) fx_##x##_elts +#define ELT(x) elt[x] +#define LOCAL_VARS \ + fxVertex *v = FX_CONTEXT(ctx)->verts; \ + const GLuint * const elt = TNL_CONTEXT(ctx)->vb.Elts; +#include "tnl/t_vb_rendertmp.h" + + + + /* Setup the Point, Line, Triangle and Quad functions based on the * current rendering state. Wherever possible, use the hardware to * render the primitive. Otherwise, fallback to software rendering. @@ -487,6 +538,8 @@ void fxDDChooseRenderState( GLcontext *ctx ) ctx->Driver.LineFunc = _swsetup_Line; ctx->Driver.TriangleFunc = _swsetup_Triangle; ctx->Driver.QuadFunc = _swsetup_Quad; + ctx->Driver.RenderTabVerts = _tnl_render_tab_verts; + ctx->Driver.RenderTabElts = _tnl_render_tab_elts; fxMesa->render_index = FX_FALLBACK_BIT; return; @@ -549,9 +602,19 @@ void fxDDChooseRenderState( GLcontext *ctx ) ctx->Driver.TriangleFunc = rast_tab[index].triangle; ctx->Driver.QuadFunc = rast_tab[index].quad; fxMesa->render_index = index; + + if (fxMesa->render_index == 0) { + ctx->Driver.RenderTabVerts = fx_render_tab_verts; + ctx->Driver.RenderTabElts = fx_render_tab_elts; + } else { + ctx->Driver.RenderTabVerts = _tnl_render_tab_verts; + ctx->Driver.RenderTabElts = _tnl_render_tab_elts; + } } + + #else |