pipebuffer: Wait for the GPU to finish reading too.

No real change, as we're not tracking relocations read/write access yet.
This commit is contained in:
José Fonseca 2009-03-02 17:32:37 +00:00
parent 802a5ff507
commit 2c1d40a051

View file

@ -296,9 +296,10 @@ fenced_buffer_map(struct pb_buffer *buf,
assert(!(flags & ~PIPE_BUFFER_USAGE_CPU_READ_WRITE));
flags &= PIPE_BUFFER_USAGE_CPU_READ_WRITE;
/* Check for GPU read/write access */
if(fenced_buf->flags & PIPE_BUFFER_USAGE_GPU_WRITE) {
/* Wait for the GPU to finish writing */
/* Serialize writes */
if((fenced_buf->flags & PIPE_BUFFER_USAGE_GPU_WRITE) ||
((fenced_buf->flags & PIPE_BUFFER_USAGE_GPU_READ) && (flags & PIPE_BUFFER_USAGE_CPU_WRITE))) {
/* Wait for the GPU to finish */
_fenced_buffer_finish(fenced_buf);
}