0

On the D3D10 Docs is a list which shows the deprecated features from D3D9 to D3D10. It says that W buffering is no longer supported and we should use high-precision depth buffers/Z-Buffers instead. I suspect that it is also not (fully) supported in Direct3D 11 and 12. But is there any way to use W-buffers in Direct3D 12?

L1-Cache
  • 91
  • 6

1 Answers1

1

The "W-buffering" feature in Direct3D 9 is part of the legacy fixed-function pipeline. In Direct3D 10 and later, you can only use the programmable shader pipeline (or for DirectX 11+ the DirectCompute shader pipeline). Therefore, the 'w-buffering' hardware feature isn't relevant. This was also much more of an issue with Direct3D 9 era hardware when people were using 16-bit depth buffers.

In the programmable shader model, it's up to your shaders to compute depth values using either conventional z or linearized-depth values, and set the appropriate depth/stencil state. Beware that you need to use SV_DepthGreater or SV_DepthLessEqual instead of SV_Depth to not lose 'early z rejection' optimizations.

See this blog post and this post for a good discussion of the topic.

TL;DR: Most people just use DXGI_FORMAT_D32_FLOAT and don't worry about it.

Chuck Walbourn
  • 38,259
  • 2
  • 58
  • 81
  • Does Z-Fighting also occur when using SV_Depth? – L1-Cache Apr 28 '20 at 12:46
  • Z fighting can happen anytime you have insufficient precision in the depth-buffer for your near/far plane settings. It's just much less of an issue when using ``DXGI_FORMAT_D32_FLOAT`` instead of the old 16-bit depth formats. – Chuck Walbourn Apr 28 '20 at 18:39