Skip to content

Commit

Permalink
st/nine: Upload managed buffers only at draw using them
Browse files Browse the repository at this point in the history
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:
#345

Signed-off-by: Axel Davy <davyaxel0@gmail.com>
  • Loading branch information
axeldavy committed Apr 27, 2019
1 parent f01ec48 commit b4e962e
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/gallium/state_trackers/nine/buffer9.h
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down

0 comments on commit b4e962e

Please sign in to comment.