Added patch to fix check for texture levels in wined3d_device_update_texture.

This commit is contained in:
Sebastian Lackner 2015-04-27 02:13:12 +02:00
parent 58cc16c463
commit 157d49eb57
8 changed files with 83 additions and 22 deletions

View File

@ -39,8 +39,9 @@ Wine. All those differences are also documented on the
Included bug fixes and improvements
-----------------------------------
**Bug fixes and features included in the next upcoming release [2]:**
**Bug fixes and features included in the next upcoming release [3]:**
* Fix check for texture levels in wined3d_device_update_texture ([Wine Bug #38048](https://bugs.winehq.org/show_bug.cgi?id=38048))
* Fix regression caused by blacklisting supported OpenGL extensions ([Wine Bug #38480](https://bugs.winehq.org/show_bug.cgi?id=38480))
* Support for FileFsFullSizeInformation information class

1
debian/changelog vendored
View File

@ -1,6 +1,7 @@
wine-staging (1.7.42) UNRELEASED; urgency=low
* Added patch to implement FileFsFullSizeInformation information class.
* Added patch to update timezone information in wine.inf.
* Added patch to fix check for texture levels in wined3d_device_update_texture.
* Removed patch to avoid crash when trying to bind mshtml event scripts to window (fixed upstream).
* Removed patch for stub of ntdll.WinSqmIsOptedIn (fixed upstream).
* Removed patch to fix issues with invalid console handles for new processes (accepted upstream).

View File

@ -229,6 +229,7 @@ patch_enable_all ()
enable_wined3d_CSMT_Helper="$1"
enable_wined3d_CSMT_Main="$1"
enable_wined3d_DXTn="$1"
enable_wined3d_Level_Count="$1"
enable_wined3d_Multisampling="$1"
enable_wined3d_Revert_PixelFormat="$1"
enable_wined3d_UnhandledBlendFactor="$1"
@ -761,6 +762,9 @@ patch_enable ()
wined3d-DXTn)
enable_wined3d_DXTn="$2"
;;
wined3d-Level_Count)
enable_wined3d_Level_Count="$2"
;;
wined3d-Multisampling)
enable_wined3d_Multisampling="$2"
;;
@ -1235,9 +1239,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_Level_Count" -gt 1; then
abort "Patchset wined3d-Level_Count disabled, but wined3d-CSMT_Helper depends on that."
fi
enable_makedep_PARENTSPEC=1
enable_ntdll_DllRedirects=1
enable_wined3d_DXTn=1
enable_wined3d_Level_Count=1
fi
if test "$enable_dsound_EAX" -eq 1; then
@ -1964,6 +1972,21 @@ if test "$enable_dxgi_GetDesc" -eq 1; then
) >> "$patchlist"
fi
# Patchset wined3d-Level_Count
# |
# | This patchset fixes the following Wine bugs:
# | * [#38048] Fix check for texture levels in wined3d_device_update_texture
# |
# | Modified files:
# | * dlls/wined3d/device.c
# |
if test "$enable_wined3d_Level_Count" -eq 1; then
patch_apply wined3d-Level_Count/0001-wined3d-Fix-check-for-texture-levels-in-wined3d_devi.patch
(
echo '+ { "Sebastian Lackner", "wined3d: Fix check for texture levels in wined3d_device_update_texture.", 1 },';
) >> "$patchlist"
fi
# Patchset ntdll-DllRedirects
# |
# | Modified files:

View File

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

View File

@ -1,4 +1,4 @@
From fe282dc2344e43fc6061c8bf6fafb6985472c2a1 Mon Sep 17 00:00:00 2001
From 2aa7d1f0d71e4d6a80b532f188d70dab9e955ed2 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Stefan=20D=C3=B6singer?= <stefan@codeweavers.com>
Date: Thu, 1 Aug 2013 00:33:48 +0200
Subject: wined3d: Send update_texture calls through the CS
@ -10,7 +10,7 @@ Subject: wined3d: Send update_texture calls through the CS
3 files changed, 97 insertions(+), 74 deletions(-)
diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c
index 77ef49b..c63299f 100644
index ad55b60..b10d67a 100644
--- a/dlls/wined3d/cs.c
+++ b/dlls/wined3d/cs.c
@@ -73,6 +73,7 @@ enum wined3d_cs_op
@ -34,7 +34,7 @@ index 77ef49b..c63299f 100644
static void wined3d_cs_mt_submit(struct wined3d_cs *cs, size_t size)
{
LONG new_val = (cs->queue.head + size) & (WINED3D_CS_QUEUE_SIZE - 1);
@@ -1999,6 +2006,31 @@ void wined3d_cs_emit_surface_preload(struct wined3d_cs *cs, struct wined3d_surfa
@@ -2001,6 +2008,31 @@ void wined3d_cs_emit_surface_preload(struct wined3d_cs *cs, struct wined3d_surfa
cs->ops->submit(cs, sizeof(*op));
}
@ -66,7 +66,7 @@ index 77ef49b..c63299f 100644
static UINT (* const wined3d_cs_op_handlers[])(struct wined3d_cs *cs, const void *data) =
{
/* WINED3D_CS_OP_NOP */ wined3d_cs_exec_nop,
@@ -2050,6 +2082,7 @@ static UINT (* const wined3d_cs_op_handlers[])(struct wined3d_cs *cs, const void
@@ -2052,6 +2084,7 @@ static UINT (* const wined3d_cs_op_handlers[])(struct wined3d_cs *cs, const void
/* WINED3D_CS_OP_UPDATE_SURFACE */ wined3d_cs_exec_update_surface,
/* WINED3D_CS_OP_TEXTURE_PRELOAD */ wined3d_cs_exec_texture_preload,
/* WINED3D_CS_OP_SURFACE_PRELOAD */ wined3d_cs_exec_surface_preload,
@ -75,7 +75,7 @@ index 77ef49b..c63299f 100644
static inline void *_wined3d_cs_mt_require_space(struct wined3d_cs *cs, size_t size, BOOL prio)
diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c
index 0d654b7..03202f7 100644
index 138bc8d..e69e7ea 100644
--- a/dlls/wined3d/device.c
+++ b/dlls/wined3d/device.c
@@ -3426,16 +3426,15 @@ void CDECL wined3d_device_draw_indexed_primitive_instanced(struct wined3d_device
@ -157,11 +157,11 @@ index 0d654b7..03202f7 100644
- return WINED3DERR_INVALIDCALL;
- }
-
- /* Check that both textures have the identical numbers of levels. */
- level_count = wined3d_texture_get_level_count(src_texture);
- if (wined3d_texture_get_level_count(dst_texture) != level_count)
- /* Check that source texture has equal or more levels than the destination texture. */
- level_count = wined3d_texture_get_level_count(dst_texture);
- if (wined3d_texture_get_level_count(src_texture) < level_count)
- {
- WARN("Source and destination have different level counts, returning WINED3DERR_INVALIDCALL.\n");
- WARN("Source has fewer level counts then destination, returning WINED3DERR_INVALIDCALL.\n");
- return WINED3DERR_INVALIDCALL;
- }
-
@ -172,7 +172,7 @@ index 0d654b7..03202f7 100644
- device->cs->ops->finish(device->cs);
- }
+ enum wined3d_resource_type type = src_texture->resource.type;
+ unsigned int level_count = wined3d_texture_get_level_count(src_texture);
+ unsigned int level_count = wined3d_texture_get_level_count(dst_texture);
+ unsigned int i;
/* Make sure that the destination texture is loaded. */
@ -270,11 +270,11 @@ index 0d654b7..03202f7 100644
+ return WINED3DERR_INVALIDCALL;
+ }
+
+ /* Check that both textures have the identical numbers of levels. */
+ level_count = wined3d_texture_get_level_count(src_texture);
+ if (wined3d_texture_get_level_count(dst_texture) != level_count)
+ /* Check that source texture has equal or more levels than the destination texture. */
+ level_count = wined3d_texture_get_level_count(dst_texture);
+ if (wined3d_texture_get_level_count(src_texture) < level_count)
+ {
+ WARN("Source and destination have different level counts, returning WINED3DERR_INVALIDCALL.\n");
+ WARN("Source has fewer level counts then destination, returning WINED3DERR_INVALIDCALL.\n");
+ return WINED3DERR_INVALIDCALL;
+ }
+
@ -284,10 +284,10 @@ index 0d654b7..03202f7 100644
}
diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h
index f6da464..3f46b1c 100644
index 6beb2bd..6a14923 100644
--- a/dlls/wined3d/wined3d_private.h
+++ b/dlls/wined3d/wined3d_private.h
@@ -2111,6 +2111,8 @@ void device_resource_add(struct wined3d_device *device, struct wined3d_resource
@@ -2110,6 +2110,8 @@ void device_resource_add(struct wined3d_device *device, struct wined3d_resource
void device_resource_released(struct wined3d_device *device, struct wined3d_resource *resource) DECLSPEC_HIDDEN;
void device_invalidate_state(const struct wined3d_device *device, DWORD state) DECLSPEC_HIDDEN;
void device_invalidate_shader_constants(const struct wined3d_device *device, DWORD mask) DECLSPEC_HIDDEN;
@ -296,7 +296,7 @@ index f6da464..3f46b1c 100644
static inline BOOL isStateDirty(const struct wined3d_context *context, DWORD state)
{
@@ -2698,6 +2700,8 @@ void wined3d_cs_emit_update_surface(struct wined3d_cs *cs, struct wined3d_surfac
@@ -2699,6 +2701,8 @@ void wined3d_cs_emit_update_surface(struct wined3d_cs *cs, struct wined3d_surfac
const RECT *src_rect, struct wined3d_surface *dst, const POINT *dst_point) DECLSPEC_HIDDEN;
void wined3d_cs_emit_texture_preload(struct wined3d_cs *cs, struct wined3d_texture *texture) DECLSPEC_HIDDEN;
void wined3d_cs_emit_surface_preload(struct wined3d_cs *cs, struct wined3d_surface *surface) DECLSPEC_HIDDEN;

View File

@ -3854,11 +3854,11 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c
+ return WINED3DERR_INVALIDCALL;
+ }
+
+ /* Check that both textures have the identical numbers of levels. */
+ level_count = wined3d_texture_get_level_count(src_texture);
+ if (wined3d_texture_get_level_count(dst_texture) != level_count)
+ /* Check that source texture has equal or more levels than the destination texture. */
+ level_count = wined3d_texture_get_level_count(dst_texture);
+ if (wined3d_texture_get_level_count(src_texture) < level_count)
+ {
+ WARN("Source and destination have different level counts, returning WINED3DERR_INVALIDCALL.\n");
+ WARN("Source has fewer level counts then destination, returning WINED3DERR_INVALIDCALL.\n");
+ return WINED3DERR_INVALIDCALL;
+ }
+

View File

@ -0,0 +1,34 @@
From 9d415a0b7671c0ab067f344ab7c6cb8520b744ff Mon Sep 17 00:00:00 2001
From: Sebastian Lackner <sebastian@fds-team.de>
Date: Mon, 27 Apr 2015 01:20:38 +0200
Subject: wined3d: Fix check for texture levels in
wined3d_device_update_texture.
Based on analysis by Sergey Isakov.
---
dlls/wined3d/device.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c
index 4954d00..f435739 100644
--- a/dlls/wined3d/device.c
+++ b/dlls/wined3d/device.c
@@ -3561,11 +3561,11 @@ HRESULT CDECL wined3d_device_update_texture(struct wined3d_device *device,
return WINED3DERR_INVALIDCALL;
}
- /* Check that both textures have the identical numbers of levels. */
- level_count = wined3d_texture_get_level_count(src_texture);
- if (wined3d_texture_get_level_count(dst_texture) != level_count)
+ /* Check that source texture has equal or more levels than the destination texture. */
+ level_count = wined3d_texture_get_level_count(dst_texture);
+ if (wined3d_texture_get_level_count(src_texture) < level_count)
{
- WARN("Source and destination have different level counts, returning WINED3DERR_INVALIDCALL.\n");
+ WARN("Source has fewer level counts then destination, returning WINED3DERR_INVALIDCALL.\n");
return WINED3DERR_INVALIDCALL;
}
--
2.3.5

View File

@ -0,0 +1 @@
Fixes: [38048] Fix check for texture levels in wined3d_device_update_texture