Ok,
I found a ‘partial’ solution:
IDirect3DTexture8 *depthStencil_Texture;
m_pIDirect3DDevice8->CreateTexture(width, height, 1, D3DUSAGE_DEPTHSTENCIL, ((D3DFORMAT) MAKEFOURCC(‘I’,‘N’,‘T’,‘Z’)), D3DPOOL_DEFAULT, &depthStencil_Texture);
IDirect3DSurface8 *depthStencil_Surface;
depthStencil_Texture->GetSurfaceLevel(0, &depthStencil_Surface);
m_pIDirect3DDevice8->SetRenderTarget(renderTarget, depthStencil);
// Do the normal render of the game …
At the end of the rendering (when the game calls to the ::Present() method), i do this:
m_pIDirect3DDevice8->SetTexture(0, depthStencil_Texture);
& i set a D3DFMT_A8R8G8B8 new render target, and a pixel shader that does a ‘texld r0, t0’.
At the end i have a render target with the INTZ values, and i can post process it later with my CUDA kernel.
But, there is a huge problem → MultiSampling does NOT work ! :sad:
I need to turn off MultiSampling to bind the ‘depthStencil_Surface’ with my ‘renderTarget’ :sad:
So, atm, this works, but, it’s useless for my project, because i lose the FSAA.
Also, i still dunno how to convert the INTZ values, but, at least i can read them.
Any tip ?