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>
This commit is contained in:
Józef Kucia 2017-02-21 13:24:42 +01:00 committed by Alexandre Julliard
parent b9688afce5
commit 377c2eebbf
3 changed files with 13 additions and 19 deletions

View file

@ -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
{

View file

@ -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;

View file

@ -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;