X-Git-Url: https://git.libre-soc.org/?a=blobdiff_plain;f=src%2Fmesa%2Ftnl%2Ft_context.h;h=226b877d8525d705b6edf6fd996ce05478ab2375;hb=cd1cefae9146fc14b35ee93a04bdb1b1590fba7b;hp=62d260681ccea21b072fff7d1d0c0185ca61e6fd;hpb=ae8ec0b30d799c29034da5bf616b4e324d42d918;p=mesa.git diff --git a/src/mesa/tnl/t_context.h b/src/mesa/tnl/t_context.h index 62d260681cc..226b877d852 100644 --- a/src/mesa/tnl/t_context.h +++ b/src/mesa/tnl/t_context.h @@ -1,10 +1,10 @@ -/* $Id: t_context.h,v 1.8 2000/12/27 22:30:29 keithw Exp $ */ +/* $Id: t_context.h,v 1.28 2001/06/04 16:09:28 keithw Exp $ */ /* * Mesa 3-D graphics library * Version: 3.5 * - * Copyright (C) 1999 Brian Paul All Rights Reserved. + * Copyright (C) 1999-2001 Brian Paul All Rights Reserved. * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), @@ -48,7 +48,7 @@ #define IMM_SIZE (IMM_MAXDATA + MAX_CLIPPED_VERTICES) -/* Values for IM->BeginState +/* Values for IM->BeginState */ #define VERT_BEGIN_0 0x1 /* glBegin (if initially inside beg/end) */ #define VERT_BEGIN_1 0x2 /* glBegin (if initially outside beg/end) */ @@ -66,16 +66,16 @@ /* Flags that describe the inputs and outputs of pipeline stages, and - * the contents of a vertex-cassette. + * the contents of a vertex-cassette. * * 5 spare flags, rearrangement of eval flags can secure at least 3 - * more. + * more. */ -#define VERT_OBJ _NEW_ARRAY_VERTEX -#define VERT_RGBA _NEW_ARRAY_COLOR -#define VERT_NORM _NEW_ARRAY_NORMAL -#define VERT_INDEX _NEW_ARRAY_INDEX -#define VERT_EDGE _NEW_ARRAY_EDGEFLAG +#define VERT_OBJ _NEW_ARRAY_VERTEX +#define VERT_RGBA _NEW_ARRAY_COLOR +#define VERT_NORM _NEW_ARRAY_NORMAL +#define VERT_INDEX _NEW_ARRAY_INDEX +#define VERT_EDGE _NEW_ARRAY_EDGEFLAG #define VERT_SPEC_RGB _NEW_ARRAY_SECONDARYCOLOR #define VERT_FOG_COORD _NEW_ARRAY_FOGCOORD #define VERT_TEX0 _NEW_ARRAY_TEXCOORD_0 @@ -105,7 +105,7 @@ /* Flags for IM->TexCoordSize. Enough flags for 16 units. */ #define TEX_0_SIZE_3 0x1 -#define TEX_0_SIZE_4 0x1000 +#define TEX_0_SIZE_4 0x1001 #define TEX_SIZE_3(unit) (TEX_0_SIZE_3< vertices whose indexes are in the + * array. + */ + + void (*RenderClippedLine)( GLcontext *ctx, GLuint v0, GLuint v1 ); + /* Render a line between the two vertices given by indexes v0 and v1. */ + + points_func PointsFunc; /* must now respect vb->elts */ + line_func LineFunc; + triangle_func TriangleFunc; + quad_func QuadFunc; + /* These functions are called in order to render points, lines, + * triangles and quads. These are only called via the T&L module. + */ + + render_func *RenderTabVerts; + render_func *RenderTabElts; + /* Render whole unclipped primitives (points, lines, linestrips, + * lineloops, etc). The tables are indexed by the GL enum of the + * primitive to be rendered. RenderTabVerts is used for non-indexed + * arrays of vertices. RenderTabElts is used for indexed arrays of + * vertices. + */ + + void (*ResetLineStipple)( GLcontext *ctx ); + /* Reset the hardware's line stipple counter. + */ + + void (*BuildProjectedVertices)( GLcontext *ctx, + GLuint start, GLuint end, + GLuint new_inputs); + /* This function is called whenever new vertices are required for + * rendering. The vertices in question are those n such that start + * <= n < end. The new_inputs parameter indicates those fields of + * the vertex which need to be updated, if only a partial repair of + * the vertex is required. + * + * This function is called only from _tnl_render_stage in tnl/t_render.c. + */ + + + GLboolean (*MultipassFunc)( GLcontext *ctx, GLuint passno ); + /* Driver may request additional render passes by returning GL_TRUE + * when this function is called. This function will be called + * after the first pass, and passes will be made until the function + * returns GL_FALSE. If no function is registered, only one pass + * is made. + * + * This function will be first invoked with passno == 1. + */ }; -typedef struct { + +typedef struct { + + /* Driver interface. + */ + struct tnl_device_driver Driver; /* Track whether the module is active. */ @@ -386,16 +496,18 @@ typedef struct { GLuint *tmp_primitive; GLuint *tmp_primitive_length; - /* Set when executing an internally generated immediate. + /* Set when executing an internally generated begin/end object. If + * such an object is encountered in a display list, it will be + * replayed only if the list is outside any existing begin/end + * objects. */ - GLboolean ReplayHardBeginEnd; - GLenum CurrentPrimitive; + GLboolean ReplayHardBeginEnd; /* Note which vertices need copying over succesive immediates. * Will add save versions to precompute vertex copying where * possible. */ - struct immediate *ExecCopySource; + struct immediate *ExecCopySource; GLuint ExecCopyCount; GLuint ExecCopyElts[IMM_MAX_COPIED_VERTS]; GLuint ExecCopyTexSize; @@ -405,6 +517,15 @@ typedef struct { GLuint DlistPrimitiveLength; GLuint DlistLastPrimitive; + /* Cache a single free immediate (refcount == 0) + */ + struct immediate *freed_immediate; + + /* Probably need a better configuration mechanism: + */ + GLboolean NeedProjCoords; + GLboolean LoopbackDListCassettes; + /* Derived state and storage for _tnl_eval_vb: */ struct tnl_eval_store eval;