Advertisement Jump to content
Sign in to follow this  

readback texture created with D3DX10CreateTextureFromFileA

This topic is 3719 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Is there a simple way of reading back the contents of a texture created with D3DX10CreateTextureFromFile ? I have attempted to get data from mipmap level zero but the first call to map () below fails:
D3D10_MAPPED_TEXTURE2D mappedTexture;
hr = md_pTexture->Map (D3D10CalcSubresource (0, 0, 0), 
  D3D10_MAP_READ, 0, &mappedTexture);

md_pTexture->Unmap (D3D10CalcSubresource (0, 0, 0));

Is there any official way of reading back texture data?

Share this post

Link to post
Share on other sites
You can override the usage in the D3DX call with the D3DX10_IMAGE_LOAD_INFO parameter to load the texture as a staging resource with cpu read capability and no bind flags. Don't expect it to work as a shader resource after that, but you can read it with Map.

Share this post

Link to post
Share on other sites
Sign in to follow this  

  • Advertisement

Important Information

By using, you agree to our community Guidelines, Terms of Use, and Privacy Policy. is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!