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>
This commit is contained in:
Eric Anholt 2020-05-11 13:46:33 -07:00 committed by Marge Bot
parent 3e424bcdfc
commit d393837332
1 changed files with 7 additions and 0 deletions

View File

@ -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);