We currently select front-buffers as new back-buffer if they happen to be
the last buffer in our framebuffer-array. Fix this by never selecting a
new front buffer as back buffer.
fb = fb_from_base(pipe->base.fbs[i]);
if (counter != 0 && counter == pipe->counter && fb->flipid == counter) {
pipe->base.front = &fb->base;
+ fb->flipid = 0;
flipped = true;
- }
-
- if (counter - fb->flipid < UINT16_MAX) {
+ } else if (counter - fb->flipid < UINT16_MAX) {
fb->flipid = 0;
back = fb;
} else if (fb->flipid == 0) {
}
}
- if (!pipe->base.back)
+ if (!pipe->base.back && back)
pipe->base.back = &back->base;
if (flipped) {