diff options
-rw-r--r-- | src/mesa/state_tracker/st_framebuffer.c | 20 |
1 files changed, 19 insertions, 1 deletions
diff --git a/src/mesa/state_tracker/st_framebuffer.c b/src/mesa/state_tracker/st_framebuffer.c index 639373fff7..ef800291cc 100644 --- a/src/mesa/state_tracker/st_framebuffer.c +++ b/src/mesa/state_tracker/st_framebuffer.c @@ -297,7 +297,10 @@ st_notify_swapbuffers(struct st_framebuffer *stfb) * Swap the front/back color buffers. Exchange the front/back pointers * and update some derived state. * No need to call st_notify_swapbuffers() first. - * This is effectively a no-op for single-buffered framebuffers. + * + * For a single-buffered framebuffer, no swap occurs, but we still return + * the pointer(s) to the front color buffer(s). + * * \param front_left returns pointer to front-left renderbuffer after swap * \param front_right returns pointer to front-right renderbuffer after swap */ @@ -318,6 +321,21 @@ st_swapbuffers(struct st_framebuffer *stfb, NULL ); } + if (!fb->Visual.doubleBufferMode) { + /* single buffer mode - return pointers to front surfaces */ + if (front_left) { + struct st_renderbuffer *strb = + st_renderbuffer(fb->Attachment[BUFFER_FRONT_LEFT].Renderbuffer); + *front_left = strb->surface; + } + if (front_right) { + struct st_renderbuffer *strb = + st_renderbuffer(fb->Attachment[BUFFER_FRONT_RIGHT].Renderbuffer); + *front_right = strb ? strb->surface : NULL; + } + return; + } + /* swap left buffers */ if (fb->Attachment[BUFFER_FRONT_LEFT].Renderbuffer && fb->Attachment[BUFFER_BACK_LEFT].Renderbuffer) { |