From 72edf5c454187452f27e1499572418ea1a314b39 Mon Sep 17 00:00:00 2001 From: Sebastian Lackner Date: Fri, 12 Feb 2016 05:21:53 +0100 Subject: [PATCH] ddraw-Revert_Surface_Init: Remove patchset (fixed upstream). --- ...-wined3d_texture_get_sub_resource-in.patch | 90 ------------------- ...e-the-mip-level-dimensions-fix-up-fr.patch | 64 ------------- patches/ddraw-Revert_Surface_Init/definition | 2 - 3 files changed, 156 deletions(-) delete mode 100644 patches/ddraw-Revert_Surface_Init/0001-Revert-ddraw-Use-wined3d_texture_get_sub_resource-in.patch delete mode 100644 patches/ddraw-Revert_Surface_Init/0002-Revert-ddraw-Move-the-mip-level-dimensions-fix-up-fr.patch delete mode 100644 patches/ddraw-Revert_Surface_Init/definition diff --git a/patches/ddraw-Revert_Surface_Init/0001-Revert-ddraw-Use-wined3d_texture_get_sub_resource-in.patch b/patches/ddraw-Revert_Surface_Init/0001-Revert-ddraw-Use-wined3d_texture_get_sub_resource-in.patch deleted file mode 100644 index 06c48274..00000000 --- a/patches/ddraw-Revert_Surface_Init/0001-Revert-ddraw-Use-wined3d_texture_get_sub_resource-in.patch +++ /dev/null @@ -1,90 +0,0 @@ -From b3537f3ed8a0d03005241cacc0470adb4337bd30 Mon Sep 17 00:00:00 2001 -From: Sebastian Lackner -Date: Sun, 7 Feb 2016 18:52:16 +0100 -Subject: Revert "ddraw: Use wined3d_texture_get_sub_resource() in - ddraw_surface7_Flip()." - -This reverts commit b1709522307a160a7c151f5293095a3c26ab998f. ---- - dlls/ddraw/surface.c | 6 +++--- - dlls/wined3d/surface.c | 7 +++++++ - dlls/wined3d/wined3d.spec | 1 + - include/wine/wined3d.h | 1 + - 4 files changed, 12 insertions(+), 3 deletions(-) - -diff --git a/dlls/ddraw/surface.c b/dlls/ddraw/surface.c -index 9b7d76e..acb3667 100644 ---- a/dlls/ddraw/surface.c -+++ b/dlls/ddraw/surface.c -@@ -1268,7 +1268,7 @@ static HRESULT WINAPI DECLSPEC_HOTPATCH ddraw_surface7_Flip(IDirectDrawSurface7 - wined3d_device_set_rendertarget_view(dst_impl->ddraw->wined3d_device, 0, src_rtv, FALSE); - wined3d_rendertarget_view_set_parent(src_rtv, dst_impl); - dst_impl->wined3d_rtv = src_rtv; -- wined3d_resource_set_parent(wined3d_texture_get_sub_resource(src_impl->wined3d_texture, 0), dst_impl); -+ wined3d_resource_set_parent(wined3d_surface_get_resource(src_impl->wined3d_surface), dst_impl); - dst_impl->wined3d_surface = src_impl->wined3d_surface; - prev_ddraw_texture = wined3d_texture_get_parent(src_impl->wined3d_texture); - wined3d_resource_set_parent(wined3d_texture_get_resource(src_impl->wined3d_texture), ddraw_texture); -@@ -1300,7 +1300,7 @@ static HRESULT WINAPI DECLSPEC_HOTPATCH ddraw_surface7_Flip(IDirectDrawSurface7 - wined3d_device_set_rendertarget_view(dst_impl->ddraw->wined3d_device, 0, src_rtv, FALSE); - wined3d_rendertarget_view_set_parent(src_rtv, dst_impl); - dst_impl->wined3d_rtv = src_rtv; -- wined3d_resource_set_parent(wined3d_texture_get_sub_resource(src_impl->wined3d_texture, 0), dst_impl); -+ wined3d_resource_set_parent(wined3d_surface_get_resource(src_impl->wined3d_surface), dst_impl); - dst_impl->wined3d_surface = src_impl->wined3d_surface; - prev_ddraw_texture = wined3d_texture_get_parent(src_impl->wined3d_texture); - wined3d_resource_set_parent(wined3d_texture_get_resource(src_impl->wined3d_texture), ddraw_texture); -@@ -1318,7 +1318,7 @@ static HRESULT WINAPI DECLSPEC_HOTPATCH ddraw_surface7_Flip(IDirectDrawSurface7 - wined3d_device_set_rendertarget_view(dst_impl->ddraw->wined3d_device, 0, tmp_rtv, FALSE); - wined3d_rendertarget_view_set_parent(tmp_rtv, src_impl); - src_impl->wined3d_rtv = tmp_rtv; -- wined3d_resource_set_parent(wined3d_texture_get_sub_resource(texture, 0), src_impl); -+ wined3d_resource_set_parent(wined3d_surface_get_resource(tmp), src_impl); - src_impl->wined3d_surface = tmp; - wined3d_resource_set_parent(wined3d_texture_get_resource(texture), ddraw_texture); - src_impl->wined3d_texture = texture; -diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c -index 53f4d09..b9d5144 100644 ---- a/dlls/wined3d/surface.c -+++ b/dlls/wined3d/surface.c -@@ -1890,6 +1890,13 @@ void * CDECL wined3d_surface_get_parent(const struct wined3d_surface *surface) - return surface->resource.parent; - } - -+struct wined3d_resource * CDECL wined3d_surface_get_resource(struct wined3d_surface *surface) -+{ -+ TRACE("surface %p.\n", surface); -+ -+ return &surface->resource; -+} -+ - DWORD CDECL wined3d_surface_get_pitch(const struct wined3d_surface *surface) - { - unsigned int alignment; -diff --git a/dlls/wined3d/wined3d.spec b/dlls/wined3d/wined3d.spec -index 53eb97a..ab45b94 100644 ---- a/dlls/wined3d/wined3d.spec -+++ b/dlls/wined3d/wined3d.spec -@@ -224,6 +224,7 @@ - - @ cdecl wined3d_surface_get_parent(ptr) - @ cdecl wined3d_surface_get_pitch(ptr) -+@ cdecl wined3d_surface_get_resource(ptr) - @ cdecl wined3d_surface_update_overlay_z_order(ptr long ptr) - - @ cdecl wined3d_swapchain_create(ptr ptr ptr ptr ptr) -diff --git a/include/wine/wined3d.h b/include/wine/wined3d.h -index 40f3d49..f8edfcf 100644 ---- a/include/wine/wined3d.h -+++ b/include/wine/wined3d.h -@@ -2477,6 +2477,7 @@ ULONG __cdecl wined3d_stateblock_incref(struct wined3d_stateblock *stateblock); - - void * __cdecl wined3d_surface_get_parent(const struct wined3d_surface *surface); - DWORD __cdecl wined3d_surface_get_pitch(const struct wined3d_surface *surface); -+struct wined3d_resource * __cdecl wined3d_surface_get_resource(struct wined3d_surface *surface); - HRESULT __cdecl wined3d_surface_update_overlay_z_order(struct wined3d_surface *surface, - DWORD flags, struct wined3d_surface *ref); - --- -2.7.0 - diff --git a/patches/ddraw-Revert_Surface_Init/0002-Revert-ddraw-Move-the-mip-level-dimensions-fix-up-fr.patch b/patches/ddraw-Revert_Surface_Init/0002-Revert-ddraw-Move-the-mip-level-dimensions-fix-up-fr.patch deleted file mode 100644 index e310ab5a..00000000 --- a/patches/ddraw-Revert_Surface_Init/0002-Revert-ddraw-Move-the-mip-level-dimensions-fix-up-fr.patch +++ /dev/null @@ -1,64 +0,0 @@ -From e70e6047539d266d0b7101e92ba789eed5cf9928 Mon Sep 17 00:00:00 2001 -From: Sebastian Lackner -Date: Sun, 7 Feb 2016 18:52:49 +0100 -Subject: Revert "ddraw: Move the mip-level dimensions fix-up from - ddraw_surface_init() to ddraw_surface_create()." - -This reverts commit 7d45318aeac41e2efabb9ddfbf95ecbea103e67d. ---- - dlls/ddraw/surface.c | 14 +++++--------- - 1 file changed, 5 insertions(+), 9 deletions(-) - -diff --git a/dlls/ddraw/surface.c b/dlls/ddraw/surface.c -index a6fbceb..923a935 100644 ---- a/dlls/ddraw/surface.c -+++ b/dlls/ddraw/surface.c -@@ -5643,8 +5643,8 @@ static HRESULT CDECL ddraw_reset_enum_callback(struct wined3d_resource *resource - HRESULT ddraw_surface_create(struct ddraw *ddraw, const DDSURFACEDESC2 *surface_desc, - struct ddraw_surface **surface, IUnknown *outer_unknown, unsigned int version) - { -- struct wined3d_resource_desc wined3d_desc, wined3d_mip_desc; - struct ddraw_surface *root, *mip, **attach; -+ struct wined3d_resource_desc wined3d_desc; - struct wined3d_texture *wined3d_texture; - struct wined3d_resource *resource; - struct wined3d_display_mode mode; -@@ -6103,17 +6103,9 @@ HRESULT ddraw_surface_create(struct ddraw *ddraw, const DDSURFACEDESC2 *surface_ - mip_desc = &mip->surface_desc; - - if (j) -- { -- wined3d_resource_get_desc(resource, &wined3d_mip_desc); -- mip_desc->dwWidth = wined3d_mip_desc.width; -- mip_desc->dwHeight = wined3d_mip_desc.height; -- - mip_desc->ddsCaps.dwCaps2 |= DDSCAPS2_MIPMAPSUBLEVEL; -- } - else -- { - mip_desc->ddsCaps.dwCaps2 &= ~DDSCAPS2_MIPMAPSUBLEVEL; -- } - - if (mip_desc->ddsCaps.dwCaps2 & DDSCAPS2_CUBEMAP) - { -@@ -6241,6 +6233,7 @@ void ddraw_surface_init(struct ddraw_surface *surface, struct ddraw *ddraw, - { - struct ddraw_texture *texture = wined3d_texture_get_parent(wined3d_texture); - DDSURFACEDESC2 *desc = &surface->surface_desc; -+ struct wined3d_resource_desc wined3d_desc; - unsigned int version = texture->version; - - surface->IDirectDrawSurface7_iface.lpVtbl = &ddraw_surface7_vtbl; -@@ -6272,6 +6265,9 @@ void ddraw_surface_init(struct ddraw_surface *surface, struct ddraw *ddraw, - } - - *desc = texture->surface_desc; -+ wined3d_resource_get_desc(wined3d_surface_get_resource(wined3d_surface), &wined3d_desc); -+ desc->dwWidth = wined3d_desc.width; -+ desc->dwHeight = wined3d_desc.height; - surface->first_attached = surface; - - if (format_is_compressed(&desc->u4.ddpfPixelFormat)) --- -2.7.0 - diff --git a/patches/ddraw-Revert_Surface_Init/definition b/patches/ddraw-Revert_Surface_Init/definition deleted file mode 100644 index eead59b8..00000000 --- a/patches/ddraw-Revert_Surface_Init/definition +++ /dev/null @@ -1,2 +0,0 @@ -Fixes: [40094] Revert patches to move mip-level dimensions fixup (causes regressions in multiple games) -Disabled: true