From: Zebediah Figura zfigura@codeweavers.com
Get rid of the create_swapchain_texture callback. --- dlls/d3d11/device.c | 14 -------------- dlls/d3d8/device.c | 21 --------------------- dlls/d3d9/device.c | 21 --------------------- dlls/ddraw/ddraw.c | 21 --------------------- dlls/wined3d/device.c | 4 ++-- dlls/wined3d/swapchain.c | 12 ++++++------ include/wine/wined3d.h | 2 -- 7 files changed, 8 insertions(+), 87 deletions(-)
diff --git a/dlls/d3d11/device.c b/dlls/d3d11/device.c index 4cf066ef945..ca231af9652 100644 --- a/dlls/d3d11/device.c +++ b/dlls/d3d11/device.c @@ -6893,26 +6893,12 @@ static HRESULT CDECL device_parent_texture_sub_resource_created(struct wined3d_d return S_OK; }
-static HRESULT CDECL device_parent_create_swapchain_texture(struct wined3d_device_parent *device_parent, - void *container_parent, const struct wined3d_resource_desc *wined3d_desc, DWORD texture_flags, - struct wined3d_texture **wined3d_texture) -{ - struct d3d_device *device = device_from_wined3d_device_parent(device_parent); - - TRACE("device_parent %p, container_parent %p, wined3d_desc %p, texture_flags %#lx, wined3d_texture %p.\n", - device_parent, container_parent, wined3d_desc, texture_flags, wined3d_texture); - - return wined3d_texture_create(device->wined3d_device, wined3d_desc, 1, 1, - texture_flags, NULL, NULL, &d3d_null_wined3d_parent_ops, wined3d_texture); -} - static const struct wined3d_device_parent_ops d3d_wined3d_device_parent_ops = { device_parent_wined3d_device_created, device_parent_mode_changed, device_parent_activate, device_parent_texture_sub_resource_created, - device_parent_create_swapchain_texture, };
static int d3d_sampler_state_compare(const void *key, const struct wine_rb_entry *entry) diff --git a/dlls/d3d8/device.c b/dlls/d3d8/device.c index 8ae6b5ce7b9..3727ad3e4eb 100644 --- a/dlls/d3d8/device.c +++ b/dlls/d3d8/device.c @@ -3624,33 +3624,12 @@ static HRESULT CDECL device_parent_texture_sub_resource_created(struct wined3d_d return D3D_OK; }
-static HRESULT CDECL device_parent_create_swapchain_texture(struct wined3d_device_parent *device_parent, - void *container_parent, const struct wined3d_resource_desc *desc, DWORD texture_flags, - struct wined3d_texture **texture) -{ - struct d3d8_device *device = device_from_device_parent(device_parent); - HRESULT hr; - - TRACE("device_parent %p, container_parent %p, desc %p, texture flags %#lx, texture %p.\n", - device_parent, container_parent, desc, texture_flags, texture); - - if (FAILED(hr = wined3d_texture_create(device->wined3d_device, desc, 1, 1, texture_flags, - NULL, NULL, &d3d8_null_wined3d_parent_ops, texture))) - { - WARN("Failed to create texture, hr %#lx.\n", hr); - return hr; - } - - return hr; -} - static const struct wined3d_device_parent_ops d3d8_wined3d_device_parent_ops = { device_parent_wined3d_device_created, device_parent_mode_changed, device_parent_activate, device_parent_texture_sub_resource_created, - device_parent_create_swapchain_texture, };
static void setup_fpu(void) diff --git a/dlls/d3d9/device.c b/dlls/d3d9/device.c index b5a16177e37..35ba241c23a 100644 --- a/dlls/d3d9/device.c +++ b/dlls/d3d9/device.c @@ -4555,33 +4555,12 @@ static HRESULT CDECL device_parent_texture_sub_resource_created(struct wined3d_d return D3D_OK; }
-static HRESULT CDECL device_parent_create_swapchain_texture(struct wined3d_device_parent *device_parent, - void *container_parent, const struct wined3d_resource_desc *desc, DWORD texture_flags, - struct wined3d_texture **texture) -{ - struct d3d9_device *device = device_from_device_parent(device_parent); - HRESULT hr; - - TRACE("device_parent %p, container_parent %p, desc %p, texture flags %#lx, texture %p.\n", - device_parent, container_parent, desc, texture_flags, texture); - - if (FAILED(hr = wined3d_texture_create(device->wined3d_device, desc, 1, 1, - texture_flags, NULL, NULL, &d3d9_null_wined3d_parent_ops, texture))) - { - WARN("Failed to create texture, hr %#lx.\n", hr); - return hr; - } - - return hr; -} - static const struct wined3d_device_parent_ops d3d9_wined3d_device_parent_ops = { device_parent_wined3d_device_created, device_parent_mode_changed, device_parent_activate, device_parent_texture_sub_resource_created, - device_parent_create_swapchain_texture, };
static void setup_fpu(void) diff --git a/dlls/ddraw/ddraw.c b/dlls/ddraw/ddraw.c index c56226fb71d..baa3219ae47 100644 --- a/dlls/ddraw/ddraw.c +++ b/dlls/ddraw/ddraw.c @@ -5042,33 +5042,12 @@ static HRESULT CDECL device_parent_texture_sub_resource_created(struct wined3d_d return DD_OK; }
-static HRESULT CDECL device_parent_create_swapchain_texture(struct wined3d_device_parent *device_parent, - void *container_parent, const struct wined3d_resource_desc *desc, DWORD texture_flags, - struct wined3d_texture **texture) -{ - struct ddraw *ddraw = ddraw_from_device_parent(device_parent); - HRESULT hr; - - TRACE("device_parent %p, container_parent %p, desc %p, texture flags %#lx, texture %p.\n", - device_parent, container_parent, desc, texture_flags, texture); - - if (FAILED(hr = wined3d_texture_create(ddraw->wined3d_device, desc, 1, 1, - texture_flags, NULL, ddraw, &ddraw_null_wined3d_parent_ops, texture))) - { - WARN("Failed to create texture, hr %#lx.\n", hr); - return hr; - } - - return hr; -} - static const struct wined3d_device_parent_ops ddraw_wined3d_device_parent_ops = { device_parent_wined3d_device_created, device_parent_mode_changed, device_parent_activate, device_parent_texture_sub_resource_created, - device_parent_create_swapchain_texture, };
HRESULT ddraw_init(struct ddraw *ddraw, DWORD flags, enum wined3d_device_type device_type) diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c index 1603329a59f..df186d9ffa2 100644 --- a/dlls/wined3d/device.c +++ b/dlls/wined3d/device.c @@ -5993,8 +5993,8 @@ HRESULT CDECL wined3d_device_reset(struct wined3d_device *device, texture_desc.depth = 1; texture_desc.size = 0;
- if (FAILED(hr = device->device_parent->ops->create_swapchain_texture(device->device_parent, - device->device_parent, &texture_desc, 0, &texture))) + if (FAILED(hr = wined3d_texture_create(device, &texture_desc, 1, 1, 0, + NULL, NULL, &wined3d_null_parent_ops, &texture))) { ERR("Failed to create the auto depth/stencil surface, hr %#lx.\n", hr); return WINED3DERR_INVALIDCALL; diff --git a/dlls/wined3d/swapchain.c b/dlls/wined3d/swapchain.c index b31c3393767..e6938ea14dc 100644 --- a/dlls/wined3d/swapchain.c +++ b/dlls/wined3d/swapchain.c @@ -1541,8 +1541,8 @@ static HRESULT wined3d_swapchain_init(struct wined3d_swapchain *swapchain, struc if (swapchain->state.desc.flags & WINED3D_SWAPCHAIN_GDI_COMPATIBLE) texture_flags |= WINED3D_TEXTURE_CREATE_GET_DC;
- if (FAILED(hr = device->device_parent->ops->create_swapchain_texture(device->device_parent, - parent, &texture_desc, texture_flags, &swapchain->front_buffer))) + if (FAILED(hr = wined3d_texture_create(device, &texture_desc, 1, 1, texture_flags, + NULL, NULL, &wined3d_null_parent_ops, &swapchain->front_buffer))) { WARN("Failed to create front buffer, hr %#lx.\n", hr); goto err; @@ -1587,8 +1587,8 @@ static HRESULT wined3d_swapchain_init(struct wined3d_swapchain *swapchain, struc for (i = 0; i < swapchain->state.desc.backbuffer_count; ++i) { TRACE("Creating back buffer %u.\n", i); - if (FAILED(hr = device->device_parent->ops->create_swapchain_texture(device->device_parent, - parent, &texture_desc, texture_flags, &swapchain->back_buffers[i]))) + if (FAILED(hr = wined3d_texture_create(device, &texture_desc, 1, 1, texture_flags, + NULL, NULL, &wined3d_null_parent_ops, &swapchain->back_buffers[i]))) { WARN("Failed to create back buffer %u, hr %#lx.\n", i, hr); swapchain->state.desc.backbuffer_count = i; @@ -1615,8 +1615,8 @@ static HRESULT wined3d_swapchain_init(struct wined3d_swapchain *swapchain, struc else texture_desc.access = WINED3D_RESOURCE_ACCESS_GPU;
- if (FAILED(hr = device->device_parent->ops->create_swapchain_texture(device->device_parent, - device->device_parent, &texture_desc, 0, &ds))) + if (FAILED(hr = wined3d_texture_create(device, &texture_desc, 1, 1, 0, + NULL, NULL, &wined3d_null_parent_ops, &ds))) { WARN("Failed to create the auto depth/stencil surface, hr %#lx.\n", hr); goto err; diff --git a/include/wine/wined3d.h b/include/wine/wined3d.h index 32a1a70b040..71a5d92c301 100644 --- a/include/wine/wined3d.h +++ b/include/wine/wined3d.h @@ -2241,8 +2241,6 @@ struct wined3d_device_parent_ops HRESULT (__cdecl *texture_sub_resource_created)(struct wined3d_device_parent *device_parent, enum wined3d_resource_type type, struct wined3d_texture *texture, unsigned int sub_resource_idx, void **parent, const struct wined3d_parent_ops **parent_ops); - HRESULT (__cdecl *create_swapchain_texture)(struct wined3d_device_parent *device_parent, void *parent, - const struct wined3d_resource_desc *desc, DWORD texture_flags, struct wined3d_texture **texture); };
struct wined3d_swapchain_state_parent