st/nine: Implement Managed vertex/index buffers

Graphics / Mesa 3D Graphics Library / Mesa - Axel Davy [ens.fr] - 12 February 2016 16:26 UTC

We were implementing those the same way than the default pool, which is sub-optimal.

The buffer is supposed to return pointer to a ram copy when user locks, and automatically update the vram copy when needed.

v2: Rename NineBuffer9_Validate to NineBuffer9_Upload Rename validate_buffers to update_managed_buffers Initialize NineBuffer9 managed fields after the resource is allocated. In case of allocation failure, when the dtor is executed, This->base.pool is then rightfully set.

cc0114f st/nine: Implement Managed vertex/index buffers
src/gallium/state_trackers/nine/buffer9.c | 77 +++++++++++++++++++++++---
src/gallium/state_trackers/nine/buffer9.h | 28 ++++++++++
src/gallium/state_trackers/nine/device9.c | 11 ++++
src/gallium/state_trackers/nine/device9.h | 2 +
src/gallium/state_trackers/nine/nine_state.c | 12 ++++
5 files changed, 121 insertions(+), 9 deletions(-)

Upstream: cgit.freedesktop.org


  • Share