Sign in to follow this  
TheDmD

[D3D9] Automatic v.s. manual depth buffer creation

Recommended Posts

Hello, Currently I creating window output interface to my engine. Now I'm using automatic depth buffer creation.
  D3DPRESENT_PARAMETERS l_present_parameters;
  ...
  l_present_parameters.EnableAutoDepthStencil = TRUE;
  l_present_parameters.Flags = D3DPRESENTFLAG_DISCARD_DEPTHSTENCIL;
Now D3D discards my depth buffer immediately after call to Present() or SetDepthStencilBuffer(). This option it will be faster than manualy managing? It mean: I creating my depth buffer once and I'm using it simultaneously with render target. I'm setting it via SetRenderTarget() and SetDepthStencilBuffer() before rendering scene. Which option is faster? There is big difference when I have a few output windows? Second question. If I want do disable depth buffer when I'm using automatic buffer managment should I call SetDepthStencilBuffer() with NULL or just forgot about it and ignore all depth releated flags?

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