Module: Mesa
Branch: master
Commit: fbda7958ff21ab8595ca7d601df6cf033a7eabf7
URL:    
http://cgit.freedesktop.org/mesa/mesa/commit/?id=fbda7958ff21ab8595ca7d601df6cf033a7eabf7

Author: Nicolai Hähnle <[email protected]>
Date:   Sun Oct 22 17:39:02 2017 +0200

st/mesa: remove redundant flushes from st_flush

st_flush should flush state tracker-internal state and the pipe, but
not mesa/main state. Of the four callers:

- glFlush/glFinish already call FLUSH_{VERTICES,STATE}.
- st_vdpau doesn't need to call them.
- st_manager will now call them explicitly.

Reviewed-by: Marek Olšák <[email protected]>

---

 src/mesa/state_tracker/st_cb_flush.c | 3 ---
 src/mesa/state_tracker/st_manager.c  | 3 +++
 src/mesa/state_tracker/st_vdpau.c    | 3 +++
 3 files changed, 6 insertions(+), 3 deletions(-)

diff --git a/src/mesa/state_tracker/st_cb_flush.c 
b/src/mesa/state_tracker/st_cb_flush.c
index d9ec0a846a..c8452d0e6f 100644
--- a/src/mesa/state_tracker/st_cb_flush.c
+++ b/src/mesa/state_tracker/st_cb_flush.c
@@ -50,9 +50,6 @@ void st_flush(struct st_context *st,
               struct pipe_fence_handle **fence,
               unsigned flags)
 {
-   FLUSH_VERTICES(st->ctx, 0);
-   FLUSH_CURRENT(st->ctx, 0);
-
    st_flush_bitmap_cache(st);
 
    st->pipe->flush(st->pipe, fence, flags);
diff --git a/src/mesa/state_tracker/st_manager.c 
b/src/mesa/state_tracker/st_manager.c
index d27727ae8f..953f7156c9 100644
--- a/src/mesa/state_tracker/st_manager.c
+++ b/src/mesa/state_tracker/st_manager.c
@@ -45,6 +45,7 @@
 #include "st_debug.h"
 #include "st_extensions.h"
 #include "st_format.h"
+#include "st_cb_bitmap.h"
 #include "st_cb_fbo.h"
 #include "st_cb_flush.h"
 #include "st_manager.h"
@@ -635,6 +636,8 @@ st_context_flush(struct st_context_iface *stctxi, unsigned 
flags,
       pipe_flags |= PIPE_FLUSH_END_OF_FRAME;
    }
 
+   FLUSH_VERTICES(st->ctx, 0);
+   FLUSH_CURRENT(st->ctx, 0);
    st_flush(st, fence, pipe_flags);
 
    if ((flags & ST_FLUSH_WAIT) && fence && *fence) {
diff --git a/src/mesa/state_tracker/st_vdpau.c 
b/src/mesa/state_tracker/st_vdpau.c
index 19611e719a..e0126cc03d 100644
--- a/src/mesa/state_tracker/st_vdpau.c
+++ b/src/mesa/state_tracker/st_vdpau.c
@@ -262,6 +262,9 @@ st_vdpau_unmap_surface(struct gl_context *ctx, GLenum 
target, GLenum access,
 
    _mesa_dirty_texobj(ctx, texObj);
 
+   /* NV_vdpau_interop does not specify an explicit synchronization mechanism
+    * between the GL and VDPAU contexts. Provide automatic synchronization 
here.
+    */
    st_flush(st, NULL, 0);
 }
 

_______________________________________________
mesa-commit mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/mesa-commit

Reply via email to