diff options
author | Brian Paul <brian.paul@tungstengraphics.com> | 2008-04-09 18:39:51 -0600 |
---|---|---|
committer | Brian Paul <brian.paul@tungstengraphics.com> | 2008-04-09 18:39:51 -0600 |
commit | 311e40268414649f047ee177ba22a17a2d437843 (patch) | |
tree | 41aa5d3e308e25c1753eb882eb25d1bc80918316 /src/mesa/state_tracker/st_atom_framebuffer.c | |
parent | 54d7c399a888283711bdc00f93cb54a3ce0b30eb (diff) |
gallium: more elaborate tracking of front color buffer state
This fixes the case where the app calls SwapBuffers then calls glReadPixels
to read the front color buffer. We now keep track of when the front buffer
is a _logically_ copy of the back buffer (after SwapBuffers) and read from
the back color buffer instead of the front.
Diffstat (limited to 'src/mesa/state_tracker/st_atom_framebuffer.c')
-rw-r--r-- | src/mesa/state_tracker/st_atom_framebuffer.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/mesa/state_tracker/st_atom_framebuffer.c b/src/mesa/state_tracker/st_atom_framebuffer.c index 02573af8f0..8a95096ec9 100644 --- a/src/mesa/state_tracker/st_atom_framebuffer.c +++ b/src/mesa/state_tracker/st_atom_framebuffer.c @@ -81,6 +81,14 @@ update_framebuffer_state( struct st_context *st ) } cso_set_framebuffer(st->cso_context, framebuffer); + + if (fb->_ColorDrawBufferMask[0] & BUFFER_BIT_FRONT_LEFT) { + if (st->frontbuffer_status == FRONT_STATUS_COPY_OF_BACK) { + /* XXX copy back buf to front? */ + } + /* we're assuming we'll really draw to the front buffer */ + st->frontbuffer_status = FRONT_STATUS_DIRTY; + } } |