[Mesa-dev] [PATCH 07/11] st/nine: D3DUSAGE_AUTOGENMIPMAP is forbidden for volumes

Axel Davy axel.davy at ens.fr
Fri Apr 24 13:11:22 PDT 2015


Signed-off-by: Axel Davy <axel.davy at ens.fr>
---
 src/gallium/state_trackers/nine/volume9.c        |  3 ---
 src/gallium/state_trackers/nine/volumetexture9.c | 14 +-------------
 2 files changed, 1 insertion(+), 16 deletions(-)

diff --git a/src/gallium/state_trackers/nine/volume9.c b/src/gallium/state_trackers/nine/volume9.c
index 8c9f148..b34ee07 100644
--- a/src/gallium/state_trackers/nine/volume9.c
+++ b/src/gallium/state_trackers/nine/volume9.c
@@ -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);
 }
diff --git a/src/gallium/state_trackers/nine/volumetexture9.c b/src/gallium/state_trackers/nine/volumetexture9.c
index 8f1de13..1193e12 100644
--- a/src/gallium/state_trackers/nine/volumetexture9.c
+++ b/src/gallium/state_trackers/nine/volumetexture9.c
@@ -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;
-- 
2.1.0



More information about the mesa-dev mailing list