Some time ago I had a topic going about GenerateMipSubLevels not working on DTXn textures. This is because hardware does not support mipmap generation on compressed textures.
Well I now have the texture in D3DFMT_A8R8G8B8 format and still this function refuses to do the job!
In PIX I can tell that if I specify 5 mipmap levels only the top surface will have the image, and rest are just black as before. Getting CAPS on my nvidia GTX690 it will say that it supports mipmap generation on D3DFMT_A8R8G8B8 targets.
hr = pGraphicsDevice->GetDevice()->CreateTexture(Width, Height, 5, 0, D3DFMT_A8R8G8B8, D3DPOOL_MANAGED, &pTex, NULL);
if( hr!=D3D_OK ) return NULL;
LPDIRECT3DSURFACE9 pSurface = NULL;
if (SUCCEEDED (pTex->GetSurfaceLevel(0, &pSurface)))
{
RECT rc;
SetRect(&rc, 0, 0, Width, Height);
hr = D3DXLoadSurfaceFromMemory(pSurface, NULL, NULL, pTextureData, (D3DFORMAT)Format, Pitch, NULL, &rc, D3DX_FILTER_NONE, 0);
}
if(pSurface) pSurface->Release();
pTex->GenerateMipSubLevels(); //won't work
Setting usage to D3DUSAGE_AUTOGENMIPMAP in CreateTexture makes all surfaces black when the Levels parameter is 2 or higher.
If Levels in CreateTexture is set to zero with D3DUSAGE_AUTOGENMIPMAP only one mipmap level is present (PIX), in conflic with documentation.
Anyone have a hunch of what might be going on?






