diff --git a/patches/patchinstall.sh b/patches/patchinstall.sh index 7fa5dfbc..cbda3b3c 100755 --- a/patches/patchinstall.sh +++ b/patches/patchinstall.sh @@ -7365,7 +7365,6 @@ if test "$enable_wined3d_CSMT_Main" -eq 1; then 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: 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: Put this into the query poll patch.", 1 },'; 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 e2fdc518..f7080548 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,13 +1,13 @@ -From 1bea1e621c0fb6b91af41755e847f90cf438168b Mon Sep 17 00:00:00 2001 +From d1901e9158ced30ba849f799ba1b612d8e74752d 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 | 69 +++++++++++++++++++----------------------- - dlls/wined3d/query.c | 30 ++++++++++++------ - dlls/wined3d/wined3d_private.h | 4 ++- - 3 files changed, 54 insertions(+), 49 deletions(-) + dlls/wined3d/query.c | 22 ++++++++------ + dlls/wined3d/wined3d_private.h | 5 +-- + 3 files changed, 46 insertions(+), 50 deletions(-) diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c index 2952104..f7ffc1c 100644 @@ -136,7 +136,7 @@ index 2952104..f7ffc1c 100644 { continue; diff --git a/dlls/wined3d/query.c b/dlls/wined3d/query.c -index 99a1411..4048714 100644 +index 99a1411..b5e1fde 100644 --- a/dlls/wined3d/query.c +++ b/dlls/wined3d/query.c @@ -37,6 +37,7 @@ static void wined3d_query_init(struct wined3d_query *query, struct wined3d_devic @@ -147,26 +147,17 @@ index 99a1411..4048714 100644 } static struct wined3d_event_query *wined3d_event_query_from_query(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); +@@ -266,6 +267,9 @@ static void wined3d_query_destroy_object(void *object) + { + struct wined3d_query *query = object; - if (!refcount) -+ { -+ if (wined3d_settings.cs_multithreaded) -+ { -+ struct wined3d_device *device = query->device; ++ if (!list_empty(&query->poll_list_entry)) ++ list_remove(&query->poll_list_entry); + -+ FIXME("waiting for cs\n"); -+ wined3d_cs_emit_glfinish(device->cs); -+ device->cs->ops->finish(device->cs); -+ } -+ - wined3d_cs_emit_destroy_object(query->device->cs, wined3d_query_destroy_object, query); -+ } - - return refcount; - } -@@ -330,12 +342,6 @@ HRESULT CDECL wined3d_query_get_data(struct wined3d_query *query, + /* 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 +@@ -330,12 +334,6 @@ HRESULT CDECL wined3d_query_get_data(struct wined3d_query *query, if (flags) WARN("Ignoring flags %#x.\n", flags); @@ -179,7 +170,7 @@ index 99a1411..4048714 100644 if (query->state == QUERY_BUILDING) { WARN("Query is building, returning S_FALSE.\n"); -@@ -343,14 +349,18 @@ HRESULT CDECL wined3d_query_get_data(struct wined3d_query *query, +@@ -343,14 +341,18 @@ HRESULT CDECL wined3d_query_get_data(struct wined3d_query *query, } if (query->state == QUERY_CREATED) @@ -203,7 +194,7 @@ index 99a1411..4048714 100644 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 a10b30f..5e45522 100644 +index a10b30f..e6d2602 100644 --- a/dlls/wined3d/wined3d_private.h +++ b/dlls/wined3d/wined3d_private.h @@ -1396,7 +1396,8 @@ struct wined3d_query @@ -224,6 +215,14 @@ index a10b30f..5e45522 100644 }; struct wined3d_cs *wined3d_cs_create(struct wined3d_device *device) DECLSPEC_HIDDEN; +@@ -3147,7 +3149,6 @@ 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_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.9.0 diff --git a/patches/wined3d-CSMT_Main/0045-wined3d-Destroy-queries-through-the-CS.patch b/patches/wined3d-CSMT_Main/0045-wined3d-Destroy-queries-through-the-CS.patch deleted file mode 100644 index 8e3329b8..00000000 --- a/patches/wined3d-CSMT_Main/0045-wined3d-Destroy-queries-through-the-CS.patch +++ /dev/null @@ -1,45 +0,0 @@ -From 817d317d346d6f91b7affb58ed533ba3c22a397d Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Stefan=20D=C3=B6singer?= -Date: Sat, 6 Jul 2013 21:54:45 +0200 -Subject: wined3d: Destroy queries through the CS - ---- - dlls/wined3d/query.c | 14 +++----------- - 1 file changed, 3 insertions(+), 11 deletions(-) - -diff --git a/dlls/wined3d/query.c b/dlls/wined3d/query.c -index 66368cf..c1ba517 100644 ---- a/dlls/wined3d/query.c -+++ b/dlls/wined3d/query.c -@@ -237,6 +237,9 @@ static void wined3d_query_destroy_object(void *object) - { - struct wined3d_query *query = object; - -+ if (!list_empty(&query->poll_list_entry)) -+ list_remove(&query->poll_list_entry); -+ - /* 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 -@@ -272,18 +275,7 @@ ULONG CDECL wined3d_query_decref(struct wined3d_query *query) - TRACE("%p decreasing refcount to %u.\n", query, refcount); - - if (!refcount) -- { -- if (wined3d_settings.cs_multithreaded) -- { -- struct wined3d_device *device = query->device; -- -- FIXME("waiting for cs\n"); -- wined3d_cs_emit_glfinish(device->cs); -- device->cs->ops->finish(device->cs); -- } -- - wined3d_cs_emit_destroy_object(query->device->cs, wined3d_query_destroy_object, query); -- } - - return refcount; - } --- -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 37bb7420..a925ab24 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 71ed3d8f5da5ad95d6fe19222d2e2329cd942482 Mon Sep 17 00:00:00 2001 +From ef8e9d367e421a6bdfe14754bcdd7c443c451f36 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,7 +10,7 @@ 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 a1a9a2a..b056e22 100644 +index a08fe6f..67e2c13 100644 --- a/dlls/wined3d/cs.c +++ b/dlls/wined3d/cs.c @@ -71,6 +71,7 @@ enum wined3d_cs_op @@ -91,13 +91,13 @@ index 2b51935..a472b3e 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 c49283e..7c632c9 100644 +index 021069c..f57dc37 100644 --- a/dlls/wined3d/wined3d_private.h +++ b/dlls/wined3d/wined3d_private.h -@@ -3153,6 +3153,7 @@ void *wined3d_cs_emit_texture_map(struct wined3d_cs *cs, struct wined3d_texture +@@ -3152,6 +3152,7 @@ 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_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 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 e0b49814..eea074da 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 49c421c543e672fb83aaf887a51cabd52a9dd13b Mon Sep 17 00:00:00 2001 +From 50cab9c747626e21eb7e80343da79a9004a1b505 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,7 +11,7 @@ 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 b056e22..4611f41 100644 +index 67e2c13..8e56772 100644 --- a/dlls/wined3d/cs.c +++ b/dlls/wined3d/cs.c @@ -72,6 +72,7 @@ enum wined3d_cs_op @@ -319,7 +319,7 @@ index d458747..99118f2 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 8af4864..3caec37 100644 +index cdcf620..75f2983 100644 --- a/dlls/wined3d/wined3d_private.h +++ b/dlls/wined3d/wined3d_private.h @@ -2533,6 +2533,8 @@ void device_resource_add(struct wined3d_device *device, struct wined3d_resource @@ -331,9 +331,9 @@ index 8af4864..3caec37 100644 static inline BOOL isStateDirty(const struct wined3d_context *context, DWORD state) { -@@ -3154,6 +3156,8 @@ void wined3d_cs_emit_texture_unmap(struct wined3d_cs *cs, struct wined3d_texture +@@ -3153,6 +3155,8 @@ void *wined3d_cs_emit_texture_map(struct wined3d_cs *cs, struct wined3d_texture + 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_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; diff --git a/patches/wined3d-CSMT_Main/9999-IfDefined.patch b/patches/wined3d-CSMT_Main/9999-IfDefined.patch index e4e49a14..f2714f1d 100644 --- a/patches/wined3d-CSMT_Main/9999-IfDefined.patch +++ b/patches/wined3d-CSMT_Main/9999-IfDefined.patch @@ -8706,7 +8706,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; -@@ -3085,12 +3276,67 @@ void wined3d_cs_emit_set_transform(struct wined3d_cs *cs, enum wined3d_transform +@@ -3085,12 +3276,66 @@ 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; @@ -8745,7 +8745,6 @@ diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h + 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_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; @@ -8774,7 +8773,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 */ -@@ -3117,6 +3363,9 @@ struct wined3d_buffer +@@ -3117,6 +3362,9 @@ struct wined3d_buffer GLenum buffer_object_usage; GLenum buffer_type_hint; DWORD flags; @@ -8784,7 +8783,7 @@ diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h void *map_ptr; struct wined3d_map_range *maps; -@@ -3141,11 +3390,19 @@ void buffer_get_memory(struct wined3d_buffer *buffer, struct wined3d_context *co +@@ -3141,11 +3389,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; @@ -8804,7 +8803,7 @@ diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h struct wined3d_rendertarget_view { -@@ -3207,7 +3464,12 @@ struct wined3d_unordered_access_view +@@ -3207,7 +3463,12 @@ struct wined3d_unordered_access_view struct wined3d_swapchain_ops { void (*swapchain_present)(struct wined3d_swapchain *swapchain, @@ -8817,7 +8816,7 @@ diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h void (*swapchain_frontbuffer_updated)(struct wined3d_swapchain *swapchain); }; -@@ -3243,6 +3505,10 @@ struct wined3d_swapchain +@@ -3243,6 +3504,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;