Jump to content

  • Log In with Google      Sign In   
  • Create Account


#ActualRudiMedia

Posted 20 February 2013 - 12:44 PM

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


#2RudiMedia

Posted 20 February 2013 - 12:42 PM

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


#1RudiMedia

Posted 20 February 2013 - 10:39 AM

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));

 


PARTNERS