From c8100a02d28c8a424f69723778abebd950914bc6 Mon Sep 17 00:00:00 2001 From: Keith Whitwell Date: Mon, 29 Mar 2004 11:05:02 +0000 Subject: First round of codegen for t_vtx_api.c -- ie the Begin/Vertex/End code. Enable with env var: MESA_CODEGEN=t. --- src/mesa/tnl/t_context.h | 28 ++++++++++++++++++++++++++-- 1 file changed, 26 insertions(+), 2 deletions(-) (limited to 'src/mesa/tnl/t_context.h') diff --git a/src/mesa/tnl/t_context.h b/src/mesa/tnl/t_context.h index 1293db3bf3..ec5675faf9 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? */ -- cgit v1.2.3