Rebase against 89b75296128e8c2cadc77cb06ecd7faa1f80d012.

This commit is contained in:
Sebastian Lackner 2017-03-01 00:46:59 +01:00
parent 3dfeab6722
commit c6708dbbbf
9 changed files with 253 additions and 483 deletions

View File

@ -52,7 +52,7 @@ usage()
# Get the upstream commit sha
upstream_commit()
{
echo "b47487af999f48ba2700b4dd5ff6cd47891d4787"
echo "89b75296128e8c2cadc77cb06ecd7faa1f80d012"
}
# Show version information
@ -8374,17 +8374,14 @@ fi
# |
# | Modified files:
# | * 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
# | dlls/wined3d/query.c, dlls/wined3d/resource.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: 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 },';
printf '%s\n' '+ { "Stefan Dösinger", "wined3d: Send blits through the command stream.", 1 },';
printf '%s\n' '+ { "Stefan Dösinger", "wined3d: Send render target view clears through the command stream.", 1 },';
@ -8419,7 +8416,6 @@ if test "$enable_wined3d_CSMT_Main" -eq 1; then
printf '%s\n' '+ { "Michael Müller", "wined3d: Don'\''t wait for events that have not been issued yet.", 1 },';
printf '%s\n' '+ { "Sebastian Lackner", "wined3d: Reset context before destruction.", 1 },';
printf '%s\n' '+ { "Sebastian Lackner", "wined3d: Synchronize before resizing swapchain context array.", 1 },';
printf '%s\n' '+ { "Michael Müller", "wined3d: Set all default state values to zero.", 1 },';
printf '%s\n' '+ { "Michael Müller", "wined3d: Improve wined3d_cs_emit_update_sub_resource.", 1 },';
printf '%s\n' '+ { "Michael Müller", "wined3d: Discard buffer during upload when replacing complete content.", 1 },';
printf '%s\n' '+ { "Sebastian Lackner", "wined3d: Enforce a memory limit of about 16 MB for CSMT blocks.", 1 },';

View File

@ -1,4 +1,4 @@
From 16a1078eca14d1a3b01144db70b440eeb1ba2458 Mon Sep 17 00:00:00 2001
From 9ae4703d968d423613ac1b190f141429c1cc7143 Mon Sep 17 00:00:00 2001
From: Sebastian Lackner <sebastian@fds-team.de>
Date: Sun, 19 Feb 2017 00:57:12 +0100
Subject: wined3d: Add additional synchronization CS ops.
@ -6,12 +6,13 @@ Subject: wined3d: Add additional synchronization CS ops.
---
dlls/wined3d/cs.c | 51 ++++++++++++++++++++++++++++++++++++++++--
dlls/wined3d/device.c | 2 ++
dlls/wined3d/swapchain.c | 1 +
dlls/wined3d/view.c | 6 +++++
dlls/wined3d/wined3d_private.h | 3 +++
4 files changed, 60 insertions(+), 2 deletions(-)
5 files changed, 61 insertions(+), 2 deletions(-)
diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c
index c6861818bce..060885dee7c 100644
index 8afa7313a02..b27a083007b 100644
--- a/dlls/wined3d/cs.c
+++ b/dlls/wined3d/cs.c
@@ -26,6 +26,8 @@ WINE_DEFAULT_DEBUG_CHANNEL(d3d);
@ -114,7 +115,7 @@ index c6861818bce..060885dee7c 100644
};
diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c
index eb626ba8a52..9f0ce923839 100644
index e812567b067..be6d784bddf 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)
@ -133,6 +134,18 @@ index eb626ba8a52..9f0ce923839 100644
if (!device->swapchains[0]->num_contexts)
return E_FAIL;
diff --git a/dlls/wined3d/swapchain.c b/dlls/wined3d/swapchain.c
index 78615456207..a5a7a09f569 100644
--- a/dlls/wined3d/swapchain.c
+++ b/dlls/wined3d/swapchain.c
@@ -66,6 +66,7 @@ static void swapchain_cleanup(struct wined3d_swapchain *swapchain)
}
wined3d_cs_destroy_object(swapchain->device->cs, wined3d_swapchain_destroy_object, swapchain);
+ wined3d_cs_emit_sync(swapchain->device->cs);
/* Restore the screen resolution if we rendered in fullscreen.
* This will restore the screen resolution to what it was before creating
diff --git a/dlls/wined3d/view.c b/dlls/wined3d/view.c
index 02964e4a96b..21aa8720e65 100644
--- a/dlls/wined3d/view.c
@ -172,10 +185,10 @@ index 02964e4a96b..21aa8720e65 100644
return WINED3D_OK;
diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h
index 38050527f8a..607fafe7804 100644
index 8b26b2827dd..8e875cec652 100644
--- a/dlls/wined3d/wined3d_private.h
+++ b/dlls/wined3d/wined3d_private.h
@@ -3179,6 +3179,7 @@ struct wined3d_cs_ops
@@ -3182,6 +3182,7 @@ struct wined3d_cs_ops
{
void *(*require_space)(struct wined3d_cs *cs, size_t size);
void (*submit)(struct wined3d_cs *cs);
@ -183,7 +196,7 @@ index 38050527f8a..607fafe7804 100644
void (*push_constants)(struct wined3d_cs *cs, enum wined3d_push_constants p,
unsigned int start_idx, unsigned int count, const void *constants);
};
@@ -3205,6 +3206,7 @@ void wined3d_cs_emit_dispatch(struct wined3d_cs *cs,
@@ -3208,6 +3209,7 @@ void wined3d_cs_emit_dispatch(struct wined3d_cs *cs,
void wined3d_cs_emit_draw(struct wined3d_cs *cs, GLenum primitive_type, int base_vertex_idx,
unsigned int start_idx, unsigned int index_count, unsigned int start_instance,
unsigned int instance_count, BOOL indexed) DECLSPEC_HIDDEN;
@ -191,7 +204,7 @@ index 38050527f8a..607fafe7804 100644
void wined3d_cs_emit_preload_resource(struct wined3d_cs *cs, struct wined3d_resource *resource) DECLSPEC_HIDDEN;
void wined3d_cs_emit_present(struct wined3d_cs *cs, struct wined3d_swapchain *swapchain,
const RECT *src_rect, const RECT *dst_rect, HWND dst_window_override, DWORD flags) DECLSPEC_HIDDEN;
@@ -3256,6 +3258,7 @@ void wined3d_cs_emit_set_unordered_access_view(struct wined3d_cs *cs, enum wined
@@ -3259,6 +3261,7 @@ void wined3d_cs_emit_set_unordered_access_view(struct wined3d_cs *cs, enum wined
void wined3d_cs_emit_set_vertex_declaration(struct wined3d_cs *cs,
struct wined3d_vertex_declaration *declaration) DECLSPEC_HIDDEN;
void wined3d_cs_emit_set_viewport(struct wined3d_cs *cs, const struct wined3d_viewport *viewport) DECLSPEC_HIDDEN;

View File

@ -1,34 +0,0 @@
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 | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c
index 73352d93b97..d3be8d1ef21 100644
--- a/dlls/wined3d/cs.c
+++ b/dlls/wined3d/cs.c
@@ -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)
{
- struct wined3d_state *state = &cs->device->state;
+ struct wined3d_state *state = &cs->state;
const struct wined3d_cs_dispatch *op = data;
dispatch_compute(cs->device, state,
@@ -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)
{
- struct wined3d_state *state = &cs->device->state;
+ struct wined3d_state *state = &cs->state;
const struct wined3d_cs_draw *op = data;
unsigned int i;
--
2.11.0

View File

@ -1,89 +0,0 @@
From 818d79add5b67b17199f656bc9286405878e9179 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Stefan=20D=C3=B6singer?= <stefan@codeweavers.com>
Date: Thu, 4 Apr 2013 14:52:24 +0200
Subject: wined3d: Pass the depth stencil to swapchain->present
TODO: Test if D3DPRESENTFLAG_DISCARD_DEPTHSTENCIL discards the current
DS or the implicit DS.
---
dlls/wined3d/cs.c | 3 ++-
dlls/wined3d/swapchain.c | 13 +++++++------
dlls/wined3d/wined3d_private.h | 3 ++-
3 files changed, 11 insertions(+), 8 deletions(-)
diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c
index 53c1cc48728..d6e5179235b 100644
--- a/dlls/wined3d/cs.c
+++ b/dlls/wined3d/cs.c
@@ -413,7 +413,8 @@ static void wined3d_cs_exec_present(struct wined3d_cs *cs, const void *data)
swapchain = op->swapchain;
wined3d_swapchain_set_window(swapchain, op->dst_window_override);
- swapchain->swapchain_ops->swapchain_present(swapchain, &op->src_rect, &op->dst_rect, op->flags);
+ swapchain->swapchain_ops->swapchain_present(swapchain, &op->src_rect, &op->dst_rect, op->flags,
+ cs->state.fb->depth_stencil);
wined3d_resource_release(&swapchain->front_buffer->resource);
for (i = 0; i < swapchain->desc.backbuffer_count; ++i)
diff --git a/dlls/wined3d/swapchain.c b/dlls/wined3d/swapchain.c
index ad2d6e26d53..7e48b5d12b5 100644
--- a/dlls/wined3d/swapchain.c
+++ b/dlls/wined3d/swapchain.c
@@ -488,10 +488,10 @@ static void wined3d_swapchain_rotate(struct wined3d_swapchain *swapchain, struct
}
static void swapchain_gl_present(struct wined3d_swapchain *swapchain,
- const RECT *src_rect, const RECT *dst_rect, DWORD flags)
+ const RECT *src_rect, const RECT *dst_rect, DWORD flags,
+ struct wined3d_rendertarget_view *depth_stencil)
{
struct wined3d_texture *back_buffer = swapchain->back_buffers[0];
- const struct wined3d_fb_state *fb = &swapchain->device->fb;
const struct wined3d_gl_info *gl_info;
struct wined3d_texture *logo_texture;
struct wined3d_context *context;
@@ -622,14 +622,14 @@ static void swapchain_gl_present(struct wined3d_swapchain *swapchain,
wined3d_texture_validate_location(swapchain->back_buffers[swapchain->desc.backbuffer_count - 1],
0, WINED3D_LOCATION_DISCARDED);
- if (fb->depth_stencil)
+ if (depth_stencil)
{
- struct wined3d_surface *ds = wined3d_rendertarget_view_get_surface(fb->depth_stencil);
+ struct wined3d_surface *ds = wined3d_rendertarget_view_get_surface(depth_stencil);
if (ds && (swapchain->desc.flags & WINED3D_SWAPCHAIN_DISCARD_DEPTHSTENCIL
|| ds->container->flags & WINED3D_TEXTURE_DISCARD))
wined3d_texture_validate_location(ds->container,
- fb->depth_stencil->sub_resource_idx, WINED3D_LOCATION_DISCARDED);
+ depth_stencil->sub_resource_idx, WINED3D_LOCATION_DISCARDED);
}
context_release(context);
@@ -695,7 +695,8 @@ static void swapchain_gdi_frontbuffer_updated(struct wined3d_swapchain *swapchai
}
static void swapchain_gdi_present(struct wined3d_swapchain *swapchain,
- const RECT *src_rect, const RECT *dst_rect, DWORD flags)
+ const RECT *src_rect, const RECT *dst_rect, DWORD flags,
+ struct wined3d_rendertarget_view *depth_stencil)
{
struct wined3d_surface *front, *back;
HBITMAP bitmap;
diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h
index df3c92cb568..4986cb33465 100644
--- a/dlls/wined3d/wined3d_private.h
+++ b/dlls/wined3d/wined3d_private.h
@@ -3393,7 +3393,8 @@ void wined3d_unordered_access_view_invalidate_location(struct wined3d_unordered_
struct wined3d_swapchain_ops
{
void (*swapchain_present)(struct wined3d_swapchain *swapchain,
- const RECT *src_rect, const RECT *dst_rect, DWORD flags);
+ const RECT *src_rect, const RECT *dst_rect, DWORD flags,
+ struct wined3d_rendertarget_view *depth_stencil);
void (*swapchain_frontbuffer_updated)(struct wined3d_swapchain *swapchain);
};
--
2.11.0

View File

@ -1,4 +1,4 @@
From 7e1cd67f99767509847f9914eb1ad37973f9034c Mon Sep 17 00:00:00 2001
From 60b6de71e32b72a2ff8efcfcd1def39b458b6904 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Stefan=20D=C3=B6singer?= <stefan@codeweavers.com>
Date: Wed, 10 Apr 2013 19:10:41 +0200
Subject: wined3d: Prevent the command stream from running ahead too far
@ -9,19 +9,19 @@ Subject: wined3d: Prevent the command stream from running ahead too far
2 files changed, 18 insertions(+)
diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c
index d6e5179235b..66f7034686f 100644
index 11c786a731c..8663c029215 100644
--- a/dlls/wined3d/cs.c
+++ b/dlls/wined3d/cs.c
@@ -416,6 +416,8 @@ static void wined3d_cs_exec_present(struct wined3d_cs *cs, const void *data)
swapchain->swapchain_ops->swapchain_present(swapchain, &op->src_rect, &op->dst_rect, op->flags,
cs->state.fb->depth_stencil);
@@ -409,6 +409,8 @@ static void wined3d_cs_exec_present(struct wined3d_cs *cs, const void *data)
swapchain->swapchain_ops->swapchain_present(swapchain, &op->src_rect, &op->dst_rect, op->flags);
+ InterlockedDecrement(&cs->pending_presents);
+
wined3d_resource_release(&swapchain->front_buffer->resource);
for (i = 0; i < swapchain->desc.backbuffer_count; ++i)
{
@@ -428,6 +430,7 @@ void wined3d_cs_emit_present(struct wined3d_cs *cs, struct wined3d_swapchain *sw
@@ -421,6 +423,7 @@ void wined3d_cs_emit_present(struct wined3d_cs *cs, struct wined3d_swapchain *sw
{
struct wined3d_cs_present *op;
unsigned int i;
@ -29,7 +29,7 @@ index d6e5179235b..66f7034686f 100644
op = cs->ops->require_space(cs, sizeof(*op));
op->opcode = WINED3D_CS_OP_PRESENT;
@@ -443,7 +446,20 @@ void wined3d_cs_emit_present(struct wined3d_cs *cs, struct wined3d_swapchain *sw
@@ -436,7 +439,20 @@ void wined3d_cs_emit_present(struct wined3d_cs *cs, struct wined3d_swapchain *sw
wined3d_resource_acquire(&swapchain->back_buffers[i]->resource);
}
@ -51,10 +51,10 @@ index d6e5179235b..66f7034686f 100644
static void wined3d_cs_exec_clear(struct wined3d_cs *cs, const void *data)
diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h
index 4986cb33465..772a8492fb0 100644
index e9aeb48fb6f..5ba22f2c148 100644
--- a/dlls/wined3d/wined3d_private.h
+++ b/dlls/wined3d/wined3d_private.h
@@ -3180,6 +3180,8 @@ struct wined3d_cs
@@ -3194,6 +3194,8 @@ struct wined3d_cs
size_t data_size, start, end;
void *data;

View File

@ -1,4 +1,4 @@
From 28c54b09deec1d91899a2317f52931f0b1697f7e Mon Sep 17 00:00:00 2001
From 99532d442dd915def1f20d52586e39f67b79c9ec Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Stefan=20D=C3=B6singer?= <stefan@codeweavers.com>
Date: Thu, 10 Oct 2013 16:43:19 +0200
Subject: wined3d: Create the initial context through the CS.
@ -6,12 +6,12 @@ Subject: wined3d: Create the initial context through the CS.
Very hacky.
---
dlls/wined3d/cs.c | 31 +++++++++++
dlls/wined3d/swapchain.c | 119 ++++++++++++++++++++++-------------------
dlls/wined3d/swapchain.c | 121 ++++++++++++++++++++++-------------------
dlls/wined3d/wined3d_private.h | 4 ++
3 files changed, 100 insertions(+), 54 deletions(-)
3 files changed, 101 insertions(+), 55 deletions(-)
diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c
index 24051b16899..c9273e5508e 100644
index eaa9267e5ba..544a6bf89e6 100644
--- a/dlls/wined3d/cs.c
+++ b/dlls/wined3d/cs.c
@@ -73,6 +73,7 @@ enum wined3d_cs_op
@ -36,7 +36,7 @@ index 24051b16899..c9273e5508e 100644
static void wined3d_cs_exec_sync(struct wined3d_cs *cs, const void *data)
{
}
@@ -2068,6 +2076,28 @@ HRESULT wined3d_cs_emit_release_dc(struct wined3d_cs *cs, struct wined3d_texture
@@ -2067,6 +2075,28 @@ HRESULT wined3d_cs_emit_release_dc(struct wined3d_cs *cs, struct wined3d_texture
return hr;
}
@ -65,7 +65,7 @@ index 24051b16899..c9273e5508e 100644
static void (* const wined3d_cs_op_handlers[])(struct wined3d_cs *cs, const void *data) =
{
/* WINED3D_CS_OP_SYNC */ wined3d_cs_exec_sync,
@@ -2117,6 +2147,7 @@ static void (* const wined3d_cs_op_handlers[])(struct wined3d_cs *cs, const void
@@ -2116,6 +2146,7 @@ static void (* const wined3d_cs_op_handlers[])(struct wined3d_cs *cs, const void
/* WINED3D_CS_OP_UPDATE_SUB_RESOURCE */ wined3d_cs_exec_update_sub_resource,
/* WINED3D_CS_OP_GET_DC */ wined3d_cs_exec_get_dc,
/* WINED3D_CS_OP_RELEASE_DC */ wined3d_cs_exec_release_dc,
@ -74,10 +74,10 @@ index 24051b16899..c9273e5508e 100644
static void *wined3d_cs_st_require_space(struct wined3d_cs *cs, size_t size)
diff --git a/dlls/wined3d/swapchain.c b/dlls/wined3d/swapchain.c
index 7e48b5d12b5..592cbd96db4 100644
index b3da7f6e20a..8d69820d400 100644
--- a/dlls/wined3d/swapchain.c
+++ b/dlls/wined3d/swapchain.c
@@ -786,6 +786,69 @@ static void wined3d_swapchain_apply_sample_count_override(const struct wined3d_s
@@ -787,6 +787,69 @@ static void wined3d_swapchain_apply_sample_count_override(const struct wined3d_s
*quality = 0;
}
@ -102,7 +102,6 @@ index 7e48b5d12b5..592cbd96db4 100644
+ ERR("Failed to create the context array.\n");
+ return E_OUTOFMEMORY;
+ }
+ swapchain->num_contexts = 1;
+
+ /* In WGL both color, depth and stencil are features of a pixel format. In case of D3D they are separate.
+ * You are able to add a depth + stencil surface at a later stage when you need it.
@ -131,6 +130,7 @@ index 7e48b5d12b5..592cbd96db4 100644
+ swapchain->context = NULL;
+ return WINED3DERR_NOTAVAILABLE;
+ }
+ swapchain->num_contexts = 1;
+
+ if (wined3d_settings.offscreen_rendering_mode != ORM_FBO
+ && (!swapchain->desc.enable_auto_depth_stencil
@ -147,7 +147,7 @@ index 7e48b5d12b5..592cbd96db4 100644
static HRESULT swapchain_init(struct wined3d_swapchain *swapchain, struct wined3d_device *device,
struct wined3d_swapchain_desc *desc, void *parent, const struct wined3d_parent_ops *parent_ops)
{
@@ -912,61 +975,9 @@ static HRESULT swapchain_init(struct wined3d_swapchain *swapchain, struct wined3
@@ -913,61 +976,9 @@ static HRESULT swapchain_init(struct wined3d_swapchain *swapchain, struct wined3
if (!(device->wined3d->flags & WINED3D_NO3D))
{
@ -167,11 +167,8 @@ index 7e48b5d12b5..592cbd96db4 100644
- {
- ERR("Failed to create the context array.\n");
- hr = E_OUTOFMEMORY;
+ hr = wined3d_cs_emit_create_swapchain_context(device->cs, swapchain);
+ if (FAILED(hr))
goto err;
- goto err;
- }
- swapchain->num_contexts = 1;
-
- /* In WGL both color, depth and stencil are features of a pixel format. In case of D3D they are separate.
- * You are able to add a depth + stencil surface at a later stage when you need it.
@ -199,6 +196,7 @@ index 7e48b5d12b5..592cbd96db4 100644
- hr = WINED3DERR_NOTAVAILABLE;
- goto err;
- }
- swapchain->num_contexts = 1;
-
- if (wined3d_settings.offscreen_rendering_mode != ORM_FBO
- && (!desc->enable_auto_depth_stencil
@ -208,14 +206,17 @@ index 7e48b5d12b5..592cbd96db4 100644
- }
- context_release(swapchain->context[0]);
- swapchain_update_swap_interval(swapchain);
+ hr = wined3d_cs_emit_create_swapchain_context(device->cs, swapchain);
+ if (FAILED(hr))
+ goto err;
}
if (swapchain->desc.backbuffer_count > 0)
diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h
index 065f118fcb7..c4830e3ab44 100644
index ffcc6c400fb..c6c2a5902fa 100644
--- a/dlls/wined3d/wined3d_private.h
+++ b/dlls/wined3d/wined3d_private.h
@@ -3218,6 +3218,8 @@ void wined3d_cs_emit_clear(struct wined3d_cs *cs, DWORD rect_count, const RECT *
@@ -3221,6 +3221,8 @@ void wined3d_cs_emit_clear(struct wined3d_cs *cs, DWORD rect_count, const RECT *
void wined3d_cs_emit_clear_rtv(struct wined3d_cs *cs, struct wined3d_rendertarget_view *view,
const RECT *rect, DWORD flags, const struct wined3d_color *color, float depth, DWORD stencil,
const struct blit_shader *blitter) DECLSPEC_HIDDEN;
@ -224,7 +225,7 @@ index 065f118fcb7..c4830e3ab44 100644
void wined3d_cs_emit_dispatch(struct wined3d_cs *cs,
unsigned int group_count_x, unsigned int group_count_y, unsigned int group_count_z) DECLSPEC_HIDDEN;
void wined3d_cs_emit_draw(struct wined3d_cs *cs, GLenum primitive_type, int base_vertex_idx,
@@ -3470,6 +3472,8 @@ struct wined3d_swapchain
@@ -3472,6 +3474,8 @@ struct wined3d_swapchain
void wined3d_swapchain_activate(struct wined3d_swapchain *swapchain, BOOL activate) DECLSPEC_HIDDEN;
struct wined3d_context *swapchain_get_context(struct wined3d_swapchain *swapchain) DECLSPEC_HIDDEN;

View File

@ -1,30 +0,0 @@
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.
This patch is necessary as some of the values contain random data which is
especially dangerous when the CS has its own state and the values differ.
The patch fixes geometry errors in the second level of FarCry and color
keying in the Motoracer 2.
---
dlls/wined3d/stateblock.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/dlls/wined3d/stateblock.c b/dlls/wined3d/stateblock.c
index 8b9135356f1..0b587f78889 100644
--- a/dlls/wined3d/stateblock.c
+++ b/dlls/wined3d/stateblock.c
@@ -1306,6 +1306,9 @@ void state_init(struct wined3d_state *state, struct wined3d_fb_state *fb,
{
unsigned int i;
+ if (flags & WINED3D_STATE_INIT_DEFAULT)
+ memset(state, 0, sizeof(*state));
+
state->flags = flags;
state->fb = fb;
--
2.11.0

File diff suppressed because it is too large Load Diff