summaryrefslogtreecommitdiffstats
path: root/src/mesa/main/texrender.c
diff options
context:
space:
mode:
authorBrian Paul <[email protected]>2005-12-01 00:25:00 +0000
committerBrian Paul <[email protected]>2005-12-01 00:25:00 +0000
commit0e31e02aef4fe44b1196d0bf6e351250d9d8f68c (patch)
tree6379cd4f13c215ec9ae544b7c090d6509b4e2948 /src/mesa/main/texrender.c
parentcf2702e3dbf41939a6be0a09f58b9578da88e910 (diff)
Added FinishRenderTexture() device driver function to indicate when
rendering to a texture has likely completed. Fixed refcount issue in texture renderbuffer wrapper.
Diffstat (limited to 'src/mesa/main/texrender.c')
-rw-r--r--src/mesa/main/texrender.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/mesa/main/texrender.c b/src/mesa/main/texrender.c
index 9c21e03515a..a4efe640382 100644
--- a/src/mesa/main/texrender.c
+++ b/src/mesa/main/texrender.c
@@ -124,6 +124,7 @@ texture_put_mono_values(GLcontext *ctx, struct gl_renderbuffer *rb,
static void
delete_texture_wrapper(struct gl_renderbuffer *rb)
{
+ ASSERT(rb->RefCount == 0);
_mesa_free(rb);
}
@@ -162,6 +163,7 @@ wrap_texture(GLcontext *ctx, struct gl_renderbuffer_attachment *att)
trb->Zoffset = att->Zoffset;
+ trb->Base.RefCount = 1;
trb->Base.Width = trb->TexImage->Width;
trb->Base.Height = trb->TexImage->Height;
trb->Base.InternalFormat = trb->TexImage->InternalFormat; /* XXX fix? */
@@ -213,8 +215,8 @@ _mesa_renderbuffer_texture(GLcontext *ctx,
if (texObj) {
_mesa_set_texture_attachment(ctx, att, texObj,
texTarget, level, zoffset);
-
- wrap_texture(ctx, att);
+ if (!att->Renderbuffer)
+ wrap_texture(ctx, att);
}
else {
_mesa_remove_attachment(ctx, att);