Rebase against 60c98caa94465799d0868b69149bce29cf767de4.

This commit is contained in:
Sebastian Lackner 2017-02-21 05:05:05 +01:00
parent 7881913b09
commit dc52cbef3c
13 changed files with 553 additions and 934 deletions

View File

@ -1,61 +0,0 @@
From bb079b53bc79d44987d5f7ac93d0e1d2c5b00698 Mon Sep 17 00:00:00 2001
From: Austin English <austinenglish@gmail.com>
Date: Wed, 9 Nov 2016 21:46:10 -0600
Subject: advapi32: add LookupSecurityDescriptorPartsA/W stubs
Fixes https://bugs.winehq.org/show_bug.cgi?id=41682
---
dlls/advapi32/advapi32.spec | 4 ++--
dlls/advapi32/security.c | 24 ++++++++++++++++++++++++
2 files changed, 26 insertions(+), 2 deletions(-)
diff --git a/dlls/advapi32/advapi32.spec b/dlls/advapi32/advapi32.spec
index 6c57c88adf7..88d8634ef64 100644
--- a/dlls/advapi32/advapi32.spec
+++ b/dlls/advapi32/advapi32.spec
@@ -415,8 +415,8 @@
@ stdcall LookupPrivilegeNameW(wstr ptr ptr ptr)
@ stdcall LookupPrivilegeValueA(ptr ptr ptr)
@ stdcall LookupPrivilegeValueW(ptr ptr ptr)
-# @ stub LookupSecurityDescriptorPartsA
-# @ stub LookupSecurityDescriptorPartsW
+@ stdcall LookupSecurityDescriptorPartsA(ptr ptr ptr ptr ptr ptr ptr)
+@ stdcall LookupSecurityDescriptorPartsW(ptr ptr ptr ptr ptr ptr ptr)
@ stdcall LsaAddAccountRights(ptr ptr ptr long)
@ stub LsaAddPrivilegesToAccount
# @ stub LsaClearAuditLog
diff --git a/dlls/advapi32/security.c b/dlls/advapi32/security.c
index 3b5d7a42b6f..01e8ea02706 100644
--- a/dlls/advapi32/security.c
+++ b/dlls/advapi32/security.c
@@ -6199,3 +6199,27 @@ BOOL WINAPI SaferSetLevelInformation(SAFER_LEVEL_HANDLE handle, SAFER_OBJECT_INF
FIXME("(%p %u %p %u) stub\n", handle, infotype, buffer, size);
return FALSE;
}
+
+/******************************************************************************
+ * LookupSecurityDescriptorPartsA [ADVAPI32.@]
+ */
+DWORD WINAPI LookupSecurityDescriptorPartsA(TRUSTEEA *owner, TRUSTEEA *group, ULONG *access_count,
+ EXPLICIT_ACCESSA *access_list, ULONG *audit_count,
+ EXPLICIT_ACCESSA *audit_list, SECURITY_DESCRIPTOR *descriptor)
+{
+ FIXME("(%p %p %p %p %p %p %p) stub\n", owner, group, access_count,
+ access_list, audit_count, audit_list, descriptor);
+ return ERROR_CALL_NOT_IMPLEMENTED;
+}
+
+/******************************************************************************
+ * LookupSecurityDescriptorPartsW [ADVAPI32.@]
+ */
+DWORD WINAPI LookupSecurityDescriptorPartsW(TRUSTEEW *owner, TRUSTEEW *group, ULONG *access_count,
+ EXPLICIT_ACCESSW *access_list, ULONG *audit_count,
+ EXPLICIT_ACCESSW *audit_list, SECURITY_DESCRIPTOR *descriptor)
+{
+ FIXME("(%p %p %p %p %p %p %p) stub\n", owner, group, access_count,
+ access_list, audit_count, audit_list, descriptor);
+ return ERROR_CALL_NOT_IMPLEMENTED;
+}
--
2.11.0

View File

@ -1 +0,0 @@
Fixes: [41682] Add stub for advapi32.LookupSecurityDescriptorPartsA/W

View File

@ -1,4 +1,4 @@
From da747c61c2cee3712c061fa75b462228ffdee12d Mon Sep 17 00:00:00 2001
From a9fb17a4b519b6ca814cd9402531a1ca860634f1 Mon Sep 17 00:00:00 2001
From: Dmitry Timoshkov <dmitry@baikal.ru>
Date: Fri, 10 Feb 2017 00:34:37 +0800
Subject: comctl32: Add support for PSPCB_ADDREF/PSPCB_RELEASE callback
@ -6,14 +6,13 @@ Subject: comctl32: Add support for PSPCB_ADDREF/PSPCB_RELEASE callback
---
dlls/comctl32/propsheet.c | 9 +++++++++
include/prsht.h | 1 +
2 files changed, 10 insertions(+)
1 file changed, 9 insertions(+)
diff --git a/dlls/comctl32/propsheet.c b/dlls/comctl32/propsheet.c
index 654b06fbcec..78afaa924ef 100644
index a3a6a5c4df8..4c4ca82a572 100644
--- a/dlls/comctl32/propsheet.c
+++ b/dlls/comctl32/propsheet.c
@@ -2991,6 +2991,9 @@ HPROPSHEETPAGE WINAPI CreatePropertySheetPageA(
@@ -3013,6 +3013,9 @@ HPROPSHEETPAGE WINAPI CreatePropertySheetPageA(
else
ppsp->pszHeaderSubTitle = NULL;
@ -23,7 +22,7 @@ index 654b06fbcec..78afaa924ef 100644
return (HPROPSHEETPAGE)ppsp;
}
@@ -3047,6 +3050,9 @@ HPROPSHEETPAGE WINAPI CreatePropertySheetPageW(LPCPROPSHEETPAGEW lpPropSheetPage
@@ -3059,6 +3062,9 @@ HPROPSHEETPAGE WINAPI CreatePropertySheetPageW(LPCPROPSHEETPAGEW lpPropSheetPage
else
ppsp->pszHeaderSubTitle = NULL;
@ -33,7 +32,7 @@ index 654b06fbcec..78afaa924ef 100644
return (HPROPSHEETPAGE)ppsp;
}
@@ -3068,6 +3074,9 @@ BOOL WINAPI DestroyPropertySheetPage(HPROPSHEETPAGE hPropPage)
@@ -3080,6 +3086,9 @@ BOOL WINAPI DestroyPropertySheetPage(HPROPSHEETPAGE hPropPage)
if (!psp)
return FALSE;
@ -43,18 +42,6 @@ index 654b06fbcec..78afaa924ef 100644
if (!(psp->dwFlags & PSP_DLGINDIRECT) && !IS_INTRESOURCE( psp->u.pszTemplate ))
Free ((LPVOID)psp->u.pszTemplate);
diff --git a/include/prsht.h b/include/prsht.h
index 21fc266447c..75ccc7c2917 100644
--- a/include/prsht.h
+++ b/include/prsht.h
@@ -293,6 +293,7 @@ DECL_PRSHT_TYPE_AW(LPCPROPSHEETPAGE, LATEST)
#define PSP_USEFUSIONCONTEXT 0x00004000
#define PSP_COMMANDLINKS 0x00040000
+#define PSPCB_ADDREF 0
#define PSPCB_RELEASE 1
#define PSPCB_CREATE 2
--
2.11.0

View File

@ -52,13 +52,13 @@ usage()
# Get the upstream commit sha
upstream_commit()
{
echo "9eb56e25e37b4adec0d72875455ffb787238672f"
echo "60c98caa94465799d0868b69149bce29cf767de4"
}
# Show version information
version()
{
echo "Wine Staging 2.2"
echo "Wine Staging 2.3 (unreleased)"
echo "Copyright (C) 2014-2017 the Wine Staging project authors."
echo ""
echo "Patchset to be applied on upstream Wine:"
@ -87,7 +87,6 @@ patch_enable_all ()
enable_Pipelight="$1"
enable_Staging="$1"
enable_advapi32_GetExplicitEntriesFromAclW="$1"
enable_advapi32_LookupSecurityDescriptorParts="$1"
enable_advapi32_LsaLookupSids="$1"
enable_advapi32_SetSecurityInfo="$1"
enable_advapi32_WinBuiltinAnyPackageSid="$1"
@ -476,9 +475,6 @@ patch_enable ()
advapi32-GetExplicitEntriesFromAclW)
enable_advapi32_GetExplicitEntriesFromAclW="$2"
;;
advapi32-LookupSecurityDescriptorParts)
enable_advapi32_LookupSecurityDescriptorParts="$2"
;;
advapi32-LsaLookupSids)
enable_advapi32_LsaLookupSids="$2"
;;
@ -2553,21 +2549,6 @@ if test "$enable_advapi32_GetExplicitEntriesFromAclW" -eq 1; then
) >> "$patchlist"
fi
# Patchset advapi32-LookupSecurityDescriptorParts
# |
# | This patchset fixes the following Wine bugs:
# | * [#41682] Add stub for advapi32.LookupSecurityDescriptorPartsA/W
# |
# | Modified files:
# | * dlls/advapi32/advapi32.spec, dlls/advapi32/security.c
# |
if test "$enable_advapi32_LookupSecurityDescriptorParts" -eq 1; then
patch_apply advapi32-LookupSecurityDescriptorParts/0001-advapi32-add-LookupSecurityDescriptorPartsA-W-stubs.patch
(
printf '%s\n' '+ { "Austin English", "advapi32: Add LookupSecurityDescriptorPartsA/W stubs.", 1 },';
) >> "$patchlist"
fi
# Patchset server-CreateProcess_ACLs
# |
# | This patchset fixes the following Wine bugs:
@ -2979,7 +2960,7 @@ fi
# Patchset comctl32-PROPSHEET_InsertPage
# |
# | Modified files:
# | * dlls/comctl32/propsheet.c, include/prsht.h
# | * dlls/comctl32/propsheet.c
# |
if test "$enable_comctl32_PROPSHEET_InsertPage" -eq 1; then
patch_apply comctl32-PROPSHEET_InsertPage/0003-comctl32-Add-support-for-PSPCB_ADDREF-PSPCB_RELEASE-.patch
@ -8426,7 +8407,6 @@ if test "$enable_wined3d_CSMT_Main" -eq 1; then
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: Send light 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 },';

View File

@ -1,213 +0,0 @@
From e9de3bb5f8aa7b31dc4caee4bd53a75c84ec42f2 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Stefan=20D=C3=B6singer?= <stefan@codeweavers.com>
Date: Wed, 10 Apr 2013 17:16:02 +0200
Subject: wined3d: Send light updates through the command stream
---
dlls/wined3d/cs.c | 100 +++++++++++++++++++++++++++++++++++++++++
dlls/wined3d/device.c | 21 +++------
dlls/wined3d/wined3d_private.h | 2 +
3 files changed, 108 insertions(+), 15 deletions(-)
diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c
index 7490b36a827..594a4b5b175 100644
--- a/dlls/wined3d/cs.c
+++ b/dlls/wined3d/cs.c
@@ -65,6 +65,8 @@ enum wined3d_cs_op
WINED3D_CS_OP_UNMAP,
WINED3D_CS_OP_PUSH_CONSTANTS,
WINED3D_CS_OP_SET_PRIMITIVE_TYPE,
+ WINED3D_CS_OP_SET_LIGHT,
+ WINED3D_CS_OP_SET_LIGHT_ENABLE,
};
struct wined3d_cs_sync
@@ -357,6 +359,19 @@ struct wined3d_cs_set_primitive_type
GLenum gl_primitive_type;
};
+struct wined3d_cs_set_light
+{
+ enum wined3d_cs_op opcode;
+ struct wined3d_light_info light;
+};
+
+struct wined3d_cs_set_light_enable
+{
+ enum wined3d_cs_op opcode;
+ UINT idx;
+ BOOL enable;
+};
+
static void wined3d_cs_exec_sync(struct wined3d_cs *cs, const void *data)
{
}
@@ -1678,6 +1693,89 @@ void wined3d_cs_emit_set_primitive_type(struct wined3d_cs *cs, GLenum primitive_
cs->ops->submit(cs);
}
+static void wined3d_cs_exec_set_light(struct wined3d_cs *cs, const void *data)
+{
+ const struct wined3d_cs_set_light *op = data;
+ UINT light_idx = op->light.OriginalIndex;
+ UINT hash_idx = LIGHTMAP_HASHFUNC(op->light.OriginalIndex);
+ struct wined3d_light_info *object;
+
+ if (!(object = wined3d_state_get_light(&cs->state, light_idx)))
+ {
+ TRACE("Adding new light\n");
+ object = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(*object));
+ if (!object)
+ {
+ ERR("Out of memory!\n");
+ return;
+ }
+
+ list_add_head(&cs->state.light_map[hash_idx], &object->entry);
+ object->glIndex = -1;
+ object->OriginalIndex = light_idx;
+ }
+
+ /* Update the live definitions if the light is currently assigned a glIndex. */
+ if (object->glIndex != -1)
+ {
+ if (object->OriginalParms.type != op->light.OriginalParms.type)
+ device_invalidate_state(cs->device, STATE_LIGHT_TYPE);
+ device_invalidate_state(cs->device, STATE_ACTIVELIGHT(object->glIndex));
+ }
+
+ object->OriginalParms = op->light.OriginalParms;
+ object->position = op->light.position;
+ object->direction = op->light.direction;
+ object->exponent = op->light.exponent;
+ object->cutoff = op->light.cutoff;
+}
+
+void wined3d_cs_emit_set_light(struct wined3d_cs *cs, const struct wined3d_light_info *light)
+{
+ struct wined3d_cs_set_light *op;
+
+ op = cs->ops->require_space(cs, sizeof(*op));
+ op->opcode = WINED3D_CS_OP_SET_LIGHT;
+ op->light = *light;
+
+ cs->ops->submit(cs);
+}
+
+static void wined3d_cs_exec_set_light_enable(struct wined3d_cs *cs, const void *data)
+{
+ const struct wined3d_cs_set_light_enable *op = data;
+ struct wined3d_light_info *light_info;
+ struct wined3d_device *device = cs->device;
+ int prev_idx;
+
+ /* Should be handled by the device by emitting a set_light op */
+ if (!(light_info = wined3d_state_get_light(&cs->state, op->idx)))
+ {
+ ERR("Light enabled requested but light not defined in cs state!\n");
+ return;
+ }
+
+ prev_idx = light_info->glIndex;
+ wined3d_state_enable_light(&cs->state, &device->adapter->d3d_info, light_info, op->enable);
+ if (light_info->glIndex != prev_idx)
+ {
+ device_invalidate_state(device, STATE_LIGHT_TYPE);
+ device_invalidate_state(device, STATE_ACTIVELIGHT(op->enable ? light_info->glIndex : prev_idx));
+ }
+}
+
+void wined3d_cs_emit_set_light_enable(struct wined3d_cs *cs, UINT idx, BOOL enable)
+{
+ struct wined3d_cs_set_light_enable *op;
+
+ op = cs->ops->require_space(cs, sizeof(*op));
+ op->opcode = WINED3D_CS_OP_SET_LIGHT_ENABLE;
+ op->idx = idx;
+ op->enable = enable;
+
+ 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,
@@ -1719,6 +1817,8 @@ 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_SET_LIGHT */ wined3d_cs_exec_set_light,
+ /* WINED3D_CS_OP_SET_LIGHT_ENABLE */ wined3d_cs_exec_set_light_enable,
};
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 6fb09dfcf19..dd8943d2e3e 100644
--- a/dlls/wined3d/device.c
+++ b/dlls/wined3d/device.c
@@ -1619,14 +1619,6 @@ HRESULT CDECL wined3d_device_set_light(struct wined3d_device *device,
light->direction.x, light->direction.y, light->direction.z,
light->range, light->falloff, light->theta, light->phi);
- /* Update the live definitions if the light is currently assigned a glIndex. */
- if (object->glIndex != -1 && !device->recording)
- {
- if (object->OriginalParms.type != light->type)
- device_invalidate_state(device, STATE_LIGHT_TYPE);
- device_invalidate_state(device, STATE_ACTIVELIGHT(object->glIndex));
- }
-
/* Save away the information. */
object->OriginalParms = *light;
@@ -1706,6 +1698,9 @@ HRESULT CDECL wined3d_device_set_light(struct wined3d_device *device,
FIXME("Unrecognized light type %#x.\n", light->type);
}
+ if (!device->recording)
+ wined3d_cs_emit_set_light(device->cs, object);
+
return WINED3D_OK;
}
@@ -1729,7 +1724,6 @@ HRESULT CDECL wined3d_device_get_light(const struct wined3d_device *device,
HRESULT CDECL wined3d_device_set_light_enable(struct wined3d_device *device, UINT light_idx, BOOL enable)
{
struct wined3d_light_info *light_info;
- int prev_idx;
TRACE("device %p, light_idx %u, enable %#x.\n", device, light_idx, enable);
@@ -1746,13 +1740,10 @@ HRESULT CDECL wined3d_device_set_light_enable(struct wined3d_device *device, UIN
}
}
- prev_idx = light_info->glIndex;
wined3d_state_enable_light(device->update_state, &device->adapter->d3d_info, light_info, enable);
- if (!device->recording && light_info->glIndex != prev_idx)
- {
- device_invalidate_state(device, STATE_LIGHT_TYPE);
- device_invalidate_state(device, STATE_ACTIVELIGHT(enable ? light_info->glIndex : prev_idx));
- }
+
+ if (!device->recording)
+ wined3d_cs_emit_set_light_enable(device->cs, light_idx, enable);
return WINED3D_OK;
}
diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h
index 514f162fefa..df3c92cb568 100644
--- a/dlls/wined3d/wined3d_private.h
+++ b/dlls/wined3d/wined3d_private.h
@@ -3210,6 +3210,8 @@ void wined3d_cs_emit_set_depth_stencil_view(struct wined3d_cs *cs,
struct wined3d_rendertarget_view *view) DECLSPEC_HIDDEN;
void wined3d_cs_emit_set_index_buffer(struct wined3d_cs *cs, struct wined3d_buffer *buffer,
enum wined3d_format_id format_id, unsigned int offset) DECLSPEC_HIDDEN;
+void wined3d_cs_emit_set_light(struct wined3d_cs *cs, const struct wined3d_light_info *light) DECLSPEC_HIDDEN;
+void wined3d_cs_emit_set_light_enable(struct wined3d_cs *cs, UINT idx, BOOL enable) DECLSPEC_HIDDEN;
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;
--
2.11.0

View File

@ -1,4 +1,4 @@
From 878bdfc42f19e26f2e4dbefdb9bd0b50bd341d97 Mon Sep 17 00:00:00 2001
From cb83d4886548b66c4c4fd0c006c3eca43d134067 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 66f7034686f..6bea12aa713 100644
index 130478e8882..420a2cc8327 100644
--- a/dlls/wined3d/cs.c
+++ b/dlls/wined3d/cs.c
@@ -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_SET_LIGHT,
WINED3D_CS_OP_SET_LIGHT_ENABLE,
+ WINED3D_CS_OP_BLT,
};
struct wined3d_cs_sync
@@ -372,6 +373,18 @@ struct wined3d_cs_set_light_enable
BOOL enable;
@@ -372,6 +373,18 @@ struct wined3d_cs_set_primitive_type
GLenum gl_primitive_type;
};
+struct wined3d_cs_blt
@ -43,7 +43,7 @@ index 66f7034686f..6bea12aa713 100644
static void wined3d_cs_exec_sync(struct wined3d_cs *cs, const void *data)
{
}
@@ -1793,6 +1806,44 @@ void wined3d_cs_emit_set_light_enable(struct wined3d_cs *cs, UINT idx, BOOL enab
@@ -1792,6 +1805,44 @@ void wined3d_cs_emit_set_primitive_type(struct wined3d_cs *cs, GLenum primitive_
cs->ops->submit(cs);
}
@ -88,19 +88,19 @@ index 66f7034686f..6bea12aa713 100644
static void (* const wined3d_cs_op_handlers[])(struct wined3d_cs *cs, const void *data) =
{
/* WINED3D_CS_OP_SYNC */ wined3d_cs_exec_sync,
@@ -1836,6 +1887,7 @@ static void (* const wined3d_cs_op_handlers[])(struct wined3d_cs *cs, const void
@@ -1835,6 +1886,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_SET_LIGHT */ wined3d_cs_exec_set_light,
/* WINED3D_CS_OP_SET_LIGHT_ENABLE */ wined3d_cs_exec_set_light_enable,
+ /* 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 dd8943d2e3e..66815f80647 100644
index 0b1b389af0b..6195122ff10 100644
--- a/dlls/wined3d/device.c
+++ b/dlls/wined3d/device.c
@@ -4017,6 +4017,7 @@ HRESULT CDECL wined3d_device_copy_sub_resource_region(struct wined3d_device *dev
@@ -4016,6 +4016,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 dd8943d2e3e..66815f80647 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",
@@ -4104,6 +4105,14 @@ HRESULT CDECL wined3d_device_copy_sub_resource_region(struct wined3d_device *dev
@@ -4103,6 +4104,14 @@ HRESULT CDECL wined3d_device_copy_sub_resource_region(struct wined3d_device *dev
if (src_box)
{
@ -123,7 +123,7 @@ index dd8943d2e3e..66815f80647 100644
SetRect(&src_rect, src_box->left, src_box->top, src_box->right, src_box->bottom);
}
else
@@ -4117,6 +4126,23 @@ HRESULT CDECL wined3d_device_copy_sub_resource_region(struct wined3d_device *dev
@@ -4116,6 +4125,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));
@ -483,10 +483,10 @@ index 19d6aa74373..5b8434d63b8 100644
+ return WINED3D_OK;
+}
diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h
index 772a8492fb0..8dc18c856c9 100644
index b04d2f502bf..be01b6f3b6a 100644
--- a/dlls/wined3d/wined3d_private.h
+++ b/dlls/wined3d/wined3d_private.h
@@ -3036,6 +3036,9 @@ HRESULT surface_upload_from_surface(struct wined3d_surface *dst_surface, const P
@@ -3038,6 +3038,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;
@ -496,7 +496,7 @@ index 772a8492fb0..8dc18c856c9 100644
void draw_textured_quad(const struct wined3d_surface *src_surface, struct wined3d_context *context,
const RECT *src_rect, const RECT *dst_rect, enum wined3d_texture_filter_type filter) DECLSPEC_HIDDEN;
@@ -3188,6 +3191,10 @@ struct wined3d_cs *wined3d_cs_create(struct wined3d_device *device) DECLSPEC_HID
@@ -3190,6 +3193,10 @@ struct wined3d_cs *wined3d_cs_create(struct wined3d_device *device) DECLSPEC_HID
void wined3d_cs_destroy(struct wined3d_cs *cs) DECLSPEC_HIDDEN;
void wined3d_cs_destroy_object(struct wined3d_cs *cs,
void (*callback)(void *object), void *object) DECLSPEC_HIDDEN;

View File

@ -1,4 +1,4 @@
From 057495030f198c62cefb1f93c0d73e6ce714f7f9 Mon Sep 17 00:00:00 2001
From 1c832f8fd2760bff7b0a0234f68c11af66dba8d1 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 7fb3dbb7fe8..0aa4939e92b 100644
index f6eb188837d..5700577709e 100644
--- a/dlls/d3d9/tests/visual.c
+++ b/dlls/d3d9/tests/visual.c
@@ -1337,7 +1337,7 @@ static void color_fill_test(void)
@ -24,12 +24,12 @@ index 7fb3dbb7fe8..0aa4939e92b 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 6bea12aa713..85eff68043d 100644
index 420a2cc8327..1dff1ff8af6 100644
--- a/dlls/wined3d/cs.c
+++ b/dlls/wined3d/cs.c
@@ -68,6 +68,7 @@ enum wined3d_cs_op
WINED3D_CS_OP_SET_LIGHT,
WINED3D_CS_OP_SET_LIGHT_ENABLE,
WINED3D_CS_OP_PUSH_CONSTANTS,
WINED3D_CS_OP_SET_PRIMITIVE_TYPE,
WINED3D_CS_OP_BLT,
+ WINED3D_CS_OP_CLEAR_RTV,
};
@ -54,7 +54,7 @@ index 6bea12aa713..85eff68043d 100644
static void wined3d_cs_exec_sync(struct wined3d_cs *cs, const void *data)
{
}
@@ -1844,6 +1857,41 @@ void wined3d_cs_emit_blt(struct wined3d_cs *cs, struct wined3d_surface *dst_surf
@@ -1843,6 +1856,41 @@ void wined3d_cs_emit_blt(struct wined3d_cs *cs, struct wined3d_surface *dst_surf
cs->ops->submit(cs);
}
@ -96,19 +96,19 @@ index 6bea12aa713..85eff68043d 100644
static void (* const wined3d_cs_op_handlers[])(struct wined3d_cs *cs, const void *data) =
{
/* WINED3D_CS_OP_SYNC */ wined3d_cs_exec_sync,
@@ -1888,6 +1936,7 @@ static void (* const wined3d_cs_op_handlers[])(struct wined3d_cs *cs, const void
/* WINED3D_CS_OP_SET_LIGHT */ wined3d_cs_exec_set_light,
/* WINED3D_CS_OP_SET_LIGHT_ENABLE */ wined3d_cs_exec_set_light_enable,
@@ -1887,6 +1935,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_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 66815f80647..3176aed1ddc 100644
index 6195122ff10..1388dda5c78 100644
--- a/dlls/wined3d/device.c
+++ b/dlls/wined3d/device.c
@@ -4273,10 +4273,8 @@ HRESULT CDECL wined3d_device_clear_rendertarget_view(struct wined3d_device *devi
@@ -4272,10 +4272,8 @@ HRESULT CDECL wined3d_device_clear_rendertarget_view(struct wined3d_device *devi
return WINED3DERR_INVALIDCALL;
}
@ -122,10 +122,10 @@ index 66815f80647..3176aed1ddc 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 8dc18c856c9..2b3ac98c35e 100644
index be01b6f3b6a..2b58f655c25 100644
--- a/dlls/wined3d/wined3d_private.h
+++ b/dlls/wined3d/wined3d_private.h
@@ -3197,6 +3197,9 @@ void wined3d_cs_emit_blt(struct wined3d_cs *cs, struct wined3d_surface *dst_surf
@@ -3199,6 +3199,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;

View File

@ -1,4 +1,4 @@
From 4066f34901ea2c033f4b873822fd6cca421debf5 Mon Sep 17 00:00:00 2001
From 8272b9dad0782ec04f08f6829f6f9a715c676d91 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,11 +11,11 @@ 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 85eff68043d..6ffdd920403 100644
index 1dff1ff8af6..c84bca1423f 100644
--- a/dlls/wined3d/cs.c
+++ b/dlls/wined3d/cs.c
@@ -69,6 +69,7 @@ enum wined3d_cs_op
WINED3D_CS_OP_SET_LIGHT_ENABLE,
WINED3D_CS_OP_SET_PRIMITIVE_TYPE,
WINED3D_CS_OP_BLT,
WINED3D_CS_OP_CLEAR_RTV,
+ WINED3D_CS_OP_UPDATE_TEXTURE,
@ -35,7 +35,7 @@ index 85eff68043d..6ffdd920403 100644
static void wined3d_cs_exec_sync(struct wined3d_cs *cs, const void *data)
{
}
@@ -1892,6 +1899,35 @@ void wined3d_cs_emit_clear_rtv(struct wined3d_cs *cs, struct wined3d_rendertarge
@@ -1891,6 +1898,35 @@ void wined3d_cs_emit_clear_rtv(struct wined3d_cs *cs, struct wined3d_rendertarge
cs->ops->submit(cs);
}
@ -71,8 +71,8 @@ index 85eff68043d..6ffdd920403 100644
static void (* const wined3d_cs_op_handlers[])(struct wined3d_cs *cs, const void *data) =
{
/* WINED3D_CS_OP_SYNC */ wined3d_cs_exec_sync,
@@ -1937,6 +1973,7 @@ static void (* const wined3d_cs_op_handlers[])(struct wined3d_cs *cs, const void
/* WINED3D_CS_OP_SET_LIGHT_ENABLE */ wined3d_cs_exec_set_light_enable,
@@ -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,
/* 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 85eff68043d..6ffdd920403 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 69f88b3420c..6e7d4f800b3 100644
index 71c95bc3f5d..f135f6ad03b 100644
--- a/dlls/wined3d/device.c
+++ b/dlls/wined3d/device.c
@@ -3617,34 +3617,17 @@ void CDECL wined3d_device_draw_indexed_primitive_instanced(struct wined3d_device
@@ -3616,34 +3616,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 69f88b3420c..6e7d4f800b3 100644
/* Only a prepare, since we're uploading entire volumes. */
wined3d_texture_prepare_texture(dst_texture, context, FALSE);
@@ -3652,32 +3635,89 @@ static HRESULT wined3d_device_update_texture_3d(struct wined3d_device *device,
@@ -3651,32 +3634,89 @@ static HRESULT wined3d_device_update_texture_3d(struct wined3d_device *device,
for (i = 0; i < level_count; ++i)
{
@ -222,7 +222,7 @@ index 69f88b3420c..6e7d4f800b3 100644
TRACE("device %p, src_texture %p, dst_texture %p.\n", device, src_texture, dst_texture);
@@ -3714,63 +3754,48 @@ HRESULT CDECL wined3d_device_update_texture(struct wined3d_device *device,
@@ -3713,63 +3753,48 @@ HRESULT CDECL wined3d_device_update_texture(struct wined3d_device *device,
return WINED3DERR_INVALIDCALL;
}
@ -316,10 +316,10 @@ index 69f88b3420c..6e7d4f800b3 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 2b3ac98c35e..9e2c272eeda 100644
index 2b58f655c25..cfe8839d746 100644
--- a/dlls/wined3d/wined3d_private.h
+++ b/dlls/wined3d/wined3d_private.h
@@ -2671,6 +2671,8 @@ LRESULT device_process_message(struct wined3d_device *device, HWND window, BOOL
@@ -2673,6 +2673,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 2b3ac98c35e..9e2c272eeda 100644
static inline BOOL isStateDirty(const struct wined3d_context *context, DWORD state)
{
@@ -3262,6 +3264,8 @@ void wined3d_cs_emit_set_vertex_declaration(struct wined3d_cs *cs,
@@ -3264,6 +3266,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 81f9eb76b36ff0fa3118ef33ef7f71fe19fc6681 Mon Sep 17 00:00:00 2001
From 2b2c215c4a7b4f3d6f42701e30752ce81da4cb75 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Stefan=20D=C3=B6singer?= <stefan@codeweavers.com>
Date: Tue, 1 Oct 2013 14:31:56 +0200
Subject: wined3d: Hackily introduce a multithreaded command stream
@ -26,7 +26,7 @@ index adffe0127bc..a9fa00224ac 100644
current_context = NULL;
diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c
index b5c7432fec3..c8394533a86 100644
index 6613f8845bf..698d19f6ec7 100644
--- a/dlls/wined3d/cs.c
+++ b/dlls/wined3d/cs.c
@@ -18,6 +18,7 @@
@ -566,12 +566,66 @@ index b5c7432fec3..c8394533a86 100644
cs->ops->submit(cs);
}
-static void wined3d_cs_exec_set_light(struct wined3d_cs *cs, const void *data)
+static UINT wined3d_cs_exec_set_light(struct wined3d_cs *cs, const void *data)
{
const struct wined3d_cs_set_light *op = data;
struct wined3d_light_info *light_info;
@@ -1580,7 +1646,7 @@ static void wined3d_cs_exec_set_light(struct wined3d_cs *cs, const void *data)
if (!(light_info = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(*light_info))))
{
ERR("Failed to allocate light info.\n");
- return;
+ return sizeof(*op);;
}
hash_idx = LIGHTMAP_HASHFUNC(light_idx);
@@ -1601,6 +1667,8 @@ static void wined3d_cs_exec_set_light(struct wined3d_cs *cs, const void *data)
light_info->direction = op->light.direction;
light_info->exponent = op->light.exponent;
light_info->cutoff = op->light.cutoff;
+
+ return sizeof(*op);
}
void wined3d_cs_emit_set_light(struct wined3d_cs *cs, const struct wined3d_light_info *light)
@@ -1614,7 +1682,7 @@ void wined3d_cs_emit_set_light(struct wined3d_cs *cs, const struct wined3d_light
cs->ops->submit(cs);
}
-static void wined3d_cs_exec_set_light_enable(struct wined3d_cs *cs, const void *data)
+static UINT wined3d_cs_exec_set_light_enable(struct wined3d_cs *cs, const void *data)
{
const struct wined3d_cs_set_light_enable *op = data;
struct wined3d_device *device = cs->device;
@@ -1624,7 +1692,7 @@ static void wined3d_cs_exec_set_light_enable(struct wined3d_cs *cs, const void *
if (!(light_info = wined3d_state_get_light(&cs->state, op->idx)))
{
ERR("Light doesn't exist.\n");
- return;
+ return sizeof(*op);
}
prev_idx = light_info->glIndex;
@@ -1634,6 +1702,8 @@ static void wined3d_cs_exec_set_light_enable(struct wined3d_cs *cs, const void *
device_invalidate_state(device, STATE_LIGHT_TYPE);
device_invalidate_state(device, STATE_ACTIVELIGHT(op->enable ? light_info->glIndex : prev_idx));
}
+
+ return sizeof(*op);
}
void wined3d_cs_emit_set_light_enable(struct wined3d_cs *cs, unsigned int idx, BOOL enable)
@@ -1648,7 +1718,7 @@ void wined3d_cs_emit_set_light_enable(struct wined3d_cs *cs, unsigned int idx, B
cs->ops->submit(cs);
}
-static void wined3d_cs_exec_reset_state(struct wined3d_cs *cs, const void *data)
+static UINT wined3d_cs_exec_reset_state(struct wined3d_cs *cs, const void *data)
{
struct wined3d_adapter *adapter = cs->device->adapter;
HRESULT hr;
@@ -1576,6 +1642,8 @@ static void wined3d_cs_exec_reset_state(struct wined3d_cs *cs, const void *data)
@@ -1658,6 +1728,8 @@ static void wined3d_cs_exec_reset_state(struct wined3d_cs *cs, const void *data)
if (FAILED(hr = state_init(&cs->state, &adapter->gl_info, &adapter->d3d_info,
WINED3D_STATE_NO_REF | WINED3D_STATE_INIT_DEFAULT)))
ERR("Failed to initialize CS state, hr %#x.\n", hr);
@ -580,7 +634,7 @@ index b5c7432fec3..c8394533a86 100644
}
void wined3d_cs_emit_reset_state(struct wined3d_cs *cs)
@@ -1588,11 +1656,13 @@ void wined3d_cs_emit_reset_state(struct wined3d_cs *cs)
@@ -1670,11 +1742,13 @@ void wined3d_cs_emit_reset_state(struct wined3d_cs *cs)
cs->ops->submit(cs);
}
@ -595,7 +649,7 @@ index b5c7432fec3..c8394533a86 100644
}
static void wined3d_cs_emit_callback(struct wined3d_cs *cs, void (*callback)(void *object), void *object)
@@ -1617,12 +1687,14 @@ void wined3d_cs_init_object(struct wined3d_cs *cs, void (*callback)(void *object
@@ -1699,12 +1773,14 @@ void wined3d_cs_init_object(struct wined3d_cs *cs, void (*callback)(void *object
wined3d_cs_emit_callback(cs, callback, object);
}
@ -611,7 +665,7 @@ index b5c7432fec3..c8394533a86 100644
}
void wined3d_cs_emit_query_issue(struct wined3d_cs *cs, struct wined3d_query *query, DWORD flags)
@@ -1637,12 +1709,14 @@ void wined3d_cs_emit_query_issue(struct wined3d_cs *cs, struct wined3d_query *qu
@@ -1719,12 +1795,14 @@ void wined3d_cs_emit_query_issue(struct wined3d_cs *cs, struct wined3d_query *qu
cs->ops->submit(cs);
}
@ -627,7 +681,7 @@ index b5c7432fec3..c8394533a86 100644
}
BOOL wined3d_cs_emit_query_poll(struct wined3d_cs *cs, struct wined3d_query *query, DWORD flags)
@@ -1661,13 +1735,15 @@ BOOL wined3d_cs_emit_query_poll(struct wined3d_cs *cs, struct wined3d_query *que
@@ -1743,13 +1821,15 @@ BOOL wined3d_cs_emit_query_poll(struct wined3d_cs *cs, struct wined3d_query *que
return ret;
}
@ -644,7 +698,7 @@ index b5c7432fec3..c8394533a86 100644
}
void wined3d_cs_emit_preload_resource(struct wined3d_cs *cs, struct wined3d_resource *resource)
@@ -1683,13 +1759,15 @@ void wined3d_cs_emit_preload_resource(struct wined3d_cs *cs, struct wined3d_reso
@@ -1765,13 +1845,15 @@ void wined3d_cs_emit_preload_resource(struct wined3d_cs *cs, struct wined3d_reso
cs->ops->submit(cs);
}
@ -661,7 +715,7 @@ index b5c7432fec3..c8394533a86 100644
}
void wined3d_cs_emit_unload_resource(struct wined3d_cs *cs, struct wined3d_resource *resource)
@@ -1705,13 +1783,15 @@ void wined3d_cs_emit_unload_resource(struct wined3d_cs *cs, struct wined3d_resou
@@ -1787,13 +1869,15 @@ void wined3d_cs_emit_unload_resource(struct wined3d_cs *cs, struct wined3d_resou
cs->ops->submit(cs);
}
@ -678,7 +732,7 @@ index b5c7432fec3..c8394533a86 100644
}
HRESULT wined3d_cs_map(struct wined3d_cs *cs, struct wined3d_resource *resource, unsigned int sub_resource_idx,
@@ -1734,12 +1814,14 @@ HRESULT wined3d_cs_map(struct wined3d_cs *cs, struct wined3d_resource *resource,
@@ -1816,12 +1900,14 @@ HRESULT wined3d_cs_map(struct wined3d_cs *cs, struct wined3d_resource *resource,
return hr;
}
@ -694,7 +748,7 @@ index b5c7432fec3..c8394533a86 100644
}
HRESULT wined3d_cs_unmap(struct wined3d_cs *cs, struct wined3d_resource *resource, unsigned int sub_resource_idx)
@@ -1780,10 +1862,11 @@ push_constant_info[] =
@@ -1862,10 +1948,11 @@ push_constant_info[] =
{FIELD_OFFSET(struct wined3d_state, ps_consts_b), sizeof(BOOL), WINED3D_SHADER_CONST_PS_B},
};
@ -707,7 +761,7 @@ index b5c7432fec3..c8394533a86 100644
unsigned int context_count;
unsigned int i;
size_t offset;
@@ -1799,6 +1882,8 @@ static void wined3d_cs_exec_push_constants(struct wined3d_cs *cs, const void *da
@@ -1881,6 +1968,8 @@ static void wined3d_cs_exec_push_constants(struct wined3d_cs *cs, const void *da
{
device->contexts[i]->constant_update_mask |= push_constant_info[op->p].mask;
}
@ -716,7 +770,7 @@ index b5c7432fec3..c8394533a86 100644
}
void wined3d_cs_emit_push_constants(struct wined3d_cs *cs, enum wined3d_push_constants p,
@@ -1816,7 +1901,7 @@ void wined3d_cs_emit_push_constants(struct wined3d_cs *cs, enum wined3d_push_con
@@ -1898,7 +1987,7 @@ void wined3d_cs_emit_push_constants(struct wined3d_cs *cs, enum wined3d_push_con
cs->ops->submit(cs);
}
@ -725,7 +779,7 @@ index b5c7432fec3..c8394533a86 100644
{
const struct wined3d_cs_set_primitive_type *op = data;
GLenum prev;
@@ -1827,6 +1912,8 @@ static void wined3d_cs_exec_set_primitive_type(struct wined3d_cs *cs, const void
@@ -1909,6 +1998,8 @@ static void wined3d_cs_exec_set_primitive_type(struct wined3d_cs *cs, const void
device_invalidate_state(cs->device, STATE_POINT_ENABLE);
cs->state.gl_primitive_type = op->gl_primitive_type;
@ -734,61 +788,7 @@ index b5c7432fec3..c8394533a86 100644
}
void wined3d_cs_emit_set_primitive_type(struct wined3d_cs *cs, GLenum primitive_type)
@@ -1840,7 +1927,7 @@ void wined3d_cs_emit_set_primitive_type(struct wined3d_cs *cs, GLenum primitive_
cs->ops->submit(cs);
}
-static void wined3d_cs_exec_set_light(struct wined3d_cs *cs, const void *data)
+static UINT wined3d_cs_exec_set_light(struct wined3d_cs *cs, const void *data)
{
const struct wined3d_cs_set_light *op = data;
UINT light_idx = op->light.OriginalIndex;
@@ -1854,7 +1941,7 @@ static void wined3d_cs_exec_set_light(struct wined3d_cs *cs, const void *data)
if (!object)
{
ERR("Out of memory!\n");
- return;
+ return sizeof(*op);
}
list_add_head(&cs->state.light_map[hash_idx], &object->entry);
@@ -1875,6 +1962,8 @@ static void wined3d_cs_exec_set_light(struct wined3d_cs *cs, const void *data)
object->direction = op->light.direction;
object->exponent = op->light.exponent;
object->cutoff = op->light.cutoff;
+
+ return sizeof(*op);
}
void wined3d_cs_emit_set_light(struct wined3d_cs *cs, const struct wined3d_light_info *light)
@@ -1888,7 +1977,7 @@ void wined3d_cs_emit_set_light(struct wined3d_cs *cs, const struct wined3d_light
cs->ops->submit(cs);
}
-static void wined3d_cs_exec_set_light_enable(struct wined3d_cs *cs, const void *data)
+static UINT wined3d_cs_exec_set_light_enable(struct wined3d_cs *cs, const void *data)
{
const struct wined3d_cs_set_light_enable *op = data;
struct wined3d_light_info *light_info;
@@ -1899,7 +1988,7 @@ static void wined3d_cs_exec_set_light_enable(struct wined3d_cs *cs, const void *
if (!(light_info = wined3d_state_get_light(&cs->state, op->idx)))
{
ERR("Light enabled requested but light not defined in cs state!\n");
- return;
+ return sizeof(*op);
}
prev_idx = light_info->glIndex;
@@ -1909,6 +1998,8 @@ static void wined3d_cs_exec_set_light_enable(struct wined3d_cs *cs, const void *
device_invalidate_state(device, STATE_LIGHT_TYPE);
device_invalidate_state(device, STATE_ACTIVELIGHT(op->enable ? light_info->glIndex : prev_idx));
}
+
+ return sizeof(*op);
}
void wined3d_cs_emit_set_light_enable(struct wined3d_cs *cs, UINT idx, BOOL enable)
@@ -1923,7 +2014,7 @@ void wined3d_cs_emit_set_light_enable(struct wined3d_cs *cs, UINT idx, BOOL enab
@@ -1922,7 +2013,7 @@ void wined3d_cs_emit_set_primitive_type(struct wined3d_cs *cs, GLenum primitive_
cs->ops->submit(cs);
}
@ -797,7 +797,7 @@ index b5c7432fec3..c8394533a86 100644
{
const struct wined3d_cs_blt *op = data;
@@ -1934,6 +2025,8 @@ static void wined3d_cs_exec_blt(struct wined3d_cs *cs, const void *data)
@@ -1933,6 +2024,8 @@ static void wined3d_cs_exec_blt(struct wined3d_cs *cs, const void *data)
wined3d_resource_release(&op->dst_surface->container->resource);
if (op->src_surface && op->src_surface != op->dst_surface)
wined3d_resource_release(&op->src_surface->container->resource);
@ -806,7 +806,7 @@ index b5c7432fec3..c8394533a86 100644
}
void wined3d_cs_emit_blt(struct wined3d_cs *cs, struct wined3d_surface *dst_surface,
@@ -1961,7 +2054,7 @@ void wined3d_cs_emit_blt(struct wined3d_cs *cs, struct wined3d_surface *dst_surf
@@ -1960,7 +2053,7 @@ void wined3d_cs_emit_blt(struct wined3d_cs *cs, struct wined3d_surface *dst_surf
cs->ops->submit(cs);
}
@ -815,7 +815,7 @@ index b5c7432fec3..c8394533a86 100644
{
const struct wined3d_cs_clear_rtv *op = data;
struct wined3d_device *device = cs->device;
@@ -1972,6 +2065,8 @@ static void wined3d_cs_exec_clear_rtv(struct wined3d_cs *cs, const void *data)
@@ -1971,6 +2064,8 @@ static void wined3d_cs_exec_clear_rtv(struct wined3d_cs *cs, const void *data)
op->blitter->depth_fill(device, op->view, &op->rect, op->flags, op->depth, op->stencil);
wined3d_resource_release(op->view->resource);
@ -824,7 +824,7 @@ index b5c7432fec3..c8394533a86 100644
}
void wined3d_cs_emit_clear_rtv(struct wined3d_cs *cs, struct wined3d_rendertarget_view *view,
@@ -1996,7 +2091,7 @@ void wined3d_cs_emit_clear_rtv(struct wined3d_cs *cs, struct wined3d_rendertarge
@@ -1995,7 +2090,7 @@ void wined3d_cs_emit_clear_rtv(struct wined3d_cs *cs, struct wined3d_rendertarge
cs->ops->submit(cs);
}
@ -833,7 +833,7 @@ index b5c7432fec3..c8394533a86 100644
{
const struct wined3d_cs_update_texture *op = data;
struct wined3d_context *context;
@@ -2007,6 +2102,8 @@ static void wined3d_cs_exec_update_texture(struct wined3d_cs *cs, const void *da
@@ -2006,6 +2101,8 @@ static void wined3d_cs_exec_update_texture(struct wined3d_cs *cs, const void *da
wined3d_resource_release(&op->src->resource);
wined3d_resource_release(&op->dst->resource);
@ -842,7 +842,7 @@ index b5c7432fec3..c8394533a86 100644
}
void wined3d_cs_emit_update_texture(struct wined3d_cs *cs, struct wined3d_texture *src,
@@ -2025,7 +2122,7 @@ void wined3d_cs_emit_update_texture(struct wined3d_cs *cs, struct wined3d_textur
@@ -2024,7 +2121,7 @@ void wined3d_cs_emit_update_texture(struct wined3d_cs *cs, struct wined3d_textur
cs->ops->submit(cs);
}
@ -851,7 +851,7 @@ index b5c7432fec3..c8394533a86 100644
{
const struct wined3d_cs_update_sub_resource *op = data;
struct wined3d_const_bo_address addr;
@@ -2041,7 +2138,7 @@ static void wined3d_cs_exec_update_sub_resource(struct wined3d_cs *cs, const voi
@@ -2040,7 +2137,7 @@ static void wined3d_cs_exec_update_sub_resource(struct wined3d_cs *cs, const voi
if (FAILED(hr = wined3d_buffer_upload_data(buffer, op->box, op->data)))
WARN("Failed to update buffer data, hr %#x.\n", hr);
@ -860,7 +860,7 @@ index b5c7432fec3..c8394533a86 100644
}
texture = wined3d_texture_from_resource(op->resource);
@@ -2070,6 +2167,8 @@ static void wined3d_cs_exec_update_sub_resource(struct wined3d_cs *cs, const voi
@@ -2069,6 +2166,8 @@ static void wined3d_cs_exec_update_sub_resource(struct wined3d_cs *cs, const voi
wined3d_texture_validate_location(texture, op->sub_resource_idx, WINED3D_LOCATION_TEXTURE_RGB);
wined3d_texture_invalidate_location(texture, op->sub_resource_idx, ~WINED3D_LOCATION_TEXTURE_RGB);
@ -869,7 +869,7 @@ index b5c7432fec3..c8394533a86 100644
}
void wined3d_cs_emit_update_sub_resource(struct wined3d_cs *cs, struct wined3d_resource *resource,
@@ -2092,11 +2191,13 @@ void wined3d_cs_emit_update_sub_resource(struct wined3d_cs *cs, struct wined3d_r
@@ -2091,11 +2190,13 @@ void wined3d_cs_emit_update_sub_resource(struct wined3d_cs *cs, struct wined3d_r
cs->ops->submit_and_wait(cs);
}
@ -884,7 +884,7 @@ index b5c7432fec3..c8394533a86 100644
}
HRESULT wined3d_cs_emit_get_dc(struct wined3d_cs *cs, struct wined3d_texture *texture,
@@ -2116,11 +2217,13 @@ HRESULT wined3d_cs_emit_get_dc(struct wined3d_cs *cs, struct wined3d_texture *te
@@ -2115,11 +2216,13 @@ HRESULT wined3d_cs_emit_get_dc(struct wined3d_cs *cs, struct wined3d_texture *te
return hr;
}
@ -899,7 +899,7 @@ index b5c7432fec3..c8394533a86 100644
}
HRESULT wined3d_cs_emit_release_dc(struct wined3d_cs *cs, struct wined3d_texture *texture,
@@ -2140,11 +2243,13 @@ HRESULT wined3d_cs_emit_release_dc(struct wined3d_cs *cs, struct wined3d_texture
@@ -2139,11 +2242,13 @@ HRESULT wined3d_cs_emit_release_dc(struct wined3d_cs *cs, struct wined3d_texture
return hr;
}
@ -914,7 +914,7 @@ index b5c7432fec3..c8394533a86 100644
}
HRESULT wined3d_cs_emit_create_swapchain_context(struct wined3d_cs *cs, struct wined3d_swapchain *swapchain)
@@ -2162,11 +2267,13 @@ HRESULT wined3d_cs_emit_create_swapchain_context(struct wined3d_cs *cs, struct w
@@ -2161,11 +2266,13 @@ HRESULT wined3d_cs_emit_create_swapchain_context(struct wined3d_cs *cs, struct w
return hr;
}
@ -929,7 +929,7 @@ index b5c7432fec3..c8394533a86 100644
}
void wined3d_cs_emit_update_swap_interval(struct wined3d_cs *cs, struct wined3d_swapchain *swapchain)
@@ -2180,7 +2287,7 @@ void wined3d_cs_emit_update_swap_interval(struct wined3d_cs *cs, struct wined3d_
@@ -2179,7 +2286,7 @@ void wined3d_cs_emit_update_swap_interval(struct wined3d_cs *cs, struct wined3d_
cs->ops->submit_and_wait(cs);
}
@ -938,7 +938,7 @@ index b5c7432fec3..c8394533a86 100644
{
const struct wined3d_cs_texture_add_dirty_region *op = data;
struct wined3d_texture *texture = op->texture;
@@ -2198,6 +2305,8 @@ static void wined3d_cs_exec_texture_add_dirty_region(struct wined3d_cs *cs, cons
@@ -2197,6 +2304,8 @@ static void wined3d_cs_exec_texture_add_dirty_region(struct wined3d_cs *cs, cons
context_release(context);
wined3d_resource_release(&texture->resource);
@ -947,7 +947,7 @@ index b5c7432fec3..c8394533a86 100644
}
void wined3d_cs_emit_texture_add_dirty_region(struct wined3d_cs *cs,
@@ -2219,7 +2328,7 @@ void wined3d_cs_emit_texture_add_dirty_region(struct wined3d_cs *cs,
@@ -2218,7 +2327,7 @@ void wined3d_cs_emit_texture_add_dirty_region(struct wined3d_cs *cs,
cs->ops->submit(cs);
}
@ -956,7 +956,7 @@ index b5c7432fec3..c8394533a86 100644
{
const struct wined3d_cs_buffer_copy *op = data;
HRESULT hr;
@@ -2229,6 +2338,8 @@ static void wined3d_cs_exec_buffer_copy(struct wined3d_cs *cs, const void *data)
@@ -2228,6 +2337,8 @@ static void wined3d_cs_exec_buffer_copy(struct wined3d_cs *cs, const void *data)
wined3d_resource_release(&op->dst_buffer->resource);
wined3d_resource_release(&op->src_buffer->resource);
@ -965,7 +965,7 @@ index b5c7432fec3..c8394533a86 100644
}
void wined3d_cs_emit_buffer_copy(struct wined3d_cs *cs, struct wined3d_buffer *dst_buffer,
@@ -2251,7 +2362,7 @@ void wined3d_cs_emit_buffer_copy(struct wined3d_cs *cs, struct wined3d_buffer *d
@@ -2250,7 +2361,7 @@ void wined3d_cs_emit_buffer_copy(struct wined3d_cs *cs, struct wined3d_buffer *d
cs->ops->submit(cs);
}
@ -974,7 +974,7 @@ index b5c7432fec3..c8394533a86 100644
{
const struct wined3d_cs_map_vertex_buffers *op = data;
struct wined3d_state *state = &cs->device->state;
@@ -2298,6 +2409,8 @@ static void wined3d_cs_exec_map_vertex_buffers(struct wined3d_cs *cs, const void
@@ -2297,6 +2408,8 @@ static void wined3d_cs_exec_map_vertex_buffers(struct wined3d_cs *cs, const void
}
context_release(context);
@ -983,7 +983,7 @@ index b5c7432fec3..c8394533a86 100644
}
void wined3d_cs_emit_map_vertex_buffers(struct wined3d_cs *cs, UINT src_start_idx,
@@ -2313,7 +2426,7 @@ void wined3d_cs_emit_map_vertex_buffers(struct wined3d_cs *cs, UINT src_start_id
@@ -2312,7 +2425,7 @@ void wined3d_cs_emit_map_vertex_buffers(struct wined3d_cs *cs, UINT src_start_id
cs->ops->submit_and_wait(cs);
}
@ -992,7 +992,7 @@ index b5c7432fec3..c8394533a86 100644
{
/* WINED3D_CS_OP_SYNC */ wined3d_cs_exec_sync,
/* WINED3D_CS_OP_GLFINISH */ wined3d_cs_exec_glfinish,
@@ -2421,6 +2534,201 @@ static const struct wined3d_cs_ops wined3d_cs_st_ops =
@@ -2420,6 +2533,201 @@ static const struct wined3d_cs_ops wined3d_cs_st_ops =
wined3d_cs_st_submit,
};
@ -1194,7 +1194,7 @@ index b5c7432fec3..c8394533a86 100644
struct wined3d_cs *wined3d_cs_create(struct wined3d_device *device)
{
const struct wined3d_gl_info *gl_info = &device->adapter->gl_info;
@@ -2447,12 +2755,40 @@ struct wined3d_cs *wined3d_cs_create(struct wined3d_device *device)
@@ -2446,12 +2754,40 @@ struct wined3d_cs *wined3d_cs_create(struct wined3d_device *device)
return NULL;
}
@ -1236,7 +1236,7 @@ index b5c7432fec3..c8394533a86 100644
HeapFree(GetProcessHeap(), 0, cs);
}
diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c
index 61c862de138..734f818692c 100644
index 4c12fd3d9e5..7c0f4bb1bf0 100644
--- a/dlls/wined3d/device.c
+++ b/dlls/wined3d/device.c
@@ -1263,7 +1263,7 @@ UINT CDECL wined3d_device_get_available_texture_mem(const struct wined3d_device
@ -1279,7 +1279,7 @@ index e7962465279..a8409cfd4b8 100644
if (hkey) RegCloseKey( hkey );
diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h
index 38693a52b29..5962fa7ea19 100644
index d731d7d4692..128e5be297e 100644
--- a/dlls/wined3d/wined3d_private.h
+++ b/dlls/wined3d/wined3d_private.h
@@ -306,6 +306,7 @@ struct wined3d_settings
@ -1290,7 +1290,7 @@ index 38693a52b29..5962fa7ea19 100644
};
extern struct wined3d_settings wined3d_settings DECLSPEC_HIDDEN;
@@ -2785,11 +2786,6 @@ static inline void wined3d_resource_release(struct wined3d_resource *resource)
@@ -2787,11 +2788,6 @@ static inline void wined3d_resource_release(struct wined3d_resource *resource)
InterlockedDecrement(&resource->access_count);
}
@ -1302,7 +1302,7 @@ index 38693a52b29..5962fa7ea19 100644
void resource_cleanup(struct wined3d_resource *resource) DECLSPEC_HIDDEN;
HRESULT resource_init(struct wined3d_resource *resource, struct wined3d_device *device,
enum wined3d_resource_type type, const struct wined3d_format *format,
@@ -3210,6 +3206,21 @@ enum wined3d_push_constants
@@ -3212,6 +3208,21 @@ enum wined3d_push_constants
WINED3D_PUSH_CONSTANTS_PS_B,
};
@ -1324,7 +1324,7 @@ index 38693a52b29..5962fa7ea19 100644
struct wined3d_cs_ops
{
void *(*require_space)(struct wined3d_cs *cs, size_t size);
@@ -3226,9 +3237,21 @@ struct wined3d_cs
@@ -3228,9 +3239,21 @@ struct wined3d_cs
size_t data_size, start, end;
void *data;

View File

@ -1,4 +1,4 @@
From 0c21b5789a1b288b28bdd31a199a87dc34f6a6c6 Mon Sep 17 00:00:00 2001
From 7fcb1c399169868513e37a08051f7ae9dc59e18a Mon Sep 17 00:00:00 2001
From: Sebastian Lackner <sebastian@fds-team.de>
Date: Wed, 8 Feb 2017 00:12:31 +0100
Subject: wined3d: Introduce a separate priority queue.
@ -9,7 +9,7 @@ Subject: wined3d: Introduce a separate priority queue.
2 files changed, 74 insertions(+), 63 deletions(-)
diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c
index a656c93684a..b874b1f41f2 100644
index 6e7a4cb9857..34bae9d4e87 100644
--- a/dlls/wined3d/cs.c
+++ b/dlls/wined3d/cs.c
@@ -492,7 +492,7 @@ void wined3d_cs_emit_sync(struct wined3d_cs *cs)
@ -282,97 +282,7 @@ index a656c93684a..b874b1f41f2 100644
op->opcode = WINED3D_CS_OP_SET_MATERIAL;
op->material = *material;
@@ -1650,7 +1650,7 @@ void wined3d_cs_emit_reset_state(struct wined3d_cs *cs)
{
struct wined3d_cs_reset_state *op;
- op = cs->ops->require_space(cs, sizeof(*op));
+ op = cs->ops->require_space(cs, sizeof(*op), 0);
op->opcode = WINED3D_CS_OP_RESET_STATE;
cs->ops->submit(cs);
@@ -1669,7 +1669,7 @@ static void wined3d_cs_emit_callback(struct wined3d_cs *cs, void (*callback)(voi
{
struct wined3d_cs_callback *op;
- op = cs->ops->require_space(cs, sizeof(*op));
+ op = cs->ops->require_space(cs, sizeof(*op), 0);
op->opcode = WINED3D_CS_OP_CALLBACK;
op->callback = callback;
op->object = object;
@@ -1701,7 +1701,7 @@ void wined3d_cs_emit_query_issue(struct wined3d_cs *cs, struct wined3d_query *qu
{
struct wined3d_cs_query_issue *op;
- op = cs->ops->require_space(cs, sizeof(*op));
+ op = cs->ops->require_space(cs, sizeof(*op), 0);
op->opcode = WINED3D_CS_OP_QUERY_ISSUE;
op->query = query;
op->flags = flags;
@@ -1724,7 +1724,7 @@ BOOL wined3d_cs_emit_query_poll(struct wined3d_cs *cs, struct wined3d_query *que
struct wined3d_cs_query_poll *op;
BOOL ret;
- op = cs->ops->require_space(cs, sizeof(*op));
+ op = cs->ops->require_space(cs, sizeof(*op), 0);
op->opcode = WINED3D_CS_OP_QUERY_POLL;
op->query = query;
op->flags = flags;
@@ -1750,7 +1750,7 @@ void wined3d_cs_emit_preload_resource(struct wined3d_cs *cs, struct wined3d_reso
{
struct wined3d_cs_preload_resource *op;
- op = cs->ops->require_space(cs, sizeof(*op));
+ op = cs->ops->require_space(cs, sizeof(*op), 0);
op->opcode = WINED3D_CS_OP_PRELOAD_RESOURCE;
op->resource = resource;
@@ -1774,7 +1774,7 @@ void wined3d_cs_emit_unload_resource(struct wined3d_cs *cs, struct wined3d_resou
{
struct wined3d_cs_unload_resource *op;
- op = cs->ops->require_space(cs, sizeof(*op));
+ op = cs->ops->require_space(cs, sizeof(*op), 0);
op->opcode = WINED3D_CS_OP_UNLOAD_RESOURCE;
op->resource = resource;
@@ -1800,7 +1800,7 @@ HRESULT wined3d_cs_map(struct wined3d_cs *cs, struct wined3d_resource *resource,
struct wined3d_cs_map *op;
HRESULT hr;
- op = cs->ops->require_space(cs, sizeof(*op));
+ op = cs->ops->require_space(cs, sizeof(*op), 0);
op->opcode = WINED3D_CS_OP_MAP;
op->resource = resource;
op->sub_resource_idx = sub_resource_idx;
@@ -1829,7 +1829,7 @@ HRESULT wined3d_cs_unmap(struct wined3d_cs *cs, struct wined3d_resource *resourc
struct wined3d_cs_unmap *op;
HRESULT hr;
- op = cs->ops->require_space(cs, sizeof(*op));
+ op = cs->ops->require_space(cs, sizeof(*op), 0);
op->opcode = WINED3D_CS_OP_UNMAP;
op->resource = resource;
op->sub_resource_idx = sub_resource_idx;
@@ -1891,7 +1891,7 @@ void wined3d_cs_emit_push_constants(struct wined3d_cs *cs, enum wined3d_push_con
{
struct wined3d_cs_push_constants *op;
- op = cs->ops->require_space(cs, FIELD_OFFSET(struct wined3d_cs_push_constants, constants[count * push_constant_info[p].size]));
+ op = cs->ops->require_space(cs, FIELD_OFFSET(struct wined3d_cs_push_constants, constants[count * push_constant_info[p].size]), 0);
op->opcode = WINED3D_CS_OP_PUSH_CONSTANTS;
op->p = p;
op->start_idx = start_idx;
@@ -1920,7 +1920,7 @@ void wined3d_cs_emit_set_primitive_type(struct wined3d_cs *cs, GLenum primitive_
{
struct wined3d_cs_set_primitive_type *op;
- op = cs->ops->require_space(cs, sizeof(*op));
+ op = cs->ops->require_space(cs, sizeof(*op), 0);
op->opcode = WINED3D_CS_OP_SET_PRIMITIVE_TYPE;
op->gl_primitive_type = primitive_type;
@@ -1970,7 +1970,7 @@ void wined3d_cs_emit_set_light(struct wined3d_cs *cs, const struct wined3d_light
@@ -1675,7 +1675,7 @@ void wined3d_cs_emit_set_light(struct wined3d_cs *cs, const struct wined3d_light
{
struct wined3d_cs_set_light *op;
@ -381,7 +291,7 @@ index a656c93684a..b874b1f41f2 100644
op->opcode = WINED3D_CS_OP_SET_LIGHT;
op->light = *light;
@@ -2006,7 +2006,7 @@ void wined3d_cs_emit_set_light_enable(struct wined3d_cs *cs, UINT idx, BOOL enab
@@ -1710,7 +1710,7 @@ void wined3d_cs_emit_set_light_enable(struct wined3d_cs *cs, unsigned int idx, B
{
struct wined3d_cs_set_light_enable *op;
@ -390,7 +300,97 @@ index a656c93684a..b874b1f41f2 100644
op->opcode = WINED3D_CS_OP_SET_LIGHT_ENABLE;
op->idx = idx;
op->enable = enable;
@@ -2036,7 +2036,7 @@ void wined3d_cs_emit_blt(struct wined3d_cs *cs, struct wined3d_surface *dst_surf
@@ -1736,7 +1736,7 @@ void wined3d_cs_emit_reset_state(struct wined3d_cs *cs)
{
struct wined3d_cs_reset_state *op;
- op = cs->ops->require_space(cs, sizeof(*op));
+ op = cs->ops->require_space(cs, sizeof(*op), 0);
op->opcode = WINED3D_CS_OP_RESET_STATE;
cs->ops->submit(cs);
@@ -1755,7 +1755,7 @@ static void wined3d_cs_emit_callback(struct wined3d_cs *cs, void (*callback)(voi
{
struct wined3d_cs_callback *op;
- op = cs->ops->require_space(cs, sizeof(*op));
+ op = cs->ops->require_space(cs, sizeof(*op), 0);
op->opcode = WINED3D_CS_OP_CALLBACK;
op->callback = callback;
op->object = object;
@@ -1787,7 +1787,7 @@ void wined3d_cs_emit_query_issue(struct wined3d_cs *cs, struct wined3d_query *qu
{
struct wined3d_cs_query_issue *op;
- op = cs->ops->require_space(cs, sizeof(*op));
+ op = cs->ops->require_space(cs, sizeof(*op), 0);
op->opcode = WINED3D_CS_OP_QUERY_ISSUE;
op->query = query;
op->flags = flags;
@@ -1810,7 +1810,7 @@ BOOL wined3d_cs_emit_query_poll(struct wined3d_cs *cs, struct wined3d_query *que
struct wined3d_cs_query_poll *op;
BOOL ret;
- op = cs->ops->require_space(cs, sizeof(*op));
+ op = cs->ops->require_space(cs, sizeof(*op), 0);
op->opcode = WINED3D_CS_OP_QUERY_POLL;
op->query = query;
op->flags = flags;
@@ -1836,7 +1836,7 @@ void wined3d_cs_emit_preload_resource(struct wined3d_cs *cs, struct wined3d_reso
{
struct wined3d_cs_preload_resource *op;
- op = cs->ops->require_space(cs, sizeof(*op));
+ op = cs->ops->require_space(cs, sizeof(*op), 0);
op->opcode = WINED3D_CS_OP_PRELOAD_RESOURCE;
op->resource = resource;
@@ -1860,7 +1860,7 @@ void wined3d_cs_emit_unload_resource(struct wined3d_cs *cs, struct wined3d_resou
{
struct wined3d_cs_unload_resource *op;
- op = cs->ops->require_space(cs, sizeof(*op));
+ op = cs->ops->require_space(cs, sizeof(*op), 0);
op->opcode = WINED3D_CS_OP_UNLOAD_RESOURCE;
op->resource = resource;
@@ -1886,7 +1886,7 @@ HRESULT wined3d_cs_map(struct wined3d_cs *cs, struct wined3d_resource *resource,
struct wined3d_cs_map *op;
HRESULT hr;
- op = cs->ops->require_space(cs, sizeof(*op));
+ op = cs->ops->require_space(cs, sizeof(*op), 0);
op->opcode = WINED3D_CS_OP_MAP;
op->resource = resource;
op->sub_resource_idx = sub_resource_idx;
@@ -1915,7 +1915,7 @@ HRESULT wined3d_cs_unmap(struct wined3d_cs *cs, struct wined3d_resource *resourc
struct wined3d_cs_unmap *op;
HRESULT hr;
- op = cs->ops->require_space(cs, sizeof(*op));
+ op = cs->ops->require_space(cs, sizeof(*op), 0);
op->opcode = WINED3D_CS_OP_UNMAP;
op->resource = resource;
op->sub_resource_idx = sub_resource_idx;
@@ -1977,7 +1977,7 @@ void wined3d_cs_emit_push_constants(struct wined3d_cs *cs, enum wined3d_push_con
{
struct wined3d_cs_push_constants *op;
- op = cs->ops->require_space(cs, FIELD_OFFSET(struct wined3d_cs_push_constants, constants[count * push_constant_info[p].size]));
+ op = cs->ops->require_space(cs, FIELD_OFFSET(struct wined3d_cs_push_constants, constants[count * push_constant_info[p].size]), 0);
op->opcode = WINED3D_CS_OP_PUSH_CONSTANTS;
op->p = p;
op->start_idx = start_idx;
@@ -2006,7 +2006,7 @@ void wined3d_cs_emit_set_primitive_type(struct wined3d_cs *cs, GLenum primitive_
{
struct wined3d_cs_set_primitive_type *op;
- op = cs->ops->require_space(cs, sizeof(*op));
+ op = cs->ops->require_space(cs, sizeof(*op), 0);
op->opcode = WINED3D_CS_OP_SET_PRIMITIVE_TYPE;
op->gl_primitive_type = primitive_type;
@@ -2035,7 +2035,7 @@ void wined3d_cs_emit_blt(struct wined3d_cs *cs, struct wined3d_surface *dst_surf
{
struct wined3d_cs_blt *op;
@ -399,7 +399,7 @@ index a656c93684a..b874b1f41f2 100644
op->opcode = WINED3D_CS_OP_BLT;
op->dst_surface = dst_surface;
op->dst_rect = *dst_rect;
@@ -2075,7 +2075,7 @@ void wined3d_cs_emit_clear_rtv(struct wined3d_cs *cs, struct wined3d_rendertarge
@@ -2074,7 +2074,7 @@ void wined3d_cs_emit_clear_rtv(struct wined3d_cs *cs, struct wined3d_rendertarge
{
struct wined3d_cs_clear_rtv *op;
@ -408,7 +408,7 @@ index a656c93684a..b874b1f41f2 100644
op->opcode = WINED3D_CS_OP_CLEAR_RTV;
op->view = view;
op->rect = *rect;
@@ -2111,7 +2111,7 @@ void wined3d_cs_emit_update_texture(struct wined3d_cs *cs, struct wined3d_textur
@@ -2110,7 +2110,7 @@ void wined3d_cs_emit_update_texture(struct wined3d_cs *cs, struct wined3d_textur
{
struct wined3d_cs_update_texture *op;
@ -417,7 +417,7 @@ index a656c93684a..b874b1f41f2 100644
op->opcode = WINED3D_CS_OP_UPDATE_TEXTURE;
op->src = src;
op->dst = dst;
@@ -2177,7 +2177,7 @@ void wined3d_cs_emit_update_sub_resource(struct wined3d_cs *cs, struct wined3d_r
@@ -2176,7 +2176,7 @@ void wined3d_cs_emit_update_sub_resource(struct wined3d_cs *cs, struct wined3d_r
{
struct wined3d_cs_update_sub_resource *op;
@ -426,7 +426,7 @@ index a656c93684a..b874b1f41f2 100644
op->opcode = WINED3D_CS_OP_UPDATE_SUB_RESOURCE;
op->resource = resource;
op->sub_resource_idx = sub_resource_idx;
@@ -2206,7 +2206,7 @@ HRESULT wined3d_cs_emit_get_dc(struct wined3d_cs *cs, struct wined3d_texture *te
@@ -2205,7 +2205,7 @@ HRESULT wined3d_cs_emit_get_dc(struct wined3d_cs *cs, struct wined3d_texture *te
struct wined3d_cs_get_release_dc *op;
HRESULT hr;
@ -435,7 +435,7 @@ index a656c93684a..b874b1f41f2 100644
op->opcode = WINED3D_CS_OP_GET_DC;
op->texture = texture;
op->sub_resource_idx = sub_resource_idx;
@@ -2232,7 +2232,7 @@ HRESULT wined3d_cs_emit_release_dc(struct wined3d_cs *cs, struct wined3d_texture
@@ -2231,7 +2231,7 @@ HRESULT wined3d_cs_emit_release_dc(struct wined3d_cs *cs, struct wined3d_texture
struct wined3d_cs_get_release_dc *op;
HRESULT hr;
@ -444,7 +444,7 @@ index a656c93684a..b874b1f41f2 100644
op->opcode = WINED3D_CS_OP_RELEASE_DC;
op->texture = texture;
op->sub_resource_idx = sub_resource_idx;
@@ -2257,7 +2257,7 @@ HRESULT wined3d_cs_emit_create_swapchain_context(struct wined3d_cs *cs, struct w
@@ -2256,7 +2256,7 @@ HRESULT wined3d_cs_emit_create_swapchain_context(struct wined3d_cs *cs, struct w
struct wined3d_cs_create_swapchain_context *op;
HRESULT hr;
@ -453,7 +453,7 @@ index a656c93684a..b874b1f41f2 100644
op->opcode = WINED3D_CS_OP_CREATE_SWAPCHAIN_CONTEXT;
op->swapchain = swapchain;
op->hr = &hr;
@@ -2280,7 +2280,7 @@ void wined3d_cs_emit_update_swap_interval(struct wined3d_cs *cs, struct wined3d_
@@ -2279,7 +2279,7 @@ void wined3d_cs_emit_update_swap_interval(struct wined3d_cs *cs, struct wined3d_
{
struct wined3d_cs_update_swap_interval *op;
@ -462,7 +462,7 @@ index a656c93684a..b874b1f41f2 100644
op->opcode = WINED3D_CS_OP_UPDATE_SWAP_INTERVAL;
op->swapchain = swapchain;
@@ -2318,7 +2318,7 @@ void wined3d_cs_emit_texture_add_dirty_region(struct wined3d_cs *cs,
@@ -2317,7 +2317,7 @@ void wined3d_cs_emit_texture_add_dirty_region(struct wined3d_cs *cs,
if (dirty_region)
WARN("Ignoring dirty_region %s.\n", debug_box(dirty_region));
@ -471,7 +471,7 @@ index a656c93684a..b874b1f41f2 100644
op->opcode = WINED3D_CS_OP_TEXTURE_ADD_DIRTY_REGION;
op->texture = texture;
op->sub_resource_idx = sub_resource_idx;
@@ -2348,7 +2348,7 @@ void wined3d_cs_emit_buffer_copy(struct wined3d_cs *cs, struct wined3d_buffer *d
@@ -2347,7 +2347,7 @@ void wined3d_cs_emit_buffer_copy(struct wined3d_cs *cs, struct wined3d_buffer *d
{
struct wined3d_cs_buffer_copy *op;
@ -480,7 +480,7 @@ index a656c93684a..b874b1f41f2 100644
op->opcode = WINED3D_CS_OP_BUFFER_COPY;
op->dst_buffer = dst_buffer;
op->dst_offset = dst_offset;
@@ -2418,7 +2418,7 @@ void wined3d_cs_emit_map_vertex_buffers(struct wined3d_cs *cs, UINT src_start_id
@@ -2417,7 +2417,7 @@ void wined3d_cs_emit_map_vertex_buffers(struct wined3d_cs *cs, UINT src_start_id
{
struct wined3d_cs_map_vertex_buffers *op;
@ -489,7 +489,7 @@ index a656c93684a..b874b1f41f2 100644
op->opcode = WINED3D_CS_OP_MAP_VERTEX_BUFFERS;
op->src_start_idx = src_start_idx;
op->stream_info = stream_info;
@@ -2483,7 +2483,7 @@ static UINT (* const wined3d_cs_op_handlers[])(struct wined3d_cs *cs, const void
@@ -2482,7 +2482,7 @@ static UINT (* const wined3d_cs_op_handlers[])(struct wined3d_cs *cs, const void
/* WINED3D_CS_OP_MAP_VERTEX_BUFFERS */ wined3d_cs_exec_map_vertex_buffers,
};
@ -498,7 +498,7 @@ index a656c93684a..b874b1f41f2 100644
{
if (size > (cs->data_size - cs->end))
{
@@ -2567,6 +2567,8 @@ static struct wined3d_cs_block *wined3d_cs_dequeue_command(struct wined3d_cs *cs
@@ -2566,6 +2566,8 @@ static struct wined3d_cs_block *wined3d_cs_dequeue_command(struct wined3d_cs *cs
/* FIXME: Use an event to wait after a couple of spins. */
for (;;)
{
@ -507,7 +507,7 @@ index a656c93684a..b874b1f41f2 100644
if ((block = wined3d_cs_list_dequeue(&cs->exec_list)))
return block;
}
@@ -2594,7 +2596,7 @@ static void wined3d_cs_list_cleanup(struct wined3d_cs_list *list)
@@ -2593,7 +2595,7 @@ static void wined3d_cs_list_cleanup(struct wined3d_cs_list *list)
DeleteCriticalSection(&list->lock);
}
@ -516,7 +516,7 @@ index a656c93684a..b874b1f41f2 100644
{
struct wined3d_cs_block *block;
@@ -2608,26 +2610,28 @@ static struct wined3d_cs_block *wined3d_cs_get_block(struct wined3d_cs *cs)
@@ -2607,26 +2609,28 @@ static struct wined3d_cs_block *wined3d_cs_get_block(struct wined3d_cs *cs)
}
block->pos = 0;
@ -549,7 +549,7 @@ index a656c93684a..b874b1f41f2 100644
cs->current_block = block;
}
@@ -2639,10 +2643,13 @@ static void *wined3d_cs_mt_require_space(struct wined3d_cs *cs, size_t size)
@@ -2638,10 +2642,13 @@ static void *wined3d_cs_mt_require_space(struct wined3d_cs *cs, size_t size)
static void wined3d_cs_mt_submit(struct wined3d_cs *cs)
{
@ -564,7 +564,7 @@ index a656c93684a..b874b1f41f2 100644
cs->current_block = NULL;
}
@@ -2656,7 +2663,7 @@ static void wined3d_cs_mt_submit_and_wait(struct wined3d_cs *cs)
@@ -2655,7 +2662,7 @@ static void wined3d_cs_mt_submit_and_wait(struct wined3d_cs *cs)
block = cs->current_block;
block->fence = &fence;
@ -573,7 +573,7 @@ index a656c93684a..b874b1f41f2 100644
cs->current_block = NULL;
/* A busy wait should be fine, we're not supposed to have to wait very
@@ -2678,7 +2685,7 @@ static void wined3d_cs_mt_emit_stop(struct wined3d_cs *cs)
@@ -2677,7 +2684,7 @@ static void wined3d_cs_mt_emit_stop(struct wined3d_cs *cs)
assert(cs->thread_id != GetCurrentThreadId());
assert(cs->ops == &wined3d_cs_mt_ops);
@ -582,7 +582,7 @@ index a656c93684a..b874b1f41f2 100644
op->opcode = WINED3D_CS_OP_STOP;
cs->ops->submit(cs);
@@ -2761,6 +2768,7 @@ struct wined3d_cs *wined3d_cs_create(struct wined3d_device *device)
@@ -2760,6 +2767,7 @@ struct wined3d_cs *wined3d_cs_create(struct wined3d_device *device)
wined3d_cs_list_init(&cs->free_list);
wined3d_cs_list_init(&cs->exec_list);
@ -590,7 +590,7 @@ index a656c93684a..b874b1f41f2 100644
if (!(cs->thread = CreateThread(NULL, 0, wined3d_cs_run, cs, 0, &cs->thread_id)))
{
@@ -2785,6 +2793,7 @@ void wined3d_cs_destroy(struct wined3d_cs *cs)
@@ -2784,6 +2792,7 @@ void wined3d_cs_destroy(struct wined3d_cs *cs)
WaitForSingleObject(cs->thread, INFINITE);
CloseHandle(cs->thread);
@ -599,10 +599,10 @@ index a656c93684a..b874b1f41f2 100644
wined3d_cs_list_cleanup(&cs->free_list);
}
diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h
index 5962fa7ea19..43b3146f6f8 100644
index 128e5be297e..22d4fde0ffa 100644
--- a/dlls/wined3d/wined3d_private.h
+++ b/dlls/wined3d/wined3d_private.h
@@ -3217,13 +3217,14 @@ struct wined3d_cs_block
@@ -3219,13 +3219,14 @@ struct wined3d_cs_block
{
struct list entry;
UINT pos;
@ -618,7 +618,7 @@ index 5962fa7ea19..43b3146f6f8 100644
void (*submit)(struct wined3d_cs *cs);
void (*submit_and_wait)(struct wined3d_cs *cs);
};
@@ -3242,6 +3243,7 @@ struct wined3d_cs
@@ -3244,6 +3245,7 @@ struct wined3d_cs
struct wined3d_cs_block *current_block;
struct wined3d_cs_list free_list;
struct wined3d_cs_list exec_list;

View File

@ -1,4 +1,4 @@
From 622caa7589fb639f654b2b569925343412dc7bc6 Mon Sep 17 00:00:00 2001
From 534625394e8964ca4b36c9319fde24d74887e6f6 Mon Sep 17 00:00:00 2001
From: Sebastian Lackner <sebastian@fds-team.de>
Date: Wed, 8 Feb 2017 12:32:55 +0100
Subject: wined3d: Do not immediately submit stateblock updates.
@ -9,7 +9,7 @@ Subject: wined3d: Do not immediately submit stateblock updates.
2 files changed, 37 insertions(+), 29 deletions(-)
diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c
index 1d2d9d7b990..d37c9ce6d38 100644
index 7c58e67901e..6f00fe64848 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
@ -223,39 +223,12 @@ index 1d2d9d7b990..d37c9ce6d38 100644
op->opcode = WINED3D_CS_OP_SET_MATERIAL;
op->material = *material;
- cs->ops->submit(cs);
+ cs->ops->submit_delayed(cs);
}
static UINT wined3d_cs_exec_reset_state(struct wined3d_cs *cs, const void *data)
@@ -1653,7 +1653,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;
- cs->ops->submit(cs);
+ cs->ops->submit_delayed(cs);
}
static UINT wined3d_cs_exec_callback(struct wined3d_cs *cs, const void *data)
@@ -1902,7 +1902,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)
@@ -1928,7 +1928,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_set_light(struct wined3d_cs *cs, const void *data)
@@ -1978,7 +1978,7 @@ void wined3d_cs_emit_set_light(struct wined3d_cs *cs, const struct wined3d_light
@@ -1679,7 +1679,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;
@ -264,16 +237,43 @@ index 1d2d9d7b990..d37c9ce6d38 100644
}
static UINT wined3d_cs_exec_set_light_enable(struct wined3d_cs *cs, const void *data)
@@ -2015,7 +2015,7 @@ void wined3d_cs_emit_set_light_enable(struct wined3d_cs *cs, UINT idx, BOOL enab
@@ -1715,7 +1715,7 @@ void wined3d_cs_emit_set_light_enable(struct wined3d_cs *cs, unsigned int idx, B
op->idx = idx;
op->enable = enable;
- cs->ops->submit(cs);
+ cs->ops->submit_delayed(cs);
}
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)
op = cs->ops->require_space(cs, sizeof(*op), 0);
op->opcode = WINED3D_CS_OP_RESET_STATE;
- cs->ops->submit(cs);
+ cs->ops->submit_delayed(cs);
}
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
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)
@@ -2536,6 +2536,7 @@ static const struct wined3d_cs_ops wined3d_cs_st_ops =
@@ -2535,6 +2535,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 +281,7 @@ index 1d2d9d7b990..d37c9ce6d38 100644
};
static void wined3d_cs_list_enqueue(struct wined3d_cs_list *list, struct wined3d_cs_block *block)
@@ -2712,11 +2713,17 @@ static void wined3d_cs_mt_submit_and_wait(struct wined3d_cs *cs)
@@ -2711,11 +2712,17 @@ static void wined3d_cs_mt_submit_and_wait(struct wined3d_cs *cs)
while (!InterlockedCompareExchange(&fence, TRUE, TRUE));
}
@ -300,10 +300,10 @@ index 1d2d9d7b990..d37c9ce6d38 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 10a7b4a8660..62f6ad52457 100644
index 6ed9ec6f557..b9db6e880b7 100644
--- a/dlls/wined3d/wined3d_private.h
+++ b/dlls/wined3d/wined3d_private.h
@@ -3228,6 +3228,7 @@ struct wined3d_cs_ops
@@ -3230,6 +3230,7 @@ struct wined3d_cs_ops
void *(*require_space)(struct wined3d_cs *cs, size_t size, int priority);
void (*submit)(struct wined3d_cs *cs);
void (*submit_and_wait)(struct wined3d_cs *cs);

File diff suppressed because it is too large Load Diff

View File

@ -1 +1 @@
Wine Staging 2.2
Wine Staging 2.3 (unreleased)