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,918
  3. MDolenc

    Regular

    Joined:
    May 26, 2002
    Messages:
    544
    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,918
    and you cant bind a depth buffer to a texture under dx11 ?
     
  5. MDolenc

    Regular

    Joined:
    May 26, 2002
    Messages:
    544
    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:
    689
    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

  • About Beyond3D

    Beyond3D has been around for over a decade and prides itself on being the best place on the web for in-depth, technically-driven discussion and analysis of 3D graphics hardware. If you love pixels and transistors, you've come to the right place!

    Beyond3D is proudly published by GPU Tools Ltd.
Loading...