summaryrefslogtreecommitdiffstats
path: root/src/gallium/state_trackers/nine
diff options
context:
space:
mode:
authorStanislaw Halik <sthalik@misaki.pl>2014-12-04 16:52:22 +0100
committerEmil Velikov <emil.l.velikov@gmail.com>2015-01-22 22:16:18 +0000
commit82810d3b660dfeef53a18c0d48914783e2999b2a (patch)
tree02e2f0ff4db7fcddafc198cf7b36c463dde33675 /src/gallium/state_trackers/nine
parent47280d777d33c8a78fb7286892071ef31c12f604 (diff)
downloadexternal_mesa3d-82810d3b660dfeef53a18c0d48914783e2999b2a.zip
external_mesa3d-82810d3b660dfeef53a18c0d48914783e2999b2a.tar.gz
external_mesa3d-82810d3b660dfeef53a18c0d48914783e2999b2a.tar.bz2
st/nine: Hack to generate resource if it doesn't exist when getting view
Buffers in the MANAGED pool are supposed to have the content in a ram buffer, a copy in VRAM if there is enough memory (driver manages memory and decide when to delete the buffer in VRAM). This is not implemented properly in nine, and a VRAM copy is going to be created when the RAM memory is filled, and the VRAM copy will get synced with the RAM memory updates. Due to some issues (in the implementation or in app logic), it can happen we try to create a sampler view of the resource while we haven't created the VRAM resource. This hack creates the resource when we hit this case, which prevents crashing, but doesn't help with the resource content. This fixes several games crashing at launch. Acked-by: Axel Davy <axel.davy@ens.fr> Acked-by: David Heidelberg <david@ixit.cz> Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu> Signed-off-by: Stanislaw Halik <sthalik@misaki.pl> Cc: "10.4" <mesa-stable@lists.freedesktop.org>
Diffstat (limited to 'src/gallium/state_trackers/nine')
-rw-r--r--src/gallium/state_trackers/nine/basetexture9.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/gallium/state_trackers/nine/basetexture9.c b/src/gallium/state_trackers/nine/basetexture9.c
index efa884f..6341dd3 100644
--- a/src/gallium/state_trackers/nine/basetexture9.c
+++ b/src/gallium/state_trackers/nine/basetexture9.c
@@ -457,6 +457,9 @@ NineBaseTexture9_UpdateSamplerView( struct NineBaseTexture9 *This,
if (unlikely(This->format == D3DFMT_NULL))
return D3D_OK;
NineBaseTexture9_Dump(This);
+ /* hack due to incorrect POOL_MANAGED handling */
+ NineBaseTexture9_GenerateMipSubLevels(This);
+ resource = This->base.resource;
}
assert(resource);