summaryrefslogtreecommitdiffstats
path: root/src/mesa/state_tracker/st_framebuffer.c
diff options
context:
space:
mode:
authorBrian Paul <[email protected]>2009-05-01 12:25:42 -0600
committerBrian Paul <[email protected]>2009-05-01 12:25:42 -0600
commitb85b315ebbe25efbd118887bdc87a562d4334fcc (patch)
tree1db456c924ce8f0247f56c27c409d5dc9a122127 /src/mesa/state_tracker/st_framebuffer.c
parent30b3d800917cc5b41ec508fd38a0ae1da8624a36 (diff)
st: added st_renderbuffer::defined flag
Indicates whether there's defined image contents, or garbage/don't care. This is set when we draw into a renderbuffer and cleared when we resize/ reallocate a renderbuffer or do a buffer swap (back buffer becomes undefined). We use this to determine whether the front color buffer has been drawn to, and whether to display its contents upon glFlush/Finish(), when the new st_swapbuffers() function is used.
Diffstat (limited to 'src/mesa/state_tracker/st_framebuffer.c')
-rw-r--r--src/mesa/state_tracker/st_framebuffer.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/mesa/state_tracker/st_framebuffer.c b/src/mesa/state_tracker/st_framebuffer.c
index 07ccaa6aab5..639373fff7e 100644
--- a/src/mesa/state_tracker/st_framebuffer.c
+++ b/src/mesa/state_tracker/st_framebuffer.c
@@ -331,6 +331,12 @@ st_swapbuffers(struct st_framebuffer *stfb,
st_renderbuffer(fb->Attachment[BUFFER_FRONT_LEFT].Renderbuffer);
*front_left = strb->surface;
}
+ /* mark back buffer contents as undefined */
+ {
+ struct st_renderbuffer *back =
+ st_renderbuffer(fb->Attachment[BUFFER_BACK_LEFT].Renderbuffer);
+ back->defined = GL_FALSE;
+ }
}
else {
/* no front buffer, display the back buffer */
@@ -354,6 +360,12 @@ st_swapbuffers(struct st_framebuffer *stfb,
st_renderbuffer(fb->Attachment[BUFFER_FRONT_RIGHT].Renderbuffer);
*front_right = strb->surface;
}
+ /* mark back buffer contents as undefined */
+ {
+ struct st_renderbuffer *back =
+ st_renderbuffer(fb->Attachment[BUFFER_BACK_RIGHT].Renderbuffer);
+ back->defined = GL_FALSE;
+ }
}
else {
/* no front right buffer, display back right buffer (if exists) */