How to clear a part of DepthStencil in DX11?

Started by
3 comments, last by artint 11 years, 7 months ago
In DX9, clear() can set a part of depth stencil, But ClearDepthStencilView can not set rectangles in DX11.Have any solutions?
thanks.
Advertisement
Render a quad with always-pass depth-testing and depth 1.0, or whichever value you wish to clear it to.

Render a quad with always-pass depth-testing and depth 1.0, or whichever value you wish to clear it to.

thx, but this must prepare render data and change state( shader, primitive stream, DepthStencil State), I want to avoid this.
[s]Keep a second buffer around that has the static contents of the particular depth value you wish to clear to, and use CopySubresourceRegion. http://msdn.microsof...4(v=vs.85).aspx[/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.

[s]Keep a second buffer around that has the static contents of the particular depth value you wish to clear to, and use CopySubresourceRegion. http://msdn.microsof...4(v=vs.85).aspx[/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.

Ok, I'll try it,thank you.

This topic is closed to new replies.

Advertisement