From 8ad98cdbeec665670170c880e1589002567c3a9b Mon Sep 17 00:00:00 2001 From: Henri Verbeet Date: Mon, 9 Jul 2012 23:16:38 +0200 Subject: [PATCH] wined3d: Get rid of the "discard" parameter to device_parent_create_depth_stencil(). --- dlls/d3d10core/device.c | 6 +++--- dlls/d3d8/device.c | 6 +++--- dlls/d3d9/device.c | 8 ++++---- dlls/ddraw/ddraw.c | 2 +- dlls/wined3d/device.c | 17 ++++++----------- dlls/wined3d/swapchain.c | 6 ++---- include/wine/wined3d.h | 2 +- 7 files changed, 20 insertions(+), 27 deletions(-) diff --git a/dlls/d3d10core/device.c b/dlls/d3d10core/device.c index 60849a36bce..3fd0c490ba4 100644 --- a/dlls/d3d10core/device.c +++ b/dlls/d3d10core/device.c @@ -1444,7 +1444,7 @@ static HRESULT CDECL device_parent_create_rendertarget(struct wined3d_device_par static HRESULT CDECL device_parent_create_depth_stencil(struct wined3d_device_parent *device_parent, UINT width, UINT height, enum wined3d_format_id format, enum wined3d_multisample_type multisample_type, - DWORD multisample_quality, BOOL discard, struct wined3d_surface **surface) + DWORD multisample_quality, struct wined3d_surface **surface) { struct d3d10_device *device = device_from_wined3d_device_parent(device_parent); struct d3d10_texture2d *texture; @@ -1452,8 +1452,8 @@ static HRESULT CDECL device_parent_create_depth_stencil(struct wined3d_device_pa HRESULT hr; FIXME("device_parent %p, width %u, height %u, format %#x, multisample_type %#x,\n" - "\tmultisample_quality %u, discard %u, surface %p partial stub!\n", - device_parent, width, height, format, multisample_type, multisample_quality, discard, surface); + "\tmultisample_quality %u, surface %p partial stub!\n", + device_parent, width, height, format, multisample_type, multisample_quality, surface); FIXME("Implement DXGI<->wined3d usage conversion\n"); diff --git a/dlls/d3d8/device.c b/dlls/d3d8/device.c index 31f0eb25ac1..50a09e959b2 100644 --- a/dlls/d3d8/device.c +++ b/dlls/d3d8/device.c @@ -2888,15 +2888,15 @@ static HRESULT CDECL device_parent_create_rendertarget(struct wined3d_device_par static HRESULT CDECL device_parent_create_depth_stencil(struct wined3d_device_parent *device_parent, UINT width, UINT height, enum wined3d_format_id format, enum wined3d_multisample_type multisample_type, - DWORD multisample_quality, BOOL discard, struct wined3d_surface **surface) + DWORD multisample_quality, struct wined3d_surface **surface) { struct d3d8_device *device = device_from_device_parent(device_parent); struct d3d8_surface *d3d_surface; HRESULT hr; TRACE("device_parent %p, width %u, height %u, format %#x, multisample_type %#x,\n" - "\tmultisample_quality %u, discard %u, surface %p.\n", - device_parent, width, height, format, multisample_type, multisample_quality, discard, surface); + "\tmultisample_quality %u, surface %p.\n", + device_parent, width, height, format, multisample_type, multisample_quality, surface); hr = IDirect3DDevice8_CreateDepthStencilSurface(&device->IDirect3DDevice8_iface, width, height, d3dformat_from_wined3dformat(format), multisample_type, (IDirect3DSurface8 **)&d3d_surface); diff --git a/dlls/d3d9/device.c b/dlls/d3d9/device.c index ef5aa4639b6..1f195d65f5c 100644 --- a/dlls/d3d9/device.c +++ b/dlls/d3d9/device.c @@ -3243,19 +3243,19 @@ static HRESULT CDECL device_parent_create_rendertarget(struct wined3d_device_par static HRESULT CDECL device_parent_create_depth_stencil(struct wined3d_device_parent *device_parent, UINT width, UINT height, enum wined3d_format_id format, enum wined3d_multisample_type multisample_type, - DWORD multisample_quality, BOOL discard, struct wined3d_surface **surface) + DWORD multisample_quality, struct wined3d_surface **surface) { struct d3d9_device *device = device_from_device_parent(device_parent); struct d3d9_surface *d3d_surface; HRESULT hr; TRACE("device_parent %p, width %u, height %u, format %#x, multisample_type %#x,\n" - "\tmultisample_quality %u, discard %u, surface %p.\n", - device_parent, width, height, format, multisample_type, multisample_quality, discard, surface); + "\tmultisample_quality %u, surface %p.\n", + device_parent, width, height, format, multisample_type, multisample_quality, surface); hr = d3d9_device_CreateDepthStencilSurface(&device->IDirect3DDevice9Ex_iface, width, height, d3dformat_from_wined3dformat(format), multisample_type, multisample_quality, - discard, (IDirect3DSurface9 **)&d3d_surface, NULL); + FALSE, (IDirect3DSurface9 **)&d3d_surface, NULL); if (FAILED(hr)) { WARN("Failed to create depth/stencil surface, hr %#x.\n", hr); diff --git a/dlls/ddraw/ddraw.c b/dlls/ddraw/ddraw.c index d613d17271d..4e2be26a899 100644 --- a/dlls/ddraw/ddraw.c +++ b/dlls/ddraw/ddraw.c @@ -5472,7 +5472,7 @@ static HRESULT CDECL device_parent_create_rendertarget(struct wined3d_device_par static HRESULT CDECL device_parent_create_depth_stencil(struct wined3d_device_parent *device_parent, UINT width, UINT height, enum wined3d_format_id format, enum wined3d_multisample_type multisample_type, - DWORD multisample_quality, BOOL discard, struct wined3d_surface **surface) + DWORD multisample_quality, struct wined3d_surface **surface) { ERR("DirectDraw doesn't have and shouldn't try creating implicit depth buffers.\n"); return E_NOTIMPL; diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c index 0acbded2f40..0b7414296d7 100644 --- a/dlls/wined3d/device.c +++ b/dlls/wined3d/device.c @@ -5230,21 +5230,16 @@ HRESULT CDECL wined3d_device_reset(struct wined3d_device *device, if (swapchain_desc->enable_auto_depth_stencil && !device->auto_depth_stencil) { - HRESULT hrc; + HRESULT hr; TRACE("Creating the depth stencil buffer\n"); - hrc = device->device_parent->ops->create_depth_stencil(device->device_parent, - swapchain_desc->backbuffer_width, - swapchain_desc->backbuffer_height, - swapchain_desc->auto_depth_stencil_format, - swapchain_desc->multisample_type, - swapchain_desc->multisample_quality, - FALSE, - &device->auto_depth_stencil); - if (FAILED(hrc)) + if (FAILED(hr = device->device_parent->ops->create_depth_stencil(device->device_parent, + swapchain_desc->backbuffer_width, swapchain_desc->backbuffer_height, + swapchain_desc->auto_depth_stencil_format, swapchain_desc->multisample_type, + swapchain_desc->multisample_quality, &device->auto_depth_stencil))) { - ERR("Failed to create the depth stencil buffer.\n"); + ERR("Failed to create the depth stencil buffer, hr %#x.\n", hr); wined3d_swapchain_decref(swapchain); return WINED3DERR_INVALIDCALL; } diff --git a/dlls/wined3d/swapchain.c b/dlls/wined3d/swapchain.c index 4aeabfbbcfb..a38949768b3 100644 --- a/dlls/wined3d/swapchain.c +++ b/dlls/wined3d/swapchain.c @@ -1070,12 +1070,10 @@ static HRESULT swapchain_init(struct wined3d_swapchain *swapchain, enum wined3d_ TRACE("Creating depth/stencil buffer.\n"); if (!device->auto_depth_stencil) { - hr = device->device_parent->ops->create_depth_stencil(device->device_parent, + if (FAILED(hr = device->device_parent->ops->create_depth_stencil(device->device_parent, swapchain->desc.backbuffer_width, swapchain->desc.backbuffer_height, swapchain->desc.auto_depth_stencil_format, swapchain->desc.multisample_type, - swapchain->desc.multisample_quality, FALSE /* FIXME: Discard */, - &device->auto_depth_stencil); - if (FAILED(hr)) + swapchain->desc.multisample_quality, &device->auto_depth_stencil))) { WARN("Failed to create the auto depth stencil, hr %#x.\n", hr); goto err; diff --git a/include/wine/wined3d.h b/include/wine/wined3d.h index 6709d286245..5049360d936 100644 --- a/include/wine/wined3d.h +++ b/include/wine/wined3d.h @@ -2005,7 +2005,7 @@ struct wined3d_device_parent_ops DWORD multisample_quality, struct wined3d_surface **surface); HRESULT (__cdecl *create_depth_stencil)(struct wined3d_device_parent *device_parent, UINT width, UINT height, enum wined3d_format_id format_id, enum wined3d_multisample_type multisample_type, - DWORD multisample_quality, BOOL discard, struct wined3d_surface **surface); + DWORD multisample_quality, struct wined3d_surface **surface); HRESULT (__cdecl *create_volume)(struct wined3d_device_parent *device_parent, void *container_parent, UINT width, UINT height, UINT depth, enum wined3d_format_id format_id, enum wined3d_pool pool, DWORD usage, struct wined3d_volume **volume); -- 2.11.4.GIT