- if (st->pipe->screen && st->pipe->screen->update_buffer)
- st->pipe->screen->update_buffer( st->pipe->screen,
- st->pipe->priv );
+ if (!st->invalidate_on_gl_viewport)
+ return;
+
+ /*
+ * Normally we'd want the state tracker manager to mark the drawables
+ * invalid only when needed. This will force the state tracker manager
+ * to revalidate the drawable, rather than just update the context with
+ * the latest cached drawable info.
+ */
+
+ stdraw = st_ws_framebuffer(st->ctx->DrawBuffer);
+ stread = st_ws_framebuffer(st->ctx->ReadBuffer);
+
+ if (stdraw)
+ stdraw->iface_stamp = p_atomic_read(&stdraw->iface->stamp) - 1;
+ if (stread && stread != stdraw)
+ stread->iface_stamp = p_atomic_read(&stread->iface->stamp) - 1;