diff options
author | Rob Clark <[email protected]> | 2015-07-26 13:30:26 -0400 |
---|---|---|
committer | Rob Clark <[email protected]> | 2015-07-27 13:51:06 -0400 |
commit | bda1354aac9d32e236048af4d353d5530f644c34 (patch) | |
tree | c576969a93da91735c2136c6d9076c515369bb11 /src/gallium/drivers/freedreno/freedreno_resource.c | |
parent | 65d36a109a7dd333c15180a0f30ad919eb01d78f (diff) |
freedreno: add resource tracking support for written buffers
With stream-out (transform-feedback) we have the case where resources
are *written* by the gpu, which needs basically the same tracking to
figure out when rendering must be flushed.
Signed-off-by: Rob Clark <[email protected]>
Diffstat (limited to 'src/gallium/drivers/freedreno/freedreno_resource.c')
-rw-r--r-- | src/gallium/drivers/freedreno/freedreno_resource.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/gallium/drivers/freedreno/freedreno_resource.c b/src/gallium/drivers/freedreno/freedreno_resource.c index 20495779d50..de3cb64ed5b 100644 --- a/src/gallium/drivers/freedreno/freedreno_resource.c +++ b/src/gallium/drivers/freedreno/freedreno_resource.c @@ -97,7 +97,7 @@ realloc_bo(struct fd_resource *rsc, uint32_t size) rsc->bo = fd_bo_new(screen->dev, size, flags); rsc->timestamp = 0; - rsc->dirty = rsc->reading = false; + rsc->dirty = rsc->reading = rsc->writing = false; list_delinit(&rsc->list); util_range_set_empty(&rsc->valid_buffer_range); } @@ -239,7 +239,8 @@ fd_resource_transfer_map(struct pipe_context *pctx, * resource and we're trying to write to it, flush the renders. */ if (rsc->dirty || (rsc->stencil && rsc->stencil->dirty) || - ((ptrans->usage & PIPE_TRANSFER_WRITE) && rsc->reading)) + ((ptrans->usage & PIPE_TRANSFER_WRITE) && rsc->reading) || + ((ptrans->usage & PIPE_TRANSFER_READ) && rsc->writing)) fd_context_render(pctx); /* The GPU keeps track of how the various bo's are being used, and |