Skip to content

Commit

Permalink
Add asm call fninit to Reset() and CreateDevice()
Browse files Browse the repository at this point in the history
  • Loading branch information
elishacloud committed Apr 18, 2024
1 parent 7e4007e commit f85dcc7
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 1 deletion.
2 changes: 1 addition & 1 deletion Dllmain/BuildNo.rc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
#define BUILD_NUMBER 7001
#define BUILD_NUMBER 7002
2 changes: 2 additions & 0 deletions d3d9/IDirect3D9Ex.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -184,6 +184,8 @@ HRESULT m_IDirect3D9Ex::CheckDeviceFormatConversion(THIS_ UINT Adapter, D3DDEVTY
template <typename T>
HRESULT m_IDirect3D9Ex::CreateDeviceT(D3DPRESENT_PARAMETERS& d3dpp, bool& MultiSampleFlag, UINT Adapter, D3DDEVTYPE DeviceType, HWND hFocusWindow, DWORD BehaviorFlags, D3DPRESENT_PARAMETERS* pPresentationParameters, D3DDISPLAYMODEEX* pFullscreenDisplayMode, T ppReturnedDeviceInterface)
{
__asm { fninit } // Reset FPU before creating device

if (!pPresentationParameters || !ppReturnedDeviceInterface)
{
return D3DERR_INVALIDCALL;
Expand Down
2 changes: 2 additions & 0 deletions d3d9/IDirect3DDevice9Ex.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,8 @@ void m_IDirect3DDevice9Ex::ClearVars(D3DPRESENT_PARAMETERS* pPresentationParamet
template <typename T>
HRESULT m_IDirect3DDevice9Ex::ResetT(T func, D3DPRESENT_PARAMETERS &d3dpp, D3DPRESENT_PARAMETERS* pPresentationParameters, D3DDISPLAYMODEEX* pFullscreenDisplayMode)
{
__asm { fninit } // Reset FPU before resetting

if (!pPresentationParameters)
{
return D3DERR_INVALIDCALL;
Expand Down

0 comments on commit f85dcc7

Please sign in to comment.