st/vdpau: flush the context before calling flush_frontbuffer
authorNayan Deshmukh <nayan26deshmukh@gmail.com>
Tue, 20 Sep 2016 04:52:11 +0000 (10:22 +0530)
committerChristian König <christian.koenig@amd.com>
Tue, 20 Sep 2016 09:18:07 +0000 (11:18 +0200)
so that the texture is rendered to back buffer before calling
flush_frontbuffer and can be copied to a different buffer in
the function

Signed-off-by: Nayan Deshmukh <nayan26deshmukh@gmail.com>
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
Acked-by: Christian König <christian.koenig@amd.com>
src/gallium/state_trackers/vdpau/presentation.c

index 2862eafa1da6202b5e6cf7cc979abd356374b741..f35d73a16ff6a1f3eeb2315ce1bc0c2a2bf97295 100644 (file)
@@ -271,11 +271,14 @@ vlVdpPresentationQueueDisplay(VdpPresentationQueue presentation_queue,
    }
 
    vscreen->set_next_timestamp(vscreen, earliest_presentation_time);
-   pipe->screen->flush_frontbuffer(pipe->screen, tex, 0, 0,
-                                   vscreen->get_private(vscreen), NULL);
 
+   // flush before calling flush_frontbuffer so that rendering is flushed
+   //  to back buffer so the texture can be copied in flush_frontbuffer
    pipe->screen->fence_reference(pipe->screen, &surf->fence, NULL);
    pipe->flush(pipe, &surf->fence, 0);
+   pipe->screen->flush_frontbuffer(pipe->screen, tex, 0, 0,
+                                   vscreen->get_private(vscreen), NULL);
+
    pq->last_surf = surf;
 
    if (dump_window == -1) {