Commit 377c2eeb authored by Józef Kucia's avatar Józef Kucia Committed by Alexandre Julliard

d3d8: Merge fixup_caps() into d3dcaps_from_wined3dcaps().

parent b9688afc
...@@ -42,7 +42,6 @@ ...@@ -42,7 +42,6 @@
#define VS_HIGHESTFIXEDFXF 0xF0000000 #define VS_HIGHESTFIXEDFXF 0xF0000000
void d3dcaps_from_wined3dcaps(D3DCAPS8 *caps, const WINED3DCAPS *wined3d_caps) DECLSPEC_HIDDEN; void d3dcaps_from_wined3dcaps(D3DCAPS8 *caps, const WINED3DCAPS *wined3d_caps) DECLSPEC_HIDDEN;
void fixup_caps(WINED3DCAPS *pWineCaps) DECLSPEC_HIDDEN;
struct d3d8 struct d3d8
{ {
......
...@@ -282,6 +282,19 @@ void d3dcaps_from_wined3dcaps(D3DCAPS8 *caps, const WINED3DCAPS *wined3d_caps) ...@@ -282,6 +282,19 @@ void d3dcaps_from_wined3dcaps(D3DCAPS8 *caps, const WINED3DCAPS *wined3d_caps)
caps->MaxVertexShaderConst = wined3d_caps->MaxVertexShaderConst; caps->MaxVertexShaderConst = wined3d_caps->MaxVertexShaderConst;
caps->PixelShaderVersion = wined3d_caps->PixelShaderVersion; caps->PixelShaderVersion = wined3d_caps->PixelShaderVersion;
caps->MaxPixelShaderValue = wined3d_caps->PixelShader1xMaxValue; 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 */ /* Handle table functions */
...@@ -527,7 +540,6 @@ static HRESULT WINAPI d3d8_device_GetDeviceCaps(IDirect3DDevice8 *iface, D3DCAPS ...@@ -527,7 +540,6 @@ static HRESULT WINAPI d3d8_device_GetDeviceCaps(IDirect3DDevice8 *iface, D3DCAPS
hr = wined3d_device_get_device_caps(device->wined3d_device, &wined3d_caps); hr = wined3d_device_get_device_caps(device->wined3d_device, &wined3d_caps);
wined3d_mutex_unlock(); wined3d_mutex_unlock();
fixup_caps(&wined3d_caps);
d3dcaps_from_wined3dcaps(caps, &wined3d_caps); d3dcaps_from_wined3dcaps(caps, &wined3d_caps);
return hr; return hr;
......
...@@ -315,22 +315,6 @@ static HRESULT WINAPI d3d8_CheckDepthStencilMatch(IDirect3D8 *iface, UINT adapte ...@@ -315,22 +315,6 @@ static HRESULT WINAPI d3d8_CheckDepthStencilMatch(IDirect3D8 *iface, UINT adapte
return hr; 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) static HRESULT WINAPI d3d8_GetDeviceCaps(IDirect3D8 *iface, UINT adapter, D3DDEVTYPE device_type, D3DCAPS8 *caps)
{ {
struct d3d8 *d3d8 = impl_from_IDirect3D8(iface); struct d3d8 *d3d8 = impl_from_IDirect3D8(iface);
...@@ -346,7 +330,6 @@ static HRESULT WINAPI d3d8_GetDeviceCaps(IDirect3D8 *iface, UINT adapter, D3DDEV ...@@ -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); hr = wined3d_get_device_caps(d3d8->wined3d, adapter, device_type, &wined3d_caps);
wined3d_mutex_unlock(); wined3d_mutex_unlock();
fixup_caps(&wined3d_caps);
d3dcaps_from_wined3dcaps(caps, &wined3d_caps); d3dcaps_from_wined3dcaps(caps, &wined3d_caps);
return hr; return hr;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment