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.
![]() |
|
|
#1 |
|
Registered
Join Date: Mar 2012
Posts: 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 |
|
Darlek ******
Join Date: Jun 2004
Posts: 9,488
|
from amd
// Bind depth buffer texture pd3dDevice->SetTexture(0, pINTZDST); http://developer.amd.com/gpu_assets/...20Cards_v2.pdf
__________________
Guardian of the Most holy Two Terabytes of Gaming Goodness™ |
|
|
|
|
|
#3 |
|
Member
Join Date: May 2002
Location: Slovenia
Posts: 420
|
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 |
|
Darlek ******
Join Date: Jun 2004
Posts: 9,488
|
and you cant bind a depth buffer to a texture under dx11 ?
__________________
Guardian of the Most holy Two Terabytes of Gaming Goodness™ |
|
|
|
|
|
#5 |
|
Member
Join Date: May 2002
Location: Slovenia
Posts: 420
|
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 |
|
Member
Join Date: Jan 2010
Posts: 375
|
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);
|
|
|
|
![]() |
| Tags |
| d3d, depthbuffer |
| Thread Tools | |
| Display Modes | |
|
|