So, you've probably read this:
MipLevels Type: UINT
The maximum number of mipmap levels in the texture. See the remarks in
D3D11_TEX1D_SRV. Use 1 for a multisampled texture; or 0 to generate a
full set of subtextures.
Yay, DirectX is going to do the dirty work for once! Hah. The devil is in the details. How so? Well, it said it is going to generate a full set of subtextures. It will figure out how many subtextures are needed from your width x height to the smallest — and generate the subtextures. But it won't fill them with anything, even though it has the 0th level source texture.
It is going to expect you to provide
D3D11_SUBRESOURCE_DATA data[n] from the biggest (source) mipmap to the smallest, as the runtime would tell you in your output window if you created the device in debug mode. Yes, that means you need to prefilter as many levels as there are needed and give a proper data pointer and pitches for each of them.
On one unapplicable misc flag
You've heard about
D3D11_RESOURCE_MISC_GENERATE_MIPS and wonder if it applies because you could call
ID3D11DeviceContext::GenerateMips? Unfortunately, Direct3D requires it to be bindable as a render target AND a shader resource. This originates in the interesting decision to only allow for mipmap automation when a texture is used as a render target, as it is not filled by the user.
So, maybe set it as a render target even though you'll never use it in that capacity? Besides it being dirty, you're out of luck again, as
DXGI_FORMAT_R32G32B32_FLOAT is not a valid render target format.
You cannot have your cake and eat it. Prefilter your texture to as many levels as needed and then fill out the D3D11_SUBRESOURCE_DATA for each one of them and pass it in bulk to the
In the end, as much as it is sneaky, Direct3D did its job. It generated the subtextures. It said nothing about filling them with filtered data from your source texture.