summaryrefslogtreecommitdiffstats
path: root/src/mesa/state_tracker/st_framebuffer.c
diff options
context:
space:
mode:
authorBrian Paul <[email protected]>2008-12-10 18:00:59 -0700
committerBrian Paul <[email protected]>2008-12-10 18:06:38 -0700
commit8137da952b6f30329adf7d49d2d9e58625534dd4 (patch)
tree2a2ec6323406f23566964c287218ad36f227d560 /src/mesa/state_tracker/st_framebuffer.c
parent99b862cd77fb088d0b2e62c6c15ecef82ec4fb80 (diff)
gallium: only mark back color buffer surfaces as undefined after swapbuffers
Marking all surfaces as undefined was wrong and cause some glean failures because glReadPixels was used after SwapBuffers.
Diffstat (limited to 'src/mesa/state_tracker/st_framebuffer.c')
-rw-r--r--src/mesa/state_tracker/st_framebuffer.c20
1 files changed, 11 insertions, 9 deletions
diff --git a/src/mesa/state_tracker/st_framebuffer.c b/src/mesa/state_tracker/st_framebuffer.c
index 6ee1777fb7a..7d270a32729 100644
--- a/src/mesa/state_tracker/st_framebuffer.c
+++ b/src/mesa/state_tracker/st_framebuffer.c
@@ -284,15 +284,17 @@ st_notify_swapbuffers_complete(struct st_framebuffer *stfb)
if (ctx && ctx->DrawBuffer == &stfb->Base) {
struct st_renderbuffer *strb;
- int i;
-
- for (i = 0; i < BUFFER_COUNT; i++) {
- if (stfb->Base.Attachment[i].Renderbuffer) {
- strb = st_renderbuffer(stfb->Base.Attachment[i].Renderbuffer);
- if (strb->surface)
- strb->surface->status = PIPE_SURFACE_STATUS_UNDEFINED;
- }
- }
+
+ /* Mark back color buffers as undefined */
+ strb = st_renderbuffer(stfb->Base.Attachment[BUFFER_BACK_LEFT].
+ Renderbuffer);
+ if (strb && strb->surface)
+ strb->surface->status = PIPE_SURFACE_STATUS_UNDEFINED;
+
+ strb = st_renderbuffer(stfb->Base.Attachment[BUFFER_BACK_RIGHT].
+ Renderbuffer);
+ if (strb && strb->surface)
+ strb->surface->status = PIPE_SURFACE_STATUS_UNDEFINED;
}
}