vo_direct3d: stop D3D from switching the FPU to single precision mode

Add the flag D3DCREATE_FPU_PRESERVE, which tells Direct3D not to switch
the FPU to single precision mode. Single precision mode would mean that
all floating point calculations are done in float precision, even if
using double variables.

The MSDN documentation seems to discourage use of this flag with scary
warnings about bad performance and stability, but I suspect in practice
switching off this completely unreasonable behavior is fine.
This commit is contained in:
wm4 2011-12-27 00:26:48 +01:00
parent 1575ba6293
commit da4dd6d14b
1 changed files with 2 additions and 1 deletions

View File

@ -796,7 +796,8 @@ static bool change_d3d_backbuffer(d3d_priv *priv)
if (FAILED(IDirect3D9_CreateDevice(priv->d3d_handle,
D3DADAPTER_DEFAULT,
DEVTYPE, vo_w32_window,
D3DCREATE_SOFTWARE_VERTEXPROCESSING,
D3DCREATE_SOFTWARE_VERTEXPROCESSING
| D3DCREATE_FPU_PRESERVE,
&present_params, &priv->d3d_device)))
{
mp_msg(MSGT_VO, MSGL_V,