0
\$\begingroup\$

Encountered a strange error when using Direct3D11, feature level 10.0.

If the depth buffer texture is created with the format DXGI_FORMAT_R24G8_TYPELESS, bind flag D3D11_BIND_DEPTH_STENCIL | D3D11_BIND_SHADER_RESOURCE and the depth stencil view format DXGI_FORMAT_D24_UNORM_S8_UINT, everything is correct. Also, there are no problems when the depth buffer texture format is DXGI_FORMAT_R32G8X24_TYPELESS and the depth stencil view format is DXGI_FORMAT_D32_FLOAT_S8X24_UINT.

However, when the depth buffer format is DXGI_FORMAT_R32_TYPELESS, and the depth stencil view format is DXGI_FORMAT_D32_FLOAT, the whole geometry is not rendered at all, only the clear color is visible. I used Visual Studio 2015's Graphics Debugger to check if the geometry is rendered as desired, but during the Output Merger stage the whole geometry is discarded because it failed the depth test. Every Direct3D function call returns no error and the Direct3D debugging output reports no error (only INFO messages about creation/destruction of resources). I do not use the stencil functionality at all, and it is disabled.

I use a Windows 7 virtual machine as a developer machine and using DXGI_FORMAT_R32_TYPELESS and DXGI_FORMAT_D32_FLOAT worked flawlessly before I switched from a Windows 7 host to an Arch Linux host, because the old hard-drive started to fail and the operating system was unable to read its own files during boot. After I switched the host operating system, this problem started to occur inside the virtual machine.

Is it possible to have a bug somewhere else in my code?

Is there a limitation when using DXGI_FORMAT_D32_FLOAT and sometimes it may not be possible to use DXGI_FORMAT_D32_FLOAT or the other depth formats on every machine (considering D3D11 feature level 10.0 is available)?

Or is this a bug somewhere else, possibly in VMware player or Linux or Bumblebee (Optimus - Intel HD 4000 + GeForce GTX 650M)?

\$\endgroup\$

1 Answer 1

0
\$\begingroup\$

If you are getting a rejection of all the geometry, just check what you are clearing your depth buffer to initially. Also, are you still binding depth stencil to your buffer when using d32? If so, remove that binding and recheck (I cant remember but there might be an issue there).

I use the same D32/R32 typeless currently in my project for shadow buffers. I will double check if there is anything special.

\$\endgroup\$

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .