Welcome, Unregistered.

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Reply
Old 21-Mar-2012, 04:08   #1
lanlangui
Registered
 
Join Date: Mar 2012
Posts: 1
Icon Question D3D problem needs help--

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!!
lanlangui is offline   Reply With Quote
Old 21-Mar-2012, 06:10   #2
Davros
Regular
 
Join Date: Jun 2004
Posts: 11,088
Default

from amd

// Bind depth buffer texture
pd3dDevice->SetTexture(0, pINTZDST);


http://developer.amd.com/gpu_assets/...20Cards_v2.pdf
__________________
Guardian of the Bodacious Three Terabytes of Gaming Goodness™
Davros is offline   Reply With Quote
Old 21-Mar-2012, 11:39   #3
MDolenc
Member
 
Join Date: May 2002
Location: Slovenia
Posts: 421
Default

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?
MDolenc is offline   Reply With Quote
Old 21-Mar-2012, 14:10   #4
Davros
Regular
 
Join Date: Jun 2004
Posts: 11,088
Default

and you cant bind a depth buffer to a texture under dx11 ?
__________________
Guardian of the Bodacious Three Terabytes of Gaming Goodness™
Davros is offline   Reply With Quote
Old 21-Mar-2012, 15:22   #5
MDolenc
Member
 
Join Date: May 2002
Location: Slovenia
Posts: 421
Default

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...
MDolenc is offline   Reply With Quote
Old 22-Mar-2012, 00:50   #6
Ethatron
Member
 
Join Date: Jan 2010
Posts: 455
Default

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);
Ethatron is offline   Reply With Quote

Reply

Tags
d3d, depthbuffer

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 18:49.


Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.