From 50a53675fe29746c800b6b707c524155f96456f8 Mon Sep 17 00:00:00 2001 From: Sebastian Lackner Date: Fri, 29 Jul 2016 21:34:46 +0200 Subject: [PATCH] Rebase against ba2e025b94fa3705d439803a545129c32e8818af. --- patches/patchinstall.sh | 5 +- ...3d-wined3d_-_query_issue-never-fails.patch | 131 ---- ...-query-support-to-the-command-stream.patch | 129 ++-- ...r-CS-state-to-find-out-if-a-query-is.patch | 34 +- ...Poll-queries-automatically-in-the-CS.patch | 476 ++------------- ...e-main-and-worker-thread-query-state.patch | 115 ---- ...-t-poll-queries-that-failed-to-start.patch | 49 +- ...set-the-query-state-if-it-doesn-t-ha.patch | 31 - ...Send-texture-preloads-through-the-CS.patch | 24 +- ...-update_texture-calls-through-the-CS.patch | 32 +- .../wined3d-CSMT_Main/9999-IfDefined.patch | 564 +++--------------- ...s-for-QUERY_TYPE_SO_STATISTICS-and-Q.patch | 75 +-- 12 files changed, 314 insertions(+), 1351 deletions(-) delete mode 100644 patches/wined3d-CSMT_Main/0040-wined3d-wined3d_-_query_issue-never-fails.patch delete mode 100644 patches/wined3d-CSMT_Main/0046-wined3d-Separate-main-and-worker-thread-query-state.patch delete mode 100644 patches/wined3d-CSMT_Main/0049-wined3d-Don-t-reset-the-query-state-if-it-doesn-t-ha.patch diff --git a/patches/patchinstall.sh b/patches/patchinstall.sh index c058e51a..60f3521a 100755 --- a/patches/patchinstall.sh +++ b/patches/patchinstall.sh @@ -51,7 +51,7 @@ usage() # Get the upstream commit sha upstream_commit() { - echo "2337c50ed769f2078257283f82aa7e696b452324" + echo "ba2e025b94fa3705d439803a545129c32e8818af" } # Show version information @@ -7311,16 +7311,13 @@ if test "$enable_wined3d_CSMT_Main" -eq 1; then echo '+ { "Stefan Dösinger", "wined3d: Replace the linked lists with a ringbuffer.", 1 },'; echo '+ { "Stefan Dösinger", "wined3d: Don'\''t preload buffers on unmap.", 1 },'; echo '+ { "Stefan Dösinger", "wined3d: Don'\''t call glFinish before swapping.", 1 },'; - echo '+ { "Stefan Dösinger", "wined3d: Wined3d_*_query_issue never fails.", 1 },'; echo '+ { "Stefan Dösinger", "wined3d: Add query support to the command stream.", 1 },'; echo '+ { "Stefan Dösinger", "wined3d: Check our CS state to find out if a query is done.", 1 },'; echo '+ { "Stefan Dösinger", "wined3d: Poll queries automatically in the CS.", 1 },'; echo '+ { "Stefan Dösinger", "wined3d: Introduce a separate queue for priority commands.", 1 },'; echo '+ { "Stefan Dösinger", "wined3d: Destroy queries through the CS.", 1 },'; - echo '+ { "Stefan Dösinger", "wined3d: Separate main and worker thread query state.", 1 },'; echo '+ { "Stefan Dösinger", "wined3d: Don'\''t poll queries that failed to start.", 1 },'; echo '+ { "Stefan Dösinger", "wined3d: Remove restated queries from the poll list.", 1 },'; - echo '+ { "Stefan Dösinger", "wined3d: Don'\''t reset the query state if it doesn'\''t have a ctx.", 1 },'; echo '+ { "Stefan Dösinger", "wined3d: Put this into the query poll patch.", 1 },'; echo '+ { "Stefan Dösinger", "wined3d: Send texture preloads through the CS.", 1 },'; echo '+ { "Stefan Dösinger", "wined3d: Don'\''t access device state in clears.", 1 },'; 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 deleted file mode 100644 index 302d94e4..00000000 --- a/patches/wined3d-CSMT_Main/0040-wined3d-wined3d_-_query_issue-never-fails.patch +++ /dev/null @@ -1,131 +0,0 @@ -From 52053fbf98485763b27e2fd9e4dacd62187e5643 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 - ---- - dlls/wined3d/query.c | 25 +++++++++---------------- - dlls/wined3d/wined3d_private.h | 2 +- - 2 files changed, 10 insertions(+), 17 deletions(-) - -diff --git a/dlls/wined3d/query.c b/dlls/wined3d/query.c -index ef93d3b..09c8657 100644 ---- a/dlls/wined3d/query.c -+++ b/dlls/wined3d/query.c -@@ -327,7 +327,8 @@ HRESULT CDECL wined3d_query_issue(struct wined3d_query *query, DWORD flags) - { - TRACE("query %p, flags %#x.\n", query, flags); - -- return query->query_ops->query_issue(query, flags); -+ query->query_ops->query_issue(query, flags); -+ return WINED3D_OK; - } - - static void fill_query_data(void *out, unsigned int out_size, const void *result, unsigned int result_size) -@@ -456,7 +457,7 @@ enum wined3d_query_type CDECL wined3d_query_get_type(const struct wined3d_query - return query->type; - } - --static HRESULT wined3d_event_query_ops_issue(struct wined3d_query *query, DWORD flags) -+static void wined3d_event_query_ops_issue(struct wined3d_query *query, DWORD flags) - { - TRACE("query %p, flags %#x.\n", query, flags); - -@@ -476,11 +477,9 @@ static HRESULT wined3d_event_query_ops_issue(struct wined3d_query *query, DWORD - query->state = QUERY_BUILDING; - else - query->state = QUERY_SIGNALLED; -- -- return WINED3D_OK; - } - --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 = wined3d_occlusion_query_from_query(query); - struct wined3d_device *device = query->device; -@@ -552,7 +551,7 @@ static HRESULT wined3d_occlusion_query_ops_issue(struct wined3d_query *query, DW - else - query->state = QUERY_SIGNALLED; - -- return WINED3D_OK; /* can be WINED3DERR_INVALIDCALL. */ -+ return; - } - - static HRESULT wined3d_timestamp_query_ops_get_data(struct wined3d_query *query, -@@ -615,7 +614,7 @@ static HRESULT wined3d_timestamp_query_ops_get_data(struct wined3d_query *query, - return res; - } - --static HRESULT wined3d_timestamp_query_ops_issue(struct wined3d_query *query, DWORD flags) -+static void wined3d_timestamp_query_ops_issue(struct wined3d_query *query, DWORD flags) - { - struct wined3d_timestamp_query *tq = wined3d_timestamp_query_from_query(query); - struct wined3d_device *device = query->device; -@@ -640,8 +639,6 @@ static HRESULT wined3d_timestamp_query_ops_issue(struct wined3d_query *query, DW - - query->state = QUERY_SIGNALLED; - } -- -- return WINED3D_OK; - } - - static HRESULT wined3d_timestamp_disjoint_query_ops_get_data(struct wined3d_query *query, -@@ -670,7 +667,7 @@ static HRESULT wined3d_timestamp_disjoint_query_ops_get_data(struct wined3d_quer - return S_OK; - } - --static HRESULT wined3d_timestamp_disjoint_query_ops_issue(struct wined3d_query *query, DWORD flags) -+static void wined3d_timestamp_disjoint_query_ops_issue(struct wined3d_query *query, DWORD flags) - { - TRACE("query %p, flags %#x.\n", query, flags); - -@@ -678,8 +675,6 @@ static HRESULT wined3d_timestamp_disjoint_query_ops_issue(struct wined3d_query * - query->state = QUERY_BUILDING; - if (flags & WINED3DISSUE_END) - query->state = QUERY_SIGNALLED; -- -- return WINED3D_OK; - } - - static HRESULT wined3d_statistics_query_ops_get_data(struct wined3d_query *query, -@@ -694,10 +689,9 @@ static HRESULT wined3d_statistics_query_ops_get_data(struct wined3d_query *query - return S_OK; - } - --static HRESULT wined3d_statistics_query_ops_issue(struct wined3d_query *query, DWORD flags) -+static void wined3d_statistics_query_ops_issue(struct wined3d_query *query, DWORD flags) - { - FIXME("query %p, flags %#x.\n", query, flags); -- return WINED3D_OK; - } - - static HRESULT wined3d_overflow_query_ops_get_data(struct wined3d_query *query, -@@ -712,10 +706,9 @@ static HRESULT wined3d_overflow_query_ops_get_data(struct wined3d_query *query, - return S_OK; - } - --static HRESULT wined3d_overflow_query_ops_issue(struct wined3d_query *query, DWORD flags) -+static void wined3d_overflow_query_ops_issue(struct wined3d_query *query, DWORD flags) - { - FIXME("query %p, flags %#x.\n", query, flags); -- return WINED3D_OK; - } - - static const struct wined3d_query_ops event_query_ops = -diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h -index 7f565bb..976e3b7 100644 ---- a/dlls/wined3d/wined3d_private.h -+++ b/dlls/wined3d/wined3d_private.h -@@ -1382,7 +1382,7 @@ enum wined3d_query_state - struct wined3d_query_ops - { - HRESULT (*query_get_data)(struct wined3d_query *query, void *data, DWORD data_size, DWORD flags); -- HRESULT (*query_issue)(struct wined3d_query *query, DWORD flags); -+ void (*query_issue)(struct wined3d_query *query, DWORD flags); - }; - - struct wined3d_query --- -2.8.0 - diff --git a/patches/wined3d-CSMT_Main/0041-wined3d-Add-query-support-to-the-command-stream.patch b/patches/wined3d-CSMT_Main/0041-wined3d-Add-query-support-to-the-command-stream.patch index fedb2937..0a44546b 100644 --- a/patches/wined3d-CSMT_Main/0041-wined3d-Add-query-support-to-the-command-stream.patch +++ b/patches/wined3d-CSMT_Main/0041-wined3d-Add-query-support-to-the-command-stream.patch @@ -1,28 +1,28 @@ -From 882f8cb04eb9f245eb790668cfb05259a89baf1a Mon Sep 17 00:00:00 2001 +From 277335bfb1e48eead7bbe911657e9258f15fb794 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stefan=20D=C3=B6singer?= Date: Sat, 6 Jul 2013 18:26:11 +0200 Subject: wined3d: Add query support to the command stream --- - dlls/wined3d/cs.c | 73 ++++++++++++++++++++++++++++++++++++++++++ - dlls/wined3d/query.c | 8 +++-- + dlls/wined3d/cs.c | 66 ++++++++++++++++++++++++++++++++++++++++++ + dlls/wined3d/query.c | 17 +++++++---- dlls/wined3d/wined3d_private.h | 4 +++ - 3 files changed, 83 insertions(+), 2 deletions(-) + 3 files changed, 82 insertions(+), 5 deletions(-) diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c -index 57e77be..4aaf259 100644 +index fb5ae07..90bb9f2 100644 --- a/dlls/wined3d/cs.c +++ b/dlls/wined3d/cs.c -@@ -69,6 +69,8 @@ enum wined3d_cs_op +@@ -70,6 +70,8 @@ enum wined3d_cs_op WINED3D_CS_OP_CLEAR_RTV, WINED3D_CS_OP_TEXTURE_MAP, WINED3D_CS_OP_TEXTURE_UNMAP, + WINED3D_CS_OP_QUERY_ISSUE, -+ WINED3D_CS_OP_QUERY_GET_DATA, ++ WINED3D_CS_OP_QUERY_POLL, WINED3D_CS_OP_STOP, }; -@@ -388,6 +390,23 @@ struct wined3d_cs_skip +@@ -395,6 +397,20 @@ struct wined3d_cs_skip DWORD size; }; @@ -33,20 +33,17 @@ index 57e77be..4aaf259 100644 + DWORD flags; +}; + -+struct wined3d_cs_query_get_data ++struct wined3d_cs_query_poll +{ + enum wined3d_cs_op opcode; + struct wined3d_query *query; -+ void *data; -+ UINT data_size; -+ DWORD flags; -+ HRESULT *ret; ++ BOOL *ret; +}; + static void wined3d_cs_submit(struct wined3d_cs *cs, size_t size) { LONG new_val = (cs->queue.head + size) & (WINED3D_CS_QUEUE_SIZE - 1); -@@ -1963,6 +1982,58 @@ void wined3d_cs_emit_texture_unmap(struct wined3d_cs *cs, struct wined3d_texture +@@ -1992,6 +2008,54 @@ void wined3d_cs_emit_texture_unmap(struct wined3d_cs *cs, struct wined3d_texture cs->ops->submit(cs, sizeof(*op)); } @@ -71,27 +68,23 @@ index 57e77be..4aaf259 100644 + cs->ops->submit(cs, sizeof(*op)); +} + -+static UINT wined3d_cs_exec_query_get_data(struct wined3d_cs *cs, const void *data) ++static UINT wined3d_cs_exec_query_poll(struct wined3d_cs *cs, const void *data) +{ -+ const struct wined3d_cs_query_get_data *op = data; ++ const struct wined3d_cs_query_poll *op = data; + struct wined3d_query *query = op->query; + -+ *op->ret = query->query_ops->query_get_data(query, op->data, op->data_size, op->flags); ++ *op->ret = query->query_ops->query_poll(query); + + return sizeof(*op); +} + -+void wined3d_cs_emit_query_get_data(struct wined3d_cs *cs, struct wined3d_query *query, void *data, -+ UINT data_size, DWORD flags, HRESULT *ret) ++void wined3d_cs_emit_query_poll(struct wined3d_cs *cs, struct wined3d_query *query, BOOL *ret) +{ -+ struct wined3d_cs_query_get_data *op; ++ struct wined3d_cs_query_poll *op; + + op = cs->ops->require_space(cs, sizeof(*op)); -+ op->opcode = WINED3D_CS_OP_QUERY_GET_DATA; ++ op->opcode = WINED3D_CS_OP_QUERY_POLL; + op->query = query; -+ op->data = data; -+ op->data_size = data_size; -+ op->flags = flags; + op->ret = ret; + + cs->ops->submit(cs, sizeof(*op)); @@ -105,59 +98,99 @@ index 57e77be..4aaf259 100644 static UINT (* const wined3d_cs_op_handlers[])(struct wined3d_cs *cs, const void *data) = { /* WINED3D_CS_OP_NOP */ wined3d_cs_exec_nop, -@@ -2010,6 +2081,8 @@ static UINT (* const wined3d_cs_op_handlers[])(struct wined3d_cs *cs, const void +@@ -2040,6 +2104,8 @@ static UINT (* const wined3d_cs_op_handlers[])(struct wined3d_cs *cs, const void /* WINED3D_CS_OP_CLEAR_RTV */ wined3d_cs_exec_clear_rtv, /* WINED3D_CS_OP_TEXTURE_MAP */ wined3d_cs_exec_texture_map, /* WINED3D_CS_OP_TEXTURE_UNMAP */ wined3d_cs_exec_texture_unmap, + /* WINED3D_CS_OP_QUERY_ISSUE */ wined3d_cs_exec_query_issue, -+ /* WINED3D_CS_OP_QUERY_GET_DATA */ wined3d_cs_exec_query_get_data, ++ /* WINED3D_CS_OP_QUERY_POLL */ wined3d_cs_exec_query_poll, }; static void *wined3d_cs_mt_require_space(struct wined3d_cs *cs, size_t size) diff --git a/dlls/wined3d/query.c b/dlls/wined3d/query.c -index cd7a73c..f656bd1 100644 +index 3bcf6f0..048a0cf 100644 --- a/dlls/wined3d/query.c +++ b/dlls/wined3d/query.c -@@ -297,10 +297,14 @@ ULONG CDECL wined3d_query_decref(struct wined3d_query *query) - HRESULT CDECL wined3d_query_get_data(struct wined3d_query *query, - void *data, UINT data_size, DWORD flags) - { -+ HRESULT hr; - TRACE("query %p, data %p, data_size %u, flags %#x.\n", - query, data, data_size, flags); +@@ -338,8 +338,13 @@ HRESULT CDECL wined3d_query_get_data(struct wined3d_query *query, -- return query->query_ops->query_get_data(query, data, data_size, flags); -+ wined3d_cs_emit_query_get_data(query->device->cs, query, data, data_size, -+ flags, &hr); -+ -+ return hr; - } + if (query->state == QUERY_CREATED) + WARN("Query wasn't started yet.\n"); +- else if (!query->query_ops->query_poll(query)) +- return S_FALSE; ++ else ++ { ++ BOOL ret; ++ wined3d_cs_emit_query_poll(query->device->cs, query, &ret); ++ if (!ret) ++ return S_FALSE; ++ } - UINT CDECL wined3d_query_get_data_size(const struct wined3d_query *query) -@@ -314,7 +318,7 @@ HRESULT CDECL wined3d_query_issue(struct wined3d_query *query, DWORD flags) + if (data) + memcpy(data, query->data, min(data_size, query->data_size)); +@@ -358,7 +363,7 @@ HRESULT CDECL wined3d_query_issue(struct wined3d_query *query, DWORD flags) { TRACE("query %p, flags %#x.\n", query, flags); - query->query_ops->query_issue(query, flags); + wined3d_cs_emit_query_issue(query->device->cs, query, flags); - return WINED3D_OK; + + if (flags & WINED3DISSUE_BEGIN) + query->state = QUERY_BUILDING; +@@ -479,7 +484,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 (oq->context->tid != GetCurrentThreadId()) + { +@@ -509,13 +514,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) + { + /* 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()) + { +@@ -531,6 +537,7 @@ static void wined3d_occlusion_query_ops_issue(struct wined3d_query *query, DWORD + context_release(context); + } + } ++ oq->started = FALSE; + } } diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h -index 525cb01..d554882 100644 +index 5b44182..9c4ed1e 100644 --- a/dlls/wined3d/wined3d_private.h +++ b/dlls/wined3d/wined3d_private.h -@@ -3136,6 +3136,10 @@ void *wined3d_cs_emit_texture_map(struct wined3d_cs *cs, struct wined3d_texture +@@ -1437,6 +1437,7 @@ struct wined3d_occlusion_query + GLuint id; + struct wined3d_context *context; + DWORD samples; ++ BOOL started; + }; + + struct wined3d_timestamp_query +@@ -3151,6 +3152,9 @@ void *wined3d_cs_emit_texture_map(struct wined3d_cs *cs, struct wined3d_texture unsigned int sub_resource_idx, DWORD flags) DECLSPEC_HIDDEN; void wined3d_cs_emit_texture_unmap(struct wined3d_cs *cs, struct wined3d_texture *texture, unsigned int sub_resource_idx) DECLSPEC_HIDDEN; +void wined3d_cs_emit_query_issue(struct wined3d_cs *cs, struct wined3d_query *query, + DWORD flags) DECLSPEC_HIDDEN; -+void wined3d_cs_emit_query_get_data(struct wined3d_cs *cs, struct wined3d_query *query, void *data, -+ UINT data_size, DWORD flags, HRESULT *ret) DECLSPEC_HIDDEN; ++void wined3d_cs_emit_query_poll(struct wined3d_cs *cs, struct wined3d_query *query, BOOL *ret) DECLSPEC_HIDDEN; /* TODO: Add tests and support for FLOAT16_4 POSITIONT, D3DCOLOR position, other * fixed function semantics as D3DCOLOR or FLOAT16 */ -- -2.8.0 +2.9.0 diff --git a/patches/wined3d-CSMT_Main/0042-wined3d-Check-our-CS-state-to-find-out-if-a-query-is.patch b/patches/wined3d-CSMT_Main/0042-wined3d-Check-our-CS-state-to-find-out-if-a-query-is.patch index 7efd6f6e..dbf3f8e3 100644 --- a/patches/wined3d-CSMT_Main/0042-wined3d-Check-our-CS-state-to-find-out-if-a-query-is.patch +++ b/patches/wined3d-CSMT_Main/0042-wined3d-Check-our-CS-state-to-find-out-if-a-query-is.patch @@ -1,4 +1,4 @@ -From f4a2f28e195b9b5125e5360f4e7167fa2aaca230 Mon Sep 17 00:00:00 2001 +From 84e3897a8d1dc4f1925979a2d876609735a0ef4d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stefan=20D=C3=B6singer?= Date: Sat, 6 Jul 2013 18:31:41 +0200 Subject: wined3d: Check our CS state to find out if a query is done @@ -10,10 +10,10 @@ Subject: wined3d: Check our CS state to find out if a query is done 3 files changed, 15 insertions(+), 1 deletion(-) diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c -index 4aaf259..94232db 100644 +index 90bb9f2..f51656c 100644 --- a/dlls/wined3d/cs.c +++ b/dlls/wined3d/cs.c -@@ -1985,8 +1985,12 @@ void wined3d_cs_emit_texture_unmap(struct wined3d_cs *cs, struct wined3d_texture +@@ -2011,8 +2011,12 @@ void wined3d_cs_emit_texture_unmap(struct wined3d_cs *cs, struct wined3d_texture static UINT wined3d_cs_exec_query_issue(struct wined3d_cs *cs, const void *data) { const struct wined3d_cs_query_issue *op = data; @@ -28,12 +28,12 @@ index 4aaf259..94232db 100644 return sizeof(*op); } diff --git a/dlls/wined3d/query.c b/dlls/wined3d/query.c -index fbbd4f2..726da3b 100644 +index 048a0cf..64dd14b 100644 --- a/dlls/wined3d/query.c +++ b/dlls/wined3d/query.c -@@ -314,6 +314,12 @@ HRESULT CDECL wined3d_query_get_data(struct wined3d_query *query, - TRACE("query %p, data %p, data_size %u, flags %#x.\n", - query, data, data_size, flags); +@@ -330,6 +330,12 @@ HRESULT CDECL wined3d_query_get_data(struct wined3d_query *query, + if (flags) + WARN("Ignoring flags %#x.\n", flags); + if (query->counter_main != query->counter_worker) + { @@ -41,10 +41,10 @@ index fbbd4f2..726da3b 100644 + return S_FALSE; + } + - wined3d_cs_emit_query_get_data(query->device->cs, query, data, data_size, - flags, &hr); - -@@ -331,6 +337,9 @@ HRESULT CDECL wined3d_query_issue(struct wined3d_query *query, DWORD flags) + if (query->state == QUERY_BUILDING) + { + WARN("Query is building, returning S_FALSE.\n"); +@@ -363,6 +369,9 @@ HRESULT CDECL wined3d_query_issue(struct wined3d_query *query, DWORD flags) { TRACE("query %p, flags %#x.\n", query, flags); @@ -52,14 +52,14 @@ index fbbd4f2..726da3b 100644 + query->counter_main++; + wined3d_cs_emit_query_issue(query->device->cs, query, flags); - return WINED3D_OK; - } + + if (flags & WINED3DISSUE_BEGIN) diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h -index 6f00f06..232f099 100644 +index 9c4ed1e..a641df3 100644 --- a/dlls/wined3d/wined3d_private.h +++ b/dlls/wined3d/wined3d_private.h -@@ -1395,6 +1395,7 @@ struct wined3d_query - enum wined3d_query_type type; +@@ -1396,6 +1396,7 @@ struct wined3d_query + const void *data; DWORD data_size; const struct wined3d_query_ops *query_ops; + LONG counter_main, counter_worker; @@ -67,5 +67,5 @@ index 6f00f06..232f099 100644 union wined3d_gl_query_object -- -2.8.0 +2.9.0 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 88032279..7f87408d 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,44 +1,41 @@ -From a0114579d6805521af8d74adf7a09e40803f4425 Mon Sep 17 00:00:00 2001 +From e3d2b6d94063c692ebc130fdb29b518c97b5ef26 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 --- - dlls/wined3d/cs.c | 76 ++++++-------- - dlls/wined3d/query.c | 223 +++++++++++++++++++++++++++-------------- - dlls/wined3d/wined3d_private.h | 7 +- - 3 files changed, 185 insertions(+), 121 deletions(-) + dlls/wined3d/cs.c | 69 +++++++++++++++++++----------------------- + dlls/wined3d/query.c | 30 ++++++++++++------ + dlls/wined3d/wined3d_private.h | 4 ++- + 3 files changed, 54 insertions(+), 49 deletions(-) diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c -index 94232db..213943f 100644 +index f51656c..b8a4a45 100644 --- a/dlls/wined3d/cs.c +++ b/dlls/wined3d/cs.c -@@ -70,7 +70,6 @@ enum wined3d_cs_op +@@ -71,7 +71,6 @@ enum wined3d_cs_op WINED3D_CS_OP_TEXTURE_MAP, WINED3D_CS_OP_TEXTURE_UNMAP, WINED3D_CS_OP_QUERY_ISSUE, -- WINED3D_CS_OP_QUERY_GET_DATA, +- WINED3D_CS_OP_QUERY_POLL, WINED3D_CS_OP_STOP, }; -@@ -397,16 +396,6 @@ struct wined3d_cs_query_issue +@@ -404,13 +403,6 @@ struct wined3d_cs_query_issue DWORD flags; }; --struct wined3d_cs_query_get_data +-struct wined3d_cs_query_poll -{ - enum wined3d_cs_op opcode; - struct wined3d_query *query; -- void *data; -- UINT data_size; -- DWORD flags; -- HRESULT *ret; +- BOOL *ret; -}; - static void wined3d_cs_submit(struct wined3d_cs *cs, size_t size) { LONG new_val = (cs->queue.head + size) & (WINED3D_CS_QUEUE_SIZE - 1); -@@ -1989,8 +1978,9 @@ static UINT wined3d_cs_exec_query_issue(struct wined3d_cs *cs, const void *data) +@@ -2015,8 +2007,9 @@ static UINT wined3d_cs_exec_query_issue(struct wined3d_cs *cs, const void *data) query->query_ops->query_issue(query, op->flags); @@ -50,31 +47,27 @@ index 94232db..213943f 100644 return sizeof(*op); } -@@ -2007,37 +1997,6 @@ void wined3d_cs_emit_query_issue(struct wined3d_cs *cs, struct wined3d_query *qu +@@ -2033,33 +2026,6 @@ void wined3d_cs_emit_query_issue(struct wined3d_cs *cs, struct wined3d_query *qu cs->ops->submit(cs, sizeof(*op)); } --static UINT wined3d_cs_exec_query_get_data(struct wined3d_cs *cs, const void *data) +-static UINT wined3d_cs_exec_query_poll(struct wined3d_cs *cs, const void *data) -{ -- const struct wined3d_cs_query_get_data *op = data; +- const struct wined3d_cs_query_poll *op = data; - struct wined3d_query *query = op->query; - -- *op->ret = query->query_ops->query_get_data(query, op->data, op->data_size, op->flags); +- *op->ret = query->query_ops->query_poll(query); - - return sizeof(*op); -} - --void wined3d_cs_emit_query_get_data(struct wined3d_cs *cs, struct wined3d_query *query, void *data, -- UINT data_size, DWORD flags, HRESULT *ret) +-void wined3d_cs_emit_query_poll(struct wined3d_cs *cs, struct wined3d_query *query, BOOL *ret) -{ -- struct wined3d_cs_query_get_data *op; +- struct wined3d_cs_query_poll *op; - - op = cs->ops->require_space(cs, sizeof(*op)); -- op->opcode = WINED3D_CS_OP_QUERY_GET_DATA; +- op->opcode = WINED3D_CS_OP_QUERY_POLL; - op->query = query; -- op->data = data; -- op->data_size = data_size; -- op->flags = flags; - op->ret = ret; - - cs->ops->submit(cs, sizeof(*op)); @@ -88,15 +81,15 @@ index 94232db..213943f 100644 static UINT (* const wined3d_cs_op_handlers[])(struct wined3d_cs *cs, const void *data) = { /* WINED3D_CS_OP_NOP */ wined3d_cs_exec_nop, -@@ -2086,7 +2045,6 @@ static UINT (* const wined3d_cs_op_handlers[])(struct wined3d_cs *cs, const void +@@ -2109,7 +2075,6 @@ static UINT (* const wined3d_cs_op_handlers[])(struct wined3d_cs *cs, const void /* WINED3D_CS_OP_TEXTURE_MAP */ wined3d_cs_exec_texture_map, /* WINED3D_CS_OP_TEXTURE_UNMAP */ wined3d_cs_exec_texture_unmap, /* WINED3D_CS_OP_QUERY_ISSUE */ wined3d_cs_exec_query_issue, -- /* WINED3D_CS_OP_QUERY_GET_DATA */ wined3d_cs_exec_query_get_data, +- /* WINED3D_CS_OP_QUERY_POLL */ wined3d_cs_exec_query_poll, }; static void *wined3d_cs_mt_require_space(struct wined3d_cs *cs, size_t size) -@@ -2205,17 +2163,45 @@ void wined3d_cs_switch_onscreen_ds(struct wined3d_cs *cs, +@@ -2228,17 +2193,45 @@ void wined3d_cs_switch_onscreen_ds(struct wined3d_cs *cs, wined3d_texture_incref(cs->onscreen_depth_stencil->container); } @@ -143,18 +136,18 @@ index 94232db..213943f 100644 { continue; diff --git a/dlls/wined3d/query.c b/dlls/wined3d/query.c -index fb948d7..d86dd30 100644 +index 6a192c6..4996da9 100644 --- a/dlls/wined3d/query.c +++ b/dlls/wined3d/query.c -@@ -35,6 +35,7 @@ static void wined3d_query_init(struct wined3d_query *query, struct wined3d_devic - query->type = type; +@@ -37,6 +37,7 @@ static void wined3d_query_init(struct wined3d_query *query, struct wined3d_devic + query->data = data; query->data_size = data_size; query->query_ops = query_ops; + list_init(&query->poll_list_entry); } static struct wined3d_event_query *wined3d_event_query_from_query(struct wined3d_query *query) -@@ -314,7 +315,18 @@ ULONG CDECL wined3d_query_decref(struct wined3d_query *query) +@@ -316,7 +317,18 @@ ULONG CDECL wined3d_query_decref(struct wined3d_query *query) TRACE("%p decreasing refcount to %u.\n", query, refcount); if (!refcount) @@ -173,13 +166,9 @@ index fb948d7..d86dd30 100644 return refcount; } -@@ -322,20 +334,10 @@ ULONG CDECL wined3d_query_decref(struct wined3d_query *query) - HRESULT CDECL wined3d_query_get_data(struct wined3d_query *query, - void *data, UINT data_size, DWORD flags) - { -- HRESULT hr; - TRACE("query %p, data %p, data_size %u, flags %#x.\n", - query, data, data_size, flags); +@@ -330,12 +342,6 @@ HRESULT CDECL wined3d_query_get_data(struct wined3d_query *query, + if (flags) + WARN("Ignoring flags %#x.\n", flags); - if (query->counter_main != query->counter_worker) - { @@ -187,389 +176,38 @@ index fb948d7..d86dd30 100644 - return S_FALSE; - } - -- wined3d_cs_emit_query_get_data(query->device->cs, query, data, data_size, -- flags, &hr); -- -- return hr; -+ return query->query_ops->query_get_data(query, data, data_size, flags); - } - - UINT CDECL wined3d_query_get_data_size(const struct wined3d_query *query) -@@ -365,14 +367,7 @@ static HRESULT wined3d_occlusion_query_ops_get_data(struct wined3d_query *query, - void *data, DWORD size, DWORD flags) - { - struct wined3d_occlusion_query *oq = wined3d_occlusion_query_from_query(query); -- struct wined3d_device *device = query->device; -- const struct wined3d_gl_info *gl_info = &device->adapter->gl_info; -- struct wined3d_context *context; -- GLuint available; - GLuint samples; -- HRESULT res; -- -- TRACE("query %p, data %p, size %#x, flags %#x.\n", query, data, size, flags); - - if (!oq->context) - query->state = QUERY_CREATED; -@@ -386,6 +381,8 @@ static HRESULT wined3d_occlusion_query_ops_get_data(struct wined3d_query *query, - return S_OK; - } - -+ TRACE("(%p) : type D3DQUERY_OCCLUSION, data %p, size %#x, flags %#x.\n", query, data, size, flags); -+ if (query->state == QUERY_BUILDING) { - /* Msdn says this returns an error, but our tests show that S_FALSE is returned */ -@@ -393,12 +390,37 @@ static HRESULT wined3d_occlusion_query_ops_get_data(struct wined3d_query *query, - return S_FALSE; + WARN("Query is building, returning S_FALSE.\n"); +@@ -343,14 +349,18 @@ HRESULT CDECL wined3d_query_get_data(struct wined3d_query *query, } -+ if (!wined3d_settings.cs_multithreaded) + if (query->state == QUERY_CREATED) + { -+ if (!query->query_ops->query_poll(query)) -+ return S_FALSE; + WARN("Query wasn't started yet.\n"); +- else + } ++ else if (!wined3d_settings.cs_multithreaded) + { +- BOOL ret; +- wined3d_cs_emit_query_poll(query->device->cs, query, &ret); +- if (!ret) ++ if (!query->query_ops->query_poll(query)) + return S_FALSE; + } + else if (query->counter_main != query->counter_retrieved) + { + return S_FALSE; + } -+ -+ if (data) -+ fill_query_data(data, size, &oq->samples, sizeof(oq->samples)); -+ -+ return S_OK; -+} -+ -+static BOOL wined3d_occlusion_query_ops_poll(struct wined3d_query *query) -+{ -+ struct wined3d_occlusion_query *oq = wined3d_occlusion_query_from_query(query); -+ struct wined3d_device *device = query->device; -+ const struct wined3d_gl_info *gl_info = &device->adapter->gl_info; -+ struct wined3d_context *context; -+ GLuint available; -+ GLuint samples; -+ BOOL ret; -+ - if (oq->context->tid != GetCurrentThreadId()) - { - FIXME("%p Wrong thread, returning 1.\n", query); -- samples = 1; -- fill_query_data(data, size, &samples, sizeof(samples)); -- return S_OK; -+ oq->samples = 1; -+ return TRUE; - } - - context = context_acquire(device, context_get_rt_surface(oq->context)); -@@ -409,61 +431,71 @@ static HRESULT wined3d_occlusion_query_ops_get_data(struct wined3d_query *query, - - if (available) - { -- if (size) -- { -- GL_EXTCALL(glGetQueryObjectuiv(oq->id, GL_QUERY_RESULT, &samples)); -- checkGLcall("glGetQueryObjectuiv(GL_QUERY_RESULT)"); -- TRACE("Returning %d samples.\n", samples); -- fill_query_data(data, size, &samples, sizeof(samples)); -- } -- res = S_OK; -+ GL_EXTCALL(glGetQueryObjectuiv(oq->id, GL_QUERY_RESULT, &samples)); -+ checkGLcall("glGetQueryObjectuiv(GL_QUERY_RESULT)"); -+ TRACE("Returning %d samples.\n", samples); -+ oq->samples = samples; -+ ret = TRUE; - } - else - { -- res = S_FALSE; -+ ret = FALSE; - } - - context_release(context); - -- return res; -+ return ret; - } - --static HRESULT wined3d_event_query_ops_get_data(struct wined3d_query *query, -- void *data, DWORD size, DWORD flags) -+static BOOL wined3d_event_query_ops_poll(struct wined3d_query *query) - { - struct wined3d_event_query *event_query = wined3d_event_query_from_query(query); - enum wined3d_event_query_result ret; -- BOOL signaled; -- -- TRACE("query %p, data %p, size %#x, flags %#x.\n", query, data, size, flags); -- -- if (!data || !size) -- return S_OK; - - ret = wined3d_event_query_test(event_query, query->device); - switch(ret) - { - case WINED3D_EVENT_QUERY_OK: - case WINED3D_EVENT_QUERY_NOT_STARTED: -- signaled = TRUE; -- fill_query_data(data, size, &signaled, sizeof(signaled)); -- break; -+ return TRUE; - - case WINED3D_EVENT_QUERY_WAITING: -- signaled = FALSE; -- fill_query_data(data, size, &signaled, sizeof(signaled)); -- break; -+ return FALSE; - - case WINED3D_EVENT_QUERY_WRONG_THREAD: - FIXME("(%p) Wrong thread, reporting GPU idle.\n", query); -- signaled = TRUE; -- fill_query_data(data, size, &signaled, sizeof(signaled)); -- break; -+ return TRUE; - - case WINED3D_EVENT_QUERY_ERROR: - ERR("The GL event query failed, returning D3DERR_INVALIDCALL\n"); -- return WINED3DERR_INVALIDCALL; -+ return TRUE; -+ -+ default: -+ ERR("Unexpected wined3d_event_query_test result %u\n", ret); -+ return TRUE; - } -+} -+ -+static HRESULT wined3d_event_query_ops_get_data(struct wined3d_query *query, -+ void *pData, DWORD dwSize, DWORD flags) -+{ -+ BOOL *data = pData; -+ enum wined3d_event_query_result ret; -+ -+ TRACE("query %p, pData %p, dwSize %#x, flags %#x.\n", query, pData, dwSize, flags); -+ -+ if (!pData || !dwSize) -+ return S_OK; -+ -+ if (!wined3d_settings.cs_multithreaded) -+ ret = query->query_ops->query_poll(query); -+ else if (query->counter_main != query->counter_retrieved) -+ ret = FALSE; -+ else -+ ret = TRUE; -+ -+ if (data) -+ fill_query_data(data, dwSize, &ret, sizeof(ret)); - - return S_OK; - } -@@ -583,33 +615,57 @@ static HRESULT wined3d_timestamp_query_ops_get_data(struct wined3d_query *query, - void *data, DWORD size, DWORD flags) - { - struct wined3d_timestamp_query *tq = wined3d_timestamp_query_from_query(query); -+ -+ TRACE("(%p) : type D3DQUERY_TIMESTAMP, data %p, size %#x, flags %#x.\n", query, data, size, flags); -+ -+ if (query->state == QUERY_CREATED) -+ { -+ UINT64 zero = 0; -+ /* D3D allows GetData on a new query, OpenGL doesn't. So just invent the data ourselves */ -+ TRACE("Query wasn't yet started, returning S_OK.\n"); -+ if (data) -+ fill_query_data(data, size, &zero, sizeof(zero)); -+ return S_OK; -+ } -+ -+ if (!wined3d_settings.cs_multithreaded) -+ { -+ if (!query->query_ops->query_poll(query)) -+ return S_FALSE; -+ } -+ else if (query->counter_main != query->counter_retrieved) -+ { -+ return S_FALSE; -+ } -+ -+ if (data) -+ fill_query_data(data, size, &tq->timestamp, sizeof(tq->timestamp)); -+ -+ return S_OK; -+} -+ -+static BOOL wined3d_timestamp_query_ops_poll(struct wined3d_query *query) -+{ -+ struct wined3d_timestamp_query *tq = wined3d_timestamp_query_from_query(query); - struct wined3d_device *device = query->device; - const struct wined3d_gl_info *gl_info = &device->adapter->gl_info; - struct wined3d_context *context; - GLuint available; - GLuint64 timestamp; -- HRESULT res; -+ BOOL ret; - -- TRACE("query %p, data %p, size %#x, flags %#x.\n", query, data, size, flags); -- -- if (!tq->context) -- query->state = QUERY_CREATED; -- -- if (query->state == QUERY_CREATED) -+ if (!gl_info->supported[ARB_TIMER_QUERY]) - { -- /* D3D allows GetData on a new query, OpenGL doesn't. So just invent the data ourselves. */ -- TRACE("Query wasn't yet started, returning S_OK.\n"); -- timestamp = 0; -- fill_query_data(data, size, ×tamp, sizeof(timestamp)); -- return S_OK; -+ TRACE("Faking timestamp.\n"); -+ QueryPerformanceCounter((LARGE_INTEGER *)&tq->timestamp); -+ return TRUE; - } - - if (tq->context->tid != GetCurrentThreadId()) - { - FIXME("%p Wrong thread, returning 1.\n", query); -- timestamp = 1; -- fill_query_data(data, size, ×tamp, sizeof(timestamp)); -- return S_OK; -+ tq->timestamp = 1; -+ return TRUE; - } - - context = context_acquire(device, context_get_rt_surface(tq->context)); -@@ -620,23 +676,20 @@ static HRESULT wined3d_timestamp_query_ops_get_data(struct wined3d_query *query, - - if (available) - { -- if (size) -- { -- GL_EXTCALL(glGetQueryObjectui64v(tq->id, GL_QUERY_RESULT, ×tamp)); -- checkGLcall("glGetQueryObjectui64v(GL_QUERY_RESULT)"); -- TRACE("Returning timestamp %s.\n", wine_dbgstr_longlong(timestamp)); -- fill_query_data(data, size, ×tamp, sizeof(timestamp)); -- } -- res = S_OK; -+ GL_EXTCALL(glGetQueryObjectui64v(tq->id, GL_QUERY_RESULT, ×tamp)); -+ checkGLcall("glGetQueryObjectui64v(GL_QUERY_RESULT)"); -+ TRACE("Returning timestamp %s.\n", wine_dbgstr_longlong(timestamp)); -+ tq->timestamp = timestamp; -+ ret = TRUE; - } - else - { -- res = S_FALSE; -+ ret = FALSE; - } - - context_release(context); - -- return res; -+ return ret; - } - - static void wined3d_timestamp_query_ops_issue(struct wined3d_query *query, DWORD flags) -@@ -670,7 +723,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); -- - if (query->type == WINED3D_QUERY_TYPE_TIMESTAMP_DISJOINT) - { - static const struct wined3d_query_data_timestamp_disjoint disjoint_data = {1000 * 1000 * 1000, FALSE}; -@@ -692,6 +744,11 @@ static HRESULT wined3d_timestamp_disjoint_query_ops_get_data(struct wined3d_quer - return S_OK; - } - -+static BOOL wined3d_timestamp_disjoint_query_ops_poll(struct wined3d_query *query) -+{ -+ return TRUE; -+} -+ - static void wined3d_timestamp_disjoint_query_ops_issue(struct wined3d_query *query, DWORD flags) - { - TRACE("query %p, flags %#x.\n", query, flags); -@@ -714,6 +771,11 @@ static HRESULT wined3d_statistics_query_ops_get_data(struct wined3d_query *query - return S_OK; - } - -+static BOOL wined3d_statistics_query_ops_poll(struct wined3d_query *query) -+{ -+ return TRUE; -+} -+ - static void wined3d_statistics_query_ops_issue(struct wined3d_query *query, DWORD flags) - { - FIXME("query %p, flags %#x.\n", query, flags); -@@ -731,6 +793,11 @@ static HRESULT wined3d_overflow_query_ops_get_data(struct wined3d_query *query, - return S_OK; - } - -+static BOOL wined3d_overflow_query_ops_poll(struct wined3d_query *query) -+{ -+ return TRUE; -+} -+ - static void wined3d_overflow_query_ops_issue(struct wined3d_query *query, DWORD flags) - { - FIXME("query %p, flags %#x.\n", query, flags); -@@ -739,6 +806,7 @@ 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, -+ wined3d_event_query_ops_poll, - wined3d_event_query_ops_issue, - }; - -@@ -770,6 +838,7 @@ static HRESULT wined3d_event_query_create(struct wined3d_device *device, - static const struct wined3d_query_ops occlusion_query_ops = - { - wined3d_occlusion_query_ops_get_data, -+ wined3d_occlusion_query_ops_poll, - wined3d_occlusion_query_ops_issue, - }; - -@@ -801,6 +870,7 @@ static HRESULT wined3d_occlusion_query_create(struct wined3d_device *device, - static const struct wined3d_query_ops timestamp_query_ops = - { - wined3d_timestamp_query_ops_get_data, -+ wined3d_timestamp_query_ops_poll, - wined3d_timestamp_query_ops_issue, - }; - -@@ -832,6 +902,7 @@ static HRESULT wined3d_timestamp_query_create(struct wined3d_device *device, - static const struct wined3d_query_ops timestamp_disjoint_query_ops = - { - wined3d_timestamp_disjoint_query_ops_get_data, -+ wined3d_timestamp_disjoint_query_ops_poll, - wined3d_timestamp_disjoint_query_ops_issue, - }; - -@@ -867,6 +938,7 @@ static HRESULT wined3d_timestamp_disjoint_query_create(struct wined3d_device *de - static const struct wined3d_query_ops statistics_query_ops = - { - wined3d_statistics_query_ops_get_data, -+ wined3d_statistics_query_ops_poll, - wined3d_statistics_query_ops_issue, - }; - -@@ -892,6 +964,7 @@ static HRESULT wined3d_statistics_query_create(struct wined3d_device *device, - static const struct wined3d_query_ops overflow_query_ops = - { - wined3d_overflow_query_ops_get_data, -+ wined3d_overflow_query_ops_poll, - wined3d_overflow_query_ops_issue, - }; + if (data) + memcpy(data, query->data, min(data_size, query->data_size)); diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h -index 232f099..3688ef9 100644 +index e7f2974..9edaa41 100644 --- a/dlls/wined3d/wined3d_private.h +++ b/dlls/wined3d/wined3d_private.h -@@ -1382,6 +1382,7 @@ enum wined3d_query_state - struct wined3d_query_ops - { - HRESULT (*query_get_data)(struct wined3d_query *query, void *data, DWORD data_size, DWORD flags); -+ BOOL (*query_poll)(struct wined3d_query *query); - void (*query_issue)(struct wined3d_query *query, DWORD flags); - }; - -@@ -1395,7 +1396,8 @@ struct wined3d_query - enum wined3d_query_type type; +@@ -1396,7 +1396,8 @@ struct wined3d_query + const void *data; DWORD data_size; const struct wined3d_query_ops *query_ops; - LONG counter_main, counter_worker; @@ -578,23 +216,7 @@ index 232f099..3688ef9 100644 }; union wined3d_gl_query_object -@@ -1435,6 +1437,7 @@ struct wined3d_occlusion_query - struct list entry; - GLuint id; - struct wined3d_context *context; -+ DWORD samples; - }; - - struct wined3d_timestamp_query -@@ -1444,6 +1447,7 @@ struct wined3d_timestamp_query - struct list entry; - GLuint id; - struct wined3d_context *context; -+ UINT64 timestamp; - }; - - void context_alloc_timestamp_query(struct wined3d_context *context, struct wined3d_timestamp_query *query) DECLSPEC_HIDDEN; -@@ -3059,6 +3063,7 @@ struct wined3d_cs +@@ -3070,6 +3071,7 @@ struct wined3d_cs struct wined3d_cs_queue queue; LONG pending_presents; @@ -603,5 +225,5 @@ index 232f099..3688ef9 100644 struct wined3d_cs *wined3d_cs_create(struct wined3d_device *device) DECLSPEC_HIDDEN; -- -2.8.0 +2.9.0 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 deleted file mode 100644 index 6bfee5ab..00000000 --- a/patches/wined3d-CSMT_Main/0046-wined3d-Separate-main-and-worker-thread-query-state.patch +++ /dev/null @@ -1,115 +0,0 @@ -From bdc6e270b4f3c17a4e59d8a2fa0a18986317d438 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 - ---- - dlls/wined3d/query.c | 29 ++++++++++------------------- - dlls/wined3d/wined3d_private.h | 1 + - 2 files changed, 11 insertions(+), 19 deletions(-) - -diff --git a/dlls/wined3d/query.c b/dlls/wined3d/query.c -index 2af86b8..8d4213e 100644 ---- a/dlls/wined3d/query.c -+++ b/dlls/wined3d/query.c -@@ -329,6 +329,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); -+ -+ if (flags & WINED3DISSUE_BEGIN) -+ query->state = QUERY_BUILDING; -+ else -+ query->state = QUERY_SIGNALLED; -+ - return WINED3D_OK; - } - -@@ -503,11 +509,6 @@ static void wined3d_event_query_ops_issue(struct wined3d_query *query, DWORD fla - /* Started implicitly at query creation. */ - ERR("Event query issued with START flag - what to do?\n"); - } -- -- if (flags & WINED3DISSUE_BEGIN) -- query->state = QUERY_BUILDING; -- else -- query->state = QUERY_SIGNALLED; - } - - static void wined3d_occlusion_query_ops_issue(struct wined3d_query *query, DWORD flags) -@@ -523,7 +524,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 (oq->context->tid != GetCurrentThreadId()) - { -@@ -553,13 +554,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) - { - /* 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()) - { -@@ -575,13 +577,9 @@ static void wined3d_occlusion_query_ops_issue(struct wined3d_query *query, DWORD - context_release(context); - } - } -+ oq->started = FALSE; - } - -- if (flags & WINED3DISSUE_BEGIN) -- query->state = QUERY_BUILDING; -- else -- query->state = QUERY_SIGNALLED; -- - return; - } - -@@ -688,8 +686,6 @@ static void wined3d_timestamp_query_ops_issue(struct wined3d_query *query, DWORD - GL_EXTCALL(glQueryCounter(tq->id, GL_TIMESTAMP)); - checkGLcall("glQueryCounter()"); - context_release(context); -- -- query->state = QUERY_SIGNALLED; - } - } - -@@ -726,11 +722,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); -- -- if (flags & WINED3DISSUE_BEGIN) -- query->state = QUERY_BUILDING; -- if (flags & WINED3DISSUE_END) -- query->state = QUERY_SIGNALLED; - } - - static HRESULT wined3d_statistics_query_ops_get_data(struct wined3d_query *query, -diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h -index 2029c0a..52038aa 100644 ---- a/dlls/wined3d/wined3d_private.h -+++ b/dlls/wined3d/wined3d_private.h -@@ -1440,6 +1440,7 @@ struct wined3d_occlusion_query - GLuint id; - struct wined3d_context *context; - DWORD samples; -+ BOOL started; - }; - - struct wined3d_timestamp_query --- -2.8.0 - 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 c313e5e5..42d06a90 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,19 +1,19 @@ -From 680600405dcf957ecaa1ff7915268afc112e33f7 Mon Sep 17 00:00:00 2001 +From 5c74973f7c5ec68fbde36808b55771c81133b670 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 --- dlls/wined3d/cs.c | 5 +++-- - dlls/wined3d/query.c | 25 ++++++++++++++++++------- + dlls/wined3d/query.c | 25 +++++++++++++++++++------ dlls/wined3d/wined3d_private.h | 2 +- - 3 files changed, 22 insertions(+), 10 deletions(-) + 3 files changed, 23 insertions(+), 9 deletions(-) diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c -index 2f66eff..7178624 100644 +index fb55549..105cf45 100644 --- a/dlls/wined3d/cs.c +++ b/dlls/wined3d/cs.c -@@ -1984,10 +1984,11 @@ static UINT wined3d_cs_exec_query_issue(struct wined3d_cs *cs, const void *data) +@@ -2013,10 +2013,11 @@ static UINT wined3d_cs_exec_query_issue(struct wined3d_cs *cs, const void *data) { const struct wined3d_cs_query_issue *op = data; struct wined3d_query *query = op->query; @@ -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 337ec9b..8682e22 100644 +index aa0973f..c7814a0 100644 --- a/dlls/wined3d/query.c +++ b/dlls/wined3d/query.c -@@ -500,7 +500,7 @@ enum wined3d_query_type CDECL wined3d_query_get_type(const struct wined3d_query +@@ -465,7 +465,7 @@ enum wined3d_query_type CDECL wined3d_query_get_type(const struct wined3d_query return query->type; } @@ -40,7 +40,7 @@ index 337ec9b..8682e22 100644 { TRACE("query %p, flags %#x.\n", query, flags); -@@ -509,20 +509,23 @@ static void wined3d_event_query_ops_issue(struct wined3d_query *query, DWORD fla +@@ -474,20 +474,23 @@ static void wined3d_event_query_ops_issue(struct wined3d_query *query, DWORD fla struct wined3d_event_query *event_query = wined3d_event_query_from_query(query); wined3d_event_query_issue(event_query, query->device); @@ -65,20 +65,19 @@ index 337ec9b..8682e22 100644 TRACE("query %p, flags %#x.\n", query, flags); -@@ -584,9 +587,10 @@ static void wined3d_occlusion_query_ops_issue(struct wined3d_query *query, DWORD +@@ -549,7 +552,10 @@ static void wined3d_occlusion_query_ops_issue(struct wined3d_query *query, DWORD } } oq->started = FALSE; + poll = TRUE; } - -- return; ++ + return poll; } - static HRESULT wined3d_timestamp_query_ops_get_data(struct wined3d_query *query, -@@ -670,7 +674,7 @@ static BOOL wined3d_timestamp_query_ops_poll(struct wined3d_query *query) - return ret; + static BOOL wined3d_timestamp_query_ops_poll(struct wined3d_query *query) +@@ -590,7 +596,7 @@ static BOOL wined3d_timestamp_query_ops_poll(struct wined3d_query *query) + return available; } -static void wined3d_timestamp_query_ops_issue(struct wined3d_query *query, DWORD flags) @@ -86,7 +85,7 @@ index 337ec9b..8682e22 100644 { struct wined3d_timestamp_query *tq = wined3d_timestamp_query_from_query(query); struct wined3d_device *device = query->device; -@@ -693,6 +697,10 @@ static void wined3d_timestamp_query_ops_issue(struct wined3d_query *query, DWORD +@@ -613,6 +619,10 @@ static void wined3d_timestamp_query_ops_issue(struct wined3d_query *query, DWORD checkGLcall("glQueryCounter()"); context_release(context); } @@ -96,8 +95,8 @@ index 337ec9b..8682e22 100644 + return FALSE; } - static HRESULT wined3d_timestamp_disjoint_query_ops_get_data(struct wined3d_query *query, -@@ -725,9 +733,10 @@ static BOOL wined3d_timestamp_disjoint_query_ops_poll(struct wined3d_query *quer + static BOOL wined3d_timestamp_disjoint_query_ops_poll(struct wined3d_query *query) +@@ -622,9 +632,10 @@ static BOOL wined3d_timestamp_disjoint_query_ops_poll(struct wined3d_query *quer return TRUE; } @@ -108,8 +107,8 @@ index 337ec9b..8682e22 100644 + return FALSE; } - static HRESULT wined3d_statistics_query_ops_get_data(struct wined3d_query *query, -@@ -747,9 +756,10 @@ static BOOL wined3d_statistics_query_ops_poll(struct wined3d_query *query) + static BOOL wined3d_statistics_query_ops_poll(struct wined3d_query *query) +@@ -634,9 +645,10 @@ static BOOL wined3d_statistics_query_ops_poll(struct wined3d_query *query) return TRUE; } @@ -120,8 +119,8 @@ index 337ec9b..8682e22 100644 + return FALSE; } - static HRESULT wined3d_overflow_query_ops_get_data(struct wined3d_query *query, -@@ -769,9 +779,10 @@ static BOOL wined3d_overflow_query_ops_poll(struct wined3d_query *query) + static HRESULT wined3d_overflow_query_ops_poll(struct wined3d_query *query) +@@ -646,9 +658,10 @@ static HRESULT wined3d_overflow_query_ops_poll(struct wined3d_query *query) return TRUE; } @@ -134,12 +133,12 @@ index 337ec9b..8682e22 100644 static const struct wined3d_query_ops event_query_ops = diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h -index b3374bf..d70804f 100644 +index 8a04b4c..20ea5a8 100644 --- a/dlls/wined3d/wined3d_private.h +++ b/dlls/wined3d/wined3d_private.h -@@ -1383,7 +1383,7 @@ struct wined3d_query_ops +@@ -1382,7 +1382,7 @@ enum wined3d_query_state + struct wined3d_query_ops { - HRESULT (*query_get_data)(struct wined3d_query *query, void *data, DWORD data_size, DWORD flags); BOOL (*query_poll)(struct wined3d_query *query); - void (*query_issue)(struct wined3d_query *query, DWORD flags); + BOOL (*query_issue)(struct wined3d_query *query, DWORD flags); @@ -147,5 +146,5 @@ index b3374bf..d70804f 100644 struct wined3d_query -- -2.8.0 +2.9.0 diff --git a/patches/wined3d-CSMT_Main/0049-wined3d-Don-t-reset-the-query-state-if-it-doesn-t-ha.patch b/patches/wined3d-CSMT_Main/0049-wined3d-Don-t-reset-the-query-state-if-it-doesn-t-ha.patch deleted file mode 100644 index 477f8ed8..00000000 --- a/patches/wined3d-CSMT_Main/0049-wined3d-Don-t-reset-the-query-state-if-it-doesn-t-ha.patch +++ /dev/null @@ -1,31 +0,0 @@ -From b8bb97c977b85a946ba508538bd5d621b03b0488 Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Stefan=20D=C3=B6singer?= -Date: Mon, 5 Aug 2013 13:07:42 +0200 -Subject: wined3d: Don't reset the query state if it doesn't have a ctx - -The CS recreates occlusion queries and changes the context variable. -This leads to incorrect query results. - -TODO: Before sending, find out why the line was there in the first place -and if it is needed with the multithreaded and/or singlethreaded CS. ---- - dlls/wined3d/query.c | 3 --- - 1 file changed, 3 deletions(-) - -diff --git a/dlls/wined3d/query.c b/dlls/wined3d/query.c -index 2a9dc2f..c115c04 100644 ---- a/dlls/wined3d/query.c -+++ b/dlls/wined3d/query.c -@@ -349,9 +349,6 @@ static HRESULT wined3d_occlusion_query_ops_get_data(struct wined3d_query *query, - struct wined3d_occlusion_query *oq = wined3d_occlusion_query_from_query(query); - GLuint samples; - -- if (!oq->context) -- query->state = QUERY_CREATED; -- - if (query->state == QUERY_CREATED) - { - /* D3D allows GetData on a new query, OpenGL doesn't. So just invent the data ourselves */ --- -2.8.0 - diff --git a/patches/wined3d-CSMT_Main/0051-wined3d-Send-texture-preloads-through-the-CS.patch b/patches/wined3d-CSMT_Main/0051-wined3d-Send-texture-preloads-through-the-CS.patch index 408e34b4..a0931e9d 100644 --- a/patches/wined3d-CSMT_Main/0051-wined3d-Send-texture-preloads-through-the-CS.patch +++ b/patches/wined3d-CSMT_Main/0051-wined3d-Send-texture-preloads-through-the-CS.patch @@ -1,4 +1,4 @@ -From 8fa73a39c4748e5c8a8ca00984fab4fbe740a806 Mon Sep 17 00:00:00 2001 +From 4e9e48376defff77261a0ae433694fc848b764b8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stefan=20D=C3=B6singer?= Date: Thu, 1 Aug 2013 00:10:40 +0200 Subject: wined3d: Send texture preloads through the CS @@ -10,10 +10,10 @@ Subject: wined3d: Send texture preloads through the CS 3 files changed, 35 insertions(+), 4 deletions(-) diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c -index 72c83f5..e115a28 100644 +index 7b91220..811c4b7 100644 --- a/dlls/wined3d/cs.c +++ b/dlls/wined3d/cs.c -@@ -70,6 +70,7 @@ enum wined3d_cs_op +@@ -71,6 +71,7 @@ enum wined3d_cs_op WINED3D_CS_OP_TEXTURE_MAP, WINED3D_CS_OP_TEXTURE_UNMAP, WINED3D_CS_OP_QUERY_ISSUE, @@ -21,7 +21,7 @@ index 72c83f5..e115a28 100644 WINED3D_CS_OP_STOP, }; -@@ -396,6 +397,12 @@ struct wined3d_cs_query_issue +@@ -403,6 +404,12 @@ struct wined3d_cs_query_issue DWORD flags; }; @@ -34,7 +34,7 @@ index 72c83f5..e115a28 100644 static void wined3d_cs_mt_submit(struct wined3d_cs *cs, size_t size) { LONG new_val = (cs->queue.head + size) & (WINED3D_CS_QUEUE_SIZE - 1); -@@ -2030,6 +2037,30 @@ void wined3d_cs_emit_query_issue(struct wined3d_cs *cs, struct wined3d_query *qu +@@ -2059,6 +2066,30 @@ void wined3d_cs_emit_query_issue(struct wined3d_cs *cs, struct wined3d_query *qu cs->ops->submit(cs, sizeof(*op)); } @@ -65,7 +65,7 @@ index 72c83f5..e115a28 100644 static UINT (* const wined3d_cs_op_handlers[])(struct wined3d_cs *cs, const void *data) = { /* WINED3D_CS_OP_NOP */ wined3d_cs_exec_nop, -@@ -2078,6 +2109,7 @@ static UINT (* const wined3d_cs_op_handlers[])(struct wined3d_cs *cs, const void +@@ -2108,6 +2139,7 @@ static UINT (* const wined3d_cs_op_handlers[])(struct wined3d_cs *cs, const void /* WINED3D_CS_OP_TEXTURE_MAP */ wined3d_cs_exec_texture_map, /* WINED3D_CS_OP_TEXTURE_UNMAP */ wined3d_cs_exec_texture_unmap, /* WINED3D_CS_OP_QUERY_ISSUE */ wined3d_cs_exec_query_issue, @@ -74,7 +74,7 @@ index 72c83f5..e115a28 100644 static inline void *_wined3d_cs_mt_require_space(struct wined3d_cs *cs, size_t size, BOOL prio) diff --git a/dlls/wined3d/texture.c b/dlls/wined3d/texture.c -index e239282..f650cd9 100644 +index e19484b..687799d 100644 --- a/dlls/wined3d/texture.c +++ b/dlls/wined3d/texture.c @@ -920,10 +920,8 @@ void wined3d_texture_load(struct wined3d_texture *texture, @@ -91,17 +91,17 @@ index e239282..f650cd9 100644 void * CDECL wined3d_texture_get_parent(const struct wined3d_texture *texture) diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h -index 277d891..0c968d2 100644 +index 20ea5a8..66fd4ae 100644 --- a/dlls/wined3d/wined3d_private.h +++ b/dlls/wined3d/wined3d_private.h -@@ -3150,6 +3150,7 @@ void wined3d_cs_emit_query_issue(struct wined3d_cs *cs, struct wined3d_query *qu +@@ -3161,6 +3161,7 @@ void wined3d_cs_emit_texture_unmap(struct wined3d_cs *cs, struct wined3d_texture + void wined3d_cs_emit_query_issue(struct wined3d_cs *cs, struct wined3d_query *query, DWORD flags) DECLSPEC_HIDDEN; - void wined3d_cs_emit_query_get_data(struct wined3d_cs *cs, struct wined3d_query *query, void *data, - UINT data_size, DWORD flags, HRESULT *ret) DECLSPEC_HIDDEN; + void wined3d_cs_emit_query_poll(struct wined3d_cs *cs, struct wined3d_query *query, BOOL *ret) DECLSPEC_HIDDEN; +void wined3d_cs_emit_texture_preload(struct wined3d_cs *cs, struct wined3d_texture *texture) DECLSPEC_HIDDEN; /* TODO: Add tests and support for FLOAT16_4 POSITIONT, D3DCOLOR position, other * fixed function semantics as D3DCOLOR or FLOAT16 */ -- -2.8.0 +2.9.0 diff --git a/patches/wined3d-CSMT_Main/0055-wined3d-Send-update_texture-calls-through-the-CS.patch b/patches/wined3d-CSMT_Main/0055-wined3d-Send-update_texture-calls-through-the-CS.patch index 3c0bda86..ee214fc7 100644 --- a/patches/wined3d-CSMT_Main/0055-wined3d-Send-update_texture-calls-through-the-CS.patch +++ b/patches/wined3d-CSMT_Main/0055-wined3d-Send-update_texture-calls-through-the-CS.patch @@ -1,4 +1,4 @@ -From 5022da3bf443b3ff8e74cb13a23e2bc1aeab0e77 Mon Sep 17 00:00:00 2001 +From e98df687ff8ca219bc6518a82f120b0fe856f9c7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stefan=20D=C3=B6singer?= Date: Thu, 1 Aug 2013 00:33:48 +0200 Subject: wined3d: Send update_texture calls through the CS @@ -11,10 +11,10 @@ FIXME: This logic duplication is ugly. 3 files changed, 137 insertions(+), 82 deletions(-) diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c -index e115a28..aa66603 100644 +index 811c4b7..2cb9ad7 100644 --- a/dlls/wined3d/cs.c +++ b/dlls/wined3d/cs.c -@@ -71,6 +71,7 @@ enum wined3d_cs_op +@@ -72,6 +72,7 @@ enum wined3d_cs_op WINED3D_CS_OP_TEXTURE_UNMAP, WINED3D_CS_OP_QUERY_ISSUE, WINED3D_CS_OP_TEXTURE_PRELOAD, @@ -22,7 +22,7 @@ index e115a28..aa66603 100644 WINED3D_CS_OP_STOP, }; -@@ -403,6 +404,12 @@ struct wined3d_cs_texture_preload +@@ -410,6 +411,12 @@ struct wined3d_cs_texture_preload struct wined3d_texture *texture; }; @@ -35,7 +35,7 @@ index e115a28..aa66603 100644 static void wined3d_cs_mt_submit(struct wined3d_cs *cs, size_t size) { LONG new_val = (cs->queue.head + size) & (WINED3D_CS_QUEUE_SIZE - 1); -@@ -2061,6 +2068,31 @@ void wined3d_cs_emit_texture_preload(struct wined3d_cs *cs, struct wined3d_textu +@@ -2090,6 +2097,31 @@ void wined3d_cs_emit_texture_preload(struct wined3d_cs *cs, struct wined3d_textu cs->ops->submit(cs, sizeof(*op)); } @@ -67,7 +67,7 @@ index e115a28..aa66603 100644 static UINT (* const wined3d_cs_op_handlers[])(struct wined3d_cs *cs, const void *data) = { /* WINED3D_CS_OP_NOP */ wined3d_cs_exec_nop, -@@ -2110,6 +2142,7 @@ static UINT (* const wined3d_cs_op_handlers[])(struct wined3d_cs *cs, const void +@@ -2140,6 +2172,7 @@ static UINT (* const wined3d_cs_op_handlers[])(struct wined3d_cs *cs, const void /* WINED3D_CS_OP_TEXTURE_UNMAP */ wined3d_cs_exec_texture_unmap, /* WINED3D_CS_OP_QUERY_ISSUE */ wined3d_cs_exec_query_issue, /* WINED3D_CS_OP_TEXTURE_PRELOAD */ wined3d_cs_exec_texture_preload, @@ -76,10 +76,10 @@ index e115a28..aa66603 100644 static inline void *_wined3d_cs_mt_require_space(struct wined3d_cs *cs, size_t size, BOOL prio) diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c -index c5f20c9..ad8e7c6 100644 +index d458747..99118f2 100644 --- a/dlls/wined3d/device.c +++ b/dlls/wined3d/device.c -@@ -3532,34 +3532,17 @@ void CDECL wined3d_device_draw_indexed_primitive_instanced(struct wined3d_device +@@ -3558,34 +3558,17 @@ void CDECL wined3d_device_draw_indexed_primitive_instanced(struct wined3d_device start_idx, index_count, start_instance, instance_count, TRUE); } @@ -118,7 +118,7 @@ index c5f20c9..ad8e7c6 100644 /* Only a prepare, since we're uploading entire volumes. */ wined3d_texture_prepare_texture(dst_texture, context, FALSE); -@@ -3567,32 +3550,89 @@ static HRESULT wined3d_device_update_texture_3d(struct wined3d_device *device, +@@ -3593,32 +3576,89 @@ static HRESULT wined3d_device_update_texture_3d(struct wined3d_device *device, for (i = 0; i < level_count; ++i) { @@ -218,7 +218,7 @@ index c5f20c9..ad8e7c6 100644 TRACE("device %p, src_texture %p, dst_texture %p.\n", device, src_texture, dst_texture); -@@ -3629,70 +3669,48 @@ HRESULT CDECL wined3d_device_update_texture(struct wined3d_device *device, +@@ -3655,70 +3695,48 @@ HRESULT CDECL wined3d_device_update_texture(struct wined3d_device *device, return WINED3DERR_INVALIDCALL; } @@ -319,10 +319,10 @@ index c5f20c9..ad8e7c6 100644 HRESULT CDECL wined3d_device_validate_device(const struct wined3d_device *device, DWORD *num_passes) diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h -index 2565a16..47fdc9e 100644 +index e2e8673..9caeb46 100644 --- a/dlls/wined3d/wined3d_private.h +++ b/dlls/wined3d/wined3d_private.h -@@ -2521,6 +2521,8 @@ void device_resource_add(struct wined3d_device *device, struct wined3d_resource +@@ -2533,6 +2533,8 @@ void device_resource_add(struct wined3d_device *device, struct wined3d_resource void device_resource_released(struct wined3d_device *device, struct wined3d_resource *resource) DECLSPEC_HIDDEN; void device_invalidate_state(const struct wined3d_device *device, DWORD state) DECLSPEC_HIDDEN; void device_invalidate_shader_constants(const struct wined3d_device *device, DWORD mask) DECLSPEC_HIDDEN; @@ -331,9 +331,9 @@ index 2565a16..47fdc9e 100644 static inline BOOL isStateDirty(const struct wined3d_context *context, DWORD state) { -@@ -3151,6 +3153,8 @@ void wined3d_cs_emit_query_issue(struct wined3d_cs *cs, struct wined3d_query *qu - void wined3d_cs_emit_query_get_data(struct wined3d_cs *cs, struct wined3d_query *query, void *data, - UINT data_size, DWORD flags, HRESULT *ret) DECLSPEC_HIDDEN; +@@ -3162,6 +3164,8 @@ void wined3d_cs_emit_query_issue(struct wined3d_cs *cs, struct wined3d_query *qu + DWORD flags) DECLSPEC_HIDDEN; + void wined3d_cs_emit_query_poll(struct wined3d_cs *cs, struct wined3d_query *query, BOOL *ret) DECLSPEC_HIDDEN; void wined3d_cs_emit_texture_preload(struct wined3d_cs *cs, struct wined3d_texture *texture) DECLSPEC_HIDDEN; +void wined3d_cs_emit_update_texture(struct wined3d_cs *cs, struct wined3d_texture *src, + struct wined3d_texture *dst) DECLSPEC_HIDDEN; @@ -341,5 +341,5 @@ index 2565a16..47fdc9e 100644 /* TODO: Add tests and support for FLOAT16_4 POSITIONT, D3DCOLOR position, other * fixed function semantics as D3DCOLOR or FLOAT16 */ -- -2.8.0 +2.9.0 diff --git a/patches/wined3d-CSMT_Main/9999-IfDefined.patch b/patches/wined3d-CSMT_Main/9999-IfDefined.patch index 94a6b9fe..1825eb8b 100644 --- a/patches/wined3d-CSMT_Main/9999-IfDefined.patch +++ b/patches/wined3d-CSMT_Main/9999-IfDefined.patch @@ -5075,8 +5075,8 @@ diff --git a/dlls/wined3d/glsl_shader.c b/dlls/wined3d/glsl_shader.c diff --git a/dlls/wined3d/query.c b/dlls/wined3d/query.c --- a/dlls/wined3d/query.c +++ b/dlls/wined3d/query.c -@@ -35,6 +35,9 @@ static void wined3d_query_init(struct wined3d_query *query, struct wined3d_devic - query->type = type; +@@ -37,6 +37,9 @@ static void wined3d_query_init(struct wined3d_query *query, struct wined3d_devic + query->data = data; query->data_size = data_size; query->query_ops = query_ops; +#if defined(STAGING_CSMT) @@ -5085,7 +5085,7 @@ diff --git a/dlls/wined3d/query.c b/dlls/wined3d/query.c } static struct wined3d_event_query *wined3d_event_query_from_query(struct wined3d_query *query) -@@ -264,6 +267,11 @@ static void wined3d_query_destroy_object(void *object) +@@ -266,6 +269,11 @@ static void wined3d_query_destroy_object(void *object) { struct wined3d_query *query = object; @@ -5097,63 +5097,19 @@ diff --git a/dlls/wined3d/query.c b/dlls/wined3d/query.c /* Queries are specific to the GL context that created them. Not * deleting the query will obviously leak it, but that's still better * than potentially deleting a different query with the same id in this -@@ -339,7 +347,21 @@ HRESULT CDECL wined3d_query_issue(struct wined3d_query *query, DWORD flags) - { - TRACE("query %p, flags %#x.\n", query, flags); - -+#if !defined(STAGING_CSMT) - return query->query_ops->query_issue(query, flags); -+#else /* STAGING_CSMT */ -+ if (flags & WINED3DISSUE_END) -+ query->counter_main++; -+ -+ wined3d_cs_emit_query_issue(query->device->cs, query, flags); -+ -+ if (flags & WINED3DISSUE_BEGIN) -+ query->state = QUERY_BUILDING; -+ else -+ query->state = QUERY_SIGNALLED; -+ -+ return WINED3D_OK; -+#endif /* STAGING_CSMT */ - } - - static void fill_query_data(void *out, unsigned int out_size, const void *result, unsigned int result_size) -@@ -351,6 +373,7 @@ static HRESULT wined3d_occlusion_query_ops_get_data(struct wined3d_query *query, - void *data, DWORD size, DWORD flags) - { - struct wined3d_occlusion_query *oq = wined3d_occlusion_query_from_query(query); -+#if !defined(STAGING_CSMT) - struct wined3d_device *device = query->device; - const struct wined3d_gl_info *gl_info = &device->adapter->gl_info; - struct wined3d_context *context; -@@ -362,6 +385,9 @@ static HRESULT wined3d_occlusion_query_ops_get_data(struct wined3d_query *query, - - if (!oq->context) - query->state = QUERY_CREATED; -+#else /* STAGING_CSMT */ -+ GLuint samples; -+#endif /* STAGING_CSMT */ +@@ -337,9 +345,24 @@ HRESULT CDECL wined3d_query_get_data(struct wined3d_query *query, + } if (query->state == QUERY_CREATED) - { -@@ -372,6 +398,10 @@ static HRESULT wined3d_occlusion_query_ops_get_data(struct wined3d_query *query, - return S_OK; - } - -+#if defined(STAGING_CSMT) -+ TRACE("(%p) : type D3DQUERY_OCCLUSION, data %p, size %#x, flags %#x.\n", query, data, size, flags); -+ -+#endif /* STAGING_CSMT */ - if (query->state == QUERY_BUILDING) - { - /* Msdn says this returns an error, but our tests show that S_FALSE is returned */ -@@ -379,12 +409,45 @@ static HRESULT wined3d_occlusion_query_ops_get_data(struct wined3d_query *query, ++#if !defined(STAGING_CSMT) + WARN("Query wasn't started yet.\n"); + else if (!query->query_ops->query_poll(query)) return S_FALSE; - } - -+#if defined(STAGING_CSMT) -+ if (!wined3d_settings.cs_multithreaded) ++#else /* STAGING_CSMT */ ++ { ++ WARN("Query wasn't started yet.\n"); ++ } ++ else if (!wined3d_settings.cs_multithreaded) + { + if (!query->query_ops->query_poll(query)) + return S_FALSE; @@ -5162,174 +5118,38 @@ diff --git a/dlls/wined3d/query.c b/dlls/wined3d/query.c + { + return S_FALSE; + } -+ -+ if (data) -+ fill_query_data(data, size, &oq->samples, sizeof(oq->samples)); -+ -+ return S_OK; -+} -+ -+static BOOL wined3d_occlusion_query_ops_poll(struct wined3d_query *query) -+{ -+ struct wined3d_occlusion_query *oq = wined3d_occlusion_query_from_query(query); -+ struct wined3d_device *device = query->device; -+ const struct wined3d_gl_info *gl_info = &device->adapter->gl_info; -+ struct wined3d_context *context; -+ GLuint available; -+ GLuint samples; -+ BOOL ret; -+ +#endif /* STAGING_CSMT */ - if (oq->context->tid != GetCurrentThreadId()) - { - FIXME("%p Wrong thread, returning 1.\n", query); -+#if !defined(STAGING_CSMT) - samples = 1; - fill_query_data(data, size, &samples, sizeof(samples)); - return S_OK; -+#else /* STAGING_CSMT */ -+ oq->samples = 1; -+ return TRUE; -+#endif /* STAGING_CSMT */ - } - context = context_acquire(device, context_get_rt_surface(oq->context)); -@@ -395,6 +458,7 @@ static HRESULT wined3d_occlusion_query_ops_get_data(struct wined3d_query *query, - - if (available) - { -+#if !defined(STAGING_CSMT) - if (size) - { - GL_EXTCALL(glGetQueryObjectuiv(oq->id, GL_QUERY_RESULT, &samples)); -@@ -403,34 +467,55 @@ static HRESULT wined3d_occlusion_query_ops_get_data(struct wined3d_query *query, - fill_query_data(data, size, &samples, sizeof(samples)); - } - res = S_OK; -+#else /* STAGING_CSMT */ -+ GL_EXTCALL(glGetQueryObjectuiv(oq->id, GL_QUERY_RESULT, &samples)); -+ checkGLcall("glGetQueryObjectuiv(GL_QUERY_RESULT)"); -+ TRACE("Returning %d samples.\n", samples); -+ oq->samples = samples; -+ ret = TRUE; -+#endif /* STAGING_CSMT */ - } - else - { -+#if !defined(STAGING_CSMT) - res = S_FALSE; -+#else /* STAGING_CSMT */ -+ ret = FALSE; -+#endif /* STAGING_CSMT */ - } - - context_release(context); - -+#if !defined(STAGING_CSMT) - return res; - } - - static HRESULT wined3d_event_query_ops_get_data(struct wined3d_query *query, - void *data, DWORD size, DWORD flags) -+#else /* STAGING_CSMT */ -+ return ret; -+} -+ -+static BOOL wined3d_event_query_ops_poll(struct wined3d_query *query) -+#endif /* STAGING_CSMT */ + if (data) + memcpy(data, query->data, min(data_size, query->data_size)); +@@ -358,7 +381,14 @@ HRESULT CDECL wined3d_query_issue(struct wined3d_query *query, DWORD flags) { - struct wined3d_event_query *event_query = wined3d_event_query_from_query(query); - enum wined3d_event_query_result ret; + TRACE("query %p, flags %#x.\n", query, flags); + +#if !defined(STAGING_CSMT) - BOOL signaled; - - TRACE("query %p, data %p, size %#x, flags %#x.\n", query, data, size, flags); - - if (!data || !size) - return S_OK; -+#endif /* STAGING_CSMT */ - - ret = wined3d_event_query_test(event_query, query->device); - switch(ret) - { - case WINED3D_EVENT_QUERY_OK: - case WINED3D_EVENT_QUERY_NOT_STARTED: -+#if !defined(STAGING_CSMT) - signaled = TRUE; - fill_query_data(data, size, &signaled, sizeof(signaled)); - break; -@@ -439,17 +524,58 @@ static HRESULT wined3d_event_query_ops_get_data(struct wined3d_query *query, - signaled = FALSE; - fill_query_data(data, size, &signaled, sizeof(signaled)); - break; + query->query_ops->query_issue(query, flags); +#else /* STAGING_CSMT */ -+ return TRUE; ++ if (flags & WINED3DISSUE_END) ++ query->counter_main++; + -+ case WINED3D_EVENT_QUERY_WAITING: -+ return FALSE; ++ wined3d_cs_emit_query_issue(query->device->cs, query, flags); +#endif /* STAGING_CSMT */ - case WINED3D_EVENT_QUERY_WRONG_THREAD: - FIXME("(%p) Wrong thread, reporting GPU idle.\n", query); -+#if !defined(STAGING_CSMT) - signaled = TRUE; - fill_query_data(data, size, &signaled, sizeof(signaled)); - break; -+#else /* STAGING_CSMT */ -+ return TRUE; -+#endif /* STAGING_CSMT */ - - case WINED3D_EVENT_QUERY_ERROR: - ERR("The GL event query failed, returning D3DERR_INVALIDCALL\n"); -+#if !defined(STAGING_CSMT) - return WINED3DERR_INVALIDCALL; - } -+#else /* STAGING_CSMT */ -+ return TRUE; -+ -+ default: -+ ERR("Unexpected wined3d_event_query_test result %u\n", ret); -+ return TRUE; -+ } -+} -+ -+static HRESULT wined3d_event_query_ops_get_data(struct wined3d_query *query, -+ void *pData, DWORD dwSize, DWORD flags) -+{ -+ BOOL *data = pData; -+ enum wined3d_event_query_result ret; -+ -+ TRACE("query %p, pData %p, dwSize %#x, flags %#x.\n", query, pData, dwSize, flags); -+ -+ if (!pData || !dwSize) -+ return S_OK; -+ -+ if (!wined3d_settings.cs_multithreaded) -+ ret = query->query_ops->query_poll(query); -+ else if (query->counter_main != query->counter_retrieved) -+ ret = FALSE; -+ else -+ ret = TRUE; -+ -+ if (data) -+ fill_query_data(data, dwSize, &ret, sizeof(ret)); -+#endif /* STAGING_CSMT */ - - return S_OK; - } -@@ -468,7 +594,11 @@ enum wined3d_query_type CDECL wined3d_query_get_type(const struct wined3d_query + if (flags & WINED3DISSUE_BEGIN) + query->state = QUERY_BUILDING; +@@ -449,7 +479,11 @@ enum wined3d_query_type CDECL wined3d_query_get_type(const struct wined3d_query return query->type; } +#if !defined(STAGING_CSMT) - static HRESULT wined3d_event_query_ops_issue(struct wined3d_query *query, DWORD flags) + static void wined3d_event_query_ops_issue(struct wined3d_query *query, DWORD flags) +#else /* STAGING_CSMT */ +static BOOL wined3d_event_query_ops_issue(struct wined3d_query *query, DWORD flags) +#endif /* STAGING_CSMT */ { TRACE("query %p, flags %#x.\n", query, flags); -@@ -477,12 +607,16 @@ static HRESULT wined3d_event_query_ops_issue(struct wined3d_query *query, DWORD +@@ -458,20 +492,33 @@ static void wined3d_event_query_ops_issue(struct wined3d_query *query, DWORD fla struct wined3d_event_query *event_query = wined3d_event_query_from_query(query); wined3d_event_query_issue(event_query, query->device); @@ -5343,13 +5163,9 @@ diff --git a/dlls/wined3d/query.c b/dlls/wined3d/query.c ERR("Event query issued with START flag - what to do?\n"); } +#if !defined(STAGING_CSMT) - - if (flags & WINED3DISSUE_BEGIN) - query->state = QUERY_BUILDING; -@@ -493,11 +627,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) + static void wined3d_occlusion_query_ops_issue(struct wined3d_query *query, DWORD flags) +#else /* STAGING_CSMT */ + return FALSE; +} @@ -5367,7 +5183,7 @@ diff --git a/dlls/wined3d/query.c b/dlls/wined3d/query.c TRACE("query %p, flags %#x.\n", query, flags); -@@ -505,7 +648,11 @@ static HRESULT wined3d_occlusion_query_ops_issue(struct wined3d_query *query, DW +@@ -479,7 +526,11 @@ static void wined3d_occlusion_query_ops_issue(struct wined3d_query *query, DWORD * restart. */ if (flags & WINED3DISSUE_BEGIN) { @@ -5379,7 +5195,7 @@ diff --git a/dlls/wined3d/query.c b/dlls/wined3d/query.c { if (oq->context->tid != GetCurrentThreadId()) { -@@ -535,13 +682,20 @@ static HRESULT wined3d_occlusion_query_ops_issue(struct wined3d_query *query, DW +@@ -509,13 +560,20 @@ static void wined3d_occlusion_query_ops_issue(struct wined3d_query *query, DWORD checkGLcall("glBeginQuery()"); context_release(context); @@ -5400,7 +5216,7 @@ diff --git a/dlls/wined3d/query.c b/dlls/wined3d/query.c { if (oq->context->tid != GetCurrentThreadId()) { -@@ -555,6 +709,7 @@ static HRESULT wined3d_occlusion_query_ops_issue(struct wined3d_query *query, DW +@@ -529,9 +587,19 @@ static void wined3d_occlusion_query_ops_issue(struct wined3d_query *query, DWORD checkGLcall("glEndQuery()"); context_release(context); @@ -5408,10 +5224,6 @@ diff --git a/dlls/wined3d/query.c b/dlls/wined3d/query.c } } } -@@ -565,17 +720,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; + } @@ -5423,139 +5235,24 @@ diff --git a/dlls/wined3d/query.c b/dlls/wined3d/query.c +#endif /* STAGING_CSMT */ } - static HRESULT wined3d_timestamp_query_ops_get_data(struct wined3d_query *query, - void *data, DWORD size, DWORD flags) - { - struct wined3d_timestamp_query *tq = wined3d_timestamp_query_from_query(query); -+#if defined(STAGING_CSMT) -+ -+ TRACE("(%p) : type D3DQUERY_TIMESTAMP, data %p, size %#x, flags %#x.\n", query, data, size, flags); -+ -+ if (query->state == QUERY_CREATED) -+ { -+ UINT64 zero = 0; -+ /* D3D allows GetData on a new query, OpenGL doesn't. So just invent the data ourselves */ -+ TRACE("Query wasn't yet started, returning S_OK.\n"); -+ if (data) -+ fill_query_data(data, size, &zero, sizeof(zero)); -+ return S_OK; -+ } -+ -+ if (!wined3d_settings.cs_multithreaded) -+ { -+ if (!query->query_ops->query_poll(query)) -+ return S_FALSE; -+ } -+ else if (query->counter_main != query->counter_retrieved) -+ { -+ return S_FALSE; -+ } -+ -+ if (data) -+ fill_query_data(data, size, &tq->timestamp, sizeof(tq->timestamp)); -+ -+ return S_OK; -+} -+ -+static BOOL wined3d_timestamp_query_ops_poll(struct wined3d_query *query) -+{ -+ struct wined3d_timestamp_query *tq = wined3d_timestamp_query_from_query(query); -+#endif /* STAGING_CSMT */ - struct wined3d_device *device = query->device; - const struct wined3d_gl_info *gl_info = &device->adapter->gl_info; - struct wined3d_context *context; - GLuint available; - GLuint64 timestamp; -+#if !defined(STAGING_CSMT) - HRESULT res; - - TRACE("query %p, data %p, size %#x, flags %#x.\n", query, data, size, flags); -@@ -590,14 +789,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; -+#else /* STAGING_CSMT */ -+ BOOL ret; -+ -+ if (!gl_info->supported[ARB_TIMER_QUERY]) -+ { -+ TRACE("Faking timestamp.\n"); -+ QueryPerformanceCounter((LARGE_INTEGER *)&tq->timestamp); -+ return TRUE; -+#endif /* STAGING_CSMT */ - } - - if (tq->context->tid != GetCurrentThreadId()) - { - FIXME("%p Wrong thread, returning 1.\n", query); -+#if !defined(STAGING_CSMT) - timestamp = 1; - fill_query_data(data, size, ×tamp, sizeof(timestamp)); - return S_OK; -+#else /* STAGING_CSMT */ -+ tq->timestamp = 1; -+ return TRUE; -+#endif /* STAGING_CSMT */ - } - - context = context_acquire(device, context_get_rt_surface(tq->context)); -@@ -608,6 +821,7 @@ static HRESULT wined3d_timestamp_query_ops_get_data(struct wined3d_query *query, - - if (available) - { -+#if !defined(STAGING_CSMT) - if (size) - { - GL_EXTCALL(glGetQueryObjectui64v(tq->id, GL_QUERY_RESULT, ×tamp)); -@@ -616,18 +830,36 @@ static HRESULT wined3d_timestamp_query_ops_get_data(struct wined3d_query *query, - fill_query_data(data, size, ×tamp, sizeof(timestamp)); - } - res = S_OK; -+#else /* STAGING_CSMT */ -+ GL_EXTCALL(glGetQueryObjectui64v(tq->id, GL_QUERY_RESULT, ×tamp)); -+ checkGLcall("glGetQueryObjectui64v(GL_QUERY_RESULT)"); -+ TRACE("Returning timestamp %s.\n", wine_dbgstr_longlong(timestamp)); -+ tq->timestamp = timestamp; -+ ret = TRUE; -+#endif /* STAGING_CSMT */ - } - else - { -+#if !defined(STAGING_CSMT) - res = S_FALSE; -+#else /* STAGING_CSMT */ -+ ret = FALSE; -+#endif /* STAGING_CSMT */ - } - - context_release(context); - -+#if !defined(STAGING_CSMT) - return res; + static BOOL wined3d_timestamp_query_ops_poll(struct wined3d_query *query) +@@ -572,7 +640,11 @@ static BOOL wined3d_timestamp_query_ops_poll(struct wined3d_query *query) + return available; } - static HRESULT wined3d_timestamp_query_ops_issue(struct wined3d_query *query, DWORD flags) ++#if !defined(STAGING_CSMT) + static void wined3d_timestamp_query_ops_issue(struct wined3d_query *query, DWORD flags) +#else /* STAGING_CSMT */ -+ return ret; -+} -+ +static BOOL wined3d_timestamp_query_ops_issue(struct wined3d_query *query, DWORD flags) +#endif /* STAGING_CSMT */ { struct wined3d_timestamp_query *tq = wined3d_timestamp_query_from_query(query); struct wined3d_device *device = query->device; -@@ -649,18 +881,28 @@ static HRESULT wined3d_timestamp_query_ops_issue(struct wined3d_query *query, DW - GL_EXTCALL(glQueryCounter(tq->id, GL_TIMESTAMP)); +@@ -595,6 +667,12 @@ static void wined3d_timestamp_query_ops_issue(struct wined3d_query *query, DWORD checkGLcall("glQueryCounter()"); context_release(context); -+#if !defined(STAGING_CSMT) - - query->state = QUERY_SIGNALLED; } - - return WINED3D_OK; -+#else /* STAGING_CSMT */ -+ } ++#if defined(STAGING_CSMT) + + if (flags & WINED3DISSUE_END) + return TRUE; @@ -5563,34 +5260,16 @@ diff --git a/dlls/wined3d/query.c b/dlls/wined3d/query.c +#endif /* STAGING_CSMT */ } - static HRESULT wined3d_timestamp_disjoint_query_ops_get_data(struct wined3d_query *query, - void *data, DWORD size, DWORD flags) - { - TRACE("query %p, data %p, size %#x, flags %#x.\n", query, data, size, flags); -+#if !defined(STAGING_CSMT) - -+#endif /* STAGING_CSMT */ - if (query->type == WINED3D_QUERY_TYPE_TIMESTAMP_DISJOINT) - { - static const struct wined3d_query_data_timestamp_disjoint disjoint_data = {1000 * 1000 * 1000, FALSE}; -@@ -682,6 +924,7 @@ static HRESULT wined3d_timestamp_disjoint_query_ops_get_data(struct wined3d_quer - return S_OK; + static BOOL wined3d_timestamp_disjoint_query_ops_poll(struct wined3d_query *query) +@@ -604,9 +682,16 @@ static BOOL wined3d_timestamp_disjoint_query_ops_poll(struct wined3d_query *quer + return TRUE; } +#if !defined(STAGING_CSMT) - static HRESULT wined3d_timestamp_disjoint_query_ops_issue(struct wined3d_query *query, DWORD flags) + static void wined3d_timestamp_disjoint_query_ops_issue(struct wined3d_query *query, DWORD flags) { TRACE("query %p, flags %#x.\n", query, flags); -@@ -692,6 +935,17 @@ static HRESULT wined3d_timestamp_disjoint_query_ops_issue(struct wined3d_query * - query->state = QUERY_SIGNALLED; - - return WINED3D_OK; +#else /* STAGING_CSMT */ -+static BOOL wined3d_timestamp_disjoint_query_ops_poll(struct wined3d_query *query) -+{ -+ return TRUE; -+} -+ +static BOOL wined3d_timestamp_disjoint_query_ops_issue(struct wined3d_query *query, DWORD flags) +{ + TRACE("query %p, flags %#x.\n", query, flags); @@ -5598,22 +5277,16 @@ diff --git a/dlls/wined3d/query.c b/dlls/wined3d/query.c +#endif /* STAGING_CSMT */ } - static HRESULT wined3d_statistics_query_ops_get_data(struct wined3d_query *query, -@@ -706,10 +960,22 @@ static HRESULT wined3d_statistics_query_ops_get_data(struct wined3d_query *query - return S_OK; + static BOOL wined3d_statistics_query_ops_poll(struct wined3d_query *query) +@@ -616,9 +701,16 @@ static BOOL wined3d_statistics_query_ops_poll(struct wined3d_query *query) + return TRUE; } +#if !defined(STAGING_CSMT) - static HRESULT wined3d_statistics_query_ops_issue(struct wined3d_query *query, DWORD flags) + static void wined3d_statistics_query_ops_issue(struct wined3d_query *query, DWORD flags) { FIXME("query %p, flags %#x.\n", query, flags); - return WINED3D_OK; +#else /* STAGING_CSMT */ -+static BOOL wined3d_statistics_query_ops_poll(struct wined3d_query *query) -+{ -+ return TRUE; -+} -+ +static BOOL wined3d_statistics_query_ops_issue(struct wined3d_query *query, DWORD flags) +{ + FIXME("query %p, flags %#x.\n", query, flags); @@ -5621,22 +5294,16 @@ diff --git a/dlls/wined3d/query.c b/dlls/wined3d/query.c +#endif /* STAGING_CSMT */ } - static HRESULT wined3d_overflow_query_ops_get_data(struct wined3d_query *query, -@@ -724,15 +990,30 @@ static HRESULT wined3d_overflow_query_ops_get_data(struct wined3d_query *query, - return S_OK; + static HRESULT wined3d_overflow_query_ops_poll(struct wined3d_query *query) +@@ -628,9 +720,16 @@ static HRESULT wined3d_overflow_query_ops_poll(struct wined3d_query *query) + return TRUE; } +#if !defined(STAGING_CSMT) - static HRESULT wined3d_overflow_query_ops_issue(struct wined3d_query *query, DWORD flags) + static void wined3d_overflow_query_ops_issue(struct wined3d_query *query, DWORD flags) { FIXME("query %p, flags %#x.\n", query, flags); - return WINED3D_OK; +#else /* STAGING_CSMT */ -+static BOOL wined3d_overflow_query_ops_poll(struct wined3d_query *query) -+{ -+ return TRUE; -+} -+ +static BOOL wined3d_overflow_query_ops_issue(struct wined3d_query *query, DWORD flags) +{ + FIXME("query %p, flags %#x.\n", query, flags); @@ -5645,64 +5312,6 @@ diff --git a/dlls/wined3d/query.c b/dlls/wined3d/query.c } static const struct wined3d_query_ops event_query_ops = - { - wined3d_event_query_ops_get_data, -+#if defined(STAGING_CSMT) -+ wined3d_event_query_ops_poll, -+#endif /* STAGING_CSMT */ - wined3d_event_query_ops_issue, - }; - -@@ -764,6 +1045,9 @@ static HRESULT wined3d_event_query_create(struct wined3d_device *device, - static const struct wined3d_query_ops occlusion_query_ops = - { - wined3d_occlusion_query_ops_get_data, -+#if defined(STAGING_CSMT) -+ wined3d_occlusion_query_ops_poll, -+#endif /* STAGING_CSMT */ - wined3d_occlusion_query_ops_issue, - }; - -@@ -795,6 +1079,9 @@ static HRESULT wined3d_occlusion_query_create(struct wined3d_device *device, - static const struct wined3d_query_ops timestamp_query_ops = - { - wined3d_timestamp_query_ops_get_data, -+#if defined(STAGING_CSMT) -+ wined3d_timestamp_query_ops_poll, -+#endif /* STAGING_CSMT */ - wined3d_timestamp_query_ops_issue, - }; - -@@ -826,6 +1113,9 @@ static HRESULT wined3d_timestamp_query_create(struct wined3d_device *device, - static const struct wined3d_query_ops timestamp_disjoint_query_ops = - { - wined3d_timestamp_disjoint_query_ops_get_data, -+#if defined(STAGING_CSMT) -+ wined3d_timestamp_disjoint_query_ops_poll, -+#endif /* STAGING_CSMT */ - wined3d_timestamp_disjoint_query_ops_issue, - }; - -@@ -861,6 +1151,9 @@ static HRESULT wined3d_timestamp_disjoint_query_create(struct wined3d_device *de - static const struct wined3d_query_ops statistics_query_ops = - { - wined3d_statistics_query_ops_get_data, -+#if defined(STAGING_CSMT) -+ wined3d_statistics_query_ops_poll, -+#endif /* STAGING_CSMT */ - wined3d_statistics_query_ops_issue, - }; - -@@ -886,6 +1179,9 @@ static HRESULT wined3d_statistics_query_create(struct wined3d_device *device, - static const struct wined3d_query_ops overflow_query_ops = - { - wined3d_overflow_query_ops_get_data, -+#if defined(STAGING_CSMT) -+ wined3d_overflow_query_ops_poll, -+#endif /* STAGING_CSMT */ - wined3d_overflow_query_ops_issue, - }; - diff --git a/dlls/wined3d/resource.c b/dlls/wined3d/resource.c --- a/dlls/wined3d/resource.c +++ b/dlls/wined3d/resource.c @@ -8709,21 +8318,20 @@ diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h }; extern struct wined3d_settings wined3d_settings DECLSPEC_HIDDEN; -@@ -1380,7 +1386,12 @@ enum wined3d_query_state +@@ -1380,7 +1386,11 @@ enum wined3d_query_state struct wined3d_query_ops { - HRESULT (*query_get_data)(struct wined3d_query *query, void *data, DWORD data_size, DWORD flags); + BOOL (*query_poll)(struct wined3d_query *query); +#if !defined(STAGING_CSMT) - HRESULT (*query_issue)(struct wined3d_query *query, DWORD flags); + void (*query_issue)(struct wined3d_query *query, DWORD flags); +#else /* STAGING_CSMT */ -+ BOOL (*query_poll)(struct wined3d_query *query); + BOOL (*query_issue)(struct wined3d_query *query, DWORD flags); +#endif /* STAGING_CSMT */ }; struct wined3d_query -@@ -1393,6 +1404,10 @@ struct wined3d_query - enum wined3d_query_type type; +@@ -1394,6 +1404,10 @@ struct wined3d_query + const void *data; DWORD data_size; const struct wined3d_query_ops *query_ops; +#if defined(STAGING_CSMT) @@ -8733,26 +8341,17 @@ diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h }; union wined3d_gl_query_object -@@ -1432,6 +1447,10 @@ struct wined3d_occlusion_query - struct list entry; +@@ -1435,6 +1449,9 @@ struct wined3d_occlusion_query GLuint id; struct wined3d_context *context; + DWORD samples; +#if defined(STAGING_CSMT) -+ DWORD samples; + BOOL started; +#endif /* STAGING_CSMT */ }; struct wined3d_timestamp_query -@@ -1441,11 +1460,46 @@ struct wined3d_timestamp_query - struct list entry; - GLuint id; - struct wined3d_context *context; -+#if defined(STAGING_CSMT) -+ UINT64 timestamp; -+#endif /* STAGING_CSMT */ - }; - +@@ -1450,6 +1467,38 @@ struct wined3d_timestamp_query void context_alloc_timestamp_query(struct wined3d_context *context, struct wined3d_timestamp_query *query) DECLSPEC_HIDDEN; void context_free_timestamp_query(struct wined3d_timestamp_query *query) DECLSPEC_HIDDEN; @@ -8791,7 +8390,7 @@ diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h struct wined3d_context { const struct wined3d_gl_info *gl_info; -@@ -1460,6 +1514,9 @@ struct wined3d_context +@@ -1464,6 +1513,9 @@ struct wined3d_context DWORD dirtyArray[STATE_HIGHEST + 1]; /* Won't get bigger than that, a state is never marked dirty 2 times */ DWORD numDirtyEntries; DWORD isStateDirty[STATE_HIGHEST / (sizeof(DWORD) * CHAR_BIT) + 1]; /* Bitmap to find out quickly if a state is dirty */ @@ -8801,7 +8400,7 @@ diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h struct wined3d_swapchain *swapchain; struct -@@ -1568,12 +1625,14 @@ struct wined3d_context +@@ -1572,12 +1624,14 @@ struct wined3d_context GLuint dummy_arbfp_prog; }; @@ -8816,7 +8415,7 @@ diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h typedef void (*APPLYSTATEFUNC)(struct wined3d_context *ctx, const struct wined3d_state *state, DWORD state_id); struct StateEntry -@@ -1712,7 +1771,11 @@ void context_alloc_event_query(struct wined3d_context *context, +@@ -1716,7 +1770,11 @@ void context_alloc_event_query(struct wined3d_context *context, void context_alloc_occlusion_query(struct wined3d_context *context, struct wined3d_occlusion_query *query) DECLSPEC_HIDDEN; void context_apply_blit_state(struct wined3d_context *context, const struct wined3d_device *device) DECLSPEC_HIDDEN; @@ -8828,7 +8427,7 @@ diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h UINT rt_count, const struct wined3d_fb_state *fb) DECLSPEC_HIDDEN; BOOL context_apply_draw_state(struct wined3d_context *context, const struct wined3d_device *device, const struct wined3d_state *state) DECLSPEC_HIDDEN; -@@ -2346,7 +2409,11 @@ struct wined3d_stream_state +@@ -2350,7 +2408,11 @@ struct wined3d_stream_state struct wined3d_state { DWORD flags; @@ -8840,7 +8439,7 @@ diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h struct wined3d_vertex_declaration *vertex_declaration; struct wined3d_stream_output stream_output[MAX_STREAM_OUT]; -@@ -2393,6 +2460,16 @@ struct wined3d_state +@@ -2397,6 +2459,16 @@ struct wined3d_state struct wined3d_rasterizer_state *rasterizer_state; }; @@ -8857,7 +8456,7 @@ diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h #define WINED3D_UNMAPPED_STAGE ~0U /* Multithreaded flag. Removed from the public header to signal that -@@ -2445,16 +2522,21 @@ struct wined3d_device +@@ -2449,16 +2521,21 @@ struct wined3d_device struct wined3d_rendertarget_view *back_buffer_view; struct wined3d_swapchain **swapchains; UINT swapchain_count; @@ -8879,7 +8478,7 @@ diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h /* For rendering to a texture using glCopyTexImage */ GLuint depth_blt_texture; -@@ -2501,9 +2583,23 @@ LRESULT device_process_message(struct wined3d_device *device, HWND window, BOOL +@@ -2505,9 +2582,23 @@ LRESULT device_process_message(struct wined3d_device *device, HWND window, BOOL UINT message, WPARAM wparam, LPARAM lparam, WNDPROC proc) DECLSPEC_HIDDEN; void device_resource_add(struct wined3d_device *device, struct wined3d_resource *resource) DECLSPEC_HIDDEN; void device_resource_released(struct wined3d_device *device, struct wined3d_resource *resource) DECLSPEC_HIDDEN; @@ -8903,7 +8502,7 @@ diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h static inline BOOL isStateDirty(const struct wined3d_context *context, DWORD state) { -@@ -2547,7 +2643,11 @@ struct wined3d_resource +@@ -2551,7 +2642,11 @@ struct wined3d_resource UINT depth; UINT size; DWORD priority; @@ -8915,7 +8514,7 @@ diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h struct list resource_list_entry; LONG access_count; -@@ -2654,6 +2754,9 @@ struct wined3d_texture +@@ -2658,6 +2753,9 @@ struct wined3d_texture DWORD flags; GLenum target; DWORD update_map_binding; @@ -8925,7 +8524,7 @@ diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h GLuint rb_multisample; GLuint rb_resolved; -@@ -2691,7 +2794,12 @@ struct wined3d_texture +@@ -2695,7 +2793,12 @@ struct wined3d_texture unsigned int map_count; DWORD locations; @@ -8938,7 +8537,7 @@ diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h } sub_resources[1]; }; -@@ -2742,11 +2850,23 @@ void wined3d_texture_bind(struct wined3d_texture *texture, +@@ -2746,11 +2849,23 @@ void wined3d_texture_bind(struct wined3d_texture *texture, struct wined3d_context *context, BOOL srgb) DECLSPEC_HIDDEN; void wined3d_texture_bind_and_dirtify(struct wined3d_texture *texture, struct wined3d_context *context, BOOL srgb) DECLSPEC_HIDDEN; @@ -8962,7 +8561,7 @@ diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h struct wined3d_texture_sub_resource *wined3d_texture_get_sub_resource(struct wined3d_texture *texture, unsigned int sub_resource_idx) DECLSPEC_HIDDEN; void wined3d_texture_invalidate_location(struct wined3d_texture *texture, -@@ -2757,13 +2877,28 @@ void *wined3d_texture_map_bo_address(const struct wined3d_bo_address *data, size +@@ -2761,13 +2876,28 @@ void *wined3d_texture_map_bo_address(const struct wined3d_bo_address *data, size const struct wined3d_gl_info *gl_info, GLenum binding, DWORD flags) DECLSPEC_HIDDEN; BOOL wined3d_texture_prepare_location(struct wined3d_texture *texture, unsigned int sub_resource_idx, struct wined3d_context *context, DWORD location) DECLSPEC_HIDDEN; @@ -8991,7 +8590,7 @@ diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h void wined3d_texture_validate_location(struct wined3d_texture *texture, unsigned int sub_resource_idx, DWORD location) DECLSPEC_HIDDEN; -@@ -2879,7 +3014,11 @@ void surface_get_drawable_size(const struct wined3d_surface *surface, const stru +@@ -2883,7 +3013,11 @@ void surface_get_drawable_size(const struct wined3d_surface *surface, const stru unsigned int *width, unsigned int *height) DECLSPEC_HIDDEN; void surface_load_fb_texture(struct wined3d_surface *surface, BOOL srgb, struct wined3d_context *context) DECLSPEC_HIDDEN; @@ -9003,7 +8602,7 @@ diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h struct wined3d_context *context, DWORD location) DECLSPEC_HIDDEN; void surface_modify_ds_location(struct wined3d_surface *surface, DWORD location, UINT w, UINT h) DECLSPEC_HIDDEN; void surface_set_compatible_renderbuffer(struct wined3d_surface *surface, -@@ -2890,6 +3029,11 @@ HRESULT surface_upload_from_surface(struct wined3d_surface *dst_surface, const P +@@ -2894,6 +3028,11 @@ HRESULT surface_upload_from_surface(struct wined3d_surface *dst_surface, const P void wined3d_surface_upload_data(struct wined3d_surface *surface, const struct wined3d_gl_info *gl_info, const struct wined3d_format *format, const RECT *src_rect, UINT src_pitch, const POINT *dst_point, BOOL srgb, const struct wined3d_const_bo_address *data) DECLSPEC_HIDDEN; @@ -9015,7 +8614,7 @@ diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h void draw_textured_quad(const struct wined3d_surface *src_surface, struct wined3d_context *context, const RECT *src_rect, const RECT *dst_rect, enum wined3d_texture_filter_type filter) DECLSPEC_HIDDEN; -@@ -2904,6 +3048,12 @@ struct wined3d_sampler +@@ -2908,6 +3047,12 @@ struct wined3d_sampler GLuint name; }; @@ -9028,7 +8627,7 @@ diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h struct wined3d_vertex_declaration_element { const struct wined3d_format *format; -@@ -2999,6 +3149,7 @@ struct wined3d_stateblock +@@ -3003,6 +3148,7 @@ struct wined3d_stateblock void stateblock_init_contained_states(struct wined3d_stateblock *stateblock) DECLSPEC_HIDDEN; void state_cleanup(struct wined3d_state *state) DECLSPEC_HIDDEN; @@ -9036,7 +8635,7 @@ diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h void state_init(struct wined3d_state *state, struct wined3d_fb_state *fb, const struct wined3d_gl_info *gl_info, const struct wined3d_d3d_info *d3d_info, DWORD flags) DECLSPEC_HIDDEN; -@@ -3012,29 +3163,74 @@ enum wined3d_push_constants +@@ -3016,29 +3162,74 @@ enum wined3d_push_constants WINED3D_PUSH_CONSTANTS_PS_I, WINED3D_PUSH_CONSTANTS_VS_B, WINED3D_PUSH_CONSTANTS_PS_B, @@ -9111,7 +8710,7 @@ diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h void wined3d_cs_emit_clear(struct wined3d_cs *cs, DWORD rect_count, const RECT *rects, DWORD flags, const struct wined3d_color *color, float depth, DWORD stencil) DECLSPEC_HIDDEN; -@@ -3087,12 +3283,70 @@ void wined3d_cs_emit_set_transform(struct wined3d_cs *cs, enum wined3d_transform +@@ -3091,12 +3282,69 @@ void wined3d_cs_emit_set_transform(struct wined3d_cs *cs, enum wined3d_transform 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; @@ -9152,8 +8751,7 @@ diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h + unsigned int sub_resource_idx) DECLSPEC_HIDDEN; +void wined3d_cs_emit_query_issue(struct wined3d_cs *cs, struct wined3d_query *query, + DWORD flags) DECLSPEC_HIDDEN; -+void wined3d_cs_emit_query_get_data(struct wined3d_cs *cs, struct wined3d_query *query, void *data, -+ UINT data_size, DWORD flags, HRESULT *ret) DECLSPEC_HIDDEN; ++void wined3d_cs_emit_query_poll(struct wined3d_cs *cs, struct wined3d_query *query, BOOL *ret) DECLSPEC_HIDDEN; +void wined3d_cs_emit_texture_preload(struct wined3d_cs *cs, struct wined3d_texture *texture) DECLSPEC_HIDDEN; +void wined3d_cs_emit_update_texture(struct wined3d_cs *cs, struct wined3d_texture *src, + struct wined3d_texture *dst) DECLSPEC_HIDDEN; @@ -9182,7 +8780,7 @@ diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h /* TODO: Add tests and support for FLOAT16_4 POSITIONT, D3DCOLOR position, other * fixed function semantics as D3DCOLOR or FLOAT16 */ -@@ -3119,6 +3373,9 @@ struct wined3d_buffer +@@ -3123,6 +3371,9 @@ struct wined3d_buffer GLenum buffer_object_usage; GLenum buffer_type_hint; DWORD flags; @@ -9192,7 +8790,7 @@ diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h void *map_ptr; struct wined3d_map_range *maps; -@@ -3143,11 +3400,19 @@ void buffer_get_memory(struct wined3d_buffer *buffer, struct wined3d_context *co +@@ -3147,11 +3398,19 @@ void buffer_get_memory(struct wined3d_buffer *buffer, struct wined3d_context *co BYTE *buffer_get_sysmem(struct wined3d_buffer *buffer, struct wined3d_context *context) DECLSPEC_HIDDEN; void buffer_internal_preload(struct wined3d_buffer *buffer, struct wined3d_context *context, const struct wined3d_state *state) DECLSPEC_HIDDEN; @@ -9212,7 +8810,7 @@ diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h struct wined3d_rendertarget_view { -@@ -3209,7 +3474,12 @@ struct wined3d_unordered_access_view +@@ -3213,7 +3472,12 @@ struct wined3d_unordered_access_view struct wined3d_swapchain_ops { void (*swapchain_present)(struct wined3d_swapchain *swapchain, @@ -9225,7 +8823,7 @@ diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h void (*swapchain_frontbuffer_updated)(struct wined3d_swapchain *swapchain); }; -@@ -3245,6 +3515,10 @@ struct wined3d_swapchain +@@ -3249,6 +3513,10 @@ struct wined3d_swapchain void wined3d_swapchain_activate(struct wined3d_swapchain *swapchain, BOOL activate) DECLSPEC_HIDDEN; struct wined3d_context *swapchain_get_context(struct wined3d_swapchain *swapchain) DECLSPEC_HIDDEN; diff --git a/patches/wined3d-QUERY_Stubs/0001-wined3d-Add-stubs-for-QUERY_TYPE_SO_STATISTICS-and-Q.patch b/patches/wined3d-QUERY_Stubs/0001-wined3d-Add-stubs-for-QUERY_TYPE_SO_STATISTICS-and-Q.patch index 6bdb4a1c..2eb8dbbd 100644 --- a/patches/wined3d-QUERY_Stubs/0001-wined3d-Add-stubs-for-QUERY_TYPE_SO_STATISTICS-and-Q.patch +++ b/patches/wined3d-QUERY_Stubs/0001-wined3d-Add-stubs-for-QUERY_TYPE_SO_STATISTICS-and-Q.patch @@ -1,4 +1,4 @@ -From 148ec0e10734a650f5c8988d5c173eb7e98e9449 Mon Sep 17 00:00:00 2001 +From 40dce808e5579bd12a4a31eb93c0499000ae5f00 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michael=20M=C3=BCller?= Date: Sat, 16 Apr 2016 18:18:54 +0200 Subject: wined3d: Add stubs for QUERY_TYPE_SO_STATISTICS and @@ -7,15 +7,15 @@ Subject: wined3d: Add stubs for QUERY_TYPE_SO_STATISTICS and --- dlls/d3d10core/tests/device.c | 4 +- dlls/d3d11/tests/d3d11.c | 4 +- - dlls/wined3d/query.c | 99 +++++++++++++++++++++++++++++++++++++++++++ + dlls/wined3d/query.c | 90 +++++++++++++++++++++++++++++++++++++++++++ include/wine/wined3d.h | 6 +++ - 4 files changed, 109 insertions(+), 4 deletions(-) + 4 files changed, 100 insertions(+), 4 deletions(-) diff --git a/dlls/d3d10core/tests/device.c b/dlls/d3d10core/tests/device.c -index 9b3a943..fb1ec06 100644 +index f3c4ac8..d3ddef7 100644 --- a/dlls/d3d10core/tests/device.c +++ b/dlls/d3d10core/tests/device.c -@@ -3491,8 +3491,8 @@ static void test_create_query(void) +@@ -3539,8 +3539,8 @@ static void test_create_query(void) {D3D10_QUERY_TIMESTAMP_DISJOINT, FALSE, FALSE}, {D3D10_QUERY_PIPELINE_STATISTICS, FALSE, TRUE}, {D3D10_QUERY_OCCLUSION_PREDICATE, TRUE, FALSE}, @@ -27,10 +27,10 @@ index 9b3a943..fb1ec06 100644 ULONG refcount, expected_refcount; diff --git a/dlls/d3d11/tests/d3d11.c b/dlls/d3d11/tests/d3d11.c -index df45eb5..4c65997 100644 +index 276f58f..648dc05 100644 --- a/dlls/d3d11/tests/d3d11.c +++ b/dlls/d3d11/tests/d3d11.c -@@ -4486,8 +4486,8 @@ static void test_create_query(void) +@@ -4525,8 +4525,8 @@ static void test_create_query(void) {D3D11_QUERY_TIMESTAMP_DISJOINT, D3D_FEATURE_LEVEL_10_0, FALSE, FALSE, FALSE}, {D3D11_QUERY_PIPELINE_STATISTICS, D3D_FEATURE_LEVEL_10_0, FALSE, FALSE, TRUE}, {D3D11_QUERY_OCCLUSION_PREDICATE, D3D_FEATURE_LEVEL_10_0, TRUE, TRUE, FALSE}, @@ -42,10 +42,10 @@ index df45eb5..4c65997 100644 {D3D11_QUERY_SO_OVERFLOW_PREDICATE_STREAM0, D3D_FEATURE_LEVEL_11_0, TRUE, FALSE, TRUE}, {D3D11_QUERY_SO_STATISTICS_STREAM1, D3D_FEATURE_LEVEL_11_0, FALSE, FALSE, TRUE}, diff --git a/dlls/wined3d/query.c b/dlls/wined3d/query.c -index 591d6c5..2d1da66 100644 +index 55e63e9..aca5d85 100644 --- a/dlls/wined3d/query.c +++ b/dlls/wined3d/query.c -@@ -293,6 +293,14 @@ static void wined3d_query_destroy_object(void *object) +@@ -295,6 +295,14 @@ static void wined3d_query_destroy_object(void *object) { HeapFree(GetProcessHeap(), 0, query); } @@ -60,62 +60,51 @@ index 591d6c5..2d1da66 100644 else { ERR("Query %p has invalid type %#x.\n", query, query->type); -@@ -686,6 +694,42 @@ static HRESULT wined3d_timestamp_disjoint_query_ops_issue(struct wined3d_query * - return WINED3D_OK; +@@ -601,6 +609,30 @@ static void wined3d_timestamp_disjoint_query_ops_issue(struct wined3d_query *que + TRACE("query %p, flags %#x.\n", query, flags); } -+static HRESULT wined3d_statistics_query_ops_get_data(struct wined3d_query *query, -+ void *data, DWORD size, DWORD flags) ++static BOOL wined3d_statistics_query_ops_poll(struct wined3d_query *query) +{ -+ static const struct wined3d_query_data_so_statistics statistics = { 1, 1 }; ++ TRACE("query %p.\n", query); + -+ FIXME("query %p, data %p, size %#x, flags %#x.\n", query, data, size, flags); -+ -+ if (!data || !size) return S_OK; -+ fill_query_data(data, size, &statistics, sizeof(statistics)); -+ return S_OK; ++ return TRUE; +} + -+static HRESULT wined3d_statistics_query_ops_issue(struct wined3d_query *query, DWORD flags) ++static void wined3d_statistics_query_ops_issue(struct wined3d_query *query, DWORD flags) +{ + FIXME("query %p, flags %#x.\n", query, flags); -+ return WINED3D_OK; +} + -+static HRESULT wined3d_overflow_query_ops_get_data(struct wined3d_query *query, -+ void *data, DWORD size, DWORD flags) ++static HRESULT wined3d_overflow_query_ops_poll(struct wined3d_query *query) +{ -+ static const BOOL overflow = FALSE; ++ TRACE("query %p.\n", query); + -+ FIXME("query %p, data %p, size %#x, flags %#x.\n", query, data, size, flags); -+ -+ if (!data || !size) return S_OK; -+ fill_query_data(data, size, &overflow, sizeof(overflow)); -+ return S_OK; ++ return TRUE; +} + -+static HRESULT wined3d_overflow_query_ops_issue(struct wined3d_query *query, DWORD flags) ++static void wined3d_overflow_query_ops_issue(struct wined3d_query *query, DWORD flags) +{ + FIXME("query %p, flags %#x.\n", query, flags); -+ return WINED3D_OK; +} + static const struct wined3d_query_ops event_query_ops = { - wined3d_event_query_ops_get_data, -@@ -814,6 +858,55 @@ static HRESULT wined3d_timestamp_disjoint_query_create(struct wined3d_device *de + wined3d_event_query_ops_poll, +@@ -741,6 +773,58 @@ static HRESULT wined3d_timestamp_disjoint_query_create(struct wined3d_device *de return WINED3D_OK; } +static const struct wined3d_query_ops statistics_query_ops = +{ -+ wined3d_statistics_query_ops_get_data, ++ wined3d_statistics_query_ops_poll, + wined3d_statistics_query_ops_issue, +}; + +static HRESULT wined3d_statistics_query_create(struct wined3d_device *device, + enum wined3d_query_type type, void *parent, struct wined3d_query **query) +{ ++ static const struct wined3d_query_data_so_statistics statistics = { 1, 1 }; + struct wined3d_query *object; + + FIXME("device %p, type %#x, parent %p, query %p.\n", device, type, parent, query); @@ -123,8 +112,8 @@ index 591d6c5..2d1da66 100644 + if (!(object = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(*object)))) + return E_OUTOFMEMORY; + -+ wined3d_query_init(object, device, type, -+ sizeof(struct wined3d_query_data_so_statistics), &statistics_query_ops, parent); ++ wined3d_query_init(object, device, type, &statistics, ++ sizeof(statistics), &statistics_query_ops, parent); + + TRACE("Created query %p.\n", object); + *query = object; @@ -134,13 +123,14 @@ index 591d6c5..2d1da66 100644 + +static const struct wined3d_query_ops overflow_query_ops = +{ -+ wined3d_overflow_query_ops_get_data, ++ wined3d_overflow_query_ops_poll, + wined3d_overflow_query_ops_issue, +}; + +static HRESULT wined3d_overflow_query_create(struct wined3d_device *device, + enum wined3d_query_type type, void *parent, struct wined3d_query **query) +{ ++ static const BOOL overflow = FALSE; + struct wined3d_query *object; + + FIXME("device %p, type %#x, parent %p, query %p.\n", device, type, parent, query); @@ -148,7 +138,8 @@ index 591d6c5..2d1da66 100644 + if (!(object = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(*object)))) + return E_OUTOFMEMORY; + -+ wined3d_query_init(object, device, type, sizeof(BOOL), &overflow_query_ops, parent); ++ wined3d_query_init(object, device, type, &overflow, ++ sizeof(overflow), &overflow_query_ops, parent); + + TRACE("Created query %p.\n", object); + *query = object; @@ -159,7 +150,7 @@ index 591d6c5..2d1da66 100644 HRESULT CDECL wined3d_query_create(struct wined3d_device *device, enum wined3d_query_type type, void *parent, struct wined3d_query **query) { -@@ -834,6 +927,12 @@ HRESULT CDECL wined3d_query_create(struct wined3d_device *device, +@@ -761,6 +845,12 @@ HRESULT CDECL wined3d_query_create(struct wined3d_device *device, case WINED3D_QUERY_TYPE_TIMESTAMP_FREQ: return wined3d_timestamp_disjoint_query_create(device, type, parent, query); @@ -173,10 +164,10 @@ index 591d6c5..2d1da66 100644 FIXME("Unhandled query type %#x.\n", type); return WINED3DERR_NOTAVAILABLE; diff --git a/include/wine/wined3d.h b/include/wine/wined3d.h -index 36de1de..468ce98 100644 +index cd2dd3b..10b1ec2 100644 --- a/include/wine/wined3d.h +++ b/include/wine/wined3d.h -@@ -700,6 +700,12 @@ struct wined3d_query_data_timestamp_disjoint +@@ -702,6 +702,12 @@ struct wined3d_query_data_timestamp_disjoint BOOL disjoint; }; @@ -190,5 +181,5 @@ index 36de1de..468ce98 100644 #define WINED3DISSUE_END (1u << 0) #define WINED3DGETDATA_FLUSH (1u << 0) -- -2.8.0 +2.9.0