From c46fab6261c2a5975e0da3dcb0e999143559b1ce Mon Sep 17 00:00:00 2001 From: Sebastian Lackner Date: Thu, 11 Aug 2016 19:47:09 +0200 Subject: [PATCH] Rebase against dca0e38d82c737cd8aeab63e08cf1990d05d9671. FIXME: Merge buffer/texture preload commands. --- ...void-misleading-indentation-warnings.patch | 27 -- patches/patchinstall.sh | 14 +- ...tem-information-SystemPerformanceInf.patch | 8 +- ...introduce-a-multithreaded-command-st.patch | 13 +- ...a-glFinish-before-modifying-resource.patch | 62 ++-- ...he-cs-before-changing-the-texture-lo.patch | 13 +- ...e-the-linked-lists-with-a-ringbuffer.patch | 40 +-- ...ned3d-Don-t-preload-buffers-on-unmap.patch | 10 +- ...Send-texture-preloads-through-the-CS.patch | 29 +- ...-buffer-resource.map_count-in-the-CS.patch | 16 +- ...-Send-buffer-preloads-through-the-CS.patch | 32 +-- ...esources-through-the-CS-in-device_re.patch | 30 +- ...urface_unload-through-the-CS-in-wine.patch | 13 +- .../wined3d-CSMT_Main/9999-IfDefined.patch | 270 +++++++++--------- 14 files changed, 264 insertions(+), 313 deletions(-) delete mode 100644 patches/Compiler_Warnings/0004-mshtml-Avoid-misleading-indentation-warnings.patch diff --git a/patches/Compiler_Warnings/0004-mshtml-Avoid-misleading-indentation-warnings.patch b/patches/Compiler_Warnings/0004-mshtml-Avoid-misleading-indentation-warnings.patch deleted file mode 100644 index 8a63a8dc..00000000 --- a/patches/Compiler_Warnings/0004-mshtml-Avoid-misleading-indentation-warnings.patch +++ /dev/null @@ -1,27 +0,0 @@ -From e733682785c0f2001a972090693c4b49bb8e1090 Mon Sep 17 00:00:00 2001 -From: Sebastian Lackner -Date: Sat, 30 Jul 2016 23:55:40 +0200 -Subject: mshtml: Avoid misleading indentation warnings. - ---- - dlls/mshtml/script.c | 4 ++-- - 1 file changed, 2 insertions(+), 2 deletions(-) - -diff --git a/dlls/mshtml/script.c b/dlls/mshtml/script.c -index 40deda4..19f3541 100644 ---- a/dlls/mshtml/script.c -+++ b/dlls/mshtml/script.c -@@ -991,8 +991,8 @@ static HRESULT ScriptBSC_read_data(BSCallback *bsc, IStream *stream) - if(This->bsc.readed >= This->size) { - void *new_buf; - new_buf = heap_realloc(This->buf, This->size << 1); -- if(!new_buf) -- return E_OUTOFMEMORY; -+ if(!new_buf) -+ return E_OUTOFMEMORY; - This->size <<= 1; - This->buf = new_buf; - } --- -2.9.0 - diff --git a/patches/patchinstall.sh b/patches/patchinstall.sh index b860e02d..800a7b60 100755 --- a/patches/patchinstall.sh +++ b/patches/patchinstall.sh @@ -52,7 +52,7 @@ usage() # Get the upstream commit sha upstream_commit() { - echo "882980c17a9a033fa8e49a4c116af9583698d218" + echo "dca0e38d82c737cd8aeab63e08cf1990d05d9671" } # Show version information @@ -2332,15 +2332,14 @@ fi # | Modified files: # | * dlls/amstream/mediastreamfilter.c, dlls/comctl32/listview.c, dlls/d2d1/brush.c, dlls/d2d1/geometry.c, dlls/d3d11/view.c, # | dlls/d3d8/texture.c, dlls/d3d9/tests/visual.c, dlls/d3d9/texture.c, dlls/ddraw/viewport.c, dlls/dsound/primary.c, -# | dlls/dwrite/layout.c, dlls/mshtml/script.c, dlls/msvcirt/tests/msvcirt.c, dlls/msxml3/schema.c, -# | dlls/netapi32/netapi32.c, dlls/oleaut32/oleaut.c, dlls/oleaut32/tests/safearray.c, dlls/rpcrt4/cstub.c, -# | dlls/shell32/tests/shellole.c, dlls/shlwapi/tests/ordinal.c, dlls/vbscript/vbdisp.c, dlls/winealsa.drv/mmdevdrv.c, -# | dlls/wined3d/glsl_shader.c, include/d3dtypes.h, include/wine/list.h, include/wine/rbtree.h, include/winnt.h, -# | server/request.c, server/sock.c, tools/makedep.c +# | dlls/dwrite/layout.c, dlls/msvcirt/tests/msvcirt.c, dlls/msxml3/schema.c, dlls/netapi32/netapi32.c, +# | dlls/oleaut32/oleaut.c, dlls/oleaut32/tests/safearray.c, dlls/rpcrt4/cstub.c, dlls/shell32/tests/shellole.c, +# | dlls/shlwapi/tests/ordinal.c, dlls/vbscript/vbdisp.c, dlls/winealsa.drv/mmdevdrv.c, dlls/wined3d/glsl_shader.c, +# | include/d3dtypes.h, include/wine/list.h, include/wine/rbtree.h, include/winnt.h, server/request.c, server/sock.c, +# | tools/makedep.c # | if test "$enable_Compiler_Warnings" -eq 1; then patch_apply Compiler_Warnings/0001-comctl32-Avoid-misleading-indentation-warnings.patch - patch_apply Compiler_Warnings/0004-mshtml-Avoid-misleading-indentation-warnings.patch patch_apply Compiler_Warnings/0005-msvcirt-tests-Avoid-misleading-indentation-warnings.patch patch_apply Compiler_Warnings/0006-oleaut32-tests-Avoid-misleading-indentation-warnings.patch patch_apply Compiler_Warnings/0009-shell32-tests-Avoid-misleading-indentation-warnings.patch @@ -2363,7 +2362,6 @@ if test "$enable_Compiler_Warnings" -eq 1; then patch_apply Compiler_Warnings/0031-include-Check-element-type-in-CONTAINING_RECORD-and-.patch ( echo '+ { "Sebastian Lackner", "comctl32: Avoid misleading indentation warnings.", 1 },'; - echo '+ { "Sebastian Lackner", "mshtml: Avoid misleading indentation warnings.", 1 },'; echo '+ { "Sebastian Lackner", "msvcirt/tests: Avoid misleading indentation warnings.", 1 },'; echo '+ { "Sebastian Lackner", "oleaut32/tests: Avoid misleading indentation warnings.", 1 },'; echo '+ { "Sebastian Lackner", "shell32/tests: Avoid misleading indentation warnings.", 1 },'; diff --git a/patches/taskmgr-Memory_Usage/0002-ntdll-Report-system-information-SystemPerformanceInf.patch b/patches/taskmgr-Memory_Usage/0002-ntdll-Report-system-information-SystemPerformanceInf.patch index 83ec6131..c7cf591b 100644 --- a/patches/taskmgr-Memory_Usage/0002-ntdll-Report-system-information-SystemPerformanceInf.patch +++ b/patches/taskmgr-Memory_Usage/0002-ntdll-Report-system-information-SystemPerformanceInf.patch @@ -1,4 +1,4 @@ -From 67cf23ba06fa874f27f0170ba9c8ea90ea8ffc3b Mon Sep 17 00:00:00 2001 +From 46a184710ee4e78749c9d102ae2929a754c1433b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michael=20M=C3=BCller?= Date: Thu, 28 Jan 2016 06:43:00 +0100 Subject: ntdll: Report system information SystemPerformanceInformation info @@ -9,7 +9,7 @@ Subject: ntdll: Report system information SystemPerformanceInformation info 1 file changed, 35 insertions(+) diff --git a/dlls/ntdll/nt.c b/dlls/ntdll/nt.c -index 46393a4..ac6f8dd 100644 +index 46393a4..0bf7803 100644 --- a/dlls/ntdll/nt.c +++ b/dlls/ntdll/nt.c @@ -30,6 +30,9 @@ @@ -26,7 +26,7 @@ index 46393a4..ac6f8dd 100644 SYSTEM_PERFORMANCE_INFORMATION spi; static BOOL fixme_written = FALSE; FILE *fp; -+ #ifdef HAVE_SYS_SYSINFO_H ++ #ifdef HAVE_SYSINFO + struct sysinfo sinfo; + #endif @@ -36,7 +36,7 @@ index 46393a4..ac6f8dd 100644 spi.IdleTime.QuadPart = ++idle; } -+ #ifdef HAVE_SYS_SYSINFO_H ++ #ifdef HAVE_SYSINFO + if (!sysinfo(&sinfo)) + { + ULONG64 freeram = (ULONG64)sinfo.freeram * sinfo.mem_unit; diff --git a/patches/wined3d-CSMT_Main/0010-wined3d-Hackily-introduce-a-multithreaded-command-st.patch b/patches/wined3d-CSMT_Main/0010-wined3d-Hackily-introduce-a-multithreaded-command-st.patch index 01bbd40b..b6b83ab5 100644 --- a/patches/wined3d-CSMT_Main/0010-wined3d-Hackily-introduce-a-multithreaded-command-st.patch +++ b/patches/wined3d-CSMT_Main/0010-wined3d-Hackily-introduce-a-multithreaded-command-st.patch @@ -1,4 +1,4 @@ -From 9ac471fe3bc3eb4156bbcfef799314dabed8eec7 Mon Sep 17 00:00:00 2001 +From 086e024e36bde8a490e128bfe552129eb51396d5 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 @@ -10,7 +10,7 @@ Subject: wined3d: Hackily introduce a multithreaded command stream 3 files changed, 369 insertions(+), 31 deletions(-) diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c -index 825523e..bb090a3 100644 +index b9d7e87..2789726 100644 --- a/dlls/wined3d/cs.c +++ b/dlls/wined3d/cs.c @@ -24,8 +24,19 @@ WINE_DEFAULT_DEBUG_CHANNEL(d3d); @@ -674,7 +674,7 @@ index 825523e..bb090a3 100644 } void wined3d_cs_emit_query_issue(struct wined3d_cs *cs, struct wined3d_query *query, DWORD flags) -@@ -1252,12 +1460,14 @@ void wined3d_cs_emit_query_issue(struct wined3d_cs *cs, struct wined3d_query *qu +@@ -1252,13 +1460,15 @@ void wined3d_cs_emit_query_issue(struct wined3d_cs *cs, struct wined3d_query *qu cs->ops->submit(cs); } @@ -685,12 +685,13 @@ index 825523e..bb090a3 100644 struct wined3d_resource *resource = op->resource; resource->resource_ops->resource_unload(resource); + wined3d_resource_release(resource); + + return sizeof(*op); } void wined3d_cs_emit_unload_resource(struct wined3d_cs *cs, struct wined3d_resource *resource) -@@ -1271,8 +1481,9 @@ void wined3d_cs_emit_unload_resource(struct wined3d_cs *cs, struct wined3d_resou +@@ -1274,8 +1484,9 @@ void wined3d_cs_emit_unload_resource(struct wined3d_cs *cs, struct wined3d_resou cs->ops->submit(cs); } @@ -701,7 +702,7 @@ index 825523e..bb090a3 100644 /* WINED3D_CS_OP_PRESENT */ wined3d_cs_exec_present, /* WINED3D_CS_OP_CLEAR */ wined3d_cs_exec_clear, /* WINED3D_CS_OP_DRAW */ wined3d_cs_exec_draw, -@@ -1335,6 +1546,58 @@ static const struct wined3d_cs_ops wined3d_cs_st_ops = +@@ -1338,6 +1549,58 @@ static const struct wined3d_cs_ops wined3d_cs_st_ops = wined3d_cs_st_submit, }; @@ -760,7 +761,7 @@ index 825523e..bb090a3 100644 struct wined3d_cs *wined3d_cs_create(struct wined3d_device *device) { const struct wined3d_gl_info *gl_info = &device->adapter->gl_info; -@@ -1361,12 +1624,60 @@ struct wined3d_cs *wined3d_cs_create(struct wined3d_device *device) +@@ -1364,12 +1627,60 @@ struct wined3d_cs *wined3d_cs_create(struct wined3d_device *device) return NULL; } diff --git a/patches/wined3d-CSMT_Main/0016-wined3d-Request-a-glFinish-before-modifying-resource.patch b/patches/wined3d-CSMT_Main/0016-wined3d-Request-a-glFinish-before-modifying-resource.patch index f2a183b1..ba2d7356 100644 --- a/patches/wined3d-CSMT_Main/0016-wined3d-Request-a-glFinish-before-modifying-resource.patch +++ b/patches/wined3d-CSMT_Main/0016-wined3d-Request-a-glFinish-before-modifying-resource.patch @@ -1,38 +1,22 @@ -From f62a560d5351df46166c32859e13ab43f7a43453 Mon Sep 17 00:00:00 2001 +From 3f4145a66ef9173bf608b12c4e210ee0f0369436 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stefan=20D=C3=B6singer?= Date: Thu, 4 Apr 2013 11:50:09 +0200 Subject: wined3d: Request a glFinish before modifying resources outside the cs --- - dlls/wined3d/buffer.c | 17 +++++++++++++++++ + dlls/wined3d/buffer.c | 18 +++++++++++++++++- dlls/wined3d/cs.c | 30 ++++++++++++++++++++++++++++++ dlls/wined3d/device.c | 27 +++++++++++++++++++++++++++ dlls/wined3d/surface.c | 7 +++++++ dlls/wined3d/texture.c | 14 ++++++++++++++ dlls/wined3d/wined3d_private.h | 1 + - 6 files changed, 96 insertions(+) + 6 files changed, 96 insertions(+), 1 deletion(-) diff --git a/dlls/wined3d/buffer.c b/dlls/wined3d/buffer.c -index fc7b04d..c16578d 100644 +index 9cc8ee0..85886bf 100644 --- a/dlls/wined3d/buffer.c +++ b/dlls/wined3d/buffer.c -@@ -931,6 +931,15 @@ void buffer_internal_preload(struct wined3d_buffer *buffer, struct wined3d_conte - void CDECL wined3d_buffer_preload(struct wined3d_buffer *buffer) - { - struct wined3d_context *context; -+ struct wined3d_device *device = buffer->resource.device; -+ -+ if (wined3d_settings.cs_multithreaded) -+ { -+ FIXME("Waiting for cs.\n"); -+ wined3d_cs_emit_glfinish(device->cs); -+ device->cs->ops->finish(device->cs); -+ } -+ - context = context_acquire(buffer->resource.device, NULL); - buffer_internal_preload(buffer, context, NULL); - context_release(context); -@@ -947,9 +956,17 @@ HRESULT CDECL wined3d_buffer_map(struct wined3d_buffer *buffer, UINT offset, UIN +@@ -939,9 +939,17 @@ HRESULT CDECL wined3d_buffer_map(struct wined3d_buffer *buffer, UINT offset, UIN { LONG count; BYTE *base; @@ -50,8 +34,26 @@ index fc7b04d..c16578d 100644 flags = wined3d_resource_sanitize_map_flags(&buffer->resource, flags); /* Filter redundant WINED3D_MAP_DISCARD maps. The 3DMark2001 multitexture * fill rate test seems to depend on this. When we map a buffer with +@@ -1222,8 +1230,16 @@ static ULONG buffer_resource_decref(struct wined3d_resource *resource) + static void buffer_resource_preload(struct wined3d_resource *resource) + { + struct wined3d_context *context; ++ struct wined3d_device *device = resource->device; + +- context = context_acquire(resource->device, NULL); ++ if (wined3d_settings.cs_multithreaded) ++ { ++ FIXME("Waiting for cs.\n"); ++ wined3d_cs_emit_glfinish(device->cs); ++ device->cs->ops->finish(device->cs); ++ } ++ ++ context = context_acquire(device, NULL); + buffer_internal_preload(buffer_from_resource(resource), context, NULL); + context_release(context); + } diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c -index 92c251c..c7ee4d2 100644 +index bf1d3d7..3a066d2 100644 --- a/dlls/wined3d/cs.c +++ b/dlls/wined3d/cs.c @@ -70,6 +70,7 @@ enum wined3d_cs_op @@ -74,7 +76,7 @@ index 92c251c..c7ee4d2 100644 /* FIXME: The list synchronization probably isn't particularly fast. */ static void wined3d_cs_list_enqueue(struct wined3d_cs_list *list, struct wined3d_cs_block *block) { -@@ -1602,6 +1608,29 @@ void wined3d_cs_emit_unload_resource(struct wined3d_cs *cs, struct wined3d_resou +@@ -1605,6 +1611,29 @@ void wined3d_cs_emit_unload_resource(struct wined3d_cs *cs, struct wined3d_resou cs->ops->submit(cs); } @@ -104,7 +106,7 @@ index 92c251c..c7ee4d2 100644 static UINT (* const wined3d_cs_op_handlers[])(struct wined3d_cs *cs, const void *data) = { /* WINED3D_CS_OP_FENCE */ wined3d_cs_exec_fence, -@@ -1638,6 +1667,7 @@ static UINT (* const wined3d_cs_op_handlers[])(struct wined3d_cs *cs, const void +@@ -1641,6 +1670,7 @@ static UINT (* const wined3d_cs_op_handlers[])(struct wined3d_cs *cs, const void /* WINED3D_CS_OP_STATEBLOCK */ wined3d_cs_exec_transfer_stateblock, /* WINED3D_CS_OP_SET_VS_CONSTS_F */ wined3d_cs_exec_set_vs_consts_f, /* WINED3D_CS_OP_SET_PS_CONSTS_F */ wined3d_cs_exec_set_ps_consts_f, @@ -113,7 +115,7 @@ index 92c251c..c7ee4d2 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 7006c62..efd8093 100644 +index 6ad0a83..77fbb61 100644 --- a/dlls/wined3d/device.c +++ b/dlls/wined3d/device.c @@ -2949,6 +2949,13 @@ static HRESULT process_vertices_strided(const struct wined3d_device *device, DWO @@ -190,10 +192,10 @@ index c63578a..5601804 100644 { WARN("D3D not initialized, using fallback.\n"); diff --git a/dlls/wined3d/texture.c b/dlls/wined3d/texture.c -index 74e4450..1306be9 100644 +index 1e34cd7..e804ac2 100644 --- a/dlls/wined3d/texture.c +++ b/dlls/wined3d/texture.c -@@ -1800,6 +1800,13 @@ static HRESULT texture_resource_sub_resource_map(struct wined3d_resource *resour +@@ -1803,6 +1803,13 @@ static HRESULT texture_resource_sub_resource_map(struct wined3d_resource *resour return WINED3DERR_INVALIDCALL; } @@ -207,7 +209,7 @@ index 74e4450..1306be9 100644 flags = wined3d_resource_sanitize_map_flags(resource, flags); if (device->d3d_initialized) -@@ -2958,6 +2965,13 @@ HRESULT CDECL wined3d_texture_get_dc(struct wined3d_texture *texture, unsigned i +@@ -2962,6 +2969,13 @@ HRESULT CDECL wined3d_texture_get_dc(struct wined3d_texture *texture, unsigned i if (texture->resource.map_count && !(texture->flags & WINED3D_TEXTURE_GET_DC_LENIENT)) return WINED3DERR_INVALIDCALL; @@ -222,10 +224,10 @@ index 74e4450..1306be9 100644 context = context_acquire(device, NULL); diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h -index ebdb49e..58c817d 100644 +index 243cc29..234b33d 100644 --- a/dlls/wined3d/wined3d_private.h +++ b/dlls/wined3d/wined3d_private.h -@@ -3073,6 +3073,7 @@ void wined3d_cs_emit_destroy_object(struct wined3d_cs *cs, +@@ -3074,6 +3074,7 @@ void wined3d_cs_emit_destroy_object(struct wined3d_cs *cs, void (*callback)(void *object), void *object) DECLSPEC_HIDDEN; void wined3d_cs_emit_draw(struct wined3d_cs *cs, int base_vertex_idx, unsigned int start_idx, unsigned int index_count, unsigned int start_instance, unsigned int instance_count, BOOL indexed) DECLSPEC_HIDDEN; diff --git a/patches/wined3d-CSMT_Main/0017-wined3d-Finish-the-cs-before-changing-the-texture-lo.patch b/patches/wined3d-CSMT_Main/0017-wined3d-Finish-the-cs-before-changing-the-texture-lo.patch index fe48277a..0d1849b2 100644 --- a/patches/wined3d-CSMT_Main/0017-wined3d-Finish-the-cs-before-changing-the-texture-lo.patch +++ b/patches/wined3d-CSMT_Main/0017-wined3d-Finish-the-cs-before-changing-the-texture-lo.patch @@ -1,20 +1,21 @@ -From 0f80ece0d6050b8850ce34cceb8e15ef57bf8af0 Mon Sep 17 00:00:00 2001 +From 2d3f1b5a6ced8163aaa6bb33f245abf67be681eb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stefan=20D=C3=B6singer?= Date: Wed, 10 Apr 2013 19:53:44 +0200 Subject: wined3d: Finish the cs before changing the texture lod --- - dlls/wined3d/texture.c | 7 +++++++ - 1 file changed, 7 insertions(+) + dlls/wined3d/texture.c | 8 +++++++- + 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/dlls/wined3d/texture.c b/dlls/wined3d/texture.c -index aae0b00..f368777 100644 +index 439f9ab..afbaac1 100644 --- a/dlls/wined3d/texture.c +++ b/dlls/wined3d/texture.c -@@ -885,6 +885,13 @@ DWORD CDECL wined3d_texture_set_lod(struct wined3d_texture *texture, DWORD lod) +@@ -1117,7 +1117,13 @@ DWORD CDECL wined3d_texture_set_lod(struct wined3d_texture *texture, DWORD lod) if (texture->lod != lod) { +- wined3d_resource_wait_idle(&texture->resource); + if (wined3d_settings.cs_multithreaded) + { + struct wined3d_device *device = texture->resource.device; @@ -26,5 +27,5 @@ index aae0b00..f368777 100644 texture->texture_rgb.base_level = ~0u; -- -2.8.0 +2.9.0 diff --git a/patches/wined3d-CSMT_Main/0037-wined3d-Replace-the-linked-lists-with-a-ringbuffer.patch b/patches/wined3d-CSMT_Main/0037-wined3d-Replace-the-linked-lists-with-a-ringbuffer.patch index 007df314..5b515013 100644 --- a/patches/wined3d-CSMT_Main/0037-wined3d-Replace-the-linked-lists-with-a-ringbuffer.patch +++ b/patches/wined3d-CSMT_Main/0037-wined3d-Replace-the-linked-lists-with-a-ringbuffer.patch @@ -1,4 +1,4 @@ -From e7e3a3a2157e282988cb3350745373259a5d040f Mon Sep 17 00:00:00 2001 +From 6494b85657fd270879356f5fcb81225f12acdd1c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stefan=20D=C3=B6singer?= Date: Thu, 4 Jul 2013 23:33:14 +0200 Subject: wined3d: Replace the linked lists with a ringbuffer @@ -9,7 +9,7 @@ Subject: wined3d: Replace the linked lists with a ringbuffer 2 files changed, 165 insertions(+), 226 deletions(-) diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c -index 6dd95af..f66056b 100644 +index 23579c4..4ebb988 100644 --- a/dlls/wined3d/cs.c +++ b/dlls/wined3d/cs.c @@ -22,20 +22,10 @@ @@ -500,16 +500,16 @@ index 6dd95af..f66056b 100644 } static UINT wined3d_cs_exec_unload_resource(struct wined3d_cs *cs, const void *data) -@@ -1791,7 +1715,7 @@ void wined3d_cs_emit_unload_resource(struct wined3d_cs *cs, struct wined3d_resou - op->opcode = WINED3D_CS_OP_UNLOAD_RESOURCE; - op->resource = resource; +@@ -1794,7 +1718,7 @@ void wined3d_cs_emit_unload_resource(struct wined3d_cs *cs, struct wined3d_resou + + wined3d_resource_acquire(resource); - cs->ops->submit(cs); + cs->ops->submit(cs, sizeof(*op)); } static UINT wined3d_cs_exec_glfinish(struct wined3d_cs *cs, const void *data) -@@ -1817,7 +1741,7 @@ void wined3d_cs_emit_glfinish(struct wined3d_cs *cs) +@@ -1820,7 +1744,7 @@ void wined3d_cs_emit_glfinish(struct wined3d_cs *cs) op = cs->ops->require_space(cs, sizeof(*op)); op->opcode = WINED3D_CS_OP_GLFINISH; @@ -518,7 +518,7 @@ index 6dd95af..f66056b 100644 } static UINT wined3d_cs_exec_set_base_vertex_index(struct wined3d_cs *cs, const void *data) -@@ -1839,7 +1763,7 @@ void wined3d_cs_emit_set_base_vertex_index(struct wined3d_cs *cs, +@@ -1842,7 +1766,7 @@ void wined3d_cs_emit_set_base_vertex_index(struct wined3d_cs *cs, op->opcode = WINED3D_CS_OP_SET_BASE_VERTEX_INDEX; op->base_vertex_index = base_vertex_index; @@ -527,7 +527,7 @@ index 6dd95af..f66056b 100644 } static UINT wined3d_cs_exec_set_primitive_type(struct wined3d_cs *cs, const void *data) -@@ -1865,7 +1789,7 @@ void wined3d_cs_emit_set_primitive_type(struct wined3d_cs *cs, GLenum primitive_ +@@ -1868,7 +1792,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; @@ -536,7 +536,7 @@ index 6dd95af..f66056b 100644 } static UINT wined3d_cs_exec_set_light(struct wined3d_cs *cs, const void *data) -@@ -1922,7 +1846,7 @@ void wined3d_cs_emit_set_light(struct wined3d_cs *cs, const struct wined3d_light +@@ -1925,7 +1849,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; @@ -545,7 +545,7 @@ index 6dd95af..f66056b 100644 } static UINT wined3d_cs_exec_set_light_enable(struct wined3d_cs *cs, const void *data) -@@ -2011,7 +1935,7 @@ void wined3d_cs_emit_set_light_enable(struct wined3d_cs *cs, UINT idx, BOOL enab +@@ -2014,7 +1938,7 @@ void wined3d_cs_emit_set_light_enable(struct wined3d_cs *cs, UINT idx, BOOL enab op->idx = idx; op->enable = enable; @@ -554,7 +554,7 @@ index 6dd95af..f66056b 100644 } static UINT wined3d_cs_exec_blt(struct wined3d_cs *cs, const void *data) -@@ -2043,7 +1967,7 @@ void wined3d_cs_emit_blt(struct wined3d_cs *cs, struct wined3d_surface *dst_surf +@@ -2046,7 +1970,7 @@ void wined3d_cs_emit_blt(struct wined3d_cs *cs, struct wined3d_surface *dst_surf if (fx) op->fx = *fx; @@ -563,7 +563,7 @@ index 6dd95af..f66056b 100644 } static UINT wined3d_cs_exec_clear_rtv(struct wined3d_cs *cs, const void *data) -@@ -2076,7 +2000,7 @@ void wined3d_cs_emit_clear_rtv(struct wined3d_cs *cs, struct wined3d_rendertarge +@@ -2079,7 +2003,7 @@ void wined3d_cs_emit_clear_rtv(struct wined3d_cs *cs, struct wined3d_rendertarge op->stencil = stencil; op->blitter = blitter; @@ -572,7 +572,7 @@ index 6dd95af..f66056b 100644 } static UINT wined3d_cs_exec_texture_map(struct wined3d_cs *cs, const void *data) -@@ -2101,12 +2025,14 @@ void *wined3d_cs_emit_texture_map(struct wined3d_cs *cs, struct wined3d_texture +@@ -2104,12 +2028,14 @@ void *wined3d_cs_emit_texture_map(struct wined3d_cs *cs, struct wined3d_texture op->flags = flags; op->mem = &ret; @@ -588,7 +588,7 @@ index 6dd95af..f66056b 100644 return ret; } -@@ -2129,11 +2055,13 @@ void wined3d_cs_emit_texture_unmap(struct wined3d_cs *cs, struct wined3d_texture +@@ -2132,11 +2058,13 @@ void wined3d_cs_emit_texture_unmap(struct wined3d_cs *cs, struct wined3d_texture op->texture = texture; op->sub_resource_idx = sub_resource_idx; @@ -603,7 +603,7 @@ index 6dd95af..f66056b 100644 /* WINED3D_CS_OP_FENCE */ wined3d_cs_exec_fence, /* WINED3D_CS_OP_PRESENT */ wined3d_cs_exec_present, /* WINED3D_CS_OP_CLEAR */ wined3d_cs_exec_clear, -@@ -2182,42 +2110,59 @@ static UINT (* const wined3d_cs_op_handlers[])(struct wined3d_cs *cs, const void +@@ -2185,42 +2113,59 @@ static UINT (* const wined3d_cs_op_handlers[])(struct wined3d_cs *cs, const void /* WINED3D_CS_OP_TEXTURE_UNMAP */ wined3d_cs_exec_texture_unmap, }; @@ -686,7 +686,7 @@ index 6dd95af..f66056b 100644 }; /* FIXME: wined3d_device_uninit_3d() should either flush and wait, or be an -@@ -2229,9 +2174,38 @@ static void wined3d_cs_emit_stop(struct wined3d_cs *cs) +@@ -2232,9 +2177,38 @@ static void wined3d_cs_emit_stop(struct wined3d_cs *cs) op = wined3d_cs_mt_require_space(cs, sizeof(*op)); op->opcode = WINED3D_CS_OP_STOP; @@ -726,7 +726,7 @@ index 6dd95af..f66056b 100644 void wined3d_cs_switch_onscreen_ds(struct wined3d_cs *cs, struct wined3d_context *context, struct wined3d_surface *depth_stencil) { -@@ -2255,31 +2229,32 @@ void wined3d_cs_switch_onscreen_ds(struct wined3d_cs *cs, +@@ -2258,31 +2232,32 @@ void wined3d_cs_switch_onscreen_ds(struct wined3d_cs *cs, static DWORD WINAPI wined3d_cs_run(void *thread_param) { struct wined3d_cs *cs = thread_param; @@ -773,7 +773,7 @@ index 6dd95af..f66056b 100644 } done: -@@ -2304,25 +2279,10 @@ struct wined3d_cs *wined3d_cs_create(struct wined3d_device *device) +@@ -2307,25 +2282,10 @@ struct wined3d_cs *wined3d_cs_create(struct wined3d_device *device) cs->ops = &wined3d_cs_st_ops; cs->device = device; @@ -799,7 +799,7 @@ index 6dd95af..f66056b 100644 if (!(cs->thread = CreateThread(NULL, 0, wined3d_cs_run, cs, 0, NULL))) { ERR("Failed to create wined3d command stream thread.\n"); -@@ -2334,12 +2294,7 @@ struct wined3d_cs *wined3d_cs_create(struct wined3d_device *device) +@@ -2337,12 +2297,7 @@ struct wined3d_cs *wined3d_cs_create(struct wined3d_device *device) err: if (cs) @@ -812,7 +812,7 @@ index 6dd95af..f66056b 100644 HeapFree(GetProcessHeap(), 0, cs); return NULL; } -@@ -2358,17 +2313,7 @@ void wined3d_cs_destroy(struct wined3d_cs *cs) +@@ -2361,17 +2316,7 @@ void wined3d_cs_destroy(struct wined3d_cs *cs) CloseHandle(cs->thread); if (ret != WAIT_OBJECT_0) ERR("Wait failed (%#x).\n", ret); diff --git a/patches/wined3d-CSMT_Main/0038-wined3d-Don-t-preload-buffers-on-unmap.patch b/patches/wined3d-CSMT_Main/0038-wined3d-Don-t-preload-buffers-on-unmap.patch index 075dd664..b3df157f 100644 --- a/patches/wined3d-CSMT_Main/0038-wined3d-Don-t-preload-buffers-on-unmap.patch +++ b/patches/wined3d-CSMT_Main/0038-wined3d-Don-t-preload-buffers-on-unmap.patch @@ -1,4 +1,4 @@ -From b7a9ab5cf76fcde0dcfadfa402587a7282b93718 Mon Sep 17 00:00:00 2001 +From 25fcdc6e671df8cf7cb68a50e6dc59921a8c2738 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stefan=20D=C3=B6singer?= Date: Thu, 4 Jul 2013 23:40:56 +0200 Subject: wined3d: Don't preload buffers on unmap @@ -8,20 +8,20 @@ Subject: wined3d: Don't preload buffers on unmap 1 file changed, 4 deletions(-) diff --git a/dlls/wined3d/buffer.c b/dlls/wined3d/buffer.c -index a50bba4..2c66a4b 100644 +index 85886bf..3ecd46b 100644 --- a/dlls/wined3d/buffer.c +++ b/dlls/wined3d/buffer.c -@@ -1133,10 +1133,6 @@ void CDECL wined3d_buffer_unmap(struct wined3d_buffer *buffer) +@@ -1108,10 +1108,6 @@ void CDECL wined3d_buffer_unmap(struct wined3d_buffer *buffer) buffer_clear_dirty_areas(buffer); buffer->map_ptr = NULL; } - else if (buffer->flags & WINED3D_BUFFER_HASDESC) - { -- wined3d_buffer_preload(buffer); +- wined3d_resource_preload(&buffer->resource); - } } HRESULT wined3d_buffer_copy(struct wined3d_buffer *dst_buffer, unsigned int dst_offset, -- -2.8.0 +2.9.0 diff --git a/patches/wined3d-CSMT_Main/0051-wined3d-Send-texture-preloads-through-the-CS.patch b/patches/wined3d-CSMT_Main/0051-wined3d-Send-texture-preloads-through-the-CS.patch index 6541403c..4060b38f 100644 --- a/patches/wined3d-CSMT_Main/0051-wined3d-Send-texture-preloads-through-the-CS.patch +++ b/patches/wined3d-CSMT_Main/0051-wined3d-Send-texture-preloads-through-the-CS.patch @@ -1,16 +1,16 @@ -From 37b8a4fd33c54e561d3da0e57319b333df55bdbd Mon Sep 17 00:00:00 2001 +From 378cf53090eb9cd3f4ba691671913e1c9ba36872 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stefan=20D=C3=B6singer?= Date: Thu, 1 Aug 2013 00:10:40 +0200 Subject: wined3d: Send texture preloads through the CS --- dlls/wined3d/cs.c | 32 ++++++++++++++++++++++++++++++++ - dlls/wined3d/texture.c | 6 ++---- + dlls/wined3d/texture.c | 7 ++----- dlls/wined3d/wined3d_private.h | 1 + - 3 files changed, 35 insertions(+), 4 deletions(-) + 3 files changed, 35 insertions(+), 5 deletions(-) diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c -index 550dbcd..6f78651 100644 +index a36d205..b7c33ab 100644 --- a/dlls/wined3d/cs.c +++ b/dlls/wined3d/cs.c @@ -72,6 +72,7 @@ enum wined3d_cs_op @@ -34,7 +34,7 @@ index 550dbcd..6f78651 100644 static void wined3d_cs_mt_submit(struct wined3d_cs *cs, size_t size) { LONG new_val = (cs->queue.head + size) & (WINED3D_CS_QUEUE_SIZE - 1); -@@ -2095,6 +2102,30 @@ void wined3d_cs_emit_texture_unmap(struct wined3d_cs *cs, struct wined3d_texture +@@ -2098,6 +2105,30 @@ void wined3d_cs_emit_texture_unmap(struct wined3d_cs *cs, struct wined3d_texture cs->ops->submit(cs, sizeof(*op)); } @@ -65,7 +65,7 @@ index 550dbcd..6f78651 100644 static UINT (* const wined3d_cs_op_handlers[])(struct wined3d_cs *cs, const void *data) = { /* WINED3D_CS_OP_NOP */ wined3d_cs_exec_nop, -@@ -2145,6 +2176,7 @@ static UINT (* const wined3d_cs_op_handlers[])(struct wined3d_cs *cs, const void +@@ -2148,6 +2179,7 @@ static UINT (* const wined3d_cs_op_handlers[])(struct wined3d_cs *cs, const void /* WINED3D_CS_OP_CLEAR_RTV */ wined3d_cs_exec_clear_rtv, /* WINED3D_CS_OP_TEXTURE_MAP */ wined3d_cs_exec_texture_map, /* WINED3D_CS_OP_TEXTURE_UNMAP */ wined3d_cs_exec_texture_unmap, @@ -74,27 +74,28 @@ index 550dbcd..6f78651 100644 static inline void *_wined3d_cs_mt_require_space(struct wined3d_cs *cs, size_t size, BOOL prio) diff --git a/dlls/wined3d/texture.c b/dlls/wined3d/texture.c -index 1acf5d5..19105a5 100644 +index b391afd..4c8856d 100644 --- a/dlls/wined3d/texture.c +++ b/dlls/wined3d/texture.c -@@ -1051,10 +1051,8 @@ void wined3d_texture_load(struct wined3d_texture *texture, - - void CDECL wined3d_texture_preload(struct wined3d_texture *texture) +@@ -1684,11 +1684,8 @@ static ULONG texture_resource_decref(struct wined3d_resource *resource) + static void texture_resource_preload(struct wined3d_resource *resource) { + struct wined3d_texture *texture = texture_from_resource(resource); - struct wined3d_context *context; -- context = context_acquire(texture->resource.device, NULL); +- +- context = context_acquire(resource->device, NULL); - wined3d_texture_load(texture, context, texture->flags & WINED3D_TEXTURE_IS_SRGB); - context_release(context); + const struct wined3d_device *device = texture->resource.device; + wined3d_cs_emit_texture_preload(device->cs, texture); } - void * CDECL wined3d_texture_get_parent(const struct wined3d_texture *texture) + static void wined3d_texture_unload(struct wined3d_resource *resource) diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h -index 949fb07..5f918f7 100644 +index 784a622..fc825a9 100644 --- a/dlls/wined3d/wined3d_private.h +++ b/dlls/wined3d/wined3d_private.h -@@ -3153,6 +3153,7 @@ void wined3d_cs_emit_set_vertex_declaration(struct wined3d_cs *cs, +@@ -3154,6 +3154,7 @@ 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_texture_map(struct wined3d_cs *cs, struct wined3d_texture *texture, unsigned int sub_resource_idx, DWORD flags) DECLSPEC_HIDDEN; diff --git a/patches/wined3d-CSMT_Main/0084-wined3d-Ignore-buffer-resource.map_count-in-the-CS.patch b/patches/wined3d-CSMT_Main/0084-wined3d-Ignore-buffer-resource.map_count-in-the-CS.patch index 898dcdd8..ea1f1a2f 100644 --- a/patches/wined3d-CSMT_Main/0084-wined3d-Ignore-buffer-resource.map_count-in-the-CS.patch +++ b/patches/wined3d-CSMT_Main/0084-wined3d-Ignore-buffer-resource.map_count-in-the-CS.patch @@ -1,4 +1,4 @@ -From 29831b11a874263e360db38a16f3497dcdf1f7af Mon Sep 17 00:00:00 2001 +From 7c04fd95e744e6c5108828ee35e6074ed3e20bf9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stefan=20D=C3=B6singer?= Date: Sat, 6 Jul 2013 22:52:06 +0200 Subject: wined3d: Ignore buffer->resource.map_count in the CS @@ -14,10 +14,10 @@ incrementing map_count. 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/dlls/wined3d/buffer.c b/dlls/wined3d/buffer.c -index e51a87e..e652695 100644 +index b154c24..6ea1e5e 100644 --- a/dlls/wined3d/buffer.c +++ b/dlls/wined3d/buffer.c -@@ -461,7 +461,8 @@ void buffer_get_memory(struct wined3d_buffer *buffer, struct wined3d_context *co +@@ -464,7 +464,8 @@ void buffer_get_memory(struct wined3d_buffer *buffer, struct wined3d_context *co data->buffer_object = buffer->buffer_object; if (!buffer->buffer_object) { @@ -27,7 +27,7 @@ index e51a87e..e652695 100644 { buffer_create_buffer_object(buffer, context); if (buffer->buffer_object) -@@ -737,12 +738,6 @@ void buffer_internal_preload(struct wined3d_buffer *buffer, struct wined3d_conte +@@ -755,12 +756,6 @@ void buffer_internal_preload(struct wined3d_buffer *buffer, struct wined3d_conte TRACE("buffer %p.\n", buffer); @@ -40,11 +40,11 @@ index e51a87e..e652695 100644 buffer_mark_used(buffer); if (!buffer->buffer_object) -@@ -933,6 +928,12 @@ void CDECL wined3d_buffer_preload(struct wined3d_buffer *buffer) +@@ -1246,6 +1241,12 @@ static void buffer_resource_preload(struct wined3d_resource *resource) struct wined3d_context *context; - struct wined3d_device *device = buffer->resource.device; + struct wined3d_device *device = resource->device; -+ if (buffer->resource.map_count) ++ if (resource->map_count) + { + WARN("Buffer is mapped, skipping preload.\n"); + return; @@ -54,5 +54,5 @@ index e51a87e..e652695 100644 { FIXME("Waiting for cs.\n"); -- -2.8.0 +2.9.0 diff --git a/patches/wined3d-CSMT_Main/0085-wined3d-Send-buffer-preloads-through-the-CS.patch b/patches/wined3d-CSMT_Main/0085-wined3d-Send-buffer-preloads-through-the-CS.patch index cdd924dc..c7eff01b 100644 --- a/patches/wined3d-CSMT_Main/0085-wined3d-Send-buffer-preloads-through-the-CS.patch +++ b/patches/wined3d-CSMT_Main/0085-wined3d-Send-buffer-preloads-through-the-CS.patch @@ -1,4 +1,4 @@ -From 366a6468228b98fd526e614503364b61a4d6b61b Mon Sep 17 00:00:00 2001 +From 9718a2a0fb3ca81fc32a5ffc97522ae448363a9d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stefan=20D=C3=B6singer?= Date: Sun, 7 Jul 2013 12:02:59 +0200 Subject: wined3d: Send buffer preloads through the CS @@ -13,18 +13,18 @@ the dirty area list, have to be considered. 3 files changed, 33 insertions(+), 11 deletions(-) diff --git a/dlls/wined3d/buffer.c b/dlls/wined3d/buffer.c -index 1da6f03..8b6d6b6 100644 +index 6ea1e5e..2625d9d 100644 --- a/dlls/wined3d/buffer.c +++ b/dlls/wined3d/buffer.c -@@ -929,7 +929,6 @@ void buffer_internal_preload(struct wined3d_buffer *buffer, struct wined3d_conte +@@ -1238,7 +1238,6 @@ static ULONG buffer_resource_decref(struct wined3d_resource *resource) - void CDECL wined3d_buffer_preload(struct wined3d_buffer *buffer) + static void buffer_resource_preload(struct wined3d_resource *resource) { - struct wined3d_context *context; - struct wined3d_device *device = buffer->resource.device; + struct wined3d_device *device = resource->device; - if (buffer->resource.map_count) -@@ -938,16 +937,7 @@ void CDECL wined3d_buffer_preload(struct wined3d_buffer *buffer) + if (resource->map_count) +@@ -1247,16 +1246,7 @@ static void buffer_resource_preload(struct wined3d_resource *resource) return; } @@ -35,15 +35,15 @@ index 1da6f03..8b6d6b6 100644 - device->cs->ops->finish(device->cs); - } - -- context = context_acquire(buffer->resource.device, NULL); -- buffer_internal_preload(buffer, context, NULL); +- context = context_acquire(device, NULL); +- buffer_internal_preload(buffer_from_resource(resource), context, NULL); - context_release(context); -+ wined3d_cs_emit_buffer_preload(device->cs, buffer); ++ wined3d_cs_emit_buffer_preload(device->cs, buffer_from_resource(resource)); } - struct wined3d_resource * CDECL wined3d_buffer_get_resource(struct wined3d_buffer *buffer) + static HRESULT buffer_resource_sub_resource_map(struct wined3d_resource *resource, unsigned int sub_resource_idx, diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c -index 9e8539d..650290b 100644 +index aee2f60..f24a37d 100644 --- a/dlls/wined3d/cs.c +++ b/dlls/wined3d/cs.c @@ -75,6 +75,7 @@ enum wined3d_cs_op @@ -67,7 +67,7 @@ index 9e8539d..650290b 100644 static void wined3d_cs_mt_submit(struct wined3d_cs *cs, size_t size) { LONG new_val = (cs->queue.head + size) & (WINED3D_CS_QUEUE_SIZE - 1); -@@ -2390,6 +2397,29 @@ void wined3d_cs_emit_buffer_invalidate_bo_range(struct wined3d_cs *cs, +@@ -2393,6 +2400,29 @@ void wined3d_cs_emit_buffer_invalidate_bo_range(struct wined3d_cs *cs, cs->ops->submit(cs, sizeof(*op)); } @@ -97,7 +97,7 @@ index 9e8539d..650290b 100644 static UINT (* const wined3d_cs_op_handlers[])(struct wined3d_cs *cs, const void *data) = { /* WINED3D_CS_OP_NOP */ wined3d_cs_exec_nop, -@@ -2443,6 +2473,7 @@ static UINT (* const wined3d_cs_op_handlers[])(struct wined3d_cs *cs, const void +@@ -2446,6 +2476,7 @@ static UINT (* const wined3d_cs_op_handlers[])(struct wined3d_cs *cs, const void /* WINED3D_CS_OP_TEXTURE_UNMAP */ wined3d_cs_exec_texture_unmap, /* WINED3D_CS_OP_BUFFER_SWAP_MEM */ wined3d_cs_exec_buffer_swap_mem, /* WINED3D_CS_OP_BUFFER_INVALIDATE_RANGE */ wined3d_cs_exec_buffer_invalidate_bo_range, @@ -106,10 +106,10 @@ index 9e8539d..650290b 100644 /* WINED3D_CS_OP_UPDATE_TEXTURE */ wined3d_cs_exec_update_texture, /* WINED3D_CS_OP_UPDATE_SUB_RESOURCE */ wined3d_cs_exec_update_sub_resource, diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h -index f23efe7..dc70283 100644 +index 14585d1..4c64b9a 100644 --- a/dlls/wined3d/wined3d_private.h +++ b/dlls/wined3d/wined3d_private.h -@@ -3104,6 +3104,7 @@ void wined3d_cs_emit_blt(struct wined3d_cs *cs, struct wined3d_surface *dst_surf +@@ -3105,6 +3105,7 @@ 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_buffer_invalidate_bo_range(struct wined3d_cs *cs, struct wined3d_buffer *buffer, unsigned int offset, unsigned int size) DECLSPEC_HIDDEN; diff --git a/patches/wined3d-CSMT_Main/0099-wined3d-Unload-resources-through-the-CS-in-device_re.patch b/patches/wined3d-CSMT_Main/0099-wined3d-Unload-resources-through-the-CS-in-device_re.patch index 586d4481..11cc7a69 100644 --- a/patches/wined3d-CSMT_Main/0099-wined3d-Unload-resources-through-the-CS-in-device_re.patch +++ b/patches/wined3d-CSMT_Main/0099-wined3d-Unload-resources-through-the-CS-in-device_re.patch @@ -1,43 +1,25 @@ -From 88fc47f261800a4c622935e5ad03dae71215c3ac Mon Sep 17 00:00:00 2001 +From 39344ce1023a10cf7303f75c50aee588f6ec4e45 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stefan=20D=C3=B6singer?= Date: Wed, 2 Oct 2013 23:40:20 +0200 Subject: wined3d: Unload resources through the CS in device_reset. --- - dlls/wined3d/device.c | 10 ++++++---- - 1 file changed, 6 insertions(+), 4 deletions(-) + dlls/wined3d/device.c | 2 ++ + 1 file changed, 2 insertions(+) diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c -index 44ff6fc..2b5c063 100644 +index 632754d6..efd4c1b 100644 --- a/dlls/wined3d/device.c +++ b/dlls/wined3d/device.c -@@ -4559,20 +4559,22 @@ static void delete_opengl_contexts(struct wined3d_device *device, struct wined3d - struct wined3d_context *context; - struct wined3d_shader *shader; - -- context = context_acquire(device, NULL); -- gl_info = context->gl_info; -- - LIST_FOR_EACH_ENTRY_SAFE(resource, cursor, &device->resources, struct wined3d_resource, resource_list_entry) - { +@@ -4562,6 +4562,8 @@ static void delete_opengl_contexts(struct wined3d_device *device, struct wined3d TRACE("Unloading resource %p.\n", resource); -- resource->resource_ops->resource_unload(resource); -+ wined3d_cs_emit_unload_resource(device->cs, resource); + wined3d_cs_emit_unload_resource(device->cs, resource); } + if (wined3d_settings.cs_multithreaded) + device->cs->ops->finish(device->cs); LIST_FOR_EACH_ENTRY(shader, &device->shaders, struct wined3d_shader, shader_list_entry) { - device->shader_backend->shader_destroy(shader); - } - -+ context = context_acquire(device, NULL); -+ gl_info = context->gl_info; -+ - if (device->depth_blt_texture) - { - gl_info->gl_ops.gl.p_glDeleteTextures(1, &device->depth_blt_texture); -- 2.9.0 diff --git a/patches/wined3d-CSMT_Main/0102-wined3d-Invoke-surface_unload-through-the-CS-in-wine.patch b/patches/wined3d-CSMT_Main/0102-wined3d-Invoke-surface_unload-through-the-CS-in-wine.patch index 51aebaae..8cda9fb0 100644 --- a/patches/wined3d-CSMT_Main/0102-wined3d-Invoke-surface_unload-through-the-CS-in-wine.patch +++ b/patches/wined3d-CSMT_Main/0102-wined3d-Invoke-surface_unload-through-the-CS-in-wine.patch @@ -1,4 +1,4 @@ -From 66785672e0f1887700cde16403d79a112065d15c Mon Sep 17 00:00:00 2001 +From bb2ad8b5ff5321f5436dcc30b9300e40fb18265c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stefan=20D=C3=B6singer?= Date: Fri, 11 Oct 2013 12:09:37 +0200 Subject: wined3d: Invoke surface_unload through the CS in @@ -7,20 +7,19 @@ Subject: wined3d: Invoke surface_unload through the CS in This fixes another case where we use a GL context in the main thread and crash fglrx in doing so. --- - dlls/wined3d/texture.c | 5 ++++- - 1 file changed, 4 insertions(+), 1 deletion(-) + dlls/wined3d/texture.c | 3 +++ + 1 file changed, 3 insertions(+) diff --git a/dlls/wined3d/texture.c b/dlls/wined3d/texture.c -index e25c121..4e57a58 100644 +index 333faca..33342ba 100644 --- a/dlls/wined3d/texture.c +++ b/dlls/wined3d/texture.c -@@ -1255,7 +1255,10 @@ HRESULT CDECL wined3d_texture_update_desc(struct wined3d_texture *texture, UINT +@@ -1249,7 +1249,10 @@ HRESULT CDECL wined3d_texture_update_desc(struct wined3d_texture *texture, UINT } if (device->d3d_initialized) -- texture->resource.resource_ops->resource_unload(&texture->resource); + { -+ wined3d_cs_emit_unload_resource(device->cs, &texture->resource); + wined3d_cs_emit_unload_resource(device->cs, &texture->resource); + device->cs->ops->finish(device->cs); + } diff --git a/patches/wined3d-CSMT_Main/9999-IfDefined.patch b/patches/wined3d-CSMT_Main/9999-IfDefined.patch index f5162f77..11c453d5 100644 --- a/patches/wined3d-CSMT_Main/9999-IfDefined.patch +++ b/patches/wined3d-CSMT_Main/9999-IfDefined.patch @@ -243,30 +243,7 @@ diff --git a/dlls/wined3d/buffer.c b/dlls/wined3d/buffer.c buffer_mark_used(buffer); if (!buffer->buffer_object) -@@ -930,10 +992,22 @@ void buffer_internal_preload(struct wined3d_buffer *buffer, struct wined3d_conte - - void CDECL wined3d_buffer_preload(struct wined3d_buffer *buffer) - { -+#if !defined(STAGING_CSMT) - struct wined3d_context *context; - context = context_acquire(buffer->resource.device, NULL); - buffer_internal_preload(buffer, context, NULL); - context_release(context); -+#else /* STAGING_CSMT */ -+ struct wined3d_device *device = buffer->resource.device; -+ -+ if (buffer->resource.map_count) -+ { -+ WARN("Buffer is mapped, skipping preload.\n"); -+ return; -+ } -+ -+ wined3d_cs_emit_buffer_preload(device->cs, buffer); -+#endif /* STAGING_CSMT */ - } - - struct wined3d_resource * CDECL wined3d_buffer_get_resource(struct wined3d_buffer *buffer) -@@ -947,9 +1021,34 @@ HRESULT CDECL wined3d_buffer_map(struct wined3d_buffer *buffer, UINT offset, UIN +@@ -939,9 +1001,34 @@ HRESULT CDECL wined3d_buffer_map(struct wined3d_buffer *buffer, UINT offset, UIN { LONG count; BYTE *base; @@ -301,7 +278,7 @@ diff --git a/dlls/wined3d/buffer.c b/dlls/wined3d/buffer.c flags = wined3d_resource_sanitize_map_flags(&buffer->resource, flags); /* Filter redundant WINED3D_MAP_DISCARD maps. The 3DMark2001 multitexture * fill rate test seems to depend on this. When we map a buffer with -@@ -957,7 +1056,11 @@ HRESULT CDECL wined3d_buffer_map(struct wined3d_buffer *buffer, UINT offset, UIN +@@ -949,7 +1036,11 @@ HRESULT CDECL wined3d_buffer_map(struct wined3d_buffer *buffer, UINT offset, UIN * previous contents of the buffer. The r600g driver only does this when * the buffer is currently in use, while the proprietary NVIDIA driver * appears to do this unconditionally. */ @@ -313,7 +290,7 @@ diff --git a/dlls/wined3d/buffer.c b/dlls/wined3d/buffer.c flags &= ~WINED3D_MAP_DISCARD; count = ++buffer->resource.map_count; -@@ -968,17 +1071,34 @@ HRESULT CDECL wined3d_buffer_map(struct wined3d_buffer *buffer, UINT offset, UIN +@@ -960,17 +1051,34 @@ HRESULT CDECL wined3d_buffer_map(struct wined3d_buffer *buffer, UINT offset, UIN * being uploaded in that case. Two such applications are Port Royale * and Darkstar One. */ if (flags & WINED3D_MAP_DISCARD) @@ -348,7 +325,7 @@ diff --git a/dlls/wined3d/buffer.c b/dlls/wined3d/buffer.c context = context_acquire(device, NULL); gl_info = context->gl_info; -@@ -1024,11 +1144,14 @@ HRESULT CDECL wined3d_buffer_map(struct wined3d_buffer *buffer, UINT offset, UIN +@@ -1016,11 +1124,14 @@ HRESULT CDECL wined3d_buffer_map(struct wined3d_buffer *buffer, UINT offset, UIN buffer_get_sysmem(buffer, context); } TRACE("New pointer is %p.\n", buffer->resource.heap_memory); @@ -363,7 +340,7 @@ diff --git a/dlls/wined3d/buffer.c b/dlls/wined3d/buffer.c if (flags & WINED3D_MAP_DISCARD) buffer->flags |= WINED3D_BUFFER_DISCARD; -@@ -1037,6 +1160,43 @@ HRESULT CDECL wined3d_buffer_map(struct wined3d_buffer *buffer, UINT offset, UIN +@@ -1029,6 +1140,43 @@ HRESULT CDECL wined3d_buffer_map(struct wined3d_buffer *buffer, UINT offset, UIN } base = buffer->map_ptr ? buffer->map_ptr : buffer->resource.heap_memory; @@ -407,7 +384,7 @@ diff --git a/dlls/wined3d/buffer.c b/dlls/wined3d/buffer.c *data = base + offset; TRACE("Returning memory at %p (base %p, offset %u).\n", *data, base, offset); -@@ -1099,17 +1259,25 @@ void CDECL wined3d_buffer_unmap(struct wined3d_buffer *buffer) +@@ -1091,17 +1239,25 @@ void CDECL wined3d_buffer_unmap(struct wined3d_buffer *buffer) } GL_EXTCALL(glUnmapBuffer(buffer->buffer_type_hint)); @@ -427,13 +404,37 @@ diff --git a/dlls/wined3d/buffer.c b/dlls/wined3d/buffer.c +#if !defined(STAGING_CSMT) else if (buffer->flags & WINED3D_BUFFER_HASDESC) { - wined3d_buffer_preload(buffer); + wined3d_resource_preload(&buffer->resource); } +#endif /* STAGING_CSMT */ } HRESULT wined3d_buffer_copy(struct wined3d_buffer *dst_buffer, unsigned int dst_offset, -@@ -1301,6 +1469,9 @@ static HRESULT buffer_init(struct wined3d_buffer *buffer, struct wined3d_device +@@ -1219,11 +1375,23 @@ static ULONG buffer_resource_decref(struct wined3d_resource *resource) + + static void buffer_resource_preload(struct wined3d_resource *resource) + { ++#if !defined(STAGING_CSMT) + struct wined3d_context *context; + + context = context_acquire(resource->device, NULL); + buffer_internal_preload(buffer_from_resource(resource), context, NULL); + context_release(context); ++#else /* STAGING_CSMT */ ++ struct wined3d_device *device = resource->device; ++ ++ if (resource->map_count) ++ { ++ WARN("Buffer is mapped, skipping preload.\n"); ++ return; ++ } ++ ++ wined3d_cs_emit_buffer_preload(device->cs, buffer_from_resource(resource)); ++#endif /* STAGING_CSMT */ + } + + static HRESULT buffer_resource_sub_resource_map(struct wined3d_resource *resource, unsigned int sub_resource_idx, +@@ -1303,6 +1471,9 @@ static HRESULT buffer_init(struct wined3d_buffer *buffer, struct wined3d_device return hr; } buffer->buffer_type_hint = bind_hint; @@ -443,7 +444,7 @@ diff --git a/dlls/wined3d/buffer.c b/dlls/wined3d/buffer.c TRACE("size %#x, usage %#x, format %s, memory @ %p, iface @ %p.\n", buffer->resource.size, buffer->resource.usage, debug_d3dformat(buffer->resource.format->id), buffer->resource.heap_memory, buffer); -@@ -1336,6 +1507,11 @@ static HRESULT buffer_init(struct wined3d_buffer *buffer, struct wined3d_device +@@ -1338,6 +1509,11 @@ static HRESULT buffer_init(struct wined3d_buffer *buffer, struct wined3d_device buffer->flags |= WINED3D_BUFFER_USE_BO; } @@ -455,7 +456,7 @@ diff --git a/dlls/wined3d/buffer.c b/dlls/wined3d/buffer.c if (!(buffer->maps = HeapAlloc(GetProcessHeap(), 0, sizeof(*buffer->maps)))) { ERR("Out of memory.\n"); -@@ -1463,3 +1639,12 @@ HRESULT CDECL wined3d_buffer_create_ib(struct wined3d_device *device, UINT size, +@@ -1465,3 +1641,12 @@ HRESULT CDECL wined3d_buffer_create_ib(struct wined3d_device *device, UINT size, return WINED3D_OK; } @@ -2245,7 +2246,7 @@ diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c } void wined3d_cs_emit_query_issue(struct wined3d_cs *cs, struct wined3d_query *query, DWORD flags) -@@ -1247,15 +2244,26 @@ void wined3d_cs_emit_query_issue(struct wined3d_cs *cs, struct wined3d_query *qu +@@ -1247,16 +2244,27 @@ void wined3d_cs_emit_query_issue(struct wined3d_cs *cs, struct wined3d_query *qu op->query = query; op->flags = flags; @@ -2265,6 +2266,7 @@ diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c struct wined3d_resource *resource = op->resource; resource->resource_ops->resource_unload(resource); + wined3d_resource_release(resource); +#if defined(STAGING_CSMT) + + return sizeof(*op); @@ -2272,15 +2274,15 @@ diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c } void wined3d_cs_emit_unload_resource(struct wined3d_cs *cs, struct wined3d_resource *resource) -@@ -1266,6 +2274,7 @@ void wined3d_cs_emit_unload_resource(struct wined3d_cs *cs, struct wined3d_resou - op->opcode = WINED3D_CS_OP_UNLOAD_RESOURCE; - op->resource = resource; +@@ -1269,6 +2277,7 @@ void wined3d_cs_emit_unload_resource(struct wined3d_cs *cs, struct wined3d_resou + + wined3d_resource_acquire(resource); +#if !defined(STAGING_CSMT) cs->ops->submit(cs); } -@@ -1414,5 +2423,1230 @@ void wined3d_cs_destroy(struct wined3d_cs *cs) +@@ -1417,5 +2426,1230 @@ void wined3d_cs_destroy(struct wined3d_cs *cs) state_cleanup(&cs->state); HeapFree(GetProcessHeap(), 0, cs->fb.render_targets); HeapFree(GetProcessHeap(), 0, cs->data); @@ -4592,7 +4594,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) -@@ -4572,13 +5039,19 @@ void CDECL wined3d_device_evict_managed_resources(struct wined3d_device *device) +@@ -4572,19 +5039,26 @@ void CDECL wined3d_device_evict_managed_resources(struct wined3d_device *device) } } @@ -4609,28 +4611,17 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c struct wined3d_shader *shader; +#if !defined(STAGING_CSMT) - context = context_acquire(device, NULL); - gl_info = context->gl_info; - -@@ -4588,11 +5061,17 @@ static void delete_opengl_contexts(struct wined3d_device *device, struct wined3d - resource->resource_ops->resource_unload(resource); + LIST_FOR_EACH_ENTRY_SAFE(resource, cursor, &device->resources, struct wined3d_resource, resource_list_entry) + { + TRACE("Unloading resource %p.\n", resource); + wined3d_cs_emit_unload_resource(device->cs, resource); } +#endif /* STAGING_CSMT */ LIST_FOR_EACH_ENTRY(shader, &device->shaders, struct wined3d_shader, shader_list_entry) { device->shader_backend->shader_destroy(shader); - } - -+#if defined(STAGING_CSMT) -+ context = context_acquire(device, NULL); -+ gl_info = context->gl_info; -+ -+#endif /* STAGING_CSMT */ - if (device->depth_blt_texture) - { - gl_info->gl_ops.gl.p_glDeleteTextures(1, &device->depth_blt_texture); -@@ -4613,12 +5092,30 @@ static void delete_opengl_contexts(struct wined3d_device *device, struct wined3d +@@ -4613,12 +5087,30 @@ static void delete_opengl_contexts(struct wined3d_device *device, struct wined3d HeapFree(GetProcessHeap(), 0, swapchain->context); swapchain->context = NULL; @@ -4661,7 +4652,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c HRESULT hr; if (FAILED(hr = device->shader_backend->shader_alloc_private(device, -@@ -4635,6 +5132,7 @@ static HRESULT create_primary_opengl_context(struct wined3d_device *device, stru +@@ -4635,6 +5127,7 @@ static HRESULT create_primary_opengl_context(struct wined3d_device *device, stru return hr; } @@ -4669,7 +4660,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c /* Recreate the primary swapchain's context */ swapchain->context = HeapAlloc(GetProcessHeap(), 0, sizeof(*swapchain->context)); if (!swapchain->context) -@@ -4647,10 +5145,15 @@ static HRESULT create_primary_opengl_context(struct wined3d_device *device, stru +@@ -4647,10 +5140,15 @@ static HRESULT create_primary_opengl_context(struct wined3d_device *device, stru target = swapchain->back_buffers ? swapchain->back_buffers[0] : swapchain->front_buffer; if (!(context = context_create(swapchain, target, swapchain->ds_format))) @@ -4685,7 +4676,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c HeapFree(GetProcessHeap(), 0, swapchain->context); return E_FAIL; } -@@ -4660,6 +5163,12 @@ static HRESULT create_primary_opengl_context(struct wined3d_device *device, stru +@@ -4660,6 +5158,12 @@ static HRESULT create_primary_opengl_context(struct wined3d_device *device, stru create_dummy_textures(device, context); create_default_samplers(device); context_release(context); @@ -4698,7 +4689,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c return WINED3D_OK; } -@@ -4677,6 +5186,14 @@ HRESULT CDECL wined3d_device_reset(struct wined3d_device *device, +@@ -4677,6 +5181,14 @@ HRESULT CDECL wined3d_device_reset(struct wined3d_device *device, TRACE("device %p, swapchain_desc %p, mode %p, callback %p, reset_state %#x.\n", device, swapchain_desc, mode, callback, reset_state); @@ -4713,7 +4704,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c if (!(swapchain = wined3d_device_get_swapchain(device, 0))) { ERR("Failed to get the first implicit swapchain.\n"); -@@ -4695,10 +5212,16 @@ HRESULT CDECL wined3d_device_reset(struct wined3d_device *device, +@@ -4695,10 +5207,16 @@ HRESULT CDECL wined3d_device_reset(struct wined3d_device *device, wined3d_texture_decref(device->cursor_texture); device->cursor_texture = NULL; } @@ -4730,7 +4721,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c { for (i = 0; i < device->adapter->gl_info.limits.buffers; ++i) { -@@ -4707,10 +5230,22 @@ HRESULT CDECL wined3d_device_reset(struct wined3d_device *device, +@@ -4707,10 +5225,22 @@ HRESULT CDECL wined3d_device_reset(struct wined3d_device *device, } wined3d_device_set_depth_stencil_view(device, NULL); @@ -4753,7 +4744,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c } if (reset_state) -@@ -4873,27 +5408,48 @@ HRESULT CDECL wined3d_device_reset(struct wined3d_device *device, +@@ -4873,27 +5403,48 @@ HRESULT CDECL wined3d_device_reset(struct wined3d_device *device, if (device->d3d_initialized) delete_opengl_contexts(device, swapchain); @@ -4802,7 +4793,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c wined3d_cs_emit_set_scissor_rect(device->cs, &state->scissor_rect); } -@@ -4901,7 +5457,11 @@ HRESULT CDECL wined3d_device_reset(struct wined3d_device *device, +@@ -4901,7 +5452,11 @@ HRESULT CDECL wined3d_device_reset(struct wined3d_device *device, { if (reset_state) hr = create_primary_opengl_context(device, swapchain); @@ -4814,7 +4805,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 -@@ -4983,11 +5543,19 @@ void device_resource_released(struct wined3d_device *device, struct wined3d_reso +@@ -4983,11 +5538,19 @@ void device_resource_released(struct wined3d_device *device, struct wined3d_reso for (i = 0; i < device->adapter->gl_info.limits.buffers; ++i) { @@ -4834,7 +4825,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); switch (type) -@@ -5123,8 +5691,17 @@ HRESULT device_init(struct wined3d_device *device, struct wined3d *wined3d, +@@ -5123,8 +5686,17 @@ HRESULT device_init(struct wined3d_device *device, struct wined3d *wined3d, device->blitter = adapter->blitter; @@ -4852,7 +4843,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))) -@@ -5218,3 +5795,58 @@ LRESULT device_process_message(struct wined3d_device *device, HWND window, BOOL +@@ -5218,3 +5790,58 @@ LRESULT device_process_message(struct wined3d_device *device, HWND window, BOOL else return CallWindowProcA(proc, window, message, wparam, lparam); } @@ -5243,7 +5234,7 @@ diff --git a/dlls/wined3d/resource.c b/dlls/wined3d/resource.c context_resource_released(resource->device, resource, resource->type); wined3d_resource_release(resource); } -@@ -342,7 +348,11 @@ BOOL wined3d_resource_allocate_sysmem(struct wined3d_resource *resource) +@@ -347,7 +353,11 @@ BOOL wined3d_resource_allocate_sysmem(struct wined3d_resource *resource) p = (void **)(((ULONG_PTR)mem + align) & ~(RESOURCE_ALIGNMENT - 1)) - 1; *p = mem; @@ -7249,27 +7240,13 @@ diff --git a/dlls/wined3d/texture.c b/dlls/wined3d/texture.c resource_cleanup(&texture->resource); wined3d_cs_emit_destroy_object(texture->resource.device->cs, wined3d_texture_destroy_object, texture); } -@@ -949,10 +1162,15 @@ void wined3d_texture_load(struct wined3d_texture *texture, - - void CDECL wined3d_texture_preload(struct wined3d_texture *texture) - { -+#if !defined(STAGING_CSMT) - struct wined3d_context *context; - context = context_acquire(texture->resource.device, NULL); - wined3d_texture_load(texture, context, texture->flags & WINED3D_TEXTURE_IS_SRGB); - context_release(context); -+#else /* STAGING_CSMT */ -+ const struct wined3d_device *device = texture->resource.device; -+ wined3d_cs_emit_texture_preload(device->cs, texture); -+#endif /* STAGING_CSMT */ - } - - void * CDECL wined3d_texture_get_parent(const struct wined3d_texture *texture) -@@ -1015,6 +1233,15 @@ DWORD CDECL wined3d_texture_set_lod(struct wined3d_texture *texture, DWORD lod) +@@ -1007,7 +1220,17 @@ DWORD CDECL wined3d_texture_set_lod(struct wined3d_texture *texture, DWORD lod) if (texture->lod != lod) { -+#if defined(STAGING_CSMT) ++#if !defined(STAGING_CSMT) + wined3d_resource_wait_idle(&texture->resource); ++#else /* STAGING_CSMT */ + if (wined3d_settings.cs_multithreaded) + { + struct wined3d_device *device = texture->resource.device; @@ -7281,22 +7258,22 @@ diff --git a/dlls/wined3d/texture.c b/dlls/wined3d/texture.c texture->lod = lod; texture->texture_rgb.base_level = ~0u; -@@ -1135,7 +1362,14 @@ HRESULT CDECL wined3d_texture_update_desc(struct wined3d_texture *texture, UINT +@@ -1128,7 +1351,14 @@ HRESULT CDECL wined3d_texture_update_desc(struct wined3d_texture *texture, UINT } if (device->d3d_initialized) +#if !defined(STAGING_CSMT) - texture->resource.resource_ops->resource_unload(&texture->resource); ++ wined3d_cs_emit_unload_resource(device->cs, &texture->resource); +#else /* STAGING_CSMT */ + { -+ wined3d_cs_emit_unload_resource(device->cs, &texture->resource); + wined3d_cs_emit_unload_resource(device->cs, &texture->resource); + device->cs->ops->finish(device->cs); + } +#endif /* STAGING_CSMT */ sub_resource = &texture->sub_resources[0]; surface = sub_resource->u.surface; -@@ -1146,6 +1380,9 @@ HRESULT CDECL wined3d_texture_update_desc(struct wined3d_texture *texture, UINT +@@ -1139,6 +1369,9 @@ HRESULT CDECL wined3d_texture_update_desc(struct wined3d_texture *texture, UINT } wined3d_resource_free_sysmem(&texture->resource); @@ -7306,7 +7283,7 @@ diff --git a/dlls/wined3d/texture.c b/dlls/wined3d/texture.c if ((texture->row_pitch = pitch)) texture->slice_pitch = height * pitch; -@@ -1202,18 +1439,31 @@ HRESULT CDECL wined3d_texture_update_desc(struct wined3d_texture *texture, UINT +@@ -1195,18 +1428,31 @@ HRESULT CDECL wined3d_texture_update_desc(struct wined3d_texture *texture, UINT wined3d_texture_invalidate_location(texture, 0, ~valid_location); if (create_dib) @@ -7338,7 +7315,7 @@ diff --git a/dlls/wined3d/texture.c b/dlls/wined3d/texture.c if (sub_resource->buffer_object) return; -@@ -1225,6 +1475,25 @@ static void wined3d_texture_prepare_buffer_object(struct wined3d_texture *textur +@@ -1218,6 +1464,25 @@ static void wined3d_texture_prepare_buffer_object(struct wined3d_texture *textur TRACE("Created buffer object %u for texture %p, sub-resource %u.\n", sub_resource->buffer_object, texture, sub_resource_idx); @@ -7364,7 +7341,7 @@ diff --git a/dlls/wined3d/texture.c b/dlls/wined3d/texture.c } static void wined3d_texture_force_reload(struct wined3d_texture *texture) -@@ -1342,6 +1611,9 @@ BOOL wined3d_texture_prepare_location(struct wined3d_texture *texture, unsigned +@@ -1335,6 +1600,9 @@ BOOL wined3d_texture_prepare_location(struct wined3d_texture *texture, unsigned ERR("Failed to allocate system memory.\n"); return FALSE; } @@ -7374,7 +7351,7 @@ diff --git a/dlls/wined3d/texture.c b/dlls/wined3d/texture.c return TRUE; case WINED3D_LOCATION_USER_MEMORY: -@@ -1350,7 +1622,11 @@ BOOL wined3d_texture_prepare_location(struct wined3d_texture *texture, unsigned +@@ -1343,7 +1611,11 @@ BOOL wined3d_texture_prepare_location(struct wined3d_texture *texture, unsigned return TRUE; case WINED3D_LOCATION_BUFFER: @@ -7386,7 +7363,7 @@ diff --git a/dlls/wined3d/texture.c b/dlls/wined3d/texture.c return TRUE; case WINED3D_LOCATION_TEXTURE_RGB: -@@ -1405,7 +1681,9 @@ struct wined3d_texture_sub_resource *wined3d_texture_get_sub_resource(struct win +@@ -1398,7 +1670,9 @@ struct wined3d_texture_sub_resource *wined3d_texture_get_sub_resource(struct win HRESULT CDECL wined3d_texture_add_dirty_region(struct wined3d_texture *texture, UINT layer, const struct wined3d_box *dirty_region) { @@ -7396,7 +7373,7 @@ diff --git a/dlls/wined3d/texture.c b/dlls/wined3d/texture.c unsigned int sub_resource_idx; TRACE("texture %p, layer %u, dirty_region %s.\n", texture, layer, debug_box(dirty_region)); -@@ -1417,6 +1695,7 @@ HRESULT CDECL wined3d_texture_add_dirty_region(struct wined3d_texture *texture, +@@ -1410,6 +1684,7 @@ HRESULT CDECL wined3d_texture_add_dirty_region(struct wined3d_texture *texture, } sub_resource_idx = layer * texture->level_count; @@ -7404,7 +7381,7 @@ diff --git a/dlls/wined3d/texture.c b/dlls/wined3d/texture.c if (dirty_region) WARN("Ignoring dirty_region %s.\n", debug_box(dirty_region)); -@@ -1430,6 +1709,9 @@ HRESULT CDECL wined3d_texture_add_dirty_region(struct wined3d_texture *texture, +@@ -1423,6 +1698,9 @@ HRESULT CDECL wined3d_texture_add_dirty_region(struct wined3d_texture *texture, wined3d_texture_invalidate_location(texture, sub_resource_idx, ~texture->resource.map_binding); context_release(context); @@ -7414,7 +7391,7 @@ diff --git a/dlls/wined3d/texture.c b/dlls/wined3d/texture.c return WINED3D_OK; } -@@ -1460,7 +1742,12 @@ static void texture2d_upload_data(struct wined3d_texture *texture, unsigned int +@@ -1453,7 +1731,12 @@ static void texture2d_upload_data(struct wined3d_texture *texture, unsigned int static BOOL texture2d_load_location(struct wined3d_texture *texture, unsigned int sub_resource_idx, struct wined3d_context *context, DWORD location) { @@ -7427,7 +7404,24 @@ diff --git a/dlls/wined3d/texture.c b/dlls/wined3d/texture.c } /* Context activation is done by the caller. */ -@@ -1613,8 +1900,13 @@ static void wined3d_texture_unload(struct wined3d_resource *resource) +@@ -1575,11 +1858,16 @@ static ULONG texture_resource_decref(struct wined3d_resource *resource) + static void texture_resource_preload(struct wined3d_resource *resource) + { + struct wined3d_texture *texture = texture_from_resource(resource); ++#if !defined(STAGING_CSMT) + struct wined3d_context *context; + + context = context_acquire(resource->device, NULL); + wined3d_texture_load(texture, context, texture->flags & WINED3D_TEXTURE_IS_SRGB); + context_release(context); ++#else /* STAGING_CSMT */ ++ const struct wined3d_device *device = texture->resource.device; ++ wined3d_cs_emit_texture_preload(device->cs, texture); ++#endif /* STAGING_CSMT */ + } + + static void wined3d_texture_unload(struct wined3d_resource *resource) +@@ -1616,8 +1904,13 @@ static void wined3d_texture_unload(struct wined3d_resource *resource) wined3d_texture_invalidate_location(texture, i, ~WINED3D_LOCATION_DISCARDED); } @@ -7441,7 +7435,7 @@ diff --git a/dlls/wined3d/texture.c b/dlls/wined3d/texture.c if (resource->type == WINED3D_RTYPE_TEXTURE_2D) { -@@ -1639,6 +1931,89 @@ static void wined3d_texture_unload(struct wined3d_resource *resource) +@@ -1642,6 +1935,89 @@ static void wined3d_texture_unload(struct wined3d_resource *resource) wined3d_texture_unload_gl_texture(texture); } @@ -7531,7 +7525,7 @@ diff --git a/dlls/wined3d/texture.c b/dlls/wined3d/texture.c static HRESULT texture_resource_sub_resource_map(struct wined3d_resource *resource, unsigned int sub_resource_idx, struct wined3d_map_desc *map_desc, const struct wined3d_box *box, DWORD flags) { -@@ -1646,6 +2021,7 @@ static HRESULT texture_resource_sub_resource_map(struct wined3d_resource *resour +@@ -1649,6 +2025,7 @@ static HRESULT texture_resource_sub_resource_map(struct wined3d_resource *resour struct wined3d_texture_sub_resource *sub_resource; struct wined3d_device *device = resource->device; unsigned int fmt_flags = resource->format_flags; @@ -7539,7 +7533,7 @@ diff --git a/dlls/wined3d/texture.c b/dlls/wined3d/texture.c const struct wined3d_gl_info *gl_info = NULL; struct wined3d_context *context = NULL; struct wined3d_texture *texture; -@@ -1653,6 +2029,11 @@ static HRESULT texture_resource_sub_resource_map(struct wined3d_resource *resour +@@ -1656,6 +2033,11 @@ static HRESULT texture_resource_sub_resource_map(struct wined3d_resource *resour unsigned int texture_level; BYTE *base_memory; BOOL ret; @@ -7551,7 +7545,7 @@ diff --git a/dlls/wined3d/texture.c b/dlls/wined3d/texture.c TRACE("resource %p, sub_resource_idx %u, map_desc %p, box %s, flags %#x.\n", resource, sub_resource_idx, map_desc, debug_box(box), flags); -@@ -1699,14 +2080,20 @@ static HRESULT texture_resource_sub_resource_map(struct wined3d_resource *resour +@@ -1702,14 +2084,20 @@ static HRESULT texture_resource_sub_resource_map(struct wined3d_resource *resour flags = wined3d_resource_sanitize_map_flags(resource, flags); @@ -7572,7 +7566,7 @@ diff --git a/dlls/wined3d/texture.c b/dlls/wined3d/texture.c TRACE("WINED3D_MAP_DISCARD flag passed, marking %s as up to date.\n", wined3d_debug_location(texture->resource.map_binding)); if ((ret = wined3d_texture_prepare_location(texture, sub_resource_idx, -@@ -1737,6 +2124,24 @@ static HRESULT texture_resource_sub_resource_map(struct wined3d_resource *resour +@@ -1740,6 +2128,24 @@ static HRESULT texture_resource_sub_resource_map(struct wined3d_resource *resour if (context) context_release(context); @@ -7597,7 +7591,7 @@ diff --git a/dlls/wined3d/texture.c b/dlls/wined3d/texture.c if (fmt_flags & WINED3DFMT_FLAG_BROKEN_PITCH) { -@@ -1772,6 +2177,7 @@ static HRESULT texture_resource_sub_resource_map(struct wined3d_resource *resour +@@ -1775,6 +2181,7 @@ static HRESULT texture_resource_sub_resource_map(struct wined3d_resource *resour } } @@ -7605,7 +7599,7 @@ diff --git a/dlls/wined3d/texture.c b/dlls/wined3d/texture.c if (texture->swapchain && texture->swapchain->front_buffer == texture) { RECT *r = &texture->swapchain->front_buffer_update; -@@ -1783,6 +2189,7 @@ static HRESULT texture_resource_sub_resource_map(struct wined3d_resource *resour +@@ -1786,6 +2193,7 @@ static HRESULT texture_resource_sub_resource_map(struct wined3d_resource *resour TRACE("Mapped front buffer %s.\n", wine_dbgstr_rect(r)); } @@ -7613,7 +7607,7 @@ diff --git a/dlls/wined3d/texture.c b/dlls/wined3d/texture.c ++resource->map_count; ++sub_resource->map_count; -@@ -1792,14 +2199,71 @@ static HRESULT texture_resource_sub_resource_map(struct wined3d_resource *resour +@@ -1795,14 +2203,71 @@ static HRESULT texture_resource_sub_resource_map(struct wined3d_resource *resour return WINED3D_OK; } @@ -7685,7 +7679,7 @@ diff --git a/dlls/wined3d/texture.c b/dlls/wined3d/texture.c TRACE("resource %p, sub_resource_idx %u.\n", resource, sub_resource_idx); -@@ -1815,6 +2279,7 @@ static HRESULT texture_resource_sub_resource_unmap(struct wined3d_resource *reso +@@ -1818,6 +2283,7 @@ static HRESULT texture_resource_sub_resource_unmap(struct wined3d_resource *reso return WINEDDERR_NOTLOCKED; } @@ -7693,7 +7687,7 @@ diff --git a/dlls/wined3d/texture.c b/dlls/wined3d/texture.c if (device->d3d_initialized) { context = context_acquire(device, NULL); -@@ -1835,6 +2300,15 @@ static HRESULT texture_resource_sub_resource_unmap(struct wined3d_resource *reso +@@ -1838,6 +2304,15 @@ static HRESULT texture_resource_sub_resource_unmap(struct wined3d_resource *reso else if (resource->format_flags & (WINED3DFMT_FLAG_DEPTH | WINED3DFMT_FLAG_STENCIL)) { FIXME("Depth / stencil buffer locking is not implemented.\n"); @@ -7709,7 +7703,7 @@ diff --git a/dlls/wined3d/texture.c b/dlls/wined3d/texture.c } --sub_resource->map_count; -@@ -2066,11 +2540,23 @@ static HRESULT texture_init(struct wined3d_texture *texture, const struct wined3 +@@ -2070,11 +2545,23 @@ static HRESULT texture_init(struct wined3d_texture *texture, const struct wined3 TRACE("Created surface level %u, layer %u @ %p.\n", i, j, surface); @@ -7733,7 +7727,7 @@ diff --git a/dlls/wined3d/texture.c b/dlls/wined3d/texture.c } } } -@@ -2207,7 +2693,9 @@ static BOOL texture3d_load_location(struct wined3d_texture *texture, unsigned in +@@ -2211,7 +2698,9 @@ static BOOL texture3d_load_location(struct wined3d_texture *texture, unsigned in struct wined3d_context *context, DWORD location) { struct wined3d_texture_sub_resource *sub_resource = &texture->sub_resources[sub_resource_idx]; @@ -7743,7 +7737,7 @@ diff --git a/dlls/wined3d/texture.c b/dlls/wined3d/texture.c unsigned int row_pitch, slice_pitch; TRACE("texture %p, sub_resource_idx %u, context %p, location %s.\n", -@@ -2215,6 +2703,7 @@ static BOOL texture3d_load_location(struct wined3d_texture *texture, unsigned in +@@ -2219,6 +2708,7 @@ static BOOL texture3d_load_location(struct wined3d_texture *texture, unsigned in TRACE("Current resource location %s.\n", wined3d_debug_location(sub_resource->locations)); @@ -7751,7 +7745,7 @@ diff --git a/dlls/wined3d/texture.c b/dlls/wined3d/texture.c if ((sub_resource->locations & location) == location) { TRACE("Location(s) already up to date.\n"); -@@ -2228,9 +2717,11 @@ static BOOL texture3d_load_location(struct wined3d_texture *texture, unsigned in +@@ -2232,9 +2722,11 @@ static BOOL texture3d_load_location(struct wined3d_texture *texture, unsigned in return FALSE; } @@ -7763,7 +7757,7 @@ diff --git a/dlls/wined3d/texture.c b/dlls/wined3d/texture.c if (sub_resource->locations & WINED3D_LOCATION_DISCARDED) { TRACE("Volume previously discarded, nothing to do.\n"); -@@ -2239,6 +2730,7 @@ static BOOL texture3d_load_location(struct wined3d_texture *texture, unsigned in +@@ -2243,6 +2735,7 @@ static BOOL texture3d_load_location(struct wined3d_texture *texture, unsigned in goto done; } @@ -7771,7 +7765,7 @@ diff --git a/dlls/wined3d/texture.c b/dlls/wined3d/texture.c switch (location) { case WINED3D_LOCATION_TEXTURE_RGB: -@@ -2254,7 +2746,11 @@ static BOOL texture3d_load_location(struct wined3d_texture *texture, unsigned in +@@ -2258,7 +2751,11 @@ static BOOL texture3d_load_location(struct wined3d_texture *texture, unsigned in } else if (sub_resource->locations & WINED3D_LOCATION_BUFFER) { @@ -7783,7 +7777,7 @@ diff --git a/dlls/wined3d/texture.c b/dlls/wined3d/texture.c wined3d_texture_bind_and_dirtify(texture, context, location == WINED3D_LOCATION_TEXTURE_SRGB); wined3d_texture_get_pitch(texture, sub_resource_idx, &row_pitch, &slice_pitch); -@@ -2300,7 +2796,11 @@ static BOOL texture3d_load_location(struct wined3d_texture *texture, unsigned in +@@ -2304,7 +2801,11 @@ static BOOL texture3d_load_location(struct wined3d_texture *texture, unsigned in case WINED3D_LOCATION_BUFFER: if (sub_resource->locations & (WINED3D_LOCATION_TEXTURE_RGB | WINED3D_LOCATION_TEXTURE_SRGB)) { @@ -7795,7 +7789,7 @@ diff --git a/dlls/wined3d/texture.c b/dlls/wined3d/texture.c if (sub_resource->locations & WINED3D_LOCATION_TEXTURE_RGB) wined3d_texture_bind_and_dirtify(texture, context, FALSE); -@@ -2323,7 +2823,9 @@ static BOOL texture3d_load_location(struct wined3d_texture *texture, unsigned in +@@ -2327,7 +2828,9 @@ static BOOL texture3d_load_location(struct wined3d_texture *texture, unsigned in return FALSE; } @@ -7805,7 +7799,7 @@ diff --git a/dlls/wined3d/texture.c b/dlls/wined3d/texture.c wined3d_texture_validate_location(texture, sub_resource_idx, location); return TRUE; -@@ -2498,6 +3000,9 @@ static HRESULT volumetexture_init(struct wined3d_texture *texture, const struct +@@ -2502,6 +3005,9 @@ static HRESULT volumetexture_init(struct wined3d_texture *texture, const struct if (wined3d_texture_use_pbo(texture, gl_info)) { wined3d_resource_free_sysmem(&texture->resource); @@ -7815,7 +7809,7 @@ diff --git a/dlls/wined3d/texture.c b/dlls/wined3d/texture.c texture->resource.map_binding = WINED3D_LOCATION_BUFFER; } -@@ -2854,13 +3359,47 @@ HRESULT CDECL wined3d_texture_create(struct wined3d_device *device, const struct +@@ -2858,13 +3364,47 @@ HRESULT CDECL wined3d_texture_create(struct wined3d_device *device, const struct return WINED3D_OK; } @@ -7863,7 +7857,7 @@ diff --git a/dlls/wined3d/texture.c b/dlls/wined3d/texture.c TRACE("texture %p, sub_resource_idx %u, dc %p.\n", texture, sub_resource_idx, dc); -@@ -2878,6 +3417,7 @@ HRESULT CDECL wined3d_texture_get_dc(struct wined3d_texture *texture, unsigned i +@@ -2882,6 +3422,7 @@ HRESULT CDECL wined3d_texture_get_dc(struct wined3d_texture *texture, unsigned i if (texture->resource.map_count && !(texture->flags & WINED3D_TEXTURE_GET_DC_LENIENT)) return WINED3DERR_INVALIDCALL; @@ -7871,7 +7865,7 @@ diff --git a/dlls/wined3d/texture.c b/dlls/wined3d/texture.c if (device->d3d_initialized) context = context_acquire(device, NULL); -@@ -2900,6 +3440,32 @@ HRESULT CDECL wined3d_texture_get_dc(struct wined3d_texture *texture, unsigned i +@@ -2904,6 +3445,32 @@ HRESULT CDECL wined3d_texture_get_dc(struct wined3d_texture *texture, unsigned i TRACE("Returning dc %p.\n", *dc); return hr; @@ -7904,7 +7898,7 @@ diff --git a/dlls/wined3d/texture.c b/dlls/wined3d/texture.c } HRESULT CDECL wined3d_texture_release_dc(struct wined3d_texture *texture, unsigned int sub_resource_idx, HDC dc) -@@ -2930,6 +3496,7 @@ HRESULT CDECL wined3d_texture_release_dc(struct wined3d_texture *texture, unsign +@@ -2934,6 +3501,7 @@ HRESULT CDECL wined3d_texture_release_dc(struct wined3d_texture *texture, unsign return WINED3DERR_INVALIDCALL; } @@ -7912,7 +7906,7 @@ diff --git a/dlls/wined3d/texture.c b/dlls/wined3d/texture.c if (!(texture->resource.usage & WINED3DUSAGE_OWNDC) && !(device->wined3d->flags & WINED3D_NO3D)) wined3d_surface_destroy_dc(surface); -@@ -2938,6 +3505,9 @@ HRESULT CDECL wined3d_texture_release_dc(struct wined3d_texture *texture, unsign +@@ -2942,6 +3510,9 @@ HRESULT CDECL wined3d_texture_release_dc(struct wined3d_texture *texture, unsign wined3d_texture_update_map_binding(texture); if (!(texture->flags & WINED3D_TEXTURE_GET_DC_LENIENT)) texture->flags &= ~WINED3D_TEXTURE_DC_IN_USE; @@ -8190,7 +8184,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) { -@@ -2554,7 +2645,11 @@ struct wined3d_resource +@@ -2555,7 +2646,11 @@ struct wined3d_resource UINT depth; UINT size; DWORD priority; @@ -8202,7 +8196,7 @@ diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h struct list resource_list_entry; LONG access_count; -@@ -2662,6 +2757,9 @@ struct wined3d_texture +@@ -2663,6 +2758,9 @@ struct wined3d_texture DWORD flags; GLenum target; DWORD update_map_binding; @@ -8212,7 +8206,7 @@ diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h GLuint rb_multisample; GLuint rb_resolved; -@@ -2698,7 +2796,12 @@ struct wined3d_texture +@@ -2699,7 +2797,12 @@ struct wined3d_texture unsigned int map_count; DWORD locations; @@ -8225,7 +8219,7 @@ diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h } sub_resources[1]; }; -@@ -2749,11 +2852,23 @@ void wined3d_texture_bind(struct wined3d_texture *texture, +@@ -2750,11 +2853,23 @@ void wined3d_texture_bind(struct wined3d_texture *texture, struct wined3d_context *context, BOOL srgb) DECLSPEC_HIDDEN; void wined3d_texture_bind_and_dirtify(struct wined3d_texture *texture, struct wined3d_context *context, BOOL srgb) DECLSPEC_HIDDEN; @@ -8249,7 +8243,7 @@ diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h struct wined3d_texture_sub_resource *wined3d_texture_get_sub_resource(struct wined3d_texture *texture, unsigned int sub_resource_idx) DECLSPEC_HIDDEN; void wined3d_texture_invalidate_location(struct wined3d_texture *texture, -@@ -2766,13 +2881,26 @@ void *wined3d_texture_map_bo_address(const struct wined3d_bo_address *data, size +@@ -2767,13 +2882,26 @@ void *wined3d_texture_map_bo_address(const struct wined3d_bo_address *data, size const struct wined3d_gl_info *gl_info, GLenum binding, DWORD flags) DECLSPEC_HIDDEN; BOOL wined3d_texture_prepare_location(struct wined3d_texture *texture, unsigned int sub_resource_idx, struct wined3d_context *context, DWORD location) DECLSPEC_HIDDEN; @@ -8276,7 +8270,7 @@ diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h void wined3d_texture_upload_data(struct wined3d_texture *texture, unsigned int sub_resource_idx, const struct wined3d_context *context, const struct wined3d_const_bo_address *data, unsigned int row_pitch, unsigned int slice_pitch) DECLSPEC_HIDDEN; -@@ -2881,7 +3009,11 @@ void surface_get_drawable_size(const struct wined3d_surface *surface, const stru +@@ -2882,7 +3010,11 @@ void surface_get_drawable_size(const struct wined3d_surface *surface, const stru unsigned int *width, unsigned int *height) DECLSPEC_HIDDEN; void surface_load_fb_texture(struct wined3d_surface *surface, BOOL srgb, struct wined3d_context *context) DECLSPEC_HIDDEN; @@ -8288,7 +8282,7 @@ diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h struct wined3d_context *context, DWORD location) DECLSPEC_HIDDEN; void surface_modify_ds_location(struct wined3d_surface *surface, DWORD location, UINT w, UINT h) DECLSPEC_HIDDEN; void surface_set_compatible_renderbuffer(struct wined3d_surface *surface, -@@ -2892,6 +3024,11 @@ HRESULT surface_upload_from_surface(struct wined3d_surface *dst_surface, const P +@@ -2893,6 +3025,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; @@ -8300,7 +8294,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; -@@ -2906,6 +3043,12 @@ struct wined3d_sampler +@@ -2907,6 +3044,12 @@ struct wined3d_sampler GLuint name; }; @@ -8313,7 +8307,7 @@ diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h struct wined3d_vertex_declaration_element { const struct wined3d_format *format; -@@ -3001,6 +3144,7 @@ struct wined3d_stateblock +@@ -3002,6 +3145,7 @@ struct wined3d_stateblock void stateblock_init_contained_states(struct wined3d_stateblock *stateblock) DECLSPEC_HIDDEN; void state_cleanup(struct wined3d_state *state) DECLSPEC_HIDDEN; @@ -8321,7 +8315,7 @@ diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h void state_init(struct wined3d_state *state, struct wined3d_fb_state *fb, const struct wined3d_gl_info *gl_info, const struct wined3d_d3d_info *d3d_info, DWORD flags) DECLSPEC_HIDDEN; -@@ -3014,53 +3158,150 @@ enum wined3d_push_constants +@@ -3015,53 +3159,150 @@ enum wined3d_push_constants WINED3D_PUSH_CONSTANTS_PS_I, WINED3D_PUSH_CONSTANTS_VS_B, WINED3D_PUSH_CONSTANTS_PS_B, @@ -8472,7 +8466,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, -@@ -3090,6 +3331,7 @@ void wined3d_cs_emit_set_transform(struct wined3d_cs *cs, enum wined3d_transform +@@ -3091,6 +3332,7 @@ void wined3d_cs_emit_set_transform(struct wined3d_cs *cs, enum wined3d_transform void wined3d_cs_emit_set_vertex_declaration(struct wined3d_cs *cs, struct wined3d_vertex_declaration *declaration) DECLSPEC_HIDDEN; void wined3d_cs_emit_set_viewport(struct wined3d_cs *cs, const struct wined3d_viewport *viewport) DECLSPEC_HIDDEN; @@ -8480,7 +8474,7 @@ diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h void wined3d_cs_emit_unload_resource(struct wined3d_cs *cs, struct wined3d_resource *resource) DECLSPEC_HIDDEN; static inline void wined3d_cs_push_constants(struct wined3d_cs *cs, enum wined3d_push_constants p, -@@ -3097,6 +3339,25 @@ static inline void wined3d_cs_push_constants(struct wined3d_cs *cs, enum wined3d +@@ -3098,6 +3340,25 @@ static inline void wined3d_cs_push_constants(struct wined3d_cs *cs, enum wined3d { cs->ops->push_constants(cs, p, start_idx, count, constants); } @@ -8506,7 +8500,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 */ -@@ -3123,6 +3384,9 @@ struct wined3d_buffer +@@ -3124,6 +3385,9 @@ struct wined3d_buffer GLenum buffer_object_usage; GLenum buffer_type_hint; DWORD flags; @@ -8516,7 +8510,7 @@ diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h void *map_ptr; struct wined3d_map_range *maps; -@@ -3147,11 +3411,19 @@ void buffer_get_memory(struct wined3d_buffer *buffer, struct wined3d_context *co +@@ -3148,11 +3412,19 @@ void buffer_get_memory(struct wined3d_buffer *buffer, struct wined3d_context *co BYTE *buffer_get_sysmem(struct wined3d_buffer *buffer, struct wined3d_context *context) DECLSPEC_HIDDEN; void buffer_internal_preload(struct wined3d_buffer *buffer, struct wined3d_context *context, const struct wined3d_state *state) DECLSPEC_HIDDEN; @@ -8536,7 +8530,7 @@ diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h struct wined3d_rendertarget_view { -@@ -3213,7 +3485,12 @@ struct wined3d_unordered_access_view +@@ -3214,7 +3486,12 @@ struct wined3d_unordered_access_view struct wined3d_swapchain_ops { void (*swapchain_present)(struct wined3d_swapchain *swapchain, @@ -8549,7 +8543,7 @@ diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h void (*swapchain_frontbuffer_updated)(struct wined3d_swapchain *swapchain); }; -@@ -3250,6 +3527,10 @@ struct wined3d_swapchain +@@ -3251,6 +3528,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;