Jump to content
  • Advertisement
Sign in to follow this  
gfxCahd

Load DDS file to CPU

This topic is 1510 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

I want to load a DDS file (mipmaps included) to the CPU. That means loading its values to a D3D11_SUBRESOURCE_DATA in d3d11 (in the case of sharpdx, that would be loaded in a dataRectangle).

 

I can't use the graphics device & its context (multithreading issues), plus it's silly to load a texture to the graphics card just for the cpu to read it back.

 

It seems though that WIC doesn't support DDS? I've found suggestions to use DirectX TK, but I am using sharpDX. So is there some easy solution to this, or do i have to write a managed version of whatever Directx TK does to read DDS?

 

-thanks

Edited by gfxCahd

Share this post


Link to post
Share on other sites
Advertisement

Is there any reason why you can't use the SharpDX toolkit?  It comes with a DDS loader, and you can load the data directly into the Image object so you won't need a context/device.  The DDS loader (and other image format loading) in SharpDX is based on the native DirectXTex library which appears to be a subset of the DirectXTk library.

 

In the worst case, if you don't want the toolkit, you could always cannibalize the source (be sure to give credit of course) and rig up your own loader.

Share this post


Link to post
Share on other sites

Eh.... It's like including a reference to XNA when all you want is just to import a DDS file. So... I think i'll start cannibalizing.

It just seemed strange that a MS framework (WIC) wouldn't support a MS filetype (DDS), out of the box.

Edited by gfxCahd

Share this post


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

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net 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!