mesa/st: Reduce the number of frontbuffer flush calls
authorThomas Hellstrom <thellstrom@vmware.com>
Tue, 20 Jun 2017 19:12:50 +0000 (21:12 +0200)
committerThomas Hellstrom <thellstrom@vmware.com>
Wed, 2 Aug 2017 09:55:35 +0000 (11:55 +0200)
commiteceb6710024716433069d705fbd873d6d136c2cc
treeef0895f5a8704536e1a02308861100af85bac934
parenteb88ece9e36cb4a5b09dcb800aa9e34ed4ba42c0
mesa/st: Reduce the number of frontbuffer flush calls

The mesa state tracker was needlessly flushing the front buffer even if it
hadn't been drawn to since the last flush. This was happening during
glXSwapBuffers if we at some point previously had set that frontbuffer as
a read- or draw renderbuffer, or at glFlush() or glFinish() if we at some
point previously had rendered to the front buffer. Since the frontbuffer
flush typically means a full drawable copy, it's a pretty big waste.

Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Reviewed-by: Sinclair Yeh <syeh@vmware.com>
src/mesa/state_tracker/st_cb_flush.c
src/mesa/state_tracker/st_manager.c