diff options
author | Eric Anholt <[email protected]> | 2016-04-15 14:27:34 -0700 |
---|---|---|
committer | Eric Anholt <[email protected]> | 2016-04-18 10:10:44 -0700 |
commit | 21a9ed620764bde2021aa7592cf2695dad8f3f74 (patch) | |
tree | db5a577aaef2a848d389716f85344f774eddfc9f /src/gallium/drivers/vc4/vc4_context.c | |
parent | 9e8a8b0c8be4a5e0542c915b982f04f25b34b2d8 (diff) |
vc4: Don't flush on read-only access of buffers read by the CL.
Fixes piglit mixed-immediate-and-vbo, and may significantly improve
performance of applications that store a 4-byte IB in the same VBO as
vertex data.
Diffstat (limited to 'src/gallium/drivers/vc4/vc4_context.c')
-rw-r--r-- | src/gallium/drivers/vc4/vc4_context.c | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/src/gallium/drivers/vc4/vc4_context.c b/src/gallium/drivers/vc4/vc4_context.c index a0888f23265..eeadea0b1db 100644 --- a/src/gallium/drivers/vc4/vc4_context.c +++ b/src/gallium/drivers/vc4/vc4_context.c @@ -133,7 +133,8 @@ vc4_pipe_flush(struct pipe_context *pctx, struct pipe_fence_handle **fence, * This helps avoid flushing the command buffers when unnecessary. */ bool -vc4_cl_references_bo(struct pipe_context *pctx, struct vc4_bo *bo) +vc4_cl_references_bo(struct pipe_context *pctx, struct vc4_bo *bo, + bool include_reads) { struct vc4_context *vc4 = vc4_context(pctx); @@ -143,10 +144,12 @@ vc4_cl_references_bo(struct pipe_context *pctx, struct vc4_bo *bo) /* Walk all the referenced BOs in the drawing command list to see if * they match. */ - struct vc4_bo **referenced_bos = vc4->bo_pointers.base; - for (int i = 0; i < cl_offset(&vc4->bo_handles) / 4; i++) { - if (referenced_bos[i] == bo) { - return true; + if (include_reads) { + struct vc4_bo **referenced_bos = vc4->bo_pointers.base; + for (int i = 0; i < cl_offset(&vc4->bo_handles) / 4; i++) { + if (referenced_bos[i] == bo) { + return true; + } } } |