<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://forums.xna.com/utility/FeedStylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>Direct3D</title><link>http://forums.xna.com/forums/27.aspx</link><description /><dc:language>en</dc:language><generator>CommunityServer 2007.1 (Build: 0.0)</generator><item><title>Re: Readback of volume texture into sysmem (DirectX 9)</title><link>http://forums.xna.com/forums/thread/194557.aspx</link><pubDate>Mon, 29 Jun 2009 15:17:15 GMT</pubDate><guid isPermaLink="false">4aa5dbf6-357b-46b2-b5b2-1b660a6dc370:194557</guid><dc:creator>legalize</dc:creator><slash:comments>0</slash:comments><comments>http://forums.xna.com/forums/thread/194557.aspx</comments><wfw:commentRss>http://forums.xna.com/forums/commentrss.aspx?SectionID=27&amp;PostID=194557</wfw:commentRss><description>&lt;p&gt;You use GetRenderTargetData to get data from a render target created by the GPU into the CPU.&lt;/p&gt;
&lt;p&gt;You use UpdateTexture to get data from the CPU into the GPU.&lt;/p&gt;
&lt;p&gt;You can&amp;#39;t render to a volume texture in D3D9, so the only way that data gets into a volume texture in D3D9 is for you to put it there from the CPU.  Since you put it there, you already have a copy on the CPU.&lt;/p&gt;</description></item><item><title>Readback of volume texture into sysmem (DirectX 9)</title><link>http://forums.xna.com/forums/thread/180127.aspx</link><pubDate>Tue, 19 May 2009 10:00:35 GMT</pubDate><guid isPermaLink="false">4aa5dbf6-357b-46b2-b5b2-1b660a6dc370:180127</guid><dc:creator>Andy Bartlett</dc:creator><slash:comments>0</slash:comments><comments>http://forums.xna.com/forums/thread/180127.aspx</comments><wfw:commentRss>http://forums.xna.com/forums/commentrss.aspx?SectionID=27&amp;PostID=180127</wfw:commentRss><description>Hi,&lt;br /&gt;
&lt;br /&gt;
I am trying to readback a volume texture into sysmem to be able to save it to file of my own format. I have to use DirectX 9. Some code:&lt;br /&gt;
&lt;br /&gt;
--&lt;br /&gt;
IDirect3DVolumeTexture9 *sysTexture&amp;nbsp;&amp;nbsp;&amp;nbsp; = 0;&lt;br /&gt;
IDirect3DVolumeTexture9 *inputTexture&amp;nbsp; = 0;&lt;br /&gt;
IDirect3DVolumeTexture9 *outputTexture&amp;nbsp; = 0;&lt;br /&gt;
&lt;br /&gt;
HRESULT hr;&lt;br /&gt;
hr = D3DXCreateVolumeTexture(pDevice, sizeX, sizeY, sizeZ, 1, 0, D3DFMT_A8, D3DPOOL_SYSTEMMEM, &amp;amp;sysTexture);&lt;br /&gt;
hr = D3DXCreateVolumeTexture(pDevice, sizeX, sizeY, sizeZ, 1, 0, D3DFMT_A8, D3DPOOL_DEFAULT, &amp;amp;inputTexture);&lt;br /&gt;
hr = D3DXCreateVolumeTexture(pDevice, sizeX, sizeY, sizeZ, 1, 0, D3DFMT_A8, D3DPOOL_DEFAULT, &amp;amp;outputTexture);&lt;br /&gt;
&lt;br /&gt;
// Upload texture&lt;br /&gt;
LoadMyVolumeToSysTexture(sysTexture, (unsigned char *)pData, sizeX, sizeY, sizeZ);&lt;br /&gt;
hr = pDevice-&amp;gt;UpdateTexture(sysTexture, inputTexture);&lt;br /&gt;
&lt;br /&gt;
MyOwnProcessing(inputTexture, outputTexture);&lt;br /&gt;
--&lt;br /&gt;
&lt;br /&gt;
Now, does anyone know how I can readback outputTexture to the CPU again? Any help would be highly appreciated. I have looked around in the forums for quite some time now without success. I see that people are using GetRenderTargetData(), but isn&amp;#39;t that function only for 2D?&lt;br /&gt;
&lt;br /&gt;
Best regards,&lt;br /&gt;
Andy</description></item></channel></rss>