Commit 8ad98cdb authored by Henri Verbeet's avatar Henri Verbeet Committed by Alexandre Julliard

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

parent 9b74ebd7
......@@ -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");
......
......@@ -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);
......
......@@ -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);
......
......@@ -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;
......
......@@ -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;
}
......
......@@ -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;
......
......@@ -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);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment