aboutsummaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/vc4/vc4_resource.c
diff options
context:
space:
mode:
authorEric Anholt <[email protected]>2016-09-08 12:56:11 -0700
committerEric Anholt <[email protected]>2016-09-14 06:25:41 +0100
commitf597ac3966405934e13a9aaa18c73211b5a40c7c (patch)
treef7f09bead790e4cdd210e1ed0ca4c4b150dbe35e /src/gallium/drivers/vc4/vc4_resource.c
parentf473348468ae1c68e7ef8eaf29f2cc51d17fbec7 (diff)
vc4: Implement job shuffling
Track rendering to each FBO independently and flush rendering only when necessary. This lets us avoid the overhead of storing and loading the frame when an application momentarily switches to rendering to some other texture in order to continue rendering the main scene. Improves glmark -b desktop:effect=shadow:windows=4 by 27% Improves glmark -b desktop:blur-radius=5:effect=blur:passes=1:separable=true:windows=4 by 17% While I haven't tested other apps, this should help X rendering a lot, and I've heard GLBenchmark needed it too.
Diffstat (limited to 'src/gallium/drivers/vc4/vc4_resource.c')
-rw-r--r--src/gallium/drivers/vc4/vc4_resource.c17
1 files changed, 8 insertions, 9 deletions
diff --git a/src/gallium/drivers/vc4/vc4_resource.c b/src/gallium/drivers/vc4/vc4_resource.c
index 12469ea192e..bfa8f40ba13 100644
--- a/src/gallium/drivers/vc4/vc4_resource.c
+++ b/src/gallium/drivers/vc4/vc4_resource.c
@@ -115,7 +115,6 @@ vc4_resource_transfer_unmap(struct pipe_context *pctx,
blit.filter = PIPE_TEX_FILTER_NEAREST;
pctx->blit(pctx, &blit);
- vc4_flush(pctx);
pipe_resource_reference(&trans->ss_resource, NULL);
}
@@ -178,20 +177,20 @@ vc4_resource_transfer_map(struct pipe_context *pctx,
if (prsc->bind & PIPE_BIND_VERTEX_BUFFER)
vc4->dirty |= VC4_DIRTY_VTXBUF;
} else {
- /* If we failed to reallocate, flush everything so
- * that we don't violate any syncing requirements.
+ /* If we failed to reallocate, flush users so that we
+ * don't violate any syncing requirements.
*/
- vc4_flush(pctx);
+ vc4_flush_jobs_reading_resource(vc4, prsc);
}
} else if (!(usage & PIPE_TRANSFER_UNSYNCHRONIZED)) {
/* If we're writing and the buffer is being used by the CL, we
* have to flush the CL first. If we're only reading, we need
* to flush if the CL has written our buffer.
*/
- if (vc4_cl_references_bo(pctx, rsc->bo,
- usage & PIPE_TRANSFER_WRITE)) {
- vc4_flush(pctx);
- }
+ if (usage & PIPE_TRANSFER_WRITE)
+ vc4_flush_jobs_reading_resource(vc4, prsc);
+ else
+ vc4_flush_jobs_writing_resource(vc4, prsc);
}
if (usage & PIPE_TRANSFER_WRITE)
@@ -245,7 +244,7 @@ vc4_resource_transfer_map(struct pipe_context *pctx,
blit.filter = PIPE_TEX_FILTER_NEAREST;
pctx->blit(pctx, &blit);
- vc4_flush(pctx);
+ vc4_flush_jobs_writing_resource(vc4, blit.dst.resource);
}
/* The rest of the mapping process should use our temporary. */