summaryrefslogtreecommitdiffstats
path: root/src/gallium/state_trackers/nine/basetexture9.c
diff options
context:
space:
mode:
authorAxel Davy <axel.davy@ens.fr>2015-02-20 12:59:45 +0100
committerAxel Davy <axel.davy@ens.fr>2015-04-29 08:28:11 +0200
commit231be57ee2515428e3de31f514effe9cf06bcda0 (patch)
tree29bb0793f85dc1f72709f3ccf05df0dd147b0647 /src/gallium/state_trackers/nine/basetexture9.c
parent58d295d41e30434c570248eeee73af2006b79eea (diff)
downloadexternal_mesa3d-231be57ee2515428e3de31f514effe9cf06bcda0.zip
external_mesa3d-231be57ee2515428e3de31f514effe9cf06bcda0.tar.gz
external_mesa3d-231be57ee2515428e3de31f514effe9cf06bcda0.tar.bz2
st/nine: Remove Managed texture hack.
Previously binding an unitialized managed texture was causing a crash, and a workaround was added to prevent the crash. This patch removes this workaround and instead set the initial state of managed textures as dirty, so that when the texture is bound for the first time, it is always initialized. Signed-off-by: Axel Davy <axel.davy@ens.fr>
Diffstat (limited to 'src/gallium/state_trackers/nine/basetexture9.c')
-rw-r--r--src/gallium/state_trackers/nine/basetexture9.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/gallium/state_trackers/nine/basetexture9.c b/src/gallium/state_trackers/nine/basetexture9.c
index b868019..17a8f44 100644
--- a/src/gallium/state_trackers/nine/basetexture9.c
+++ b/src/gallium/state_trackers/nine/basetexture9.c
@@ -69,6 +69,10 @@ NineBaseTexture9_ctor( struct NineBaseTexture9 *This,
D3DTEXF_LINEAR : D3DTEXF_NONE;
This->managed.lod = 0;
This->managed.lod_resident = -1;
+ /* Mark the texture as dirty to trigger first upload when we need the texture,
+ * even if it wasn't set by the application */
+ if (Pool == D3DPOOL_MANAGED)
+ This->managed.dirty = TRUE;
/* When a depth buffer is sampled, it is for shadow mapping, except for
* D3DFMT_INTZ, D3DFMT_DF16 and D3DFMT_DF24.
* In addition D3DFMT_INTZ can be used for both texturing and depth buffering
@@ -496,9 +500,6 @@ 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);