HW Mipmap Generation ignores specified amount of Mipmaps and is incorrectly logged

Description

Referring to the old thread in the forums here:
http://www.ogre3d.org/forums/viewtopic.php?f=3&t=88687

As mentioned there, the following commit was applied to the 1.10 branch:
https://bitbucket.org/sinbad/ogre/commits/27215c836cb2c962d5e6a2d05354c645a1be9fee

------------------------------------------------------------

1)

However, the new code still seems to override the user specified amount of mipmaps.

File: OgreD3D9Texture.cpp
Method: _createNormTex()
Link: here

This numMips var is later in the function passed as param to the call to D3DXCreateTexture(). Before it is assigned a 0 here, it holds the user specified amount of mipmaps (if in use, see code above). According to MSDN passing a value of 0 will create mipmaps up to 1x1 pixels:

If this value is zero or D3DX_DEFAULT, a complete mipmap chain is created.

I suggest to remove this assignment from the code snippet above:

If the mipmaps were HW generated, this will set mNumMipmaps to 0, due to GetLevelCount() returning a 1 (MSDN)

If you create a texture with D3DUSAGE_AUTOGENMIPMAP to make that texture automatically generate sublevels, GetLevelCount always returns 1 for the number of levels.

Not sure what a good fix here is...
But setting mNumMipmaps to 0 like done, will cause the following code piece below to be skipped and hence the log entry does not state that the texture was created with HW mipmaps.

File: OgreTexture.cpp
Method: _loadImages()
Link: here

Environment

None

Status

Assignee

Unassigned

Reporter

Clint Banzhaf

Labels

Components

Affects versions

Priority

Minor
Configure