diff --git a/dlls/d3d8/d3d8_private.h b/dlls/d3d8/d3d8_private.h index 1a7d7fd231c..e7dea353715 100644 --- a/dlls/d3d8/d3d8_private.h +++ b/dlls/d3d8/d3d8_private.h @@ -42,7 +42,6 @@ #define VS_HIGHESTFIXEDFXF 0xF0000000 void d3dcaps_from_wined3dcaps(D3DCAPS8 *caps, const WINED3DCAPS *wined3d_caps) DECLSPEC_HIDDEN; -void fixup_caps(WINED3DCAPS *pWineCaps) DECLSPEC_HIDDEN; struct d3d8 { diff --git a/dlls/d3d8/device.c b/dlls/d3d8/device.c index 1ef7420a9e8..d7a933b831d 100644 --- a/dlls/d3d8/device.c +++ b/dlls/d3d8/device.c @@ -282,6 +282,19 @@ void d3dcaps_from_wined3dcaps(D3DCAPS8 *caps, const WINED3DCAPS *wined3d_caps) caps->MaxVertexShaderConst = wined3d_caps->MaxVertexShaderConst; caps->PixelShaderVersion = wined3d_caps->PixelShaderVersion; caps->MaxPixelShaderValue = wined3d_caps->PixelShader1xMaxValue; + + /* D3D8 doesn't support SM 2.0 or higher, so clamp to 1.x */ + if (caps->PixelShaderVersion) + caps->PixelShaderVersion = D3DPS_VERSION(1, 4); + else + caps->PixelShaderVersion = D3DPS_VERSION(0, 0); + if (caps->VertexShaderVersion) + caps->VertexShaderVersion = D3DVS_VERSION(1, 1); + else + caps->VertexShaderVersion = D3DVS_VERSION(0, 0); + caps->MaxVertexShaderConst = min(D3D8_MAX_VERTEX_SHADER_CONSTANTF, caps->MaxVertexShaderConst); + + caps->StencilCaps &= ~WINED3DSTENCILCAPS_TWOSIDED; } /* Handle table functions */ @@ -527,7 +540,6 @@ static HRESULT WINAPI d3d8_device_GetDeviceCaps(IDirect3DDevice8 *iface, D3DCAPS hr = wined3d_device_get_device_caps(device->wined3d_device, &wined3d_caps); wined3d_mutex_unlock(); - fixup_caps(&wined3d_caps); d3dcaps_from_wined3dcaps(caps, &wined3d_caps); return hr; diff --git a/dlls/d3d8/directx.c b/dlls/d3d8/directx.c index 560e107a861..f91e4af034a 100644 --- a/dlls/d3d8/directx.c +++ b/dlls/d3d8/directx.c @@ -315,22 +315,6 @@ static HRESULT WINAPI d3d8_CheckDepthStencilMatch(IDirect3D8 *iface, UINT adapte return hr; } -void fixup_caps(WINED3DCAPS *caps) -{ - /* D3D8 doesn't support SM 2.0 or higher, so clamp to 1.x */ - if (caps->PixelShaderVersion) - caps->PixelShaderVersion = D3DPS_VERSION(1,4); - else - caps->PixelShaderVersion = D3DPS_VERSION(0,0); - if (caps->VertexShaderVersion) - caps->VertexShaderVersion = D3DVS_VERSION(1,1); - else - caps->VertexShaderVersion = D3DVS_VERSION(0,0); - caps->MaxVertexShaderConst = min(D3D8_MAX_VERTEX_SHADER_CONSTANTF, caps->MaxVertexShaderConst); - - caps->StencilCaps &= ~WINED3DSTENCILCAPS_TWOSIDED; -} - static HRESULT WINAPI d3d8_GetDeviceCaps(IDirect3D8 *iface, UINT adapter, D3DDEVTYPE device_type, D3DCAPS8 *caps) { struct d3d8 *d3d8 = impl_from_IDirect3D8(iface); @@ -346,7 +330,6 @@ static HRESULT WINAPI d3d8_GetDeviceCaps(IDirect3D8 *iface, UINT adapter, D3DDEV hr = wined3d_get_device_caps(d3d8->wined3d, adapter, device_type, &wined3d_caps); wined3d_mutex_unlock(); - fixup_caps(&wined3d_caps); d3dcaps_from_wined3dcaps(caps, &wined3d_caps); return hr;