summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorMarek Olšák <[email protected]>2019-04-26 22:51:33 -0400
committerMarek Olšák <[email protected]>2019-05-01 21:15:33 -0400
commit181dcf0792f021f9118b25505b71b461d8a83549 (patch)
tree2e9c0b01c8a1063dbf984883c8f9a38ffc5f2d28 /src
parent35294f2eca8b49193f1bcb8c62edbcc1537a9cc3 (diff)
st/mesa: don't flush the front buffer if it's a pbuffer
This is the best guess I can make here. Reviewed-by: Emil Velikov <[email protected]>
Diffstat (limited to 'src')
-rw-r--r--src/mesa/state_tracker/st_manager.c16
1 files changed, 13 insertions, 3 deletions
diff --git a/src/mesa/state_tracker/st_manager.c b/src/mesa/state_tracker/st_manager.c
index 5efbd1fa1d2..bee1f6b1366 100644
--- a/src/mesa/state_tracker/st_manager.c
+++ b/src/mesa/state_tracker/st_manager.c
@@ -1130,9 +1130,19 @@ st_manager_flush_frontbuffer(struct st_context *st)
struct st_framebuffer *stfb = st_ws_framebuffer(st->ctx->DrawBuffer);
struct st_renderbuffer *strb = NULL;
- if (stfb)
- strb = st_renderbuffer(stfb->Base.Attachment[BUFFER_FRONT_LEFT].
- Renderbuffer);
+ if (!stfb)
+ return;
+
+ /* If the context uses a doublebuffered visual, but the buffer is
+ * single-buffered, guess that it's a pbuffer, which doesn't need
+ * flushing.
+ */
+ if (st->ctx->Visual.doubleBufferMode &&
+ !stfb->Base.Visual.doubleBufferMode)
+ return;
+
+ strb = st_renderbuffer(stfb->Base.Attachment[BUFFER_FRONT_LEFT].
+ Renderbuffer);
/* Do we have a front color buffer and has it been drawn to since last
* frontbuffer flush?