st/nine: Upload managed buffers only at draw using them

When a draw call is emited, buffers in the
device->update_buffers list are uploaded.

This patch removes buffers from the list if they
are not bound anymore.

Behaviour found studying:
https://github.com/iXit/Mesa-3D/issues/345

Signed-off-by: Axel Davy <davyaxel0@gmail.com>
This commit is contained in:
Axel Davy 2019-04-04 23:06:44 +02:00
parent 5df96995ef
commit bb3b8f8e01
1 changed files with 4 additions and 1 deletions

View File

@ -125,8 +125,11 @@ NineBindBufferToDevice( struct NineDevice9 *device,
list_add(&buf->managed.list, &device->update_buffers);
buf->bind_count++;
}
if (old)
if (old) {
old->bind_count--;
if (!old->bind_count && old->managed.dirty)
list_delinit(&old->managed.list);
}
nine_bind(slot, buf);
}