Sign in to follow this  
RudiMedia

Windows Phone 8 Depth Buffer access

Recommended Posts

Just a quick question,

is it possible to bind the depth buffer to a shader resource view with FEATURE_LEVEL_9_3?

 

Because I constantly get an error, if I use both D3D11_BIND_DEPTH_STENCIL and D3D11_BIND_SHADER_RESOURCE as flags.

CD3D11_TEXTURE2D_DESC depthStencilDesc(DXGI_FORMAT_D24_UNORM_S8_UINT, static_cast<UINT>(m_renderTargetSize.Width),
		static_cast<UINT>(m_renderTargetSize.Height), 1, 1, D3D11_BIND_DEPTH_STENCIL | D3D11_BIND_SHADER_RESOURCE);

ComPtr<ID3D11Texture2D> depthStencil;
DX::ThrowIfFailed(m_d3dDevice->CreateTexture2D(&depthStencilDesc, nullptr, &depthStencil));

 

//Edit: Found my mistake, the format has to be DXGI_FORMAT_R24G8_TYPELESS

Edited by RudiMedia

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this