diff --git a/patches/patchinstall.sh b/patches/patchinstall.sh index 1b52eb4d..4c796562 100755 --- a/patches/patchinstall.sh +++ b/patches/patchinstall.sh @@ -51,7 +51,7 @@ usage() # Get the upstream commit sha upstream_commit() { - echo "0a5e205c06e0f0ccf632e02a48e86a386a4884e0" + echo "a02c7ce7518b19d401ae854f18d2401a489f60db" } # Show version information diff --git a/patches/wined3d-CSMT_Main/0040-wined3d-wined3d_-_query_issue-never-fails.patch b/patches/wined3d-CSMT_Main/0040-wined3d-wined3d_-_query_issue-never-fails.patch index 78c0797f..18ade3cb 100644 --- a/patches/wined3d-CSMT_Main/0040-wined3d-wined3d_-_query_issue-never-fails.patch +++ b/patches/wined3d-CSMT_Main/0040-wined3d-wined3d_-_query_issue-never-fails.patch @@ -1,4 +1,4 @@ -From bcb7a976e21e8bf74e52d2169943fd0bd1f736c2 Mon Sep 17 00:00:00 2001 +From d8d88af87fdff19251a7a489619ee76ebe06f3af Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stefan=20D=C3=B6singer?= Date: Sat, 6 Jul 2013 18:15:00 +0200 Subject: wined3d: wined3d_*_query_issue never fails @@ -9,7 +9,7 @@ Subject: wined3d: wined3d_*_query_issue never fails 2 files changed, 10 insertions(+), 17 deletions(-) diff --git a/dlls/wined3d/query.c b/dlls/wined3d/query.c -index 7ef879d..ffa3f62 100644 +index 822c1e0..40f8649 100644 --- a/dlls/wined3d/query.c +++ b/dlls/wined3d/query.c @@ -297,7 +297,8 @@ HRESULT CDECL wined3d_query_issue(struct wined3d_query *query, DWORD flags) @@ -22,7 +22,7 @@ index 7ef879d..ffa3f62 100644 } static void fill_query_data(void *out, unsigned int out_size, const void *result, unsigned int result_size) -@@ -434,7 +435,7 @@ enum wined3d_query_type CDECL wined3d_query_get_type(const struct wined3d_query +@@ -426,7 +427,7 @@ enum wined3d_query_type CDECL wined3d_query_get_type(const struct wined3d_query return query->type; } @@ -31,7 +31,7 @@ index 7ef879d..ffa3f62 100644 { TRACE("query %p, flags %#x.\n", query, flags); -@@ -455,11 +456,9 @@ static HRESULT wined3d_event_query_ops_issue(struct wined3d_query *query, DWORD +@@ -447,11 +448,9 @@ static HRESULT wined3d_event_query_ops_issue(struct wined3d_query *query, DWORD query->state = QUERY_BUILDING; else query->state = QUERY_SIGNALLED; @@ -42,9 +42,9 @@ index 7ef879d..ffa3f62 100644 -static HRESULT wined3d_occlusion_query_ops_issue(struct wined3d_query *query, DWORD flags) +static void wined3d_occlusion_query_ops_issue(struct wined3d_query *query, DWORD flags) { + struct wined3d_occlusion_query *oq = query->extendedData; struct wined3d_device *device = query->device; - const struct wined3d_gl_info *gl_info = &device->adapter->gl_info; -@@ -538,7 +537,7 @@ static HRESULT wined3d_occlusion_query_ops_issue(struct wined3d_query *query, DW +@@ -523,7 +522,7 @@ static HRESULT wined3d_occlusion_query_ops_issue(struct wined3d_query *query, DW else query->state = QUERY_SIGNALLED; @@ -53,7 +53,7 @@ index 7ef879d..ffa3f62 100644 } static HRESULT wined3d_timestamp_query_ops_get_data(struct wined3d_query *query, -@@ -601,7 +600,7 @@ static HRESULT wined3d_timestamp_query_ops_get_data(struct wined3d_query *query, +@@ -586,7 +585,7 @@ static HRESULT wined3d_timestamp_query_ops_get_data(struct wined3d_query *query, return res; } @@ -62,7 +62,7 @@ index 7ef879d..ffa3f62 100644 { struct wined3d_device *device = query->device; const struct wined3d_gl_info *gl_info = &device->adapter->gl_info; -@@ -635,8 +634,6 @@ static HRESULT wined3d_timestamp_query_ops_issue(struct wined3d_query *query, DW +@@ -620,8 +619,6 @@ static HRESULT wined3d_timestamp_query_ops_issue(struct wined3d_query *query, DW if (flags & WINED3DISSUE_END) query->state = QUERY_SIGNALLED; @@ -71,7 +71,7 @@ index 7ef879d..ffa3f62 100644 } static HRESULT wined3d_timestamp_disjoint_query_ops_get_data(struct wined3d_query *query, -@@ -665,7 +662,7 @@ static HRESULT wined3d_timestamp_disjoint_query_ops_get_data(struct wined3d_quer +@@ -650,7 +647,7 @@ static HRESULT wined3d_timestamp_disjoint_query_ops_get_data(struct wined3d_quer return S_OK; } @@ -80,7 +80,7 @@ index 7ef879d..ffa3f62 100644 { TRACE("query %p, flags %#x.\n", query, flags); -@@ -673,8 +670,6 @@ static HRESULT wined3d_timestamp_disjoint_query_ops_issue(struct wined3d_query * +@@ -658,8 +655,6 @@ static HRESULT wined3d_timestamp_disjoint_query_ops_issue(struct wined3d_query * query->state = QUERY_BUILDING; if (flags & WINED3DISSUE_END) query->state = QUERY_SIGNALLED; @@ -89,7 +89,7 @@ index 7ef879d..ffa3f62 100644 } static HRESULT wined3d_statistics_query_ops_get_data(struct wined3d_query *query, -@@ -689,10 +684,9 @@ static HRESULT wined3d_statistics_query_ops_get_data(struct wined3d_query *query +@@ -674,10 +669,9 @@ static HRESULT wined3d_statistics_query_ops_get_data(struct wined3d_query *query return S_OK; } @@ -101,7 +101,7 @@ index 7ef879d..ffa3f62 100644 } static HRESULT wined3d_overflow_query_ops_get_data(struct wined3d_query *query, -@@ -707,10 +701,9 @@ static HRESULT wined3d_overflow_query_ops_get_data(struct wined3d_query *query, +@@ -692,10 +686,9 @@ static HRESULT wined3d_overflow_query_ops_get_data(struct wined3d_query *query, return S_OK; } diff --git a/patches/wined3d-CSMT_Main/0043-wined3d-Poll-queries-automatically-in-the-CS.patch b/patches/wined3d-CSMT_Main/0043-wined3d-Poll-queries-automatically-in-the-CS.patch index c59191ec..5d8bb65b 100644 --- a/patches/wined3d-CSMT_Main/0043-wined3d-Poll-queries-automatically-in-the-CS.patch +++ b/patches/wined3d-CSMT_Main/0043-wined3d-Poll-queries-automatically-in-the-CS.patch @@ -1,4 +1,4 @@ -From ab6ea7552635df439e3ec00a6305296f92b0b737 Mon Sep 17 00:00:00 2001 +From 553e8c8b1abe7da6cb7c62a15f5c314793defaf2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stefan=20D=C3=B6singer?= Date: Sat, 6 Jul 2013 19:18:48 +0200 Subject: wined3d: Poll queries automatically in the CS @@ -7,7 +7,7 @@ Subject: wined3d: Poll queries automatically in the CS dlls/wined3d/cs.c | 76 ++++++-------- dlls/wined3d/query.c | 223 +++++++++++++++++++++++++++-------------- dlls/wined3d/wined3d_private.h | 7 +- - 3 files changed, 186 insertions(+), 120 deletions(-) + 3 files changed, 185 insertions(+), 121 deletions(-) diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c index 94232db..213943f 100644 @@ -143,7 +143,7 @@ index 94232db..213943f 100644 { continue; diff --git a/dlls/wined3d/query.c b/dlls/wined3d/query.c -index 6b42332..e3e3f56 100644 +index 2357f9e..f41370e 100644 --- a/dlls/wined3d/query.c +++ b/dlls/wined3d/query.c @@ -272,7 +272,18 @@ ULONG CDECL wined3d_query_decref(struct wined3d_query *query) @@ -187,16 +187,14 @@ index 6b42332..e3e3f56 100644 } UINT CDECL wined3d_query_get_data_size(const struct wined3d_query *query) -@@ -322,15 +323,10 @@ static void fill_query_data(void *out, unsigned int out_size, const void *result - static HRESULT wined3d_occlusion_query_ops_get_data(struct wined3d_query *query, +@@ -323,14 +324,7 @@ static HRESULT wined3d_occlusion_query_ops_get_data(struct wined3d_query *query, void *data, DWORD size, DWORD flags) { -- struct wined3d_occlusion_query *oq = query->extendedData; - struct wined3d_device *device = query->device; - const struct wined3d_gl_info *gl_info = &device->adapter->gl_info; + struct wined3d_occlusion_query *oq = query->extendedData; +- struct wined3d_device *device = query->device; +- const struct wined3d_gl_info *gl_info = &device->adapter->gl_info; - struct wined3d_context *context; - GLuint available; -+ struct wined3d_occlusion_query *oq = query->extendedData; GLuint samples; - HRESULT res; - @@ -204,7 +202,7 @@ index 6b42332..e3e3f56 100644 if (!oq->context) query->state = QUERY_CREATED; -@@ -344,6 +340,8 @@ static HRESULT wined3d_occlusion_query_ops_get_data(struct wined3d_query *query, +@@ -344,6 +338,8 @@ static HRESULT wined3d_occlusion_query_ops_get_data(struct wined3d_query *query, return S_OK; } @@ -213,8 +211,8 @@ index 6b42332..e3e3f56 100644 if (query->state == QUERY_BUILDING) { /* Msdn says this returns an error, but our tests show that S_FALSE is returned */ -@@ -359,12 +357,37 @@ static HRESULT wined3d_occlusion_query_ops_get_data(struct wined3d_query *query, - return S_OK; +@@ -351,12 +347,37 @@ static HRESULT wined3d_occlusion_query_ops_get_data(struct wined3d_query *query, + return S_FALSE; } + if (!wined3d_settings.cs_multithreaded) @@ -254,7 +252,7 @@ index 6b42332..e3e3f56 100644 } context = context_acquire(device, context_get_rt_surface(oq->context)); -@@ -375,61 +398,71 @@ static HRESULT wined3d_occlusion_query_ops_get_data(struct wined3d_query *query, +@@ -367,61 +388,71 @@ static HRESULT wined3d_occlusion_query_ops_get_data(struct wined3d_query *query, if (available) { @@ -354,7 +352,7 @@ index 6b42332..e3e3f56 100644 return S_OK; } -@@ -557,33 +590,57 @@ static HRESULT wined3d_timestamp_query_ops_get_data(struct wined3d_query *query, +@@ -542,33 +573,57 @@ static HRESULT wined3d_timestamp_query_ops_get_data(struct wined3d_query *query, void *data, DWORD size, DWORD flags) { struct wined3d_timestamp_query *tq = query->extendedData; @@ -427,7 +425,7 @@ index 6b42332..e3e3f56 100644 } context = context_acquire(device, context_get_rt_surface(tq->context)); -@@ -594,23 +651,20 @@ static HRESULT wined3d_timestamp_query_ops_get_data(struct wined3d_query *query, +@@ -579,23 +634,20 @@ static HRESULT wined3d_timestamp_query_ops_get_data(struct wined3d_query *query, if (available) { @@ -458,7 +456,7 @@ index 6b42332..e3e3f56 100644 } static void wined3d_timestamp_query_ops_issue(struct wined3d_query *query, DWORD flags) -@@ -653,7 +707,6 @@ static HRESULT wined3d_timestamp_disjoint_query_ops_get_data(struct wined3d_quer +@@ -638,7 +690,6 @@ static HRESULT wined3d_timestamp_disjoint_query_ops_get_data(struct wined3d_quer void *data, DWORD size, DWORD flags) { TRACE("query %p, data %p, size %#x, flags %#x.\n", query, data, size, flags); @@ -466,7 +464,7 @@ index 6b42332..e3e3f56 100644 if (query->type == WINED3D_QUERY_TYPE_TIMESTAMP_DISJOINT) { static const struct wined3d_query_data_timestamp_disjoint disjoint_data = {1000 * 1000 * 1000, FALSE}; -@@ -675,6 +728,11 @@ static HRESULT wined3d_timestamp_disjoint_query_ops_get_data(struct wined3d_quer +@@ -660,6 +711,11 @@ static HRESULT wined3d_timestamp_disjoint_query_ops_get_data(struct wined3d_quer return S_OK; } @@ -478,7 +476,7 @@ index 6b42332..e3e3f56 100644 static void wined3d_timestamp_disjoint_query_ops_issue(struct wined3d_query *query, DWORD flags) { TRACE("query %p, flags %#x.\n", query, flags); -@@ -697,6 +755,11 @@ static HRESULT wined3d_statistics_query_ops_get_data(struct wined3d_query *query +@@ -682,6 +738,11 @@ static HRESULT wined3d_statistics_query_ops_get_data(struct wined3d_query *query return S_OK; } @@ -490,7 +488,7 @@ index 6b42332..e3e3f56 100644 static void wined3d_statistics_query_ops_issue(struct wined3d_query *query, DWORD flags) { FIXME("query %p, flags %#x.\n", query, flags); -@@ -714,6 +777,11 @@ static HRESULT wined3d_overflow_query_ops_get_data(struct wined3d_query *query, +@@ -699,6 +760,11 @@ static HRESULT wined3d_overflow_query_ops_get_data(struct wined3d_query *query, return S_OK; } @@ -502,7 +500,7 @@ index 6b42332..e3e3f56 100644 static void wined3d_overflow_query_ops_issue(struct wined3d_query *query, DWORD flags) { FIXME("query %p, flags %#x.\n", query, flags); -@@ -722,36 +790,42 @@ static void wined3d_overflow_query_ops_issue(struct wined3d_query *query, DWORD +@@ -707,36 +773,42 @@ static void wined3d_overflow_query_ops_issue(struct wined3d_query *query, DWORD static const struct wined3d_query_ops event_query_ops = { wined3d_event_query_ops_get_data, @@ -545,7 +543,7 @@ index 6b42332..e3e3f56 100644 wined3d_overflow_query_ops_issue }; -@@ -866,6 +940,7 @@ static HRESULT query_init(struct wined3d_query *query, struct wined3d_device *de +@@ -848,6 +920,7 @@ static HRESULT query_init(struct wined3d_query *query, struct wined3d_device *de query->state = QUERY_CREATED; query->device = device; query->ref = 1; diff --git a/patches/wined3d-CSMT_Main/0046-wined3d-Separate-main-and-worker-thread-query-state.patch b/patches/wined3d-CSMT_Main/0046-wined3d-Separate-main-and-worker-thread-query-state.patch index b07c5ad2..784a9787 100644 --- a/patches/wined3d-CSMT_Main/0046-wined3d-Separate-main-and-worker-thread-query-state.patch +++ b/patches/wined3d-CSMT_Main/0046-wined3d-Separate-main-and-worker-thread-query-state.patch @@ -1,4 +1,4 @@ -From 7e1d35d3a2ef4d353f3e5897462824a6d4b22b89 Mon Sep 17 00:00:00 2001 +From 2926e747953bb84e36c626e9561cf4b9545efb45 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stefan=20D=C3=B6singer?= Date: Wed, 24 Jul 2013 16:34:17 +0200 Subject: wined3d: Separate main and worker thread query state @@ -9,10 +9,10 @@ Subject: wined3d: Separate main and worker thread query state 2 files changed, 13 insertions(+), 22 deletions(-) diff --git a/dlls/wined3d/query.c b/dlls/wined3d/query.c -index 1334ec3..7c5e8fc 100644 +index 43f7189..56d5a1b 100644 --- a/dlls/wined3d/query.c +++ b/dlls/wined3d/query.c -@@ -299,6 +299,12 @@ HRESULT CDECL wined3d_query_issue(struct wined3d_query *query, DWORD flags) +@@ -304,6 +304,12 @@ HRESULT CDECL wined3d_query_issue(struct wined3d_query *query, DWORD flags) query->counter_main++; wined3d_cs_emit_query_issue(query->device->cs, query, flags); @@ -25,7 +25,7 @@ index 1334ec3..7c5e8fc 100644 return WINED3D_OK; } -@@ -493,11 +499,6 @@ static void wined3d_event_query_ops_issue(struct wined3d_query *query, DWORD fla +@@ -479,11 +485,6 @@ static void wined3d_event_query_ops_issue(struct wined3d_query *query, DWORD fla /* Started implicitly at device creation */ ERR("Event query issued with START flag - what to do?\n"); } @@ -37,42 +37,36 @@ index 1334ec3..7c5e8fc 100644 } static void wined3d_occlusion_query_ops_issue(struct wined3d_query *query, DWORD flags) -@@ -515,7 +516,7 @@ static void wined3d_occlusion_query_ops_issue(struct wined3d_query *query, DWORD - /* This is allowed according to msdn and our tests. Reset the query and restart */ - if (flags & WINED3DISSUE_BEGIN) +@@ -499,7 +500,7 @@ static void wined3d_occlusion_query_ops_issue(struct wined3d_query *query, DWORD + * restart. */ + if (flags & WINED3DISSUE_BEGIN) + { +- if (query->state == QUERY_BUILDING) ++ if (oq->started) { -- if (query->state == QUERY_BUILDING) -+ if (oq->started) + if (oq->context->tid != GetCurrentThreadId()) { - if (oq->context->tid != GetCurrentThreadId()) - { -@@ -544,6 +545,7 @@ static void wined3d_occlusion_query_ops_issue(struct wined3d_query *query, DWORD - checkGLcall("glBeginQuery()"); +@@ -529,13 +530,14 @@ static void wined3d_occlusion_query_ops_issue(struct wined3d_query *query, DWORD + checkGLcall("glBeginQuery()"); - context_release(context); -+ oq->started = TRUE; - } - if (flags & WINED3DISSUE_END) - { -@@ -551,7 +553,7 @@ static void wined3d_occlusion_query_ops_issue(struct wined3d_query *query, DWORD - * our tests show that it returns OK. But OpenGL doesn't like it, so avoid - * generating an error - */ -- if (query->state == QUERY_BUILDING) -+ if (oq->started) - { - if (oq->context->tid != GetCurrentThreadId()) - { -@@ -567,6 +569,7 @@ static void wined3d_occlusion_query_ops_issue(struct wined3d_query *query, DWORD - context_release(context); - } - } -+ oq->started = FALSE; - } + context_release(context); ++ oq->started = TRUE; } - else -@@ -574,11 +577,6 @@ static void wined3d_occlusion_query_ops_issue(struct wined3d_query *query, DWORD - FIXME("%p Occlusion queries not supported.\n", query); + if (flags & WINED3DISSUE_END) + { + /* MSDN says END on a non-building occlusion query returns an error, + * but our tests show that it returns OK. But OpenGL doesn't like it, + * so avoid generating an error. */ +- if (query->state == QUERY_BUILDING) ++ if (oq->started) + { + if (oq->context->tid != GetCurrentThreadId()) + { +@@ -551,13 +553,9 @@ static void wined3d_occlusion_query_ops_issue(struct wined3d_query *query, DWORD + context_release(context); + } + } ++ oq->started = FALSE; } - if (flags & WINED3DISSUE_BEGIN) @@ -83,7 +77,7 @@ index 1334ec3..7c5e8fc 100644 return; } -@@ -694,9 +692,6 @@ static void wined3d_timestamp_query_ops_issue(struct wined3d_query *query, DWORD +@@ -673,9 +671,6 @@ static void wined3d_timestamp_query_ops_issue(struct wined3d_query *query, DWORD { ERR("Timestamp queries not supported.\n"); } @@ -93,7 +87,7 @@ index 1334ec3..7c5e8fc 100644 } static HRESULT wined3d_timestamp_disjoint_query_ops_get_data(struct wined3d_query *query, -@@ -732,11 +727,6 @@ static BOOL wined3d_timestamp_disjoint_query_ops_poll(struct wined3d_query *quer +@@ -711,11 +706,6 @@ static BOOL wined3d_timestamp_disjoint_query_ops_poll(struct wined3d_query *quer static void wined3d_timestamp_disjoint_query_ops_issue(struct wined3d_query *query, DWORD flags) { TRACE("query %p, flags %#x.\n", query, flags); @@ -105,7 +99,7 @@ index 1334ec3..7c5e8fc 100644 } static HRESULT wined3d_statistics_query_ops_get_data(struct wined3d_query *query, -@@ -833,13 +823,13 @@ static HRESULT query_init(struct wined3d_query *query, struct wined3d_device *de +@@ -822,13 +812,13 @@ static HRESULT query_init(struct wined3d_query *query, struct wined3d_device *de } query->query_ops = &occlusion_query_ops; query->data_size = sizeof(DWORD); @@ -122,10 +116,10 @@ index 1334ec3..7c5e8fc 100644 case WINED3D_QUERY_TYPE_EVENT: diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h -index abff020..0e5b031 100644 +index 3d05e42..d9d0b63 100644 --- a/dlls/wined3d/wined3d_private.h +++ b/dlls/wined3d/wined3d_private.h -@@ -1278,6 +1278,7 @@ struct wined3d_occlusion_query +@@ -1375,6 +1375,7 @@ struct wined3d_occlusion_query GLuint id; struct wined3d_context *context; DWORD samples; diff --git a/patches/wined3d-CSMT_Main/0047-wined3d-Don-t-poll-queries-that-failed-to-start.patch b/patches/wined3d-CSMT_Main/0047-wined3d-Don-t-poll-queries-that-failed-to-start.patch index 8d2099c3..de1b26c4 100644 --- a/patches/wined3d-CSMT_Main/0047-wined3d-Don-t-poll-queries-that-failed-to-start.patch +++ b/patches/wined3d-CSMT_Main/0047-wined3d-Don-t-poll-queries-that-failed-to-start.patch @@ -1,4 +1,4 @@ -From 4ceddc82591a0ba5dd38e15f6f4fd43d1a2752f1 Mon Sep 17 00:00:00 2001 +From 43cf824eade39ee6dede48a85c41e6b6a844fceb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stefan=20D=C3=B6singer?= Date: Wed, 24 Jul 2013 17:27:35 +0200 Subject: wined3d: Don't poll queries that failed to start @@ -28,10 +28,10 @@ index 2f66eff..7178624 100644 list_add_tail(&cs->query_poll_list, &query->poll_list_entry); diff --git a/dlls/wined3d/query.c b/dlls/wined3d/query.c -index f67159e..4c2c318 100644 +index 56d5a1b..243928c 100644 --- a/dlls/wined3d/query.c +++ b/dlls/wined3d/query.c -@@ -479,7 +479,7 @@ enum wined3d_query_type CDECL wined3d_query_get_type(const struct wined3d_query +@@ -469,7 +469,7 @@ enum wined3d_query_type CDECL wined3d_query_get_type(const struct wined3d_query return query->type; } @@ -40,7 +40,7 @@ index f67159e..4c2c318 100644 { TRACE("query %p, flags %#x.\n", query, flags); -@@ -489,18 +489,21 @@ static void wined3d_event_query_ops_issue(struct wined3d_query *query, DWORD fla +@@ -479,20 +479,23 @@ static void wined3d_event_query_ops_issue(struct wined3d_query *query, DWORD fla struct wined3d_event_query *event_query = query->extendedData; wined3d_event_query_issue(event_query, query->device); @@ -57,22 +57,19 @@ index f67159e..4c2c318 100644 -static void wined3d_occlusion_query_ops_issue(struct wined3d_query *query, DWORD flags) +static BOOL wined3d_occlusion_query_ops_issue(struct wined3d_query *query, DWORD flags) { + struct wined3d_occlusion_query *oq = query->extendedData; struct wined3d_device *device = query->device; const struct wined3d_gl_info *gl_info = &device->adapter->gl_info; + struct wined3d_context *context; + BOOL poll = FALSE; TRACE("query %p, flags %#x.\n", query, flags); -@@ -566,6 +569,7 @@ static void wined3d_occlusion_query_ops_issue(struct wined3d_query *query, DWORD - } +@@ -554,9 +557,10 @@ static void wined3d_occlusion_query_ops_issue(struct wined3d_query *query, DWORD } - oq->started = FALSE; -+ poll = TRUE; } - } - else -@@ -573,7 +577,7 @@ static void wined3d_occlusion_query_ops_issue(struct wined3d_query *query, DWORD - FIXME("%p Occlusion queries not supported.\n", query); + oq->started = FALSE; ++ poll = TRUE; } - return; @@ -80,7 +77,7 @@ index f67159e..4c2c318 100644 } static HRESULT wined3d_timestamp_query_ops_get_data(struct wined3d_query *query, -@@ -657,7 +661,7 @@ static BOOL wined3d_timestamp_query_ops_poll(struct wined3d_query *query) +@@ -640,7 +644,7 @@ static BOOL wined3d_timestamp_query_ops_poll(struct wined3d_query *query) return ret; } @@ -89,7 +86,7 @@ index f67159e..4c2c318 100644 { struct wined3d_device *device = query->device; const struct wined3d_gl_info *gl_info = &device->adapter->gl_info; -@@ -688,6 +692,10 @@ static void wined3d_timestamp_query_ops_issue(struct wined3d_query *query, DWORD +@@ -671,6 +675,10 @@ static void wined3d_timestamp_query_ops_issue(struct wined3d_query *query, DWORD { ERR("Timestamp queries not supported.\n"); } @@ -100,7 +97,7 @@ index f67159e..4c2c318 100644 } static HRESULT wined3d_timestamp_disjoint_query_ops_get_data(struct wined3d_query *query, -@@ -720,9 +728,10 @@ static BOOL wined3d_timestamp_disjoint_query_ops_poll(struct wined3d_query *quer +@@ -703,9 +711,10 @@ static BOOL wined3d_timestamp_disjoint_query_ops_poll(struct wined3d_query *quer return TRUE; } @@ -112,7 +109,7 @@ index f67159e..4c2c318 100644 } static HRESULT wined3d_statistics_query_ops_get_data(struct wined3d_query *query, -@@ -742,9 +751,10 @@ static BOOL wined3d_statistics_query_ops_poll(struct wined3d_query *query) +@@ -725,9 +734,10 @@ static BOOL wined3d_statistics_query_ops_poll(struct wined3d_query *query) return TRUE; } @@ -124,7 +121,7 @@ index f67159e..4c2c318 100644 } static HRESULT wined3d_overflow_query_ops_get_data(struct wined3d_query *query, -@@ -764,9 +774,10 @@ static BOOL wined3d_overflow_query_ops_poll(struct wined3d_query *query) +@@ -747,9 +757,10 @@ static BOOL wined3d_overflow_query_ops_poll(struct wined3d_query *query) return TRUE; } diff --git a/patches/wined3d-CSMT_Main/0050-wined3d-Put-this-into-the-query-poll-patch.patch b/patches/wined3d-CSMT_Main/0050-wined3d-Put-this-into-the-query-poll-patch.patch index 00d180ff..c55687dc 100644 --- a/patches/wined3d-CSMT_Main/0050-wined3d-Put-this-into-the-query-poll-patch.patch +++ b/patches/wined3d-CSMT_Main/0050-wined3d-Put-this-into-the-query-poll-patch.patch @@ -1,4 +1,4 @@ -From ef32438cbd218b7671fdeca72bd58715a5c825f3 Mon Sep 17 00:00:00 2001 +From 4c6d31415dc3e8faf74afdf6124adf226184782a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stefan=20D=C3=B6singer?= Date: Fri, 30 Aug 2013 13:53:48 +0200 Subject: wined3d: Put this into the query poll patch @@ -9,10 +9,10 @@ Subject: wined3d: Put this into the query poll patch 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c -index 4f505c6..afb1a80 100644 +index 69c7167..72c83f5 100644 --- a/dlls/wined3d/cs.c +++ b/dlls/wined3d/cs.c -@@ -1837,6 +1837,18 @@ static UINT wined3d_cs_exec_query_issue(struct wined3d_cs *cs, const void *data) +@@ -2001,6 +2001,18 @@ static UINT wined3d_cs_exec_query_issue(struct wined3d_cs *cs, const void *data) list_remove(&query->poll_list_entry); list_init(&query->poll_list_entry); } @@ -32,21 +32,21 @@ index 4f505c6..afb1a80 100644 return sizeof(*op); diff --git a/dlls/wined3d/query.c b/dlls/wined3d/query.c -index 4176d61..718fba1 100644 +index db3d063..8ecad12 100644 --- a/dlls/wined3d/query.c +++ b/dlls/wined3d/query.c -@@ -567,10 +567,10 @@ static BOOL wined3d_occlusion_query_ops_issue(struct wined3d_query *query, DWORD - checkGLcall("glEndQuery()"); +@@ -551,10 +551,10 @@ static BOOL wined3d_occlusion_query_ops_issue(struct wined3d_query *query, DWORD + checkGLcall("glEndQuery()"); - context_release(context); -+ poll = TRUE; - } + context_release(context); ++ poll = TRUE; } - oq->started = FALSE; -- poll = TRUE; } + oq->started = FALSE; +- poll = TRUE; } - else + + return poll; -- 2.8.0 diff --git a/patches/wined3d-CSMT_Main/9999-IfDefined.patch b/patches/wined3d-CSMT_Main/9999-IfDefined.patch index a3b51253..afd28fd9 100644 --- a/patches/wined3d-CSMT_Main/9999-IfDefined.patch +++ b/patches/wined3d-CSMT_Main/9999-IfDefined.patch @@ -5074,28 +5074,25 @@ diff --git a/dlls/wined3d/query.c b/dlls/wined3d/query.c } static void fill_query_data(void *out, unsigned int out_size, const void *result, unsigned int result_size) -@@ -308,6 +327,7 @@ static void fill_query_data(void *out, unsigned int out_size, const void *result - static HRESULT wined3d_occlusion_query_ops_get_data(struct wined3d_query *query, +@@ -309,6 +328,7 @@ static HRESULT wined3d_occlusion_query_ops_get_data(struct wined3d_query *query, void *data, DWORD size, DWORD flags) { -+#if !defined(STAGING_CSMT) struct wined3d_occlusion_query *oq = query->extendedData; ++#if !defined(STAGING_CSMT) struct wined3d_device *device = query->device; const struct wined3d_gl_info *gl_info = &device->adapter->gl_info; -@@ -320,6 +340,12 @@ static HRESULT wined3d_occlusion_query_ops_get_data(struct wined3d_query *query, + struct wined3d_context *context; +@@ -320,6 +340,9 @@ static HRESULT wined3d_occlusion_query_ops_get_data(struct wined3d_query *query, if (!oq->context) query->state = QUERY_CREATED; +#else /* STAGING_CSMT */ -+ struct wined3d_device *device = query->device; -+ const struct wined3d_gl_info *gl_info = &device->adapter->gl_info; -+ struct wined3d_occlusion_query *oq = query->extendedData; + GLuint samples; +#endif /* STAGING_CSMT */ if (query->state == QUERY_CREATED) { -@@ -330,6 +356,10 @@ static HRESULT wined3d_occlusion_query_ops_get_data(struct wined3d_query *query, +@@ -330,6 +353,10 @@ static HRESULT wined3d_occlusion_query_ops_get_data(struct wined3d_query *query, return S_OK; } @@ -5106,8 +5103,8 @@ diff --git a/dlls/wined3d/query.c b/dlls/wined3d/query.c if (query->state == QUERY_BUILDING) { /* Msdn says this returns an error, but our tests show that S_FALSE is returned */ -@@ -345,12 +375,45 @@ static HRESULT wined3d_occlusion_query_ops_get_data(struct wined3d_query *query, - return S_OK; +@@ -337,12 +364,45 @@ static HRESULT wined3d_occlusion_query_ops_get_data(struct wined3d_query *query, + return S_FALSE; } +#if defined(STAGING_CSMT) @@ -5152,7 +5149,7 @@ diff --git a/dlls/wined3d/query.c b/dlls/wined3d/query.c } context = context_acquire(device, context_get_rt_surface(oq->context)); -@@ -361,6 +424,7 @@ static HRESULT wined3d_occlusion_query_ops_get_data(struct wined3d_query *query, +@@ -353,6 +413,7 @@ static HRESULT wined3d_occlusion_query_ops_get_data(struct wined3d_query *query, if (available) { @@ -5160,7 +5157,7 @@ diff --git a/dlls/wined3d/query.c b/dlls/wined3d/query.c if (size) { GL_EXTCALL(glGetQueryObjectuiv(oq->id, GL_QUERY_RESULT, &samples)); -@@ -369,14 +433,26 @@ static HRESULT wined3d_occlusion_query_ops_get_data(struct wined3d_query *query, +@@ -361,14 +422,26 @@ static HRESULT wined3d_occlusion_query_ops_get_data(struct wined3d_query *query, fill_query_data(data, size, &samples, sizeof(samples)); } res = S_OK; @@ -5187,7 +5184,7 @@ diff --git a/dlls/wined3d/query.c b/dlls/wined3d/query.c return res; } -@@ -391,12 +467,22 @@ static HRESULT wined3d_event_query_ops_get_data(struct wined3d_query *query, +@@ -383,12 +456,22 @@ static HRESULT wined3d_event_query_ops_get_data(struct wined3d_query *query, if (!data || !size) return S_OK; @@ -5210,7 +5207,7 @@ diff --git a/dlls/wined3d/query.c b/dlls/wined3d/query.c signaled = TRUE; fill_query_data(data, size, &signaled, sizeof(signaled)); break; -@@ -405,17 +491,58 @@ static HRESULT wined3d_event_query_ops_get_data(struct wined3d_query *query, +@@ -397,17 +480,58 @@ static HRESULT wined3d_event_query_ops_get_data(struct wined3d_query *query, signaled = FALSE; fill_query_data(data, size, &signaled, sizeof(signaled)); break; @@ -5269,7 +5266,7 @@ diff --git a/dlls/wined3d/query.c b/dlls/wined3d/query.c return S_OK; } -@@ -434,7 +561,11 @@ enum wined3d_query_type CDECL wined3d_query_get_type(const struct wined3d_query +@@ -426,7 +550,11 @@ enum wined3d_query_type CDECL wined3d_query_get_type(const struct wined3d_query return query->type; } @@ -5281,7 +5278,7 @@ diff --git a/dlls/wined3d/query.c b/dlls/wined3d/query.c { TRACE("query %p, flags %#x.\n", query, flags); -@@ -444,12 +575,16 @@ static HRESULT wined3d_event_query_ops_issue(struct wined3d_query *query, DWORD +@@ -436,12 +564,16 @@ static HRESULT wined3d_event_query_ops_issue(struct wined3d_query *query, DWORD struct wined3d_event_query *event_query = query->extendedData; wined3d_event_query_issue(event_query, query->device); @@ -5298,7 +5295,7 @@ diff --git a/dlls/wined3d/query.c b/dlls/wined3d/query.c if (flags & WINED3DISSUE_BEGIN) query->state = QUERY_BUILDING; -@@ -460,9 +595,18 @@ static HRESULT wined3d_event_query_ops_issue(struct wined3d_query *query, DWORD +@@ -452,11 +584,20 @@ static HRESULT wined3d_event_query_ops_issue(struct wined3d_query *query, DWORD } static HRESULT wined3d_occlusion_query_ops_issue(struct wined3d_query *query, DWORD flags) @@ -5309,76 +5306,68 @@ diff --git a/dlls/wined3d/query.c b/dlls/wined3d/query.c +static BOOL wined3d_occlusion_query_ops_issue(struct wined3d_query *query, DWORD flags) +#endif /* STAGING_CSMT */ { + struct wined3d_occlusion_query *oq = query->extendedData; struct wined3d_device *device = query->device; const struct wined3d_gl_info *gl_info = &device->adapter->gl_info; + struct wined3d_context *context; +#if defined(STAGING_CSMT) + BOOL poll = FALSE; +#endif /* STAGING_CSMT */ TRACE("query %p, flags %#x.\n", query, flags); -@@ -474,7 +618,11 @@ static HRESULT wined3d_occlusion_query_ops_issue(struct wined3d_query *query, DW - /* This is allowed according to msdn and our tests. Reset the query and restart */ - if (flags & WINED3DISSUE_BEGIN) - { -+#if !defined(STAGING_CSMT) - if (query->state == QUERY_BUILDING) -+#else /* STAGING_CSMT */ -+ if (oq->started) -+#endif /* STAGING_CSMT */ - { - if (oq->context->tid != GetCurrentThreadId()) - { -@@ -503,6 +651,9 @@ static HRESULT wined3d_occlusion_query_ops_issue(struct wined3d_query *query, DW - checkGLcall("glBeginQuery()"); - - context_release(context); -+#if defined(STAGING_CSMT) -+ oq->started = TRUE; -+#endif /* STAGING_CSMT */ - } - if (flags & WINED3DISSUE_END) - { -@@ -510,7 +661,11 @@ static HRESULT wined3d_occlusion_query_ops_issue(struct wined3d_query *query, DW - * our tests show that it returns OK. But OpenGL doesn't like it, so avoid - * generating an error - */ -+#if !defined(STAGING_CSMT) - if (query->state == QUERY_BUILDING) -+#else /* STAGING_CSMT */ -+ if (oq->started) -+#endif /* STAGING_CSMT */ - { - if (oq->context->tid != GetCurrentThreadId()) - { -@@ -524,8 +679,15 @@ static HRESULT wined3d_occlusion_query_ops_issue(struct wined3d_query *query, DW - checkGLcall("glEndQuery()"); - - context_release(context); -+#if !defined(STAGING_CSMT) - } - } -+#else /* STAGING_CSMT */ -+ poll = TRUE; -+ } -+ } -+ oq->started = FALSE; -+#endif /* STAGING_CSMT */ - } - } - else -@@ -533,23 +695,62 @@ static HRESULT wined3d_occlusion_query_ops_issue(struct wined3d_query *query, DW - FIXME("%p Occlusion queries not supported.\n", query); - } - -+#if !defined(STAGING_CSMT) +@@ -464,7 +605,11 @@ static HRESULT wined3d_occlusion_query_ops_issue(struct wined3d_query *query, DW + * restart. */ if (flags & WINED3DISSUE_BEGIN) - query->state = QUERY_BUILDING; - else + { ++#if !defined(STAGING_CSMT) + if (query->state == QUERY_BUILDING) ++#else /* STAGING_CSMT */ ++ if (oq->started) ++#endif /* STAGING_CSMT */ + { + if (oq->context->tid != GetCurrentThreadId()) + { +@@ -494,13 +639,20 @@ static HRESULT wined3d_occlusion_query_ops_issue(struct wined3d_query *query, DW + checkGLcall("glBeginQuery()"); + + context_release(context); ++#if defined(STAGING_CSMT) ++ oq->started = TRUE; ++#endif /* STAGING_CSMT */ + } + if (flags & WINED3DISSUE_END) + { + /* MSDN says END on a non-building occlusion query returns an error, + * but our tests show that it returns OK. But OpenGL doesn't like it, + * so avoid generating an error. */ ++#if !defined(STAGING_CSMT) + if (query->state == QUERY_BUILDING) ++#else /* STAGING_CSMT */ ++ if (oq->started) ++#endif /* STAGING_CSMT */ + { + if (oq->context->tid != GetCurrentThreadId()) + { +@@ -514,6 +666,7 @@ static HRESULT wined3d_occlusion_query_ops_issue(struct wined3d_query *query, DW + checkGLcall("glEndQuery()"); + + context_release(context); ++#if !defined(STAGING_CSMT) + } + } + } +@@ -524,17 +677,61 @@ static HRESULT wined3d_occlusion_query_ops_issue(struct wined3d_query *query, DW query->state = QUERY_SIGNALLED; return WINED3D_OK; /* can be WINED3DERR_INVALIDCALL. */ +#else /* STAGING_CSMT */ ++ poll = TRUE; ++ } ++ } ++ oq->started = FALSE; ++ } ++ + return poll; +#endif /* STAGING_CSMT */ } @@ -5430,7 +5419,7 @@ diff --git a/dlls/wined3d/query.c b/dlls/wined3d/query.c HRESULT res; TRACE("query %p, data %p, size %#x, flags %#x.\n", query, data, size, flags); -@@ -564,14 +765,28 @@ static HRESULT wined3d_timestamp_query_ops_get_data(struct wined3d_query *query, +@@ -549,14 +746,28 @@ static HRESULT wined3d_timestamp_query_ops_get_data(struct wined3d_query *query, timestamp = 0; fill_query_data(data, size, ×tamp, sizeof(timestamp)); return S_OK; @@ -5459,7 +5448,7 @@ diff --git a/dlls/wined3d/query.c b/dlls/wined3d/query.c } context = context_acquire(device, context_get_rt_surface(tq->context)); -@@ -582,6 +797,7 @@ static HRESULT wined3d_timestamp_query_ops_get_data(struct wined3d_query *query, +@@ -567,6 +778,7 @@ static HRESULT wined3d_timestamp_query_ops_get_data(struct wined3d_query *query, if (available) { @@ -5467,7 +5456,7 @@ diff --git a/dlls/wined3d/query.c b/dlls/wined3d/query.c if (size) { GL_EXTCALL(glGetQueryObjectui64v(tq->id, GL_QUERY_RESULT, ×tamp)); -@@ -590,18 +806,36 @@ static HRESULT wined3d_timestamp_query_ops_get_data(struct wined3d_query *query, +@@ -575,18 +787,36 @@ static HRESULT wined3d_timestamp_query_ops_get_data(struct wined3d_query *query, fill_query_data(data, size, ×tamp, sizeof(timestamp)); } res = S_OK; @@ -5504,7 +5493,7 @@ diff --git a/dlls/wined3d/query.c b/dlls/wined3d/query.c { struct wined3d_device *device = query->device; const struct wined3d_gl_info *gl_info = &device->adapter->gl_info; -@@ -634,16 +868,23 @@ static HRESULT wined3d_timestamp_query_ops_issue(struct wined3d_query *query, DW +@@ -619,16 +849,23 @@ static HRESULT wined3d_timestamp_query_ops_issue(struct wined3d_query *query, DW } if (flags & WINED3DISSUE_END) @@ -5528,7 +5517,7 @@ diff --git a/dlls/wined3d/query.c b/dlls/wined3d/query.c if (query->type == WINED3D_QUERY_TYPE_TIMESTAMP_DISJOINT) { static const struct wined3d_query_data_timestamp_disjoint disjoint_data = {1000 * 1000 * 1000, FALSE}; -@@ -665,6 +906,7 @@ static HRESULT wined3d_timestamp_disjoint_query_ops_get_data(struct wined3d_quer +@@ -650,6 +887,7 @@ static HRESULT wined3d_timestamp_disjoint_query_ops_get_data(struct wined3d_quer return S_OK; } @@ -5536,7 +5525,7 @@ diff --git a/dlls/wined3d/query.c b/dlls/wined3d/query.c static HRESULT wined3d_timestamp_disjoint_query_ops_issue(struct wined3d_query *query, DWORD flags) { TRACE("query %p, flags %#x.\n", query, flags); -@@ -675,6 +917,17 @@ static HRESULT wined3d_timestamp_disjoint_query_ops_issue(struct wined3d_query * +@@ -660,6 +898,17 @@ static HRESULT wined3d_timestamp_disjoint_query_ops_issue(struct wined3d_query * query->state = QUERY_SIGNALLED; return WINED3D_OK; @@ -5554,7 +5543,7 @@ diff --git a/dlls/wined3d/query.c b/dlls/wined3d/query.c } static HRESULT wined3d_statistics_query_ops_get_data(struct wined3d_query *query, -@@ -689,10 +942,22 @@ static HRESULT wined3d_statistics_query_ops_get_data(struct wined3d_query *query +@@ -674,10 +923,22 @@ static HRESULT wined3d_statistics_query_ops_get_data(struct wined3d_query *query return S_OK; } @@ -5577,7 +5566,7 @@ diff --git a/dlls/wined3d/query.c b/dlls/wined3d/query.c } static HRESULT wined3d_overflow_query_ops_get_data(struct wined3d_query *query, -@@ -707,45 +972,75 @@ static HRESULT wined3d_overflow_query_ops_get_data(struct wined3d_query *query, +@@ -692,45 +953,75 @@ static HRESULT wined3d_overflow_query_ops_get_data(struct wined3d_query *query, return S_OK; } @@ -5653,7 +5642,7 @@ diff --git a/dlls/wined3d/query.c b/dlls/wined3d/query.c wined3d_overflow_query_ops_issue }; -@@ -767,13 +1062,20 @@ static HRESULT query_init(struct wined3d_query *query, struct wined3d_device *de +@@ -752,13 +1043,20 @@ static HRESULT query_init(struct wined3d_query *query, struct wined3d_device *de } query->query_ops = &occlusion_query_ops; query->data_size = sizeof(DWORD); @@ -5674,7 +5663,7 @@ diff --git a/dlls/wined3d/query.c b/dlls/wined3d/query.c break; case WINED3D_QUERY_TYPE_EVENT: -@@ -860,6 +1162,9 @@ static HRESULT query_init(struct wined3d_query *query, struct wined3d_device *de +@@ -842,6 +1140,9 @@ static HRESULT query_init(struct wined3d_query *query, struct wined3d_device *de query->state = QUERY_CREATED; query->device = device; query->ref = 1;