diff options
author | Axel Davy <[email protected]> | 2015-05-08 16:54:53 +0200 |
---|---|---|
committer | Axel Davy <[email protected]> | 2015-08-21 22:21:46 +0200 |
commit | c57f777b095fbbb6273fccfe7ea2d1ced5fbc0a4 (patch) | |
tree | ca1ef1707fcc09b77129b431bae2e7342e89ac6e /src/gallium/state_trackers/nine/basetexture9.c | |
parent | 4c126f0b5837227d93e481fb04e43c96b3316413 (diff) |
st/nine: Implement EvictManagedResources
EvictManagedResources is used by apps to free
the gpu memory of MANAGED textures (which have
a cpu memory backing)
Signed-off-by: Axel Davy <[email protected]>
Diffstat (limited to 'src/gallium/state_trackers/nine/basetexture9.c')
-rw-r--r-- | src/gallium/state_trackers/nine/basetexture9.c | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/src/gallium/state_trackers/nine/basetexture9.c b/src/gallium/state_trackers/nine/basetexture9.c index c38a31010a1..110df79769e 100644 --- a/src/gallium/state_trackers/nine/basetexture9.c +++ b/src/gallium/state_trackers/nine/basetexture9.c @@ -587,6 +587,21 @@ NineBaseTexture9_PreLoad( struct NineBaseTexture9 *This ) NineBaseTexture9_UploadSelf(This); } +void +NineBaseTexture9_UnLoad( struct NineBaseTexture9 *This ) +{ + if (This->base.pool != D3DPOOL_MANAGED || + This->managed.lod_resident == -1) + return; + + pipe_resource_reference(&This->base.resource, NULL); + This->managed.lod_resident = -1; + This->managed.dirty = TRUE; + + /* If the texture is bound, we have to re-upload it */ + BASETEX_REGISTER_UPDATE(This); +} + #ifdef DEBUG void NineBaseTexture9_Dump( struct NineBaseTexture9 *This ) |