I'm currently trying to get rid of all D3DX functions since those are deprecated in the Windows 8 SDK. So I want to replace the D3DX10CreateTextureFromFile with basic DX10 functions. The main problem I'm currently facing is to generate the mipmaps for the loaded texture. Things I've tried so far:
1) ID3D10Device::CreateTexture2D with D3D10_TEXTURE2D_DESC::MipLevels set to 1 and setting pInitialData to the image data.
2) ID3D10Device::CreateTexture2D with D3D10_TEXTURE2D_DESC::MipLevels set to 0 and uploading texture data through ID3D10Device::UpdateSubresource
The first gives me a texture without any mipmaps and the second gives me a texture with only the base image set and empty mipmaps. I've also looked at the ID3D10Device::GenerateMips function but this requires that I set the D3D10_BIND_RENDER_TARGET and D3D10_RESOURCE_MISC_GENERATE_MIPS flags and I'm woried that this degrades performance. If you look at the texture description of the texture created by D3DX10CreateTextureFromFile you will see that none of these flags are set so I wonder how does D3DX10CreateTextureFromFile create textures?