Rebase against 9e35dd15454be28c487b0f1bebefbbe530b2aca4.

This commit is contained in:
Sebastian Lackner 2017-04-12 09:52:27 +02:00
parent b113596b6c
commit 4a75337774
14 changed files with 473 additions and 1051 deletions

View File

@ -1,4 +1,4 @@
From 714b2b8a22566f7c6c0d92ed74bd9886062fb16e Mon Sep 17 00:00:00 2001
From 7618743260a673e0556845b352bc7c2620775164 Mon Sep 17 00:00:00 2001
From: Sebastian Lackner <sebastian@fds-team.de>
Date: Sun, 9 Apr 2017 03:13:25 +0200
Subject: server: Skip async completion when possible.
@ -25,7 +25,7 @@ index 013eb2b39f..631013c755 100644
CloseHandle(ov.hEvent);
diff --git a/server/async.c b/server/async.c
index e113681bb0..5a64565d5f 100644
index 7323047d8d..ad7c1f097f 100644
--- a/server/async.c
+++ b/server/async.c
@@ -45,6 +45,7 @@ struct async
@ -42,7 +42,7 @@ index e113681bb0..5a64565d5f 100644
+void async_skip_completion( struct async *async, int comp_flags )
+{
+ if (!async->data.callback) return;
+ if (!async->data.user) return;
+ if (!(comp_flags & COMPLETION_SKIP_ON_SUCCESS)) return;
+ async->skip_completion = (async->status == STATUS_SUCCESS ||
+ async->status == STATUS_ALERTED);
@ -51,7 +51,7 @@ index e113681bb0..5a64565d5f 100644
/* notifies client thread of new status of its async request */
void async_terminate( struct async *async, unsigned int status )
{
@@ -263,6 +272,7 @@ struct async *create_async( struct thread *thread, const async_data_t *data, str
@@ -262,6 +271,7 @@ struct async *create_async( struct thread *thread, const async_data_t *data, str
async->timeout = NULL;
async->queue = NULL;
async->signaled = 0;
@ -59,14 +59,14 @@ index e113681bb0..5a64565d5f 100644
if (iosb) async->iosb = (struct iosb *)grab_object( iosb );
else async->iosb = NULL;
@@ -328,7 +338,7 @@ void async_set_result( struct object *obj, unsigned int status, apc_param_t tota
@@ -326,7 +336,7 @@ void async_set_result( struct object *obj, unsigned int status, apc_param_t tota
async->status = status;
if (status == STATUS_MORE_PROCESSING_REQUIRED) return; /* don't report the completion */
- if (async->queue && async->data.cvalue)
+ if (async->queue && async->data.cvalue && !async->skip_completion)
add_async_completion( async->queue, async->data.cvalue, status, total );
if (apc)
- if (async->queue && !async->data.apc && async->data.apc_context)
+ if (async->queue && !async->data.apc && async->data.apc_context && !async->skip_completion)
add_async_completion( async->queue, async->data.apc_context, status, total );
if (async->data.apc)
{
diff --git a/server/fd.c b/server/fd.c
index 9617fa1279..e0c2ee4f26 100644
@ -105,11 +105,11 @@ index 9617fa1279..e0c2ee4f26 100644
}
release_object( iosb );
diff --git a/server/file.h b/server/file.h
index 398733c460..19bc3cbfe4 100644
index 94cc37ff2e..6c68153d38 100644
--- a/server/file.h
+++ b/server/file.h
@@ -182,6 +182,7 @@ extern void async_set_result( struct object *obj, unsigned int status,
apc_param_t total, client_ptr_t apc, client_ptr_t apc_arg );
@@ -181,6 +181,7 @@ extern void async_set_timeout( struct async *async, timeout_t timeout, unsigned
extern void async_set_result( struct object *obj, unsigned int status, apc_param_t total );
extern int async_queued( struct async_queue *queue );
extern int async_waiting( struct async_queue *queue );
+extern void async_skip_completion( struct async *async, int comp_flags );

View File

@ -1,4 +1,4 @@
From e9f0a1256a3e1850f5a19bf33f44fafb05caa4e2 Mon Sep 17 00:00:00 2001
From 31994d20fb36774cb6cc0652bdd432e524ce4837 Mon Sep 17 00:00:00 2001
From: Sebastian Lackner <sebastian@fds-team.de>
Date: Tue, 3 Mar 2015 03:39:12 +0100
Subject: ntdll: Reuse old async fileio structures if possible.
@ -11,18 +11,18 @@ often possible to reuse old fileio structures.
1 file changed, 18 insertions(+), 6 deletions(-)
diff --git a/dlls/ntdll/file.c b/dlls/ntdll/file.c
index b07e5f9..7b6c2b9 100644
index 264ad65fe0..011e47a1ca 100644
--- a/dlls/ntdll/file.c
+++ b/dlls/ntdll/file.c
@@ -332,6 +332,7 @@ NTSTATUS WINAPI NtCreateFile( PHANDLE handle, ACCESS_MASK access, POBJECT_ATTRIB
struct async_fileio
@@ -352,6 +352,7 @@ struct async_fileio
{
async_callback_t *callback; /* must be the first field */
struct async_fileio *next;
+ DWORD size;
HANDLE handle;
PIO_APC_ROUTINE apc;
void *apc_arg;
@@ -370,17 +371,28 @@ static struct async_fileio *alloc_fileio( DWORD size, HANDLE handle, PIO_APC_ROU
};
@@ -396,18 +397,29 @@ static struct async_fileio *alloc_fileio( DWORD size, async_callback_t callback,
{
/* first free remaining previous fileinfos */
@ -53,10 +53,11 @@ index b07e5f9..7b6c2b9 100644
- if ((io = RtlAllocateHeap( GetProcessHeap(), 0, size )))
+ if (io || (io = RtlAllocateHeap( GetProcessHeap(), 0, size )))
{
+ io->size = size;
io->handle = handle;
io->apc = apc;
io->apc_arg = arg;
io->callback = callback;
+ io->size = size;
io->handle = handle;
}
return io;
--
2.3.0
2.11.0

View File

@ -52,7 +52,7 @@ usage()
# Get the upstream commit sha
upstream_commit()
{
echo "692656467729c5548c45244aa05ca946620afa72"
echo "9e35dd15454be28c487b0f1bebefbbe530b2aca4"
}
# Show version information
@ -8757,7 +8757,6 @@ if test "$enable_wined3d_CSMT_Main" -eq 1; then
printf '%s\n' '+ { "Stefan Dösinger", "wined3d: Prevent the command stream from running ahead too far.", 1 },';
printf '%s\n' '+ { "Stefan Dösinger", "wined3d: Send blits through the command stream.", 1 },';
printf '%s\n' '+ { "Stefan Dösinger", "wined3d: Get rid of the end_scene flush and finish.", 1 },';
printf '%s\n' '+ { "Stefan Dösinger", "wined3d: Send update_texture calls through the CS.", 1 },';
printf '%s\n' '+ { "Sebastian Lackner", "wined3d: Send query_poll through the command stream.", 1 },';
printf '%s\n' '+ { "Stefan Dösinger", "wined3d: Update the swap interval through the CS in reset.", 1 },';
printf '%s\n' '+ { "Nils Kuhnhenn", "wined3d: Fix context_acquire not being called from the command thread in wined3d_texture_add_dirty_region.", 1 },';

View File

@ -1,4 +1,4 @@
From 916af67f174d81515eb825e1bb45af8b54781bdf Mon Sep 17 00:00:00 2001
From c5093b9a61cc252beb6b406cc72e7dd5a6642751 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Michael=20M=C3=BCller?= <michael@fds-team.de>
Date: Sun, 8 Jan 2017 18:22:30 +0100
Subject: user32: Add semi-stub for GetAutoRotationState.
@ -11,7 +11,7 @@ Subject: user32: Add semi-stub for GetAutoRotationState.
4 files changed, 56 insertions(+)
diff --git a/dlls/user32/sysparams.c b/dlls/user32/sysparams.c
index 63c4ffe070d..c79b53c6e7b 100644
index 63c4ffe070..c79b53c6e7 100644
--- a/dlls/user32/sysparams.c
+++ b/dlls/user32/sysparams.c
@@ -2913,3 +2913,20 @@ BOOL WINAPI IsProcessDPIAware(void)
@ -36,7 +36,7 @@ index 63c4ffe070d..c79b53c6e7b 100644
+ return TRUE;
+}
diff --git a/dlls/user32/tests/sysparams.c b/dlls/user32/tests/sysparams.c
index 075a0c71f65..758fd45399a 100644
index 96b15814d7..3fe21abb90 100644
--- a/dlls/user32/tests/sysparams.c
+++ b/dlls/user32/tests/sysparams.c
@@ -39,6 +39,7 @@
@ -46,8 +46,8 @@ index 075a0c71f65..758fd45399a 100644
+static LONG (WINAPI *pGetAutoRotationState)(PAR_STATE);
static BOOL strict;
static int dpi;
@@ -2917,6 +2918,28 @@ static void test_GetSysColorBrush(void)
static int dpi, real_dpi;
@@ -2932,6 +2933,28 @@ static void test_GetSysColorBrush(void)
win_skip("COLOR_MENUBAR unsupported\n");
}
@ -76,7 +76,7 @@ index 075a0c71f65..758fd45399a 100644
START_TEST(sysparams)
{
int argc;
@@ -2929,6 +2952,7 @@ START_TEST(sysparams)
@@ -2944,6 +2967,7 @@ START_TEST(sysparams)
hdll = GetModuleHandleA("user32.dll");
pChangeDisplaySettingsExA=(void*)GetProcAddress(hdll, "ChangeDisplaySettingsExA");
@ -84,7 +84,7 @@ index 075a0c71f65..758fd45399a 100644
hInstance = GetModuleHandleA( NULL );
hdc = GetDC(0);
@@ -2948,6 +2972,7 @@ START_TEST(sysparams)
@@ -2965,6 +2989,7 @@ START_TEST(sysparams)
trace("testing EnumDisplaySettings vs GetDeviceCaps\n");
test_EnumDisplaySettings( );
test_GetSysColorBrush( );
@ -93,7 +93,7 @@ index 075a0c71f65..758fd45399a 100644
change_counter = 0;
change_last_param = 0;
diff --git a/dlls/user32/user32.spec b/dlls/user32/user32.spec
index 65a5bfe3c08..e53d57ca9ed 100644
index 6f2703a9b7..b3fa5ae532 100644
--- a/dlls/user32/user32.spec
+++ b/dlls/user32/user32.spec
@@ -251,6 +251,7 @@
@ -105,10 +105,10 @@ index 65a5bfe3c08..e53d57ca9ed 100644
@ stdcall GetCaretBlinkTime()
@ stdcall GetCaretPos(ptr)
diff --git a/include/winuser.h b/include/winuser.h
index 2b8331c3b63..8af65e51380 100644
index 802b0b0660..ec4b753d02 100644
--- a/include/winuser.h
+++ b/include/winuser.h
@@ -1458,6 +1458,19 @@ DECL_WINELIB_TYPE_AW(LPHELPWININFO)
@@ -1460,6 +1460,19 @@ DECL_WINELIB_TYPE_AW(LPHELPWININFO)
#define CDS_SETRECT 0x20000000
#define CDS_RESET 0x40000000

View File

@ -1,322 +0,0 @@
From ff1d7052ee893bb9e3c338e88a71278aaf228f27 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Stefan=20D=C3=B6singer?= <stefan@codeweavers.com>
Date: Thu, 1 Aug 2013 00:33:48 +0200
Subject: wined3d: Send update_texture calls through the CS
FIXME: This logic duplication is ugly.
---
dlls/wined3d/cs.c | 37 +++++++++++
dlls/wined3d/device.c | 145 +++++++++++++++++++++++------------------
dlls/wined3d/wined3d_private.h | 4 ++
3 files changed, 123 insertions(+), 63 deletions(-)
diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c
index 1b9c199e91..b6c56ca164 100644
--- a/dlls/wined3d/cs.c
+++ b/dlls/wined3d/cs.c
@@ -68,6 +68,7 @@ enum wined3d_cs_op
WINED3D_CS_OP_BLT_SUB_RESOURCE,
WINED3D_CS_OP_UPDATE_SUB_RESOURCE,
WINED3D_CS_OP_PUSH_CONSTANTS,
+ WINED3D_CS_OP_UPDATE_TEXTURE,
};
struct wined3d_cs_sync
@@ -394,6 +395,12 @@ struct wined3d_cs_push_constants
BYTE constants[1];
};
+struct wined3d_cs_update_texture
+{
+ enum wined3d_cs_op opcode;
+ struct wined3d_texture *src, *dst;
+};
+
static void wined3d_cs_exec_sync(struct wined3d_cs *cs, const void *data)
{
}
@@ -2078,6 +2085,35 @@ void wined3d_cs_emit_push_constants(struct wined3d_cs *cs, enum wined3d_push_con
cs->ops->submit(cs);
}
+static void wined3d_cs_exec_update_texture(struct wined3d_cs *cs, const void *data)
+{
+ const struct wined3d_cs_update_texture *op = data;
+ struct wined3d_context *context;
+
+ context = context_acquire(cs->device, NULL, 0);
+ device_exec_update_texture(context, op->src, op->dst);
+ context_release(context);
+
+ wined3d_resource_release(&op->src->resource);
+ wined3d_resource_release(&op->dst->resource);
+}
+
+void wined3d_cs_emit_update_texture(struct wined3d_cs *cs, struct wined3d_texture *src,
+ struct wined3d_texture *dst)
+{
+ struct wined3d_cs_update_texture *op;
+
+ op = cs->ops->require_space(cs, sizeof(*op));
+ op->opcode = WINED3D_CS_OP_UPDATE_TEXTURE;
+ op->src = src;
+ op->dst = dst;
+
+ wined3d_resource_acquire(&op->src->resource);
+ wined3d_resource_acquire(&op->dst->resource);
+
+ cs->ops->submit(cs);
+}
+
static void (* const wined3d_cs_op_handlers[])(struct wined3d_cs *cs, const void *data) =
{
/* WINED3D_CS_OP_SYNC */ wined3d_cs_exec_sync,
@@ -2122,6 +2158,7 @@ static void (* const wined3d_cs_op_handlers[])(struct wined3d_cs *cs, const void
/* WINED3D_CS_OP_BLT_SUB_RESOURCE */ wined3d_cs_exec_blt_sub_resource,
/* WINED3D_CS_OP_UPDATE_SUB_RESOURCE */ wined3d_cs_exec_update_sub_resource,
/* WINED3D_CS_OP_PUSH_CONSTANTS */ wined3d_cs_exec_push_constants,
+ /* WINED3D_CS_OP_UPDATE_TEXTURE */ wined3d_cs_exec_update_texture,
};
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 cde275573d..f30aa6bf6f 100644
--- a/dlls/wined3d/device.c
+++ b/dlls/wined3d/device.c
@@ -3656,59 +3656,20 @@ void CDECL wined3d_device_draw_indexed_primitive_instanced(struct wined3d_device
start_idx, index_count, start_instance, instance_count, TRUE);
}
-HRESULT CDECL wined3d_device_update_texture(struct wined3d_device *device,
- struct wined3d_texture *src_texture, struct wined3d_texture *dst_texture)
+/* Context activation is done by the caller */
+void device_exec_update_texture(struct wined3d_context *context, struct wined3d_texture *src_texture,
+ struct wined3d_texture *dst_texture)
{
unsigned int src_size, dst_size, src_skip_levels = 0;
unsigned int layer_count, level_count, i, j;
unsigned int row_pitch, slice_pitch;
enum wined3d_resource_type type;
- struct wined3d_context *context;
struct wined3d_bo_address data;
HRESULT hr;
RECT r;
- TRACE("device %p, src_texture %p, dst_texture %p.\n", device, src_texture, dst_texture);
-
- /* Verify that the source and destination textures are non-NULL. */
- if (!src_texture || !dst_texture)
- {
- WARN("Source and destination textures must be non-NULL, returning WINED3DERR_INVALIDCALL.\n");
- return WINED3DERR_INVALIDCALL;
- }
-
- if (src_texture->resource.pool != WINED3D_POOL_SYSTEM_MEM)
- {
- WARN("Source texture not in WINED3D_POOL_SYSTEM_MEM, returning WINED3DERR_INVALIDCALL.\n");
- return WINED3DERR_INVALIDCALL;
- }
- if (dst_texture->resource.pool != WINED3D_POOL_DEFAULT)
- {
- WARN("Destination texture not in WINED3D_POOL_DEFAULT, returning WINED3DERR_INVALIDCALL.\n");
- return WINED3DERR_INVALIDCALL;
- }
-
- /* Verify that the source and destination textures are the same type. */
type = src_texture->resource.type;
- if (dst_texture->resource.type != type)
- {
- WARN("Source and destination have different types, returning WINED3DERR_INVALIDCALL.\n");
- return WINED3DERR_INVALIDCALL;
- }
-
layer_count = src_texture->layer_count;
- if (layer_count != dst_texture->layer_count)
- {
- WARN("Source and destination have different layer counts.\n");
- return WINED3DERR_INVALIDCALL;
- }
-
- if (src_texture->resource.format != dst_texture->resource.format)
- {
- WARN("Source and destination formats do not match.\n");
- return WINED3DERR_INVALIDCALL;
- }
-
level_count = min(wined3d_texture_get_level_count(src_texture),
wined3d_texture_get_level_count(dst_texture));
@@ -3725,18 +3686,8 @@ HRESULT CDECL wined3d_device_update_texture(struct wined3d_device *device,
++src_skip_levels;
}
- if (wined3d_texture_get_level_width(src_texture, src_skip_levels) != dst_texture->resource.width
- || wined3d_texture_get_level_height(src_texture, src_skip_levels) != dst_texture->resource.height
- || wined3d_texture_get_level_depth(src_texture, src_skip_levels) != dst_texture->resource.depth)
- {
- WARN("Source and destination dimensions do not match.\n");
- return WINED3DERR_INVALIDCALL;
- }
-
/* Make sure that the destination texture is loaded. */
- context = context_acquire(device, NULL, 0);
wined3d_texture_load(dst_texture, context, FALSE);
- context_release(context);
/* Update every surface level of the texture. */
switch (type)
@@ -3765,7 +3716,7 @@ HRESULT CDECL wined3d_device_update_texture(struct wined3d_device *device,
src_texture, src_sub_resource_idx, &r, 0, NULL, WINED3D_TEXF_POINT)))
{
WARN("Failed to update surface, hr %#x.\n", hr);
- return hr;
+ return;
}
continue;
}
@@ -3775,16 +3726,14 @@ HRESULT CDECL wined3d_device_update_texture(struct wined3d_device *device,
if (FAILED(hr = surface_upload_from_surface(dst_surface, NULL, src_surface, NULL)))
{
WARN("Failed to update surface, hr %#x.\n", hr);
- return hr;
+ return;
}
}
}
- return WINED3D_OK;
+ break;
}
case WINED3D_RTYPE_TEXTURE_3D:
- context = context_acquire(device, NULL, 0);
-
/* Only a prepare, since we're uploading entire volumes. */
wined3d_texture_prepare_texture(dst_texture, context, FALSE);
wined3d_texture_bind_and_dirtify(dst_texture, context, FALSE);
@@ -3796,8 +3745,7 @@ HRESULT CDECL wined3d_device_update_texture(struct wined3d_device *device,
{
WARN("Failed to load source sub-resource %u into %s.\n", src_skip_levels + j,
wined3d_debug_location(src_texture->resource.map_binding));
- context_release(context);
- return WINED3DERR_INVALIDCALL;
+ return;
}
wined3d_texture_get_memory(src_texture, src_skip_levels + j, &data, src_texture->resource.map_binding);
@@ -3807,16 +3755,87 @@ HRESULT CDECL wined3d_device_update_texture(struct wined3d_device *device,
wined3d_const_bo_address(&data), row_pitch, slice_pitch);
wined3d_texture_invalidate_location(dst_texture, j, ~WINED3D_LOCATION_TEXTURE_RGB);
}
-
- context_release(context);
- return WINED3D_OK;
+ break;
default:
FIXME("Unsupported texture type %#x.\n", type);
- return WINED3DERR_INVALIDCALL;
}
}
+HRESULT CDECL wined3d_device_update_texture(struct wined3d_device *device,
+ struct wined3d_texture *src_texture, struct wined3d_texture *dst_texture)
+{
+ unsigned int src_size, dst_size, src_skip_levels = 0;
+ unsigned int layer_count;
+ enum wined3d_resource_type type;
+
+ TRACE("device %p, src_texture %p, dst_texture %p.\n", device, src_texture, dst_texture);
+
+ /* Verify that the source and destination textures are non-NULL. */
+ if (!src_texture || !dst_texture)
+ {
+ WARN("Source and destination textures must be non-NULL, returning WINED3DERR_INVALIDCALL.\n");
+ return WINED3DERR_INVALIDCALL;
+ }
+
+ if (src_texture->resource.pool != WINED3D_POOL_SYSTEM_MEM)
+ {
+ WARN("Source texture not in WINED3D_POOL_SYSTEM_MEM, returning WINED3DERR_INVALIDCALL.\n");
+ return WINED3DERR_INVALIDCALL;
+ }
+ if (dst_texture->resource.pool != WINED3D_POOL_DEFAULT)
+ {
+ WARN("Destination texture not in WINED3D_POOL_DEFAULT, returning WINED3DERR_INVALIDCALL.\n");
+ return WINED3DERR_INVALIDCALL;
+ }
+
+ /* Verify that the source and destination textures are the same type. */
+ type = src_texture->resource.type;
+ if (dst_texture->resource.type != type)
+ {
+ WARN("Source and destination have different types, returning WINED3DERR_INVALIDCALL.\n");
+ return WINED3DERR_INVALIDCALL;
+ }
+
+ layer_count = src_texture->layer_count;
+ if (layer_count != dst_texture->layer_count)
+ {
+ WARN("Source and destination have different layer counts.\n");
+ return WINED3DERR_INVALIDCALL;
+ }
+
+ if (src_texture->resource.format != dst_texture->resource.format)
+ {
+ WARN("Source and destination formats do not match.\n");
+ return WINED3DERR_INVALIDCALL;
+ }
+
+ src_size = max(src_texture->resource.width, src_texture->resource.height);
+ dst_size = max(dst_texture->resource.width, dst_texture->resource.height);
+ if (type == WINED3D_RTYPE_TEXTURE_3D)
+ {
+ src_size = max(src_size, src_texture->resource.depth);
+ dst_size = max(dst_size, dst_texture->resource.depth);
+ }
+ while (src_size > dst_size)
+ {
+ src_size >>= 1;
+ ++src_skip_levels;
+ }
+
+ if (wined3d_texture_get_level_width(src_texture, src_skip_levels) != dst_texture->resource.width
+ || wined3d_texture_get_level_height(src_texture, src_skip_levels) != dst_texture->resource.height
+ || wined3d_texture_get_level_depth(src_texture, src_skip_levels) != dst_texture->resource.depth)
+ {
+ WARN("Source and destination dimensions do not match.\n");
+ return WINED3DERR_INVALIDCALL;
+ }
+
+ wined3d_cs_emit_update_texture(device->cs, src_texture, dst_texture);
+
+ return WINED3D_OK;
+}
+
HRESULT CDECL wined3d_device_validate_device(const struct wined3d_device *device, DWORD *num_passes)
{
const struct wined3d_state *state = &device->state;
diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h
index 437a1c1437..eab448fa29 100644
--- a/dlls/wined3d/wined3d_private.h
+++ b/dlls/wined3d/wined3d_private.h
@@ -2733,6 +2733,8 @@ LRESULT device_process_message(struct wined3d_device *device, HWND window, BOOL
void device_resource_add(struct wined3d_device *device, struct wined3d_resource *resource) DECLSPEC_HIDDEN;
void device_resource_released(struct wined3d_device *device, struct wined3d_resource *resource) DECLSPEC_HIDDEN;
void device_invalidate_state(const struct wined3d_device *device, DWORD state) DECLSPEC_HIDDEN;
+void device_exec_update_texture(struct wined3d_context *context, struct wined3d_texture *src_texture,
+ struct wined3d_texture *dst_texture) DECLSPEC_HIDDEN;
static inline BOOL isStateDirty(const struct wined3d_context *context, DWORD state)
{
@@ -3321,6 +3323,8 @@ void wined3d_cs_emit_unload_resource(struct wined3d_cs *cs, struct wined3d_resou
void wined3d_cs_emit_update_sub_resource(struct wined3d_cs *cs, struct wined3d_resource *resource,
unsigned int sub_resource_idx, const struct wined3d_box *box, const void *data, unsigned int row_pitch,
unsigned int slice_pitch) DECLSPEC_HIDDEN;
+void wined3d_cs_emit_update_texture(struct wined3d_cs *cs, struct wined3d_texture *src,
+ struct wined3d_texture *dst) DECLSPEC_HIDDEN;
void wined3d_cs_init_object(struct wined3d_cs *cs,
void (*callback)(void *object), void *object) DECLSPEC_HIDDEN;
HRESULT wined3d_cs_map(struct wined3d_cs *cs, struct wined3d_resource *resource, unsigned int sub_resource_idx,
--
2.11.0

View File

@ -1,4 +1,4 @@
From 4d40a30b39e380e7b1b4bdf5a297340e3483305d Mon Sep 17 00:00:00 2001
From 93d7436f3da6532a3ec5beeeea4d548c34820477 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,19 +10,19 @@ 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 058dca866e..cfcbbfbacc 100644
index d5199a93d8..65c02e4d21 100644
--- a/dlls/wined3d/cs.c
+++ b/dlls/wined3d/cs.c
@@ -70,6 +70,7 @@ enum wined3d_cs_op
@@ -69,6 +69,7 @@ enum wined3d_cs_op
WINED3D_CS_OP_BLT_SUB_RESOURCE,
WINED3D_CS_OP_UPDATE_SUB_RESOURCE,
WINED3D_CS_OP_PUSH_CONSTANTS,
WINED3D_CS_OP_UPDATE_TEXTURE,
+ WINED3D_CS_OP_UPDATE_SWAP_INTERVAL,
};
struct wined3d_cs_sync
@@ -410,6 +411,12 @@ struct wined3d_cs_update_texture
struct wined3d_texture *src, *dst;
@@ -403,6 +404,12 @@ struct wined3d_cs_push_constants
BYTE constants[1];
};
+struct wined3d_cs_update_swap_interval
@ -34,7 +34,7 @@ index 058dca866e..cfcbbfbacc 100644
static void wined3d_cs_exec_sync(struct wined3d_cs *cs, const void *data)
{
}
@@ -2068,6 +2075,24 @@ void wined3d_cs_emit_update_texture(struct wined3d_cs *cs, struct wined3d_textur
@@ -2111,6 +2118,24 @@ void wined3d_cs_emit_push_constants(struct wined3d_cs *cs, enum wined3d_push_con
cs->ops->submit(cs);
}
@ -59,19 +59,19 @@ index 058dca866e..cfcbbfbacc 100644
static void (* const wined3d_cs_op_handlers[])(struct wined3d_cs *cs, const void *data) =
{
/* WINED3D_CS_OP_SYNC */ wined3d_cs_exec_sync,
@@ -2114,6 +2139,7 @@ static void (* const wined3d_cs_op_handlers[])(struct wined3d_cs *cs, const void
@@ -2156,6 +2181,7 @@ static void (* const wined3d_cs_op_handlers[])(struct wined3d_cs *cs, const void
/* WINED3D_CS_OP_BLT_SUB_RESOURCE */ wined3d_cs_exec_blt_sub_resource,
/* WINED3D_CS_OP_UPDATE_SUB_RESOURCE */ wined3d_cs_exec_update_sub_resource,
/* WINED3D_CS_OP_PUSH_CONSTANTS */ wined3d_cs_exec_push_constants,
/* WINED3D_CS_OP_UPDATE_TEXTURE */ wined3d_cs_exec_update_texture,
+ /* 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 acc1916747..ef136e813f 100644
index c2b7623141..c05c8c51f2 100644
--- a/dlls/wined3d/device.c
+++ b/dlls/wined3d/device.c
@@ -4903,7 +4903,7 @@ HRESULT CDECL wined3d_device_reset(struct wined3d_device *device,
@@ -4779,7 +4779,7 @@ HRESULT CDECL wined3d_device_reset(struct wined3d_device *device,
{
if (reset_state)
hr = wined3d_device_create_primary_opengl_context(device);
@ -81,17 +81,17 @@ index acc1916747..ef136e813f 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 6863825f45..f377367b6f 100644
index b30d10f3f1..c3cfa428e0 100644
--- a/dlls/wined3d/wined3d_private.h
+++ b/dlls/wined3d/wined3d_private.h
@@ -3305,6 +3305,7 @@ void wined3d_cs_emit_unload_resource(struct wined3d_cs *cs, struct wined3d_resou
@@ -3322,6 +3322,7 @@ void wined3d_cs_emit_unload_resource(struct wined3d_cs *cs, struct wined3d_resou
void wined3d_cs_emit_update_sub_resource(struct wined3d_cs *cs, struct wined3d_resource *resource,
unsigned int sub_resource_idx, const struct wined3d_box *box, const void *data, unsigned int row_pitch,
unsigned int slice_pitch) DECLSPEC_HIDDEN;
+void wined3d_cs_emit_update_swap_interval(struct wined3d_cs *cs, struct wined3d_swapchain *swapchain) DECLSPEC_HIDDEN;
void wined3d_cs_emit_update_texture(struct wined3d_cs *cs, struct wined3d_texture *src,
struct wined3d_texture *dst) DECLSPEC_HIDDEN;
void wined3d_cs_init_object(struct wined3d_cs *cs,
void (*callback)(void *object), void *object) DECLSPEC_HIDDEN;
HRESULT wined3d_cs_map(struct wined3d_cs *cs, struct wined3d_resource *resource, unsigned int sub_resource_idx,
--
2.11.0

View File

@ -1,28 +1,28 @@
From 9fcf11a9d8a434369e31ab08c7f6b80f47b5203a Mon Sep 17 00:00:00 2001
From 6255aef81f1fb5a7acbae1f69840c26dcd85b44b 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
in wined3d_texture_add_dirty_region.
---
dlls/wined3d/cs.c | 48 ++++++++++++++++++++++++++++++++++++++++++
dlls/wined3d/texture.c | 15 +------------
dlls/wined3d/cs.c | 53 ++++++++++++++++++++++++++++++++++++++++++
dlls/wined3d/texture.c | 20 ++--------------
dlls/wined3d/wined3d_private.h | 2 ++
3 files changed, 51 insertions(+), 14 deletions(-)
3 files changed, 57 insertions(+), 18 deletions(-)
diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c
index cfcbbfbacc..e380f9edcb 100644
index 65c02e4d21..2ba1e74606 100644
--- a/dlls/wined3d/cs.c
+++ b/dlls/wined3d/cs.c
@@ -71,6 +71,7 @@ enum wined3d_cs_op
@@ -70,6 +70,7 @@ enum wined3d_cs_op
WINED3D_CS_OP_UPDATE_SUB_RESOURCE,
WINED3D_CS_OP_PUSH_CONSTANTS,
WINED3D_CS_OP_UPDATE_TEXTURE,
WINED3D_CS_OP_UPDATE_SWAP_INTERVAL,
+ WINED3D_CS_OP_TEXTURE_ADD_DIRTY_REGION,
};
struct wined3d_cs_sync
@@ -417,6 +418,13 @@ struct wined3d_cs_update_swap_interval
@@ -410,6 +411,13 @@ struct wined3d_cs_update_swap_interval
struct wined3d_swapchain *swapchain;
};
@ -36,27 +36,32 @@ index cfcbbfbacc..e380f9edcb 100644
static void wined3d_cs_exec_sync(struct wined3d_cs *cs, const void *data)
{
}
@@ -2093,6 +2101,45 @@ void wined3d_cs_emit_update_swap_interval(struct wined3d_cs *cs, struct wined3d_
@@ -2136,6 +2144,50 @@ void wined3d_cs_emit_update_swap_interval(struct wined3d_cs *cs, struct wined3d_
cs->ops->submit_and_wait(cs);
}
+static void wined3d_cs_exec_texture_add_dirty_region(struct wined3d_cs *cs, const void *data)
+{
+ const struct wined3d_cs_texture_add_dirty_region *op = data;
+ unsigned int i, sub_resource_idx = op->sub_resource_idx;
+ struct wined3d_texture *texture = op->texture;
+ struct wined3d_context *context;
+
+ context = context_acquire(cs->device, NULL, 0);
+ if (!wined3d_texture_load_location(texture, op->sub_resource_idx, context, texture->resource.map_binding))
+ {
+ ERR("Failed to load location %s.\n", wined3d_debug_location(texture->resource.map_binding));
+ }
+ else
+ {
+ wined3d_texture_invalidate_location(texture, op->sub_resource_idx, ~texture->resource.map_binding);
+ }
+ context_release(context);
+ context = context_acquire(texture->resource.device, NULL, 0);
+
+ for (i = 0; i < texture->level_count; ++i, ++sub_resource_idx)
+ {
+ if (!wined3d_texture_load_location(texture, sub_resource_idx, context, texture->resource.map_binding))
+ {
+ ERR("Failed to load location %s.\n", wined3d_debug_location(texture->resource.map_binding));
+ context_release(context);
+ goto error;
+ }
+ wined3d_texture_invalidate_location(texture, sub_resource_idx, ~texture->resource.map_binding);
+ }
+
+error:
+ context_release(context);
+ wined3d_resource_release(&texture->resource);
+}
+
@ -82,52 +87,59 @@ index cfcbbfbacc..e380f9edcb 100644
static void (* const wined3d_cs_op_handlers[])(struct wined3d_cs *cs, const void *data) =
{
/* WINED3D_CS_OP_SYNC */ wined3d_cs_exec_sync,
@@ -2140,6 +2187,7 @@ static void (* const wined3d_cs_op_handlers[])(struct wined3d_cs *cs, const void
@@ -2182,6 +2234,7 @@ static void (* const wined3d_cs_op_handlers[])(struct wined3d_cs *cs, const void
/* WINED3D_CS_OP_UPDATE_SUB_RESOURCE */ wined3d_cs_exec_update_sub_resource,
/* WINED3D_CS_OP_PUSH_CONSTANTS */ wined3d_cs_exec_push_constants,
/* WINED3D_CS_OP_UPDATE_TEXTURE */ wined3d_cs_exec_update_texture,
/* 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 2b249c26c0..700e587f8d 100644
index 8581723a15..700e587f8d 100644
--- a/dlls/wined3d/texture.c
+++ b/dlls/wined3d/texture.c
@@ -1654,7 +1654,6 @@ static struct wined3d_texture_sub_resource *wined3d_texture_get_sub_resource(str
@@ -1654,8 +1654,7 @@ static struct wined3d_texture_sub_resource *wined3d_texture_get_sub_resource(str
HRESULT CDECL wined3d_texture_add_dirty_region(struct wined3d_texture *texture,
UINT layer, const struct wined3d_box *dirty_region)
{
- unsigned int sub_resource_idx, i;
- struct wined3d_context *context;
unsigned int sub_resource_idx;
+ unsigned int sub_resource_idx;
TRACE("texture %p, layer %u, dirty_region %s.\n", texture, layer, debug_box(dirty_region));
@@ -1666,19 +1665,7 @@ HRESULT CDECL wined3d_texture_add_dirty_region(struct wined3d_texture *texture,
}
sub_resource_idx = layer * texture->level_count;
@@ -1664,24 +1663,9 @@ HRESULT CDECL wined3d_texture_add_dirty_region(struct wined3d_texture *texture,
WARN("Invalid layer %u specified.\n", layer);
return WINED3DERR_INVALIDCALL;
}
-
- if (dirty_region)
- WARN("Ignoring dirty_region %s.\n", debug_box(dirty_region));
-
- context = context_acquire(texture->resource.device, NULL, 0);
- if (!wined3d_texture_load_location(texture, sub_resource_idx, context, texture->resource.map_binding))
sub_resource_idx = layer * texture->level_count;
- for (i = 0; i < texture->level_count; ++i, ++sub_resource_idx)
- {
- ERR("Failed to load location %s.\n", wined3d_debug_location(texture->resource.map_binding));
- context_release(context);
- return E_OUTOFMEMORY;
- if (!wined3d_texture_load_location(texture, sub_resource_idx, context, texture->resource.map_binding))
- {
- ERR("Failed to load location %s.\n", wined3d_debug_location(texture->resource.map_binding));
- context_release(context);
- return E_OUTOFMEMORY;
- }
- wined3d_texture_invalidate_location(texture, sub_resource_idx, ~texture->resource.map_binding);
- }
- wined3d_texture_invalidate_location(texture, sub_resource_idx, ~texture->resource.map_binding);
- context_release(context);
-
+ wined3d_cs_emit_texture_add_dirty_region(texture->resource.device->cs, texture, sub_resource_idx, dirty_region);
return WINED3D_OK;
}
diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h
index f377367b6f..21bc1cde7e 100644
index c3cfa428e0..ab73b02b11 100644
--- a/dlls/wined3d/wined3d_private.h
+++ b/dlls/wined3d/wined3d_private.h
@@ -3300,6 +3300,8 @@ void wined3d_cs_emit_set_unordered_access_view(struct wined3d_cs *cs, enum wined
@@ -3317,6 +3317,8 @@ void wined3d_cs_emit_set_unordered_access_view(struct wined3d_cs *cs, enum wined
void wined3d_cs_emit_set_vertex_declaration(struct wined3d_cs *cs,
struct wined3d_vertex_declaration *declaration) DECLSPEC_HIDDEN;
void wined3d_cs_emit_set_viewport(struct wined3d_cs *cs, const struct wined3d_viewport *viewport) DECLSPEC_HIDDEN;

View File

@ -1,4 +1,4 @@
From 5fab8a00429f7e67ac09cd82a6b168c5f0abb590 Mon Sep 17 00:00:00 2001
From 685ac4b76854b8e8960338c81a5f33d7e6d40fb2 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Stefan=20D=C3=B6singer?= <stefan@codeweavers.com>
Date: Fri, 30 Aug 2013 17:00:35 +0200
Subject: wined3d: Wrap GL BOs in a structure
@ -13,10 +13,10 @@ them for DISCARD maps.
4 files changed, 93 insertions(+), 35 deletions(-)
diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c
index bf48c71564..a7dd944dab 100644
index c05c8c51f2..0c81eeaced 100644
--- a/dlls/wined3d/device.c
+++ b/dlls/wined3d/device.c
@@ -5222,3 +5222,56 @@ LRESULT device_process_message(struct wined3d_device *device, HWND window, BOOL
@@ -5092,3 +5092,56 @@ LRESULT device_process_message(struct wined3d_device *device, HWND window, BOOL
else
return CallWindowProcA(proc, window, message, wparam, lparam);
}
@ -74,10 +74,10 @@ index bf48c71564..a7dd944dab 100644
+ wined3d_device_destroy_bo(device, context, bo);
+}
diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c
index cd82d46a00..59c1f55455 100644
index 1eea0e8bb0..f1a089e88f 100644
--- a/dlls/wined3d/surface.c
+++ b/dlls/wined3d/surface.c
@@ -2773,7 +2773,7 @@ static BOOL surface_load_texture(struct wined3d_surface *surface,
@@ -2405,7 +2405,7 @@ static BOOL surface_load_texture(struct wined3d_surface *surface,
/* Don't use PBOs for converted surfaces. During PBO conversion we look at
* WINED3D_TEXTURE_CONVERTED but it isn't set (yet) in all cases it is
* getting called. */
@ -87,10 +87,10 @@ index cd82d46a00..59c1f55455 100644
TRACE("Removing the pbo attached to surface %p.\n", surface);
diff --git a/dlls/wined3d/texture.c b/dlls/wined3d/texture.c
index 05dc506716..5abd80eae1 100644
index 700e587f8d..0bcf64b87a 100644
--- a/dlls/wined3d/texture.c
+++ b/dlls/wined3d/texture.c
@@ -337,7 +337,7 @@ void wined3d_texture_get_memory(struct wined3d_texture *texture, unsigned int su
@@ -333,7 +333,7 @@ void wined3d_texture_get_memory(struct wined3d_texture *texture, unsigned int su
if (locations & WINED3D_LOCATION_BUFFER)
{
data->addr = NULL;
@ -99,7 +99,7 @@ index 05dc506716..5abd80eae1 100644
return;
}
if (locations & WINED3D_LOCATION_USER_MEMORY)
@@ -438,18 +438,17 @@ static HRESULT wined3d_texture_init(struct wined3d_texture *texture, const struc
@@ -434,18 +434,17 @@ static HRESULT wined3d_texture_init(struct wined3d_texture *texture, const struc
/* Context activation is done by the caller. */
static void wined3d_texture_remove_buffer_object(struct wined3d_texture *texture,
@ -125,7 +125,7 @@ index 05dc506716..5abd80eae1 100644
}
static void wined3d_texture_update_map_binding(struct wined3d_texture *texture)
@@ -469,7 +468,7 @@ static void wined3d_texture_update_map_binding(struct wined3d_texture *texture)
@@ -465,7 +464,7 @@ static void wined3d_texture_update_map_binding(struct wined3d_texture *texture)
&& !wined3d_texture_load_location(texture, i, context, map_binding))
ERR("Failed to load location %s.\n", wined3d_debug_location(map_binding));
if (texture->resource.map_binding == WINED3D_LOCATION_BUFFER)
@ -134,7 +134,7 @@ index 05dc506716..5abd80eae1 100644
}
if (context)
@@ -626,28 +625,25 @@ static void wined3d_texture_cleanup(struct wined3d_texture *texture)
@@ -622,28 +621,25 @@ static void wined3d_texture_cleanup(struct wined3d_texture *texture)
unsigned int sub_count = texture->level_count * texture->layer_count;
struct wined3d_device *device = texture->resource.device;
struct wined3d_context *context = NULL;
@ -168,7 +168,7 @@ index 05dc506716..5abd80eae1 100644
}
if (context)
context_release(context);
@@ -1351,22 +1347,19 @@ HRESULT CDECL wined3d_texture_update_desc(struct wined3d_texture *texture, UINT
@@ -1458,22 +1454,19 @@ HRESULT CDECL wined3d_texture_update_desc(struct wined3d_texture *texture, UINT
/* Context activation is done by the caller. */
static void wined3d_texture_prepare_buffer_object(struct wined3d_texture *texture,
@ -196,7 +196,7 @@ index 05dc506716..5abd80eae1 100644
}
static void wined3d_texture_force_reload(struct wined3d_texture *texture)
@@ -1492,7 +1485,7 @@ BOOL wined3d_texture_prepare_location(struct wined3d_texture *texture, unsigned
@@ -1599,7 +1592,7 @@ BOOL wined3d_texture_prepare_location(struct wined3d_texture *texture, unsigned
return TRUE;
case WINED3D_LOCATION_BUFFER:
@ -205,7 +205,7 @@ index 05dc506716..5abd80eae1 100644
return TRUE;
case WINED3D_LOCATION_TEXTURE_RGB:
@@ -1792,7 +1785,7 @@ static BOOL texture1d_load_location(struct wined3d_texture *texture, unsigned in
@@ -1899,7 +1892,7 @@ static BOOL texture1d_load_location(struct wined3d_texture *texture, unsigned in
}
else if (sub_resource->locations & WINED3D_LOCATION_BUFFER)
{
@ -214,7 +214,7 @@ index 05dc506716..5abd80eae1 100644
wined3d_texture_bind_and_dirtify(texture, context, location == WINED3D_LOCATION_TEXTURE_SRGB);
wined3d_texture_get_pitch(texture, sub_resource_idx, &row_pitch, &slice_pitch);
texture1d_upload_data(texture, sub_resource_idx, context, NULL, &data, row_pitch, slice_pitch);
@@ -1837,7 +1830,7 @@ static BOOL texture1d_load_location(struct wined3d_texture *texture, unsigned in
@@ -1944,7 +1937,7 @@ static BOOL texture1d_load_location(struct wined3d_texture *texture, unsigned in
case WINED3D_LOCATION_BUFFER:
if (sub_resource->locations & (WINED3D_LOCATION_TEXTURE_RGB | WINED3D_LOCATION_TEXTURE_SRGB))
{
@ -223,7 +223,7 @@ index 05dc506716..5abd80eae1 100644
if (sub_resource->locations & WINED3D_LOCATION_TEXTURE_RGB)
wined3d_texture_bind_and_dirtify(texture, context, FALSE);
@@ -2131,8 +2124,8 @@ static void wined3d_texture_unload(struct wined3d_resource *resource)
@@ -2238,8 +2231,8 @@ static void wined3d_texture_unload(struct wined3d_resource *resource)
wined3d_texture_invalidate_location(texture, i, ~WINED3D_LOCATION_DISCARDED);
}
@ -234,7 +234,7 @@ index 05dc506716..5abd80eae1 100644
if (resource->type == WINED3D_RTYPE_TEXTURE_2D)
{
@@ -2917,7 +2910,7 @@ static BOOL texture3d_load_location(struct wined3d_texture *texture, unsigned in
@@ -3024,7 +3017,7 @@ static BOOL texture3d_load_location(struct wined3d_texture *texture, unsigned in
}
else if (sub_resource->locations & WINED3D_LOCATION_BUFFER)
{
@ -243,7 +243,7 @@ index 05dc506716..5abd80eae1 100644
wined3d_texture_bind_and_dirtify(texture, context,
location == WINED3D_LOCATION_TEXTURE_SRGB);
wined3d_texture_get_pitch(texture, sub_resource_idx, &row_pitch, &slice_pitch);
@@ -2963,7 +2956,7 @@ static BOOL texture3d_load_location(struct wined3d_texture *texture, unsigned in
@@ -3070,7 +3063,7 @@ static BOOL texture3d_load_location(struct wined3d_texture *texture, unsigned in
case WINED3D_LOCATION_BUFFER:
if (sub_resource->locations & (WINED3D_LOCATION_TEXTURE_RGB | WINED3D_LOCATION_TEXTURE_SRGB))
{
@ -253,10 +253,10 @@ index 05dc506716..5abd80eae1 100644
if (sub_resource->locations & WINED3D_LOCATION_TEXTURE_RGB)
wined3d_texture_bind_and_dirtify(texture, context, FALSE);
diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h
index 91e0bfb313..6114e5b88a 100644
index ab73b02b11..11831b3d1f 100644
--- a/dlls/wined3d/wined3d_private.h
+++ b/dlls/wined3d/wined3d_private.h
@@ -2606,6 +2606,14 @@ struct wined3d_state
@@ -2624,6 +2624,14 @@ struct wined3d_state
struct wined3d_rasterizer_state *rasterizer_state;
};
@ -271,10 +271,10 @@ index 91e0bfb313..6114e5b88a 100644
#define WINED3D_UNMAPPED_STAGE ~0u
/* Multithreaded flag. Removed from the public header to signal that
@@ -2720,6 +2728,10 @@ void device_resource_released(struct wined3d_device *device, struct wined3d_reso
@@ -2735,6 +2743,10 @@ 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;
void device_exec_update_texture(struct wined3d_context *context, struct wined3d_texture *src_texture,
struct wined3d_texture *dst_texture) DECLSPEC_HIDDEN;
+struct wined3d_gl_bo *wined3d_device_get_bo(struct wined3d_device *device, UINT size, GLenum gl_usage,
+ GLenum type_hint, struct wined3d_context *context) DECLSPEC_HIDDEN;
+void wined3d_device_release_bo(struct wined3d_device *device, struct wined3d_gl_bo *bo,
@ -282,7 +282,7 @@ index 91e0bfb313..6114e5b88a 100644
static inline BOOL isStateDirty(const struct wined3d_context *context, DWORD state)
{
@@ -2910,7 +2922,7 @@ struct wined3d_texture
@@ -2926,7 +2938,7 @@ struct wined3d_texture
unsigned int map_count;
DWORD locations;

View File

@ -1,21 +1,21 @@
From 6b760fb77f50a2f5632656c048f4fb3c2f015cf7 Mon Sep 17 00:00:00 2001
From 60156f6e4f2b3bb35af27b2dc33a640c1c04e80f 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 | 441 +++++++++++++++++++++++++++++++++++------
dlls/wined3d/cs.c | 437 +++++++++++++++++++++++++++++++++++------
dlls/wined3d/device.c | 2 +-
dlls/wined3d/wined3d_main.c | 10 +
dlls/wined3d/wined3d_private.h | 33 ++-
5 files changed, 426 insertions(+), 63 deletions(-)
dlls/wined3d/wined3d_private.h | 33 +++-
5 files changed, 423 insertions(+), 62 deletions(-)
diff --git a/dlls/wined3d/context.c b/dlls/wined3d/context.c
index 6b05c0a71c..cbf63fdac7 100644
index 598622d3e7..41a332f19a 100644
--- a/dlls/wined3d/context.c
+++ b/dlls/wined3d/context.c
@@ -3841,6 +3841,9 @@ struct wined3d_context *context_acquire(const struct wined3d_device *device,
@@ -3860,6 +3860,9 @@ struct wined3d_context *context_acquire(const struct wined3d_device *device,
TRACE("device %p, texture %p, sub_resource_idx %u.\n", device, texture, sub_resource_idx);
@ -26,7 +26,7 @@ index 6b05c0a71c..cbf63fdac7 100644
current_context = NULL;
diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c
index db84f087dd..cdf71e7c3c 100644
index 2ba1e74606..8662a142ff 100644
--- a/dlls/wined3d/cs.c
+++ b/dlls/wined3d/cs.c
@@ -18,6 +18,7 @@
@ -37,15 +37,15 @@ index db84f087dd..cdf71e7c3c 100644
#include "wined3d_private.h"
WINE_DEFAULT_DEBUG_CHANNEL(d3d);
@@ -72,6 +73,7 @@ enum wined3d_cs_op
WINED3D_CS_OP_UPDATE_TEXTURE,
@@ -71,6 +72,7 @@ enum wined3d_cs_op
WINED3D_CS_OP_PUSH_CONSTANTS,
WINED3D_CS_OP_UPDATE_SWAP_INTERVAL,
WINED3D_CS_OP_TEXTURE_ADD_DIRTY_REGION,
+ WINED3D_CS_OP_STOP,
};
struct wined3d_cs_sync
@@ -97,6 +99,7 @@ struct wined3d_cs_present
@@ -96,6 +98,7 @@ struct wined3d_cs_present
struct wined3d_cs_clear
{
enum wined3d_cs_op opcode;
@ -53,7 +53,7 @@ index db84f087dd..cdf71e7c3c 100644
DWORD flags;
unsigned int rt_count;
struct wined3d_fb_state *fb;
@@ -425,8 +428,14 @@ struct wined3d_cs_texture_add_dirty_region
@@ -418,8 +421,14 @@ struct wined3d_cs_texture_add_dirty_region
unsigned int sub_resource_idx;
};
@ -69,7 +69,7 @@ index db84f087dd..cdf71e7c3c 100644
}
void wined3d_cs_emit_sync(struct wined3d_cs *cs)
@@ -439,12 +448,14 @@ void wined3d_cs_emit_sync(struct wined3d_cs *cs)
@@ -432,12 +441,14 @@ void wined3d_cs_emit_sync(struct wined3d_cs *cs)
cs->ops->submit_and_wait(cs);
}
@ -85,7 +85,7 @@ index db84f087dd..cdf71e7c3c 100644
}
void wined3d_cs_emit_glfinish(struct wined3d_cs *cs)
@@ -457,7 +468,7 @@ void wined3d_cs_emit_glfinish(struct wined3d_cs *cs)
@@ -450,7 +461,7 @@ void wined3d_cs_emit_glfinish(struct wined3d_cs *cs)
cs->ops->submit_and_wait(cs);
}
@ -94,7 +94,7 @@ index db84f087dd..cdf71e7c3c 100644
{
const struct wined3d_cs_present *op = data;
struct wined3d_swapchain *swapchain;
@@ -475,6 +486,8 @@ static void wined3d_cs_exec_present(struct wined3d_cs *cs, const void *data)
@@ -468,6 +479,8 @@ static void wined3d_cs_exec_present(struct wined3d_cs *cs, const void *data)
{
wined3d_resource_release(&swapchain->back_buffers[i]->resource);
}
@ -103,7 +103,7 @@ index db84f087dd..cdf71e7c3c 100644
}
void wined3d_cs_emit_present(struct wined3d_cs *cs, struct wined3d_swapchain *swapchain,
@@ -514,7 +527,7 @@ void wined3d_cs_emit_present(struct wined3d_cs *cs, struct wined3d_swapchain *sw
@@ -507,7 +520,7 @@ void wined3d_cs_emit_present(struct wined3d_cs *cs, struct wined3d_swapchain *sw
pending = InterlockedCompareExchange(&cs->pending_presents, 0, 0);
}
@ -112,7 +112,7 @@ index db84f087dd..cdf71e7c3c 100644
{
const struct wined3d_state *state = &cs->state;
const struct wined3d_cs_clear *op = data;
@@ -537,6 +550,8 @@ static void wined3d_cs_exec_clear(struct wined3d_cs *cs, const void *data)
@@ -530,6 +543,8 @@ static void wined3d_cs_exec_clear(struct wined3d_cs *cs, const void *data)
}
if (op->flags & (WINED3DCLEAR_ZBUFFER | WINED3DCLEAR_STENCIL))
wined3d_resource_release(op->fb->depth_stencil->resource);
@ -121,7 +121,7 @@ index db84f087dd..cdf71e7c3c 100644
}
void wined3d_cs_emit_clear(struct wined3d_cs *cs, DWORD rect_count, const RECT *rects,
@@ -545,10 +560,12 @@ void wined3d_cs_emit_clear(struct wined3d_cs *cs, DWORD rect_count, const RECT *
@@ -538,10 +553,12 @@ void wined3d_cs_emit_clear(struct wined3d_cs *cs, DWORD rect_count, const RECT *
unsigned int rt_count = cs->device->adapter->gl_info.limits.buffers;
const struct wined3d_state *state = &cs->device->state;
struct wined3d_cs_clear *op;
@ -135,7 +135,7 @@ index db84f087dd..cdf71e7c3c 100644
op->flags = flags;
op->rt_count = rt_count;
op->fb = &cs->fb;
@@ -582,13 +599,15 @@ void wined3d_cs_emit_clear_rendertarget_view(struct wined3d_cs *cs, struct wined
@@ -575,13 +592,15 @@ void wined3d_cs_emit_clear_rendertarget_view(struct wined3d_cs *cs, struct wined
struct wined3d_rendertarget_view *rt;
struct wined3d_fb_state fb;
} *extra;
@ -152,7 +152,7 @@ index db84f087dd..cdf71e7c3c 100644
op->flags = flags;
if (flags & WINED3DCLEAR_TARGET)
{
@@ -720,7 +739,7 @@ static void release_unordered_access_resources(const struct wined3d_shader *shad
@@ -713,7 +732,7 @@ static void release_unordered_access_resources(const struct wined3d_shader *shad
}
}
@ -161,7 +161,7 @@ index db84f087dd..cdf71e7c3c 100644
{
const struct wined3d_cs_dispatch *op = data;
struct wined3d_state *state = &cs->state;
@@ -731,6 +750,8 @@ static void wined3d_cs_exec_dispatch(struct wined3d_cs *cs, const void *data)
@@ -724,6 +743,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]);
@ -170,7 +170,7 @@ index db84f087dd..cdf71e7c3c 100644
}
void wined3d_cs_emit_dispatch(struct wined3d_cs *cs,
@@ -752,7 +773,7 @@ void wined3d_cs_emit_dispatch(struct wined3d_cs *cs,
@@ -745,7 +766,7 @@ void wined3d_cs_emit_dispatch(struct wined3d_cs *cs,
cs->ops->submit(cs);
}
@ -179,7 +179,7 @@ index db84f087dd..cdf71e7c3c 100644
{
struct wined3d_state *state = &cs->state;
const struct wined3d_cs_draw *op = data;
@@ -802,6 +823,8 @@ static void wined3d_cs_exec_draw(struct wined3d_cs *cs, const void *data)
@@ -795,6 +816,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]);
@ -188,7 +188,7 @@ index db84f087dd..cdf71e7c3c 100644
}
void wined3d_cs_emit_draw(struct wined3d_cs *cs, GLenum primitive_type, int base_vertex_idx, unsigned int start_idx,
@@ -852,12 +875,14 @@ void wined3d_cs_emit_draw(struct wined3d_cs *cs, GLenum primitive_type, int base
@@ -845,12 +868,14 @@ void wined3d_cs_emit_draw(struct wined3d_cs *cs, GLenum primitive_type, int base
cs->ops->submit(cs);
}
@ -204,7 +204,7 @@ index db84f087dd..cdf71e7c3c 100644
}
void wined3d_cs_emit_set_predication(struct wined3d_cs *cs, struct wined3d_query *predicate, BOOL value)
@@ -872,12 +897,14 @@ void wined3d_cs_emit_set_predication(struct wined3d_cs *cs, struct wined3d_query
@@ -865,12 +890,14 @@ void wined3d_cs_emit_set_predication(struct wined3d_cs *cs, struct wined3d_query
cs->ops->submit(cs);
}
@ -220,7 +220,7 @@ index db84f087dd..cdf71e7c3c 100644
}
void wined3d_cs_emit_set_viewport(struct wined3d_cs *cs, const struct wined3d_viewport *viewport)
@@ -891,12 +918,14 @@ void wined3d_cs_emit_set_viewport(struct wined3d_cs *cs, const struct wined3d_vi
@@ -884,12 +911,14 @@ void wined3d_cs_emit_set_viewport(struct wined3d_cs *cs, const struct wined3d_vi
cs->ops->submit(cs);
}
@ -236,7 +236,7 @@ index db84f087dd..cdf71e7c3c 100644
}
void wined3d_cs_emit_set_scissor_rect(struct wined3d_cs *cs, const RECT *rect)
@@ -910,12 +939,14 @@ void wined3d_cs_emit_set_scissor_rect(struct wined3d_cs *cs, const RECT *rect)
@@ -903,12 +932,14 @@ void wined3d_cs_emit_set_scissor_rect(struct wined3d_cs *cs, const RECT *rect)
cs->ops->submit(cs);
}
@ -252,7 +252,7 @@ index db84f087dd..cdf71e7c3c 100644
}
void wined3d_cs_emit_set_rendertarget_view(struct wined3d_cs *cs, unsigned int view_idx,
@@ -931,7 +962,7 @@ void wined3d_cs_emit_set_rendertarget_view(struct wined3d_cs *cs, unsigned int v
@@ -924,7 +955,7 @@ void wined3d_cs_emit_set_rendertarget_view(struct wined3d_cs *cs, unsigned int v
cs->ops->submit(cs);
}
@ -261,7 +261,7 @@ index db84f087dd..cdf71e7c3c 100644
{
const struct wined3d_cs_set_depth_stencil_view *op = data;
struct wined3d_device *device = cs->device;
@@ -966,6 +997,8 @@ static void wined3d_cs_exec_set_depth_stencil_view(struct wined3d_cs *cs, const
@@ -959,6 +990,8 @@ static void wined3d_cs_exec_set_depth_stencil_view(struct wined3d_cs *cs, const
}
device_invalidate_state(device, STATE_FRAMEBUFFER);
@ -270,7 +270,7 @@ index db84f087dd..cdf71e7c3c 100644
}
void wined3d_cs_emit_set_depth_stencil_view(struct wined3d_cs *cs, struct wined3d_rendertarget_view *view)
@@ -979,12 +1012,14 @@ void wined3d_cs_emit_set_depth_stencil_view(struct wined3d_cs *cs, struct wined3
@@ -972,12 +1005,14 @@ void wined3d_cs_emit_set_depth_stencil_view(struct wined3d_cs *cs, struct wined3
cs->ops->submit(cs);
}
@ -286,7 +286,7 @@ index db84f087dd..cdf71e7c3c 100644
}
void wined3d_cs_emit_set_vertex_declaration(struct wined3d_cs *cs, struct wined3d_vertex_declaration *declaration)
@@ -998,7 +1033,7 @@ void wined3d_cs_emit_set_vertex_declaration(struct wined3d_cs *cs, struct wined3
@@ -991,7 +1026,7 @@ void wined3d_cs_emit_set_vertex_declaration(struct wined3d_cs *cs, struct wined3
cs->ops->submit(cs);
}
@ -295,7 +295,7 @@ index db84f087dd..cdf71e7c3c 100644
{
const struct wined3d_cs_set_stream_source *op = data;
struct wined3d_stream_state *stream;
@@ -1016,6 +1051,8 @@ static void wined3d_cs_exec_set_stream_source(struct wined3d_cs *cs, const void
@@ -1009,6 +1044,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);
@ -304,7 +304,7 @@ index db84f087dd..cdf71e7c3c 100644
}
void wined3d_cs_emit_set_stream_source(struct wined3d_cs *cs, UINT stream_idx,
@@ -1033,7 +1070,7 @@ void wined3d_cs_emit_set_stream_source(struct wined3d_cs *cs, UINT stream_idx,
@@ -1026,7 +1063,7 @@ void wined3d_cs_emit_set_stream_source(struct wined3d_cs *cs, UINT stream_idx,
cs->ops->submit(cs);
}
@ -313,7 +313,7 @@ index db84f087dd..cdf71e7c3c 100644
{
const struct wined3d_cs_set_stream_source_freq *op = data;
struct wined3d_stream_state *stream;
@@ -1043,6 +1080,8 @@ static void wined3d_cs_exec_set_stream_source_freq(struct wined3d_cs *cs, const
@@ -1036,6 +1073,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);
@ -322,7 +322,7 @@ index db84f087dd..cdf71e7c3c 100644
}
void wined3d_cs_emit_set_stream_source_freq(struct wined3d_cs *cs, UINT stream_idx, UINT frequency, UINT flags)
@@ -1058,7 +1097,7 @@ void wined3d_cs_emit_set_stream_source_freq(struct wined3d_cs *cs, UINT stream_i
@@ -1051,7 +1090,7 @@ void wined3d_cs_emit_set_stream_source_freq(struct wined3d_cs *cs, UINT stream_i
cs->ops->submit(cs);
}
@ -331,7 +331,7 @@ index db84f087dd..cdf71e7c3c 100644
{
const struct wined3d_cs_set_stream_output *op = data;
struct wined3d_stream_output *stream;
@@ -1075,6 +1114,8 @@ static void wined3d_cs_exec_set_stream_output(struct wined3d_cs *cs, const void
@@ -1068,6 +1107,8 @@ static void wined3d_cs_exec_set_stream_output(struct wined3d_cs *cs, const void
InterlockedDecrement(&prev->resource.bind_count);
device_invalidate_state(cs->device, STATE_STREAM_OUTPUT);
@ -340,7 +340,7 @@ index db84f087dd..cdf71e7c3c 100644
}
void wined3d_cs_emit_set_stream_output(struct wined3d_cs *cs, UINT stream_idx,
@@ -1091,7 +1132,7 @@ void wined3d_cs_emit_set_stream_output(struct wined3d_cs *cs, UINT stream_idx,
@@ -1084,7 +1125,7 @@ void wined3d_cs_emit_set_stream_output(struct wined3d_cs *cs, UINT stream_idx,
cs->ops->submit(cs);
}
@ -349,7 +349,7 @@ index db84f087dd..cdf71e7c3c 100644
{
const struct wined3d_cs_set_index_buffer *op = data;
struct wined3d_buffer *prev;
@@ -1107,6 +1148,8 @@ static void wined3d_cs_exec_set_index_buffer(struct wined3d_cs *cs, const void *
@@ -1100,6 +1141,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);
@ -358,7 +358,7 @@ index db84f087dd..cdf71e7c3c 100644
}
void wined3d_cs_emit_set_index_buffer(struct wined3d_cs *cs, struct wined3d_buffer *buffer,
@@ -1123,7 +1166,7 @@ void wined3d_cs_emit_set_index_buffer(struct wined3d_cs *cs, struct wined3d_buff
@@ -1116,7 +1159,7 @@ void wined3d_cs_emit_set_index_buffer(struct wined3d_cs *cs, struct wined3d_buff
cs->ops->submit(cs);
}
@ -367,7 +367,7 @@ index db84f087dd..cdf71e7c3c 100644
{
const struct wined3d_cs_set_constant_buffer *op = data;
struct wined3d_buffer *prev;
@@ -1137,6 +1180,7 @@ static void wined3d_cs_exec_set_constant_buffer(struct wined3d_cs *cs, const voi
@@ -1130,6 +1173,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));
@ -375,7 +375,7 @@ index db84f087dd..cdf71e7c3c 100644
}
void wined3d_cs_emit_set_constant_buffer(struct wined3d_cs *cs, enum wined3d_shader_type type,
@@ -1153,7 +1197,7 @@ void wined3d_cs_emit_set_constant_buffer(struct wined3d_cs *cs, enum wined3d_sha
@@ -1146,7 +1190,7 @@ void wined3d_cs_emit_set_constant_buffer(struct wined3d_cs *cs, enum wined3d_sha
cs->ops->submit(cs);
}
@ -384,7 +384,7 @@ index db84f087dd..cdf71e7c3c 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;
@@ -1230,6 +1274,8 @@ static void wined3d_cs_exec_set_texture(struct wined3d_cs *cs, const void *data)
@@ -1223,6 +1267,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);
@ -393,7 +393,7 @@ index db84f087dd..cdf71e7c3c 100644
}
void wined3d_cs_emit_set_texture(struct wined3d_cs *cs, UINT stage, struct wined3d_texture *texture)
@@ -1244,7 +1290,7 @@ void wined3d_cs_emit_set_texture(struct wined3d_cs *cs, UINT stage, struct wined
@@ -1237,7 +1283,7 @@ void wined3d_cs_emit_set_texture(struct wined3d_cs *cs, UINT stage, struct wined
cs->ops->submit(cs);
}
@ -402,7 +402,7 @@ index db84f087dd..cdf71e7c3c 100644
{
const struct wined3d_cs_set_shader_resource_view *op = data;
struct wined3d_shader_resource_view *prev;
@@ -1261,6 +1307,8 @@ static void wined3d_cs_exec_set_shader_resource_view(struct wined3d_cs *cs, cons
@@ -1254,6 +1300,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);
@ -411,7 +411,7 @@ index db84f087dd..cdf71e7c3c 100644
}
void wined3d_cs_emit_set_shader_resource_view(struct wined3d_cs *cs, enum wined3d_shader_type type,
@@ -1277,7 +1325,7 @@ void wined3d_cs_emit_set_shader_resource_view(struct wined3d_cs *cs, enum wined3
@@ -1270,7 +1318,7 @@ void wined3d_cs_emit_set_shader_resource_view(struct wined3d_cs *cs, enum wined3
cs->ops->submit(cs);
}
@ -420,7 +420,7 @@ index db84f087dd..cdf71e7c3c 100644
{
const struct wined3d_cs_set_unordered_access_view *op = data;
struct wined3d_unordered_access_view *prev;
@@ -1291,6 +1339,8 @@ static void wined3d_cs_exec_set_unordered_access_view(struct wined3d_cs *cs, con
@@ -1284,6 +1332,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));
@ -429,7 +429,7 @@ index db84f087dd..cdf71e7c3c 100644
}
void wined3d_cs_emit_set_unordered_access_view(struct wined3d_cs *cs, enum wined3d_pipeline pipeline,
@@ -1307,7 +1357,7 @@ void wined3d_cs_emit_set_unordered_access_view(struct wined3d_cs *cs, enum wined
@@ -1300,7 +1350,7 @@ void wined3d_cs_emit_set_unordered_access_view(struct wined3d_cs *cs, enum wined
cs->ops->submit(cs);
}
@ -438,7 +438,7 @@ index db84f087dd..cdf71e7c3c 100644
{
const struct wined3d_cs_set_sampler *op = data;
@@ -1316,6 +1366,8 @@ static void wined3d_cs_exec_set_sampler(struct wined3d_cs *cs, const void *data)
@@ -1309,6 +1359,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);
@ -447,7 +447,7 @@ index db84f087dd..cdf71e7c3c 100644
}
void wined3d_cs_emit_set_sampler(struct wined3d_cs *cs, enum wined3d_shader_type type,
@@ -1332,7 +1384,7 @@ void wined3d_cs_emit_set_sampler(struct wined3d_cs *cs, enum wined3d_shader_type
@@ -1325,7 +1377,7 @@ void wined3d_cs_emit_set_sampler(struct wined3d_cs *cs, enum wined3d_shader_type
cs->ops->submit(cs);
}
@ -456,7 +456,7 @@ index db84f087dd..cdf71e7c3c 100644
{
const struct wined3d_cs_set_shader *op = data;
@@ -1342,6 +1394,8 @@ static void wined3d_cs_exec_set_shader(struct wined3d_cs *cs, const void *data)
@@ -1335,6 +1387,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);
@ -465,7 +465,7 @@ index db84f087dd..cdf71e7c3c 100644
}
void wined3d_cs_emit_set_shader(struct wined3d_cs *cs, enum wined3d_shader_type type, struct wined3d_shader *shader)
@@ -1356,12 +1410,14 @@ void wined3d_cs_emit_set_shader(struct wined3d_cs *cs, enum wined3d_shader_type
@@ -1349,12 +1403,14 @@ void wined3d_cs_emit_set_shader(struct wined3d_cs *cs, enum wined3d_shader_type
cs->ops->submit(cs);
}
@ -481,7 +481,7 @@ index db84f087dd..cdf71e7c3c 100644
}
void wined3d_cs_emit_set_rasterizer_state(struct wined3d_cs *cs,
@@ -1376,12 +1432,14 @@ void wined3d_cs_emit_set_rasterizer_state(struct wined3d_cs *cs,
@@ -1369,12 +1425,14 @@ void wined3d_cs_emit_set_rasterizer_state(struct wined3d_cs *cs,
cs->ops->submit(cs);
}
@ -497,7 +497,7 @@ index db84f087dd..cdf71e7c3c 100644
}
void wined3d_cs_emit_set_render_state(struct wined3d_cs *cs, enum wined3d_render_state state, DWORD value)
@@ -1396,12 +1454,14 @@ void wined3d_cs_emit_set_render_state(struct wined3d_cs *cs, enum wined3d_render
@@ -1389,12 +1447,14 @@ void wined3d_cs_emit_set_render_state(struct wined3d_cs *cs, enum wined3d_render
cs->ops->submit(cs);
}
@ -513,7 +513,7 @@ index db84f087dd..cdf71e7c3c 100644
}
void wined3d_cs_emit_set_texture_state(struct wined3d_cs *cs, UINT stage,
@@ -1418,12 +1478,14 @@ void wined3d_cs_emit_set_texture_state(struct wined3d_cs *cs, UINT stage,
@@ -1411,12 +1471,14 @@ void wined3d_cs_emit_set_texture_state(struct wined3d_cs *cs, UINT stage,
cs->ops->submit(cs);
}
@ -529,7 +529,7 @@ index db84f087dd..cdf71e7c3c 100644
}
void wined3d_cs_emit_set_sampler_state(struct wined3d_cs *cs, UINT sampler_idx,
@@ -1440,13 +1502,15 @@ void wined3d_cs_emit_set_sampler_state(struct wined3d_cs *cs, UINT sampler_idx,
@@ -1433,13 +1495,15 @@ void wined3d_cs_emit_set_sampler_state(struct wined3d_cs *cs, UINT sampler_idx,
cs->ops->submit(cs);
}
@ -546,7 +546,7 @@ index db84f087dd..cdf71e7c3c 100644
}
void wined3d_cs_emit_set_transform(struct wined3d_cs *cs, enum wined3d_transform_state state,
@@ -1462,12 +1526,14 @@ void wined3d_cs_emit_set_transform(struct wined3d_cs *cs, enum wined3d_transform
@@ -1455,12 +1519,14 @@ void wined3d_cs_emit_set_transform(struct wined3d_cs *cs, enum wined3d_transform
cs->ops->submit(cs);
}
@ -562,7 +562,7 @@ index db84f087dd..cdf71e7c3c 100644
}
void wined3d_cs_emit_set_clip_plane(struct wined3d_cs *cs, UINT plane_idx, const struct wined3d_vec4 *plane)
@@ -1482,7 +1548,7 @@ void wined3d_cs_emit_set_clip_plane(struct wined3d_cs *cs, UINT plane_idx, const
@@ -1475,7 +1541,7 @@ void wined3d_cs_emit_set_clip_plane(struct wined3d_cs *cs, UINT plane_idx, const
cs->ops->submit(cs);
}
@ -571,7 +571,7 @@ index db84f087dd..cdf71e7c3c 100644
{
const struct wined3d_cs_set_color_key *op = data;
struct wined3d_texture *texture = op->texture;
@@ -1543,6 +1609,8 @@ static void wined3d_cs_exec_set_color_key(struct wined3d_cs *cs, const void *dat
@@ -1536,6 +1602,8 @@ static void wined3d_cs_exec_set_color_key(struct wined3d_cs *cs, const void *dat
break;
}
}
@ -580,7 +580,7 @@ index db84f087dd..cdf71e7c3c 100644
}
void wined3d_cs_emit_set_color_key(struct wined3d_cs *cs, struct wined3d_texture *texture,
@@ -1565,12 +1633,14 @@ void wined3d_cs_emit_set_color_key(struct wined3d_cs *cs, struct wined3d_texture
@@ -1558,12 +1626,14 @@ void wined3d_cs_emit_set_color_key(struct wined3d_cs *cs, struct wined3d_texture
cs->ops->submit(cs);
}
@ -596,7 +596,7 @@ index db84f087dd..cdf71e7c3c 100644
}
void wined3d_cs_emit_set_material(struct wined3d_cs *cs, const struct wined3d_material *material)
@@ -1584,7 +1654,7 @@ void wined3d_cs_emit_set_material(struct wined3d_cs *cs, const struct wined3d_ma
@@ -1577,7 +1647,7 @@ void wined3d_cs_emit_set_material(struct wined3d_cs *cs, const struct wined3d_ma
cs->ops->submit(cs);
}
@ -605,7 +605,7 @@ index db84f087dd..cdf71e7c3c 100644
{
const struct wined3d_cs_set_light *op = data;
struct wined3d_light_info *light_info;
@@ -1598,7 +1668,7 @@ static void wined3d_cs_exec_set_light(struct wined3d_cs *cs, const void *data)
@@ -1591,7 +1661,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");
@ -614,7 +614,7 @@ index db84f087dd..cdf71e7c3c 100644
}
hash_idx = LIGHTMAP_HASHFUNC(light_idx);
@@ -1619,6 +1689,8 @@ static void wined3d_cs_exec_set_light(struct wined3d_cs *cs, const void *data)
@@ -1612,6 +1682,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;
@ -623,7 +623,7 @@ index db84f087dd..cdf71e7c3c 100644
}
void wined3d_cs_emit_set_light(struct wined3d_cs *cs, const struct wined3d_light_info *light)
@@ -1632,7 +1704,7 @@ void wined3d_cs_emit_set_light(struct wined3d_cs *cs, const struct wined3d_light
@@ -1625,7 +1697,7 @@ void wined3d_cs_emit_set_light(struct wined3d_cs *cs, const struct wined3d_light
cs->ops->submit(cs);
}
@ -632,7 +632,7 @@ index db84f087dd..cdf71e7c3c 100644
{
const struct wined3d_cs_set_light_enable *op = data;
struct wined3d_device *device = cs->device;
@@ -1642,7 +1714,7 @@ static void wined3d_cs_exec_set_light_enable(struct wined3d_cs *cs, const void *
@@ -1635,7 +1707,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");
@ -641,7 +641,7 @@ index db84f087dd..cdf71e7c3c 100644
}
prev_idx = light_info->glIndex;
@@ -1652,6 +1724,8 @@ static void wined3d_cs_exec_set_light_enable(struct wined3d_cs *cs, const void *
@@ -1645,6 +1717,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));
}
@ -650,7 +650,7 @@ index db84f087dd..cdf71e7c3c 100644
}
void wined3d_cs_emit_set_light_enable(struct wined3d_cs *cs, unsigned int idx, BOOL enable)
@@ -1666,7 +1740,7 @@ void wined3d_cs_emit_set_light_enable(struct wined3d_cs *cs, unsigned int idx, B
@@ -1659,7 +1733,7 @@ void wined3d_cs_emit_set_light_enable(struct wined3d_cs *cs, unsigned int idx, B
cs->ops->submit(cs);
}
@ -659,7 +659,7 @@ index db84f087dd..cdf71e7c3c 100644
{
struct wined3d_adapter *adapter = cs->device->adapter;
@@ -1674,6 +1748,8 @@ static void wined3d_cs_exec_reset_state(struct wined3d_cs *cs, const void *data)
@@ -1667,6 +1741,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);
@ -668,7 +668,7 @@ index db84f087dd..cdf71e7c3c 100644
}
void wined3d_cs_emit_reset_state(struct wined3d_cs *cs)
@@ -1686,11 +1762,13 @@ void wined3d_cs_emit_reset_state(struct wined3d_cs *cs)
@@ -1679,11 +1755,13 @@ void wined3d_cs_emit_reset_state(struct wined3d_cs *cs)
cs->ops->submit(cs);
}
@ -683,7 +683,7 @@ index db84f087dd..cdf71e7c3c 100644
}
static void wined3d_cs_emit_callback(struct wined3d_cs *cs, void (*callback)(void *object), void *object)
@@ -1715,12 +1793,14 @@ void wined3d_cs_init_object(struct wined3d_cs *cs, void (*callback)(void *object
@@ -1708,12 +1786,14 @@ void wined3d_cs_init_object(struct wined3d_cs *cs, void (*callback)(void *object
wined3d_cs_emit_callback(cs, callback, object);
}
@ -699,7 +699,7 @@ index db84f087dd..cdf71e7c3c 100644
}
void wined3d_cs_emit_query_issue(struct wined3d_cs *cs, struct wined3d_query *query, DWORD flags)
@@ -1735,12 +1815,14 @@ void wined3d_cs_emit_query_issue(struct wined3d_cs *cs, struct wined3d_query *qu
@@ -1728,12 +1808,14 @@ void wined3d_cs_emit_query_issue(struct wined3d_cs *cs, struct wined3d_query *qu
cs->ops->submit(cs);
}
@ -715,7 +715,7 @@ index db84f087dd..cdf71e7c3c 100644
}
BOOL wined3d_cs_emit_query_poll(struct wined3d_cs *cs, struct wined3d_query *query, DWORD flags)
@@ -1759,13 +1841,15 @@ BOOL wined3d_cs_emit_query_poll(struct wined3d_cs *cs, struct wined3d_query *que
@@ -1752,13 +1834,15 @@ BOOL wined3d_cs_emit_query_poll(struct wined3d_cs *cs, struct wined3d_query *que
return ret;
}
@ -732,7 +732,7 @@ index db84f087dd..cdf71e7c3c 100644
}
void wined3d_cs_emit_preload_resource(struct wined3d_cs *cs, struct wined3d_resource *resource)
@@ -1781,13 +1865,15 @@ void wined3d_cs_emit_preload_resource(struct wined3d_cs *cs, struct wined3d_reso
@@ -1774,13 +1858,15 @@ void wined3d_cs_emit_preload_resource(struct wined3d_cs *cs, struct wined3d_reso
cs->ops->submit(cs);
}
@ -749,7 +749,7 @@ index db84f087dd..cdf71e7c3c 100644
}
void wined3d_cs_emit_unload_resource(struct wined3d_cs *cs, struct wined3d_resource *resource)
@@ -1803,13 +1889,15 @@ void wined3d_cs_emit_unload_resource(struct wined3d_cs *cs, struct wined3d_resou
@@ -1796,13 +1882,15 @@ void wined3d_cs_emit_unload_resource(struct wined3d_cs *cs, struct wined3d_resou
cs->ops->submit(cs);
}
@ -766,7 +766,7 @@ index db84f087dd..cdf71e7c3c 100644
}
HRESULT wined3d_cs_map(struct wined3d_cs *cs, struct wined3d_resource *resource, unsigned int sub_resource_idx,
@@ -1832,12 +1920,14 @@ HRESULT wined3d_cs_map(struct wined3d_cs *cs, struct wined3d_resource *resource,
@@ -1825,12 +1913,14 @@ HRESULT wined3d_cs_map(struct wined3d_cs *cs, struct wined3d_resource *resource,
return hr;
}
@ -782,7 +782,7 @@ index db84f087dd..cdf71e7c3c 100644
}
HRESULT wined3d_cs_unmap(struct wined3d_cs *cs, struct wined3d_resource *resource, unsigned int sub_resource_idx)
@@ -1856,7 +1946,7 @@ HRESULT wined3d_cs_unmap(struct wined3d_cs *cs, struct wined3d_resource *resourc
@@ -1849,7 +1939,7 @@ HRESULT wined3d_cs_unmap(struct wined3d_cs *cs, struct wined3d_resource *resourc
return hr;
}
@ -791,7 +791,7 @@ index db84f087dd..cdf71e7c3c 100644
{
const struct wined3d_cs_blt_sub_resource *op = data;
@@ -1896,14 +1986,14 @@ static void wined3d_cs_exec_blt_sub_resource(struct wined3d_cs *cs, const void *
@@ -1889,14 +1979,14 @@ static void wined3d_cs_exec_blt_sub_resource(struct wined3d_cs *cs, const void *
{
FIXME("Flags %#x not implemented for %s resources.\n",
op->flags, debug_d3dresourcetype(op->dst_resource->type));
@ -808,7 +808,7 @@ index db84f087dd..cdf71e7c3c 100644
}
update_w = op->dst_box.right - op->dst_box.left;
@@ -1915,14 +2005,14 @@ static void wined3d_cs_exec_blt_sub_resource(struct wined3d_cs *cs, const void *
@@ -1908,14 +1998,14 @@ static void wined3d_cs_exec_blt_sub_resource(struct wined3d_cs *cs, const void *
{
FIXME("Stretching not implemented for %s resources.\n",
debug_d3dresourcetype(op->dst_resource->type));
@ -825,7 +825,7 @@ index db84f087dd..cdf71e7c3c 100644
}
dst_texture = texture_from_resource(op->dst_resource);
@@ -1936,7 +2026,7 @@ static void wined3d_cs_exec_blt_sub_resource(struct wined3d_cs *cs, const void *
@@ -1929,7 +2019,7 @@ static void wined3d_cs_exec_blt_sub_resource(struct wined3d_cs *cs, const void *
ERR("Failed to load source sub-resource into %s.\n",
wined3d_debug_location(src_texture->resource.map_binding));
context_release(context);
@ -834,7 +834,7 @@ index db84f087dd..cdf71e7c3c 100644
}
level = op->dst_sub_resource_idx % dst_texture->level_count;
@@ -1951,7 +2041,7 @@ static void wined3d_cs_exec_blt_sub_resource(struct wined3d_cs *cs, const void *
@@ -1944,7 +2034,7 @@ static void wined3d_cs_exec_blt_sub_resource(struct wined3d_cs *cs, const void *
{
ERR("Failed to load destination sub-resource.\n");
context_release(context);
@ -843,7 +843,7 @@ index db84f087dd..cdf71e7c3c 100644
}
wined3d_texture_get_memory(src_texture, op->src_sub_resource_idx, &addr, src_texture->resource.map_binding);
@@ -1971,9 +2061,12 @@ static void wined3d_cs_exec_blt_sub_resource(struct wined3d_cs *cs, const void *
@@ -1964,9 +2054,12 @@ static void wined3d_cs_exec_blt_sub_resource(struct wined3d_cs *cs, const void *
FIXME("Not implemented for %s resources.\n", debug_d3dresourcetype(op->dst_resource->type));
}
@ -856,7 +856,7 @@ index db84f087dd..cdf71e7c3c 100644
}
void wined3d_cs_emit_blt_sub_resource(struct wined3d_cs *cs, struct wined3d_resource *dst_resource,
@@ -2003,7 +2096,7 @@ void wined3d_cs_emit_blt_sub_resource(struct wined3d_cs *cs, struct wined3d_reso
@@ -1996,7 +2089,7 @@ void wined3d_cs_emit_blt_sub_resource(struct wined3d_cs *cs, struct wined3d_reso
cs->ops->submit(cs);
}
@ -865,7 +865,7 @@ index db84f087dd..cdf71e7c3c 100644
{
const struct wined3d_cs_update_sub_resource *op = data;
const struct wined3d_box *box = &op->box;
@@ -2053,6 +2146,7 @@ static void wined3d_cs_exec_update_sub_resource(struct wined3d_cs *cs, const voi
@@ -2046,6 +2139,7 @@ static void wined3d_cs_exec_update_sub_resource(struct wined3d_cs *cs, const voi
done:
wined3d_resource_release(op->resource);
@ -873,7 +873,7 @@ index db84f087dd..cdf71e7c3c 100644
}
void wined3d_cs_emit_update_sub_resource(struct wined3d_cs *cs, struct wined3d_resource *resource,
@@ -2097,10 +2191,11 @@ push_constant_info[] =
@@ -2090,10 +2184,11 @@ push_constant_info[] =
{FIELD_OFFSET(struct wined3d_state, ps_consts_b), sizeof(BOOL), WINED3D_SHADER_CONST_PS_B},
};
@ -886,7 +886,7 @@ index db84f087dd..cdf71e7c3c 100644
unsigned int context_count;
unsigned int i;
size_t offset;
@@ -2116,6 +2211,8 @@ static void wined3d_cs_exec_push_constants(struct wined3d_cs *cs, const void *da
@@ -2109,6 +2204,8 @@ static void wined3d_cs_exec_push_constants(struct wined3d_cs *cs, const void *da
{
device->contexts[i]->constant_update_mask |= push_constant_info[op->p].mask;
}
@ -895,25 +895,7 @@ index db84f087dd..cdf71e7c3c 100644
}
void wined3d_cs_emit_push_constants(struct wined3d_cs *cs, enum wined3d_push_constants p,
@@ -2133,7 +2230,7 @@ void wined3d_cs_emit_push_constants(struct wined3d_cs *cs, enum wined3d_push_con
cs->ops->submit(cs);
}
-static void wined3d_cs_exec_update_texture(struct wined3d_cs *cs, const void *data)
+static UINT wined3d_cs_exec_update_texture(struct wined3d_cs *cs, const void *data)
{
const struct wined3d_cs_update_texture *op = data;
struct wined3d_context *context;
@@ -2144,6 +2241,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);
+
+ return sizeof(*op);
}
void wined3d_cs_emit_update_texture(struct wined3d_cs *cs, struct wined3d_texture *src,
@@ -2162,11 +2261,13 @@ void wined3d_cs_emit_update_texture(struct wined3d_cs *cs, struct wined3d_textur
@@ -2126,11 +2223,13 @@ void wined3d_cs_emit_push_constants(struct wined3d_cs *cs, enum wined3d_push_con
cs->ops->submit(cs);
}
@ -928,7 +910,7 @@ index db84f087dd..cdf71e7c3c 100644
}
void wined3d_cs_emit_update_swap_interval(struct wined3d_cs *cs, struct wined3d_swapchain *swapchain)
@@ -2180,7 +2281,7 @@ void wined3d_cs_emit_update_swap_interval(struct wined3d_cs *cs, struct wined3d_
@@ -2144,7 +2243,7 @@ void wined3d_cs_emit_update_swap_interval(struct wined3d_cs *cs, struct wined3d_
cs->ops->submit_and_wait(cs);
}
@ -936,17 +918,17 @@ index db84f087dd..cdf71e7c3c 100644
+static UINT wined3d_cs_exec_texture_add_dirty_region(struct wined3d_cs *cs, const void *data)
{
const struct wined3d_cs_texture_add_dirty_region *op = data;
struct wined3d_texture *texture = op->texture;
@@ -2198,6 +2299,8 @@ static void wined3d_cs_exec_texture_add_dirty_region(struct wined3d_cs *cs, cons
unsigned int i, sub_resource_idx = op->sub_resource_idx;
@@ -2167,6 +2266,8 @@ static void wined3d_cs_exec_texture_add_dirty_region(struct wined3d_cs *cs, cons
error:
context_release(context);
wined3d_resource_release(&texture->resource);
+
+ return sizeof(*op);
}
void wined3d_cs_emit_texture_add_dirty_region(struct wined3d_cs *cs,
@@ -2219,7 +2322,7 @@ void wined3d_cs_emit_texture_add_dirty_region(struct wined3d_cs *cs,
@@ -2188,7 +2289,7 @@ void wined3d_cs_emit_texture_add_dirty_region(struct wined3d_cs *cs,
cs->ops->submit(cs);
}
@ -955,7 +937,7 @@ index db84f087dd..cdf71e7c3c 100644
{
/* WINED3D_CS_OP_SYNC */ wined3d_cs_exec_sync,
/* WINED3D_CS_OP_GLFINISH */ wined3d_cs_exec_glfinish,
@@ -2320,6 +2423,201 @@ static const struct wined3d_cs_ops wined3d_cs_st_ops =
@@ -2288,6 +2389,201 @@ static const struct wined3d_cs_ops wined3d_cs_st_ops =
wined3d_cs_st_submit,
};
@ -1157,7 +1139,7 @@ index db84f087dd..cdf71e7c3c 100644
struct wined3d_cs *wined3d_cs_create(struct wined3d_device *device)
{
const struct wined3d_gl_info *gl_info = &device->adapter->gl_info;
@@ -2349,12 +2647,41 @@ struct wined3d_cs *wined3d_cs_create(struct wined3d_device *device)
@@ -2317,12 +2613,41 @@ struct wined3d_cs *wined3d_cs_create(struct wined3d_device *device)
return NULL;
}
@ -1200,7 +1182,7 @@ index db84f087dd..cdf71e7c3c 100644
HeapFree(GetProcessHeap(), 0, cs->data);
HeapFree(GetProcessHeap(), 0, cs);
diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c
index fff869d863..37d1272f78 100644
index d5e6e8ca9e..9362c8637e 100644
--- a/dlls/wined3d/device.c
+++ b/dlls/wined3d/device.c
@@ -1307,7 +1307,7 @@ UINT CDECL wined3d_device_get_available_texture_mem(const struct wined3d_device
@ -1243,7 +1225,7 @@ index 1ce5937f17..4ef747ca89 100644
if (hkey) RegCloseKey( hkey );
diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h
index 40b1e8753a..2699ee33b5 100644
index 7701fc50a2..1bdabe73a6 100644
--- a/dlls/wined3d/wined3d_private.h
+++ b/dlls/wined3d/wined3d_private.h
@@ -390,6 +390,7 @@ struct wined3d_settings
@ -1254,7 +1236,7 @@ index 40b1e8753a..2699ee33b5 100644
};
extern struct wined3d_settings wined3d_settings DECLSPEC_HIDDEN;
@@ -2816,11 +2817,6 @@ static inline void wined3d_resource_release(struct wined3d_resource *resource)
@@ -2824,11 +2825,6 @@ static inline void wined3d_resource_release(struct wined3d_resource *resource)
InterlockedDecrement(&resource->access_count);
}
@ -1266,7 +1248,7 @@ index 40b1e8753a..2699ee33b5 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,
@@ -3232,6 +3228,21 @@ enum wined3d_push_constants
@@ -3238,6 +3234,21 @@ enum wined3d_push_constants
WINED3D_PUSH_CONSTANTS_PS_B,
};
@ -1288,7 +1270,7 @@ index 40b1e8753a..2699ee33b5 100644
struct wined3d_cs_ops
{
void *(*require_space)(struct wined3d_cs *cs, size_t size);
@@ -3249,9 +3260,21 @@ struct wined3d_cs
@@ -3255,9 +3266,21 @@ struct wined3d_cs
size_t data_size, start, end;
void *data;

View File

@ -1,18 +1,18 @@
From 5eb8b32612f16ef0a657838d28262914af8771ec Mon Sep 17 00:00:00 2001
From 826d8b385ffe74c04815d60b01ee8b43b0f9e2c3 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 | 121 ++++++++++++++++++++++-------------------
dlls/wined3d/cs.c | 119 ++++++++++++++++++++++-------------------
dlls/wined3d/wined3d_private.h | 4 +-
2 files changed, 68 insertions(+), 57 deletions(-)
2 files changed, 67 insertions(+), 56 deletions(-)
diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c
index b5d9c7390e..24713e411b 100644
index 7dc1cab014..d456b8fb68 100644
--- a/dlls/wined3d/cs.c
+++ b/dlls/wined3d/cs.c
@@ -442,7 +442,7 @@ void wined3d_cs_emit_sync(struct wined3d_cs *cs)
@@ -435,7 +435,7 @@ void wined3d_cs_emit_sync(struct wined3d_cs *cs)
{
struct wined3d_cs_sync *op;
@ -21,7 +21,7 @@ index b5d9c7390e..24713e411b 100644
op->opcode = WINED3D_CS_OP_SYNC;
cs->ops->submit_and_wait(cs);
@@ -462,7 +462,7 @@ void wined3d_cs_emit_glfinish(struct wined3d_cs *cs)
@@ -455,7 +455,7 @@ void wined3d_cs_emit_glfinish(struct wined3d_cs *cs)
{
struct wined3d_cs_glfinish *op;
@ -30,7 +30,7 @@ index b5d9c7390e..24713e411b 100644
op->opcode = WINED3D_CS_OP_GLFINISH;
cs->ops->submit_and_wait(cs);
@@ -497,7 +497,7 @@ void wined3d_cs_emit_present(struct wined3d_cs *cs, struct wined3d_swapchain *sw
@@ -490,7 +490,7 @@ void wined3d_cs_emit_present(struct wined3d_cs *cs, struct wined3d_swapchain *sw
unsigned int i;
LONG pending;
@ -39,7 +39,7 @@ index b5d9c7390e..24713e411b 100644
op->opcode = WINED3D_CS_OP_PRESENT;
op->dst_window_override = dst_window_override;
op->swapchain = swapchain;
@@ -563,7 +563,7 @@ void wined3d_cs_emit_clear(struct wined3d_cs *cs, DWORD rect_count, const RECT *
@@ -556,7 +556,7 @@ void wined3d_cs_emit_clear(struct wined3d_cs *cs, DWORD rect_count, const RECT *
size_t size = FIELD_OFFSET(struct wined3d_cs_clear, rects[rect_count]);
unsigned int i;
@ -48,7 +48,7 @@ index b5d9c7390e..24713e411b 100644
op->opcode = WINED3D_CS_OP_CLEAR;
op->size = size;
op->flags = flags;
@@ -601,7 +601,7 @@ void wined3d_cs_emit_clear_rendertarget_view(struct wined3d_cs *cs, struct wined
@@ -594,7 +594,7 @@ void wined3d_cs_emit_clear_rendertarget_view(struct wined3d_cs *cs, struct wined
} *extra;
size_t size = FIELD_OFFSET(struct wined3d_cs_clear, rects[1]) + sizeof(*extra);
@ -57,7 +57,7 @@ index b5d9c7390e..24713e411b 100644
extra = (void *)&op->rects[1];
extra->fb.render_targets = &extra->rt;
op->fb = &extra->fb;
@@ -760,7 +760,7 @@ void wined3d_cs_emit_dispatch(struct wined3d_cs *cs,
@@ -753,7 +753,7 @@ void wined3d_cs_emit_dispatch(struct wined3d_cs *cs,
const struct wined3d_state *state = &cs->device->state;
struct wined3d_cs_dispatch *op;
@ -66,7 +66,7 @@ index b5d9c7390e..24713e411b 100644
op->opcode = WINED3D_CS_OP_DISPATCH;
op->group_count_x = group_count_x;
op->group_count_y = group_count_y;
@@ -834,7 +834,7 @@ void wined3d_cs_emit_draw(struct wined3d_cs *cs, GLenum primitive_type, int base
@@ -827,7 +827,7 @@ void wined3d_cs_emit_draw(struct wined3d_cs *cs, GLenum primitive_type, int base
struct wined3d_cs_draw *op;
unsigned int i;
@ -75,7 +75,7 @@ index b5d9c7390e..24713e411b 100644
op->opcode = WINED3D_CS_OP_DRAW;
op->primitive_type = primitive_type;
op->base_vertex_idx = base_vertex_idx;
@@ -889,7 +889,7 @@ void wined3d_cs_emit_set_predication(struct wined3d_cs *cs, struct wined3d_query
@@ -882,7 +882,7 @@ void wined3d_cs_emit_set_predication(struct wined3d_cs *cs, struct wined3d_query
{
struct wined3d_cs_set_predication *op;
@ -84,7 +84,7 @@ index b5d9c7390e..24713e411b 100644
op->opcode = WINED3D_CS_OP_SET_PREDICATION;
op->predicate = predicate;
op->value = value;
@@ -911,7 +911,7 @@ void wined3d_cs_emit_set_viewport(struct wined3d_cs *cs, const struct wined3d_vi
@@ -904,7 +904,7 @@ void wined3d_cs_emit_set_viewport(struct wined3d_cs *cs, const struct wined3d_vi
{
struct wined3d_cs_set_viewport *op;
@ -93,7 +93,7 @@ index b5d9c7390e..24713e411b 100644
op->opcode = WINED3D_CS_OP_SET_VIEWPORT;
op->viewport = *viewport;
@@ -932,7 +932,7 @@ void wined3d_cs_emit_set_scissor_rect(struct wined3d_cs *cs, const RECT *rect)
@@ -925,7 +925,7 @@ void wined3d_cs_emit_set_scissor_rect(struct wined3d_cs *cs, const RECT *rect)
{
struct wined3d_cs_set_scissor_rect *op;
@ -102,7 +102,7 @@ index b5d9c7390e..24713e411b 100644
op->opcode = WINED3D_CS_OP_SET_SCISSOR_RECT;
op->rect = *rect;
@@ -954,7 +954,7 @@ void wined3d_cs_emit_set_rendertarget_view(struct wined3d_cs *cs, unsigned int v
@@ -947,7 +947,7 @@ void wined3d_cs_emit_set_rendertarget_view(struct wined3d_cs *cs, unsigned int v
{
struct wined3d_cs_set_rendertarget_view *op;
@ -111,7 +111,7 @@ index b5d9c7390e..24713e411b 100644
op->opcode = WINED3D_CS_OP_SET_RENDERTARGET_VIEW;
op->view_idx = view_idx;
op->view = view;
@@ -1005,7 +1005,7 @@ void wined3d_cs_emit_set_depth_stencil_view(struct wined3d_cs *cs, struct wined3
@@ -998,7 +998,7 @@ void wined3d_cs_emit_set_depth_stencil_view(struct wined3d_cs *cs, struct wined3
{
struct wined3d_cs_set_depth_stencil_view *op;
@ -120,7 +120,7 @@ index b5d9c7390e..24713e411b 100644
op->opcode = WINED3D_CS_OP_SET_DEPTH_STENCIL_VIEW;
op->view = view;
@@ -1026,7 +1026,7 @@ void wined3d_cs_emit_set_vertex_declaration(struct wined3d_cs *cs, struct wined3
@@ -1019,7 +1019,7 @@ void wined3d_cs_emit_set_vertex_declaration(struct wined3d_cs *cs, struct wined3
{
struct wined3d_cs_set_vertex_declaration *op;
@ -129,7 +129,7 @@ index b5d9c7390e..24713e411b 100644
op->opcode = WINED3D_CS_OP_SET_VERTEX_DECLARATION;
op->declaration = declaration;
@@ -1060,7 +1060,7 @@ void wined3d_cs_emit_set_stream_source(struct wined3d_cs *cs, UINT stream_idx,
@@ -1053,7 +1053,7 @@ void wined3d_cs_emit_set_stream_source(struct wined3d_cs *cs, UINT stream_idx,
{
struct wined3d_cs_set_stream_source *op;
@ -138,7 +138,7 @@ index b5d9c7390e..24713e411b 100644
op->opcode = WINED3D_CS_OP_SET_STREAM_SOURCE;
op->stream_idx = stream_idx;
op->buffer = buffer;
@@ -1088,7 +1088,7 @@ void wined3d_cs_emit_set_stream_source_freq(struct wined3d_cs *cs, UINT stream_i
@@ -1081,7 +1081,7 @@ void wined3d_cs_emit_set_stream_source_freq(struct wined3d_cs *cs, UINT stream_i
{
struct wined3d_cs_set_stream_source_freq *op;
@ -147,7 +147,7 @@ index b5d9c7390e..24713e411b 100644
op->opcode = WINED3D_CS_OP_SET_STREAM_SOURCE_FREQ;
op->stream_idx = stream_idx;
op->frequency = frequency;
@@ -1123,7 +1123,7 @@ void wined3d_cs_emit_set_stream_output(struct wined3d_cs *cs, UINT stream_idx,
@@ -1116,7 +1116,7 @@ void wined3d_cs_emit_set_stream_output(struct wined3d_cs *cs, UINT stream_idx,
{
struct wined3d_cs_set_stream_output *op;
@ -156,7 +156,7 @@ index b5d9c7390e..24713e411b 100644
op->opcode = WINED3D_CS_OP_SET_STREAM_OUTPUT;
op->stream_idx = stream_idx;
op->buffer = buffer;
@@ -1157,7 +1157,7 @@ void wined3d_cs_emit_set_index_buffer(struct wined3d_cs *cs, struct wined3d_buff
@@ -1150,7 +1150,7 @@ void wined3d_cs_emit_set_index_buffer(struct wined3d_cs *cs, struct wined3d_buff
{
struct wined3d_cs_set_index_buffer *op;
@ -165,7 +165,7 @@ index b5d9c7390e..24713e411b 100644
op->opcode = WINED3D_CS_OP_SET_INDEX_BUFFER;
op->buffer = buffer;
op->format_id = format_id;
@@ -1188,7 +1188,7 @@ void wined3d_cs_emit_set_constant_buffer(struct wined3d_cs *cs, enum wined3d_sha
@@ -1181,7 +1181,7 @@ void wined3d_cs_emit_set_constant_buffer(struct wined3d_cs *cs, enum wined3d_sha
{
struct wined3d_cs_set_constant_buffer *op;
@ -174,7 +174,7 @@ index b5d9c7390e..24713e411b 100644
op->opcode = WINED3D_CS_OP_SET_CONSTANT_BUFFER;
op->type = type;
op->cb_idx = cb_idx;
@@ -1282,7 +1282,7 @@ void wined3d_cs_emit_set_texture(struct wined3d_cs *cs, UINT stage, struct wined
@@ -1275,7 +1275,7 @@ void wined3d_cs_emit_set_texture(struct wined3d_cs *cs, UINT stage, struct wined
{
struct wined3d_cs_set_texture *op;
@ -183,7 +183,7 @@ index b5d9c7390e..24713e411b 100644
op->opcode = WINED3D_CS_OP_SET_TEXTURE;
op->stage = stage;
op->texture = texture;
@@ -1316,7 +1316,7 @@ void wined3d_cs_emit_set_shader_resource_view(struct wined3d_cs *cs, enum wined3
@@ -1309,7 +1309,7 @@ void wined3d_cs_emit_set_shader_resource_view(struct wined3d_cs *cs, enum wined3
{
struct wined3d_cs_set_shader_resource_view *op;
@ -192,7 +192,7 @@ index b5d9c7390e..24713e411b 100644
op->opcode = WINED3D_CS_OP_SET_SHADER_RESOURCE_VIEW;
op->type = type;
op->view_idx = view_idx;
@@ -1348,7 +1348,7 @@ void wined3d_cs_emit_set_unordered_access_view(struct wined3d_cs *cs, enum wined
@@ -1341,7 +1341,7 @@ void wined3d_cs_emit_set_unordered_access_view(struct wined3d_cs *cs, enum wined
{
struct wined3d_cs_set_unordered_access_view *op;
@ -201,7 +201,7 @@ index b5d9c7390e..24713e411b 100644
op->opcode = WINED3D_CS_OP_SET_UNORDERED_ACCESS_VIEW;
op->pipeline = pipeline;
op->view_idx = view_idx;
@@ -1375,7 +1375,7 @@ void wined3d_cs_emit_set_sampler(struct wined3d_cs *cs, enum wined3d_shader_type
@@ -1368,7 +1368,7 @@ void wined3d_cs_emit_set_sampler(struct wined3d_cs *cs, enum wined3d_shader_type
{
struct wined3d_cs_set_sampler *op;
@ -210,7 +210,7 @@ index b5d9c7390e..24713e411b 100644
op->opcode = WINED3D_CS_OP_SET_SAMPLER;
op->type = type;
op->sampler_idx = sampler_idx;
@@ -1402,7 +1402,7 @@ void wined3d_cs_emit_set_shader(struct wined3d_cs *cs, enum wined3d_shader_type
@@ -1395,7 +1395,7 @@ void wined3d_cs_emit_set_shader(struct wined3d_cs *cs, enum wined3d_shader_type
{
struct wined3d_cs_set_shader *op;
@ -219,7 +219,7 @@ index b5d9c7390e..24713e411b 100644
op->opcode = WINED3D_CS_OP_SET_SHADER;
op->type = type;
op->shader = shader;
@@ -1425,7 +1425,7 @@ void wined3d_cs_emit_set_rasterizer_state(struct wined3d_cs *cs,
@@ -1418,7 +1418,7 @@ void wined3d_cs_emit_set_rasterizer_state(struct wined3d_cs *cs,
{
struct wined3d_cs_set_rasterizer_state *op;
@ -228,7 +228,7 @@ index b5d9c7390e..24713e411b 100644
op->opcode = WINED3D_CS_OP_SET_RASTERIZER_STATE;
op->state = rasterizer_state;
@@ -1446,7 +1446,7 @@ void wined3d_cs_emit_set_render_state(struct wined3d_cs *cs, enum wined3d_render
@@ -1439,7 +1439,7 @@ void wined3d_cs_emit_set_render_state(struct wined3d_cs *cs, enum wined3d_render
{
struct wined3d_cs_set_render_state *op;
@ -237,7 +237,7 @@ index b5d9c7390e..24713e411b 100644
op->opcode = WINED3D_CS_OP_SET_RENDER_STATE;
op->state = state;
op->value = value;
@@ -1469,7 +1469,7 @@ void wined3d_cs_emit_set_texture_state(struct wined3d_cs *cs, UINT stage,
@@ -1462,7 +1462,7 @@ void wined3d_cs_emit_set_texture_state(struct wined3d_cs *cs, UINT stage,
{
struct wined3d_cs_set_texture_state *op;
@ -246,7 +246,7 @@ index b5d9c7390e..24713e411b 100644
op->opcode = WINED3D_CS_OP_SET_TEXTURE_STATE;
op->stage = stage;
op->state = state;
@@ -1493,7 +1493,7 @@ void wined3d_cs_emit_set_sampler_state(struct wined3d_cs *cs, UINT sampler_idx,
@@ -1486,7 +1486,7 @@ void wined3d_cs_emit_set_sampler_state(struct wined3d_cs *cs, UINT sampler_idx,
{
struct wined3d_cs_set_sampler_state *op;
@ -255,7 +255,7 @@ index b5d9c7390e..24713e411b 100644
op->opcode = WINED3D_CS_OP_SET_SAMPLER_STATE;
op->sampler_idx = sampler_idx;
op->state = state;
@@ -1518,7 +1518,7 @@ void wined3d_cs_emit_set_transform(struct wined3d_cs *cs, enum wined3d_transform
@@ -1511,7 +1511,7 @@ void wined3d_cs_emit_set_transform(struct wined3d_cs *cs, enum wined3d_transform
{
struct wined3d_cs_set_transform *op;
@ -264,7 +264,7 @@ index b5d9c7390e..24713e411b 100644
op->opcode = WINED3D_CS_OP_SET_TRANSFORM;
op->state = state;
op->matrix = *matrix;
@@ -1540,7 +1540,7 @@ void wined3d_cs_emit_set_clip_plane(struct wined3d_cs *cs, UINT plane_idx, const
@@ -1533,7 +1533,7 @@ void wined3d_cs_emit_set_clip_plane(struct wined3d_cs *cs, UINT plane_idx, const
{
struct wined3d_cs_set_clip_plane *op;
@ -273,7 +273,7 @@ index b5d9c7390e..24713e411b 100644
op->opcode = WINED3D_CS_OP_SET_CLIP_PLANE;
op->plane_idx = plane_idx;
op->plane = *plane;
@@ -1618,7 +1618,7 @@ void wined3d_cs_emit_set_color_key(struct wined3d_cs *cs, struct wined3d_texture
@@ -1611,7 +1611,7 @@ void wined3d_cs_emit_set_color_key(struct wined3d_cs *cs, struct wined3d_texture
{
struct wined3d_cs_set_color_key *op;
@ -282,7 +282,7 @@ index b5d9c7390e..24713e411b 100644
op->opcode = WINED3D_CS_OP_SET_COLOR_KEY;
op->texture = texture;
op->flags = flags;
@@ -1647,7 +1647,7 @@ void wined3d_cs_emit_set_material(struct wined3d_cs *cs, const struct wined3d_ma
@@ -1640,7 +1640,7 @@ void wined3d_cs_emit_set_material(struct wined3d_cs *cs, const struct wined3d_ma
{
struct wined3d_cs_set_material *op;
@ -291,7 +291,7 @@ index b5d9c7390e..24713e411b 100644
op->opcode = WINED3D_CS_OP_SET_MATERIAL;
op->material = *material;
@@ -1697,7 +1697,7 @@ void wined3d_cs_emit_set_light(struct wined3d_cs *cs, const struct wined3d_light
@@ -1690,7 +1690,7 @@ void wined3d_cs_emit_set_light(struct wined3d_cs *cs, const struct wined3d_light
{
struct wined3d_cs_set_light *op;
@ -300,7 +300,7 @@ index b5d9c7390e..24713e411b 100644
op->opcode = WINED3D_CS_OP_SET_LIGHT;
op->light = *light;
@@ -1732,7 +1732,7 @@ void wined3d_cs_emit_set_light_enable(struct wined3d_cs *cs, unsigned int idx, B
@@ -1725,7 +1725,7 @@ void wined3d_cs_emit_set_light_enable(struct wined3d_cs *cs, unsigned int idx, B
{
struct wined3d_cs_set_light_enable *op;
@ -309,7 +309,7 @@ index b5d9c7390e..24713e411b 100644
op->opcode = WINED3D_CS_OP_SET_LIGHT_ENABLE;
op->idx = idx;
op->enable = enable;
@@ -1756,7 +1756,7 @@ void wined3d_cs_emit_reset_state(struct wined3d_cs *cs)
@@ -1749,7 +1749,7 @@ void wined3d_cs_emit_reset_state(struct wined3d_cs *cs)
{
struct wined3d_cs_reset_state *op;
@ -318,7 +318,7 @@ index b5d9c7390e..24713e411b 100644
op->opcode = WINED3D_CS_OP_RESET_STATE;
cs->ops->submit(cs);
@@ -1775,7 +1775,7 @@ static void wined3d_cs_emit_callback(struct wined3d_cs *cs, void (*callback)(voi
@@ -1768,7 +1768,7 @@ static void wined3d_cs_emit_callback(struct wined3d_cs *cs, void (*callback)(voi
{
struct wined3d_cs_callback *op;
@ -327,7 +327,7 @@ index b5d9c7390e..24713e411b 100644
op->opcode = WINED3D_CS_OP_CALLBACK;
op->callback = callback;
op->object = object;
@@ -1807,7 +1807,7 @@ void wined3d_cs_emit_query_issue(struct wined3d_cs *cs, struct wined3d_query *qu
@@ -1800,7 +1800,7 @@ void wined3d_cs_emit_query_issue(struct wined3d_cs *cs, struct wined3d_query *qu
{
struct wined3d_cs_query_issue *op;
@ -336,7 +336,7 @@ index b5d9c7390e..24713e411b 100644
op->opcode = WINED3D_CS_OP_QUERY_ISSUE;
op->query = query;
op->flags = flags;
@@ -1830,7 +1830,7 @@ BOOL wined3d_cs_emit_query_poll(struct wined3d_cs *cs, struct wined3d_query *que
@@ -1823,7 +1823,7 @@ BOOL wined3d_cs_emit_query_poll(struct wined3d_cs *cs, struct wined3d_query *que
struct wined3d_cs_query_poll *op;
BOOL ret;
@ -345,7 +345,7 @@ index b5d9c7390e..24713e411b 100644
op->opcode = WINED3D_CS_OP_QUERY_POLL;
op->query = query;
op->flags = flags;
@@ -1856,7 +1856,7 @@ void wined3d_cs_emit_preload_resource(struct wined3d_cs *cs, struct wined3d_reso
@@ -1849,7 +1849,7 @@ void wined3d_cs_emit_preload_resource(struct wined3d_cs *cs, struct wined3d_reso
{
struct wined3d_cs_preload_resource *op;
@ -354,7 +354,7 @@ index b5d9c7390e..24713e411b 100644
op->opcode = WINED3D_CS_OP_PRELOAD_RESOURCE;
op->resource = resource;
@@ -1880,7 +1880,7 @@ void wined3d_cs_emit_unload_resource(struct wined3d_cs *cs, struct wined3d_resou
@@ -1873,7 +1873,7 @@ void wined3d_cs_emit_unload_resource(struct wined3d_cs *cs, struct wined3d_resou
{
struct wined3d_cs_unload_resource *op;
@ -363,7 +363,7 @@ index b5d9c7390e..24713e411b 100644
op->opcode = WINED3D_CS_OP_UNLOAD_RESOURCE;
op->resource = resource;
@@ -1906,7 +1906,7 @@ HRESULT wined3d_cs_map(struct wined3d_cs *cs, struct wined3d_resource *resource,
@@ -1899,7 +1899,7 @@ HRESULT wined3d_cs_map(struct wined3d_cs *cs, struct wined3d_resource *resource,
struct wined3d_cs_map *op;
HRESULT hr;
@ -372,7 +372,7 @@ index b5d9c7390e..24713e411b 100644
op->opcode = WINED3D_CS_OP_MAP;
op->resource = resource;
op->sub_resource_idx = sub_resource_idx;
@@ -1935,7 +1935,7 @@ HRESULT wined3d_cs_unmap(struct wined3d_cs *cs, struct wined3d_resource *resourc
@@ -1928,7 +1928,7 @@ HRESULT wined3d_cs_unmap(struct wined3d_cs *cs, struct wined3d_resource *resourc
struct wined3d_cs_unmap *op;
HRESULT hr;
@ -381,7 +381,7 @@ index b5d9c7390e..24713e411b 100644
op->opcode = WINED3D_CS_OP_UNMAP;
op->resource = resource;
op->sub_resource_idx = sub_resource_idx;
@@ -1996,7 +1996,7 @@ void wined3d_cs_emit_blt_sub_resource(struct wined3d_cs *cs, struct wined3d_reso
@@ -2069,7 +2069,7 @@ void wined3d_cs_emit_blt_sub_resource(struct wined3d_cs *cs, struct wined3d_reso
{
struct wined3d_cs_blt_sub_resource *op;
@ -390,7 +390,7 @@ index b5d9c7390e..24713e411b 100644
op->opcode = WINED3D_CS_OP_BLT_SUB_RESOURCE;
op->dst_resource = dst_resource;
op->dst_sub_resource_idx = dst_sub_resource_idx;
@@ -2075,7 +2075,7 @@ void wined3d_cs_emit_update_sub_resource(struct wined3d_cs *cs, struct wined3d_r
@@ -2148,7 +2148,7 @@ void wined3d_cs_emit_update_sub_resource(struct wined3d_cs *cs, struct wined3d_r
{
struct wined3d_cs_update_sub_resource *op;
@ -399,7 +399,7 @@ index b5d9c7390e..24713e411b 100644
op->opcode = WINED3D_CS_OP_UPDATE_SUB_RESOURCE;
op->resource = resource;
op->sub_resource_idx = sub_resource_idx;
@@ -2140,7 +2140,7 @@ void wined3d_cs_emit_push_constants(struct wined3d_cs *cs, enum wined3d_push_con
@@ -2213,7 +2213,7 @@ void wined3d_cs_emit_push_constants(struct wined3d_cs *cs, enum wined3d_push_con
{
struct wined3d_cs_push_constants *op;
@ -408,16 +408,7 @@ index b5d9c7390e..24713e411b 100644
op->opcode = WINED3D_CS_OP_PUSH_CONSTANTS;
op->p = p;
op->start_idx = start_idx;
@@ -2170,7 +2170,7 @@ void wined3d_cs_emit_update_texture(struct wined3d_cs *cs, struct wined3d_textur
{
struct wined3d_cs_update_texture *op;
- op = cs->ops->require_space(cs, sizeof(*op));
+ op = cs->ops->require_space(cs, sizeof(*op), 0);
op->opcode = WINED3D_CS_OP_UPDATE_TEXTURE;
op->src = src;
op->dst = dst;
@@ -2194,7 +2194,7 @@ void wined3d_cs_emit_update_swap_interval(struct wined3d_cs *cs, struct wined3d_
@@ -2236,7 +2236,7 @@ void wined3d_cs_emit_update_swap_interval(struct wined3d_cs *cs, struct wined3d_
{
struct wined3d_cs_update_swap_interval *op;
@ -426,7 +417,7 @@ index b5d9c7390e..24713e411b 100644
op->opcode = WINED3D_CS_OP_UPDATE_SWAP_INTERVAL;
op->swapchain = swapchain;
@@ -2232,7 +2232,7 @@ void wined3d_cs_emit_texture_add_dirty_region(struct wined3d_cs *cs,
@@ -2279,7 +2279,7 @@ void wined3d_cs_emit_texture_add_dirty_region(struct wined3d_cs *cs,
if (dirty_region)
WARN("Ignoring dirty_region %s.\n", debug_box(dirty_region));
@ -435,7 +426,7 @@ index b5d9c7390e..24713e411b 100644
op->opcode = WINED3D_CS_OP_TEXTURE_ADD_DIRTY_REGION;
op->texture = texture;
op->sub_resource_idx = sub_resource_idx;
@@ -2292,7 +2292,7 @@ static UINT (* const wined3d_cs_op_handlers[])(struct wined3d_cs *cs, const void
@@ -2338,7 +2338,7 @@ static UINT (* const wined3d_cs_op_handlers[])(struct wined3d_cs *cs, const void
/* WINED3D_CS_OP_TEXTURE_ADD_DIRTY_REGION */ wined3d_cs_exec_texture_add_dirty_region,
};
@ -444,7 +435,7 @@ index b5d9c7390e..24713e411b 100644
{
if (size > (cs->data_size - cs->end))
{
@@ -2376,6 +2376,8 @@ static struct wined3d_cs_block *wined3d_cs_dequeue_command(struct wined3d_cs *cs
@@ -2422,6 +2422,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 (;;)
{
@ -453,7 +444,7 @@ index b5d9c7390e..24713e411b 100644
if ((block = wined3d_cs_list_dequeue(&cs->exec_list)))
return block;
}
@@ -2403,7 +2405,7 @@ static void wined3d_cs_list_cleanup(struct wined3d_cs_list *list)
@@ -2449,7 +2451,7 @@ static void wined3d_cs_list_cleanup(struct wined3d_cs_list *list)
DeleteCriticalSection(&list->lock);
}
@ -462,7 +453,7 @@ index b5d9c7390e..24713e411b 100644
{
struct wined3d_cs_block *block;
@@ -2417,26 +2419,28 @@ static struct wined3d_cs_block *wined3d_cs_get_block(struct wined3d_cs *cs)
@@ -2463,26 +2465,28 @@ static struct wined3d_cs_block *wined3d_cs_get_block(struct wined3d_cs *cs)
}
block->pos = 0;
@ -495,7 +486,7 @@ index b5d9c7390e..24713e411b 100644
cs->current_block = block;
}
@@ -2448,10 +2452,13 @@ static void *wined3d_cs_mt_require_space(struct wined3d_cs *cs, size_t size)
@@ -2494,10 +2498,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)
{
@ -510,7 +501,7 @@ index b5d9c7390e..24713e411b 100644
cs->current_block = NULL;
}
@@ -2465,7 +2472,7 @@ static void wined3d_cs_mt_submit_and_wait(struct wined3d_cs *cs)
@@ -2511,7 +2518,7 @@ static void wined3d_cs_mt_submit_and_wait(struct wined3d_cs *cs)
block = cs->current_block;
block->fence = &fence;
@ -519,7 +510,7 @@ index b5d9c7390e..24713e411b 100644
cs->current_block = NULL;
/* A busy wait should be fine, we're not supposed to have to wait very
@@ -2487,7 +2494,7 @@ static void wined3d_cs_mt_emit_stop(struct wined3d_cs *cs)
@@ -2533,7 +2540,7 @@ static void wined3d_cs_mt_emit_stop(struct wined3d_cs *cs)
assert(cs->thread_id != GetCurrentThreadId());
assert(cs->ops == &wined3d_cs_mt_ops);
@ -528,7 +519,7 @@ index b5d9c7390e..24713e411b 100644
op->opcode = WINED3D_CS_OP_STOP;
cs->ops->submit(cs);
@@ -2573,6 +2580,7 @@ struct wined3d_cs *wined3d_cs_create(struct wined3d_device *device)
@@ -2619,6 +2626,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);
@ -536,7 +527,7 @@ index b5d9c7390e..24713e411b 100644
if (!(cs->thread = CreateThread(NULL, 0, wined3d_cs_run, cs, 0, &cs->thread_id)))
{
@@ -2598,6 +2606,7 @@ void wined3d_cs_destroy(struct wined3d_cs *cs)
@@ -2644,6 +2652,7 @@ void wined3d_cs_destroy(struct wined3d_cs *cs)
WaitForSingleObject(cs->thread, INFINITE);
CloseHandle(cs->thread);
@ -545,10 +536,10 @@ index b5d9c7390e..24713e411b 100644
wined3d_cs_list_cleanup(&cs->free_list);
}
diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h
index 99f598f4fe..21172d7a6b 100644
index 1bdabe73a6..d9a0e8f788 100644
--- a/dlls/wined3d/wined3d_private.h
+++ b/dlls/wined3d/wined3d_private.h
@@ -3228,13 +3228,14 @@ struct wined3d_cs_block
@@ -3245,13 +3245,14 @@ struct wined3d_cs_block
{
struct list entry;
UINT pos;
@ -564,7 +555,7 @@ index 99f598f4fe..21172d7a6b 100644
void (*submit)(struct wined3d_cs *cs);
void (*submit_and_wait)(struct wined3d_cs *cs);
};
@@ -3254,6 +3255,7 @@ struct wined3d_cs
@@ -3271,6 +3272,7 @@ struct wined3d_cs
struct wined3d_cs_block *current_block;
struct wined3d_cs_list free_list;
struct wined3d_cs_list exec_list;

View File

@ -1,4 +1,4 @@
From 3968647ea08b56327b34d00da606dcf2e3688d2f Mon Sep 17 00:00:00 2001
From dd838d9cf7c7ff402eabbf9630e15dc312b390d9 Mon Sep 17 00:00:00 2001
From: Sebastian Lackner <sebastian@fds-team.de>
Date: Wed, 8 Feb 2017 12:32:55 +0100
Subject: wined3d: Do not immediately submit stateblock updates.
@ -9,10 +9,10 @@ Subject: wined3d: Do not immediately submit stateblock updates.
2 files changed, 36 insertions(+), 28 deletions(-)
diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c
index f6c2315400..5d53fd5696 100644
index 00ffa04faf..2818e9b793 100644
--- a/dlls/wined3d/cs.c
+++ b/dlls/wined3d/cs.c
@@ -894,7 +894,7 @@ void wined3d_cs_emit_set_predication(struct wined3d_cs *cs, struct wined3d_query
@@ -887,7 +887,7 @@ void wined3d_cs_emit_set_predication(struct wined3d_cs *cs, struct wined3d_query
op->predicate = predicate;
op->value = value;
@ -21,7 +21,7 @@ index f6c2315400..5d53fd5696 100644
}
static UINT wined3d_cs_exec_set_viewport(struct wined3d_cs *cs, const void *data)
@@ -915,7 +915,7 @@ void wined3d_cs_emit_set_viewport(struct wined3d_cs *cs, const struct wined3d_vi
@@ -908,7 +908,7 @@ void wined3d_cs_emit_set_viewport(struct wined3d_cs *cs, const struct wined3d_vi
op->opcode = WINED3D_CS_OP_SET_VIEWPORT;
op->viewport = *viewport;
@ -30,7 +30,7 @@ index f6c2315400..5d53fd5696 100644
}
static UINT wined3d_cs_exec_set_scissor_rect(struct wined3d_cs *cs, const void *data)
@@ -936,7 +936,7 @@ void wined3d_cs_emit_set_scissor_rect(struct wined3d_cs *cs, const RECT *rect)
@@ -929,7 +929,7 @@ void wined3d_cs_emit_set_scissor_rect(struct wined3d_cs *cs, const RECT *rect)
op->opcode = WINED3D_CS_OP_SET_SCISSOR_RECT;
op->rect = *rect;
@ -39,7 +39,7 @@ index f6c2315400..5d53fd5696 100644
}
static UINT wined3d_cs_exec_set_rendertarget_view(struct wined3d_cs *cs, const void *data)
@@ -959,7 +959,7 @@ void wined3d_cs_emit_set_rendertarget_view(struct wined3d_cs *cs, unsigned int v
@@ -952,7 +952,7 @@ void wined3d_cs_emit_set_rendertarget_view(struct wined3d_cs *cs, unsigned int v
op->view_idx = view_idx;
op->view = view;
@ -48,7 +48,7 @@ index f6c2315400..5d53fd5696 100644
}
static UINT wined3d_cs_exec_set_depth_stencil_view(struct wined3d_cs *cs, const void *data)
@@ -1009,7 +1009,7 @@ void wined3d_cs_emit_set_depth_stencil_view(struct wined3d_cs *cs, struct wined3
@@ -1002,7 +1002,7 @@ void wined3d_cs_emit_set_depth_stencil_view(struct wined3d_cs *cs, struct wined3
op->opcode = WINED3D_CS_OP_SET_DEPTH_STENCIL_VIEW;
op->view = view;
@ -57,7 +57,7 @@ index f6c2315400..5d53fd5696 100644
}
static UINT wined3d_cs_exec_set_vertex_declaration(struct wined3d_cs *cs, const void *data)
@@ -1030,7 +1030,7 @@ void wined3d_cs_emit_set_vertex_declaration(struct wined3d_cs *cs, struct wined3
@@ -1023,7 +1023,7 @@ void wined3d_cs_emit_set_vertex_declaration(struct wined3d_cs *cs, struct wined3
op->opcode = WINED3D_CS_OP_SET_VERTEX_DECLARATION;
op->declaration = declaration;
@ -66,7 +66,7 @@ index f6c2315400..5d53fd5696 100644
}
static UINT wined3d_cs_exec_set_stream_source(struct wined3d_cs *cs, const void *data)
@@ -1067,7 +1067,7 @@ void wined3d_cs_emit_set_stream_source(struct wined3d_cs *cs, UINT stream_idx,
@@ -1060,7 +1060,7 @@ void wined3d_cs_emit_set_stream_source(struct wined3d_cs *cs, UINT stream_idx,
op->offset = offset;
op->stride = stride;
@ -75,7 +75,7 @@ index f6c2315400..5d53fd5696 100644
}
static UINT wined3d_cs_exec_set_stream_source_freq(struct wined3d_cs *cs, const void *data)
@@ -1094,7 +1094,7 @@ void wined3d_cs_emit_set_stream_source_freq(struct wined3d_cs *cs, UINT stream_i
@@ -1087,7 +1087,7 @@ void wined3d_cs_emit_set_stream_source_freq(struct wined3d_cs *cs, UINT stream_i
op->frequency = frequency;
op->flags = flags;
@ -84,7 +84,7 @@ index f6c2315400..5d53fd5696 100644
}
static UINT wined3d_cs_exec_set_stream_output(struct wined3d_cs *cs, const void *data)
@@ -1129,7 +1129,7 @@ void wined3d_cs_emit_set_stream_output(struct wined3d_cs *cs, UINT stream_idx,
@@ -1122,7 +1122,7 @@ void wined3d_cs_emit_set_stream_output(struct wined3d_cs *cs, UINT stream_idx,
op->buffer = buffer;
op->offset = offset;
@ -93,7 +93,7 @@ index f6c2315400..5d53fd5696 100644
}
static UINT wined3d_cs_exec_set_index_buffer(struct wined3d_cs *cs, const void *data)
@@ -1163,7 +1163,7 @@ void wined3d_cs_emit_set_index_buffer(struct wined3d_cs *cs, struct wined3d_buff
@@ -1156,7 +1156,7 @@ void wined3d_cs_emit_set_index_buffer(struct wined3d_cs *cs, struct wined3d_buff
op->format_id = format_id;
op->offset = offset;
@ -102,7 +102,7 @@ index f6c2315400..5d53fd5696 100644
}
static UINT wined3d_cs_exec_set_constant_buffer(struct wined3d_cs *cs, const void *data)
@@ -1194,7 +1194,7 @@ void wined3d_cs_emit_set_constant_buffer(struct wined3d_cs *cs, enum wined3d_sha
@@ -1187,7 +1187,7 @@ void wined3d_cs_emit_set_constant_buffer(struct wined3d_cs *cs, enum wined3d_sha
op->cb_idx = cb_idx;
op->buffer = buffer;
@ -111,7 +111,7 @@ index f6c2315400..5d53fd5696 100644
}
static UINT wined3d_cs_exec_set_texture(struct wined3d_cs *cs, const void *data)
@@ -1287,7 +1287,7 @@ void wined3d_cs_emit_set_texture(struct wined3d_cs *cs, UINT stage, struct wined
@@ -1280,7 +1280,7 @@ void wined3d_cs_emit_set_texture(struct wined3d_cs *cs, UINT stage, struct wined
op->stage = stage;
op->texture = texture;
@ -120,7 +120,7 @@ index f6c2315400..5d53fd5696 100644
}
static UINT wined3d_cs_exec_set_shader_resource_view(struct wined3d_cs *cs, const void *data)
@@ -1322,7 +1322,7 @@ void wined3d_cs_emit_set_shader_resource_view(struct wined3d_cs *cs, enum wined3
@@ -1315,7 +1315,7 @@ void wined3d_cs_emit_set_shader_resource_view(struct wined3d_cs *cs, enum wined3
op->view_idx = view_idx;
op->view = view;
@ -129,7 +129,7 @@ index f6c2315400..5d53fd5696 100644
}
static UINT wined3d_cs_exec_set_unordered_access_view(struct wined3d_cs *cs, const void *data)
@@ -1354,7 +1354,7 @@ void wined3d_cs_emit_set_unordered_access_view(struct wined3d_cs *cs, enum wined
@@ -1347,7 +1347,7 @@ void wined3d_cs_emit_set_unordered_access_view(struct wined3d_cs *cs, enum wined
op->view_idx = view_idx;
op->view = view;
@ -138,7 +138,7 @@ index f6c2315400..5d53fd5696 100644
}
static UINT wined3d_cs_exec_set_sampler(struct wined3d_cs *cs, const void *data)
@@ -1381,7 +1381,7 @@ void wined3d_cs_emit_set_sampler(struct wined3d_cs *cs, enum wined3d_shader_type
@@ -1374,7 +1374,7 @@ void wined3d_cs_emit_set_sampler(struct wined3d_cs *cs, enum wined3d_shader_type
op->sampler_idx = sampler_idx;
op->sampler = sampler;
@ -147,7 +147,7 @@ index f6c2315400..5d53fd5696 100644
}
static UINT wined3d_cs_exec_set_shader(struct wined3d_cs *cs, const void *data)
@@ -1407,7 +1407,7 @@ void wined3d_cs_emit_set_shader(struct wined3d_cs *cs, enum wined3d_shader_type
@@ -1400,7 +1400,7 @@ void wined3d_cs_emit_set_shader(struct wined3d_cs *cs, enum wined3d_shader_type
op->type = type;
op->shader = shader;
@ -156,7 +156,7 @@ index f6c2315400..5d53fd5696 100644
}
static UINT wined3d_cs_exec_set_rasterizer_state(struct wined3d_cs *cs, const void *data)
@@ -1429,7 +1429,7 @@ void wined3d_cs_emit_set_rasterizer_state(struct wined3d_cs *cs,
@@ -1422,7 +1422,7 @@ void wined3d_cs_emit_set_rasterizer_state(struct wined3d_cs *cs,
op->opcode = WINED3D_CS_OP_SET_RASTERIZER_STATE;
op->state = rasterizer_state;
@ -165,7 +165,7 @@ index f6c2315400..5d53fd5696 100644
}
static UINT wined3d_cs_exec_set_render_state(struct wined3d_cs *cs, const void *data)
@@ -1451,7 +1451,7 @@ void wined3d_cs_emit_set_render_state(struct wined3d_cs *cs, enum wined3d_render
@@ -1444,7 +1444,7 @@ void wined3d_cs_emit_set_render_state(struct wined3d_cs *cs, enum wined3d_render
op->state = state;
op->value = value;
@ -174,7 +174,7 @@ index f6c2315400..5d53fd5696 100644
}
static UINT wined3d_cs_exec_set_texture_state(struct wined3d_cs *cs, const void *data)
@@ -1475,7 +1475,7 @@ void wined3d_cs_emit_set_texture_state(struct wined3d_cs *cs, UINT stage,
@@ -1468,7 +1468,7 @@ void wined3d_cs_emit_set_texture_state(struct wined3d_cs *cs, UINT stage,
op->state = state;
op->value = value;
@ -183,7 +183,7 @@ index f6c2315400..5d53fd5696 100644
}
static UINT wined3d_cs_exec_set_sampler_state(struct wined3d_cs *cs, const void *data)
@@ -1499,7 +1499,7 @@ void wined3d_cs_emit_set_sampler_state(struct wined3d_cs *cs, UINT sampler_idx,
@@ -1492,7 +1492,7 @@ void wined3d_cs_emit_set_sampler_state(struct wined3d_cs *cs, UINT sampler_idx,
op->state = state;
op->value = value;
@ -192,7 +192,7 @@ index f6c2315400..5d53fd5696 100644
}
static UINT wined3d_cs_exec_set_transform(struct wined3d_cs *cs, const void *data)
@@ -1523,7 +1523,7 @@ void wined3d_cs_emit_set_transform(struct wined3d_cs *cs, enum wined3d_transform
@@ -1516,7 +1516,7 @@ void wined3d_cs_emit_set_transform(struct wined3d_cs *cs, enum wined3d_transform
op->state = state;
op->matrix = *matrix;
@ -201,7 +201,7 @@ index f6c2315400..5d53fd5696 100644
}
static UINT wined3d_cs_exec_set_clip_plane(struct wined3d_cs *cs, const void *data)
@@ -1545,7 +1545,7 @@ void wined3d_cs_emit_set_clip_plane(struct wined3d_cs *cs, UINT plane_idx, const
@@ -1538,7 +1538,7 @@ void wined3d_cs_emit_set_clip_plane(struct wined3d_cs *cs, UINT plane_idx, const
op->plane_idx = plane_idx;
op->plane = *plane;
@ -210,7 +210,7 @@ index f6c2315400..5d53fd5696 100644
}
static UINT wined3d_cs_exec_set_color_key(struct wined3d_cs *cs, const void *data)
@@ -1630,7 +1630,7 @@ void wined3d_cs_emit_set_color_key(struct wined3d_cs *cs, struct wined3d_texture
@@ -1623,7 +1623,7 @@ void wined3d_cs_emit_set_color_key(struct wined3d_cs *cs, struct wined3d_texture
else
op->set = 0;
@ -219,7 +219,7 @@ index f6c2315400..5d53fd5696 100644
}
static UINT wined3d_cs_exec_set_material(struct wined3d_cs *cs, const void *data)
@@ -1651,7 +1651,7 @@ void wined3d_cs_emit_set_material(struct wined3d_cs *cs, const struct wined3d_ma
@@ -1644,7 +1644,7 @@ void wined3d_cs_emit_set_material(struct wined3d_cs *cs, const struct wined3d_ma
op->opcode = WINED3D_CS_OP_SET_MATERIAL;
op->material = *material;
@ -228,7 +228,7 @@ index f6c2315400..5d53fd5696 100644
}
static UINT wined3d_cs_exec_set_light(struct wined3d_cs *cs, const void *data)
@@ -1701,7 +1701,7 @@ void wined3d_cs_emit_set_light(struct wined3d_cs *cs, const struct wined3d_light
@@ -1694,7 +1694,7 @@ void wined3d_cs_emit_set_light(struct wined3d_cs *cs, const struct wined3d_light
op->opcode = WINED3D_CS_OP_SET_LIGHT;
op->light = *light;
@ -237,7 +237,7 @@ index f6c2315400..5d53fd5696 100644
}
static UINT wined3d_cs_exec_set_light_enable(struct wined3d_cs *cs, const void *data)
@@ -1737,7 +1737,7 @@ void wined3d_cs_emit_set_light_enable(struct wined3d_cs *cs, unsigned int idx, B
@@ -1730,7 +1730,7 @@ void wined3d_cs_emit_set_light_enable(struct wined3d_cs *cs, unsigned int idx, B
op->idx = idx;
op->enable = enable;
@ -246,7 +246,7 @@ index f6c2315400..5d53fd5696 100644
}
static UINT wined3d_cs_exec_reset_state(struct wined3d_cs *cs, const void *data)
@@ -1759,7 +1759,7 @@ void wined3d_cs_emit_reset_state(struct wined3d_cs *cs)
@@ -1752,7 +1752,7 @@ void wined3d_cs_emit_reset_state(struct wined3d_cs *cs)
op = cs->ops->require_space(cs, sizeof(*op), 0);
op->opcode = WINED3D_CS_OP_RESET_STATE;
@ -255,7 +255,7 @@ index f6c2315400..5d53fd5696 100644
}
static UINT wined3d_cs_exec_callback(struct wined3d_cs *cs, const void *data)
@@ -2151,7 +2151,7 @@ void wined3d_cs_emit_push_constants(struct wined3d_cs *cs, enum wined3d_push_con
@@ -2224,7 +2224,7 @@ void wined3d_cs_emit_push_constants(struct wined3d_cs *cs, enum wined3d_push_con
op->count = count;
memcpy(op->constants, constants, count * push_constant_info[p].size);
@ -263,8 +263,8 @@ index f6c2315400..5d53fd5696 100644
+ cs->ops->submit_delayed(cs);
}
static UINT wined3d_cs_exec_update_texture(struct wined3d_cs *cs, const void *data)
@@ -2345,6 +2345,7 @@ static const struct wined3d_cs_ops wined3d_cs_st_ops =
static UINT wined3d_cs_exec_update_swap_interval(struct wined3d_cs *cs, const void *data)
@@ -2391,6 +2391,7 @@ static const struct wined3d_cs_ops wined3d_cs_st_ops =
wined3d_cs_st_require_space,
wined3d_cs_st_submit,
wined3d_cs_st_submit,
@ -272,7 +272,7 @@ index f6c2315400..5d53fd5696 100644
};
static void wined3d_cs_list_enqueue(struct wined3d_cs_list *list, struct wined3d_cs_block *block)
@@ -2521,11 +2522,17 @@ static void wined3d_cs_mt_submit_and_wait(struct wined3d_cs *cs)
@@ -2567,11 +2568,17 @@ static void wined3d_cs_mt_submit_and_wait(struct wined3d_cs *cs)
while (!InterlockedCompareExchange(&fence, TRUE, TRUE));
}
@ -291,10 +291,10 @@ index f6c2315400..5d53fd5696 100644
static void wined3d_cs_mt_emit_stop(struct wined3d_cs *cs)
diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h
index 4c518e2a09..c6b8c59d1e 100644
index d2288647f4..6c00cec005 100644
--- a/dlls/wined3d/wined3d_private.h
+++ b/dlls/wined3d/wined3d_private.h
@@ -3239,6 +3239,7 @@ struct wined3d_cs_ops
@@ -3256,6 +3256,7 @@ struct wined3d_cs_ops
void *(*require_space)(struct wined3d_cs *cs, size_t size, int priority);
void (*submit)(struct wined3d_cs *cs);
void (*submit_and_wait)(struct wined3d_cs *cs);

File diff suppressed because it is too large Load Diff

View File

@ -1,4 +1,4 @@
From 40557e752dfc48ee40e75173c6eb32bf640ef286 Mon Sep 17 00:00:00 2001
From 418256c5f4821f87fdc353d9eb1dd5991bdf2a1c Mon Sep 17 00:00:00 2001
From: Sebastian Lackner <sebastian@fds-team.de>
Date: Mon, 21 Mar 2016 18:27:59 +0100
Subject: wined3d: Silence extremely noisy FIXME in
@ -9,18 +9,18 @@ Subject: wined3d: Silence extremely noisy FIXME in
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/dlls/wined3d/texture.c b/dlls/wined3d/texture.c
index e77e13356a5..a26b2dfb619 100644
index 3219305246..684e18b46f 100644
--- a/dlls/wined3d/texture.c
+++ b/dlls/wined3d/texture.c
@@ -1469,7 +1469,7 @@ HRESULT CDECL wined3d_texture_add_dirty_region(struct wined3d_texture *texture,
sub_resource_idx = layer * texture->level_count;
@@ -1651,7 +1651,7 @@ HRESULT CDECL wined3d_texture_add_dirty_region(struct wined3d_texture *texture,
}
if (dirty_region)
- FIXME("Ignoring dirty_region %s.\n", debug_box(dirty_region));
+ WARN("Ignoring dirty_region %s.\n", debug_box(dirty_region));
context = context_acquire(texture->resource.device, NULL, 0);
if (!wined3d_texture_load_location(texture, sub_resource_idx, context, texture->resource.map_binding))
sub_resource_idx = layer * texture->level_count;
--
2.11.0

View File

@ -1,25 +1,25 @@
From 908b5f8f2adabefde41d520582937ba85421d7c4 Mon Sep 17 00:00:00 2001
From 18d0ea3aec53d25ba5673576093c1acbc9289f9d Mon Sep 17 00:00:00 2001
From: Sebastian Lackner <sebastian@fds-team.de>
Date: Tue, 3 Mar 2015 19:20:40 +0100
Subject: ws2_32: Reuse old async ws2_async_io structures if possible.
---
dlls/ws2_32/socket.c | 27 +++++++++++++++++++++------
1 file changed, 21 insertions(+), 6 deletions(-)
dlls/ws2_32/socket.c | 28 +++++++++++++++++++++-------
1 file changed, 21 insertions(+), 7 deletions(-)
diff --git a/dlls/ws2_32/socket.c b/dlls/ws2_32/socket.c
index 22ff4797f8..c83a760718 100644
index 8f11dd8ce7..ae20bd03f3 100644
--- a/dlls/ws2_32/socket.c
+++ b/dlls/ws2_32/socket.c
@@ -473,6 +473,7 @@ static inline const char *debugstr_optval(const char *optval, int optlenval)
struct ws2_async_io
@@ -476,6 +476,7 @@ struct ws2_async_io
{
async_callback_t *callback; /* must be the first field */
struct ws2_async_io *next;
+ DWORD size;
};
struct ws2_async_shutdown
@@ -548,16 +549,30 @@ static struct ws2_async_io *alloc_async_io( DWORD size )
@@ -551,17 +552,30 @@ static struct ws2_async_io *alloc_async_io( DWORD size, async_callback_t callbac
{
/* first free remaining previous fileinfos */
@ -47,15 +47,16 @@ index 22ff4797f8..c83a760718 100644
+ }
}
- return HeapAlloc( GetProcessHeap(), 0, size );
- io = HeapAlloc( GetProcessHeap(), 0, size );
- if (io) io->callback = callback;
+ if (io || (io = HeapAlloc( GetProcessHeap(), 0, size )))
+ {
+ io->callback = callback;
+ io->size = size;
+ }
+ return io;
return io;
}
typedef NTSTATUS async_callback_t( void *user, IO_STATUS_BLOCK *io, NTSTATUS status, void **apc, void **arg );
--
2.11.0