Module: wine Branch: master Commit: 377c2eebbfc750d67c687c1d81911200b92c004d URL: http://source.winehq.org/git/wine.git/?a=commit;h=377c2eebbfc750d67c687c1d81...
Author: Józef Kucia jkucia@codeweavers.com Date: Tue Feb 21 13:24:42 2017 +0100
d3d8: Merge fixup_caps() into d3dcaps_from_wined3dcaps().
Signed-off-by: Józef Kucia jkucia@codeweavers.com Signed-off-by: Henri Verbeet hverbeet@codeweavers.com Signed-off-by: Alexandre Julliard julliard@winehq.org
---
dlls/d3d8/d3d8_private.h | 1 - dlls/d3d8/device.c | 14 +++++++++++++- dlls/d3d8/directx.c | 17 ----------------- 3 files changed, 13 insertions(+), 19 deletions(-)
diff --git a/dlls/d3d8/d3d8_private.h b/dlls/d3d8/d3d8_private.h index 1a7d7fd..e7dea35 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 1ef7420..d7a933b 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 560e107..f91e4af 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;