From 88f3b89a2cb77766d2009b9868c44e03abe2dbb2 Mon Sep 17 00:00:00 2001 From: Keith Whitwell Date: Thu, 28 Dec 2000 22:11:04 +0000 Subject: Add render stage for unclipped vb's to fx driver. Bump MAX_TEXTURE_UNITS to 8 Fix mem. leak in destroy_lists Fix crash in q3 (cva generally) --- src/mesa/drivers/glide/fxdd.c | 28 +++++++++++++++++----------- 1 file changed, 17 insertions(+), 11 deletions(-) (limited to 'src/mesa/drivers/glide/fxdd.c') diff --git a/src/mesa/drivers/glide/fxdd.c b/src/mesa/drivers/glide/fxdd.c index 3bbe42328a..0f1ace3ee0 100644 --- a/src/mesa/drivers/glide/fxdd.c +++ b/src/mesa/drivers/glide/fxdd.c @@ -61,6 +61,8 @@ #include "tnl/tnl.h" #include "array_cache/acache.h" +#include "tnl/t_pipeline.h" + /* These lookup table are used to extract RGB values in [0,255] from * 16-bit pixel values. */ @@ -645,25 +647,21 @@ static const GLubyte *fxDDGetString(GLcontext *ctx, GLenum name) } } -#if 0 -static const struct gl_pipeline_stage * const fx_pipeline[] = { +static const struct gl_pipeline_stage *fx_pipeline[] = { &_tnl_update_material_stage, + /* TODO: Add the fastpath here */ &_tnl_vertex_transform_stage, &_tnl_normal_transform_stage, - &_tnl_lighting_stage, /* OMIT: fog coordinate stage */ + &_tnl_lighting_stage, + &_tnl_fog_coordinate_stage, /* TODO: Omit fog stage */ &_tnl_texgen_stage, &_tnl_texture_transform_stage, &_tnl_point_attenuation_stage, - &_fx_fast_render_stage, /* ADD: the fastpath as a render stage */ + &fx_render_stage, /* ADD: render simple unclipped vb's */ &_tnl_render_stage, /* KEEP: the old render stage for fallbacks */ - 0 + 0, }; -#else -/* Need to turn off tnl fogging, both the stage and the clipping in - * _tnl_render_stage. Could insert a dummy stage that did nothing but - * provided storage that clipping could spin on? - */ -#endif + @@ -771,6 +769,9 @@ int fxDDInitFxMesaContext( fxMesaContext fxMesa ) _tnl_CreateContext( fxMesa->glCtx ); _swsetup_CreateContext( fxMesa->glCtx ); + _tnl_destroy_pipeline( fxMesa->glCtx ); + _tnl_install_pipeline( fxMesa->glCtx, fx_pipeline ); + fxAllocVB( fxMesa->glCtx ); fxSetupDDPointers(fxMesa->glCtx); @@ -780,6 +781,11 @@ int fxDDInitFxMesaContext( fxMesaContext fxMesa ) _swrast_allow_vertex_fog( fxMesa->glCtx, GL_FALSE ); _swrast_allow_pixel_fog( fxMesa->glCtx, GL_TRUE ); + /* Tell tnl not to calculate or use vertex fog factors. (Needed to + * tell render stage not to clip fog coords). + */ +/* _tnl_calculate_vertex_fog( fxMesa->glCtx, GL_FALSE ); */ + fxDDInitExtensions(fxMesa->glCtx); #ifdef FXVTXFMT -- cgit v1.2.3