diff options
author | Ilia Mirkin <imirkin@alum.mit.edu> | 2014-06-30 23:49:46 -0400 |
---|---|---|
committer | Ilia Mirkin <imirkin@alum.mit.edu> | 2014-07-03 20:01:07 -0400 |
commit | 5d4f5218bb71cb387f1a57ea08125245e5039e94 (patch) | |
tree | a4ee5a2356efd6d61f116bcf9e897546c07282a1 /src/gallium/drivers/nouveau/nv50/nv50_context.c | |
parent | b2b7c651221037266abee7c3ede1ca7b3cb2da33 (diff) | |
download | external_mesa3d-5d4f5218bb71cb387f1a57ea08125245e5039e94.zip external_mesa3d-5d4f5218bb71cb387f1a57ea08125245e5039e94.tar.gz external_mesa3d-5d4f5218bb71cb387f1a57ea08125245e5039e94.tar.bz2 |
nv50: do an explicit flush on draw when there are persistent buffers
Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Cc: "10.2" <mesa-stable@lists.freedesktop.org>
Diffstat (limited to 'src/gallium/drivers/nouveau/nv50/nv50_context.c')
-rw-r--r-- | src/gallium/drivers/nouveau/nv50/nv50_context.c | 22 |
1 files changed, 21 insertions, 1 deletions
diff --git a/src/gallium/drivers/nouveau/nv50/nv50_context.c b/src/gallium/drivers/nouveau/nv50/nv50_context.c index 3f3a888..c2eb0c0 100644 --- a/src/gallium/drivers/nouveau/nv50/nv50_context.c +++ b/src/gallium/drivers/nouveau/nv50/nv50_context.c @@ -61,7 +61,7 @@ static void nv50_memory_barrier(struct pipe_context *pipe, unsigned flags) { struct nv50_context *nv50 = nv50_context(pipe); - int i; + int i, s; if (flags & PIPE_BARRIER_MAPPED_BUFFER) { for (i = 0; i < nv50->num_vtxbufs; ++i) { @@ -74,6 +74,26 @@ nv50_memory_barrier(struct pipe_context *pipe, unsigned flags) if (nv50->idxbuf.buffer && nv50->idxbuf.buffer->flags & PIPE_RESOURCE_FLAG_MAP_PERSISTENT) nv50->base.vbo_dirty = TRUE; + + for (s = 0; s < 3 && !nv50->cb_dirty; ++s) { + uint32_t valid = nv50->constbuf_valid[s]; + + while (valid && !nv50->cb_dirty) { + const unsigned i = ffs(valid) - 1; + struct pipe_resource *res; + + valid &= ~(1 << i); + if (nv50->constbuf[s][i].user) + continue; + + res = nv50->constbuf[s][i].u.buf; + if (!res) + continue; + + if (res->flags & PIPE_RESOURCE_FLAG_MAP_PERSISTENT) + nv50->cb_dirty = TRUE; + } + } } } |