r600g: Flush upload buffers before draws instead of before flushes.
authorHenri Verbeet <hverbeet@gmail.com>
Sun, 19 Sep 2010 17:27:30 +0000 (19:27 +0200)
committerHenri Verbeet <hverbeet@gmail.com>
Sun, 19 Sep 2010 17:43:05 +0000 (19:43 +0200)
commita1d9a58b825825723f1c5f7705f2ed3ef834038a
tree7fde0b98f73428750390542b4e536092a53292e8
parent2a910b339672e80e70d49d01ac7e8e870068e7ad
r600g: Flush upload buffers before draws instead of before flushes.

If a upload buffer is used by a previous draw that's still in the CS,
accessing it would need a context flush. However, doing a context flush when
mapping the upload buffer would then flush/destroy the same buffer we're trying
to map there. Flushing the upload buffers before a draw avoids both the CS
flush and the upload buffer going away while it's being used. Note that
u_upload_data() could e.g. use a pool of buffers instead of allocating new
ones all the time if that turns out to be a significant issue.
src/gallium/drivers/r600/r600_context.c
src/gallium/drivers/r600/r600_draw.c