Jump to content
  • Advertisement
Sign in to follow this  
iGrfx

DX11 Is there a way to clear sub region of a depth stencial view in DX11?

Recommended Posts

Posted (edited)

I want to clear only a sub area of a DSV, I wonder how to make it in DX11 ? Like what can be done using ID3D12GraphicsCommandList::ClearDepthStencilView.

Anyone has some advise?

Edited by iGrfx

Share this post


Link to post
Share on other sites
Advertisement

One way is to set depth and color write mask to false  and set up a manual screen space quad to render with desired stencil write mask and to always depth/stencil pass.

Share this post


Link to post
Share on other sites

Greate thanks to all of you!:D

I finally decided to use “CopySubresourceRegion” as an alternative way to achive this.

Share this post


Link to post
Share on other sites

wooops,looks like CopySubresourceRegion not work but CopyResource works fine....

 

Share this post


Link to post
Share on other sites
Posted (edited)

Seems to work for depth-only though, so no stencil.

But it gets worse. I liked the idea about using CopySubresourceRegion as a workaround, though it doesn't allow arbitrary regions for ... wait for it ... depth textures (see final not in the remarks).  

Yeah, if all fails, blitting quads it is. :P

Edited by unbird

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!