diff options
author | Keith Whitwell <[email protected]> | 2004-03-29 11:05:02 +0000 |
---|---|---|
committer | Keith Whitwell <[email protected]> | 2004-03-29 11:05:02 +0000 |
commit | c8100a02d28c8a424f69723778abebd950914bc6 (patch) | |
tree | 65257db12171856ef0407402020afc61d1e0e201 /src/mesa/tnl/t_context.h | |
parent | 638ea113b962bfba322033ffc4658335a10cb865 (diff) |
First round of codegen for t_vtx_api.c -- ie the Begin/Vertex/End code.
Enable with env var: MESA_CODEGEN=t.
Diffstat (limited to 'src/mesa/tnl/t_context.h')
-rw-r--r-- | src/mesa/tnl/t_context.h | 28 |
1 files changed, 26 insertions, 2 deletions
diff --git a/src/mesa/tnl/t_context.h b/src/mesa/tnl/t_context.h index 1293db3bf3f..ec5675faf91 100644 --- a/src/mesa/tnl/t_context.h +++ b/src/mesa/tnl/t_context.h @@ -248,10 +248,28 @@ struct tnl_copied_vtx { #define VERT_BUFFER_SIZE 2048 /* 8kbytes */ -#define ERROR_ATTRIB _TNL_ATTRIB_MAX /* error path for t_vtx_api.c */ typedef void (*attrfv_func)( const GLfloat * ); +struct dynfn { + struct dynfn *next, *prev; + int key; + char *code; +}; + +struct dynfn_lists { + struct dynfn Vertex[4]; + struct dynfn Attribute[4]; +}; + +struct dynfn_generators { + struct dynfn *(*Vertex[4])( GLcontext *ctx, int key ); + struct dynfn *(*Attribute[4])( GLcontext *ctx, int key ); +}; + +#define _TNL_MAX_ATTR_CODEGEN 16 + + /* The assembly of vertices in immediate mode is separated from * display list compilation. This allows a simpler immediate mode * treatment and a display list compiler better suited to @@ -269,7 +287,12 @@ struct tnl_vtx { GLfloat *current[_TNL_ATTRIB_MAX]; /* points into ctx->Current, etc */ GLuint counter, initial_counter; struct tnl_copied_vtx copied; - attrfv_func tabfv[_TNL_ATTRIB_MAX+1][4]; /* +1 for ERROR_ATTRIB */ + + attrfv_func tabfv[_TNL_MAX_ATTR_CODEGEN+1][4]; /* plus 1 for ERROR_ATTRIB */ + + struct dynfn_lists cache; + struct dynfn_generators gen; + struct tnl_eval eval; GLboolean *edgeflag_tmp; GLboolean have_materials; @@ -714,6 +737,7 @@ typedef struct GLboolean IsolateMaterials; GLboolean AllowVertexFog; GLboolean AllowPixelFog; + GLboolean AllowCodegen; GLboolean _DoVertexFog; /* eval fog function at each vertex? */ |