Auto generate mipmaps

The question is whats the difference between the usage flag D3DUSAGE_AUTOGENMIPMAPS and specifying a zero value for the levels of a texture. The sdk of february 2005 isn't clear on the difference between them to me.
[327 byte] By [NightCreature] at [2008-1-3]
# 1
D3DUSAGE_AUTOGENMIPMAPS is a hardware flag that asks the GPU to regenerate the mipmaps when the texture is dirtied (either by UpdateTexture or render-to-texture operations). Passing 0 for the texture levels when creating the texture asks D3DX to generate the mipmaps during loading (this is done only when loading the texture on the CPU). If the top surface of the texture changes later, the mipmaps won't be updated...
WessamBahnassi at 2007-9-13 > top of Msdn Tech,Game Technologies: DirectX, XNA, XACT, etc.,Game Technologies: DirectX 101...
# 2
I guess its the same for IDirect3DDevice9::CreateTexture with level 0. I am not allowed to use the D3DX lib for this project.
So if i fill the texture with my texture and mipmap data i would be set?
NightCreature at 2007-9-13 > top of Msdn Tech,Game Technologies: DirectX, XNA, XACT, etc.,Game Technologies: DirectX 101...
# 3
Yes. It's the same. The only difference is that D3DX also generates the data for the mipmaps when you load a texture. So in your case, yes you have to fill out the mipmaps manually one by one.
WessamBahnassi at 2007-9-13 > top of Msdn Tech,Game Technologies: DirectX, XNA, XACT, etc.,Game Technologies: DirectX 101...
# 4
Unless I have a Auto generating card and after i fill level zero I call UpdateTexture right?
NightCreature at 2007-9-13 > top of Msdn Tech,Game Technologies: DirectX, XNA, XACT, etc.,Game Technologies: DirectX 101...
# 5
If you don't have automipmap generation on, then you have to lock each and every mipmap level manually and fill it up. With automipmap gen, yes... UpdateTexture does it...
WessamBahnassi at 2007-9-13 > top of Msdn Tech,Game Technologies: DirectX, XNA, XACT, etc.,Game Technologies: DirectX 101...
# 6
Thanks that answers it better then the sdk does
NightCreature at 2007-9-13 > top of Msdn Tech,Game Technologies: DirectX, XNA, XACT, etc.,Game Technologies: DirectX 101...
# 7
hr = m_texture->LockRect(i, &lockedrect, NULL, /*i==0?D3DLOCK_DISCARD:0*/0);
I am locking a texture to fill the mipmap levels with data. Only thing is when i D3DLOCK_DISCARD the top level it messes the level up. I get an image that contains the source image multiple times. If the lock flag is 0 for all levels it works, why doesn't it work if I give the 0th level a discard flag?
NightCreature at 2007-9-13 > top of Msdn Tech,Game Technologies: DirectX, XNA, XACT, etc.,Game Technologies: DirectX 101...
# 8
Is your texture dynamic?
WessamBahnassi at 2007-9-13 > top of Msdn Tech,Game Technologies: DirectX, XNA, XACT, etc.,Game Technologies: DirectX 101...
# 9
Yes
NightCreature at 2007-9-13 > top of Msdn Tech,Game Technologies: DirectX, XNA, XACT, etc.,Game Technologies: DirectX 101...