Rebase against e6f8f136fa557d282f44654be509573cb45a831f.

This commit is contained in:
Sebastian Lackner 2017-03-02 17:27:26 +01:00
parent c6708dbbbf
commit 04a8307d45
10 changed files with 323 additions and 736 deletions

View File

@ -1,27 +0,0 @@
From 42dd44a1aa50a947d7184e1eeeb5b1b31ed69125 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Michael=20M=C3=BCller?= <michael@fds-team.de>
Date: Tue, 25 Aug 2015 11:16:07 +0200
Subject: ddraw: Fix arguments to IDirectDraw7::EnumSurfaces in DllMain.
---
dlls/ddraw/main.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/dlls/ddraw/main.c b/dlls/ddraw/main.c
index 8631827..3dae424 100644
--- a/dlls/ddraw/main.c
+++ b/dlls/ddraw/main.c
@@ -937,8 +937,8 @@ BOOL WINAPI DllMain(HINSTANCE inst, DWORD reason, void *reserved)
desc.dwSize = sizeof(desc);
for(i = 0; i <= 1; i++)
{
- hr = IDirectDraw7_EnumSurfaces(&ddraw->IDirectDraw7_iface, DDENUMSURFACES_ALL,
- &desc, ddraw, DestroyCallback);
+ hr = IDirectDraw7_EnumSurfaces(&ddraw->IDirectDraw7_iface,
+ DDENUMSURFACES_DOESEXIST | DDENUMSURFACES_ALL, &desc, ddraw, DestroyCallback);
if(hr != D3D_OK)
ERR("(%p) EnumSurfaces failed, prepare for trouble\n", ddraw);
}
--
2.5.0

View File

@ -52,7 +52,7 @@ usage()
# Get the upstream commit sha
upstream_commit()
{
echo "89b75296128e8c2cadc77cb06ecd7faa1f80d012"
echo "e6f8f136fa557d282f44654be509573cb45a831f"
}
# Show version information
@ -3619,15 +3619,13 @@ fi
# | * [#17233] Implement DDENUMSURFACES_CANBECREATED in IDirectDraw7::EnumSurfaces
# |
# | Modified files:
# | * dlls/ddraw/ddraw.c, dlls/ddraw/main.c, dlls/ddraw/tests/d3d.c
# | * dlls/ddraw/ddraw.c, dlls/ddraw/tests/d3d.c
# |
if test "$enable_ddraw_EnumSurfaces" -eq 1; then
patch_apply ddraw-EnumSurfaces/0001-ddraw-tests-Add-more-tests-for-IDirectDraw7-EnumSurf.patch
patch_apply ddraw-EnumSurfaces/0002-ddraw-Fix-arguments-to-IDirectDraw7-EnumSurfaces-in-.patch
patch_apply ddraw-EnumSurfaces/0003-ddraw-Implement-DDENUMSURFACES_CANBECREATED-flag-in-.patch
(
printf '%s\n' '+ { "Michael Müller", "ddraw/tests: Add more tests for IDirectDraw7::EnumSurfaces.", 1 },';
printf '%s\n' '+ { "Michael Müller", "ddraw: Fix arguments to IDirectDraw7::EnumSurfaces in DllMain.", 1 },';
printf '%s\n' '+ { "Michael Müller", "ddraw: Implement DDENUMSURFACES_CANBECREATED flag in ddraw7_EnumSurfaces.", 1 },';
) >> "$patchlist"
fi
@ -8390,7 +8388,6 @@ if test "$enable_wined3d_CSMT_Main" -eq 1; then
printf '%s\n' '+ { "Stefan Dösinger", "wined3d: Send update_sub_resource calls through the command stream.", 1 },';
printf '%s\n' '+ { "Stefan Dösinger", "wined3d: Send getdc and releasedc through the command stream.", 1 },';
printf '%s\n' '+ { "Sebastian Lackner", "wined3d: Send query_poll through the command stream.", 1 },';
printf '%s\n' '+ { "Stefan Dösinger", "wined3d: Create the initial context through the CS.", 1 },';
printf '%s\n' '+ { "Stefan Dösinger", "wined3d: Update the swap interval through the CS in reset.", 1 },';
printf '%s\n' '+ { "Stefan Dösinger", "wined3d: Create initial DCs through the CS.", 1 },';
printf '%s\n' '+ { "Nils Kuhnhenn", "wined3d: Fix context_acquire not being called from the command thread in wined3d_texture_add_dirty_region.", 1 },';

View File

@ -1,4 +1,4 @@
From 9ae4703d968d423613ac1b190f141429c1cc7143 Mon Sep 17 00:00:00 2001
From cc2cafc81cc50bcd93c20b887838dd663c190ef7 Mon Sep 17 00:00:00 2001
From: Sebastian Lackner <sebastian@fds-team.de>
Date: Sun, 19 Feb 2017 00:57:12 +0100
Subject: wined3d: Add additional synchronization CS ops.
@ -6,10 +6,10 @@ Subject: wined3d: Add additional synchronization CS ops.
---
dlls/wined3d/cs.c | 51 ++++++++++++++++++++++++++++++++++++++++--
dlls/wined3d/device.c | 2 ++
dlls/wined3d/swapchain.c | 1 +
dlls/wined3d/swapchain.c | 2 ++
dlls/wined3d/view.c | 6 +++++
dlls/wined3d/wined3d_private.h | 3 +++
5 files changed, 61 insertions(+), 2 deletions(-)
5 files changed, 62 insertions(+), 2 deletions(-)
diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c
index 8afa7313a02..b27a083007b 100644
@ -135,7 +135,7 @@ index e812567b067..be6d784bddf 100644
return E_FAIL;
diff --git a/dlls/wined3d/swapchain.c b/dlls/wined3d/swapchain.c
index 78615456207..a5a7a09f569 100644
index 25deaeb1ae9..bd23999fb1e 100644
--- a/dlls/wined3d/swapchain.c
+++ b/dlls/wined3d/swapchain.c
@@ -66,6 +66,7 @@ static void swapchain_cleanup(struct wined3d_swapchain *swapchain)
@ -146,6 +146,14 @@ index 78615456207..a5a7a09f569 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
}
wined3d_cs_init_object(device->cs, wined3d_swapchain_cs_init, swapchain);
+ wined3d_cs_emit_sync(device->cs);
if (!swapchain->context[0])
{
diff --git a/dlls/wined3d/view.c b/dlls/wined3d/view.c
index 02964e4a96b..21aa8720e65 100644
--- a/dlls/wined3d/view.c
@ -185,10 +193,10 @@ index 02964e4a96b..21aa8720e65 100644
return WINED3D_OK;
diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h
index 8b26b2827dd..8e875cec652 100644
index d45e19b0224..d0385a5e90a 100644
--- a/dlls/wined3d/wined3d_private.h
+++ b/dlls/wined3d/wined3d_private.h
@@ -3182,6 +3182,7 @@ struct wined3d_cs_ops
@@ -3193,6 +3193,7 @@ struct wined3d_cs_ops
{
void *(*require_space)(struct wined3d_cs *cs, size_t size);
void (*submit)(struct wined3d_cs *cs);
@ -196,7 +204,7 @@ index 8b26b2827dd..8e875cec652 100644
void (*push_constants)(struct wined3d_cs *cs, enum wined3d_push_constants p,
unsigned int start_idx, unsigned int count, const void *constants);
};
@@ -3208,6 +3209,7 @@ void wined3d_cs_emit_dispatch(struct wined3d_cs *cs,
@@ -3219,6 +3220,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;
@ -204,7 +212,7 @@ index 8b26b2827dd..8e875cec652 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;
@@ -3259,6 +3261,7 @@ void wined3d_cs_emit_set_unordered_access_view(struct wined3d_cs *cs, enum wined
@@ -3270,6 +3272,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;

View File

@ -1,239 +0,0 @@
From 99532d442dd915def1f20d52586e39f67b79c9ec Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Stefan=20D=C3=B6singer?= <stefan@codeweavers.com>
Date: Thu, 10 Oct 2013 16:43:19 +0200
Subject: wined3d: Create the initial context through the CS.
Very hacky.
---
dlls/wined3d/cs.c | 31 +++++++++++
dlls/wined3d/swapchain.c | 121 ++++++++++++++++++++++-------------------
dlls/wined3d/wined3d_private.h | 4 ++
3 files changed, 101 insertions(+), 55 deletions(-)
diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c
index eaa9267e5ba..544a6bf89e6 100644
--- a/dlls/wined3d/cs.c
+++ b/dlls/wined3d/cs.c
@@ -73,6 +73,7 @@ enum wined3d_cs_op
WINED3D_CS_OP_UPDATE_SUB_RESOURCE,
WINED3D_CS_OP_GET_DC,
WINED3D_CS_OP_RELEASE_DC,
+ WINED3D_CS_OP_CREATE_SWAPCHAIN_CONTEXT,
};
struct wined3d_cs_sync
@@ -428,6 +429,13 @@ struct wined3d_cs_get_release_dc
HRESULT *hr;
};
+struct wined3d_cs_create_swapchain_context
+{
+ enum wined3d_cs_op opcode;
+ struct wined3d_swapchain *swapchain;
+ HRESULT *hr;
+};
+
static void wined3d_cs_exec_sync(struct wined3d_cs *cs, const void *data)
{
}
@@ -2067,6 +2075,28 @@ HRESULT wined3d_cs_emit_release_dc(struct wined3d_cs *cs, struct wined3d_texture
return hr;
}
+static void wined3d_cs_exec_create_swapchain_context(struct wined3d_cs *cs, const void *data)
+{
+ const struct wined3d_cs_create_swapchain_context *op = data;
+
+ *op->hr = swapchain_create_context_cs(cs->device, op->swapchain);
+}
+
+HRESULT wined3d_cs_emit_create_swapchain_context(struct wined3d_cs *cs, struct wined3d_swapchain *swapchain)
+{
+ struct wined3d_cs_create_swapchain_context *op;
+ HRESULT hr;
+
+ op = cs->ops->require_space(cs, sizeof(*op));
+ op->opcode = WINED3D_CS_OP_CREATE_SWAPCHAIN_CONTEXT;
+ op->swapchain = swapchain;
+ op->hr = &hr;
+
+ cs->ops->submit_and_wait(cs);
+
+ return hr;
+}
+
static void (* const wined3d_cs_op_handlers[])(struct wined3d_cs *cs, const void *data) =
{
/* WINED3D_CS_OP_SYNC */ wined3d_cs_exec_sync,
@@ -2116,6 +2146,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_GET_DC */ wined3d_cs_exec_get_dc,
/* WINED3D_CS_OP_RELEASE_DC */ wined3d_cs_exec_release_dc,
+ /* WINED3D_CS_OP_CREATE_SWAPCHAIN_CONTEXT */ wined3d_cs_exec_create_swapchain_context,
};
static void *wined3d_cs_st_require_space(struct wined3d_cs *cs, size_t size)
diff --git a/dlls/wined3d/swapchain.c b/dlls/wined3d/swapchain.c
index b3da7f6e20a..8d69820d400 100644
--- a/dlls/wined3d/swapchain.c
+++ b/dlls/wined3d/swapchain.c
@@ -787,6 +787,69 @@ static void wined3d_swapchain_apply_sample_count_override(const struct wined3d_s
*quality = 0;
}
+HRESULT swapchain_create_context_cs(struct wined3d_device *device, struct wined3d_swapchain *swapchain)
+{
+ const struct wined3d_adapter *adapter = device->adapter;
+ const struct wined3d_gl_info *gl_info = &adapter->gl_info;
+ UINT i;
+
+ static const enum wined3d_format_id formats[] =
+ {
+ WINED3DFMT_D24_UNORM_S8_UINT,
+ WINED3DFMT_D32_UNORM,
+ WINED3DFMT_R24_UNORM_X8_TYPELESS,
+ WINED3DFMT_D16_UNORM,
+ WINED3DFMT_S1_UINT_D15_UNORM
+ };
+
+ swapchain->context = HeapAlloc(GetProcessHeap(), 0, sizeof(*swapchain->context));
+ if (!swapchain->context)
+ {
+ ERR("Failed to create the context array.\n");
+ return E_OUTOFMEMORY;
+ }
+
+ /* In WGL both color, depth and stencil are features of a pixel format. In case of D3D they are separate.
+ * You are able to add a depth + stencil surface at a later stage when you need it.
+ * In order to support this properly in WineD3D we need the ability to recreate the opengl context and
+ * drawable when this is required. This is very tricky as we need to reapply ALL opengl states for the new
+ * context, need torecreate shaders, textures and other resources.
+ *
+ * The context manager already takes care of the state problem and for the other tasks code from Reset
+ * can be used. These changes are way to risky during the 1.0 code freeze which is taking place right now.
+ * Likely a lot of other new bugs will be exposed. For that reason request a depth stencil surface all the
+ * time. It can cause a slight performance hit but fixes a lot of regressions. A fixme reminds of that this
+ * issue needs to be fixed. */
+ for (i = 0; i < (sizeof(formats) / sizeof(*formats)); i++)
+ {
+ swapchain->ds_format = wined3d_get_format(gl_info, formats[i], WINED3DUSAGE_DEPTHSTENCIL);
+ swapchain->context[0] = context_create(swapchain, swapchain->front_buffer, swapchain->ds_format);
+ if (swapchain->context[0]) break;
+ TRACE("Depth stencil format %s is not supported, trying next format\n",
+ debug_d3dformat(formats[i]));
+ }
+
+ if (!swapchain->context[0])
+ {
+ WARN("Failed to create context.\n");
+ HeapFree(GetProcessHeap(), 0, swapchain->context);
+ swapchain->context = NULL;
+ return WINED3DERR_NOTAVAILABLE;
+ }
+ swapchain->num_contexts = 1;
+
+ if (wined3d_settings.offscreen_rendering_mode != ORM_FBO
+ && (!swapchain->desc.enable_auto_depth_stencil
+ || swapchain->desc.auto_depth_stencil_format != swapchain->ds_format->id))
+ {
+ FIXME("Add OpenGL context recreation support to context_validate_onscreen_formats\n");
+ }
+ context_release(swapchain->context[0]);
+ swapchain_update_swap_interval(swapchain);
+
+ return WINED3D_OK;
+}
+
static HRESULT swapchain_init(struct wined3d_swapchain *swapchain, struct wined3d_device *device,
struct wined3d_swapchain_desc *desc, void *parent, const struct wined3d_parent_ops *parent_ops)
{
@@ -913,61 +976,9 @@ static HRESULT swapchain_init(struct wined3d_swapchain *swapchain, struct wined3
if (!(device->wined3d->flags & WINED3D_NO3D))
{
- static const enum wined3d_format_id formats[] =
- {
- WINED3DFMT_D24_UNORM_S8_UINT,
- WINED3DFMT_D32_UNORM,
- WINED3DFMT_R24_UNORM_X8_TYPELESS,
- WINED3DFMT_D16_UNORM,
- WINED3DFMT_S1_UINT_D15_UNORM
- };
-
- const struct wined3d_gl_info *gl_info = &adapter->gl_info;
-
- swapchain->context = HeapAlloc(GetProcessHeap(), 0, sizeof(*swapchain->context));
- if (!swapchain->context)
- {
- ERR("Failed to create the context array.\n");
- hr = E_OUTOFMEMORY;
- goto err;
- }
-
- /* In WGL both color, depth and stencil are features of a pixel format. In case of D3D they are separate.
- * You are able to add a depth + stencil surface at a later stage when you need it.
- * In order to support this properly in WineD3D we need the ability to recreate the opengl context and
- * drawable when this is required. This is very tricky as we need to reapply ALL opengl states for the new
- * context, need torecreate shaders, textures and other resources.
- *
- * The context manager already takes care of the state problem and for the other tasks code from Reset
- * can be used. These changes are way to risky during the 1.0 code freeze which is taking place right now.
- * Likely a lot of other new bugs will be exposed. For that reason request a depth stencil surface all the
- * time. It can cause a slight performance hit but fixes a lot of regressions. A fixme reminds of that this
- * issue needs to be fixed. */
- for (i = 0; i < (sizeof(formats) / sizeof(*formats)); i++)
- {
- swapchain->ds_format = wined3d_get_format(gl_info, formats[i], WINED3DUSAGE_DEPTHSTENCIL);
- swapchain->context[0] = context_create(swapchain, swapchain->front_buffer, swapchain->ds_format);
- if (swapchain->context[0]) break;
- TRACE("Depth stencil format %s is not supported, trying next format\n",
- debug_d3dformat(formats[i]));
- }
-
- if (!swapchain->context[0])
- {
- WARN("Failed to create context.\n");
- hr = WINED3DERR_NOTAVAILABLE;
- goto err;
- }
- swapchain->num_contexts = 1;
-
- if (wined3d_settings.offscreen_rendering_mode != ORM_FBO
- && (!desc->enable_auto_depth_stencil
- || swapchain->desc.auto_depth_stencil_format != swapchain->ds_format->id))
- {
- FIXME("Add OpenGL context recreation support to context_validate_onscreen_formats\n");
- }
- context_release(swapchain->context[0]);
- swapchain_update_swap_interval(swapchain);
+ hr = wined3d_cs_emit_create_swapchain_context(device->cs, swapchain);
+ if (FAILED(hr))
+ goto err;
}
if (swapchain->desc.backbuffer_count > 0)
diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h
index ffcc6c400fb..c6c2a5902fa 100644
--- a/dlls/wined3d/wined3d_private.h
+++ b/dlls/wined3d/wined3d_private.h
@@ -3221,6 +3221,8 @@ void wined3d_cs_emit_clear(struct wined3d_cs *cs, DWORD rect_count, const RECT *
void wined3d_cs_emit_clear_rtv(struct wined3d_cs *cs, struct wined3d_rendertarget_view *view,
const RECT *rect, DWORD flags, const struct wined3d_color *color, float depth, DWORD stencil,
const struct blit_shader *blitter) DECLSPEC_HIDDEN;
+HRESULT wined3d_cs_emit_create_swapchain_context(struct wined3d_cs *cs,
+ struct wined3d_swapchain *swapchain) DECLSPEC_HIDDEN;
void wined3d_cs_emit_dispatch(struct wined3d_cs *cs,
unsigned int group_count_x, unsigned int group_count_y, unsigned int group_count_z) DECLSPEC_HIDDEN;
void wined3d_cs_emit_draw(struct wined3d_cs *cs, GLenum primitive_type, int base_vertex_idx,
@@ -3472,6 +3474,8 @@ struct wined3d_swapchain
void wined3d_swapchain_activate(struct wined3d_swapchain *swapchain, BOOL activate) DECLSPEC_HIDDEN;
struct wined3d_context *swapchain_get_context(struct wined3d_swapchain *swapchain) DECLSPEC_HIDDEN;
+HRESULT swapchain_create_context_cs(struct wined3d_device *device,
+ struct wined3d_swapchain *swapchain) DECLSPEC_HIDDEN;
void swapchain_destroy_contexts(struct wined3d_swapchain *swapchain) DECLSPEC_HIDDEN;
HDC swapchain_get_backup_dc(struct wined3d_swapchain *swapchain) DECLSPEC_HIDDEN;
void swapchain_update_draw_bindings(struct wined3d_swapchain *swapchain) DECLSPEC_HIDDEN;
--
2.11.0

View File

@ -1,4 +1,4 @@
From 87dc42bd2a784e106d9898b5dcf3969e5c508fab Mon Sep 17 00:00:00 2001
From 207bfb3829ccd61de999f5d1797fabee9cb44e4c Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Stefan=20D=C3=B6singer?= <stefandoesinger@gmx.at>
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 4ee459f535a..c7ed94f623c 100644
index eaa9267e5ba..770760f78c7 100644
--- a/dlls/wined3d/cs.c
+++ b/dlls/wined3d/cs.c
@@ -75,6 +75,7 @@ enum wined3d_cs_op
@@ -73,6 +73,7 @@ enum wined3d_cs_op
WINED3D_CS_OP_UPDATE_SUB_RESOURCE,
WINED3D_CS_OP_GET_DC,
WINED3D_CS_OP_RELEASE_DC,
WINED3D_CS_OP_CREATE_SWAPCHAIN_CONTEXT,
+ WINED3D_CS_OP_UPDATE_SWAP_INTERVAL,
};
struct wined3d_cs_sync
@@ -442,6 +443,12 @@ struct wined3d_cs_create_swapchain_context
@@ -428,6 +429,12 @@ struct wined3d_cs_get_release_dc
HRESULT *hr;
};
@ -34,7 +34,7 @@ index 4ee459f535a..c7ed94f623c 100644
static void wined3d_cs_exec_sync(struct wined3d_cs *cs, const void *data)
{
}
@@ -2115,6 +2122,24 @@ HRESULT wined3d_cs_emit_create_swapchain_context(struct wined3d_cs *cs, struct w
@@ -2067,6 +2074,24 @@ HRESULT wined3d_cs_emit_release_dc(struct wined3d_cs *cs, struct wined3d_texture
return hr;
}
@ -59,19 +59,19 @@ index 4ee459f535a..c7ed94f623c 100644
static void (* const wined3d_cs_op_handlers[])(struct wined3d_cs *cs, const void *data) =
{
/* WINED3D_CS_OP_SYNC */ wined3d_cs_exec_sync,
@@ -2166,6 +2191,7 @@ static void (* const wined3d_cs_op_handlers[])(struct wined3d_cs *cs, const void
@@ -2116,6 +2141,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_GET_DC */ wined3d_cs_exec_get_dc,
/* WINED3D_CS_OP_RELEASE_DC */ wined3d_cs_exec_release_dc,
/* WINED3D_CS_OP_CREATE_SWAPCHAIN_CONTEXT */ wined3d_cs_exec_create_swapchain_context,
+ /* 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)
diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c
index 86b1808463e..3e4a1790946 100644
index 03361548a89..3870ecf3f0d 100644
--- a/dlls/wined3d/device.c
+++ b/dlls/wined3d/device.c
@@ -4839,7 +4839,7 @@ HRESULT CDECL wined3d_device_reset(struct wined3d_device *device,
@@ -4850,7 +4850,7 @@ HRESULT CDECL wined3d_device_reset(struct wined3d_device *device,
{
if (reset_state)
hr = wined3d_device_create_primary_opengl_context(device);
@ -81,10 +81,10 @@ index 86b1808463e..3e4a1790946 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 b3995627850..ce02d81914f 100644
index 667b66f8231..6e215b8f2c4 100644
--- a/dlls/wined3d/wined3d_private.h
+++ b/dlls/wined3d/wined3d_private.h
@@ -3279,6 +3279,7 @@ void wined3d_cs_emit_unload_resource(struct wined3d_cs *cs, struct wined3d_resou
@@ -3301,6 +3301,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 depth_pitch) DECLSPEC_HIDDEN;

View File

@ -1,4 +1,4 @@
From a25b97bf63e04c95f9f2028f48db60d5fc511433 Mon Sep 17 00:00:00 2001
From d8510f1a77606628c1868332f11f5dd8ec90f82e Mon Sep 17 00:00:00 2001
From: Nils Kuhnhenn <nils@volafile.io>
Date: Fri, 5 Aug 2016 20:28:46 +0200
Subject: wined3d: Fix context_acquire not being called from the command thread
@ -11,18 +11,18 @@ Subject: wined3d: Fix context_acquire not being called from the command thread
3 files changed, 51 insertions(+), 14 deletions(-)
diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c
index c7ed94f623c..5b529d000f4 100644
index 770760f78c7..8b13ca2f792 100644
--- a/dlls/wined3d/cs.c
+++ b/dlls/wined3d/cs.c
@@ -76,6 +76,7 @@ enum wined3d_cs_op
@@ -74,6 +74,7 @@ enum wined3d_cs_op
WINED3D_CS_OP_GET_DC,
WINED3D_CS_OP_RELEASE_DC,
WINED3D_CS_OP_CREATE_SWAPCHAIN_CONTEXT,
WINED3D_CS_OP_UPDATE_SWAP_INTERVAL,
+ WINED3D_CS_OP_TEXTURE_ADD_DIRTY_REGION,
};
struct wined3d_cs_sync
@@ -449,6 +450,13 @@ struct wined3d_cs_update_swap_interval
@@ -435,6 +436,13 @@ struct wined3d_cs_update_swap_interval
struct wined3d_swapchain *swapchain;
};
@ -36,7 +36,7 @@ index c7ed94f623c..5b529d000f4 100644
static void wined3d_cs_exec_sync(struct wined3d_cs *cs, const void *data)
{
}
@@ -2140,6 +2148,45 @@ void wined3d_cs_emit_update_swap_interval(struct wined3d_cs *cs, struct wined3d_
@@ -2092,6 +2100,45 @@ void wined3d_cs_emit_update_swap_interval(struct wined3d_cs *cs, struct wined3d_
cs->ops->submit_and_wait(cs);
}
@ -82,19 +82,19 @@ index c7ed94f623c..5b529d000f4 100644
static void (* const wined3d_cs_op_handlers[])(struct wined3d_cs *cs, const void *data) =
{
/* WINED3D_CS_OP_SYNC */ wined3d_cs_exec_sync,
@@ -2192,6 +2239,7 @@ static void (* const wined3d_cs_op_handlers[])(struct wined3d_cs *cs, const void
@@ -2142,6 +2189,7 @@ static void (* const wined3d_cs_op_handlers[])(struct wined3d_cs *cs, const void
/* WINED3D_CS_OP_GET_DC */ wined3d_cs_exec_get_dc,
/* WINED3D_CS_OP_RELEASE_DC */ wined3d_cs_exec_release_dc,
/* WINED3D_CS_OP_CREATE_SWAPCHAIN_CONTEXT */ wined3d_cs_exec_create_swapchain_context,
/* 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 70c4590f74a..de118e4d564 100644
index baecda0b9ed..4c6a8e96611 100644
--- a/dlls/wined3d/texture.c
+++ b/dlls/wined3d/texture.c
@@ -1521,7 +1521,6 @@ struct wined3d_texture_sub_resource *wined3d_texture_get_sub_resource(struct win
@@ -1523,7 +1523,6 @@ struct wined3d_texture_sub_resource *wined3d_texture_get_sub_resource(struct win
HRESULT CDECL wined3d_texture_add_dirty_region(struct wined3d_texture *texture,
UINT layer, const struct wined3d_box *dirty_region)
{
@ -102,7 +102,7 @@ index 70c4590f74a..de118e4d564 100644
unsigned int sub_resource_idx;
TRACE("texture %p, layer %u, dirty_region %s.\n", texture, layer, debug_box(dirty_region));
@@ -1533,19 +1532,7 @@ HRESULT CDECL wined3d_texture_add_dirty_region(struct wined3d_texture *texture,
@@ -1535,19 +1534,7 @@ HRESULT CDECL wined3d_texture_add_dirty_region(struct wined3d_texture *texture,
}
sub_resource_idx = layer * texture->level_count;
@ -124,10 +124,10 @@ index 70c4590f74a..de118e4d564 100644
}
diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h
index ce02d81914f..7cabc276a0b 100644
index 6e215b8f2c4..efa3b879098 100644
--- a/dlls/wined3d/wined3d_private.h
+++ b/dlls/wined3d/wined3d_private.h
@@ -3274,6 +3274,8 @@ void wined3d_cs_emit_set_unordered_access_view(struct wined3d_cs *cs, enum wined
@@ -3296,6 +3296,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;

View File

@ -1,4 +1,4 @@
From da62e3d0e77ffb6f420b1c460bc52b833955635c Mon Sep 17 00:00:00 2001
From 3bf5f63ec62c705afb14d485df3e2d0bd799d7dd Mon Sep 17 00:00:00 2001
From: Sebastian Lackner <sebastian@fds-team.de>
Date: Tue, 7 Feb 2017 14:37:07 +0100
Subject: wined3d: Send buffer copy requests through CS.
@ -10,18 +10,18 @@ Subject: wined3d: Send buffer copy requests through CS.
3 files changed, 51 insertions(+), 4 deletions(-)
diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c
index 7e032d8ec05..381b7ca30ac 100644
index be7e041b86c..51ac0c2b000 100644
--- a/dlls/wined3d/cs.c
+++ b/dlls/wined3d/cs.c
@@ -77,6 +77,7 @@ enum wined3d_cs_op
WINED3D_CS_OP_CREATE_SWAPCHAIN_CONTEXT,
@@ -75,6 +75,7 @@ enum wined3d_cs_op
WINED3D_CS_OP_RELEASE_DC,
WINED3D_CS_OP_UPDATE_SWAP_INTERVAL,
WINED3D_CS_OP_TEXTURE_ADD_DIRTY_REGION,
+ WINED3D_CS_OP_BUFFER_COPY,
};
struct wined3d_cs_sync
@@ -457,6 +458,16 @@ struct wined3d_cs_texture_add_dirty_region
@@ -443,6 +444,16 @@ struct wined3d_cs_texture_add_dirty_region
unsigned int sub_resource_idx;
};
@ -38,7 +38,7 @@ index 7e032d8ec05..381b7ca30ac 100644
static void wined3d_cs_exec_sync(struct wined3d_cs *cs, const void *data)
{
}
@@ -2198,6 +2209,38 @@ void wined3d_cs_emit_texture_add_dirty_region(struct wined3d_cs *cs,
@@ -2150,6 +2161,38 @@ void wined3d_cs_emit_texture_add_dirty_region(struct wined3d_cs *cs,
cs->ops->submit(cs);
}
@ -77,8 +77,8 @@ index 7e032d8ec05..381b7ca30ac 100644
static void (* const wined3d_cs_op_handlers[])(struct wined3d_cs *cs, const void *data) =
{
/* WINED3D_CS_OP_SYNC */ wined3d_cs_exec_sync,
@@ -2251,6 +2294,7 @@ static void (* const wined3d_cs_op_handlers[])(struct wined3d_cs *cs, const void
/* WINED3D_CS_OP_CREATE_SWAPCHAIN_CONTEXT */ wined3d_cs_exec_create_swapchain_context,
@@ -2201,6 +2244,7 @@ static void (* const wined3d_cs_op_handlers[])(struct wined3d_cs *cs, const void
/* WINED3D_CS_OP_RELEASE_DC */ wined3d_cs_exec_release_dc,
/* 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,
+ /* WINED3D_CS_OP_BUFFER_COPY */ wined3d_cs_exec_buffer_copy,
@ -86,10 +86,10 @@ index 7e032d8ec05..381b7ca30ac 100644
static void *wined3d_cs_st_require_space(struct wined3d_cs *cs, size_t size)
diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c
index bf647d5241c..625357e4407 100644
index 749ba9ca19c..a8ca7cbaf56 100644
--- a/dlls/wined3d/device.c
+++ b/dlls/wined3d/device.c
@@ -3981,10 +3981,9 @@ void CDECL wined3d_device_copy_resource(struct wined3d_device *device,
@@ -3991,10 +3991,9 @@ void CDECL wined3d_device_copy_resource(struct wined3d_device *device,
if (dst_resource->type == WINED3D_RTYPE_BUFFER)
{
@ -102,7 +102,7 @@ index bf647d5241c..625357e4407 100644
return;
}
@@ -4106,8 +4105,9 @@ HRESULT CDECL wined3d_device_copy_sub_resource_region(struct wined3d_device *dev
@@ -4116,8 +4115,9 @@ HRESULT CDECL wined3d_device_copy_sub_resource_region(struct wined3d_device *dev
return WINED3DERR_INVALIDCALL;
}
@ -114,10 +114,10 @@ index bf647d5241c..625357e4407 100644
if (dst_resource->type != WINED3D_RTYPE_TEXTURE_2D)
diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h
index e4474a7b2c5..2b7b658a162 100644
index d45c45c09dc..708091f573b 100644
--- a/dlls/wined3d/wined3d_private.h
+++ b/dlls/wined3d/wined3d_private.h
@@ -3214,6 +3214,9 @@ void wined3d_cs_emit_blt(struct wined3d_cs *cs, struct wined3d_surface *dst_surf
@@ -3239,6 +3239,9 @@ void wined3d_cs_emit_blt(struct wined3d_cs *cs, struct wined3d_surface *dst_surf
const RECT *dst_rect, struct wined3d_surface *src_surface,
const RECT *src_rect, DWORD flags, const struct wined3d_blt_fx *fx,
enum wined3d_texture_filter_type filter) DECLSPEC_HIDDEN;

View File

@ -1,15 +1,15 @@
From adcfeb74fcf62fa623485fa08f46cbcf7d83e253 Mon Sep 17 00:00:00 2001
From aaef68da7d9a0734e4827036aa561b0e67c70606 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Stefan=20D=C3=B6singer?= <stefan@codeweavers.com>
Date: Tue, 1 Oct 2013 14:31:56 +0200
Subject: wined3d: Hackily introduce a multithreaded command stream
---
dlls/wined3d/context.c | 3 +
dlls/wined3d/cs.c | 447 +++++++++++++++++++++++++++++++++++------
dlls/wined3d/cs.c | 443 ++++++++++++++++++++++++++++++++++++-----
dlls/wined3d/device.c | 2 +-
dlls/wined3d/wined3d_main.c | 10 +
dlls/wined3d/wined3d_private.h | 33 ++-
5 files changed, 433 insertions(+), 62 deletions(-)
5 files changed, 430 insertions(+), 61 deletions(-)
diff --git a/dlls/wined3d/context.c b/dlls/wined3d/context.c
index 9e0805e822d..226d655b83a 100644
@ -26,7 +26,7 @@ index 9e0805e822d..226d655b83a 100644
current_context = NULL;
diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c
index 1711762f485..4200b5ebeeb 100644
index 93a80f2887e..35f6a5889fb 100644
--- a/dlls/wined3d/cs.c
+++ b/dlls/wined3d/cs.c
@@ -18,6 +18,7 @@
@ -37,7 +37,7 @@ index 1711762f485..4200b5ebeeb 100644
#include "wined3d_private.h"
WINE_DEFAULT_DEBUG_CHANNEL(d3d);
@@ -78,6 +79,7 @@ enum wined3d_cs_op
@@ -77,6 +78,7 @@ enum wined3d_cs_op
WINED3D_CS_OP_TEXTURE_ADD_DIRTY_REGION,
WINED3D_CS_OP_BUFFER_COPY,
WINED3D_CS_OP_MAP_VERTEX_BUFFERS,
@ -45,7 +45,7 @@ index 1711762f485..4200b5ebeeb 100644
};
struct wined3d_cs_sync
@@ -470,8 +472,14 @@ struct wined3d_cs_map_vertex_buffers
@@ -462,8 +464,14 @@ struct wined3d_cs_map_vertex_buffers
struct wined3d_stream_info *stream_info;
};
@ -61,7 +61,7 @@ index 1711762f485..4200b5ebeeb 100644
}
void wined3d_cs_emit_sync(struct wined3d_cs *cs)
@@ -484,12 +492,14 @@ void wined3d_cs_emit_sync(struct wined3d_cs *cs)
@@ -476,12 +484,14 @@ void wined3d_cs_emit_sync(struct wined3d_cs *cs)
cs->ops->submit_and_wait(cs);
}
@ -77,7 +77,7 @@ index 1711762f485..4200b5ebeeb 100644
}
void wined3d_cs_emit_glfinish(struct wined3d_cs *cs)
@@ -502,7 +512,7 @@ void wined3d_cs_emit_glfinish(struct wined3d_cs *cs)
@@ -494,7 +504,7 @@ void wined3d_cs_emit_glfinish(struct wined3d_cs *cs)
cs->ops->submit_and_wait(cs);
}
@ -86,7 +86,7 @@ index 1711762f485..4200b5ebeeb 100644
{
const struct wined3d_cs_present *op = data;
struct wined3d_swapchain *swapchain;
@@ -520,6 +530,8 @@ static void wined3d_cs_exec_present(struct wined3d_cs *cs, const void *data)
@@ -512,6 +522,8 @@ static void wined3d_cs_exec_present(struct wined3d_cs *cs, const void *data)
{
wined3d_resource_release(&swapchain->back_buffers[i]->resource);
}
@ -95,7 +95,7 @@ index 1711762f485..4200b5ebeeb 100644
}
void wined3d_cs_emit_present(struct wined3d_cs *cs, struct wined3d_swapchain *swapchain,
@@ -559,13 +571,14 @@ void wined3d_cs_emit_present(struct wined3d_cs *cs, struct wined3d_swapchain *sw
@@ -551,13 +563,14 @@ void wined3d_cs_emit_present(struct wined3d_cs *cs, struct wined3d_swapchain *sw
pending = InterlockedCompareExchange(&cs->pending_presents, 0, 0);
}
@ -111,7 +111,7 @@ index 1711762f485..4200b5ebeeb 100644
device = cs->device;
wined3d_get_draw_rect(state, &draw_rect);
@@ -583,6 +596,8 @@ static void wined3d_cs_exec_clear(struct wined3d_cs *cs, const void *data)
@@ -575,6 +588,8 @@ static void wined3d_cs_exec_clear(struct wined3d_cs *cs, const void *data)
}
if (op->flags & (WINED3DCLEAR_ZBUFFER | WINED3DCLEAR_STENCIL))
wined3d_resource_release(state->fb->depth_stencil->resource);
@ -120,7 +120,7 @@ index 1711762f485..4200b5ebeeb 100644
}
void wined3d_cs_emit_clear(struct wined3d_cs *cs, DWORD rect_count, const RECT *rects,
@@ -721,7 +736,7 @@ static void release_unordered_access_resources(const struct wined3d_shader *shad
@@ -713,7 +728,7 @@ static void release_unordered_access_resources(const struct wined3d_shader *shad
}
}
@ -129,7 +129,7 @@ index 1711762f485..4200b5ebeeb 100644
{
const struct wined3d_cs_dispatch *op = data;
struct wined3d_state *state = &cs->state;
@@ -732,6 +747,8 @@ static void wined3d_cs_exec_dispatch(struct wined3d_cs *cs, const void *data)
@@ -724,6 +739,8 @@ 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]);
@ -138,7 +138,7 @@ index 1711762f485..4200b5ebeeb 100644
}
void wined3d_cs_emit_dispatch(struct wined3d_cs *cs,
@@ -753,7 +770,7 @@ void wined3d_cs_emit_dispatch(struct wined3d_cs *cs,
@@ -745,7 +762,7 @@ void wined3d_cs_emit_dispatch(struct wined3d_cs *cs,
cs->ops->submit(cs);
}
@ -147,7 +147,7 @@ index 1711762f485..4200b5ebeeb 100644
{
struct wined3d_state *state = &cs->state;
const struct wined3d_cs_draw *op = data;
@@ -798,6 +815,8 @@ static void wined3d_cs_exec_draw(struct wined3d_cs *cs, const void *data)
@@ -790,6 +807,8 @@ 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]);
@ -156,7 +156,7 @@ index 1711762f485..4200b5ebeeb 100644
}
void wined3d_cs_emit_draw(struct wined3d_cs *cs, GLenum primitive_type, int base_vertex_idx, unsigned int start_idx,
@@ -843,12 +862,14 @@ void wined3d_cs_emit_draw(struct wined3d_cs *cs, GLenum primitive_type, int base
@@ -835,12 +854,14 @@ void wined3d_cs_emit_draw(struct wined3d_cs *cs, GLenum primitive_type, int base
cs->ops->submit(cs);
}
@ -172,7 +172,7 @@ index 1711762f485..4200b5ebeeb 100644
}
void wined3d_cs_emit_set_predication(struct wined3d_cs *cs, struct wined3d_query *predicate, BOOL value)
@@ -863,12 +884,14 @@ void wined3d_cs_emit_set_predication(struct wined3d_cs *cs, struct wined3d_query
@@ -855,12 +876,14 @@ void wined3d_cs_emit_set_predication(struct wined3d_cs *cs, struct wined3d_query
cs->ops->submit(cs);
}
@ -188,7 +188,7 @@ index 1711762f485..4200b5ebeeb 100644
}
void wined3d_cs_emit_set_viewport(struct wined3d_cs *cs, const struct wined3d_viewport *viewport)
@@ -882,12 +905,14 @@ void wined3d_cs_emit_set_viewport(struct wined3d_cs *cs, const struct wined3d_vi
@@ -874,12 +897,14 @@ void wined3d_cs_emit_set_viewport(struct wined3d_cs *cs, const struct wined3d_vi
cs->ops->submit(cs);
}
@ -204,7 +204,7 @@ index 1711762f485..4200b5ebeeb 100644
}
void wined3d_cs_emit_set_scissor_rect(struct wined3d_cs *cs, const RECT *rect)
@@ -901,12 +926,14 @@ void wined3d_cs_emit_set_scissor_rect(struct wined3d_cs *cs, const RECT *rect)
@@ -893,12 +918,14 @@ void wined3d_cs_emit_set_scissor_rect(struct wined3d_cs *cs, const RECT *rect)
cs->ops->submit(cs);
}
@ -220,7 +220,7 @@ index 1711762f485..4200b5ebeeb 100644
}
void wined3d_cs_emit_set_rendertarget_view(struct wined3d_cs *cs, unsigned int view_idx,
@@ -922,7 +949,7 @@ void wined3d_cs_emit_set_rendertarget_view(struct wined3d_cs *cs, unsigned int v
@@ -914,7 +941,7 @@ void wined3d_cs_emit_set_rendertarget_view(struct wined3d_cs *cs, unsigned int v
cs->ops->submit(cs);
}
@ -229,7 +229,7 @@ index 1711762f485..4200b5ebeeb 100644
{
const struct wined3d_cs_set_depth_stencil_view *op = data;
struct wined3d_device *device = cs->device;
@@ -957,6 +984,8 @@ static void wined3d_cs_exec_set_depth_stencil_view(struct wined3d_cs *cs, const
@@ -949,6 +976,8 @@ static void wined3d_cs_exec_set_depth_stencil_view(struct wined3d_cs *cs, const
}
device_invalidate_state(device, STATE_FRAMEBUFFER);
@ -238,7 +238,7 @@ index 1711762f485..4200b5ebeeb 100644
}
void wined3d_cs_emit_set_depth_stencil_view(struct wined3d_cs *cs, struct wined3d_rendertarget_view *view)
@@ -970,12 +999,14 @@ void wined3d_cs_emit_set_depth_stencil_view(struct wined3d_cs *cs, struct wined3
@@ -962,12 +991,14 @@ void wined3d_cs_emit_set_depth_stencil_view(struct wined3d_cs *cs, struct wined3
cs->ops->submit(cs);
}
@ -254,7 +254,7 @@ index 1711762f485..4200b5ebeeb 100644
}
void wined3d_cs_emit_set_vertex_declaration(struct wined3d_cs *cs, struct wined3d_vertex_declaration *declaration)
@@ -989,7 +1020,7 @@ void wined3d_cs_emit_set_vertex_declaration(struct wined3d_cs *cs, struct wined3
@@ -981,7 +1012,7 @@ void wined3d_cs_emit_set_vertex_declaration(struct wined3d_cs *cs, struct wined3
cs->ops->submit(cs);
}
@ -263,7 +263,7 @@ index 1711762f485..4200b5ebeeb 100644
{
const struct wined3d_cs_set_stream_source *op = data;
struct wined3d_stream_state *stream;
@@ -1007,6 +1038,8 @@ static void wined3d_cs_exec_set_stream_source(struct wined3d_cs *cs, const void
@@ -999,6 +1030,8 @@ 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);
@ -272,7 +272,7 @@ index 1711762f485..4200b5ebeeb 100644
}
void wined3d_cs_emit_set_stream_source(struct wined3d_cs *cs, UINT stream_idx,
@@ -1024,7 +1057,7 @@ void wined3d_cs_emit_set_stream_source(struct wined3d_cs *cs, UINT stream_idx,
@@ -1016,7 +1049,7 @@ void wined3d_cs_emit_set_stream_source(struct wined3d_cs *cs, UINT stream_idx,
cs->ops->submit(cs);
}
@ -281,7 +281,7 @@ index 1711762f485..4200b5ebeeb 100644
{
const struct wined3d_cs_set_stream_source_freq *op = data;
struct wined3d_stream_state *stream;
@@ -1034,6 +1067,8 @@ static void wined3d_cs_exec_set_stream_source_freq(struct wined3d_cs *cs, const
@@ -1026,6 +1059,8 @@ 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);
@ -290,7 +290,7 @@ index 1711762f485..4200b5ebeeb 100644
}
void wined3d_cs_emit_set_stream_source_freq(struct wined3d_cs *cs, UINT stream_idx, UINT frequency, UINT flags)
@@ -1049,7 +1084,7 @@ void wined3d_cs_emit_set_stream_source_freq(struct wined3d_cs *cs, UINT stream_i
@@ -1041,7 +1076,7 @@ void wined3d_cs_emit_set_stream_source_freq(struct wined3d_cs *cs, UINT stream_i
cs->ops->submit(cs);
}
@ -299,7 +299,7 @@ index 1711762f485..4200b5ebeeb 100644
{
const struct wined3d_cs_set_stream_output *op = data;
struct wined3d_stream_output *stream;
@@ -1064,6 +1099,8 @@ static void wined3d_cs_exec_set_stream_output(struct wined3d_cs *cs, const void
@@ -1056,6 +1091,8 @@ static void wined3d_cs_exec_set_stream_output(struct wined3d_cs *cs, const void
InterlockedIncrement(&op->buffer->resource.bind_count);
if (prev)
InterlockedDecrement(&prev->resource.bind_count);
@ -308,7 +308,7 @@ index 1711762f485..4200b5ebeeb 100644
}
void wined3d_cs_emit_set_stream_output(struct wined3d_cs *cs, UINT stream_idx,
@@ -1080,7 +1117,7 @@ void wined3d_cs_emit_set_stream_output(struct wined3d_cs *cs, UINT stream_idx,
@@ -1072,7 +1109,7 @@ void wined3d_cs_emit_set_stream_output(struct wined3d_cs *cs, UINT stream_idx,
cs->ops->submit(cs);
}
@ -317,7 +317,7 @@ index 1711762f485..4200b5ebeeb 100644
{
const struct wined3d_cs_set_index_buffer *op = data;
struct wined3d_buffer *prev;
@@ -1096,6 +1133,8 @@ static void wined3d_cs_exec_set_index_buffer(struct wined3d_cs *cs, const void *
@@ -1088,6 +1125,8 @@ 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);
@ -326,7 +326,7 @@ index 1711762f485..4200b5ebeeb 100644
}
void wined3d_cs_emit_set_index_buffer(struct wined3d_cs *cs, struct wined3d_buffer *buffer,
@@ -1112,7 +1151,7 @@ void wined3d_cs_emit_set_index_buffer(struct wined3d_cs *cs, struct wined3d_buff
@@ -1104,7 +1143,7 @@ void wined3d_cs_emit_set_index_buffer(struct wined3d_cs *cs, struct wined3d_buff
cs->ops->submit(cs);
}
@ -335,7 +335,7 @@ index 1711762f485..4200b5ebeeb 100644
{
const struct wined3d_cs_set_constant_buffer *op = data;
struct wined3d_buffer *prev;
@@ -1126,6 +1165,7 @@ static void wined3d_cs_exec_set_constant_buffer(struct wined3d_cs *cs, const voi
@@ -1118,6 +1157,7 @@ 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));
@ -343,7 +343,7 @@ index 1711762f485..4200b5ebeeb 100644
}
void wined3d_cs_emit_set_constant_buffer(struct wined3d_cs *cs, enum wined3d_shader_type type,
@@ -1142,7 +1182,7 @@ void wined3d_cs_emit_set_constant_buffer(struct wined3d_cs *cs, enum wined3d_sha
@@ -1134,7 +1174,7 @@ void wined3d_cs_emit_set_constant_buffer(struct wined3d_cs *cs, enum wined3d_sha
cs->ops->submit(cs);
}
@ -352,7 +352,7 @@ index 1711762f485..4200b5ebeeb 100644
{
const struct wined3d_gl_info *gl_info = &cs->device->adapter->gl_info;
const struct wined3d_d3d_info *d3d_info = &cs->device->adapter->d3d_info;
@@ -1219,6 +1259,8 @@ static void wined3d_cs_exec_set_texture(struct wined3d_cs *cs, const void *data)
@@ -1211,6 +1251,8 @@ 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);
@ -361,7 +361,7 @@ index 1711762f485..4200b5ebeeb 100644
}
void wined3d_cs_emit_set_texture(struct wined3d_cs *cs, UINT stage, struct wined3d_texture *texture)
@@ -1233,7 +1275,7 @@ void wined3d_cs_emit_set_texture(struct wined3d_cs *cs, UINT stage, struct wined
@@ -1225,7 +1267,7 @@ void wined3d_cs_emit_set_texture(struct wined3d_cs *cs, UINT stage, struct wined
cs->ops->submit(cs);
}
@ -370,7 +370,7 @@ index 1711762f485..4200b5ebeeb 100644
{
const struct wined3d_cs_set_shader_resource_view *op = data;
struct wined3d_shader_resource_view *prev;
@@ -1250,6 +1292,8 @@ static void wined3d_cs_exec_set_shader_resource_view(struct wined3d_cs *cs, cons
@@ -1242,6 +1284,8 @@ 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);
@ -379,7 +379,7 @@ index 1711762f485..4200b5ebeeb 100644
}
void wined3d_cs_emit_set_shader_resource_view(struct wined3d_cs *cs, enum wined3d_shader_type type,
@@ -1266,7 +1310,7 @@ void wined3d_cs_emit_set_shader_resource_view(struct wined3d_cs *cs, enum wined3
@@ -1258,7 +1302,7 @@ void wined3d_cs_emit_set_shader_resource_view(struct wined3d_cs *cs, enum wined3
cs->ops->submit(cs);
}
@ -388,7 +388,7 @@ index 1711762f485..4200b5ebeeb 100644
{
const struct wined3d_cs_set_unordered_access_view *op = data;
struct wined3d_unordered_access_view *prev;
@@ -1280,6 +1324,8 @@ static void wined3d_cs_exec_set_unordered_access_view(struct wined3d_cs *cs, con
@@ -1272,6 +1316,8 @@ 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));
@ -397,7 +397,7 @@ index 1711762f485..4200b5ebeeb 100644
}
void wined3d_cs_emit_set_unordered_access_view(struct wined3d_cs *cs, enum wined3d_pipeline pipeline,
@@ -1296,7 +1342,7 @@ void wined3d_cs_emit_set_unordered_access_view(struct wined3d_cs *cs, enum wined
@@ -1288,7 +1334,7 @@ void wined3d_cs_emit_set_unordered_access_view(struct wined3d_cs *cs, enum wined
cs->ops->submit(cs);
}
@ -406,7 +406,7 @@ index 1711762f485..4200b5ebeeb 100644
{
const struct wined3d_cs_set_sampler *op = data;
@@ -1305,6 +1351,8 @@ static void wined3d_cs_exec_set_sampler(struct wined3d_cs *cs, const void *data)
@@ -1297,6 +1343,8 @@ 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);
@ -415,7 +415,7 @@ index 1711762f485..4200b5ebeeb 100644
}
void wined3d_cs_emit_set_sampler(struct wined3d_cs *cs, enum wined3d_shader_type type,
@@ -1321,7 +1369,7 @@ void wined3d_cs_emit_set_sampler(struct wined3d_cs *cs, enum wined3d_shader_type
@@ -1313,7 +1361,7 @@ void wined3d_cs_emit_set_sampler(struct wined3d_cs *cs, enum wined3d_shader_type
cs->ops->submit(cs);
}
@ -424,7 +424,7 @@ index 1711762f485..4200b5ebeeb 100644
{
const struct wined3d_cs_set_shader *op = data;
@@ -1331,6 +1379,8 @@ static void wined3d_cs_exec_set_shader(struct wined3d_cs *cs, const void *data)
@@ -1323,6 +1371,8 @@ 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);
@ -433,7 +433,7 @@ index 1711762f485..4200b5ebeeb 100644
}
void wined3d_cs_emit_set_shader(struct wined3d_cs *cs, enum wined3d_shader_type type, struct wined3d_shader *shader)
@@ -1345,12 +1395,14 @@ void wined3d_cs_emit_set_shader(struct wined3d_cs *cs, enum wined3d_shader_type
@@ -1337,12 +1387,14 @@ void wined3d_cs_emit_set_shader(struct wined3d_cs *cs, enum wined3d_shader_type
cs->ops->submit(cs);
}
@ -449,7 +449,7 @@ index 1711762f485..4200b5ebeeb 100644
}
void wined3d_cs_emit_set_rasterizer_state(struct wined3d_cs *cs,
@@ -1365,12 +1417,14 @@ void wined3d_cs_emit_set_rasterizer_state(struct wined3d_cs *cs,
@@ -1357,12 +1409,14 @@ void wined3d_cs_emit_set_rasterizer_state(struct wined3d_cs *cs,
cs->ops->submit(cs);
}
@ -465,7 +465,7 @@ index 1711762f485..4200b5ebeeb 100644
}
void wined3d_cs_emit_set_render_state(struct wined3d_cs *cs, enum wined3d_render_state state, DWORD value)
@@ -1385,12 +1439,14 @@ void wined3d_cs_emit_set_render_state(struct wined3d_cs *cs, enum wined3d_render
@@ -1377,12 +1431,14 @@ void wined3d_cs_emit_set_render_state(struct wined3d_cs *cs, enum wined3d_render
cs->ops->submit(cs);
}
@ -481,7 +481,7 @@ index 1711762f485..4200b5ebeeb 100644
}
void wined3d_cs_emit_set_texture_state(struct wined3d_cs *cs, UINT stage,
@@ -1407,12 +1463,14 @@ void wined3d_cs_emit_set_texture_state(struct wined3d_cs *cs, UINT stage,
@@ -1399,12 +1455,14 @@ void wined3d_cs_emit_set_texture_state(struct wined3d_cs *cs, UINT stage,
cs->ops->submit(cs);
}
@ -497,7 +497,7 @@ index 1711762f485..4200b5ebeeb 100644
}
void wined3d_cs_emit_set_sampler_state(struct wined3d_cs *cs, UINT sampler_idx,
@@ -1429,13 +1487,15 @@ void wined3d_cs_emit_set_sampler_state(struct wined3d_cs *cs, UINT sampler_idx,
@@ -1421,13 +1479,15 @@ void wined3d_cs_emit_set_sampler_state(struct wined3d_cs *cs, UINT sampler_idx,
cs->ops->submit(cs);
}
@ -514,7 +514,7 @@ index 1711762f485..4200b5ebeeb 100644
}
void wined3d_cs_emit_set_transform(struct wined3d_cs *cs, enum wined3d_transform_state state,
@@ -1451,12 +1511,14 @@ void wined3d_cs_emit_set_transform(struct wined3d_cs *cs, enum wined3d_transform
@@ -1443,12 +1503,14 @@ void wined3d_cs_emit_set_transform(struct wined3d_cs *cs, enum wined3d_transform
cs->ops->submit(cs);
}
@ -530,7 +530,7 @@ index 1711762f485..4200b5ebeeb 100644
}
void wined3d_cs_emit_set_clip_plane(struct wined3d_cs *cs, UINT plane_idx, const struct wined3d_vec4 *plane)
@@ -1471,7 +1533,7 @@ void wined3d_cs_emit_set_clip_plane(struct wined3d_cs *cs, UINT plane_idx, const
@@ -1463,7 +1525,7 @@ void wined3d_cs_emit_set_clip_plane(struct wined3d_cs *cs, UINT plane_idx, const
cs->ops->submit(cs);
}
@ -539,7 +539,7 @@ index 1711762f485..4200b5ebeeb 100644
{
const struct wined3d_cs_set_color_key *op = data;
struct wined3d_texture *texture = op->texture;
@@ -1532,6 +1594,8 @@ static void wined3d_cs_exec_set_color_key(struct wined3d_cs *cs, const void *dat
@@ -1524,6 +1586,8 @@ static void wined3d_cs_exec_set_color_key(struct wined3d_cs *cs, const void *dat
break;
}
}
@ -548,7 +548,7 @@ index 1711762f485..4200b5ebeeb 100644
}
void wined3d_cs_emit_set_color_key(struct wined3d_cs *cs, struct wined3d_texture *texture,
@@ -1554,12 +1618,14 @@ void wined3d_cs_emit_set_color_key(struct wined3d_cs *cs, struct wined3d_texture
@@ -1546,12 +1610,14 @@ void wined3d_cs_emit_set_color_key(struct wined3d_cs *cs, struct wined3d_texture
cs->ops->submit(cs);
}
@ -564,7 +564,7 @@ index 1711762f485..4200b5ebeeb 100644
}
void wined3d_cs_emit_set_material(struct wined3d_cs *cs, const struct wined3d_material *material)
@@ -1573,7 +1639,7 @@ void wined3d_cs_emit_set_material(struct wined3d_cs *cs, const struct wined3d_ma
@@ -1565,7 +1631,7 @@ void wined3d_cs_emit_set_material(struct wined3d_cs *cs, const struct wined3d_ma
cs->ops->submit(cs);
}
@ -573,7 +573,7 @@ index 1711762f485..4200b5ebeeb 100644
{
const struct wined3d_cs_set_light *op = data;
struct wined3d_light_info *light_info;
@@ -1587,7 +1653,7 @@ static void wined3d_cs_exec_set_light(struct wined3d_cs *cs, const void *data)
@@ -1579,7 +1645,7 @@ static void wined3d_cs_exec_set_light(struct wined3d_cs *cs, const void *data)
if (!(light_info = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(*light_info))))
{
ERR("Failed to allocate light info.\n");
@ -582,7 +582,7 @@ index 1711762f485..4200b5ebeeb 100644
}
hash_idx = LIGHTMAP_HASHFUNC(light_idx);
@@ -1608,6 +1674,8 @@ static void wined3d_cs_exec_set_light(struct wined3d_cs *cs, const void *data)
@@ -1600,6 +1666,8 @@ static void wined3d_cs_exec_set_light(struct wined3d_cs *cs, const void *data)
light_info->direction = op->light.direction;
light_info->exponent = op->light.exponent;
light_info->cutoff = op->light.cutoff;
@ -591,7 +591,7 @@ index 1711762f485..4200b5ebeeb 100644
}
void wined3d_cs_emit_set_light(struct wined3d_cs *cs, const struct wined3d_light_info *light)
@@ -1621,7 +1689,7 @@ void wined3d_cs_emit_set_light(struct wined3d_cs *cs, const struct wined3d_light
@@ -1613,7 +1681,7 @@ void wined3d_cs_emit_set_light(struct wined3d_cs *cs, const struct wined3d_light
cs->ops->submit(cs);
}
@ -600,7 +600,7 @@ index 1711762f485..4200b5ebeeb 100644
{
const struct wined3d_cs_set_light_enable *op = data;
struct wined3d_device *device = cs->device;
@@ -1631,7 +1699,7 @@ static void wined3d_cs_exec_set_light_enable(struct wined3d_cs *cs, const void *
@@ -1623,7 +1691,7 @@ static void wined3d_cs_exec_set_light_enable(struct wined3d_cs *cs, const void *
if (!(light_info = wined3d_state_get_light(&cs->state, op->idx)))
{
ERR("Light doesn't exist.\n");
@ -609,7 +609,7 @@ index 1711762f485..4200b5ebeeb 100644
}
prev_idx = light_info->glIndex;
@@ -1641,6 +1709,8 @@ static void wined3d_cs_exec_set_light_enable(struct wined3d_cs *cs, const void *
@@ -1633,6 +1701,8 @@ static void wined3d_cs_exec_set_light_enable(struct wined3d_cs *cs, const void *
device_invalidate_state(device, STATE_LIGHT_TYPE);
device_invalidate_state(device, STATE_ACTIVELIGHT(op->enable ? light_info->glIndex : prev_idx));
}
@ -618,7 +618,7 @@ index 1711762f485..4200b5ebeeb 100644
}
void wined3d_cs_emit_set_light_enable(struct wined3d_cs *cs, unsigned int idx, BOOL enable)
@@ -1655,7 +1725,7 @@ void wined3d_cs_emit_set_light_enable(struct wined3d_cs *cs, unsigned int idx, B
@@ -1647,7 +1717,7 @@ void wined3d_cs_emit_set_light_enable(struct wined3d_cs *cs, unsigned int idx, B
cs->ops->submit(cs);
}
@ -627,7 +627,7 @@ index 1711762f485..4200b5ebeeb 100644
{
struct wined3d_adapter *adapter = cs->device->adapter;
@@ -1663,6 +1733,8 @@ static void wined3d_cs_exec_reset_state(struct wined3d_cs *cs, const void *data)
@@ -1655,6 +1725,8 @@ 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);
@ -636,7 +636,7 @@ index 1711762f485..4200b5ebeeb 100644
}
void wined3d_cs_emit_reset_state(struct wined3d_cs *cs)
@@ -1675,11 +1747,13 @@ void wined3d_cs_emit_reset_state(struct wined3d_cs *cs)
@@ -1667,11 +1739,13 @@ void wined3d_cs_emit_reset_state(struct wined3d_cs *cs)
cs->ops->submit(cs);
}
@ -651,7 +651,7 @@ index 1711762f485..4200b5ebeeb 100644
}
static void wined3d_cs_emit_callback(struct wined3d_cs *cs, void (*callback)(void *object), void *object)
@@ -1704,12 +1778,14 @@ void wined3d_cs_init_object(struct wined3d_cs *cs, void (*callback)(void *object
@@ -1696,12 +1770,14 @@ void wined3d_cs_init_object(struct wined3d_cs *cs, void (*callback)(void *object
wined3d_cs_emit_callback(cs, callback, object);
}
@ -667,7 +667,7 @@ index 1711762f485..4200b5ebeeb 100644
}
void wined3d_cs_emit_query_issue(struct wined3d_cs *cs, struct wined3d_query *query, DWORD flags)
@@ -1724,12 +1800,14 @@ void wined3d_cs_emit_query_issue(struct wined3d_cs *cs, struct wined3d_query *qu
@@ -1716,12 +1792,14 @@ void wined3d_cs_emit_query_issue(struct wined3d_cs *cs, struct wined3d_query *qu
cs->ops->submit(cs);
}
@ -683,7 +683,7 @@ index 1711762f485..4200b5ebeeb 100644
}
BOOL wined3d_cs_emit_query_poll(struct wined3d_cs *cs, struct wined3d_query *query, DWORD flags)
@@ -1748,13 +1826,15 @@ BOOL wined3d_cs_emit_query_poll(struct wined3d_cs *cs, struct wined3d_query *que
@@ -1740,13 +1818,15 @@ BOOL wined3d_cs_emit_query_poll(struct wined3d_cs *cs, struct wined3d_query *que
return ret;
}
@ -700,7 +700,7 @@ index 1711762f485..4200b5ebeeb 100644
}
void wined3d_cs_emit_preload_resource(struct wined3d_cs *cs, struct wined3d_resource *resource)
@@ -1770,13 +1850,15 @@ void wined3d_cs_emit_preload_resource(struct wined3d_cs *cs, struct wined3d_reso
@@ -1762,13 +1842,15 @@ void wined3d_cs_emit_preload_resource(struct wined3d_cs *cs, struct wined3d_reso
cs->ops->submit(cs);
}
@ -717,7 +717,7 @@ index 1711762f485..4200b5ebeeb 100644
}
void wined3d_cs_emit_unload_resource(struct wined3d_cs *cs, struct wined3d_resource *resource)
@@ -1792,13 +1874,15 @@ void wined3d_cs_emit_unload_resource(struct wined3d_cs *cs, struct wined3d_resou
@@ -1784,13 +1866,15 @@ void wined3d_cs_emit_unload_resource(struct wined3d_cs *cs, struct wined3d_resou
cs->ops->submit(cs);
}
@ -734,7 +734,7 @@ index 1711762f485..4200b5ebeeb 100644
}
HRESULT wined3d_cs_map(struct wined3d_cs *cs, struct wined3d_resource *resource, unsigned int sub_resource_idx,
@@ -1821,12 +1905,14 @@ HRESULT wined3d_cs_map(struct wined3d_cs *cs, struct wined3d_resource *resource,
@@ -1813,12 +1897,14 @@ HRESULT wined3d_cs_map(struct wined3d_cs *cs, struct wined3d_resource *resource,
return hr;
}
@ -750,7 +750,7 @@ index 1711762f485..4200b5ebeeb 100644
}
HRESULT wined3d_cs_unmap(struct wined3d_cs *cs, struct wined3d_resource *resource, unsigned int sub_resource_idx)
@@ -1867,10 +1953,11 @@ push_constant_info[] =
@@ -1859,10 +1945,11 @@ push_constant_info[] =
{FIELD_OFFSET(struct wined3d_state, ps_consts_b), sizeof(BOOL), WINED3D_SHADER_CONST_PS_B},
};
@ -763,7 +763,7 @@ index 1711762f485..4200b5ebeeb 100644
unsigned int context_count;
unsigned int i;
size_t offset;
@@ -1886,6 +1973,8 @@ static void wined3d_cs_exec_push_constants(struct wined3d_cs *cs, const void *da
@@ -1878,6 +1965,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;
}
@ -772,7 +772,7 @@ index 1711762f485..4200b5ebeeb 100644
}
void wined3d_cs_emit_push_constants(struct wined3d_cs *cs, enum wined3d_push_constants p,
@@ -1903,7 +1992,7 @@ void wined3d_cs_emit_push_constants(struct wined3d_cs *cs, enum wined3d_push_con
@@ -1895,7 +1984,7 @@ void wined3d_cs_emit_push_constants(struct wined3d_cs *cs, enum wined3d_push_con
cs->ops->submit(cs);
}
@ -781,7 +781,7 @@ index 1711762f485..4200b5ebeeb 100644
{
const struct wined3d_cs_blt *op = data;
@@ -1914,6 +2003,8 @@ static void wined3d_cs_exec_blt(struct wined3d_cs *cs, const void *data)
@@ -1906,6 +1995,8 @@ static void wined3d_cs_exec_blt(struct wined3d_cs *cs, const void *data)
wined3d_resource_release(&op->dst_surface->container->resource);
if (op->src_surface && op->src_surface != op->dst_surface)
wined3d_resource_release(&op->src_surface->container->resource);
@ -790,7 +790,7 @@ index 1711762f485..4200b5ebeeb 100644
}
void wined3d_cs_emit_blt(struct wined3d_cs *cs, struct wined3d_surface *dst_surface,
@@ -1941,7 +2032,7 @@ void wined3d_cs_emit_blt(struct wined3d_cs *cs, struct wined3d_surface *dst_surf
@@ -1933,7 +2024,7 @@ void wined3d_cs_emit_blt(struct wined3d_cs *cs, struct wined3d_surface *dst_surf
cs->ops->submit(cs);
}
@ -799,7 +799,7 @@ index 1711762f485..4200b5ebeeb 100644
{
const struct wined3d_cs_clear_rtv *op = data;
struct wined3d_device *device = cs->device;
@@ -1952,6 +2043,8 @@ static void wined3d_cs_exec_clear_rtv(struct wined3d_cs *cs, const void *data)
@@ -1944,6 +2035,8 @@ static void wined3d_cs_exec_clear_rtv(struct wined3d_cs *cs, const void *data)
op->blitter->depth_fill(device, op->view, &op->rect, op->flags, op->depth, op->stencil);
wined3d_resource_release(op->view->resource);
@ -808,7 +808,7 @@ index 1711762f485..4200b5ebeeb 100644
}
void wined3d_cs_emit_clear_rtv(struct wined3d_cs *cs, struct wined3d_rendertarget_view *view,
@@ -1976,7 +2069,7 @@ void wined3d_cs_emit_clear_rtv(struct wined3d_cs *cs, struct wined3d_rendertarge
@@ -1968,7 +2061,7 @@ void wined3d_cs_emit_clear_rtv(struct wined3d_cs *cs, struct wined3d_rendertarge
cs->ops->submit(cs);
}
@ -817,7 +817,7 @@ index 1711762f485..4200b5ebeeb 100644
{
const struct wined3d_cs_update_texture *op = data;
struct wined3d_context *context;
@@ -1987,6 +2080,8 @@ static void wined3d_cs_exec_update_texture(struct wined3d_cs *cs, const void *da
@@ -1979,6 +2072,8 @@ static void wined3d_cs_exec_update_texture(struct wined3d_cs *cs, const void *da
wined3d_resource_release(&op->src->resource);
wined3d_resource_release(&op->dst->resource);
@ -826,7 +826,7 @@ index 1711762f485..4200b5ebeeb 100644
}
void wined3d_cs_emit_update_texture(struct wined3d_cs *cs, struct wined3d_texture *src,
@@ -2005,7 +2100,7 @@ void wined3d_cs_emit_update_texture(struct wined3d_cs *cs, struct wined3d_textur
@@ -1997,7 +2092,7 @@ void wined3d_cs_emit_update_texture(struct wined3d_cs *cs, struct wined3d_textur
cs->ops->submit(cs);
}
@ -835,7 +835,7 @@ index 1711762f485..4200b5ebeeb 100644
{
const struct wined3d_cs_update_sub_resource *op = data;
struct wined3d_const_bo_address addr;
@@ -2021,7 +2116,7 @@ static void wined3d_cs_exec_update_sub_resource(struct wined3d_cs *cs, const voi
@@ -2013,7 +2108,7 @@ static void wined3d_cs_exec_update_sub_resource(struct wined3d_cs *cs, const voi
if (FAILED(hr = wined3d_buffer_upload_data(buffer, op->box, op->data)))
WARN("Failed to update buffer data, hr %#x.\n", hr);
@ -844,7 +844,7 @@ index 1711762f485..4200b5ebeeb 100644
}
texture = wined3d_texture_from_resource(op->resource);
@@ -2050,6 +2145,8 @@ static void wined3d_cs_exec_update_sub_resource(struct wined3d_cs *cs, const voi
@@ -2042,6 +2137,8 @@ static void wined3d_cs_exec_update_sub_resource(struct wined3d_cs *cs, const voi
wined3d_texture_validate_location(texture, op->sub_resource_idx, WINED3D_LOCATION_TEXTURE_RGB);
wined3d_texture_invalidate_location(texture, op->sub_resource_idx, ~WINED3D_LOCATION_TEXTURE_RGB);
@ -853,7 +853,7 @@ index 1711762f485..4200b5ebeeb 100644
}
void wined3d_cs_emit_update_sub_resource(struct wined3d_cs *cs, struct wined3d_resource *resource,
@@ -2072,11 +2169,13 @@ void wined3d_cs_emit_update_sub_resource(struct wined3d_cs *cs, struct wined3d_r
@@ -2064,11 +2161,13 @@ void wined3d_cs_emit_update_sub_resource(struct wined3d_cs *cs, struct wined3d_r
cs->ops->submit_and_wait(cs);
}
@ -868,7 +868,7 @@ index 1711762f485..4200b5ebeeb 100644
}
HRESULT wined3d_cs_emit_get_dc(struct wined3d_cs *cs, struct wined3d_texture *texture,
@@ -2096,11 +2195,13 @@ HRESULT wined3d_cs_emit_get_dc(struct wined3d_cs *cs, struct wined3d_texture *te
@@ -2088,11 +2187,13 @@ HRESULT wined3d_cs_emit_get_dc(struct wined3d_cs *cs, struct wined3d_texture *te
return hr;
}
@ -883,22 +883,7 @@ index 1711762f485..4200b5ebeeb 100644
}
HRESULT wined3d_cs_emit_release_dc(struct wined3d_cs *cs, struct wined3d_texture *texture,
@@ -2120,11 +2221,13 @@ HRESULT wined3d_cs_emit_release_dc(struct wined3d_cs *cs, struct wined3d_texture
return hr;
}
-static void wined3d_cs_exec_create_swapchain_context(struct wined3d_cs *cs, const void *data)
+static UINT wined3d_cs_exec_create_swapchain_context(struct wined3d_cs *cs, const void *data)
{
const struct wined3d_cs_create_swapchain_context *op = data;
*op->hr = swapchain_create_context_cs(cs->device, op->swapchain);
+
+ return sizeof(*op);
}
HRESULT wined3d_cs_emit_create_swapchain_context(struct wined3d_cs *cs, struct wined3d_swapchain *swapchain)
@@ -2142,11 +2245,13 @@ HRESULT wined3d_cs_emit_create_swapchain_context(struct wined3d_cs *cs, struct w
@@ -2112,11 +2213,13 @@ HRESULT wined3d_cs_emit_release_dc(struct wined3d_cs *cs, struct wined3d_texture
return hr;
}
@ -913,7 +898,7 @@ index 1711762f485..4200b5ebeeb 100644
}
void wined3d_cs_emit_update_swap_interval(struct wined3d_cs *cs, struct wined3d_swapchain *swapchain)
@@ -2160,7 +2265,7 @@ void wined3d_cs_emit_update_swap_interval(struct wined3d_cs *cs, struct wined3d_
@@ -2130,7 +2233,7 @@ void wined3d_cs_emit_update_swap_interval(struct wined3d_cs *cs, struct wined3d_
cs->ops->submit_and_wait(cs);
}
@ -922,7 +907,7 @@ index 1711762f485..4200b5ebeeb 100644
{
const struct wined3d_cs_texture_add_dirty_region *op = data;
struct wined3d_texture *texture = op->texture;
@@ -2178,6 +2283,8 @@ static void wined3d_cs_exec_texture_add_dirty_region(struct wined3d_cs *cs, cons
@@ -2148,6 +2251,8 @@ static void wined3d_cs_exec_texture_add_dirty_region(struct wined3d_cs *cs, cons
context_release(context);
wined3d_resource_release(&texture->resource);
@ -931,7 +916,7 @@ index 1711762f485..4200b5ebeeb 100644
}
void wined3d_cs_emit_texture_add_dirty_region(struct wined3d_cs *cs,
@@ -2199,7 +2306,7 @@ void wined3d_cs_emit_texture_add_dirty_region(struct wined3d_cs *cs,
@@ -2169,7 +2274,7 @@ void wined3d_cs_emit_texture_add_dirty_region(struct wined3d_cs *cs,
cs->ops->submit(cs);
}
@ -940,7 +925,7 @@ index 1711762f485..4200b5ebeeb 100644
{
const struct wined3d_cs_buffer_copy *op = data;
HRESULT hr;
@@ -2209,6 +2316,8 @@ static void wined3d_cs_exec_buffer_copy(struct wined3d_cs *cs, const void *data)
@@ -2179,6 +2284,8 @@ static void wined3d_cs_exec_buffer_copy(struct wined3d_cs *cs, const void *data)
wined3d_resource_release(&op->dst_buffer->resource);
wined3d_resource_release(&op->src_buffer->resource);
@ -949,7 +934,7 @@ index 1711762f485..4200b5ebeeb 100644
}
void wined3d_cs_emit_buffer_copy(struct wined3d_cs *cs, struct wined3d_buffer *dst_buffer,
@@ -2231,7 +2340,7 @@ void wined3d_cs_emit_buffer_copy(struct wined3d_cs *cs, struct wined3d_buffer *d
@@ -2201,7 +2308,7 @@ void wined3d_cs_emit_buffer_copy(struct wined3d_cs *cs, struct wined3d_buffer *d
cs->ops->submit(cs);
}
@ -958,7 +943,7 @@ index 1711762f485..4200b5ebeeb 100644
{
const struct wined3d_cs_map_vertex_buffers *op = data;
struct wined3d_state *state = &cs->device->state;
@@ -2278,6 +2387,8 @@ static void wined3d_cs_exec_map_vertex_buffers(struct wined3d_cs *cs, const void
@@ -2248,6 +2355,8 @@ static void wined3d_cs_exec_map_vertex_buffers(struct wined3d_cs *cs, const void
}
context_release(context);
@ -967,7 +952,7 @@ index 1711762f485..4200b5ebeeb 100644
}
void wined3d_cs_emit_map_vertex_buffers(struct wined3d_cs *cs, UINT src_start_idx,
@@ -2293,7 +2404,7 @@ void wined3d_cs_emit_map_vertex_buffers(struct wined3d_cs *cs, UINT src_start_id
@@ -2263,7 +2372,7 @@ void wined3d_cs_emit_map_vertex_buffers(struct wined3d_cs *cs, UINT src_start_id
cs->ops->submit_and_wait(cs);
}
@ -976,7 +961,7 @@ index 1711762f485..4200b5ebeeb 100644
{
/* WINED3D_CS_OP_SYNC */ wined3d_cs_exec_sync,
/* WINED3D_CS_OP_GLFINISH */ wined3d_cs_exec_glfinish,
@@ -2400,6 +2511,201 @@ static const struct wined3d_cs_ops wined3d_cs_st_ops =
@@ -2369,6 +2478,201 @@ static const struct wined3d_cs_ops wined3d_cs_st_ops =
wined3d_cs_st_submit,
};
@ -1178,7 +1163,7 @@ index 1711762f485..4200b5ebeeb 100644
struct wined3d_cs *wined3d_cs_create(struct wined3d_device *device)
{
const struct wined3d_gl_info *gl_info = &device->adapter->gl_info;
@@ -2429,12 +2735,41 @@ struct wined3d_cs *wined3d_cs_create(struct wined3d_device *device)
@@ -2398,12 +2702,41 @@ struct wined3d_cs *wined3d_cs_create(struct wined3d_device *device)
return NULL;
}
@ -1264,10 +1249,10 @@ index 1ce5937f173..4ef747ca89a 100644
if (hkey) RegCloseKey( hkey );
diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h
index 1688533f55f..6b1e0287b7a 100644
index 0c46eba6200..3e14ae56508 100644
--- a/dlls/wined3d/wined3d_private.h
+++ b/dlls/wined3d/wined3d_private.h
@@ -306,6 +306,7 @@ struct wined3d_settings
@@ -307,6 +307,7 @@ struct wined3d_settings
unsigned int max_sm_ps;
unsigned int max_sm_cs;
BOOL no_3d;
@ -1275,7 +1260,7 @@ index 1688533f55f..6b1e0287b7a 100644
};
extern struct wined3d_settings wined3d_settings DECLSPEC_HIDDEN;
@@ -2776,11 +2777,6 @@ static inline void wined3d_resource_release(struct wined3d_resource *resource)
@@ -2787,11 +2788,6 @@ static inline void wined3d_resource_release(struct wined3d_resource *resource)
InterlockedDecrement(&resource->access_count);
}
@ -1287,7 +1272,7 @@ index 1688533f55f..6b1e0287b7a 100644
void resource_cleanup(struct wined3d_resource *resource) DECLSPEC_HIDDEN;
HRESULT resource_init(struct wined3d_resource *resource, struct wined3d_device *device,
enum wined3d_resource_type type, const struct wined3d_format *format,
@@ -3201,6 +3197,21 @@ enum wined3d_push_constants
@@ -3212,6 +3208,21 @@ enum wined3d_push_constants
WINED3D_PUSH_CONSTANTS_PS_B,
};
@ -1309,7 +1294,7 @@ index 1688533f55f..6b1e0287b7a 100644
struct wined3d_cs_ops
{
void *(*require_space)(struct wined3d_cs *cs, size_t size);
@@ -3218,9 +3229,21 @@ struct wined3d_cs
@@ -3229,9 +3240,21 @@ struct wined3d_cs
size_t data_size, start, end;
void *data;

View File

@ -1,18 +1,18 @@
From 89e52ae05f316cdbdf6d8026527aed0cdb11a193 Mon Sep 17 00:00:00 2001
From ec468210c7846be779fe5e81d6340a2862870574 Mon Sep 17 00:00:00 2001
From: Sebastian Lackner <sebastian@fds-team.de>
Date: Wed, 8 Feb 2017 00:12:31 +0100
Subject: wined3d: Introduce a separate priority queue.
---
dlls/wined3d/cs.c | 131 ++++++++++++++++++++++-------------------
dlls/wined3d/cs.c | 129 ++++++++++++++++++++++-------------------
dlls/wined3d/wined3d_private.h | 4 +-
2 files changed, 73 insertions(+), 62 deletions(-)
2 files changed, 72 insertions(+), 61 deletions(-)
diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c
index 3d762a55555..47f65a7e20c 100644
index 53a09a8cf8c..7b5c99b9e21 100644
--- a/dlls/wined3d/cs.c
+++ b/dlls/wined3d/cs.c
@@ -486,7 +486,7 @@ void wined3d_cs_emit_sync(struct wined3d_cs *cs)
@@ -478,7 +478,7 @@ void wined3d_cs_emit_sync(struct wined3d_cs *cs)
{
struct wined3d_cs_sync *op;
@ -21,7 +21,7 @@ index 3d762a55555..47f65a7e20c 100644
op->opcode = WINED3D_CS_OP_SYNC;
cs->ops->submit_and_wait(cs);
@@ -506,7 +506,7 @@ void wined3d_cs_emit_glfinish(struct wined3d_cs *cs)
@@ -498,7 +498,7 @@ void wined3d_cs_emit_glfinish(struct wined3d_cs *cs)
{
struct wined3d_cs_glfinish *op;
@ -30,7 +30,7 @@ index 3d762a55555..47f65a7e20c 100644
op->opcode = WINED3D_CS_OP_GLFINISH;
cs->ops->submit_and_wait(cs);
@@ -542,7 +542,7 @@ void wined3d_cs_emit_present(struct wined3d_cs *cs, struct wined3d_swapchain *sw
@@ -533,7 +533,7 @@ void wined3d_cs_emit_present(struct wined3d_cs *cs, struct wined3d_swapchain *sw
unsigned int i;
LONG pending;
@ -39,7 +39,7 @@ index 3d762a55555..47f65a7e20c 100644
op->opcode = WINED3D_CS_OP_PRESENT;
op->dst_window_override = dst_window_override;
op->swapchain = swapchain;
@@ -608,7 +608,7 @@ void wined3d_cs_emit_clear(struct wined3d_cs *cs, DWORD rect_count, const RECT *
@@ -599,7 +599,7 @@ void wined3d_cs_emit_clear(struct wined3d_cs *cs, DWORD rect_count, const RECT *
struct wined3d_cs_clear *op;
unsigned int i;
@ -48,7 +48,7 @@ index 3d762a55555..47f65a7e20c 100644
op->opcode = WINED3D_CS_OP_CLEAR;
op->flags = flags;
op->color = *color;
@@ -758,7 +758,7 @@ void wined3d_cs_emit_dispatch(struct wined3d_cs *cs,
@@ -749,7 +749,7 @@ void wined3d_cs_emit_dispatch(struct wined3d_cs *cs,
const struct wined3d_state *state = &cs->device->state;
struct wined3d_cs_dispatch *op;
@ -57,7 +57,7 @@ index 3d762a55555..47f65a7e20c 100644
op->opcode = WINED3D_CS_OP_DISPATCH;
op->group_count_x = group_count_x;
op->group_count_y = group_count_y;
@@ -827,7 +827,7 @@ void wined3d_cs_emit_draw(struct wined3d_cs *cs, GLenum primitive_type, int base
@@ -818,7 +818,7 @@ void wined3d_cs_emit_draw(struct wined3d_cs *cs, GLenum primitive_type, int base
struct wined3d_cs_draw *op;
unsigned int i;
@ -66,7 +66,7 @@ index 3d762a55555..47f65a7e20c 100644
op->opcode = WINED3D_CS_OP_DRAW;
op->primitive_type = primitive_type;
op->base_vertex_idx = base_vertex_idx;
@@ -877,7 +877,7 @@ void wined3d_cs_emit_set_predication(struct wined3d_cs *cs, struct wined3d_query
@@ -868,7 +868,7 @@ void wined3d_cs_emit_set_predication(struct wined3d_cs *cs, struct wined3d_query
{
struct wined3d_cs_set_predication *op;
@ -75,7 +75,7 @@ index 3d762a55555..47f65a7e20c 100644
op->opcode = WINED3D_CS_OP_SET_PREDICATION;
op->predicate = predicate;
op->value = value;
@@ -899,7 +899,7 @@ void wined3d_cs_emit_set_viewport(struct wined3d_cs *cs, const struct wined3d_vi
@@ -890,7 +890,7 @@ void wined3d_cs_emit_set_viewport(struct wined3d_cs *cs, const struct wined3d_vi
{
struct wined3d_cs_set_viewport *op;
@ -84,7 +84,7 @@ index 3d762a55555..47f65a7e20c 100644
op->opcode = WINED3D_CS_OP_SET_VIEWPORT;
op->viewport = *viewport;
@@ -920,7 +920,7 @@ void wined3d_cs_emit_set_scissor_rect(struct wined3d_cs *cs, const RECT *rect)
@@ -911,7 +911,7 @@ void wined3d_cs_emit_set_scissor_rect(struct wined3d_cs *cs, const RECT *rect)
{
struct wined3d_cs_set_scissor_rect *op;
@ -93,7 +93,7 @@ index 3d762a55555..47f65a7e20c 100644
op->opcode = WINED3D_CS_OP_SET_SCISSOR_RECT;
op->rect = *rect;
@@ -942,7 +942,7 @@ void wined3d_cs_emit_set_rendertarget_view(struct wined3d_cs *cs, unsigned int v
@@ -933,7 +933,7 @@ void wined3d_cs_emit_set_rendertarget_view(struct wined3d_cs *cs, unsigned int v
{
struct wined3d_cs_set_rendertarget_view *op;
@ -102,7 +102,7 @@ index 3d762a55555..47f65a7e20c 100644
op->opcode = WINED3D_CS_OP_SET_RENDERTARGET_VIEW;
op->view_idx = view_idx;
op->view = view;
@@ -993,7 +993,7 @@ void wined3d_cs_emit_set_depth_stencil_view(struct wined3d_cs *cs, struct wined3
@@ -984,7 +984,7 @@ void wined3d_cs_emit_set_depth_stencil_view(struct wined3d_cs *cs, struct wined3
{
struct wined3d_cs_set_depth_stencil_view *op;
@ -111,7 +111,7 @@ index 3d762a55555..47f65a7e20c 100644
op->opcode = WINED3D_CS_OP_SET_DEPTH_STENCIL_VIEW;
op->view = view;
@@ -1014,7 +1014,7 @@ void wined3d_cs_emit_set_vertex_declaration(struct wined3d_cs *cs, struct wined3
@@ -1005,7 +1005,7 @@ void wined3d_cs_emit_set_vertex_declaration(struct wined3d_cs *cs, struct wined3
{
struct wined3d_cs_set_vertex_declaration *op;
@ -120,7 +120,7 @@ index 3d762a55555..47f65a7e20c 100644
op->opcode = WINED3D_CS_OP_SET_VERTEX_DECLARATION;
op->declaration = declaration;
@@ -1048,7 +1048,7 @@ void wined3d_cs_emit_set_stream_source(struct wined3d_cs *cs, UINT stream_idx,
@@ -1039,7 +1039,7 @@ void wined3d_cs_emit_set_stream_source(struct wined3d_cs *cs, UINT stream_idx,
{
struct wined3d_cs_set_stream_source *op;
@ -129,7 +129,7 @@ index 3d762a55555..47f65a7e20c 100644
op->opcode = WINED3D_CS_OP_SET_STREAM_SOURCE;
op->stream_idx = stream_idx;
op->buffer = buffer;
@@ -1076,7 +1076,7 @@ void wined3d_cs_emit_set_stream_source_freq(struct wined3d_cs *cs, UINT stream_i
@@ -1067,7 +1067,7 @@ void wined3d_cs_emit_set_stream_source_freq(struct wined3d_cs *cs, UINT stream_i
{
struct wined3d_cs_set_stream_source_freq *op;
@ -138,7 +138,7 @@ index 3d762a55555..47f65a7e20c 100644
op->opcode = WINED3D_CS_OP_SET_STREAM_SOURCE_FREQ;
op->stream_idx = stream_idx;
op->frequency = frequency;
@@ -1109,7 +1109,7 @@ void wined3d_cs_emit_set_stream_output(struct wined3d_cs *cs, UINT stream_idx,
@@ -1100,7 +1100,7 @@ void wined3d_cs_emit_set_stream_output(struct wined3d_cs *cs, UINT stream_idx,
{
struct wined3d_cs_set_stream_output *op;
@ -147,7 +147,7 @@ index 3d762a55555..47f65a7e20c 100644
op->opcode = WINED3D_CS_OP_SET_STREAM_OUTPUT;
op->stream_idx = stream_idx;
op->buffer = buffer;
@@ -1143,7 +1143,7 @@ void wined3d_cs_emit_set_index_buffer(struct wined3d_cs *cs, struct wined3d_buff
@@ -1134,7 +1134,7 @@ void wined3d_cs_emit_set_index_buffer(struct wined3d_cs *cs, struct wined3d_buff
{
struct wined3d_cs_set_index_buffer *op;
@ -156,7 +156,7 @@ index 3d762a55555..47f65a7e20c 100644
op->opcode = WINED3D_CS_OP_SET_INDEX_BUFFER;
op->buffer = buffer;
op->format_id = format_id;
@@ -1174,7 +1174,7 @@ void wined3d_cs_emit_set_constant_buffer(struct wined3d_cs *cs, enum wined3d_sha
@@ -1165,7 +1165,7 @@ void wined3d_cs_emit_set_constant_buffer(struct wined3d_cs *cs, enum wined3d_sha
{
struct wined3d_cs_set_constant_buffer *op;
@ -165,7 +165,7 @@ index 3d762a55555..47f65a7e20c 100644
op->opcode = WINED3D_CS_OP_SET_CONSTANT_BUFFER;
op->type = type;
op->cb_idx = cb_idx;
@@ -1268,7 +1268,7 @@ void wined3d_cs_emit_set_texture(struct wined3d_cs *cs, UINT stage, struct wined
@@ -1259,7 +1259,7 @@ void wined3d_cs_emit_set_texture(struct wined3d_cs *cs, UINT stage, struct wined
{
struct wined3d_cs_set_texture *op;
@ -174,7 +174,7 @@ index 3d762a55555..47f65a7e20c 100644
op->opcode = WINED3D_CS_OP_SET_TEXTURE;
op->stage = stage;
op->texture = texture;
@@ -1302,7 +1302,7 @@ void wined3d_cs_emit_set_shader_resource_view(struct wined3d_cs *cs, enum wined3
@@ -1293,7 +1293,7 @@ void wined3d_cs_emit_set_shader_resource_view(struct wined3d_cs *cs, enum wined3
{
struct wined3d_cs_set_shader_resource_view *op;
@ -183,7 +183,7 @@ index 3d762a55555..47f65a7e20c 100644
op->opcode = WINED3D_CS_OP_SET_SHADER_RESOURCE_VIEW;
op->type = type;
op->view_idx = view_idx;
@@ -1334,7 +1334,7 @@ void wined3d_cs_emit_set_unordered_access_view(struct wined3d_cs *cs, enum wined
@@ -1325,7 +1325,7 @@ void wined3d_cs_emit_set_unordered_access_view(struct wined3d_cs *cs, enum wined
{
struct wined3d_cs_set_unordered_access_view *op;
@ -192,7 +192,7 @@ index 3d762a55555..47f65a7e20c 100644
op->opcode = WINED3D_CS_OP_SET_UNORDERED_ACCESS_VIEW;
op->pipeline = pipeline;
op->view_idx = view_idx;
@@ -1361,7 +1361,7 @@ void wined3d_cs_emit_set_sampler(struct wined3d_cs *cs, enum wined3d_shader_type
@@ -1352,7 +1352,7 @@ void wined3d_cs_emit_set_sampler(struct wined3d_cs *cs, enum wined3d_shader_type
{
struct wined3d_cs_set_sampler *op;
@ -201,7 +201,7 @@ index 3d762a55555..47f65a7e20c 100644
op->opcode = WINED3D_CS_OP_SET_SAMPLER;
op->type = type;
op->sampler_idx = sampler_idx;
@@ -1388,7 +1388,7 @@ void wined3d_cs_emit_set_shader(struct wined3d_cs *cs, enum wined3d_shader_type
@@ -1379,7 +1379,7 @@ void wined3d_cs_emit_set_shader(struct wined3d_cs *cs, enum wined3d_shader_type
{
struct wined3d_cs_set_shader *op;
@ -210,7 +210,7 @@ index 3d762a55555..47f65a7e20c 100644
op->opcode = WINED3D_CS_OP_SET_SHADER;
op->type = type;
op->shader = shader;
@@ -1411,7 +1411,7 @@ void wined3d_cs_emit_set_rasterizer_state(struct wined3d_cs *cs,
@@ -1402,7 +1402,7 @@ void wined3d_cs_emit_set_rasterizer_state(struct wined3d_cs *cs,
{
struct wined3d_cs_set_rasterizer_state *op;
@ -219,7 +219,7 @@ index 3d762a55555..47f65a7e20c 100644
op->opcode = WINED3D_CS_OP_SET_RASTERIZER_STATE;
op->state = rasterizer_state;
@@ -1432,7 +1432,7 @@ void wined3d_cs_emit_set_render_state(struct wined3d_cs *cs, enum wined3d_render
@@ -1423,7 +1423,7 @@ void wined3d_cs_emit_set_render_state(struct wined3d_cs *cs, enum wined3d_render
{
struct wined3d_cs_set_render_state *op;
@ -228,7 +228,7 @@ index 3d762a55555..47f65a7e20c 100644
op->opcode = WINED3D_CS_OP_SET_RENDER_STATE;
op->state = state;
op->value = value;
@@ -1455,7 +1455,7 @@ void wined3d_cs_emit_set_texture_state(struct wined3d_cs *cs, UINT stage,
@@ -1446,7 +1446,7 @@ void wined3d_cs_emit_set_texture_state(struct wined3d_cs *cs, UINT stage,
{
struct wined3d_cs_set_texture_state *op;
@ -237,7 +237,7 @@ index 3d762a55555..47f65a7e20c 100644
op->opcode = WINED3D_CS_OP_SET_TEXTURE_STATE;
op->stage = stage;
op->state = state;
@@ -1479,7 +1479,7 @@ void wined3d_cs_emit_set_sampler_state(struct wined3d_cs *cs, UINT sampler_idx,
@@ -1470,7 +1470,7 @@ void wined3d_cs_emit_set_sampler_state(struct wined3d_cs *cs, UINT sampler_idx,
{
struct wined3d_cs_set_sampler_state *op;
@ -246,7 +246,7 @@ index 3d762a55555..47f65a7e20c 100644
op->opcode = WINED3D_CS_OP_SET_SAMPLER_STATE;
op->sampler_idx = sampler_idx;
op->state = state;
@@ -1504,7 +1504,7 @@ void wined3d_cs_emit_set_transform(struct wined3d_cs *cs, enum wined3d_transform
@@ -1495,7 +1495,7 @@ void wined3d_cs_emit_set_transform(struct wined3d_cs *cs, enum wined3d_transform
{
struct wined3d_cs_set_transform *op;
@ -255,7 +255,7 @@ index 3d762a55555..47f65a7e20c 100644
op->opcode = WINED3D_CS_OP_SET_TRANSFORM;
op->state = state;
op->matrix = *matrix;
@@ -1526,7 +1526,7 @@ void wined3d_cs_emit_set_clip_plane(struct wined3d_cs *cs, UINT plane_idx, const
@@ -1517,7 +1517,7 @@ void wined3d_cs_emit_set_clip_plane(struct wined3d_cs *cs, UINT plane_idx, const
{
struct wined3d_cs_set_clip_plane *op;
@ -264,7 +264,7 @@ index 3d762a55555..47f65a7e20c 100644
op->opcode = WINED3D_CS_OP_SET_CLIP_PLANE;
op->plane_idx = plane_idx;
op->plane = *plane;
@@ -1604,7 +1604,7 @@ void wined3d_cs_emit_set_color_key(struct wined3d_cs *cs, struct wined3d_texture
@@ -1595,7 +1595,7 @@ void wined3d_cs_emit_set_color_key(struct wined3d_cs *cs, struct wined3d_texture
{
struct wined3d_cs_set_color_key *op;
@ -273,7 +273,7 @@ index 3d762a55555..47f65a7e20c 100644
op->opcode = WINED3D_CS_OP_SET_COLOR_KEY;
op->texture = texture;
op->flags = flags;
@@ -1633,7 +1633,7 @@ void wined3d_cs_emit_set_material(struct wined3d_cs *cs, const struct wined3d_ma
@@ -1624,7 +1624,7 @@ void wined3d_cs_emit_set_material(struct wined3d_cs *cs, const struct wined3d_ma
{
struct wined3d_cs_set_material *op;
@ -282,7 +282,7 @@ index 3d762a55555..47f65a7e20c 100644
op->opcode = WINED3D_CS_OP_SET_MATERIAL;
op->material = *material;
@@ -1683,7 +1683,7 @@ void wined3d_cs_emit_set_light(struct wined3d_cs *cs, const struct wined3d_light
@@ -1674,7 +1674,7 @@ void wined3d_cs_emit_set_light(struct wined3d_cs *cs, const struct wined3d_light
{
struct wined3d_cs_set_light *op;
@ -291,7 +291,7 @@ index 3d762a55555..47f65a7e20c 100644
op->opcode = WINED3D_CS_OP_SET_LIGHT;
op->light = *light;
@@ -1718,7 +1718,7 @@ void wined3d_cs_emit_set_light_enable(struct wined3d_cs *cs, unsigned int idx, B
@@ -1709,7 +1709,7 @@ void wined3d_cs_emit_set_light_enable(struct wined3d_cs *cs, unsigned int idx, B
{
struct wined3d_cs_set_light_enable *op;
@ -300,7 +300,7 @@ index 3d762a55555..47f65a7e20c 100644
op->opcode = WINED3D_CS_OP_SET_LIGHT_ENABLE;
op->idx = idx;
op->enable = enable;
@@ -1742,7 +1742,7 @@ void wined3d_cs_emit_reset_state(struct wined3d_cs *cs)
@@ -1733,7 +1733,7 @@ void wined3d_cs_emit_reset_state(struct wined3d_cs *cs)
{
struct wined3d_cs_reset_state *op;
@ -309,7 +309,7 @@ index 3d762a55555..47f65a7e20c 100644
op->opcode = WINED3D_CS_OP_RESET_STATE;
cs->ops->submit(cs);
@@ -1761,7 +1761,7 @@ static void wined3d_cs_emit_callback(struct wined3d_cs *cs, void (*callback)(voi
@@ -1752,7 +1752,7 @@ static void wined3d_cs_emit_callback(struct wined3d_cs *cs, void (*callback)(voi
{
struct wined3d_cs_callback *op;
@ -318,7 +318,7 @@ index 3d762a55555..47f65a7e20c 100644
op->opcode = WINED3D_CS_OP_CALLBACK;
op->callback = callback;
op->object = object;
@@ -1793,7 +1793,7 @@ void wined3d_cs_emit_query_issue(struct wined3d_cs *cs, struct wined3d_query *qu
@@ -1784,7 +1784,7 @@ void wined3d_cs_emit_query_issue(struct wined3d_cs *cs, struct wined3d_query *qu
{
struct wined3d_cs_query_issue *op;
@ -327,7 +327,7 @@ index 3d762a55555..47f65a7e20c 100644
op->opcode = WINED3D_CS_OP_QUERY_ISSUE;
op->query = query;
op->flags = flags;
@@ -1816,7 +1816,7 @@ BOOL wined3d_cs_emit_query_poll(struct wined3d_cs *cs, struct wined3d_query *que
@@ -1807,7 +1807,7 @@ BOOL wined3d_cs_emit_query_poll(struct wined3d_cs *cs, struct wined3d_query *que
struct wined3d_cs_query_poll *op;
BOOL ret;
@ -336,7 +336,7 @@ index 3d762a55555..47f65a7e20c 100644
op->opcode = WINED3D_CS_OP_QUERY_POLL;
op->query = query;
op->flags = flags;
@@ -1842,7 +1842,7 @@ void wined3d_cs_emit_preload_resource(struct wined3d_cs *cs, struct wined3d_reso
@@ -1833,7 +1833,7 @@ void wined3d_cs_emit_preload_resource(struct wined3d_cs *cs, struct wined3d_reso
{
struct wined3d_cs_preload_resource *op;
@ -345,7 +345,7 @@ index 3d762a55555..47f65a7e20c 100644
op->opcode = WINED3D_CS_OP_PRELOAD_RESOURCE;
op->resource = resource;
@@ -1866,7 +1866,7 @@ void wined3d_cs_emit_unload_resource(struct wined3d_cs *cs, struct wined3d_resou
@@ -1857,7 +1857,7 @@ void wined3d_cs_emit_unload_resource(struct wined3d_cs *cs, struct wined3d_resou
{
struct wined3d_cs_unload_resource *op;
@ -354,7 +354,7 @@ index 3d762a55555..47f65a7e20c 100644
op->opcode = WINED3D_CS_OP_UNLOAD_RESOURCE;
op->resource = resource;
@@ -1892,7 +1892,7 @@ HRESULT wined3d_cs_map(struct wined3d_cs *cs, struct wined3d_resource *resource,
@@ -1883,7 +1883,7 @@ HRESULT wined3d_cs_map(struct wined3d_cs *cs, struct wined3d_resource *resource,
struct wined3d_cs_map *op;
HRESULT hr;
@ -363,7 +363,7 @@ index 3d762a55555..47f65a7e20c 100644
op->opcode = WINED3D_CS_OP_MAP;
op->resource = resource;
op->sub_resource_idx = sub_resource_idx;
@@ -1921,7 +1921,7 @@ HRESULT wined3d_cs_unmap(struct wined3d_cs *cs, struct wined3d_resource *resourc
@@ -1912,7 +1912,7 @@ HRESULT wined3d_cs_unmap(struct wined3d_cs *cs, struct wined3d_resource *resourc
struct wined3d_cs_unmap *op;
HRESULT hr;
@ -372,7 +372,7 @@ index 3d762a55555..47f65a7e20c 100644
op->opcode = WINED3D_CS_OP_UNMAP;
op->resource = resource;
op->sub_resource_idx = sub_resource_idx;
@@ -1983,7 +1983,7 @@ void wined3d_cs_emit_push_constants(struct wined3d_cs *cs, enum wined3d_push_con
@@ -1974,7 +1974,7 @@ void wined3d_cs_emit_push_constants(struct wined3d_cs *cs, enum wined3d_push_con
{
struct wined3d_cs_push_constants *op;
@ -381,7 +381,7 @@ index 3d762a55555..47f65a7e20c 100644
op->opcode = WINED3D_CS_OP_PUSH_CONSTANTS;
op->p = p;
op->start_idx = start_idx;
@@ -2015,7 +2015,7 @@ void wined3d_cs_emit_blt(struct wined3d_cs *cs, struct wined3d_surface *dst_surf
@@ -2006,7 +2006,7 @@ void wined3d_cs_emit_blt(struct wined3d_cs *cs, struct wined3d_surface *dst_surf
{
struct wined3d_cs_blt *op;
@ -390,7 +390,7 @@ index 3d762a55555..47f65a7e20c 100644
op->opcode = WINED3D_CS_OP_BLT;
op->dst_surface = dst_surface;
op->dst_rect = *dst_rect;
@@ -2054,7 +2054,7 @@ void wined3d_cs_emit_clear_rtv(struct wined3d_cs *cs, struct wined3d_rendertarge
@@ -2045,7 +2045,7 @@ void wined3d_cs_emit_clear_rtv(struct wined3d_cs *cs, struct wined3d_rendertarge
{
struct wined3d_cs_clear_rtv *op;
@ -399,7 +399,7 @@ index 3d762a55555..47f65a7e20c 100644
op->opcode = WINED3D_CS_OP_CLEAR_RTV;
op->view = view;
op->rect = *rect;
@@ -2090,7 +2090,7 @@ void wined3d_cs_emit_update_texture(struct wined3d_cs *cs, struct wined3d_textur
@@ -2081,7 +2081,7 @@ void wined3d_cs_emit_update_texture(struct wined3d_cs *cs, struct wined3d_textur
{
struct wined3d_cs_update_texture *op;
@ -408,7 +408,7 @@ index 3d762a55555..47f65a7e20c 100644
op->opcode = WINED3D_CS_OP_UPDATE_TEXTURE;
op->src = src;
op->dst = dst;
@@ -2156,7 +2156,7 @@ void wined3d_cs_emit_update_sub_resource(struct wined3d_cs *cs, struct wined3d_r
@@ -2147,7 +2147,7 @@ void wined3d_cs_emit_update_sub_resource(struct wined3d_cs *cs, struct wined3d_r
{
struct wined3d_cs_update_sub_resource *op;
@ -417,7 +417,7 @@ index 3d762a55555..47f65a7e20c 100644
op->opcode = WINED3D_CS_OP_UPDATE_SUB_RESOURCE;
op->resource = resource;
op->sub_resource_idx = sub_resource_idx;
@@ -2185,7 +2185,7 @@ HRESULT wined3d_cs_emit_get_dc(struct wined3d_cs *cs, struct wined3d_texture *te
@@ -2176,7 +2176,7 @@ HRESULT wined3d_cs_emit_get_dc(struct wined3d_cs *cs, struct wined3d_texture *te
struct wined3d_cs_get_release_dc *op;
HRESULT hr;
@ -426,7 +426,7 @@ index 3d762a55555..47f65a7e20c 100644
op->opcode = WINED3D_CS_OP_GET_DC;
op->texture = texture;
op->sub_resource_idx = sub_resource_idx;
@@ -2211,7 +2211,7 @@ HRESULT wined3d_cs_emit_release_dc(struct wined3d_cs *cs, struct wined3d_texture
@@ -2202,7 +2202,7 @@ HRESULT wined3d_cs_emit_release_dc(struct wined3d_cs *cs, struct wined3d_texture
struct wined3d_cs_get_release_dc *op;
HRESULT hr;
@ -435,16 +435,7 @@ index 3d762a55555..47f65a7e20c 100644
op->opcode = WINED3D_CS_OP_RELEASE_DC;
op->texture = texture;
op->sub_resource_idx = sub_resource_idx;
@@ -2236,7 +2236,7 @@ HRESULT wined3d_cs_emit_create_swapchain_context(struct wined3d_cs *cs, struct w
struct wined3d_cs_create_swapchain_context *op;
HRESULT hr;
- op = cs->ops->require_space(cs, sizeof(*op));
+ op = cs->ops->require_space(cs, sizeof(*op), 0);
op->opcode = WINED3D_CS_OP_CREATE_SWAPCHAIN_CONTEXT;
op->swapchain = swapchain;
op->hr = &hr;
@@ -2259,7 +2259,7 @@ void wined3d_cs_emit_update_swap_interval(struct wined3d_cs *cs, struct wined3d_
@@ -2226,7 +2226,7 @@ void wined3d_cs_emit_update_swap_interval(struct wined3d_cs *cs, struct wined3d_
{
struct wined3d_cs_update_swap_interval *op;
@ -453,7 +444,7 @@ index 3d762a55555..47f65a7e20c 100644
op->opcode = WINED3D_CS_OP_UPDATE_SWAP_INTERVAL;
op->swapchain = swapchain;
@@ -2297,7 +2297,7 @@ void wined3d_cs_emit_texture_add_dirty_region(struct wined3d_cs *cs,
@@ -2264,7 +2264,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));
@ -462,7 +453,7 @@ index 3d762a55555..47f65a7e20c 100644
op->opcode = WINED3D_CS_OP_TEXTURE_ADD_DIRTY_REGION;
op->texture = texture;
op->sub_resource_idx = sub_resource_idx;
@@ -2327,7 +2327,7 @@ void wined3d_cs_emit_buffer_copy(struct wined3d_cs *cs, struct wined3d_buffer *d
@@ -2294,7 +2294,7 @@ void wined3d_cs_emit_buffer_copy(struct wined3d_cs *cs, struct wined3d_buffer *d
{
struct wined3d_cs_buffer_copy *op;
@ -471,7 +462,7 @@ index 3d762a55555..47f65a7e20c 100644
op->opcode = WINED3D_CS_OP_BUFFER_COPY;
op->dst_buffer = dst_buffer;
op->dst_offset = dst_offset;
@@ -2397,7 +2397,7 @@ void wined3d_cs_emit_map_vertex_buffers(struct wined3d_cs *cs, UINT src_start_id
@@ -2364,7 +2364,7 @@ void wined3d_cs_emit_map_vertex_buffers(struct wined3d_cs *cs, UINT src_start_id
{
struct wined3d_cs_map_vertex_buffers *op;
@ -480,7 +471,7 @@ index 3d762a55555..47f65a7e20c 100644
op->opcode = WINED3D_CS_OP_MAP_VERTEX_BUFFERS;
op->src_start_idx = src_start_idx;
op->stream_info = stream_info;
@@ -2461,7 +2461,7 @@ static UINT (* const wined3d_cs_op_handlers[])(struct wined3d_cs *cs, const void
@@ -2427,7 +2427,7 @@ static UINT (* const wined3d_cs_op_handlers[])(struct wined3d_cs *cs, const void
/* WINED3D_CS_OP_MAP_VERTEX_BUFFERS */ wined3d_cs_exec_map_vertex_buffers,
};
@ -489,7 +480,7 @@ index 3d762a55555..47f65a7e20c 100644
{
if (size > (cs->data_size - cs->end))
{
@@ -2545,6 +2545,8 @@ static struct wined3d_cs_block *wined3d_cs_dequeue_command(struct wined3d_cs *cs
@@ -2511,6 +2511,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 (;;)
{
@ -498,7 +489,7 @@ index 3d762a55555..47f65a7e20c 100644
if ((block = wined3d_cs_list_dequeue(&cs->exec_list)))
return block;
}
@@ -2572,7 +2574,7 @@ static void wined3d_cs_list_cleanup(struct wined3d_cs_list *list)
@@ -2538,7 +2540,7 @@ static void wined3d_cs_list_cleanup(struct wined3d_cs_list *list)
DeleteCriticalSection(&list->lock);
}
@ -507,7 +498,7 @@ index 3d762a55555..47f65a7e20c 100644
{
struct wined3d_cs_block *block;
@@ -2586,26 +2588,28 @@ static struct wined3d_cs_block *wined3d_cs_get_block(struct wined3d_cs *cs)
@@ -2552,26 +2554,28 @@ static struct wined3d_cs_block *wined3d_cs_get_block(struct wined3d_cs *cs)
}
block->pos = 0;
@ -540,7 +531,7 @@ index 3d762a55555..47f65a7e20c 100644
cs->current_block = block;
}
@@ -2617,10 +2621,13 @@ static void *wined3d_cs_mt_require_space(struct wined3d_cs *cs, size_t size)
@@ -2583,10 +2587,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)
{
@ -555,7 +546,7 @@ index 3d762a55555..47f65a7e20c 100644
cs->current_block = NULL;
}
@@ -2634,7 +2641,7 @@ static void wined3d_cs_mt_submit_and_wait(struct wined3d_cs *cs)
@@ -2600,7 +2607,7 @@ static void wined3d_cs_mt_submit_and_wait(struct wined3d_cs *cs)
block = cs->current_block;
block->fence = &fence;
@ -564,7 +555,7 @@ index 3d762a55555..47f65a7e20c 100644
cs->current_block = NULL;
/* A busy wait should be fine, we're not supposed to have to wait very
@@ -2656,7 +2663,7 @@ static void wined3d_cs_mt_emit_stop(struct wined3d_cs *cs)
@@ -2622,7 +2629,7 @@ static void wined3d_cs_mt_emit_stop(struct wined3d_cs *cs)
assert(cs->thread_id != GetCurrentThreadId());
assert(cs->ops == &wined3d_cs_mt_ops);
@ -573,7 +564,7 @@ index 3d762a55555..47f65a7e20c 100644
op->opcode = WINED3D_CS_OP_STOP;
cs->ops->submit(cs);
@@ -2742,6 +2749,7 @@ struct wined3d_cs *wined3d_cs_create(struct wined3d_device *device)
@@ -2708,6 +2715,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);
@ -581,7 +572,7 @@ index 3d762a55555..47f65a7e20c 100644
if (!(cs->thread = CreateThread(NULL, 0, wined3d_cs_run, cs, 0, &cs->thread_id)))
{
@@ -2767,6 +2775,7 @@ void wined3d_cs_destroy(struct wined3d_cs *cs)
@@ -2733,6 +2741,7 @@ void wined3d_cs_destroy(struct wined3d_cs *cs)
WaitForSingleObject(cs->thread, INFINITE);
CloseHandle(cs->thread);
@ -590,10 +581,10 @@ index 3d762a55555..47f65a7e20c 100644
wined3d_cs_list_cleanup(&cs->free_list);
}
diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h
index e1516f0f0b0..d4c51d17bad 100644
index 3e14ae56508..b6f84e1a36b 100644
--- a/dlls/wined3d/wined3d_private.h
+++ b/dlls/wined3d/wined3d_private.h
@@ -3205,13 +3205,14 @@ struct wined3d_cs_block
@@ -3219,13 +3219,14 @@ struct wined3d_cs_block
{
struct list entry;
UINT pos;
@ -609,7 +600,7 @@ index e1516f0f0b0..d4c51d17bad 100644
void (*submit)(struct wined3d_cs *cs);
void (*submit_and_wait)(struct wined3d_cs *cs);
};
@@ -3231,6 +3232,7 @@ struct wined3d_cs
@@ -3245,6 +3246,7 @@ struct wined3d_cs
struct wined3d_cs_block *current_block;
struct wined3d_cs_list free_list;
struct wined3d_cs_list exec_list;

View File

@ -90,7 +90,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,10 +66,38 @@ enum wined3d_cs_op
@@ -59,10 +66,37 @@ enum wined3d_cs_op
WINED3D_CS_OP_RESET_STATE,
WINED3D_CS_OP_CALLBACK,
WINED3D_CS_OP_QUERY_ISSUE,
@ -109,7 +109,6 @@ diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c
+ WINED3D_CS_OP_UPDATE_SUB_RESOURCE,
+ WINED3D_CS_OP_GET_DC,
+ WINED3D_CS_OP_RELEASE_DC,
+ WINED3D_CS_OP_CREATE_SWAPCHAIN_CONTEXT,
+ WINED3D_CS_OP_UPDATE_SWAP_INTERVAL,
+ WINED3D_CS_OP_TEXTURE_ADD_DIRTY_REGION,
+ WINED3D_CS_OP_BUFFER_COPY,
@ -129,7 +128,7 @@ diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c
};
struct wined3d_cs_present
@@ -313,6 +348,16 @@ struct wined3d_cs_query_issue
@@ -313,6 +347,16 @@ struct wined3d_cs_query_issue
DWORD flags;
};
@ -146,7 +145,7 @@ diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c
struct wined3d_cs_preload_resource
{
enum wined3d_cs_op opcode;
@@ -344,7 +389,147 @@ struct wined3d_cs_unmap
@@ -344,7 +388,140 @@ struct wined3d_cs_unmap
HRESULT *hr;
};
@ -212,13 +211,6 @@ diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c
+ HRESULT *hr;
+};
+
+struct wined3d_cs_create_swapchain_context
+{
+ enum wined3d_cs_op opcode;
+ struct wined3d_swapchain *swapchain;
+ HRESULT *hr;
+};
+
+struct wined3d_cs_update_swap_interval
+{
+ enum wined3d_cs_op opcode;
@ -294,7 +286,7 @@ diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c
{
const struct wined3d_cs_present *op = data;
struct wined3d_swapchain *swapchain;
@@ -355,11 +540,19 @@ static void wined3d_cs_exec_present(struct wined3d_cs *cs, const void *data)
@@ -355,11 +532,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);
@ -314,7 +306,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,
@@ -367,8 +560,14 @@ void wined3d_cs_emit_present(struct wined3d_cs *cs, struct wined3d_swapchain *sw
@@ -367,8 +552,14 @@ void wined3d_cs_emit_present(struct wined3d_cs *cs, struct wined3d_swapchain *sw
{
struct wined3d_cs_present *op;
unsigned int i;
@ -329,7 +321,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;
@@ -382,16 +581,39 @@ void wined3d_cs_emit_present(struct wined3d_cs *cs, struct wined3d_swapchain *sw
@@ -382,16 +573,39 @@ void wined3d_cs_emit_present(struct wined3d_cs *cs, struct wined3d_swapchain *sw
wined3d_resource_acquire(&swapchain->back_buffers[i]->resource);
}
@ -369,7 +361,7 @@ diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c
device = cs->device;
wined3d_get_draw_rect(state, &draw_rect);
@@ -409,6 +631,10 @@ static void wined3d_cs_exec_clear(struct wined3d_cs *cs, const void *data)
@@ -409,6 +623,10 @@ static void wined3d_cs_exec_clear(struct wined3d_cs *cs, const void *data)
}
if (op->flags & (WINED3DCLEAR_ZBUFFER | WINED3DCLEAR_STENCIL))
wined3d_resource_release(state->fb->depth_stencil->resource);
@ -380,7 +372,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,
@@ -418,7 +644,11 @@ void wined3d_cs_emit_clear(struct wined3d_cs *cs, DWORD rect_count, const RECT *
@@ -418,7 +636,11 @@ void wined3d_cs_emit_clear(struct wined3d_cs *cs, DWORD rect_count, const RECT *
struct wined3d_cs_clear *op;
unsigned int i;
@ -392,7 +384,7 @@ diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c
op->opcode = WINED3D_CS_OP_CLEAR;
op->flags = flags;
op->color = *color;
@@ -547,7 +777,11 @@ static void release_unordered_access_resources(const struct wined3d_shader *shad
@@ -547,7 +769,11 @@ static void release_unordered_access_resources(const struct wined3d_shader *shad
}
}
@ -404,7 +396,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;
@@ -558,6 +792,10 @@ static void wined3d_cs_exec_dispatch(struct wined3d_cs *cs, const void *data)
@@ -558,6 +784,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]);
@ -415,7 +407,7 @@ diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c
}
void wined3d_cs_emit_dispatch(struct wined3d_cs *cs,
@@ -566,7 +804,11 @@ void wined3d_cs_emit_dispatch(struct wined3d_cs *cs,
@@ -566,7 +796,11 @@ void wined3d_cs_emit_dispatch(struct wined3d_cs *cs,
const struct wined3d_state *state = &cs->device->state;
struct wined3d_cs_dispatch *op;
@ -427,7 +419,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;
@@ -579,7 +821,11 @@ void wined3d_cs_emit_dispatch(struct wined3d_cs *cs,
@@ -579,7 +813,11 @@ void wined3d_cs_emit_dispatch(struct wined3d_cs *cs,
cs->ops->submit(cs);
}
@ -439,7 +431,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;
@@ -624,6 +870,10 @@ static void wined3d_cs_exec_draw(struct wined3d_cs *cs, const void *data)
@@ -624,6 +862,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]);
@ -450,7 +442,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,
@@ -633,7 +883,11 @@ void wined3d_cs_emit_draw(struct wined3d_cs *cs, GLenum primitive_type, int base
@@ -633,7 +875,11 @@ void wined3d_cs_emit_draw(struct wined3d_cs *cs, GLenum primitive_type, int base
struct wined3d_cs_draw *op;
unsigned int i;
@ -462,7 +454,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;
@@ -669,70 +923,123 @@ void wined3d_cs_emit_draw(struct wined3d_cs *cs, GLenum primitive_type, int base
@@ -669,70 +915,123 @@ void wined3d_cs_emit_draw(struct wined3d_cs *cs, GLenum primitive_type, int base
cs->ops->submit(cs);
}
@ -586,7 +578,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,
@@ -740,15 +1047,26 @@ void wined3d_cs_emit_set_rendertarget_view(struct wined3d_cs *cs, unsigned int v
@@ -740,15 +1039,26 @@ void wined3d_cs_emit_set_rendertarget_view(struct wined3d_cs *cs, unsigned int v
{
struct wined3d_cs_set_rendertarget_view *op;
@ -613,7 +605,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;
@@ -783,39 +1101,69 @@ static void wined3d_cs_exec_set_depth_stencil_view(struct wined3d_cs *cs, const
@@ -783,39 +1093,69 @@ static void wined3d_cs_exec_set_depth_stencil_view(struct wined3d_cs *cs, const
}
device_invalidate_state(device, STATE_FRAMEBUFFER);
@ -683,7 +675,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;
@@ -833,6 +1181,10 @@ static void wined3d_cs_exec_set_stream_source(struct wined3d_cs *cs, const void
@@ -833,6 +1173,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);
@ -694,7 +686,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,
@@ -840,17 +1192,28 @@ void wined3d_cs_emit_set_stream_source(struct wined3d_cs *cs, UINT stream_idx,
@@ -840,17 +1184,28 @@ void wined3d_cs_emit_set_stream_source(struct wined3d_cs *cs, UINT stream_idx,
{
struct wined3d_cs_set_stream_source *op;
@ -723,7 +715,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;
@@ -860,22 +1223,37 @@ static void wined3d_cs_exec_set_stream_source_freq(struct wined3d_cs *cs, const
@@ -860,22 +1215,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);
@ -761,7 +753,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;
@@ -890,6 +1268,10 @@ static void wined3d_cs_exec_set_stream_output(struct wined3d_cs *cs, const void
@@ -890,6 +1260,10 @@ static void wined3d_cs_exec_set_stream_output(struct wined3d_cs *cs, const void
InterlockedIncrement(&op->buffer->resource.bind_count);
if (prev)
InterlockedDecrement(&prev->resource.bind_count);
@ -772,7 +764,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,
@@ -897,16 +1279,27 @@ void wined3d_cs_emit_set_stream_output(struct wined3d_cs *cs, UINT stream_idx,
@@ -897,16 +1271,27 @@ void wined3d_cs_emit_set_stream_output(struct wined3d_cs *cs, UINT stream_idx,
{
struct wined3d_cs_set_stream_output *op;
@ -800,7 +792,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;
@@ -922,6 +1315,10 @@ static void wined3d_cs_exec_set_index_buffer(struct wined3d_cs *cs, const void *
@@ -922,6 +1307,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);
@ -811,7 +803,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,
@@ -929,16 +1326,27 @@ void wined3d_cs_emit_set_index_buffer(struct wined3d_cs *cs, struct wined3d_buff
@@ -929,16 +1318,27 @@ void wined3d_cs_emit_set_index_buffer(struct wined3d_cs *cs, struct wined3d_buff
{
struct wined3d_cs_set_index_buffer *op;
@ -839,7 +831,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;
@@ -952,6 +1360,9 @@ static void wined3d_cs_exec_set_constant_buffer(struct wined3d_cs *cs, const voi
@@ -952,6 +1352,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));
@ -849,7 +841,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,
@@ -959,16 +1370,27 @@ void wined3d_cs_emit_set_constant_buffer(struct wined3d_cs *cs, enum wined3d_sha
@@ -959,16 +1362,27 @@ void wined3d_cs_emit_set_constant_buffer(struct wined3d_cs *cs, enum wined3d_sha
{
struct wined3d_cs_set_constant_buffer *op;
@ -877,7 +869,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;
@@ -1045,21 +1467,36 @@ static void wined3d_cs_exec_set_texture(struct wined3d_cs *cs, const void *data)
@@ -1045,21 +1459,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);
@ -914,7 +906,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;
@@ -1076,6 +1513,10 @@ static void wined3d_cs_exec_set_shader_resource_view(struct wined3d_cs *cs, cons
@@ -1076,6 +1505,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);
@ -925,7 +917,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,
@@ -1083,16 +1524,27 @@ void wined3d_cs_emit_set_shader_resource_view(struct wined3d_cs *cs, enum wined3
@@ -1083,16 +1516,27 @@ void wined3d_cs_emit_set_shader_resource_view(struct wined3d_cs *cs, enum wined3
{
struct wined3d_cs_set_shader_resource_view *op;
@ -953,7 +945,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;
@@ -1106,6 +1558,10 @@ static void wined3d_cs_exec_set_unordered_access_view(struct wined3d_cs *cs, con
@@ -1106,6 +1550,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));
@ -964,7 +956,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,
@@ -1113,16 +1569,27 @@ void wined3d_cs_emit_set_unordered_access_view(struct wined3d_cs *cs, enum wined
@@ -1113,16 +1561,27 @@ void wined3d_cs_emit_set_unordered_access_view(struct wined3d_cs *cs, enum wined
{
struct wined3d_cs_set_unordered_access_view *op;
@ -992,7 +984,7 @@ diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c
{
const struct wined3d_cs_set_sampler *op = data;
@@ -1131,6 +1598,10 @@ static void wined3d_cs_exec_set_sampler(struct wined3d_cs *cs, const void *data)
@@ -1131,6 +1590,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);
@ -1003,7 +995,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,
@@ -1138,16 +1609,27 @@ void wined3d_cs_emit_set_sampler(struct wined3d_cs *cs, enum wined3d_shader_type
@@ -1138,16 +1601,27 @@ void wined3d_cs_emit_set_sampler(struct wined3d_cs *cs, enum wined3d_shader_type
{
struct wined3d_cs_set_sampler *op;
@ -1031,7 +1023,7 @@ diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c
{
const struct wined3d_cs_set_shader *op = data;
@@ -1157,26 +1639,45 @@ static void wined3d_cs_exec_set_shader(struct wined3d_cs *cs, const void *data)
@@ -1157,26 +1631,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);
@ -1077,7 +1069,7 @@ diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c
}
void wined3d_cs_emit_set_rasterizer_state(struct wined3d_cs *cs,
@@ -1184,39 +1685,69 @@ void wined3d_cs_emit_set_rasterizer_state(struct wined3d_cs *cs,
@@ -1184,39 +1677,69 @@ void wined3d_cs_emit_set_rasterizer_state(struct wined3d_cs *cs,
{
struct wined3d_cs_set_rasterizer_state *op;
@ -1147,7 +1139,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,
@@ -1224,21 +1755,36 @@ void wined3d_cs_emit_set_texture_state(struct wined3d_cs *cs, UINT stage,
@@ -1224,21 +1747,36 @@ void wined3d_cs_emit_set_texture_state(struct wined3d_cs *cs, UINT stage,
{
struct wined3d_cs_set_texture_state *op;
@ -1184,7 +1176,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,
@@ -1246,22 +1792,37 @@ void wined3d_cs_emit_set_sampler_state(struct wined3d_cs *cs, UINT sampler_idx,
@@ -1246,22 +1784,37 @@ void wined3d_cs_emit_set_sampler_state(struct wined3d_cs *cs, UINT sampler_idx,
{
struct wined3d_cs_set_sampler_state *op;
@ -1222,7 +1214,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,
@@ -1269,35 +1830,61 @@ void wined3d_cs_emit_set_transform(struct wined3d_cs *cs, enum wined3d_transform
@@ -1269,35 +1822,61 @@ void wined3d_cs_emit_set_transform(struct wined3d_cs *cs, enum wined3d_transform
{
struct wined3d_cs_set_transform *op;
@ -1284,7 +1276,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;
@@ -1358,6 +1945,10 @@ static void wined3d_cs_exec_set_color_key(struct wined3d_cs *cs, const void *dat
@@ -1358,6 +1937,10 @@ static void wined3d_cs_exec_set_color_key(struct wined3d_cs *cs, const void *dat
break;
}
}
@ -1295,7 +1287,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,
@@ -1365,7 +1956,11 @@ void wined3d_cs_emit_set_color_key(struct wined3d_cs *cs, struct wined3d_texture
@@ -1365,7 +1948,11 @@ void wined3d_cs_emit_set_color_key(struct wined3d_cs *cs, struct wined3d_texture
{
struct wined3d_cs_set_color_key *op;
@ -1307,7 +1299,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;
@@ -1377,29 +1972,51 @@ void wined3d_cs_emit_set_color_key(struct wined3d_cs *cs, struct wined3d_texture
@@ -1377,29 +1964,51 @@ void wined3d_cs_emit_set_color_key(struct wined3d_cs *cs, struct wined3d_texture
else
op->set = 0;
@ -1359,7 +1351,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;
@@ -1413,7 +2030,11 @@ static void wined3d_cs_exec_set_light(struct wined3d_cs *cs, const void *data)
@@ -1413,7 +2022,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");
@ -1371,7 +1363,7 @@ diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c
}
hash_idx = LIGHTMAP_HASHFUNC(light_idx);
@@ -1434,20 +2055,35 @@ static void wined3d_cs_exec_set_light(struct wined3d_cs *cs, const void *data)
@@ -1434,20 +2047,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;
@ -1407,7 +1399,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;
@@ -1457,7 +2093,11 @@ static void wined3d_cs_exec_set_light_enable(struct wined3d_cs *cs, const void *
@@ -1457,7 +2085,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");
@ -1419,7 +1411,7 @@ diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c
}
prev_idx = light_info->glIndex;
@@ -1467,21 +2107,36 @@ static void wined3d_cs_exec_set_light_enable(struct wined3d_cs *cs, const void *
@@ -1467,21 +2099,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));
}
@ -1456,7 +1448,7 @@ diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c
{
struct wined3d_adapter *adapter = cs->device->adapter;
@@ -1489,12 +2144,17 @@ static void wined3d_cs_exec_reset_state(struct wined3d_cs *cs, const void *data)
@@ -1489,12 +2136,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);
@ -1474,7 +1466,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;
@@ -1502,17 +2162,34 @@ void wined3d_cs_emit_reset_state(struct wined3d_cs *cs)
@@ -1502,17 +2154,34 @@ void wined3d_cs_emit_reset_state(struct wined3d_cs *cs)
}
static void wined3d_cs_exec_callback(struct wined3d_cs *cs, const void *data)
@ -1509,7 +1501,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;
@@ -1530,40 +2207,103 @@ void wined3d_cs_init_object(struct wined3d_cs *cs, void (*callback)(void *object
@@ -1530,40 +2199,103 @@ void wined3d_cs_init_object(struct wined3d_cs *cs, void (*callback)(void *object
wined3d_cs_emit_callback(cs, callback, object);
}
@ -1613,7 +1605,7 @@ diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c
op->opcode = WINED3D_CS_OP_PRELOAD_RESOURCE;
op->resource = resource;
@@ -1572,20 +2312,32 @@ void wined3d_cs_emit_preload_resource(struct wined3d_cs *cs, struct wined3d_reso
@@ -1572,20 +2304,32 @@ void wined3d_cs_emit_preload_resource(struct wined3d_cs *cs, struct wined3d_reso
cs->ops->submit(cs);
}
@ -1646,7 +1638,7 @@ diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c
op->opcode = WINED3D_CS_OP_UNLOAD_RESOURCE;
op->resource = resource;
@@ -1594,13 +2346,21 @@ void wined3d_cs_emit_unload_resource(struct wined3d_cs *cs, struct wined3d_resou
@@ -1594,13 +2338,21 @@ void wined3d_cs_emit_unload_resource(struct wined3d_cs *cs, struct wined3d_resou
cs->ops->submit(cs);
}
@ -1668,7 +1660,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,
@@ -1609,7 +2369,11 @@ HRESULT wined3d_cs_map(struct wined3d_cs *cs, struct wined3d_resource *resource,
@@ -1609,7 +2361,11 @@ HRESULT wined3d_cs_map(struct wined3d_cs *cs, struct wined3d_resource *resource,
struct wined3d_cs_map *op;
HRESULT hr;
@ -1680,7 +1672,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;
@@ -1618,17 +2382,29 @@ HRESULT wined3d_cs_map(struct wined3d_cs *cs, struct wined3d_resource *resource,
@@ -1618,17 +2374,29 @@ HRESULT wined3d_cs_map(struct wined3d_cs *cs, struct wined3d_resource *resource,
op->flags = flags;
op->hr = &hr;
@ -1710,7 +1702,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)
@@ -1636,19 +2412,578 @@ HRESULT wined3d_cs_unmap(struct wined3d_cs *cs, struct wined3d_resource *resourc
@@ -1636,19 +2404,554 @@ HRESULT wined3d_cs_unmap(struct wined3d_cs *cs, struct wined3d_resource *resourc
struct wined3d_cs_unmap *op;
HRESULT hr;
@ -1725,13 +1717,13 @@ diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c
op->hr = &hr;
+#if !defined(STAGING_CSMT)
+ cs->ops->submit(cs);
cs->ops->submit(cs);
+#else /* STAGING_CSMT */
+ cs->ops->submit_and_wait(cs);
+
+ return hr;
+}
+
return hr;
}
+static const struct
+{
+ size_t offset;
@ -1898,7 +1890,7 @@ diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c
+ wined3d_resource_acquire(&op->src->resource);
+ wined3d_resource_acquire(&op->dst->resource);
+
cs->ops->submit(cs);
+ cs->ops->submit(cs);
+}
+
+static UINT wined3d_cs_exec_update_sub_resource(struct wined3d_cs *cs, const void *data)
@ -2064,10 +2056,10 @@ diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c
+
+ cs->ops->submit_and_wait(cs);
+#endif /* STAGING_CSMT */
return hr;
}
+
+ return hr;
+}
+
+#if !defined(STAGING_CSMT)
static void (* const wined3d_cs_op_handlers[])(struct wined3d_cs *cs, const void *data) =
{
@ -2098,30 +2090,6 @@ diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c
+ return hr;
+}
+
+static UINT wined3d_cs_exec_create_swapchain_context(struct wined3d_cs *cs, const void *data)
+{
+ const struct wined3d_cs_create_swapchain_context *op = data;
+
+ *op->hr = swapchain_create_context_cs(cs->device, op->swapchain);
+
+ return sizeof(*op);
+}
+
+HRESULT wined3d_cs_emit_create_swapchain_context(struct wined3d_cs *cs, struct wined3d_swapchain *swapchain)
+{
+ struct wined3d_cs_create_swapchain_context *op;
+ HRESULT hr;
+
+ op = cs->ops->require_space(cs, sizeof(*op), 0);
+ op->opcode = WINED3D_CS_OP_CREATE_SWAPCHAIN_CONTEXT;
+ op->swapchain = swapchain;
+ op->hr = &hr;
+
+ cs->ops->submit_and_wait(cs);
+
+ return hr;
+}
+
+static UINT wined3d_cs_exec_update_swap_interval(struct wined3d_cs *cs, const void *data)
+{
+ const struct wined3d_cs_update_swap_interval *op = data;
@ -2289,7 +2257,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,
@@ -1682,13 +3017,34 @@ static void (* const wined3d_cs_op_handlers[])(struct wined3d_cs *cs, const void
@@ -1682,13 +2985,33 @@ 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,
@ -2312,7 +2280,6 @@ diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c
+ /* WINED3D_CS_OP_UPDATE_SUB_RESOURCE */ wined3d_cs_exec_update_sub_resource,
+ /* WINED3D_CS_OP_GET_DC */ wined3d_cs_exec_get_dc,
+ /* WINED3D_CS_OP_RELEASE_DC */ wined3d_cs_exec_release_dc,
+ /* WINED3D_CS_OP_CREATE_SWAPCHAIN_CONTEXT */ wined3d_cs_exec_create_swapchain_context,
+ /* 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,
+ /* WINED3D_CS_OP_BUFFER_COPY */ wined3d_cs_exec_buffer_copy,
@ -2324,7 +2291,7 @@ diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c
{
if (size > (cs->data_size - cs->end))
{
@@ -1732,6 +3088,7 @@ static void wined3d_cs_st_submit(struct wined3d_cs *cs)
@@ -1732,6 +3055,7 @@ static void wined3d_cs_st_submit(struct wined3d_cs *cs)
HeapFree(GetProcessHeap(), 0, data);
}
@ -2332,7 +2299,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)
{
@@ -1772,15 +3129,271 @@ static void wined3d_cs_st_push_constants(struct wined3d_cs *cs, enum wined3d_pus
@@ -1772,15 +3096,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;
@ -2363,14 +2330,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);
@ -2392,9 +2359,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 =
{
@ -2604,7 +2571,7 @@ diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c
struct wined3d_cs *wined3d_cs_create(struct wined3d_device *device)
{
@@ -1811,12 +3424,57 @@ struct wined3d_cs *wined3d_cs_create(struct wined3d_device *device)
@@ -1811,12 +3391,57 @@ struct wined3d_cs *wined3d_cs_create(struct wined3d_device *device)
return NULL;
}
@ -3863,99 +3830,17 @@ diff --git a/dlls/wined3d/swapchain.c b/dlls/wined3d/swapchain.c
gl_info->gl_ops.gl.p_glFinish();
/* call wglSwapBuffers through the gl table to avoid confusing the Steam overlay */
@@ -786,6 +799,71 @@ static void wined3d_swapchain_apply_sample_count_override(const struct wined3d_s
*quality = 0;
}
+#if defined(STAGING_CSMT)
+HRESULT swapchain_create_context_cs(struct wined3d_device *device, struct wined3d_swapchain *swapchain)
+{
+ const struct wined3d_adapter *adapter = device->adapter;
+ const struct wined3d_gl_info *gl_info = &adapter->gl_info;
+ UINT i;
+
+ static const enum wined3d_format_id formats[] =
+ {
+ WINED3DFMT_D24_UNORM_S8_UINT,
+ WINED3DFMT_D32_UNORM,
+ WINED3DFMT_R24_UNORM_X8_TYPELESS,
+ WINED3DFMT_D16_UNORM,
+ WINED3DFMT_S1_UINT_D15_UNORM
+ };
+
+ swapchain->context = HeapAlloc(GetProcessHeap(), 0, sizeof(*swapchain->context));
+ if (!swapchain->context)
+ {
+ ERR("Failed to create the context array.\n");
+ return E_OUTOFMEMORY;
+ }
+
+ /* In WGL both color, depth and stencil are features of a pixel format. In case of D3D they are separate.
+ * You are able to add a depth + stencil surface at a later stage when you need it.
+ * In order to support this properly in WineD3D we need the ability to recreate the opengl context and
+ * drawable when this is required. This is very tricky as we need to reapply ALL opengl states for the new
+ * context, need torecreate shaders, textures and other resources.
+ *
+ * The context manager already takes care of the state problem and for the other tasks code from Reset
+ * can be used. These changes are way to risky during the 1.0 code freeze which is taking place right now.
+ * Likely a lot of other new bugs will be exposed. For that reason request a depth stencil surface all the
+ * time. It can cause a slight performance hit but fixes a lot of regressions. A fixme reminds of that this
+ * issue needs to be fixed. */
+ for (i = 0; i < (sizeof(formats) / sizeof(*formats)); i++)
+ {
+ swapchain->ds_format = wined3d_get_format(gl_info, formats[i], WINED3DUSAGE_DEPTHSTENCIL);
+ swapchain->context[0] = context_create(swapchain, swapchain->front_buffer, swapchain->ds_format);
+ if (swapchain->context[0]) break;
+ TRACE("Depth stencil format %s is not supported, trying next format\n",
+ debug_d3dformat(formats[i]));
+ }
+
+ if (!swapchain->context[0])
+ {
+ WARN("Failed to create context.\n");
+ HeapFree(GetProcessHeap(), 0, swapchain->context);
+ swapchain->context = NULL;
+ return WINED3DERR_NOTAVAILABLE;
+ }
+ swapchain->num_contexts = 1;
+
+ if (wined3d_settings.offscreen_rendering_mode != ORM_FBO
+ && (!swapchain->desc.enable_auto_depth_stencil
+ || swapchain->desc.auto_depth_stencil_format != swapchain->ds_format->id))
+ {
+ FIXME("Add OpenGL context recreation support to context_validate_onscreen_formats\n");
+ }
+ context_release(swapchain->context[0]);
+ swapchain_update_swap_interval(swapchain);
+
+ return WINED3D_OK;
+}
+
+#endif /* STAGING_CSMT */
static HRESULT swapchain_init(struct wined3d_swapchain *swapchain, struct wined3d_device *device,
struct wined3d_swapchain_desc *desc, void *parent, const struct wined3d_parent_ops *parent_ops)
{
@@ -912,6 +990,7 @@ static HRESULT swapchain_init(struct wined3d_swapchain *swapchain, struct wined3
if (!(device->wined3d->flags & WINED3D_NO3D))
{
+#if !defined(STAGING_CSMT)
static const enum wined3d_format_id formats[] =
{
WINED3DFMT_D24_UNORM_S8_UINT,
@@ -967,6 +1046,11 @@ static HRESULT swapchain_init(struct wined3d_swapchain *swapchain, struct wined3
@@ -965,6 +978,9 @@ static HRESULT swapchain_init(struct wined3d_swapchain *swapchain, struct wined3
}
context_release(swapchain->context[0]);
swapchain_update_swap_interval(swapchain);
+#else /* STAGING_CSMT */
+ hr = wined3d_cs_emit_create_swapchain_context(device->cs, swapchain);
+ if (FAILED(hr))
+ goto err;
+#endif /* STAGING_CSMT */
}
if (swapchain->desc.backbuffer_count > 0)
@@ -1101,6 +1185,10 @@ static struct wined3d_context *swapchain_create_context(struct wined3d_swapchain
wined3d_cs_init_object(device->cs, wined3d_swapchain_cs_init, swapchain);
+#if defined(STAGING_CSMT)
+ wined3d_cs_emit_sync(device->cs);
+#endif /* STAGING_CSMT */
if (!swapchain->context[0])
{
@@ -1105,6 +1121,10 @@ static struct wined3d_context *swapchain_create_context(struct wined3d_swapchain
TRACE("Creating a new context for swapchain %p, thread %u.\n", swapchain, GetCurrentThreadId());
@ -3966,7 +3851,7 @@ diff --git a/dlls/wined3d/swapchain.c b/dlls/wined3d/swapchain.c
if (!(ctx = context_create(swapchain, swapchain->front_buffer, swapchain->ds_format)))
{
ERR("Failed to create a new context for the swapchain\n");
@@ -1287,6 +1375,9 @@ HRESULT CDECL wined3d_swapchain_resize_buffers(struct wined3d_swapchain *swapcha
@@ -1291,6 +1311,9 @@ HRESULT CDECL wined3d_swapchain_resize_buffers(struct wined3d_swapchain *swapcha
enum wined3d_multisample_type multisample_type, unsigned int multisample_quality)
{
BOOL update_desc = FALSE;
@ -3976,7 +3861,7 @@ diff --git a/dlls/wined3d/swapchain.c b/dlls/wined3d/swapchain.c
TRACE("swapchain %p, buffer_count %u, width %u, height %u, format %s, "
"multisample_type %#x, multisample_quality %#x.\n",
@@ -1298,6 +1389,10 @@ HRESULT CDECL wined3d_swapchain_resize_buffers(struct wined3d_swapchain *swapcha
@@ -1302,6 +1325,10 @@ HRESULT CDECL wined3d_swapchain_resize_buffers(struct wined3d_swapchain *swapcha
if (buffer_count && buffer_count != swapchain->desc.backbuffer_count)
FIXME("Cannot change the back buffer count yet.\n");
@ -4475,7 +4360,7 @@ diff --git a/dlls/wined3d/wined3d_main.c b/dlls/wined3d/wined3d_main.c
diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h
--- a/dlls/wined3d/wined3d_private.h
+++ b/dlls/wined3d/wined3d_private.h
@@ -306,6 +306,9 @@ struct wined3d_settings
@@ -307,6 +307,9 @@ struct wined3d_settings
unsigned int max_sm_ps;
unsigned int max_sm_cs;
BOOL no_3d;
@ -4485,7 +4370,7 @@ diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h
};
extern struct wined3d_settings wined3d_settings DECLSPEC_HIDDEN;
@@ -1505,6 +1508,10 @@ struct wined3d_query
@@ -1516,6 +1519,10 @@ struct wined3d_query
const void *data;
DWORD data_size;
const struct wined3d_query_ops *query_ops;
@ -4496,7 +4381,7 @@ diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h
};
union wined3d_gl_query_object
@@ -1546,6 +1553,9 @@ struct wined3d_occlusion_query
@@ -1557,6 +1564,9 @@ struct wined3d_occlusion_query
GLuint id;
struct wined3d_context *context;
UINT64 samples;
@ -4506,7 +4391,7 @@ diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h
};
struct wined3d_timestamp_query
@@ -2575,6 +2585,16 @@ struct wined3d_state
@@ -2586,6 +2596,16 @@ struct wined3d_state
struct wined3d_rasterizer_state *rasterizer_state;
};
@ -4523,7 +4408,7 @@ diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h
#define WINED3D_UNMAPPED_STAGE ~0u
/* Multithreaded flag. Removed from the public header to signal that
@@ -2686,6 +2706,14 @@ LRESULT device_process_message(struct wined3d_device *device, HWND window, BOOL
@@ -2697,6 +2717,14 @@ LRESULT device_process_message(struct wined3d_device *device, HWND window, BOOL
void device_resource_add(struct wined3d_device *device, struct wined3d_resource *resource) DECLSPEC_HIDDEN;
void device_resource_released(struct wined3d_device *device, struct wined3d_resource *resource) DECLSPEC_HIDDEN;
void device_invalidate_state(const struct wined3d_device *device, DWORD state) DECLSPEC_HIDDEN;
@ -4538,7 +4423,7 @@ diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h
static inline BOOL isStateDirty(const struct wined3d_context *context, DWORD state)
{
@@ -2761,11 +2789,13 @@ static inline void wined3d_resource_release(struct wined3d_resource *resource)
@@ -2772,11 +2800,13 @@ static inline void wined3d_resource_release(struct wined3d_resource *resource)
InterlockedDecrement(&resource->access_count);
}
@ -4552,7 +4437,7 @@ diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h
void resource_cleanup(struct wined3d_resource *resource) DECLSPEC_HIDDEN;
HRESULT resource_init(struct wined3d_resource *resource, struct wined3d_device *device,
enum wined3d_resource_type type, const struct wined3d_format *format,
@@ -2876,7 +2906,11 @@ struct wined3d_texture
@@ -2887,7 +2917,11 @@ struct wined3d_texture
unsigned int map_count;
DWORD locations;
@ -4564,7 +4449,7 @@ diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h
} sub_resources[1];
};
@@ -2929,9 +2963,16 @@ void wined3d_texture_bind_and_dirtify(struct wined3d_texture *texture,
@@ -2940,9 +2974,16 @@ void wined3d_texture_bind_and_dirtify(struct wined3d_texture *texture,
struct wined3d_context *context, BOOL srgb) DECLSPEC_HIDDEN;
BOOL wined3d_texture_check_block_align(const struct wined3d_texture *texture,
unsigned int level, const struct wined3d_box *box) DECLSPEC_HIDDEN;
@ -4581,7 +4466,7 @@ diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h
void wined3d_texture_invalidate_location(struct wined3d_texture *texture,
unsigned int sub_resource_idx, DWORD location) DECLSPEC_HIDDEN;
void wined3d_texture_load(struct wined3d_texture *texture,
@@ -2944,6 +2985,10 @@ BOOL wined3d_texture_prepare_location(struct wined3d_texture *texture, unsigned
@@ -2955,6 +2996,10 @@ BOOL wined3d_texture_prepare_location(struct wined3d_texture *texture, unsigned
struct wined3d_context *context, DWORD location) DECLSPEC_HIDDEN;
void wined3d_texture_prepare_texture(struct wined3d_texture *texture,
struct wined3d_context *context, BOOL srgb) DECLSPEC_HIDDEN;
@ -4592,7 +4477,7 @@ diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h
void wined3d_texture_set_map_binding(struct wined3d_texture *texture, DWORD map_binding) DECLSPEC_HIDDEN;
void wined3d_texture_set_swapchain(struct wined3d_texture *texture,
struct wined3d_swapchain *swapchain) DECLSPEC_HIDDEN;
@@ -3051,6 +3096,11 @@ HRESULT surface_upload_from_surface(struct wined3d_surface *dst_surface, const P
@@ -3062,6 +3107,11 @@ HRESULT surface_upload_from_surface(struct wined3d_surface *dst_surface, const P
void wined3d_surface_upload_data(struct wined3d_surface *surface, const struct wined3d_gl_info *gl_info,
const struct wined3d_format *format, const RECT *src_rect, UINT src_pitch, const POINT *dst_point,
BOOL srgb, const struct wined3d_const_bo_address *data) DECLSPEC_HIDDEN;
@ -4604,7 +4489,7 @@ diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h
void draw_textured_quad(const struct wined3d_surface *src_surface, struct wined3d_context *context,
const RECT *src_rect, const RECT *dst_rect, enum wined3d_texture_filter_type filter) DECLSPEC_HIDDEN;
@@ -3178,6 +3228,7 @@ enum wined3d_push_constants
@@ -3189,6 +3239,7 @@ enum wined3d_push_constants
WINED3D_PUSH_CONSTANTS_PS_B,
};
@ -4612,7 +4497,7 @@ diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h
struct wined3d_cs_ops
{
void *(*require_space)(struct wined3d_cs *cs, size_t size);
@@ -3185,6 +3236,33 @@ struct wined3d_cs_ops
@@ -3196,6 +3247,33 @@ struct wined3d_cs_ops
void (*push_constants)(struct wined3d_cs *cs, enum wined3d_push_constants p,
unsigned int start_idx, unsigned int count, const void *constants);
};
@ -4646,12 +4531,12 @@ diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h
struct wined3d_cs
{
@@ -3195,23 +3273,77 @@ struct wined3d_cs
@@ -3206,23 +3284,75 @@ struct wined3d_cs
size_t data_size, start, end;
void *data;
+#if !defined(STAGING_CSMT)
+};
};
+#else /* STAGING_CSMT */
+
+ HANDLE thread;
@ -4666,15 +4551,15 @@ diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h
+
+ HANDLE event;
+ BOOL waiting_for_event;
};
+};
+
+static inline void wined3d_resource_wait_idle(struct wined3d_resource *resource)
+{
+ if (resource->device->cs->thread_id == GetCurrentThreadId()) return;
+ while (InterlockedCompareExchange(&resource->access_count, 0, 0));
+}
+#endif /* STAGING_CSMT */
+
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,
@ -4695,8 +4580,6 @@ diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h
+void wined3d_cs_emit_clear_rtv(struct wined3d_cs *cs, struct wined3d_rendertarget_view *view,
+ const RECT *rect, DWORD flags, const struct wined3d_color *color, float depth, DWORD stencil,
+ const struct blit_shader *blitter) DECLSPEC_HIDDEN;
+HRESULT wined3d_cs_emit_create_swapchain_context(struct wined3d_cs *cs,
+ struct wined3d_swapchain *swapchain) DECLSPEC_HIDDEN;
+#endif /* STAGING_CSMT */
void wined3d_cs_emit_dispatch(struct wined3d_cs *cs,
unsigned int group_count_x, unsigned int group_count_y, unsigned int group_count_z) DECLSPEC_HIDDEN;
@ -4712,11 +4595,11 @@ diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h
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;
+#if !defined(STAGING_CSMT)
void wined3d_cs_emit_query_issue(struct wined3d_cs *cs, struct wined3d_query *query, DWORD flags) DECLSPEC_HIDDEN;
+void wined3d_cs_emit_query_issue(struct wined3d_cs *cs, struct wined3d_query *query, DWORD flags) DECLSPEC_HIDDEN;
+#else /* STAGING_CSMT */
+void wined3d_cs_emit_push_constants(struct wined3d_cs *cs, enum wined3d_push_constants p,
+ unsigned int start_idx, unsigned int count, const void *constants) DECLSPEC_HIDDEN;
+void wined3d_cs_emit_query_issue(struct wined3d_cs *cs, struct wined3d_query *query, DWORD flags) DECLSPEC_HIDDEN;
void wined3d_cs_emit_query_issue(struct wined3d_cs *cs, struct wined3d_query *query, DWORD flags) DECLSPEC_HIDDEN;
+BOOL wined3d_cs_emit_query_poll(struct wined3d_cs *cs, struct wined3d_query *query, DWORD flags) DECLSPEC_HIDDEN;
+HRESULT wined3d_cs_emit_release_dc(struct wined3d_cs *cs, struct wined3d_texture *texture,
+ unsigned int sub_resource_idx) DECLSPEC_HIDDEN;
@ -4724,17 +4607,17 @@ 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;
@@ -3259,19 +3391,37 @@ void wined3d_cs_emit_set_unordered_access_view(struct wined3d_cs *cs, enum wined
@@ -3270,19 +3400,37 @@ void wined3d_cs_emit_set_unordered_access_view(struct wined3d_cs *cs, enum wined
void wined3d_cs_emit_set_vertex_declaration(struct wined3d_cs *cs,
struct wined3d_vertex_declaration *declaration) DECLSPEC_HIDDEN;
void wined3d_cs_emit_set_viewport(struct wined3d_cs *cs, const struct wined3d_viewport *viewport) DECLSPEC_HIDDEN;
+#if !defined(STAGING_CSMT)
void wined3d_cs_emit_unload_resource(struct wined3d_cs *cs, struct wined3d_resource *resource) DECLSPEC_HIDDEN;
+void wined3d_cs_emit_unload_resource(struct wined3d_cs *cs, struct wined3d_resource *resource) DECLSPEC_HIDDEN;
+#else /* 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);
+void wined3d_cs_emit_unload_resource(struct wined3d_cs *cs, struct wined3d_resource *resource) DECLSPEC_HIDDEN;
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,
+ unsigned int sub_resource_idx, const struct wined3d_box *box, const void *data, unsigned int row_pitch,
+ unsigned int depth_pitch) DECLSPEC_HIDDEN;
@ -4762,14 +4645,3 @@ diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h
/* TODO: Add tests and support for FLOAT16_4 POSITIONT, D3DCOLOR position, other
* fixed function semantics as D3DCOLOR or FLOAT16 */
@@ -3446,6 +3596,10 @@ struct wined3d_swapchain
void wined3d_swapchain_activate(struct wined3d_swapchain *swapchain, BOOL activate) DECLSPEC_HIDDEN;
struct wined3d_context *swapchain_get_context(struct wined3d_swapchain *swapchain) DECLSPEC_HIDDEN;
+#if defined(STAGING_CSMT)
+HRESULT swapchain_create_context_cs(struct wined3d_device *device,
+ struct wined3d_swapchain *swapchain) DECLSPEC_HIDDEN;
+#endif /* STAGING_CSMT */
void swapchain_destroy_contexts(struct wined3d_swapchain *swapchain) DECLSPEC_HIDDEN;
HDC swapchain_get_backup_dc(struct wined3d_swapchain *swapchain) DECLSPEC_HIDDEN;
void swapchain_update_draw_bindings(struct wined3d_swapchain *swapchain) DECLSPEC_HIDDEN;