Hi,
I'm trying to Map and Umpap mipmap levels of a compressed texture created with the DXGI_FORMAT_BC3_UNORM format.
The problem is that I get an E_INVALIDARG error when I create the texture object with D3D11_CPU_ACCESS_WRITE (even with D3D11_USAGE_DYNAMIC or D3D11_USAGE_DEFAULT flags) using this format, but works ok if i define 1 mipmap level.
This is the code I'm using to create the texture:
D3D11_TEXTURE2D_DESC tex_desc;
tex_desc.Width = 1056;
tex_desc.Height = 1056;
tex_desc.MipLevels = 2; //works with 1 mip level only
tex_desc.ArraySize = 1;
tex_desc.Format = DXGI_FORMAT_BC3_UNORM;
tex_desc.SampleDesc.Count = 1;
tex_desc.SampleDesc.Quality = 0;
tex_desc.Usage = D3D11_USAGE_DYNAMIC;
tex_desc.BindFlags = D3D11_BIND_SHADER_RESOURCE;
tex_desc.CPUAccessFlags = D3D11_CPU_ACCESS_WRITE;
tex_desc.MiscFlags = 0;
ID3D11Texture2D * myTexture;
hr = DxEventNotifier::GetD3DDevice()->CreateTexture2D(&tex_desc, NULL, &myTexture);
assert(myTexture);
This problem did not sowed in DX9 using 2 miplevels and D3DFMT_DXT5 format in a line like:
IDirect3DTexture9 * myTexture;
CreateTexture( 1056, 1056, 2, 0, D3DFMT_DXT5, D3DPOOL_MANAGED, &myTexture, NULL ) );
any suggestions will be appreciated, thanks in advance.