Henri Verbeet : wined3d: Get rid of the "discard" parameter to device_parent_create_depth_stencil().

Alexandre Julliard julliard at winehq.org
Tue Jul 10 19:01:42 CDT 2012


Module: wine
Branch: master
Commit: 8ad98cdbeec665670170c880e1589002567c3a9b
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=8ad98cdbeec665670170c880e1589002567c3a9b

Author: Henri Verbeet <hverbeet at codeweavers.com>
Date:   Mon Jul  9 23:16:38 2012 +0200

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 60849a3..3fd0c49 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 31f0eb2..50a09e9 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 ef5aa46..1f195d6 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 d613d17..4e2be26 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 0acbded..0b74142 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 4aeabfb..a389497 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 6709d28..5049360 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);




More information about the wine-cvs mailing list