You've already forked wine-staging
mirror of
https://gitlab.winehq.org/wine/wine-staging.git
synced 2025-09-12 18:50:20 -07:00
Added patch to fix check for texture levels in wined3d_device_update_texture.
This commit is contained in:
@@ -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;
|
||||
|
||||
@@ -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;
|
||||
+ }
|
||||
+
|
||||
|
||||
Reference in New Issue
Block a user