From 14acf51a2d0de1ba14eaa15244e2f678680819f2 Mon Sep 17 00:00:00 2001 From: Sebastian Lackner Date: Thu, 13 Apr 2017 11:52:28 +0200 Subject: [PATCH] Rebase against aa1580398e4c9eda851d475213e07d865d9238bd. --- ...-Skip-async-completion-when-possible.patch | 16 +- patches/patchinstall.sh | 3 +- ...eference-to-the-parent-object-for-pi.patch | 28 +-- ...-support-for-global-and-local-shared.patch | 48 ++-- ...he-swap-interval-through-the-CS-in-r.patch | 97 -------- ...introduce-a-multithreaded-command-st.patch | 191 +++++++-------- ...-Introduce-a-separate-priority-queue.patch | 129 +++++----- ...mmediately-submit-stateblock-updates.patch | 68 +++--- .../wined3d-CSMT_Main/9999-IfDefined.patch | 226 +++++++----------- ...t-FIXME-only-once-in-surface_cpu_blt.patch | 24 +- ...nhttp-Fix-handling-of-Accept-headers.patch | 15 +- ...rt-for-TF_REUSE_SOCKET-to-TransmitFi.patch | 22 +- 12 files changed, 349 insertions(+), 518 deletions(-) delete mode 100644 patches/wined3d-CSMT_Main/0016-wined3d-Update-the-swap-interval-through-the-CS-in-r.patch diff --git a/patches/kernel32-SetFileCompletionNotificationModes/0006-server-Skip-async-completion-when-possible.patch b/patches/kernel32-SetFileCompletionNotificationModes/0006-server-Skip-async-completion-when-possible.patch index c9b2172c..a6e2eea6 100644 --- a/patches/kernel32-SetFileCompletionNotificationModes/0006-server-Skip-async-completion-when-possible.patch +++ b/patches/kernel32-SetFileCompletionNotificationModes/0006-server-Skip-async-completion-when-possible.patch @@ -1,4 +1,4 @@ -From 7618743260a673e0556845b352bc7c2620775164 Mon Sep 17 00:00:00 2001 +From 663bd84bef7a95f85a935fe52662186930235237 Mon Sep 17 00:00:00 2001 From: Sebastian Lackner Date: Sun, 9 Apr 2017 03:13:25 +0200 Subject: server: Skip async completion when possible. @@ -25,7 +25,7 @@ index 013eb2b39f..631013c755 100644 CloseHandle(ov.hEvent); diff --git a/server/async.c b/server/async.c -index 7323047d8d..ad7c1f097f 100644 +index f9d8af36b9..be7da06b65 100644 --- a/server/async.c +++ b/server/async.c @@ -45,6 +45,7 @@ struct async @@ -69,20 +69,20 @@ index 7323047d8d..ad7c1f097f 100644 if (async->data.apc) { diff --git a/server/fd.c b/server/fd.c -index 9617fa1279..e0c2ee4f26 100644 +index 288f6976e1..fdbd07ef59 100644 --- a/server/fd.c +++ b/server/fd.c @@ -2381,6 +2381,7 @@ DECL_HANDLER(flush) if (async) { - reply->event = fd->fd_ops->flush( fd, async, req->blocking ); + reply->event = fd->fd_ops->flush( fd, async ); + async_skip_completion( async, fd->comp_flags ); release_object( async ); } release_object( fd ); @@ -2461,6 +2462,7 @@ DECL_HANDLER(read) { - reply->wait = fd->fd_ops->read( fd, async, req->blocking, req->pos ); + reply->wait = fd->fd_ops->read( fd, async, req->pos ); reply->options = fd->options; + async_skip_completion( async, fd->comp_flags ); release_object( async ); @@ -90,7 +90,7 @@ index 9617fa1279..e0c2ee4f26 100644 release_object( iosb ); @@ -2484,6 +2486,7 @@ DECL_HANDLER(write) { - reply->wait = fd->fd_ops->write( fd, async, req->blocking, req->pos ); + reply->wait = fd->fd_ops->write( fd, async, req->pos ); reply->options = fd->options; + async_skip_completion( async, fd->comp_flags ); release_object( async ); @@ -98,14 +98,14 @@ index 9617fa1279..e0c2ee4f26 100644 release_object( iosb ); @@ -2507,6 +2510,7 @@ DECL_HANDLER(ioctl) { - reply->wait = fd->fd_ops->ioctl( fd, req->code, async, req->blocking ); + reply->wait = fd->fd_ops->ioctl( fd, req->code, async ); reply->options = fd->options; + async_skip_completion( async, fd->comp_flags ); release_object( async ); } release_object( iosb ); diff --git a/server/file.h b/server/file.h -index 94cc37ff2e..6c68153d38 100644 +index 5ea8f0f5cb..ff605c3719 100644 --- a/server/file.h +++ b/server/file.h @@ -181,6 +181,7 @@ extern void async_set_timeout( struct async *async, timeout_t timeout, unsigned diff --git a/patches/patchinstall.sh b/patches/patchinstall.sh index 26adc481..9b7a2d4c 100755 --- a/patches/patchinstall.sh +++ b/patches/patchinstall.sh @@ -52,7 +52,7 @@ usage() # Get the upstream commit sha upstream_commit() { - echo "d6557e812984e010a989a3360039453eb978bd12" + echo "aa1580398e4c9eda851d475213e07d865d9238bd" } # Show version information @@ -8758,7 +8758,6 @@ if test "$enable_wined3d_CSMT_Main" -eq 1; then printf '%s\n' '+ { "Stefan Dösinger", "wined3d: Send blits through the command stream.", 1 },'; printf '%s\n' '+ { "Stefan Dösinger", "wined3d: Get rid of the end_scene flush and finish.", 1 },'; printf '%s\n' '+ { "Sebastian Lackner", "wined3d: Send query_poll through the command stream.", 1 },'; - printf '%s\n' '+ { "Stefan Dösinger", "wined3d: Update the swap interval through the CS in reset.", 1 },'; printf '%s\n' '+ { "Stefan Dösinger", "wined3d: Wrap GL BOs in a structure.", 1 },'; printf '%s\n' '+ { "Stefan Dösinger", "wined3d: Add a separate variable to check if queries are started.", 1 },'; printf '%s\n' '+ { "Stefan Dösinger", "wined3d: Wait for the cs to finish before destroying the device.", 1 },'; diff --git a/patches/server-Pipe_ObjectName/0001-server-Store-a-reference-to-the-parent-object-for-pi.patch b/patches/server-Pipe_ObjectName/0001-server-Store-a-reference-to-the-parent-object-for-pi.patch index 1209db43..3870d2ea 100644 --- a/patches/server-Pipe_ObjectName/0001-server-Store-a-reference-to-the-parent-object-for-pi.patch +++ b/patches/server-Pipe_ObjectName/0001-server-Store-a-reference-to-the-parent-object-for-pi.patch @@ -1,4 +1,4 @@ -From aaeefae082df9cd44092a36d5781de6d6a0fabee Mon Sep 17 00:00:00 2001 +From 63c4e77ca26c57eb4f1c0786f4b62f3b01106d96 Mon Sep 17 00:00:00 2001 From: Sebastian Lackner Date: Mon, 17 Aug 2015 01:11:47 +0200 Subject: server: Store a reference to the parent object for pipe servers. (v2) @@ -30,19 +30,19 @@ index 43c5ee46d7..9a1ba670ab 100644 "name too short %s\n", wine_dbgstr_w(str->Buffer) ); trace( "got %s len %u\n", wine_dbgstr_w(str->Buffer), len ); diff --git a/server/named_pipe.c b/server/named_pipe.c -index 0d10f11669..2713614776 100644 +index 4196edfd4b..0726c75f40 100644 --- a/server/named_pipe.c +++ b/server/named_pipe.c -@@ -164,6 +164,8 @@ static void pipe_end_reselect_async( struct fd *fd, struct async_queue *queue ); +@@ -162,6 +162,8 @@ static void pipe_end_reselect_async( struct fd *fd, struct async_queue *queue ); /* server end functions */ static void pipe_server_dump( struct object *obj, int verbose ); static struct fd *pipe_server_get_fd( struct object *obj ); +static int pipe_server_link_name( struct object *obj, struct object_name *name, struct object *parent ); +static void pipe_server_unlink_name( struct object *obj, struct object_name *name ); static void pipe_server_destroy( struct object *obj); - static obj_handle_t pipe_server_flush( struct fd *fd, struct async *async, int blocking ); + static obj_handle_t pipe_server_flush( struct fd *fd, struct async *async ); static enum server_fd_type pipe_server_get_fd_type( struct fd *fd ); -@@ -185,8 +187,8 @@ static const struct object_ops pipe_server_ops = +@@ -182,8 +184,8 @@ static const struct object_ops pipe_server_ops = default_get_sd, /* get_sd */ default_set_sd, /* set_sd */ no_lookup_name, /* lookup_name */ @@ -53,16 +53,16 @@ index 0d10f11669..2713614776 100644 no_open_file, /* open_file */ no_alloc_handle, /* alloc_handle */ fd_close_handle, /* close_handle */ -@@ -210,6 +212,8 @@ static const struct fd_ops pipe_server_fd_ops = +@@ -207,6 +209,8 @@ static const struct fd_ops pipe_server_fd_ops = static void pipe_client_dump( struct object *obj, int verbose ); static int pipe_client_signaled( struct object *obj, struct wait_queue_entry *entry ); static struct fd *pipe_client_get_fd( struct object *obj ); +static int pipe_client_link_name( struct object *obj, struct object_name *name, struct object *parent ); +static void pipe_client_unlink_name( struct object *obj, struct object_name *name ); static void pipe_client_destroy( struct object *obj ); - static obj_handle_t pipe_client_flush( struct fd *fd, struct async *async, int blocking ); - static obj_handle_t pipe_client_ioctl( struct fd *fd, ioctl_code_t code, struct async *async, -@@ -231,8 +235,8 @@ static const struct object_ops pipe_client_ops = + static obj_handle_t pipe_client_flush( struct fd *fd, struct async *async ); + static obj_handle_t pipe_client_ioctl( struct fd *fd, ioctl_code_t code, struct async *async ); +@@ -227,8 +231,8 @@ static const struct object_ops pipe_client_ops = default_get_sd, /* get_sd */ default_set_sd, /* set_sd */ no_lookup_name, /* lookup_name */ @@ -73,7 +73,7 @@ index 0d10f11669..2713614776 100644 no_open_file, /* open_file */ no_alloc_handle, /* alloc_handle */ fd_close_handle, /* close_handle */ -@@ -484,6 +488,17 @@ static void pipe_end_destroy( struct pipe_end *pipe_end ) +@@ -480,6 +484,17 @@ static void pipe_end_destroy( struct pipe_end *pipe_end ) free_async_queue( pipe_end->write_q ); } @@ -91,7 +91,7 @@ index 0d10f11669..2713614776 100644 static void pipe_server_destroy( struct object *obj) { struct pipe_server *server = (struct pipe_server *)obj; -@@ -513,6 +528,17 @@ static void pipe_server_destroy( struct object *obj) +@@ -509,6 +524,17 @@ static void pipe_server_destroy( struct object *obj) release_object( server->pipe ); } @@ -109,7 +109,7 @@ index 0d10f11669..2713614776 100644 static void pipe_client_destroy( struct object *obj) { struct pipe_client *client = (struct pipe_client *)obj; -@@ -1072,9 +1098,10 @@ static void init_pipe_end( struct pipe_end *pipe_end, unsigned int pipe_flags, d +@@ -1080,9 +1106,10 @@ static void init_pipe_end( struct pipe_end *pipe_end, unsigned int pipe_flags, d static struct pipe_server *create_pipe_server( struct named_pipe *pipe, unsigned int options, unsigned int pipe_flags ) { @@ -121,7 +121,7 @@ index 0d10f11669..2713614776 100644 if (!server) return NULL; -@@ -1096,11 +1123,13 @@ static struct pipe_server *create_pipe_server( struct named_pipe *pipe, unsigned +@@ -1104,11 +1131,13 @@ static struct pipe_server *create_pipe_server( struct named_pipe *pipe, unsigned return server; } @@ -137,7 +137,7 @@ index 0d10f11669..2713614776 100644 if (!client) return NULL; -@@ -1170,7 +1199,7 @@ static struct object *named_pipe_open_file( struct object *obj, unsigned int acc +@@ -1178,7 +1207,7 @@ static struct object *named_pipe_open_file( struct object *obj, unsigned int acc return NULL; } diff --git a/patches/server-Shared_Memory/0002-server-Implement-support-for-global-and-local-shared.patch b/patches/server-Shared_Memory/0002-server-Implement-support-for-global-and-local-shared.patch index 93587f4b..1e3d8769 100644 --- a/patches/server-Shared_Memory/0002-server-Implement-support-for-global-and-local-shared.patch +++ b/patches/server-Shared_Memory/0002-server-Implement-support-for-global-and-local-shared.patch @@ -1,4 +1,4 @@ -From 926b152191997c78520b5b61ba4be8decb09a361 Mon Sep 17 00:00:00 2001 +From 50af842c68f0588edc927f5ad0de4f1f0b33b6e9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michael=20M=C3=BCller?= Date: Thu, 19 Mar 2015 01:22:34 +0100 Subject: server: Implement support for global and local shared memory blocks @@ -20,7 +20,7 @@ Subject: server: Implement support for global and local shared memory blocks 12 files changed, 215 insertions(+), 1 deletion(-) diff --git a/dlls/ntdll/ntdll_misc.h b/dlls/ntdll/ntdll_misc.h -index 6e24ac364ac..7fe818941f6 100644 +index 6e24ac364a..7fe818941f 100644 --- a/dlls/ntdll/ntdll_misc.h +++ b/dlls/ntdll/ntdll_misc.h @@ -100,6 +100,7 @@ extern int server_pipe( int fd[2] ) DECLSPEC_HIDDEN; @@ -32,10 +32,10 @@ index 6e24ac364ac..7fe818941f6 100644 /* module handling */ extern LIST_ENTRY tls_links DECLSPEC_HIDDEN; diff --git a/dlls/ntdll/server.c b/dlls/ntdll/server.c -index ec517fcf408..016830e066f 100644 +index c02a12ab19..80d061abd8 100644 --- a/dlls/ntdll/server.c +++ b/dlls/ntdll/server.c -@@ -979,6 +979,66 @@ done: +@@ -973,6 +973,66 @@ done: /*********************************************************************** @@ -102,7 +102,7 @@ index ec517fcf408..016830e066f 100644 * wine_server_fd_to_handle (NTDLL.@) * * Allocate a file handle for a Unix file descriptor. -@@ -1507,6 +1567,10 @@ size_t server_init_thread( void *entry_point ) +@@ -1501,6 +1561,10 @@ size_t server_init_thread( void *entry_point ) } SERVER_END_REQ; @@ -114,7 +114,7 @@ index ec517fcf408..016830e066f 100644 ntdll_get_thread_data()->wow64_redir = is_wow64; diff --git a/dlls/ntdll/thread.c b/dlls/ntdll/thread.c -index 306a6c6ee83..e5ebd7c2665 100644 +index 9a02b8d3da..63a9c4f90b 100644 --- a/dlls/ntdll/thread.c +++ b/dlls/ntdll/thread.c @@ -380,6 +380,7 @@ void terminate_thread( int status ) @@ -136,7 +136,7 @@ index 306a6c6ee83..e5ebd7c2665 100644 if ((teb = interlocked_xchg_ptr( &prev_teb, NtCurrentTeb() ))) diff --git a/include/wine/server.h b/include/wine/server.h -index d573d1f7ad4..9889b95aaff 100644 +index d573d1f7ad..9889b95aaf 100644 --- a/include/wine/server.h +++ b/include/wine/server.h @@ -120,6 +120,17 @@ static inline void *wine_server_get_ptr( client_ptr_t ptr ) @@ -158,7 +158,7 @@ index d573d1f7ad4..9889b95aaff 100644 /* macros for server requests */ diff --git a/include/winternl.h b/include/winternl.h -index f35091cba1a..e4f2fd9cafc 100644 +index 5cd1664f1f..52bf022cdb 100644 --- a/include/winternl.h +++ b/include/winternl.h @@ -366,7 +366,7 @@ typedef struct _TEB @@ -171,10 +171,10 @@ index f35091cba1a..e4f2fd9cafc 100644 ULONG ImpersonationLocale; /* f98/1788 */ ULONG IsImpersonating; /* f9c/178c */ diff --git a/server/fd.c b/server/fd.c -index 88ea6abb0a5..238f066f477 100644 +index 3c8f1bd6c3..5f7519866c 100644 --- a/server/fd.c +++ b/server/fd.c -@@ -2533,6 +2533,33 @@ DECL_HANDLER(write) +@@ -2487,6 +2487,33 @@ DECL_HANDLER(write) release_object( fd ); } @@ -209,10 +209,10 @@ index 88ea6abb0a5..238f066f477 100644 DECL_HANDLER(ioctl) { diff --git a/server/file.h b/server/file.h -index c5867a670f6..46b06c630bd 100644 +index 5ea8f0f5cb..123f8b3ca7 100644 --- a/server/file.h +++ b/server/file.h -@@ -156,6 +156,14 @@ extern struct object *create_mailslot_device( struct object *root, const struct +@@ -154,6 +154,14 @@ extern struct object *create_mailslot_device( struct object *root, const struct extern struct object *create_unix_device( struct object *root, const struct unicode_str *name, const char *unix_path ); @@ -228,7 +228,7 @@ index c5867a670f6..46b06c630bd 100644 extern void do_change_notify( int unix_fd ); diff --git a/server/main.c b/server/main.c -index 7aed338e968..f984bfc1e30 100644 +index 7aed338e96..f984bfc1e3 100644 --- a/server/main.c +++ b/server/main.c @@ -145,6 +145,7 @@ int main( int argc, char *argv[] ) @@ -240,7 +240,7 @@ index 7aed338e968..f984bfc1e30 100644 return 0; } diff --git a/server/mapping.c b/server/mapping.c -index a465bf5f2dd..ac4d982888b 100644 +index f03ea7a6f6..d071ed95b3 100644 --- a/server/mapping.c +++ b/server/mapping.c @@ -29,8 +29,32 @@ @@ -276,7 +276,7 @@ index a465bf5f2dd..ac4d982888b 100644 #include "ntstatus.h" #define WIN32_NO_STATUS #include "windef.h" -@@ -116,6 +140,10 @@ static struct list shared_list = LIST_INIT(shared_list); +@@ -115,6 +139,10 @@ static struct list shared_list = LIST_INIT(shared_list); static size_t page_mask; @@ -287,7 +287,7 @@ index a465bf5f2dd..ac4d982888b 100644 #define ROUND_SIZE(size) (((size) + page_mask) & ~page_mask) -@@ -160,6 +188,52 @@ static int check_current_dir_for_exec(void) +@@ -159,6 +187,52 @@ static int check_current_dir_for_exec(void) return (ret != MAP_FAILED); } @@ -341,7 +341,7 @@ index a465bf5f2dd..ac4d982888b 100644 static int create_temp_file( file_pos_t size ) { diff --git a/server/protocol.def b/server/protocol.def -index 3d91aecf1e4..ddb996ad42b 100644 +index 87285a4038..1bb679261d 100644 --- a/server/protocol.def +++ b/server/protocol.def @@ -69,6 +69,15 @@ struct request_max_size @@ -360,7 +360,7 @@ index 3d91aecf1e4..ddb996ad42b 100644 /* debug event data */ typedef union -@@ -1243,6 +1252,12 @@ enum server_fd_type +@@ -1240,6 +1249,12 @@ enum server_fd_type @END @@ -372,12 +372,12 @@ index 3d91aecf1e4..ddb996ad42b 100644 + /* Flush a file buffers */ @REQ(flush) - int blocking; /* whether it's a blocking flush */ + async_data_t async; /* async I/O parameters */ diff --git a/server/thread.c b/server/thread.c -index 0eed897e032..08c07821862 100644 +index ba308ee9ab..6bfa8a4467 100644 --- a/server/thread.c +++ b/server/thread.c -@@ -201,6 +201,8 @@ static inline void init_thread_structure( struct thread *thread ) +@@ -199,6 +199,8 @@ static inline void init_thread_structure( struct thread *thread ) thread->desktop_users = 0; thread->token = NULL; thread->exit_poll = NULL; @@ -386,7 +386,7 @@ index 0eed897e032..08c07821862 100644 thread->creation_time = current_time; thread->exit_time = 0; -@@ -302,6 +304,8 @@ static void cleanup_thread( struct thread *thread ) +@@ -300,6 +302,8 @@ static void cleanup_thread( struct thread *thread ) thread->inflight[i].client = thread->inflight[i].server = -1; } } @@ -395,7 +395,7 @@ index 0eed897e032..08c07821862 100644 thread->req_data = NULL; thread->reply_data = NULL; thread->request_fd = NULL; -@@ -310,6 +314,9 @@ static void cleanup_thread( struct thread *thread ) +@@ -308,6 +312,9 @@ static void cleanup_thread( struct thread *thread ) thread->context = NULL; thread->suspend_context = NULL; thread->desktop = 0; @@ -406,7 +406,7 @@ index 0eed897e032..08c07821862 100644 /* destroy a thread when its refcount is 0 */ diff --git a/server/thread.h b/server/thread.h -index ac9af24086d..59ef2505bd4 100644 +index ac9af24086..59ef2505bd 100644 --- a/server/thread.h +++ b/server/thread.h @@ -89,6 +89,8 @@ struct thread diff --git a/patches/wined3d-CSMT_Main/0016-wined3d-Update-the-swap-interval-through-the-CS-in-r.patch b/patches/wined3d-CSMT_Main/0016-wined3d-Update-the-swap-interval-through-the-CS-in-r.patch deleted file mode 100644 index d1bb0542..00000000 --- a/patches/wined3d-CSMT_Main/0016-wined3d-Update-the-swap-interval-through-the-CS-in-r.patch +++ /dev/null @@ -1,97 +0,0 @@ -From 7788e5dc312a2f08419f2e7b17bfc3a8d2439ae7 Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Stefan=20D=C3=B6singer?= -Date: Sat, 7 May 2016 21:58:06 +0100 -Subject: wined3d: Update the swap interval through the CS in reset. - ---- - dlls/wined3d/cs.c | 26 ++++++++++++++++++++++++++ - dlls/wined3d/device.c | 2 +- - dlls/wined3d/wined3d_private.h | 1 + - 3 files changed, 28 insertions(+), 1 deletion(-) - -diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c -index b6bc0e6b84..eb82d40e8f 100644 ---- a/dlls/wined3d/cs.c -+++ b/dlls/wined3d/cs.c -@@ -70,6 +70,7 @@ enum wined3d_cs_op - WINED3D_CS_OP_UPDATE_SUB_RESOURCE, - WINED3D_CS_OP_ADD_DIRTY_TEXTURE_REGION, - WINED3D_CS_OP_PUSH_CONSTANTS, -+ WINED3D_CS_OP_UPDATE_SWAP_INTERVAL, - }; - - struct wined3d_cs_sync -@@ -411,6 +412,12 @@ struct wined3d_cs_push_constants - BYTE constants[1]; - }; - -+struct wined3d_cs_update_swap_interval -+{ -+ enum wined3d_cs_op opcode; -+ struct wined3d_swapchain *swapchain; -+}; -+ - static void wined3d_cs_exec_sync(struct wined3d_cs *cs, const void *data) - { - } -@@ -2155,6 +2162,24 @@ void wined3d_cs_emit_push_constants(struct wined3d_cs *cs, enum wined3d_push_con - cs->ops->submit(cs); - } - -+static void wined3d_cs_exec_update_swap_interval(struct wined3d_cs *cs, const void *data) -+{ -+ const struct wined3d_cs_update_swap_interval *op = data; -+ -+ swapchain_update_swap_interval(op->swapchain); -+} -+ -+void wined3d_cs_emit_update_swap_interval(struct wined3d_cs *cs, struct wined3d_swapchain *swapchain) -+{ -+ struct wined3d_cs_update_swap_interval *op; -+ -+ op = cs->ops->require_space(cs, sizeof(*op)); -+ op->opcode = WINED3D_CS_OP_UPDATE_SWAP_INTERVAL; -+ op->swapchain = swapchain; -+ -+ cs->ops->submit_and_wait(cs); -+} -+ - static void (* const wined3d_cs_op_handlers[])(struct wined3d_cs *cs, const void *data) = - { - /* WINED3D_CS_OP_SYNC */ wined3d_cs_exec_sync, -@@ -2201,6 +2226,7 @@ static void (* const wined3d_cs_op_handlers[])(struct wined3d_cs *cs, const void - /* WINED3D_CS_OP_UPDATE_SUB_RESOURCE */ wined3d_cs_exec_update_sub_resource, - /* WINED3D_CS_OP_ADD_DIRTY_TEXTURE_REGION */ wined3d_cs_exec_add_dirty_texture_region, - /* WINED3D_CS_OP_PUSH_CONSTANTS */ wined3d_cs_exec_push_constants, -+ /* WINED3D_CS_OP_UPDATE_SWAP_INTERVAL */ wined3d_cs_exec_update_swap_interval, - }; - - static void *wined3d_cs_st_require_space(struct wined3d_cs *cs, size_t size) -diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c -index c2b7623141..c05c8c51f2 100644 ---- a/dlls/wined3d/device.c -+++ b/dlls/wined3d/device.c -@@ -4779,7 +4779,7 @@ HRESULT CDECL wined3d_device_reset(struct wined3d_device *device, - { - if (reset_state) - hr = wined3d_device_create_primary_opengl_context(device); -- swapchain_update_swap_interval(swapchain); -+ wined3d_cs_emit_update_swap_interval(device->cs, swapchain); - } - - /* All done. There is no need to reload resources or shaders, this will happen automatically on the -diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h -index 611e9532ce..7a7e281318 100644 ---- a/dlls/wined3d/wined3d_private.h -+++ b/dlls/wined3d/wined3d_private.h -@@ -3324,6 +3324,7 @@ void wined3d_cs_emit_unload_resource(struct wined3d_cs *cs, struct wined3d_resou - void wined3d_cs_emit_update_sub_resource(struct wined3d_cs *cs, struct wined3d_resource *resource, - unsigned int sub_resource_idx, const struct wined3d_box *box, const void *data, unsigned int row_pitch, - unsigned int slice_pitch) DECLSPEC_HIDDEN; -+void wined3d_cs_emit_update_swap_interval(struct wined3d_cs *cs, struct wined3d_swapchain *swapchain) DECLSPEC_HIDDEN; - void wined3d_cs_init_object(struct wined3d_cs *cs, - void (*callback)(void *object), void *object) DECLSPEC_HIDDEN; - HRESULT wined3d_cs_map(struct wined3d_cs *cs, struct wined3d_resource *resource, unsigned int sub_resource_idx, --- -2.11.0 - diff --git a/patches/wined3d-CSMT_Main/0029-wined3d-Hackily-introduce-a-multithreaded-command-st.patch b/patches/wined3d-CSMT_Main/0029-wined3d-Hackily-introduce-a-multithreaded-command-st.patch index badfe442..a09b8039 100644 --- a/patches/wined3d-CSMT_Main/0029-wined3d-Hackily-introduce-a-multithreaded-command-st.patch +++ b/patches/wined3d-CSMT_Main/0029-wined3d-Hackily-introduce-a-multithreaded-command-st.patch @@ -1,15 +1,15 @@ -From b46cefd599a66804a8b90997af54d69c435515b1 Mon Sep 17 00:00:00 2001 +From 05bcda7023f9521f4c4e29b8714b04815030059b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stefan=20D=C3=B6singer?= Date: Tue, 1 Oct 2013 14:31:56 +0200 Subject: wined3d: Hackily introduce a multithreaded command stream --- dlls/wined3d/context.c | 3 + - dlls/wined3d/cs.c | 437 +++++++++++++++++++++++++++++++++++------ + dlls/wined3d/cs.c | 433 +++++++++++++++++++++++++++++++++++------ dlls/wined3d/device.c | 2 +- dlls/wined3d/wined3d_main.c | 10 + dlls/wined3d/wined3d_private.h | 33 +++- - 5 files changed, 423 insertions(+), 62 deletions(-) + 5 files changed, 420 insertions(+), 61 deletions(-) diff --git a/dlls/wined3d/context.c b/dlls/wined3d/context.c index 598622d3e7..41a332f19a 100644 @@ -26,7 +26,7 @@ index 598622d3e7..41a332f19a 100644 current_context = NULL; diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c -index eb82d40e8f..e183a730ed 100644 +index b6bc0e6b84..a9a5d42ac0 100644 --- a/dlls/wined3d/cs.c +++ b/dlls/wined3d/cs.c @@ -18,6 +18,7 @@ @@ -37,15 +37,15 @@ index eb82d40e8f..e183a730ed 100644 #include "wined3d_private.h" WINE_DEFAULT_DEBUG_CHANNEL(d3d); -@@ -71,6 +72,7 @@ enum wined3d_cs_op +@@ -70,6 +71,7 @@ enum wined3d_cs_op + WINED3D_CS_OP_UPDATE_SUB_RESOURCE, WINED3D_CS_OP_ADD_DIRTY_TEXTURE_REGION, WINED3D_CS_OP_PUSH_CONSTANTS, - WINED3D_CS_OP_UPDATE_SWAP_INTERVAL, + WINED3D_CS_OP_STOP, }; struct wined3d_cs_sync -@@ -96,6 +98,7 @@ struct wined3d_cs_present +@@ -95,6 +97,7 @@ struct wined3d_cs_present struct wined3d_cs_clear { enum wined3d_cs_op opcode; @@ -53,8 +53,8 @@ index eb82d40e8f..e183a730ed 100644 DWORD flags; unsigned int rt_count; struct wined3d_fb_state *fb; -@@ -418,8 +421,14 @@ struct wined3d_cs_update_swap_interval - struct wined3d_swapchain *swapchain; +@@ -411,8 +414,14 @@ struct wined3d_cs_push_constants + BYTE constants[1]; }; -static void wined3d_cs_exec_sync(struct wined3d_cs *cs, const void *data) @@ -69,7 +69,7 @@ index eb82d40e8f..e183a730ed 100644 } void wined3d_cs_emit_sync(struct wined3d_cs *cs) -@@ -432,12 +441,14 @@ void wined3d_cs_emit_sync(struct wined3d_cs *cs) +@@ -425,12 +434,14 @@ void wined3d_cs_emit_sync(struct wined3d_cs *cs) cs->ops->submit_and_wait(cs); } @@ -85,7 +85,7 @@ index eb82d40e8f..e183a730ed 100644 } void wined3d_cs_emit_glfinish(struct wined3d_cs *cs) -@@ -450,7 +461,7 @@ void wined3d_cs_emit_glfinish(struct wined3d_cs *cs) +@@ -443,7 +454,7 @@ void wined3d_cs_emit_glfinish(struct wined3d_cs *cs) cs->ops->submit_and_wait(cs); } @@ -94,7 +94,7 @@ index eb82d40e8f..e183a730ed 100644 { const struct wined3d_cs_present *op = data; struct wined3d_swapchain *swapchain; -@@ -468,6 +479,8 @@ static void wined3d_cs_exec_present(struct wined3d_cs *cs, const void *data) +@@ -461,6 +472,8 @@ static void wined3d_cs_exec_present(struct wined3d_cs *cs, const void *data) { wined3d_resource_release(&swapchain->back_buffers[i]->resource); } @@ -103,7 +103,7 @@ index eb82d40e8f..e183a730ed 100644 } void wined3d_cs_emit_present(struct wined3d_cs *cs, struct wined3d_swapchain *swapchain, -@@ -507,7 +520,7 @@ void wined3d_cs_emit_present(struct wined3d_cs *cs, struct wined3d_swapchain *sw +@@ -500,7 +513,7 @@ void wined3d_cs_emit_present(struct wined3d_cs *cs, struct wined3d_swapchain *sw pending = InterlockedCompareExchange(&cs->pending_presents, 0, 0); } @@ -112,7 +112,7 @@ index eb82d40e8f..e183a730ed 100644 { const struct wined3d_state *state = &cs->state; const struct wined3d_cs_clear *op = data; -@@ -530,6 +543,8 @@ static void wined3d_cs_exec_clear(struct wined3d_cs *cs, const void *data) +@@ -523,6 +536,8 @@ static void wined3d_cs_exec_clear(struct wined3d_cs *cs, const void *data) } if (op->flags & (WINED3DCLEAR_ZBUFFER | WINED3DCLEAR_STENCIL)) wined3d_resource_release(op->fb->depth_stencil->resource); @@ -121,7 +121,7 @@ index eb82d40e8f..e183a730ed 100644 } void wined3d_cs_emit_clear(struct wined3d_cs *cs, DWORD rect_count, const RECT *rects, -@@ -538,10 +553,12 @@ void wined3d_cs_emit_clear(struct wined3d_cs *cs, DWORD rect_count, const RECT * +@@ -531,10 +546,12 @@ void wined3d_cs_emit_clear(struct wined3d_cs *cs, DWORD rect_count, const RECT * unsigned int rt_count = cs->device->adapter->gl_info.limits.buffers; const struct wined3d_state *state = &cs->device->state; struct wined3d_cs_clear *op; @@ -135,7 +135,7 @@ index eb82d40e8f..e183a730ed 100644 op->flags = flags; op->rt_count = rt_count; op->fb = &cs->fb; -@@ -575,13 +592,15 @@ void wined3d_cs_emit_clear_rendertarget_view(struct wined3d_cs *cs, struct wined +@@ -568,13 +585,15 @@ void wined3d_cs_emit_clear_rendertarget_view(struct wined3d_cs *cs, struct wined struct wined3d_rendertarget_view *rt; struct wined3d_fb_state fb; } *extra; @@ -152,7 +152,7 @@ index eb82d40e8f..e183a730ed 100644 op->flags = flags; if (flags & WINED3DCLEAR_TARGET) { -@@ -713,7 +732,7 @@ static void release_unordered_access_resources(const struct wined3d_shader *shad +@@ -706,7 +725,7 @@ static void release_unordered_access_resources(const struct wined3d_shader *shad } } @@ -161,7 +161,7 @@ index eb82d40e8f..e183a730ed 100644 { const struct wined3d_cs_dispatch *op = data; struct wined3d_state *state = &cs->state; -@@ -724,6 +743,8 @@ static void wined3d_cs_exec_dispatch(struct wined3d_cs *cs, const void *data) +@@ -717,6 +736,8 @@ static void wined3d_cs_exec_dispatch(struct wined3d_cs *cs, const void *data) release_shader_resources(state, 1u << WINED3D_SHADER_TYPE_COMPUTE); release_unordered_access_resources(state->shader[WINED3D_SHADER_TYPE_COMPUTE], state->unordered_access_view[WINED3D_PIPELINE_COMPUTE]); @@ -170,7 +170,7 @@ index eb82d40e8f..e183a730ed 100644 } void wined3d_cs_emit_dispatch(struct wined3d_cs *cs, -@@ -745,7 +766,7 @@ void wined3d_cs_emit_dispatch(struct wined3d_cs *cs, +@@ -738,7 +759,7 @@ void wined3d_cs_emit_dispatch(struct wined3d_cs *cs, cs->ops->submit(cs); } @@ -179,7 +179,7 @@ index eb82d40e8f..e183a730ed 100644 { struct wined3d_state *state = &cs->state; const struct wined3d_cs_draw *op = data; -@@ -795,6 +816,8 @@ static void wined3d_cs_exec_draw(struct wined3d_cs *cs, const void *data) +@@ -788,6 +809,8 @@ static void wined3d_cs_exec_draw(struct wined3d_cs *cs, const void *data) release_shader_resources(state, ~(1u << WINED3D_SHADER_TYPE_COMPUTE)); release_unordered_access_resources(state->shader[WINED3D_SHADER_TYPE_PIXEL], state->unordered_access_view[WINED3D_PIPELINE_GRAPHICS]); @@ -188,7 +188,7 @@ index eb82d40e8f..e183a730ed 100644 } void wined3d_cs_emit_draw(struct wined3d_cs *cs, GLenum primitive_type, int base_vertex_idx, unsigned int start_idx, -@@ -845,12 +868,14 @@ void wined3d_cs_emit_draw(struct wined3d_cs *cs, GLenum primitive_type, int base +@@ -838,12 +861,14 @@ void wined3d_cs_emit_draw(struct wined3d_cs *cs, GLenum primitive_type, int base cs->ops->submit(cs); } @@ -204,7 +204,7 @@ index eb82d40e8f..e183a730ed 100644 } void wined3d_cs_emit_set_predication(struct wined3d_cs *cs, struct wined3d_query *predicate, BOOL value) -@@ -865,12 +890,14 @@ void wined3d_cs_emit_set_predication(struct wined3d_cs *cs, struct wined3d_query +@@ -858,12 +883,14 @@ void wined3d_cs_emit_set_predication(struct wined3d_cs *cs, struct wined3d_query cs->ops->submit(cs); } @@ -220,7 +220,7 @@ index eb82d40e8f..e183a730ed 100644 } void wined3d_cs_emit_set_viewport(struct wined3d_cs *cs, const struct wined3d_viewport *viewport) -@@ -884,12 +911,14 @@ void wined3d_cs_emit_set_viewport(struct wined3d_cs *cs, const struct wined3d_vi +@@ -877,12 +904,14 @@ void wined3d_cs_emit_set_viewport(struct wined3d_cs *cs, const struct wined3d_vi cs->ops->submit(cs); } @@ -236,7 +236,7 @@ index eb82d40e8f..e183a730ed 100644 } void wined3d_cs_emit_set_scissor_rect(struct wined3d_cs *cs, const RECT *rect) -@@ -903,12 +932,14 @@ void wined3d_cs_emit_set_scissor_rect(struct wined3d_cs *cs, const RECT *rect) +@@ -896,12 +925,14 @@ void wined3d_cs_emit_set_scissor_rect(struct wined3d_cs *cs, const RECT *rect) cs->ops->submit(cs); } @@ -252,7 +252,7 @@ index eb82d40e8f..e183a730ed 100644 } void wined3d_cs_emit_set_rendertarget_view(struct wined3d_cs *cs, unsigned int view_idx, -@@ -924,7 +955,7 @@ void wined3d_cs_emit_set_rendertarget_view(struct wined3d_cs *cs, unsigned int v +@@ -917,7 +948,7 @@ void wined3d_cs_emit_set_rendertarget_view(struct wined3d_cs *cs, unsigned int v cs->ops->submit(cs); } @@ -261,7 +261,7 @@ index eb82d40e8f..e183a730ed 100644 { const struct wined3d_cs_set_depth_stencil_view *op = data; struct wined3d_device *device = cs->device; -@@ -959,6 +990,8 @@ static void wined3d_cs_exec_set_depth_stencil_view(struct wined3d_cs *cs, const +@@ -952,6 +983,8 @@ static void wined3d_cs_exec_set_depth_stencil_view(struct wined3d_cs *cs, const } device_invalidate_state(device, STATE_FRAMEBUFFER); @@ -270,7 +270,7 @@ index eb82d40e8f..e183a730ed 100644 } void wined3d_cs_emit_set_depth_stencil_view(struct wined3d_cs *cs, struct wined3d_rendertarget_view *view) -@@ -972,12 +1005,14 @@ void wined3d_cs_emit_set_depth_stencil_view(struct wined3d_cs *cs, struct wined3 +@@ -965,12 +998,14 @@ void wined3d_cs_emit_set_depth_stencil_view(struct wined3d_cs *cs, struct wined3 cs->ops->submit(cs); } @@ -286,7 +286,7 @@ index eb82d40e8f..e183a730ed 100644 } void wined3d_cs_emit_set_vertex_declaration(struct wined3d_cs *cs, struct wined3d_vertex_declaration *declaration) -@@ -991,7 +1026,7 @@ void wined3d_cs_emit_set_vertex_declaration(struct wined3d_cs *cs, struct wined3 +@@ -984,7 +1019,7 @@ void wined3d_cs_emit_set_vertex_declaration(struct wined3d_cs *cs, struct wined3 cs->ops->submit(cs); } @@ -295,7 +295,7 @@ index eb82d40e8f..e183a730ed 100644 { const struct wined3d_cs_set_stream_source *op = data; struct wined3d_stream_state *stream; -@@ -1009,6 +1044,8 @@ static void wined3d_cs_exec_set_stream_source(struct wined3d_cs *cs, const void +@@ -1002,6 +1037,8 @@ static void wined3d_cs_exec_set_stream_source(struct wined3d_cs *cs, const void InterlockedDecrement(&prev->resource.bind_count); device_invalidate_state(cs->device, STATE_STREAMSRC); @@ -304,7 +304,7 @@ index eb82d40e8f..e183a730ed 100644 } void wined3d_cs_emit_set_stream_source(struct wined3d_cs *cs, UINT stream_idx, -@@ -1026,7 +1063,7 @@ void wined3d_cs_emit_set_stream_source(struct wined3d_cs *cs, UINT stream_idx, +@@ -1019,7 +1056,7 @@ void wined3d_cs_emit_set_stream_source(struct wined3d_cs *cs, UINT stream_idx, cs->ops->submit(cs); } @@ -313,7 +313,7 @@ index eb82d40e8f..e183a730ed 100644 { const struct wined3d_cs_set_stream_source_freq *op = data; struct wined3d_stream_state *stream; -@@ -1036,6 +1073,8 @@ static void wined3d_cs_exec_set_stream_source_freq(struct wined3d_cs *cs, const +@@ -1029,6 +1066,8 @@ static void wined3d_cs_exec_set_stream_source_freq(struct wined3d_cs *cs, const stream->flags = op->flags; device_invalidate_state(cs->device, STATE_STREAMSRC); @@ -322,7 +322,7 @@ index eb82d40e8f..e183a730ed 100644 } void wined3d_cs_emit_set_stream_source_freq(struct wined3d_cs *cs, UINT stream_idx, UINT frequency, UINT flags) -@@ -1051,7 +1090,7 @@ void wined3d_cs_emit_set_stream_source_freq(struct wined3d_cs *cs, UINT stream_i +@@ -1044,7 +1083,7 @@ void wined3d_cs_emit_set_stream_source_freq(struct wined3d_cs *cs, UINT stream_i cs->ops->submit(cs); } @@ -331,7 +331,7 @@ index eb82d40e8f..e183a730ed 100644 { const struct wined3d_cs_set_stream_output *op = data; struct wined3d_stream_output *stream; -@@ -1068,6 +1107,8 @@ static void wined3d_cs_exec_set_stream_output(struct wined3d_cs *cs, const void +@@ -1061,6 +1100,8 @@ static void wined3d_cs_exec_set_stream_output(struct wined3d_cs *cs, const void InterlockedDecrement(&prev->resource.bind_count); device_invalidate_state(cs->device, STATE_STREAM_OUTPUT); @@ -340,7 +340,7 @@ index eb82d40e8f..e183a730ed 100644 } void wined3d_cs_emit_set_stream_output(struct wined3d_cs *cs, UINT stream_idx, -@@ -1084,7 +1125,7 @@ void wined3d_cs_emit_set_stream_output(struct wined3d_cs *cs, UINT stream_idx, +@@ -1077,7 +1118,7 @@ void wined3d_cs_emit_set_stream_output(struct wined3d_cs *cs, UINT stream_idx, cs->ops->submit(cs); } @@ -349,7 +349,7 @@ index eb82d40e8f..e183a730ed 100644 { const struct wined3d_cs_set_index_buffer *op = data; struct wined3d_buffer *prev; -@@ -1100,6 +1141,8 @@ static void wined3d_cs_exec_set_index_buffer(struct wined3d_cs *cs, const void * +@@ -1093,6 +1134,8 @@ static void wined3d_cs_exec_set_index_buffer(struct wined3d_cs *cs, const void * InterlockedDecrement(&prev->resource.bind_count); device_invalidate_state(cs->device, STATE_INDEXBUFFER); @@ -358,7 +358,7 @@ index eb82d40e8f..e183a730ed 100644 } void wined3d_cs_emit_set_index_buffer(struct wined3d_cs *cs, struct wined3d_buffer *buffer, -@@ -1116,7 +1159,7 @@ void wined3d_cs_emit_set_index_buffer(struct wined3d_cs *cs, struct wined3d_buff +@@ -1109,7 +1152,7 @@ void wined3d_cs_emit_set_index_buffer(struct wined3d_cs *cs, struct wined3d_buff cs->ops->submit(cs); } @@ -367,7 +367,7 @@ index eb82d40e8f..e183a730ed 100644 { const struct wined3d_cs_set_constant_buffer *op = data; struct wined3d_buffer *prev; -@@ -1130,6 +1173,7 @@ static void wined3d_cs_exec_set_constant_buffer(struct wined3d_cs *cs, const voi +@@ -1123,6 +1166,7 @@ static void wined3d_cs_exec_set_constant_buffer(struct wined3d_cs *cs, const voi InterlockedDecrement(&prev->resource.bind_count); device_invalidate_state(cs->device, STATE_CONSTANT_BUFFER(op->type)); @@ -375,7 +375,7 @@ index eb82d40e8f..e183a730ed 100644 } void wined3d_cs_emit_set_constant_buffer(struct wined3d_cs *cs, enum wined3d_shader_type type, -@@ -1146,7 +1190,7 @@ void wined3d_cs_emit_set_constant_buffer(struct wined3d_cs *cs, enum wined3d_sha +@@ -1139,7 +1183,7 @@ void wined3d_cs_emit_set_constant_buffer(struct wined3d_cs *cs, enum wined3d_sha cs->ops->submit(cs); } @@ -384,7 +384,7 @@ index eb82d40e8f..e183a730ed 100644 { const struct wined3d_gl_info *gl_info = &cs->device->adapter->gl_info; const struct wined3d_d3d_info *d3d_info = &cs->device->adapter->d3d_info; -@@ -1223,6 +1267,8 @@ static void wined3d_cs_exec_set_texture(struct wined3d_cs *cs, const void *data) +@@ -1216,6 +1260,8 @@ static void wined3d_cs_exec_set_texture(struct wined3d_cs *cs, const void *data) if (new_use_color_key) device_invalidate_state(cs->device, STATE_COLOR_KEY); @@ -393,7 +393,7 @@ index eb82d40e8f..e183a730ed 100644 } void wined3d_cs_emit_set_texture(struct wined3d_cs *cs, UINT stage, struct wined3d_texture *texture) -@@ -1237,7 +1283,7 @@ void wined3d_cs_emit_set_texture(struct wined3d_cs *cs, UINT stage, struct wined +@@ -1230,7 +1276,7 @@ void wined3d_cs_emit_set_texture(struct wined3d_cs *cs, UINT stage, struct wined cs->ops->submit(cs); } @@ -402,7 +402,7 @@ index eb82d40e8f..e183a730ed 100644 { const struct wined3d_cs_set_shader_resource_view *op = data; struct wined3d_shader_resource_view *prev; -@@ -1254,6 +1300,8 @@ static void wined3d_cs_exec_set_shader_resource_view(struct wined3d_cs *cs, cons +@@ -1247,6 +1293,8 @@ static void wined3d_cs_exec_set_shader_resource_view(struct wined3d_cs *cs, cons device_invalidate_state(cs->device, STATE_GRAPHICS_SHADER_RESOURCE_BINDING); else device_invalidate_state(cs->device, STATE_COMPUTE_SHADER_RESOURCE_BINDING); @@ -411,7 +411,7 @@ index eb82d40e8f..e183a730ed 100644 } void wined3d_cs_emit_set_shader_resource_view(struct wined3d_cs *cs, enum wined3d_shader_type type, -@@ -1270,7 +1318,7 @@ void wined3d_cs_emit_set_shader_resource_view(struct wined3d_cs *cs, enum wined3 +@@ -1263,7 +1311,7 @@ void wined3d_cs_emit_set_shader_resource_view(struct wined3d_cs *cs, enum wined3 cs->ops->submit(cs); } @@ -420,7 +420,7 @@ index eb82d40e8f..e183a730ed 100644 { const struct wined3d_cs_set_unordered_access_view *op = data; struct wined3d_unordered_access_view *prev; -@@ -1284,6 +1332,8 @@ static void wined3d_cs_exec_set_unordered_access_view(struct wined3d_cs *cs, con +@@ -1277,6 +1325,8 @@ static void wined3d_cs_exec_set_unordered_access_view(struct wined3d_cs *cs, con InterlockedDecrement(&prev->resource->bind_count); device_invalidate_state(cs->device, STATE_UNORDERED_ACCESS_VIEW_BINDING(op->pipeline)); @@ -429,7 +429,7 @@ index eb82d40e8f..e183a730ed 100644 } void wined3d_cs_emit_set_unordered_access_view(struct wined3d_cs *cs, enum wined3d_pipeline pipeline, -@@ -1300,7 +1350,7 @@ void wined3d_cs_emit_set_unordered_access_view(struct wined3d_cs *cs, enum wined +@@ -1293,7 +1343,7 @@ void wined3d_cs_emit_set_unordered_access_view(struct wined3d_cs *cs, enum wined cs->ops->submit(cs); } @@ -438,7 +438,7 @@ index eb82d40e8f..e183a730ed 100644 { const struct wined3d_cs_set_sampler *op = data; -@@ -1309,6 +1359,8 @@ static void wined3d_cs_exec_set_sampler(struct wined3d_cs *cs, const void *data) +@@ -1302,6 +1352,8 @@ static void wined3d_cs_exec_set_sampler(struct wined3d_cs *cs, const void *data) device_invalidate_state(cs->device, STATE_GRAPHICS_SHADER_RESOURCE_BINDING); else device_invalidate_state(cs->device, STATE_COMPUTE_SHADER_RESOURCE_BINDING); @@ -447,7 +447,7 @@ index eb82d40e8f..e183a730ed 100644 } void wined3d_cs_emit_set_sampler(struct wined3d_cs *cs, enum wined3d_shader_type type, -@@ -1325,7 +1377,7 @@ void wined3d_cs_emit_set_sampler(struct wined3d_cs *cs, enum wined3d_shader_type +@@ -1318,7 +1370,7 @@ void wined3d_cs_emit_set_sampler(struct wined3d_cs *cs, enum wined3d_shader_type cs->ops->submit(cs); } @@ -456,7 +456,7 @@ index eb82d40e8f..e183a730ed 100644 { const struct wined3d_cs_set_shader *op = data; -@@ -1335,6 +1387,8 @@ static void wined3d_cs_exec_set_shader(struct wined3d_cs *cs, const void *data) +@@ -1328,6 +1380,8 @@ static void wined3d_cs_exec_set_shader(struct wined3d_cs *cs, const void *data) device_invalidate_state(cs->device, STATE_GRAPHICS_SHADER_RESOURCE_BINDING); else device_invalidate_state(cs->device, STATE_COMPUTE_SHADER_RESOURCE_BINDING); @@ -465,7 +465,7 @@ index eb82d40e8f..e183a730ed 100644 } void wined3d_cs_emit_set_shader(struct wined3d_cs *cs, enum wined3d_shader_type type, struct wined3d_shader *shader) -@@ -1349,12 +1403,14 @@ void wined3d_cs_emit_set_shader(struct wined3d_cs *cs, enum wined3d_shader_type +@@ -1342,12 +1396,14 @@ void wined3d_cs_emit_set_shader(struct wined3d_cs *cs, enum wined3d_shader_type cs->ops->submit(cs); } @@ -481,7 +481,7 @@ index eb82d40e8f..e183a730ed 100644 } void wined3d_cs_emit_set_rasterizer_state(struct wined3d_cs *cs, -@@ -1369,12 +1425,14 @@ void wined3d_cs_emit_set_rasterizer_state(struct wined3d_cs *cs, +@@ -1362,12 +1418,14 @@ void wined3d_cs_emit_set_rasterizer_state(struct wined3d_cs *cs, cs->ops->submit(cs); } @@ -497,7 +497,7 @@ index eb82d40e8f..e183a730ed 100644 } void wined3d_cs_emit_set_render_state(struct wined3d_cs *cs, enum wined3d_render_state state, DWORD value) -@@ -1389,12 +1447,14 @@ void wined3d_cs_emit_set_render_state(struct wined3d_cs *cs, enum wined3d_render +@@ -1382,12 +1440,14 @@ void wined3d_cs_emit_set_render_state(struct wined3d_cs *cs, enum wined3d_render cs->ops->submit(cs); } @@ -513,7 +513,7 @@ index eb82d40e8f..e183a730ed 100644 } void wined3d_cs_emit_set_texture_state(struct wined3d_cs *cs, UINT stage, -@@ -1411,12 +1471,14 @@ void wined3d_cs_emit_set_texture_state(struct wined3d_cs *cs, UINT stage, +@@ -1404,12 +1464,14 @@ void wined3d_cs_emit_set_texture_state(struct wined3d_cs *cs, UINT stage, cs->ops->submit(cs); } @@ -529,7 +529,7 @@ index eb82d40e8f..e183a730ed 100644 } void wined3d_cs_emit_set_sampler_state(struct wined3d_cs *cs, UINT sampler_idx, -@@ -1433,13 +1495,15 @@ void wined3d_cs_emit_set_sampler_state(struct wined3d_cs *cs, UINT sampler_idx, +@@ -1426,13 +1488,15 @@ void wined3d_cs_emit_set_sampler_state(struct wined3d_cs *cs, UINT sampler_idx, cs->ops->submit(cs); } @@ -546,7 +546,7 @@ index eb82d40e8f..e183a730ed 100644 } void wined3d_cs_emit_set_transform(struct wined3d_cs *cs, enum wined3d_transform_state state, -@@ -1455,12 +1519,14 @@ void wined3d_cs_emit_set_transform(struct wined3d_cs *cs, enum wined3d_transform +@@ -1448,12 +1512,14 @@ void wined3d_cs_emit_set_transform(struct wined3d_cs *cs, enum wined3d_transform cs->ops->submit(cs); } @@ -562,7 +562,7 @@ index eb82d40e8f..e183a730ed 100644 } void wined3d_cs_emit_set_clip_plane(struct wined3d_cs *cs, UINT plane_idx, const struct wined3d_vec4 *plane) -@@ -1475,7 +1541,7 @@ void wined3d_cs_emit_set_clip_plane(struct wined3d_cs *cs, UINT plane_idx, const +@@ -1468,7 +1534,7 @@ void wined3d_cs_emit_set_clip_plane(struct wined3d_cs *cs, UINT plane_idx, const cs->ops->submit(cs); } @@ -571,7 +571,7 @@ index eb82d40e8f..e183a730ed 100644 { const struct wined3d_cs_set_color_key *op = data; struct wined3d_texture *texture = op->texture; -@@ -1536,6 +1602,8 @@ static void wined3d_cs_exec_set_color_key(struct wined3d_cs *cs, const void *dat +@@ -1529,6 +1595,8 @@ static void wined3d_cs_exec_set_color_key(struct wined3d_cs *cs, const void *dat break; } } @@ -580,7 +580,7 @@ index eb82d40e8f..e183a730ed 100644 } void wined3d_cs_emit_set_color_key(struct wined3d_cs *cs, struct wined3d_texture *texture, -@@ -1558,12 +1626,14 @@ void wined3d_cs_emit_set_color_key(struct wined3d_cs *cs, struct wined3d_texture +@@ -1551,12 +1619,14 @@ void wined3d_cs_emit_set_color_key(struct wined3d_cs *cs, struct wined3d_texture cs->ops->submit(cs); } @@ -596,7 +596,7 @@ index eb82d40e8f..e183a730ed 100644 } void wined3d_cs_emit_set_material(struct wined3d_cs *cs, const struct wined3d_material *material) -@@ -1577,7 +1647,7 @@ void wined3d_cs_emit_set_material(struct wined3d_cs *cs, const struct wined3d_ma +@@ -1570,7 +1640,7 @@ void wined3d_cs_emit_set_material(struct wined3d_cs *cs, const struct wined3d_ma cs->ops->submit(cs); } @@ -605,7 +605,7 @@ index eb82d40e8f..e183a730ed 100644 { const struct wined3d_cs_set_light *op = data; struct wined3d_light_info *light_info; -@@ -1591,7 +1661,7 @@ static void wined3d_cs_exec_set_light(struct wined3d_cs *cs, const void *data) +@@ -1584,7 +1654,7 @@ static void wined3d_cs_exec_set_light(struct wined3d_cs *cs, const void *data) if (!(light_info = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(*light_info)))) { ERR("Failed to allocate light info.\n"); @@ -614,7 +614,7 @@ index eb82d40e8f..e183a730ed 100644 } hash_idx = LIGHTMAP_HASHFUNC(light_idx); -@@ -1612,6 +1682,8 @@ static void wined3d_cs_exec_set_light(struct wined3d_cs *cs, const void *data) +@@ -1605,6 +1675,8 @@ static void wined3d_cs_exec_set_light(struct wined3d_cs *cs, const void *data) light_info->direction = op->light.direction; light_info->exponent = op->light.exponent; light_info->cutoff = op->light.cutoff; @@ -623,7 +623,7 @@ index eb82d40e8f..e183a730ed 100644 } void wined3d_cs_emit_set_light(struct wined3d_cs *cs, const struct wined3d_light_info *light) -@@ -1625,7 +1697,7 @@ void wined3d_cs_emit_set_light(struct wined3d_cs *cs, const struct wined3d_light +@@ -1618,7 +1690,7 @@ void wined3d_cs_emit_set_light(struct wined3d_cs *cs, const struct wined3d_light cs->ops->submit(cs); } @@ -632,7 +632,7 @@ index eb82d40e8f..e183a730ed 100644 { const struct wined3d_cs_set_light_enable *op = data; struct wined3d_device *device = cs->device; -@@ -1635,7 +1707,7 @@ static void wined3d_cs_exec_set_light_enable(struct wined3d_cs *cs, const void * +@@ -1628,7 +1700,7 @@ static void wined3d_cs_exec_set_light_enable(struct wined3d_cs *cs, const void * if (!(light_info = wined3d_state_get_light(&cs->state, op->idx))) { ERR("Light doesn't exist.\n"); @@ -641,7 +641,7 @@ index eb82d40e8f..e183a730ed 100644 } prev_idx = light_info->glIndex; -@@ -1645,6 +1717,8 @@ static void wined3d_cs_exec_set_light_enable(struct wined3d_cs *cs, const void * +@@ -1638,6 +1710,8 @@ static void wined3d_cs_exec_set_light_enable(struct wined3d_cs *cs, const void * device_invalidate_state(device, STATE_LIGHT_TYPE); device_invalidate_state(device, STATE_ACTIVELIGHT(op->enable ? light_info->glIndex : prev_idx)); } @@ -650,7 +650,7 @@ index eb82d40e8f..e183a730ed 100644 } void wined3d_cs_emit_set_light_enable(struct wined3d_cs *cs, unsigned int idx, BOOL enable) -@@ -1659,7 +1733,7 @@ void wined3d_cs_emit_set_light_enable(struct wined3d_cs *cs, unsigned int idx, B +@@ -1652,7 +1726,7 @@ void wined3d_cs_emit_set_light_enable(struct wined3d_cs *cs, unsigned int idx, B cs->ops->submit(cs); } @@ -659,7 +659,7 @@ index eb82d40e8f..e183a730ed 100644 { struct wined3d_adapter *adapter = cs->device->adapter; -@@ -1667,6 +1741,8 @@ static void wined3d_cs_exec_reset_state(struct wined3d_cs *cs, const void *data) +@@ -1660,6 +1734,8 @@ static void wined3d_cs_exec_reset_state(struct wined3d_cs *cs, const void *data) memset(&cs->state, 0, sizeof(cs->state)); state_init(&cs->state, &cs->fb, &adapter->gl_info, &adapter->d3d_info, WINED3D_STATE_NO_REF | WINED3D_STATE_INIT_DEFAULT); @@ -668,7 +668,7 @@ index eb82d40e8f..e183a730ed 100644 } void wined3d_cs_emit_reset_state(struct wined3d_cs *cs) -@@ -1679,11 +1755,13 @@ void wined3d_cs_emit_reset_state(struct wined3d_cs *cs) +@@ -1672,11 +1748,13 @@ void wined3d_cs_emit_reset_state(struct wined3d_cs *cs) cs->ops->submit(cs); } @@ -683,7 +683,7 @@ index eb82d40e8f..e183a730ed 100644 } static void wined3d_cs_emit_callback(struct wined3d_cs *cs, void (*callback)(void *object), void *object) -@@ -1708,12 +1786,14 @@ void wined3d_cs_init_object(struct wined3d_cs *cs, void (*callback)(void *object +@@ -1701,12 +1779,14 @@ void wined3d_cs_init_object(struct wined3d_cs *cs, void (*callback)(void *object wined3d_cs_emit_callback(cs, callback, object); } @@ -699,7 +699,7 @@ index eb82d40e8f..e183a730ed 100644 } void wined3d_cs_emit_query_issue(struct wined3d_cs *cs, struct wined3d_query *query, DWORD flags) -@@ -1728,12 +1808,14 @@ void wined3d_cs_emit_query_issue(struct wined3d_cs *cs, struct wined3d_query *qu +@@ -1721,12 +1801,14 @@ void wined3d_cs_emit_query_issue(struct wined3d_cs *cs, struct wined3d_query *qu cs->ops->submit(cs); } @@ -715,7 +715,7 @@ index eb82d40e8f..e183a730ed 100644 } BOOL wined3d_cs_emit_query_poll(struct wined3d_cs *cs, struct wined3d_query *query, DWORD flags) -@@ -1752,13 +1834,15 @@ BOOL wined3d_cs_emit_query_poll(struct wined3d_cs *cs, struct wined3d_query *que +@@ -1745,13 +1827,15 @@ BOOL wined3d_cs_emit_query_poll(struct wined3d_cs *cs, struct wined3d_query *que return ret; } @@ -732,7 +732,7 @@ index eb82d40e8f..e183a730ed 100644 } void wined3d_cs_emit_preload_resource(struct wined3d_cs *cs, struct wined3d_resource *resource) -@@ -1774,13 +1858,15 @@ void wined3d_cs_emit_preload_resource(struct wined3d_cs *cs, struct wined3d_reso +@@ -1767,13 +1851,15 @@ void wined3d_cs_emit_preload_resource(struct wined3d_cs *cs, struct wined3d_reso cs->ops->submit(cs); } @@ -749,7 +749,7 @@ index eb82d40e8f..e183a730ed 100644 } void wined3d_cs_emit_unload_resource(struct wined3d_cs *cs, struct wined3d_resource *resource) -@@ -1796,13 +1882,15 @@ void wined3d_cs_emit_unload_resource(struct wined3d_cs *cs, struct wined3d_resou +@@ -1789,13 +1875,15 @@ void wined3d_cs_emit_unload_resource(struct wined3d_cs *cs, struct wined3d_resou cs->ops->submit(cs); } @@ -766,7 +766,7 @@ index eb82d40e8f..e183a730ed 100644 } HRESULT wined3d_cs_map(struct wined3d_cs *cs, struct wined3d_resource *resource, unsigned int sub_resource_idx, -@@ -1825,12 +1913,14 @@ HRESULT wined3d_cs_map(struct wined3d_cs *cs, struct wined3d_resource *resource, +@@ -1818,12 +1906,14 @@ HRESULT wined3d_cs_map(struct wined3d_cs *cs, struct wined3d_resource *resource, return hr; } @@ -782,7 +782,7 @@ index eb82d40e8f..e183a730ed 100644 } HRESULT wined3d_cs_unmap(struct wined3d_cs *cs, struct wined3d_resource *resource, unsigned int sub_resource_idx) -@@ -1849,7 +1939,7 @@ HRESULT wined3d_cs_unmap(struct wined3d_cs *cs, struct wined3d_resource *resourc +@@ -1842,7 +1932,7 @@ HRESULT wined3d_cs_unmap(struct wined3d_cs *cs, struct wined3d_resource *resourc return hr; } @@ -791,7 +791,7 @@ index eb82d40e8f..e183a730ed 100644 { const struct wined3d_cs_blt_sub_resource *op = data; -@@ -1889,14 +1979,14 @@ static void wined3d_cs_exec_blt_sub_resource(struct wined3d_cs *cs, const void * +@@ -1882,14 +1972,14 @@ static void wined3d_cs_exec_blt_sub_resource(struct wined3d_cs *cs, const void * { FIXME("Flags %#x not implemented for %s resources.\n", op->flags, debug_d3dresourcetype(op->dst_resource->type)); @@ -808,7 +808,7 @@ index eb82d40e8f..e183a730ed 100644 } update_w = op->dst_box.right - op->dst_box.left; -@@ -1908,14 +1998,14 @@ static void wined3d_cs_exec_blt_sub_resource(struct wined3d_cs *cs, const void * +@@ -1901,14 +1991,14 @@ static void wined3d_cs_exec_blt_sub_resource(struct wined3d_cs *cs, const void * { FIXME("Stretching not implemented for %s resources.\n", debug_d3dresourcetype(op->dst_resource->type)); @@ -825,7 +825,7 @@ index eb82d40e8f..e183a730ed 100644 } dst_texture = texture_from_resource(op->dst_resource); -@@ -1929,7 +2019,7 @@ static void wined3d_cs_exec_blt_sub_resource(struct wined3d_cs *cs, const void * +@@ -1922,7 +2012,7 @@ static void wined3d_cs_exec_blt_sub_resource(struct wined3d_cs *cs, const void * ERR("Failed to load source sub-resource into %s.\n", wined3d_debug_location(src_texture->resource.map_binding)); context_release(context); @@ -834,7 +834,7 @@ index eb82d40e8f..e183a730ed 100644 } level = op->dst_sub_resource_idx % dst_texture->level_count; -@@ -1944,7 +2034,7 @@ static void wined3d_cs_exec_blt_sub_resource(struct wined3d_cs *cs, const void * +@@ -1937,7 +2027,7 @@ static void wined3d_cs_exec_blt_sub_resource(struct wined3d_cs *cs, const void * { ERR("Failed to load destination sub-resource.\n"); context_release(context); @@ -843,7 +843,7 @@ index eb82d40e8f..e183a730ed 100644 } wined3d_texture_get_memory(src_texture, op->src_sub_resource_idx, &addr, src_texture->resource.map_binding); -@@ -1964,9 +2054,12 @@ static void wined3d_cs_exec_blt_sub_resource(struct wined3d_cs *cs, const void * +@@ -1957,9 +2047,12 @@ static void wined3d_cs_exec_blt_sub_resource(struct wined3d_cs *cs, const void * FIXME("Not implemented for %s resources.\n", debug_d3dresourcetype(op->dst_resource->type)); } @@ -856,7 +856,7 @@ index eb82d40e8f..e183a730ed 100644 } void wined3d_cs_emit_blt_sub_resource(struct wined3d_cs *cs, struct wined3d_resource *dst_resource, -@@ -1996,7 +2089,7 @@ void wined3d_cs_emit_blt_sub_resource(struct wined3d_cs *cs, struct wined3d_reso +@@ -1989,7 +2082,7 @@ void wined3d_cs_emit_blt_sub_resource(struct wined3d_cs *cs, struct wined3d_reso cs->ops->submit(cs); } @@ -865,7 +865,7 @@ index eb82d40e8f..e183a730ed 100644 { const struct wined3d_cs_update_sub_resource *op = data; const struct wined3d_box *box = &op->box; -@@ -2046,6 +2139,7 @@ static void wined3d_cs_exec_update_sub_resource(struct wined3d_cs *cs, const voi +@@ -2039,6 +2132,7 @@ static void wined3d_cs_exec_update_sub_resource(struct wined3d_cs *cs, const voi done: wined3d_resource_release(op->resource); @@ -873,7 +873,7 @@ index eb82d40e8f..e183a730ed 100644 } void wined3d_cs_emit_update_sub_resource(struct wined3d_cs *cs, struct wined3d_resource *resource, -@@ -2068,7 +2162,7 @@ void wined3d_cs_emit_update_sub_resource(struct wined3d_cs *cs, struct wined3d_r +@@ -2061,7 +2155,7 @@ void wined3d_cs_emit_update_sub_resource(struct wined3d_cs *cs, struct wined3d_r cs->ops->submit_and_wait(cs); } @@ -882,7 +882,7 @@ index eb82d40e8f..e183a730ed 100644 { const struct wined3d_cs_add_dirty_texture_region *op = data; struct wined3d_texture *texture = op->texture; -@@ -2087,6 +2181,8 @@ static void wined3d_cs_exec_add_dirty_texture_region(struct wined3d_cs *cs, cons +@@ -2080,6 +2174,8 @@ static void wined3d_cs_exec_add_dirty_texture_region(struct wined3d_cs *cs, cons context_release(context); wined3d_resource_release(&texture->resource); @@ -891,7 +891,7 @@ index eb82d40e8f..e183a730ed 100644 } void wined3d_cs_emit_add_dirty_texture_region(struct wined3d_cs *cs, -@@ -2126,10 +2222,11 @@ push_constant_info[] = +@@ -2119,10 +2215,11 @@ push_constant_info[] = {FIELD_OFFSET(struct wined3d_state, ps_consts_b), sizeof(BOOL), WINED3D_SHADER_CONST_PS_B}, }; @@ -904,7 +904,7 @@ index eb82d40e8f..e183a730ed 100644 unsigned int context_count; unsigned int i; size_t offset; -@@ -2145,6 +2242,8 @@ static void wined3d_cs_exec_push_constants(struct wined3d_cs *cs, const void *da +@@ -2138,6 +2235,8 @@ static void wined3d_cs_exec_push_constants(struct wined3d_cs *cs, const void *da { device->contexts[i]->constant_update_mask |= push_constant_info[op->p].mask; } @@ -913,31 +913,16 @@ index eb82d40e8f..e183a730ed 100644 } void wined3d_cs_emit_push_constants(struct wined3d_cs *cs, enum wined3d_push_constants p, -@@ -2162,11 +2261,13 @@ void wined3d_cs_emit_push_constants(struct wined3d_cs *cs, enum wined3d_push_con +@@ -2155,7 +2254,7 @@ void wined3d_cs_emit_push_constants(struct wined3d_cs *cs, enum wined3d_push_con cs->ops->submit(cs); } --static void wined3d_cs_exec_update_swap_interval(struct wined3d_cs *cs, const void *data) -+static UINT wined3d_cs_exec_update_swap_interval(struct wined3d_cs *cs, const void *data) - { - const struct wined3d_cs_update_swap_interval *op = data; - - swapchain_update_swap_interval(op->swapchain); -+ -+ return sizeof(*op); - } - - void wined3d_cs_emit_update_swap_interval(struct wined3d_cs *cs, struct wined3d_swapchain *swapchain) -@@ -2180,7 +2281,7 @@ void wined3d_cs_emit_update_swap_interval(struct wined3d_cs *cs, struct wined3d_ - cs->ops->submit_and_wait(cs); - } - -static void (* const wined3d_cs_op_handlers[])(struct wined3d_cs *cs, const void *data) = +static UINT (* const wined3d_cs_op_handlers[])(struct wined3d_cs *cs, const void *data) = { /* WINED3D_CS_OP_SYNC */ wined3d_cs_exec_sync, /* WINED3D_CS_OP_GLFINISH */ wined3d_cs_exec_glfinish, -@@ -2280,6 +2381,201 @@ static const struct wined3d_cs_ops wined3d_cs_st_ops = +@@ -2254,6 +2353,201 @@ static const struct wined3d_cs_ops wined3d_cs_st_ops = wined3d_cs_st_submit, }; @@ -1139,7 +1124,7 @@ index eb82d40e8f..e183a730ed 100644 struct wined3d_cs *wined3d_cs_create(struct wined3d_device *device) { const struct wined3d_gl_info *gl_info = &device->adapter->gl_info; -@@ -2309,12 +2605,41 @@ struct wined3d_cs *wined3d_cs_create(struct wined3d_device *device) +@@ -2283,12 +2577,41 @@ struct wined3d_cs *wined3d_cs_create(struct wined3d_device *device) return NULL; } @@ -1182,7 +1167,7 @@ index eb82d40e8f..e183a730ed 100644 HeapFree(GetProcessHeap(), 0, cs->data); HeapFree(GetProcessHeap(), 0, cs); diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c -index d5e6e8ca9e..9362c8637e 100644 +index c1400e28e2..2bfe43af13 100644 --- a/dlls/wined3d/device.c +++ b/dlls/wined3d/device.c @@ -1307,7 +1307,7 @@ UINT CDECL wined3d_device_get_available_texture_mem(const struct wined3d_device @@ -1225,7 +1210,7 @@ index 1ce5937f17..4ef747ca89 100644 if (hkey) RegCloseKey( hkey ); diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h -index 77a6aa3824..1f8af50116 100644 +index d758399f53..cabeea5161 100644 --- a/dlls/wined3d/wined3d_private.h +++ b/dlls/wined3d/wined3d_private.h @@ -390,6 +390,7 @@ struct wined3d_settings diff --git a/patches/wined3d-CSMT_Main/0031-wined3d-Introduce-a-separate-priority-queue.patch b/patches/wined3d-CSMT_Main/0031-wined3d-Introduce-a-separate-priority-queue.patch index 9a2eb6ab..dc2f9bee 100644 --- a/patches/wined3d-CSMT_Main/0031-wined3d-Introduce-a-separate-priority-queue.patch +++ b/patches/wined3d-CSMT_Main/0031-wined3d-Introduce-a-separate-priority-queue.patch @@ -1,18 +1,18 @@ -From f48daa130158a7637b0726a45fca28a814052f41 Mon Sep 17 00:00:00 2001 +From a6fe53f9418f1fd731dcee2155aac8f42ce4cd53 Mon Sep 17 00:00:00 2001 From: Sebastian Lackner Date: Wed, 8 Feb 2017 00:12:31 +0100 Subject: wined3d: Introduce a separate priority queue. --- - dlls/wined3d/cs.c | 119 ++++++++++++++++++++++------------------- + dlls/wined3d/cs.c | 117 ++++++++++++++++++++++------------------- dlls/wined3d/wined3d_private.h | 4 +- - 2 files changed, 67 insertions(+), 56 deletions(-) + 2 files changed, 66 insertions(+), 55 deletions(-) diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c -index 141c4f7194..f4769431a6 100644 +index c44c0563a4..dabba83897 100644 --- a/dlls/wined3d/cs.c +++ b/dlls/wined3d/cs.c -@@ -435,7 +435,7 @@ void wined3d_cs_emit_sync(struct wined3d_cs *cs) +@@ -428,7 +428,7 @@ void wined3d_cs_emit_sync(struct wined3d_cs *cs) { struct wined3d_cs_sync *op; @@ -21,7 +21,7 @@ index 141c4f7194..f4769431a6 100644 op->opcode = WINED3D_CS_OP_SYNC; cs->ops->submit_and_wait(cs); -@@ -455,7 +455,7 @@ void wined3d_cs_emit_glfinish(struct wined3d_cs *cs) +@@ -448,7 +448,7 @@ void wined3d_cs_emit_glfinish(struct wined3d_cs *cs) { struct wined3d_cs_glfinish *op; @@ -30,7 +30,7 @@ index 141c4f7194..f4769431a6 100644 op->opcode = WINED3D_CS_OP_GLFINISH; cs->ops->submit_and_wait(cs); -@@ -490,7 +490,7 @@ void wined3d_cs_emit_present(struct wined3d_cs *cs, struct wined3d_swapchain *sw +@@ -483,7 +483,7 @@ void wined3d_cs_emit_present(struct wined3d_cs *cs, struct wined3d_swapchain *sw unsigned int i; LONG pending; @@ -39,7 +39,7 @@ index 141c4f7194..f4769431a6 100644 op->opcode = WINED3D_CS_OP_PRESENT; op->dst_window_override = dst_window_override; op->swapchain = swapchain; -@@ -556,7 +556,7 @@ void wined3d_cs_emit_clear(struct wined3d_cs *cs, DWORD rect_count, const RECT * +@@ -549,7 +549,7 @@ void wined3d_cs_emit_clear(struct wined3d_cs *cs, DWORD rect_count, const RECT * size_t size = FIELD_OFFSET(struct wined3d_cs_clear, rects[rect_count]); unsigned int i; @@ -48,7 +48,7 @@ index 141c4f7194..f4769431a6 100644 op->opcode = WINED3D_CS_OP_CLEAR; op->size = size; op->flags = flags; -@@ -594,7 +594,7 @@ void wined3d_cs_emit_clear_rendertarget_view(struct wined3d_cs *cs, struct wined +@@ -587,7 +587,7 @@ void wined3d_cs_emit_clear_rendertarget_view(struct wined3d_cs *cs, struct wined } *extra; size_t size = FIELD_OFFSET(struct wined3d_cs_clear, rects[1]) + sizeof(*extra); @@ -57,7 +57,7 @@ index 141c4f7194..f4769431a6 100644 extra = (void *)&op->rects[1]; extra->fb.render_targets = &extra->rt; op->fb = &extra->fb; -@@ -753,7 +753,7 @@ void wined3d_cs_emit_dispatch(struct wined3d_cs *cs, +@@ -746,7 +746,7 @@ void wined3d_cs_emit_dispatch(struct wined3d_cs *cs, const struct wined3d_state *state = &cs->device->state; struct wined3d_cs_dispatch *op; @@ -66,7 +66,7 @@ index 141c4f7194..f4769431a6 100644 op->opcode = WINED3D_CS_OP_DISPATCH; op->group_count_x = group_count_x; op->group_count_y = group_count_y; -@@ -827,7 +827,7 @@ void wined3d_cs_emit_draw(struct wined3d_cs *cs, GLenum primitive_type, int base +@@ -820,7 +820,7 @@ void wined3d_cs_emit_draw(struct wined3d_cs *cs, GLenum primitive_type, int base struct wined3d_cs_draw *op; unsigned int i; @@ -75,7 +75,7 @@ index 141c4f7194..f4769431a6 100644 op->opcode = WINED3D_CS_OP_DRAW; op->primitive_type = primitive_type; op->base_vertex_idx = base_vertex_idx; -@@ -882,7 +882,7 @@ void wined3d_cs_emit_set_predication(struct wined3d_cs *cs, struct wined3d_query +@@ -875,7 +875,7 @@ void wined3d_cs_emit_set_predication(struct wined3d_cs *cs, struct wined3d_query { struct wined3d_cs_set_predication *op; @@ -84,7 +84,7 @@ index 141c4f7194..f4769431a6 100644 op->opcode = WINED3D_CS_OP_SET_PREDICATION; op->predicate = predicate; op->value = value; -@@ -904,7 +904,7 @@ void wined3d_cs_emit_set_viewport(struct wined3d_cs *cs, const struct wined3d_vi +@@ -897,7 +897,7 @@ void wined3d_cs_emit_set_viewport(struct wined3d_cs *cs, const struct wined3d_vi { struct wined3d_cs_set_viewport *op; @@ -93,7 +93,7 @@ index 141c4f7194..f4769431a6 100644 op->opcode = WINED3D_CS_OP_SET_VIEWPORT; op->viewport = *viewport; -@@ -925,7 +925,7 @@ void wined3d_cs_emit_set_scissor_rect(struct wined3d_cs *cs, const RECT *rect) +@@ -918,7 +918,7 @@ void wined3d_cs_emit_set_scissor_rect(struct wined3d_cs *cs, const RECT *rect) { struct wined3d_cs_set_scissor_rect *op; @@ -102,7 +102,7 @@ index 141c4f7194..f4769431a6 100644 op->opcode = WINED3D_CS_OP_SET_SCISSOR_RECT; op->rect = *rect; -@@ -947,7 +947,7 @@ void wined3d_cs_emit_set_rendertarget_view(struct wined3d_cs *cs, unsigned int v +@@ -940,7 +940,7 @@ void wined3d_cs_emit_set_rendertarget_view(struct wined3d_cs *cs, unsigned int v { struct wined3d_cs_set_rendertarget_view *op; @@ -111,7 +111,7 @@ index 141c4f7194..f4769431a6 100644 op->opcode = WINED3D_CS_OP_SET_RENDERTARGET_VIEW; op->view_idx = view_idx; op->view = view; -@@ -998,7 +998,7 @@ void wined3d_cs_emit_set_depth_stencil_view(struct wined3d_cs *cs, struct wined3 +@@ -991,7 +991,7 @@ void wined3d_cs_emit_set_depth_stencil_view(struct wined3d_cs *cs, struct wined3 { struct wined3d_cs_set_depth_stencil_view *op; @@ -120,7 +120,7 @@ index 141c4f7194..f4769431a6 100644 op->opcode = WINED3D_CS_OP_SET_DEPTH_STENCIL_VIEW; op->view = view; -@@ -1019,7 +1019,7 @@ void wined3d_cs_emit_set_vertex_declaration(struct wined3d_cs *cs, struct wined3 +@@ -1012,7 +1012,7 @@ void wined3d_cs_emit_set_vertex_declaration(struct wined3d_cs *cs, struct wined3 { struct wined3d_cs_set_vertex_declaration *op; @@ -129,7 +129,7 @@ index 141c4f7194..f4769431a6 100644 op->opcode = WINED3D_CS_OP_SET_VERTEX_DECLARATION; op->declaration = declaration; -@@ -1053,7 +1053,7 @@ void wined3d_cs_emit_set_stream_source(struct wined3d_cs *cs, UINT stream_idx, +@@ -1046,7 +1046,7 @@ void wined3d_cs_emit_set_stream_source(struct wined3d_cs *cs, UINT stream_idx, { struct wined3d_cs_set_stream_source *op; @@ -138,7 +138,7 @@ index 141c4f7194..f4769431a6 100644 op->opcode = WINED3D_CS_OP_SET_STREAM_SOURCE; op->stream_idx = stream_idx; op->buffer = buffer; -@@ -1081,7 +1081,7 @@ void wined3d_cs_emit_set_stream_source_freq(struct wined3d_cs *cs, UINT stream_i +@@ -1074,7 +1074,7 @@ void wined3d_cs_emit_set_stream_source_freq(struct wined3d_cs *cs, UINT stream_i { struct wined3d_cs_set_stream_source_freq *op; @@ -147,7 +147,7 @@ index 141c4f7194..f4769431a6 100644 op->opcode = WINED3D_CS_OP_SET_STREAM_SOURCE_FREQ; op->stream_idx = stream_idx; op->frequency = frequency; -@@ -1116,7 +1116,7 @@ void wined3d_cs_emit_set_stream_output(struct wined3d_cs *cs, UINT stream_idx, +@@ -1109,7 +1109,7 @@ void wined3d_cs_emit_set_stream_output(struct wined3d_cs *cs, UINT stream_idx, { struct wined3d_cs_set_stream_output *op; @@ -156,7 +156,7 @@ index 141c4f7194..f4769431a6 100644 op->opcode = WINED3D_CS_OP_SET_STREAM_OUTPUT; op->stream_idx = stream_idx; op->buffer = buffer; -@@ -1150,7 +1150,7 @@ void wined3d_cs_emit_set_index_buffer(struct wined3d_cs *cs, struct wined3d_buff +@@ -1143,7 +1143,7 @@ void wined3d_cs_emit_set_index_buffer(struct wined3d_cs *cs, struct wined3d_buff { struct wined3d_cs_set_index_buffer *op; @@ -165,7 +165,7 @@ index 141c4f7194..f4769431a6 100644 op->opcode = WINED3D_CS_OP_SET_INDEX_BUFFER; op->buffer = buffer; op->format_id = format_id; -@@ -1181,7 +1181,7 @@ void wined3d_cs_emit_set_constant_buffer(struct wined3d_cs *cs, enum wined3d_sha +@@ -1174,7 +1174,7 @@ void wined3d_cs_emit_set_constant_buffer(struct wined3d_cs *cs, enum wined3d_sha { struct wined3d_cs_set_constant_buffer *op; @@ -174,7 +174,7 @@ index 141c4f7194..f4769431a6 100644 op->opcode = WINED3D_CS_OP_SET_CONSTANT_BUFFER; op->type = type; op->cb_idx = cb_idx; -@@ -1275,7 +1275,7 @@ void wined3d_cs_emit_set_texture(struct wined3d_cs *cs, UINT stage, struct wined +@@ -1268,7 +1268,7 @@ void wined3d_cs_emit_set_texture(struct wined3d_cs *cs, UINT stage, struct wined { struct wined3d_cs_set_texture *op; @@ -183,7 +183,7 @@ index 141c4f7194..f4769431a6 100644 op->opcode = WINED3D_CS_OP_SET_TEXTURE; op->stage = stage; op->texture = texture; -@@ -1309,7 +1309,7 @@ void wined3d_cs_emit_set_shader_resource_view(struct wined3d_cs *cs, enum wined3 +@@ -1302,7 +1302,7 @@ void wined3d_cs_emit_set_shader_resource_view(struct wined3d_cs *cs, enum wined3 { struct wined3d_cs_set_shader_resource_view *op; @@ -192,7 +192,7 @@ index 141c4f7194..f4769431a6 100644 op->opcode = WINED3D_CS_OP_SET_SHADER_RESOURCE_VIEW; op->type = type; op->view_idx = view_idx; -@@ -1341,7 +1341,7 @@ void wined3d_cs_emit_set_unordered_access_view(struct wined3d_cs *cs, enum wined +@@ -1334,7 +1334,7 @@ void wined3d_cs_emit_set_unordered_access_view(struct wined3d_cs *cs, enum wined { struct wined3d_cs_set_unordered_access_view *op; @@ -201,7 +201,7 @@ index 141c4f7194..f4769431a6 100644 op->opcode = WINED3D_CS_OP_SET_UNORDERED_ACCESS_VIEW; op->pipeline = pipeline; op->view_idx = view_idx; -@@ -1368,7 +1368,7 @@ void wined3d_cs_emit_set_sampler(struct wined3d_cs *cs, enum wined3d_shader_type +@@ -1361,7 +1361,7 @@ void wined3d_cs_emit_set_sampler(struct wined3d_cs *cs, enum wined3d_shader_type { struct wined3d_cs_set_sampler *op; @@ -210,7 +210,7 @@ index 141c4f7194..f4769431a6 100644 op->opcode = WINED3D_CS_OP_SET_SAMPLER; op->type = type; op->sampler_idx = sampler_idx; -@@ -1395,7 +1395,7 @@ void wined3d_cs_emit_set_shader(struct wined3d_cs *cs, enum wined3d_shader_type +@@ -1388,7 +1388,7 @@ void wined3d_cs_emit_set_shader(struct wined3d_cs *cs, enum wined3d_shader_type { struct wined3d_cs_set_shader *op; @@ -219,7 +219,7 @@ index 141c4f7194..f4769431a6 100644 op->opcode = WINED3D_CS_OP_SET_SHADER; op->type = type; op->shader = shader; -@@ -1418,7 +1418,7 @@ void wined3d_cs_emit_set_rasterizer_state(struct wined3d_cs *cs, +@@ -1411,7 +1411,7 @@ void wined3d_cs_emit_set_rasterizer_state(struct wined3d_cs *cs, { struct wined3d_cs_set_rasterizer_state *op; @@ -228,7 +228,7 @@ index 141c4f7194..f4769431a6 100644 op->opcode = WINED3D_CS_OP_SET_RASTERIZER_STATE; op->state = rasterizer_state; -@@ -1439,7 +1439,7 @@ void wined3d_cs_emit_set_render_state(struct wined3d_cs *cs, enum wined3d_render +@@ -1432,7 +1432,7 @@ void wined3d_cs_emit_set_render_state(struct wined3d_cs *cs, enum wined3d_render { struct wined3d_cs_set_render_state *op; @@ -237,7 +237,7 @@ index 141c4f7194..f4769431a6 100644 op->opcode = WINED3D_CS_OP_SET_RENDER_STATE; op->state = state; op->value = value; -@@ -1462,7 +1462,7 @@ void wined3d_cs_emit_set_texture_state(struct wined3d_cs *cs, UINT stage, +@@ -1455,7 +1455,7 @@ void wined3d_cs_emit_set_texture_state(struct wined3d_cs *cs, UINT stage, { struct wined3d_cs_set_texture_state *op; @@ -246,7 +246,7 @@ index 141c4f7194..f4769431a6 100644 op->opcode = WINED3D_CS_OP_SET_TEXTURE_STATE; op->stage = stage; op->state = state; -@@ -1486,7 +1486,7 @@ void wined3d_cs_emit_set_sampler_state(struct wined3d_cs *cs, UINT sampler_idx, +@@ -1479,7 +1479,7 @@ void wined3d_cs_emit_set_sampler_state(struct wined3d_cs *cs, UINT sampler_idx, { struct wined3d_cs_set_sampler_state *op; @@ -255,7 +255,7 @@ index 141c4f7194..f4769431a6 100644 op->opcode = WINED3D_CS_OP_SET_SAMPLER_STATE; op->sampler_idx = sampler_idx; op->state = state; -@@ -1511,7 +1511,7 @@ void wined3d_cs_emit_set_transform(struct wined3d_cs *cs, enum wined3d_transform +@@ -1504,7 +1504,7 @@ void wined3d_cs_emit_set_transform(struct wined3d_cs *cs, enum wined3d_transform { struct wined3d_cs_set_transform *op; @@ -264,7 +264,7 @@ index 141c4f7194..f4769431a6 100644 op->opcode = WINED3D_CS_OP_SET_TRANSFORM; op->state = state; op->matrix = *matrix; -@@ -1533,7 +1533,7 @@ void wined3d_cs_emit_set_clip_plane(struct wined3d_cs *cs, UINT plane_idx, const +@@ -1526,7 +1526,7 @@ void wined3d_cs_emit_set_clip_plane(struct wined3d_cs *cs, UINT plane_idx, const { struct wined3d_cs_set_clip_plane *op; @@ -273,7 +273,7 @@ index 141c4f7194..f4769431a6 100644 op->opcode = WINED3D_CS_OP_SET_CLIP_PLANE; op->plane_idx = plane_idx; op->plane = *plane; -@@ -1611,7 +1611,7 @@ void wined3d_cs_emit_set_color_key(struct wined3d_cs *cs, struct wined3d_texture +@@ -1604,7 +1604,7 @@ void wined3d_cs_emit_set_color_key(struct wined3d_cs *cs, struct wined3d_texture { struct wined3d_cs_set_color_key *op; @@ -282,7 +282,7 @@ index 141c4f7194..f4769431a6 100644 op->opcode = WINED3D_CS_OP_SET_COLOR_KEY; op->texture = texture; op->flags = flags; -@@ -1640,7 +1640,7 @@ void wined3d_cs_emit_set_material(struct wined3d_cs *cs, const struct wined3d_ma +@@ -1633,7 +1633,7 @@ void wined3d_cs_emit_set_material(struct wined3d_cs *cs, const struct wined3d_ma { struct wined3d_cs_set_material *op; @@ -291,7 +291,7 @@ index 141c4f7194..f4769431a6 100644 op->opcode = WINED3D_CS_OP_SET_MATERIAL; op->material = *material; -@@ -1690,7 +1690,7 @@ void wined3d_cs_emit_set_light(struct wined3d_cs *cs, const struct wined3d_light +@@ -1683,7 +1683,7 @@ void wined3d_cs_emit_set_light(struct wined3d_cs *cs, const struct wined3d_light { struct wined3d_cs_set_light *op; @@ -300,7 +300,7 @@ index 141c4f7194..f4769431a6 100644 op->opcode = WINED3D_CS_OP_SET_LIGHT; op->light = *light; -@@ -1725,7 +1725,7 @@ void wined3d_cs_emit_set_light_enable(struct wined3d_cs *cs, unsigned int idx, B +@@ -1718,7 +1718,7 @@ void wined3d_cs_emit_set_light_enable(struct wined3d_cs *cs, unsigned int idx, B { struct wined3d_cs_set_light_enable *op; @@ -309,7 +309,7 @@ index 141c4f7194..f4769431a6 100644 op->opcode = WINED3D_CS_OP_SET_LIGHT_ENABLE; op->idx = idx; op->enable = enable; -@@ -1749,7 +1749,7 @@ void wined3d_cs_emit_reset_state(struct wined3d_cs *cs) +@@ -1742,7 +1742,7 @@ void wined3d_cs_emit_reset_state(struct wined3d_cs *cs) { struct wined3d_cs_reset_state *op; @@ -318,7 +318,7 @@ index 141c4f7194..f4769431a6 100644 op->opcode = WINED3D_CS_OP_RESET_STATE; cs->ops->submit(cs); -@@ -1768,7 +1768,7 @@ static void wined3d_cs_emit_callback(struct wined3d_cs *cs, void (*callback)(voi +@@ -1761,7 +1761,7 @@ static void wined3d_cs_emit_callback(struct wined3d_cs *cs, void (*callback)(voi { struct wined3d_cs_callback *op; @@ -327,7 +327,7 @@ index 141c4f7194..f4769431a6 100644 op->opcode = WINED3D_CS_OP_CALLBACK; op->callback = callback; op->object = object; -@@ -1800,7 +1800,7 @@ void wined3d_cs_emit_query_issue(struct wined3d_cs *cs, struct wined3d_query *qu +@@ -1793,7 +1793,7 @@ void wined3d_cs_emit_query_issue(struct wined3d_cs *cs, struct wined3d_query *qu { struct wined3d_cs_query_issue *op; @@ -336,7 +336,7 @@ index 141c4f7194..f4769431a6 100644 op->opcode = WINED3D_CS_OP_QUERY_ISSUE; op->query = query; op->flags = flags; -@@ -1823,7 +1823,7 @@ BOOL wined3d_cs_emit_query_poll(struct wined3d_cs *cs, struct wined3d_query *que +@@ -1816,7 +1816,7 @@ BOOL wined3d_cs_emit_query_poll(struct wined3d_cs *cs, struct wined3d_query *que struct wined3d_cs_query_poll *op; BOOL ret; @@ -345,7 +345,7 @@ index 141c4f7194..f4769431a6 100644 op->opcode = WINED3D_CS_OP_QUERY_POLL; op->query = query; op->flags = flags; -@@ -1849,7 +1849,7 @@ void wined3d_cs_emit_preload_resource(struct wined3d_cs *cs, struct wined3d_reso +@@ -1842,7 +1842,7 @@ void wined3d_cs_emit_preload_resource(struct wined3d_cs *cs, struct wined3d_reso { struct wined3d_cs_preload_resource *op; @@ -354,7 +354,7 @@ index 141c4f7194..f4769431a6 100644 op->opcode = WINED3D_CS_OP_PRELOAD_RESOURCE; op->resource = resource; -@@ -1873,7 +1873,7 @@ void wined3d_cs_emit_unload_resource(struct wined3d_cs *cs, struct wined3d_resou +@@ -1866,7 +1866,7 @@ void wined3d_cs_emit_unload_resource(struct wined3d_cs *cs, struct wined3d_resou { struct wined3d_cs_unload_resource *op; @@ -363,7 +363,7 @@ index 141c4f7194..f4769431a6 100644 op->opcode = WINED3D_CS_OP_UNLOAD_RESOURCE; op->resource = resource; -@@ -1899,7 +1899,7 @@ HRESULT wined3d_cs_map(struct wined3d_cs *cs, struct wined3d_resource *resource, +@@ -1892,7 +1892,7 @@ HRESULT wined3d_cs_map(struct wined3d_cs *cs, struct wined3d_resource *resource, struct wined3d_cs_map *op; HRESULT hr; @@ -372,7 +372,7 @@ index 141c4f7194..f4769431a6 100644 op->opcode = WINED3D_CS_OP_MAP; op->resource = resource; op->sub_resource_idx = sub_resource_idx; -@@ -1928,7 +1928,7 @@ HRESULT wined3d_cs_unmap(struct wined3d_cs *cs, struct wined3d_resource *resourc +@@ -1921,7 +1921,7 @@ HRESULT wined3d_cs_unmap(struct wined3d_cs *cs, struct wined3d_resource *resourc struct wined3d_cs_unmap *op; HRESULT hr; @@ -381,7 +381,7 @@ index 141c4f7194..f4769431a6 100644 op->opcode = WINED3D_CS_OP_UNMAP; op->resource = resource; op->sub_resource_idx = sub_resource_idx; -@@ -2069,7 +2069,7 @@ void wined3d_cs_emit_blt_sub_resource(struct wined3d_cs *cs, struct wined3d_reso +@@ -2062,7 +2062,7 @@ void wined3d_cs_emit_blt_sub_resource(struct wined3d_cs *cs, struct wined3d_reso { struct wined3d_cs_blt_sub_resource *op; @@ -390,7 +390,7 @@ index 141c4f7194..f4769431a6 100644 op->opcode = WINED3D_CS_OP_BLT_SUB_RESOURCE; op->dst_resource = dst_resource; op->dst_sub_resource_idx = dst_sub_resource_idx; -@@ -2148,7 +2148,7 @@ void wined3d_cs_emit_update_sub_resource(struct wined3d_cs *cs, struct wined3d_r +@@ -2141,7 +2141,7 @@ void wined3d_cs_emit_update_sub_resource(struct wined3d_cs *cs, struct wined3d_r { struct wined3d_cs_update_sub_resource *op; @@ -399,7 +399,7 @@ index 141c4f7194..f4769431a6 100644 op->opcode = WINED3D_CS_OP_UPDATE_SUB_RESOURCE; op->resource = resource; op->sub_resource_idx = sub_resource_idx; -@@ -2190,7 +2190,7 @@ void wined3d_cs_emit_add_dirty_texture_region(struct wined3d_cs *cs, +@@ -2183,7 +2183,7 @@ void wined3d_cs_emit_add_dirty_texture_region(struct wined3d_cs *cs, { struct wined3d_cs_add_dirty_texture_region *op; @@ -408,7 +408,7 @@ index 141c4f7194..f4769431a6 100644 op->opcode = WINED3D_CS_OP_ADD_DIRTY_TEXTURE_REGION; op->texture = texture; op->layer = layer; -@@ -2251,7 +2251,7 @@ void wined3d_cs_emit_push_constants(struct wined3d_cs *cs, enum wined3d_push_con +@@ -2244,7 +2244,7 @@ void wined3d_cs_emit_push_constants(struct wined3d_cs *cs, enum wined3d_push_con { struct wined3d_cs_push_constants *op; @@ -417,17 +417,8 @@ index 141c4f7194..f4769431a6 100644 op->opcode = WINED3D_CS_OP_PUSH_CONSTANTS; op->p = p; op->start_idx = start_idx; -@@ -2274,7 +2274,7 @@ void wined3d_cs_emit_update_swap_interval(struct wined3d_cs *cs, struct wined3d_ - { - struct wined3d_cs_update_swap_interval *op; - -- op = cs->ops->require_space(cs, sizeof(*op)); -+ op = cs->ops->require_space(cs, sizeof(*op), 0); - op->opcode = WINED3D_CS_OP_UPDATE_SWAP_INTERVAL; - op->swapchain = swapchain; - -@@ -2330,7 +2330,7 @@ static UINT (* const wined3d_cs_op_handlers[])(struct wined3d_cs *cs, const void - /* WINED3D_CS_OP_UPDATE_SWAP_INTERVAL */ wined3d_cs_exec_update_swap_interval, +@@ -2302,7 +2302,7 @@ static UINT (* const wined3d_cs_op_handlers[])(struct wined3d_cs *cs, const void + /* WINED3D_CS_OP_PUSH_CONSTANTS */ wined3d_cs_exec_push_constants, }; -static void *wined3d_cs_st_require_space(struct wined3d_cs *cs, size_t size) @@ -435,7 +426,7 @@ index 141c4f7194..f4769431a6 100644 { if (size > (cs->data_size - cs->end)) { -@@ -2414,6 +2414,8 @@ static struct wined3d_cs_block *wined3d_cs_dequeue_command(struct wined3d_cs *cs +@@ -2386,6 +2386,8 @@ static struct wined3d_cs_block *wined3d_cs_dequeue_command(struct wined3d_cs *cs /* FIXME: Use an event to wait after a couple of spins. */ for (;;) { @@ -444,7 +435,7 @@ index 141c4f7194..f4769431a6 100644 if ((block = wined3d_cs_list_dequeue(&cs->exec_list))) return block; } -@@ -2441,7 +2443,7 @@ static void wined3d_cs_list_cleanup(struct wined3d_cs_list *list) +@@ -2413,7 +2415,7 @@ static void wined3d_cs_list_cleanup(struct wined3d_cs_list *list) DeleteCriticalSection(&list->lock); } @@ -453,7 +444,7 @@ index 141c4f7194..f4769431a6 100644 { struct wined3d_cs_block *block; -@@ -2455,26 +2457,28 @@ static struct wined3d_cs_block *wined3d_cs_get_block(struct wined3d_cs *cs) +@@ -2427,26 +2429,28 @@ static struct wined3d_cs_block *wined3d_cs_get_block(struct wined3d_cs *cs) } block->pos = 0; @@ -486,7 +477,7 @@ index 141c4f7194..f4769431a6 100644 cs->current_block = block; } -@@ -2486,10 +2490,13 @@ static void *wined3d_cs_mt_require_space(struct wined3d_cs *cs, size_t size) +@@ -2458,10 +2462,13 @@ static void *wined3d_cs_mt_require_space(struct wined3d_cs *cs, size_t size) static void wined3d_cs_mt_submit(struct wined3d_cs *cs) { @@ -501,7 +492,7 @@ index 141c4f7194..f4769431a6 100644 cs->current_block = NULL; } -@@ -2503,7 +2510,7 @@ static void wined3d_cs_mt_submit_and_wait(struct wined3d_cs *cs) +@@ -2475,7 +2482,7 @@ static void wined3d_cs_mt_submit_and_wait(struct wined3d_cs *cs) block = cs->current_block; block->fence = &fence; @@ -510,7 +501,7 @@ index 141c4f7194..f4769431a6 100644 cs->current_block = NULL; /* A busy wait should be fine, we're not supposed to have to wait very -@@ -2525,7 +2532,7 @@ static void wined3d_cs_mt_emit_stop(struct wined3d_cs *cs) +@@ -2497,7 +2504,7 @@ static void wined3d_cs_mt_emit_stop(struct wined3d_cs *cs) assert(cs->thread_id != GetCurrentThreadId()); assert(cs->ops == &wined3d_cs_mt_ops); @@ -519,7 +510,7 @@ index 141c4f7194..f4769431a6 100644 op->opcode = WINED3D_CS_OP_STOP; cs->ops->submit(cs); -@@ -2611,6 +2618,7 @@ struct wined3d_cs *wined3d_cs_create(struct wined3d_device *device) +@@ -2583,6 +2590,7 @@ struct wined3d_cs *wined3d_cs_create(struct wined3d_device *device) wined3d_cs_list_init(&cs->free_list); wined3d_cs_list_init(&cs->exec_list); @@ -527,7 +518,7 @@ index 141c4f7194..f4769431a6 100644 if (!(cs->thread = CreateThread(NULL, 0, wined3d_cs_run, cs, 0, &cs->thread_id))) { -@@ -2636,6 +2644,7 @@ void wined3d_cs_destroy(struct wined3d_cs *cs) +@@ -2608,6 +2616,7 @@ void wined3d_cs_destroy(struct wined3d_cs *cs) WaitForSingleObject(cs->thread, INFINITE); CloseHandle(cs->thread); @@ -536,7 +527,7 @@ index 141c4f7194..f4769431a6 100644 wined3d_cs_list_cleanup(&cs->free_list); } diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h -index 1f8af50116..12ace4e746 100644 +index cabeea5161..240e0b5b8b 100644 --- a/dlls/wined3d/wined3d_private.h +++ b/dlls/wined3d/wined3d_private.h @@ -3245,13 +3245,14 @@ struct wined3d_cs_block diff --git a/patches/wined3d-CSMT_Main/0038-wined3d-Do-not-immediately-submit-stateblock-updates.patch b/patches/wined3d-CSMT_Main/0038-wined3d-Do-not-immediately-submit-stateblock-updates.patch index 1f7a42b4..0bd05152 100644 --- a/patches/wined3d-CSMT_Main/0038-wined3d-Do-not-immediately-submit-stateblock-updates.patch +++ b/patches/wined3d-CSMT_Main/0038-wined3d-Do-not-immediately-submit-stateblock-updates.patch @@ -1,4 +1,4 @@ -From dd838d9cf7c7ff402eabbf9630e15dc312b390d9 Mon Sep 17 00:00:00 2001 +From 52300fd0f8d10adaab547cb7195168be253f2d1d Mon Sep 17 00:00:00 2001 From: Sebastian Lackner Date: Wed, 8 Feb 2017 12:32:55 +0100 Subject: wined3d: Do not immediately submit stateblock updates. @@ -9,10 +9,10 @@ Subject: wined3d: Do not immediately submit stateblock updates. 2 files changed, 36 insertions(+), 28 deletions(-) diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c -index 00ffa04faf..2818e9b793 100644 +index 209d34fc9d..273ff7cd6c 100644 --- a/dlls/wined3d/cs.c +++ b/dlls/wined3d/cs.c -@@ -887,7 +887,7 @@ void wined3d_cs_emit_set_predication(struct wined3d_cs *cs, struct wined3d_query +@@ -880,7 +880,7 @@ void wined3d_cs_emit_set_predication(struct wined3d_cs *cs, struct wined3d_query op->predicate = predicate; op->value = value; @@ -21,7 +21,7 @@ index 00ffa04faf..2818e9b793 100644 } static UINT wined3d_cs_exec_set_viewport(struct wined3d_cs *cs, const void *data) -@@ -908,7 +908,7 @@ void wined3d_cs_emit_set_viewport(struct wined3d_cs *cs, const struct wined3d_vi +@@ -901,7 +901,7 @@ void wined3d_cs_emit_set_viewport(struct wined3d_cs *cs, const struct wined3d_vi op->opcode = WINED3D_CS_OP_SET_VIEWPORT; op->viewport = *viewport; @@ -30,7 +30,7 @@ index 00ffa04faf..2818e9b793 100644 } static UINT wined3d_cs_exec_set_scissor_rect(struct wined3d_cs *cs, const void *data) -@@ -929,7 +929,7 @@ void wined3d_cs_emit_set_scissor_rect(struct wined3d_cs *cs, const RECT *rect) +@@ -922,7 +922,7 @@ void wined3d_cs_emit_set_scissor_rect(struct wined3d_cs *cs, const RECT *rect) op->opcode = WINED3D_CS_OP_SET_SCISSOR_RECT; op->rect = *rect; @@ -39,7 +39,7 @@ index 00ffa04faf..2818e9b793 100644 } static UINT wined3d_cs_exec_set_rendertarget_view(struct wined3d_cs *cs, const void *data) -@@ -952,7 +952,7 @@ void wined3d_cs_emit_set_rendertarget_view(struct wined3d_cs *cs, unsigned int v +@@ -945,7 +945,7 @@ void wined3d_cs_emit_set_rendertarget_view(struct wined3d_cs *cs, unsigned int v op->view_idx = view_idx; op->view = view; @@ -48,7 +48,7 @@ index 00ffa04faf..2818e9b793 100644 } static UINT wined3d_cs_exec_set_depth_stencil_view(struct wined3d_cs *cs, const void *data) -@@ -1002,7 +1002,7 @@ void wined3d_cs_emit_set_depth_stencil_view(struct wined3d_cs *cs, struct wined3 +@@ -995,7 +995,7 @@ void wined3d_cs_emit_set_depth_stencil_view(struct wined3d_cs *cs, struct wined3 op->opcode = WINED3D_CS_OP_SET_DEPTH_STENCIL_VIEW; op->view = view; @@ -57,7 +57,7 @@ index 00ffa04faf..2818e9b793 100644 } static UINT wined3d_cs_exec_set_vertex_declaration(struct wined3d_cs *cs, const void *data) -@@ -1023,7 +1023,7 @@ void wined3d_cs_emit_set_vertex_declaration(struct wined3d_cs *cs, struct wined3 +@@ -1016,7 +1016,7 @@ void wined3d_cs_emit_set_vertex_declaration(struct wined3d_cs *cs, struct wined3 op->opcode = WINED3D_CS_OP_SET_VERTEX_DECLARATION; op->declaration = declaration; @@ -66,7 +66,7 @@ index 00ffa04faf..2818e9b793 100644 } static UINT wined3d_cs_exec_set_stream_source(struct wined3d_cs *cs, const void *data) -@@ -1060,7 +1060,7 @@ void wined3d_cs_emit_set_stream_source(struct wined3d_cs *cs, UINT stream_idx, +@@ -1053,7 +1053,7 @@ void wined3d_cs_emit_set_stream_source(struct wined3d_cs *cs, UINT stream_idx, op->offset = offset; op->stride = stride; @@ -75,7 +75,7 @@ index 00ffa04faf..2818e9b793 100644 } static UINT wined3d_cs_exec_set_stream_source_freq(struct wined3d_cs *cs, const void *data) -@@ -1087,7 +1087,7 @@ void wined3d_cs_emit_set_stream_source_freq(struct wined3d_cs *cs, UINT stream_i +@@ -1080,7 +1080,7 @@ void wined3d_cs_emit_set_stream_source_freq(struct wined3d_cs *cs, UINT stream_i op->frequency = frequency; op->flags = flags; @@ -84,7 +84,7 @@ index 00ffa04faf..2818e9b793 100644 } static UINT wined3d_cs_exec_set_stream_output(struct wined3d_cs *cs, const void *data) -@@ -1122,7 +1122,7 @@ void wined3d_cs_emit_set_stream_output(struct wined3d_cs *cs, UINT stream_idx, +@@ -1115,7 +1115,7 @@ void wined3d_cs_emit_set_stream_output(struct wined3d_cs *cs, UINT stream_idx, op->buffer = buffer; op->offset = offset; @@ -93,7 +93,7 @@ index 00ffa04faf..2818e9b793 100644 } static UINT wined3d_cs_exec_set_index_buffer(struct wined3d_cs *cs, const void *data) -@@ -1156,7 +1156,7 @@ void wined3d_cs_emit_set_index_buffer(struct wined3d_cs *cs, struct wined3d_buff +@@ -1149,7 +1149,7 @@ void wined3d_cs_emit_set_index_buffer(struct wined3d_cs *cs, struct wined3d_buff op->format_id = format_id; op->offset = offset; @@ -102,7 +102,7 @@ index 00ffa04faf..2818e9b793 100644 } static UINT wined3d_cs_exec_set_constant_buffer(struct wined3d_cs *cs, const void *data) -@@ -1187,7 +1187,7 @@ void wined3d_cs_emit_set_constant_buffer(struct wined3d_cs *cs, enum wined3d_sha +@@ -1180,7 +1180,7 @@ void wined3d_cs_emit_set_constant_buffer(struct wined3d_cs *cs, enum wined3d_sha op->cb_idx = cb_idx; op->buffer = buffer; @@ -111,7 +111,7 @@ index 00ffa04faf..2818e9b793 100644 } static UINT wined3d_cs_exec_set_texture(struct wined3d_cs *cs, const void *data) -@@ -1280,7 +1280,7 @@ void wined3d_cs_emit_set_texture(struct wined3d_cs *cs, UINT stage, struct wined +@@ -1273,7 +1273,7 @@ void wined3d_cs_emit_set_texture(struct wined3d_cs *cs, UINT stage, struct wined op->stage = stage; op->texture = texture; @@ -120,7 +120,7 @@ index 00ffa04faf..2818e9b793 100644 } static UINT wined3d_cs_exec_set_shader_resource_view(struct wined3d_cs *cs, const void *data) -@@ -1315,7 +1315,7 @@ void wined3d_cs_emit_set_shader_resource_view(struct wined3d_cs *cs, enum wined3 +@@ -1308,7 +1308,7 @@ void wined3d_cs_emit_set_shader_resource_view(struct wined3d_cs *cs, enum wined3 op->view_idx = view_idx; op->view = view; @@ -129,7 +129,7 @@ index 00ffa04faf..2818e9b793 100644 } static UINT wined3d_cs_exec_set_unordered_access_view(struct wined3d_cs *cs, const void *data) -@@ -1347,7 +1347,7 @@ void wined3d_cs_emit_set_unordered_access_view(struct wined3d_cs *cs, enum wined +@@ -1340,7 +1340,7 @@ void wined3d_cs_emit_set_unordered_access_view(struct wined3d_cs *cs, enum wined op->view_idx = view_idx; op->view = view; @@ -138,7 +138,7 @@ index 00ffa04faf..2818e9b793 100644 } static UINT wined3d_cs_exec_set_sampler(struct wined3d_cs *cs, const void *data) -@@ -1374,7 +1374,7 @@ void wined3d_cs_emit_set_sampler(struct wined3d_cs *cs, enum wined3d_shader_type +@@ -1367,7 +1367,7 @@ void wined3d_cs_emit_set_sampler(struct wined3d_cs *cs, enum wined3d_shader_type op->sampler_idx = sampler_idx; op->sampler = sampler; @@ -147,7 +147,7 @@ index 00ffa04faf..2818e9b793 100644 } static UINT wined3d_cs_exec_set_shader(struct wined3d_cs *cs, const void *data) -@@ -1400,7 +1400,7 @@ void wined3d_cs_emit_set_shader(struct wined3d_cs *cs, enum wined3d_shader_type +@@ -1393,7 +1393,7 @@ void wined3d_cs_emit_set_shader(struct wined3d_cs *cs, enum wined3d_shader_type op->type = type; op->shader = shader; @@ -156,7 +156,7 @@ index 00ffa04faf..2818e9b793 100644 } static UINT wined3d_cs_exec_set_rasterizer_state(struct wined3d_cs *cs, const void *data) -@@ -1422,7 +1422,7 @@ void wined3d_cs_emit_set_rasterizer_state(struct wined3d_cs *cs, +@@ -1415,7 +1415,7 @@ void wined3d_cs_emit_set_rasterizer_state(struct wined3d_cs *cs, op->opcode = WINED3D_CS_OP_SET_RASTERIZER_STATE; op->state = rasterizer_state; @@ -165,7 +165,7 @@ index 00ffa04faf..2818e9b793 100644 } static UINT wined3d_cs_exec_set_render_state(struct wined3d_cs *cs, const void *data) -@@ -1444,7 +1444,7 @@ void wined3d_cs_emit_set_render_state(struct wined3d_cs *cs, enum wined3d_render +@@ -1437,7 +1437,7 @@ void wined3d_cs_emit_set_render_state(struct wined3d_cs *cs, enum wined3d_render op->state = state; op->value = value; @@ -174,7 +174,7 @@ index 00ffa04faf..2818e9b793 100644 } static UINT wined3d_cs_exec_set_texture_state(struct wined3d_cs *cs, const void *data) -@@ -1468,7 +1468,7 @@ void wined3d_cs_emit_set_texture_state(struct wined3d_cs *cs, UINT stage, +@@ -1461,7 +1461,7 @@ void wined3d_cs_emit_set_texture_state(struct wined3d_cs *cs, UINT stage, op->state = state; op->value = value; @@ -183,7 +183,7 @@ index 00ffa04faf..2818e9b793 100644 } static UINT wined3d_cs_exec_set_sampler_state(struct wined3d_cs *cs, const void *data) -@@ -1492,7 +1492,7 @@ void wined3d_cs_emit_set_sampler_state(struct wined3d_cs *cs, UINT sampler_idx, +@@ -1485,7 +1485,7 @@ void wined3d_cs_emit_set_sampler_state(struct wined3d_cs *cs, UINT sampler_idx, op->state = state; op->value = value; @@ -192,7 +192,7 @@ index 00ffa04faf..2818e9b793 100644 } static UINT wined3d_cs_exec_set_transform(struct wined3d_cs *cs, const void *data) -@@ -1516,7 +1516,7 @@ void wined3d_cs_emit_set_transform(struct wined3d_cs *cs, enum wined3d_transform +@@ -1509,7 +1509,7 @@ void wined3d_cs_emit_set_transform(struct wined3d_cs *cs, enum wined3d_transform op->state = state; op->matrix = *matrix; @@ -201,7 +201,7 @@ index 00ffa04faf..2818e9b793 100644 } static UINT wined3d_cs_exec_set_clip_plane(struct wined3d_cs *cs, const void *data) -@@ -1538,7 +1538,7 @@ void wined3d_cs_emit_set_clip_plane(struct wined3d_cs *cs, UINT plane_idx, const +@@ -1531,7 +1531,7 @@ void wined3d_cs_emit_set_clip_plane(struct wined3d_cs *cs, UINT plane_idx, const op->plane_idx = plane_idx; op->plane = *plane; @@ -210,7 +210,7 @@ index 00ffa04faf..2818e9b793 100644 } static UINT wined3d_cs_exec_set_color_key(struct wined3d_cs *cs, const void *data) -@@ -1623,7 +1623,7 @@ void wined3d_cs_emit_set_color_key(struct wined3d_cs *cs, struct wined3d_texture +@@ -1616,7 +1616,7 @@ void wined3d_cs_emit_set_color_key(struct wined3d_cs *cs, struct wined3d_texture else op->set = 0; @@ -219,7 +219,7 @@ index 00ffa04faf..2818e9b793 100644 } static UINT wined3d_cs_exec_set_material(struct wined3d_cs *cs, const void *data) -@@ -1644,7 +1644,7 @@ void wined3d_cs_emit_set_material(struct wined3d_cs *cs, const struct wined3d_ma +@@ -1637,7 +1637,7 @@ void wined3d_cs_emit_set_material(struct wined3d_cs *cs, const struct wined3d_ma op->opcode = WINED3D_CS_OP_SET_MATERIAL; op->material = *material; @@ -228,7 +228,7 @@ index 00ffa04faf..2818e9b793 100644 } static UINT wined3d_cs_exec_set_light(struct wined3d_cs *cs, const void *data) -@@ -1694,7 +1694,7 @@ void wined3d_cs_emit_set_light(struct wined3d_cs *cs, const struct wined3d_light +@@ -1687,7 +1687,7 @@ void wined3d_cs_emit_set_light(struct wined3d_cs *cs, const struct wined3d_light op->opcode = WINED3D_CS_OP_SET_LIGHT; op->light = *light; @@ -237,7 +237,7 @@ index 00ffa04faf..2818e9b793 100644 } static UINT wined3d_cs_exec_set_light_enable(struct wined3d_cs *cs, const void *data) -@@ -1730,7 +1730,7 @@ void wined3d_cs_emit_set_light_enable(struct wined3d_cs *cs, unsigned int idx, B +@@ -1723,7 +1723,7 @@ void wined3d_cs_emit_set_light_enable(struct wined3d_cs *cs, unsigned int idx, B op->idx = idx; op->enable = enable; @@ -246,7 +246,7 @@ index 00ffa04faf..2818e9b793 100644 } static UINT wined3d_cs_exec_reset_state(struct wined3d_cs *cs, const void *data) -@@ -1752,7 +1752,7 @@ void wined3d_cs_emit_reset_state(struct wined3d_cs *cs) +@@ -1745,7 +1745,7 @@ void wined3d_cs_emit_reset_state(struct wined3d_cs *cs) op = cs->ops->require_space(cs, sizeof(*op), 0); op->opcode = WINED3D_CS_OP_RESET_STATE; @@ -255,7 +255,7 @@ index 00ffa04faf..2818e9b793 100644 } static UINT wined3d_cs_exec_callback(struct wined3d_cs *cs, const void *data) -@@ -2224,7 +2224,7 @@ void wined3d_cs_emit_push_constants(struct wined3d_cs *cs, enum wined3d_push_con +@@ -2255,7 +2255,7 @@ void wined3d_cs_emit_push_constants(struct wined3d_cs *cs, enum wined3d_push_con op->count = count; memcpy(op->constants, constants, count * push_constant_info[p].size); @@ -263,8 +263,8 @@ index 00ffa04faf..2818e9b793 100644 + cs->ops->submit_delayed(cs); } - static UINT wined3d_cs_exec_update_swap_interval(struct wined3d_cs *cs, const void *data) -@@ -2391,6 +2391,7 @@ static const struct wined3d_cs_ops wined3d_cs_st_ops = + static UINT (* const wined3d_cs_op_handlers[])(struct wined3d_cs *cs, const void *data) = +@@ -2355,6 +2355,7 @@ static const struct wined3d_cs_ops wined3d_cs_st_ops = wined3d_cs_st_require_space, wined3d_cs_st_submit, wined3d_cs_st_submit, @@ -272,7 +272,7 @@ index 00ffa04faf..2818e9b793 100644 }; static void wined3d_cs_list_enqueue(struct wined3d_cs_list *list, struct wined3d_cs_block *block) -@@ -2567,11 +2568,17 @@ static void wined3d_cs_mt_submit_and_wait(struct wined3d_cs *cs) +@@ -2531,11 +2532,17 @@ static void wined3d_cs_mt_submit_and_wait(struct wined3d_cs *cs) while (!InterlockedCompareExchange(&fence, TRUE, TRUE)); } @@ -291,7 +291,7 @@ index 00ffa04faf..2818e9b793 100644 static void wined3d_cs_mt_emit_stop(struct wined3d_cs *cs) diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h -index d2288647f4..6c00cec005 100644 +index fadb4bc152..f245e6f24e 100644 --- a/dlls/wined3d/wined3d_private.h +++ b/dlls/wined3d/wined3d_private.h @@ -3256,6 +3256,7 @@ struct wined3d_cs_ops diff --git a/patches/wined3d-CSMT_Main/9999-IfDefined.patch b/patches/wined3d-CSMT_Main/9999-IfDefined.patch index 604cbfbe..6e7e3575 100644 --- a/patches/wined3d-CSMT_Main/9999-IfDefined.patch +++ b/patches/wined3d-CSMT_Main/9999-IfDefined.patch @@ -5,7 +5,6 @@ Based on patches by: Michael Müller Sebastian Lackner Stefan Dösinger - Stefan Dösinger diff --git a/dlls/wined3d/buffer.c b/dlls/wined3d/buffer.c --- a/dlls/wined3d/buffer.c @@ -84,13 +83,12 @@ diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c WINED3D_CS_OP_PRELOAD_RESOURCE, WINED3D_CS_OP_UNLOAD_RESOURCE, WINED3D_CS_OP_MAP, -@@ -66,6 +76,21 @@ enum wined3d_cs_op +@@ -66,6 +76,20 @@ enum wined3d_cs_op WINED3D_CS_OP_BLT_SUB_RESOURCE, WINED3D_CS_OP_UPDATE_SUB_RESOURCE, WINED3D_CS_OP_ADD_DIRTY_TEXTURE_REGION, +#if defined(STAGING_CSMT) + WINED3D_CS_OP_PUSH_CONSTANTS, -+ WINED3D_CS_OP_UPDATE_SWAP_INTERVAL, + WINED3D_CS_OP_STOP, +}; + @@ -106,7 +104,7 @@ diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c }; struct wined3d_cs_present -@@ -81,6 +106,9 @@ struct wined3d_cs_present +@@ -81,6 +105,9 @@ struct wined3d_cs_present struct wined3d_cs_clear { enum wined3d_cs_op opcode; @@ -116,7 +114,7 @@ diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c DWORD flags; unsigned int rt_count; struct wined3d_fb_state *fb; -@@ -319,6 +347,16 @@ struct wined3d_cs_query_issue +@@ -319,6 +346,16 @@ struct wined3d_cs_query_issue DWORD flags; }; @@ -133,7 +131,7 @@ diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c struct wined3d_cs_preload_resource { enum wined3d_cs_op opcode; -@@ -367,10 +405,16 @@ struct wined3d_cs_blt_sub_resource +@@ -367,10 +404,16 @@ struct wined3d_cs_blt_sub_resource struct wined3d_cs_update_sub_resource { enum wined3d_cs_op opcode; @@ -150,7 +148,7 @@ diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c }; struct wined3d_cs_add_dirty_texture_region -@@ -380,7 +424,66 @@ struct wined3d_cs_add_dirty_texture_region +@@ -380,7 +423,60 @@ struct wined3d_cs_add_dirty_texture_region unsigned int layer; }; @@ -166,12 +164,6 @@ diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c + BYTE constants[1]; +}; + -+struct wined3d_cs_update_swap_interval -+{ -+ enum wined3d_cs_op opcode; -+ struct wined3d_swapchain *swapchain; -+}; -+ +struct wined3d_cs_stop +{ + enum wined3d_cs_op opcode; @@ -217,7 +209,7 @@ diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c { const struct wined3d_cs_present *op = data; struct wined3d_swapchain *swapchain; -@@ -391,11 +494,19 @@ static void wined3d_cs_exec_present(struct wined3d_cs *cs, const void *data) +@@ -391,11 +487,19 @@ static void wined3d_cs_exec_present(struct wined3d_cs *cs, const void *data) swapchain->swapchain_ops->swapchain_present(swapchain, &op->src_rect, &op->dst_rect, op->flags); @@ -237,7 +229,7 @@ diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c } void wined3d_cs_emit_present(struct wined3d_cs *cs, struct wined3d_swapchain *swapchain, -@@ -403,8 +514,14 @@ void wined3d_cs_emit_present(struct wined3d_cs *cs, struct wined3d_swapchain *sw +@@ -403,8 +507,14 @@ void wined3d_cs_emit_present(struct wined3d_cs *cs, struct wined3d_swapchain *sw { struct wined3d_cs_present *op; unsigned int i; @@ -252,7 +244,7 @@ diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c op->opcode = WINED3D_CS_OP_PRESENT; op->dst_window_override = dst_window_override; op->swapchain = swapchain; -@@ -418,10 +535,30 @@ void wined3d_cs_emit_present(struct wined3d_cs *cs, struct wined3d_swapchain *sw +@@ -418,10 +528,30 @@ void wined3d_cs_emit_present(struct wined3d_cs *cs, struct wined3d_swapchain *sw wined3d_resource_acquire(&swapchain->back_buffers[i]->resource); } @@ -283,7 +275,7 @@ diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c { const struct wined3d_state *state = &cs->state; const struct wined3d_cs_clear *op = data; -@@ -444,6 +581,10 @@ static void wined3d_cs_exec_clear(struct wined3d_cs *cs, const void *data) +@@ -444,6 +574,10 @@ static void wined3d_cs_exec_clear(struct wined3d_cs *cs, const void *data) } if (op->flags & (WINED3DCLEAR_ZBUFFER | WINED3DCLEAR_STENCIL)) wined3d_resource_release(op->fb->depth_stencil->resource); @@ -294,7 +286,7 @@ diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c } void wined3d_cs_emit_clear(struct wined3d_cs *cs, DWORD rect_count, const RECT *rects, -@@ -452,10 +593,19 @@ void wined3d_cs_emit_clear(struct wined3d_cs *cs, DWORD rect_count, const RECT * +@@ -452,10 +586,19 @@ void wined3d_cs_emit_clear(struct wined3d_cs *cs, DWORD rect_count, const RECT * unsigned int rt_count = cs->device->adapter->gl_info.limits.buffers; const struct wined3d_state *state = &cs->device->state; struct wined3d_cs_clear *op; @@ -314,7 +306,7 @@ diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c op->flags = flags; op->rt_count = rt_count; op->fb = &cs->fb; -@@ -489,13 +639,22 @@ void wined3d_cs_emit_clear_rendertarget_view(struct wined3d_cs *cs, struct wined +@@ -489,13 +632,22 @@ void wined3d_cs_emit_clear_rendertarget_view(struct wined3d_cs *cs, struct wined struct wined3d_rendertarget_view *rt; struct wined3d_fb_state fb; } *extra; @@ -337,7 +329,7 @@ diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c op->flags = flags; if (flags & WINED3DCLEAR_TARGET) { -@@ -627,7 +786,11 @@ static void release_unordered_access_resources(const struct wined3d_shader *shad +@@ -627,7 +779,11 @@ static void release_unordered_access_resources(const struct wined3d_shader *shad } } @@ -349,7 +341,7 @@ diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c { const struct wined3d_cs_dispatch *op = data; struct wined3d_state *state = &cs->state; -@@ -638,6 +801,10 @@ static void wined3d_cs_exec_dispatch(struct wined3d_cs *cs, const void *data) +@@ -638,6 +794,10 @@ static void wined3d_cs_exec_dispatch(struct wined3d_cs *cs, const void *data) release_shader_resources(state, 1u << WINED3D_SHADER_TYPE_COMPUTE); release_unordered_access_resources(state->shader[WINED3D_SHADER_TYPE_COMPUTE], state->unordered_access_view[WINED3D_PIPELINE_COMPUTE]); @@ -360,7 +352,7 @@ diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c } void wined3d_cs_emit_dispatch(struct wined3d_cs *cs, -@@ -646,7 +813,11 @@ void wined3d_cs_emit_dispatch(struct wined3d_cs *cs, +@@ -646,7 +806,11 @@ void wined3d_cs_emit_dispatch(struct wined3d_cs *cs, const struct wined3d_state *state = &cs->device->state; struct wined3d_cs_dispatch *op; @@ -372,7 +364,7 @@ diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c op->opcode = WINED3D_CS_OP_DISPATCH; op->group_count_x = group_count_x; op->group_count_y = group_count_y; -@@ -659,7 +830,11 @@ void wined3d_cs_emit_dispatch(struct wined3d_cs *cs, +@@ -659,7 +823,11 @@ void wined3d_cs_emit_dispatch(struct wined3d_cs *cs, cs->ops->submit(cs); } @@ -384,7 +376,7 @@ diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c { struct wined3d_state *state = &cs->state; const struct wined3d_cs_draw *op = data; -@@ -709,6 +884,10 @@ static void wined3d_cs_exec_draw(struct wined3d_cs *cs, const void *data) +@@ -709,6 +877,10 @@ static void wined3d_cs_exec_draw(struct wined3d_cs *cs, const void *data) release_shader_resources(state, ~(1u << WINED3D_SHADER_TYPE_COMPUTE)); release_unordered_access_resources(state->shader[WINED3D_SHADER_TYPE_PIXEL], state->unordered_access_view[WINED3D_PIPELINE_GRAPHICS]); @@ -395,7 +387,7 @@ diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c } void wined3d_cs_emit_draw(struct wined3d_cs *cs, GLenum primitive_type, int base_vertex_idx, unsigned int start_idx, -@@ -718,7 +897,11 @@ void wined3d_cs_emit_draw(struct wined3d_cs *cs, GLenum primitive_type, int base +@@ -718,7 +890,11 @@ void wined3d_cs_emit_draw(struct wined3d_cs *cs, GLenum primitive_type, int base struct wined3d_cs_draw *op; unsigned int i; @@ -407,7 +399,7 @@ diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c op->opcode = WINED3D_CS_OP_DRAW; op->primitive_type = primitive_type; op->base_vertex_idx = base_vertex_idx; -@@ -759,70 +942,123 @@ void wined3d_cs_emit_draw(struct wined3d_cs *cs, GLenum primitive_type, int base +@@ -759,70 +935,123 @@ void wined3d_cs_emit_draw(struct wined3d_cs *cs, GLenum primitive_type, int base cs->ops->submit(cs); } @@ -531,7 +523,7 @@ diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c } void wined3d_cs_emit_set_rendertarget_view(struct wined3d_cs *cs, unsigned int view_idx, -@@ -830,15 +1066,26 @@ void wined3d_cs_emit_set_rendertarget_view(struct wined3d_cs *cs, unsigned int v +@@ -830,15 +1059,26 @@ void wined3d_cs_emit_set_rendertarget_view(struct wined3d_cs *cs, unsigned int v { struct wined3d_cs_set_rendertarget_view *op; @@ -558,7 +550,7 @@ diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c { const struct wined3d_cs_set_depth_stencil_view *op = data; struct wined3d_device *device = cs->device; -@@ -873,39 +1120,69 @@ static void wined3d_cs_exec_set_depth_stencil_view(struct wined3d_cs *cs, const +@@ -873,39 +1113,69 @@ static void wined3d_cs_exec_set_depth_stencil_view(struct wined3d_cs *cs, const } device_invalidate_state(device, STATE_FRAMEBUFFER); @@ -628,7 +620,7 @@ diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c { const struct wined3d_cs_set_stream_source *op = data; struct wined3d_stream_state *stream; -@@ -923,6 +1200,10 @@ static void wined3d_cs_exec_set_stream_source(struct wined3d_cs *cs, const void +@@ -923,6 +1193,10 @@ static void wined3d_cs_exec_set_stream_source(struct wined3d_cs *cs, const void InterlockedDecrement(&prev->resource.bind_count); device_invalidate_state(cs->device, STATE_STREAMSRC); @@ -639,7 +631,7 @@ diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c } void wined3d_cs_emit_set_stream_source(struct wined3d_cs *cs, UINT stream_idx, -@@ -930,17 +1211,28 @@ void wined3d_cs_emit_set_stream_source(struct wined3d_cs *cs, UINT stream_idx, +@@ -930,17 +1204,28 @@ void wined3d_cs_emit_set_stream_source(struct wined3d_cs *cs, UINT stream_idx, { struct wined3d_cs_set_stream_source *op; @@ -668,7 +660,7 @@ diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c { const struct wined3d_cs_set_stream_source_freq *op = data; struct wined3d_stream_state *stream; -@@ -950,22 +1242,37 @@ static void wined3d_cs_exec_set_stream_source_freq(struct wined3d_cs *cs, const +@@ -950,22 +1235,37 @@ static void wined3d_cs_exec_set_stream_source_freq(struct wined3d_cs *cs, const stream->flags = op->flags; device_invalidate_state(cs->device, STATE_STREAMSRC); @@ -706,7 +698,7 @@ diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c { const struct wined3d_cs_set_stream_output *op = data; struct wined3d_stream_output *stream; -@@ -982,6 +1289,10 @@ static void wined3d_cs_exec_set_stream_output(struct wined3d_cs *cs, const void +@@ -982,6 +1282,10 @@ static void wined3d_cs_exec_set_stream_output(struct wined3d_cs *cs, const void InterlockedDecrement(&prev->resource.bind_count); device_invalidate_state(cs->device, STATE_STREAM_OUTPUT); @@ -717,7 +709,7 @@ diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c } void wined3d_cs_emit_set_stream_output(struct wined3d_cs *cs, UINT stream_idx, -@@ -989,16 +1300,27 @@ void wined3d_cs_emit_set_stream_output(struct wined3d_cs *cs, UINT stream_idx, +@@ -989,16 +1293,27 @@ void wined3d_cs_emit_set_stream_output(struct wined3d_cs *cs, UINT stream_idx, { struct wined3d_cs_set_stream_output *op; @@ -745,7 +737,7 @@ diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c { const struct wined3d_cs_set_index_buffer *op = data; struct wined3d_buffer *prev; -@@ -1014,6 +1336,10 @@ static void wined3d_cs_exec_set_index_buffer(struct wined3d_cs *cs, const void * +@@ -1014,6 +1329,10 @@ static void wined3d_cs_exec_set_index_buffer(struct wined3d_cs *cs, const void * InterlockedDecrement(&prev->resource.bind_count); device_invalidate_state(cs->device, STATE_INDEXBUFFER); @@ -756,7 +748,7 @@ diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c } void wined3d_cs_emit_set_index_buffer(struct wined3d_cs *cs, struct wined3d_buffer *buffer, -@@ -1021,16 +1347,27 @@ void wined3d_cs_emit_set_index_buffer(struct wined3d_cs *cs, struct wined3d_buff +@@ -1021,16 +1340,27 @@ void wined3d_cs_emit_set_index_buffer(struct wined3d_cs *cs, struct wined3d_buff { struct wined3d_cs_set_index_buffer *op; @@ -784,7 +776,7 @@ diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c { const struct wined3d_cs_set_constant_buffer *op = data; struct wined3d_buffer *prev; -@@ -1044,6 +1381,9 @@ static void wined3d_cs_exec_set_constant_buffer(struct wined3d_cs *cs, const voi +@@ -1044,6 +1374,9 @@ static void wined3d_cs_exec_set_constant_buffer(struct wined3d_cs *cs, const voi InterlockedDecrement(&prev->resource.bind_count); device_invalidate_state(cs->device, STATE_CONSTANT_BUFFER(op->type)); @@ -794,7 +786,7 @@ diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c } void wined3d_cs_emit_set_constant_buffer(struct wined3d_cs *cs, enum wined3d_shader_type type, -@@ -1051,16 +1391,27 @@ void wined3d_cs_emit_set_constant_buffer(struct wined3d_cs *cs, enum wined3d_sha +@@ -1051,16 +1384,27 @@ void wined3d_cs_emit_set_constant_buffer(struct wined3d_cs *cs, enum wined3d_sha { struct wined3d_cs_set_constant_buffer *op; @@ -822,7 +814,7 @@ diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c { const struct wined3d_gl_info *gl_info = &cs->device->adapter->gl_info; const struct wined3d_d3d_info *d3d_info = &cs->device->adapter->d3d_info; -@@ -1137,21 +1488,36 @@ static void wined3d_cs_exec_set_texture(struct wined3d_cs *cs, const void *data) +@@ -1137,21 +1481,36 @@ static void wined3d_cs_exec_set_texture(struct wined3d_cs *cs, const void *data) if (new_use_color_key) device_invalidate_state(cs->device, STATE_COLOR_KEY); @@ -859,7 +851,7 @@ diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c { const struct wined3d_cs_set_shader_resource_view *op = data; struct wined3d_shader_resource_view *prev; -@@ -1168,6 +1534,10 @@ static void wined3d_cs_exec_set_shader_resource_view(struct wined3d_cs *cs, cons +@@ -1168,6 +1527,10 @@ static void wined3d_cs_exec_set_shader_resource_view(struct wined3d_cs *cs, cons device_invalidate_state(cs->device, STATE_GRAPHICS_SHADER_RESOURCE_BINDING); else device_invalidate_state(cs->device, STATE_COMPUTE_SHADER_RESOURCE_BINDING); @@ -870,7 +862,7 @@ diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c } void wined3d_cs_emit_set_shader_resource_view(struct wined3d_cs *cs, enum wined3d_shader_type type, -@@ -1175,16 +1545,27 @@ void wined3d_cs_emit_set_shader_resource_view(struct wined3d_cs *cs, enum wined3 +@@ -1175,16 +1538,27 @@ void wined3d_cs_emit_set_shader_resource_view(struct wined3d_cs *cs, enum wined3 { struct wined3d_cs_set_shader_resource_view *op; @@ -898,7 +890,7 @@ diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c { const struct wined3d_cs_set_unordered_access_view *op = data; struct wined3d_unordered_access_view *prev; -@@ -1198,6 +1579,10 @@ static void wined3d_cs_exec_set_unordered_access_view(struct wined3d_cs *cs, con +@@ -1198,6 +1572,10 @@ static void wined3d_cs_exec_set_unordered_access_view(struct wined3d_cs *cs, con InterlockedDecrement(&prev->resource->bind_count); device_invalidate_state(cs->device, STATE_UNORDERED_ACCESS_VIEW_BINDING(op->pipeline)); @@ -909,7 +901,7 @@ diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c } void wined3d_cs_emit_set_unordered_access_view(struct wined3d_cs *cs, enum wined3d_pipeline pipeline, -@@ -1205,16 +1590,27 @@ void wined3d_cs_emit_set_unordered_access_view(struct wined3d_cs *cs, enum wined +@@ -1205,16 +1583,27 @@ void wined3d_cs_emit_set_unordered_access_view(struct wined3d_cs *cs, enum wined { struct wined3d_cs_set_unordered_access_view *op; @@ -937,7 +929,7 @@ diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c { const struct wined3d_cs_set_sampler *op = data; -@@ -1223,6 +1619,10 @@ static void wined3d_cs_exec_set_sampler(struct wined3d_cs *cs, const void *data) +@@ -1223,6 +1612,10 @@ static void wined3d_cs_exec_set_sampler(struct wined3d_cs *cs, const void *data) device_invalidate_state(cs->device, STATE_GRAPHICS_SHADER_RESOURCE_BINDING); else device_invalidate_state(cs->device, STATE_COMPUTE_SHADER_RESOURCE_BINDING); @@ -948,7 +940,7 @@ diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c } void wined3d_cs_emit_set_sampler(struct wined3d_cs *cs, enum wined3d_shader_type type, -@@ -1230,16 +1630,27 @@ void wined3d_cs_emit_set_sampler(struct wined3d_cs *cs, enum wined3d_shader_type +@@ -1230,16 +1623,27 @@ void wined3d_cs_emit_set_sampler(struct wined3d_cs *cs, enum wined3d_shader_type { struct wined3d_cs_set_sampler *op; @@ -976,7 +968,7 @@ diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c { const struct wined3d_cs_set_shader *op = data; -@@ -1249,26 +1660,45 @@ static void wined3d_cs_exec_set_shader(struct wined3d_cs *cs, const void *data) +@@ -1249,26 +1653,45 @@ static void wined3d_cs_exec_set_shader(struct wined3d_cs *cs, const void *data) device_invalidate_state(cs->device, STATE_GRAPHICS_SHADER_RESOURCE_BINDING); else device_invalidate_state(cs->device, STATE_COMPUTE_SHADER_RESOURCE_BINDING); @@ -1022,7 +1014,7 @@ diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c } void wined3d_cs_emit_set_rasterizer_state(struct wined3d_cs *cs, -@@ -1276,39 +1706,69 @@ void wined3d_cs_emit_set_rasterizer_state(struct wined3d_cs *cs, +@@ -1276,39 +1699,69 @@ void wined3d_cs_emit_set_rasterizer_state(struct wined3d_cs *cs, { struct wined3d_cs_set_rasterizer_state *op; @@ -1092,7 +1084,7 @@ diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c } void wined3d_cs_emit_set_texture_state(struct wined3d_cs *cs, UINT stage, -@@ -1316,21 +1776,36 @@ void wined3d_cs_emit_set_texture_state(struct wined3d_cs *cs, UINT stage, +@@ -1316,21 +1769,36 @@ void wined3d_cs_emit_set_texture_state(struct wined3d_cs *cs, UINT stage, { struct wined3d_cs_set_texture_state *op; @@ -1129,7 +1121,7 @@ diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c } void wined3d_cs_emit_set_sampler_state(struct wined3d_cs *cs, UINT sampler_idx, -@@ -1338,22 +1813,37 @@ void wined3d_cs_emit_set_sampler_state(struct wined3d_cs *cs, UINT sampler_idx, +@@ -1338,22 +1806,37 @@ void wined3d_cs_emit_set_sampler_state(struct wined3d_cs *cs, UINT sampler_idx, { struct wined3d_cs_set_sampler_state *op; @@ -1167,7 +1159,7 @@ diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c } void wined3d_cs_emit_set_transform(struct wined3d_cs *cs, enum wined3d_transform_state state, -@@ -1361,35 +1851,61 @@ void wined3d_cs_emit_set_transform(struct wined3d_cs *cs, enum wined3d_transform +@@ -1361,35 +1844,61 @@ void wined3d_cs_emit_set_transform(struct wined3d_cs *cs, enum wined3d_transform { struct wined3d_cs_set_transform *op; @@ -1229,7 +1221,7 @@ diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c { const struct wined3d_cs_set_color_key *op = data; struct wined3d_texture *texture = op->texture; -@@ -1450,6 +1966,10 @@ static void wined3d_cs_exec_set_color_key(struct wined3d_cs *cs, const void *dat +@@ -1450,6 +1959,10 @@ static void wined3d_cs_exec_set_color_key(struct wined3d_cs *cs, const void *dat break; } } @@ -1240,7 +1232,7 @@ diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c } void wined3d_cs_emit_set_color_key(struct wined3d_cs *cs, struct wined3d_texture *texture, -@@ -1457,7 +1977,11 @@ void wined3d_cs_emit_set_color_key(struct wined3d_cs *cs, struct wined3d_texture +@@ -1457,7 +1970,11 @@ void wined3d_cs_emit_set_color_key(struct wined3d_cs *cs, struct wined3d_texture { struct wined3d_cs_set_color_key *op; @@ -1252,7 +1244,7 @@ diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c op->opcode = WINED3D_CS_OP_SET_COLOR_KEY; op->texture = texture; op->flags = flags; -@@ -1469,29 +1993,51 @@ void wined3d_cs_emit_set_color_key(struct wined3d_cs *cs, struct wined3d_texture +@@ -1469,29 +1986,51 @@ void wined3d_cs_emit_set_color_key(struct wined3d_cs *cs, struct wined3d_texture else op->set = 0; @@ -1304,7 +1296,7 @@ diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c { const struct wined3d_cs_set_light *op = data; struct wined3d_light_info *light_info; -@@ -1505,7 +2051,11 @@ static void wined3d_cs_exec_set_light(struct wined3d_cs *cs, const void *data) +@@ -1505,7 +2044,11 @@ static void wined3d_cs_exec_set_light(struct wined3d_cs *cs, const void *data) if (!(light_info = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(*light_info)))) { ERR("Failed to allocate light info.\n"); @@ -1316,7 +1308,7 @@ diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c } hash_idx = LIGHTMAP_HASHFUNC(light_idx); -@@ -1526,20 +2076,35 @@ static void wined3d_cs_exec_set_light(struct wined3d_cs *cs, const void *data) +@@ -1526,20 +2069,35 @@ static void wined3d_cs_exec_set_light(struct wined3d_cs *cs, const void *data) light_info->direction = op->light.direction; light_info->exponent = op->light.exponent; light_info->cutoff = op->light.cutoff; @@ -1352,7 +1344,7 @@ diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c { const struct wined3d_cs_set_light_enable *op = data; struct wined3d_device *device = cs->device; -@@ -1549,7 +2114,11 @@ static void wined3d_cs_exec_set_light_enable(struct wined3d_cs *cs, const void * +@@ -1549,7 +2107,11 @@ static void wined3d_cs_exec_set_light_enable(struct wined3d_cs *cs, const void * if (!(light_info = wined3d_state_get_light(&cs->state, op->idx))) { ERR("Light doesn't exist.\n"); @@ -1364,7 +1356,7 @@ diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c } prev_idx = light_info->glIndex; -@@ -1559,21 +2128,36 @@ static void wined3d_cs_exec_set_light_enable(struct wined3d_cs *cs, const void * +@@ -1559,21 +2121,36 @@ static void wined3d_cs_exec_set_light_enable(struct wined3d_cs *cs, const void * device_invalidate_state(device, STATE_LIGHT_TYPE); device_invalidate_state(device, STATE_ACTIVELIGHT(op->enable ? light_info->glIndex : prev_idx)); } @@ -1401,7 +1393,7 @@ diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c { struct wined3d_adapter *adapter = cs->device->adapter; -@@ -1581,12 +2165,17 @@ static void wined3d_cs_exec_reset_state(struct wined3d_cs *cs, const void *data) +@@ -1581,12 +2158,17 @@ static void wined3d_cs_exec_reset_state(struct wined3d_cs *cs, const void *data) memset(&cs->state, 0, sizeof(cs->state)); state_init(&cs->state, &cs->fb, &adapter->gl_info, &adapter->d3d_info, WINED3D_STATE_NO_REF | WINED3D_STATE_INIT_DEFAULT); @@ -1419,7 +1411,7 @@ diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c op = cs->ops->require_space(cs, sizeof(*op)); op->opcode = WINED3D_CS_OP_RESET_STATE; -@@ -1594,17 +2183,34 @@ void wined3d_cs_emit_reset_state(struct wined3d_cs *cs) +@@ -1594,17 +2176,34 @@ void wined3d_cs_emit_reset_state(struct wined3d_cs *cs) } static void wined3d_cs_exec_callback(struct wined3d_cs *cs, const void *data) @@ -1454,7 +1446,7 @@ diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c op->opcode = WINED3D_CS_OP_CALLBACK; op->callback = callback; op->object = object; -@@ -1622,40 +2228,103 @@ void wined3d_cs_init_object(struct wined3d_cs *cs, void (*callback)(void *object +@@ -1622,40 +2221,103 @@ void wined3d_cs_init_object(struct wined3d_cs *cs, void (*callback)(void *object wined3d_cs_emit_callback(cs, callback, object); } @@ -1558,7 +1550,7 @@ diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c op->opcode = WINED3D_CS_OP_PRELOAD_RESOURCE; op->resource = resource; -@@ -1664,20 +2333,32 @@ void wined3d_cs_emit_preload_resource(struct wined3d_cs *cs, struct wined3d_reso +@@ -1664,20 +2326,32 @@ void wined3d_cs_emit_preload_resource(struct wined3d_cs *cs, struct wined3d_reso cs->ops->submit(cs); } @@ -1591,7 +1583,7 @@ diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c op->opcode = WINED3D_CS_OP_UNLOAD_RESOURCE; op->resource = resource; -@@ -1686,13 +2367,21 @@ void wined3d_cs_emit_unload_resource(struct wined3d_cs *cs, struct wined3d_resou +@@ -1686,13 +2360,21 @@ void wined3d_cs_emit_unload_resource(struct wined3d_cs *cs, struct wined3d_resou cs->ops->submit(cs); } @@ -1613,7 +1605,7 @@ diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c } HRESULT wined3d_cs_map(struct wined3d_cs *cs, struct wined3d_resource *resource, unsigned int sub_resource_idx, -@@ -1701,7 +2390,11 @@ HRESULT wined3d_cs_map(struct wined3d_cs *cs, struct wined3d_resource *resource, +@@ -1701,7 +2383,11 @@ HRESULT wined3d_cs_map(struct wined3d_cs *cs, struct wined3d_resource *resource, struct wined3d_cs_map *op; HRESULT hr; @@ -1625,7 +1617,7 @@ diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c op->opcode = WINED3D_CS_OP_MAP; op->resource = resource; op->sub_resource_idx = sub_resource_idx; -@@ -1710,17 +2403,29 @@ HRESULT wined3d_cs_map(struct wined3d_cs *cs, struct wined3d_resource *resource, +@@ -1710,17 +2396,29 @@ HRESULT wined3d_cs_map(struct wined3d_cs *cs, struct wined3d_resource *resource, op->flags = flags; op->hr = &hr; @@ -1655,7 +1647,7 @@ diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c } HRESULT wined3d_cs_unmap(struct wined3d_cs *cs, struct wined3d_resource *resource, unsigned int sub_resource_idx) -@@ -1728,18 +2433,30 @@ HRESULT wined3d_cs_unmap(struct wined3d_cs *cs, struct wined3d_resource *resourc +@@ -1728,18 +2426,30 @@ HRESULT wined3d_cs_unmap(struct wined3d_cs *cs, struct wined3d_resource *resourc struct wined3d_cs_unmap *op; HRESULT hr; @@ -1686,7 +1678,7 @@ diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c { const struct wined3d_cs_blt_sub_resource *op = data; -@@ -1779,14 +2496,22 @@ static void wined3d_cs_exec_blt_sub_resource(struct wined3d_cs *cs, const void * +@@ -1779,14 +2489,22 @@ static void wined3d_cs_exec_blt_sub_resource(struct wined3d_cs *cs, const void * { FIXME("Flags %#x not implemented for %s resources.\n", op->flags, debug_d3dresourcetype(op->dst_resource->type)); @@ -1709,7 +1701,7 @@ diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c } update_w = op->dst_box.right - op->dst_box.left; -@@ -1798,14 +2523,22 @@ static void wined3d_cs_exec_blt_sub_resource(struct wined3d_cs *cs, const void * +@@ -1798,14 +2516,22 @@ static void wined3d_cs_exec_blt_sub_resource(struct wined3d_cs *cs, const void * { FIXME("Stretching not implemented for %s resources.\n", debug_d3dresourcetype(op->dst_resource->type)); @@ -1732,7 +1724,7 @@ diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c } dst_texture = texture_from_resource(op->dst_resource); -@@ -1819,7 +2552,11 @@ static void wined3d_cs_exec_blt_sub_resource(struct wined3d_cs *cs, const void * +@@ -1819,7 +2545,11 @@ static void wined3d_cs_exec_blt_sub_resource(struct wined3d_cs *cs, const void * ERR("Failed to load source sub-resource into %s.\n", wined3d_debug_location(src_texture->resource.map_binding)); context_release(context); @@ -1744,7 +1736,7 @@ diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c } level = op->dst_sub_resource_idx % dst_texture->level_count; -@@ -1834,7 +2571,11 @@ static void wined3d_cs_exec_blt_sub_resource(struct wined3d_cs *cs, const void * +@@ -1834,7 +2564,11 @@ static void wined3d_cs_exec_blt_sub_resource(struct wined3d_cs *cs, const void * { ERR("Failed to load destination sub-resource.\n"); context_release(context); @@ -1756,7 +1748,7 @@ diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c } wined3d_texture_get_memory(src_texture, op->src_sub_resource_idx, &addr, src_texture->resource.map_binding); -@@ -1854,9 +2595,16 @@ static void wined3d_cs_exec_blt_sub_resource(struct wined3d_cs *cs, const void * +@@ -1854,9 +2588,16 @@ static void wined3d_cs_exec_blt_sub_resource(struct wined3d_cs *cs, const void * FIXME("Not implemented for %s resources.\n", debug_d3dresourcetype(op->dst_resource->type)); } @@ -1773,7 +1765,7 @@ diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c } void wined3d_cs_emit_blt_sub_resource(struct wined3d_cs *cs, struct wined3d_resource *dst_resource, -@@ -1866,7 +2614,11 @@ void wined3d_cs_emit_blt_sub_resource(struct wined3d_cs *cs, struct wined3d_reso +@@ -1866,7 +2607,11 @@ void wined3d_cs_emit_blt_sub_resource(struct wined3d_cs *cs, struct wined3d_reso { struct wined3d_cs_blt_sub_resource *op; @@ -1785,7 +1777,7 @@ diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c op->opcode = WINED3D_CS_OP_BLT_SUB_RESOURCE; op->dst_resource = dst_resource; op->dst_sub_resource_idx = dst_sub_resource_idx; -@@ -1886,7 +2638,11 @@ void wined3d_cs_emit_blt_sub_resource(struct wined3d_cs *cs, struct wined3d_reso +@@ -1886,7 +2631,11 @@ void wined3d_cs_emit_blt_sub_resource(struct wined3d_cs *cs, struct wined3d_reso cs->ops->submit(cs); } @@ -1797,7 +1789,7 @@ diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c { const struct wined3d_cs_update_sub_resource *op = data; const struct wined3d_box *box = &op->box; -@@ -1936,6 +2692,9 @@ static void wined3d_cs_exec_update_sub_resource(struct wined3d_cs *cs, const voi +@@ -1936,6 +2685,9 @@ static void wined3d_cs_exec_update_sub_resource(struct wined3d_cs *cs, const voi done: wined3d_resource_release(op->resource); @@ -1807,7 +1799,7 @@ diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c } void wined3d_cs_emit_update_sub_resource(struct wined3d_cs *cs, struct wined3d_resource *resource, -@@ -1943,22 +2702,83 @@ void wined3d_cs_emit_update_sub_resource(struct wined3d_cs *cs, struct wined3d_r +@@ -1943,22 +2695,83 @@ void wined3d_cs_emit_update_sub_resource(struct wined3d_cs *cs, struct wined3d_r unsigned int slice_pitch) { struct wined3d_cs_update_sub_resource *op; @@ -1891,7 +1883,7 @@ diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c { const struct wined3d_cs_add_dirty_texture_region *op = data; struct wined3d_texture *texture = op->texture; -@@ -1977,6 +2797,10 @@ static void wined3d_cs_exec_add_dirty_texture_region(struct wined3d_cs *cs, cons +@@ -1977,6 +2790,10 @@ static void wined3d_cs_exec_add_dirty_texture_region(struct wined3d_cs *cs, cons context_release(context); wined3d_resource_release(&texture->resource); @@ -1902,7 +1894,7 @@ diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c } void wined3d_cs_emit_add_dirty_texture_region(struct wined3d_cs *cs, -@@ -1984,7 +2808,11 @@ void wined3d_cs_emit_add_dirty_texture_region(struct wined3d_cs *cs, +@@ -1984,7 +2801,11 @@ void wined3d_cs_emit_add_dirty_texture_region(struct wined3d_cs *cs, { struct wined3d_cs_add_dirty_texture_region *op; @@ -1914,7 +1906,7 @@ diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c op->opcode = WINED3D_CS_OP_ADD_DIRTY_TEXTURE_REGION; op->texture = texture; op->layer = layer; -@@ -1994,8 +2822,96 @@ void wined3d_cs_emit_add_dirty_texture_region(struct wined3d_cs *cs, +@@ -1994,8 +2815,76 @@ void wined3d_cs_emit_add_dirty_texture_region(struct wined3d_cs *cs, cs->ops->submit(cs); } @@ -1983,26 +1975,6 @@ diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c + cs->ops->submit_delayed(cs); +} + -+static UINT wined3d_cs_exec_update_swap_interval(struct wined3d_cs *cs, const void *data) -+{ -+ const struct wined3d_cs_update_swap_interval *op = data; -+ -+ swapchain_update_swap_interval(op->swapchain); -+ -+ return sizeof(*op); -+} -+ -+void wined3d_cs_emit_update_swap_interval(struct wined3d_cs *cs, struct wined3d_swapchain *swapchain) -+{ -+ struct wined3d_cs_update_swap_interval *op; -+ -+ op = cs->ops->require_space(cs, sizeof(*op), 0); -+ op->opcode = WINED3D_CS_OP_UPDATE_SWAP_INTERVAL; -+ op->swapchain = swapchain; -+ -+ cs->ops->submit_and_wait(cs); -+} -+ +static UINT (* const wined3d_cs_op_handlers[])(struct wined3d_cs *cs, const void *data) = +{ + /* WINED3D_CS_OP_SYNC */ wined3d_cs_exec_sync, @@ -2011,7 +1983,7 @@ diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c /* WINED3D_CS_OP_PRESENT */ wined3d_cs_exec_present, /* WINED3D_CS_OP_CLEAR */ wined3d_cs_exec_clear, /* WINED3D_CS_OP_DISPATCH */ wined3d_cs_exec_dispatch, -@@ -2029,6 +2945,9 @@ static void (* const wined3d_cs_op_handlers[])(struct wined3d_cs *cs, const void +@@ -2029,6 +2918,9 @@ static void (* const wined3d_cs_op_handlers[])(struct wined3d_cs *cs, const void /* WINED3D_CS_OP_RESET_STATE */ wined3d_cs_exec_reset_state, /* WINED3D_CS_OP_CALLBACK */ wined3d_cs_exec_callback, /* WINED3D_CS_OP_QUERY_ISSUE */ wined3d_cs_exec_query_issue, @@ -2021,7 +1993,7 @@ diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c /* WINED3D_CS_OP_PRELOAD_RESOURCE */ wined3d_cs_exec_preload_resource, /* WINED3D_CS_OP_UNLOAD_RESOURCE */ wined3d_cs_exec_unload_resource, /* WINED3D_CS_OP_MAP */ wined3d_cs_exec_map, -@@ -2036,9 +2955,17 @@ static void (* const wined3d_cs_op_handlers[])(struct wined3d_cs *cs, const void +@@ -2036,9 +2928,16 @@ static void (* const wined3d_cs_op_handlers[])(struct wined3d_cs *cs, const void /* WINED3D_CS_OP_BLT_SUB_RESOURCE */ wined3d_cs_exec_blt_sub_resource, /* WINED3D_CS_OP_UPDATE_SUB_RESOURCE */ wined3d_cs_exec_update_sub_resource, /* WINED3D_CS_OP_ADD_DIRTY_TEXTURE_REGION */ wined3d_cs_exec_add_dirty_texture_region, @@ -2031,7 +2003,6 @@ diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c static void *wined3d_cs_st_require_space(struct wined3d_cs *cs, size_t size) +#else /* STAGING_CSMT */ + /* WINED3D_CS_OP_PUSH_CONSTANTS */ wined3d_cs_exec_push_constants, -+ /* WINED3D_CS_OP_UPDATE_SWAP_INTERVAL */ wined3d_cs_exec_update_swap_interval, +}; + +static void *wined3d_cs_st_require_space(struct wined3d_cs *cs, size_t size, int priority) @@ -2039,7 +2010,7 @@ diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c { if (size > (cs->data_size - cs->end)) { -@@ -2082,6 +3009,7 @@ static void wined3d_cs_st_submit(struct wined3d_cs *cs) +@@ -2082,6 +2981,7 @@ static void wined3d_cs_st_submit(struct wined3d_cs *cs) HeapFree(GetProcessHeap(), 0, data); } @@ -2047,7 +2018,7 @@ diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c static void wined3d_cs_st_push_constants(struct wined3d_cs *cs, enum wined3d_push_constants p, unsigned int start_idx, unsigned int count, const void *constants) { -@@ -2122,15 +3050,271 @@ static void wined3d_cs_st_push_constants(struct wined3d_cs *cs, enum wined3d_pus +@@ -2122,15 +3022,271 @@ static void wined3d_cs_st_push_constants(struct wined3d_cs *cs, enum wined3d_pus for (i = 0, context_count = device->context_count; i < context_count; ++i) { device->contexts[i]->constant_update_mask |= push_constant_info[p].mask; @@ -2106,18 +2077,9 @@ diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c + else + { + WaitForSingleObject(cs->event, INFINITE); -+#endif /* STAGING_CSMT */ + } +} + -+#if !defined(STAGING_CSMT) - static const struct wined3d_cs_ops wined3d_cs_st_ops = - { - wined3d_cs_st_require_space, - wined3d_cs_st_submit, - wined3d_cs_st_push_constants, - }; -+#else /* STAGING_CSMT */ +static struct wined3d_cs_block *wined3d_cs_dequeue_command(struct wined3d_cs *cs) +{ + struct wined3d_cs_block *block; @@ -2137,9 +2099,18 @@ diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c + wined3d_cs_wait_event(cs); + spin_count = 0; + } ++#endif /* STAGING_CSMT */ + } +} + ++#if !defined(STAGING_CSMT) + static const struct wined3d_cs_ops wined3d_cs_st_ops = + { + wined3d_cs_st_require_space, + wined3d_cs_st_submit, + wined3d_cs_st_push_constants, + }; ++#else /* STAGING_CSMT */ +static void wined3d_cs_list_init(struct wined3d_cs_list *list) +{ + InitializeCriticalSectionAndSpinCount(&list->lock, WINED3D_CS_SPIN_COUNT); @@ -2319,7 +2290,7 @@ diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c struct wined3d_cs *wined3d_cs_create(struct wined3d_device *device) { -@@ -2161,12 +3345,57 @@ struct wined3d_cs *wined3d_cs_create(struct wined3d_device *device) +@@ -2161,12 +3317,57 @@ struct wined3d_cs *wined3d_cs_create(struct wined3d_device *device) return NULL; } @@ -2559,19 +2530,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c } if (!src_box) -@@ -4786,7 +4844,11 @@ HRESULT CDECL wined3d_device_reset(struct wined3d_device *device, - { - if (reset_state) - hr = wined3d_device_create_primary_opengl_context(device); -+#if !defined(STAGING_CSMT) - swapchain_update_swap_interval(swapchain); -+#else /* STAGING_CSMT */ -+ wined3d_cs_emit_update_swap_interval(device->cs, swapchain); -+#endif /* STAGING_CSMT */ - } - - /* All done. There is no need to reload resources or shaders, this will happen automatically on the -@@ -5099,3 +5161,58 @@ LRESULT device_process_message(struct wined3d_device *device, HWND window, BOOL +@@ -5099,3 +5157,58 @@ LRESULT device_process_message(struct wined3d_device *device, HWND window, BOOL else return CallWindowProcA(proc, window, message, wparam, lparam); } @@ -2784,7 +2743,7 @@ diff --git a/dlls/wined3d/swapchain.c b/dlls/wined3d/swapchain.c gl_info->gl_ops.gl.p_glFinish(); /* call wglSwapBuffers through the gl table to avoid confusing the Steam overlay */ -@@ -857,6 +870,9 @@ static HRESULT swapchain_init(struct wined3d_swapchain *swapchain, struct wined3 +@@ -900,6 +913,9 @@ static HRESULT swapchain_init(struct wined3d_swapchain *swapchain, struct wined3 } wined3d_cs_init_object(device->cs, wined3d_swapchain_cs_init, swapchain); @@ -2794,7 +2753,7 @@ diff --git a/dlls/wined3d/swapchain.c b/dlls/wined3d/swapchain.c if (!swapchain->context[0]) { -@@ -997,6 +1013,10 @@ static struct wined3d_context *swapchain_create_context(struct wined3d_swapchain +@@ -1040,6 +1056,10 @@ static struct wined3d_context *swapchain_create_context(struct wined3d_swapchain TRACE("Creating a new context for swapchain %p, thread %u.\n", swapchain, GetCurrentThreadId()); @@ -2805,7 +2764,7 @@ diff --git a/dlls/wined3d/swapchain.c b/dlls/wined3d/swapchain.c if (!(ctx = context_create(swapchain, swapchain->front_buffer, swapchain->ds_format))) { ERR("Failed to create a new context for the swapchain\n"); -@@ -1183,6 +1203,9 @@ HRESULT CDECL wined3d_swapchain_resize_buffers(struct wined3d_swapchain *swapcha +@@ -1189,6 +1209,9 @@ HRESULT CDECL wined3d_swapchain_resize_buffers(struct wined3d_swapchain *swapcha enum wined3d_multisample_type multisample_type, unsigned int multisample_quality) { BOOL update_desc = FALSE; @@ -2815,7 +2774,7 @@ diff --git a/dlls/wined3d/swapchain.c b/dlls/wined3d/swapchain.c TRACE("swapchain %p, buffer_count %u, width %u, height %u, format %s, " "multisample_type %#x, multisample_quality %#x.\n", -@@ -1194,6 +1217,10 @@ HRESULT CDECL wined3d_swapchain_resize_buffers(struct wined3d_swapchain *swapcha +@@ -1200,6 +1223,10 @@ HRESULT CDECL wined3d_swapchain_resize_buffers(struct wined3d_swapchain *swapcha if (buffer_count && buffer_count != swapchain->desc.backbuffer_count) FIXME("Cannot change the back buffer count yet.\n"); @@ -3383,7 +3342,7 @@ diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h void wined3d_cs_emit_reset_state(struct wined3d_cs *cs) DECLSPEC_HIDDEN; void wined3d_cs_emit_set_clip_plane(struct wined3d_cs *cs, UINT plane_idx, const struct wined3d_vec4 *plane) DECLSPEC_HIDDEN; -@@ -3314,10 +3407,16 @@ void wined3d_cs_emit_set_unordered_access_view(struct wined3d_cs *cs, enum wined +@@ -3314,6 +3407,9 @@ void wined3d_cs_emit_set_unordered_access_view(struct wined3d_cs *cs, enum wined void wined3d_cs_emit_set_vertex_declaration(struct wined3d_cs *cs, struct wined3d_vertex_declaration *declaration) DECLSPEC_HIDDEN; void wined3d_cs_emit_set_viewport(struct wined3d_cs *cs, const struct wined3d_viewport *viewport) DECLSPEC_HIDDEN; @@ -3393,14 +3352,7 @@ diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h void wined3d_cs_emit_unload_resource(struct wined3d_cs *cs, struct wined3d_resource *resource) DECLSPEC_HIDDEN; void wined3d_cs_emit_update_sub_resource(struct wined3d_cs *cs, struct wined3d_resource *resource, unsigned int sub_resource_idx, const struct wined3d_box *box, const void *data, unsigned int row_pitch, - unsigned int slice_pitch) DECLSPEC_HIDDEN; -+#if defined(STAGING_CSMT) -+void wined3d_cs_emit_update_swap_interval(struct wined3d_cs *cs, struct wined3d_swapchain *swapchain) DECLSPEC_HIDDEN; -+#endif /* STAGING_CSMT */ - void wined3d_cs_init_object(struct wined3d_cs *cs, - void (*callback)(void *object), void *object) DECLSPEC_HIDDEN; - HRESULT wined3d_cs_map(struct wined3d_cs *cs, struct wined3d_resource *resource, unsigned int sub_resource_idx, -@@ -3325,12 +3424,14 @@ HRESULT wined3d_cs_map(struct wined3d_cs *cs, struct wined3d_resource *resource, +@@ -3325,12 +3421,14 @@ HRESULT wined3d_cs_map(struct wined3d_cs *cs, struct wined3d_resource *resource, HRESULT wined3d_cs_unmap(struct wined3d_cs *cs, struct wined3d_resource *resource, unsigned int sub_resource_idx) DECLSPEC_HIDDEN; diff --git a/patches/wined3d-Silence_FIXMEs/0004-wined3d-Print-FIXME-only-once-in-surface_cpu_blt.patch b/patches/wined3d-Silence_FIXMEs/0004-wined3d-Print-FIXME-only-once-in-surface_cpu_blt.patch index c84f67b0..68a55917 100644 --- a/patches/wined3d-Silence_FIXMEs/0004-wined3d-Print-FIXME-only-once-in-surface_cpu_blt.patch +++ b/patches/wined3d-Silence_FIXMEs/0004-wined3d-Print-FIXME-only-once-in-surface_cpu_blt.patch @@ -1,4 +1,4 @@ -From 9627792f549907cfa050d89f464f7a19a1ef1c59 Mon Sep 17 00:00:00 2001 +From 42ccc2bd6a5d7182baae711eb3e96e40c77b8263 Mon Sep 17 00:00:00 2001 From: Christian Costa Date: Sun, 25 Oct 2015 12:50:31 +0100 Subject: wined3d: Print FIXME only once in surface_cpu_blt. @@ -8,19 +8,19 @@ Subject: wined3d: Print FIXME only once in surface_cpu_blt. 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c -index 814d4ab..8192c18 100644 +index 2bf4854511..d6c03a8889 100644 --- a/dlls/wined3d/surface.c +++ b/dlls/wined3d/surface.c -@@ -4238,7 +4238,8 @@ static HRESULT surface_cpu_blt(struct wined3d_texture *dst_texture, unsigned int - && (src_width != dst_width || src_height != dst_height)) - { - /* Can happen when d3d9 apps do a StretchRect() call which isn't handled in GL. */ -- FIXME("Filter %s not supported in software blit.\n", debug_d3dtexturefiltertype(filter)); -+ static int once; -+ if (!once++) FIXME("Filter %s not supported in software blit.\n", debug_d3dtexturefiltertype(filter)); - } +@@ -2935,7 +2935,8 @@ static HRESULT surface_cpu_blt(struct wined3d_texture *dst_texture, unsigned int + && (src_width != dst_width || src_height != dst_height)) + { + /* Can happen when d3d9 apps do a StretchRect() call which isn't handled in GL. */ +- FIXME("Filter %s not supported in software blit.\n", debug_d3dtexturefiltertype(filter)); ++ static int once; ++ if (!once++) FIXME("Filter %s not supported in software blit.\n", debug_d3dtexturefiltertype(filter)); + } - xinc = (src_width << 16) / dst_width; + xinc = (src_width << 16) / dst_width; -- -2.7.1 +2.11.0 diff --git a/patches/winhttp-Accept_Headers/0001-winhttp-Fix-handling-of-Accept-headers.patch b/patches/winhttp-Accept_Headers/0001-winhttp-Fix-handling-of-Accept-headers.patch index 1131bfd7..8cf8cd05 100644 --- a/patches/winhttp-Accept_Headers/0001-winhttp-Fix-handling-of-Accept-headers.patch +++ b/patches/winhttp-Accept_Headers/0001-winhttp-Fix-handling-of-Accept-headers.patch @@ -1,4 +1,4 @@ -From 11c32d17116fc6a9ff384aee1918b476544d8f42 Mon Sep 17 00:00:00 2001 +From 9cb94401c419b2e3f9d95a8dc5ce171da398bd66 Mon Sep 17 00:00:00 2001 From: Sebastian Lackner Date: Wed, 21 Dec 2016 00:54:37 +0100 Subject: winhttp: Fix handling of Accept headers. @@ -10,10 +10,10 @@ Subject: winhttp: Fix handling of Accept headers. 3 files changed, 7 insertions(+), 32 deletions(-) diff --git a/dlls/winhttp/request.c b/dlls/winhttp/request.c -index b2b72c7..174972c 100644 +index db6d12d027..2447efaec0 100644 --- a/dlls/winhttp/request.c +++ b/dlls/winhttp/request.c -@@ -403,7 +403,7 @@ static BOOL delete_header( request_t *request, DWORD index ) +@@ -399,7 +399,7 @@ static BOOL delete_header( request_t *request, DWORD index ) return TRUE; } @@ -22,7 +22,7 @@ index b2b72c7..174972c 100644 { int index; header_t hdr; -@@ -1130,15 +1130,10 @@ static BOOL send_request( request_t *request, LPCWSTR headers, DWORD headers_len +@@ -1325,16 +1325,11 @@ static BOOL send_request( request_t *request, LPCWSTR headers, DWORD headers_len WCHAR *req = NULL; char *req_ascii; int bytes_sent; @@ -30,6 +30,7 @@ index b2b72c7..174972c 100644 + DWORD len; clear_response_headers( request ); + drain_content( request ); - flags = WINHTTP_ADDREQ_FLAG_ADD|WINHTTP_ADDREQ_FLAG_COALESCE_WITH_COMMA; - for (i = 0; i < request->num_accept_types; i++) @@ -40,7 +41,7 @@ index b2b72c7..174972c 100644 process_header( request, attr_user_agent, session->agent, WINHTTP_ADDREQ_FLAG_ADD_IF_NEW, TRUE ); diff --git a/dlls/winhttp/session.c b/dlls/winhttp/session.c -index 514a56d..a2db716 100644 +index 514a56daa9..a2db716000 100644 --- a/dlls/winhttp/session.c +++ b/dlls/winhttp/session.c @@ -599,8 +599,6 @@ static void request_destroy( object_header_t *hdr ) @@ -89,7 +90,7 @@ index 514a56d..a2db716 100644 } return TRUE; diff --git a/dlls/winhttp/winhttp_private.h b/dlls/winhttp/winhttp_private.h -index 388fc33..75ba161 100644 +index 46c2aaa02d..b9e2fe664d 100644 --- a/dlls/winhttp/winhttp_private.h +++ b/dlls/winhttp/winhttp_private.h @@ -207,8 +207,6 @@ typedef struct @@ -111,5 +112,5 @@ index 388fc33..75ba161 100644 void release_typelib( void ) DECLSPEC_HIDDEN; -- -2.9.0 +2.11.0 diff --git a/patches/ws2_32-TransmitFile/0002-ws2_32-Add-support-for-TF_REUSE_SOCKET-to-TransmitFi.patch b/patches/ws2_32-TransmitFile/0002-ws2_32-Add-support-for-TF_REUSE_SOCKET-to-TransmitFi.patch index 82d39f82..67e39fcc 100644 --- a/patches/ws2_32-TransmitFile/0002-ws2_32-Add-support-for-TF_REUSE_SOCKET-to-TransmitFi.patch +++ b/patches/ws2_32-TransmitFile/0002-ws2_32-Add-support-for-TF_REUSE_SOCKET-to-TransmitFi.patch @@ -1,4 +1,4 @@ -From 3e03add0569ba08db7fae8b167070b0036d52d40 Mon Sep 17 00:00:00 2001 +From c9763b1c3d31bdf050339d03935c014ec187e9a4 Mon Sep 17 00:00:00 2001 From: "Erich E. Hoover" Date: Thu, 16 Jan 2014 19:08:30 -0700 Subject: ws2_32: Add support for TF_REUSE_SOCKET to TransmitFile. @@ -12,10 +12,10 @@ Subject: ws2_32: Add support for TF_REUSE_SOCKET to TransmitFile. 5 files changed, 75 insertions(+), 11 deletions(-) diff --git a/dlls/ws2_32/socket.c b/dlls/ws2_32/socket.c -index 43eafebe78e..64d9ac08175 100644 +index cb0e45d29d..22311e8694 100644 --- a/dlls/ws2_32/socket.c +++ b/dlls/ws2_32/socket.c -@@ -3034,6 +3034,17 @@ static NTSTATUS WS2_transmitfile_base( int fd, struct ws2_transmitfile_async *ws +@@ -3019,6 +3019,17 @@ static NTSTATUS WS2_transmitfile_base( int fd, struct ws2_transmitfile_async *ws if (status != STATUS_SUCCESS) return status; @@ -33,7 +33,7 @@ index 43eafebe78e..64d9ac08175 100644 if (wsa->flags & TF_DISCONNECT) { /* we can't use WS_closesocket because it modifies the last error */ -@@ -3077,7 +3088,7 @@ static BOOL WINAPI WS2_TransmitFile( SOCKET s, HANDLE h, DWORD file_bytes, DWORD +@@ -3061,7 +3072,7 @@ static BOOL WINAPI WS2_TransmitFile( SOCKET s, HANDLE h, DWORD file_bytes, DWORD LPOVERLAPPED overlapped, LPTRANSMIT_FILE_BUFFERS buffers, DWORD flags ) { @@ -43,10 +43,10 @@ index 43eafebe78e..64d9ac08175 100644 unsigned int uaddrlen = sizeof(uaddr); struct ws2_transmitfile_async *wsa; diff --git a/dlls/ws2_32/tests/sock.c b/dlls/ws2_32/tests/sock.c -index 82835036814..2aa9a1b4c22 100644 +index 3c68cf597d..1f3d55d202 100644 --- a/dlls/ws2_32/tests/sock.c +++ b/dlls/ws2_32/tests/sock.c -@@ -8488,7 +8488,6 @@ static void test_TransmitFile(void) +@@ -8580,7 +8580,6 @@ static void test_TransmitFile(void) err, WSAENOTSOCK); /* Test TransmitFile with a UDP datagram socket */ @@ -55,7 +55,7 @@ index 82835036814..2aa9a1b4c22 100644 bret = pTransmitFile(client, NULL, 0, 0, NULL, NULL, 0); err = WSAGetLastError(); diff --git a/include/winsock.h b/include/winsock.h -index cf9adf57ebd..2feb22466e4 100644 +index cf9adf57eb..2feb22466e 100644 --- a/include/winsock.h +++ b/include/winsock.h @@ -816,6 +816,7 @@ typedef struct WS(WSAData) @@ -67,10 +67,10 @@ index cf9adf57ebd..2feb22466e4 100644 #define FD_WINE_NONBLOCKING 0x20000000 #define FD_WINE_CONNECTED 0x40000000 diff --git a/server/protocol.def b/server/protocol.def -index 60865a6ffc2..2bbad809edb 100644 +index 87285a4038..cf5f5376ca 100644 --- a/server/protocol.def +++ b/server/protocol.def -@@ -1303,6 +1303,12 @@ enum server_fd_type +@@ -1299,6 +1299,12 @@ enum server_fd_type @END @@ -84,7 +84,7 @@ index 60865a6ffc2..2bbad809edb 100644 @REQ(set_socket_event) obj_handle_t handle; /* handle to the socket */ diff --git a/server/sock.c b/server/sock.c -index d6b4fb2fa5c..2e310eec516 100644 +index 1625ed3a42..076c606f5d 100644 --- a/server/sock.c +++ b/server/sock.c @@ -86,6 +86,7 @@ @@ -96,7 +96,7 @@ index d6b4fb2fa5c..2e310eec516 100644 #define FD_WINE_NONBLOCKING 0x20000000 #define FD_WINE_CONNECTED 0x40000000 @@ -132,6 +133,7 @@ static enum server_fd_type sock_get_fd_type( struct fd *fd ); - static obj_handle_t sock_ioctl( struct fd *fd, ioctl_code_t code, struct async *async, int blocking ); + static obj_handle_t sock_ioctl( struct fd *fd, ioctl_code_t code, struct async *async ); static void sock_queue_async( struct fd *fd, struct async *async, int type, int count ); static void sock_reselect_async( struct fd *fd, struct async_queue *queue ); +static int sock_close_handle( struct object *obj, struct process *process, obj_handle_t handle );