Rebase against dca0e38d82c737cd8aeab63e08cf1990d05d9671.

FIXME: Merge buffer/texture preload commands.
This commit is contained in:
Sebastian Lackner 2016-08-11 19:47:09 +02:00
parent e875860886
commit c46fab6261
14 changed files with 264 additions and 313 deletions

View File

@ -1,27 +0,0 @@
From e733682785c0f2001a972090693c4b49bb8e1090 Mon Sep 17 00:00:00 2001
From: Sebastian Lackner <sebastian@fds-team.de>
Date: Sat, 30 Jul 2016 23:55:40 +0200
Subject: mshtml: Avoid misleading indentation warnings.
---
dlls/mshtml/script.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/dlls/mshtml/script.c b/dlls/mshtml/script.c
index 40deda4..19f3541 100644
--- a/dlls/mshtml/script.c
+++ b/dlls/mshtml/script.c
@@ -991,8 +991,8 @@ static HRESULT ScriptBSC_read_data(BSCallback *bsc, IStream *stream)
if(This->bsc.readed >= This->size) {
void *new_buf;
new_buf = heap_realloc(This->buf, This->size << 1);
- if(!new_buf)
- return E_OUTOFMEMORY;
+ if(!new_buf)
+ return E_OUTOFMEMORY;
This->size <<= 1;
This->buf = new_buf;
}
--
2.9.0

View File

@ -52,7 +52,7 @@ usage()
# Get the upstream commit sha
upstream_commit()
{
echo "882980c17a9a033fa8e49a4c116af9583698d218"
echo "dca0e38d82c737cd8aeab63e08cf1990d05d9671"
}
# Show version information
@ -2332,15 +2332,14 @@ fi
# | Modified files:
# | * dlls/amstream/mediastreamfilter.c, dlls/comctl32/listview.c, dlls/d2d1/brush.c, dlls/d2d1/geometry.c, dlls/d3d11/view.c,
# | dlls/d3d8/texture.c, dlls/d3d9/tests/visual.c, dlls/d3d9/texture.c, dlls/ddraw/viewport.c, dlls/dsound/primary.c,
# | dlls/dwrite/layout.c, dlls/mshtml/script.c, dlls/msvcirt/tests/msvcirt.c, dlls/msxml3/schema.c,
# | dlls/netapi32/netapi32.c, dlls/oleaut32/oleaut.c, dlls/oleaut32/tests/safearray.c, dlls/rpcrt4/cstub.c,
# | dlls/shell32/tests/shellole.c, dlls/shlwapi/tests/ordinal.c, dlls/vbscript/vbdisp.c, dlls/winealsa.drv/mmdevdrv.c,
# | dlls/wined3d/glsl_shader.c, include/d3dtypes.h, include/wine/list.h, include/wine/rbtree.h, include/winnt.h,
# | server/request.c, server/sock.c, tools/makedep.c
# | dlls/dwrite/layout.c, dlls/msvcirt/tests/msvcirt.c, dlls/msxml3/schema.c, dlls/netapi32/netapi32.c,
# | dlls/oleaut32/oleaut.c, dlls/oleaut32/tests/safearray.c, dlls/rpcrt4/cstub.c, dlls/shell32/tests/shellole.c,
# | dlls/shlwapi/tests/ordinal.c, dlls/vbscript/vbdisp.c, dlls/winealsa.drv/mmdevdrv.c, dlls/wined3d/glsl_shader.c,
# | include/d3dtypes.h, include/wine/list.h, include/wine/rbtree.h, include/winnt.h, server/request.c, server/sock.c,
# | tools/makedep.c
# |
if test "$enable_Compiler_Warnings" -eq 1; then
patch_apply Compiler_Warnings/0001-comctl32-Avoid-misleading-indentation-warnings.patch
patch_apply Compiler_Warnings/0004-mshtml-Avoid-misleading-indentation-warnings.patch
patch_apply Compiler_Warnings/0005-msvcirt-tests-Avoid-misleading-indentation-warnings.patch
patch_apply Compiler_Warnings/0006-oleaut32-tests-Avoid-misleading-indentation-warnings.patch
patch_apply Compiler_Warnings/0009-shell32-tests-Avoid-misleading-indentation-warnings.patch
@ -2363,7 +2362,6 @@ if test "$enable_Compiler_Warnings" -eq 1; then
patch_apply Compiler_Warnings/0031-include-Check-element-type-in-CONTAINING_RECORD-and-.patch
(
echo '+ { "Sebastian Lackner", "comctl32: Avoid misleading indentation warnings.", 1 },';
echo '+ { "Sebastian Lackner", "mshtml: Avoid misleading indentation warnings.", 1 },';
echo '+ { "Sebastian Lackner", "msvcirt/tests: Avoid misleading indentation warnings.", 1 },';
echo '+ { "Sebastian Lackner", "oleaut32/tests: Avoid misleading indentation warnings.", 1 },';
echo '+ { "Sebastian Lackner", "shell32/tests: Avoid misleading indentation warnings.", 1 },';

View File

@ -1,4 +1,4 @@
From 67cf23ba06fa874f27f0170ba9c8ea90ea8ffc3b Mon Sep 17 00:00:00 2001
From 46a184710ee4e78749c9d102ae2929a754c1433b Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Michael=20M=C3=BCller?= <michael@fds-team.de>
Date: Thu, 28 Jan 2016 06:43:00 +0100
Subject: ntdll: Report system information SystemPerformanceInformation info
@ -9,7 +9,7 @@ Subject: ntdll: Report system information SystemPerformanceInformation info
1 file changed, 35 insertions(+)
diff --git a/dlls/ntdll/nt.c b/dlls/ntdll/nt.c
index 46393a4..ac6f8dd 100644
index 46393a4..0bf7803 100644
--- a/dlls/ntdll/nt.c
+++ b/dlls/ntdll/nt.c
@@ -30,6 +30,9 @@
@ -26,7 +26,7 @@ index 46393a4..ac6f8dd 100644
SYSTEM_PERFORMANCE_INFORMATION spi;
static BOOL fixme_written = FALSE;
FILE *fp;
+ #ifdef HAVE_SYS_SYSINFO_H
+ #ifdef HAVE_SYSINFO
+ struct sysinfo sinfo;
+ #endif
@ -36,7 +36,7 @@ index 46393a4..ac6f8dd 100644
spi.IdleTime.QuadPart = ++idle;
}
+ #ifdef HAVE_SYS_SYSINFO_H
+ #ifdef HAVE_SYSINFO
+ if (!sysinfo(&sinfo))
+ {
+ ULONG64 freeram = (ULONG64)sinfo.freeram * sinfo.mem_unit;

View File

@ -1,4 +1,4 @@
From 9ac471fe3bc3eb4156bbcfef799314dabed8eec7 Mon Sep 17 00:00:00 2001
From 086e024e36bde8a490e128bfe552129eb51396d5 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Stefan=20D=C3=B6singer?= <stefan@codeweavers.com>
Date: Tue, 1 Oct 2013 14:31:56 +0200
Subject: wined3d: Hackily introduce a multithreaded command stream
@ -10,7 +10,7 @@ Subject: wined3d: Hackily introduce a multithreaded command stream
3 files changed, 369 insertions(+), 31 deletions(-)
diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c
index 825523e..bb090a3 100644
index b9d7e87..2789726 100644
--- a/dlls/wined3d/cs.c
+++ b/dlls/wined3d/cs.c
@@ -24,8 +24,19 @@ WINE_DEFAULT_DEBUG_CHANNEL(d3d);
@ -674,7 +674,7 @@ index 825523e..bb090a3 100644
}
void wined3d_cs_emit_query_issue(struct wined3d_cs *cs, struct wined3d_query *query, DWORD flags)
@@ -1252,12 +1460,14 @@ void wined3d_cs_emit_query_issue(struct wined3d_cs *cs, struct wined3d_query *qu
@@ -1252,13 +1460,15 @@ void wined3d_cs_emit_query_issue(struct wined3d_cs *cs, struct wined3d_query *qu
cs->ops->submit(cs);
}
@ -685,12 +685,13 @@ index 825523e..bb090a3 100644
struct wined3d_resource *resource = op->resource;
resource->resource_ops->resource_unload(resource);
wined3d_resource_release(resource);
+
+ return sizeof(*op);
}
void wined3d_cs_emit_unload_resource(struct wined3d_cs *cs, struct wined3d_resource *resource)
@@ -1271,8 +1481,9 @@ void wined3d_cs_emit_unload_resource(struct wined3d_cs *cs, struct wined3d_resou
@@ -1274,8 +1484,9 @@ void wined3d_cs_emit_unload_resource(struct wined3d_cs *cs, struct wined3d_resou
cs->ops->submit(cs);
}
@ -701,7 +702,7 @@ index 825523e..bb090a3 100644
/* WINED3D_CS_OP_PRESENT */ wined3d_cs_exec_present,
/* WINED3D_CS_OP_CLEAR */ wined3d_cs_exec_clear,
/* WINED3D_CS_OP_DRAW */ wined3d_cs_exec_draw,
@@ -1335,6 +1546,58 @@ static const struct wined3d_cs_ops wined3d_cs_st_ops =
@@ -1338,6 +1549,58 @@ static const struct wined3d_cs_ops wined3d_cs_st_ops =
wined3d_cs_st_submit,
};
@ -760,7 +761,7 @@ index 825523e..bb090a3 100644
struct wined3d_cs *wined3d_cs_create(struct wined3d_device *device)
{
const struct wined3d_gl_info *gl_info = &device->adapter->gl_info;
@@ -1361,12 +1624,60 @@ struct wined3d_cs *wined3d_cs_create(struct wined3d_device *device)
@@ -1364,12 +1627,60 @@ struct wined3d_cs *wined3d_cs_create(struct wined3d_device *device)
return NULL;
}

View File

@ -1,38 +1,22 @@
From f62a560d5351df46166c32859e13ab43f7a43453 Mon Sep 17 00:00:00 2001
From 3f4145a66ef9173bf608b12c4e210ee0f0369436 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Stefan=20D=C3=B6singer?= <stefan@codeweavers.com>
Date: Thu, 4 Apr 2013 11:50:09 +0200
Subject: wined3d: Request a glFinish before modifying resources outside the cs
---
dlls/wined3d/buffer.c | 17 +++++++++++++++++
dlls/wined3d/buffer.c | 18 +++++++++++++++++-
dlls/wined3d/cs.c | 30 ++++++++++++++++++++++++++++++
dlls/wined3d/device.c | 27 +++++++++++++++++++++++++++
dlls/wined3d/surface.c | 7 +++++++
dlls/wined3d/texture.c | 14 ++++++++++++++
dlls/wined3d/wined3d_private.h | 1 +
6 files changed, 96 insertions(+)
6 files changed, 96 insertions(+), 1 deletion(-)
diff --git a/dlls/wined3d/buffer.c b/dlls/wined3d/buffer.c
index fc7b04d..c16578d 100644
index 9cc8ee0..85886bf 100644
--- a/dlls/wined3d/buffer.c
+++ b/dlls/wined3d/buffer.c
@@ -931,6 +931,15 @@ void buffer_internal_preload(struct wined3d_buffer *buffer, struct wined3d_conte
void CDECL wined3d_buffer_preload(struct wined3d_buffer *buffer)
{
struct wined3d_context *context;
+ struct wined3d_device *device = buffer->resource.device;
+
+ if (wined3d_settings.cs_multithreaded)
+ {
+ FIXME("Waiting for cs.\n");
+ wined3d_cs_emit_glfinish(device->cs);
+ device->cs->ops->finish(device->cs);
+ }
+
context = context_acquire(buffer->resource.device, NULL);
buffer_internal_preload(buffer, context, NULL);
context_release(context);
@@ -947,9 +956,17 @@ HRESULT CDECL wined3d_buffer_map(struct wined3d_buffer *buffer, UINT offset, UIN
@@ -939,9 +939,17 @@ HRESULT CDECL wined3d_buffer_map(struct wined3d_buffer *buffer, UINT offset, UIN
{
LONG count;
BYTE *base;
@ -50,8 +34,26 @@ index fc7b04d..c16578d 100644
flags = wined3d_resource_sanitize_map_flags(&buffer->resource, flags);
/* Filter redundant WINED3D_MAP_DISCARD maps. The 3DMark2001 multitexture
* fill rate test seems to depend on this. When we map a buffer with
@@ -1222,8 +1230,16 @@ static ULONG buffer_resource_decref(struct wined3d_resource *resource)
static void buffer_resource_preload(struct wined3d_resource *resource)
{
struct wined3d_context *context;
+ struct wined3d_device *device = resource->device;
- context = context_acquire(resource->device, NULL);
+ if (wined3d_settings.cs_multithreaded)
+ {
+ FIXME("Waiting for cs.\n");
+ wined3d_cs_emit_glfinish(device->cs);
+ device->cs->ops->finish(device->cs);
+ }
+
+ context = context_acquire(device, NULL);
buffer_internal_preload(buffer_from_resource(resource), context, NULL);
context_release(context);
}
diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c
index 92c251c..c7ee4d2 100644
index bf1d3d7..3a066d2 100644
--- a/dlls/wined3d/cs.c
+++ b/dlls/wined3d/cs.c
@@ -70,6 +70,7 @@ enum wined3d_cs_op
@ -74,7 +76,7 @@ index 92c251c..c7ee4d2 100644
/* FIXME: The list synchronization probably isn't particularly fast. */
static void wined3d_cs_list_enqueue(struct wined3d_cs_list *list, struct wined3d_cs_block *block)
{
@@ -1602,6 +1608,29 @@ void wined3d_cs_emit_unload_resource(struct wined3d_cs *cs, struct wined3d_resou
@@ -1605,6 +1611,29 @@ void wined3d_cs_emit_unload_resource(struct wined3d_cs *cs, struct wined3d_resou
cs->ops->submit(cs);
}
@ -104,7 +106,7 @@ index 92c251c..c7ee4d2 100644
static UINT (* const wined3d_cs_op_handlers[])(struct wined3d_cs *cs, const void *data) =
{
/* WINED3D_CS_OP_FENCE */ wined3d_cs_exec_fence,
@@ -1638,6 +1667,7 @@ static UINT (* const wined3d_cs_op_handlers[])(struct wined3d_cs *cs, const void
@@ -1641,6 +1670,7 @@ static UINT (* const wined3d_cs_op_handlers[])(struct wined3d_cs *cs, const void
/* WINED3D_CS_OP_STATEBLOCK */ wined3d_cs_exec_transfer_stateblock,
/* WINED3D_CS_OP_SET_VS_CONSTS_F */ wined3d_cs_exec_set_vs_consts_f,
/* WINED3D_CS_OP_SET_PS_CONSTS_F */ wined3d_cs_exec_set_ps_consts_f,
@ -113,7 +115,7 @@ index 92c251c..c7ee4d2 100644
static void *wined3d_cs_st_require_space(struct wined3d_cs *cs, size_t size)
diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c
index 7006c62..efd8093 100644
index 6ad0a83..77fbb61 100644
--- a/dlls/wined3d/device.c
+++ b/dlls/wined3d/device.c
@@ -2949,6 +2949,13 @@ static HRESULT process_vertices_strided(const struct wined3d_device *device, DWO
@ -190,10 +192,10 @@ index c63578a..5601804 100644
{
WARN("D3D not initialized, using fallback.\n");
diff --git a/dlls/wined3d/texture.c b/dlls/wined3d/texture.c
index 74e4450..1306be9 100644
index 1e34cd7..e804ac2 100644
--- a/dlls/wined3d/texture.c
+++ b/dlls/wined3d/texture.c
@@ -1800,6 +1800,13 @@ static HRESULT texture_resource_sub_resource_map(struct wined3d_resource *resour
@@ -1803,6 +1803,13 @@ static HRESULT texture_resource_sub_resource_map(struct wined3d_resource *resour
return WINED3DERR_INVALIDCALL;
}
@ -207,7 +209,7 @@ index 74e4450..1306be9 100644
flags = wined3d_resource_sanitize_map_flags(resource, flags);
if (device->d3d_initialized)
@@ -2958,6 +2965,13 @@ HRESULT CDECL wined3d_texture_get_dc(struct wined3d_texture *texture, unsigned i
@@ -2962,6 +2969,13 @@ HRESULT CDECL wined3d_texture_get_dc(struct wined3d_texture *texture, unsigned i
if (texture->resource.map_count && !(texture->flags & WINED3D_TEXTURE_GET_DC_LENIENT))
return WINED3DERR_INVALIDCALL;
@ -222,10 +224,10 @@ index 74e4450..1306be9 100644
context = context_acquire(device, NULL);
diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h
index ebdb49e..58c817d 100644
index 243cc29..234b33d 100644
--- a/dlls/wined3d/wined3d_private.h
+++ b/dlls/wined3d/wined3d_private.h
@@ -3073,6 +3073,7 @@ void wined3d_cs_emit_destroy_object(struct wined3d_cs *cs,
@@ -3074,6 +3074,7 @@ void wined3d_cs_emit_destroy_object(struct wined3d_cs *cs,
void (*callback)(void *object), void *object) DECLSPEC_HIDDEN;
void wined3d_cs_emit_draw(struct wined3d_cs *cs, int base_vertex_idx, unsigned int start_idx, unsigned int index_count,
unsigned int start_instance, unsigned int instance_count, BOOL indexed) DECLSPEC_HIDDEN;

View File

@ -1,20 +1,21 @@
From 0f80ece0d6050b8850ce34cceb8e15ef57bf8af0 Mon Sep 17 00:00:00 2001
From 2d3f1b5a6ced8163aaa6bb33f245abf67be681eb Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Stefan=20D=C3=B6singer?= <stefan@codeweavers.com>
Date: Wed, 10 Apr 2013 19:53:44 +0200
Subject: wined3d: Finish the cs before changing the texture lod
---
dlls/wined3d/texture.c | 7 +++++++
1 file changed, 7 insertions(+)
dlls/wined3d/texture.c | 8 +++++++-
1 file changed, 7 insertions(+), 1 deletion(-)
diff --git a/dlls/wined3d/texture.c b/dlls/wined3d/texture.c
index aae0b00..f368777 100644
index 439f9ab..afbaac1 100644
--- a/dlls/wined3d/texture.c
+++ b/dlls/wined3d/texture.c
@@ -885,6 +885,13 @@ DWORD CDECL wined3d_texture_set_lod(struct wined3d_texture *texture, DWORD lod)
@@ -1117,7 +1117,13 @@ DWORD CDECL wined3d_texture_set_lod(struct wined3d_texture *texture, DWORD lod)
if (texture->lod != lod)
{
- wined3d_resource_wait_idle(&texture->resource);
+ if (wined3d_settings.cs_multithreaded)
+ {
+ struct wined3d_device *device = texture->resource.device;
@ -26,5 +27,5 @@ index aae0b00..f368777 100644
texture->texture_rgb.base_level = ~0u;
--
2.8.0
2.9.0

View File

@ -1,4 +1,4 @@
From e7e3a3a2157e282988cb3350745373259a5d040f Mon Sep 17 00:00:00 2001
From 6494b85657fd270879356f5fcb81225f12acdd1c Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Stefan=20D=C3=B6singer?= <stefan@codeweavers.com>
Date: Thu, 4 Jul 2013 23:33:14 +0200
Subject: wined3d: Replace the linked lists with a ringbuffer
@ -9,7 +9,7 @@ Subject: wined3d: Replace the linked lists with a ringbuffer
2 files changed, 165 insertions(+), 226 deletions(-)
diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c
index 6dd95af..f66056b 100644
index 23579c4..4ebb988 100644
--- a/dlls/wined3d/cs.c
+++ b/dlls/wined3d/cs.c
@@ -22,20 +22,10 @@
@ -500,16 +500,16 @@ index 6dd95af..f66056b 100644
}
static UINT wined3d_cs_exec_unload_resource(struct wined3d_cs *cs, const void *data)
@@ -1791,7 +1715,7 @@ void wined3d_cs_emit_unload_resource(struct wined3d_cs *cs, struct wined3d_resou
op->opcode = WINED3D_CS_OP_UNLOAD_RESOURCE;
op->resource = resource;
@@ -1794,7 +1718,7 @@ void wined3d_cs_emit_unload_resource(struct wined3d_cs *cs, struct wined3d_resou
wined3d_resource_acquire(resource);
- cs->ops->submit(cs);
+ cs->ops->submit(cs, sizeof(*op));
}
static UINT wined3d_cs_exec_glfinish(struct wined3d_cs *cs, const void *data)
@@ -1817,7 +1741,7 @@ void wined3d_cs_emit_glfinish(struct wined3d_cs *cs)
@@ -1820,7 +1744,7 @@ void wined3d_cs_emit_glfinish(struct wined3d_cs *cs)
op = cs->ops->require_space(cs, sizeof(*op));
op->opcode = WINED3D_CS_OP_GLFINISH;
@ -518,7 +518,7 @@ index 6dd95af..f66056b 100644
}
static UINT wined3d_cs_exec_set_base_vertex_index(struct wined3d_cs *cs, const void *data)
@@ -1839,7 +1763,7 @@ void wined3d_cs_emit_set_base_vertex_index(struct wined3d_cs *cs,
@@ -1842,7 +1766,7 @@ void wined3d_cs_emit_set_base_vertex_index(struct wined3d_cs *cs,
op->opcode = WINED3D_CS_OP_SET_BASE_VERTEX_INDEX;
op->base_vertex_index = base_vertex_index;
@ -527,7 +527,7 @@ index 6dd95af..f66056b 100644
}
static UINT wined3d_cs_exec_set_primitive_type(struct wined3d_cs *cs, const void *data)
@@ -1865,7 +1789,7 @@ void wined3d_cs_emit_set_primitive_type(struct wined3d_cs *cs, GLenum primitive_
@@ -1868,7 +1792,7 @@ void wined3d_cs_emit_set_primitive_type(struct wined3d_cs *cs, GLenum primitive_
op->opcode = WINED3D_CS_OP_SET_PRIMITIVE_TYPE;
op->gl_primitive_type = primitive_type;
@ -536,7 +536,7 @@ index 6dd95af..f66056b 100644
}
static UINT wined3d_cs_exec_set_light(struct wined3d_cs *cs, const void *data)
@@ -1922,7 +1846,7 @@ void wined3d_cs_emit_set_light(struct wined3d_cs *cs, const struct wined3d_light
@@ -1925,7 +1849,7 @@ void wined3d_cs_emit_set_light(struct wined3d_cs *cs, const struct wined3d_light
op->opcode = WINED3D_CS_OP_SET_LIGHT;
op->light = *light;
@ -545,7 +545,7 @@ index 6dd95af..f66056b 100644
}
static UINT wined3d_cs_exec_set_light_enable(struct wined3d_cs *cs, const void *data)
@@ -2011,7 +1935,7 @@ void wined3d_cs_emit_set_light_enable(struct wined3d_cs *cs, UINT idx, BOOL enab
@@ -2014,7 +1938,7 @@ void wined3d_cs_emit_set_light_enable(struct wined3d_cs *cs, UINT idx, BOOL enab
op->idx = idx;
op->enable = enable;
@ -554,7 +554,7 @@ index 6dd95af..f66056b 100644
}
static UINT wined3d_cs_exec_blt(struct wined3d_cs *cs, const void *data)
@@ -2043,7 +1967,7 @@ void wined3d_cs_emit_blt(struct wined3d_cs *cs, struct wined3d_surface *dst_surf
@@ -2046,7 +1970,7 @@ void wined3d_cs_emit_blt(struct wined3d_cs *cs, struct wined3d_surface *dst_surf
if (fx)
op->fx = *fx;
@ -563,7 +563,7 @@ index 6dd95af..f66056b 100644
}
static UINT wined3d_cs_exec_clear_rtv(struct wined3d_cs *cs, const void *data)
@@ -2076,7 +2000,7 @@ void wined3d_cs_emit_clear_rtv(struct wined3d_cs *cs, struct wined3d_rendertarge
@@ -2079,7 +2003,7 @@ void wined3d_cs_emit_clear_rtv(struct wined3d_cs *cs, struct wined3d_rendertarge
op->stencil = stencil;
op->blitter = blitter;
@ -572,7 +572,7 @@ index 6dd95af..f66056b 100644
}
static UINT wined3d_cs_exec_texture_map(struct wined3d_cs *cs, const void *data)
@@ -2101,12 +2025,14 @@ void *wined3d_cs_emit_texture_map(struct wined3d_cs *cs, struct wined3d_texture
@@ -2104,12 +2028,14 @@ void *wined3d_cs_emit_texture_map(struct wined3d_cs *cs, struct wined3d_texture
op->flags = flags;
op->mem = &ret;
@ -588,7 +588,7 @@ index 6dd95af..f66056b 100644
return ret;
}
@@ -2129,11 +2055,13 @@ void wined3d_cs_emit_texture_unmap(struct wined3d_cs *cs, struct wined3d_texture
@@ -2132,11 +2058,13 @@ void wined3d_cs_emit_texture_unmap(struct wined3d_cs *cs, struct wined3d_texture
op->texture = texture;
op->sub_resource_idx = sub_resource_idx;
@ -603,7 +603,7 @@ index 6dd95af..f66056b 100644
/* WINED3D_CS_OP_FENCE */ wined3d_cs_exec_fence,
/* WINED3D_CS_OP_PRESENT */ wined3d_cs_exec_present,
/* WINED3D_CS_OP_CLEAR */ wined3d_cs_exec_clear,
@@ -2182,42 +2110,59 @@ static UINT (* const wined3d_cs_op_handlers[])(struct wined3d_cs *cs, const void
@@ -2185,42 +2113,59 @@ static UINT (* const wined3d_cs_op_handlers[])(struct wined3d_cs *cs, const void
/* WINED3D_CS_OP_TEXTURE_UNMAP */ wined3d_cs_exec_texture_unmap,
};
@ -686,7 +686,7 @@ index 6dd95af..f66056b 100644
};
/* FIXME: wined3d_device_uninit_3d() should either flush and wait, or be an
@@ -2229,9 +2174,38 @@ static void wined3d_cs_emit_stop(struct wined3d_cs *cs)
@@ -2232,9 +2177,38 @@ static void wined3d_cs_emit_stop(struct wined3d_cs *cs)
op = wined3d_cs_mt_require_space(cs, sizeof(*op));
op->opcode = WINED3D_CS_OP_STOP;
@ -726,7 +726,7 @@ index 6dd95af..f66056b 100644
void wined3d_cs_switch_onscreen_ds(struct wined3d_cs *cs,
struct wined3d_context *context, struct wined3d_surface *depth_stencil)
{
@@ -2255,31 +2229,32 @@ void wined3d_cs_switch_onscreen_ds(struct wined3d_cs *cs,
@@ -2258,31 +2232,32 @@ void wined3d_cs_switch_onscreen_ds(struct wined3d_cs *cs,
static DWORD WINAPI wined3d_cs_run(void *thread_param)
{
struct wined3d_cs *cs = thread_param;
@ -773,7 +773,7 @@ index 6dd95af..f66056b 100644
}
done:
@@ -2304,25 +2279,10 @@ struct wined3d_cs *wined3d_cs_create(struct wined3d_device *device)
@@ -2307,25 +2282,10 @@ struct wined3d_cs *wined3d_cs_create(struct wined3d_device *device)
cs->ops = &wined3d_cs_st_ops;
cs->device = device;
@ -799,7 +799,7 @@ index 6dd95af..f66056b 100644
if (!(cs->thread = CreateThread(NULL, 0, wined3d_cs_run, cs, 0, NULL)))
{
ERR("Failed to create wined3d command stream thread.\n");
@@ -2334,12 +2294,7 @@ struct wined3d_cs *wined3d_cs_create(struct wined3d_device *device)
@@ -2337,12 +2297,7 @@ struct wined3d_cs *wined3d_cs_create(struct wined3d_device *device)
err:
if (cs)
@ -812,7 +812,7 @@ index 6dd95af..f66056b 100644
HeapFree(GetProcessHeap(), 0, cs);
return NULL;
}
@@ -2358,17 +2313,7 @@ void wined3d_cs_destroy(struct wined3d_cs *cs)
@@ -2361,17 +2316,7 @@ void wined3d_cs_destroy(struct wined3d_cs *cs)
CloseHandle(cs->thread);
if (ret != WAIT_OBJECT_0)
ERR("Wait failed (%#x).\n", ret);

View File

@ -1,4 +1,4 @@
From b7a9ab5cf76fcde0dcfadfa402587a7282b93718 Mon Sep 17 00:00:00 2001
From 25fcdc6e671df8cf7cb68a50e6dc59921a8c2738 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Stefan=20D=C3=B6singer?= <stefan@codeweavers.com>
Date: Thu, 4 Jul 2013 23:40:56 +0200
Subject: wined3d: Don't preload buffers on unmap
@ -8,20 +8,20 @@ Subject: wined3d: Don't preload buffers on unmap
1 file changed, 4 deletions(-)
diff --git a/dlls/wined3d/buffer.c b/dlls/wined3d/buffer.c
index a50bba4..2c66a4b 100644
index 85886bf..3ecd46b 100644
--- a/dlls/wined3d/buffer.c
+++ b/dlls/wined3d/buffer.c
@@ -1133,10 +1133,6 @@ void CDECL wined3d_buffer_unmap(struct wined3d_buffer *buffer)
@@ -1108,10 +1108,6 @@ void CDECL wined3d_buffer_unmap(struct wined3d_buffer *buffer)
buffer_clear_dirty_areas(buffer);
buffer->map_ptr = NULL;
}
- else if (buffer->flags & WINED3D_BUFFER_HASDESC)
- {
- wined3d_buffer_preload(buffer);
- wined3d_resource_preload(&buffer->resource);
- }
}
HRESULT wined3d_buffer_copy(struct wined3d_buffer *dst_buffer, unsigned int dst_offset,
--
2.8.0
2.9.0

View File

@ -1,16 +1,16 @@
From 37b8a4fd33c54e561d3da0e57319b333df55bdbd Mon Sep 17 00:00:00 2001
From 378cf53090eb9cd3f4ba691671913e1c9ba36872 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Stefan=20D=C3=B6singer?= <stefan@codeweavers.com>
Date: Thu, 1 Aug 2013 00:10:40 +0200
Subject: wined3d: Send texture preloads through the CS
---
dlls/wined3d/cs.c | 32 ++++++++++++++++++++++++++++++++
dlls/wined3d/texture.c | 6 ++----
dlls/wined3d/texture.c | 7 ++-----
dlls/wined3d/wined3d_private.h | 1 +
3 files changed, 35 insertions(+), 4 deletions(-)
3 files changed, 35 insertions(+), 5 deletions(-)
diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c
index 550dbcd..6f78651 100644
index a36d205..b7c33ab 100644
--- a/dlls/wined3d/cs.c
+++ b/dlls/wined3d/cs.c
@@ -72,6 +72,7 @@ enum wined3d_cs_op
@ -34,7 +34,7 @@ index 550dbcd..6f78651 100644
static void wined3d_cs_mt_submit(struct wined3d_cs *cs, size_t size)
{
LONG new_val = (cs->queue.head + size) & (WINED3D_CS_QUEUE_SIZE - 1);
@@ -2095,6 +2102,30 @@ void wined3d_cs_emit_texture_unmap(struct wined3d_cs *cs, struct wined3d_texture
@@ -2098,6 +2105,30 @@ void wined3d_cs_emit_texture_unmap(struct wined3d_cs *cs, struct wined3d_texture
cs->ops->submit(cs, sizeof(*op));
}
@ -65,7 +65,7 @@ index 550dbcd..6f78651 100644
static UINT (* const wined3d_cs_op_handlers[])(struct wined3d_cs *cs, const void *data) =
{
/* WINED3D_CS_OP_NOP */ wined3d_cs_exec_nop,
@@ -2145,6 +2176,7 @@ static UINT (* const wined3d_cs_op_handlers[])(struct wined3d_cs *cs, const void
@@ -2148,6 +2179,7 @@ static UINT (* const wined3d_cs_op_handlers[])(struct wined3d_cs *cs, const void
/* WINED3D_CS_OP_CLEAR_RTV */ wined3d_cs_exec_clear_rtv,
/* WINED3D_CS_OP_TEXTURE_MAP */ wined3d_cs_exec_texture_map,
/* WINED3D_CS_OP_TEXTURE_UNMAP */ wined3d_cs_exec_texture_unmap,
@ -74,27 +74,28 @@ index 550dbcd..6f78651 100644
static inline void *_wined3d_cs_mt_require_space(struct wined3d_cs *cs, size_t size, BOOL prio)
diff --git a/dlls/wined3d/texture.c b/dlls/wined3d/texture.c
index 1acf5d5..19105a5 100644
index b391afd..4c8856d 100644
--- a/dlls/wined3d/texture.c
+++ b/dlls/wined3d/texture.c
@@ -1051,10 +1051,8 @@ void wined3d_texture_load(struct wined3d_texture *texture,
void CDECL wined3d_texture_preload(struct wined3d_texture *texture)
@@ -1684,11 +1684,8 @@ static ULONG texture_resource_decref(struct wined3d_resource *resource)
static void texture_resource_preload(struct wined3d_resource *resource)
{
struct wined3d_texture *texture = texture_from_resource(resource);
- struct wined3d_context *context;
- context = context_acquire(texture->resource.device, NULL);
-
- context = context_acquire(resource->device, NULL);
- wined3d_texture_load(texture, context, texture->flags & WINED3D_TEXTURE_IS_SRGB);
- context_release(context);
+ const struct wined3d_device *device = texture->resource.device;
+ wined3d_cs_emit_texture_preload(device->cs, texture);
}
void * CDECL wined3d_texture_get_parent(const struct wined3d_texture *texture)
static void wined3d_texture_unload(struct wined3d_resource *resource)
diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h
index 949fb07..5f918f7 100644
index 784a622..fc825a9 100644
--- a/dlls/wined3d/wined3d_private.h
+++ b/dlls/wined3d/wined3d_private.h
@@ -3153,6 +3153,7 @@ void wined3d_cs_emit_set_vertex_declaration(struct wined3d_cs *cs,
@@ -3154,6 +3154,7 @@ void wined3d_cs_emit_set_vertex_declaration(struct wined3d_cs *cs,
void wined3d_cs_emit_set_viewport(struct wined3d_cs *cs, const struct wined3d_viewport *viewport) DECLSPEC_HIDDEN;
void *wined3d_cs_emit_texture_map(struct wined3d_cs *cs, struct wined3d_texture *texture,
unsigned int sub_resource_idx, DWORD flags) DECLSPEC_HIDDEN;

View File

@ -1,4 +1,4 @@
From 29831b11a874263e360db38a16f3497dcdf1f7af Mon Sep 17 00:00:00 2001
From 7c04fd95e744e6c5108828ee35e6074ed3e20bf9 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Stefan=20D=C3=B6singer?= <stefan@codeweavers.com>
Date: Sat, 6 Jul 2013 22:52:06 +0200
Subject: wined3d: Ignore buffer->resource.map_count in the CS
@ -14,10 +14,10 @@ incrementing map_count.
1 file changed, 8 insertions(+), 7 deletions(-)
diff --git a/dlls/wined3d/buffer.c b/dlls/wined3d/buffer.c
index e51a87e..e652695 100644
index b154c24..6ea1e5e 100644
--- a/dlls/wined3d/buffer.c
+++ b/dlls/wined3d/buffer.c
@@ -461,7 +461,8 @@ void buffer_get_memory(struct wined3d_buffer *buffer, struct wined3d_context *co
@@ -464,7 +464,8 @@ void buffer_get_memory(struct wined3d_buffer *buffer, struct wined3d_context *co
data->buffer_object = buffer->buffer_object;
if (!buffer->buffer_object)
{
@ -27,7 +27,7 @@ index e51a87e..e652695 100644
{
buffer_create_buffer_object(buffer, context);
if (buffer->buffer_object)
@@ -737,12 +738,6 @@ void buffer_internal_preload(struct wined3d_buffer *buffer, struct wined3d_conte
@@ -755,12 +756,6 @@ void buffer_internal_preload(struct wined3d_buffer *buffer, struct wined3d_conte
TRACE("buffer %p.\n", buffer);
@ -40,11 +40,11 @@ index e51a87e..e652695 100644
buffer_mark_used(buffer);
if (!buffer->buffer_object)
@@ -933,6 +928,12 @@ void CDECL wined3d_buffer_preload(struct wined3d_buffer *buffer)
@@ -1246,6 +1241,12 @@ static void buffer_resource_preload(struct wined3d_resource *resource)
struct wined3d_context *context;
struct wined3d_device *device = buffer->resource.device;
struct wined3d_device *device = resource->device;
+ if (buffer->resource.map_count)
+ if (resource->map_count)
+ {
+ WARN("Buffer is mapped, skipping preload.\n");
+ return;
@ -54,5 +54,5 @@ index e51a87e..e652695 100644
{
FIXME("Waiting for cs.\n");
--
2.8.0
2.9.0

View File

@ -1,4 +1,4 @@
From 366a6468228b98fd526e614503364b61a4d6b61b Mon Sep 17 00:00:00 2001
From 9718a2a0fb3ca81fc32a5ffc97522ae448363a9d Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Stefan=20D=C3=B6singer?= <stefan@codeweavers.com>
Date: Sun, 7 Jul 2013 12:02:59 +0200
Subject: wined3d: Send buffer preloads through the CS
@ -13,18 +13,18 @@ the dirty area list, have to be considered.
3 files changed, 33 insertions(+), 11 deletions(-)
diff --git a/dlls/wined3d/buffer.c b/dlls/wined3d/buffer.c
index 1da6f03..8b6d6b6 100644
index 6ea1e5e..2625d9d 100644
--- a/dlls/wined3d/buffer.c
+++ b/dlls/wined3d/buffer.c
@@ -929,7 +929,6 @@ void buffer_internal_preload(struct wined3d_buffer *buffer, struct wined3d_conte
@@ -1238,7 +1238,6 @@ static ULONG buffer_resource_decref(struct wined3d_resource *resource)
void CDECL wined3d_buffer_preload(struct wined3d_buffer *buffer)
static void buffer_resource_preload(struct wined3d_resource *resource)
{
- struct wined3d_context *context;
struct wined3d_device *device = buffer->resource.device;
struct wined3d_device *device = resource->device;
if (buffer->resource.map_count)
@@ -938,16 +937,7 @@ void CDECL wined3d_buffer_preload(struct wined3d_buffer *buffer)
if (resource->map_count)
@@ -1247,16 +1246,7 @@ static void buffer_resource_preload(struct wined3d_resource *resource)
return;
}
@ -35,15 +35,15 @@ index 1da6f03..8b6d6b6 100644
- device->cs->ops->finish(device->cs);
- }
-
- context = context_acquire(buffer->resource.device, NULL);
- buffer_internal_preload(buffer, context, NULL);
- context = context_acquire(device, NULL);
- buffer_internal_preload(buffer_from_resource(resource), context, NULL);
- context_release(context);
+ wined3d_cs_emit_buffer_preload(device->cs, buffer);
+ wined3d_cs_emit_buffer_preload(device->cs, buffer_from_resource(resource));
}
struct wined3d_resource * CDECL wined3d_buffer_get_resource(struct wined3d_buffer *buffer)
static HRESULT buffer_resource_sub_resource_map(struct wined3d_resource *resource, unsigned int sub_resource_idx,
diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c
index 9e8539d..650290b 100644
index aee2f60..f24a37d 100644
--- a/dlls/wined3d/cs.c
+++ b/dlls/wined3d/cs.c
@@ -75,6 +75,7 @@ enum wined3d_cs_op
@ -67,7 +67,7 @@ index 9e8539d..650290b 100644
static void wined3d_cs_mt_submit(struct wined3d_cs *cs, size_t size)
{
LONG new_val = (cs->queue.head + size) & (WINED3D_CS_QUEUE_SIZE - 1);
@@ -2390,6 +2397,29 @@ void wined3d_cs_emit_buffer_invalidate_bo_range(struct wined3d_cs *cs,
@@ -2393,6 +2400,29 @@ void wined3d_cs_emit_buffer_invalidate_bo_range(struct wined3d_cs *cs,
cs->ops->submit(cs, sizeof(*op));
}
@ -97,7 +97,7 @@ index 9e8539d..650290b 100644
static UINT (* const wined3d_cs_op_handlers[])(struct wined3d_cs *cs, const void *data) =
{
/* WINED3D_CS_OP_NOP */ wined3d_cs_exec_nop,
@@ -2443,6 +2473,7 @@ static UINT (* const wined3d_cs_op_handlers[])(struct wined3d_cs *cs, const void
@@ -2446,6 +2476,7 @@ static UINT (* const wined3d_cs_op_handlers[])(struct wined3d_cs *cs, const void
/* WINED3D_CS_OP_TEXTURE_UNMAP */ wined3d_cs_exec_texture_unmap,
/* WINED3D_CS_OP_BUFFER_SWAP_MEM */ wined3d_cs_exec_buffer_swap_mem,
/* WINED3D_CS_OP_BUFFER_INVALIDATE_RANGE */ wined3d_cs_exec_buffer_invalidate_bo_range,
@ -106,10 +106,10 @@ index 9e8539d..650290b 100644
/* WINED3D_CS_OP_UPDATE_TEXTURE */ wined3d_cs_exec_update_texture,
/* WINED3D_CS_OP_UPDATE_SUB_RESOURCE */ wined3d_cs_exec_update_sub_resource,
diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h
index f23efe7..dc70283 100644
index 14585d1..4c64b9a 100644
--- a/dlls/wined3d/wined3d_private.h
+++ b/dlls/wined3d/wined3d_private.h
@@ -3104,6 +3104,7 @@ void wined3d_cs_emit_blt(struct wined3d_cs *cs, struct wined3d_surface *dst_surf
@@ -3105,6 +3105,7 @@ void wined3d_cs_emit_blt(struct wined3d_cs *cs, struct wined3d_surface *dst_surf
enum wined3d_texture_filter_type filter) DECLSPEC_HIDDEN;
void wined3d_cs_emit_buffer_invalidate_bo_range(struct wined3d_cs *cs,
struct wined3d_buffer *buffer, unsigned int offset, unsigned int size) DECLSPEC_HIDDEN;

View File

@ -1,43 +1,25 @@
From 88fc47f261800a4c622935e5ad03dae71215c3ac Mon Sep 17 00:00:00 2001
From 39344ce1023a10cf7303f75c50aee588f6ec4e45 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Stefan=20D=C3=B6singer?= <stefan@codeweavers.com>
Date: Wed, 2 Oct 2013 23:40:20 +0200
Subject: wined3d: Unload resources through the CS in device_reset.
---
dlls/wined3d/device.c | 10 ++++++----
1 file changed, 6 insertions(+), 4 deletions(-)
dlls/wined3d/device.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c
index 44ff6fc..2b5c063 100644
index 632754d6..efd4c1b 100644
--- a/dlls/wined3d/device.c
+++ b/dlls/wined3d/device.c
@@ -4559,20 +4559,22 @@ static void delete_opengl_contexts(struct wined3d_device *device, struct wined3d
struct wined3d_context *context;
struct wined3d_shader *shader;
- context = context_acquire(device, NULL);
- gl_info = context->gl_info;
-
LIST_FOR_EACH_ENTRY_SAFE(resource, cursor, &device->resources, struct wined3d_resource, resource_list_entry)
{
@@ -4562,6 +4562,8 @@ static void delete_opengl_contexts(struct wined3d_device *device, struct wined3d
TRACE("Unloading resource %p.\n", resource);
- resource->resource_ops->resource_unload(resource);
+ wined3d_cs_emit_unload_resource(device->cs, resource);
wined3d_cs_emit_unload_resource(device->cs, resource);
}
+ if (wined3d_settings.cs_multithreaded)
+ device->cs->ops->finish(device->cs);
LIST_FOR_EACH_ENTRY(shader, &device->shaders, struct wined3d_shader, shader_list_entry)
{
device->shader_backend->shader_destroy(shader);
}
+ context = context_acquire(device, NULL);
+ gl_info = context->gl_info;
+
if (device->depth_blt_texture)
{
gl_info->gl_ops.gl.p_glDeleteTextures(1, &device->depth_blt_texture);
--
2.9.0

View File

@ -1,4 +1,4 @@
From 66785672e0f1887700cde16403d79a112065d15c Mon Sep 17 00:00:00 2001
From bb2ad8b5ff5321f5436dcc30b9300e40fb18265c Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Stefan=20D=C3=B6singer?= <stefan@codeweavers.com>
Date: Fri, 11 Oct 2013 12:09:37 +0200
Subject: wined3d: Invoke surface_unload through the CS in
@ -7,20 +7,19 @@ Subject: wined3d: Invoke surface_unload through the CS in
This fixes another case where we use a GL context in the main thread and
crash fglrx in doing so.
---
dlls/wined3d/texture.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
dlls/wined3d/texture.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/dlls/wined3d/texture.c b/dlls/wined3d/texture.c
index e25c121..4e57a58 100644
index 333faca..33342ba 100644
--- a/dlls/wined3d/texture.c
+++ b/dlls/wined3d/texture.c
@@ -1255,7 +1255,10 @@ HRESULT CDECL wined3d_texture_update_desc(struct wined3d_texture *texture, UINT
@@ -1249,7 +1249,10 @@ HRESULT CDECL wined3d_texture_update_desc(struct wined3d_texture *texture, UINT
}
if (device->d3d_initialized)
- texture->resource.resource_ops->resource_unload(&texture->resource);
+ {
+ wined3d_cs_emit_unload_resource(device->cs, &texture->resource);
wined3d_cs_emit_unload_resource(device->cs, &texture->resource);
+ device->cs->ops->finish(device->cs);
+ }

File diff suppressed because it is too large Load Diff