Jump to content

  • Log In with Google      Sign In   
  • Create Account

We're offering banner ads on our site from just $5!

1. Details HERE. 2. GDNet+ Subscriptions HERE. 3. Ad upload HERE.


R10G10B10A2 and D3DX11SaveTextureToFile


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
5 replies to this topic

#1 japam   Members   -  Reputation: 202

Like
0Likes
Like

Posted 08 July 2012 - 04:32 PM

Hi gurus,

Anyone knows what it takes to make D3DX11SaveTextureToFile work with R10G10B10A2 format?

A call to D3DX11SaveTextureToFile with any destination image format except D3DX11_IFF_DDS results in 0x80004005 error.

Thanks,
John

Edited by japam, 08 July 2012 - 04:35 PM.


Sponsor:

#2 MJP   Moderators   -  Reputation: 11589

Like
1Likes
Like

Posted 08 July 2012 - 05:13 PM

It probably only supports saving textures with 8-bit RGBA formats. If you link to the debug version of the D3DX libs you might get some extra error messages in the debug output. Otherwise you could try using D3DX11LoadTextureFromTexture to create a new texture with R8G8B8A8_UNORM format, and saving that instead.

Edited by MJP, 08 July 2012 - 05:14 PM.


#3 mhagain   Crossbones+   -  Reputation: 8141

Like
1Likes
Like

Posted 08 July 2012 - 07:18 PM

Most image formats won't support this texture format - BMP for a fact doesn't, for example.

It appears that the gentleman thought C++ was extremely difficult and he was overjoyed that the machine was absorbing it; he understood that good C++ is difficult but the best C++ is well-nigh unintelligible.


#4 japam   Members   -  Reputation: 202

Like
0Likes
Like

Posted 08 July 2012 - 08:17 PM

MJP, thank you, D3DX11LoadTextureFromTexture works.

http://img641.images...9543/ss1uip.jpg
http://img825.images.../7906/ss2gi.jpg

The only downside is that D3DX11LoadTextureFromTexture is a bit slow causing a little freeze.

Edited by japam, 08 July 2012 - 08:23 PM.


#5 MJP   Moderators   -  Reputation: 11589

Like
0Likes
Like

Posted 08 July 2012 - 08:38 PM

Yeah it will be a little slow since it will readback the texture on the CPU, and do the conversion there. Plus there will be a delay from having to allocate a new resource. What you could try instead is pre-allocating a Texture2D with the size you need at startup, with the R8G8B8A8_UNORM format. Then when you need a screen shot, you could use a compute shader or full screen render pass to sample the R10G10B10 texture and write it out to the R8G8B8A8 texture. Then you could save the R8G8B8A8 without having to do any conversion on the CPU, or allocating any resources.

#6 japam   Members   -  Reputation: 202

Like
0Likes
Like

Posted 21 December 2012 - 05:54 PM

Yeah it will be a little slow since it will readback the texture on the CPU, and do the conversion there. Plus there will be a delay from having to allocate a new resource. What you could try instead is pre-allocating a Texture2D with the size you need at startup, with the R8G8B8A8_UNORM format. Then when you need a screen shot, you could use a compute shader or full screen render pass to sample the R10G10B10 texture and write it out to the R8G8B8A8 texture. Then you could save the R8G8B8A8 without having to do any conversion on the CPU, or allocating any resources.

Sorry about delayed reply... thanks again for the tip, a fullscreen render pass did the trick and it's faster than D3DX11LoadTextureFromTexture.






Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS