mirror of
https://gitlab.winehq.org/wine/wine-staging.git
synced 2025-01-28 22:04:43 -08:00
wined3d-CSMT_Main: Update patchset.
This commit is contained in:
parent
2b415aff4f
commit
bdc0bd9ac4
@ -8493,6 +8493,8 @@ if test "$enable_wined3d_CSMT_Main" -eq 1; then
|
||||
printf '%s\n' '+ { "Sebastian Lackner", "wined3d: Do not immediately submit stateblock updates.", 1 },';
|
||||
printf '%s\n' '+ { "Sebastian Lackner", "wined3d: Get rid of TLS for command stream.", 1 },';
|
||||
printf '%s\n' '+ { "Sebastian Lackner", "wined3d: Clean up cs lists on shutdown.", 1 },';
|
||||
printf '%s\n' '+ { "Michael Müller", "wined3d: Use a separate lock for each CS list.", 1 },';
|
||||
printf '%s\n' '+ { "Sebastian Lackner", "wined3d: Don'\''t crash in context_release when device was not fully created.", 1 },';
|
||||
) >> "$patchlist"
|
||||
fi
|
||||
|
||||
|
@ -0,0 +1,96 @@
|
||||
From 2f24beca349dd4f2aa5a408e2da5d09e6425583d Mon Sep 17 00:00:00 2001
|
||||
From: =?UTF-8?q?Michael=20M=C3=BCller?= <michael@fds-team.de>
|
||||
Date: Thu, 9 Feb 2017 21:11:25 +0100
|
||||
Subject: wined3d: Use a separate lock for each CS list.
|
||||
|
||||
---
|
||||
dlls/wined3d/cs.c | 26 +++++++++++---------------
|
||||
dlls/wined3d/wined3d_private.h | 1 +
|
||||
2 files changed, 12 insertions(+), 15 deletions(-)
|
||||
|
||||
diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c
|
||||
index f68bbd55663..09936328cf4 100644
|
||||
--- a/dlls/wined3d/cs.c
|
||||
+++ b/dlls/wined3d/cs.c
|
||||
@@ -25,16 +25,6 @@ WINE_DEFAULT_DEBUG_CHANNEL(d3d);
|
||||
|
||||
#define WINED3D_INITIAL_CS_SIZE 4096
|
||||
|
||||
-static CRITICAL_SECTION wined3d_cs_list_mutex;
|
||||
-static CRITICAL_SECTION_DEBUG wined3d_cs_list_mutex_debug =
|
||||
-{
|
||||
- 0, 0, &wined3d_cs_list_mutex,
|
||||
- {&wined3d_cs_list_mutex_debug.ProcessLocksList,
|
||||
- &wined3d_cs_list_mutex_debug.ProcessLocksList},
|
||||
- 0, 0, {(DWORD_PTR)(__FILE__ ": wined3d_cs_list_mutex")}
|
||||
-};
|
||||
-static CRITICAL_SECTION wined3d_cs_list_mutex = {&wined3d_cs_list_mutex_debug, -1, 0, 0, 0, 0};
|
||||
-
|
||||
enum wined3d_cs_op
|
||||
{
|
||||
WINED3D_CS_OP_SYNC,
|
||||
@@ -539,9 +529,9 @@ static void wined3d_cs_mt_submit(struct wined3d_cs *cs);
|
||||
/* FIXME: The list synchronization probably isn't particularly fast. */
|
||||
static void wined3d_cs_list_enqueue(struct wined3d_cs_list *list, struct wined3d_cs_block *block)
|
||||
{
|
||||
- EnterCriticalSection(&wined3d_cs_list_mutex);
|
||||
+ EnterCriticalSection(&list->lock);
|
||||
list_add_tail(&list->blocks, &block->entry);
|
||||
- LeaveCriticalSection(&wined3d_cs_list_mutex);
|
||||
+ LeaveCriticalSection(&list->lock);
|
||||
InterlockedIncrement(&list->count);
|
||||
}
|
||||
|
||||
@@ -550,14 +540,14 @@ static struct wined3d_cs_block *wined3d_cs_list_dequeue(struct wined3d_cs_list *
|
||||
struct list *head;
|
||||
|
||||
if (!list->count) return NULL;
|
||||
- EnterCriticalSection(&wined3d_cs_list_mutex);
|
||||
+ EnterCriticalSection(&list->lock);
|
||||
if (!(head = list_head(&list->blocks)))
|
||||
{
|
||||
- LeaveCriticalSection(&wined3d_cs_list_mutex);
|
||||
+ LeaveCriticalSection(&list->lock);
|
||||
return NULL;
|
||||
}
|
||||
list_remove(head);
|
||||
- LeaveCriticalSection(&wined3d_cs_list_mutex);
|
||||
+ LeaveCriticalSection(&list->lock);
|
||||
InterlockedDecrement(&list->count);
|
||||
|
||||
return LIST_ENTRY(head, struct wined3d_cs_block, entry);
|
||||
@@ -610,6 +600,9 @@ static struct wined3d_cs_block *wined3d_cs_dequeue_block(struct wined3d_cs *cs)
|
||||
|
||||
static void wined3d_cs_list_init(struct wined3d_cs_list *list)
|
||||
{
|
||||
+ InitializeCriticalSection(&list->lock);
|
||||
+ list->lock.DebugInfo->Spare[0] = (DWORD_PTR)(__FILE__ ": wined3d_cs_list_lock");
|
||||
+
|
||||
list_init(&list->blocks);
|
||||
}
|
||||
|
||||
@@ -622,6 +615,9 @@ static void wined3d_cs_list_cleanup(struct wined3d_cs_list *list)
|
||||
list_remove(&block->entry);
|
||||
HeapFree(GetProcessHeap(), 0, block);
|
||||
}
|
||||
+
|
||||
+ list->lock.DebugInfo->Spare[0] = 0;
|
||||
+ DeleteCriticalSection(&list->lock);
|
||||
}
|
||||
|
||||
static struct wined3d_cs_block *wined3d_cs_get_block(struct wined3d_cs *cs, struct wined3d_cs_list *list)
|
||||
diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h
|
||||
index e6b0d363cdd..d4f05b204fd 100644
|
||||
--- a/dlls/wined3d/wined3d_private.h
|
||||
+++ b/dlls/wined3d/wined3d_private.h
|
||||
@@ -3207,6 +3207,7 @@ enum wined3d_push_constants
|
||||
|
||||
struct wined3d_cs_list
|
||||
{
|
||||
+ CRITICAL_SECTION lock;
|
||||
struct list blocks;
|
||||
LONG count;
|
||||
};
|
||||
--
|
||||
2.11.0
|
||||
|
@ -0,0 +1,30 @@
|
||||
From 9c3420b9d0fd92a9421e0b15177d4fb8b5a55601 Mon Sep 17 00:00:00 2001
|
||||
From: Sebastian Lackner <sebastian@fds-team.de>
|
||||
Date: Fri, 10 Feb 2017 20:31:21 +0100
|
||||
Subject: wined3d: Don't crash in context_release when device was not fully
|
||||
created.
|
||||
|
||||
---
|
||||
dlls/wined3d/context.c | 5 ++++-
|
||||
1 file changed, 4 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/dlls/wined3d/context.c b/dlls/wined3d/context.c
|
||||
index 1979a36d875..be5194daaf0 100644
|
||||
--- a/dlls/wined3d/context.c
|
||||
+++ b/dlls/wined3d/context.c
|
||||
@@ -1353,8 +1353,11 @@ void context_release(struct wined3d_context *context)
|
||||
WARN("Context %p is not the current context.\n", context);
|
||||
}
|
||||
|
||||
- if (wined3d_settings.cs_multithreaded && context->device->cs->thread_id != GetCurrentThreadId())
|
||||
+ if (wined3d_settings.cs_multithreaded && context->device &&
|
||||
+ context->device->cs->thread_id != GetCurrentThreadId())
|
||||
+ {
|
||||
context->gl_info->gl_ops.gl.p_glFinish();
|
||||
+ }
|
||||
|
||||
if (!--context->level)
|
||||
{
|
||||
--
|
||||
2.11.0
|
||||
|
File diff suppressed because it is too large
Load Diff
Loading…
x
Reference in New Issue
Block a user