Rebase against b47487af999f48ba2700b4dd5ff6cd47891d4787.

This commit is contained in:
Sebastian Lackner
2017-02-28 04:53:10 +01:00
parent 147562e3e1
commit 3dfeab6722
18 changed files with 518 additions and 2931 deletions

View File

@@ -52,7 +52,7 @@ usage()
# Get the upstream commit sha
upstream_commit()
{
echo "adedebf47a9a02694b79965eb2aa670b3906b398"
echo "b47487af999f48ba2700b4dd5ff6cd47891d4787"
}
# Show version information
@@ -8373,18 +8373,16 @@ fi
# | * [#11674] Support for CSMT (command stream) to increase graphic performance
# |
# | Modified files:
# | * dlls/d3d9/tests/visual.c, dlls/wined3d/arb_program_shader.c, dlls/wined3d/buffer.c, dlls/wined3d/context.c,
# | dlls/wined3d/cs.c, dlls/wined3d/device.c, dlls/wined3d/drawprim.c, dlls/wined3d/glsl_shader.c, dlls/wined3d/query.c,
# | dlls/wined3d/resource.c, dlls/wined3d/shader.c, dlls/wined3d/state.c, dlls/wined3d/stateblock.c, dlls/wined3d/surface.c,
# | dlls/wined3d/swapchain.c, dlls/wined3d/texture.c, dlls/wined3d/utils.c, dlls/wined3d/view.c,
# | dlls/wined3d/wined3d_main.c, dlls/wined3d/wined3d_private.h
# | * dlls/d3d9/tests/visual.c, dlls/wined3d/buffer.c, dlls/wined3d/context.c, dlls/wined3d/cs.c, dlls/wined3d/device.c,
# | dlls/wined3d/query.c, dlls/wined3d/resource.c, dlls/wined3d/stateblock.c, dlls/wined3d/surface.c,
# | dlls/wined3d/swapchain.c, dlls/wined3d/texture.c, dlls/wined3d/view.c, dlls/wined3d/wined3d_main.c,
# | dlls/wined3d/wined3d_private.h
# |
if test "$enable_wined3d_CSMT_Main" -eq 1; then
patch_apply wined3d-CSMT_Main/9999-IfDefined.patch
(
printf '%s\n' '+ { "Sebastian Lackner", "wined3d: Add additional synchronization CS ops.", 1 },';
printf '%s\n' '+ { "Sebastian Lackner", "wined3d: Send push_constants through the CS.", 1 },';
printf '%s\n' '+ { "Stefan Dösinger", "wined3d: Send primitive type updates through the command stream.", 1 },';
printf '%s\n' '+ { "Stefan Dösinger", "wined3d: Give the cs its own state.", 1 },';
printf '%s\n' '+ { "Stefan Dösinger", "wined3d: Pass the depth stencil to swapchain->present.", 1 },';
printf '%s\n' '+ { "Stefan Dösinger", "wined3d: Prevent the command stream from running ahead too far.", 1 },';
@@ -8402,8 +8400,6 @@ if test "$enable_wined3d_CSMT_Main" -eq 1; then
printf '%s\n' '+ { "Stefan Dösinger", "wined3d: Wrap GL BOs in a structure.", 1 },';
printf '%s\n' '+ { "Sebastian Lackner", "wined3d: Send buffer update subresource requests through CS.", 1 },';
printf '%s\n' '+ { "Sebastian Lackner", "wined3d: Send buffer copy requests through CS.", 1 },';
printf '%s\n' '+ { "Stefan Dösinger", "wined3d: Move the framebuffer into wined3d_state.", 1 },';
printf '%s\n' '+ { "Stefan Dösinger", "wined3d: Don'\''t access device state in clears.", 1 },';
printf '%s\n' '+ { "Stefan Dösinger", "wined3d: Avoid destroying views in color and depth fills.", 1 },';
printf '%s\n' '+ { "Stefan Dösinger", "wined3d: Add a separate variable to check if queries are started.", 1 },';
printf '%s\n' '+ { "Michael Müller", "wined3d: Map vertex buffers through cs.", 1 },';

View File

@@ -1,4 +1,4 @@
From ac5bd002bbe0d7366b443e24baf04aed612e60d8 Mon Sep 17 00:00:00 2001
From 16a1078eca14d1a3b01144db70b440eeb1ba2458 Mon Sep 17 00:00:00 2001
From: Sebastian Lackner <sebastian@fds-team.de>
Date: Sun, 19 Feb 2017 00:57:12 +0100
Subject: wined3d: Add additional synchronization CS ops.
@@ -11,7 +11,7 @@ Subject: wined3d: Add additional synchronization CS ops.
4 files changed, 60 insertions(+), 2 deletions(-)
diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c
index 763fda7153..8dd5352d8d 100644
index c6861818bce..060885dee7c 100644
--- a/dlls/wined3d/cs.c
+++ b/dlls/wined3d/cs.c
@@ -26,6 +26,8 @@ WINE_DEFAULT_DEBUG_CHANNEL(d3d);
@@ -40,7 +40,7 @@ index 763fda7153..8dd5352d8d 100644
struct wined3d_cs_present
{
enum wined3d_cs_op opcode;
@@ -343,6 +355,38 @@ struct wined3d_cs_unmap
@@ -344,6 +356,38 @@ struct wined3d_cs_unmap
HRESULT *hr;
};
@@ -79,7 +79,7 @@ index 763fda7153..8dd5352d8d 100644
static void wined3d_cs_exec_present(struct wined3d_cs *cs, const void *data)
{
const struct wined3d_cs_present *op = data;
@@ -1610,7 +1654,7 @@ HRESULT wined3d_cs_map(struct wined3d_cs *cs, struct wined3d_resource *resource,
@@ -1618,7 +1662,7 @@ HRESULT wined3d_cs_map(struct wined3d_cs *cs, struct wined3d_resource *resource,
op->flags = flags;
op->hr = &hr;
@@ -88,7 +88,7 @@ index 763fda7153..8dd5352d8d 100644
return hr;
}
@@ -1634,13 +1678,15 @@ HRESULT wined3d_cs_unmap(struct wined3d_cs *cs, struct wined3d_resource *resourc
@@ -1642,13 +1686,15 @@ HRESULT wined3d_cs_unmap(struct wined3d_cs *cs, struct wined3d_resource *resourc
op->sub_resource_idx = sub_resource_idx;
op->hr = &hr;
@@ -105,7 +105,7 @@ index 763fda7153..8dd5352d8d 100644
/* WINED3D_CS_OP_PRESENT */ wined3d_cs_exec_present,
/* WINED3D_CS_OP_CLEAR */ wined3d_cs_exec_clear,
/* WINED3D_CS_OP_DISPATCH */ wined3d_cs_exec_dispatch,
@@ -1771,6 +1817,7 @@ static const struct wined3d_cs_ops wined3d_cs_st_ops =
@@ -1779,6 +1825,7 @@ static const struct wined3d_cs_ops wined3d_cs_st_ops =
{
wined3d_cs_st_require_space,
wined3d_cs_st_submit,
@@ -114,7 +114,7 @@ index 763fda7153..8dd5352d8d 100644
};
diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c
index 6d844e7c40..fe74808492 100644
index eb626ba8a52..9f0ce923839 100644
--- a/dlls/wined3d/device.c
+++ b/dlls/wined3d/device.c
@@ -1008,6 +1008,7 @@ static void wined3d_device_delete_opengl_contexts_cs(void *object)
@@ -134,7 +134,7 @@ index 6d844e7c40..fe74808492 100644
return E_FAIL;
diff --git a/dlls/wined3d/view.c b/dlls/wined3d/view.c
index 02964e4a96..21aa8720e6 100644
index 02964e4a96b..21aa8720e65 100644
--- a/dlls/wined3d/view.c
+++ b/dlls/wined3d/view.c
@@ -598,6 +598,8 @@ static void wined3d_shader_resource_view_cs_init(void *object)
@@ -172,10 +172,10 @@ index 02964e4a96..21aa8720e6 100644
return WINED3D_OK;
diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h
index 8b1a18ffcf..cfb971abdf 100644
index 38050527f8a..607fafe7804 100644
--- a/dlls/wined3d/wined3d_private.h
+++ b/dlls/wined3d/wined3d_private.h
@@ -3180,6 +3180,7 @@ struct wined3d_cs_ops
@@ -3179,6 +3179,7 @@ struct wined3d_cs_ops
{
void *(*require_space)(struct wined3d_cs *cs, size_t size);
void (*submit)(struct wined3d_cs *cs);
@@ -184,9 +184,9 @@ index 8b1a18ffcf..cfb971abdf 100644
unsigned int start_idx, unsigned int count, const void *constants);
};
@@ -3205,6 +3206,7 @@ void wined3d_cs_emit_dispatch(struct wined3d_cs *cs,
unsigned int group_count_x, unsigned int group_count_y, unsigned int group_count_z) DECLSPEC_HIDDEN;
void wined3d_cs_emit_draw(struct wined3d_cs *cs, int base_vertex_idx, unsigned int start_idx, unsigned int index_count,
unsigned int start_instance, unsigned int instance_count, BOOL indexed) DECLSPEC_HIDDEN;
void wined3d_cs_emit_draw(struct wined3d_cs *cs, GLenum primitive_type, int base_vertex_idx,
unsigned int start_idx, unsigned int index_count, unsigned int start_instance,
unsigned int instance_count, BOOL indexed) DECLSPEC_HIDDEN;
+void wined3d_cs_emit_glfinish(struct wined3d_cs *cs) DECLSPEC_HIDDEN;
void wined3d_cs_emit_preload_resource(struct wined3d_cs *cs, struct wined3d_resource *resource) DECLSPEC_HIDDEN;
void wined3d_cs_emit_present(struct wined3d_cs *cs, struct wined3d_swapchain *swapchain,

View File

@@ -1,122 +0,0 @@
From d699a2c72dfa675f6d718673e2dabfd3139bab8a Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Stefan=20D=C3=B6singer?= <stefan@codeweavers.com>
Date: Sun, 7 Apr 2013 17:53:43 +0200
Subject: wined3d: Send primitive type updates through the command stream
---
dlls/wined3d/cs.c | 32 ++++++++++++++++++++++++++++++++
dlls/wined3d/device.c | 4 ++--
dlls/wined3d/stateblock.c | 4 ++--
dlls/wined3d/wined3d_private.h | 2 ++
4 files changed, 38 insertions(+), 4 deletions(-)
diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c
index 4612244ce0c..7490b36a827 100644
--- a/dlls/wined3d/cs.c
+++ b/dlls/wined3d/cs.c
@@ -64,6 +64,7 @@ enum wined3d_cs_op
WINED3D_CS_OP_MAP,
WINED3D_CS_OP_UNMAP,
WINED3D_CS_OP_PUSH_CONSTANTS,
+ WINED3D_CS_OP_SET_PRIMITIVE_TYPE,
};
struct wined3d_cs_sync
@@ -350,6 +351,12 @@ struct wined3d_cs_push_constants
BYTE constants[1];
};
+struct wined3d_cs_set_primitive_type
+{
+ enum wined3d_cs_op opcode;
+ GLenum gl_primitive_type;
+};
+
static void wined3d_cs_exec_sync(struct wined3d_cs *cs, const void *data)
{
}
@@ -1647,6 +1654,30 @@ void wined3d_cs_emit_push_constants(struct wined3d_cs *cs, enum wined3d_push_con
cs->ops->submit(cs);
}
+static void wined3d_cs_exec_set_primitive_type(struct wined3d_cs *cs, const void *data)
+{
+ const struct wined3d_cs_set_primitive_type *op = data;
+ GLenum prev;
+
+ prev = cs->state.gl_primitive_type;
+
+ if (op->gl_primitive_type == GL_POINTS || prev == GL_POINTS)
+ device_invalidate_state(cs->device, STATE_POINT_ENABLE);
+
+ cs->state.gl_primitive_type = op->gl_primitive_type;
+}
+
+void wined3d_cs_emit_set_primitive_type(struct wined3d_cs *cs, GLenum primitive_type)
+{
+ struct wined3d_cs_set_primitive_type *op;
+
+ op = cs->ops->require_space(cs, sizeof(*op));
+ op->opcode = WINED3D_CS_OP_SET_PRIMITIVE_TYPE;
+ op->gl_primitive_type = primitive_type;
+
+ 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,
@@ -1687,6 +1718,7 @@ static void (* const wined3d_cs_op_handlers[])(struct wined3d_cs *cs, const void
/* WINED3D_CS_OP_MAP */ wined3d_cs_exec_map,
/* WINED3D_CS_OP_UNMAP */ wined3d_cs_exec_unmap,
/* WINED3D_CS_OP_PUSH_CONSTANTS */ wined3d_cs_exec_push_constants,
+ /* WINED3D_CS_OP_SET_PRIMITIVE_TYPE */ wined3d_cs_exec_set_primitive_type,
};
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 5e17ba185de..6fb09dfcf19 100644
--- a/dlls/wined3d/device.c
+++ b/dlls/wined3d/device.c
@@ -3574,8 +3574,8 @@ void CDECL wined3d_device_set_primitive_type(struct wined3d_device *device,
device->update_state->gl_primitive_type = gl_primitive_type;
if (device->recording)
device->recording->changed.primitive_type = TRUE;
- else if (gl_primitive_type != prev && (gl_primitive_type == GL_POINTS || prev == GL_POINTS))
- device_invalidate_state(device, STATE_POINT_ENABLE);
+ else if (gl_primitive_type != prev)
+ wined3d_cs_emit_set_primitive_type(device->cs, gl_primitive_type);
}
void CDECL wined3d_device_get_primitive_type(const struct wined3d_device *device,
diff --git a/dlls/wined3d/stateblock.c b/dlls/wined3d/stateblock.c
index 22e511fcec1..ad347082c4d 100644
--- a/dlls/wined3d/stateblock.c
+++ b/dlls/wined3d/stateblock.c
@@ -1054,8 +1054,8 @@ void CDECL wined3d_stateblock_apply(const struct wined3d_stateblock *stateblock)
gl_primitive_type = stateblock->state.gl_primitive_type;
prev = device->update_state->gl_primitive_type;
device->update_state->gl_primitive_type = gl_primitive_type;
- if (gl_primitive_type != prev && (gl_primitive_type == GL_POINTS || prev == GL_POINTS))
- device_invalidate_state(device, STATE_POINT_ENABLE);
+ if (gl_primitive_type != prev)
+ wined3d_cs_emit_set_primitive_type(device->cs, gl_primitive_type);
}
if (stateblock->changed.indices)
diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h
index df05dcb8fc8..514f162fefa 100644
--- a/dlls/wined3d/wined3d_private.h
+++ b/dlls/wined3d/wined3d_private.h
@@ -3213,6 +3213,8 @@ void wined3d_cs_emit_set_index_buffer(struct wined3d_cs *cs, struct wined3d_buff
void wined3d_cs_emit_set_material(struct wined3d_cs *cs, const struct wined3d_material *material) DECLSPEC_HIDDEN;
void wined3d_cs_emit_set_predication(struct wined3d_cs *cs,
struct wined3d_query *predicate, BOOL value) DECLSPEC_HIDDEN;
+void wined3d_cs_emit_set_primitive_type(struct wined3d_cs *cs,
+ GLenum primitive_type) DECLSPEC_HIDDEN;
void wined3d_cs_emit_set_rasterizer_state(struct wined3d_cs *cs,
struct wined3d_rasterizer_state *rasterizer_state) DECLSPEC_HIDDEN;
void wined3d_cs_emit_set_render_state(struct wined3d_cs *cs,
--
2.11.0

View File

@@ -1,26 +1,17 @@
From 6dbf3379c1262b61c6730d2228c40b85ef751773 Mon Sep 17 00:00:00 2001
From 890fa1752284ee9a459b29eeac7d875cd1a84015 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Stefan=20D=C3=B6singer?= <stefan@codeweavers.com>
Date: Tue, 1 Oct 2013 15:30:26 +0200
Subject: wined3d: Give the cs its own state
---
dlls/wined3d/cs.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
dlls/wined3d/cs.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c
index 594a4b5b175..53c1cc48728 100644
index 73352d93b97..d3be8d1ef21 100644
--- a/dlls/wined3d/cs.c
+++ b/dlls/wined3d/cs.c
@@ -454,7 +454,7 @@ static void wined3d_cs_exec_clear(struct wined3d_cs *cs, const void *data)
RECT draw_rect;
device = cs->device;
- state = &device->state;
+ state = &cs->state;
wined3d_get_draw_rect(state, &draw_rect);
device_clear_render_targets(device, device->adapter->gl_info.limits.buffers,
&device->fb, op->rect_count, op->rects, &draw_rect, op->flags,
@@ -610,7 +610,7 @@ static void release_unordered_access_resources(const struct wined3d_shader *shad
@@ -603,7 +603,7 @@ static void release_unordered_access_resources(const struct wined3d_shader *shad
static void wined3d_cs_exec_dispatch(struct wined3d_cs *cs, const void *data)
{
@@ -29,7 +20,7 @@ index 594a4b5b175..53c1cc48728 100644
const struct wined3d_cs_dispatch *op = data;
dispatch_compute(cs->device, state,
@@ -642,7 +642,7 @@ void wined3d_cs_emit_dispatch(struct wined3d_cs *cs,
@@ -635,7 +635,7 @@ void wined3d_cs_emit_dispatch(struct wined3d_cs *cs,
static void wined3d_cs_exec_draw(struct wined3d_cs *cs, const void *data)
{

View File

@@ -1,4 +1,4 @@
From 06958496811f70af6507c8de08347d3aac61057b Mon Sep 17 00:00:00 2001
From c300fbe493da45c4767a7ebe73f9854a9a1101e8 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Stefan=20D=C3=B6singer?= <stefan@codeweavers.com>
Date: Mon, 29 Apr 2013 18:49:53 +0200
Subject: wined3d: Send blits through the command stream.
@@ -13,19 +13,19 @@ between surface_blt and surface_blt_ugly isn't particularly nice.
4 files changed, 228 insertions(+), 97 deletions(-)
diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c
index 9934b74e150..b563dfbd080 100644
index ee3d9a79da0..1517df9da95 100644
--- a/dlls/wined3d/cs.c
+++ b/dlls/wined3d/cs.c
@@ -67,6 +67,7 @@ enum wined3d_cs_op
@@ -66,6 +66,7 @@ enum wined3d_cs_op
WINED3D_CS_OP_MAP,
WINED3D_CS_OP_UNMAP,
WINED3D_CS_OP_PUSH_CONSTANTS,
WINED3D_CS_OP_SET_PRIMITIVE_TYPE,
+ WINED3D_CS_OP_BLT,
};
struct wined3d_cs_sync
@@ -372,6 +373,18 @@ struct wined3d_cs_set_primitive_type
GLenum gl_primitive_type;
@@ -366,6 +367,18 @@ struct wined3d_cs_push_constants
BYTE constants[1];
};
+struct wined3d_cs_blt
@@ -43,7 +43,7 @@ index 9934b74e150..b563dfbd080 100644
static void wined3d_cs_exec_sync(struct wined3d_cs *cs, const void *data)
{
}
@@ -1799,6 +1812,44 @@ void wined3d_cs_emit_set_primitive_type(struct wined3d_cs *cs, GLenum primitive_
@@ -1776,6 +1789,44 @@ void wined3d_cs_emit_push_constants(struct wined3d_cs *cs, enum wined3d_push_con
cs->ops->submit(cs);
}
@@ -88,19 +88,19 @@ index 9934b74e150..b563dfbd080 100644
static void (* const wined3d_cs_op_handlers[])(struct wined3d_cs *cs, const void *data) =
{
/* WINED3D_CS_OP_SYNC */ wined3d_cs_exec_sync,
@@ -1842,6 +1893,7 @@ static void (* const wined3d_cs_op_handlers[])(struct wined3d_cs *cs, const void
@@ -1818,6 +1869,7 @@ static void (* const wined3d_cs_op_handlers[])(struct wined3d_cs *cs, const void
/* WINED3D_CS_OP_MAP */ wined3d_cs_exec_map,
/* WINED3D_CS_OP_UNMAP */ wined3d_cs_exec_unmap,
/* WINED3D_CS_OP_PUSH_CONSTANTS */ wined3d_cs_exec_push_constants,
/* WINED3D_CS_OP_SET_PRIMITIVE_TYPE */ wined3d_cs_exec_set_primitive_type,
+ /* WINED3D_CS_OP_BLT */ wined3d_cs_exec_blt,
};
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 335ff016cf3..f4cdb5d9c10 100644
index 01f7f1b6d84..7644e2aa250 100644
--- a/dlls/wined3d/device.c
+++ b/dlls/wined3d/device.c
@@ -4032,6 +4032,7 @@ HRESULT CDECL wined3d_device_copy_sub_resource_region(struct wined3d_device *dev
@@ -4027,6 +4027,7 @@ HRESULT CDECL wined3d_device_copy_sub_resource_region(struct wined3d_device *dev
struct wined3d_texture *dst_texture, *src_texture;
RECT dst_rect, src_rect;
HRESULT hr;
@@ -108,7 +108,7 @@ index 335ff016cf3..f4cdb5d9c10 100644
TRACE("device %p, dst_resource %p, dst_sub_resource_idx %u, dst_x %u, dst_y %u, dst_z %u, "
"src_resource %p, src_sub_resource_idx %u, src_box %s.\n",
@@ -4119,6 +4120,14 @@ HRESULT CDECL wined3d_device_copy_sub_resource_region(struct wined3d_device *dev
@@ -4114,6 +4115,14 @@ HRESULT CDECL wined3d_device_copy_sub_resource_region(struct wined3d_device *dev
if (src_box)
{
@@ -123,7 +123,7 @@ index 335ff016cf3..f4cdb5d9c10 100644
SetRect(&src_rect, src_box->left, src_box->top, src_box->right, src_box->bottom);
}
else
@@ -4132,6 +4141,23 @@ HRESULT CDECL wined3d_device_copy_sub_resource_region(struct wined3d_device *dev
@@ -4127,6 +4136,23 @@ HRESULT CDECL wined3d_device_copy_sub_resource_region(struct wined3d_device *dev
SetRect(&dst_rect, dst_x, dst_y, dst_x + (src_rect.right - src_rect.left),
dst_y + (src_rect.bottom - src_rect.top));
@@ -148,10 +148,10 @@ index 335ff016cf3..f4cdb5d9c10 100644
src_texture, src_sub_resource_idx, &src_rect, 0, NULL, WINED3D_TEXF_POINT)))
WARN("Failed to blit, hr %#x.\n", hr);
diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c
index 87cf6727cf5..8c5624c8787 100644
index 347a8097484..c0b34e20b83 100644
--- a/dlls/wined3d/surface.c
+++ b/dlls/wined3d/surface.c
@@ -3775,7 +3775,7 @@ const struct blit_shader cpu_blit = {
@@ -3772,7 +3772,7 @@ const struct blit_shader cpu_blit = {
cpu_blit_blit_surface,
};
@@ -160,7 +160,7 @@ index 87cf6727cf5..8c5624c8787 100644
struct wined3d_surface *src_surface, const RECT *src_rect, DWORD flags,
const struct wined3d_blt_fx *fx, enum wined3d_texture_filter_type filter)
{
@@ -3785,9 +3785,8 @@ HRESULT wined3d_surface_blt(struct wined3d_surface *dst_surface, const RECT *dst
@@ -3782,9 +3782,8 @@ HRESULT wined3d_surface_blt(struct wined3d_surface *dst_surface, const RECT *dst
struct wined3d_texture *dst_texture = dst_surface->container;
struct wined3d_device *device = dst_texture->resource.device;
struct wined3d_swapchain *src_swapchain, *dst_swapchain;
@@ -172,7 +172,7 @@ index 87cf6727cf5..8c5624c8787 100644
DWORD src_ds_flags, dst_ds_flags;
BOOL scale, convert;
@@ -3800,84 +3799,17 @@ HRESULT wined3d_surface_blt(struct wined3d_surface *dst_surface, const RECT *dst
@@ -3797,84 +3796,17 @@ HRESULT wined3d_surface_blt(struct wined3d_surface *dst_surface, const RECT *dst
| WINED3D_BLT_DO_NOT_WAIT
| WINED3D_BLT_ALPHA_TEST;
@@ -262,7 +262,7 @@ index 87cf6727cf5..8c5624c8787 100644
}
if (!device->d3d_initialized)
@@ -3902,11 +3834,6 @@ HRESULT wined3d_surface_blt(struct wined3d_surface *dst_surface, const RECT *dst
@@ -3899,11 +3831,6 @@ HRESULT wined3d_surface_blt(struct wined3d_surface *dst_surface, const RECT *dst
goto fallback;
}
@@ -274,7 +274,7 @@ index 87cf6727cf5..8c5624c8787 100644
dst_swapchain = dst_texture->swapchain;
/* This isn't strictly needed. FBO blits for example could deal with
@@ -3942,22 +3869,16 @@ HRESULT wined3d_surface_blt(struct wined3d_surface *dst_surface, const RECT *dst
@@ -3939,22 +3866,16 @@ HRESULT wined3d_surface_blt(struct wined3d_surface *dst_surface, const RECT *dst
TRACE("Depth fill.\n");
if (!wined3d_format_convert_color_to_float(dst_texture->resource.format, NULL, fx->fill_color, &color))
@@ -300,7 +300,7 @@ index 87cf6727cf5..8c5624c8787 100644
}
}
else
@@ -3993,7 +3914,7 @@ HRESULT wined3d_surface_blt(struct wined3d_surface *dst_surface, const RECT *dst
@@ -3990,7 +3911,7 @@ HRESULT wined3d_surface_blt(struct wined3d_surface *dst_surface, const RECT *dst
goto fallback;
if (SUCCEEDED(surface_color_fill(dst_surface, dst_rect, &color)))
@@ -309,7 +309,7 @@ index 87cf6727cf5..8c5624c8787 100644
}
else
{
@@ -4037,7 +3958,7 @@ HRESULT wined3d_surface_blt(struct wined3d_surface *dst_surface, const RECT *dst
@@ -4034,7 +3955,7 @@ HRESULT wined3d_surface_blt(struct wined3d_surface *dst_surface, const RECT *dst
context, dst_texture->resource.draw_binding);
context_release(context);
}
@@ -318,7 +318,7 @@ index 87cf6727cf5..8c5624c8787 100644
}
}
}
@@ -4061,7 +3982,7 @@ HRESULT wined3d_surface_blt(struct wined3d_surface *dst_surface, const RECT *dst
@@ -4058,7 +3979,7 @@ HRESULT wined3d_surface_blt(struct wined3d_surface *dst_surface, const RECT *dst
wined3d_swapchain_present(dst_swapchain, NULL, NULL, dst_swapchain->win_handle, 0);
dst_swapchain->desc.swap_effect = swap_effect;
@@ -327,7 +327,7 @@ index 87cf6727cf5..8c5624c8787 100644
}
if (fbo_blit_supported(&device->adapter->gl_info, blit_op,
@@ -4082,7 +4003,7 @@ HRESULT wined3d_surface_blt(struct wined3d_surface *dst_surface, const RECT *dst
@@ -4079,7 +4000,7 @@ HRESULT wined3d_surface_blt(struct wined3d_surface *dst_surface, const RECT *dst
wined3d_texture_invalidate_location(dst_texture, dst_sub_resource_idx,
~dst_texture->resource.draw_binding);
@@ -336,7 +336,7 @@ index 87cf6727cf5..8c5624c8787 100644
}
blitter = wined3d_select_blitter(&device->adapter->gl_info, &device->adapter->d3d_info, blit_op,
@@ -4092,7 +4013,7 @@ HRESULT wined3d_surface_blt(struct wined3d_surface *dst_surface, const RECT *dst
@@ -4089,7 +4010,7 @@ HRESULT wined3d_surface_blt(struct wined3d_surface *dst_surface, const RECT *dst
{
blitter->blit_surface(device, blit_op, filter, src_surface,
src_rect, dst_surface, dst_rect, color_key);
@@ -345,7 +345,7 @@ index 87cf6727cf5..8c5624c8787 100644
}
}
}
@@ -4100,9 +4021,134 @@ HRESULT wined3d_surface_blt(struct wined3d_surface *dst_surface, const RECT *dst
@@ -4097,9 +4018,134 @@ HRESULT wined3d_surface_blt(struct wined3d_surface *dst_surface, const RECT *dst
fallback:
/* Special cases for render targets. */
if (SUCCEEDED(surface_blt_special(dst_surface, dst_rect, src_surface, src_rect, flags, fx, filter)))
@@ -483,10 +483,10 @@ index 87cf6727cf5..8c5624c8787 100644
+ return WINED3D_OK;
+}
diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h
index 6fcfdcbe05c..a2663a10b82 100644
index c62c64e7d3d..62f9c484287 100644
--- a/dlls/wined3d/wined3d_private.h
+++ b/dlls/wined3d/wined3d_private.h
@@ -3047,6 +3047,9 @@ HRESULT surface_upload_from_surface(struct wined3d_surface *dst_surface, const P
@@ -3048,6 +3048,9 @@ HRESULT surface_upload_from_surface(struct wined3d_surface *dst_surface, const P
void wined3d_surface_upload_data(struct wined3d_surface *surface, const struct wined3d_gl_info *gl_info,
const struct wined3d_format *format, const RECT *src_rect, UINT src_pitch, const POINT *dst_point,
BOOL srgb, const struct wined3d_const_bo_address *data) DECLSPEC_HIDDEN;

View File

@@ -1,4 +1,4 @@
From 1c832f8fd2760bff7b0a0234f68c11af66dba8d1 Mon Sep 17 00:00:00 2001
From 71236080e419dcf33176b5f8f54bbaf2dbefb630 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Stefan=20D=C3=B6singer?= <stefan@codeweavers.com>
Date: Thu, 4 Jul 2013 21:10:16 +0200
Subject: wined3d: Send render target view clears through the command stream
@@ -11,7 +11,7 @@ Subject: wined3d: Send render target view clears through the command stream
4 files changed, 55 insertions(+), 5 deletions(-)
diff --git a/dlls/d3d9/tests/visual.c b/dlls/d3d9/tests/visual.c
index f6eb188837d..5700577709e 100644
index 8e5be756654..88e0e44c4d3 100644
--- a/dlls/d3d9/tests/visual.c
+++ b/dlls/d3d9/tests/visual.c
@@ -1337,7 +1337,7 @@ static void color_fill_test(void)
@@ -24,18 +24,18 @@ index f6eb188837d..5700577709e 100644
* supported as offscreen plain surfaces and do not support D3DUSAGE_RENDERTARGET
* when created as texture. */
diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c
index 420a2cc8327..1dff1ff8af6 100644
index 1517df9da95..ebc4e4f15e5 100644
--- a/dlls/wined3d/cs.c
+++ b/dlls/wined3d/cs.c
@@ -68,6 +68,7 @@ enum wined3d_cs_op
@@ -67,6 +67,7 @@ enum wined3d_cs_op
WINED3D_CS_OP_UNMAP,
WINED3D_CS_OP_PUSH_CONSTANTS,
WINED3D_CS_OP_SET_PRIMITIVE_TYPE,
WINED3D_CS_OP_BLT,
+ WINED3D_CS_OP_CLEAR_RTV,
};
struct wined3d_cs_sync
@@ -385,6 +386,18 @@ struct wined3d_cs_blt
@@ -379,6 +380,18 @@ struct wined3d_cs_blt
enum wined3d_texture_filter_type filter;
};
@@ -54,7 +54,7 @@ index 420a2cc8327..1dff1ff8af6 100644
static void wined3d_cs_exec_sync(struct wined3d_cs *cs, const void *data)
{
}
@@ -1843,6 +1856,41 @@ void wined3d_cs_emit_blt(struct wined3d_cs *cs, struct wined3d_surface *dst_surf
@@ -1827,6 +1840,41 @@ void wined3d_cs_emit_blt(struct wined3d_cs *cs, struct wined3d_surface *dst_surf
cs->ops->submit(cs);
}
@@ -96,19 +96,19 @@ index 420a2cc8327..1dff1ff8af6 100644
static void (* const wined3d_cs_op_handlers[])(struct wined3d_cs *cs, const void *data) =
{
/* WINED3D_CS_OP_SYNC */ wined3d_cs_exec_sync,
@@ -1887,6 +1935,7 @@ static void (* const wined3d_cs_op_handlers[])(struct wined3d_cs *cs, const void
@@ -1870,6 +1918,7 @@ static void (* const wined3d_cs_op_handlers[])(struct wined3d_cs *cs, const void
/* WINED3D_CS_OP_UNMAP */ wined3d_cs_exec_unmap,
/* WINED3D_CS_OP_PUSH_CONSTANTS */ wined3d_cs_exec_push_constants,
/* WINED3D_CS_OP_SET_PRIMITIVE_TYPE */ wined3d_cs_exec_set_primitive_type,
/* WINED3D_CS_OP_BLT */ wined3d_cs_exec_blt,
+ /* WINED3D_CS_OP_CLEAR_RTV */ wined3d_cs_exec_clear_rtv,
};
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 6195122ff10..1388dda5c78 100644
index 7644e2aa250..35c57ff7b94 100644
--- a/dlls/wined3d/device.c
+++ b/dlls/wined3d/device.c
@@ -4272,10 +4272,8 @@ HRESULT CDECL wined3d_device_clear_rendertarget_view(struct wined3d_device *devi
@@ -4283,10 +4283,8 @@ HRESULT CDECL wined3d_device_clear_rendertarget_view(struct wined3d_device *devi
return WINED3DERR_INVALIDCALL;
}
@@ -122,10 +122,10 @@ index 6195122ff10..1388dda5c78 100644
struct wined3d_rendertarget_view * CDECL wined3d_device_get_rendertarget_view(const struct wined3d_device *device,
diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h
index be01b6f3b6a..2b58f655c25 100644
index 62f9c484287..334cdf0fb8b 100644
--- a/dlls/wined3d/wined3d_private.h
+++ b/dlls/wined3d/wined3d_private.h
@@ -3199,6 +3199,9 @@ void wined3d_cs_emit_blt(struct wined3d_cs *cs, struct wined3d_surface *dst_surf
@@ -3208,6 +3208,9 @@ 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_clear(struct wined3d_cs *cs, DWORD rect_count, const RECT *rects,
DWORD flags, const struct wined3d_color *color, float depth, DWORD stencil) DECLSPEC_HIDDEN;
@@ -134,7 +134,7 @@ index be01b6f3b6a..2b58f655c25 100644
+ const struct blit_shader *blitter) DECLSPEC_HIDDEN;
void wined3d_cs_emit_dispatch(struct wined3d_cs *cs,
unsigned int group_count_x, unsigned int group_count_y, unsigned int group_count_z) DECLSPEC_HIDDEN;
void wined3d_cs_emit_draw(struct wined3d_cs *cs, int base_vertex_idx, unsigned int start_idx, unsigned int index_count,
void wined3d_cs_emit_draw(struct wined3d_cs *cs, GLenum primitive_type, int base_vertex_idx,
--
2.11.0

View File

@@ -1,4 +1,4 @@
From 8272b9dad0782ec04f08f6829f6f9a715c676d91 Mon Sep 17 00:00:00 2001
From 91f8e688a10e60bf4240ec172bc4a56d6c2f59d9 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
@@ -11,18 +11,18 @@ FIXME: This logic duplication is ugly.
3 files changed, 141 insertions(+), 75 deletions(-)
diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c
index 1dff1ff8af6..c84bca1423f 100644
index ebc4e4f15e5..461ef30f17a 100644
--- a/dlls/wined3d/cs.c
+++ b/dlls/wined3d/cs.c
@@ -69,6 +69,7 @@ enum wined3d_cs_op
WINED3D_CS_OP_SET_PRIMITIVE_TYPE,
@@ -68,6 +68,7 @@ enum wined3d_cs_op
WINED3D_CS_OP_PUSH_CONSTANTS,
WINED3D_CS_OP_BLT,
WINED3D_CS_OP_CLEAR_RTV,
+ WINED3D_CS_OP_UPDATE_TEXTURE,
};
struct wined3d_cs_sync
@@ -398,6 +399,12 @@ struct wined3d_cs_clear_rtv
@@ -392,6 +393,12 @@ struct wined3d_cs_clear_rtv
const struct blit_shader *blitter;
};
@@ -35,7 +35,7 @@ index 1dff1ff8af6..c84bca1423f 100644
static void wined3d_cs_exec_sync(struct wined3d_cs *cs, const void *data)
{
}
@@ -1891,6 +1898,35 @@ void wined3d_cs_emit_clear_rtv(struct wined3d_cs *cs, struct wined3d_rendertarge
@@ -1875,6 +1882,35 @@ void wined3d_cs_emit_clear_rtv(struct wined3d_cs *cs, struct wined3d_rendertarge
cs->ops->submit(cs);
}
@@ -71,8 +71,8 @@ index 1dff1ff8af6..c84bca1423f 100644
static void (* const wined3d_cs_op_handlers[])(struct wined3d_cs *cs, const void *data) =
{
/* WINED3D_CS_OP_SYNC */ wined3d_cs_exec_sync,
@@ -1936,6 +1972,7 @@ static void (* const wined3d_cs_op_handlers[])(struct wined3d_cs *cs, const void
/* WINED3D_CS_OP_SET_PRIMITIVE_TYPE */ wined3d_cs_exec_set_primitive_type,
@@ -1919,6 +1955,7 @@ static void (* const wined3d_cs_op_handlers[])(struct wined3d_cs *cs, const void
/* WINED3D_CS_OP_PUSH_CONSTANTS */ wined3d_cs_exec_push_constants,
/* WINED3D_CS_OP_BLT */ wined3d_cs_exec_blt,
/* WINED3D_CS_OP_CLEAR_RTV */ wined3d_cs_exec_clear_rtv,
+ /* WINED3D_CS_OP_UPDATE_TEXTURE */ wined3d_cs_exec_update_texture,
@@ -80,10 +80,10 @@ index 1dff1ff8af6..c84bca1423f 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 71c95bc3f5d..f135f6ad03b 100644
index 72cf63af27f..8f7640cadc2 100644
--- a/dlls/wined3d/device.c
+++ b/dlls/wined3d/device.c
@@ -3616,34 +3616,17 @@ void CDECL wined3d_device_draw_indexed_primitive_instanced(struct wined3d_device
@@ -3627,34 +3627,17 @@ void CDECL wined3d_device_draw_indexed_primitive_instanced(struct wined3d_device
start_idx, index_count, start_instance, instance_count, TRUE);
}
@@ -122,7 +122,7 @@ index 71c95bc3f5d..f135f6ad03b 100644
/* Only a prepare, since we're uploading entire volumes. */
wined3d_texture_prepare_texture(dst_texture, context, FALSE);
@@ -3651,32 +3634,89 @@ static HRESULT wined3d_device_update_texture_3d(struct wined3d_device *device,
@@ -3662,32 +3645,89 @@ static HRESULT wined3d_device_update_texture_3d(struct wined3d_device *device,
for (i = 0; i < level_count; ++i)
{
@@ -222,7 +222,7 @@ index 71c95bc3f5d..f135f6ad03b 100644
TRACE("device %p, src_texture %p, dst_texture %p.\n", device, src_texture, dst_texture);
@@ -3713,63 +3753,48 @@ HRESULT CDECL wined3d_device_update_texture(struct wined3d_device *device,
@@ -3724,63 +3764,48 @@ HRESULT CDECL wined3d_device_update_texture(struct wined3d_device *device,
return WINED3DERR_INVALIDCALL;
}
@@ -316,10 +316,10 @@ index 71c95bc3f5d..f135f6ad03b 100644
HRESULT CDECL wined3d_device_validate_device(const struct wined3d_device *device, DWORD *num_passes)
diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h
index 2b58f655c25..cfe8839d746 100644
index 334cdf0fb8b..81bcadc927f 100644
--- a/dlls/wined3d/wined3d_private.h
+++ b/dlls/wined3d/wined3d_private.h
@@ -2673,6 +2673,8 @@ LRESULT device_process_message(struct wined3d_device *device, HWND window, BOOL
@@ -2683,6 +2683,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;
@@ -328,7 +328,7 @@ index 2b58f655c25..cfe8839d746 100644
static inline BOOL isStateDirty(const struct wined3d_context *context, DWORD state)
{
@@ -3264,6 +3266,8 @@ void wined3d_cs_emit_set_vertex_declaration(struct wined3d_cs *cs,
@@ -3272,6 +3274,8 @@ 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_sync(struct wined3d_cs *cs);
void wined3d_cs_emit_unload_resource(struct wined3d_cs *cs, struct wined3d_resource *resource) DECLSPEC_HIDDEN;

View File

@@ -1,4 +1,4 @@
From 5d761db7832335a902459846f73ad5a88af92860 Mon Sep 17 00:00:00 2001
From 5cde9b1eaee021e59d3a7b17bfdc69270771003d Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Stefan=20D=C3=B6singer?= <stefan@codeweavers.com>
Date: Sun, 16 Mar 2014 14:13:42 +0100
Subject: wined3d: Send getdc and releasedc through the command stream.
@@ -11,10 +11,10 @@ Another hacky patch to avoid using GL outside the worker thread.
3 files changed, 119 insertions(+), 29 deletions(-)
diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c
index ac9e09345dd..29b27176d34 100644
index e2b756eecb9..86ae7eb89c8 100644
--- a/dlls/wined3d/cs.c
+++ b/dlls/wined3d/cs.c
@@ -71,6 +71,8 @@ enum wined3d_cs_op
@@ -70,6 +70,8 @@ enum wined3d_cs_op
WINED3D_CS_OP_CLEAR_RTV,
WINED3D_CS_OP_UPDATE_TEXTURE,
WINED3D_CS_OP_UPDATE_SUB_RESOURCE,
@@ -23,7 +23,7 @@ index ac9e09345dd..29b27176d34 100644
};
struct wined3d_cs_sync
@@ -415,6 +417,14 @@ struct wined3d_cs_update_sub_resource
@@ -409,6 +411,14 @@ struct wined3d_cs_update_sub_resource
const void *data;
};
@@ -38,7 +38,7 @@ index ac9e09345dd..29b27176d34 100644
static void wined3d_cs_exec_sync(struct wined3d_cs *cs, const void *data)
{
}
@@ -1994,6 +2004,54 @@ void wined3d_cs_emit_update_sub_resource(struct wined3d_cs *cs, struct wined3d_r
@@ -1977,6 +1987,54 @@ void wined3d_cs_emit_update_sub_resource(struct wined3d_cs *cs, struct wined3d_r
cs->ops->submit_and_wait(cs);
}
@@ -93,7 +93,7 @@ index ac9e09345dd..29b27176d34 100644
static void (* const wined3d_cs_op_handlers[])(struct wined3d_cs *cs, const void *data) =
{
/* WINED3D_CS_OP_SYNC */ wined3d_cs_exec_sync,
@@ -2041,6 +2099,8 @@ static void (* const wined3d_cs_op_handlers[])(struct wined3d_cs *cs, const void
@@ -2023,6 +2081,8 @@ static void (* const wined3d_cs_op_handlers[])(struct wined3d_cs *cs, const void
/* WINED3D_CS_OP_CLEAR_RTV */ wined3d_cs_exec_clear_rtv,
/* WINED3D_CS_OP_UPDATE_TEXTURE */ wined3d_cs_exec_update_texture,
/* WINED3D_CS_OP_UPDATE_SUB_RESOURCE */ wined3d_cs_exec_update_sub_resource,
@@ -103,10 +103,10 @@ index ac9e09345dd..29b27176d34 100644
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 5673a93f791..2360c589902 100644
index 65777aad7be..644637696ea 100644
--- a/dlls/wined3d/texture.c
+++ b/dlls/wined3d/texture.c
@@ -3489,13 +3489,41 @@ HRESULT CDECL wined3d_texture_create(struct wined3d_device *device, const struct
@@ -3486,13 +3486,41 @@ HRESULT CDECL wined3d_texture_create(struct wined3d_device *device, const struct
return WINED3D_OK;
}
@@ -150,7 +150,7 @@ index 5673a93f791..2360c589902 100644
TRACE("texture %p, sub_resource_idx %u, dc %p.\n", texture, sub_resource_idx, dc);
@@ -3520,28 +3548,32 @@ HRESULT CDECL wined3d_texture_get_dc(struct wined3d_texture *texture, unsigned i
@@ -3517,28 +3545,32 @@ 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;
@@ -200,7 +200,7 @@ index 5673a93f791..2360c589902 100644
}
HRESULT CDECL wined3d_texture_release_dc(struct wined3d_texture *texture, unsigned int sub_resource_idx, HDC dc)
@@ -3572,14 +3604,5 @@ HRESULT CDECL wined3d_texture_release_dc(struct wined3d_texture *texture, unsign
@@ -3569,14 +3601,5 @@ HRESULT CDECL wined3d_texture_release_dc(struct wined3d_texture *texture, unsign
return WINED3DERR_INVALIDCALL;
}
@@ -217,10 +217,10 @@ index 5673a93f791..2360c589902 100644
+ return wined3d_cs_emit_release_dc(device->cs, texture, sub_resource_idx);
}
diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h
index 17cb43771d8..da3ee393739 100644
index 9cd5c2e316a..822d951b80f 100644
--- a/dlls/wined3d/wined3d_private.h
+++ b/dlls/wined3d/wined3d_private.h
@@ -2916,6 +2916,7 @@ void wined3d_texture_bind_and_dirtify(struct wined3d_texture *texture,
@@ -2928,6 +2928,7 @@ void wined3d_texture_bind_and_dirtify(struct wined3d_texture *texture,
struct wined3d_context *context, BOOL srgb) DECLSPEC_HIDDEN;
BOOL wined3d_texture_check_block_align(const struct wined3d_texture *texture,
unsigned int level, const struct wined3d_box *box) DECLSPEC_HIDDEN;
@@ -228,7 +228,7 @@ index 17cb43771d8..da3ee393739 100644
GLenum wined3d_texture_get_gl_buffer(const struct wined3d_texture *texture) DECLSPEC_HIDDEN;
void wined3d_texture_get_memory(struct wined3d_texture *texture, unsigned int sub_resource_idx,
struct wined3d_bo_address *data, DWORD locations) DECLSPEC_HIDDEN;
@@ -2933,6 +2934,8 @@ BOOL wined3d_texture_prepare_location(struct wined3d_texture *texture, unsigned
@@ -2945,6 +2946,8 @@ BOOL wined3d_texture_prepare_location(struct wined3d_texture *texture, unsigned
struct wined3d_context *context, DWORD location) DECLSPEC_HIDDEN;
void wined3d_texture_prepare_texture(struct wined3d_texture *texture,
struct wined3d_context *context, BOOL srgb) DECLSPEC_HIDDEN;
@@ -237,16 +237,16 @@ index 17cb43771d8..da3ee393739 100644
void wined3d_texture_set_map_binding(struct wined3d_texture *texture, DWORD map_binding) DECLSPEC_HIDDEN;
void wined3d_texture_set_swapchain(struct wined3d_texture *texture,
struct wined3d_swapchain *swapchain) DECLSPEC_HIDDEN;
@@ -3208,6 +3211,8 @@ void wined3d_cs_emit_dispatch(struct wined3d_cs *cs,
unsigned int group_count_x, unsigned int group_count_y, unsigned int group_count_z) DECLSPEC_HIDDEN;
void wined3d_cs_emit_draw(struct wined3d_cs *cs, int base_vertex_idx, unsigned int start_idx, unsigned int index_count,
unsigned int start_instance, unsigned int instance_count, BOOL indexed) DECLSPEC_HIDDEN;
@@ -3220,6 +3223,8 @@ void wined3d_cs_emit_dispatch(struct wined3d_cs *cs,
void wined3d_cs_emit_draw(struct wined3d_cs *cs, GLenum primitive_type, int base_vertex_idx,
unsigned int start_idx, unsigned int index_count, unsigned int start_instance,
unsigned int instance_count, BOOL indexed) DECLSPEC_HIDDEN;
+HRESULT wined3d_cs_emit_get_dc(struct wined3d_cs *cs, struct wined3d_texture *texture,
+ unsigned int sub_resource_idx) DECLSPEC_HIDDEN;
void wined3d_cs_emit_glfinish(struct wined3d_cs *cs) DECLSPEC_HIDDEN;
void wined3d_cs_emit_preload_resource(struct wined3d_cs *cs, struct wined3d_resource *resource) DECLSPEC_HIDDEN;
void wined3d_cs_emit_present(struct wined3d_cs *cs, struct wined3d_swapchain *swapchain,
@@ -3215,6 +3220,8 @@ void wined3d_cs_emit_present(struct wined3d_cs *cs, struct wined3d_swapchain *sw
@@ -3227,6 +3232,8 @@ void wined3d_cs_emit_present(struct wined3d_cs *cs, struct wined3d_swapchain *sw
void wined3d_cs_emit_push_constants(struct wined3d_cs *cs, enum wined3d_push_constants p,
unsigned int start_idx, unsigned int count, const void *constants) DECLSPEC_HIDDEN;
void wined3d_cs_emit_query_issue(struct wined3d_cs *cs, struct wined3d_query *query, DWORD flags) DECLSPEC_HIDDEN;

View File

@@ -1,4 +1,4 @@
From 04cdcd00a3c11da1292657739f22a016faa54435 Mon Sep 17 00:00:00 2001
From 28c54b09deec1d91899a2317f52931f0b1697f7e Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Stefan=20D=C3=B6singer?= <stefan@codeweavers.com>
Date: Thu, 10 Oct 2013 16:43:19 +0200
Subject: wined3d: Create the initial context through the CS.
@@ -11,10 +11,10 @@ Very hacky.
3 files changed, 100 insertions(+), 54 deletions(-)
diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c
index 81deae77363..4ee459f535a 100644
index 24051b16899..c9273e5508e 100644
--- a/dlls/wined3d/cs.c
+++ b/dlls/wined3d/cs.c
@@ -74,6 +74,7 @@ enum wined3d_cs_op
@@ -73,6 +73,7 @@ enum wined3d_cs_op
WINED3D_CS_OP_UPDATE_SUB_RESOURCE,
WINED3D_CS_OP_GET_DC,
WINED3D_CS_OP_RELEASE_DC,
@@ -22,7 +22,7 @@ index 81deae77363..4ee459f535a 100644
};
struct wined3d_cs_sync
@@ -434,6 +435,13 @@ struct wined3d_cs_get_release_dc
@@ -428,6 +429,13 @@ struct wined3d_cs_get_release_dc
HRESULT *hr;
};
@@ -36,7 +36,7 @@ index 81deae77363..4ee459f535a 100644
static void wined3d_cs_exec_sync(struct wined3d_cs *cs, const void *data)
{
}
@@ -2085,6 +2093,28 @@ HRESULT wined3d_cs_emit_release_dc(struct wined3d_cs *cs, struct wined3d_texture
@@ -2068,6 +2076,28 @@ HRESULT wined3d_cs_emit_release_dc(struct wined3d_cs *cs, struct wined3d_texture
return hr;
}
@@ -65,7 +65,7 @@ index 81deae77363..4ee459f535a 100644
static void (* const wined3d_cs_op_handlers[])(struct wined3d_cs *cs, const void *data) =
{
/* WINED3D_CS_OP_SYNC */ wined3d_cs_exec_sync,
@@ -2135,6 +2165,7 @@ static void (* const wined3d_cs_op_handlers[])(struct wined3d_cs *cs, const void
@@ -2117,6 +2147,7 @@ static void (* const wined3d_cs_op_handlers[])(struct wined3d_cs *cs, const void
/* WINED3D_CS_OP_UPDATE_SUB_RESOURCE */ wined3d_cs_exec_update_sub_resource,
/* WINED3D_CS_OP_GET_DC */ wined3d_cs_exec_get_dc,
/* WINED3D_CS_OP_RELEASE_DC */ wined3d_cs_exec_release_dc,
@@ -212,10 +212,10 @@ index 7e48b5d12b5..592cbd96db4 100644
if (swapchain->desc.backbuffer_count > 0)
diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h
index 91b2215f287..b3995627850 100644
index 065f118fcb7..c4830e3ab44 100644
--- a/dlls/wined3d/wined3d_private.h
+++ b/dlls/wined3d/wined3d_private.h
@@ -3207,6 +3207,8 @@ void wined3d_cs_emit_clear(struct wined3d_cs *cs, DWORD rect_count, const RECT *
@@ -3218,6 +3218,8 @@ void wined3d_cs_emit_clear(struct wined3d_cs *cs, DWORD rect_count, const RECT *
void wined3d_cs_emit_clear_rtv(struct wined3d_cs *cs, struct wined3d_rendertarget_view *view,
const RECT *rect, DWORD flags, const struct wined3d_color *color, float depth, DWORD stencil,
const struct blit_shader *blitter) DECLSPEC_HIDDEN;
@@ -223,8 +223,8 @@ index 91b2215f287..b3995627850 100644
+ struct wined3d_swapchain *swapchain) DECLSPEC_HIDDEN;
void wined3d_cs_emit_dispatch(struct wined3d_cs *cs,
unsigned int group_count_x, unsigned int group_count_y, unsigned int group_count_z) DECLSPEC_HIDDEN;
void wined3d_cs_emit_draw(struct wined3d_cs *cs, int base_vertex_idx, unsigned int start_idx, unsigned int index_count,
@@ -3460,6 +3462,8 @@ struct wined3d_swapchain
void wined3d_cs_emit_draw(struct wined3d_cs *cs, GLenum primitive_type, int base_vertex_idx,
@@ -3470,6 +3472,8 @@ struct wined3d_swapchain
void wined3d_swapchain_activate(struct wined3d_swapchain *swapchain, BOOL activate) DECLSPEC_HIDDEN;
struct wined3d_context *swapchain_get_context(struct wined3d_swapchain *swapchain) DECLSPEC_HIDDEN;

View File

@@ -1,89 +0,0 @@
From fabdd4237545714b754ab6ddce9fcbca433d5876 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Stefan=20D=C3=B6singer?= <stefandoesinger@gmx.at>
Date: Thu, 7 Apr 2016 19:51:54 +0100
Subject: wined3d: Don't access device state in clears.
---
dlls/wined3d/context.c | 7 ++++---
dlls/wined3d/device.c | 5 ++---
dlls/wined3d/wined3d_private.h | 2 +-
3 files changed, 7 insertions(+), 7 deletions(-)
diff --git a/dlls/wined3d/context.c b/dlls/wined3d/context.c
index bb65538ad7b..adffe0127bc 100644
--- a/dlls/wined3d/context.c
+++ b/dlls/wined3d/context.c
@@ -2635,7 +2635,7 @@ static BOOL context_validate_rt_config(UINT rt_count, struct wined3d_rendertarge
}
/* Context activation is done by the caller. */
-BOOL context_apply_clear_state(struct wined3d_context *context, const struct wined3d_state *state,
+BOOL context_apply_clear_state(struct wined3d_context *context,
UINT rt_count, const struct wined3d_fb_state *fb)
{
struct wined3d_rendertarget_view **rts = fb->render_targets;
@@ -2644,7 +2644,7 @@ BOOL context_apply_clear_state(struct wined3d_context *context, const struct win
DWORD rt_mask = 0, *cur_mask;
UINT i;
- if (isStateDirty(context, STATE_FRAMEBUFFER) || !wined3d_fb_equal(fb, &state->fb)
+ if (isStateDirty(context, STATE_FRAMEBUFFER) || !wined3d_fb_equal(fb, &context->current_fb)
|| rt_count != gl_info->limits.buffers)
{
if (!context_validate_rt_config(rt_count, rts, dsv))
@@ -2730,7 +2730,8 @@ BOOL context_apply_clear_state(struct wined3d_context *context, const struct win
gl_info->gl_ops.gl.p_glEnable(GL_SCISSOR_TEST);
if (rt_count && gl_info->supported[ARB_FRAMEBUFFER_SRGB])
{
- if (needs_srgb_write(context, state, fb))
+ /* FIXME: The way to access the state is ugly. */
+ if (needs_srgb_write(context, &rts[0]->resource->device->cs->state, fb))
gl_info->gl_ops.gl.p_glEnable(GL_FRAMEBUFFER_SRGB);
else
gl_info->gl_ops.gl.p_glDisable(GL_FRAMEBUFFER_SRGB);
diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c
index 62abafd4125..32d25cd1d0f 100644
--- a/dlls/wined3d/device.c
+++ b/dlls/wined3d/device.c
@@ -223,7 +223,6 @@ void device_clear_render_targets(struct wined3d_device *device, UINT rt_count, c
struct wined3d_surface *target = rtv ? wined3d_rendertarget_view_get_surface(rtv) : NULL;
struct wined3d_rendertarget_view *dsv = fb->depth_stencil;
struct wined3d_surface *depth_stencil = dsv ? wined3d_rendertarget_view_get_surface(dsv) : NULL;
- const struct wined3d_state *state = &device->state;
const struct wined3d_gl_info *gl_info;
UINT drawable_width, drawable_height;
struct wined3d_color corrected_color;
@@ -293,7 +292,7 @@ void device_clear_render_targets(struct wined3d_device *device, UINT rt_count, c
dsv->sub_resource_idx, context, location);
}
- if (!context_apply_clear_state(context, state, rt_count, fb))
+ if (!context_apply_clear_state(context, rt_count, fb))
{
context_release(context);
WARN("Failed to apply clear state, skipping clear.\n");
@@ -350,7 +349,7 @@ void device_clear_render_targets(struct wined3d_device *device, UINT rt_count, c
wined3d_texture_invalidate_location(texture, rtv->sub_resource_idx, ~rtv->resource->draw_binding);
}
- if (!gl_info->supported[ARB_FRAMEBUFFER_SRGB] && needs_srgb_write(context, state, fb))
+ if (!gl_info->supported[ARB_FRAMEBUFFER_SRGB] && needs_srgb_write(context, &device->cs->state, fb))
{
if (rt_count > 1)
WARN("Clearing multiple sRGB render targets with no GL_ARB_framebuffer_sRGB "
diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h
index 7d921011577..7ad99bca086 100644
--- a/dlls/wined3d/wined3d_private.h
+++ b/dlls/wined3d/wined3d_private.h
@@ -1852,7 +1852,7 @@ void context_alloc_event_query(struct wined3d_context *context,
void context_alloc_occlusion_query(struct wined3d_context *context,
struct wined3d_occlusion_query *query) DECLSPEC_HIDDEN;
void context_apply_blit_state(struct wined3d_context *context, const struct wined3d_device *device) DECLSPEC_HIDDEN;
-BOOL context_apply_clear_state(struct wined3d_context *context, const struct wined3d_state *state,
+BOOL context_apply_clear_state(struct wined3d_context *context,
UINT rt_count, const struct wined3d_fb_state *fb) DECLSPEC_HIDDEN;
void context_apply_compute_state(struct wined3d_context *context,
const struct wined3d_device *device, const struct wined3d_state *state) DECLSPEC_HIDDEN;
--
2.11.0

View File

@@ -1,4 +1,4 @@
From a0962ea827e829d8fe589cc0f8c3893341e2c3b6 Mon Sep 17 00:00:00 2001
From c1afe12bb6d64352554ac5ca4e8599de2fae62f1 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Stefan=20D=C3=B6singer?= <stefan@codeweavers.com>
Date: Thu, 24 Oct 2013 18:56:13 +0200
Subject: wined3d: Use an event to block the worker thread when it is idle.
@@ -34,10 +34,10 @@ vsync is turned on.
2 files changed, 52 insertions(+)
diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c
index a5a6fc0fa4a..1c9d8e1d192 100644
index 74b8b024cc3..c47d918b81e 100644
--- a/dlls/wined3d/cs.c
+++ b/dlls/wined3d/cs.c
@@ -2564,9 +2564,33 @@ static struct wined3d_cs_block *wined3d_cs_list_dequeue(struct wined3d_cs_list *
@@ -2542,9 +2542,33 @@ static struct wined3d_cs_block *wined3d_cs_list_dequeue(struct wined3d_cs_list *
return LIST_ENTRY(head, struct wined3d_cs_block, entry);
}
@@ -71,7 +71,7 @@ index a5a6fc0fa4a..1c9d8e1d192 100644
/* FIXME: Use an event to wait after a couple of spins. */
for (;;)
@@ -2575,6 +2599,13 @@ static struct wined3d_cs_block *wined3d_cs_dequeue_command(struct wined3d_cs *cs
@@ -2553,6 +2577,13 @@ static struct wined3d_cs_block *wined3d_cs_dequeue_command(struct wined3d_cs *cs
return block;
if ((block = wined3d_cs_list_dequeue(&cs->exec_list)))
return block;
@@ -85,7 +85,7 @@ index a5a6fc0fa4a..1c9d8e1d192 100644
}
}
@@ -2655,6 +2686,9 @@ static void wined3d_cs_mt_submit(struct wined3d_cs *cs)
@@ -2633,6 +2664,9 @@ static void wined3d_cs_mt_submit(struct wined3d_cs *cs)
block = cs->current_block;
wined3d_cs_list_enqueue(block->list, block);
cs->current_block = NULL;
@@ -95,7 +95,7 @@ index a5a6fc0fa4a..1c9d8e1d192 100644
}
static void wined3d_cs_mt_submit_and_wait(struct wined3d_cs *cs)
@@ -2670,6 +2704,9 @@ static void wined3d_cs_mt_submit_and_wait(struct wined3d_cs *cs)
@@ -2648,6 +2682,9 @@ static void wined3d_cs_mt_submit_and_wait(struct wined3d_cs *cs)
wined3d_cs_list_enqueue(block->list, block);
cs->current_block = NULL;
@@ -105,7 +105,7 @@ index a5a6fc0fa4a..1c9d8e1d192 100644
/* A busy wait should be fine, we're not supposed to have to wait very
* long. */
while (!InterlockedCompareExchange(&fence, TRUE, TRUE));
@@ -2766,6 +2803,14 @@ struct wined3d_cs *wined3d_cs_create(struct wined3d_device *device)
@@ -2747,6 +2784,14 @@ struct wined3d_cs *wined3d_cs_create(struct wined3d_device *device)
return NULL;
}
@@ -120,27 +120,27 @@ index a5a6fc0fa4a..1c9d8e1d192 100644
if (wined3d_settings.cs_multithreaded)
{
cs->ops = &wined3d_cs_mt_ops;
@@ -2778,6 +2823,7 @@ struct wined3d_cs *wined3d_cs_create(struct wined3d_device *device)
@@ -2759,6 +2804,7 @@ struct wined3d_cs *wined3d_cs_create(struct wined3d_device *device)
{
ERR("Failed to create wined3d command stream thread.\n");
state_cleanup(&cs->state);
+ CloseHandle(cs->event);
HeapFree(GetProcessHeap(), 0, cs->fb.render_targets);
HeapFree(GetProcessHeap(), 0, cs->data);
HeapFree(GetProcessHeap(), 0, cs);
return NULL;
@@ -2802,6 +2848,7 @@ void wined3d_cs_destroy(struct wined3d_cs *cs)
@@ -2784,6 +2830,7 @@ void wined3d_cs_destroy(struct wined3d_cs *cs)
wined3d_cs_list_cleanup(&cs->free_list);
}
+ CloseHandle(cs->event);
HeapFree(GetProcessHeap(), 0, cs->fb.render_targets);
HeapFree(GetProcessHeap(), 0, cs->data);
HeapFree(GetProcessHeap(), 0, cs);
}
diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h
index ba371f13d8d..10a7b4a8660 100644
index c1919b314bc..e71dfbb2ca8 100644
--- a/dlls/wined3d/wined3d_private.h
+++ b/dlls/wined3d/wined3d_private.h
@@ -3230,6 +3230,8 @@ struct wined3d_cs_ops
@@ -3218,6 +3218,8 @@ struct wined3d_cs_ops
void (*submit_and_wait)(struct wined3d_cs *cs);
};
@@ -149,7 +149,7 @@ index ba371f13d8d..10a7b4a8660 100644
struct wined3d_cs
{
const struct wined3d_cs_ops *ops;
@@ -3247,6 +3249,9 @@ struct wined3d_cs
@@ -3236,6 +3238,9 @@ struct wined3d_cs
struct wined3d_cs_list exec_prio_list;
LONG pending_presents;

View File

@@ -1,18 +1,18 @@
From 534625394e8964ca4b36c9319fde24d74887e6f6 Mon Sep 17 00:00:00 2001
From 66849c6928010aa02b9d9d049fcc43c5a3823b0c 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.
---
dlls/wined3d/cs.c | 65 +++++++++++++++++++++++-------------------
dlls/wined3d/cs.c | 63 +++++++++++++++++++++++-------------------
dlls/wined3d/wined3d_private.h | 1 +
2 files changed, 37 insertions(+), 29 deletions(-)
2 files changed, 36 insertions(+), 28 deletions(-)
diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c
index 7c58e67901e..6f00fe64848 100644
index 705d30b2879..25f833dfdce 100644
--- a/dlls/wined3d/cs.c
+++ b/dlls/wined3d/cs.c
@@ -881,7 +881,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
op->predicate = predicate;
op->value = value;
@@ -21,7 +21,7 @@ index 7c58e67901e..6f00fe64848 100644
}
static UINT wined3d_cs_exec_set_viewport(struct wined3d_cs *cs, const void *data)
@@ -902,7 +902,7 @@ void wined3d_cs_emit_set_viewport(struct wined3d_cs *cs, const struct wined3d_vi
@@ -903,7 +903,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 7c58e67901e..6f00fe64848 100644
}
static UINT wined3d_cs_exec_set_scissor_rect(struct wined3d_cs *cs, const void *data)
@@ -923,7 +923,7 @@ void wined3d_cs_emit_set_scissor_rect(struct wined3d_cs *cs, const RECT *rect)
@@ -924,7 +924,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 7c58e67901e..6f00fe64848 100644
}
static UINT wined3d_cs_exec_set_rendertarget_view(struct wined3d_cs *cs, const void *data)
@@ -946,7 +946,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
op->view_idx = view_idx;
op->view = view;
@@ -48,7 +48,7 @@ index 7c58e67901e..6f00fe64848 100644
}
static UINT wined3d_cs_exec_set_depth_stencil_view(struct wined3d_cs *cs, const void *data)
@@ -996,7 +996,7 @@ void wined3d_cs_emit_set_depth_stencil_view(struct wined3d_cs *cs, struct wined3
@@ -997,7 +997,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 7c58e67901e..6f00fe64848 100644
}
static UINT wined3d_cs_exec_set_vertex_declaration(struct wined3d_cs *cs, const void *data)
@@ -1017,7 +1017,7 @@ void wined3d_cs_emit_set_vertex_declaration(struct wined3d_cs *cs, struct wined3
@@ -1018,7 +1018,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 7c58e67901e..6f00fe64848 100644
}
static UINT wined3d_cs_exec_set_stream_source(struct wined3d_cs *cs, const void *data)
@@ -1054,7 +1054,7 @@ void wined3d_cs_emit_set_stream_source(struct wined3d_cs *cs, UINT stream_idx,
@@ -1055,7 +1055,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 7c58e67901e..6f00fe64848 100644
}
static UINT wined3d_cs_exec_set_stream_source_freq(struct wined3d_cs *cs, const void *data)
@@ -1081,7 +1081,7 @@ void wined3d_cs_emit_set_stream_source_freq(struct wined3d_cs *cs, UINT stream_i
@@ -1082,7 +1082,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 7c58e67901e..6f00fe64848 100644
}
static UINT wined3d_cs_exec_set_stream_output(struct wined3d_cs *cs, const void *data)
@@ -1114,7 +1114,7 @@ void wined3d_cs_emit_set_stream_output(struct wined3d_cs *cs, UINT stream_idx,
@@ -1115,7 +1115,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 7c58e67901e..6f00fe64848 100644
}
static UINT wined3d_cs_exec_set_index_buffer(struct wined3d_cs *cs, const void *data)
@@ -1148,7 +1148,7 @@ void wined3d_cs_emit_set_index_buffer(struct wined3d_cs *cs, struct wined3d_buff
@@ -1149,7 +1149,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 7c58e67901e..6f00fe64848 100644
}
static UINT wined3d_cs_exec_set_constant_buffer(struct wined3d_cs *cs, const void *data)
@@ -1179,7 +1179,7 @@ void wined3d_cs_emit_set_constant_buffer(struct wined3d_cs *cs, enum wined3d_sha
@@ -1180,7 +1180,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 7c58e67901e..6f00fe64848 100644
}
static UINT wined3d_cs_exec_set_texture(struct wined3d_cs *cs, const void *data)
@@ -1272,7 +1272,7 @@ void wined3d_cs_emit_set_texture(struct wined3d_cs *cs, UINT stage, struct wined
@@ -1273,7 +1273,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 7c58e67901e..6f00fe64848 100644
}
static UINT wined3d_cs_exec_set_shader_resource_view(struct wined3d_cs *cs, const void *data)
@@ -1305,7 +1305,7 @@ void wined3d_cs_emit_set_shader_resource_view(struct wined3d_cs *cs, enum wined3
@@ -1308,7 +1308,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 7c58e67901e..6f00fe64848 100644
}
static UINT wined3d_cs_exec_set_unordered_access_view(struct wined3d_cs *cs, const void *data)
@@ -1337,7 +1337,7 @@ void wined3d_cs_emit_set_unordered_access_view(struct wined3d_cs *cs, enum wined
@@ -1340,7 +1340,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 7c58e67901e..6f00fe64848 100644
}
static UINT wined3d_cs_exec_set_sampler(struct wined3d_cs *cs, const void *data)
@@ -1361,7 +1361,7 @@ void wined3d_cs_emit_set_sampler(struct wined3d_cs *cs, enum wined3d_shader_type
@@ -1367,7 +1367,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 7c58e67901e..6f00fe64848 100644
}
static UINT wined3d_cs_exec_set_shader(struct wined3d_cs *cs, const void *data)
@@ -1385,7 +1385,7 @@ void wined3d_cs_emit_set_shader(struct wined3d_cs *cs, enum wined3d_shader_type
@@ -1393,7 +1393,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 7c58e67901e..6f00fe64848 100644
}
static UINT wined3d_cs_exec_set_rasterizer_state(struct wined3d_cs *cs, const void *data)
@@ -1407,7 +1407,7 @@ void wined3d_cs_emit_set_rasterizer_state(struct wined3d_cs *cs,
@@ -1415,7 +1415,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 7c58e67901e..6f00fe64848 100644
}
static UINT wined3d_cs_exec_set_render_state(struct wined3d_cs *cs, const void *data)
@@ -1429,7 +1429,7 @@ void wined3d_cs_emit_set_render_state(struct wined3d_cs *cs, enum wined3d_render
@@ -1437,7 +1437,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 7c58e67901e..6f00fe64848 100644
}
static UINT wined3d_cs_exec_set_texture_state(struct wined3d_cs *cs, const void *data)
@@ -1453,7 +1453,7 @@ void wined3d_cs_emit_set_texture_state(struct wined3d_cs *cs, UINT stage,
@@ -1461,7 +1461,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 7c58e67901e..6f00fe64848 100644
}
static UINT wined3d_cs_exec_set_sampler_state(struct wined3d_cs *cs, const void *data)
@@ -1477,7 +1477,7 @@ void wined3d_cs_emit_set_sampler_state(struct wined3d_cs *cs, UINT sampler_idx,
@@ -1485,7 +1485,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 7c58e67901e..6f00fe64848 100644
}
static UINT wined3d_cs_exec_set_transform(struct wined3d_cs *cs, const void *data)
@@ -1501,7 +1501,7 @@ void wined3d_cs_emit_set_transform(struct wined3d_cs *cs, enum wined3d_transform
@@ -1509,7 +1509,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 7c58e67901e..6f00fe64848 100644
}
static UINT wined3d_cs_exec_set_clip_plane(struct wined3d_cs *cs, const void *data)
@@ -1523,7 +1523,7 @@ void wined3d_cs_emit_set_clip_plane(struct wined3d_cs *cs, UINT plane_idx, const
@@ -1531,7 +1531,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 7c58e67901e..6f00fe64848 100644
}
static UINT wined3d_cs_exec_set_color_key(struct wined3d_cs *cs, const void *data)
@@ -1608,7 +1608,7 @@ void wined3d_cs_emit_set_color_key(struct wined3d_cs *cs, struct wined3d_texture
@@ -1616,7 +1616,7 @@ void wined3d_cs_emit_set_color_key(struct wined3d_cs *cs, struct wined3d_texture
else
op->set = 0;
@@ -219,7 +219,7 @@ index 7c58e67901e..6f00fe64848 100644
}
static UINT wined3d_cs_exec_set_material(struct wined3d_cs *cs, const void *data)
@@ -1629,7 +1629,7 @@ void wined3d_cs_emit_set_material(struct wined3d_cs *cs, const struct wined3d_ma
@@ -1637,7 +1637,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 7c58e67901e..6f00fe64848 100644
}
static UINT wined3d_cs_exec_set_light(struct wined3d_cs *cs, const void *data)
@@ -1679,7 +1679,7 @@ void wined3d_cs_emit_set_light(struct wined3d_cs *cs, const struct wined3d_light
@@ -1687,7 +1687,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 7c58e67901e..6f00fe64848 100644
}
static UINT wined3d_cs_exec_set_light_enable(struct wined3d_cs *cs, const void *data)
@@ -1715,7 +1715,7 @@ void wined3d_cs_emit_set_light_enable(struct wined3d_cs *cs, unsigned int idx, B
@@ -1723,7 +1723,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 7c58e67901e..6f00fe64848 100644
}
static UINT wined3d_cs_exec_reset_state(struct wined3d_cs *cs, const void *data)
@@ -1739,7 +1739,7 @@ void wined3d_cs_emit_reset_state(struct wined3d_cs *cs)
@@ -1745,7 +1745,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,25 +255,16 @@ index 7c58e67901e..6f00fe64848 100644
}
static UINT wined3d_cs_exec_callback(struct wined3d_cs *cs, const void *data)
@@ -1988,7 +1988,7 @@ void wined3d_cs_emit_push_constants(struct wined3d_cs *cs, enum wined3d_push_con
@@ -1994,7 +1994,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);
- cs->ops->submit(cs);
+ cs->ops->submit_delayed(cs);
}
static UINT wined3d_cs_exec_set_primitive_type(struct wined3d_cs *cs, const void *data)
@@ -2014,7 +2014,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;
- cs->ops->submit(cs);
+ cs->ops->submit_delayed(cs);
}
static UINT wined3d_cs_exec_blt(struct wined3d_cs *cs, const void *data)
@@ -2535,6 +2535,7 @@ static const struct wined3d_cs_ops wined3d_cs_st_ops =
@@ -2514,6 +2514,7 @@ static const struct wined3d_cs_ops wined3d_cs_st_ops =
wined3d_cs_st_require_space,
wined3d_cs_st_submit,
wined3d_cs_st_submit,
@@ -281,7 +272,7 @@ index 7c58e67901e..6f00fe64848 100644
};
static void wined3d_cs_list_enqueue(struct wined3d_cs_list *list, struct wined3d_cs_block *block)
@@ -2711,11 +2712,17 @@ static void wined3d_cs_mt_submit_and_wait(struct wined3d_cs *cs)
@@ -2690,11 +2691,17 @@ static void wined3d_cs_mt_submit_and_wait(struct wined3d_cs *cs)
while (!InterlockedCompareExchange(&fence, TRUE, TRUE));
}
@@ -300,10 +291,10 @@ index 7c58e67901e..6f00fe64848 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 6ed9ec6f557..b9db6e880b7 100644
index e71dfbb2ca8..b8c14275406 100644
--- a/dlls/wined3d/wined3d_private.h
+++ b/dlls/wined3d/wined3d_private.h
@@ -3230,6 +3230,7 @@ struct wined3d_cs_ops
@@ -3216,6 +3216,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);

View File

@@ -1,4 +1,4 @@
From 1214019f4faa9b41852a33503f131c2cf86769dd Mon Sep 17 00:00:00 2001
From 25629ab322f251afa9ae5495212c84a00f5af00f Mon Sep 17 00:00:00 2001
From: Sebastian Lackner <sebastian@fds-team.de>
Date: Sun, 19 Feb 2017 08:29:23 +0100
Subject: wined3d: Reset context before destruction.
@@ -8,7 +8,7 @@ Subject: wined3d: Reset context before destruction.
1 file changed, 1 insertion(+)
diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c
index 60d24c38319..c32d967df88 100644
index aa24d7f4c37..1bf7db30b3d 100644
--- a/dlls/wined3d/device.c
+++ b/dlls/wined3d/device.c
@@ -1200,6 +1200,7 @@ HRESULT CDECL wined3d_device_uninit_3d(struct wined3d_device *device)
@@ -18,7 +18,7 @@ index 60d24c38319..c32d967df88 100644
+ context_set_current(NULL);
wined3d_device_delete_opengl_contexts(device);
if (device->back_buffer_view)
if (device->fb.depth_stencil)
--
2.11.0

View File

@@ -1,4 +1,4 @@
From e01ccb1f50492054732c4234a963832581a1aa8c Mon Sep 17 00:00:00 2001
From 3c4ecedb41a99b2ebe8cc5f1f6d6fe0341ff28bf Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Michael=20M=C3=BCller?= <michael@fds-team.de>
Date: Sun, 19 Feb 2017 17:38:00 +0100
Subject: wined3d: Set all default state values to zero.
@@ -12,10 +12,10 @@ keying in the Motoracer 2.
1 file changed, 3 insertions(+)
diff --git a/dlls/wined3d/stateblock.c b/dlls/wined3d/stateblock.c
index 463ccc91561..263b200c762 100644
index 8b9135356f1..0b587f78889 100644
--- a/dlls/wined3d/stateblock.c
+++ b/dlls/wined3d/stateblock.c
@@ -1358,6 +1358,9 @@ HRESULT state_init(struct wined3d_state *state, const struct wined3d_gl_info *gl
@@ -1306,6 +1306,9 @@ void state_init(struct wined3d_state *state, struct wined3d_fb_state *fb,
{
unsigned int i;
@@ -23,8 +23,8 @@ index 463ccc91561..263b200c762 100644
+ memset(state, 0, sizeof(*state));
+
state->flags = flags;
state->fb = fb;
for (i = 0; i < LIGHTMAP_SIZE; i++)
--
2.11.0

File diff suppressed because it is too large Load Diff