summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEric Anholt <[email protected]>2009-11-04 14:31:30 -0800
committerEric Anholt <[email protected]>2009-11-06 11:37:32 -0800
commit6b68482e6869bdc03339ef5380d7273e14a61a56 (patch)
tree823064919194d773de661f066844194f5225f482
parent8df81bca1704aef2f5cdc4052ef313d8f84f5d06 (diff)
mesa: Attempt to pair up Driver.RenderTexture and FinishRenderTexture()
This is probably not 100% complete (bind vs unbind may still not pair up exactly), but it should help out drivers which are relying on FinishRenderTexture to be called when we're done rendering to a particular texture level, not just when we're done rendering to the object at all. This is the case for the one consumer of FinishRenderTexture() so far: the gallium state tracker. Noticed when trying to make use of FRT() in the intel driver.
-rw-r--r--src/mesa/main/fbobject.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/mesa/main/fbobject.c b/src/mesa/main/fbobject.c
index 319d0f2ce97..c4454550dbc 100644
--- a/src/mesa/main/fbobject.c
+++ b/src/mesa/main/fbobject.c
@@ -233,9 +233,13 @@ _mesa_set_texture_attachment(GLcontext *ctx,
if (att->Texture == texObj) {
/* re-attaching same texture */
ASSERT(att->Type == GL_TEXTURE);
+ if (ctx->Driver.FinishRenderTexture)
+ ctx->Driver.FinishRenderTexture(ctx, att);
}
else {
/* new attachment */
+ if (ctx->Driver.FinishRenderTexture && att->Texture)
+ ctx->Driver.FinishRenderTexture(ctx, att);
_mesa_remove_attachment(ctx, att);
att->Type = GL_TEXTURE;
assert(!att->Texture);