• Advertisement
Sign in to follow this  

DirectX11 DepthStencil problem with SampleDesc

This topic is 688 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hello,

I have a problem with creation of depthstencil view.

When creating DXGI_SWAP_CHAIN_DESC, I set the following: 

sd.SampleDesc.Count = 4;
sd.SampleDesc.Quality = m_4xMSaaQuality - 1;

After that, if I put the following:

D3D11_TEXTURE2D_DESC depthStencilDesc;
depthStencilDesc.SampleDesc.Count =  4;
depthStencilDesc.SampleDesc.Quality = m_4xMSaaQuality - 1;

 CreateDepthStencilView() fails, and HRESULT is E_INVALIDARG One or more arguments are invalid.

 

 

If I set SampleDesc.Count = 1 and SampleDesc.Quality = 0 in both places everything works properly.

 

Also, some code that might matter:

 

Microsoft::WRL:: ComPtr<ID3D11Texture2D> mDepthStencilBufer;
CD3D11_DEPTH_STENCIL_VIEW_DESC depthStencilViewDescription(D3D11_DSV_DIMENSION_TEXTURE2D);
HRESULT dsHR = m_d3dDevice->CreateTexture2D(&depthStencilDesc, 0, mDepthStencilBufer.GetAddressOf());
dsHR = m_d3dDevice->CreateDepthStencilView(mDepthStencilBufer.Get(), &depthStencilViewDescription, m_depthStencilView.GetAddressOf());

Thanks in advance for help!

Edited by paperplane

Share this post


Link to post
Share on other sites
Advertisement

You probably wanted:

CD3D11_DEPTH_STENCIL_VIEW_DESC depthStencilViewDescription(D3D11_DSV_DIMENSION_TEXTURE2DMS);

when using Multisampling counts > 1.

 

Thanks a lot!
It's working now.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement