D3D problem needs help--

Discussion in 'Rendering Technology and APIs' started by lanlangui, Mar 21, 2012.

  1. lanlangui

    Newcomer

    Joined:
    Mar 21, 2012
    Messages:
    1
    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!!
     
  2. Davros

    Legend

    Joined:
    Jun 7, 2004
    Messages:
    12,791
  3. MDolenc

    Regular

    Joined:
    May 26, 2002
    Messages:
    526
    Location:
    Slovenia
    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?
     
  4. Davros

    Legend

    Joined:
    Jun 7, 2004
    Messages:
    12,791
    and you cant bind a depth buffer to a texture under dx11 ?
     
  5. MDolenc

    Regular

    Joined:
    May 26, 2002
    Messages:
    526
    Location:
    Slovenia
    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...
     
  6. Ethatron

    Regular Subscriber

    Joined:
    Jan 24, 2010
    Messages:
    673
    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);
    
     

Share This Page

Loading...