Quantcast
Channel: GameDev.net
Viewing all articles
Browse latest Browse all 17560

Copy texture data in default heap to readback heap

$
0
0

Hi Guys,

Are there any straight forward way to copy texture2d data into CPU readable array? IIRC, we can't create texture2d on readback heap right?  Copy upload heap buffer to texture2d require lots of bookkeeping, so I guess do a revers task is also very tricky.

 

Right now I use a compute shader to copy texture2D to a structured buffer in default heap first, and then use CopyBufferRegion to copy it to buffer in readback heap, and finally do a map on it to read data back to CPU.

 

I feel my approach is overly complicated, there must be a much convenient way to copy texture2D to CPU readable array (otherwise how we do capture screen to a file?)

 

Thanks in advance.

 


Viewing all articles
Browse latest Browse all 17560

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>