mesa: display list clean-ups

Rename some structs and fields to be more consistant with the rest of mesa.
This commit is contained in:
Brian
2009-01-31 11:57:22 -07:00
parent 7721bf267b
commit 446abc2799
7 changed files with 45 additions and 41 deletions
+1 -1
View File
@@ -581,7 +581,7 @@ static void
delete_displaylist_cb(GLuint id, void *data, void *userData)
{
#if FEATURE_dlist
struct mesa_display_list *list = (struct mesa_display_list *) data;
struct gl_display_list *list = (struct gl_display_list *) data;
GLcontext *ctx = (GLcontext *) userData;
_mesa_delete_list(ctx, list);
#endif
+2 -2
View File
@@ -34,7 +34,7 @@
/* THIS FILE ONLY INCLUDED BY mtypes.h !!!!! */
struct gl_pixelstore_attrib;
struct mesa_display_list;
struct gl_display_list;
/**
* Device driver function table.
@@ -999,7 +999,7 @@ struct dd_function_table {
* Notify the T&L component before and after calling a display list.
*/
void (*BeginCallList)( GLcontext *ctx,
struct mesa_display_list *dlist );
struct gl_display_list *dlist );
/**
* Called by glEndCallList().
*
+21 -17
View File
@@ -370,7 +370,7 @@ typedef enum
* contiguous nodes in memory.
* Each node is the union of a variety of data types.
*/
union node
union gl_dlist_node
{
OpCode opcode;
GLboolean b;
@@ -387,6 +387,9 @@ union node
};
typedef union gl_dlist_node Node;
/**
* How many nodes to allocate at a time.
*
@@ -414,13 +417,13 @@ void mesa_print_display_list(GLuint list);
* Make an empty display list. This is used by glGenLists() to
* reserve display list IDs.
*/
static struct mesa_display_list *
static struct gl_display_list *
make_list(GLuint list, GLuint count)
{
struct mesa_display_list *dlist = CALLOC_STRUCT(mesa_display_list);
dlist->id = list;
dlist->node = (Node *) _mesa_malloc(sizeof(Node) * count);
dlist->node[0].opcode = OPCODE_END_OF_LIST;
struct gl_display_list *dlist = CALLOC_STRUCT(gl_display_list);
dlist->Name = list;
dlist->Head = (Node *) _mesa_malloc(sizeof(Node) * count);
dlist->Head[0].opcode = OPCODE_END_OF_LIST;
return dlist;
}
@@ -428,10 +431,10 @@ make_list(GLuint list, GLuint count)
/**
* Lookup function to just encapsulate casting.
*/
static INLINE struct mesa_display_list *
static INLINE struct gl_display_list *
lookup_list(GLcontext *ctx, GLuint list)
{
return (struct mesa_display_list *)
return (struct gl_display_list *)
_mesa_HashLookup(ctx->Shared->DisplayList, list);
}
@@ -442,12 +445,12 @@ lookup_list(GLcontext *ctx, GLuint list)
* \param dlist - display list pointer
*/
void
_mesa_delete_list(GLcontext *ctx, struct mesa_display_list *dlist)
_mesa_delete_list(GLcontext *ctx, struct gl_display_list *dlist)
{
Node *n, *block;
GLboolean done;
n = block = dlist->node;
n = block = dlist->Head;
done = block ? GL_FALSE : GL_TRUE;
while (!done) {
@@ -596,7 +599,7 @@ _mesa_delete_list(GLcontext *ctx, struct mesa_display_list *dlist)
static void
destroy_list(GLcontext *ctx, GLuint list)
{
struct mesa_display_list *dlist;
struct gl_display_list *dlist;
if (list == 0)
return;
@@ -5731,7 +5734,7 @@ islist(GLcontext *ctx, GLuint list)
static void
execute_list(GLcontext *ctx, GLuint list)
{
struct mesa_display_list *dlist;
struct gl_display_list *dlist;
Node *n;
GLboolean done;
@@ -5752,7 +5755,7 @@ execute_list(GLcontext *ctx, GLuint list)
if (ctx->Driver.BeginCallList)
ctx->Driver.BeginCallList(ctx, dlist);
n = dlist->node;
n = dlist->Head;
done = GL_FALSE;
while (!done) {
@@ -6757,7 +6760,7 @@ _mesa_NewList(GLuint list, GLenum mode)
/* Allocate new display list */
ctx->ListState.CurrentListNum = list;
ctx->ListState.CurrentList = make_list(list, BLOCK_SIZE);
ctx->ListState.CurrentBlock = ctx->ListState.CurrentList->node;
ctx->ListState.CurrentBlock = ctx->ListState.CurrentList->Head;
ctx->ListState.CurrentListPtr = ctx->ListState.CurrentBlock;
ctx->ListState.CurrentPos = 0;
@@ -6805,7 +6808,8 @@ _mesa_EndList(void)
/* Destroy old list, if any */
destroy_list(ctx, ctx->ListState.CurrentListNum);
/* Install the list */
/* Install the new list */
_mesa_HashInsert(ctx->Shared->DisplayList, ctx->ListState.CurrentListNum,
ctx->ListState.CurrentList);
@@ -8209,7 +8213,7 @@ enum_string(GLenum k)
static void GLAPIENTRY
print_list(GLcontext *ctx, GLuint list)
{
struct mesa_display_list *dlist;
struct gl_display_list *dlist;
Node *n;
GLboolean done;
@@ -8222,7 +8226,7 @@ print_list(GLcontext *ctx, GLuint list)
if (!dlist)
return;
n = dlist->node;
n = dlist->Head;
_mesa_printf("START-LIST %u, address %p\n", list, (void *) n);
+1 -1
View File
@@ -39,7 +39,7 @@
#if _HAVE_FULL_GL
extern void
_mesa_delete_list(GLcontext *ctx, struct mesa_display_list *dlist);
_mesa_delete_list(GLcontext *ctx, struct gl_display_list *dlist);
extern void GLAPIENTRY _mesa_CallList( GLuint list );
+16 -16
View File
@@ -2848,13 +2848,6 @@ struct gl_matrix_stack
/*
* Forward declaration of display list data types:
*/
union node;
typedef union node Node;
/* This has to be included here. */
#include "dd.h"
@@ -2886,11 +2879,17 @@ struct gl_tnl_module
/**
* Strictly this is a tnl/ private concept, but it doesn't seem
* Display list flags.
* Strictly this is a tnl-private concept, but it doesn't seem
* worthwhile adding a tnl private structure just to hold this one bit
* of information:
*/
#define MESA_DLIST_DANGLING_REFS 0x1
#define DLIST_DANGLING_REFS 0x1
/*
* Forward declaration of display list data types:
*/
union gl_dlist_node;
/**
@@ -2898,11 +2897,12 @@ struct gl_tnl_module
* collected. Could be extended with driverPrivate structures,
* etc. in the future.
*/
struct mesa_display_list
struct gl_display_list
{
Node *node; /**< The dlist commands are in a linked list of nodes */
GLuint id;
GLbitfield flags; /**< MESA_DLIST_x flags */
GLuint Name;
GLbitfield Flags; /**< DLIST_x flags */
/** The dlist commands are in a linked list of nodes */
union gl_dlist_node *Head;
};
@@ -2913,10 +2913,10 @@ struct gl_dlist_state
{
GLuint CallDepth; /**< Current recursion calling depth */
struct mesa_display_list *CurrentList;
Node *CurrentListPtr; /**< Head of list being compiled */
struct gl_display_list *CurrentList;
GLuint CurrentListNum; /**< Number of the list being compiled */
Node *CurrentBlock; /**< Pointer to current block of nodes */
union gl_dlist_node *CurrentListPtr; /**< Head of list being compiled */
union gl_dlist_node *CurrentBlock; /**< Pointer to current block of nodes */
GLuint CurrentPos; /**< Index into current block of nodes */
GLvertexformat ListVtxfmt;
+1 -1
View File
@@ -166,7 +166,7 @@ void vbo_loopback_vertex_list( GLcontext *ctx,
void vbo_save_EndList( GLcontext *ctx );
void vbo_save_NewList( GLcontext *ctx, GLuint list, GLenum mode );
void vbo_save_EndCallList( GLcontext *ctx );
void vbo_save_BeginCallList( GLcontext *ctx, struct mesa_display_list *list );
void vbo_save_BeginCallList( GLcontext *ctx, struct gl_display_list *list );
void vbo_save_SaveFlushVertices( GLcontext *ctx );
GLboolean vbo_save_NotifyBegin( GLcontext *ctx, GLenum mode );
+3 -3
View File
@@ -293,7 +293,7 @@ static void _save_compile_vertex_list( GLcontext *ctx )
node->count == 0);
if (save->dangling_attr_ref)
ctx->ListState.CurrentList->flags |= MESA_DLIST_DANGLING_REFS;
ctx->ListState.CurrentList->Flags |= DLIST_DANGLING_REFS;
save->vertex_store->used += save->vertex_size * node->count;
save->prim_store->used += node->prim_count;
@@ -1076,10 +1076,10 @@ void vbo_save_EndList( GLcontext *ctx )
assert(save->vertex_size == 0);
}
void vbo_save_BeginCallList( GLcontext *ctx, struct mesa_display_list *dlist )
void vbo_save_BeginCallList( GLcontext *ctx, struct gl_display_list *dlist )
{
struct vbo_save_context *save = &vbo_context(ctx)->save;
save->replay_flags |= dlist->flags;
save->replay_flags |= dlist->Flags;
}
void vbo_save_EndCallList( GLcontext *ctx )