diff options
Diffstat (limited to 'src/mesa/main/context.c')
-rw-r--r-- | src/mesa/main/context.c | 42 |
1 files changed, 32 insertions, 10 deletions
diff --git a/src/mesa/main/context.c b/src/mesa/main/context.c index 779d11061b3..1b4911ddc55 100644 --- a/src/mesa/main/context.c +++ b/src/mesa/main/context.c @@ -126,7 +126,7 @@ #include "math/m_matrix.h" #include "math/m_xform.h" #include "math/mathmod.h" -#endif
+#endif #include "shaderobjects.h" #ifdef USE_SPARC_ASM @@ -866,8 +866,8 @@ alloc_shared_state( GLcontext *ctx ) goto cleanup; #endif - ss->BufferObjects = _mesa_NewHashTable();
-
+ ss->BufferObjects = _mesa_NewHashTable(); + ss->GL2Objects = _mesa_NewHashTable (); ss->Default1D = (*ctx->Driver.NewTextureObject)(ctx, 0, GL_TEXTURE_1D); @@ -897,6 +897,16 @@ alloc_shared_state( GLcontext *ctx ) ss->DefaultCubeMap->RefCount += MAX_TEXTURE_IMAGE_UNITS; ss->DefaultRect->RefCount += MAX_TEXTURE_IMAGE_UNITS; +#if FEATURE_EXT_framebuffer_object + ss->FrameBuffers = _mesa_NewHashTable(); + if (!ss->FrameBuffers) + goto cleanup; + ss->RenderBuffers = _mesa_NewHashTable(); + if (!ss->RenderBuffers) + goto cleanup; +#endif + + return GL_TRUE; cleanup: @@ -924,11 +934,18 @@ alloc_shared_state( GLcontext *ctx ) #if FEATURE_ARB_vertex_buffer_object if (ss->BufferObjects) _mesa_DeleteHashTable(ss->BufferObjects); -#endif
-
- if (ss->GL2Objects)
+#endif + + if (ss->GL2Objects) _mesa_DeleteHashTable (ss->GL2Objects); +#if FEATURE_EXT_framebuffer_object + if (ss->FrameBuffers) + _mesa_DeleteHashTable(ss->FrameBuffers); + if (ss->RenderBuffers) + _mesa_DeleteHashTable(ss->RenderBuffers); +#endif + if (ss->Default1D) (*ctx->Driver.DeleteTexture)(ctx, ss->Default1D); if (ss->Default2D) @@ -1024,9 +1041,14 @@ free_shared_state( GLcontext *ctx, struct gl_shared_state *ss ) #if FEATURE_ARB_vertex_buffer_object _mesa_DeleteHashTable(ss->BufferObjects); -#endif
-
- _mesa_DeleteHashTable (ss->GL2Objects);
+#endif + + _mesa_DeleteHashTable (ss->GL2Objects); + +#if FEATURE_EXT_framebuffer_object + _mesa_DeleteHashTable(ss->FrameBuffers); + _mesa_DeleteHashTable(ss->RenderBuffers); +#endif _glthread_DESTROY_MUTEX(ss->Mutex); @@ -1187,7 +1209,7 @@ init_attrib_groups( GLcontext *ctx ) _mesa_init_point( ctx ); _mesa_init_polygon( ctx ); _mesa_init_program( ctx ); - _mesa_init_rastpos( ctx );
+ _mesa_init_rastpos( ctx ); _mesa_init_shaderobjects (ctx); _mesa_init_stencil( ctx ); _mesa_init_transform( ctx ); |