• Advertisement
Sign in to follow this  

How to clear a part of DepthStencil in DX11?

This topic is 1957 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

In DX9, clear() can set a part of depth stencil, But ClearDepthStencilView can not set rectangles in DX11.Have any solutions?
thanks.

Share this post


Link to post
Share on other sites
Advertisement
[quote name='Erik Rufelt' timestamp='1347116390' post='4977991']
Render a quad with always-pass depth-testing and depth 1.0, or whichever value you wish to clear it to.
[/quote]
thx, but this must prepare render data and change state( shader, primitive stream, DepthStencil State), I want to avoid this.

Share this post


Link to post
Share on other sites
[s]Keep a second buffer around that has the static contents of the particular depth value you wish to clear to, and use CopySubresourceRegion. [url="http://msdn.microsoft.com/en-us/library/windows/desktop/ff476394(v=vs.85).aspx"]http://msdn.microsof...4(v=vs.85).aspx[/url][/s]

Actually never mind, the docs say you can't do that for a depth stencil resource. Unless you clear very many times per frame state-changes won't be a problem for drawing a quad. Edited by Erik Rufelt

Share this post


Link to post
Share on other sites
[quote name='Erik Rufelt' timestamp='1347134996' post='4978085']
[s]Keep a second buffer around that has the static contents of the particular depth value you wish to clear to, and use CopySubresourceRegion. [url="http://msdn.microsoft.com/en-us/library/windows/desktop/ff476394(v=vs.85).aspx"]http://msdn.microsof...4(v=vs.85).aspx[/url][/s]

Actually never mind, the docs say you can't do that for a depth stencil resource. Unless you clear very many times per frame state-changes won't be a problem for drawing a quad.
[/quote]
Ok, I'll try it,thank you.

Share this post


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

  • Advertisement