st/nine: Call flush_resource before flush
authorAxel Davy <axel.davy@ens.fr>
Thu, 8 Oct 2015 22:08:43 +0000 (00:08 +0200)
committerAxel Davy <axel.davy@ens.fr>
Thu, 4 Feb 2016 21:12:17 +0000 (22:12 +0100)
flush_resource needs to be called before flush (for
fast clear resolve, etc).

Removes useless computation of resource (it is
already set correctly).

Signed-off-by: Axel Davy <axel.davy@ens.fr>
Reviewed-by: Patrick Rudolph <siro@das-labor.org>
src/gallium/state_trackers/nine/swapchain9.c

index 697df89592d6890d51d0cb5d51dc9df4d6891b4e..c8d3ca158903c87b4b65065583773bb5f3a1f3b0 100644 (file)
@@ -716,6 +716,10 @@ present( struct NineSwapChain9 *This,
         This->pipe->blit(This->pipe, &blit);
     }
 
+    /* The resource we present has to resolve fast clears
+     * if needed (and other things) */
+    This->pipe->flush_resource(This->pipe, resource);
+
     if (This->params.SwapEffect != D3DSWAPEFFECT_DISCARD)
         handle_draw_cursor_and_hud(This, resource);
 
@@ -741,12 +745,6 @@ bypass_rendering:
             return D3DERR_WASSTILLDRAWING;
     }
 
-    if (This->present_buffers)
-        resource = This->present_buffers[0];
-    else
-        resource = This->buffers[0]->base.resource;
-    This->pipe->flush_resource(This->pipe, resource);
-
     if (!This->enable_threadpool) {
         This->tasks[0]=NULL;
         fence = swap_fences_pop_front(This);