diff --git a/patches/advapi32-LookupSecurityDescriptorParts/0001-advapi32-add-LookupSecurityDescriptorPartsA-W-stubs.patch b/patches/advapi32-LookupSecurityDescriptorParts/0001-advapi32-add-LookupSecurityDescriptorPartsA-W-stubs.patch deleted file mode 100644 index 8f7e185e..00000000 --- a/patches/advapi32-LookupSecurityDescriptorParts/0001-advapi32-add-LookupSecurityDescriptorPartsA-W-stubs.patch +++ /dev/null @@ -1,61 +0,0 @@ -From bb079b53bc79d44987d5f7ac93d0e1d2c5b00698 Mon Sep 17 00:00:00 2001 -From: Austin English -Date: Wed, 9 Nov 2016 21:46:10 -0600 -Subject: advapi32: add LookupSecurityDescriptorPartsA/W stubs - -Fixes https://bugs.winehq.org/show_bug.cgi?id=41682 ---- - dlls/advapi32/advapi32.spec | 4 ++-- - dlls/advapi32/security.c | 24 ++++++++++++++++++++++++ - 2 files changed, 26 insertions(+), 2 deletions(-) - -diff --git a/dlls/advapi32/advapi32.spec b/dlls/advapi32/advapi32.spec -index 6c57c88adf7..88d8634ef64 100644 ---- a/dlls/advapi32/advapi32.spec -+++ b/dlls/advapi32/advapi32.spec -@@ -415,8 +415,8 @@ - @ stdcall LookupPrivilegeNameW(wstr ptr ptr ptr) - @ stdcall LookupPrivilegeValueA(ptr ptr ptr) - @ stdcall LookupPrivilegeValueW(ptr ptr ptr) --# @ stub LookupSecurityDescriptorPartsA --# @ stub LookupSecurityDescriptorPartsW -+@ stdcall LookupSecurityDescriptorPartsA(ptr ptr ptr ptr ptr ptr ptr) -+@ stdcall LookupSecurityDescriptorPartsW(ptr ptr ptr ptr ptr ptr ptr) - @ stdcall LsaAddAccountRights(ptr ptr ptr long) - @ stub LsaAddPrivilegesToAccount - # @ stub LsaClearAuditLog -diff --git a/dlls/advapi32/security.c b/dlls/advapi32/security.c -index 3b5d7a42b6f..01e8ea02706 100644 ---- a/dlls/advapi32/security.c -+++ b/dlls/advapi32/security.c -@@ -6199,3 +6199,27 @@ BOOL WINAPI SaferSetLevelInformation(SAFER_LEVEL_HANDLE handle, SAFER_OBJECT_INF - FIXME("(%p %u %p %u) stub\n", handle, infotype, buffer, size); - return FALSE; - } -+ -+/****************************************************************************** -+ * LookupSecurityDescriptorPartsA [ADVAPI32.@] -+ */ -+DWORD WINAPI LookupSecurityDescriptorPartsA(TRUSTEEA *owner, TRUSTEEA *group, ULONG *access_count, -+ EXPLICIT_ACCESSA *access_list, ULONG *audit_count, -+ EXPLICIT_ACCESSA *audit_list, SECURITY_DESCRIPTOR *descriptor) -+{ -+ FIXME("(%p %p %p %p %p %p %p) stub\n", owner, group, access_count, -+ access_list, audit_count, audit_list, descriptor); -+ return ERROR_CALL_NOT_IMPLEMENTED; -+} -+ -+/****************************************************************************** -+ * LookupSecurityDescriptorPartsW [ADVAPI32.@] -+ */ -+DWORD WINAPI LookupSecurityDescriptorPartsW(TRUSTEEW *owner, TRUSTEEW *group, ULONG *access_count, -+ EXPLICIT_ACCESSW *access_list, ULONG *audit_count, -+ EXPLICIT_ACCESSW *audit_list, SECURITY_DESCRIPTOR *descriptor) -+{ -+ FIXME("(%p %p %p %p %p %p %p) stub\n", owner, group, access_count, -+ access_list, audit_count, audit_list, descriptor); -+ return ERROR_CALL_NOT_IMPLEMENTED; -+} --- -2.11.0 - diff --git a/patches/advapi32-LookupSecurityDescriptorParts/definition b/patches/advapi32-LookupSecurityDescriptorParts/definition deleted file mode 100644 index 2c2a8f3c..00000000 --- a/patches/advapi32-LookupSecurityDescriptorParts/definition +++ /dev/null @@ -1 +0,0 @@ -Fixes: [41682] Add stub for advapi32.LookupSecurityDescriptorPartsA/W diff --git a/patches/comctl32-PROPSHEET_InsertPage/0003-comctl32-Add-support-for-PSPCB_ADDREF-PSPCB_RELEASE-.patch b/patches/comctl32-PROPSHEET_InsertPage/0003-comctl32-Add-support-for-PSPCB_ADDREF-PSPCB_RELEASE-.patch index 27196c2c..fb1bc0d3 100644 --- a/patches/comctl32-PROPSHEET_InsertPage/0003-comctl32-Add-support-for-PSPCB_ADDREF-PSPCB_RELEASE-.patch +++ b/patches/comctl32-PROPSHEET_InsertPage/0003-comctl32-Add-support-for-PSPCB_ADDREF-PSPCB_RELEASE-.patch @@ -1,4 +1,4 @@ -From da747c61c2cee3712c061fa75b462228ffdee12d Mon Sep 17 00:00:00 2001 +From a9fb17a4b519b6ca814cd9402531a1ca860634f1 Mon Sep 17 00:00:00 2001 From: Dmitry Timoshkov Date: Fri, 10 Feb 2017 00:34:37 +0800 Subject: comctl32: Add support for PSPCB_ADDREF/PSPCB_RELEASE callback @@ -6,14 +6,13 @@ Subject: comctl32: Add support for PSPCB_ADDREF/PSPCB_RELEASE callback --- dlls/comctl32/propsheet.c | 9 +++++++++ - include/prsht.h | 1 + - 2 files changed, 10 insertions(+) + 1 file changed, 9 insertions(+) diff --git a/dlls/comctl32/propsheet.c b/dlls/comctl32/propsheet.c -index 654b06fbcec..78afaa924ef 100644 +index a3a6a5c4df8..4c4ca82a572 100644 --- a/dlls/comctl32/propsheet.c +++ b/dlls/comctl32/propsheet.c -@@ -2991,6 +2991,9 @@ HPROPSHEETPAGE WINAPI CreatePropertySheetPageA( +@@ -3013,6 +3013,9 @@ HPROPSHEETPAGE WINAPI CreatePropertySheetPageA( else ppsp->pszHeaderSubTitle = NULL; @@ -23,7 +22,7 @@ index 654b06fbcec..78afaa924ef 100644 return (HPROPSHEETPAGE)ppsp; } -@@ -3047,6 +3050,9 @@ HPROPSHEETPAGE WINAPI CreatePropertySheetPageW(LPCPROPSHEETPAGEW lpPropSheetPage +@@ -3059,6 +3062,9 @@ HPROPSHEETPAGE WINAPI CreatePropertySheetPageW(LPCPROPSHEETPAGEW lpPropSheetPage else ppsp->pszHeaderSubTitle = NULL; @@ -33,7 +32,7 @@ index 654b06fbcec..78afaa924ef 100644 return (HPROPSHEETPAGE)ppsp; } -@@ -3068,6 +3074,9 @@ BOOL WINAPI DestroyPropertySheetPage(HPROPSHEETPAGE hPropPage) +@@ -3080,6 +3086,9 @@ BOOL WINAPI DestroyPropertySheetPage(HPROPSHEETPAGE hPropPage) if (!psp) return FALSE; @@ -43,18 +42,6 @@ index 654b06fbcec..78afaa924ef 100644 if (!(psp->dwFlags & PSP_DLGINDIRECT) && !IS_INTRESOURCE( psp->u.pszTemplate )) Free ((LPVOID)psp->u.pszTemplate); -diff --git a/include/prsht.h b/include/prsht.h -index 21fc266447c..75ccc7c2917 100644 ---- a/include/prsht.h -+++ b/include/prsht.h -@@ -293,6 +293,7 @@ DECL_PRSHT_TYPE_AW(LPCPROPSHEETPAGE, LATEST) - #define PSP_USEFUSIONCONTEXT 0x00004000 - #define PSP_COMMANDLINKS 0x00040000 - -+#define PSPCB_ADDREF 0 - #define PSPCB_RELEASE 1 - #define PSPCB_CREATE 2 - -- 2.11.0 diff --git a/patches/patchinstall.sh b/patches/patchinstall.sh index 8b34f4fa..bbed40d4 100755 --- a/patches/patchinstall.sh +++ b/patches/patchinstall.sh @@ -52,13 +52,13 @@ usage() # Get the upstream commit sha upstream_commit() { - echo "9eb56e25e37b4adec0d72875455ffb787238672f" + echo "60c98caa94465799d0868b69149bce29cf767de4" } # Show version information version() { - echo "Wine Staging 2.2" + echo "Wine Staging 2.3 (unreleased)" echo "Copyright (C) 2014-2017 the Wine Staging project authors." echo "" echo "Patchset to be applied on upstream Wine:" @@ -87,7 +87,6 @@ patch_enable_all () enable_Pipelight="$1" enable_Staging="$1" enable_advapi32_GetExplicitEntriesFromAclW="$1" - enable_advapi32_LookupSecurityDescriptorParts="$1" enable_advapi32_LsaLookupSids="$1" enable_advapi32_SetSecurityInfo="$1" enable_advapi32_WinBuiltinAnyPackageSid="$1" @@ -476,9 +475,6 @@ patch_enable () advapi32-GetExplicitEntriesFromAclW) enable_advapi32_GetExplicitEntriesFromAclW="$2" ;; - advapi32-LookupSecurityDescriptorParts) - enable_advapi32_LookupSecurityDescriptorParts="$2" - ;; advapi32-LsaLookupSids) enable_advapi32_LsaLookupSids="$2" ;; @@ -2553,21 +2549,6 @@ if test "$enable_advapi32_GetExplicitEntriesFromAclW" -eq 1; then ) >> "$patchlist" fi -# Patchset advapi32-LookupSecurityDescriptorParts -# | -# | This patchset fixes the following Wine bugs: -# | * [#41682] Add stub for advapi32.LookupSecurityDescriptorPartsA/W -# | -# | Modified files: -# | * dlls/advapi32/advapi32.spec, dlls/advapi32/security.c -# | -if test "$enable_advapi32_LookupSecurityDescriptorParts" -eq 1; then - patch_apply advapi32-LookupSecurityDescriptorParts/0001-advapi32-add-LookupSecurityDescriptorPartsA-W-stubs.patch - ( - printf '%s\n' '+ { "Austin English", "advapi32: Add LookupSecurityDescriptorPartsA/W stubs.", 1 },'; - ) >> "$patchlist" -fi - # Patchset server-CreateProcess_ACLs # | # | This patchset fixes the following Wine bugs: @@ -2979,7 +2960,7 @@ fi # Patchset comctl32-PROPSHEET_InsertPage # | # | Modified files: -# | * dlls/comctl32/propsheet.c, include/prsht.h +# | * dlls/comctl32/propsheet.c # | if test "$enable_comctl32_PROPSHEET_InsertPage" -eq 1; then patch_apply comctl32-PROPSHEET_InsertPage/0003-comctl32-Add-support-for-PSPCB_ADDREF-PSPCB_RELEASE-.patch @@ -8426,7 +8407,6 @@ if test "$enable_wined3d_CSMT_Main" -eq 1; then printf '%s\n' '+ { "Sebastian Lackner", "wined3d: Add additional synchronization CS ops.", 1 },'; printf '%s\n' '+ { "Sebastian Lackner", "wined3d: Send push_constants through the CS.", 1 },'; printf '%s\n' '+ { "Stefan Dösinger", "wined3d: Send primitive type updates through the command stream.", 1 },'; - printf '%s\n' '+ { "Stefan Dösinger", "wined3d: Send light updates through the command stream.", 1 },'; printf '%s\n' '+ { "Stefan Dösinger", "wined3d: Give the cs its own state.", 1 },'; printf '%s\n' '+ { "Stefan Dösinger", "wined3d: Pass the depth stencil to swapchain->present.", 1 },'; printf '%s\n' '+ { "Stefan Dösinger", "wined3d: Prevent the command stream from running ahead too far.", 1 },'; diff --git a/patches/wined3d-CSMT_Main/0004-wined3d-Send-light-updates-through-the-command-strea.patch b/patches/wined3d-CSMT_Main/0004-wined3d-Send-light-updates-through-the-command-strea.patch deleted file mode 100644 index 1cce3587..00000000 --- a/patches/wined3d-CSMT_Main/0004-wined3d-Send-light-updates-through-the-command-strea.patch +++ /dev/null @@ -1,213 +0,0 @@ -From e9de3bb5f8aa7b31dc4caee4bd53a75c84ec42f2 Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Stefan=20D=C3=B6singer?= -Date: Wed, 10 Apr 2013 17:16:02 +0200 -Subject: wined3d: Send light updates through the command stream - ---- - dlls/wined3d/cs.c | 100 +++++++++++++++++++++++++++++++++++++++++ - dlls/wined3d/device.c | 21 +++------ - dlls/wined3d/wined3d_private.h | 2 + - 3 files changed, 108 insertions(+), 15 deletions(-) - -diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c -index 7490b36a827..594a4b5b175 100644 ---- a/dlls/wined3d/cs.c -+++ b/dlls/wined3d/cs.c -@@ -65,6 +65,8 @@ enum wined3d_cs_op - WINED3D_CS_OP_UNMAP, - WINED3D_CS_OP_PUSH_CONSTANTS, - WINED3D_CS_OP_SET_PRIMITIVE_TYPE, -+ WINED3D_CS_OP_SET_LIGHT, -+ WINED3D_CS_OP_SET_LIGHT_ENABLE, - }; - - struct wined3d_cs_sync -@@ -357,6 +359,19 @@ struct wined3d_cs_set_primitive_type - GLenum gl_primitive_type; - }; - -+struct wined3d_cs_set_light -+{ -+ enum wined3d_cs_op opcode; -+ struct wined3d_light_info light; -+}; -+ -+struct wined3d_cs_set_light_enable -+{ -+ enum wined3d_cs_op opcode; -+ UINT idx; -+ BOOL enable; -+}; -+ - static void wined3d_cs_exec_sync(struct wined3d_cs *cs, const void *data) - { - } -@@ -1678,6 +1693,89 @@ void wined3d_cs_emit_set_primitive_type(struct wined3d_cs *cs, GLenum primitive_ - cs->ops->submit(cs); - } - -+static void wined3d_cs_exec_set_light(struct wined3d_cs *cs, const void *data) -+{ -+ const struct wined3d_cs_set_light *op = data; -+ UINT light_idx = op->light.OriginalIndex; -+ UINT hash_idx = LIGHTMAP_HASHFUNC(op->light.OriginalIndex); -+ struct wined3d_light_info *object; -+ -+ if (!(object = wined3d_state_get_light(&cs->state, light_idx))) -+ { -+ TRACE("Adding new light\n"); -+ object = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(*object)); -+ if (!object) -+ { -+ ERR("Out of memory!\n"); -+ return; -+ } -+ -+ list_add_head(&cs->state.light_map[hash_idx], &object->entry); -+ object->glIndex = -1; -+ object->OriginalIndex = light_idx; -+ } -+ -+ /* Update the live definitions if the light is currently assigned a glIndex. */ -+ if (object->glIndex != -1) -+ { -+ if (object->OriginalParms.type != op->light.OriginalParms.type) -+ device_invalidate_state(cs->device, STATE_LIGHT_TYPE); -+ device_invalidate_state(cs->device, STATE_ACTIVELIGHT(object->glIndex)); -+ } -+ -+ object->OriginalParms = op->light.OriginalParms; -+ object->position = op->light.position; -+ object->direction = op->light.direction; -+ object->exponent = op->light.exponent; -+ object->cutoff = op->light.cutoff; -+} -+ -+void wined3d_cs_emit_set_light(struct wined3d_cs *cs, const struct wined3d_light_info *light) -+{ -+ struct wined3d_cs_set_light *op; -+ -+ op = cs->ops->require_space(cs, sizeof(*op)); -+ op->opcode = WINED3D_CS_OP_SET_LIGHT; -+ op->light = *light; -+ -+ cs->ops->submit(cs); -+} -+ -+static void wined3d_cs_exec_set_light_enable(struct wined3d_cs *cs, const void *data) -+{ -+ const struct wined3d_cs_set_light_enable *op = data; -+ struct wined3d_light_info *light_info; -+ struct wined3d_device *device = cs->device; -+ int prev_idx; -+ -+ /* Should be handled by the device by emitting a set_light op */ -+ if (!(light_info = wined3d_state_get_light(&cs->state, op->idx))) -+ { -+ ERR("Light enabled requested but light not defined in cs state!\n"); -+ return; -+ } -+ -+ prev_idx = light_info->glIndex; -+ wined3d_state_enable_light(&cs->state, &device->adapter->d3d_info, light_info, op->enable); -+ if (light_info->glIndex != prev_idx) -+ { -+ device_invalidate_state(device, STATE_LIGHT_TYPE); -+ device_invalidate_state(device, STATE_ACTIVELIGHT(op->enable ? light_info->glIndex : prev_idx)); -+ } -+} -+ -+void wined3d_cs_emit_set_light_enable(struct wined3d_cs *cs, UINT idx, BOOL enable) -+{ -+ struct wined3d_cs_set_light_enable *op; -+ -+ op = cs->ops->require_space(cs, sizeof(*op)); -+ op->opcode = WINED3D_CS_OP_SET_LIGHT_ENABLE; -+ op->idx = idx; -+ op->enable = enable; -+ -+ cs->ops->submit(cs); -+} -+ - static void (* const wined3d_cs_op_handlers[])(struct wined3d_cs *cs, const void *data) = - { - /* WINED3D_CS_OP_SYNC */ wined3d_cs_exec_sync, -@@ -1719,6 +1817,8 @@ static void (* const wined3d_cs_op_handlers[])(struct wined3d_cs *cs, const void - /* WINED3D_CS_OP_UNMAP */ wined3d_cs_exec_unmap, - /* WINED3D_CS_OP_PUSH_CONSTANTS */ wined3d_cs_exec_push_constants, - /* WINED3D_CS_OP_SET_PRIMITIVE_TYPE */ wined3d_cs_exec_set_primitive_type, -+ /* WINED3D_CS_OP_SET_LIGHT */ wined3d_cs_exec_set_light, -+ /* WINED3D_CS_OP_SET_LIGHT_ENABLE */ wined3d_cs_exec_set_light_enable, - }; - - static void *wined3d_cs_st_require_space(struct wined3d_cs *cs, size_t size) -diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c -index 6fb09dfcf19..dd8943d2e3e 100644 ---- a/dlls/wined3d/device.c -+++ b/dlls/wined3d/device.c -@@ -1619,14 +1619,6 @@ HRESULT CDECL wined3d_device_set_light(struct wined3d_device *device, - light->direction.x, light->direction.y, light->direction.z, - light->range, light->falloff, light->theta, light->phi); - -- /* Update the live definitions if the light is currently assigned a glIndex. */ -- if (object->glIndex != -1 && !device->recording) -- { -- if (object->OriginalParms.type != light->type) -- device_invalidate_state(device, STATE_LIGHT_TYPE); -- device_invalidate_state(device, STATE_ACTIVELIGHT(object->glIndex)); -- } -- - /* Save away the information. */ - object->OriginalParms = *light; - -@@ -1706,6 +1698,9 @@ HRESULT CDECL wined3d_device_set_light(struct wined3d_device *device, - FIXME("Unrecognized light type %#x.\n", light->type); - } - -+ if (!device->recording) -+ wined3d_cs_emit_set_light(device->cs, object); -+ - return WINED3D_OK; - } - -@@ -1729,7 +1724,6 @@ HRESULT CDECL wined3d_device_get_light(const struct wined3d_device *device, - HRESULT CDECL wined3d_device_set_light_enable(struct wined3d_device *device, UINT light_idx, BOOL enable) - { - struct wined3d_light_info *light_info; -- int prev_idx; - - TRACE("device %p, light_idx %u, enable %#x.\n", device, light_idx, enable); - -@@ -1746,13 +1740,10 @@ HRESULT CDECL wined3d_device_set_light_enable(struct wined3d_device *device, UIN - } - } - -- prev_idx = light_info->glIndex; - wined3d_state_enable_light(device->update_state, &device->adapter->d3d_info, light_info, enable); -- if (!device->recording && light_info->glIndex != prev_idx) -- { -- device_invalidate_state(device, STATE_LIGHT_TYPE); -- device_invalidate_state(device, STATE_ACTIVELIGHT(enable ? light_info->glIndex : prev_idx)); -- } -+ -+ if (!device->recording) -+ wined3d_cs_emit_set_light_enable(device->cs, light_idx, enable); - - return WINED3D_OK; - } -diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h -index 514f162fefa..df3c92cb568 100644 ---- a/dlls/wined3d/wined3d_private.h -+++ b/dlls/wined3d/wined3d_private.h -@@ -3210,6 +3210,8 @@ void wined3d_cs_emit_set_depth_stencil_view(struct wined3d_cs *cs, - struct wined3d_rendertarget_view *view) DECLSPEC_HIDDEN; - void wined3d_cs_emit_set_index_buffer(struct wined3d_cs *cs, struct wined3d_buffer *buffer, - enum wined3d_format_id format_id, unsigned int offset) DECLSPEC_HIDDEN; -+void wined3d_cs_emit_set_light(struct wined3d_cs *cs, const struct wined3d_light_info *light) DECLSPEC_HIDDEN; -+void wined3d_cs_emit_set_light_enable(struct wined3d_cs *cs, UINT idx, BOOL enable) DECLSPEC_HIDDEN; - void wined3d_cs_emit_set_material(struct wined3d_cs *cs, const struct wined3d_material *material) DECLSPEC_HIDDEN; - void wined3d_cs_emit_set_predication(struct wined3d_cs *cs, - struct wined3d_query *predicate, BOOL value) DECLSPEC_HIDDEN; --- -2.11.0 - diff --git a/patches/wined3d-CSMT_Main/0008-wined3d-Send-blits-through-the-command-stream.patch b/patches/wined3d-CSMT_Main/0008-wined3d-Send-blits-through-the-command-stream.patch index 9f4beb5f..a0bc76cc 100644 --- a/patches/wined3d-CSMT_Main/0008-wined3d-Send-blits-through-the-command-stream.patch +++ b/patches/wined3d-CSMT_Main/0008-wined3d-Send-blits-through-the-command-stream.patch @@ -1,4 +1,4 @@ -From 878bdfc42f19e26f2e4dbefdb9bd0b50bd341d97 Mon Sep 17 00:00:00 2001 +From cb83d4886548b66c4c4fd0c006c3eca43d134067 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stefan=20D=C3=B6singer?= Date: Mon, 29 Apr 2013 18:49:53 +0200 Subject: wined3d: Send blits through the command stream. @@ -13,19 +13,19 @@ between surface_blt and surface_blt_ugly isn't particularly nice. 4 files changed, 228 insertions(+), 97 deletions(-) diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c -index 66f7034686f..6bea12aa713 100644 +index 130478e8882..420a2cc8327 100644 --- a/dlls/wined3d/cs.c +++ b/dlls/wined3d/cs.c @@ -67,6 +67,7 @@ enum wined3d_cs_op + WINED3D_CS_OP_UNMAP, + WINED3D_CS_OP_PUSH_CONSTANTS, WINED3D_CS_OP_SET_PRIMITIVE_TYPE, - WINED3D_CS_OP_SET_LIGHT, - WINED3D_CS_OP_SET_LIGHT_ENABLE, + WINED3D_CS_OP_BLT, }; struct wined3d_cs_sync -@@ -372,6 +373,18 @@ struct wined3d_cs_set_light_enable - BOOL enable; +@@ -372,6 +373,18 @@ struct wined3d_cs_set_primitive_type + GLenum gl_primitive_type; }; +struct wined3d_cs_blt @@ -43,7 +43,7 @@ index 66f7034686f..6bea12aa713 100644 static void wined3d_cs_exec_sync(struct wined3d_cs *cs, const void *data) { } -@@ -1793,6 +1806,44 @@ void wined3d_cs_emit_set_light_enable(struct wined3d_cs *cs, UINT idx, BOOL enab +@@ -1792,6 +1805,44 @@ void wined3d_cs_emit_set_primitive_type(struct wined3d_cs *cs, GLenum primitive_ cs->ops->submit(cs); } @@ -88,19 +88,19 @@ index 66f7034686f..6bea12aa713 100644 static void (* const wined3d_cs_op_handlers[])(struct wined3d_cs *cs, const void *data) = { /* WINED3D_CS_OP_SYNC */ wined3d_cs_exec_sync, -@@ -1836,6 +1887,7 @@ static void (* const wined3d_cs_op_handlers[])(struct wined3d_cs *cs, const void +@@ -1835,6 +1886,7 @@ static void (* const wined3d_cs_op_handlers[])(struct wined3d_cs *cs, const void + /* WINED3D_CS_OP_UNMAP */ wined3d_cs_exec_unmap, + /* WINED3D_CS_OP_PUSH_CONSTANTS */ wined3d_cs_exec_push_constants, /* WINED3D_CS_OP_SET_PRIMITIVE_TYPE */ wined3d_cs_exec_set_primitive_type, - /* WINED3D_CS_OP_SET_LIGHT */ wined3d_cs_exec_set_light, - /* WINED3D_CS_OP_SET_LIGHT_ENABLE */ wined3d_cs_exec_set_light_enable, + /* WINED3D_CS_OP_BLT */ wined3d_cs_exec_blt, }; static void *wined3d_cs_st_require_space(struct wined3d_cs *cs, size_t size) diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c -index dd8943d2e3e..66815f80647 100644 +index 0b1b389af0b..6195122ff10 100644 --- a/dlls/wined3d/device.c +++ b/dlls/wined3d/device.c -@@ -4017,6 +4017,7 @@ HRESULT CDECL wined3d_device_copy_sub_resource_region(struct wined3d_device *dev +@@ -4016,6 +4016,7 @@ HRESULT CDECL wined3d_device_copy_sub_resource_region(struct wined3d_device *dev struct wined3d_texture *dst_texture, *src_texture; RECT dst_rect, src_rect; HRESULT hr; @@ -108,7 +108,7 @@ index dd8943d2e3e..66815f80647 100644 TRACE("device %p, dst_resource %p, dst_sub_resource_idx %u, dst_x %u, dst_y %u, dst_z %u, " "src_resource %p, src_sub_resource_idx %u, src_box %s.\n", -@@ -4104,6 +4105,14 @@ HRESULT CDECL wined3d_device_copy_sub_resource_region(struct wined3d_device *dev +@@ -4103,6 +4104,14 @@ HRESULT CDECL wined3d_device_copy_sub_resource_region(struct wined3d_device *dev if (src_box) { @@ -123,7 +123,7 @@ index dd8943d2e3e..66815f80647 100644 SetRect(&src_rect, src_box->left, src_box->top, src_box->right, src_box->bottom); } else -@@ -4117,6 +4126,23 @@ HRESULT CDECL wined3d_device_copy_sub_resource_region(struct wined3d_device *dev +@@ -4116,6 +4125,23 @@ HRESULT CDECL wined3d_device_copy_sub_resource_region(struct wined3d_device *dev SetRect(&dst_rect, dst_x, dst_y, dst_x + (src_rect.right - src_rect.left), dst_y + (src_rect.bottom - src_rect.top)); @@ -483,10 +483,10 @@ index 19d6aa74373..5b8434d63b8 100644 + return WINED3D_OK; +} diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h -index 772a8492fb0..8dc18c856c9 100644 +index b04d2f502bf..be01b6f3b6a 100644 --- a/dlls/wined3d/wined3d_private.h +++ b/dlls/wined3d/wined3d_private.h -@@ -3036,6 +3036,9 @@ HRESULT surface_upload_from_surface(struct wined3d_surface *dst_surface, const P +@@ -3038,6 +3038,9 @@ 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; @@ -496,7 +496,7 @@ index 772a8492fb0..8dc18c856c9 100644 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; -@@ -3188,6 +3191,10 @@ struct wined3d_cs *wined3d_cs_create(struct wined3d_device *device) DECLSPEC_HID +@@ -3190,6 +3193,10 @@ struct wined3d_cs *wined3d_cs_create(struct wined3d_device *device) DECLSPEC_HID void wined3d_cs_destroy(struct wined3d_cs *cs) DECLSPEC_HIDDEN; void wined3d_cs_destroy_object(struct wined3d_cs *cs, void (*callback)(void *object), void *object) DECLSPEC_HIDDEN; diff --git a/patches/wined3d-CSMT_Main/0009-wined3d-Send-render-target-view-clears-through-the-c.patch b/patches/wined3d-CSMT_Main/0009-wined3d-Send-render-target-view-clears-through-the-c.patch index a2d18f17..210e773f 100644 --- a/patches/wined3d-CSMT_Main/0009-wined3d-Send-render-target-view-clears-through-the-c.patch +++ b/patches/wined3d-CSMT_Main/0009-wined3d-Send-render-target-view-clears-through-the-c.patch @@ -1,4 +1,4 @@ -From 057495030f198c62cefb1f93c0d73e6ce714f7f9 Mon Sep 17 00:00:00 2001 +From 1c832f8fd2760bff7b0a0234f68c11af66dba8d1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stefan=20D=C3=B6singer?= Date: Thu, 4 Jul 2013 21:10:16 +0200 Subject: wined3d: Send render target view clears through the command stream @@ -11,7 +11,7 @@ Subject: wined3d: Send render target view clears through the command stream 4 files changed, 55 insertions(+), 5 deletions(-) diff --git a/dlls/d3d9/tests/visual.c b/dlls/d3d9/tests/visual.c -index 7fb3dbb7fe8..0aa4939e92b 100644 +index f6eb188837d..5700577709e 100644 --- a/dlls/d3d9/tests/visual.c +++ b/dlls/d3d9/tests/visual.c @@ -1337,7 +1337,7 @@ static void color_fill_test(void) @@ -24,12 +24,12 @@ index 7fb3dbb7fe8..0aa4939e92b 100644 * supported as offscreen plain surfaces and do not support D3DUSAGE_RENDERTARGET * when created as texture. */ diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c -index 6bea12aa713..85eff68043d 100644 +index 420a2cc8327..1dff1ff8af6 100644 --- a/dlls/wined3d/cs.c +++ b/dlls/wined3d/cs.c @@ -68,6 +68,7 @@ enum wined3d_cs_op - WINED3D_CS_OP_SET_LIGHT, - WINED3D_CS_OP_SET_LIGHT_ENABLE, + WINED3D_CS_OP_PUSH_CONSTANTS, + WINED3D_CS_OP_SET_PRIMITIVE_TYPE, WINED3D_CS_OP_BLT, + WINED3D_CS_OP_CLEAR_RTV, }; @@ -54,7 +54,7 @@ index 6bea12aa713..85eff68043d 100644 static void wined3d_cs_exec_sync(struct wined3d_cs *cs, const void *data) { } -@@ -1844,6 +1857,41 @@ void wined3d_cs_emit_blt(struct wined3d_cs *cs, struct wined3d_surface *dst_surf +@@ -1843,6 +1856,41 @@ void wined3d_cs_emit_blt(struct wined3d_cs *cs, struct wined3d_surface *dst_surf cs->ops->submit(cs); } @@ -96,19 +96,19 @@ index 6bea12aa713..85eff68043d 100644 static void (* const wined3d_cs_op_handlers[])(struct wined3d_cs *cs, const void *data) = { /* WINED3D_CS_OP_SYNC */ wined3d_cs_exec_sync, -@@ -1888,6 +1936,7 @@ static void (* const wined3d_cs_op_handlers[])(struct wined3d_cs *cs, const void - /* WINED3D_CS_OP_SET_LIGHT */ wined3d_cs_exec_set_light, - /* WINED3D_CS_OP_SET_LIGHT_ENABLE */ wined3d_cs_exec_set_light_enable, +@@ -1887,6 +1935,7 @@ static void (* const wined3d_cs_op_handlers[])(struct wined3d_cs *cs, const void + /* WINED3D_CS_OP_PUSH_CONSTANTS */ wined3d_cs_exec_push_constants, + /* WINED3D_CS_OP_SET_PRIMITIVE_TYPE */ wined3d_cs_exec_set_primitive_type, /* WINED3D_CS_OP_BLT */ wined3d_cs_exec_blt, + /* WINED3D_CS_OP_CLEAR_RTV */ wined3d_cs_exec_clear_rtv, }; static void *wined3d_cs_st_require_space(struct wined3d_cs *cs, size_t size) diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c -index 66815f80647..3176aed1ddc 100644 +index 6195122ff10..1388dda5c78 100644 --- a/dlls/wined3d/device.c +++ b/dlls/wined3d/device.c -@@ -4273,10 +4273,8 @@ HRESULT CDECL wined3d_device_clear_rendertarget_view(struct wined3d_device *devi +@@ -4272,10 +4272,8 @@ HRESULT CDECL wined3d_device_clear_rendertarget_view(struct wined3d_device *devi return WINED3DERR_INVALIDCALL; } @@ -122,10 +122,10 @@ index 66815f80647..3176aed1ddc 100644 struct wined3d_rendertarget_view * CDECL wined3d_device_get_rendertarget_view(const struct wined3d_device *device, diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h -index 8dc18c856c9..2b3ac98c35e 100644 +index be01b6f3b6a..2b58f655c25 100644 --- a/dlls/wined3d/wined3d_private.h +++ b/dlls/wined3d/wined3d_private.h -@@ -3197,6 +3197,9 @@ void wined3d_cs_emit_blt(struct wined3d_cs *cs, struct wined3d_surface *dst_surf +@@ -3199,6 +3199,9 @@ void wined3d_cs_emit_blt(struct wined3d_cs *cs, struct wined3d_surface *dst_surf enum wined3d_texture_filter_type filter) DECLSPEC_HIDDEN; 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; diff --git a/patches/wined3d-CSMT_Main/0011-wined3d-Send-update_texture-calls-through-the-CS.patch b/patches/wined3d-CSMT_Main/0011-wined3d-Send-update_texture-calls-through-the-CS.patch index cc54814a..208f19d9 100644 --- a/patches/wined3d-CSMT_Main/0011-wined3d-Send-update_texture-calls-through-the-CS.patch +++ b/patches/wined3d-CSMT_Main/0011-wined3d-Send-update_texture-calls-through-the-CS.patch @@ -1,4 +1,4 @@ -From 4066f34901ea2c033f4b873822fd6cca421debf5 Mon Sep 17 00:00:00 2001 +From 8272b9dad0782ec04f08f6829f6f9a715c676d91 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,11 +11,11 @@ FIXME: This logic duplication is ugly. 3 files changed, 141 insertions(+), 75 deletions(-) diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c -index 85eff68043d..6ffdd920403 100644 +index 1dff1ff8af6..c84bca1423f 100644 --- a/dlls/wined3d/cs.c +++ b/dlls/wined3d/cs.c @@ -69,6 +69,7 @@ enum wined3d_cs_op - WINED3D_CS_OP_SET_LIGHT_ENABLE, + WINED3D_CS_OP_SET_PRIMITIVE_TYPE, WINED3D_CS_OP_BLT, WINED3D_CS_OP_CLEAR_RTV, + WINED3D_CS_OP_UPDATE_TEXTURE, @@ -35,7 +35,7 @@ index 85eff68043d..6ffdd920403 100644 static void wined3d_cs_exec_sync(struct wined3d_cs *cs, const void *data) { } -@@ -1892,6 +1899,35 @@ void wined3d_cs_emit_clear_rtv(struct wined3d_cs *cs, struct wined3d_rendertarge +@@ -1891,6 +1898,35 @@ void wined3d_cs_emit_clear_rtv(struct wined3d_cs *cs, struct wined3d_rendertarge cs->ops->submit(cs); } @@ -71,8 +71,8 @@ index 85eff68043d..6ffdd920403 100644 static void (* const wined3d_cs_op_handlers[])(struct wined3d_cs *cs, const void *data) = { /* WINED3D_CS_OP_SYNC */ wined3d_cs_exec_sync, -@@ -1937,6 +1973,7 @@ static void (* const wined3d_cs_op_handlers[])(struct wined3d_cs *cs, const void - /* WINED3D_CS_OP_SET_LIGHT_ENABLE */ wined3d_cs_exec_set_light_enable, +@@ -1936,6 +1972,7 @@ static void (* const wined3d_cs_op_handlers[])(struct wined3d_cs *cs, const void + /* WINED3D_CS_OP_SET_PRIMITIVE_TYPE */ wined3d_cs_exec_set_primitive_type, /* WINED3D_CS_OP_BLT */ wined3d_cs_exec_blt, /* WINED3D_CS_OP_CLEAR_RTV */ wined3d_cs_exec_clear_rtv, + /* WINED3D_CS_OP_UPDATE_TEXTURE */ wined3d_cs_exec_update_texture, @@ -80,10 +80,10 @@ index 85eff68043d..6ffdd920403 100644 static void *wined3d_cs_st_require_space(struct wined3d_cs *cs, size_t size) diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c -index 69f88b3420c..6e7d4f800b3 100644 +index 71c95bc3f5d..f135f6ad03b 100644 --- a/dlls/wined3d/device.c +++ b/dlls/wined3d/device.c -@@ -3617,34 +3617,17 @@ void CDECL wined3d_device_draw_indexed_primitive_instanced(struct wined3d_device +@@ -3616,34 +3616,17 @@ void CDECL wined3d_device_draw_indexed_primitive_instanced(struct wined3d_device start_idx, index_count, start_instance, instance_count, TRUE); } @@ -122,7 +122,7 @@ index 69f88b3420c..6e7d4f800b3 100644 /* Only a prepare, since we're uploading entire volumes. */ wined3d_texture_prepare_texture(dst_texture, context, FALSE); -@@ -3652,32 +3635,89 @@ static HRESULT wined3d_device_update_texture_3d(struct wined3d_device *device, +@@ -3651,32 +3634,89 @@ static HRESULT wined3d_device_update_texture_3d(struct wined3d_device *device, for (i = 0; i < level_count; ++i) { @@ -222,7 +222,7 @@ index 69f88b3420c..6e7d4f800b3 100644 TRACE("device %p, src_texture %p, dst_texture %p.\n", device, src_texture, dst_texture); -@@ -3714,63 +3754,48 @@ HRESULT CDECL wined3d_device_update_texture(struct wined3d_device *device, +@@ -3713,63 +3753,48 @@ HRESULT CDECL wined3d_device_update_texture(struct wined3d_device *device, return WINED3DERR_INVALIDCALL; } @@ -316,10 +316,10 @@ index 69f88b3420c..6e7d4f800b3 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 2b3ac98c35e..9e2c272eeda 100644 +index 2b58f655c25..cfe8839d746 100644 --- a/dlls/wined3d/wined3d_private.h +++ b/dlls/wined3d/wined3d_private.h -@@ -2671,6 +2671,8 @@ LRESULT device_process_message(struct wined3d_device *device, HWND window, BOOL +@@ -2673,6 +2673,8 @@ LRESULT device_process_message(struct wined3d_device *device, HWND window, BOOL 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; void device_invalidate_state(const struct wined3d_device *device, DWORD state) DECLSPEC_HIDDEN; @@ -328,7 +328,7 @@ index 2b3ac98c35e..9e2c272eeda 100644 static inline BOOL isStateDirty(const struct wined3d_context *context, DWORD state) { -@@ -3262,6 +3264,8 @@ void wined3d_cs_emit_set_vertex_declaration(struct wined3d_cs *cs, +@@ -3264,6 +3266,8 @@ void wined3d_cs_emit_set_vertex_declaration(struct wined3d_cs *cs, void wined3d_cs_emit_set_viewport(struct wined3d_cs *cs, const struct wined3d_viewport *viewport) DECLSPEC_HIDDEN; void wined3d_cs_emit_sync(struct wined3d_cs *cs); void wined3d_cs_emit_unload_resource(struct wined3d_cs *cs, struct wined3d_resource *resource) DECLSPEC_HIDDEN; diff --git a/patches/wined3d-CSMT_Main/0029-wined3d-Hackily-introduce-a-multithreaded-command-st.patch b/patches/wined3d-CSMT_Main/0029-wined3d-Hackily-introduce-a-multithreaded-command-st.patch index 33896017..b42acbe2 100644 --- a/patches/wined3d-CSMT_Main/0029-wined3d-Hackily-introduce-a-multithreaded-command-st.patch +++ b/patches/wined3d-CSMT_Main/0029-wined3d-Hackily-introduce-a-multithreaded-command-st.patch @@ -1,4 +1,4 @@ -From 81f9eb76b36ff0fa3118ef33ef7f71fe19fc6681 Mon Sep 17 00:00:00 2001 +From 2b2c215c4a7b4f3d6f42701e30752ce81da4cb75 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stefan=20D=C3=B6singer?= Date: Tue, 1 Oct 2013 14:31:56 +0200 Subject: wined3d: Hackily introduce a multithreaded command stream @@ -26,7 +26,7 @@ index adffe0127bc..a9fa00224ac 100644 current_context = NULL; diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c -index b5c7432fec3..c8394533a86 100644 +index 6613f8845bf..698d19f6ec7 100644 --- a/dlls/wined3d/cs.c +++ b/dlls/wined3d/cs.c @@ -18,6 +18,7 @@ @@ -566,12 +566,66 @@ index b5c7432fec3..c8394533a86 100644 cs->ops->submit(cs); } +-static void wined3d_cs_exec_set_light(struct wined3d_cs *cs, const void *data) ++static UINT wined3d_cs_exec_set_light(struct wined3d_cs *cs, const void *data) + { + const struct wined3d_cs_set_light *op = data; + struct wined3d_light_info *light_info; +@@ -1580,7 +1646,7 @@ static void wined3d_cs_exec_set_light(struct wined3d_cs *cs, const void *data) + if (!(light_info = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(*light_info)))) + { + ERR("Failed to allocate light info.\n"); +- return; ++ return sizeof(*op);; + } + + hash_idx = LIGHTMAP_HASHFUNC(light_idx); +@@ -1601,6 +1667,8 @@ static void wined3d_cs_exec_set_light(struct wined3d_cs *cs, const void *data) + light_info->direction = op->light.direction; + light_info->exponent = op->light.exponent; + light_info->cutoff = op->light.cutoff; ++ ++ return sizeof(*op); + } + + void wined3d_cs_emit_set_light(struct wined3d_cs *cs, const struct wined3d_light_info *light) +@@ -1614,7 +1682,7 @@ void wined3d_cs_emit_set_light(struct wined3d_cs *cs, const struct wined3d_light + cs->ops->submit(cs); + } + +-static void wined3d_cs_exec_set_light_enable(struct wined3d_cs *cs, const void *data) ++static UINT wined3d_cs_exec_set_light_enable(struct wined3d_cs *cs, const void *data) + { + const struct wined3d_cs_set_light_enable *op = data; + struct wined3d_device *device = cs->device; +@@ -1624,7 +1692,7 @@ static void wined3d_cs_exec_set_light_enable(struct wined3d_cs *cs, const void * + if (!(light_info = wined3d_state_get_light(&cs->state, op->idx))) + { + ERR("Light doesn't exist.\n"); +- return; ++ return sizeof(*op); + } + + prev_idx = light_info->glIndex; +@@ -1634,6 +1702,8 @@ static void wined3d_cs_exec_set_light_enable(struct wined3d_cs *cs, const void * + device_invalidate_state(device, STATE_LIGHT_TYPE); + device_invalidate_state(device, STATE_ACTIVELIGHT(op->enable ? light_info->glIndex : prev_idx)); + } ++ ++ return sizeof(*op); + } + + void wined3d_cs_emit_set_light_enable(struct wined3d_cs *cs, unsigned int idx, BOOL enable) +@@ -1648,7 +1718,7 @@ void wined3d_cs_emit_set_light_enable(struct wined3d_cs *cs, unsigned int idx, B + cs->ops->submit(cs); + } + -static void wined3d_cs_exec_reset_state(struct wined3d_cs *cs, const void *data) +static UINT wined3d_cs_exec_reset_state(struct wined3d_cs *cs, const void *data) { struct wined3d_adapter *adapter = cs->device->adapter; HRESULT hr; -@@ -1576,6 +1642,8 @@ static void wined3d_cs_exec_reset_state(struct wined3d_cs *cs, const void *data) +@@ -1658,6 +1728,8 @@ static void wined3d_cs_exec_reset_state(struct wined3d_cs *cs, const void *data) if (FAILED(hr = state_init(&cs->state, &adapter->gl_info, &adapter->d3d_info, WINED3D_STATE_NO_REF | WINED3D_STATE_INIT_DEFAULT))) ERR("Failed to initialize CS state, hr %#x.\n", hr); @@ -580,7 +634,7 @@ index b5c7432fec3..c8394533a86 100644 } void wined3d_cs_emit_reset_state(struct wined3d_cs *cs) -@@ -1588,11 +1656,13 @@ void wined3d_cs_emit_reset_state(struct wined3d_cs *cs) +@@ -1670,11 +1742,13 @@ void wined3d_cs_emit_reset_state(struct wined3d_cs *cs) cs->ops->submit(cs); } @@ -595,7 +649,7 @@ index b5c7432fec3..c8394533a86 100644 } static void wined3d_cs_emit_callback(struct wined3d_cs *cs, void (*callback)(void *object), void *object) -@@ -1617,12 +1687,14 @@ void wined3d_cs_init_object(struct wined3d_cs *cs, void (*callback)(void *object +@@ -1699,12 +1773,14 @@ void wined3d_cs_init_object(struct wined3d_cs *cs, void (*callback)(void *object wined3d_cs_emit_callback(cs, callback, object); } @@ -611,7 +665,7 @@ index b5c7432fec3..c8394533a86 100644 } void wined3d_cs_emit_query_issue(struct wined3d_cs *cs, struct wined3d_query *query, DWORD flags) -@@ -1637,12 +1709,14 @@ void wined3d_cs_emit_query_issue(struct wined3d_cs *cs, struct wined3d_query *qu +@@ -1719,12 +1795,14 @@ void wined3d_cs_emit_query_issue(struct wined3d_cs *cs, struct wined3d_query *qu cs->ops->submit(cs); } @@ -627,7 +681,7 @@ index b5c7432fec3..c8394533a86 100644 } BOOL wined3d_cs_emit_query_poll(struct wined3d_cs *cs, struct wined3d_query *query, DWORD flags) -@@ -1661,13 +1735,15 @@ BOOL wined3d_cs_emit_query_poll(struct wined3d_cs *cs, struct wined3d_query *que +@@ -1743,13 +1821,15 @@ BOOL wined3d_cs_emit_query_poll(struct wined3d_cs *cs, struct wined3d_query *que return ret; } @@ -644,7 +698,7 @@ index b5c7432fec3..c8394533a86 100644 } void wined3d_cs_emit_preload_resource(struct wined3d_cs *cs, struct wined3d_resource *resource) -@@ -1683,13 +1759,15 @@ void wined3d_cs_emit_preload_resource(struct wined3d_cs *cs, struct wined3d_reso +@@ -1765,13 +1845,15 @@ void wined3d_cs_emit_preload_resource(struct wined3d_cs *cs, struct wined3d_reso cs->ops->submit(cs); } @@ -661,7 +715,7 @@ index b5c7432fec3..c8394533a86 100644 } void wined3d_cs_emit_unload_resource(struct wined3d_cs *cs, struct wined3d_resource *resource) -@@ -1705,13 +1783,15 @@ void wined3d_cs_emit_unload_resource(struct wined3d_cs *cs, struct wined3d_resou +@@ -1787,13 +1869,15 @@ void wined3d_cs_emit_unload_resource(struct wined3d_cs *cs, struct wined3d_resou cs->ops->submit(cs); } @@ -678,7 +732,7 @@ index b5c7432fec3..c8394533a86 100644 } HRESULT wined3d_cs_map(struct wined3d_cs *cs, struct wined3d_resource *resource, unsigned int sub_resource_idx, -@@ -1734,12 +1814,14 @@ HRESULT wined3d_cs_map(struct wined3d_cs *cs, struct wined3d_resource *resource, +@@ -1816,12 +1900,14 @@ HRESULT wined3d_cs_map(struct wined3d_cs *cs, struct wined3d_resource *resource, return hr; } @@ -694,7 +748,7 @@ index b5c7432fec3..c8394533a86 100644 } HRESULT wined3d_cs_unmap(struct wined3d_cs *cs, struct wined3d_resource *resource, unsigned int sub_resource_idx) -@@ -1780,10 +1862,11 @@ push_constant_info[] = +@@ -1862,10 +1948,11 @@ push_constant_info[] = {FIELD_OFFSET(struct wined3d_state, ps_consts_b), sizeof(BOOL), WINED3D_SHADER_CONST_PS_B}, }; @@ -707,7 +761,7 @@ index b5c7432fec3..c8394533a86 100644 unsigned int context_count; unsigned int i; size_t offset; -@@ -1799,6 +1882,8 @@ static void wined3d_cs_exec_push_constants(struct wined3d_cs *cs, const void *da +@@ -1881,6 +1968,8 @@ static void wined3d_cs_exec_push_constants(struct wined3d_cs *cs, const void *da { device->contexts[i]->constant_update_mask |= push_constant_info[op->p].mask; } @@ -716,7 +770,7 @@ index b5c7432fec3..c8394533a86 100644 } void wined3d_cs_emit_push_constants(struct wined3d_cs *cs, enum wined3d_push_constants p, -@@ -1816,7 +1901,7 @@ void wined3d_cs_emit_push_constants(struct wined3d_cs *cs, enum wined3d_push_con +@@ -1898,7 +1987,7 @@ void wined3d_cs_emit_push_constants(struct wined3d_cs *cs, enum wined3d_push_con cs->ops->submit(cs); } @@ -725,7 +779,7 @@ index b5c7432fec3..c8394533a86 100644 { const struct wined3d_cs_set_primitive_type *op = data; GLenum prev; -@@ -1827,6 +1912,8 @@ static void wined3d_cs_exec_set_primitive_type(struct wined3d_cs *cs, const void +@@ -1909,6 +1998,8 @@ static void wined3d_cs_exec_set_primitive_type(struct wined3d_cs *cs, const void device_invalidate_state(cs->device, STATE_POINT_ENABLE); cs->state.gl_primitive_type = op->gl_primitive_type; @@ -734,61 +788,7 @@ index b5c7432fec3..c8394533a86 100644 } void wined3d_cs_emit_set_primitive_type(struct wined3d_cs *cs, GLenum primitive_type) -@@ -1840,7 +1927,7 @@ void wined3d_cs_emit_set_primitive_type(struct wined3d_cs *cs, GLenum primitive_ - cs->ops->submit(cs); - } - --static void wined3d_cs_exec_set_light(struct wined3d_cs *cs, const void *data) -+static UINT wined3d_cs_exec_set_light(struct wined3d_cs *cs, const void *data) - { - const struct wined3d_cs_set_light *op = data; - UINT light_idx = op->light.OriginalIndex; -@@ -1854,7 +1941,7 @@ static void wined3d_cs_exec_set_light(struct wined3d_cs *cs, const void *data) - if (!object) - { - ERR("Out of memory!\n"); -- return; -+ return sizeof(*op); - } - - list_add_head(&cs->state.light_map[hash_idx], &object->entry); -@@ -1875,6 +1962,8 @@ static void wined3d_cs_exec_set_light(struct wined3d_cs *cs, const void *data) - object->direction = op->light.direction; - object->exponent = op->light.exponent; - object->cutoff = op->light.cutoff; -+ -+ return sizeof(*op); - } - - void wined3d_cs_emit_set_light(struct wined3d_cs *cs, const struct wined3d_light_info *light) -@@ -1888,7 +1977,7 @@ void wined3d_cs_emit_set_light(struct wined3d_cs *cs, const struct wined3d_light - cs->ops->submit(cs); - } - --static void wined3d_cs_exec_set_light_enable(struct wined3d_cs *cs, const void *data) -+static UINT wined3d_cs_exec_set_light_enable(struct wined3d_cs *cs, const void *data) - { - const struct wined3d_cs_set_light_enable *op = data; - struct wined3d_light_info *light_info; -@@ -1899,7 +1988,7 @@ static void wined3d_cs_exec_set_light_enable(struct wined3d_cs *cs, const void * - if (!(light_info = wined3d_state_get_light(&cs->state, op->idx))) - { - ERR("Light enabled requested but light not defined in cs state!\n"); -- return; -+ return sizeof(*op); - } - - prev_idx = light_info->glIndex; -@@ -1909,6 +1998,8 @@ static void wined3d_cs_exec_set_light_enable(struct wined3d_cs *cs, const void * - device_invalidate_state(device, STATE_LIGHT_TYPE); - device_invalidate_state(device, STATE_ACTIVELIGHT(op->enable ? light_info->glIndex : prev_idx)); - } -+ -+ return sizeof(*op); - } - - void wined3d_cs_emit_set_light_enable(struct wined3d_cs *cs, UINT idx, BOOL enable) -@@ -1923,7 +2014,7 @@ void wined3d_cs_emit_set_light_enable(struct wined3d_cs *cs, UINT idx, BOOL enab +@@ -1922,7 +2013,7 @@ void wined3d_cs_emit_set_primitive_type(struct wined3d_cs *cs, GLenum primitive_ cs->ops->submit(cs); } @@ -797,7 +797,7 @@ index b5c7432fec3..c8394533a86 100644 { const struct wined3d_cs_blt *op = data; -@@ -1934,6 +2025,8 @@ static void wined3d_cs_exec_blt(struct wined3d_cs *cs, const void *data) +@@ -1933,6 +2024,8 @@ static void wined3d_cs_exec_blt(struct wined3d_cs *cs, const void *data) wined3d_resource_release(&op->dst_surface->container->resource); if (op->src_surface && op->src_surface != op->dst_surface) wined3d_resource_release(&op->src_surface->container->resource); @@ -806,7 +806,7 @@ index b5c7432fec3..c8394533a86 100644 } void wined3d_cs_emit_blt(struct wined3d_cs *cs, struct wined3d_surface *dst_surface, -@@ -1961,7 +2054,7 @@ void wined3d_cs_emit_blt(struct wined3d_cs *cs, struct wined3d_surface *dst_surf +@@ -1960,7 +2053,7 @@ void wined3d_cs_emit_blt(struct wined3d_cs *cs, struct wined3d_surface *dst_surf cs->ops->submit(cs); } @@ -815,7 +815,7 @@ index b5c7432fec3..c8394533a86 100644 { const struct wined3d_cs_clear_rtv *op = data; struct wined3d_device *device = cs->device; -@@ -1972,6 +2065,8 @@ static void wined3d_cs_exec_clear_rtv(struct wined3d_cs *cs, const void *data) +@@ -1971,6 +2064,8 @@ static void wined3d_cs_exec_clear_rtv(struct wined3d_cs *cs, const void *data) op->blitter->depth_fill(device, op->view, &op->rect, op->flags, op->depth, op->stencil); wined3d_resource_release(op->view->resource); @@ -824,7 +824,7 @@ index b5c7432fec3..c8394533a86 100644 } void wined3d_cs_emit_clear_rtv(struct wined3d_cs *cs, struct wined3d_rendertarget_view *view, -@@ -1996,7 +2091,7 @@ void wined3d_cs_emit_clear_rtv(struct wined3d_cs *cs, struct wined3d_rendertarge +@@ -1995,7 +2090,7 @@ void wined3d_cs_emit_clear_rtv(struct wined3d_cs *cs, struct wined3d_rendertarge cs->ops->submit(cs); } @@ -833,7 +833,7 @@ index b5c7432fec3..c8394533a86 100644 { const struct wined3d_cs_update_texture *op = data; struct wined3d_context *context; -@@ -2007,6 +2102,8 @@ static void wined3d_cs_exec_update_texture(struct wined3d_cs *cs, const void *da +@@ -2006,6 +2101,8 @@ static void wined3d_cs_exec_update_texture(struct wined3d_cs *cs, const void *da wined3d_resource_release(&op->src->resource); wined3d_resource_release(&op->dst->resource); @@ -842,7 +842,7 @@ index b5c7432fec3..c8394533a86 100644 } void wined3d_cs_emit_update_texture(struct wined3d_cs *cs, struct wined3d_texture *src, -@@ -2025,7 +2122,7 @@ void wined3d_cs_emit_update_texture(struct wined3d_cs *cs, struct wined3d_textur +@@ -2024,7 +2121,7 @@ void wined3d_cs_emit_update_texture(struct wined3d_cs *cs, struct wined3d_textur cs->ops->submit(cs); } @@ -851,7 +851,7 @@ index b5c7432fec3..c8394533a86 100644 { const struct wined3d_cs_update_sub_resource *op = data; struct wined3d_const_bo_address addr; -@@ -2041,7 +2138,7 @@ static void wined3d_cs_exec_update_sub_resource(struct wined3d_cs *cs, const voi +@@ -2040,7 +2137,7 @@ static void wined3d_cs_exec_update_sub_resource(struct wined3d_cs *cs, const voi if (FAILED(hr = wined3d_buffer_upload_data(buffer, op->box, op->data))) WARN("Failed to update buffer data, hr %#x.\n", hr); @@ -860,7 +860,7 @@ index b5c7432fec3..c8394533a86 100644 } texture = wined3d_texture_from_resource(op->resource); -@@ -2070,6 +2167,8 @@ static void wined3d_cs_exec_update_sub_resource(struct wined3d_cs *cs, const voi +@@ -2069,6 +2166,8 @@ static void wined3d_cs_exec_update_sub_resource(struct wined3d_cs *cs, const voi wined3d_texture_validate_location(texture, op->sub_resource_idx, WINED3D_LOCATION_TEXTURE_RGB); wined3d_texture_invalidate_location(texture, op->sub_resource_idx, ~WINED3D_LOCATION_TEXTURE_RGB); @@ -869,7 +869,7 @@ index b5c7432fec3..c8394533a86 100644 } void wined3d_cs_emit_update_sub_resource(struct wined3d_cs *cs, struct wined3d_resource *resource, -@@ -2092,11 +2191,13 @@ void wined3d_cs_emit_update_sub_resource(struct wined3d_cs *cs, struct wined3d_r +@@ -2091,11 +2190,13 @@ void wined3d_cs_emit_update_sub_resource(struct wined3d_cs *cs, struct wined3d_r cs->ops->submit_and_wait(cs); } @@ -884,7 +884,7 @@ index b5c7432fec3..c8394533a86 100644 } HRESULT wined3d_cs_emit_get_dc(struct wined3d_cs *cs, struct wined3d_texture *texture, -@@ -2116,11 +2217,13 @@ HRESULT wined3d_cs_emit_get_dc(struct wined3d_cs *cs, struct wined3d_texture *te +@@ -2115,11 +2216,13 @@ HRESULT wined3d_cs_emit_get_dc(struct wined3d_cs *cs, struct wined3d_texture *te return hr; } @@ -899,7 +899,7 @@ index b5c7432fec3..c8394533a86 100644 } HRESULT wined3d_cs_emit_release_dc(struct wined3d_cs *cs, struct wined3d_texture *texture, -@@ -2140,11 +2243,13 @@ HRESULT wined3d_cs_emit_release_dc(struct wined3d_cs *cs, struct wined3d_texture +@@ -2139,11 +2242,13 @@ HRESULT wined3d_cs_emit_release_dc(struct wined3d_cs *cs, struct wined3d_texture return hr; } @@ -914,7 +914,7 @@ index b5c7432fec3..c8394533a86 100644 } HRESULT wined3d_cs_emit_create_swapchain_context(struct wined3d_cs *cs, struct wined3d_swapchain *swapchain) -@@ -2162,11 +2267,13 @@ HRESULT wined3d_cs_emit_create_swapchain_context(struct wined3d_cs *cs, struct w +@@ -2161,11 +2266,13 @@ HRESULT wined3d_cs_emit_create_swapchain_context(struct wined3d_cs *cs, struct w return hr; } @@ -929,7 +929,7 @@ index b5c7432fec3..c8394533a86 100644 } void wined3d_cs_emit_update_swap_interval(struct wined3d_cs *cs, struct wined3d_swapchain *swapchain) -@@ -2180,7 +2287,7 @@ void wined3d_cs_emit_update_swap_interval(struct wined3d_cs *cs, struct wined3d_ +@@ -2179,7 +2286,7 @@ void wined3d_cs_emit_update_swap_interval(struct wined3d_cs *cs, struct wined3d_ cs->ops->submit_and_wait(cs); } @@ -938,7 +938,7 @@ index b5c7432fec3..c8394533a86 100644 { const struct wined3d_cs_texture_add_dirty_region *op = data; struct wined3d_texture *texture = op->texture; -@@ -2198,6 +2305,8 @@ static void wined3d_cs_exec_texture_add_dirty_region(struct wined3d_cs *cs, cons +@@ -2197,6 +2304,8 @@ static void wined3d_cs_exec_texture_add_dirty_region(struct wined3d_cs *cs, cons context_release(context); wined3d_resource_release(&texture->resource); @@ -947,7 +947,7 @@ index b5c7432fec3..c8394533a86 100644 } void wined3d_cs_emit_texture_add_dirty_region(struct wined3d_cs *cs, -@@ -2219,7 +2328,7 @@ void wined3d_cs_emit_texture_add_dirty_region(struct wined3d_cs *cs, +@@ -2218,7 +2327,7 @@ void wined3d_cs_emit_texture_add_dirty_region(struct wined3d_cs *cs, cs->ops->submit(cs); } @@ -956,7 +956,7 @@ index b5c7432fec3..c8394533a86 100644 { const struct wined3d_cs_buffer_copy *op = data; HRESULT hr; -@@ -2229,6 +2338,8 @@ static void wined3d_cs_exec_buffer_copy(struct wined3d_cs *cs, const void *data) +@@ -2228,6 +2337,8 @@ static void wined3d_cs_exec_buffer_copy(struct wined3d_cs *cs, const void *data) wined3d_resource_release(&op->dst_buffer->resource); wined3d_resource_release(&op->src_buffer->resource); @@ -965,7 +965,7 @@ index b5c7432fec3..c8394533a86 100644 } void wined3d_cs_emit_buffer_copy(struct wined3d_cs *cs, struct wined3d_buffer *dst_buffer, -@@ -2251,7 +2362,7 @@ void wined3d_cs_emit_buffer_copy(struct wined3d_cs *cs, struct wined3d_buffer *d +@@ -2250,7 +2361,7 @@ void wined3d_cs_emit_buffer_copy(struct wined3d_cs *cs, struct wined3d_buffer *d cs->ops->submit(cs); } @@ -974,7 +974,7 @@ index b5c7432fec3..c8394533a86 100644 { const struct wined3d_cs_map_vertex_buffers *op = data; struct wined3d_state *state = &cs->device->state; -@@ -2298,6 +2409,8 @@ static void wined3d_cs_exec_map_vertex_buffers(struct wined3d_cs *cs, const void +@@ -2297,6 +2408,8 @@ static void wined3d_cs_exec_map_vertex_buffers(struct wined3d_cs *cs, const void } context_release(context); @@ -983,7 +983,7 @@ index b5c7432fec3..c8394533a86 100644 } void wined3d_cs_emit_map_vertex_buffers(struct wined3d_cs *cs, UINT src_start_idx, -@@ -2313,7 +2426,7 @@ void wined3d_cs_emit_map_vertex_buffers(struct wined3d_cs *cs, UINT src_start_id +@@ -2312,7 +2425,7 @@ void wined3d_cs_emit_map_vertex_buffers(struct wined3d_cs *cs, UINT src_start_id cs->ops->submit_and_wait(cs); } @@ -992,7 +992,7 @@ index b5c7432fec3..c8394533a86 100644 { /* WINED3D_CS_OP_SYNC */ wined3d_cs_exec_sync, /* WINED3D_CS_OP_GLFINISH */ wined3d_cs_exec_glfinish, -@@ -2421,6 +2534,201 @@ static const struct wined3d_cs_ops wined3d_cs_st_ops = +@@ -2420,6 +2533,201 @@ static const struct wined3d_cs_ops wined3d_cs_st_ops = wined3d_cs_st_submit, }; @@ -1194,7 +1194,7 @@ index b5c7432fec3..c8394533a86 100644 struct wined3d_cs *wined3d_cs_create(struct wined3d_device *device) { const struct wined3d_gl_info *gl_info = &device->adapter->gl_info; -@@ -2447,12 +2755,40 @@ struct wined3d_cs *wined3d_cs_create(struct wined3d_device *device) +@@ -2446,12 +2754,40 @@ struct wined3d_cs *wined3d_cs_create(struct wined3d_device *device) return NULL; } @@ -1236,7 +1236,7 @@ index b5c7432fec3..c8394533a86 100644 HeapFree(GetProcessHeap(), 0, cs); } diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c -index 61c862de138..734f818692c 100644 +index 4c12fd3d9e5..7c0f4bb1bf0 100644 --- a/dlls/wined3d/device.c +++ b/dlls/wined3d/device.c @@ -1263,7 +1263,7 @@ UINT CDECL wined3d_device_get_available_texture_mem(const struct wined3d_device @@ -1279,7 +1279,7 @@ index e7962465279..a8409cfd4b8 100644 if (hkey) RegCloseKey( hkey ); diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h -index 38693a52b29..5962fa7ea19 100644 +index d731d7d4692..128e5be297e 100644 --- a/dlls/wined3d/wined3d_private.h +++ b/dlls/wined3d/wined3d_private.h @@ -306,6 +306,7 @@ struct wined3d_settings @@ -1290,7 +1290,7 @@ index 38693a52b29..5962fa7ea19 100644 }; extern struct wined3d_settings wined3d_settings DECLSPEC_HIDDEN; -@@ -2785,11 +2786,6 @@ static inline void wined3d_resource_release(struct wined3d_resource *resource) +@@ -2787,11 +2788,6 @@ static inline void wined3d_resource_release(struct wined3d_resource *resource) InterlockedDecrement(&resource->access_count); } @@ -1302,7 +1302,7 @@ index 38693a52b29..5962fa7ea19 100644 void resource_cleanup(struct wined3d_resource *resource) DECLSPEC_HIDDEN; HRESULT resource_init(struct wined3d_resource *resource, struct wined3d_device *device, enum wined3d_resource_type type, const struct wined3d_format *format, -@@ -3210,6 +3206,21 @@ enum wined3d_push_constants +@@ -3212,6 +3208,21 @@ enum wined3d_push_constants WINED3D_PUSH_CONSTANTS_PS_B, }; @@ -1324,7 +1324,7 @@ index 38693a52b29..5962fa7ea19 100644 struct wined3d_cs_ops { void *(*require_space)(struct wined3d_cs *cs, size_t size); -@@ -3226,9 +3237,21 @@ struct wined3d_cs +@@ -3228,9 +3239,21 @@ struct wined3d_cs size_t data_size, start, end; void *data; diff --git a/patches/wined3d-CSMT_Main/0031-wined3d-Introduce-a-separate-priority-queue.patch b/patches/wined3d-CSMT_Main/0031-wined3d-Introduce-a-separate-priority-queue.patch index 1504cf38..ce46e6ff 100644 --- a/patches/wined3d-CSMT_Main/0031-wined3d-Introduce-a-separate-priority-queue.patch +++ b/patches/wined3d-CSMT_Main/0031-wined3d-Introduce-a-separate-priority-queue.patch @@ -1,4 +1,4 @@ -From 0c21b5789a1b288b28bdd31a199a87dc34f6a6c6 Mon Sep 17 00:00:00 2001 +From 7fcb1c399169868513e37a08051f7ae9dc59e18a Mon Sep 17 00:00:00 2001 From: Sebastian Lackner Date: Wed, 8 Feb 2017 00:12:31 +0100 Subject: wined3d: Introduce a separate priority queue. @@ -9,7 +9,7 @@ Subject: wined3d: Introduce a separate priority queue. 2 files changed, 74 insertions(+), 63 deletions(-) diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c -index a656c93684a..b874b1f41f2 100644 +index 6e7a4cb9857..34bae9d4e87 100644 --- a/dlls/wined3d/cs.c +++ b/dlls/wined3d/cs.c @@ -492,7 +492,7 @@ void wined3d_cs_emit_sync(struct wined3d_cs *cs) @@ -282,97 +282,7 @@ index a656c93684a..b874b1f41f2 100644 op->opcode = WINED3D_CS_OP_SET_MATERIAL; op->material = *material; -@@ -1650,7 +1650,7 @@ void wined3d_cs_emit_reset_state(struct wined3d_cs *cs) - { - struct wined3d_cs_reset_state *op; - -- op = cs->ops->require_space(cs, sizeof(*op)); -+ op = cs->ops->require_space(cs, sizeof(*op), 0); - op->opcode = WINED3D_CS_OP_RESET_STATE; - - cs->ops->submit(cs); -@@ -1669,7 +1669,7 @@ static void wined3d_cs_emit_callback(struct wined3d_cs *cs, void (*callback)(voi - { - struct wined3d_cs_callback *op; - -- op = cs->ops->require_space(cs, sizeof(*op)); -+ op = cs->ops->require_space(cs, sizeof(*op), 0); - op->opcode = WINED3D_CS_OP_CALLBACK; - op->callback = callback; - op->object = object; -@@ -1701,7 +1701,7 @@ void wined3d_cs_emit_query_issue(struct wined3d_cs *cs, struct wined3d_query *qu - { - struct wined3d_cs_query_issue *op; - -- op = cs->ops->require_space(cs, sizeof(*op)); -+ op = cs->ops->require_space(cs, sizeof(*op), 0); - op->opcode = WINED3D_CS_OP_QUERY_ISSUE; - op->query = query; - op->flags = flags; -@@ -1724,7 +1724,7 @@ BOOL wined3d_cs_emit_query_poll(struct wined3d_cs *cs, struct wined3d_query *que - struct wined3d_cs_query_poll *op; - BOOL ret; - -- op = cs->ops->require_space(cs, sizeof(*op)); -+ op = cs->ops->require_space(cs, sizeof(*op), 0); - op->opcode = WINED3D_CS_OP_QUERY_POLL; - op->query = query; - op->flags = flags; -@@ -1750,7 +1750,7 @@ void wined3d_cs_emit_preload_resource(struct wined3d_cs *cs, struct wined3d_reso - { - struct wined3d_cs_preload_resource *op; - -- op = cs->ops->require_space(cs, sizeof(*op)); -+ op = cs->ops->require_space(cs, sizeof(*op), 0); - op->opcode = WINED3D_CS_OP_PRELOAD_RESOURCE; - op->resource = resource; - -@@ -1774,7 +1774,7 @@ void wined3d_cs_emit_unload_resource(struct wined3d_cs *cs, struct wined3d_resou - { - struct wined3d_cs_unload_resource *op; - -- op = cs->ops->require_space(cs, sizeof(*op)); -+ op = cs->ops->require_space(cs, sizeof(*op), 0); - op->opcode = WINED3D_CS_OP_UNLOAD_RESOURCE; - op->resource = resource; - -@@ -1800,7 +1800,7 @@ HRESULT wined3d_cs_map(struct wined3d_cs *cs, struct wined3d_resource *resource, - struct wined3d_cs_map *op; - HRESULT hr; - -- op = cs->ops->require_space(cs, sizeof(*op)); -+ op = cs->ops->require_space(cs, sizeof(*op), 0); - op->opcode = WINED3D_CS_OP_MAP; - op->resource = resource; - op->sub_resource_idx = sub_resource_idx; -@@ -1829,7 +1829,7 @@ HRESULT wined3d_cs_unmap(struct wined3d_cs *cs, struct wined3d_resource *resourc - struct wined3d_cs_unmap *op; - HRESULT hr; - -- op = cs->ops->require_space(cs, sizeof(*op)); -+ op = cs->ops->require_space(cs, sizeof(*op), 0); - op->opcode = WINED3D_CS_OP_UNMAP; - op->resource = resource; - op->sub_resource_idx = sub_resource_idx; -@@ -1891,7 +1891,7 @@ void wined3d_cs_emit_push_constants(struct wined3d_cs *cs, enum wined3d_push_con - { - struct wined3d_cs_push_constants *op; - -- op = cs->ops->require_space(cs, FIELD_OFFSET(struct wined3d_cs_push_constants, constants[count * push_constant_info[p].size])); -+ op = cs->ops->require_space(cs, FIELD_OFFSET(struct wined3d_cs_push_constants, constants[count * push_constant_info[p].size]), 0); - op->opcode = WINED3D_CS_OP_PUSH_CONSTANTS; - op->p = p; - op->start_idx = start_idx; -@@ -1920,7 +1920,7 @@ void wined3d_cs_emit_set_primitive_type(struct wined3d_cs *cs, GLenum primitive_ - { - struct wined3d_cs_set_primitive_type *op; - -- op = cs->ops->require_space(cs, sizeof(*op)); -+ op = cs->ops->require_space(cs, sizeof(*op), 0); - op->opcode = WINED3D_CS_OP_SET_PRIMITIVE_TYPE; - op->gl_primitive_type = primitive_type; - -@@ -1970,7 +1970,7 @@ void wined3d_cs_emit_set_light(struct wined3d_cs *cs, const struct wined3d_light +@@ -1675,7 +1675,7 @@ void wined3d_cs_emit_set_light(struct wined3d_cs *cs, const struct wined3d_light { struct wined3d_cs_set_light *op; @@ -381,7 +291,7 @@ index a656c93684a..b874b1f41f2 100644 op->opcode = WINED3D_CS_OP_SET_LIGHT; op->light = *light; -@@ -2006,7 +2006,7 @@ void wined3d_cs_emit_set_light_enable(struct wined3d_cs *cs, UINT idx, BOOL enab +@@ -1710,7 +1710,7 @@ void wined3d_cs_emit_set_light_enable(struct wined3d_cs *cs, unsigned int idx, B { struct wined3d_cs_set_light_enable *op; @@ -390,7 +300,97 @@ index a656c93684a..b874b1f41f2 100644 op->opcode = WINED3D_CS_OP_SET_LIGHT_ENABLE; op->idx = idx; op->enable = enable; -@@ -2036,7 +2036,7 @@ void wined3d_cs_emit_blt(struct wined3d_cs *cs, struct wined3d_surface *dst_surf +@@ -1736,7 +1736,7 @@ void wined3d_cs_emit_reset_state(struct wined3d_cs *cs) + { + struct wined3d_cs_reset_state *op; + +- op = cs->ops->require_space(cs, sizeof(*op)); ++ op = cs->ops->require_space(cs, sizeof(*op), 0); + op->opcode = WINED3D_CS_OP_RESET_STATE; + + cs->ops->submit(cs); +@@ -1755,7 +1755,7 @@ static void wined3d_cs_emit_callback(struct wined3d_cs *cs, void (*callback)(voi + { + struct wined3d_cs_callback *op; + +- op = cs->ops->require_space(cs, sizeof(*op)); ++ op = cs->ops->require_space(cs, sizeof(*op), 0); + op->opcode = WINED3D_CS_OP_CALLBACK; + op->callback = callback; + op->object = object; +@@ -1787,7 +1787,7 @@ void wined3d_cs_emit_query_issue(struct wined3d_cs *cs, struct wined3d_query *qu + { + struct wined3d_cs_query_issue *op; + +- op = cs->ops->require_space(cs, sizeof(*op)); ++ op = cs->ops->require_space(cs, sizeof(*op), 0); + op->opcode = WINED3D_CS_OP_QUERY_ISSUE; + op->query = query; + op->flags = flags; +@@ -1810,7 +1810,7 @@ BOOL wined3d_cs_emit_query_poll(struct wined3d_cs *cs, struct wined3d_query *que + struct wined3d_cs_query_poll *op; + BOOL ret; + +- op = cs->ops->require_space(cs, sizeof(*op)); ++ op = cs->ops->require_space(cs, sizeof(*op), 0); + op->opcode = WINED3D_CS_OP_QUERY_POLL; + op->query = query; + op->flags = flags; +@@ -1836,7 +1836,7 @@ void wined3d_cs_emit_preload_resource(struct wined3d_cs *cs, struct wined3d_reso + { + struct wined3d_cs_preload_resource *op; + +- op = cs->ops->require_space(cs, sizeof(*op)); ++ op = cs->ops->require_space(cs, sizeof(*op), 0); + op->opcode = WINED3D_CS_OP_PRELOAD_RESOURCE; + op->resource = resource; + +@@ -1860,7 +1860,7 @@ void wined3d_cs_emit_unload_resource(struct wined3d_cs *cs, struct wined3d_resou + { + struct wined3d_cs_unload_resource *op; + +- op = cs->ops->require_space(cs, sizeof(*op)); ++ op = cs->ops->require_space(cs, sizeof(*op), 0); + op->opcode = WINED3D_CS_OP_UNLOAD_RESOURCE; + op->resource = resource; + +@@ -1886,7 +1886,7 @@ HRESULT wined3d_cs_map(struct wined3d_cs *cs, struct wined3d_resource *resource, + struct wined3d_cs_map *op; + HRESULT hr; + +- op = cs->ops->require_space(cs, sizeof(*op)); ++ op = cs->ops->require_space(cs, sizeof(*op), 0); + op->opcode = WINED3D_CS_OP_MAP; + op->resource = resource; + op->sub_resource_idx = sub_resource_idx; +@@ -1915,7 +1915,7 @@ HRESULT wined3d_cs_unmap(struct wined3d_cs *cs, struct wined3d_resource *resourc + struct wined3d_cs_unmap *op; + HRESULT hr; + +- op = cs->ops->require_space(cs, sizeof(*op)); ++ op = cs->ops->require_space(cs, sizeof(*op), 0); + op->opcode = WINED3D_CS_OP_UNMAP; + op->resource = resource; + op->sub_resource_idx = sub_resource_idx; +@@ -1977,7 +1977,7 @@ void wined3d_cs_emit_push_constants(struct wined3d_cs *cs, enum wined3d_push_con + { + struct wined3d_cs_push_constants *op; + +- op = cs->ops->require_space(cs, FIELD_OFFSET(struct wined3d_cs_push_constants, constants[count * push_constant_info[p].size])); ++ op = cs->ops->require_space(cs, FIELD_OFFSET(struct wined3d_cs_push_constants, constants[count * push_constant_info[p].size]), 0); + op->opcode = WINED3D_CS_OP_PUSH_CONSTANTS; + op->p = p; + op->start_idx = start_idx; +@@ -2006,7 +2006,7 @@ void wined3d_cs_emit_set_primitive_type(struct wined3d_cs *cs, GLenum primitive_ + { + struct wined3d_cs_set_primitive_type *op; + +- op = cs->ops->require_space(cs, sizeof(*op)); ++ op = cs->ops->require_space(cs, sizeof(*op), 0); + op->opcode = WINED3D_CS_OP_SET_PRIMITIVE_TYPE; + op->gl_primitive_type = primitive_type; + +@@ -2035,7 +2035,7 @@ void wined3d_cs_emit_blt(struct wined3d_cs *cs, struct wined3d_surface *dst_surf { struct wined3d_cs_blt *op; @@ -399,7 +399,7 @@ index a656c93684a..b874b1f41f2 100644 op->opcode = WINED3D_CS_OP_BLT; op->dst_surface = dst_surface; op->dst_rect = *dst_rect; -@@ -2075,7 +2075,7 @@ void wined3d_cs_emit_clear_rtv(struct wined3d_cs *cs, struct wined3d_rendertarge +@@ -2074,7 +2074,7 @@ void wined3d_cs_emit_clear_rtv(struct wined3d_cs *cs, struct wined3d_rendertarge { struct wined3d_cs_clear_rtv *op; @@ -408,7 +408,7 @@ index a656c93684a..b874b1f41f2 100644 op->opcode = WINED3D_CS_OP_CLEAR_RTV; op->view = view; op->rect = *rect; -@@ -2111,7 +2111,7 @@ void wined3d_cs_emit_update_texture(struct wined3d_cs *cs, struct wined3d_textur +@@ -2110,7 +2110,7 @@ void wined3d_cs_emit_update_texture(struct wined3d_cs *cs, struct wined3d_textur { struct wined3d_cs_update_texture *op; @@ -417,7 +417,7 @@ index a656c93684a..b874b1f41f2 100644 op->opcode = WINED3D_CS_OP_UPDATE_TEXTURE; op->src = src; op->dst = dst; -@@ -2177,7 +2177,7 @@ void wined3d_cs_emit_update_sub_resource(struct wined3d_cs *cs, struct wined3d_r +@@ -2176,7 +2176,7 @@ void wined3d_cs_emit_update_sub_resource(struct wined3d_cs *cs, struct wined3d_r { struct wined3d_cs_update_sub_resource *op; @@ -426,7 +426,7 @@ index a656c93684a..b874b1f41f2 100644 op->opcode = WINED3D_CS_OP_UPDATE_SUB_RESOURCE; op->resource = resource; op->sub_resource_idx = sub_resource_idx; -@@ -2206,7 +2206,7 @@ HRESULT wined3d_cs_emit_get_dc(struct wined3d_cs *cs, struct wined3d_texture *te +@@ -2205,7 +2205,7 @@ HRESULT wined3d_cs_emit_get_dc(struct wined3d_cs *cs, struct wined3d_texture *te struct wined3d_cs_get_release_dc *op; HRESULT hr; @@ -435,7 +435,7 @@ index a656c93684a..b874b1f41f2 100644 op->opcode = WINED3D_CS_OP_GET_DC; op->texture = texture; op->sub_resource_idx = sub_resource_idx; -@@ -2232,7 +2232,7 @@ HRESULT wined3d_cs_emit_release_dc(struct wined3d_cs *cs, struct wined3d_texture +@@ -2231,7 +2231,7 @@ HRESULT wined3d_cs_emit_release_dc(struct wined3d_cs *cs, struct wined3d_texture struct wined3d_cs_get_release_dc *op; HRESULT hr; @@ -444,7 +444,7 @@ index a656c93684a..b874b1f41f2 100644 op->opcode = WINED3D_CS_OP_RELEASE_DC; op->texture = texture; op->sub_resource_idx = sub_resource_idx; -@@ -2257,7 +2257,7 @@ HRESULT wined3d_cs_emit_create_swapchain_context(struct wined3d_cs *cs, struct w +@@ -2256,7 +2256,7 @@ HRESULT wined3d_cs_emit_create_swapchain_context(struct wined3d_cs *cs, struct w struct wined3d_cs_create_swapchain_context *op; HRESULT hr; @@ -453,7 +453,7 @@ index a656c93684a..b874b1f41f2 100644 op->opcode = WINED3D_CS_OP_CREATE_SWAPCHAIN_CONTEXT; op->swapchain = swapchain; op->hr = &hr; -@@ -2280,7 +2280,7 @@ void wined3d_cs_emit_update_swap_interval(struct wined3d_cs *cs, struct wined3d_ +@@ -2279,7 +2279,7 @@ void wined3d_cs_emit_update_swap_interval(struct wined3d_cs *cs, struct wined3d_ { struct wined3d_cs_update_swap_interval *op; @@ -462,7 +462,7 @@ index a656c93684a..b874b1f41f2 100644 op->opcode = WINED3D_CS_OP_UPDATE_SWAP_INTERVAL; op->swapchain = swapchain; -@@ -2318,7 +2318,7 @@ void wined3d_cs_emit_texture_add_dirty_region(struct wined3d_cs *cs, +@@ -2317,7 +2317,7 @@ void wined3d_cs_emit_texture_add_dirty_region(struct wined3d_cs *cs, if (dirty_region) WARN("Ignoring dirty_region %s.\n", debug_box(dirty_region)); @@ -471,7 +471,7 @@ index a656c93684a..b874b1f41f2 100644 op->opcode = WINED3D_CS_OP_TEXTURE_ADD_DIRTY_REGION; op->texture = texture; op->sub_resource_idx = sub_resource_idx; -@@ -2348,7 +2348,7 @@ void wined3d_cs_emit_buffer_copy(struct wined3d_cs *cs, struct wined3d_buffer *d +@@ -2347,7 +2347,7 @@ void wined3d_cs_emit_buffer_copy(struct wined3d_cs *cs, struct wined3d_buffer *d { struct wined3d_cs_buffer_copy *op; @@ -480,7 +480,7 @@ index a656c93684a..b874b1f41f2 100644 op->opcode = WINED3D_CS_OP_BUFFER_COPY; op->dst_buffer = dst_buffer; op->dst_offset = dst_offset; -@@ -2418,7 +2418,7 @@ void wined3d_cs_emit_map_vertex_buffers(struct wined3d_cs *cs, UINT src_start_id +@@ -2417,7 +2417,7 @@ void wined3d_cs_emit_map_vertex_buffers(struct wined3d_cs *cs, UINT src_start_id { struct wined3d_cs_map_vertex_buffers *op; @@ -489,7 +489,7 @@ index a656c93684a..b874b1f41f2 100644 op->opcode = WINED3D_CS_OP_MAP_VERTEX_BUFFERS; op->src_start_idx = src_start_idx; op->stream_info = stream_info; -@@ -2483,7 +2483,7 @@ static UINT (* const wined3d_cs_op_handlers[])(struct wined3d_cs *cs, const void +@@ -2482,7 +2482,7 @@ static UINT (* const wined3d_cs_op_handlers[])(struct wined3d_cs *cs, const void /* WINED3D_CS_OP_MAP_VERTEX_BUFFERS */ wined3d_cs_exec_map_vertex_buffers, }; @@ -498,7 +498,7 @@ index a656c93684a..b874b1f41f2 100644 { if (size > (cs->data_size - cs->end)) { -@@ -2567,6 +2567,8 @@ static struct wined3d_cs_block *wined3d_cs_dequeue_command(struct wined3d_cs *cs +@@ -2566,6 +2566,8 @@ static struct wined3d_cs_block *wined3d_cs_dequeue_command(struct wined3d_cs *cs /* FIXME: Use an event to wait after a couple of spins. */ for (;;) { @@ -507,7 +507,7 @@ index a656c93684a..b874b1f41f2 100644 if ((block = wined3d_cs_list_dequeue(&cs->exec_list))) return block; } -@@ -2594,7 +2596,7 @@ static void wined3d_cs_list_cleanup(struct wined3d_cs_list *list) +@@ -2593,7 +2595,7 @@ static void wined3d_cs_list_cleanup(struct wined3d_cs_list *list) DeleteCriticalSection(&list->lock); } @@ -516,7 +516,7 @@ index a656c93684a..b874b1f41f2 100644 { struct wined3d_cs_block *block; -@@ -2608,26 +2610,28 @@ static struct wined3d_cs_block *wined3d_cs_get_block(struct wined3d_cs *cs) +@@ -2607,26 +2609,28 @@ static struct wined3d_cs_block *wined3d_cs_get_block(struct wined3d_cs *cs) } block->pos = 0; @@ -549,7 +549,7 @@ index a656c93684a..b874b1f41f2 100644 cs->current_block = block; } -@@ -2639,10 +2643,13 @@ static void *wined3d_cs_mt_require_space(struct wined3d_cs *cs, size_t size) +@@ -2638,10 +2642,13 @@ static void *wined3d_cs_mt_require_space(struct wined3d_cs *cs, size_t size) static void wined3d_cs_mt_submit(struct wined3d_cs *cs) { @@ -564,7 +564,7 @@ index a656c93684a..b874b1f41f2 100644 cs->current_block = NULL; } -@@ -2656,7 +2663,7 @@ static void wined3d_cs_mt_submit_and_wait(struct wined3d_cs *cs) +@@ -2655,7 +2662,7 @@ static void wined3d_cs_mt_submit_and_wait(struct wined3d_cs *cs) block = cs->current_block; block->fence = &fence; @@ -573,7 +573,7 @@ index a656c93684a..b874b1f41f2 100644 cs->current_block = NULL; /* A busy wait should be fine, we're not supposed to have to wait very -@@ -2678,7 +2685,7 @@ static void wined3d_cs_mt_emit_stop(struct wined3d_cs *cs) +@@ -2677,7 +2684,7 @@ static void wined3d_cs_mt_emit_stop(struct wined3d_cs *cs) assert(cs->thread_id != GetCurrentThreadId()); assert(cs->ops == &wined3d_cs_mt_ops); @@ -582,7 +582,7 @@ index a656c93684a..b874b1f41f2 100644 op->opcode = WINED3D_CS_OP_STOP; cs->ops->submit(cs); -@@ -2761,6 +2768,7 @@ struct wined3d_cs *wined3d_cs_create(struct wined3d_device *device) +@@ -2760,6 +2767,7 @@ struct wined3d_cs *wined3d_cs_create(struct wined3d_device *device) wined3d_cs_list_init(&cs->free_list); wined3d_cs_list_init(&cs->exec_list); @@ -590,7 +590,7 @@ index a656c93684a..b874b1f41f2 100644 if (!(cs->thread = CreateThread(NULL, 0, wined3d_cs_run, cs, 0, &cs->thread_id))) { -@@ -2785,6 +2793,7 @@ void wined3d_cs_destroy(struct wined3d_cs *cs) +@@ -2784,6 +2792,7 @@ void wined3d_cs_destroy(struct wined3d_cs *cs) WaitForSingleObject(cs->thread, INFINITE); CloseHandle(cs->thread); @@ -599,10 +599,10 @@ index a656c93684a..b874b1f41f2 100644 wined3d_cs_list_cleanup(&cs->free_list); } diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h -index 5962fa7ea19..43b3146f6f8 100644 +index 128e5be297e..22d4fde0ffa 100644 --- a/dlls/wined3d/wined3d_private.h +++ b/dlls/wined3d/wined3d_private.h -@@ -3217,13 +3217,14 @@ struct wined3d_cs_block +@@ -3219,13 +3219,14 @@ struct wined3d_cs_block { struct list entry; UINT pos; @@ -618,7 +618,7 @@ index 5962fa7ea19..43b3146f6f8 100644 void (*submit)(struct wined3d_cs *cs); void (*submit_and_wait)(struct wined3d_cs *cs); }; -@@ -3242,6 +3243,7 @@ struct wined3d_cs +@@ -3244,6 +3245,7 @@ struct wined3d_cs struct wined3d_cs_block *current_block; struct wined3d_cs_list free_list; struct wined3d_cs_list exec_list; diff --git a/patches/wined3d-CSMT_Main/0038-wined3d-Do-not-immediately-submit-stateblock-updates.patch b/patches/wined3d-CSMT_Main/0038-wined3d-Do-not-immediately-submit-stateblock-updates.patch index b9ff7895..41287b94 100644 --- a/patches/wined3d-CSMT_Main/0038-wined3d-Do-not-immediately-submit-stateblock-updates.patch +++ b/patches/wined3d-CSMT_Main/0038-wined3d-Do-not-immediately-submit-stateblock-updates.patch @@ -1,4 +1,4 @@ -From 622caa7589fb639f654b2b569925343412dc7bc6 Mon Sep 17 00:00:00 2001 +From 534625394e8964ca4b36c9319fde24d74887e6f6 Mon Sep 17 00:00:00 2001 From: Sebastian Lackner Date: Wed, 8 Feb 2017 12:32:55 +0100 Subject: wined3d: Do not immediately submit stateblock updates. @@ -9,7 +9,7 @@ Subject: wined3d: Do not immediately submit stateblock updates. 2 files changed, 37 insertions(+), 29 deletions(-) diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c -index 1d2d9d7b990..d37c9ce6d38 100644 +index 7c58e67901e..6f00fe64848 100644 --- a/dlls/wined3d/cs.c +++ b/dlls/wined3d/cs.c @@ -881,7 +881,7 @@ void wined3d_cs_emit_set_predication(struct wined3d_cs *cs, struct wined3d_query @@ -223,39 +223,12 @@ index 1d2d9d7b990..d37c9ce6d38 100644 op->opcode = WINED3D_CS_OP_SET_MATERIAL; op->material = *material; -- cs->ops->submit(cs); -+ cs->ops->submit_delayed(cs); - } - - static UINT wined3d_cs_exec_reset_state(struct wined3d_cs *cs, const void *data) -@@ -1653,7 +1653,7 @@ void wined3d_cs_emit_reset_state(struct wined3d_cs *cs) - op = cs->ops->require_space(cs, sizeof(*op), 0); - op->opcode = WINED3D_CS_OP_RESET_STATE; - -- cs->ops->submit(cs); -+ cs->ops->submit_delayed(cs); - } - - static UINT wined3d_cs_exec_callback(struct wined3d_cs *cs, const void *data) -@@ -1902,7 +1902,7 @@ void wined3d_cs_emit_push_constants(struct wined3d_cs *cs, enum wined3d_push_con - op->count = count; - memcpy(op->constants, constants, count * push_constant_info[p].size); - -- cs->ops->submit(cs); -+ cs->ops->submit_delayed(cs); - } - - static UINT wined3d_cs_exec_set_primitive_type(struct wined3d_cs *cs, const void *data) -@@ -1928,7 +1928,7 @@ void wined3d_cs_emit_set_primitive_type(struct wined3d_cs *cs, GLenum primitive_ - op->opcode = WINED3D_CS_OP_SET_PRIMITIVE_TYPE; - op->gl_primitive_type = primitive_type; - - cs->ops->submit(cs); + cs->ops->submit_delayed(cs); } static UINT wined3d_cs_exec_set_light(struct wined3d_cs *cs, const void *data) -@@ -1978,7 +1978,7 @@ void wined3d_cs_emit_set_light(struct wined3d_cs *cs, const struct wined3d_light +@@ -1679,7 +1679,7 @@ void wined3d_cs_emit_set_light(struct wined3d_cs *cs, const struct wined3d_light op->opcode = WINED3D_CS_OP_SET_LIGHT; op->light = *light; @@ -264,16 +237,43 @@ index 1d2d9d7b990..d37c9ce6d38 100644 } static UINT wined3d_cs_exec_set_light_enable(struct wined3d_cs *cs, const void *data) -@@ -2015,7 +2015,7 @@ void wined3d_cs_emit_set_light_enable(struct wined3d_cs *cs, UINT idx, BOOL enab +@@ -1715,7 +1715,7 @@ void wined3d_cs_emit_set_light_enable(struct wined3d_cs *cs, unsigned int idx, B op->idx = idx; op->enable = enable; +- cs->ops->submit(cs); ++ cs->ops->submit_delayed(cs); + } + + static UINT wined3d_cs_exec_reset_state(struct wined3d_cs *cs, const void *data) +@@ -1739,7 +1739,7 @@ void wined3d_cs_emit_reset_state(struct wined3d_cs *cs) + op = cs->ops->require_space(cs, sizeof(*op), 0); + op->opcode = WINED3D_CS_OP_RESET_STATE; + +- cs->ops->submit(cs); ++ cs->ops->submit_delayed(cs); + } + + static UINT wined3d_cs_exec_callback(struct wined3d_cs *cs, const void *data) +@@ -1988,7 +1988,7 @@ void wined3d_cs_emit_push_constants(struct wined3d_cs *cs, enum wined3d_push_con + op->count = count; + memcpy(op->constants, constants, count * push_constant_info[p].size); + +- cs->ops->submit(cs); ++ cs->ops->submit_delayed(cs); + } + + static UINT wined3d_cs_exec_set_primitive_type(struct wined3d_cs *cs, const void *data) +@@ -2014,7 +2014,7 @@ void wined3d_cs_emit_set_primitive_type(struct wined3d_cs *cs, GLenum primitive_ + op->opcode = WINED3D_CS_OP_SET_PRIMITIVE_TYPE; + op->gl_primitive_type = primitive_type; + - cs->ops->submit(cs); + cs->ops->submit_delayed(cs); } static UINT wined3d_cs_exec_blt(struct wined3d_cs *cs, const void *data) -@@ -2536,6 +2536,7 @@ static const struct wined3d_cs_ops wined3d_cs_st_ops = +@@ -2535,6 +2535,7 @@ static const struct wined3d_cs_ops wined3d_cs_st_ops = wined3d_cs_st_require_space, wined3d_cs_st_submit, wined3d_cs_st_submit, @@ -281,7 +281,7 @@ index 1d2d9d7b990..d37c9ce6d38 100644 }; static void wined3d_cs_list_enqueue(struct wined3d_cs_list *list, struct wined3d_cs_block *block) -@@ -2712,11 +2713,17 @@ static void wined3d_cs_mt_submit_and_wait(struct wined3d_cs *cs) +@@ -2711,11 +2712,17 @@ static void wined3d_cs_mt_submit_and_wait(struct wined3d_cs *cs) while (!InterlockedCompareExchange(&fence, TRUE, TRUE)); } @@ -300,10 +300,10 @@ index 1d2d9d7b990..d37c9ce6d38 100644 static void wined3d_cs_mt_emit_stop(struct wined3d_cs *cs) diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h -index 10a7b4a8660..62f6ad52457 100644 +index 6ed9ec6f557..b9db6e880b7 100644 --- a/dlls/wined3d/wined3d_private.h +++ b/dlls/wined3d/wined3d_private.h -@@ -3228,6 +3228,7 @@ struct wined3d_cs_ops +@@ -3230,6 +3230,7 @@ struct wined3d_cs_ops void *(*require_space)(struct wined3d_cs *cs, size_t size, int priority); void (*submit)(struct wined3d_cs *cs); void (*submit_and_wait)(struct wined3d_cs *cs); diff --git a/patches/wined3d-CSMT_Main/9999-IfDefined.patch b/patches/wined3d-CSMT_Main/9999-IfDefined.patch index 89a2fd27..bd46e966 100644 --- a/patches/wined3d-CSMT_Main/9999-IfDefined.patch +++ b/patches/wined3d-CSMT_Main/9999-IfDefined.patch @@ -292,7 +292,7 @@ diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c WINED3D_CS_OP_PRESENT, WINED3D_CS_OP_CLEAR, WINED3D_CS_OP_DISPATCH, -@@ -57,10 +64,41 @@ enum wined3d_cs_op +@@ -59,10 +66,39 @@ enum wined3d_cs_op WINED3D_CS_OP_RESET_STATE, WINED3D_CS_OP_CALLBACK, WINED3D_CS_OP_QUERY_ISSUE, @@ -306,8 +306,6 @@ diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c +#if defined(STAGING_CSMT) + WINED3D_CS_OP_PUSH_CONSTANTS, + WINED3D_CS_OP_SET_PRIMITIVE_TYPE, -+ WINED3D_CS_OP_SET_LIGHT, -+ WINED3D_CS_OP_SET_LIGHT_ENABLE, + WINED3D_CS_OP_BLT, + WINED3D_CS_OP_CLEAR_RTV, + WINED3D_CS_OP_UPDATE_TEXTURE, @@ -334,7 +332,7 @@ diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c }; struct wined3d_cs_present -@@ -297,6 +335,16 @@ struct wined3d_cs_query_issue +@@ -312,6 +348,16 @@ struct wined3d_cs_query_issue DWORD flags; }; @@ -351,7 +349,7 @@ diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c struct wined3d_cs_preload_resource { enum wined3d_cs_op opcode; -@@ -328,7 +376,166 @@ struct wined3d_cs_unmap +@@ -343,7 +389,153 @@ struct wined3d_cs_unmap HRESULT *hr; }; @@ -373,19 +371,6 @@ diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c + GLenum gl_primitive_type; +}; + -+struct wined3d_cs_set_light -+{ -+ enum wined3d_cs_op opcode; -+ struct wined3d_light_info light; -+}; -+ -+struct wined3d_cs_set_light_enable -+{ -+ enum wined3d_cs_op opcode; -+ UINT idx; -+ BOOL enable; -+}; -+ +struct wined3d_cs_blt +{ + enum wined3d_cs_op opcode; @@ -518,7 +503,7 @@ diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c { const struct wined3d_cs_present *op = data; struct wined3d_swapchain *swapchain; -@@ -337,13 +544,24 @@ static void wined3d_cs_exec_present(struct wined3d_cs *cs, const void *data) +@@ -352,13 +544,24 @@ static void wined3d_cs_exec_present(struct wined3d_cs *cs, const void *data) swapchain = op->swapchain; wined3d_swapchain_set_window(swapchain, op->dst_window_override); @@ -543,7 +528,7 @@ diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c } void wined3d_cs_emit_present(struct wined3d_cs *cs, struct wined3d_swapchain *swapchain, -@@ -351,8 +569,14 @@ void wined3d_cs_emit_present(struct wined3d_cs *cs, struct wined3d_swapchain *sw +@@ -366,8 +569,14 @@ void wined3d_cs_emit_present(struct wined3d_cs *cs, struct wined3d_swapchain *sw { struct wined3d_cs_present *op; unsigned int i; @@ -558,7 +543,7 @@ diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c op->opcode = WINED3D_CS_OP_PRESENT; op->dst_window_override = dst_window_override; op->swapchain = swapchain; -@@ -366,34 +590,75 @@ void wined3d_cs_emit_present(struct wined3d_cs *cs, struct wined3d_swapchain *sw +@@ -381,34 +590,75 @@ void wined3d_cs_emit_present(struct wined3d_cs *cs, struct wined3d_swapchain *sw wined3d_resource_acquire(&swapchain->back_buffers[i]->resource); } @@ -634,7 +619,7 @@ diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c } void wined3d_cs_emit_clear(struct wined3d_cs *cs, DWORD rect_count, const RECT *rects, -@@ -403,7 +668,11 @@ void wined3d_cs_emit_clear(struct wined3d_cs *cs, DWORD rect_count, const RECT * +@@ -418,7 +668,11 @@ void wined3d_cs_emit_clear(struct wined3d_cs *cs, DWORD rect_count, const RECT * struct wined3d_cs_clear *op; unsigned int i; @@ -646,7 +631,7 @@ diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c op->opcode = WINED3D_CS_OP_CLEAR; op->flags = flags; op->color = *color; -@@ -416,12 +685,21 @@ void wined3d_cs_emit_clear(struct wined3d_cs *cs, DWORD rect_count, const RECT * +@@ -431,12 +685,21 @@ void wined3d_cs_emit_clear(struct wined3d_cs *cs, DWORD rect_count, const RECT * { for (i = 0; i < cs->device->adapter->gl_info.limits.buffers; ++i) { @@ -668,7 +653,7 @@ diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c cs->ops->submit(cs); } -@@ -532,9 +810,15 @@ static void release_unordered_access_resources(const struct wined3d_shader *shad +@@ -547,9 +810,15 @@ static void release_unordered_access_resources(const struct wined3d_shader *shad } } @@ -684,7 +669,7 @@ diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c const struct wined3d_cs_dispatch *op = data; dispatch_compute(cs->device, state, -@@ -543,6 +827,10 @@ static void wined3d_cs_exec_dispatch(struct wined3d_cs *cs, const void *data) +@@ -558,6 +827,10 @@ static void wined3d_cs_exec_dispatch(struct wined3d_cs *cs, const void *data) release_shader_resources(state, 1u << WINED3D_SHADER_TYPE_COMPUTE); release_unordered_access_resources(state->shader[WINED3D_SHADER_TYPE_COMPUTE], state->unordered_access_view[WINED3D_PIPELINE_COMPUTE]); @@ -695,7 +680,7 @@ diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c } void wined3d_cs_emit_dispatch(struct wined3d_cs *cs, -@@ -551,7 +839,11 @@ void wined3d_cs_emit_dispatch(struct wined3d_cs *cs, +@@ -566,7 +839,11 @@ void wined3d_cs_emit_dispatch(struct wined3d_cs *cs, const struct wined3d_state *state = &cs->device->state; struct wined3d_cs_dispatch *op; @@ -707,7 +692,7 @@ diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c op->opcode = WINED3D_CS_OP_DISPATCH; op->group_count_x = group_count_x; op->group_count_y = group_count_y; -@@ -564,9 +856,15 @@ void wined3d_cs_emit_dispatch(struct wined3d_cs *cs, +@@ -579,9 +856,15 @@ void wined3d_cs_emit_dispatch(struct wined3d_cs *cs, cs->ops->submit(cs); } @@ -723,7 +708,7 @@ diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c const struct wined3d_cs_draw *op = data; unsigned int i; -@@ -594,14 +892,26 @@ static void wined3d_cs_exec_draw(struct wined3d_cs *cs, const void *data) +@@ -609,14 +892,26 @@ static void wined3d_cs_exec_draw(struct wined3d_cs *cs, const void *data) } for (i = 0; i < cs->device->adapter->gl_info.limits.buffers; ++i) { @@ -750,7 +735,7 @@ diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c } void wined3d_cs_emit_draw(struct wined3d_cs *cs, int base_vertex_idx, unsigned int start_idx, -@@ -611,7 +921,11 @@ void wined3d_cs_emit_draw(struct wined3d_cs *cs, int base_vertex_idx, unsigned i +@@ -626,7 +921,11 @@ void wined3d_cs_emit_draw(struct wined3d_cs *cs, int base_vertex_idx, unsigned i struct wined3d_cs_draw *op; unsigned int i; @@ -762,7 +747,7 @@ diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c op->opcode = WINED3D_CS_OP_DRAW; op->base_vertex_idx = base_vertex_idx; op->start_idx = start_idx; -@@ -634,11 +948,19 @@ void wined3d_cs_emit_draw(struct wined3d_cs *cs, int base_vertex_idx, unsigned i +@@ -649,11 +948,19 @@ void wined3d_cs_emit_draw(struct wined3d_cs *cs, int base_vertex_idx, unsigned i } for (i = 0; i < cs->device->adapter->gl_info.limits.buffers; ++i) { @@ -782,7 +767,7 @@ diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c acquire_shader_resources(state, ~(1u << WINED3D_SHADER_TYPE_COMPUTE)); acquire_unordered_access_resources(state->shader[WINED3D_SHADER_TYPE_PIXEL], state->unordered_access_view[WINED3D_PIPELINE_GRAPHICS]); -@@ -646,70 +968,126 @@ void wined3d_cs_emit_draw(struct wined3d_cs *cs, int base_vertex_idx, unsigned i +@@ -661,70 +968,126 @@ void wined3d_cs_emit_draw(struct wined3d_cs *cs, int base_vertex_idx, unsigned i cs->ops->submit(cs); } @@ -909,7 +894,7 @@ diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c } void wined3d_cs_emit_set_rendertarget_view(struct wined3d_cs *cs, unsigned int view_idx, -@@ -717,21 +1095,36 @@ void wined3d_cs_emit_set_rendertarget_view(struct wined3d_cs *cs, unsigned int v +@@ -732,21 +1095,36 @@ void wined3d_cs_emit_set_rendertarget_view(struct wined3d_cs *cs, unsigned int v { struct wined3d_cs_set_rendertarget_view *op; @@ -946,7 +931,7 @@ diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c { struct wined3d_surface *prev_surface = wined3d_rendertarget_view_get_surface(prev); -@@ -743,7 +1136,11 @@ static void wined3d_cs_exec_set_depth_stencil_view(struct wined3d_cs *cs, const +@@ -758,7 +1136,11 @@ static void wined3d_cs_exec_set_depth_stencil_view(struct wined3d_cs *cs, const } } @@ -958,7 +943,7 @@ diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c if (!prev != !op->view) { -@@ -760,39 +1157,69 @@ static void wined3d_cs_exec_set_depth_stencil_view(struct wined3d_cs *cs, const +@@ -775,39 +1157,69 @@ static void wined3d_cs_exec_set_depth_stencil_view(struct wined3d_cs *cs, const } device_invalidate_state(device, STATE_FRAMEBUFFER); @@ -1028,7 +1013,7 @@ diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c { const struct wined3d_cs_set_stream_source *op = data; struct wined3d_stream_state *stream; -@@ -810,6 +1237,10 @@ static void wined3d_cs_exec_set_stream_source(struct wined3d_cs *cs, const void +@@ -825,6 +1237,10 @@ static void wined3d_cs_exec_set_stream_source(struct wined3d_cs *cs, const void InterlockedDecrement(&prev->resource.bind_count); device_invalidate_state(cs->device, STATE_STREAMSRC); @@ -1039,7 +1024,7 @@ diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c } void wined3d_cs_emit_set_stream_source(struct wined3d_cs *cs, UINT stream_idx, -@@ -817,17 +1248,28 @@ void wined3d_cs_emit_set_stream_source(struct wined3d_cs *cs, UINT stream_idx, +@@ -832,17 +1248,28 @@ void wined3d_cs_emit_set_stream_source(struct wined3d_cs *cs, UINT stream_idx, { struct wined3d_cs_set_stream_source *op; @@ -1068,7 +1053,7 @@ diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c { const struct wined3d_cs_set_stream_source_freq *op = data; struct wined3d_stream_state *stream; -@@ -837,22 +1279,37 @@ static void wined3d_cs_exec_set_stream_source_freq(struct wined3d_cs *cs, const +@@ -852,22 +1279,37 @@ static void wined3d_cs_exec_set_stream_source_freq(struct wined3d_cs *cs, const stream->flags = op->flags; device_invalidate_state(cs->device, STATE_STREAMSRC); @@ -1106,7 +1091,7 @@ diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c { const struct wined3d_cs_set_stream_output *op = data; struct wined3d_stream_output *stream; -@@ -867,6 +1324,10 @@ static void wined3d_cs_exec_set_stream_output(struct wined3d_cs *cs, const void +@@ -882,6 +1324,10 @@ static void wined3d_cs_exec_set_stream_output(struct wined3d_cs *cs, const void InterlockedIncrement(&op->buffer->resource.bind_count); if (prev) InterlockedDecrement(&prev->resource.bind_count); @@ -1117,7 +1102,7 @@ diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c } void wined3d_cs_emit_set_stream_output(struct wined3d_cs *cs, UINT stream_idx, -@@ -874,16 +1335,27 @@ void wined3d_cs_emit_set_stream_output(struct wined3d_cs *cs, UINT stream_idx, +@@ -889,16 +1335,27 @@ void wined3d_cs_emit_set_stream_output(struct wined3d_cs *cs, UINT stream_idx, { struct wined3d_cs_set_stream_output *op; @@ -1145,7 +1130,7 @@ diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c { const struct wined3d_cs_set_index_buffer *op = data; struct wined3d_buffer *prev; -@@ -899,6 +1371,10 @@ static void wined3d_cs_exec_set_index_buffer(struct wined3d_cs *cs, const void * +@@ -914,6 +1371,10 @@ static void wined3d_cs_exec_set_index_buffer(struct wined3d_cs *cs, const void * InterlockedDecrement(&prev->resource.bind_count); device_invalidate_state(cs->device, STATE_INDEXBUFFER); @@ -1156,7 +1141,7 @@ diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c } void wined3d_cs_emit_set_index_buffer(struct wined3d_cs *cs, struct wined3d_buffer *buffer, -@@ -906,16 +1382,27 @@ void wined3d_cs_emit_set_index_buffer(struct wined3d_cs *cs, struct wined3d_buff +@@ -921,16 +1382,27 @@ void wined3d_cs_emit_set_index_buffer(struct wined3d_cs *cs, struct wined3d_buff { struct wined3d_cs_set_index_buffer *op; @@ -1184,7 +1169,7 @@ diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c { const struct wined3d_cs_set_constant_buffer *op = data; struct wined3d_buffer *prev; -@@ -929,6 +1416,9 @@ static void wined3d_cs_exec_set_constant_buffer(struct wined3d_cs *cs, const voi +@@ -944,6 +1416,9 @@ static void wined3d_cs_exec_set_constant_buffer(struct wined3d_cs *cs, const voi InterlockedDecrement(&prev->resource.bind_count); device_invalidate_state(cs->device, STATE_CONSTANT_BUFFER(op->type)); @@ -1194,7 +1179,7 @@ diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c } void wined3d_cs_emit_set_constant_buffer(struct wined3d_cs *cs, enum wined3d_shader_type type, -@@ -936,16 +1426,27 @@ void wined3d_cs_emit_set_constant_buffer(struct wined3d_cs *cs, enum wined3d_sha +@@ -951,16 +1426,27 @@ void wined3d_cs_emit_set_constant_buffer(struct wined3d_cs *cs, enum wined3d_sha { struct wined3d_cs_set_constant_buffer *op; @@ -1222,7 +1207,7 @@ diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c { const struct wined3d_gl_info *gl_info = &cs->device->adapter->gl_info; const struct wined3d_d3d_info *d3d_info = &cs->device->adapter->d3d_info; -@@ -1022,21 +1523,36 @@ static void wined3d_cs_exec_set_texture(struct wined3d_cs *cs, const void *data) +@@ -1037,21 +1523,36 @@ static void wined3d_cs_exec_set_texture(struct wined3d_cs *cs, const void *data) if (new_use_color_key) device_invalidate_state(cs->device, STATE_COLOR_KEY); @@ -1259,7 +1244,7 @@ diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c { const struct wined3d_cs_set_shader_resource_view *op = data; struct wined3d_shader_resource_view *prev; -@@ -1051,6 +1567,10 @@ static void wined3d_cs_exec_set_shader_resource_view(struct wined3d_cs *cs, cons +@@ -1066,6 +1567,10 @@ static void wined3d_cs_exec_set_shader_resource_view(struct wined3d_cs *cs, cons if (op->type != WINED3D_SHADER_TYPE_COMPUTE) device_invalidate_state(cs->device, STATE_SHADER_RESOURCE_BINDING); @@ -1270,7 +1255,7 @@ diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c } void wined3d_cs_emit_set_shader_resource_view(struct wined3d_cs *cs, enum wined3d_shader_type type, -@@ -1058,16 +1578,27 @@ void wined3d_cs_emit_set_shader_resource_view(struct wined3d_cs *cs, enum wined3 +@@ -1073,16 +1578,27 @@ void wined3d_cs_emit_set_shader_resource_view(struct wined3d_cs *cs, enum wined3 { struct wined3d_cs_set_shader_resource_view *op; @@ -1298,7 +1283,7 @@ diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c { const struct wined3d_cs_set_unordered_access_view *op = data; struct wined3d_unordered_access_view *prev; -@@ -1081,6 +1612,10 @@ static void wined3d_cs_exec_set_unordered_access_view(struct wined3d_cs *cs, con +@@ -1096,6 +1612,10 @@ static void wined3d_cs_exec_set_unordered_access_view(struct wined3d_cs *cs, con InterlockedDecrement(&prev->resource->bind_count); device_invalidate_state(cs->device, STATE_UNORDERED_ACCESS_VIEW_BINDING(op->pipeline)); @@ -1309,7 +1294,7 @@ diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c } void wined3d_cs_emit_set_unordered_access_view(struct wined3d_cs *cs, enum wined3d_pipeline pipeline, -@@ -1088,21 +1623,36 @@ void wined3d_cs_emit_set_unordered_access_view(struct wined3d_cs *cs, enum wined +@@ -1103,21 +1623,36 @@ void wined3d_cs_emit_set_unordered_access_view(struct wined3d_cs *cs, enum wined { struct wined3d_cs_set_unordered_access_view *op; @@ -1346,7 +1331,7 @@ diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c } void wined3d_cs_emit_set_sampler(struct wined3d_cs *cs, enum wined3d_shader_type type, -@@ -1110,16 +1660,27 @@ void wined3d_cs_emit_set_sampler(struct wined3d_cs *cs, enum wined3d_shader_type +@@ -1125,16 +1660,27 @@ void wined3d_cs_emit_set_sampler(struct wined3d_cs *cs, enum wined3d_shader_type { struct wined3d_cs_set_sampler *op; @@ -1374,7 +1359,7 @@ diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c { const struct wined3d_cs_set_shader *op = data; -@@ -1127,26 +1688,45 @@ static void wined3d_cs_exec_set_shader(struct wined3d_cs *cs, const void *data) +@@ -1142,26 +1688,45 @@ static void wined3d_cs_exec_set_shader(struct wined3d_cs *cs, const void *data) device_invalidate_state(cs->device, STATE_SHADER(op->type)); if (op->type != WINED3D_SHADER_TYPE_COMPUTE) device_invalidate_state(cs->device, STATE_SHADER_RESOURCE_BINDING); @@ -1420,7 +1405,7 @@ diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c } void wined3d_cs_emit_set_rasterizer_state(struct wined3d_cs *cs, -@@ -1154,39 +1734,69 @@ void wined3d_cs_emit_set_rasterizer_state(struct wined3d_cs *cs, +@@ -1169,39 +1734,69 @@ void wined3d_cs_emit_set_rasterizer_state(struct wined3d_cs *cs, { struct wined3d_cs_set_rasterizer_state *op; @@ -1490,7 +1475,7 @@ diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c } void wined3d_cs_emit_set_texture_state(struct wined3d_cs *cs, UINT stage, -@@ -1194,21 +1804,36 @@ void wined3d_cs_emit_set_texture_state(struct wined3d_cs *cs, UINT stage, +@@ -1209,21 +1804,36 @@ void wined3d_cs_emit_set_texture_state(struct wined3d_cs *cs, UINT stage, { struct wined3d_cs_set_texture_state *op; @@ -1527,7 +1512,7 @@ diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c } void wined3d_cs_emit_set_sampler_state(struct wined3d_cs *cs, UINT sampler_idx, -@@ -1216,22 +1841,37 @@ void wined3d_cs_emit_set_sampler_state(struct wined3d_cs *cs, UINT sampler_idx, +@@ -1231,22 +1841,37 @@ void wined3d_cs_emit_set_sampler_state(struct wined3d_cs *cs, UINT sampler_idx, { struct wined3d_cs_set_sampler_state *op; @@ -1565,7 +1550,7 @@ diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c } void wined3d_cs_emit_set_transform(struct wined3d_cs *cs, enum wined3d_transform_state state, -@@ -1239,35 +1879,61 @@ void wined3d_cs_emit_set_transform(struct wined3d_cs *cs, enum wined3d_transform +@@ -1254,35 +1879,61 @@ void wined3d_cs_emit_set_transform(struct wined3d_cs *cs, enum wined3d_transform { struct wined3d_cs_set_transform *op; @@ -1627,7 +1612,7 @@ diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c { const struct wined3d_cs_set_color_key *op = data; struct wined3d_texture *texture = op->texture; -@@ -1328,6 +1994,10 @@ static void wined3d_cs_exec_set_color_key(struct wined3d_cs *cs, const void *dat +@@ -1343,6 +1994,10 @@ static void wined3d_cs_exec_set_color_key(struct wined3d_cs *cs, const void *dat break; } } @@ -1638,7 +1623,7 @@ diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c } void wined3d_cs_emit_set_color_key(struct wined3d_cs *cs, struct wined3d_texture *texture, -@@ -1335,7 +2005,11 @@ void wined3d_cs_emit_set_color_key(struct wined3d_cs *cs, struct wined3d_texture +@@ -1350,7 +2005,11 @@ void wined3d_cs_emit_set_color_key(struct wined3d_cs *cs, struct wined3d_texture { struct wined3d_cs_set_color_key *op; @@ -1650,7 +1635,7 @@ diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c op->opcode = WINED3D_CS_OP_SET_COLOR_KEY; op->texture = texture; op->flags = flags; -@@ -1347,42 +2021,76 @@ void wined3d_cs_emit_set_color_key(struct wined3d_cs *cs, struct wined3d_texture +@@ -1362,29 +2021,51 @@ void wined3d_cs_emit_set_color_key(struct wined3d_cs *cs, struct wined3d_texture else op->set = 0; @@ -1688,6 +1673,103 @@ diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c op->opcode = WINED3D_CS_OP_SET_MATERIAL; op->material = *material; ++#if !defined(STAGING_CSMT) + cs->ops->submit(cs); + } + + static void wined3d_cs_exec_set_light(struct wined3d_cs *cs, const void *data) ++#else /* STAGING_CSMT */ ++ cs->ops->submit_delayed(cs); ++} ++ ++static UINT wined3d_cs_exec_set_light(struct wined3d_cs *cs, const void *data) ++#endif /* STAGING_CSMT */ + { + const struct wined3d_cs_set_light *op = data; + struct wined3d_light_info *light_info; +@@ -1398,7 +2079,11 @@ static void wined3d_cs_exec_set_light(struct wined3d_cs *cs, const void *data) + if (!(light_info = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(*light_info)))) + { + ERR("Failed to allocate light info.\n"); ++#if !defined(STAGING_CSMT) + return; ++#else /* STAGING_CSMT */ ++ return sizeof(*op);; ++#endif /* STAGING_CSMT */ + } + + hash_idx = LIGHTMAP_HASHFUNC(light_idx); +@@ -1419,20 +2104,35 @@ static void wined3d_cs_exec_set_light(struct wined3d_cs *cs, const void *data) + light_info->direction = op->light.direction; + light_info->exponent = op->light.exponent; + light_info->cutoff = op->light.cutoff; ++#if defined(STAGING_CSMT) ++ ++ return sizeof(*op); ++#endif /* STAGING_CSMT */ + } + + void wined3d_cs_emit_set_light(struct wined3d_cs *cs, const struct wined3d_light_info *light) + { + struct wined3d_cs_set_light *op; + ++#if !defined(STAGING_CSMT) + op = cs->ops->require_space(cs, sizeof(*op)); ++#else /* STAGING_CSMT */ ++ op = cs->ops->require_space(cs, sizeof(*op), 0); ++#endif /* STAGING_CSMT */ + op->opcode = WINED3D_CS_OP_SET_LIGHT; + op->light = *light; + ++#if !defined(STAGING_CSMT) + cs->ops->submit(cs); + } + + static void wined3d_cs_exec_set_light_enable(struct wined3d_cs *cs, const void *data) ++#else /* STAGING_CSMT */ ++ cs->ops->submit_delayed(cs); ++} ++ ++static UINT wined3d_cs_exec_set_light_enable(struct wined3d_cs *cs, const void *data) ++#endif /* STAGING_CSMT */ + { + const struct wined3d_cs_set_light_enable *op = data; + struct wined3d_device *device = cs->device; +@@ -1442,7 +2142,11 @@ static void wined3d_cs_exec_set_light_enable(struct wined3d_cs *cs, const void * + if (!(light_info = wined3d_state_get_light(&cs->state, op->idx))) + { + ERR("Light doesn't exist.\n"); ++#if !defined(STAGING_CSMT) + return; ++#else /* STAGING_CSMT */ ++ return sizeof(*op); ++#endif /* STAGING_CSMT */ + } + + prev_idx = light_info->glIndex; +@@ -1452,34 +2156,61 @@ static void wined3d_cs_exec_set_light_enable(struct wined3d_cs *cs, const void * + device_invalidate_state(device, STATE_LIGHT_TYPE); + device_invalidate_state(device, STATE_ACTIVELIGHT(op->enable ? light_info->glIndex : prev_idx)); + } ++#if defined(STAGING_CSMT) ++ ++ return sizeof(*op); ++#endif /* STAGING_CSMT */ + } + + void wined3d_cs_emit_set_light_enable(struct wined3d_cs *cs, unsigned int idx, BOOL enable) + { + struct wined3d_cs_set_light_enable *op; + ++#if !defined(STAGING_CSMT) + op = cs->ops->require_space(cs, sizeof(*op)); ++#else /* STAGING_CSMT */ ++ op = cs->ops->require_space(cs, sizeof(*op), 0); ++#endif /* STAGING_CSMT */ + op->opcode = WINED3D_CS_OP_SET_LIGHT_ENABLE; + op->idx = idx; + op->enable = enable; + +#if !defined(STAGING_CSMT) cs->ops->submit(cs); } @@ -1727,7 +1809,7 @@ diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c op = cs->ops->require_space(cs, sizeof(*op)); op->opcode = WINED3D_CS_OP_RESET_STATE; -@@ -1390,17 +2098,34 @@ void wined3d_cs_emit_reset_state(struct wined3d_cs *cs) +@@ -1487,17 +2218,34 @@ void wined3d_cs_emit_reset_state(struct wined3d_cs *cs) } static void wined3d_cs_exec_callback(struct wined3d_cs *cs, const void *data) @@ -1762,7 +1844,7 @@ diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c op->opcode = WINED3D_CS_OP_CALLBACK; op->callback = callback; op->object = object; -@@ -1418,40 +2143,103 @@ void wined3d_cs_init_object(struct wined3d_cs *cs, void (*callback)(void *object +@@ -1515,40 +2263,103 @@ void wined3d_cs_init_object(struct wined3d_cs *cs, void (*callback)(void *object wined3d_cs_emit_callback(cs, callback, object); } @@ -1775,12 +1857,12 @@ diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c const struct wined3d_cs_query_issue *op = data; struct wined3d_query *query = op->query; +#if !defined(STAGING_CSMT) - - query->query_ops->query_issue(query, op->flags); -+#else /* STAGING_CSMT */ -+ struct wined3d_context *context; + + query->query_ops->query_issue(query, op->flags); ++#else /* STAGING_CSMT */ ++ struct wined3d_context *context; + + query->query_ops->query_issue(query, op->flags); + + InterlockedDecrement(&query->pending); + @@ -1866,7 +1948,7 @@ diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c op->opcode = WINED3D_CS_OP_PRELOAD_RESOURCE; op->resource = resource; -@@ -1460,20 +2248,32 @@ void wined3d_cs_emit_preload_resource(struct wined3d_cs *cs, struct wined3d_reso +@@ -1557,20 +2368,32 @@ void wined3d_cs_emit_preload_resource(struct wined3d_cs *cs, struct wined3d_reso cs->ops->submit(cs); } @@ -1899,7 +1981,7 @@ diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c op->opcode = WINED3D_CS_OP_UNLOAD_RESOURCE; op->resource = resource; -@@ -1482,13 +2282,21 @@ void wined3d_cs_emit_unload_resource(struct wined3d_cs *cs, struct wined3d_resou +@@ -1579,13 +2402,21 @@ void wined3d_cs_emit_unload_resource(struct wined3d_cs *cs, struct wined3d_resou cs->ops->submit(cs); } @@ -1921,7 +2003,7 @@ diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c } HRESULT wined3d_cs_map(struct wined3d_cs *cs, struct wined3d_resource *resource, unsigned int sub_resource_idx, -@@ -1497,7 +2305,11 @@ HRESULT wined3d_cs_map(struct wined3d_cs *cs, struct wined3d_resource *resource, +@@ -1594,7 +2425,11 @@ HRESULT wined3d_cs_map(struct wined3d_cs *cs, struct wined3d_resource *resource, struct wined3d_cs_map *op; HRESULT hr; @@ -1933,7 +2015,7 @@ diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c op->opcode = WINED3D_CS_OP_MAP; op->resource = resource; op->sub_resource_idx = sub_resource_idx; -@@ -1506,17 +2318,29 @@ HRESULT wined3d_cs_map(struct wined3d_cs *cs, struct wined3d_resource *resource, +@@ -1603,17 +2438,29 @@ HRESULT wined3d_cs_map(struct wined3d_cs *cs, struct wined3d_resource *resource, op->flags = flags; op->hr = &hr; @@ -1963,7 +2045,7 @@ diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c } HRESULT wined3d_cs_unmap(struct wined3d_cs *cs, struct wined3d_resource *resource, unsigned int sub_resource_idx) -@@ -1524,19 +2348,691 @@ HRESULT wined3d_cs_unmap(struct wined3d_cs *cs, struct wined3d_resource *resourc +@@ -1621,19 +2468,604 @@ HRESULT wined3d_cs_unmap(struct wined3d_cs *cs, struct wined3d_resource *resourc struct wined3d_cs_unmap *op; HRESULT hr; @@ -1978,13 +2060,13 @@ diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c op->hr = &hr; +#if !defined(STAGING_CSMT) - cs->ops->submit(cs); ++ cs->ops->submit(cs); +#else /* STAGING_CSMT */ + cs->ops->submit_and_wait(cs); - - return hr; - } - ++ ++ return hr; ++} ++ +static const struct +{ + size_t offset; @@ -2072,93 +2154,6 @@ diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c + cs->ops->submit_delayed(cs); +} + -+static UINT wined3d_cs_exec_set_light(struct wined3d_cs *cs, const void *data) -+{ -+ const struct wined3d_cs_set_light *op = data; -+ UINT light_idx = op->light.OriginalIndex; -+ UINT hash_idx = LIGHTMAP_HASHFUNC(op->light.OriginalIndex); -+ struct wined3d_light_info *object; -+ -+ if (!(object = wined3d_state_get_light(&cs->state, light_idx))) -+ { -+ TRACE("Adding new light\n"); -+ object = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(*object)); -+ if (!object) -+ { -+ ERR("Out of memory!\n"); -+ return sizeof(*op); -+ } -+ -+ list_add_head(&cs->state.light_map[hash_idx], &object->entry); -+ object->glIndex = -1; -+ object->OriginalIndex = light_idx; -+ } -+ -+ /* Update the live definitions if the light is currently assigned a glIndex. */ -+ if (object->glIndex != -1) -+ { -+ if (object->OriginalParms.type != op->light.OriginalParms.type) -+ device_invalidate_state(cs->device, STATE_LIGHT_TYPE); -+ device_invalidate_state(cs->device, STATE_ACTIVELIGHT(object->glIndex)); -+ } -+ -+ object->OriginalParms = op->light.OriginalParms; -+ object->position = op->light.position; -+ object->direction = op->light.direction; -+ object->exponent = op->light.exponent; -+ object->cutoff = op->light.cutoff; -+ -+ return sizeof(*op); -+} -+ -+void wined3d_cs_emit_set_light(struct wined3d_cs *cs, const struct wined3d_light_info *light) -+{ -+ struct wined3d_cs_set_light *op; -+ -+ op = cs->ops->require_space(cs, sizeof(*op), 0); -+ op->opcode = WINED3D_CS_OP_SET_LIGHT; -+ op->light = *light; -+ -+ cs->ops->submit_delayed(cs); -+} -+ -+static UINT wined3d_cs_exec_set_light_enable(struct wined3d_cs *cs, const void *data) -+{ -+ const struct wined3d_cs_set_light_enable *op = data; -+ struct wined3d_light_info *light_info; -+ struct wined3d_device *device = cs->device; -+ int prev_idx; -+ -+ /* Should be handled by the device by emitting a set_light op */ -+ if (!(light_info = wined3d_state_get_light(&cs->state, op->idx))) -+ { -+ ERR("Light enabled requested but light not defined in cs state!\n"); -+ return sizeof(*op); -+ } -+ -+ prev_idx = light_info->glIndex; -+ wined3d_state_enable_light(&cs->state, &device->adapter->d3d_info, light_info, op->enable); -+ if (light_info->glIndex != prev_idx) -+ { -+ device_invalidate_state(device, STATE_LIGHT_TYPE); -+ device_invalidate_state(device, STATE_ACTIVELIGHT(op->enable ? light_info->glIndex : prev_idx)); -+ } -+ -+ return sizeof(*op); -+} -+ -+void wined3d_cs_emit_set_light_enable(struct wined3d_cs *cs, UINT idx, BOOL enable) -+{ -+ struct wined3d_cs_set_light_enable *op; -+ -+ op = cs->ops->require_space(cs, sizeof(*op), 0); -+ op->opcode = WINED3D_CS_OP_SET_LIGHT_ENABLE; -+ op->idx = idx; -+ op->enable = enable; -+ -+ cs->ops->submit_delayed(cs); -+} -+ +static UINT wined3d_cs_exec_blt(struct wined3d_cs *cs, const void *data) +{ + const struct wined3d_cs_blt *op = data; @@ -2233,7 +2228,7 @@ diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c + + wined3d_resource_acquire(view->resource); + -+ cs->ops->submit(cs); + cs->ops->submit(cs); +} + +static UINT wined3d_cs_exec_update_texture(struct wined3d_cs *cs, const void *data) @@ -2455,15 +2450,10 @@ diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c + op->hr = &hr; + + cs->ops->submit_and_wait(cs); -+#endif /* STAGING_CSMT */ -+ -+ return hr; -+} -+ -+#if !defined(STAGING_CSMT) - static void (* const wined3d_cs_op_handlers[])(struct wined3d_cs *cs, const void *data) = - { -+#else /* STAGING_CSMT */ + + return hr; + } + +static UINT wined3d_cs_exec_create_swapchain_context(struct wined3d_cs *cs, const void *data) +{ + const struct wined3d_cs_create_swapchain_context *op = data; @@ -2484,10 +2474,15 @@ diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c + op->hr = &hr; + + cs->ops->submit_and_wait(cs); ++#endif /* STAGING_CSMT */ + + return hr; +} + ++#if !defined(STAGING_CSMT) + static void (* const wined3d_cs_op_handlers[])(struct wined3d_cs *cs, const void *data) = + { ++#else /* STAGING_CSMT */ +static UINT wined3d_cs_exec_update_swap_interval(struct wined3d_cs *cs, const void *data) +{ + const struct wined3d_cs_update_swap_interval *op = data; @@ -2655,7 +2650,7 @@ diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c /* WINED3D_CS_OP_PRESENT */ wined3d_cs_exec_present, /* WINED3D_CS_OP_CLEAR */ wined3d_cs_exec_clear, /* WINED3D_CS_OP_DISPATCH */ wined3d_cs_exec_dispatch, -@@ -1568,13 +3064,37 @@ static void (* const wined3d_cs_op_handlers[])(struct wined3d_cs *cs, const void +@@ -1667,13 +3099,35 @@ static void (* const wined3d_cs_op_handlers[])(struct wined3d_cs *cs, const void /* WINED3D_CS_OP_RESET_STATE */ wined3d_cs_exec_reset_state, /* WINED3D_CS_OP_CALLBACK */ wined3d_cs_exec_callback, /* WINED3D_CS_OP_QUERY_ISSUE */ wined3d_cs_exec_query_issue, @@ -2673,8 +2668,6 @@ diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c +#else /* STAGING_CSMT */ + /* WINED3D_CS_OP_PUSH_CONSTANTS */ wined3d_cs_exec_push_constants, + /* WINED3D_CS_OP_SET_PRIMITIVE_TYPE */ wined3d_cs_exec_set_primitive_type, -+ /* WINED3D_CS_OP_SET_LIGHT */ wined3d_cs_exec_set_light, -+ /* WINED3D_CS_OP_SET_LIGHT_ENABLE */ wined3d_cs_exec_set_light_enable, + /* WINED3D_CS_OP_BLT */ wined3d_cs_exec_blt, + /* WINED3D_CS_OP_CLEAR_RTV */ wined3d_cs_exec_clear_rtv, + /* WINED3D_CS_OP_UPDATE_TEXTURE */ wined3d_cs_exec_update_texture, @@ -2693,7 +2686,7 @@ diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c { if (size > (cs->data_size - cs->end)) { -@@ -1618,6 +3138,7 @@ static void wined3d_cs_st_submit(struct wined3d_cs *cs) +@@ -1717,6 +3171,7 @@ static void wined3d_cs_st_submit(struct wined3d_cs *cs) HeapFree(GetProcessHeap(), 0, data); } @@ -2701,7 +2694,7 @@ diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c static void wined3d_cs_st_push_constants(struct wined3d_cs *cs, enum wined3d_push_constants p, unsigned int start_idx, unsigned int count, const void *constants) { -@@ -1658,15 +3179,269 @@ static void wined3d_cs_st_push_constants(struct wined3d_cs *cs, enum wined3d_pus +@@ -1757,15 +3212,269 @@ static void wined3d_cs_st_push_constants(struct wined3d_cs *cs, enum wined3d_pus for (i = 0, context_count = device->context_count; i < context_count; ++i) { device->contexts[i]->constant_update_mask |= push_constant_info[p].mask; @@ -2732,14 +2725,14 @@ diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c + { + LeaveCriticalSection(&list->lock); + return NULL; - } ++ } + list_remove(head); + LeaveCriticalSection(&list->lock); + InterlockedDecrement(&list->count); + + return LIST_ENTRY(head, struct wined3d_cs_block, entry); - } - ++} ++ +static void wined3d_cs_wait_event(struct wined3d_cs *cs) +{ + InterlockedExchange(&cs->waiting_for_event, TRUE); @@ -2761,9 +2754,9 @@ diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c + { + WaitForSingleObject(cs->event, INFINITE); +#endif /* STAGING_CSMT */ -+ } -+} -+ + } + } + +#if !defined(STAGING_CSMT) static const struct wined3d_cs_ops wined3d_cs_st_ops = { @@ -2971,7 +2964,7 @@ diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c struct wined3d_cs *wined3d_cs_create(struct wined3d_device *device) { -@@ -1676,15 +3451,22 @@ struct wined3d_cs *wined3d_cs_create(struct wined3d_device *device) +@@ -1775,15 +3484,22 @@ struct wined3d_cs *wined3d_cs_create(struct wined3d_device *device) if (!(cs = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(*cs)))) return NULL; @@ -2994,26 +2987,26 @@ diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c cs->ops = &wined3d_cs_st_ops; cs->device = device; -@@ -1692,18 +3474,65 @@ struct wined3d_cs *wined3d_cs_create(struct wined3d_device *device) +@@ -1791,18 +3507,65 @@ struct wined3d_cs *wined3d_cs_create(struct wined3d_device *device) if (!(cs->data = HeapAlloc(GetProcessHeap(), 0, cs->data_size))) { state_cleanup(&cs->state); +#if !defined(STAGING_CSMT) HeapFree(GetProcessHeap(), 0, cs->fb.render_targets); +#endif /* STAGING_CSMT */ -+ HeapFree(GetProcessHeap(), 0, cs); -+ return NULL; -+ } -+ + HeapFree(GetProcessHeap(), 0, cs); + return NULL; + } + +#if defined(STAGING_CSMT) + if (!(cs->event = CreateEventW(NULL, FALSE, FALSE, NULL))) + { + state_cleanup(&cs->state); + HeapFree(GetProcessHeap(), 0, cs->data); - HeapFree(GetProcessHeap(), 0, cs); - return NULL; - } - ++ HeapFree(GetProcessHeap(), 0, cs); ++ return NULL; ++ } ++ + if (wined3d_settings.cs_multithreaded) + { + cs->ops = &wined3d_cs_mt_ops; @@ -3224,66 +3217,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c { GLint vram_free_kb; UINT64 vram_free; -@@ -1617,6 +1667,7 @@ HRESULT CDECL wined3d_device_set_light(struct wined3d_device *device, - light->direction.x, light->direction.y, light->direction.z, - light->range, light->falloff, light->theta, light->phi); - -+#if !defined(STAGING_CSMT) - /* Update the live definitions if the light is currently assigned a glIndex. */ - if (object->glIndex != -1 && !device->recording) - { -@@ -1625,6 +1676,7 @@ HRESULT CDECL wined3d_device_set_light(struct wined3d_device *device, - device_invalidate_state(device, STATE_ACTIVELIGHT(object->glIndex)); - } - -+#endif /* STAGING_CSMT */ - /* Save away the information. */ - object->OriginalParms = *light; - -@@ -1704,6 +1756,11 @@ HRESULT CDECL wined3d_device_set_light(struct wined3d_device *device, - FIXME("Unrecognized light type %#x.\n", light->type); - } - -+#if defined(STAGING_CSMT) -+ if (!device->recording) -+ wined3d_cs_emit_set_light(device->cs, object); -+ -+#endif /* STAGING_CSMT */ - return WINED3D_OK; - } - -@@ -1727,7 +1784,9 @@ HRESULT CDECL wined3d_device_get_light(const struct wined3d_device *device, - HRESULT CDECL wined3d_device_set_light_enable(struct wined3d_device *device, UINT light_idx, BOOL enable) - { - struct wined3d_light_info *light_info; -+#if !defined(STAGING_CSMT) - int prev_idx; -+#endif /* STAGING_CSMT */ - - TRACE("device %p, light_idx %u, enable %#x.\n", device, light_idx, enable); - -@@ -1744,6 +1803,7 @@ HRESULT CDECL wined3d_device_set_light_enable(struct wined3d_device *device, UIN - } - } - -+#if !defined(STAGING_CSMT) - prev_idx = light_info->glIndex; - wined3d_state_enable_light(device->update_state, &device->adapter->d3d_info, light_info, enable); - if (!device->recording && light_info->glIndex != prev_idx) -@@ -1751,6 +1811,12 @@ HRESULT CDECL wined3d_device_set_light_enable(struct wined3d_device *device, UIN - device_invalidate_state(device, STATE_LIGHT_TYPE); - device_invalidate_state(device, STATE_ACTIVELIGHT(enable ? light_info->glIndex : prev_idx)); - } -+#else /* STAGING_CSMT */ -+ wined3d_state_enable_light(device->update_state, &device->adapter->d3d_info, light_info, enable); -+ -+ if (!device->recording) -+ wined3d_cs_emit_set_light_enable(device->cs, light_idx, enable); -+#endif /* STAGING_CSMT */ - - return WINED3D_OK; - } -@@ -1957,7 +2023,11 @@ static void resolve_depth_buffer(struct wined3d_state *state) +@@ -1947,7 +1997,11 @@ static void resolve_depth_buffer(struct wined3d_state *state) || !(dst_texture->resource.format_flags & WINED3DFMT_FLAG_DEPTH)) return; @@ -3295,7 +3229,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c return; if (src_view->resource->type == WINED3D_RTYPE_BUFFER) { -@@ -2345,7 +2415,11 @@ HRESULT CDECL wined3d_device_set_vs_consts_b(struct wined3d_device *device, +@@ -2335,7 +2389,11 @@ HRESULT CDECL wined3d_device_set_vs_consts_b(struct wined3d_device *device, } else { @@ -3307,7 +3241,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c } return WINED3D_OK; -@@ -2394,7 +2468,11 @@ HRESULT CDECL wined3d_device_set_vs_consts_i(struct wined3d_device *device, +@@ -2384,7 +2442,11 @@ HRESULT CDECL wined3d_device_set_vs_consts_i(struct wined3d_device *device, } else { @@ -3319,7 +3253,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c } return WINED3D_OK; -@@ -2439,7 +2517,11 @@ HRESULT CDECL wined3d_device_set_vs_consts_f(struct wined3d_device *device, +@@ -2429,7 +2491,11 @@ HRESULT CDECL wined3d_device_set_vs_consts_f(struct wined3d_device *device, memset(&device->recording->changed.vs_consts_f[start_idx], 1, count * sizeof(*device->recording->changed.vs_consts_f)); else @@ -3331,7 +3265,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c return WINED3D_OK; } -@@ -2578,7 +2660,11 @@ HRESULT CDECL wined3d_device_set_ps_consts_b(struct wined3d_device *device, +@@ -2568,7 +2634,11 @@ HRESULT CDECL wined3d_device_set_ps_consts_b(struct wined3d_device *device, } else { @@ -3343,7 +3277,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c } return WINED3D_OK; -@@ -2627,7 +2713,11 @@ HRESULT CDECL wined3d_device_set_ps_consts_i(struct wined3d_device *device, +@@ -2617,7 +2687,11 @@ HRESULT CDECL wined3d_device_set_ps_consts_i(struct wined3d_device *device, } else { @@ -3355,7 +3289,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c } return WINED3D_OK; -@@ -2673,7 +2763,11 @@ HRESULT CDECL wined3d_device_set_ps_consts_f(struct wined3d_device *device, +@@ -2663,7 +2737,11 @@ HRESULT CDECL wined3d_device_set_ps_consts_f(struct wined3d_device *device, memset(&device->recording->changed.ps_consts_f[start_idx], 1, count * sizeof(*device->recording->changed.ps_consts_f)); else @@ -3367,7 +3301,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c return WINED3D_OK; } -@@ -2844,7 +2938,9 @@ void CDECL wined3d_device_set_unordered_access_view(struct wined3d_device *devic +@@ -2834,7 +2912,9 @@ void CDECL wined3d_device_set_unordered_access_view(struct wined3d_device *devic wined3d_device_set_pipeline_unordered_access_view(device, WINED3D_PIPELINE_GRAPHICS, idx, uav); } @@ -3377,7 +3311,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c #define copy_and_next(dest, src, size) memcpy(dest, src, size); dest += (size) static HRESULT process_vertices_strided(const struct wined3d_device *device, DWORD dwDestIndex, DWORD dwCount, const struct wined3d_stream_info *stream_info, struct wined3d_buffer *dest, DWORD flags, -@@ -3120,6 +3216,7 @@ HRESULT CDECL wined3d_device_process_vertices(struct wined3d_device *device, +@@ -3110,6 +3190,7 @@ HRESULT CDECL wined3d_device_process_vertices(struct wined3d_device *device, UINT src_start_idx, UINT dst_idx, UINT vertex_count, struct wined3d_buffer *dst_buffer, const struct wined3d_vertex_declaration *declaration, DWORD flags, DWORD dst_fvf) { @@ -3385,7 +3319,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c struct wined3d_state *state = &device->state; struct wined3d_stream_info stream_info; const struct wined3d_gl_info *gl_info; -@@ -3128,6 +3225,10 @@ HRESULT CDECL wined3d_device_process_vertices(struct wined3d_device *device, +@@ -3118,6 +3199,10 @@ HRESULT CDECL wined3d_device_process_vertices(struct wined3d_device *device, unsigned int i; HRESULT hr; WORD map; @@ -3396,7 +3330,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c TRACE("device %p, src_start_idx %u, dst_idx %u, vertex_count %u, " "dst_buffer %p, declaration %p, flags %#x, dst_fvf %#x.\n", -@@ -3137,6 +3238,7 @@ HRESULT CDECL wined3d_device_process_vertices(struct wined3d_device *device, +@@ -3127,6 +3212,7 @@ HRESULT CDECL wined3d_device_process_vertices(struct wined3d_device *device, if (declaration) FIXME("Output vertex declaration not implemented yet.\n"); @@ -3404,7 +3338,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c /* Need any context to write to the vbo. */ context = context_acquire(device, NULL, 0); gl_info = context->gl_info; -@@ -3172,12 +3274,17 @@ HRESULT CDECL wined3d_device_process_vertices(struct wined3d_device *device, +@@ -3162,12 +3248,17 @@ HRESULT CDECL wined3d_device_process_vertices(struct wined3d_device *device, if (e->data.addr) e->data.addr += e->stride * src_start_idx; } @@ -3422,7 +3356,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c return hr; } -@@ -3464,8 +3571,10 @@ HRESULT CDECL wined3d_device_begin_scene(struct wined3d_device *device) +@@ -3454,8 +3545,10 @@ HRESULT CDECL wined3d_device_begin_scene(struct wined3d_device *device) HRESULT CDECL wined3d_device_end_scene(struct wined3d_device *device) { @@ -3433,7 +3367,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c TRACE("device %p.\n", device); if (!device->inScene) -@@ -3474,6 +3583,7 @@ HRESULT CDECL wined3d_device_end_scene(struct wined3d_device *device) +@@ -3464,6 +3557,7 @@ HRESULT CDECL wined3d_device_end_scene(struct wined3d_device *device) return WINED3DERR_INVALIDCALL; } @@ -3441,7 +3375,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c context = context_acquire(device, NULL, 0); /* We only have to do this if we need to read the, swapbuffers performs a flush for us */ context->gl_info->gl_ops.gl.p_glFlush(); -@@ -3481,6 +3591,7 @@ HRESULT CDECL wined3d_device_end_scene(struct wined3d_device *device) +@@ -3471,6 +3565,7 @@ HRESULT CDECL wined3d_device_end_scene(struct wined3d_device *device) * fails. */ context_release(context); @@ -3449,7 +3383,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c device->inScene = FALSE; return WINED3D_OK; } -@@ -3488,6 +3599,10 @@ HRESULT CDECL wined3d_device_end_scene(struct wined3d_device *device) +@@ -3478,6 +3573,10 @@ HRESULT CDECL wined3d_device_end_scene(struct wined3d_device *device) HRESULT CDECL wined3d_device_clear(struct wined3d_device *device, DWORD rect_count, const RECT *rects, DWORD flags, const struct wined3d_color *color, float depth, DWORD stencil) { @@ -3460,7 +3394,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c TRACE("device %p, rect_count %u, rects %p, flags %#x, color %s, depth %.8e, stencil %u.\n", device, rect_count, rects, flags, debug_color(color), depth, stencil); -@@ -3499,7 +3614,11 @@ HRESULT CDECL wined3d_device_clear(struct wined3d_device *device, DWORD rect_cou +@@ -3489,7 +3588,11 @@ HRESULT CDECL wined3d_device_clear(struct wined3d_device *device, DWORD rect_cou if (flags & (WINED3DCLEAR_ZBUFFER | WINED3DCLEAR_STENCIL)) { @@ -3472,7 +3406,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c if (!ds) { WARN("Clearing depth and/or stencil without a depth stencil buffer attached, returning WINED3DERR_INVALIDCALL\n"); -@@ -3508,8 +3627,13 @@ HRESULT CDECL wined3d_device_clear(struct wined3d_device *device, DWORD rect_cou +@@ -3498,8 +3601,13 @@ HRESULT CDECL wined3d_device_clear(struct wined3d_device *device, DWORD rect_cou } else if (flags & WINED3DCLEAR_TARGET) { @@ -3486,7 +3420,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c { WARN("Silently ignoring depth and target clear with mismatching sizes\n"); return WINED3D_OK; -@@ -3572,8 +3696,13 @@ void CDECL wined3d_device_set_primitive_type(struct wined3d_device *device, +@@ -3562,8 +3670,13 @@ void CDECL wined3d_device_set_primitive_type(struct wined3d_device *device, device->update_state->gl_primitive_type = gl_primitive_type; if (device->recording) device->recording->changed.primitive_type = TRUE; @@ -3500,7 +3434,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c } void CDECL wined3d_device_get_primitive_type(const struct wined3d_device *device, -@@ -3633,11 +3762,17 @@ void CDECL wined3d_device_draw_indexed_primitive_instanced(struct wined3d_device +@@ -3623,11 +3736,17 @@ void CDECL wined3d_device_draw_indexed_primitive_instanced(struct wined3d_device start_idx, index_count, start_instance, instance_count, TRUE); } @@ -3518,7 +3452,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c struct wined3d_context *context; struct wined3d_map_desc src; HRESULT hr = WINED3D_OK; -@@ -3661,6 +3796,13 @@ static HRESULT wined3d_device_update_texture_3d(struct wined3d_device *device, +@@ -3651,6 +3770,13 @@ static HRESULT wined3d_device_update_texture_3d(struct wined3d_device *device, } context = context_acquire(device, NULL, 0); @@ -3532,7 +3466,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c /* Only a prepare, since we're uploading entire volumes. */ wined3d_texture_prepare_texture(dst_texture, context, FALSE); -@@ -3668,15 +3810,22 @@ static HRESULT wined3d_device_update_texture_3d(struct wined3d_device *device, +@@ -3658,15 +3784,22 @@ static HRESULT wined3d_device_update_texture_3d(struct wined3d_device *device, for (i = 0; i < level_count; ++i) { @@ -3555,7 +3489,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c if (FAILED(hr = wined3d_resource_unmap(&src_texture->resource, src_level + i))) goto done; } -@@ -3684,16 +3833,89 @@ static HRESULT wined3d_device_update_texture_3d(struct wined3d_device *device, +@@ -3674,16 +3807,89 @@ static HRESULT wined3d_device_update_texture_3d(struct wined3d_device *device, done: context_release(context); return hr; @@ -3645,7 +3579,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c TRACE("device %p, src_texture %p, dst_texture %p.\n", device, src_texture, dst_texture); -@@ -3730,6 +3952,7 @@ HRESULT CDECL wined3d_device_update_texture(struct wined3d_device *device, +@@ -3720,6 +3926,7 @@ HRESULT CDECL wined3d_device_update_texture(struct wined3d_device *device, return WINED3DERR_INVALIDCALL; } @@ -3653,7 +3587,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c level_count = min(wined3d_texture_get_level_count(src_texture), wined3d_texture_get_level_count(dst_texture)); -@@ -3752,9 +3975,21 @@ HRESULT CDECL wined3d_device_update_texture(struct wined3d_device *device, +@@ -3742,9 +3949,21 @@ HRESULT CDECL wined3d_device_update_texture(struct wined3d_device *device, context_release(context); /* Update every surface level of the texture. */ @@ -3675,7 +3609,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c { unsigned int src_levels = src_texture->level_count; unsigned int dst_levels = dst_texture->level_count; -@@ -3787,6 +4022,38 @@ HRESULT CDECL wined3d_device_update_texture(struct wined3d_device *device, +@@ -3777,6 +3996,38 @@ HRESULT CDECL wined3d_device_update_texture(struct wined3d_device *device, FIXME("Unsupported texture type %#x.\n", type); return WINED3DERR_INVALIDCALL; } @@ -3714,7 +3648,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c } HRESULT CDECL wined3d_device_validate_device(const struct wined3d_device *device, DWORD *num_passes) -@@ -3834,8 +4101,13 @@ HRESULT CDECL wined3d_device_validate_device(const struct wined3d_device *device +@@ -3824,8 +4075,13 @@ HRESULT CDECL wined3d_device_validate_device(const struct wined3d_device *device if (state->render_states[WINED3D_RS_ZENABLE] || state->render_states[WINED3D_RS_ZWRITEENABLE] || state->render_states[WINED3D_RS_STENCILENABLE]) { @@ -3728,7 +3662,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c if (ds && rt && (ds->width < rt->width || ds->height < rt->height)) { -@@ -3972,10 +4244,16 @@ void CDECL wined3d_device_copy_resource(struct wined3d_device *device, +@@ -3962,10 +4218,16 @@ void CDECL wined3d_device_copy_resource(struct wined3d_device *device, if (dst_resource->type == WINED3D_RTYPE_BUFFER) { @@ -3745,7 +3679,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c return; } -@@ -4024,6 +4302,9 @@ HRESULT CDECL wined3d_device_copy_sub_resource_region(struct wined3d_device *dev +@@ -4014,6 +4276,9 @@ HRESULT CDECL wined3d_device_copy_sub_resource_region(struct wined3d_device *dev struct wined3d_texture *dst_texture, *src_texture; RECT dst_rect, src_rect; HRESULT hr; @@ -3755,7 +3689,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c TRACE("device %p, dst_resource %p, dst_sub_resource_idx %u, dst_x %u, dst_y %u, dst_z %u, " "src_resource %p, src_sub_resource_idx %u, src_box %s.\n", -@@ -4096,8 +4377,14 @@ HRESULT CDECL wined3d_device_copy_sub_resource_region(struct wined3d_device *dev +@@ -4086,8 +4351,14 @@ HRESULT CDECL wined3d_device_copy_sub_resource_region(struct wined3d_device *dev return WINED3DERR_INVALIDCALL; } @@ -3770,7 +3704,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c } if (dst_resource->type != WINED3D_RTYPE_TEXTURE_2D) -@@ -4111,6 +4398,16 @@ HRESULT CDECL wined3d_device_copy_sub_resource_region(struct wined3d_device *dev +@@ -4101,6 +4372,16 @@ HRESULT CDECL wined3d_device_copy_sub_resource_region(struct wined3d_device *dev if (src_box) { @@ -3787,7 +3721,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c SetRect(&src_rect, src_box->left, src_box->top, src_box->right, src_box->bottom); } else -@@ -4124,6 +4421,25 @@ HRESULT CDECL wined3d_device_copy_sub_resource_region(struct wined3d_device *dev +@@ -4114,6 +4395,25 @@ HRESULT CDECL wined3d_device_copy_sub_resource_region(struct wined3d_device *dev SetRect(&dst_rect, dst_x, dst_y, dst_x + (src_rect.right - src_rect.left), dst_y + (src_rect.bottom - src_rect.top)); @@ -3813,7 +3747,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c if (FAILED(hr = wined3d_texture_blt(dst_texture, dst_sub_resource_idx, &dst_rect, src_texture, src_sub_resource_idx, &src_rect, 0, NULL, WINED3D_TEXF_POINT))) WARN("Failed to blit, hr %#x.\n", hr); -@@ -4136,8 +4452,10 @@ void CDECL wined3d_device_update_sub_resource(struct wined3d_device *device, str +@@ -4126,8 +4426,10 @@ void CDECL wined3d_device_update_sub_resource(struct wined3d_device *device, str unsigned int depth_pitch) { unsigned int width, height, depth, level; @@ -3824,7 +3758,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c struct wined3d_texture *texture; TRACE("device %p, resource %p, sub_resource_idx %u, box %s, data %p, row_pitch %u, depth_pitch %u.\n", -@@ -4145,18 +4463,24 @@ void CDECL wined3d_device_update_sub_resource(struct wined3d_device *device, str +@@ -4135,18 +4437,24 @@ void CDECL wined3d_device_update_sub_resource(struct wined3d_device *device, str if (resource->type == WINED3D_RTYPE_BUFFER) { @@ -3849,7 +3783,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c return; } -@@ -4187,6 +4511,7 @@ void CDECL wined3d_device_update_sub_resource(struct wined3d_device *device, str +@@ -4177,6 +4485,7 @@ void CDECL wined3d_device_update_sub_resource(struct wined3d_device *device, str return; } @@ -3857,7 +3791,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c addr.buffer_object = 0; addr.addr = data; -@@ -4206,6 +4531,9 @@ void CDECL wined3d_device_update_sub_resource(struct wined3d_device *device, str +@@ -4196,6 +4505,9 @@ void CDECL wined3d_device_update_sub_resource(struct wined3d_device *device, str wined3d_texture_validate_location(texture, sub_resource_idx, WINED3D_LOCATION_TEXTURE_RGB); wined3d_texture_invalidate_location(texture, sub_resource_idx, ~WINED3D_LOCATION_TEXTURE_RGB); @@ -3867,7 +3801,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c } HRESULT CDECL wined3d_device_clear_rendertarget_view(struct wined3d_device *device, -@@ -4254,10 +4582,15 @@ HRESULT CDECL wined3d_device_clear_rendertarget_view(struct wined3d_device *devi +@@ -4244,10 +4556,15 @@ HRESULT CDECL wined3d_device_clear_rendertarget_view(struct wined3d_device *devi return WINED3DERR_INVALIDCALL; } @@ -3883,7 +3817,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c } struct wined3d_rendertarget_view * CDECL wined3d_device_get_rendertarget_view(const struct wined3d_device *device, -@@ -4271,20 +4604,31 @@ struct wined3d_rendertarget_view * CDECL wined3d_device_get_rendertarget_view(co +@@ -4261,20 +4578,31 @@ struct wined3d_rendertarget_view * CDECL wined3d_device_get_rendertarget_view(co return NULL; } @@ -3915,7 +3849,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c TRACE("device %p, view_idx %u, view %p, set_viewport %#x.\n", device, view_idx, view, set_viewport); -@@ -4321,13 +4665,21 @@ HRESULT CDECL wined3d_device_set_rendertarget_view(struct wined3d_device *device +@@ -4311,13 +4639,21 @@ HRESULT CDECL wined3d_device_set_rendertarget_view(struct wined3d_device *device } @@ -3937,7 +3871,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c wined3d_cs_emit_set_rendertarget_view(device->cs, view_idx, view); /* Release after the assignment, to prevent device_resource_released() * from seeing the surface as still in use. */ -@@ -4339,18 +4691,29 @@ HRESULT CDECL wined3d_device_set_rendertarget_view(struct wined3d_device *device +@@ -4329,18 +4665,29 @@ HRESULT CDECL wined3d_device_set_rendertarget_view(struct wined3d_device *device void CDECL wined3d_device_set_depth_stencil_view(struct wined3d_device *device, struct wined3d_rendertarget_view *view) { @@ -3967,7 +3901,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c wined3d_rendertarget_view_incref(view); wined3d_cs_emit_set_depth_stencil_view(device->cs, view); if (prev) -@@ -4616,10 +4979,16 @@ HRESULT CDECL wined3d_device_reset(struct wined3d_device *device, +@@ -4606,10 +4953,16 @@ HRESULT CDECL wined3d_device_reset(struct wined3d_device *device, wined3d_texture_decref(device->cursor_texture); device->cursor_texture = NULL; } @@ -3984,7 +3918,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c { for (i = 0; i < device->adapter->gl_info.limits.buffers; ++i) { -@@ -4630,6 +4999,13 @@ HRESULT CDECL wined3d_device_reset(struct wined3d_device *device, +@@ -4620,6 +4973,13 @@ HRESULT CDECL wined3d_device_reset(struct wined3d_device *device, if (reset_state) { @@ -3998,7 +3932,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c LIST_FOR_EACH_ENTRY_SAFE(resource, cursor, &device->resources, struct wined3d_resource, resource_list_entry) { TRACE("Enumerating resource %p.\n", resource); -@@ -4798,27 +5174,48 @@ HRESULT CDECL wined3d_device_reset(struct wined3d_device *device, +@@ -4788,27 +5148,48 @@ HRESULT CDECL wined3d_device_reset(struct wined3d_device *device, if (device->d3d_initialized) wined3d_device_delete_opengl_contexts(device); @@ -4047,7 +3981,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c wined3d_cs_emit_set_scissor_rect(device->cs, &state->scissor_rect); } -@@ -4826,7 +5223,11 @@ HRESULT CDECL wined3d_device_reset(struct wined3d_device *device, +@@ -4816,7 +5197,11 @@ HRESULT CDECL wined3d_device_reset(struct wined3d_device *device, { if (reset_state) hr = wined3d_device_create_primary_opengl_context(device); @@ -4059,7 +3993,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c } /* All done. There is no need to reload resources or shaders, this will happen automatically on the -@@ -4910,11 +5311,19 @@ void device_resource_released(struct wined3d_device *device, struct wined3d_reso +@@ -4900,11 +5285,19 @@ void device_resource_released(struct wined3d_device *device, struct wined3d_reso { for (i = 0; i < device->adapter->gl_info.limits.buffers; ++i) { @@ -4079,7 +4013,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c ERR("Resource %p is still in use as depth/stencil buffer.\n", resource); } -@@ -5040,8 +5449,17 @@ HRESULT device_init(struct wined3d_device *device, struct wined3d *wined3d, +@@ -5030,8 +5423,17 @@ HRESULT device_init(struct wined3d_device *device, struct wined3d *wined3d, device->blitter = adapter->blitter; @@ -4097,7 +4031,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c device->update_state = &device->state; if (!(device->cs = wined3d_cs_create(device))) -@@ -5141,3 +5559,58 @@ LRESULT device_process_message(struct wined3d_device *device, HWND window, BOOL +@@ -5131,3 +5533,58 @@ LRESULT device_process_message(struct wined3d_device *device, HWND window, BOOL else return CallWindowProcA(proc, window, message, wparam, lparam); } @@ -5735,7 +5669,7 @@ diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h }; extern struct wined3d_settings wined3d_settings DECLSPEC_HIDDEN; -@@ -1499,6 +1502,10 @@ struct wined3d_query +@@ -1500,6 +1503,10 @@ struct wined3d_query const void *data; DWORD data_size; const struct wined3d_query_ops *query_ops; @@ -5746,7 +5680,7 @@ diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h }; union wined3d_gl_query_object -@@ -1540,6 +1547,9 @@ struct wined3d_occlusion_query +@@ -1541,6 +1548,9 @@ struct wined3d_occlusion_query GLuint id; struct wined3d_context *context; UINT64 samples; @@ -5756,7 +5690,7 @@ diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h }; struct wined3d_timestamp_query -@@ -1555,6 +1565,38 @@ struct wined3d_timestamp_query +@@ -1556,6 +1566,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; @@ -5795,7 +5729,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; -@@ -1570,6 +1612,9 @@ struct wined3d_context +@@ -1571,6 +1613,9 @@ struct wined3d_context DWORD numDirtyEntries; DWORD isStateDirty[STATE_HIGHEST / (sizeof(DWORD) * CHAR_BIT) + 1]; /* Bitmap to find out quickly if a state is dirty */ unsigned int dirty_compute_states[STATE_COMPUTE_COUNT / (sizeof(unsigned int) * CHAR_BIT) + 1]; @@ -5805,7 +5739,7 @@ diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h struct wined3d_device *device; struct wined3d_swapchain *swapchain; -@@ -1683,12 +1728,14 @@ struct wined3d_context +@@ -1684,12 +1729,14 @@ struct wined3d_context GLuint dummy_arbfp_prog; }; @@ -5820,7 +5754,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 -@@ -1827,7 +1874,11 @@ void context_alloc_event_query(struct wined3d_context *context, +@@ -1828,7 +1875,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; @@ -5832,7 +5766,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; void context_apply_compute_state(struct wined3d_context *context, const struct wined3d_device *device, const struct wined3d_state *state) DECLSPEC_HIDDEN; -@@ -2512,7 +2563,11 @@ struct wined3d_stream_state +@@ -2514,7 +2565,11 @@ struct wined3d_stream_state struct wined3d_state { DWORD flags; @@ -5844,7 +5778,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]; -@@ -2560,6 +2615,16 @@ struct wined3d_state +@@ -2562,6 +2617,16 @@ struct wined3d_state struct wined3d_rasterizer_state *rasterizer_state; }; @@ -5861,7 +5795,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 -@@ -2618,7 +2683,9 @@ struct wined3d_device +@@ -2620,7 +2685,9 @@ struct wined3d_device struct wine_rb_tree samplers; /* Render Target Support */ @@ -5871,7 +5805,7 @@ diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h struct wined3d_rendertarget_view *auto_depth_stencil_view; /* Cursor management */ -@@ -2671,6 +2738,14 @@ LRESULT device_process_message(struct wined3d_device *device, HWND window, BOOL +@@ -2673,6 +2740,14 @@ LRESULT device_process_message(struct wined3d_device *device, HWND window, BOOL 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; void device_invalidate_state(const struct wined3d_device *device, DWORD state) DECLSPEC_HIDDEN; @@ -5886,7 +5820,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) { -@@ -2746,11 +2821,13 @@ static inline void wined3d_resource_release(struct wined3d_resource *resource) +@@ -2748,11 +2823,13 @@ static inline void wined3d_resource_release(struct wined3d_resource *resource) InterlockedDecrement(&resource->access_count); } @@ -5900,7 +5834,7 @@ diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h void resource_cleanup(struct wined3d_resource *resource) DECLSPEC_HIDDEN; HRESULT resource_init(struct wined3d_resource *resource, struct wined3d_device *device, enum wined3d_resource_type type, const struct wined3d_format *format, -@@ -2861,7 +2938,11 @@ struct wined3d_texture +@@ -2863,7 +2940,11 @@ struct wined3d_texture unsigned int map_count; DWORD locations; @@ -5912,7 +5846,7 @@ diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h } sub_resources[1]; }; -@@ -2914,9 +2995,16 @@ void wined3d_texture_bind_and_dirtify(struct wined3d_texture *texture, +@@ -2916,9 +2997,16 @@ void wined3d_texture_bind_and_dirtify(struct wined3d_texture *texture, struct wined3d_context *context, BOOL srgb) DECLSPEC_HIDDEN; BOOL wined3d_texture_check_block_align(const struct wined3d_texture *texture, unsigned int level, const struct wined3d_box *box) DECLSPEC_HIDDEN; @@ -5929,7 +5863,7 @@ diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h void wined3d_texture_invalidate_location(struct wined3d_texture *texture, unsigned int sub_resource_idx, DWORD location) DECLSPEC_HIDDEN; void wined3d_texture_load(struct wined3d_texture *texture, -@@ -2929,6 +3017,10 @@ BOOL wined3d_texture_prepare_location(struct wined3d_texture *texture, unsigned +@@ -2931,6 +3019,10 @@ BOOL wined3d_texture_prepare_location(struct wined3d_texture *texture, unsigned struct wined3d_context *context, DWORD location) DECLSPEC_HIDDEN; void wined3d_texture_prepare_texture(struct wined3d_texture *texture, struct wined3d_context *context, BOOL srgb) DECLSPEC_HIDDEN; @@ -5940,7 +5874,7 @@ diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h void wined3d_texture_set_map_binding(struct wined3d_texture *texture, DWORD map_binding) DECLSPEC_HIDDEN; void wined3d_texture_set_swapchain(struct wined3d_texture *texture, struct wined3d_swapchain *swapchain) DECLSPEC_HIDDEN; -@@ -3036,6 +3128,11 @@ HRESULT surface_upload_from_surface(struct wined3d_surface *dst_surface, const P +@@ -3038,6 +3130,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; @@ -5952,7 +5886,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; -@@ -3149,9 +3246,14 @@ void wined3d_state_enable_light(struct wined3d_state *state, const struct wined3 +@@ -3151,9 +3248,14 @@ void wined3d_state_enable_light(struct wined3d_state *state, const struct wined3 struct wined3d_light_info *light_info, BOOL enable) DECLSPEC_HIDDEN; struct wined3d_light_info *wined3d_state_get_light(const struct wined3d_state *state, unsigned int idx) DECLSPEC_HIDDEN; @@ -5967,7 +5901,7 @@ diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h void state_unbind_resources(struct wined3d_state *state) DECLSPEC_HIDDEN; enum wined3d_push_constants -@@ -3164,6 +3266,7 @@ enum wined3d_push_constants +@@ -3166,6 +3268,7 @@ enum wined3d_push_constants WINED3D_PUSH_CONSTANTS_PS_B, }; @@ -5975,7 +5909,7 @@ diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h struct wined3d_cs_ops { void *(*require_space)(struct wined3d_cs *cs, size_t size); -@@ -3171,32 +3274,114 @@ struct wined3d_cs_ops +@@ -3173,32 +3276,114 @@ struct wined3d_cs_ops void (*push_constants)(struct wined3d_cs *cs, enum wined3d_push_constants p, unsigned int start_idx, unsigned int count, const void *constants); }; @@ -6090,14 +6024,7 @@ diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h void wined3d_cs_emit_reset_state(struct wined3d_cs *cs) DECLSPEC_HIDDEN; void wined3d_cs_emit_set_clip_plane(struct wined3d_cs *cs, UINT plane_idx, const struct wined3d_vec4 *plane) DECLSPEC_HIDDEN; -@@ -3208,9 +3393,17 @@ void wined3d_cs_emit_set_depth_stencil_view(struct wined3d_cs *cs, - struct wined3d_rendertarget_view *view) DECLSPEC_HIDDEN; - void wined3d_cs_emit_set_index_buffer(struct wined3d_cs *cs, struct wined3d_buffer *buffer, - enum wined3d_format_id format_id, unsigned int offset) DECLSPEC_HIDDEN; -+#if defined(STAGING_CSMT) -+void wined3d_cs_emit_set_light(struct wined3d_cs *cs, const struct wined3d_light_info *light) DECLSPEC_HIDDEN; -+void wined3d_cs_emit_set_light_enable(struct wined3d_cs *cs, UINT idx, BOOL enable) DECLSPEC_HIDDEN; -+#endif /* STAGING_CSMT */ +@@ -3215,6 +3400,10 @@ void wined3d_cs_emit_set_light_enable(struct wined3d_cs *cs, unsigned int idx, B void wined3d_cs_emit_set_material(struct wined3d_cs *cs, const struct wined3d_material *material) DECLSPEC_HIDDEN; void wined3d_cs_emit_set_predication(struct wined3d_cs *cs, struct wined3d_query *predicate, BOOL value) DECLSPEC_HIDDEN; @@ -6108,7 +6035,7 @@ diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h void wined3d_cs_emit_set_rasterizer_state(struct wined3d_cs *cs, struct wined3d_rasterizer_state *rasterizer_state) DECLSPEC_HIDDEN; void wined3d_cs_emit_set_render_state(struct wined3d_cs *cs, -@@ -3242,19 +3435,37 @@ void wined3d_cs_emit_set_unordered_access_view(struct wined3d_cs *cs, enum wined +@@ -3246,19 +3435,37 @@ void wined3d_cs_emit_set_unordered_access_view(struct wined3d_cs *cs, enum wined void wined3d_cs_emit_set_vertex_declaration(struct wined3d_cs *cs, struct wined3d_vertex_declaration *declaration) DECLSPEC_HIDDEN; void wined3d_cs_emit_set_viewport(struct wined3d_cs *cs, const struct wined3d_viewport *viewport) DECLSPEC_HIDDEN; @@ -6146,7 +6073,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 */ -@@ -3392,7 +3603,12 @@ void wined3d_unordered_access_view_invalidate_location(struct wined3d_unordered_ +@@ -3396,7 +3603,12 @@ void wined3d_unordered_access_view_invalidate_location(struct wined3d_unordered_ struct wined3d_swapchain_ops { void (*swapchain_present)(struct wined3d_swapchain *swapchain, @@ -6159,7 +6086,7 @@ diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h void (*swapchain_frontbuffer_updated)(struct wined3d_swapchain *swapchain); }; -@@ -3429,6 +3645,10 @@ struct wined3d_swapchain +@@ -3433,6 +3645,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/staging/VERSION b/staging/VERSION index 6b44d3f2..be280895 100644 --- a/staging/VERSION +++ b/staging/VERSION @@ -1 +1 @@ -Wine Staging 2.2 +Wine Staging 2.3 (unreleased)