Skip to content

Commit

Permalink
Test for shader creation errors
Browse files Browse the repository at this point in the history
  • Loading branch information
ccw808 committed Mar 20, 2018
1 parent ea97269 commit 47e08b5
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 5 deletions.
10 changes: 6 additions & 4 deletions Client/core/DXHook/CDirect3DHook9.cpp
Expand Up @@ -73,6 +73,8 @@ IDirect3D9* CDirect3DHook9::API_Direct3DCreate9(UINT SDKVersion)
CDirect3DHook9* pThis = CDirect3DHook9::GetSingletonPtr();
assert(pThis && "API_Direct3DCreate9: No CDirect3DHook9");

// Override GTA supplied SDK version
SDKVersion = D3D_SDK_VERSION;
if (pThis->m_bDirect3DCreate9Suspended)
return pThis->m_pfnDirect3DCreate9(SDKVersion);

Expand All @@ -89,13 +91,13 @@ IDirect3D9* CDirect3DHook9::API_Direct3DCreate9(UINT SDKVersion)
}

// D3DX_SDK_VERSION checks
// August 2009 SDK required for shaders to work properly
#if D3DX_SDK_VERSION != 42
// June 2010 SDK required for shaders to work properly
#if D3DX_SDK_VERSION != 43
WriteDebugEvent("D3DX_SDK_VERSION incorrect " QUOTE_DEFINE(D3DX_SDK_VERSION));
#pragma message( "WARNING: Microsoft DirectX SDK (August 2009) includes missing" )
#pragma message( "WARNING: Microsoft DirectX SDK (June 2010) includes missing" )
#ifndef CI_BUILD
#ifndef MTA_DEBUG
#error "Microsoft DirectX SDK (August 2009) includes missing"
#error "Microsoft DirectX SDK (June 2010) includes missing"
#endif
#endif
#endif
Expand Down
6 changes: 5 additions & 1 deletion Client/core/DXHook/CProxyDirect3D9.cpp
Expand Up @@ -111,7 +111,11 @@ HRESULT CProxyDirect3D9::CheckDeviceFormatConversion(UINT Adapter, D3DDEVTYPE De

HRESULT CProxyDirect3D9::GetDeviceCaps(UINT Adapter, D3DDEVTYPE DeviceType, D3DCAPS9* pCaps)
{
return m_pDevice->GetDeviceCaps(Adapter, DeviceType, pCaps);
HRESULT hr = m_pDevice->GetDeviceCaps(Adapter, DeviceType, pCaps);
// Make GTA not use shaders
pCaps->VertexShaderVersion = 0;
pCaps->PixelShaderVersion = 0;
return hr;
}

HMONITOR CProxyDirect3D9::GetAdapterMonitor(UINT Adapter)
Expand Down

0 comments on commit 47e08b5

Please sign in to comment.