I'm loading my DDS cubemaps with this function:
HRESULT hr = CreateDDSTextureFromFile(mDevice, inPath, &Texture, &mShaderResourceView);
This works fine, except it has no mipmaps.
According to this page:
I have to use the Ex version:
unsigned int bindFlags = D3D11_BIND_SHADER_RESOURCE | D3D11_BIND_RENDER_TARGET;
unsigned int miscFlags = D3D11_RESOURCE_MISC_GENERATE_MIPS;
HRESULT hr=CreateDDSTextureFromFileEx(mDevice, mContext, inPath, 0, D3D11_USAGE_DEFAULT, bindFlags, 0, miscFlags, false, &Texture, &mShaderResourceView);
However, no matter what I try I get a:
E_INVALIDARG One or more arguments are invalid
When stepping through the code I found out that the format is DXGI_FORMAT_BC1_UNORM (71) and this format is not supported for auto-gen mipmaps for my feature level and it finally fails at the CreateD3DResources function.
DirectX 9 has no problems generating mipmaps for this very same DDS file. Does this mean I have to convert the DDS file to another format, like uncompressed? Or is there a way to make it work in DirectX 11?
Any hints will be much appreciated!