From 5fb84d263b8068467a2429942ecf113a0a4c8a60 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Wed, 24 May 2000 15:04:45 +0000 Subject: changed allocation/initialization of API dispatch tables --- src/mesa/main/state.c | 27 ++++++++++++--------------- 1 file changed, 12 insertions(+), 15 deletions(-) (limited to 'src/mesa/main/state.c') diff --git a/src/mesa/main/state.c b/src/mesa/main/state.c index 9eb8aafb675..a2ba03a02a4 100644 --- a/src/mesa/main/state.c +++ b/src/mesa/main/state.c @@ -1,4 +1,4 @@ -/* $Id: state.c,v 1.13 2000/05/23 20:10:50 brianp Exp $ */ +/* $Id: state.c,v 1.14 2000/05/24 15:04:45 brianp Exp $ */ /* * Mesa 3-D graphics library @@ -99,20 +99,17 @@ generic_noop(void) } +/* + * Set all pointers in the given dispatch table to point to a + * generic no-op function. + */ void -_mesa_init_no_op_table(struct _glapi_table *table) +_mesa_init_no_op_table(struct _glapi_table *table, GLuint tableSize) { - /* Check to be sure the dispatcher's table is at least as big as Mesa's. */ - const GLuint size = sizeof(struct _glapi_table) / sizeof(void *); - assert(_glapi_get_dispatch_table_size() >= size); - - { - const GLuint n = _glapi_get_dispatch_table_size(); - GLuint i; - void **dispatch = (void **) table; - for (i = 0; i < n; i++) { - dispatch[i] = (void *) generic_noop; - } + GLuint i; + void **dispatch = (void **) table; + for (i = 0; i < tableSize; i++) { + dispatch[i] = (void *) generic_noop; } } @@ -122,10 +119,10 @@ _mesa_init_no_op_table(struct _glapi_table *table) * immediate-mode commands. */ void -_mesa_init_exec_table(struct _glapi_table *exec) +_mesa_init_exec_table(struct _glapi_table *exec, GLuint tableSize) { /* first initialize all dispatch slots to no-op */ - _mesa_init_no_op_table(exec); + _mesa_init_no_op_table(exec, tableSize); /* load the dispatch slots we understand */ exec->Accum = _mesa_Accum; -- cgit v1.2.3