diff options
author | keithw <keithw> | 2004-05-19 19:05:40 +0000 |
---|---|---|
committer | keithw <keithw> | 2004-05-19 19:05:40 +0000 |
commit | 2ac1c5e72a3ca2abe3db5800468392e723f15b28 (patch) | |
tree | 05b27e70d6d4d403712ffbbc7b152602029b4be8 | |
parent | eba751722a5ab6e82c433f0c4687f0ca26c74ec9 (diff) |
Disable non-threadsafe code with prejudice...i865-agp-0-1-branch
-rw-r--r-- | xc/extras/Mesa/src/tnl/t_context.c | 7 | ||||
-rw-r--r-- | xc/extras/Mesa/src/tnl/t_context.h | 20 | ||||
-rw-r--r-- | xc/extras/Mesa/src/tnl/t_imm_dlist.c | 4 | ||||
-rw-r--r-- | xc/extras/Mesa/src/tnl/t_imm_exec.c | 17 |
4 files changed, 18 insertions, 30 deletions
diff --git a/xc/extras/Mesa/src/tnl/t_context.c b/xc/extras/Mesa/src/tnl/t_context.c index 906953712..650143fbf 100644 --- a/xc/extras/Mesa/src/tnl/t_context.c +++ b/xc/extras/Mesa/src/tnl/t_context.c @@ -45,19 +45,12 @@ #include "t_pipeline.h" #include "tnl.h" -#ifndef THREADS -struct immediate *_tnl_CurrentInput = NULL; -#endif - void _tnl_MakeCurrent( GLcontext *ctx, GLframebuffer *drawBuffer, GLframebuffer *readBuffer ) { -#ifndef THREADS - SET_IMMEDIATE( ctx, TNL_CURRENT_IM(ctx) ); -#endif } diff --git a/xc/extras/Mesa/src/tnl/t_context.h b/xc/extras/Mesa/src/tnl/t_context.h index 396406ccb..3201bbfaa 100644 --- a/xc/extras/Mesa/src/tnl/t_context.h +++ b/xc/extras/Mesa/src/tnl/t_context.h @@ -564,18 +564,18 @@ extern void _tnl_MakeCurrent( GLcontext *ctx, /* * Macros for fetching current input buffer. */ -#ifdef THREADS #define GET_IMMEDIATE struct immediate *IM = TNL_CURRENT_IM(((GLcontext *) (_glapi_Context ? _glapi_Context : _glapi_get_context()))) -#define SET_IMMEDIATE(ctx, im) ctx->swtnl_im = (void *)im -#else -extern struct immediate *_tnl_CurrentInput; -#define GET_IMMEDIATE struct immediate *IM = _tnl_CurrentInput -#define SET_IMMEDIATE(ctx, im) \ -do { \ - ctx->swtnl_im = (void *)im; \ - _tnl_CurrentInput = im; \ + +#define SET_IMMEDIATE(ctx, im) \ +do { \ + if (!ctx->swtnl_im) \ + fprintf(stderr, "Previously zero immediate in %s:%d, now %p\n", \ + __FUNCTION__, __LINE__, (void *)im); \ + if (!im) \ + fprintf(stderr, "Setting zero immediate in %s:%d, previously %p\n",\ + __FUNCTION__, __LINE__, ctx->swtnl_im); \ + ctx->swtnl_im = (void *)im; \ } while (0) -#endif #endif diff --git a/xc/extras/Mesa/src/tnl/t_imm_dlist.c b/xc/extras/Mesa/src/tnl/t_imm_dlist.c index e74c944a8..6ecfc7b85 100644 --- a/xc/extras/Mesa/src/tnl/t_imm_dlist.c +++ b/xc/extras/Mesa/src/tnl/t_imm_dlist.c @@ -447,7 +447,7 @@ _tnl_EndList( GLcontext *ctx ) { struct immediate *IM = TNL_CURRENT_IM(ctx); - ctx->swtnl_im = 0; + SET_IMMEDIATE( ctx, NULL ); IM->ref_count--; /* outside begin/end, even in COMPILE_AND_EXEC, @@ -461,7 +461,7 @@ _tnl_EndList( GLcontext *ctx ) if (IM->ref_count != 0) IM = _tnl_alloc_immediate( ctx ); - ASSERT(IM->ref_count == 0); + assert(IM->ref_count == 0); SET_IMMEDIATE( ctx, IM ); IM->ref_count++; diff --git a/xc/extras/Mesa/src/tnl/t_imm_exec.c b/xc/extras/Mesa/src/tnl/t_imm_exec.c index 64c970118..9c2663c31 100644 --- a/xc/extras/Mesa/src/tnl/t_imm_exec.c +++ b/xc/extras/Mesa/src/tnl/t_imm_exec.c @@ -529,20 +529,22 @@ void _tnl_imm_init( GLcontext *ctx ) struct vertex_arrays *tmp = &tnl->imm_inputs; GLuint i; static int firsttime = 1; + struct immediate *im; if (firsttime) { firsttime = 0; _tnl_imm_elt_init(); } - ctx->swtnl_im = _tnl_alloc_immediate( ctx ); - TNL_CURRENT_IM(ctx)->ref_count++; + im = _tnl_alloc_immediate( ctx ); + im->ref_count++; + SET_IMMEDIATE(ctx, im); tnl->ExecCopyTexSize = 0; tnl->ExecCopyCount = 0; tnl->ExecCopySource = 0; - TNL_CURRENT_IM(ctx)->CopyStart = IMM_MAX_COPIED_VERTS; + im->CopyStart = IMM_MAX_COPIED_VERTS; _mesa_vector4f_init( &tmp->Obj, 0, 0 ); _mesa_vector4f_init( &tmp->Normal, 0, 0 ); @@ -587,13 +589,6 @@ void _tnl_imm_destroy( GLcontext *ctx ) TNL_CURRENT_IM(ctx)->ref_count--; if (TNL_CURRENT_IM(ctx)->ref_count == 0) _tnl_free_immediate( ctx, TNL_CURRENT_IM(ctx) ); - /* - * Don't use SET_IMMEDIATE here, or else we'll whack the - * _tnl_CurrentInput pointer - not good when another - * context has already been made current. - * So we just set the context's own tnl immediate pointer - * to 0. - */ - ctx->swtnl_im = NULL; + SET_IMMEDIATE(ctx, NULL); } } |