D3D problem needs help--

lanlangui

Newcomer
Hey guys
I am new in d3d field. I want to write a program
to read depth buffer from gpu after rendering using
D3D11, How can I do it. I have look up so long time
but find no API , thank you very much!!
 
That's useless for him, since he's using DX11.

lanlangui: What do you mean exactly? Using depth buffer in a shader or do you want to ship it to the CPU side?
 
Sure you can. You can actually bind it directly. You don't need anything like special four cc formats exposed by DX9 drivers to do that. Which makes me think he's trying to do something a bit more complicated then the obvious reading depth from shader...
 
I think he just didn't realized that the DB is "simply" a surface and you can bind is as a texture. There is no special DB API because of that generalization:

Code:
  ID3D11Texture2D *m_depthStencilBuffer;

  pD3D11Device->CreateTexture2D(
    &depthBufferDesc, NULL, &m_depthStencilBuffer);
  pD3D11Device->CreateDepthStencilView(
    m_depthStencilBuffer, &depthStencilViewDesc, &m_depthStencilView);
 
Back
Top