Rebase against 81c700e0f8f8670f9c3b05a4baab2b2cffaeff89.

This commit is contained in:
Sebastian Lackner 2016-05-27 23:37:32 +02:00
parent a15b448623
commit 749dc37048
7 changed files with 78 additions and 79 deletions

View File

@ -51,7 +51,7 @@ usage()
# Get the upstream commit sha
upstream_commit()
{
echo "0dcf255b51ef096d649a5b4daee7204409550376"
echo "81c700e0f8f8670f9c3b05a4baab2b2cffaeff89"
}
# Show version information

View File

@ -1,4 +1,4 @@
From d868b0b30b06dd1cc8133da99b8f6f60c57014b3 Mon Sep 17 00:00:00 2001
From c33629a7a9e150d49b7923244037eaaa9c29bb64 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Stefan=20D=C3=B6singer?= <stefan@codeweavers.com>
Date: Thu, 4 Jul 2013 23:44:11 +0200
Subject: wined3d: Use double-buffered buffers for multithreaded CS
@ -8,11 +8,11 @@ Subject: wined3d: Use double-buffered buffers for multithreaded CS
1 file changed, 3 insertions(+)
diff --git a/dlls/wined3d/buffer.c b/dlls/wined3d/buffer.c
index e8d1027..ce567be 100644
index 324bca7..b1ba51c 100644
--- a/dlls/wined3d/buffer.c
+++ b/dlls/wined3d/buffer.c
@@ -1353,6 +1353,9 @@ static HRESULT buffer_init(struct wined3d_buffer *buffer, struct wined3d_device
buffer->flags |= WINED3D_BUFFER_CREATEBO;
@@ -1351,6 +1351,9 @@ static HRESULT buffer_init(struct wined3d_buffer *buffer, struct wined3d_device
buffer->flags |= WINED3D_BUFFER_USE_BO;
}
+ if (wined3d_settings.cs_multithreaded)

View File

@ -1,4 +1,4 @@
From 575b8b92e9712546cc9163ef6f3d81e8357f8ec1 Mon Sep 17 00:00:00 2001
From 29831b11a874263e360db38a16f3497dcdf1f7af 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,20 +14,20 @@ incrementing map_count.
1 file changed, 8 insertions(+), 7 deletions(-)
diff --git a/dlls/wined3d/buffer.c b/dlls/wined3d/buffer.c
index ca2184e..3fb0d7c 100644
index e51a87e..e652695 100644
--- a/dlls/wined3d/buffer.c
+++ b/dlls/wined3d/buffer.c
@@ -467,7 +467,8 @@ void buffer_get_memory(struct wined3d_buffer *buffer, struct wined3d_context *co
@@ -461,7 +461,8 @@ void buffer_get_memory(struct wined3d_buffer *buffer, struct wined3d_context *co
data->buffer_object = buffer->buffer_object;
if (!buffer->buffer_object)
{
- if ((buffer->flags & WINED3D_BUFFER_CREATEBO) && !buffer->resource.map_count)
- if ((buffer->flags & WINED3D_BUFFER_USE_BO) && !buffer->resource.map_count)
+ if ((!buffer->resource.map_count || buffer->flags & WINED3D_BUFFER_DOUBLEBUFFER)
+ && buffer->flags & WINED3D_BUFFER_CREATEBO)
+ && buffer->flags & WINED3D_BUFFER_USE_BO)
{
buffer_create_buffer_object(buffer, context);
buffer->flags &= ~WINED3D_BUFFER_CREATEBO;
@@ -745,12 +746,6 @@ void buffer_internal_preload(struct wined3d_buffer *buffer, struct wined3d_conte
if (buffer->buffer_object)
@@ -737,12 +738,6 @@ void buffer_internal_preload(struct wined3d_buffer *buffer, struct wined3d_conte
TRACE("buffer %p.\n", buffer);
@ -40,7 +40,7 @@ index ca2184e..3fb0d7c 100644
buffer_mark_used(buffer);
if (!buffer->buffer_object)
@@ -942,6 +937,12 @@ void CDECL wined3d_buffer_preload(struct wined3d_buffer *buffer)
@@ -933,6 +928,12 @@ void CDECL wined3d_buffer_preload(struct wined3d_buffer *buffer)
struct wined3d_context *context;
struct wined3d_device *device = buffer->resource.device;

View File

@ -1,4 +1,4 @@
From c037c518a352f4bf9dfc6754a1e21d52c13b5382 Mon Sep 17 00:00:00 2001
From 6dea1a91cc8a00d2c8e24e3511fefe017d76d9c7 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Stefan=20D=C3=B6singer?= <stefan@codeweavers.com>
Date: Tue, 30 Jul 2013 22:17:10 +0200
Subject: wined3d: Separate GL buffer discard control from ignoring
@ -18,19 +18,19 @@ There are some problems left:
3 files changed, 28 insertions(+), 8 deletions(-)
diff --git a/dlls/wined3d/buffer.c b/dlls/wined3d/buffer.c
index 1d64146..6a201b9 100644
index ff5ecd0..1602ff1 100644
--- a/dlls/wined3d/buffer.c
+++ b/dlls/wined3d/buffer.c
@@ -32,7 +32,7 @@ WINE_DEFAULT_DEBUG_CHANNEL(d3d);
#define WINED3D_BUFFER_HASDESC 0x01 /* A vertex description has been found. */
#define WINED3D_BUFFER_CREATEBO 0x02 /* Create a buffer object for this buffer. */
#define WINED3D_BUFFER_USE_BO 0x02 /* Use a buffer object for this buffer. */
#define WINED3D_BUFFER_DOUBLEBUFFER 0x04 /* Keep both a buffer object and a system memory copy for this buffer. */
-#define WINED3D_BUFFER_DISCARD 0x08 /* A DISCARD lock has occurred since the last preload. */
+#define WINED3D_BUFFER_DISCARD 0x08 /* The next PreLoad may discard the buffer contents. */
#define WINED3D_BUFFER_SYNC 0x10 /* There has been at least one synchronized map since the last preload. */
#define WINED3D_BUFFER_APPLESYNC 0x20 /* Using sync as in GL_APPLE_flush_buffer_range. */
@@ -929,7 +929,7 @@ HRESULT CDECL wined3d_buffer_map(struct wined3d_buffer *buffer, UINT offset, UIN
@@ -920,7 +920,7 @@ HRESULT CDECL wined3d_buffer_map(struct wined3d_buffer *buffer, UINT offset, UIN
* previous contents of the buffer. The r600g driver only does this when
* the buffer is currently in use, while the proprietary NVIDIA driver
* appears to do this unconditionally. */
@ -39,7 +39,7 @@ index 1d64146..6a201b9 100644
flags &= ~WINED3D_MAP_DISCARD;
count = ++buffer->resource.map_count;
@@ -1010,10 +1010,15 @@ HRESULT CDECL wined3d_buffer_map(struct wined3d_buffer *buffer, UINT offset, UIN
@@ -1001,10 +1001,15 @@ HRESULT CDECL wined3d_buffer_map(struct wined3d_buffer *buffer, UINT offset, UIN
context_release(context);
}
}
@ -59,7 +59,7 @@ index 1d64146..6a201b9 100644
buffer->flags |= WINED3D_BUFFER_SYNC;
}
@@ -1022,6 +1027,7 @@ HRESULT CDECL wined3d_buffer_map(struct wined3d_buffer *buffer, UINT offset, UIN
@@ -1013,6 +1018,7 @@ HRESULT CDECL wined3d_buffer_map(struct wined3d_buffer *buffer, UINT offset, UIN
BOOL swvp = device->create_parms.flags & WINED3DCREATE_SOFTWARE_VERTEXPROCESSING;
if (flags & WINED3D_MAP_DISCARD && !swvp)
{
@ -67,7 +67,7 @@ index 1d64146..6a201b9 100644
wined3d_resource_allocate_sysmem(&buffer->resource);
wined3d_cs_emit_buffer_swap_mem(device->cs, buffer, buffer->resource.map_heap_memory);
}
@@ -1462,3 +1468,10 @@ HRESULT CDECL wined3d_buffer_create_ib(struct wined3d_device *device, UINT size,
@@ -1449,3 +1455,10 @@ HRESULT CDECL wined3d_buffer_create_ib(struct wined3d_device *device, UINT size,
return WINED3D_OK;
}
@ -79,10 +79,10 @@ index 1d64146..6a201b9 100644
+ buffer->flags |= WINED3D_BUFFER_DISCARD;
+}
diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c
index 91e4a84..f0b21c0 100644
index 688d933a..0c735bf 100644
--- a/dlls/wined3d/cs.c
+++ b/dlls/wined3d/cs.c
@@ -708,11 +708,17 @@ void wined3d_cs_emit_draw(struct wined3d_cs *cs, UINT start_idx, UINT index_coun
@@ -711,11 +711,17 @@ void wined3d_cs_emit_draw(struct wined3d_cs *cs, UINT start_idx, UINT index_coun
op->indexed = indexed;
if (indexed)
@ -100,7 +100,7 @@ index 91e4a84..f0b21c0 100644
}
for (i = 0; i < sizeof(state->textures) / sizeof(*state->textures); i++)
{
@@ -2261,8 +2267,7 @@ static UINT wined3d_cs_exec_buffer_swap_mem(struct wined3d_cs *cs, const void *d
@@ -2255,8 +2261,7 @@ static UINT wined3d_cs_exec_buffer_swap_mem(struct wined3d_cs *cs, const void *d
const struct wined3d_cs_buffer_swap_mem *op = data;
struct wined3d_buffer *buffer = op->buffer;
@ -111,10 +111,10 @@ index 91e4a84..f0b21c0 100644
if (!buffer->buffer_object && buffer->resource.bind_count)
{
diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h
index dcaab57..b5b0246 100644
index d13e8db..451b941 100644
--- a/dlls/wined3d/wined3d_private.h
+++ b/dlls/wined3d/wined3d_private.h
@@ -3099,6 +3099,7 @@ struct wined3d_buffer
@@ -3121,6 +3121,7 @@ struct wined3d_buffer
GLenum buffer_object_usage;
GLenum buffer_type_hint;
DWORD flags;
@ -122,7 +122,7 @@ index dcaab57..b5b0246 100644
void *map_ptr;
struct wined3d_map_range *maps;
@@ -3128,6 +3129,7 @@ HRESULT wined3d_buffer_copy(struct wined3d_buffer *dst_buffer, unsigned int dst_
@@ -3150,6 +3151,7 @@ HRESULT wined3d_buffer_copy(struct wined3d_buffer *dst_buffer, unsigned int dst_
HRESULT wined3d_buffer_upload_data(struct wined3d_buffer *buffer,
const struct wined3d_box *box, const void *data) DECLSPEC_HIDDEN;
void buffer_invalidate_bo_range(struct wined3d_buffer *buffer, unsigned int offset, unsigned int size) DECLSPEC_HIDDEN;

View File

@ -1,17 +1,17 @@
From 0050fafe7b359c4d8c5d9f94c57521fd4263c15e Mon Sep 17 00:00:00 2001
From 53cf8182c26262a3ffaf9d1d961ac94e7d6ed18d Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Stefan=20D=C3=B6singer?= <stefan@codeweavers.com>
Date: Thu, 29 Aug 2013 17:35:53 +0200
Subject: wined3d: Create buffers before mapping them.
---
dlls/wined3d/buffer.c | 26 +++++++++++++++++++++++++-
1 file changed, 25 insertions(+), 1 deletion(-)
dlls/wined3d/buffer.c | 25 ++++++++++++++++++++++++-
1 file changed, 24 insertions(+), 1 deletion(-)
diff --git a/dlls/wined3d/buffer.c b/dlls/wined3d/buffer.c
index 6a201b9..cddbdc1 100644
index 1602ff1..5566c1e 100644
--- a/dlls/wined3d/buffer.c
+++ b/dlls/wined3d/buffer.c
@@ -194,6 +194,8 @@ static void buffer_create_buffer_object(struct wined3d_buffer *This, struct wine
@@ -188,6 +188,8 @@ static void buffer_create_buffer_object(struct wined3d_buffer *This, struct wine
ERR("glBufferData failed with error %s (%#x)\n", debug_glerror(error), error);
goto fail;
}
@ -20,7 +20,7 @@ index 6a201b9..cddbdc1 100644
This->buffer_object_usage = gl_usage;
@@ -919,9 +921,32 @@ HRESULT CDECL wined3d_buffer_map(struct wined3d_buffer *buffer, UINT offset, UIN
@@ -910,9 +912,31 @@ HRESULT CDECL wined3d_buffer_map(struct wined3d_buffer *buffer, UINT offset, UIN
LONG count;
BYTE *base;
struct wined3d_device *device = buffer->resource.device;
@ -42,18 +42,17 @@ index 6a201b9..cddbdc1 100644
+ *
+ * Also keep in mind that UnLoad can destroy the VBO, so simply creating it
+ * on buffer creation won't work either. */
+ if (buffer->flags & WINED3D_BUFFER_CREATEBO)
+ if (!buffer->buffer_object && buffer->flags & WINED3D_BUFFER_USE_BO)
+ {
+ context = context_acquire(device, NULL);
+ buffer_create_buffer_object(buffer, context);
+ context_release(context);
+ buffer->flags &= ~WINED3D_BUFFER_CREATEBO;
+ }
+
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
@@ -949,7 +974,6 @@ HRESULT CDECL wined3d_buffer_map(struct wined3d_buffer *buffer, UINT offset, UIN
@@ -940,7 +964,6 @@ HRESULT CDECL wined3d_buffer_map(struct wined3d_buffer *buffer, UINT offset, UIN
if (count == 1)
{
struct wined3d_device *device = buffer->resource.device;

View File

@ -1,4 +1,4 @@
From f86243044bf0a13fe8778e6b96a9192d59506ee4 Mon Sep 17 00:00:00 2001
From c7a8885b345150606ee93c1ada440109f8e26126 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Stefan=20D=C3=B6singer?= <stefan@codeweavers.com>
Date: Wed, 2 Oct 2013 21:47:08 +0200
Subject: wined3d: Create VBOs through the command stream.
@ -11,10 +11,10 @@ A stop-gap solution to make fglrx happier until buffers are updated.
3 files changed, 37 insertions(+), 6 deletions(-)
diff --git a/dlls/wined3d/buffer.c b/dlls/wined3d/buffer.c
index cddbdc1..8e95d88 100644
index 5566c1e..b611daf 100644
--- a/dlls/wined3d/buffer.c
+++ b/dlls/wined3d/buffer.c
@@ -128,7 +128,7 @@ static void delete_gl_buffer(struct wined3d_buffer *This, const struct wined3d_g
@@ -122,7 +122,7 @@ static void delete_gl_buffer(struct wined3d_buffer *This, const struct wined3d_g
}
/* Context activation is done by the caller. */
@ -23,7 +23,7 @@ index cddbdc1..8e95d88 100644
{
GLenum gl_usage = GL_STATIC_DRAW_ARB;
GLenum error;
@@ -194,8 +194,6 @@ static void buffer_create_buffer_object(struct wined3d_buffer *This, struct wine
@@ -188,8 +188,6 @@ static void buffer_create_buffer_object(struct wined3d_buffer *This, struct wine
ERR("glBufferData failed with error %s (%#x)\n", debug_glerror(error), error);
goto fail;
}
@ -32,19 +32,19 @@ index cddbdc1..8e95d88 100644
This->buffer_object_usage = gl_usage;
@@ -941,9 +939,7 @@ HRESULT CDECL wined3d_buffer_map(struct wined3d_buffer *buffer, UINT offset, UIN
@@ -932,9 +930,7 @@ HRESULT CDECL wined3d_buffer_map(struct wined3d_buffer *buffer, UINT offset, UIN
* on buffer creation won't work either. */
if (buffer->flags & WINED3D_BUFFER_CREATEBO)
if (!buffer->buffer_object && buffer->flags & WINED3D_BUFFER_USE_BO)
{
- context = context_acquire(device, NULL);
- buffer_create_buffer_object(buffer, context);
- context_release(context);
+ wined3d_cs_emit_create_vbo(device->cs, buffer);
buffer->flags &= ~WINED3D_BUFFER_CREATEBO;
}
flags = wined3d_resource_sanitize_map_flags(&buffer->resource, flags);
diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c
index b58cc89..65c5db3 100644
index bd40193..badc0b1 100644
--- a/dlls/wined3d/cs.c
+++ b/dlls/wined3d/cs.c
@@ -81,6 +81,7 @@ enum wined3d_cs_op
@ -55,7 +55,7 @@ index b58cc89..65c5db3 100644
WINED3D_CS_OP_STOP,
};
@@ -475,6 +476,12 @@ struct wined3d_cs_shader_cleanup
@@ -478,6 +479,12 @@ struct wined3d_cs_shader_cleanup
struct wined3d_shader *shader;
};
@ -68,7 +68,7 @@ index b58cc89..65c5db3 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);
@@ -2417,6 +2424,30 @@ void wined3d_cs_emit_shader_cleanup(struct wined3d_cs *cs, struct wined3d_shader
@@ -2411,6 +2418,30 @@ void wined3d_cs_emit_shader_cleanup(struct wined3d_cs *cs, struct wined3d_shader
cs->ops->submit(cs, sizeof(*op));
}
@ -99,7 +99,7 @@ index b58cc89..65c5db3 100644
static UINT (* const wined3d_cs_op_handlers[])(struct wined3d_cs *cs, const void *data) =
{
/* WINED3D_CS_OP_NOP */ wined3d_cs_exec_nop,
@@ -2476,6 +2507,7 @@ static UINT (* const wined3d_cs_op_handlers[])(struct wined3d_cs *cs, const void
@@ -2470,6 +2501,7 @@ static UINT (* const wined3d_cs_op_handlers[])(struct wined3d_cs *cs, const void
/* WINED3D_CS_OP_VIEW_DESTROY */ wined3d_cs_exec_view_destroy,
/* WINED3D_CS_OP_VDECL_DESTROY */ wined3d_cs_exec_vertex_declaration_destroy,
/* WINED3D_CS_OP_SHADER_CLEANUP */ wined3d_cs_exec_shader_cleanup,
@ -108,10 +108,10 @@ index b58cc89..65c5db3 100644
static inline void *_wined3d_cs_mt_require_space(struct wined3d_cs *cs, size_t size, BOOL prio)
diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h
index 44a77ce..d46bb87 100644
index 4bf5313..0cfe28a 100644
--- a/dlls/wined3d/wined3d_private.h
+++ b/dlls/wined3d/wined3d_private.h
@@ -3044,6 +3044,7 @@ void wined3d_cs_emit_view_destroy(struct wined3d_cs *cs, struct wined3d_renderta
@@ -3066,6 +3066,7 @@ void wined3d_cs_emit_view_destroy(struct wined3d_cs *cs, struct wined3d_renderta
void wined3d_cs_emit_vertex_declaration_destroy(struct wined3d_cs *cs,
struct wined3d_vertex_declaration *declaration) DECLSPEC_HIDDEN;
void wined3d_cs_emit_shader_cleanup(struct wined3d_cs *cs, struct wined3d_shader *shader) DECLSPEC_HIDDEN;
@ -119,7 +119,7 @@ index 44a77ce..d46bb87 100644
/* Direct3D terminology with little modifications. We do not have an issued state
* because only the driver knows about it, but we have a created state because d3d
@@ -3136,6 +3137,8 @@ HRESULT wined3d_buffer_upload_data(struct wined3d_buffer *buffer,
@@ -3158,6 +3159,8 @@ HRESULT wined3d_buffer_upload_data(struct wined3d_buffer *buffer,
const struct wined3d_box *box, const void *data) DECLSPEC_HIDDEN;
void buffer_invalidate_bo_range(struct wined3d_buffer *buffer, unsigned int offset, unsigned int size) DECLSPEC_HIDDEN;
void buffer_swap_mem(struct wined3d_buffer *buffer, BYTE *mem) DECLSPEC_HIDDEN;

View File

@ -122,7 +122,7 @@ diff --git a/dlls/wined3d/buffer.c b/dlls/wined3d/buffer.c
+++ b/dlls/wined3d/buffer.c
@@ -32,7 +32,11 @@
#define WINED3D_BUFFER_HASDESC 0x01 /* A vertex description has been found. */
#define WINED3D_BUFFER_CREATEBO 0x02 /* Create a buffer object for this buffer. */
#define WINED3D_BUFFER_USE_BO 0x02 /* Use a buffer object for this buffer. */
#define WINED3D_BUFFER_DOUBLEBUFFER 0x04 /* Keep both a buffer object and a system memory copy for this buffer. */
+#if defined(STAGING_CSMT)
#define WINED3D_BUFFER_DISCARD 0x08 /* The next PreLoad may discard the buffer contents. */
@ -171,19 +171,19 @@ diff --git a/dlls/wined3d/buffer.c b/dlls/wined3d/buffer.c
return;
@@ -460,8 +476,12 @@
@@ -461,8 +477,12 @@
data->buffer_object = buffer->buffer_object;
if (!buffer->buffer_object)
{
+#if defined(STAGING_CSMT)
if ((!buffer->resource.map_count || buffer->flags & WINED3D_BUFFER_DOUBLEBUFFER)
&& buffer->flags & WINED3D_BUFFER_CREATEBO)
&& buffer->flags & WINED3D_BUFFER_USE_BO)
+#else /* STAGING_CSMT */
+ if ((buffer->flags & WINED3D_BUFFER_CREATEBO) && !buffer->resource.map_count)
+ if ((buffer->flags & WINED3D_BUFFER_USE_BO) && !buffer->resource.map_count)
+#endif /* STAGING_CSMT */
{
buffer_create_buffer_object(buffer, context);
buffer->flags &= ~WINED3D_BUFFER_CREATEBO;
if (buffer->buffer_object)
@@ -500,7 +520,9 @@
if (!wined3d_resource_allocate_sysmem(&buffer->resource))
@ -194,7 +194,7 @@ diff --git a/dlls/wined3d/buffer.c b/dlls/wined3d/buffer.c
buffer_bind(buffer, context);
GL_EXTCALL(glGetBufferSubData(buffer->buffer_type_hint, 0, buffer->resource.size, buffer->resource.heap_memory));
@@ -546,6 +568,7 @@
@@ -545,6 +567,7 @@
resource_unload(resource);
}
@ -202,7 +202,7 @@ diff --git a/dlls/wined3d/buffer.c b/dlls/wined3d/buffer.c
void wined3d_buffer_cleanup_cs(struct wined3d_buffer *buffer)
{
struct wined3d_context *context;
@@ -578,6 +601,30 @@
@@ -577,6 +600,30 @@
buffer->resource.parent_ops->wined3d_object_destroyed(buffer->resource.parent);
wined3d_cs_emit_buffer_cleanup(device->cs, buffer);
@ -233,7 +233,7 @@ diff --git a/dlls/wined3d/buffer.c b/dlls/wined3d/buffer.c
}
return refcount;
@@ -662,6 +709,7 @@
@@ -661,6 +708,7 @@
/* The caller provides a GL context */
static void buffer_direct_upload(struct wined3d_buffer *This, const struct wined3d_gl_info *gl_info, DWORD flags)
{
@ -241,7 +241,7 @@ diff --git a/dlls/wined3d/buffer.c b/dlls/wined3d/buffer.c
UINT start = 0, len = 0;
/* This potentially invalidates the element array buffer binding, but the
@@ -685,6 +733,45 @@
@@ -684,6 +732,45 @@
GL_EXTCALL(glBufferParameteriAPPLE(This->buffer_type_hint, GL_BUFFER_SERIALIZED_MODIFY_APPLE, GL_TRUE));
checkGLcall("glBufferParameteriAPPLE(This->buffer_type_hint, GL_BUFFER_SERIALIZED_MODIFY_APPLE, GL_TRUE)");
This->flags &= ~WINED3D_BUFFER_APPLESYNC;
@ -287,7 +287,7 @@ diff --git a/dlls/wined3d/buffer.c b/dlls/wined3d/buffer.c
}
while (This->modified_areas)
@@ -693,12 +780,33 @@
@@ -692,12 +779,33 @@
start = This->maps[This->modified_areas].offset;
len = This->maps[This->modified_areas].size;
@ -321,7 +321,7 @@ diff --git a/dlls/wined3d/buffer.c b/dlls/wined3d/buffer.c
{
buffer->flags &= ~(WINED3D_BUFFER_SYNC | WINED3D_BUFFER_DISCARD);
}
@@ -717,6 +825,14 @@
@@ -716,6 +824,14 @@
TRACE("buffer %p.\n", buffer);
@ -336,7 +336,7 @@ diff --git a/dlls/wined3d/buffer.c b/dlls/wined3d/buffer.c
buffer_mark_used(buffer);
if (!buffer->buffer_object)
@@ -905,6 +1021,7 @@
@@ -903,6 +1019,7 @@
void CDECL wined3d_buffer_preload(struct wined3d_buffer *buffer)
{
@ -344,7 +344,7 @@ diff --git a/dlls/wined3d/buffer.c b/dlls/wined3d/buffer.c
struct wined3d_device *device = buffer->resource.device;
if (buffer->resource.map_count)
@@ -914,6 +1031,12 @@
@@ -912,6 +1029,12 @@
}
wined3d_cs_emit_buffer_preload(device->cs, buffer);
@ -357,7 +357,7 @@ diff --git a/dlls/wined3d/buffer.c b/dlls/wined3d/buffer.c
}
struct wined3d_resource * CDECL wined3d_buffer_get_resource(struct wined3d_buffer *buffer)
@@ -927,6 +1050,7 @@
@@ -925,6 +1048,7 @@
{
LONG count;
BYTE *base;
@ -365,9 +365,9 @@ diff --git a/dlls/wined3d/buffer.c b/dlls/wined3d/buffer.c
struct wined3d_device *device = buffer->resource.device;
struct wined3d_context *context;
@@ -951,6 +1075,10 @@
@@ -948,6 +1072,10 @@
{
wined3d_cs_emit_create_vbo(device->cs, buffer);
buffer->flags &= ~WINED3D_BUFFER_CREATEBO;
}
+#else /* STAGING_CSMT */
+
@ -376,7 +376,7 @@ diff --git a/dlls/wined3d/buffer.c b/dlls/wined3d/buffer.c
flags = wined3d_resource_sanitize_map_flags(&buffer->resource, flags);
/* Filter redundant WINED3D_MAP_DISCARD maps. The 3DMark2001 multitexture
@@ -959,7 +1087,11 @@
@@ -956,7 +1084,11 @@
* previous contents of the buffer. The r600g driver only does this when
* the buffer is currently in use, while the proprietary NVIDIA driver
* appears to do this unconditionally. */
@ -388,7 +388,7 @@ diff --git a/dlls/wined3d/buffer.c b/dlls/wined3d/buffer.c
flags &= ~WINED3D_MAP_DISCARD;
count = ++buffer->resource.map_count;
@@ -970,6 +1102,7 @@
@@ -967,6 +1099,7 @@
* being uploaded in that case. Two such applications are Port Royale
* and Darkstar One. */
if (flags & WINED3D_MAP_DISCARD)
@ -396,7 +396,7 @@ diff --git a/dlls/wined3d/buffer.c b/dlls/wined3d/buffer.c
wined3d_cs_emit_buffer_invalidate_bo_range(device->cs, buffer, 0, 0);
else if (!(flags & WINED3D_MAP_READONLY))
wined3d_cs_emit_buffer_invalidate_bo_range(device->cs, buffer, offset, size);
@@ -987,6 +1120,19 @@
@@ -984,6 +1117,19 @@
wined3d_cs_emit_glfinish(device->cs);
device->cs->ops->finish(device->cs);
}
@ -416,7 +416,7 @@ diff --git a/dlls/wined3d/buffer.c b/dlls/wined3d/buffer.c
context = context_acquire(device, NULL);
gl_info = context->gl_info;
@@ -1035,6 +1181,7 @@
@@ -1032,6 +1178,7 @@
buffer_get_sysmem(buffer, context);
}
TRACE("New pointer is %p.\n", buffer->resource.heap_memory);
@ -424,7 +424,7 @@ diff --git a/dlls/wined3d/buffer.c b/dlls/wined3d/buffer.c
}
context_release(context);
}
@@ -1074,6 +1221,21 @@
@@ -1071,6 +1218,21 @@
}
base = buffer->map_ptr ? buffer->map_ptr : buffer->resource.map_heap_memory;
@ -446,7 +446,7 @@ diff --git a/dlls/wined3d/buffer.c b/dlls/wined3d/buffer.c
*data = base + offset;
TRACE("Returning memory at %p (base %p, offset %u).\n", *data, base, offset);
@@ -1136,6 +1298,7 @@
@@ -1133,6 +1295,7 @@
}
GL_EXTCALL(glUnmapBuffer(buffer->buffer_type_hint));
@ -454,7 +454,7 @@ diff --git a/dlls/wined3d/buffer.c b/dlls/wined3d/buffer.c
if (wined3d_settings.cs_multithreaded)
gl_info->gl_ops.gl.p_glFinish();
else if (wined3d_settings.strict_draw_ordering)
@@ -1144,6 +1307,18 @@
@@ -1141,6 +1304,18 @@
buffer_clear_dirty_areas(buffer);
buffer->map_ptr = NULL;
@ -473,7 +473,7 @@ diff --git a/dlls/wined3d/buffer.c b/dlls/wined3d/buffer.c
}
}
@@ -1336,7 +1511,9 @@
@@ -1333,7 +1508,9 @@
return hr;
}
buffer->buffer_type_hint = bind_hint;
@ -483,15 +483,15 @@ diff --git a/dlls/wined3d/buffer.c b/dlls/wined3d/buffer.c
TRACE("size %#x, usage %#x, format %s, memory @ %p, iface @ %p.\n", buffer->resource.size, buffer->resource.usage,
debug_d3dformat(buffer->resource.format->id), buffer->resource.heap_memory, buffer);
@@ -1372,6 +1549,7 @@
buffer->flags |= WINED3D_BUFFER_CREATEBO;
@@ -1369,6 +1546,7 @@
buffer->flags |= WINED3D_BUFFER_USE_BO;
}
+#if defined(STAGING_CSMT)
if (wined3d_settings.cs_multithreaded)
buffer->flags |= WINED3D_BUFFER_DOUBLEBUFFER;
@@ -1382,6 +1560,13 @@
@@ -1379,6 +1557,13 @@
resource_cleanup(&buffer->resource);
if (wined3d_settings.cs_multithreaded)
buffer->resource.device->cs->ops->finish(buffer->resource.device->cs);
@ -505,7 +505,7 @@ diff --git a/dlls/wined3d/buffer.c b/dlls/wined3d/buffer.c
return E_OUTOFMEMORY;
}
buffer->maps_size = 1;
@@ -1392,8 +1577,10 @@
@@ -1389,8 +1574,10 @@
buffer_unload(&buffer->resource);
resource_cleanup(&buffer->resource);
HeapFree(GetProcessHeap(), 0, buffer->maps);
@ -516,7 +516,7 @@ diff --git a/dlls/wined3d/buffer.c b/dlls/wined3d/buffer.c
return hr;
}
@@ -1504,6 +1691,7 @@
@@ -1501,6 +1688,7 @@
return WINED3D_OK;
}
@ -524,7 +524,7 @@ diff --git a/dlls/wined3d/buffer.c b/dlls/wined3d/buffer.c
void buffer_swap_mem(struct wined3d_buffer *buffer, BYTE *mem)
{
@@ -1511,3 +1699,4 @@
@@ -1508,3 +1696,4 @@
buffer->resource.heap_memory = mem;
buffer->flags |= WINED3D_BUFFER_DISCARD;
}