Rebase against b77688102a84e1c7b7278340c46f53db3e1cda00.

This commit is contained in:
Sebastian Lackner
2017-05-12 00:36:30 +02:00
parent d6c145fbf5
commit 975205155e
6 changed files with 68 additions and 99 deletions

View File

@@ -1,26 +1,19 @@
From b1a406bab0b46ba9b97081b1a7689d33d6147435 Mon Sep 17 00:00:00 2001
From 9c3480193d90c7553b03b3d61cc9db4c08aeffbc Mon Sep 17 00:00:00 2001
From: Sebastian Lackner <sebastian@fds-team.de>
Date: Sun, 19 Feb 2017 00:57:12 +0100
Subject: wined3d: Add additional synchronization CS ops.
---
dlls/wined3d/cs.c | 9 +++++----
dlls/wined3d/cs.c | 1 +
dlls/wined3d/view.c | 6 ++++++
dlls/wined3d/wined3d_main.c | 2 +-
3 files changed, 12 insertions(+), 5 deletions(-)
3 files changed, 8 insertions(+), 1 deletion(-)
diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c
index 7331f31dd3..5c444b29bc 100644
index fd6968634b..a2d4885167 100644
--- a/dlls/wined3d/cs.c
+++ b/dlls/wined3d/cs.c
@@ -2554,17 +2554,18 @@ fail:
void wined3d_cs_destroy(struct wined3d_cs *cs)
{
- state_cleanup(&cs->state);
- HeapFree(GetProcessHeap(), 0, cs->fb.render_targets);
- HeapFree(GetProcessHeap(), 0, cs->data);
-
@@ -2557,6 +2557,7 @@ void wined3d_cs_destroy(struct wined3d_cs *cs)
if (cs->thread)
{
wined3d_cs_emit_stop(cs);
@@ -28,14 +21,6 @@ index 7331f31dd3..5c444b29bc 100644
CloseHandle(cs->thread);
if (!CloseHandle(cs->event))
ERR("Closing event failed.\n");
}
+ state_cleanup(&cs->state);
+ HeapFree(GetProcessHeap(), 0, cs->fb.render_targets);
+ HeapFree(GetProcessHeap(), 0, cs->data);
+
HeapFree(GetProcessHeap(), 0, cs);
}
diff --git a/dlls/wined3d/view.c b/dlls/wined3d/view.c
index 0a458803a7..0184b21cdb 100644
--- a/dlls/wined3d/view.c

View File

@@ -812,16 +812,7 @@ diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c
TRACE("Stopped.\n");
FreeLibraryAndExitThread(cs->wined3d_module, 0);
}
@@ -2554,17 +2859,28 @@ fail:
void wined3d_cs_destroy(struct wined3d_cs *cs)
{
+#if !defined(STAGING_CSMT)
state_cleanup(&cs->state);
HeapFree(GetProcessHeap(), 0, cs->fb.render_targets);
HeapFree(GetProcessHeap(), 0, cs->data);
+#endif /* STAGING_CSMT */
@@ -2557,6 +2862,9 @@ void wined3d_cs_destroy(struct wined3d_cs *cs)
if (cs->thread)
{
wined3d_cs_emit_stop(cs);
@@ -831,16 +822,6 @@ diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c
CloseHandle(cs->thread);
if (!CloseHandle(cs->event))
ERR("Closing event failed.\n");
}
+#if defined(STAGING_CSMT)
+ state_cleanup(&cs->state);
+ HeapFree(GetProcessHeap(), 0, cs->fb.render_targets);
+ HeapFree(GetProcessHeap(), 0, cs->data);
+
+#endif /* STAGING_CSMT */
HeapFree(GetProcessHeap(), 0, cs);
}
diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c
--- a/dlls/wined3d/device.c
+++ b/dlls/wined3d/device.c
@@ -854,7 +835,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c
wined3d_device_delete_opengl_contexts(device);
if (device->fb.depth_stencil)
@@ -4229,6 +4232,7 @@ HRESULT CDECL wined3d_device_copy_sub_resource_region(struct wined3d_device *dev
@@ -4230,6 +4233,7 @@ HRESULT CDECL wined3d_device_copy_sub_resource_region(struct wined3d_device *dev
return WINED3DERR_INVALIDCALL;
}
@@ -862,7 +843,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c
if (dst_texture->sub_resources[dst_sub_resource_idx].map_count)
{
WARN("Destination sub-resource %u is mapped.\n", dst_sub_resource_idx);
@@ -4239,6 +4243,19 @@ HRESULT CDECL wined3d_device_copy_sub_resource_region(struct wined3d_device *dev
@@ -4240,6 +4244,19 @@ HRESULT CDECL wined3d_device_copy_sub_resource_region(struct wined3d_device *dev
{
WARN("Source sub-resource %u is mapped.\n", src_sub_resource_idx);
return WINED3DERR_INVALIDCALL;
@@ -882,7 +863,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c
}
if (!src_box)
@@ -5272,3 +5289,58 @@ LRESULT device_process_message(struct wined3d_device *device, HWND window, BOOL
@@ -5273,3 +5290,58 @@ LRESULT device_process_message(struct wined3d_device *device, HWND window, BOOL
else
return CallWindowProcA(proc, window, message, wparam, lparam);
}
@@ -1291,7 +1272,7 @@ diff --git a/dlls/wined3d/wined3d_main.c b/dlls/wined3d/wined3d_main.c
diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h
--- a/dlls/wined3d/wined3d_private.h
+++ b/dlls/wined3d/wined3d_private.h
@@ -2649,6 +2649,16 @@ struct wined3d_state
@@ -2650,6 +2650,16 @@ struct wined3d_state
struct wined3d_rasterizer_state *rasterizer_state;
};
@@ -1308,7 +1289,7 @@ diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h
#define WINED3D_UNMAPPED_STAGE ~0u
/* Multithreaded flag. Removed from the public header to signal that
@@ -2760,6 +2770,12 @@ LRESULT device_process_message(struct wined3d_device *device, HWND window, BOOL
@@ -2761,6 +2771,12 @@ LRESULT device_process_message(struct wined3d_device *device, HWND window, BOOL
void device_resource_add(struct wined3d_device *device, struct wined3d_resource *resource) DECLSPEC_HIDDEN;
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;
@@ -1321,7 +1302,7 @@ diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h
static inline BOOL isStateDirty(const struct wined3d_context *context, DWORD state)
{
@@ -2946,7 +2962,11 @@ struct wined3d_texture
@@ -2947,7 +2963,11 @@ struct wined3d_texture
unsigned int map_count;
DWORD locations;
@@ -1333,7 +1314,7 @@ diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h
} sub_resources[1];
};
@@ -3254,7 +3274,12 @@ struct wined3d_cs_queue
@@ -3255,7 +3275,12 @@ struct wined3d_cs_queue
struct wined3d_cs_ops
{
@@ -1346,7 +1327,7 @@ diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h
void (*submit)(struct wined3d_cs *cs);
void (*finish)(struct wined3d_cs *cs);
void (*push_constants)(struct wined3d_cs *cs, enum wined3d_push_constants p,
@@ -3271,7 +3296,13 @@ struct wined3d_cs
@@ -3272,7 +3297,13 @@ struct wined3d_cs
HANDLE thread;
DWORD thread_id;