OSDN Git Service

st/nine: Implement NineDevice9_GetAvailableTextureMem
authorPatrick Rudolph <siro@das-labor.org>
Wed, 30 Sep 2015 14:42:10 +0000 (16:42 +0200)
committerAxel Davy <axel.davy@ens.fr>
Thu, 4 Feb 2016 21:12:17 +0000 (22:12 +0100)
commit1a893ac8869a0be08582f3b224d1a92ff37fc400
tree6912bfddcb4c3f75a5b7343fd46dc1738d496ca5
parenta961ec335d5f38c07181e4956341c9b4cca59fa4
st/nine: Implement NineDevice9_GetAvailableTextureMem

Implement a device private memory counter similar to Win 7.

Only textures and surfaces increment vidmem and may return
ERR_OUTOFVIDEOMEMORY. Vertexbuffers and indexbuffers creation always
succeedes, even when out of video memory.

Fixes "Vampire: The Masquerade - Bloodlines" allocating resources until crash.
Fixes "Age of Conan" allocating resources until crash.
Fixes failing WINE test device.c test_vidmem_accounting().

Signed-off-by: Patrick Rudolph <siro@das-labor.org>
Reviewed-by: Axel Davy <axel.davy@ens.fr>
src/gallium/state_trackers/nine/device9.c
src/gallium/state_trackers/nine/device9.h
src/gallium/state_trackers/nine/resource9.c
src/gallium/state_trackers/nine/resource9.h