From: Chip Davis cdavis@codeweavers.com
Signed-off-by: Chip Davis cdavis@codeweavers.com Signed-off-by: Henri Verbeet hverbeet@codeweavers.com --- dlls/d3d9/d3d9_private.h | 10 ++++++++++ dlls/d3d9/device.c | 25 +++++++++++++------------ dlls/d3d9/directx.c | 4 ++-- dlls/d3d9/surface.c | 2 +- dlls/d3d9/texture.c | 4 ++-- 5 files changed, 28 insertions(+), 17 deletions(-)
diff --git a/dlls/d3d9/d3d9_private.h b/dlls/d3d9/d3d9_private.h index ff9a8fec0b0..0d7ab0172a2 100644 --- a/dlls/d3d9/d3d9_private.h +++ b/dlls/d3d9/d3d9_private.h @@ -336,6 +336,11 @@ static inline D3DPOOL d3dpool_from_wined3daccess(unsigned int access, unsigned i } }
+static inline D3DMULTISAMPLE_TYPE d3dmultisample_type_from_wined3d(enum wined3d_multisample_type type) +{ + return (D3DMULTISAMPLE_TYPE)type; +} + static inline unsigned int map_access_from_usage(unsigned int usage) { if (usage & D3DUSAGE_WRITEONLY) @@ -384,4 +389,9 @@ static inline DWORD wined3dusage_from_d3dusage(unsigned int usage) return usage & WINED3DUSAGE_MASK; }
+static inline enum wined3d_multisample_type wined3d_multisample_type_from_d3d(D3DMULTISAMPLE_TYPE type) +{ + return (enum wined3d_multisample_type)type; +} + #endif /* __WINE_D3D9_PRIVATE_H */ diff --git a/dlls/d3d9/device.c b/dlls/d3d9/device.c index 53137da28f1..3f81f1474aa 100644 --- a/dlls/d3d9/device.c +++ b/dlls/d3d9/device.c @@ -244,7 +244,7 @@ void present_parameters_from_wined3d_swapchain_desc(D3DPRESENT_PARAMETERS *prese present_parameters->BackBufferHeight = swapchain_desc->backbuffer_height; present_parameters->BackBufferFormat = d3dformat_from_wined3dformat(swapchain_desc->backbuffer_format); present_parameters->BackBufferCount = swapchain_desc->backbuffer_count; - present_parameters->MultiSampleType = swapchain_desc->multisample_type; + present_parameters->MultiSampleType = d3dmultisample_type_from_wined3d(swapchain_desc->multisample_type); present_parameters->MultiSampleQuality = swapchain_desc->multisample_quality; present_parameters->SwapEffect = d3dswapeffect_from_wined3dswapeffect(swapchain_desc->swap_effect); present_parameters->hDeviceWindow = swapchain_desc->device_window; @@ -335,7 +335,7 @@ static BOOL wined3d_swapchain_desc_from_present_parameters(struct wined3d_swapch swapchain_desc->backbuffer_format = wined3dformat_from_d3dformat(present_parameters->BackBufferFormat); swapchain_desc->backbuffer_count = max(1, present_parameters->BackBufferCount); swapchain_desc->backbuffer_bind_flags = WINED3D_BIND_RENDER_TARGET; - swapchain_desc->multisample_type = present_parameters->MultiSampleType; + swapchain_desc->multisample_type = wined3d_multisample_type_from_d3d(present_parameters->MultiSampleType); swapchain_desc->multisample_quality = present_parameters->MultiSampleQuality; swapchain_desc->swap_effect = wined3dswapeffect_from_d3dswapeffect(present_parameters->SwapEffect); swapchain_desc->device_window = present_parameters->hDeviceWindow; @@ -1543,8 +1543,8 @@ static HRESULT d3d9_device_create_surface(struct d3d9_device *device, unsigned i IDirect3DSurface9_AddRef(*surface);
if (user_mem) - wined3d_texture_update_desc(texture, width, height, - desc.format, multisample_type, multisample_quality, user_mem, 0); + wined3d_texture_update_desc(texture, width, height, desc.format, + wined3d_multisample_type_from_d3d(multisample_type), multisample_quality, user_mem, 0);
wined3d_texture_decref(texture);
@@ -1596,8 +1596,9 @@ static HRESULT WINAPI d3d9_device_CreateRenderTarget(IDirect3DDevice9Ex *iface, if (lockable) access |= WINED3D_RESOURCE_ACCESS_MAP_R | WINED3D_RESOURCE_ACCESS_MAP_W;
- return d3d9_device_create_surface(device, 0, wined3dformat_from_d3dformat(format), multisample_type, - multisample_quality, 0, WINED3D_BIND_RENDER_TARGET, access, width, height, NULL, surface); + return d3d9_device_create_surface(device, 0, wined3dformat_from_d3dformat(format), + wined3d_multisample_type_from_d3d(multisample_type), multisample_quality, 0, + WINED3D_BIND_RENDER_TARGET, access, width, height, NULL, surface); }
static HRESULT WINAPI d3d9_device_CreateDepthStencilSurface(IDirect3DDevice9Ex *iface, UINT width, UINT height, @@ -1628,8 +1629,8 @@ static HRESULT WINAPI d3d9_device_CreateDepthStencilSurface(IDirect3DDevice9Ex * flags |= WINED3D_TEXTURE_CREATE_DISCARD;
return d3d9_device_create_surface(device, flags, wined3dformat_from_d3dformat(format), - multisample_type, multisample_quality, 0, WINED3D_BIND_DEPTH_STENCIL, - WINED3D_RESOURCE_ACCESS_GPU, width, height, NULL, surface); + wined3d_multisample_type_from_d3d(multisample_type), multisample_quality, 0, + WINED3D_BIND_DEPTH_STENCIL, WINED3D_RESOURCE_ACCESS_GPU, width, height, NULL, surface); }
@@ -4276,8 +4277,8 @@ static HRESULT WINAPI d3d9_device_CreateRenderTargetEx(IDirect3DDevice9Ex *iface access |= WINED3D_RESOURCE_ACCESS_MAP_R | WINED3D_RESOURCE_ACCESS_MAP_W;
return d3d9_device_create_surface(device, 0, wined3dformat_from_d3dformat(format), - multisample_type, multisample_quality, usage & WINED3DUSAGE_MASK, - WINED3D_BIND_RENDER_TARGET, access, width, height, NULL, surface); + wined3d_multisample_type_from_d3d(multisample_type), multisample_quality, + usage & WINED3DUSAGE_MASK, WINED3D_BIND_RENDER_TARGET, access, width, height, NULL, surface); }
static HRESULT WINAPI d3d9_device_CreateOffscreenPlainSurfaceEx(IDirect3DDevice9Ex *iface, @@ -4316,8 +4317,8 @@ static HRESULT WINAPI d3d9_device_CreateDepthStencilSurfaceEx(IDirect3DDevice9Ex
*surface = NULL; return d3d9_device_create_surface(device, flags, wined3dformat_from_d3dformat(format), - multisample_type, multisample_quality, usage & WINED3DUSAGE_MASK, WINED3D_BIND_DEPTH_STENCIL, - WINED3D_RESOURCE_ACCESS_GPU, width, height, NULL, surface); + wined3d_multisample_type_from_d3d(multisample_type), multisample_quality, usage & WINED3DUSAGE_MASK, + WINED3D_BIND_DEPTH_STENCIL, WINED3D_RESOURCE_ACCESS_GPU, width, height, NULL, surface); }
static HRESULT WINAPI DECLSPEC_HOTPATCH d3d9_device_ResetEx(IDirect3DDevice9Ex *iface, diff --git a/dlls/d3d9/directx.c b/dlls/d3d9/directx.c index 6c67be31b45..6a1745ee1cb 100644 --- a/dlls/d3d9/directx.c +++ b/dlls/d3d9/directx.c @@ -368,8 +368,8 @@ static HRESULT WINAPI d3d9_CheckDeviceMultiSampleType(IDirect3D9Ex *iface, UINT
wined3d_mutex_lock(); wined3d_adapter = wined3d_output_get_adapter(d3d9->wined3d_outputs[output_idx]); - hr = wined3d_check_device_multisample_type(wined3d_adapter, device_type, - wined3dformat_from_d3dformat(format), windowed, multisample_type, levels); + hr = wined3d_check_device_multisample_type(wined3d_adapter, device_type, wined3dformat_from_d3dformat(format), + windowed, wined3d_multisample_type_from_d3d(multisample_type), levels); wined3d_mutex_unlock(); if (hr == WINED3DERR_NOTAVAILABLE && levels) *levels = 1; diff --git a/dlls/d3d9/surface.c b/dlls/d3d9/surface.c index b74f6cacf7e..3d1fbf12f99 100644 --- a/dlls/d3d9/surface.c +++ b/dlls/d3d9/surface.c @@ -224,7 +224,7 @@ static HRESULT WINAPI d3d9_surface_GetDesc(IDirect3DSurface9 *iface, D3DSURFACE_ desc->Type = D3DRTYPE_SURFACE; desc->Usage = d3dusage_from_wined3dusage(wined3d_desc.usage, wined3d_desc.bind_flags); desc->Pool = d3dpool_from_wined3daccess(wined3d_desc.access, wined3d_desc.usage); - desc->MultiSampleType = wined3d_desc.multisample_type; + desc->MultiSampleType = d3dmultisample_type_from_wined3d(wined3d_desc.multisample_type); desc->MultiSampleQuality = wined3d_desc.multisample_quality; desc->Width = wined3d_desc.width; desc->Height = wined3d_desc.height; diff --git a/dlls/d3d9/texture.c b/dlls/d3d9/texture.c index 9be9d450ba0..a8c2985c4ea 100644 --- a/dlls/d3d9/texture.c +++ b/dlls/d3d9/texture.c @@ -367,7 +367,7 @@ static HRESULT WINAPI d3d9_texture_2d_GetLevelDesc(IDirect3DTexture9 *iface, UIN desc->Type = D3DRTYPE_SURFACE; desc->Usage = texture->usage; desc->Pool = d3dpool_from_wined3daccess(wined3d_desc.access, wined3d_desc.usage); - desc->MultiSampleType = wined3d_desc.multisample_type; + desc->MultiSampleType = d3dmultisample_type_from_wined3d(wined3d_desc.multisample_type); desc->MultiSampleQuality = wined3d_desc.multisample_quality; desc->Width = wined3d_desc.width; desc->Height = wined3d_desc.height; @@ -774,7 +774,7 @@ static HRESULT WINAPI d3d9_texture_cube_GetLevelDesc(IDirect3DCubeTexture9 *ifac desc->Type = D3DRTYPE_SURFACE; desc->Usage = texture->usage; desc->Pool = d3dpool_from_wined3daccess(wined3d_desc.access, wined3d_desc.usage); - desc->MultiSampleType = wined3d_desc.multisample_type; + desc->MultiSampleType = d3dmultisample_type_from_wined3d(wined3d_desc.multisample_type); desc->MultiSampleQuality = wined3d_desc.multisample_quality; desc->Width = wined3d_desc.width; desc->Height = wined3d_desc.height;