st/nine: D3DUSAGE_AUTOGENMIPMAP is forbidden for volumes
authorAxel Davy <axel.davy@ens.fr>
Thu, 19 Feb 2015 19:55:42 +0000 (20:55 +0100)
committerAxel Davy <axel.davy@ens.fr>
Wed, 29 Apr 2015 06:28:11 +0000 (08:28 +0200)
Signed-off-by: Axel Davy <axel.davy@ens.fr>
src/gallium/state_trackers/nine/volume9.c
src/gallium/state_trackers/nine/volumetexture9.c

index 8c9f148373b1c45945ef682f9fcd679472a7520b..b34ee07dce92b33d44fe75cce45da0c5dddfe729 100644 (file)
@@ -169,9 +169,6 @@ NineVolume9_MarkContainerDirty( struct NineVolume9 *This )
     assert(tex);
     if (This->desc.Pool == D3DPOOL_MANAGED)
         tex->managed.dirty = TRUE;
-    else
-    if (This->desc.Usage & D3DUSAGE_AUTOGENMIPMAP)
-        tex->dirty_mip = TRUE;
 
     BASETEX_REGISTER_UPDATE(tex);
 }
index 8f1de13ce5fe8fba0c0b791f9576956295964663..1193e12f34ce2316650db71d47d38d8dec6bf9b5 100644 (file)
@@ -51,14 +51,10 @@ NineVolumeTexture9_ctor( struct NineVolumeTexture9 *This,
     /* An IDirect3DVolume9 cannot be bound as a render target can it ? */
     user_assert(!(Usage & (D3DUSAGE_RENDERTARGET | D3DUSAGE_DEPTHSTENCIL)),
                 D3DERR_INVALIDCALL);
-    user_assert(!(Usage & D3DUSAGE_AUTOGENMIPMAP) ||
-                (Pool != D3DPOOL_SYSTEMMEM && Levels <= 1), D3DERR_INVALIDCALL);
+    user_assert(!(Usage & D3DUSAGE_AUTOGENMIPMAP), D3DERR_INVALIDCALL);
 
     user_assert(!pSharedHandle, D3DERR_INVALIDCALL); /* TODO */
 
-    if (Usage & D3DUSAGE_AUTOGENMIPMAP)
-        Levels = 0;
-
     pf = d3d9_to_pipe_format_checked(screen, Format, PIPE_TEXTURE_3D, 0,
                                      PIPE_BIND_SAMPLER_VIEW, FALSE);
     if (pf == PIPE_FORMAT_NONE)
@@ -145,8 +141,6 @@ NineVolumeTexture9_GetLevelDesc( struct NineVolumeTexture9 *This,
                                  D3DVOLUME_DESC *pDesc )
 {
     user_assert(Level <= This->base.base.info.last_level, D3DERR_INVALIDCALL);
-    user_assert(Level == 0 || !(This->base.base.usage & D3DUSAGE_AUTOGENMIPMAP),
-                D3DERR_INVALIDCALL);
 
     *pDesc = This->volumes[Level]->desc;
 
@@ -159,8 +153,6 @@ NineVolumeTexture9_GetVolumeLevel( struct NineVolumeTexture9 *This,
                                    IDirect3DVolume9 **ppVolumeLevel )
 {
     user_assert(Level <= This->base.base.info.last_level, D3DERR_INVALIDCALL);
-    user_assert(Level == 0 || !(This->base.base.usage & D3DUSAGE_AUTOGENMIPMAP),
-                D3DERR_INVALIDCALL);
 
     NineUnknown_AddRef(NineUnknown(This->volumes[Level]));
     *ppVolumeLevel = (IDirect3DVolume9 *)This->volumes[Level];
@@ -179,8 +171,6 @@ NineVolumeTexture9_LockBox( struct NineVolumeTexture9 *This,
         This, Level, pLockedVolume, pBox, Flags);
 
     user_assert(Level <= This->base.base.info.last_level, D3DERR_INVALIDCALL);
-    user_assert(Level == 0 || !(This->base.base.usage & D3DUSAGE_AUTOGENMIPMAP),
-                D3DERR_INVALIDCALL);
 
     return NineVolume9_LockBox(This->volumes[Level], pLockedVolume, pBox,
                                Flags);
@@ -204,8 +194,6 @@ NineVolumeTexture9_AddDirtyBox( struct NineVolumeTexture9 *This,
     DBG("This=%p pDirtybox=%p\n", This, pDirtyBox);
 
     if (This->base.base.pool != D3DPOOL_MANAGED) {
-        if (This->base.base.usage & D3DUSAGE_AUTOGENMIPMAP)
-            This->base.dirty_mip = TRUE;
         return D3D_OK;
     }
     This->base.managed.dirty = TRUE;