d3d8: Introduce a helper to convert d3d8 device types to wined3d types.
Signed-off-by: Chip Davis <cdavis@codeweavers.com> Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com> Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
parent
43104e37ad
commit
9937a26b1a
|
@ -374,4 +374,9 @@ static inline D3DMULTISAMPLE_TYPE d3dmultisample_type_from_wined3d(enum wined3d_
|
|||
return (D3DMULTISAMPLE_TYPE)type;
|
||||
}
|
||||
|
||||
static inline enum wined3d_device_type wined3d_device_type_from_d3d(D3DDEVTYPE type)
|
||||
{
|
||||
return (enum wined3d_device_type)type;
|
||||
}
|
||||
|
||||
#endif /* __WINE_D3DX8_PRIVATE_H */
|
||||
|
|
|
@ -3722,7 +3722,7 @@ HRESULT device_init(struct d3d8_device *device, struct d3d8 *parent, struct wine
|
|||
|
||||
wined3d_mutex_lock();
|
||||
wined3d_adapter = wined3d_output_get_adapter(parent->wined3d_outputs[output_idx]);
|
||||
if (FAILED(hr = wined3d_device_create(wined3d, wined3d_adapter, device_type,
|
||||
if (FAILED(hr = wined3d_device_create(wined3d, wined3d_adapter, wined3d_device_type_from_d3d(device_type),
|
||||
focus_window, flags, 4, feature_levels, ARRAY_SIZE(feature_levels),
|
||||
&device->device_parent, &device->wined3d_device)))
|
||||
{
|
||||
|
@ -3732,7 +3732,7 @@ HRESULT device_init(struct d3d8_device *device, struct d3d8 *parent, struct wine
|
|||
return hr;
|
||||
}
|
||||
|
||||
wined3d_get_device_caps(wined3d_adapter, device_type, &caps);
|
||||
wined3d_get_device_caps(wined3d_adapter, wined3d_device_type_from_d3d(device_type), &caps);
|
||||
device->max_user_clip_planes = caps.MaxUserClipPlanes;
|
||||
device->vs_uniform_count = caps.MaxVertexShaderConst;
|
||||
|
||||
|
|
|
@ -232,8 +232,8 @@ static HRESULT WINAPI d3d8_CheckDeviceType(IDirect3D8 *iface, UINT adapter, D3DD
|
|||
return WINED3DERR_NOTAVAILABLE;
|
||||
|
||||
wined3d_mutex_lock();
|
||||
hr = wined3d_check_device_type(d3d8->wined3d, d3d8->wined3d_outputs[output_idx], device_type,
|
||||
wined3dformat_from_d3dformat(display_format),
|
||||
hr = wined3d_check_device_type(d3d8->wined3d, d3d8->wined3d_outputs[output_idx],
|
||||
wined3d_device_type_from_d3d(device_type), wined3dformat_from_d3dformat(display_format),
|
||||
wined3dformat_from_d3dformat(backbuffer_format), windowed);
|
||||
wined3d_mutex_unlock();
|
||||
|
||||
|
@ -298,13 +298,13 @@ static HRESULT WINAPI d3d8_CheckDeviceFormat(IDirect3D8 *iface, UINT adapter, D3
|
|||
{
|
||||
DWORD levels;
|
||||
|
||||
hr = wined3d_check_device_multisample_type(wined3d_adapter, device_type,
|
||||
hr = wined3d_check_device_multisample_type(wined3d_adapter, wined3d_device_type_from_d3d(device_type),
|
||||
WINED3DFMT_D24_UNORM_S8_UINT, FALSE, WINED3D_MULTISAMPLE_NON_MASKABLE, &levels);
|
||||
if (SUCCEEDED(hr) && !levels)
|
||||
hr = D3DERR_NOTAVAILABLE;
|
||||
}
|
||||
else
|
||||
hr = wined3d_check_device_format(d3d8->wined3d, wined3d_adapter, device_type,
|
||||
hr = wined3d_check_device_format(d3d8->wined3d, wined3d_adapter, wined3d_device_type_from_d3d(device_type),
|
||||
wined3dformat_from_d3dformat(adapter_format), usage, bind_flags, wined3d_rtype,
|
||||
wined3dformat_from_d3dformat(format));
|
||||
wined3d_mutex_unlock();
|
||||
|
@ -332,7 +332,7 @@ static HRESULT WINAPI d3d8_CheckDeviceMultiSampleType(IDirect3D8 *iface, UINT ad
|
|||
|
||||
wined3d_mutex_lock();
|
||||
wined3d_adapter = wined3d_output_get_adapter(d3d8->wined3d_outputs[output_idx]);
|
||||
hr = wined3d_check_device_multisample_type(wined3d_adapter, device_type,
|
||||
hr = wined3d_check_device_multisample_type(wined3d_adapter, wined3d_device_type_from_d3d(device_type),
|
||||
wined3dformat_from_d3dformat(format), windowed,
|
||||
(enum wined3d_multisample_type)multisample_type, NULL);
|
||||
wined3d_mutex_unlock();
|
||||
|
@ -357,7 +357,7 @@ static HRESULT WINAPI d3d8_CheckDepthStencilMatch(IDirect3D8 *iface, UINT adapte
|
|||
|
||||
wined3d_mutex_lock();
|
||||
wined3d_adapter = wined3d_output_get_adapter(d3d8->wined3d_outputs[output_idx]);
|
||||
hr = wined3d_check_depth_stencil_match(wined3d_adapter, device_type,
|
||||
hr = wined3d_check_depth_stencil_match(wined3d_adapter, wined3d_device_type_from_d3d(device_type),
|
||||
wined3dformat_from_d3dformat(adapter_format), wined3dformat_from_d3dformat(rt_format),
|
||||
wined3dformat_from_d3dformat(ds_format));
|
||||
wined3d_mutex_unlock();
|
||||
|
@ -384,7 +384,7 @@ static HRESULT WINAPI d3d8_GetDeviceCaps(IDirect3D8 *iface, UINT adapter, D3DDEV
|
|||
|
||||
wined3d_mutex_lock();
|
||||
wined3d_adapter = wined3d_output_get_adapter(d3d8->wined3d_outputs[output_idx]);
|
||||
hr = wined3d_get_device_caps(wined3d_adapter, device_type, &wined3d_caps);
|
||||
hr = wined3d_get_device_caps(wined3d_adapter, wined3d_device_type_from_d3d(device_type), &wined3d_caps);
|
||||
wined3d_mutex_unlock();
|
||||
|
||||
d3dcaps_from_wined3dcaps(caps, &wined3d_caps, adapter);
|
||||
|
|
Loading…
Reference in New Issue