diff options
author | Keith Whitwell <[email protected]> | 2000-11-13 20:02:56 +0000 |
---|---|---|
committer | Keith Whitwell <[email protected]> | 2000-11-13 20:02:56 +0000 |
commit | 1e1aac034c986a08248861363c0baa27dc2ae2d5 (patch) | |
tree | d6aa2dd575eae913007d089928d765be8c867126 /src/mesa/swrast_setup/ss_triangle.c | |
parent | 6b8ae62d6b6a3b06c51628123fc30634cacf9c7c (diff) |
Cleanup of derived state calculation prior to seperating software T&L
into a new directory. Specifically the handling of changes to lighting
lighting space (light in model vs. light in eye) have been revamped.
Moved several derived values used only by swrast into that directory.
Removed direct calls to swrast_flush() from vbrender.c -- pushed into
ctx->Driver.RenderFinish.
Optimized flat-shading case in swrast_setup.
Diffstat (limited to 'src/mesa/swrast_setup/ss_triangle.c')
-rw-r--r-- | src/mesa/swrast_setup/ss_triangle.c | 89 |
1 files changed, 88 insertions, 1 deletions
diff --git a/src/mesa/swrast_setup/ss_triangle.c b/src/mesa/swrast_setup/ss_triangle.c index 992bc4f396a..ab70f5c97bc 100644 --- a/src/mesa/swrast_setup/ss_triangle.c +++ b/src/mesa/swrast_setup/ss_triangle.c @@ -36,7 +36,8 @@ #define SS_OFFSET_BIT 0x2 #define SS_TWOSIDE_BIT 0x4 #define SS_UNFILLED_BIT 0x10 -#define SS_MAX_TRIFUNC 0x20 +#define SS_COPY_EXTRAS 0x20 /* optimization */ +#define SS_MAX_TRIFUNC 0x40 static triangle_func tri_tab[SS_MAX_TRIFUNC]; static line_func line_tab[SS_MAX_TRIFUNC]; @@ -112,6 +113,70 @@ static quad_func quad_tab[SS_MAX_TRIFUNC]; #define TAG(x) x##_flat_offset_twoside_unfilled #include "ss_tritmp.h" +#define IND (0|SS_COPY_EXTRAS) +#define TAG(x) x##_spec +#include "ss_tritmp.h" + +#define IND (SS_FLAT_BIT|SS_COPY_EXTRAS) +#define TAG(x) x##_flat_spec +#include "ss_tritmp.h" + +#define IND (SS_OFFSET_BIT|SS_COPY_EXTRAS) +#define TAG(x) x##_offset_spec +#include "ss_tritmp.h" + +#define IND (SS_FLAT_BIT|SS_OFFSET_BIT|SS_COPY_EXTRAS) +#define TAG(x) x##_flat_offset_spec +#include "ss_tritmp.h" + +#define IND (SS_TWOSIDE_BIT|SS_COPY_EXTRAS) +#define TAG(x) x##_twoside_spec +#include "ss_tritmp.h" + +#define IND (SS_FLAT_BIT|SS_TWOSIDE_BIT|SS_COPY_EXTRAS) +#define TAG(x) x##_flat_twoside_spec +#include "ss_tritmp.h" + +#define IND (SS_OFFSET_BIT|SS_TWOSIDE_BIT|SS_COPY_EXTRAS) +#define TAG(x) x##_offset_twoside_spec +#include "ss_tritmp.h" + +#define IND (SS_FLAT_BIT|SS_OFFSET_BIT|SS_TWOSIDE_BIT|SS_COPY_EXTRAS) +#define TAG(x) x##_flat_offset_twoside_spec +#include "ss_tritmp.h" + +#define IND (SS_UNFILLED_BIT|SS_COPY_EXTRAS) +#define TAG(x) x##_unfilled_spec +#include "ss_tritmp.h" + +#define IND (SS_FLAT_BIT|SS_UNFILLED_BIT|SS_COPY_EXTRAS) +#define TAG(x) x##_flat_unfilled_spec +#include "ss_tritmp.h" + +#define IND (SS_OFFSET_BIT|SS_UNFILLED_BIT|SS_COPY_EXTRAS) +#define TAG(x) x##_offset_unfilled_spec +#include "ss_tritmp.h" + +#define IND (SS_FLAT_BIT|SS_OFFSET_BIT|SS_UNFILLED_BIT|SS_COPY_EXTRAS) +#define TAG(x) x##_flat_offset_unfilled_spec +#include "ss_tritmp.h" + +#define IND (SS_TWOSIDE_BIT|SS_UNFILLED_BIT|SS_COPY_EXTRAS) +#define TAG(x) x##_twoside_unfilled_spec +#include "ss_tritmp.h" + +#define IND (SS_FLAT_BIT|SS_TWOSIDE_BIT|SS_UNFILLED_BIT|SS_COPY_EXTRAS) +#define TAG(x) x##_flat_twoside_unfilled_spec +#include "ss_tritmp.h" + +#define IND (SS_OFFSET_BIT|SS_TWOSIDE_BIT|SS_UNFILLED_BIT|SS_COPY_EXTRAS) +#define TAG(x) x##_offset_twoside_unfilled_spec +#include "ss_tritmp.h" + +#define IND (SS_FLAT_BIT|SS_OFFSET_BIT|SS_TWOSIDE_BIT|SS_UNFILLED_BIT|SS_COPY_EXTRAS) +#define TAG(x) x##_flat_offset_twoside_unfilled_spec +#include "ss_tritmp.h" + void _swsetup_trifuncs_init( GLcontext *ctx ) { @@ -133,6 +198,23 @@ void _swsetup_trifuncs_init( GLcontext *ctx ) init_flat_twoside_unfilled(); init_offset_twoside_unfilled(); init_flat_offset_twoside_unfilled(); + + init_spec(); + init_flat_spec(); + init_offset_spec(); + init_flat_offset_spec(); + init_twoside_spec(); + init_flat_twoside_spec(); + init_offset_twoside_spec(); + init_flat_offset_twoside_spec(); + init_unfilled_spec(); + init_flat_unfilled_spec(); + init_offset_unfilled_spec(); + init_flat_offset_unfilled_spec(); + init_twoside_unfilled_spec(); + init_flat_twoside_unfilled_spec(); + init_offset_twoside_unfilled_spec(); + init_flat_offset_twoside_unfilled_spec(); } @@ -153,6 +235,11 @@ void _swsetup_choose_trifuncs( GLcontext *ctx ) if (ctx->Polygon._Unfilled) ind |= SS_UNFILLED_BIT; + if ((ctx->_TriangleCaps & DD_SEPERATE_SPECULAR) || + ctx->RenderMode == GL_SELECT || + !ctx->Visual.RGBAflag) + ind |= SS_COPY_EXTRAS; + swsetup->Triangle = tri_tab[ind]; swsetup->Line = line_tab[ind]; swsetup->Points = points_tab[ind]; |