Rebase against 6b2a080372ae49cdde6b7752de5de20142ce2a70.

This commit is contained in:
Sebastian Lackner 2016-02-04 03:01:19 +01:00
parent 21ac67b551
commit dbb0795dd4
5 changed files with 124 additions and 54 deletions

View File

@ -1,17 +1,17 @@
From 43c2d8643d8d7ece5f9e232c068a2b78a982ab8e Mon Sep 17 00:00:00 2001
From aee6d79ac93aecb6eb7927e42736609d0d473c31 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Michael=20M=C3=BCller?= <michael@fds-team.de>
Date: Sat, 30 May 2015 02:55:03 +0200
Subject: ddraw: Allow size and format conversions in IDirect3DTexture2::Load.
---
dlls/ddraw/surface.c | 150 +++++++++++++++++++++++++++------------------------
1 file changed, 80 insertions(+), 70 deletions(-)
dlls/ddraw/surface.c | 151 +++++++++++++++++++++++++++------------------------
1 file changed, 80 insertions(+), 71 deletions(-)
diff --git a/dlls/ddraw/surface.c b/dlls/ddraw/surface.c
index 3e57ad6..c6bde0f 100644
index 6a07cd7..cacf14c 100644
--- a/dlls/ddraw/surface.c
+++ b/dlls/ddraw/surface.c
@@ -5035,6 +5035,46 @@ static struct ddraw_surface *get_sub_mimaplevel(struct ddraw_surface *surface)
@@ -5041,6 +5041,46 @@ static struct ddraw_surface *get_sub_mimaplevel(struct ddraw_surface *surface)
return impl_from_IDirectDrawSurface7(next_level);
}
@ -58,18 +58,22 @@ index 3e57ad6..c6bde0f 100644
/*****************************************************************************
* IDirect3DTexture2::Load
*
@@ -5056,6 +5096,7 @@ static HRESULT WINAPI d3d_texture2_Load(IDirect3DTexture2 *iface, IDirect3DTextu
@@ -5062,7 +5102,7 @@ static HRESULT WINAPI d3d_texture2_Load(IDirect3DTexture2 *iface, IDirect3DTextu
{
struct ddraw_surface *dst_surface = impl_from_IDirect3DTexture2(iface);
struct ddraw_surface *src_surface = unsafe_impl_from_IDirect3DTexture2(src_texture);
- struct wined3d_resource *dst_resource, *src_resource;
+ RECT src_rect, dst_rect;
HRESULT hr;
TRACE("iface %p, src_texture %p.\n", iface, src_texture);
@@ -5068,90 +5109,60 @@ static HRESULT WINAPI d3d_texture2_Load(IDirect3DTexture2 *iface, IDirect3DTextu
@@ -5075,90 +5115,60 @@ static HRESULT WINAPI d3d_texture2_Load(IDirect3DTexture2 *iface, IDirect3DTextu
wined3d_mutex_lock();
- dst_resource = wined3d_texture_get_resource(dst_surface->wined3d_texture);
- src_resource = wined3d_texture_get_resource(src_surface->wined3d_texture);
-
- if (((src_surface->surface_desc.ddsCaps.dwCaps & DDSCAPS_MIPMAP)
- != (dst_surface->surface_desc.ddsCaps.dwCaps & DDSCAPS_MIPMAP))
- || (src_surface->surface_desc.u2.dwMipMapCount != dst_surface->surface_desc.u2.dwMipMapCount))
@ -151,22 +155,19 @@ index 3e57ad6..c6bde0f 100644
+ return E_FAIL;
+ }
- /* Copy the main memory texture into the surface that corresponds
- * to the OpenGL texture object. */
-
- hr = wined3d_surface_map(src_surface->wined3d_surface, &src_map_desc, NULL, 0);
- if (FAILED(hr))
- if (FAILED(hr = wined3d_resource_sub_resource_map(src_resource,
- src_surface->sub_resource_idx, &src_map_desc, NULL, 0)))
- {
- ERR("Failed to lock source surface, hr %#x.\n", hr);
- wined3d_mutex_unlock();
- return D3DERR_TEXTURE_LOAD_FAILED;
- }
-
- hr = wined3d_surface_map(dst_surface->wined3d_surface, &dst_map_desc, NULL, 0);
- if (FAILED(hr))
- if (FAILED(hr = wined3d_resource_sub_resource_map(dst_resource,
- dst_surface->sub_resource_idx, &dst_map_desc, NULL, 0)))
- {
- ERR("Failed to lock destination surface, hr %#x.\n", hr);
- wined3d_surface_unmap(src_surface->wined3d_surface);
- wined3d_resource_sub_resource_unmap(src_resource, src_surface->sub_resource_idx);
- wined3d_mutex_unlock();
- return D3DERR_TEXTURE_LOAD_FAILED;
- }
@ -180,8 +181,8 @@ index 3e57ad6..c6bde0f 100644
+ SetRect(&src_rect, 0, 0, src_surface->surface_desc.dwWidth, src_surface->surface_desc.dwHeight);
+ SetRect(&dst_rect, 0, 0, dst_surface->surface_desc.dwWidth, dst_surface->surface_desc.dwHeight);
- wined3d_surface_unmap(src_surface->wined3d_surface);
- wined3d_surface_unmap(dst_surface->wined3d_surface);
- wined3d_resource_sub_resource_unmap(dst_resource, dst_surface->sub_resource_idx);
- wined3d_resource_sub_resource_unmap(src_resource, src_surface->sub_resource_idx);
+ hr = wined3d_texture_blt(dst_surface->wined3d_texture, dst_surface->sub_resource_idx, &dst_rect,
+ src_surface->wined3d_texture, src_surface->sub_resource_idx, &src_rect,
+ 0, NULL, WINED3D_TEXF_LINEAR);
@ -193,7 +194,7 @@ index 3e57ad6..c6bde0f 100644
}
if (src_surface->surface_desc.ddsCaps.dwCaps & DDSCAPS_MIPMAP)
@@ -5164,12 +5175,11 @@ static HRESULT WINAPI d3d_texture2_Load(IDirect3DTexture2 *iface, IDirect3DTextu
@@ -5171,12 +5181,11 @@ static HRESULT WINAPI d3d_texture2_Load(IDirect3DTexture2 *iface, IDirect3DTextu
else
dst_surface = NULL;

View File

@ -1 +1,2 @@
Fixes: Fix scaling behaviour of images and mipmap levels in IDirect3DTexture2_Load (needed for example by Prezzie Hunt)
Depends: wined3d-resource_map

View File

@ -51,7 +51,7 @@ usage()
# Get the upstream commit sha
upstream_commit()
{
echo "9bdab23bf7a57e92656782907ae2ac67ed292f0b"
echo "6b2a080372ae49cdde6b7752de5de20142ce2a70"
}
# Show version information
@ -336,6 +336,7 @@ patch_enable_all ()
enable_wined3d_Revert_PixelFormat="$1"
enable_wined3d_UnhandledBlendFactor="$1"
enable_wined3d_resource_check_usage="$1"
enable_wined3d_resource_map="$1"
enable_wined3d_surface_cpu_blt="$1"
enable_wined3d_wined3d_swapchain_present="$1"
enable_winedevice_Fix_Relocation="$1"
@ -1147,6 +1148,9 @@ patch_enable ()
wined3d-resource_check_usage)
enable_wined3d_resource_check_usage="$2"
;;
wined3d-resource_map)
enable_wined3d_resource_map="$2"
;;
wined3d-surface_cpu_blt)
enable_wined3d_surface_cpu_blt="$2"
;;
@ -1891,9 +1895,13 @@ if test "$enable_wined3d_CSMT_Helper" -eq 1; then
if test "$enable_wined3d_DXTn" -gt 1; then
abort "Patchset wined3d-DXTn disabled, but wined3d-CSMT_Helper depends on that."
fi
if test "$enable_wined3d_resource_map" -gt 1; then
abort "Patchset wined3d-resource_map disabled, but wined3d-CSMT_Helper depends on that."
fi
enable_makedep_PARENTSPEC=1
enable_ntdll_DllRedirects=1
enable_wined3d_DXTn=1
enable_wined3d_resource_map=1
fi
if test "$enable_uxtheme_GTK_Theming" -eq 1; then
@ -2151,6 +2159,13 @@ if test "$enable_dsound_EAX" -eq 1; then
enable_dsound_Revert_Cleanup=1
fi
if test "$enable_ddraw_IDirect3DTexture2_Load" -eq 1; then
if test "$enable_wined3d_resource_map" -gt 1; then
abort "Patchset wined3d-resource_map disabled, but ddraw-IDirect3DTexture2_Load depends on that."
fi
enable_wined3d_resource_map=1
fi
if test "$enable_d3dx9_33_Share_Source" -eq 1; then
if test "$enable_d3dx9_36_D3DXStubs" -gt 1; then
abort "Patchset d3dx9_36-D3DXStubs disabled, but d3dx9_33-Share_Source depends on that."
@ -3184,8 +3199,24 @@ if test "$enable_ddraw_EnumSurfaces" -eq 1; then
) >> "$patchlist"
fi
# Patchset wined3d-resource_map
# |
# | Modified files:
# | * dlls/d3d11/device.c, dlls/d3d11/texture.c, dlls/d3d8/surface.c, dlls/d3d8/volume.c, dlls/d3d9/surface.c,
# | dlls/d3d9/volume.c, dlls/ddraw/surface.c, dlls/wined3d/resource.c, dlls/wined3d/wined3d.spec, include/wine/wined3d.h
# |
if test "$enable_wined3d_resource_map" -eq 1; then
patch_apply wined3d-resource_map/0001-wined3d-Rename-wined3d_resource_-un-map-to-wined3d_r.patch
(
echo '+ { "Sebastian Lackner", "wined3d: Rename wined3d_resource_(un)map to wined3d_resource_sub_resource_(un)map.", 1 },';
) >> "$patchlist"
fi
# Patchset ddraw-IDirect3DTexture2_Load
# |
# | This patchset has the following (direct or indirect) dependencies:
# | * wined3d-resource_map
# |
# | Modified files:
# | * dlls/ddraw/surface.c, dlls/ddraw/tests/d3d.c, dlls/ddraw/tests/ddraw2.c
# |
@ -6531,18 +6562,15 @@ fi
# Patchset wined3d-CSMT_Helper
# |
# | This patchset has the following (direct or indirect) dependencies:
# | * makedep-PARENTSPEC, ntdll-DllOverrides_WOW64, ntdll-Loader_Machine_Type, ntdll-DllRedirects, wined3d-DXTn
# | * makedep-PARENTSPEC, ntdll-DllOverrides_WOW64, ntdll-Loader_Machine_Type, ntdll-DllRedirects, wined3d-DXTn, wined3d-
# | resource_map
# |
# | Modified files:
# | * configure.ac, dlls/d3d11/device.c, dlls/d3d11/texture.c, dlls/d3d8/surface.c, dlls/d3d8/volume.c, dlls/d3d9/surface.c,
# | dlls/d3d9/volume.c, dlls/wined3d-csmt/Makefile.in, dlls/wined3d-csmt/version.rc, dlls/wined3d/resource.c,
# | dlls/wined3d/wined3d.spec, include/wine/wined3d.h
# | * configure.ac, dlls/wined3d-csmt/Makefile.in, dlls/wined3d-csmt/version.rc
# |
if test "$enable_wined3d_CSMT_Helper" -eq 1; then
patch_apply wined3d-CSMT_Helper/0001-wined3d-Rename-wined3d_resource_-un-map-to-wined3d_r.patch
patch_apply wined3d-CSMT_Helper/0002-wined3d-Add-second-dll-with-STAGING_CSMT-definition-.patch
(
echo '+ { "Sebastian Lackner", "wined3d: Rename wined3d_resource_(un)map to wined3d_resource_sub_resource_(un)map.", 1 },';
echo '+ { "Sebastian Lackner", "wined3d: Add second dll with STAGING_CSMT definition set.", 1 },';
) >> "$patchlist"
fi
@ -6658,7 +6686,7 @@ fi
# |
# | This patchset has the following (direct or indirect) dependencies:
# | * makedep-PARENTSPEC, ntdll-DllOverrides_WOW64, ntdll-Loader_Machine_Type, ntdll-DllRedirects, wined3d-DXTn, wined3d-
# | CSMT_Helper
# | resource_map, wined3d-CSMT_Helper
# |
# | This patchset fixes the following Wine bugs:
# | * [#11674] Support for CSMT (command stream) to increase graphic performance

View File

@ -1,3 +1,4 @@
Depends: wined3d-DXTn
Depends: wined3d-resource_map
Depends: makedep-PARENTSPEC
Depends: ntdll-DllRedirects

View File

@ -1,4 +1,4 @@
From 8eaad5ab61fe01c56e9d2622b11fd9f1e058273e Mon Sep 17 00:00:00 2001
From 662d52d4bea06aafcd85678159e44d8c50d520d7 Mon Sep 17 00:00:00 2001
From: Sebastian Lackner <sebastian@fds-team.de>
Date: Wed, 4 Nov 2015 19:31:30 +0100
Subject: wined3d: Rename wined3d_resource_(un)map to
@ -6,22 +6,23 @@ Subject: wined3d: Rename wined3d_resource_(un)map to
To avoid name conflicts in the CSMT patchset.
---
dlls/d3d11/device.c | 4 ++--
dlls/d3d11/texture.c | 8 ++++----
dlls/d3d8/surface.c | 4 ++--
dlls/d3d8/volume.c | 4 ++--
dlls/d3d9/surface.c | 4 ++--
dlls/d3d9/volume.c | 4 ++--
dlls/wined3d/resource.c | 4 ++--
dlls/wined3d/wined3d.spec | 4 ++--
include/wine/wined3d.h | 6 +++---
9 files changed, 21 insertions(+), 21 deletions(-)
dlls/d3d11/device.c | 4 ++--
dlls/d3d11/texture.c | 8 ++++----
dlls/d3d8/surface.c | 4 ++--
dlls/d3d8/volume.c | 4 ++--
dlls/d3d9/surface.c | 4 ++--
dlls/d3d9/volume.c | 4 ++--
dlls/ddraw/surface.c | 10 +++++-----
dlls/wined3d/resource.c | 4 ++--
dlls/wined3d/wined3d.spec | 4 ++--
include/wine/wined3d.h | 6 +++---
10 files changed, 26 insertions(+), 26 deletions(-)
diff --git a/dlls/d3d11/device.c b/dlls/d3d11/device.c
index 4560f52..b5cb5ed 100644
index fb308d0..9658c21 100644
--- a/dlls/d3d11/device.c
+++ b/dlls/d3d11/device.c
@@ -215,7 +215,7 @@ static HRESULT STDMETHODCALLTYPE d3d11_immediate_context_Map(ID3D11DeviceContext
@@ -267,7 +267,7 @@ static HRESULT STDMETHODCALLTYPE d3d11_immediate_context_Map(ID3D11DeviceContext
wined3d_resource = wined3d_resource_from_d3d11_resource(resource);
wined3d_mutex_lock();
@ -30,7 +31,7 @@ index 4560f52..b5cb5ed 100644
&map_desc, NULL, wined3d_map_flags_from_d3d11_map_type(map_type));
wined3d_mutex_unlock();
@@ -236,7 +236,7 @@ static void STDMETHODCALLTYPE d3d11_immediate_context_Unmap(ID3D11DeviceContext
@@ -288,7 +288,7 @@ static void STDMETHODCALLTYPE d3d11_immediate_context_Unmap(ID3D11DeviceContext
wined3d_resource = wined3d_resource_from_d3d11_resource(resource);
wined3d_mutex_lock();
@ -40,7 +41,7 @@ index 4560f52..b5cb5ed 100644
}
diff --git a/dlls/d3d11/texture.c b/dlls/d3d11/texture.c
index 011a5f7..99e531a 100644
index 11bda45..e24f945 100644
--- a/dlls/d3d11/texture.c
+++ b/dlls/d3d11/texture.c
@@ -366,7 +366,7 @@ static HRESULT STDMETHODCALLTYPE d3d10_texture2d_Map(ID3D10Texture2D *iface, UIN
@ -61,7 +62,7 @@ index 011a5f7..99e531a 100644
wined3d_mutex_unlock();
}
@@ -823,7 +823,7 @@ static HRESULT STDMETHODCALLTYPE d3d10_texture3d_Map(ID3D10Texture3D *iface, UIN
@@ -825,7 +825,7 @@ static HRESULT STDMETHODCALLTYPE d3d10_texture3d_Map(ID3D10Texture3D *iface, UIN
FIXME("Ignoring map_flags %#x.\n", map_flags);
wined3d_mutex_lock();
@ -70,7 +71,7 @@ index 011a5f7..99e531a 100644
&wined3d_map_desc, NULL, wined3d_map_flags_from_d3d11_map_type(map_type))))
{
mapped_texture->pData = wined3d_map_desc.data;
@@ -842,7 +842,7 @@ static void STDMETHODCALLTYPE d3d10_texture3d_Unmap(ID3D10Texture3D *iface, UINT
@@ -844,7 +844,7 @@ static void STDMETHODCALLTYPE d3d10_texture3d_Unmap(ID3D10Texture3D *iface, UINT
TRACE("iface %p, sub_resource_idx %u.\n", iface, sub_resource_idx);
wined3d_mutex_lock();
@ -80,10 +81,10 @@ index 011a5f7..99e531a 100644
}
diff --git a/dlls/d3d8/surface.c b/dlls/d3d8/surface.c
index 679f094..21f1438 100644
index ec263b1..5100101 100644
--- a/dlls/d3d8/surface.c
+++ b/dlls/d3d8/surface.c
@@ -234,7 +234,7 @@ static HRESULT WINAPI d3d8_surface_LockRect(IDirect3DSurface8 *iface,
@@ -244,7 +244,7 @@ static HRESULT WINAPI d3d8_surface_LockRect(IDirect3DSurface8 *iface,
box.back = 1;
}
@ -92,7 +93,7 @@ index 679f094..21f1438 100644
&map_desc, rect ? &box : NULL, flags);
wined3d_mutex_unlock();
@@ -260,7 +260,7 @@ static HRESULT WINAPI d3d8_surface_UnlockRect(IDirect3DSurface8 *iface)
@@ -270,7 +270,7 @@ static HRESULT WINAPI d3d8_surface_UnlockRect(IDirect3DSurface8 *iface)
TRACE("iface %p.\n", iface);
wined3d_mutex_lock();
@ -124,7 +125,7 @@ index f26e424..d1ee0b5 100644
return hr;
diff --git a/dlls/d3d9/surface.c b/dlls/d3d9/surface.c
index 833c1f4..54baf83 100644
index c3032dc..120f5c9 100644
--- a/dlls/d3d9/surface.c
+++ b/dlls/d3d9/surface.c
@@ -251,7 +251,7 @@ static HRESULT WINAPI d3d9_surface_LockRect(IDirect3DSurface9 *iface,
@ -167,11 +168,49 @@ index 52502bf..a81b6c7 100644
wined3d_mutex_unlock();
return hr;
diff --git a/dlls/ddraw/surface.c b/dlls/ddraw/surface.c
index 6a07cd7..c95d9a2 100644
--- a/dlls/ddraw/surface.c
+++ b/dlls/ddraw/surface.c
@@ -5135,7 +5135,7 @@ static HRESULT WINAPI d3d_texture2_Load(IDirect3DTexture2 *iface, IDirect3DTextu
DDCKEY_SRCBLT, &src_desc->ddckCKSrcBlt);
}
- if (FAILED(hr = wined3d_resource_map(src_resource,
+ if (FAILED(hr = wined3d_resource_sub_resource_map(src_resource,
src_surface->sub_resource_idx, &src_map_desc, NULL, 0)))
{
ERR("Failed to lock source surface, hr %#x.\n", hr);
@@ -5143,11 +5143,11 @@ static HRESULT WINAPI d3d_texture2_Load(IDirect3DTexture2 *iface, IDirect3DTextu
return D3DERR_TEXTURE_LOAD_FAILED;
}
- if (FAILED(hr = wined3d_resource_map(dst_resource,
+ if (FAILED(hr = wined3d_resource_sub_resource_map(dst_resource,
dst_surface->sub_resource_idx, &dst_map_desc, NULL, 0)))
{
ERR("Failed to lock destination surface, hr %#x.\n", hr);
- wined3d_resource_unmap(src_resource, src_surface->sub_resource_idx);
+ wined3d_resource_sub_resource_unmap(src_resource, src_surface->sub_resource_idx);
wined3d_mutex_unlock();
return D3DERR_TEXTURE_LOAD_FAILED;
}
@@ -5157,8 +5157,8 @@ static HRESULT WINAPI d3d_texture2_Load(IDirect3DTexture2 *iface, IDirect3DTextu
else
memcpy(dst_map_desc.data, src_map_desc.data, src_map_desc.row_pitch * src_desc->dwHeight);
- wined3d_resource_unmap(dst_resource, dst_surface->sub_resource_idx);
- wined3d_resource_unmap(src_resource, src_surface->sub_resource_idx);
+ wined3d_resource_sub_resource_unmap(dst_resource, dst_surface->sub_resource_idx);
+ wined3d_resource_sub_resource_unmap(src_resource, src_surface->sub_resource_idx);
}
if (src_surface->surface_desc.ddsCaps.dwCaps & DDSCAPS_MIPMAP)
diff --git a/dlls/wined3d/resource.c b/dlls/wined3d/resource.c
index d466764..74be48d 100644
index 73250ec..c1079ba 100644
--- a/dlls/wined3d/resource.c
+++ b/dlls/wined3d/resource.c
@@ -295,7 +295,7 @@ void CDECL wined3d_resource_get_desc(const struct wined3d_resource *resource, st
@@ -305,7 +305,7 @@ void CDECL wined3d_resource_get_desc(const struct wined3d_resource *resource, st
desc->size = resource->size;
}
@ -180,7 +219,7 @@ index d466764..74be48d 100644
struct wined3d_map_desc *map_desc, const struct wined3d_box *box, DWORD flags)
{
TRACE("resource %p, sub_resource_idx %u, map_desc %p, box %p, flags %#x.\n",
@@ -304,7 +304,7 @@ HRESULT CDECL wined3d_resource_map(struct wined3d_resource *resource, unsigned i
@@ -314,7 +314,7 @@ HRESULT CDECL wined3d_resource_map(struct wined3d_resource *resource, unsigned i
return resource->resource_ops->resource_sub_resource_map(resource, sub_resource_idx, map_desc, box, flags);
}
@ -190,7 +229,7 @@ index d466764..74be48d 100644
TRACE("resource %p, sub_resource_idx %u.\n", resource, sub_resource_idx);
diff --git a/dlls/wined3d/wined3d.spec b/dlls/wined3d/wined3d.spec
index a7e625d..b6be230 100644
index 2698d17..70a0734 100644
--- a/dlls/wined3d/wined3d.spec
+++ b/dlls/wined3d/wined3d.spec
@@ -182,10 +182,10 @@
@ -207,10 +246,10 @@ index a7e625d..b6be230 100644
@ cdecl wined3d_rendertarget_view_create(ptr ptr ptr ptr ptr)
@ cdecl wined3d_rendertarget_view_create_from_surface(ptr ptr ptr ptr)
diff --git a/include/wine/wined3d.h b/include/wine/wined3d.h
index 2deb450..e25aa69 100644
index 0b134cd..68e3cdf 100644
--- a/include/wine/wined3d.h
+++ b/include/wine/wined3d.h
@@ -2422,11 +2422,11 @@ void __cdecl wined3d_resource_get_desc(const struct wined3d_resource *resource,
@@ -2418,11 +2418,11 @@ void __cdecl wined3d_resource_get_desc(const struct wined3d_resource *resource,
struct wined3d_resource_desc *desc);
void * __cdecl wined3d_resource_get_parent(const struct wined3d_resource *resource);
DWORD __cdecl wined3d_resource_get_priority(const struct wined3d_resource *resource);
@ -226,5 +265,5 @@ index 2deb450..e25aa69 100644
HRESULT __cdecl wined3d_rendertarget_view_create(const struct wined3d_rendertarget_view_desc *desc,
struct wined3d_resource *resource, void *parent, const struct wined3d_parent_ops *parent_ops,
--
2.6.2
2.7.0