Jump to content

  • Log In with Google      Sign In   
  • Create Account

FREE SOFTWARE GIVEAWAY

We have 4 x Pro Licences (valued at $59 each) for 2d modular animation software Spriter to give away in this Thursday's GDNet Direct email newsletter.


Read more in this forum topic or make sure you're signed up (from the right-hand sidebar on the homepage) and read Thursday's newsletter to get in the running!


How to clear a part of DepthStencil in DX11?


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
4 replies to this topic

#1 artint   Members   -  Reputation: 102

Like
0Likes
Like

Posted 08 September 2012 - 12:50 AM

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

Sponsor:

#2 Erik Rufelt   Crossbones+   -  Reputation: 3642

Like
0Likes
Like

Posted 08 September 2012 - 08:59 AM

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

#3 artint   Members   -  Reputation: 102

Like
0Likes
Like

Posted 08 September 2012 - 12:13 PM

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.

#4 Erik Rufelt   Crossbones+   -  Reputation: 3642

Like
0Likes
Like

Posted 08 September 2012 - 02:09 PM

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

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, 08 September 2012 - 02:12 PM.


#5 artint   Members   -  Reputation: 102

Like
0Likes
Like

Posted 09 September 2012 - 12:50 AM

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

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.




Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS