diff options
author | Brian <[email protected]> | 2007-08-13 11:29:46 +0100 |
---|---|---|
committer | Brian <[email protected]> | 2007-08-13 11:29:46 +0100 |
commit | 9e01b915f1243a3f551cb795b7124bd1e52ca15f (patch) | |
tree | 8813956c0705bb9b8b85948480320b3ea5cfede8 /src/mesa/main/framebuffer.c | |
parent | 6f4725088842fbc0069aeb51f41907b87e0a8f08 (diff) |
Implement mutex/locking around texture object reference counting.
Use new _mesa_reference_texobj() function for referencing/unreferencing
textures. Add new assertions/tests to try to detect invalid usage of
deleted textures.
Diffstat (limited to 'src/mesa/main/framebuffer.c')
-rw-r--r-- | src/mesa/main/framebuffer.c | 13 |
1 files changed, 4 insertions, 9 deletions
diff --git a/src/mesa/main/framebuffer.c b/src/mesa/main/framebuffer.c index c9b30d32528..0a6de12fb85 100644 --- a/src/mesa/main/framebuffer.c +++ b/src/mesa/main/framebuffer.c @@ -38,6 +38,7 @@ #include "fbobject.h" #include "framebuffer.h" #include "renderbuffer.h" +#include "texobj.h" @@ -192,17 +193,11 @@ _mesa_free_framebuffer_data(struct gl_framebuffer *fb) _mesa_reference_renderbuffer(&att->Renderbuffer, NULL); } if (att->Texture) { - /* render to texture */ - att->Texture->RefCount--; - if (att->Texture->RefCount == 0) { - GET_CURRENT_CONTEXT(ctx); - if (ctx) { - ctx->Driver.DeleteTexture(ctx, att->Texture); - } - } + _mesa_reference_texobj(&att->Texture, NULL); } + ASSERT(!att->Renderbuffer); + ASSERT(!att->Texture); att->Type = GL_NONE; - att->Texture = NULL; } /* unbind _Depth/_StencilBuffer to decr ref counts */ |