Echelon9 / cxbx-shogun

shogun's mirrored branch of the Cxbx original Xbox emulator
GNU General Public License v2.0
33 stars 7 forks source link

Improve emulated Direct3DDevice::Clear() calls when render target does not have an attached depth buffer #12

Closed Echelon9 closed 10 years ago

Echelon9 commented 10 years ago

Per MSDN, Direct3DDevice::Clear() fails if the D3DCLEAR_ZBUFFER or D3DCLEAR_STENCIL flags are specified when the render target does not have an attached depth buffer (e.g. Software Renderer on DirectX 8).

We can provide flexibility to use the Software Renderer and DirectX Debug Runtime mode if the Cxbx emulator tracks the presence/absence of a depth buffer and modifies on the fly calls to Direct3DDevice::Clear() in titles.

DirectX Debug Runtime log

With the Software Renderer selected, the error report is as follows:

Direct3D8: (ERROR) :Invalid flag D3DCLEAR_STENCIL: no zbuffer is associated with device. Clear failed.
Echelon9 commented 10 years ago
Improved titles