diff --git a/patches/patchinstall.sh b/patches/patchinstall.sh index 851d637c..26adc481 100755 --- a/patches/patchinstall.sh +++ b/patches/patchinstall.sh @@ -52,7 +52,7 @@ usage() # Get the upstream commit sha upstream_commit() { - echo "9e35dd15454be28c487b0f1bebefbbe530b2aca4" + echo "d6557e812984e010a989a3360039453eb978bd12" } # Show version information @@ -8759,7 +8759,6 @@ if test "$enable_wined3d_CSMT_Main" -eq 1; then printf '%s\n' '+ { "Stefan Dösinger", "wined3d: Get rid of the end_scene flush and finish.", 1 },'; printf '%s\n' '+ { "Sebastian Lackner", "wined3d: Send query_poll through the command stream.", 1 },'; printf '%s\n' '+ { "Stefan Dösinger", "wined3d: Update the swap interval through the CS in reset.", 1 },'; - printf '%s\n' '+ { "Nils Kuhnhenn", "wined3d: Fix context_acquire not being called from the command thread in wined3d_texture_add_dirty_region.", 1 },'; printf '%s\n' '+ { "Stefan Dösinger", "wined3d: Wrap GL BOs in a structure.", 1 },'; printf '%s\n' '+ { "Stefan Dösinger", "wined3d: Add a separate variable to check if queries are started.", 1 },'; printf '%s\n' '+ { "Stefan Dösinger", "wined3d: Wait for the cs to finish before destroying the device.", 1 },'; diff --git a/patches/wined3d-CSMT_Main/0001-wined3d-Add-additional-synchronization-CS-ops.patch b/patches/wined3d-CSMT_Main/0001-wined3d-Add-additional-synchronization-CS-ops.patch index ac7c2c72..9b90ab77 100644 --- a/patches/wined3d-CSMT_Main/0001-wined3d-Add-additional-synchronization-CS-ops.patch +++ b/patches/wined3d-CSMT_Main/0001-wined3d-Add-additional-synchronization-CS-ops.patch @@ -1,4 +1,4 @@ -From d8e7bb3cf2730686403c387bb3ed9b79e513294f Mon Sep 17 00:00:00 2001 +From bf9af9d4fc2546603587ce2e57eb6feff9744892 Mon Sep 17 00:00:00 2001 From: Sebastian Lackner Date: Sun, 19 Feb 2017 00:57:12 +0100 Subject: wined3d: Add additional synchronization CS ops. @@ -13,7 +13,7 @@ Subject: wined3d: Add additional synchronization CS ops. 6 files changed, 74 insertions(+), 3 deletions(-) diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c -index f5bf70d2ee..8c0abf449f 100644 +index ed567bc571..445a11d07e 100644 --- a/dlls/wined3d/cs.c +++ b/dlls/wined3d/cs.c @@ -26,6 +26,8 @@ WINE_DEFAULT_DEBUG_CHANNEL(d3d); @@ -25,8 +25,8 @@ index f5bf70d2ee..8c0abf449f 100644 WINED3D_CS_OP_PRESENT, WINED3D_CS_OP_CLEAR, WINED3D_CS_OP_DISPATCH, -@@ -67,6 +69,16 @@ enum wined3d_cs_op - WINED3D_CS_OP_UPDATE_SUB_RESOURCE, +@@ -68,6 +70,16 @@ enum wined3d_cs_op + WINED3D_CS_OP_ADD_DIRTY_TEXTURE_REGION, }; +struct wined3d_cs_sync @@ -42,8 +42,8 @@ index f5bf70d2ee..8c0abf449f 100644 struct wined3d_cs_present { enum wined3d_cs_op opcode; -@@ -369,6 +381,38 @@ struct wined3d_cs_update_sub_resource - struct wined3d_sub_resource_data data; +@@ -380,6 +392,38 @@ struct wined3d_cs_add_dirty_texture_region + unsigned int layer; }; +static void wined3d_cs_exec_sync(struct wined3d_cs *cs, const void *data) @@ -81,7 +81,7 @@ index f5bf70d2ee..8c0abf449f 100644 static void wined3d_cs_exec_present(struct wined3d_cs *cs, const void *data) { const struct wined3d_cs_present *op = data; -@@ -1643,7 +1687,7 @@ HRESULT wined3d_cs_map(struct wined3d_cs *cs, struct wined3d_resource *resource, +@@ -1710,7 +1754,7 @@ HRESULT wined3d_cs_map(struct wined3d_cs *cs, struct wined3d_resource *resource, op->flags = flags; op->hr = &hr; @@ -90,7 +90,7 @@ index f5bf70d2ee..8c0abf449f 100644 return hr; } -@@ -1667,7 +1711,7 @@ HRESULT wined3d_cs_unmap(struct wined3d_cs *cs, struct wined3d_resource *resourc +@@ -1734,7 +1778,7 @@ HRESULT wined3d_cs_unmap(struct wined3d_cs *cs, struct wined3d_resource *resourc op->sub_resource_idx = sub_resource_idx; op->hr = &hr; @@ -99,7 +99,7 @@ index f5bf70d2ee..8c0abf449f 100644 return hr; } -@@ -1809,11 +1853,13 @@ void wined3d_cs_emit_update_sub_resource(struct wined3d_cs *cs, struct wined3d_r +@@ -1955,7 +1999,7 @@ void wined3d_cs_emit_update_sub_resource(struct wined3d_cs *cs, struct wined3d_r wined3d_resource_acquire(resource); @@ -107,6 +107,9 @@ index f5bf70d2ee..8c0abf449f 100644 + cs->ops->submit_and_wait(cs); } + static void wined3d_cs_exec_add_dirty_texture_region(struct wined3d_cs *cs, const void *data) +@@ -1996,6 +2040,8 @@ void wined3d_cs_emit_add_dirty_texture_region(struct wined3d_cs *cs, + static void (* const wined3d_cs_op_handlers[])(struct wined3d_cs *cs, const void *data) = { + /* WINED3D_CS_OP_SYNC */ wined3d_cs_exec_sync, @@ -114,7 +117,7 @@ index f5bf70d2ee..8c0abf449f 100644 /* WINED3D_CS_OP_PRESENT */ wined3d_cs_exec_present, /* WINED3D_CS_OP_CLEAR */ wined3d_cs_exec_clear, /* WINED3D_CS_OP_DISPATCH */ wined3d_cs_exec_dispatch, -@@ -1946,6 +1992,7 @@ static const struct wined3d_cs_ops wined3d_cs_st_ops = +@@ -2129,6 +2175,7 @@ static const struct wined3d_cs_ops wined3d_cs_st_ops = { wined3d_cs_st_require_space, wined3d_cs_st_submit, @@ -123,10 +126,10 @@ index f5bf70d2ee..8c0abf449f 100644 }; diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c -index 94879b5de1..e328f32403 100644 +index f557306dfb..62580f6867 100644 --- a/dlls/wined3d/device.c +++ b/dlls/wined3d/device.c -@@ -1029,6 +1029,7 @@ static void wined3d_device_delete_opengl_contexts_cs(void *object) +@@ -1023,6 +1023,7 @@ static void wined3d_device_delete_opengl_contexts_cs(void *object) static void wined3d_device_delete_opengl_contexts(struct wined3d_device *device) { wined3d_cs_destroy_object(device->cs, wined3d_device_delete_opengl_contexts_cs, device); @@ -134,7 +137,7 @@ index 94879b5de1..e328f32403 100644 } static void wined3d_device_create_primary_opengl_context_cs(void *object) -@@ -1064,6 +1065,7 @@ static void wined3d_device_create_primary_opengl_context_cs(void *object) +@@ -1061,6 +1062,7 @@ static void wined3d_device_create_primary_opengl_context_cs(void *object) static HRESULT wined3d_device_create_primary_opengl_context(struct wined3d_device *device) { wined3d_cs_init_object(device->cs, wined3d_device_create_primary_opengl_context_cs, device); @@ -143,7 +146,7 @@ index 94879b5de1..e328f32403 100644 return E_FAIL; diff --git a/dlls/wined3d/swapchain.c b/dlls/wined3d/swapchain.c -index 25deaeb1ae..bd23999fb1 100644 +index 026322d7eb..b01607be4b 100644 --- a/dlls/wined3d/swapchain.c +++ b/dlls/wined3d/swapchain.c @@ -66,6 +66,7 @@ static void swapchain_cleanup(struct wined3d_swapchain *swapchain) @@ -154,7 +157,7 @@ index 25deaeb1ae..bd23999fb1 100644 /* Restore the screen resolution if we rendered in fullscreen. * This will restore the screen resolution to what it was before creating -@@ -965,6 +966,7 @@ static HRESULT swapchain_init(struct wined3d_swapchain *swapchain, struct wined3 +@@ -857,6 +858,7 @@ static HRESULT swapchain_init(struct wined3d_swapchain *swapchain, struct wined3 } wined3d_cs_init_object(device->cs, wined3d_swapchain_cs_init, swapchain); @@ -163,10 +166,10 @@ index 25deaeb1ae..bd23999fb1 100644 if (!swapchain->context[0]) { diff --git a/dlls/wined3d/texture.c b/dlls/wined3d/texture.c -index 91f0cc36ed..0197f6daae 100644 +index 288ef8078a..c259bbfe8c 100644 --- a/dlls/wined3d/texture.c +++ b/dlls/wined3d/texture.c -@@ -1391,6 +1391,7 @@ HRESULT CDECL wined3d_texture_update_desc(struct wined3d_texture *texture, UINT +@@ -1387,6 +1387,7 @@ HRESULT CDECL wined3d_texture_update_desc(struct wined3d_texture *texture, UINT if (surface->dc) { wined3d_cs_destroy_object(device->cs, texture2d_destroy_dc, surface); @@ -174,7 +177,7 @@ index 91f0cc36ed..0197f6daae 100644 create_dib = TRUE; } -@@ -1451,7 +1452,10 @@ HRESULT CDECL wined3d_texture_update_desc(struct wined3d_texture *texture, UINT +@@ -1447,7 +1448,10 @@ HRESULT CDECL wined3d_texture_update_desc(struct wined3d_texture *texture, UINT wined3d_texture_invalidate_location(texture, 0, ~valid_location); if (create_dib) @@ -185,7 +188,7 @@ index 91f0cc36ed..0197f6daae 100644 return WINED3D_OK; } -@@ -2856,6 +2860,7 @@ static HRESULT texture_init(struct wined3d_texture *texture, const struct wined3 +@@ -2840,6 +2844,7 @@ static HRESULT texture_init(struct wined3d_texture *texture, const struct wined3 if ((desc->usage & WINED3DUSAGE_OWNDC) || (device->wined3d->flags & WINED3D_NO3D)) { wined3d_cs_init_object(device->cs, texture2d_create_dc, surface); @@ -193,7 +196,7 @@ index 91f0cc36ed..0197f6daae 100644 if (!surface->dc) { wined3d_texture_cleanup_sync(texture); -@@ -3653,7 +3658,10 @@ HRESULT CDECL wined3d_texture_get_dc(struct wined3d_texture *texture, unsigned i +@@ -3627,7 +3632,10 @@ HRESULT CDECL wined3d_texture_get_dc(struct wined3d_texture *texture, unsigned i return WINED3DERR_INVALIDCALL; if (!surface->dc) @@ -204,7 +207,7 @@ index 91f0cc36ed..0197f6daae 100644 if (!surface->dc) return WINED3DERR_INVALIDCALL; -@@ -3697,7 +3705,10 @@ HRESULT CDECL wined3d_texture_release_dc(struct wined3d_texture *texture, unsign +@@ -3671,7 +3679,10 @@ HRESULT CDECL wined3d_texture_release_dc(struct wined3d_texture *texture, unsign } if (!(texture->resource.usage & WINED3DUSAGE_OWNDC) && !(device->wined3d->flags & WINED3D_NO3D)) @@ -216,10 +219,10 @@ index 91f0cc36ed..0197f6daae 100644 --sub_resource->map_count; if (!--texture->resource.map_count && texture->update_map_binding) diff --git a/dlls/wined3d/view.c b/dlls/wined3d/view.c -index 3cd20ea8fa..9b9e7eef4c 100644 +index dc225f4f81..cd09c9c8ee 100644 --- a/dlls/wined3d/view.c +++ b/dlls/wined3d/view.c -@@ -594,6 +594,8 @@ static void wined3d_shader_resource_view_cs_init(void *object) +@@ -632,6 +632,8 @@ static void wined3d_shader_resource_view_cs_init(void *object) debug_d3dformat(resource->format->id), debug_d3dformat(view_format->id)); } } @@ -228,7 +231,7 @@ index 3cd20ea8fa..9b9e7eef4c 100644 } static HRESULT wined3d_shader_resource_view_init(struct wined3d_shader_resource_view *view, -@@ -610,6 +612,7 @@ static HRESULT wined3d_shader_resource_view_init(struct wined3d_shader_resource_ +@@ -648,6 +650,7 @@ static HRESULT wined3d_shader_resource_view_init(struct wined3d_shader_resource_ wined3d_resource_incref(view->resource = resource); @@ -236,7 +239,7 @@ index 3cd20ea8fa..9b9e7eef4c 100644 wined3d_cs_init_object(resource->device->cs, wined3d_shader_resource_view_cs_init, view); return WINED3D_OK; -@@ -786,6 +789,8 @@ static void wined3d_unordered_access_view_cs_init(void *object) +@@ -829,6 +832,8 @@ static void wined3d_unordered_access_view_cs_init(void *object) desc, texture, view->format); } } @@ -245,7 +248,7 @@ index 3cd20ea8fa..9b9e7eef4c 100644 } static HRESULT wined3d_unordered_access_view_init(struct wined3d_unordered_access_view *view, -@@ -805,6 +810,7 @@ static HRESULT wined3d_unordered_access_view_init(struct wined3d_unordered_acces +@@ -848,6 +853,7 @@ static HRESULT wined3d_unordered_access_view_init(struct wined3d_unordered_acces wined3d_resource_incref(view->resource = resource); @@ -254,10 +257,10 @@ index 3cd20ea8fa..9b9e7eef4c 100644 return WINED3D_OK; diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h -index 987f3dc70b..9918f13f08 100644 +index ab6472339b..d5b26d1f43 100644 --- a/dlls/wined3d/wined3d_private.h +++ b/dlls/wined3d/wined3d_private.h -@@ -3209,6 +3209,7 @@ struct wined3d_cs_ops +@@ -3229,6 +3229,7 @@ struct wined3d_cs_ops { void *(*require_space)(struct wined3d_cs *cs, size_t size); void (*submit)(struct wined3d_cs *cs); @@ -265,7 +268,7 @@ index 987f3dc70b..9918f13f08 100644 void (*push_constants)(struct wined3d_cs *cs, enum wined3d_push_constants p, unsigned int start_idx, unsigned int count, const void *constants); }; -@@ -3239,6 +3240,7 @@ void wined3d_cs_emit_dispatch(struct wined3d_cs *cs, +@@ -3263,6 +3264,7 @@ void wined3d_cs_emit_dispatch(struct wined3d_cs *cs, void wined3d_cs_emit_draw(struct wined3d_cs *cs, GLenum primitive_type, int base_vertex_idx, unsigned int start_idx, unsigned int index_count, unsigned int start_instance, unsigned int instance_count, BOOL indexed) DECLSPEC_HIDDEN; @@ -273,7 +276,7 @@ index 987f3dc70b..9918f13f08 100644 void wined3d_cs_emit_preload_resource(struct wined3d_cs *cs, struct wined3d_resource *resource) DECLSPEC_HIDDEN; void wined3d_cs_emit_present(struct wined3d_cs *cs, struct wined3d_swapchain *swapchain, const RECT *src_rect, const RECT *dst_rect, HWND dst_window_override, DWORD flags) DECLSPEC_HIDDEN; -@@ -3290,6 +3292,7 @@ void wined3d_cs_emit_set_unordered_access_view(struct wined3d_cs *cs, enum wined +@@ -3314,6 +3316,7 @@ 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; diff --git a/patches/wined3d-CSMT_Main/0002-wined3d-Send-push_constants-through-the-CS.patch b/patches/wined3d-CSMT_Main/0002-wined3d-Send-push_constants-through-the-CS.patch index 1ddbdb05..b247984a 100644 --- a/patches/wined3d-CSMT_Main/0002-wined3d-Send-push_constants-through-the-CS.patch +++ b/patches/wined3d-CSMT_Main/0002-wined3d-Send-push_constants-through-the-CS.patch @@ -1,4 +1,4 @@ -From 9e6e4d61e56980850bbbc340d510e9a57f9d5627 Mon Sep 17 00:00:00 2001 +From d595e0401ffc44a7e33b1d47931bc3cfb2ef1f24 Mon Sep 17 00:00:00 2001 From: Sebastian Lackner Date: Mon, 6 Feb 2017 05:50:11 +0100 Subject: wined3d: Send push_constants through the CS. @@ -10,19 +10,19 @@ Subject: wined3d: Send push_constants through the CS. 3 files changed, 77 insertions(+), 58 deletions(-) diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c -index 8c0abf449f2..0d74ea806a9 100644 +index 445a11d07e..eb2b012545 100644 --- a/dlls/wined3d/cs.c +++ b/dlls/wined3d/cs.c -@@ -67,6 +67,7 @@ enum wined3d_cs_op - WINED3D_CS_OP_UNMAP, +@@ -68,6 +68,7 @@ enum wined3d_cs_op WINED3D_CS_OP_BLT_SUB_RESOURCE, WINED3D_CS_OP_UPDATE_SUB_RESOURCE, + WINED3D_CS_OP_ADD_DIRTY_TEXTURE_REGION, + WINED3D_CS_OP_PUSH_CONSTANTS, }; struct wined3d_cs_sync -@@ -381,6 +382,15 @@ struct wined3d_cs_update_sub_resource - struct wined3d_sub_resource_data data; +@@ -392,6 +393,15 @@ struct wined3d_cs_add_dirty_texture_region + unsigned int layer; }; +struct wined3d_cs_push_constants @@ -37,8 +37,8 @@ index 8c0abf449f2..0d74ea806a9 100644 static void wined3d_cs_exec_sync(struct wined3d_cs *cs, const void *data) { } -@@ -1856,6 +1866,64 @@ void wined3d_cs_emit_update_sub_resource(struct wined3d_cs *cs, struct wined3d_r - cs->ops->submit_and_wait(cs); +@@ -2038,6 +2048,64 @@ void wined3d_cs_emit_add_dirty_texture_region(struct wined3d_cs *cs, + cs->ops->submit(cs); } +static const struct @@ -102,15 +102,15 @@ index 8c0abf449f2..0d74ea806a9 100644 static void (* const wined3d_cs_op_handlers[])(struct wined3d_cs *cs, const void *data) = { /* WINED3D_CS_OP_SYNC */ wined3d_cs_exec_sync, -@@ -1899,6 +1967,7 @@ static void (* const wined3d_cs_op_handlers[])(struct wined3d_cs *cs, const void - /* WINED3D_CS_OP_UNMAP */ wined3d_cs_exec_unmap, +@@ -2082,6 +2150,7 @@ static void (* const wined3d_cs_op_handlers[])(struct wined3d_cs *cs, const void /* WINED3D_CS_OP_BLT_SUB_RESOURCE */ wined3d_cs_exec_blt_sub_resource, /* WINED3D_CS_OP_UPDATE_SUB_RESOURCE */ wined3d_cs_exec_update_sub_resource, + /* WINED3D_CS_OP_ADD_DIRTY_TEXTURE_REGION */ wined3d_cs_exec_add_dirty_texture_region, + /* WINED3D_CS_OP_PUSH_CONSTANTS */ wined3d_cs_exec_push_constants, }; static void *wined3d_cs_st_require_space(struct wined3d_cs *cs, size_t size) -@@ -1945,55 +2014,11 @@ static void wined3d_cs_st_submit(struct wined3d_cs *cs) +@@ -2128,55 +2197,11 @@ static void wined3d_cs_st_submit(struct wined3d_cs *cs) HeapFree(GetProcessHeap(), 0, data); } @@ -167,10 +167,10 @@ index 8c0abf449f2..0d74ea806a9 100644 struct wined3d_cs *wined3d_cs_create(struct wined3d_device *device) diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c -index e328f32403f..c3a10a2d13a 100644 +index 62580f6867..08cb0cb369 100644 --- a/dlls/wined3d/device.c +++ b/dlls/wined3d/device.c -@@ -2376,7 +2376,7 @@ HRESULT CDECL wined3d_device_set_vs_consts_b(struct wined3d_device *device, +@@ -2373,7 +2373,7 @@ HRESULT CDECL wined3d_device_set_vs_consts_b(struct wined3d_device *device, } else { @@ -179,7 +179,7 @@ index e328f32403f..c3a10a2d13a 100644 } return WINED3D_OK; -@@ -2425,7 +2425,7 @@ HRESULT CDECL wined3d_device_set_vs_consts_i(struct wined3d_device *device, +@@ -2422,7 +2422,7 @@ HRESULT CDECL wined3d_device_set_vs_consts_i(struct wined3d_device *device, } else { @@ -188,7 +188,7 @@ index e328f32403f..c3a10a2d13a 100644 } return WINED3D_OK; -@@ -2470,7 +2470,7 @@ HRESULT CDECL wined3d_device_set_vs_consts_f(struct wined3d_device *device, +@@ -2467,7 +2467,7 @@ 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 @@ -197,7 +197,7 @@ index e328f32403f..c3a10a2d13a 100644 return WINED3D_OK; } -@@ -2591,7 +2591,7 @@ HRESULT CDECL wined3d_device_set_ps_consts_b(struct wined3d_device *device, +@@ -2588,7 +2588,7 @@ HRESULT CDECL wined3d_device_set_ps_consts_b(struct wined3d_device *device, } else { @@ -206,7 +206,7 @@ index e328f32403f..c3a10a2d13a 100644 } return WINED3D_OK; -@@ -2640,7 +2640,7 @@ HRESULT CDECL wined3d_device_set_ps_consts_i(struct wined3d_device *device, +@@ -2637,7 +2637,7 @@ HRESULT CDECL wined3d_device_set_ps_consts_i(struct wined3d_device *device, } else { @@ -215,7 +215,7 @@ index e328f32403f..c3a10a2d13a 100644 } return WINED3D_OK; -@@ -2686,7 +2686,7 @@ HRESULT CDECL wined3d_device_set_ps_consts_f(struct wined3d_device *device, +@@ -2683,7 +2683,7 @@ 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 @@ -225,10 +225,10 @@ index e328f32403f..c3a10a2d13a 100644 return WINED3D_OK; } diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h -index 2922caaa412..9c68628ed6c 100644 +index d5b26d1f43..ee41d45201 100644 --- a/dlls/wined3d/wined3d_private.h +++ b/dlls/wined3d/wined3d_private.h -@@ -3200,8 +3200,6 @@ struct wined3d_cs_ops +@@ -3230,8 +3230,6 @@ struct wined3d_cs_ops void *(*require_space)(struct wined3d_cs *cs, size_t size); void (*submit)(struct wined3d_cs *cs); void (*submit_and_wait)(struct wined3d_cs *cs); @@ -237,7 +237,7 @@ index 2922caaa412..9c68628ed6c 100644 }; struct wined3d_cs -@@ -3234,6 +3232,8 @@ void wined3d_cs_emit_glfinish(struct wined3d_cs *cs) DECLSPEC_HIDDEN; +@@ -3268,6 +3266,8 @@ void wined3d_cs_emit_glfinish(struct wined3d_cs *cs) DECLSPEC_HIDDEN; void wined3d_cs_emit_preload_resource(struct wined3d_cs *cs, struct wined3d_resource *resource) DECLSPEC_HIDDEN; void wined3d_cs_emit_present(struct wined3d_cs *cs, struct wined3d_swapchain *swapchain, const RECT *src_rect, const RECT *dst_rect, HWND dst_window_override, DWORD flags) DECLSPEC_HIDDEN; @@ -246,7 +246,7 @@ index 2922caaa412..9c68628ed6c 100644 void wined3d_cs_emit_query_issue(struct wined3d_cs *cs, struct wined3d_query *query, DWORD flags) DECLSPEC_HIDDEN; 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, -@@ -3294,12 +3294,6 @@ HRESULT wined3d_cs_map(struct wined3d_cs *cs, struct wined3d_resource *resource, +@@ -3328,12 +3328,6 @@ HRESULT wined3d_cs_map(struct wined3d_cs *cs, struct wined3d_resource *resource, HRESULT wined3d_cs_unmap(struct wined3d_cs *cs, struct wined3d_resource *resource, unsigned int sub_resource_idx) DECLSPEC_HIDDEN; diff --git a/patches/wined3d-CSMT_Main/0016-wined3d-Update-the-swap-interval-through-the-CS-in-r.patch b/patches/wined3d-CSMT_Main/0016-wined3d-Update-the-swap-interval-through-the-CS-in-r.patch index 982bd3c2..d1bb0542 100644 --- a/patches/wined3d-CSMT_Main/0016-wined3d-Update-the-swap-interval-through-the-CS-in-r.patch +++ b/patches/wined3d-CSMT_Main/0016-wined3d-Update-the-swap-interval-through-the-CS-in-r.patch @@ -1,4 +1,4 @@ -From 93d7436f3da6532a3ec5beeeea4d548c34820477 Mon Sep 17 00:00:00 2001 +From 7788e5dc312a2f08419f2e7b17bfc3a8d2439ae7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stefan=20D=C3=B6singer?= Date: Sat, 7 May 2016 21:58:06 +0100 Subject: wined3d: Update the swap interval through the CS in reset. @@ -10,18 +10,18 @@ Subject: wined3d: Update the swap interval through the CS in reset. 3 files changed, 28 insertions(+), 1 deletion(-) diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c -index d5199a93d8..65c02e4d21 100644 +index b6bc0e6b84..eb82d40e8f 100644 --- a/dlls/wined3d/cs.c +++ b/dlls/wined3d/cs.c -@@ -69,6 +69,7 @@ enum wined3d_cs_op - WINED3D_CS_OP_BLT_SUB_RESOURCE, +@@ -70,6 +70,7 @@ enum wined3d_cs_op WINED3D_CS_OP_UPDATE_SUB_RESOURCE, + WINED3D_CS_OP_ADD_DIRTY_TEXTURE_REGION, WINED3D_CS_OP_PUSH_CONSTANTS, + WINED3D_CS_OP_UPDATE_SWAP_INTERVAL, }; struct wined3d_cs_sync -@@ -403,6 +404,12 @@ struct wined3d_cs_push_constants +@@ -411,6 +412,12 @@ struct wined3d_cs_push_constants BYTE constants[1]; }; @@ -34,7 +34,7 @@ index d5199a93d8..65c02e4d21 100644 static void wined3d_cs_exec_sync(struct wined3d_cs *cs, const void *data) { } -@@ -2111,6 +2118,24 @@ void wined3d_cs_emit_push_constants(struct wined3d_cs *cs, enum wined3d_push_con +@@ -2155,6 +2162,24 @@ void wined3d_cs_emit_push_constants(struct wined3d_cs *cs, enum wined3d_push_con cs->ops->submit(cs); } @@ -59,9 +59,9 @@ index d5199a93d8..65c02e4d21 100644 static void (* const wined3d_cs_op_handlers[])(struct wined3d_cs *cs, const void *data) = { /* WINED3D_CS_OP_SYNC */ wined3d_cs_exec_sync, -@@ -2156,6 +2181,7 @@ static void (* const wined3d_cs_op_handlers[])(struct wined3d_cs *cs, const void - /* WINED3D_CS_OP_BLT_SUB_RESOURCE */ wined3d_cs_exec_blt_sub_resource, +@@ -2201,6 +2226,7 @@ static void (* const wined3d_cs_op_handlers[])(struct wined3d_cs *cs, const void /* WINED3D_CS_OP_UPDATE_SUB_RESOURCE */ wined3d_cs_exec_update_sub_resource, + /* WINED3D_CS_OP_ADD_DIRTY_TEXTURE_REGION */ wined3d_cs_exec_add_dirty_texture_region, /* WINED3D_CS_OP_PUSH_CONSTANTS */ wined3d_cs_exec_push_constants, + /* WINED3D_CS_OP_UPDATE_SWAP_INTERVAL */ wined3d_cs_exec_update_swap_interval, }; @@ -81,10 +81,10 @@ index c2b7623141..c05c8c51f2 100644 /* All done. There is no need to reload resources or shaders, this will happen automatically on the diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h -index b30d10f3f1..c3cfa428e0 100644 +index 611e9532ce..7a7e281318 100644 --- a/dlls/wined3d/wined3d_private.h +++ b/dlls/wined3d/wined3d_private.h -@@ -3322,6 +3322,7 @@ void wined3d_cs_emit_unload_resource(struct wined3d_cs *cs, struct wined3d_resou +@@ -3324,6 +3324,7 @@ void wined3d_cs_emit_unload_resource(struct wined3d_cs *cs, struct wined3d_resou void wined3d_cs_emit_update_sub_resource(struct wined3d_cs *cs, struct wined3d_resource *resource, unsigned int sub_resource_idx, const struct wined3d_box *box, const void *data, unsigned int row_pitch, unsigned int slice_pitch) DECLSPEC_HIDDEN; diff --git a/patches/wined3d-CSMT_Main/0018-wined3d-Fix-context_acquire-not-being-called-from-th.patch b/patches/wined3d-CSMT_Main/0018-wined3d-Fix-context_acquire-not-being-called-from-th.patch deleted file mode 100644 index 888e35fb..00000000 --- a/patches/wined3d-CSMT_Main/0018-wined3d-Fix-context_acquire-not-being-called-from-th.patch +++ /dev/null @@ -1,153 +0,0 @@ -From 6255aef81f1fb5a7acbae1f69840c26dcd85b44b Mon Sep 17 00:00:00 2001 -From: Nils Kuhnhenn -Date: Fri, 5 Aug 2016 20:28:46 +0200 -Subject: wined3d: Fix context_acquire not being called from the command thread - in wined3d_texture_add_dirty_region. - ---- - dlls/wined3d/cs.c | 53 ++++++++++++++++++++++++++++++++++++++++++ - dlls/wined3d/texture.c | 20 ++-------------- - dlls/wined3d/wined3d_private.h | 2 ++ - 3 files changed, 57 insertions(+), 18 deletions(-) - -diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c -index 65c02e4d21..2ba1e74606 100644 ---- a/dlls/wined3d/cs.c -+++ b/dlls/wined3d/cs.c -@@ -70,6 +70,7 @@ enum wined3d_cs_op - WINED3D_CS_OP_UPDATE_SUB_RESOURCE, - WINED3D_CS_OP_PUSH_CONSTANTS, - WINED3D_CS_OP_UPDATE_SWAP_INTERVAL, -+ WINED3D_CS_OP_TEXTURE_ADD_DIRTY_REGION, - }; - - struct wined3d_cs_sync -@@ -410,6 +411,13 @@ struct wined3d_cs_update_swap_interval - struct wined3d_swapchain *swapchain; - }; - -+struct wined3d_cs_texture_add_dirty_region -+{ -+ enum wined3d_cs_op opcode; -+ struct wined3d_texture *texture; -+ unsigned int sub_resource_idx; -+}; -+ - static void wined3d_cs_exec_sync(struct wined3d_cs *cs, const void *data) - { - } -@@ -2136,6 +2144,50 @@ void wined3d_cs_emit_update_swap_interval(struct wined3d_cs *cs, struct wined3d_ - cs->ops->submit_and_wait(cs); - } - -+static void wined3d_cs_exec_texture_add_dirty_region(struct wined3d_cs *cs, const void *data) -+{ -+ const struct wined3d_cs_texture_add_dirty_region *op = data; -+ unsigned int i, sub_resource_idx = op->sub_resource_idx; -+ struct wined3d_texture *texture = op->texture; -+ struct wined3d_context *context; -+ -+ context = context_acquire(texture->resource.device, NULL, 0); -+ -+ for (i = 0; i < texture->level_count; ++i, ++sub_resource_idx) -+ { -+ if (!wined3d_texture_load_location(texture, sub_resource_idx, context, texture->resource.map_binding)) -+ { -+ ERR("Failed to load location %s.\n", wined3d_debug_location(texture->resource.map_binding)); -+ context_release(context); -+ goto error; -+ } -+ wined3d_texture_invalidate_location(texture, sub_resource_idx, ~texture->resource.map_binding); -+ } -+ -+error: -+ context_release(context); -+ wined3d_resource_release(&texture->resource); -+} -+ -+void wined3d_cs_emit_texture_add_dirty_region(struct wined3d_cs *cs, -+ struct wined3d_texture *texture, unsigned int sub_resource_idx, -+ const struct wined3d_box *dirty_region) -+{ -+ struct wined3d_cs_texture_add_dirty_region *op; -+ -+ if (dirty_region) -+ WARN("Ignoring dirty_region %s.\n", debug_box(dirty_region)); -+ -+ op = cs->ops->require_space(cs, sizeof(*op)); -+ op->opcode = WINED3D_CS_OP_TEXTURE_ADD_DIRTY_REGION; -+ op->texture = texture; -+ op->sub_resource_idx = sub_resource_idx; -+ -+ wined3d_resource_acquire(&texture->resource); -+ -+ 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, -@@ -2182,6 +2234,7 @@ static void (* const wined3d_cs_op_handlers[])(struct wined3d_cs *cs, const void - /* WINED3D_CS_OP_UPDATE_SUB_RESOURCE */ wined3d_cs_exec_update_sub_resource, - /* WINED3D_CS_OP_PUSH_CONSTANTS */ wined3d_cs_exec_push_constants, - /* WINED3D_CS_OP_UPDATE_SWAP_INTERVAL */ wined3d_cs_exec_update_swap_interval, -+ /* WINED3D_CS_OP_TEXTURE_ADD_DIRTY_REGION */ wined3d_cs_exec_texture_add_dirty_region, - }; - - static void *wined3d_cs_st_require_space(struct wined3d_cs *cs, size_t size) -diff --git a/dlls/wined3d/texture.c b/dlls/wined3d/texture.c -index 8581723a15..700e587f8d 100644 ---- a/dlls/wined3d/texture.c -+++ b/dlls/wined3d/texture.c -@@ -1654,8 +1654,7 @@ static struct wined3d_texture_sub_resource *wined3d_texture_get_sub_resource(str - HRESULT CDECL wined3d_texture_add_dirty_region(struct wined3d_texture *texture, - UINT layer, const struct wined3d_box *dirty_region) - { -- unsigned int sub_resource_idx, i; -- struct wined3d_context *context; -+ unsigned int sub_resource_idx; - - TRACE("texture %p, layer %u, dirty_region %s.\n", texture, layer, debug_box(dirty_region)); - -@@ -1664,24 +1663,9 @@ HRESULT CDECL wined3d_texture_add_dirty_region(struct wined3d_texture *texture, - WARN("Invalid layer %u specified.\n", layer); - return WINED3DERR_INVALIDCALL; - } -- -- if (dirty_region) -- WARN("Ignoring dirty_region %s.\n", debug_box(dirty_region)); -- -- context = context_acquire(texture->resource.device, NULL, 0); - sub_resource_idx = layer * texture->level_count; -- for (i = 0; i < texture->level_count; ++i, ++sub_resource_idx) -- { -- if (!wined3d_texture_load_location(texture, sub_resource_idx, context, texture->resource.map_binding)) -- { -- ERR("Failed to load location %s.\n", wined3d_debug_location(texture->resource.map_binding)); -- context_release(context); -- return E_OUTOFMEMORY; -- } -- wined3d_texture_invalidate_location(texture, sub_resource_idx, ~texture->resource.map_binding); -- } -- context_release(context); - -+ wined3d_cs_emit_texture_add_dirty_region(texture->resource.device->cs, texture, sub_resource_idx, dirty_region); - return WINED3D_OK; - } - -diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h -index c3cfa428e0..ab73b02b11 100644 ---- a/dlls/wined3d/wined3d_private.h -+++ b/dlls/wined3d/wined3d_private.h -@@ -3317,6 +3317,8 @@ 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; -+void wined3d_cs_emit_texture_add_dirty_region(struct wined3d_cs *cs, struct wined3d_texture *texture, -+ unsigned int sub_resource_idx, const struct wined3d_box *dirty_region) 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; - void wined3d_cs_emit_update_sub_resource(struct wined3d_cs *cs, struct wined3d_resource *resource, --- -2.11.0 - 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 b8a99da4..badfe442 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 60156f6e4f2b3bb35af27b2dc33a640c1c04e80f Mon Sep 17 00:00:00 2001 +From b46cefd599a66804a8b90997af54d69c435515b1 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 598622d3e7..41a332f19a 100644 current_context = NULL; diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c -index 2ba1e74606..8662a142ff 100644 +index eb82d40e8f..e183a730ed 100644 --- a/dlls/wined3d/cs.c +++ b/dlls/wined3d/cs.c @@ -18,6 +18,7 @@ @@ -38,9 +38,9 @@ index 2ba1e74606..8662a142ff 100644 WINE_DEFAULT_DEBUG_CHANNEL(d3d); @@ -71,6 +72,7 @@ enum wined3d_cs_op + WINED3D_CS_OP_ADD_DIRTY_TEXTURE_REGION, WINED3D_CS_OP_PUSH_CONSTANTS, WINED3D_CS_OP_UPDATE_SWAP_INTERVAL, - WINED3D_CS_OP_TEXTURE_ADD_DIRTY_REGION, + WINED3D_CS_OP_STOP, }; @@ -53,8 +53,8 @@ index 2ba1e74606..8662a142ff 100644 DWORD flags; unsigned int rt_count; struct wined3d_fb_state *fb; -@@ -418,8 +421,14 @@ struct wined3d_cs_texture_add_dirty_region - unsigned int sub_resource_idx; +@@ -418,8 +421,14 @@ struct wined3d_cs_update_swap_interval + struct wined3d_swapchain *swapchain; }; -static void wined3d_cs_exec_sync(struct wined3d_cs *cs, const void *data) @@ -873,7 +873,25 @@ index 2ba1e74606..8662a142ff 100644 } void wined3d_cs_emit_update_sub_resource(struct wined3d_cs *cs, struct wined3d_resource *resource, -@@ -2090,10 +2184,11 @@ push_constant_info[] = +@@ -2068,7 +2162,7 @@ void wined3d_cs_emit_update_sub_resource(struct wined3d_cs *cs, struct wined3d_r + cs->ops->submit_and_wait(cs); + } + +-static void wined3d_cs_exec_add_dirty_texture_region(struct wined3d_cs *cs, const void *data) ++static UINT wined3d_cs_exec_add_dirty_texture_region(struct wined3d_cs *cs, const void *data) + { + const struct wined3d_cs_add_dirty_texture_region *op = data; + struct wined3d_texture *texture = op->texture; +@@ -2087,6 +2181,8 @@ static void wined3d_cs_exec_add_dirty_texture_region(struct wined3d_cs *cs, cons + context_release(context); + + wined3d_resource_release(&texture->resource); ++ ++ return sizeof(*op); + } + + void wined3d_cs_emit_add_dirty_texture_region(struct wined3d_cs *cs, +@@ -2126,10 +2222,11 @@ push_constant_info[] = {FIELD_OFFSET(struct wined3d_state, ps_consts_b), sizeof(BOOL), WINED3D_SHADER_CONST_PS_B}, }; @@ -886,7 +904,7 @@ index 2ba1e74606..8662a142ff 100644 unsigned int context_count; unsigned int i; size_t offset; -@@ -2109,6 +2204,8 @@ static void wined3d_cs_exec_push_constants(struct wined3d_cs *cs, const void *da +@@ -2145,6 +2242,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; } @@ -895,7 +913,7 @@ index 2ba1e74606..8662a142ff 100644 } void wined3d_cs_emit_push_constants(struct wined3d_cs *cs, enum wined3d_push_constants p, -@@ -2126,11 +2223,13 @@ void wined3d_cs_emit_push_constants(struct wined3d_cs *cs, enum wined3d_push_con +@@ -2162,11 +2261,13 @@ void wined3d_cs_emit_push_constants(struct wined3d_cs *cs, enum wined3d_push_con cs->ops->submit(cs); } @@ -910,34 +928,16 @@ index 2ba1e74606..8662a142ff 100644 } void wined3d_cs_emit_update_swap_interval(struct wined3d_cs *cs, struct wined3d_swapchain *swapchain) -@@ -2144,7 +2243,7 @@ void wined3d_cs_emit_update_swap_interval(struct wined3d_cs *cs, struct wined3d_ +@@ -2180,7 +2281,7 @@ void wined3d_cs_emit_update_swap_interval(struct wined3d_cs *cs, struct wined3d_ cs->ops->submit_and_wait(cs); } --static void wined3d_cs_exec_texture_add_dirty_region(struct wined3d_cs *cs, const void *data) -+static UINT wined3d_cs_exec_texture_add_dirty_region(struct wined3d_cs *cs, const void *data) - { - const struct wined3d_cs_texture_add_dirty_region *op = data; - unsigned int i, sub_resource_idx = op->sub_resource_idx; -@@ -2167,6 +2266,8 @@ static void wined3d_cs_exec_texture_add_dirty_region(struct wined3d_cs *cs, cons - error: - context_release(context); - wined3d_resource_release(&texture->resource); -+ -+ return sizeof(*op); - } - - void wined3d_cs_emit_texture_add_dirty_region(struct wined3d_cs *cs, -@@ -2188,7 +2289,7 @@ void wined3d_cs_emit_texture_add_dirty_region(struct wined3d_cs *cs, - cs->ops->submit(cs); - } - -static void (* const wined3d_cs_op_handlers[])(struct wined3d_cs *cs, const void *data) = +static UINT (* const wined3d_cs_op_handlers[])(struct wined3d_cs *cs, const void *data) = { /* WINED3D_CS_OP_SYNC */ wined3d_cs_exec_sync, /* WINED3D_CS_OP_GLFINISH */ wined3d_cs_exec_glfinish, -@@ -2288,6 +2389,201 @@ static const struct wined3d_cs_ops wined3d_cs_st_ops = +@@ -2280,6 +2381,201 @@ static const struct wined3d_cs_ops wined3d_cs_st_ops = wined3d_cs_st_submit, }; @@ -1139,7 +1139,7 @@ index 2ba1e74606..8662a142ff 100644 struct wined3d_cs *wined3d_cs_create(struct wined3d_device *device) { const struct wined3d_gl_info *gl_info = &device->adapter->gl_info; -@@ -2317,12 +2613,41 @@ struct wined3d_cs *wined3d_cs_create(struct wined3d_device *device) +@@ -2309,12 +2605,41 @@ struct wined3d_cs *wined3d_cs_create(struct wined3d_device *device) return NULL; } @@ -1225,7 +1225,7 @@ index 1ce5937f17..4ef747ca89 100644 if (hkey) RegCloseKey( hkey ); diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h -index 7701fc50a2..1bdabe73a6 100644 +index 77a6aa3824..1f8af50116 100644 --- a/dlls/wined3d/wined3d_private.h +++ b/dlls/wined3d/wined3d_private.h @@ -390,6 +390,7 @@ struct wined3d_settings 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 0bd7ae4e..9a2eb6ab 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 826d8b385ffe74c04815d60b01ee8b43b0f9e2c3 Mon Sep 17 00:00:00 2001 +From f48daa130158a7637b0726a45fca28a814052f41 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, 67 insertions(+), 56 deletions(-) diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c -index 7dc1cab014..d456b8fb68 100644 +index 141c4f7194..f4769431a6 100644 --- a/dlls/wined3d/cs.c +++ b/dlls/wined3d/cs.c @@ -435,7 +435,7 @@ void wined3d_cs_emit_sync(struct wined3d_cs *cs) @@ -399,7 +399,16 @@ index 7dc1cab014..d456b8fb68 100644 op->opcode = WINED3D_CS_OP_UPDATE_SUB_RESOURCE; op->resource = resource; op->sub_resource_idx = sub_resource_idx; -@@ -2213,7 +2213,7 @@ void wined3d_cs_emit_push_constants(struct wined3d_cs *cs, enum wined3d_push_con +@@ -2190,7 +2190,7 @@ void wined3d_cs_emit_add_dirty_texture_region(struct wined3d_cs *cs, + { + struct wined3d_cs_add_dirty_texture_region *op; + +- op = cs->ops->require_space(cs, sizeof(*op)); ++ op = cs->ops->require_space(cs, sizeof(*op), 0); + op->opcode = WINED3D_CS_OP_ADD_DIRTY_TEXTURE_REGION; + op->texture = texture; + op->layer = layer; +@@ -2251,7 +2251,7 @@ void wined3d_cs_emit_push_constants(struct wined3d_cs *cs, enum wined3d_push_con { struct wined3d_cs_push_constants *op; @@ -408,7 +417,7 @@ index 7dc1cab014..d456b8fb68 100644 op->opcode = WINED3D_CS_OP_PUSH_CONSTANTS; op->p = p; op->start_idx = start_idx; -@@ -2236,7 +2236,7 @@ void wined3d_cs_emit_update_swap_interval(struct wined3d_cs *cs, struct wined3d_ +@@ -2274,7 +2274,7 @@ void wined3d_cs_emit_update_swap_interval(struct wined3d_cs *cs, struct wined3d_ { struct wined3d_cs_update_swap_interval *op; @@ -417,17 +426,8 @@ index 7dc1cab014..d456b8fb68 100644 op->opcode = WINED3D_CS_OP_UPDATE_SWAP_INTERVAL; op->swapchain = swapchain; -@@ -2279,7 +2279,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)); - -- op = cs->ops->require_space(cs, sizeof(*op)); -+ op = cs->ops->require_space(cs, sizeof(*op), 0); - op->opcode = WINED3D_CS_OP_TEXTURE_ADD_DIRTY_REGION; - op->texture = texture; - op->sub_resource_idx = sub_resource_idx; -@@ -2338,7 +2338,7 @@ static UINT (* const wined3d_cs_op_handlers[])(struct wined3d_cs *cs, const void - /* WINED3D_CS_OP_TEXTURE_ADD_DIRTY_REGION */ wined3d_cs_exec_texture_add_dirty_region, +@@ -2330,7 +2330,7 @@ static UINT (* const wined3d_cs_op_handlers[])(struct wined3d_cs *cs, const void + /* WINED3D_CS_OP_UPDATE_SWAP_INTERVAL */ wined3d_cs_exec_update_swap_interval, }; -static void *wined3d_cs_st_require_space(struct wined3d_cs *cs, size_t size) @@ -435,7 +435,7 @@ index 7dc1cab014..d456b8fb68 100644 { if (size > (cs->data_size - cs->end)) { -@@ -2422,6 +2422,8 @@ static struct wined3d_cs_block *wined3d_cs_dequeue_command(struct wined3d_cs *cs +@@ -2414,6 +2414,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 (;;) { @@ -444,7 +444,7 @@ index 7dc1cab014..d456b8fb68 100644 if ((block = wined3d_cs_list_dequeue(&cs->exec_list))) return block; } -@@ -2449,7 +2451,7 @@ static void wined3d_cs_list_cleanup(struct wined3d_cs_list *list) +@@ -2441,7 +2443,7 @@ static void wined3d_cs_list_cleanup(struct wined3d_cs_list *list) DeleteCriticalSection(&list->lock); } @@ -453,7 +453,7 @@ index 7dc1cab014..d456b8fb68 100644 { struct wined3d_cs_block *block; -@@ -2463,26 +2465,28 @@ static struct wined3d_cs_block *wined3d_cs_get_block(struct wined3d_cs *cs) +@@ -2455,26 +2457,28 @@ static struct wined3d_cs_block *wined3d_cs_get_block(struct wined3d_cs *cs) } block->pos = 0; @@ -486,7 +486,7 @@ index 7dc1cab014..d456b8fb68 100644 cs->current_block = block; } -@@ -2494,10 +2498,13 @@ static void *wined3d_cs_mt_require_space(struct wined3d_cs *cs, size_t size) +@@ -2486,10 +2490,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) { @@ -501,7 +501,7 @@ index 7dc1cab014..d456b8fb68 100644 cs->current_block = NULL; } -@@ -2511,7 +2518,7 @@ static void wined3d_cs_mt_submit_and_wait(struct wined3d_cs *cs) +@@ -2503,7 +2510,7 @@ static void wined3d_cs_mt_submit_and_wait(struct wined3d_cs *cs) block = cs->current_block; block->fence = &fence; @@ -510,7 +510,7 @@ index 7dc1cab014..d456b8fb68 100644 cs->current_block = NULL; /* A busy wait should be fine, we're not supposed to have to wait very -@@ -2533,7 +2540,7 @@ static void wined3d_cs_mt_emit_stop(struct wined3d_cs *cs) +@@ -2525,7 +2532,7 @@ static void wined3d_cs_mt_emit_stop(struct wined3d_cs *cs) assert(cs->thread_id != GetCurrentThreadId()); assert(cs->ops == &wined3d_cs_mt_ops); @@ -519,7 +519,7 @@ index 7dc1cab014..d456b8fb68 100644 op->opcode = WINED3D_CS_OP_STOP; cs->ops->submit(cs); -@@ -2619,6 +2626,7 @@ struct wined3d_cs *wined3d_cs_create(struct wined3d_device *device) +@@ -2611,6 +2618,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); @@ -527,7 +527,7 @@ index 7dc1cab014..d456b8fb68 100644 if (!(cs->thread = CreateThread(NULL, 0, wined3d_cs_run, cs, 0, &cs->thread_id))) { -@@ -2644,6 +2652,7 @@ void wined3d_cs_destroy(struct wined3d_cs *cs) +@@ -2636,6 +2644,7 @@ void wined3d_cs_destroy(struct wined3d_cs *cs) WaitForSingleObject(cs->thread, INFINITE); CloseHandle(cs->thread); @@ -536,7 +536,7 @@ index 7dc1cab014..d456b8fb68 100644 wined3d_cs_list_cleanup(&cs->free_list); } diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h -index 1bdabe73a6..d9a0e8f788 100644 +index 1f8af50116..12ace4e746 100644 --- a/dlls/wined3d/wined3d_private.h +++ b/dlls/wined3d/wined3d_private.h @@ -3245,13 +3245,14 @@ struct wined3d_cs_block diff --git a/patches/wined3d-CSMT_Main/0045-wined3d-Improve-wined3d_cs_emit_update_sub_resource.patch b/patches/wined3d-CSMT_Main/0045-wined3d-Improve-wined3d_cs_emit_update_sub_resource.patch index a24f63d2..ee0f3122 100644 --- a/patches/wined3d-CSMT_Main/0045-wined3d-Improve-wined3d_cs_emit_update_sub_resource.patch +++ b/patches/wined3d-CSMT_Main/0045-wined3d-Improve-wined3d_cs_emit_update_sub_resource.patch @@ -1,4 +1,4 @@ -From 399b96f2a004f607fe917225e390a6efff7169b6 Mon Sep 17 00:00:00 2001 +From 3d756295634736a4685f5a672e47e4dcaaf44908 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michael=20M=C3=BCller?= Date: Mon, 20 Feb 2017 00:27:25 +0100 Subject: wined3d: Improve wined3d_cs_emit_update_sub_resource. @@ -9,10 +9,10 @@ Subject: wined3d: Improve wined3d_cs_emit_update_sub_resource. 2 files changed, 48 insertions(+), 3 deletions(-) diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c -index d3bcc49e6ee..94f46d289a6 100644 +index 0bc2a59d2e..27ec9dc130 100644 --- a/dlls/wined3d/cs.c +++ b/dlls/wined3d/cs.c -@@ -380,10 +380,12 @@ struct wined3d_cs_unmap +@@ -393,10 +393,12 @@ struct wined3d_cs_blt_sub_resource struct wined3d_cs_update_sub_resource { enum wined3d_cs_op opcode; @@ -24,8 +24,8 @@ index d3bcc49e6ee..94f46d289a6 100644 + BYTE copy_data[1]; }; - struct wined3d_cs_push_constants -@@ -1973,7 +1975,7 @@ static UINT wined3d_cs_exec_update_sub_resource(struct wined3d_cs *cs, const voi + struct wined3d_cs_add_dirty_texture_region +@@ -2147,7 +2149,7 @@ static UINT wined3d_cs_exec_update_sub_resource(struct wined3d_cs *cs, const voi done: wined3d_resource_release(op->resource); @@ -34,7 +34,7 @@ index d3bcc49e6ee..94f46d289a6 100644 } void wined3d_cs_emit_update_sub_resource(struct wined3d_cs *cs, struct wined3d_resource *resource, -@@ -1981,9 +1983,54 @@ void wined3d_cs_emit_update_sub_resource(struct wined3d_cs *cs, struct wined3d_r +@@ -2155,9 +2157,54 @@ void wined3d_cs_emit_update_sub_resource(struct wined3d_cs *cs, struct wined3d_r unsigned int slice_pitch) { struct wined3d_cs_update_sub_resource *op; @@ -90,10 +90,10 @@ index d3bcc49e6ee..94f46d289a6 100644 op->sub_resource_idx = sub_resource_idx; op->box = *box; diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c -index b413de95858..0efd687b747 100644 +index 170215b944..a642f77b58 100644 --- a/dlls/wined3d/device.c +++ b/dlls/wined3d/device.c -@@ -4163,8 +4163,6 @@ void CDECL wined3d_device_update_sub_resource(struct wined3d_device *device, str +@@ -4115,8 +4115,6 @@ void CDECL wined3d_device_update_sub_resource(struct wined3d_device *device, str TRACE("device %p, resource %p, sub_resource_idx %u, box %s, data %p, row_pitch %u, depth_pitch %u.\n", device, resource, sub_resource_idx, debug_box(box), data, row_pitch, depth_pitch); diff --git a/patches/wined3d-CSMT_Main/9999-IfDefined.patch b/patches/wined3d-CSMT_Main/9999-IfDefined.patch index c94ff09e..604cbfbe 100644 --- a/patches/wined3d-CSMT_Main/9999-IfDefined.patch +++ b/patches/wined3d-CSMT_Main/9999-IfDefined.patch @@ -3,7 +3,6 @@ Subject: Autogenerated #ifdef patch for wined3d-CSMT_Main. Based on patches by: Michael Müller - Nils Kuhnhenn Sebastian Lackner Stefan Dösinger Stefan Dösinger @@ -75,7 +74,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, -@@ -59,12 +66,31 @@ enum wined3d_cs_op +@@ -59,6 +66,9 @@ enum wined3d_cs_op WINED3D_CS_OP_RESET_STATE, WINED3D_CS_OP_CALLBACK, WINED3D_CS_OP_QUERY_ISSUE, @@ -85,13 +84,13 @@ diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c WINED3D_CS_OP_PRELOAD_RESOURCE, WINED3D_CS_OP_UNLOAD_RESOURCE, WINED3D_CS_OP_MAP, - WINED3D_CS_OP_UNMAP, +@@ -66,6 +76,21 @@ enum wined3d_cs_op WINED3D_CS_OP_BLT_SUB_RESOURCE, WINED3D_CS_OP_UPDATE_SUB_RESOURCE, + WINED3D_CS_OP_ADD_DIRTY_TEXTURE_REGION, +#if defined(STAGING_CSMT) + WINED3D_CS_OP_PUSH_CONSTANTS, + WINED3D_CS_OP_UPDATE_SWAP_INTERVAL, -+ WINED3D_CS_OP_TEXTURE_ADD_DIRTY_REGION, + WINED3D_CS_OP_STOP, +}; + @@ -107,7 +106,7 @@ diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c }; struct wined3d_cs_present -@@ -80,6 +106,9 @@ struct wined3d_cs_present +@@ -81,6 +106,9 @@ struct wined3d_cs_present struct wined3d_cs_clear { enum wined3d_cs_op opcode; @@ -117,7 +116,7 @@ diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c DWORD flags; unsigned int rt_count; struct wined3d_fb_state *fb; -@@ -318,6 +347,16 @@ struct wined3d_cs_query_issue +@@ -319,6 +347,16 @@ struct wined3d_cs_query_issue DWORD flags; }; @@ -134,7 +133,7 @@ diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c struct wined3d_cs_preload_resource { enum wined3d_cs_op opcode; -@@ -366,13 +405,85 @@ struct wined3d_cs_blt_sub_resource +@@ -367,10 +405,16 @@ struct wined3d_cs_blt_sub_resource struct wined3d_cs_update_sub_resource { enum wined3d_cs_op opcode; @@ -145,14 +144,19 @@ diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c unsigned int sub_resource_idx; struct wined3d_box box; struct wined3d_sub_resource_data data; -+#if !defined(STAGING_CSMT) ++#if defined(STAGING_CSMT) ++ BYTE copy_data[1]; ++#endif /* STAGING_CSMT */ }; + struct wined3d_cs_add_dirty_texture_region +@@ -380,7 +424,66 @@ struct wined3d_cs_add_dirty_texture_region + unsigned int layer; + }; + ++#if !defined(STAGING_CSMT) static void wined3d_cs_exec_present(struct wined3d_cs *cs, const void *data) +#else /* STAGING_CSMT */ -+ BYTE copy_data[1]; -+}; -+ +struct wined3d_cs_push_constants +{ + enum wined3d_cs_op opcode; @@ -168,13 +172,6 @@ diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c + struct wined3d_swapchain *swapchain; +}; + -+struct wined3d_cs_texture_add_dirty_region -+{ -+ enum wined3d_cs_op opcode; -+ struct wined3d_texture *texture; -+ unsigned int sub_resource_idx; -+}; -+ +struct wined3d_cs_stop +{ + enum wined3d_cs_op opcode; @@ -220,7 +217,7 @@ diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c { const struct wined3d_cs_present *op = data; struct wined3d_swapchain *swapchain; -@@ -383,11 +494,19 @@ static void wined3d_cs_exec_present(struct wined3d_cs *cs, const void *data) +@@ -391,11 +494,19 @@ static void wined3d_cs_exec_present(struct wined3d_cs *cs, const void *data) swapchain->swapchain_ops->swapchain_present(swapchain, &op->src_rect, &op->dst_rect, op->flags); @@ -240,7 +237,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, -@@ -395,8 +514,14 @@ void wined3d_cs_emit_present(struct wined3d_cs *cs, struct wined3d_swapchain *sw +@@ -403,8 +514,14 @@ void wined3d_cs_emit_present(struct wined3d_cs *cs, struct wined3d_swapchain *sw { struct wined3d_cs_present *op; unsigned int i; @@ -255,7 +252,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; -@@ -410,10 +535,30 @@ void wined3d_cs_emit_present(struct wined3d_cs *cs, struct wined3d_swapchain *sw +@@ -418,10 +535,30 @@ void wined3d_cs_emit_present(struct wined3d_cs *cs, struct wined3d_swapchain *sw wined3d_resource_acquire(&swapchain->back_buffers[i]->resource); } @@ -286,7 +283,7 @@ diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c { const struct wined3d_state *state = &cs->state; const struct wined3d_cs_clear *op = data; -@@ -436,6 +581,10 @@ static void wined3d_cs_exec_clear(struct wined3d_cs *cs, const void *data) +@@ -444,6 +581,10 @@ static void wined3d_cs_exec_clear(struct wined3d_cs *cs, const void *data) } if (op->flags & (WINED3DCLEAR_ZBUFFER | WINED3DCLEAR_STENCIL)) wined3d_resource_release(op->fb->depth_stencil->resource); @@ -297,7 +294,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, -@@ -444,10 +593,19 @@ void wined3d_cs_emit_clear(struct wined3d_cs *cs, DWORD rect_count, const RECT * +@@ -452,10 +593,19 @@ void wined3d_cs_emit_clear(struct wined3d_cs *cs, DWORD rect_count, const RECT * unsigned int rt_count = cs->device->adapter->gl_info.limits.buffers; const struct wined3d_state *state = &cs->device->state; struct wined3d_cs_clear *op; @@ -317,7 +314,7 @@ diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c op->flags = flags; op->rt_count = rt_count; op->fb = &cs->fb; -@@ -481,13 +639,22 @@ void wined3d_cs_emit_clear_rendertarget_view(struct wined3d_cs *cs, struct wined +@@ -489,13 +639,22 @@ void wined3d_cs_emit_clear_rendertarget_view(struct wined3d_cs *cs, struct wined struct wined3d_rendertarget_view *rt; struct wined3d_fb_state fb; } *extra; @@ -340,7 +337,7 @@ diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c op->flags = flags; if (flags & WINED3DCLEAR_TARGET) { -@@ -619,7 +786,11 @@ static void release_unordered_access_resources(const struct wined3d_shader *shad +@@ -627,7 +786,11 @@ static void release_unordered_access_resources(const struct wined3d_shader *shad } } @@ -352,7 +349,7 @@ diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c { const struct wined3d_cs_dispatch *op = data; struct wined3d_state *state = &cs->state; -@@ -630,6 +801,10 @@ static void wined3d_cs_exec_dispatch(struct wined3d_cs *cs, const void *data) +@@ -638,6 +801,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]); @@ -363,7 +360,7 @@ diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c } void wined3d_cs_emit_dispatch(struct wined3d_cs *cs, -@@ -638,7 +813,11 @@ void wined3d_cs_emit_dispatch(struct wined3d_cs *cs, +@@ -646,7 +813,11 @@ void wined3d_cs_emit_dispatch(struct wined3d_cs *cs, const struct wined3d_state *state = &cs->device->state; struct wined3d_cs_dispatch *op; @@ -375,7 +372,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; -@@ -651,7 +830,11 @@ void wined3d_cs_emit_dispatch(struct wined3d_cs *cs, +@@ -659,7 +830,11 @@ void wined3d_cs_emit_dispatch(struct wined3d_cs *cs, cs->ops->submit(cs); } @@ -387,7 +384,7 @@ diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c { struct wined3d_state *state = &cs->state; const struct wined3d_cs_draw *op = data; -@@ -701,6 +884,10 @@ static void wined3d_cs_exec_draw(struct wined3d_cs *cs, const void *data) +@@ -709,6 +884,10 @@ static void wined3d_cs_exec_draw(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_PIXEL], state->unordered_access_view[WINED3D_PIPELINE_GRAPHICS]); @@ -398,7 +395,7 @@ diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c } void wined3d_cs_emit_draw(struct wined3d_cs *cs, GLenum primitive_type, int base_vertex_idx, unsigned int start_idx, -@@ -710,7 +897,11 @@ void wined3d_cs_emit_draw(struct wined3d_cs *cs, GLenum primitive_type, int base +@@ -718,7 +897,11 @@ void wined3d_cs_emit_draw(struct wined3d_cs *cs, GLenum primitive_type, int base struct wined3d_cs_draw *op; unsigned int i; @@ -410,7 +407,7 @@ diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c op->opcode = WINED3D_CS_OP_DRAW; op->primitive_type = primitive_type; op->base_vertex_idx = base_vertex_idx; -@@ -751,70 +942,123 @@ void wined3d_cs_emit_draw(struct wined3d_cs *cs, GLenum primitive_type, int base +@@ -759,70 +942,123 @@ void wined3d_cs_emit_draw(struct wined3d_cs *cs, GLenum primitive_type, int base cs->ops->submit(cs); } @@ -534,7 +531,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, -@@ -822,15 +1066,26 @@ void wined3d_cs_emit_set_rendertarget_view(struct wined3d_cs *cs, unsigned int v +@@ -830,15 +1066,26 @@ void wined3d_cs_emit_set_rendertarget_view(struct wined3d_cs *cs, unsigned int v { struct wined3d_cs_set_rendertarget_view *op; @@ -561,7 +558,7 @@ diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c { const struct wined3d_cs_set_depth_stencil_view *op = data; struct wined3d_device *device = cs->device; -@@ -865,39 +1120,69 @@ static void wined3d_cs_exec_set_depth_stencil_view(struct wined3d_cs *cs, const +@@ -873,39 +1120,69 @@ static void wined3d_cs_exec_set_depth_stencil_view(struct wined3d_cs *cs, const } device_invalidate_state(device, STATE_FRAMEBUFFER); @@ -631,7 +628,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; -@@ -915,6 +1200,10 @@ static void wined3d_cs_exec_set_stream_source(struct wined3d_cs *cs, const void +@@ -923,6 +1200,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); @@ -642,7 +639,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, -@@ -922,17 +1211,28 @@ void wined3d_cs_emit_set_stream_source(struct wined3d_cs *cs, UINT stream_idx, +@@ -930,17 +1211,28 @@ void wined3d_cs_emit_set_stream_source(struct wined3d_cs *cs, UINT stream_idx, { struct wined3d_cs_set_stream_source *op; @@ -671,7 +668,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; -@@ -942,22 +1242,37 @@ static void wined3d_cs_exec_set_stream_source_freq(struct wined3d_cs *cs, const +@@ -950,22 +1242,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); @@ -709,7 +706,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; -@@ -974,6 +1289,10 @@ static void wined3d_cs_exec_set_stream_output(struct wined3d_cs *cs, const void +@@ -982,6 +1289,10 @@ static void wined3d_cs_exec_set_stream_output(struct wined3d_cs *cs, const void InterlockedDecrement(&prev->resource.bind_count); device_invalidate_state(cs->device, STATE_STREAM_OUTPUT); @@ -720,7 +717,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, -@@ -981,16 +1300,27 @@ void wined3d_cs_emit_set_stream_output(struct wined3d_cs *cs, UINT stream_idx, +@@ -989,16 +1300,27 @@ void wined3d_cs_emit_set_stream_output(struct wined3d_cs *cs, UINT stream_idx, { struct wined3d_cs_set_stream_output *op; @@ -748,7 +745,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; -@@ -1006,6 +1336,10 @@ static void wined3d_cs_exec_set_index_buffer(struct wined3d_cs *cs, const void * +@@ -1014,6 +1336,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); @@ -759,7 +756,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, -@@ -1013,16 +1347,27 @@ void wined3d_cs_emit_set_index_buffer(struct wined3d_cs *cs, struct wined3d_buff +@@ -1021,16 +1347,27 @@ void wined3d_cs_emit_set_index_buffer(struct wined3d_cs *cs, struct wined3d_buff { struct wined3d_cs_set_index_buffer *op; @@ -787,7 +784,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; -@@ -1036,6 +1381,9 @@ static void wined3d_cs_exec_set_constant_buffer(struct wined3d_cs *cs, const voi +@@ -1044,6 +1381,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)); @@ -797,7 +794,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, -@@ -1043,16 +1391,27 @@ void wined3d_cs_emit_set_constant_buffer(struct wined3d_cs *cs, enum wined3d_sha +@@ -1051,16 +1391,27 @@ void wined3d_cs_emit_set_constant_buffer(struct wined3d_cs *cs, enum wined3d_sha { struct wined3d_cs_set_constant_buffer *op; @@ -825,7 +822,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; -@@ -1129,21 +1488,36 @@ static void wined3d_cs_exec_set_texture(struct wined3d_cs *cs, const void *data) +@@ -1137,21 +1488,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); @@ -862,7 +859,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; -@@ -1160,6 +1534,10 @@ static void wined3d_cs_exec_set_shader_resource_view(struct wined3d_cs *cs, cons +@@ -1168,6 +1534,10 @@ static void wined3d_cs_exec_set_shader_resource_view(struct wined3d_cs *cs, cons device_invalidate_state(cs->device, STATE_GRAPHICS_SHADER_RESOURCE_BINDING); else device_invalidate_state(cs->device, STATE_COMPUTE_SHADER_RESOURCE_BINDING); @@ -873,7 +870,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, -@@ -1167,16 +1545,27 @@ void wined3d_cs_emit_set_shader_resource_view(struct wined3d_cs *cs, enum wined3 +@@ -1175,16 +1545,27 @@ void wined3d_cs_emit_set_shader_resource_view(struct wined3d_cs *cs, enum wined3 { struct wined3d_cs_set_shader_resource_view *op; @@ -901,7 +898,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; -@@ -1190,6 +1579,10 @@ static void wined3d_cs_exec_set_unordered_access_view(struct wined3d_cs *cs, con +@@ -1198,6 +1579,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)); @@ -912,7 +909,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, -@@ -1197,16 +1590,27 @@ void wined3d_cs_emit_set_unordered_access_view(struct wined3d_cs *cs, enum wined +@@ -1205,16 +1590,27 @@ void wined3d_cs_emit_set_unordered_access_view(struct wined3d_cs *cs, enum wined { struct wined3d_cs_set_unordered_access_view *op; @@ -940,7 +937,7 @@ diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c { const struct wined3d_cs_set_sampler *op = data; -@@ -1215,6 +1619,10 @@ static void wined3d_cs_exec_set_sampler(struct wined3d_cs *cs, const void *data) +@@ -1223,6 +1619,10 @@ static void wined3d_cs_exec_set_sampler(struct wined3d_cs *cs, const void *data) device_invalidate_state(cs->device, STATE_GRAPHICS_SHADER_RESOURCE_BINDING); else device_invalidate_state(cs->device, STATE_COMPUTE_SHADER_RESOURCE_BINDING); @@ -951,7 +948,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, -@@ -1222,16 +1630,27 @@ void wined3d_cs_emit_set_sampler(struct wined3d_cs *cs, enum wined3d_shader_type +@@ -1230,16 +1630,27 @@ void wined3d_cs_emit_set_sampler(struct wined3d_cs *cs, enum wined3d_shader_type { struct wined3d_cs_set_sampler *op; @@ -979,7 +976,7 @@ diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c { const struct wined3d_cs_set_shader *op = data; -@@ -1241,26 +1660,45 @@ static void wined3d_cs_exec_set_shader(struct wined3d_cs *cs, const void *data) +@@ -1249,26 +1660,45 @@ static void wined3d_cs_exec_set_shader(struct wined3d_cs *cs, const void *data) device_invalidate_state(cs->device, STATE_GRAPHICS_SHADER_RESOURCE_BINDING); else device_invalidate_state(cs->device, STATE_COMPUTE_SHADER_RESOURCE_BINDING); @@ -1025,7 +1022,7 @@ diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c } void wined3d_cs_emit_set_rasterizer_state(struct wined3d_cs *cs, -@@ -1268,39 +1706,69 @@ void wined3d_cs_emit_set_rasterizer_state(struct wined3d_cs *cs, +@@ -1276,39 +1706,69 @@ void wined3d_cs_emit_set_rasterizer_state(struct wined3d_cs *cs, { struct wined3d_cs_set_rasterizer_state *op; @@ -1095,7 +1092,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, -@@ -1308,21 +1776,36 @@ void wined3d_cs_emit_set_texture_state(struct wined3d_cs *cs, UINT stage, +@@ -1316,21 +1776,36 @@ void wined3d_cs_emit_set_texture_state(struct wined3d_cs *cs, UINT stage, { struct wined3d_cs_set_texture_state *op; @@ -1132,7 +1129,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, -@@ -1330,22 +1813,37 @@ void wined3d_cs_emit_set_sampler_state(struct wined3d_cs *cs, UINT sampler_idx, +@@ -1338,22 +1813,37 @@ void wined3d_cs_emit_set_sampler_state(struct wined3d_cs *cs, UINT sampler_idx, { struct wined3d_cs_set_sampler_state *op; @@ -1170,7 +1167,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, -@@ -1353,35 +1851,61 @@ void wined3d_cs_emit_set_transform(struct wined3d_cs *cs, enum wined3d_transform +@@ -1361,35 +1851,61 @@ void wined3d_cs_emit_set_transform(struct wined3d_cs *cs, enum wined3d_transform { struct wined3d_cs_set_transform *op; @@ -1232,7 +1229,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; -@@ -1442,6 +1966,10 @@ static void wined3d_cs_exec_set_color_key(struct wined3d_cs *cs, const void *dat +@@ -1450,6 +1966,10 @@ static void wined3d_cs_exec_set_color_key(struct wined3d_cs *cs, const void *dat break; } } @@ -1243,7 +1240,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, -@@ -1449,7 +1977,11 @@ void wined3d_cs_emit_set_color_key(struct wined3d_cs *cs, struct wined3d_texture +@@ -1457,7 +1977,11 @@ void wined3d_cs_emit_set_color_key(struct wined3d_cs *cs, struct wined3d_texture { struct wined3d_cs_set_color_key *op; @@ -1255,7 +1252,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; -@@ -1461,29 +1993,51 @@ void wined3d_cs_emit_set_color_key(struct wined3d_cs *cs, struct wined3d_texture +@@ -1469,29 +1993,51 @@ void wined3d_cs_emit_set_color_key(struct wined3d_cs *cs, struct wined3d_texture else op->set = 0; @@ -1307,7 +1304,7 @@ diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c { const struct wined3d_cs_set_light *op = data; struct wined3d_light_info *light_info; -@@ -1497,7 +2051,11 @@ static void wined3d_cs_exec_set_light(struct wined3d_cs *cs, const void *data) +@@ -1505,7 +2051,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"); @@ -1319,7 +1316,7 @@ diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c } hash_idx = LIGHTMAP_HASHFUNC(light_idx); -@@ -1518,20 +2076,35 @@ static void wined3d_cs_exec_set_light(struct wined3d_cs *cs, const void *data) +@@ -1526,20 +2076,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; @@ -1355,7 +1352,7 @@ diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c { const struct wined3d_cs_set_light_enable *op = data; struct wined3d_device *device = cs->device; -@@ -1541,7 +2114,11 @@ static void wined3d_cs_exec_set_light_enable(struct wined3d_cs *cs, const void * +@@ -1549,7 +2114,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"); @@ -1367,7 +1364,7 @@ diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c } prev_idx = light_info->glIndex; -@@ -1551,21 +2128,36 @@ static void wined3d_cs_exec_set_light_enable(struct wined3d_cs *cs, const void * +@@ -1559,21 +2128,36 @@ 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)); } @@ -1404,7 +1401,7 @@ diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c { struct wined3d_adapter *adapter = cs->device->adapter; -@@ -1573,12 +2165,17 @@ static void wined3d_cs_exec_reset_state(struct wined3d_cs *cs, const void *data) +@@ -1581,12 +2165,17 @@ static void wined3d_cs_exec_reset_state(struct wined3d_cs *cs, const void *data) memset(&cs->state, 0, sizeof(cs->state)); state_init(&cs->state, &cs->fb, &adapter->gl_info, &adapter->d3d_info, WINED3D_STATE_NO_REF | WINED3D_STATE_INIT_DEFAULT); @@ -1422,7 +1419,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; -@@ -1586,17 +2183,34 @@ void wined3d_cs_emit_reset_state(struct wined3d_cs *cs) +@@ -1594,17 +2183,34 @@ void wined3d_cs_emit_reset_state(struct wined3d_cs *cs) } static void wined3d_cs_exec_callback(struct wined3d_cs *cs, const void *data) @@ -1457,7 +1454,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; -@@ -1614,40 +2228,103 @@ void wined3d_cs_init_object(struct wined3d_cs *cs, void (*callback)(void *object +@@ -1622,40 +2228,103 @@ void wined3d_cs_init_object(struct wined3d_cs *cs, void (*callback)(void *object wined3d_cs_emit_callback(cs, callback, object); } @@ -1561,7 +1558,7 @@ diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c op->opcode = WINED3D_CS_OP_PRELOAD_RESOURCE; op->resource = resource; -@@ -1656,20 +2333,32 @@ void wined3d_cs_emit_preload_resource(struct wined3d_cs *cs, struct wined3d_reso +@@ -1664,20 +2333,32 @@ void wined3d_cs_emit_preload_resource(struct wined3d_cs *cs, struct wined3d_reso cs->ops->submit(cs); } @@ -1594,7 +1591,7 @@ diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c op->opcode = WINED3D_CS_OP_UNLOAD_RESOURCE; op->resource = resource; -@@ -1678,13 +2367,21 @@ void wined3d_cs_emit_unload_resource(struct wined3d_cs *cs, struct wined3d_resou +@@ -1686,13 +2367,21 @@ void wined3d_cs_emit_unload_resource(struct wined3d_cs *cs, struct wined3d_resou cs->ops->submit(cs); } @@ -1616,7 +1613,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, -@@ -1693,7 +2390,11 @@ HRESULT wined3d_cs_map(struct wined3d_cs *cs, struct wined3d_resource *resource, +@@ -1701,7 +2390,11 @@ HRESULT wined3d_cs_map(struct wined3d_cs *cs, struct wined3d_resource *resource, struct wined3d_cs_map *op; HRESULT hr; @@ -1628,7 +1625,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; -@@ -1702,17 +2403,29 @@ HRESULT wined3d_cs_map(struct wined3d_cs *cs, struct wined3d_resource *resource, +@@ -1710,17 +2403,29 @@ HRESULT wined3d_cs_map(struct wined3d_cs *cs, struct wined3d_resource *resource, op->flags = flags; op->hr = &hr; @@ -1658,7 +1655,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) -@@ -1720,18 +2433,30 @@ HRESULT wined3d_cs_unmap(struct wined3d_cs *cs, struct wined3d_resource *resourc +@@ -1728,18 +2433,30 @@ HRESULT wined3d_cs_unmap(struct wined3d_cs *cs, struct wined3d_resource *resourc struct wined3d_cs_unmap *op; HRESULT hr; @@ -1689,7 +1686,7 @@ diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c { const struct wined3d_cs_blt_sub_resource *op = data; -@@ -1771,14 +2496,22 @@ static void wined3d_cs_exec_blt_sub_resource(struct wined3d_cs *cs, const void * +@@ -1779,14 +2496,22 @@ static void wined3d_cs_exec_blt_sub_resource(struct wined3d_cs *cs, const void * { FIXME("Flags %#x not implemented for %s resources.\n", op->flags, debug_d3dresourcetype(op->dst_resource->type)); @@ -1712,7 +1709,7 @@ diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c } update_w = op->dst_box.right - op->dst_box.left; -@@ -1790,14 +2523,22 @@ static void wined3d_cs_exec_blt_sub_resource(struct wined3d_cs *cs, const void * +@@ -1798,14 +2523,22 @@ static void wined3d_cs_exec_blt_sub_resource(struct wined3d_cs *cs, const void * { FIXME("Stretching not implemented for %s resources.\n", debug_d3dresourcetype(op->dst_resource->type)); @@ -1735,7 +1732,7 @@ diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c } dst_texture = texture_from_resource(op->dst_resource); -@@ -1811,7 +2552,11 @@ static void wined3d_cs_exec_blt_sub_resource(struct wined3d_cs *cs, const void * +@@ -1819,7 +2552,11 @@ static void wined3d_cs_exec_blt_sub_resource(struct wined3d_cs *cs, const void * ERR("Failed to load source sub-resource into %s.\n", wined3d_debug_location(src_texture->resource.map_binding)); context_release(context); @@ -1747,7 +1744,7 @@ diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c } level = op->dst_sub_resource_idx % dst_texture->level_count; -@@ -1826,7 +2571,11 @@ static void wined3d_cs_exec_blt_sub_resource(struct wined3d_cs *cs, const void * +@@ -1834,7 +2571,11 @@ static void wined3d_cs_exec_blt_sub_resource(struct wined3d_cs *cs, const void * { ERR("Failed to load destination sub-resource.\n"); context_release(context); @@ -1759,7 +1756,7 @@ diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c } wined3d_texture_get_memory(src_texture, op->src_sub_resource_idx, &addr, src_texture->resource.map_binding); -@@ -1846,9 +2595,16 @@ static void wined3d_cs_exec_blt_sub_resource(struct wined3d_cs *cs, const void * +@@ -1854,9 +2595,16 @@ static void wined3d_cs_exec_blt_sub_resource(struct wined3d_cs *cs, const void * FIXME("Not implemented for %s resources.\n", debug_d3dresourcetype(op->dst_resource->type)); } @@ -1776,7 +1773,7 @@ diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c } void wined3d_cs_emit_blt_sub_resource(struct wined3d_cs *cs, struct wined3d_resource *dst_resource, -@@ -1858,7 +2614,11 @@ void wined3d_cs_emit_blt_sub_resource(struct wined3d_cs *cs, struct wined3d_reso +@@ -1866,7 +2614,11 @@ void wined3d_cs_emit_blt_sub_resource(struct wined3d_cs *cs, struct wined3d_reso { struct wined3d_cs_blt_sub_resource *op; @@ -1788,7 +1785,7 @@ diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c op->opcode = WINED3D_CS_OP_BLT_SUB_RESOURCE; op->dst_resource = dst_resource; op->dst_sub_resource_idx = dst_sub_resource_idx; -@@ -1878,7 +2638,11 @@ void wined3d_cs_emit_blt_sub_resource(struct wined3d_cs *cs, struct wined3d_reso +@@ -1886,7 +2638,11 @@ void wined3d_cs_emit_blt_sub_resource(struct wined3d_cs *cs, struct wined3d_reso cs->ops->submit(cs); } @@ -1800,7 +1797,7 @@ diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c { const struct wined3d_cs_update_sub_resource *op = data; const struct wined3d_box *box = &op->box; -@@ -1928,6 +2692,9 @@ static void wined3d_cs_exec_update_sub_resource(struct wined3d_cs *cs, const voi +@@ -1936,6 +2692,9 @@ static void wined3d_cs_exec_update_sub_resource(struct wined3d_cs *cs, const voi done: wined3d_resource_release(op->resource); @@ -1810,7 +1807,7 @@ diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c } void wined3d_cs_emit_update_sub_resource(struct wined3d_cs *cs, struct wined3d_resource *resource, -@@ -1935,9 +2702,60 @@ void wined3d_cs_emit_update_sub_resource(struct wined3d_cs *cs, struct wined3d_r +@@ -1943,22 +2702,83 @@ void wined3d_cs_emit_update_sub_resource(struct wined3d_cs *cs, struct wined3d_r unsigned int slice_pitch) { struct wined3d_cs_update_sub_resource *op; @@ -1848,17 +1845,27 @@ diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c + op = cs->ops->require_space(cs, size, 0); + op->opcode = WINED3D_CS_OP_UPDATE_SUB_RESOURCE; + op->size = size; -+ op->resource = resource; -+ op->sub_resource_idx = sub_resource_idx; -+ op->box = *box; -+ op->data.row_pitch = row_pitch; -+ op->data.slice_pitch = slice_pitch; ++#endif /* STAGING_CSMT */ + op->resource = resource; + op->sub_resource_idx = sub_resource_idx; + op->box = *box; + op->data.row_pitch = row_pitch; + op->data.slice_pitch = slice_pitch; ++#if !defined(STAGING_CSMT) + op->data.data = data; ++#else /* STAGING_CSMT */ + op->data.data = op->copy_data; + memcpy(op->copy_data, data, data_size); -+ -+ wined3d_resource_acquire(resource); -+ -+ cs->ops->submit(cs); ++#endif /* STAGING_CSMT */ + + wined3d_resource_acquire(resource); + + cs->ops->submit(cs); ++#if !defined(STAGING_CSMT) + } + + static void wined3d_cs_exec_add_dirty_texture_region(struct wined3d_cs *cs, const void *data) ++#else /* STAGING_CSMT */ + return; + +no_async: @@ -1867,18 +1874,54 @@ diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c + op = cs->ops->require_space(cs, sizeof(*op), 1); + op->opcode = WINED3D_CS_OP_UPDATE_SUB_RESOURCE; + op->size = sizeof(*op); -+#endif /* STAGING_CSMT */ - op->resource = resource; - op->sub_resource_idx = sub_resource_idx; - op->box = *box; -@@ -1947,11 +2765,147 @@ void wined3d_cs_emit_update_sub_resource(struct wined3d_cs *cs, struct wined3d_r - - wined3d_resource_acquire(resource); - -+#if defined(STAGING_CSMT) ++ op->resource = resource; ++ op->sub_resource_idx = sub_resource_idx; ++ op->box = *box; ++ op->data.row_pitch = row_pitch; ++ op->data.slice_pitch = slice_pitch; ++ op->data.data = data; ++ ++ wined3d_resource_acquire(resource); ++ + cs->ops->submit_and_wait(cs); +} + ++static UINT wined3d_cs_exec_add_dirty_texture_region(struct wined3d_cs *cs, const void *data) ++#endif /* STAGING_CSMT */ + { + const struct wined3d_cs_add_dirty_texture_region *op = data; + struct wined3d_texture *texture = op->texture; +@@ -1977,6 +2797,10 @@ static void wined3d_cs_exec_add_dirty_texture_region(struct wined3d_cs *cs, cons + context_release(context); + + wined3d_resource_release(&texture->resource); ++#if defined(STAGING_CSMT) ++ ++ return sizeof(*op); ++#endif /* STAGING_CSMT */ + } + + void wined3d_cs_emit_add_dirty_texture_region(struct wined3d_cs *cs, +@@ -1984,7 +2808,11 @@ void wined3d_cs_emit_add_dirty_texture_region(struct wined3d_cs *cs, + { + struct wined3d_cs_add_dirty_texture_region *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_ADD_DIRTY_TEXTURE_REGION; + op->texture = texture; + op->layer = layer; +@@ -1994,8 +2822,96 @@ void wined3d_cs_emit_add_dirty_texture_region(struct wined3d_cs *cs, + cs->ops->submit(cs); + } + ++#if !defined(STAGING_CSMT) + static void (* const wined3d_cs_op_handlers[])(struct wined3d_cs *cs, const void *data) = + { ++#else /* STAGING_CSMT */ +static const struct +{ + size_t offset; @@ -1960,57 +2003,6 @@ diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c + cs->ops->submit_and_wait(cs); +} + -+static UINT wined3d_cs_exec_texture_add_dirty_region(struct wined3d_cs *cs, const void *data) -+{ -+ const struct wined3d_cs_texture_add_dirty_region *op = data; -+ unsigned int i, sub_resource_idx = op->sub_resource_idx; -+ struct wined3d_texture *texture = op->texture; -+ struct wined3d_context *context; -+ -+ context = context_acquire(texture->resource.device, NULL, 0); -+ -+ for (i = 0; i < texture->level_count; ++i, ++sub_resource_idx) -+ { -+ if (!wined3d_texture_load_location(texture, sub_resource_idx, context, texture->resource.map_binding)) -+ { -+ ERR("Failed to load location %s.\n", wined3d_debug_location(texture->resource.map_binding)); -+ context_release(context); -+ goto error; -+ } -+ wined3d_texture_invalidate_location(texture, sub_resource_idx, ~texture->resource.map_binding); -+ } -+ -+error: -+ context_release(context); -+ wined3d_resource_release(&texture->resource); -+ -+ return sizeof(*op); -+} -+ -+void wined3d_cs_emit_texture_add_dirty_region(struct wined3d_cs *cs, -+ struct wined3d_texture *texture, unsigned int sub_resource_idx, -+ const struct wined3d_box *dirty_region) -+{ -+ struct wined3d_cs_texture_add_dirty_region *op; -+ -+ if (dirty_region) -+ WARN("Ignoring dirty_region %s.\n", debug_box(dirty_region)); -+ -+ op = cs->ops->require_space(cs, sizeof(*op), 0); -+ op->opcode = WINED3D_CS_OP_TEXTURE_ADD_DIRTY_REGION; -+ op->texture = texture; -+ op->sub_resource_idx = sub_resource_idx; -+ -+ wined3d_resource_acquire(&texture->resource); -+ -+#endif /* STAGING_CSMT */ - cs->ops->submit(cs); - } - -+#if !defined(STAGING_CSMT) - static void (* const wined3d_cs_op_handlers[])(struct wined3d_cs *cs, const void *data) = - { -+#else /* STAGING_CSMT */ +static UINT (* const wined3d_cs_op_handlers[])(struct wined3d_cs *cs, const void *data) = +{ + /* WINED3D_CS_OP_SYNC */ wined3d_cs_exec_sync, @@ -2019,7 +2011,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, -@@ -1985,15 +2939,27 @@ static void (* const wined3d_cs_op_handlers[])(struct wined3d_cs *cs, const void +@@ -2029,6 +2945,9 @@ 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, @@ -2029,9 +2021,10 @@ diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c /* WINED3D_CS_OP_PRELOAD_RESOURCE */ wined3d_cs_exec_preload_resource, /* WINED3D_CS_OP_UNLOAD_RESOURCE */ wined3d_cs_exec_unload_resource, /* WINED3D_CS_OP_MAP */ wined3d_cs_exec_map, - /* WINED3D_CS_OP_UNMAP */ wined3d_cs_exec_unmap, +@@ -2036,9 +2955,17 @@ static void (* const wined3d_cs_op_handlers[])(struct wined3d_cs *cs, const void /* WINED3D_CS_OP_BLT_SUB_RESOURCE */ wined3d_cs_exec_blt_sub_resource, /* WINED3D_CS_OP_UPDATE_SUB_RESOURCE */ wined3d_cs_exec_update_sub_resource, + /* WINED3D_CS_OP_ADD_DIRTY_TEXTURE_REGION */ wined3d_cs_exec_add_dirty_texture_region, +#if !defined(STAGING_CSMT) }; @@ -2039,7 +2032,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_UPDATE_SWAP_INTERVAL */ wined3d_cs_exec_update_swap_interval, -+ /* WINED3D_CS_OP_TEXTURE_ADD_DIRTY_REGION */ wined3d_cs_exec_texture_add_dirty_region, +}; + +static void *wined3d_cs_st_require_space(struct wined3d_cs *cs, size_t size, int priority) @@ -2047,7 +2039,7 @@ diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c { if (size > (cs->data_size - cs->end)) { -@@ -2037,6 +3003,7 @@ static void wined3d_cs_st_submit(struct wined3d_cs *cs) +@@ -2082,6 +3009,7 @@ static void wined3d_cs_st_submit(struct wined3d_cs *cs) HeapFree(GetProcessHeap(), 0, data); } @@ -2055,7 +2047,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) { -@@ -2077,15 +3044,271 @@ static void wined3d_cs_st_push_constants(struct wined3d_cs *cs, enum wined3d_pus +@@ -2122,15 +3050,271 @@ 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; @@ -2086,14 +2078,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); @@ -2115,9 +2107,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 = { @@ -2327,7 +2319,7 @@ diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c struct wined3d_cs *wined3d_cs_create(struct wined3d_device *device) { -@@ -2116,12 +3339,57 @@ struct wined3d_cs *wined3d_cs_create(struct wined3d_device *device) +@@ -2161,12 +3345,57 @@ struct wined3d_cs *wined3d_cs_create(struct wined3d_device *device) return NULL; } @@ -2951,10 +2943,10 @@ diff --git a/dlls/wined3d/texture.c b/dlls/wined3d/texture.c if (create_dib) +#if !defined(STAGING_CSMT) -+ wined3d_cs_init_object(device->cs, texture2d_create_dc, surface); + wined3d_cs_init_object(device->cs, texture2d_create_dc, surface); +#else /* STAGING_CSMT */ + { - wined3d_cs_init_object(device->cs, texture2d_create_dc, surface); ++ wined3d_cs_init_object(device->cs, texture2d_create_dc, surface); + wined3d_cs_emit_sync(device->cs); + } +#endif /* STAGING_CSMT */ @@ -3006,40 +2998,7 @@ diff --git a/dlls/wined3d/texture.c b/dlls/wined3d/texture.c return TRUE; case WINED3D_LOCATION_TEXTURE_RGB: -@@ -1650,8 +1719,12 @@ static struct wined3d_texture_sub_resource *wined3d_texture_get_sub_resource(str - HRESULT CDECL wined3d_texture_add_dirty_region(struct wined3d_texture *texture, - UINT layer, const struct wined3d_box *dirty_region) - { -+#if !defined(STAGING_CSMT) - unsigned int sub_resource_idx, i; - struct wined3d_context *context; -+#else /* STAGING_CSMT */ -+ unsigned int sub_resource_idx; -+#endif /* STAGING_CSMT */ - - TRACE("texture %p, layer %u, dirty_region %s.\n", texture, layer, debug_box(dirty_region)); - -@@ -1660,6 +1733,7 @@ HRESULT CDECL wined3d_texture_add_dirty_region(struct wined3d_texture *texture, - WARN("Invalid layer %u specified.\n", layer); - return WINED3DERR_INVALIDCALL; - } -+#if !defined(STAGING_CSMT) - - if (dirty_region) - WARN("Ignoring dirty_region %s.\n", debug_box(dirty_region)); -@@ -1678,6 +1752,11 @@ HRESULT CDECL wined3d_texture_add_dirty_region(struct wined3d_texture *texture, - } - context_release(context); - -+#else /* STAGING_CSMT */ -+ sub_resource_idx = layer * texture->level_count; -+ -+ wined3d_cs_emit_texture_add_dirty_region(texture->resource.device->cs, texture, sub_resource_idx, dirty_region); -+#endif /* STAGING_CSMT */ - return WINED3D_OK; - } - -@@ -1911,7 +1990,11 @@ static BOOL texture1d_load_location(struct wined3d_texture *texture, unsigned in +@@ -1896,7 +1965,11 @@ static BOOL texture1d_load_location(struct wined3d_texture *texture, unsigned in } else if (sub_resource->locations & WINED3D_LOCATION_BUFFER) { @@ -3051,7 +3010,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); texture1d_upload_data(texture, sub_resource_idx, context, NULL, &data, row_pitch, slice_pitch); -@@ -1956,7 +2039,11 @@ static BOOL texture1d_load_location(struct wined3d_texture *texture, unsigned in +@@ -1941,7 +2014,11 @@ static BOOL texture1d_load_location(struct wined3d_texture *texture, unsigned in case WINED3D_LOCATION_BUFFER: if (sub_resource->locations & (WINED3D_LOCATION_TEXTURE_RGB | WINED3D_LOCATION_TEXTURE_SRGB)) { @@ -3063,7 +3022,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); -@@ -2250,8 +2337,13 @@ static void wined3d_texture_unload(struct wined3d_resource *resource) +@@ -2235,8 +2312,13 @@ static void wined3d_texture_unload(struct wined3d_resource *resource) wined3d_texture_invalidate_location(texture, i, ~WINED3D_LOCATION_DISCARDED); } @@ -3077,7 +3036,7 @@ diff --git a/dlls/wined3d/texture.c b/dlls/wined3d/texture.c if (resource->type == WINED3D_RTYPE_TEXTURE_2D) { -@@ -2855,6 +2947,9 @@ static HRESULT texture_init(struct wined3d_texture *texture, const struct wined3 +@@ -2840,6 +2922,9 @@ static HRESULT texture_init(struct wined3d_texture *texture, const struct wined3 if ((desc->usage & WINED3DUSAGE_OWNDC) || (device->wined3d->flags & WINED3D_NO3D)) { wined3d_cs_init_object(device->cs, texture2d_create_dc, surface); @@ -3087,7 +3046,7 @@ diff --git a/dlls/wined3d/texture.c b/dlls/wined3d/texture.c if (!surface->dc) { wined3d_texture_cleanup_sync(texture); -@@ -3035,7 +3130,11 @@ static BOOL texture3d_load_location(struct wined3d_texture *texture, unsigned in +@@ -3020,7 +3105,11 @@ static BOOL texture3d_load_location(struct wined3d_texture *texture, unsigned in } else if (sub_resource->locations & WINED3D_LOCATION_BUFFER) { @@ -3099,7 +3058,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); -@@ -3081,7 +3180,11 @@ static BOOL texture3d_load_location(struct wined3d_texture *texture, unsigned in +@@ -3066,7 +3155,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)) { @@ -3111,7 +3070,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); -@@ -3299,8 +3402,18 @@ HRESULT CDECL wined3d_texture_blt(struct wined3d_texture *dst_texture, unsigned +@@ -3284,8 +3377,18 @@ HRESULT CDECL wined3d_texture_blt(struct wined3d_texture *dst_texture, unsigned if (dst_texture->sub_resources[dst_sub_resource_idx].map_count || src_texture->sub_resources[src_sub_resource_idx].map_count) { @@ -3130,7 +3089,7 @@ diff --git a/dlls/wined3d/texture.c b/dlls/wined3d/texture.c } if ((src_format_flags & (WINED3DFMT_FLAG_DEPTH | WINED3DFMT_FLAG_STENCIL)) -@@ -3642,7 +3755,14 @@ HRESULT CDECL wined3d_texture_get_dc(struct wined3d_texture *texture, unsigned i +@@ -3627,7 +3730,14 @@ HRESULT CDECL wined3d_texture_get_dc(struct wined3d_texture *texture, unsigned i return WINED3DERR_INVALIDCALL; if (!surface->dc) @@ -3145,7 +3104,7 @@ diff --git a/dlls/wined3d/texture.c b/dlls/wined3d/texture.c if (!surface->dc) return WINED3DERR_INVALIDCALL; -@@ -3686,7 +3806,14 @@ HRESULT CDECL wined3d_texture_release_dc(struct wined3d_texture *texture, unsign +@@ -3671,7 +3781,14 @@ HRESULT CDECL wined3d_texture_release_dc(struct wined3d_texture *texture, unsign } if (!(texture->resource.usage & WINED3DUSAGE_OWNDC) && !(device->wined3d->flags & WINED3D_NO3D)) @@ -3403,7 +3362,7 @@ diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h struct wined3d_cs *wined3d_cs_create(struct wined3d_device *device) DECLSPEC_HIDDEN; void wined3d_cs_destroy(struct wined3d_cs *cs) DECLSPEC_HIDDEN; void wined3d_cs_destroy_object(struct wined3d_cs *cs, -@@ -3261,10 +3344,20 @@ void wined3d_cs_emit_dispatch(struct wined3d_cs *cs, +@@ -3263,10 +3346,20 @@ void wined3d_cs_emit_dispatch(struct wined3d_cs *cs, void wined3d_cs_emit_draw(struct wined3d_cs *cs, GLenum primitive_type, int base_vertex_idx, unsigned int start_idx, unsigned int index_count, unsigned int start_instance, unsigned int instance_count, BOOL indexed) DECLSPEC_HIDDEN; @@ -3424,13 +3383,11 @@ 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; -@@ -3312,10 +3405,18 @@ void wined3d_cs_emit_set_unordered_access_view(struct wined3d_cs *cs, enum wined +@@ -3314,10 +3407,16 @@ 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; +#if defined(STAGING_CSMT) -+void wined3d_cs_emit_texture_add_dirty_region(struct wined3d_cs *cs, struct wined3d_texture *texture, -+ unsigned int sub_resource_idx, const struct wined3d_box *dirty_region) DECLSPEC_HIDDEN; +void wined3d_cs_emit_sync(struct wined3d_cs *cs); +#endif /* STAGING_CSMT */ void wined3d_cs_emit_unload_resource(struct wined3d_cs *cs, struct wined3d_resource *resource) DECLSPEC_HIDDEN; @@ -3443,7 +3400,7 @@ diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h void wined3d_cs_init_object(struct wined3d_cs *cs, void (*callback)(void *object), void *object) DECLSPEC_HIDDEN; HRESULT wined3d_cs_map(struct wined3d_cs *cs, struct wined3d_resource *resource, unsigned int sub_resource_idx, -@@ -3323,12 +3424,14 @@ HRESULT wined3d_cs_map(struct wined3d_cs *cs, struct wined3d_resource *resource, +@@ -3325,12 +3424,14 @@ HRESULT wined3d_cs_map(struct wined3d_cs *cs, struct wined3d_resource *resource, HRESULT wined3d_cs_unmap(struct wined3d_cs *cs, struct wined3d_resource *resource, unsigned int sub_resource_idx) DECLSPEC_HIDDEN; diff --git a/patches/wined3d-Silence_FIXMEs/0006-wined3d-Silence-extremely-noisy-FIXME-in-wined3d_tex.patch b/patches/wined3d-Silence_FIXMEs/0006-wined3d-Silence-extremely-noisy-FIXME-in-wined3d_tex.patch index dd5db76c..1cc6b699 100644 --- a/patches/wined3d-Silence_FIXMEs/0006-wined3d-Silence-extremely-noisy-FIXME-in-wined3d_tex.patch +++ b/patches/wined3d-Silence_FIXMEs/0006-wined3d-Silence-extremely-noisy-FIXME-in-wined3d_tex.patch @@ -1,4 +1,4 @@ -From 418256c5f4821f87fdc353d9eb1dd5991bdf2a1c Mon Sep 17 00:00:00 2001 +From c91507431e6dc246386277821a0ba4a3719d0a36 Mon Sep 17 00:00:00 2001 From: Sebastian Lackner Date: Mon, 21 Mar 2016 18:27:59 +0100 Subject: wined3d: Silence extremely noisy FIXME in @@ -9,18 +9,18 @@ Subject: wined3d: Silence extremely noisy FIXME in 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dlls/wined3d/texture.c b/dlls/wined3d/texture.c -index 3219305246..684e18b46f 100644 +index 2419616731..6e0ff4be4d 100644 --- a/dlls/wined3d/texture.c +++ b/dlls/wined3d/texture.c -@@ -1651,7 +1651,7 @@ HRESULT CDECL wined3d_texture_add_dirty_region(struct wined3d_texture *texture, +@@ -1648,7 +1648,7 @@ HRESULT CDECL wined3d_texture_add_dirty_region(struct wined3d_texture *texture, } if (dirty_region) - FIXME("Ignoring dirty_region %s.\n", debug_box(dirty_region)); + WARN("Ignoring dirty_region %s.\n", debug_box(dirty_region)); - context = context_acquire(texture->resource.device, NULL, 0); - sub_resource_idx = layer * texture->level_count; + wined3d_cs_emit_add_dirty_texture_region(texture->resource.device->cs, texture, layer); + -- 2.11.0