Hi,
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:
--
IDirect3DVolumeTexture9 *sysTexture = 0;
IDirect3DVolumeTexture9 *inputTexture = 0;
IDirect3DVolumeTexture9 *outputTexture = 0;
HRESULT hr;
hr = D3DXCreateVolumeTexture(pDevice, sizeX, sizeY, sizeZ, 1, 0, D3DFMT_A8, D3DPOOL_SYSTEMMEM, &sysTexture);
hr = D3DXCreateVolumeTexture(pDevice, sizeX, sizeY, sizeZ, 1, 0, D3DFMT_A8, D3DPOOL_DEFAULT, &inputTexture);
hr = D3DXCreateVolumeTexture(pDevice, sizeX, sizeY, sizeZ, 1, 0, D3DFMT_A8, D3DPOOL_DEFAULT, &outputTexture);
// Upload texture
LoadMyVolumeToSysTexture(sysTexture, (unsigned char *)pData, sizeX, sizeY, sizeZ);
hr = pDevice->UpdateTexture(sysTexture, inputTexture);
MyOwnProcessing(inputTexture, outputTexture);
--
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't that function only for 2D?
Best regards,
Andy