diff options
author | Eric Anholt <[email protected]> | 2020-05-11 13:46:33 -0700 |
---|---|---|
committer | Marge Bot <[email protected]> | 2020-05-12 21:19:50 +0000 |
commit | d393837332a07f53b9622ca55149e63947e0f937 (patch) | |
tree | 189344029cd048b12f4821a16f1a30347cdf9322 /src | |
parent | 3e424bcdfcef19682f9b651f7c1a04e32f18be5c (diff) |
freedreno: Add an early out for preparing to read a resource.
nohw drawoverhead 8 UBOs test throughput 1.06093% +/- 0.363376% (n=10).
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4996>
Diffstat (limited to 'src')
-rw-r--r-- | src/gallium/drivers/freedreno/freedreno_batch.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/gallium/drivers/freedreno/freedreno_batch.c b/src/gallium/drivers/freedreno/freedreno_batch.c index a653e0d91a8..3ee150fce75 100644 --- a/src/gallium/drivers/freedreno/freedreno_batch.c +++ b/src/gallium/drivers/freedreno/freedreno_batch.c @@ -460,6 +460,13 @@ fd_batch_resource_read(struct fd_batch *batch, struct fd_resource *rsc) { fd_screen_assert_locked(batch->ctx->screen); + /* Early out, if we hit this then we know we don't have anyone else + * writing to it (since both _write and _read flush other writers), and + * that we've already recursed for stencil. + */ + if (likely(fd_batch_references_resource(batch, rsc))) + return; + if (rsc->stencil) fd_batch_resource_read(batch, rsc->stencil); |