From 2936e4ac54b14cc09c5b20b06b17fdb0545374b8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stefan=20D=C3=B6singer?= Date: Mon, 7 Sep 2015 23:50:34 +0200 Subject: [PATCH] wined3d: Remove wined3d_backbuffer_type. --- dlls/d3d8/device.c | 5 +++-- dlls/d3d8/swapchain.c | 5 +++-- dlls/d3d9/device.c | 5 +++-- dlls/d3d9/swapchain.c | 5 +++-- dlls/dxgi/swapchain.c | 6 ++---- dlls/wined3d/swapchain.c | 6 +++--- include/wine/wined3d.h | 9 +-------- 7 files changed, 18 insertions(+), 23 deletions(-) diff --git a/dlls/d3d8/device.c b/dlls/d3d8/device.c index 455c76415c6..e899b3402ad 100644 --- a/dlls/d3d8/device.c +++ b/dlls/d3d8/device.c @@ -732,6 +732,8 @@ static HRESULT WINAPI d3d8_device_GetBackBuffer(IDirect3DDevice8 *iface, TRACE("iface %p, backbuffer_idx %u, backbuffer_type %#x, backbuffer %p.\n", iface, backbuffer_idx, backbuffer_type, backbuffer); + /* backbuffer_type is ignored by native. */ + /* No need to check for backbuffer == NULL, Windows crashes in that case. */ wined3d_mutex_lock(); if (!(swapchain = wined3d_device_get_swapchain(device->wined3d_device, 0))) @@ -741,8 +743,7 @@ static HRESULT WINAPI d3d8_device_GetBackBuffer(IDirect3DDevice8 *iface, return D3DERR_INVALIDCALL; } - if (!(wined3d_texture = wined3d_swapchain_get_back_buffer(swapchain, - backbuffer_idx, (enum wined3d_backbuffer_type)backbuffer_type))) + if (!(wined3d_texture = wined3d_swapchain_get_back_buffer(swapchain, backbuffer_idx))) { wined3d_mutex_unlock(); *backbuffer = NULL; diff --git a/dlls/d3d8/swapchain.c b/dlls/d3d8/swapchain.c index 70b7fb0322e..8efdd0a5e92 100644 --- a/dlls/d3d8/swapchain.c +++ b/dlls/d3d8/swapchain.c @@ -120,6 +120,8 @@ static HRESULT WINAPI d3d8_swapchain_GetBackBuffer(IDirect3DSwapChain8 *iface, TRACE("iface %p, backbuffer_idx %u, backbuffer_type %#x, backbuffer %p.\n", iface, backbuffer_idx, backbuffer_type, backbuffer); + /* backbuffer_type is ignored by native. */ + if (!backbuffer) { WARN("The output pointer is NULL, returning D3DERR_INVALIDCALL.\n"); @@ -127,8 +129,7 @@ static HRESULT WINAPI d3d8_swapchain_GetBackBuffer(IDirect3DSwapChain8 *iface, } wined3d_mutex_lock(); - if ((wined3d_texture = wined3d_swapchain_get_back_buffer(swapchain->wined3d_swapchain, - backbuffer_idx, (enum wined3d_backbuffer_type)backbuffer_type))) + if ((wined3d_texture = wined3d_swapchain_get_back_buffer(swapchain->wined3d_swapchain, backbuffer_idx))) { wined3d_resource = wined3d_texture_get_sub_resource(wined3d_texture, 0); surface_impl = wined3d_resource_get_parent(wined3d_resource); diff --git a/dlls/d3d9/device.c b/dlls/d3d9/device.c index 01a6d9e2c15..3a0376dac40 100644 --- a/dlls/d3d9/device.c +++ b/dlls/d3d9/device.c @@ -754,6 +754,8 @@ static HRESULT WINAPI d3d9_device_GetBackBuffer(IDirect3DDevice9Ex *iface, UINT TRACE("iface %p, swapchain %u, backbuffer_idx %u, backbuffer_type %#x, backbuffer %p.\n", iface, swapchain, backbuffer_idx, backbuffer_type, backbuffer); + /* backbuffer_type is ignored by native. */ + /* No need to check for backbuffer == NULL, Windows crashes in that case. */ wined3d_mutex_lock(); @@ -764,8 +766,7 @@ static HRESULT WINAPI d3d9_device_GetBackBuffer(IDirect3DDevice9Ex *iface, UINT return D3DERR_INVALIDCALL; } - if (!(wined3d_texture = wined3d_swapchain_get_back_buffer(wined3d_swapchain, - backbuffer_idx, (enum wined3d_backbuffer_type)backbuffer_type))) + if (!(wined3d_texture = wined3d_swapchain_get_back_buffer(wined3d_swapchain, backbuffer_idx))) { wined3d_mutex_unlock(); *backbuffer = NULL; diff --git a/dlls/d3d9/swapchain.c b/dlls/d3d9/swapchain.c index b26a4826ddb..c995afb17d1 100644 --- a/dlls/d3d9/swapchain.c +++ b/dlls/d3d9/swapchain.c @@ -160,6 +160,8 @@ static HRESULT WINAPI d3d9_swapchain_GetBackBuffer(IDirect3DSwapChain9Ex *iface, TRACE("iface %p, backbuffer_idx %u, backbuffer_type %#x, backbuffer %p.\n", iface, backbuffer_idx, backbuffer_type, backbuffer); + /* backbuffer_type is ignored by native. */ + if (!backbuffer) { WARN("The output pointer is NULL, returning D3DERR_INVALIDCALL.\n"); @@ -167,8 +169,7 @@ static HRESULT WINAPI d3d9_swapchain_GetBackBuffer(IDirect3DSwapChain9Ex *iface, } wined3d_mutex_lock(); - if ((wined3d_texture = wined3d_swapchain_get_back_buffer(swapchain->wined3d_swapchain, - backbuffer_idx, (enum wined3d_backbuffer_type)backbuffer_type))) + if ((wined3d_texture = wined3d_swapchain_get_back_buffer(swapchain->wined3d_swapchain, backbuffer_idx))) { wined3d_resource = wined3d_texture_get_sub_resource(wined3d_texture, 0); surface_impl = wined3d_resource_get_parent(wined3d_resource); diff --git a/dlls/dxgi/swapchain.c b/dlls/dxgi/swapchain.c index 10ae26d1f66..366bdb98f1c 100644 --- a/dlls/dxgi/swapchain.c +++ b/dlls/dxgi/swapchain.c @@ -152,8 +152,7 @@ static HRESULT STDMETHODCALLTYPE dxgi_swapchain_GetBuffer(IDXGISwapChain *iface, EnterCriticalSection(&dxgi_cs); - if (!(texture = wined3d_swapchain_get_back_buffer(This->wined3d_swapchain, - buffer_idx, WINED3D_BACKBUFFER_TYPE_MONO))) + if (!(texture = wined3d_swapchain_get_back_buffer(This->wined3d_swapchain, buffer_idx))) { LeaveCriticalSection(&dxgi_cs); return DXGI_ERROR_INVALID_CALL; @@ -235,8 +234,7 @@ static HRESULT STDMETHODCALLTYPE dxgi_swapchain_ResizeBuffers(IDXGISwapChain *if wined3d_swapchain_get_desc(swapchain->wined3d_swapchain, &wined3d_desc); for (i = 0; i < wined3d_desc.backbuffer_count; ++i) { - texture = wined3d_swapchain_get_back_buffer(swapchain->wined3d_swapchain, - i, WINED3D_BACKBUFFER_TYPE_MONO); + texture = wined3d_swapchain_get_back_buffer(swapchain->wined3d_swapchain, i); parent = wined3d_texture_get_parent(texture); IUnknown_AddRef(parent); if (IUnknown_Release(parent)) diff --git a/dlls/wined3d/swapchain.c b/dlls/wined3d/swapchain.c index 8fb9f6aad12..b37bbb9f52d 100644 --- a/dlls/wined3d/swapchain.c +++ b/dlls/wined3d/swapchain.c @@ -178,10 +178,10 @@ HRESULT CDECL wined3d_swapchain_get_front_buffer_data(const struct wined3d_swapc } struct wined3d_texture * CDECL wined3d_swapchain_get_back_buffer(const struct wined3d_swapchain *swapchain, - UINT back_buffer_idx, enum wined3d_backbuffer_type type) + UINT back_buffer_idx) { - TRACE("swapchain %p, back_buffer_idx %u, type %#x.\n", - swapchain, back_buffer_idx, type); + TRACE("swapchain %p, back_buffer_idx %u.\n", + swapchain, back_buffer_idx); /* Return invalid if there is no backbuffer array, otherwise it will * crash when ddraw is used (there swapchain->back_buffers is always diff --git a/include/wine/wined3d.h b/include/wine/wined3d.h index 9c77cfe2f73..7d4e5a0f461 100644 --- a/include/wine/wined3d.h +++ b/include/wine/wined3d.h @@ -503,13 +503,6 @@ enum wined3d_patch_edge_style WINED3D_PATCH_EDGE_CONTINUOUS = 1, }; -enum wined3d_backbuffer_type -{ - WINED3D_BACKBUFFER_TYPE_MONO = 0, - WINED3D_BACKBUFFER_TYPE_LEFT = 1, - WINED3D_BACKBUFFER_TYPE_RIGHT = 2, -}; - enum wined3d_swap_effect { WINED3D_SWAP_EFFECT_DISCARD = 1, @@ -2512,7 +2505,7 @@ HRESULT __cdecl wined3d_swapchain_create(struct wined3d_device *device, struct w void *parent, const struct wined3d_parent_ops *parent_ops, struct wined3d_swapchain **swapchain); ULONG __cdecl wined3d_swapchain_decref(struct wined3d_swapchain *swapchain); struct wined3d_texture * __cdecl wined3d_swapchain_get_back_buffer(const struct wined3d_swapchain *swapchain, - UINT backbuffer_idx, enum wined3d_backbuffer_type backbuffer_type); + UINT backbuffer_idx); struct wined3d_device * __cdecl wined3d_swapchain_get_device(const struct wined3d_swapchain *swapchain); HRESULT __cdecl wined3d_swapchain_get_display_mode(const struct wined3d_swapchain *swapchain, struct wined3d_display_mode *mode, enum wined3d_display_rotation *rotation);