On 6 July 2014 18:06, Stefan Dösinger <stefan(a)codeweavers.com> wrote:
> diff --git a/dlls/ddraw/surface.c b/dlls/ddraw/surface.c
> index 3d61e61..7367c01 100644
> --- a/dlls/ddraw/surface.c
> +++ b/dlls/ddraw/surface.c
> @@ -5838,6 +5838,7 @@ HRESULT ddraw_surface_create(struct ddraw *ddraw, const DDSURFACEDESC2 *surface_
> {
> enum wined3d_resource_type rtype;
> DWORD usage = 0;
> + enum wined3d_format_id adapter_format = mode.format_id;
>
> if (desc->ddsCaps.dwCaps2 & DDSCAPS2_CUBEMAP)
> rtype = WINED3D_RTYPE_CUBE_TEXTURE;
> @@ -5851,8 +5852,11 @@ HRESULT ddraw_surface_create(struct ddraw *ddraw, const DDSURFACEDESC2 *surface_
> else if (desc->ddsCaps.dwCaps & DDSCAPS_3DDEVICE)
> usage = WINED3DUSAGE_RENDERTARGET;
>
> + if (desc->ddsCaps.dwCaps & DDSCAPS_PRIMARYSURFACE)
> + adapter_format = WINED3DFMT_B8G8R8X8_UNORM;
> +
> if (SUCCEEDED(hr = wined3d_check_device_format(ddraw->wined3d, WINED3DADAPTER_DEFAULT,
> - WINED3D_DEVICE_TYPE_HAL, mode.format_id, usage, rtype, wined3d_desc.format)))
> + WINED3D_DEVICE_TYPE_HAL, adapter_format, usage, rtype, wined3d_desc.format)))
I don't think this fix is quite correct either. The drawable format is
a wined3d internal thing, ddraw shouldn't have to know about it. In
principle it wouldn't necessarily need to be WINED3DFMT_B8G8R8X8_UNORM
either, for example if we ever get around to supporting 10 bpc display
modes. So I think the fix for this would need to be in
wined3d_check_device_format(), or its utility functions.