Search code examples
c++directxdds-format

E_INVALIDARG when creating texture2d from DDS dxt5 compressed


Doing all work about processing from this article.

Detect headers,get pitch from this formula:

max( 1, ((width+3)/4) ) * block-size  (block-size == 16)

then trying to CreateTexture2D( &texDesc, resData, &texture );

I filled all fields from header. But always get E_INVALIDARG. Can't find out my problem.


Solution

  • Create your ID3D11Device with the debug flag D3D11_CREATE_DEVICE_DEBUG and look at the error explanation in the output window.