st/wgl: fix double-present on swapbuffers bug
authorBrian Paul <brianp@vmware.com>
Tue, 16 Jun 2015 01:14:42 +0000 (19:14 -0600)
committerJose Fonseca <jfonseca@vmware.com>
Mon, 9 Nov 2015 11:25:59 +0000 (11:25 +0000)
commit75d1e363ff142b273b30d8cd236bb1c92c1b2f27
tree087bf343f81b1a1202e6526939525a8372f7b81c
parent8083943e2e5b3f2a7201650a586b597dff481d43
st/wgl: fix double-present on swapbuffers bug

The stw_st_framebuffer_present_locked() function was getting called
twice per SwapBuffers.  First, when st_context_iface::flush() was
called from DrvSwapBuffers() because the ST_FLUSH_FRONT flag was
given.  Second, by stw_st_swap_framebuffer_locked() which does the
actual SwapBuffers.

Two code changes:
1. Pass ST_FLUSH_END_OF_FRAME, instead of ST_FLUSH_FRONT.
2. Move the implementation of stw_flush_current_locked() into
DrvSwapBuffers() since it's not called anywhere else.

Not much change in perf for benchmarks like Lightsmark, but some simple
Mesa demos are measurably faster.

Reviewed-by: José Fonseca <jfonseca@vmware.com>
src/gallium/state_trackers/wgl/stw_context.c
src/gallium/state_trackers/wgl/stw_context.h
src/gallium/state_trackers/wgl/stw_framebuffer.c