#include "context.h"
#include "convolve.h"
#include "depth.h"
-#if FEATURE_dlist
#include "dlist.h"
-#endif
#include "drawpix.h"
#include "rastpos.h"
#include "enable.h"
SET_Viewport(exec, _mesa_Viewport);
_mesa_init_accum_dispatch(exec);
+ _mesa_init_dlist_dispatch(exec);
-#if FEATURE_dlist
- SET_CallList(exec, _mesa_CallList);
- SET_CallLists(exec, _mesa_CallLists);
- SET_DeleteLists(exec, _mesa_DeleteLists);
- SET_EndList(exec, _mesa_EndList);
- SET_GenLists(exec, _mesa_GenLists);
- SET_IsList(exec, _mesa_IsList);
- SET_ListBase(exec, _mesa_ListBase);
- SET_NewList(exec, _mesa_NewList);
-#endif
SET_ClearDepth(exec, _mesa_ClearDepth);
SET_ClearIndex(exec, _mesa_ClearIndex);
SET_ClipPlane(exec, _mesa_ClipPlane);
#include "context.h"
#include "light.h"
#include "macros.h"
-#if FEATURE_dlist
#include "dlist.h"
-#endif
#include "eval.h"
#include "glapi/dispatch.h"
_MESA_INIT_ARRAYELT_VTXFMT(vfmt, _ae_);
vfmt->Begin = _mesa_noop_Begin;
-#if FEATURE_dlist
- vfmt->CallList = _mesa_CallList;
- vfmt->CallLists = _mesa_CallLists;
-#endif
+
+ _MESA_INIT_DLIST_VTXFMT(vfmt, _mesa_);
+
vfmt->Color3f = _mesa_noop_Color3f;
vfmt->Color3fv = _mesa_noop_Color3fv;
vfmt->Color4f = _mesa_noop_Color4f;
#include "cpuinfo.h"
#include "debug.h"
#include "depth.h"
-#if FEATURE_dlist
#include "dlist.h"
-#endif
#include "eval.h"
#include "enums.h"
#include "extensions.h"
_mesa_init_current( ctx );
_mesa_init_depth( ctx );
_mesa_init_debug( ctx );
-#if FEATURE_dlist
_mesa_init_display_list( ctx );
-#endif
_mesa_init_eval( ctx );
_mesa_init_fbobjects( ctx );
_mesa_init_feedback( ctx );
_mesa_init_exec_table(ctx->Exec);
#endif
ctx->CurrentDispatch = ctx->Exec;
+
#if FEATURE_dlist
- _mesa_init_dlist_table(ctx->Save);
+ _mesa_init_save_table(ctx->Save);
_mesa_install_save_vtxfmt( ctx, &ctx->ListState.ListVtxfmt );
#endif
+
/* Neutral tnl module stuff */
_mesa_init_exec_vtxfmt( ctx );
ctx->TnlModule.Current = NULL;
#include "texstate.h"
#include "mtypes.h"
#include "varray.h"
+#include "vtxfmt.h"
#if FEATURE_ARB_vertex_program || FEATURE_ARB_fragment_program
#include "shader/arbprogram.h"
#include "shader/program.h"
*/
static GLuint InstSize[OPCODE_END_OF_LIST + 1];
+
+#if FEATURE_dlist
+
+
void mesa_print_display_list(GLuint list);
ctx->Driver.CurrentSavePrimitive = PRIM_UNKNOWN;
}
-void GLAPIENTRY
-_mesa_save_CallList(GLuint list)
+static void GLAPIENTRY
+save_CallList(GLuint list)
{
GET_CURRENT_CONTEXT(ctx);
Node *n;
}
-void GLAPIENTRY
-_mesa_save_CallLists(GLsizei num, GLenum type, const GLvoid * lists)
+static void GLAPIENTRY
+save_CallLists(GLsizei num, GLenum type, const GLvoid * lists)
{
GET_CURRENT_CONTEXT(ctx);
GLint i;
/**
* Test if a display list number is valid.
*/
-GLboolean GLAPIENTRY
+static GLboolean GLAPIENTRY
_mesa_IsList(GLuint list)
{
GET_CURRENT_CONTEXT(ctx);
/**
* Delete a sequence of consecutive display lists.
*/
-void GLAPIENTRY
+static void GLAPIENTRY
_mesa_DeleteLists(GLuint list, GLsizei range)
{
GET_CURRENT_CONTEXT(ctx);
* Return a display list number, n, such that lists n through n+range-1
* are free.
*/
-GLuint GLAPIENTRY
+static GLuint GLAPIENTRY
_mesa_GenLists(GLsizei range)
{
GET_CURRENT_CONTEXT(ctx);
/**
* Begin a new display list.
*/
-void GLAPIENTRY
+static void GLAPIENTRY
_mesa_NewList(GLuint name, GLenum mode)
{
GET_CURRENT_CONTEXT(ctx);
/**
* End definition of current display list.
*/
-void GLAPIENTRY
+static void GLAPIENTRY
_mesa_EndList(void)
{
GET_CURRENT_CONTEXT(ctx);
/**
* Set the offset added to list numbers in glCallLists.
*/
-void GLAPIENTRY
+static void GLAPIENTRY
_mesa_ListBase(GLuint base)
{
GET_CURRENT_CONTEXT(ctx);
* struct.
*/
void
-_mesa_init_dlist_table(struct _glapi_table *table)
+_mesa_init_save_table(struct _glapi_table *table)
{
_mesa_loopback_init_api_table(table);
SET_AlphaFunc(table, save_AlphaFunc);
SET_Bitmap(table, save_Bitmap);
SET_BlendFunc(table, save_BlendFunc);
- SET_CallList(table, _mesa_save_CallList);
- SET_CallLists(table, _mesa_save_CallLists);
+ SET_CallList(table, save_CallList);
+ SET_CallLists(table, save_CallLists);
SET_Clear(table, save_Clear);
SET_ClearAccum(table, save_ClearAccum);
SET_ClearColor(table, save_ClearColor);
_MESA_INIT_ARRAYELT_VTXFMT(vfmt, _ae_);
vfmt->Begin = save_Begin;
- vfmt->CallList = _mesa_save_CallList;
- vfmt->CallLists = _mesa_save_CallLists;
+
+ _MESA_INIT_DLIST_VTXFMT(vfmt, save_);
+
vfmt->Color3f = save_Color3f;
vfmt->Color3fv = save_Color3fv;
vfmt->Color4f = save_Color4f;
}
+void
+_mesa_install_dlist_vtxfmt(struct _glapi_table *disp,
+ const GLvertexformat *vfmt)
+{
+ SET_CallList(disp, vfmt->CallList);
+ SET_CallLists(disp, vfmt->CallLists);
+}
+
+
+void _mesa_init_dlist_dispatch(struct _glapi_table *disp)
+{
+ SET_CallList(disp, _mesa_CallList);
+ SET_CallLists(disp, _mesa_CallLists);
+
+ SET_DeleteLists(disp, _mesa_DeleteLists);
+ SET_EndList(disp, _mesa_EndList);
+ SET_GenLists(disp, _mesa_GenLists);
+ SET_IsList(disp, _mesa_IsList);
+ SET_ListBase(disp, _mesa_ListBase);
+ SET_NewList(disp, _mesa_NewList);
+}
+
+
+#endif /* FEATURE_dlist */
+
+
/**
* Initialize display list state for given context.
*/
/* Display List group */
ctx->List.ListBase = 0;
+#if FEATURE_dlist
_mesa_save_vtxfmt_init(&ctx->ListState.ListVtxfmt);
+#endif
}
#define DLIST_H
-#include "mtypes.h"
+#include "main/mtypes.h"
-#if _HAVE_FULL_GL
+#if FEATURE_dlist
-extern void
-_mesa_delete_list(GLcontext *ctx, struct gl_display_list *dlist);
+#define _MESA_INIT_DLIST_FUNCTIONS(driver, impl) \
+ do { \
+ (driver)->NewList = impl ## NewList; \
+ (driver)->EndList = impl ## EndList; \
+ (driver)->BeginCallList = impl ## BeginCallList; \
+ (driver)->EndCallList = impl ## EndCallList; \
+ (driver)->SaveFlushVertices = impl ## SaveFlushVertices; \
+ (driver)->NotifySaveBegin = impl ## NotifyBegin; \
+ } while (0)
+
+#define _MESA_INIT_DLIST_VTXFMT(vfmt, impl) \
+ do { \
+ (vfmt)->CallList = impl ## CallList; \
+ (vfmt)->CallLists = impl ## CallLists; \
+ } while (0)
extern void GLAPIENTRY _mesa_CallList( GLuint list );
extern void GLAPIENTRY _mesa_CallLists( GLsizei n, GLenum type, const GLvoid *lists );
-extern void GLAPIENTRY _mesa_DeleteLists( GLuint list, GLsizei range );
-
-extern void GLAPIENTRY _mesa_EndList( void );
-
-extern GLuint GLAPIENTRY _mesa_GenLists( GLsizei range );
-
-extern GLboolean GLAPIENTRY _mesa_IsList( GLuint list );
-
-extern void GLAPIENTRY _mesa_ListBase( GLuint base );
-
-extern void GLAPIENTRY _mesa_NewList( GLuint list, GLenum mode );
-
-extern void GLAPIENTRY _mesa_save_CallLists( GLsizei n, GLenum type, const GLvoid *lists );
-
-extern void GLAPIENTRY _mesa_save_CallList( GLuint list );
-
-
-
-extern void _mesa_init_dlist_table( struct _glapi_table *table );
extern void _mesa_compile_error( GLcontext *ctx, GLenum error, const char *s );
-
extern void *_mesa_alloc_instruction(GLcontext *ctx, GLuint opcode, GLuint sz);
extern GLint _mesa_alloc_opcode( GLcontext *ctx, GLuint sz,
void (*destroy)( GLcontext *, void * ),
void (*print)( GLcontext *, void * ) );
-extern void _mesa_init_display_list( GLcontext * ctx );
+extern void _mesa_delete_list(GLcontext *ctx, struct gl_display_list *dlist);
extern void _mesa_save_vtxfmt_init( GLvertexformat *vfmt );
+extern void _mesa_init_save_table( struct _glapi_table *table );
+
+extern void _mesa_install_dlist_vtxfmt(struct _glapi_table *disp,
+ const GLvertexformat *vfmt);
+
+extern void _mesa_init_dlist_dispatch(struct _glapi_table *disp);
-#else
+#else /* FEATURE_dlist */
-/** No-op */
-#define _mesa_init_dlist_table(t,ts) ((void)0)
+#define _MESA_INIT_DLIST_FUNCTIONS(driver, impl) do { } while (0)
+#define _MESA_INIT_DLIST_VTXFMT(vfmt, impl) do { } while (0)
-/** No-op */
-#define _mesa_init_display_list(c) ((void)0)
+static INLINE void
+_mesa_delete_list(GLcontext *ctx, struct gl_display_list *dlist)
+{
+ /* there should be no list to delete */
+ ASSERT_NO_FEATURE();
+}
-/** No-op */
-#define _mesa_save_vtxfmt_init(v) ((void)0)
+static INLINE void
+_mesa_install_dlist_vtxfmt(struct _glapi_table *disp,
+ const GLvertexformat *vfmt)
+{
+}
+
+static INLINE void
+_mesa_init_dlist_dispatch(struct _glapi_table *disp)
+{
+}
+
+#endif /* FEATURE_dlist */
+
+extern void _mesa_init_display_list( GLcontext * ctx );
-#endif
-#endif
+#endif /* DLIST_H */
#include "shared.h"
#include "shader/program.h"
#include "shader/shader_api.h"
-#if FEATURE_dlist
#include "dlist.h"
-#endif
#if FEATURE_ATI_fragment_shader
#include "shader/atifragshader.h"
#endif
static void
delete_displaylist_cb(GLuint id, void *data, void *userData)
{
-#if FEATURE_dlist
struct gl_display_list *list = (struct gl_display_list *) data;
GLcontext *ctx = (GLcontext *) userData;
_mesa_delete_list(ctx, list);
-#endif
}
#include "state.h"
#include "vtxfmt.h"
#include "eval.h"
+#include "dlist.h"
/* The neutral vertex format. This wraps all tnl module functions,
SET_Vertex3fv(tab, vfmt->Vertex3fv);
SET_Vertex4f(tab, vfmt->Vertex4f);
SET_Vertex4fv(tab, vfmt->Vertex4fv);
- SET_CallList(tab, vfmt->CallList);
- SET_CallLists(tab, vfmt->CallLists);
+
+ _mesa_install_dlist_vtxfmt(tab, vfmt);
+
SET_Begin(tab, vfmt->Begin);
SET_End(tab, vfmt->End);
SET_Rectf(tab, vfmt->Rectf);
#include "main/context.h"
#include "main/macros.h"
#include "main/vtxfmt.h"
-#if FEATURE_dlist
#include "main/dlist.h"
-#endif
#include "main/eval.h"
#include "main/state.h"
#include "main/light.h"
_MESA_INIT_ARRAYELT_VTXFMT(vfmt, _ae_);
vfmt->Begin = vbo_exec_Begin;
-#if FEATURE_dlist
- vfmt->CallList = _mesa_CallList;
- vfmt->CallLists = _mesa_CallLists;
-#endif
vfmt->End = vbo_exec_End;
+ _MESA_INIT_DLIST_VTXFMT(vfmt, _mesa_);
_MESA_INIT_EVAL_VTXFMT(vfmt, vbo_exec_);
vfmt->Rectf = _mesa_noop_Rectf;
/* This will all require us to fallback to saving the list as opcodes:
*/
- vfmt->CallList = _save_CallList; /* inside begin/end */
- vfmt->CallLists = _save_CallLists; /* inside begin/end */
+ _MESA_INIT_DLIST_VTXFMT(vfmt, _save_); /* inside begin/end */
_MESA_INIT_EVAL_VTXFMT(vfmt, _save_);