freedreno: fix glReadPixels
authorRob Clark <robclark@freedesktop.org>
Thu, 19 Sep 2013 14:08:38 +0000 (10:08 -0400)
committerRob Clark <robclark@freedesktop.org>
Thu, 19 Sep 2013 15:45:01 +0000 (11:45 -0400)
duh, we still need to flush if there are pending draws and it isn't an
unsynchronized case.

Signed-off-by: Rob Clark <robclark@freedesktop.org>
src/gallium/drivers/freedreno/freedreno_resource.c

index fd975cb388d5961d37e66debd7770f9ffe0a1e16..bae1874ed3d4be2e7aea33e67751c8ce28f240ae 100644 (file)
@@ -123,8 +123,8 @@ fd_resource_transfer_map(struct pipe_context *pctx,
                op |= DRM_FREEDRENO_PREP_NOSYNC;
 
        /* some state trackers (at least XA) don't do this.. */
-//     if (!(usage & PIPE_TRANSFER_FLUSH_EXPLICIT))
-//             fd_resource_transfer_flush_region(pctx, ptrans, box);
+       if (!(usage & (PIPE_TRANSFER_FLUSH_EXPLICIT | PIPE_TRANSFER_DISCARD_WHOLE_RESOURCE)))
+               fd_resource_transfer_flush_region(pctx, ptrans, box);
 
        if (!(usage & PIPE_TRANSFER_UNSYNCHRONIZED)) {
                ret = fd_bo_cpu_prep(rsc->bo, ctx->screen->pipe, op);