2000-12-26 05:09:27 +00:00
|
|
|
/*
|
|
|
|
* Mesa 3-D graphics library
|
2005-09-14 14:32:20 +00:00
|
|
|
* Version: 6.5
|
2000-12-26 05:09:27 +00:00
|
|
|
*
|
2006-04-11 11:41:11 +00:00
|
|
|
* Copyright (C) 1999-2006 Brian Paul All Rights Reserved.
|
2000-12-26 05:09:27 +00:00
|
|
|
*
|
|
|
|
* Permission is hereby granted, free of charge, to any person obtaining a
|
|
|
|
* copy of this software and associated documentation files (the "Software"),
|
|
|
|
* to deal in the Software without restriction, including without limitation
|
|
|
|
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
|
|
|
|
* and/or sell copies of the Software, and to permit persons to whom the
|
|
|
|
* Software is furnished to do so, subject to the following conditions:
|
|
|
|
*
|
|
|
|
* The above copyright notice and this permission notice shall be included
|
|
|
|
* in all copies or substantial portions of the Software.
|
|
|
|
*
|
|
|
|
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
|
|
|
|
* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
|
|
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
|
|
|
|
* BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
|
|
|
|
* AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
|
|
|
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
|
|
*
|
|
|
|
* Authors:
|
2002-10-29 20:28:36 +00:00
|
|
|
* Keith Whitwell <keith@tungstengraphics.com>
|
2000-12-26 05:09:27 +00:00
|
|
|
*/
|
|
|
|
|
|
|
|
|
2003-11-24 15:23:18 +00:00
|
|
|
#include "api_arrayelt.h"
|
2000-12-26 05:09:27 +00:00
|
|
|
#include "glheader.h"
|
2002-10-24 23:57:19 +00:00
|
|
|
#include "imports.h"
|
2004-01-05 09:43:42 +00:00
|
|
|
#include "context.h"
|
2000-12-26 05:09:27 +00:00
|
|
|
#include "macros.h"
|
2000-11-22 07:32:16 +00:00
|
|
|
#include "mtypes.h"
|
2000-11-24 15:21:59 +00:00
|
|
|
#include "dlist.h"
|
2002-02-13 00:53:19 +00:00
|
|
|
#include "light.h"
|
2000-11-24 10:25:05 +00:00
|
|
|
#include "vtxfmt.h"
|
2000-11-16 21:05:34 +00:00
|
|
|
|
2005-06-27 00:45:36 +00:00
|
|
|
#include "tnl.h"
|
2000-12-26 05:09:27 +00:00
|
|
|
#include "t_array_api.h"
|
2005-06-27 00:45:36 +00:00
|
|
|
#include "t_context.h"
|
2000-11-16 21:05:34 +00:00
|
|
|
#include "t_pipeline.h"
|
2005-06-27 00:45:36 +00:00
|
|
|
#include "t_save_api.h"
|
|
|
|
#include "t_vp_build.h"
|
|
|
|
#include "t_vtx_api.h"
|
2000-11-16 21:05:34 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
2000-11-24 10:25:05 +00:00
|
|
|
static void
|
|
|
|
install_driver_callbacks( GLcontext *ctx )
|
|
|
|
{
|
|
|
|
ctx->Driver.NewList = _tnl_NewList;
|
|
|
|
ctx->Driver.EndList = _tnl_EndList;
|
2003-11-24 15:23:18 +00:00
|
|
|
ctx->Driver.FlushVertices = _tnl_FlushVertices;
|
|
|
|
ctx->Driver.SaveFlushVertices = _tnl_SaveFlushVertices;
|
2000-12-26 05:09:27 +00:00
|
|
|
ctx->Driver.BeginCallList = _tnl_BeginCallList;
|
|
|
|
ctx->Driver.EndCallList = _tnl_EndCallList;
|
2000-11-24 10:25:05 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
2000-11-16 21:05:34 +00:00
|
|
|
GLboolean
|
|
|
|
_tnl_CreateContext( GLcontext *ctx )
|
|
|
|
{
|
|
|
|
TNLcontext *tnl;
|
|
|
|
|
|
|
|
/* Create the TNLcontext structure
|
|
|
|
*/
|
2001-03-07 05:06:11 +00:00
|
|
|
ctx->swtnl_context = tnl = (TNLcontext *) CALLOC( sizeof(TNLcontext) );
|
2001-01-08 21:55:59 +00:00
|
|
|
|
2000-11-16 21:05:34 +00:00
|
|
|
if (!tnl) {
|
|
|
|
return GL_FALSE;
|
|
|
|
}
|
|
|
|
|
2005-09-16 18:14:24 +00:00
|
|
|
if (_mesa_getenv("MESA_CODEGEN"))
|
2004-04-05 06:49:36 +00:00
|
|
|
tnl->AllowCodegen = GL_TRUE;
|
|
|
|
|
2000-12-26 05:09:27 +00:00
|
|
|
/* Initialize the VB.
|
2000-11-16 21:05:34 +00:00
|
|
|
*/
|
2003-11-24 15:23:18 +00:00
|
|
|
tnl->vb.Size = ctx->Const.MaxArrayLockSize + MAX_CLIPPED_VERTICES;
|
2000-11-16 21:05:34 +00:00
|
|
|
|
|
|
|
|
2000-12-26 05:09:27 +00:00
|
|
|
/* Initialize tnl state and tnl->vtxfmt.
|
2000-11-16 21:05:34 +00:00
|
|
|
*/
|
2003-11-24 15:23:18 +00:00
|
|
|
_tnl_save_init( ctx );
|
2000-12-26 05:09:27 +00:00
|
|
|
_tnl_array_init( ctx );
|
2003-11-24 15:23:18 +00:00
|
|
|
_tnl_vtx_init( ctx );
|
2005-06-09 14:55:34 +00:00
|
|
|
|
2005-11-01 15:43:06 +00:00
|
|
|
if (ctx->_MaintainTnlProgram) {
|
2005-12-06 15:41:43 +00:00
|
|
|
tnl->vp_cache = (struct tnl_cache *) MALLOC(sizeof(*tnl->vp_cache));
|
2005-11-01 15:43:06 +00:00
|
|
|
tnl->vp_cache->size = 5;
|
|
|
|
tnl->vp_cache->n_items = 0;
|
2005-12-06 15:41:43 +00:00
|
|
|
tnl->vp_cache->items = (struct tnl_cache_item**)
|
|
|
|
_mesa_malloc(tnl->vp_cache->size * sizeof(*tnl->vp_cache->items));
|
2005-11-01 15:43:06 +00:00
|
|
|
_mesa_memset(tnl->vp_cache->items, 0, tnl->vp_cache->size *
|
|
|
|
sizeof(*tnl->vp_cache->items));
|
|
|
|
|
2005-06-09 14:55:34 +00:00
|
|
|
_tnl_install_pipeline( ctx, _tnl_vp_pipeline );
|
2005-11-01 15:43:06 +00:00
|
|
|
} else {
|
2005-06-09 14:55:34 +00:00
|
|
|
_tnl_install_pipeline( ctx, _tnl_default_pipeline );
|
2005-11-01 15:43:06 +00:00
|
|
|
}
|
2000-11-16 21:05:34 +00:00
|
|
|
|
2003-11-24 15:23:18 +00:00
|
|
|
/* Initialize the arrayelt helper
|
|
|
|
*/
|
|
|
|
if (!_ae_create_context( ctx ))
|
|
|
|
return GL_FALSE;
|
|
|
|
|
2001-01-13 05:48:25 +00:00
|
|
|
|
2001-12-18 04:06:44 +00:00
|
|
|
tnl->NeedNdcCoords = GL_TRUE;
|
2001-06-04 16:09:28 +00:00
|
|
|
tnl->LoopbackDListCassettes = GL_FALSE;
|
2001-06-28 17:34:14 +00:00
|
|
|
tnl->CalcDListNormalLengths = GL_TRUE;
|
2004-02-17 21:03:03 +00:00
|
|
|
tnl->AllowVertexFog = GL_TRUE;
|
2004-02-24 16:10:52 +00:00
|
|
|
tnl->AllowPixelFog = GL_TRUE;
|
Support for swappable tnl modules.
Core Mesa provides a neutral tnl module that verifies the currently
module before installing the tnl function pointers in a lazy fashion.
It also records which tnl functions have been swapped out, and only
restores these when tnl modules themselves are swapped.
Fallback strategies:
Drivers set a bitmask of dangerous stage changes. When such a state
change occurs, the driver should restore the neutral tnl module via
_mesa_restore_exec_vtxfmt(). The neutral tnl module will call
_mesa_update_state(), followed by ctx->Driver.ValidateTnlModule() if the
validation bitmask matches the new state bitmask. The driver should
call _tnl_wakeup_exec() if it can no longer handle the current state,
which will revert to the default tnl module. In this case, previous
vertices should be replayed as required (depending on the current
primitive) after the new tnl module is installed.
If the driver uses chooser functions for any part of the tnl module,
these should generally be reinstalled as part of the fallback to the
neutral tnl module. For example, if the lighting state changes, a
driver might fall back to the neutral tnl module, verify that the
current lighting state can be handled, and use the chooser function to
pick the most efficient implementation of the current lighting state.
It is up to the drivers to detect and handle fallback cases caused by
tnl function calls themselves (such as glTexCoord4f* if the current tnl
module can't handle projected textures, for example).
2001-03-11 18:49:11 +00:00
|
|
|
|
2000-11-24 10:25:05 +00:00
|
|
|
/* Hook our functions into exec and compile dispatch tables.
|
|
|
|
*/
|
2003-11-24 15:23:18 +00:00
|
|
|
_mesa_install_exec_vtxfmt( ctx, &tnl->exec_vtxfmt );
|
2002-04-09 16:56:50 +00:00
|
|
|
|
2000-11-16 21:05:34 +00:00
|
|
|
|
2000-11-24 10:25:05 +00:00
|
|
|
/* Set a few default values in the driver struct.
|
2000-11-16 21:05:34 +00:00
|
|
|
*/
|
2000-11-24 10:25:05 +00:00
|
|
|
install_driver_callbacks(ctx);
|
2003-11-24 15:23:18 +00:00
|
|
|
ctx->Driver.NeedFlush = 0;
|
2000-12-26 05:09:27 +00:00
|
|
|
ctx->Driver.CurrentExecPrimitive = PRIM_OUTSIDE_BEGIN_END;
|
|
|
|
ctx->Driver.CurrentSavePrimitive = PRIM_UNKNOWN;
|
2001-03-19 02:25:35 +00:00
|
|
|
|
2001-07-12 22:09:21 +00:00
|
|
|
tnl->Driver.Render.PrimTabElts = _tnl_render_tab_elts;
|
|
|
|
tnl->Driver.Render.PrimTabVerts = _tnl_render_tab_verts;
|
2002-02-13 00:53:19 +00:00
|
|
|
tnl->Driver.NotifyMaterialChange = _mesa_validate_all_lighting_tables;
|
2005-04-22 12:51:19 +00:00
|
|
|
|
2000-11-16 21:05:34 +00:00
|
|
|
return GL_TRUE;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void
|
|
|
|
_tnl_DestroyContext( GLcontext *ctx )
|
|
|
|
{
|
|
|
|
TNLcontext *tnl = TNL_CONTEXT(ctx);
|
|
|
|
|
2000-12-26 05:09:27 +00:00
|
|
|
_tnl_array_destroy( ctx );
|
2003-11-24 15:23:18 +00:00
|
|
|
_tnl_vtx_destroy( ctx );
|
|
|
|
_tnl_save_destroy( ctx );
|
2000-12-26 05:09:27 +00:00
|
|
|
_tnl_destroy_pipeline( ctx );
|
2003-12-13 01:55:49 +00:00
|
|
|
_ae_destroy_context( ctx );
|
2000-11-16 21:05:34 +00:00
|
|
|
|
2005-11-01 15:43:06 +00:00
|
|
|
if (ctx->_MaintainTnlProgram)
|
|
|
|
_tnl_ProgramCacheDestroy( ctx );
|
2005-06-09 14:55:34 +00:00
|
|
|
|
2000-12-26 05:09:27 +00:00
|
|
|
FREE(tnl);
|
2005-02-10 10:57:22 +00:00
|
|
|
ctx->swtnl_context = NULL;
|
2000-11-16 21:05:34 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2000-11-22 07:32:16 +00:00
|
|
|
void
|
2000-11-16 21:05:34 +00:00
|
|
|
_tnl_InvalidateState( GLcontext *ctx, GLuint new_state )
|
|
|
|
{
|
2000-12-26 05:09:27 +00:00
|
|
|
TNLcontext *tnl = TNL_CONTEXT(ctx);
|
2000-11-22 07:32:16 +00:00
|
|
|
|
2004-02-17 21:03:03 +00:00
|
|
|
if (new_state & (_NEW_HINT)) {
|
2004-02-24 16:10:52 +00:00
|
|
|
ASSERT(tnl->AllowVertexFog || tnl->AllowPixelFog);
|
|
|
|
tnl->_DoVertexFog = (tnl->AllowVertexFog && (ctx->Hint.Fog != GL_NICEST))
|
|
|
|
|| !tnl->AllowPixelFog;
|
2004-02-17 21:03:03 +00:00
|
|
|
}
|
|
|
|
|
2003-12-13 01:55:49 +00:00
|
|
|
_ae_invalidate_state(ctx, new_state);
|
|
|
|
|
2005-04-22 12:51:19 +00:00
|
|
|
tnl->pipeline.new_state |= new_state;
|
2003-11-24 15:23:18 +00:00
|
|
|
tnl->vtx.eval.new_state |= new_state;
|
2004-01-05 09:43:42 +00:00
|
|
|
|
|
|
|
/* Calculate tnl->render_inputs:
|
|
|
|
*/
|
|
|
|
if (ctx->Visual.rgbMode) {
|
2006-04-11 11:41:11 +00:00
|
|
|
GLuint i;
|
|
|
|
|
|
|
|
RENDERINPUTS_ZERO( tnl->render_inputs_bitset );
|
|
|
|
RENDERINPUTS_SET( tnl->render_inputs_bitset, _TNL_ATTRIB_POS );
|
|
|
|
RENDERINPUTS_SET( tnl->render_inputs_bitset, _TNL_ATTRIB_COLOR0 );
|
|
|
|
for (i = 0; i < ctx->Const.MaxTextureCoordUnits; i++) {
|
|
|
|
if (ctx->Texture._EnabledCoordUnits & (1 << i)) {
|
|
|
|
RENDERINPUTS_SET( tnl->render_inputs_bitset, _TNL_ATTRIB_TEX(i) );
|
|
|
|
}
|
|
|
|
}
|
2004-01-05 09:43:42 +00:00
|
|
|
|
|
|
|
if (NEED_SECONDARY_COLOR(ctx))
|
2006-04-11 11:41:11 +00:00
|
|
|
RENDERINPUTS_SET( tnl->render_inputs_bitset, _TNL_ATTRIB_COLOR1 );
|
2004-01-05 09:43:42 +00:00
|
|
|
}
|
|
|
|
else {
|
2006-04-11 11:41:11 +00:00
|
|
|
RENDERINPUTS_SET( tnl->render_inputs_bitset, _TNL_ATTRIB_POS );
|
2006-04-25 00:53:25 +00:00
|
|
|
RENDERINPUTS_SET( tnl->render_inputs_bitset, _TNL_ATTRIB_COLOR_INDEX );
|
2004-01-05 09:43:42 +00:00
|
|
|
}
|
2006-04-11 11:41:11 +00:00
|
|
|
|
2005-04-26 20:56:21 +00:00
|
|
|
if (ctx->Fog.Enabled ||
|
2005-05-10 11:40:52 +00:00
|
|
|
(ctx->FragmentProgram._Active &&
|
2006-04-11 11:41:11 +00:00
|
|
|
ctx->FragmentProgram._Current->FogOption != GL_NONE))
|
|
|
|
RENDERINPUTS_SET( tnl->render_inputs_bitset, _TNL_ATTRIB_FOG );
|
2004-01-05 09:43:42 +00:00
|
|
|
|
|
|
|
if (ctx->Polygon.FrontMode != GL_FILL ||
|
|
|
|
ctx->Polygon.BackMode != GL_FILL)
|
2006-04-11 11:41:11 +00:00
|
|
|
RENDERINPUTS_SET( tnl->render_inputs_bitset, _TNL_ATTRIB_EDGEFLAG );
|
2004-01-05 09:43:42 +00:00
|
|
|
|
|
|
|
if (ctx->RenderMode == GL_FEEDBACK)
|
2006-04-11 11:41:11 +00:00
|
|
|
RENDERINPUTS_SET( tnl->render_inputs_bitset, _TNL_ATTRIB_TEX0 );
|
2004-01-05 15:24:53 +00:00
|
|
|
|
|
|
|
if (ctx->Point._Attenuated ||
|
2004-04-23 14:16:46 +00:00
|
|
|
(ctx->VertexProgram._Enabled && ctx->VertexProgram.PointSizeEnabled))
|
2006-04-11 11:41:11 +00:00
|
|
|
RENDERINPUTS_SET( tnl->render_inputs_bitset, _TNL_ATTRIB_POINTSIZE );
|
|
|
|
|
|
|
|
if (ctx->ShaderObjects._VertexShaderPresent || ctx->ShaderObjects._FragmentShaderPresent)
|
|
|
|
RENDERINPUTS_SET_RANGE( tnl->render_inputs_bitset, _TNL_FIRST_ATTRIBUTE, _TNL_LAST_ATTRIBUTE );
|
2000-11-16 21:05:34 +00:00
|
|
|
}
|
|
|
|
|
2000-12-26 05:09:27 +00:00
|
|
|
|
2000-11-16 21:05:34 +00:00
|
|
|
void
|
2000-11-24 10:25:05 +00:00
|
|
|
_tnl_wakeup_exec( GLcontext *ctx )
|
2000-11-16 21:05:34 +00:00
|
|
|
{
|
2000-11-24 10:25:05 +00:00
|
|
|
TNLcontext *tnl = TNL_CONTEXT(ctx);
|
Support for swappable tnl modules.
Core Mesa provides a neutral tnl module that verifies the currently
module before installing the tnl function pointers in a lazy fashion.
It also records which tnl functions have been swapped out, and only
restores these when tnl modules themselves are swapped.
Fallback strategies:
Drivers set a bitmask of dangerous stage changes. When such a state
change occurs, the driver should restore the neutral tnl module via
_mesa_restore_exec_vtxfmt(). The neutral tnl module will call
_mesa_update_state(), followed by ctx->Driver.ValidateTnlModule() if the
validation bitmask matches the new state bitmask. The driver should
call _tnl_wakeup_exec() if it can no longer handle the current state,
which will revert to the default tnl module. In this case, previous
vertices should be replayed as required (depending on the current
primitive) after the new tnl module is installed.
If the driver uses chooser functions for any part of the tnl module,
these should generally be reinstalled as part of the fallback to the
neutral tnl module. For example, if the lighting state changes, a
driver might fall back to the neutral tnl module, verify that the
current lighting state can be handled, and use the chooser function to
pick the most efficient implementation of the current lighting state.
It is up to the drivers to detect and handle fallback cases caused by
tnl function calls themselves (such as glTexCoord4f* if the current tnl
module can't handle projected textures, for example).
2001-03-11 18:49:11 +00:00
|
|
|
|
2000-11-24 10:25:05 +00:00
|
|
|
install_driver_callbacks(ctx);
|
2000-12-26 05:09:27 +00:00
|
|
|
ctx->Driver.NeedFlush |= FLUSH_UPDATE_CURRENT;
|
2000-11-24 10:25:05 +00:00
|
|
|
|
|
|
|
/* Hook our functions into exec and compile dispatch tables.
|
|
|
|
*/
|
2003-11-24 15:23:18 +00:00
|
|
|
_mesa_install_exec_vtxfmt( ctx, &tnl->exec_vtxfmt );
|
2000-11-24 10:25:05 +00:00
|
|
|
|
|
|
|
/* Assume we haven't been getting state updates either:
|
|
|
|
*/
|
Support for swappable tnl modules.
Core Mesa provides a neutral tnl module that verifies the currently
module before installing the tnl function pointers in a lazy fashion.
It also records which tnl functions have been swapped out, and only
restores these when tnl modules themselves are swapped.
Fallback strategies:
Drivers set a bitmask of dangerous stage changes. When such a state
change occurs, the driver should restore the neutral tnl module via
_mesa_restore_exec_vtxfmt(). The neutral tnl module will call
_mesa_update_state(), followed by ctx->Driver.ValidateTnlModule() if the
validation bitmask matches the new state bitmask. The driver should
call _tnl_wakeup_exec() if it can no longer handle the current state,
which will revert to the default tnl module. In this case, previous
vertices should be replayed as required (depending on the current
primitive) after the new tnl module is installed.
If the driver uses chooser functions for any part of the tnl module,
these should generally be reinstalled as part of the fallback to the
neutral tnl module. For example, if the lighting state changes, a
driver might fall back to the neutral tnl module, verify that the
current lighting state can be handled, and use the chooser function to
pick the most efficient implementation of the current lighting state.
It is up to the drivers to detect and handle fallback cases caused by
tnl function calls themselves (such as glTexCoord4f* if the current tnl
module can't handle projected textures, for example).
2001-03-11 18:49:11 +00:00
|
|
|
_tnl_InvalidateState( ctx, ~0 );
|
2002-08-21 10:39:59 +00:00
|
|
|
|
|
|
|
if (ctx->Light.ColorMaterialEnabled) {
|
2003-11-24 15:23:18 +00:00
|
|
|
_mesa_update_color_material( ctx,
|
|
|
|
ctx->Current.Attrib[VERT_ATTRIB_COLOR0] );
|
2002-08-21 10:39:59 +00:00
|
|
|
}
|
2000-11-16 21:05:34 +00:00
|
|
|
}
|
2000-11-24 10:25:05 +00:00
|
|
|
|
2000-12-26 05:09:27 +00:00
|
|
|
|
2000-11-24 10:25:05 +00:00
|
|
|
void
|
|
|
|
_tnl_wakeup_save_exec( GLcontext *ctx )
|
|
|
|
{
|
|
|
|
TNLcontext *tnl = TNL_CONTEXT(ctx);
|
|
|
|
|
|
|
|
_tnl_wakeup_exec( ctx );
|
2002-04-09 16:56:50 +00:00
|
|
|
_mesa_install_save_vtxfmt( ctx, &tnl->save_vtxfmt );
|
2000-11-24 10:25:05 +00:00
|
|
|
}
|
|
|
|
|
2001-01-13 05:48:25 +00:00
|
|
|
|
2003-02-04 14:40:56 +00:00
|
|
|
/**
|
|
|
|
* Drivers call this function to tell the TCL module whether or not
|
|
|
|
* it wants Normalized Device Coords (NDC) computed. I.e. whether
|
|
|
|
* we should "Divide-by-W". Software renders will want that.
|
|
|
|
*/
|
2001-01-13 05:48:25 +00:00
|
|
|
void
|
|
|
|
_tnl_need_projected_coords( GLcontext *ctx, GLboolean mode )
|
|
|
|
{
|
|
|
|
TNLcontext *tnl = TNL_CONTEXT(ctx);
|
2001-12-18 04:06:44 +00:00
|
|
|
if (tnl->NeedNdcCoords != mode) {
|
|
|
|
tnl->NeedNdcCoords = mode;
|
2001-01-13 05:48:25 +00:00
|
|
|
_tnl_InvalidateState( ctx, _NEW_PROJECTION );
|
|
|
|
}
|
|
|
|
}
|
2001-06-04 16:09:28 +00:00
|
|
|
|
|
|
|
void
|
|
|
|
_tnl_need_dlist_loopback( GLcontext *ctx, GLboolean mode )
|
|
|
|
{
|
|
|
|
TNLcontext *tnl = TNL_CONTEXT(ctx);
|
2002-02-13 00:53:19 +00:00
|
|
|
tnl->LoopbackDListCassettes = mode;
|
2001-06-04 16:09:28 +00:00
|
|
|
}
|
2001-06-28 17:34:14 +00:00
|
|
|
|
|
|
|
void
|
|
|
|
_tnl_need_dlist_norm_lengths( GLcontext *ctx, GLboolean mode )
|
|
|
|
{
|
|
|
|
TNLcontext *tnl = TNL_CONTEXT(ctx);
|
2002-02-13 00:53:19 +00:00
|
|
|
tnl->CalcDListNormalLengths = mode;
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
_tnl_isolate_materials( GLcontext *ctx, GLboolean mode )
|
|
|
|
{
|
|
|
|
TNLcontext *tnl = TNL_CONTEXT(ctx);
|
|
|
|
tnl->IsolateMaterials = mode;
|
2001-06-28 17:34:14 +00:00
|
|
|
}
|
2004-02-17 21:03:03 +00:00
|
|
|
|
|
|
|
void
|
|
|
|
_tnl_allow_vertex_fog( GLcontext *ctx, GLboolean value )
|
|
|
|
{
|
|
|
|
TNLcontext *tnl = TNL_CONTEXT(ctx);
|
|
|
|
tnl->AllowVertexFog = value;
|
2005-11-22 10:58:05 +00:00
|
|
|
tnl->_DoVertexFog = (tnl->AllowVertexFog && (ctx->Hint.Fog != GL_NICEST))
|
|
|
|
|| !tnl->AllowPixelFog;
|
|
|
|
|
2004-02-17 21:03:03 +00:00
|
|
|
}
|
|
|
|
|
2004-02-24 16:10:52 +00:00
|
|
|
void
|
|
|
|
_tnl_allow_pixel_fog( GLcontext *ctx, GLboolean value )
|
|
|
|
{
|
|
|
|
TNLcontext *tnl = TNL_CONTEXT(ctx);
|
|
|
|
tnl->AllowPixelFog = value;
|
2005-11-22 10:58:05 +00:00
|
|
|
tnl->_DoVertexFog = (tnl->AllowVertexFog && (ctx->Hint.Fog != GL_NICEST))
|
|
|
|
|| !tnl->AllowPixelFog;
|
2004-02-24 16:10:52 +00:00
|
|
|
}
|
|
|
|
|