Rebase against 9fecb7499531ddbcde7970b4d98df92dbc1bc010

This commit is contained in:
Zebediah Figura 2018-04-27 16:30:13 -05:00
parent 9e260976b4
commit 4801f89bba
7 changed files with 8 additions and 331 deletions

View File

@ -1,99 +0,0 @@
From 314e990c95edd137695f81edb0ce138615cd11b0 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Michael=20M=C3=BCller?= <michael@fds-team.de>
Date: Mon, 26 Jun 2017 16:18:09 +0200
Subject: msi: Create dummy thread to initialize COM for custom actions.
---
dlls/msi/action.c | 48 ++++++++++++++++++++++++++++++++++++++++++++++++
1 file changed, 48 insertions(+)
diff --git a/dlls/msi/action.c b/dlls/msi/action.c
index 58a831e7e63..e440ee77fd9 100644
--- a/dlls/msi/action.c
+++ b/dlls/msi/action.c
@@ -160,6 +160,13 @@ static const WCHAR szWriteEnvironmentStrings[] =
static const WCHAR szINSTALL[] =
{'I','N','S','T','A','L','L',0};
+struct dummy_thread
+{
+ HANDLE started;
+ HANDLE stopped;
+ HANDLE thread;
+};
+
static INT ui_actionstart(MSIPACKAGE *package, LPCWSTR action, LPCWSTR description, LPCWSTR template)
{
WCHAR query[] = {'S','E','L','E','C','T',' ','*',' ','F','R','O','M',' ',
@@ -7968,6 +7975,42 @@ static UINT ACTION_PerformActionSequence(MSIPACKAGE *package, UINT seq)
return rc;
}
+DWORD WINAPI dummy_thread_proc(void *arg)
+{
+ struct dummy_thread *info = arg;
+ HRESULT hr;
+
+ hr = CoInitializeEx(0, COINIT_MULTITHREADED);
+ if (FAILED(hr)) ERR("CoInitializeEx failed %08x\n", hr);
+
+ SetEvent(info->started);
+ WaitForSingleObject(info->stopped, INFINITE);
+
+ CoUninitialize();
+ return 0;
+}
+
+static void start_dummy_thread(struct dummy_thread *info)
+{
+ if (!(info->started = CreateEventA(NULL, TRUE, FALSE, NULL))) return;
+ if (!(info->stopped = CreateEventA(NULL, TRUE, FALSE, NULL))) return;
+ if (!(info->thread = CreateThread(NULL, 0, dummy_thread_proc, info, 0, NULL))) return;
+
+ WaitForSingleObject(info->started, INFINITE);
+}
+
+static void stop_dummy_thread(struct dummy_thread *info)
+{
+ if (info->thread)
+ {
+ SetEvent(info->stopped);
+ WaitForSingleObject(info->thread, INFINITE);
+ CloseHandle(info->thread);
+ }
+ if (info->started) CloseHandle(info->started);
+ if (info->stopped) CloseHandle(info->stopped);
+}
+
/****************************************************
* TOP level entry points
*****************************************************/
@@ -7978,6 +8021,7 @@ UINT MSI_InstallPackage( MSIPACKAGE *package, LPCWSTR szPackagePath,
static const WCHAR szDisableRollback[] = {'D','I','S','A','B','L','E','R','O','L','L','B','A','C','K',0};
static const WCHAR szAction[] = {'A','C','T','I','O','N',0};
WCHAR *reinstall = NULL, *productcode, *action;
+ struct dummy_thread thread_info = {NULL, NULL, NULL};
UINT rc;
DWORD len = 0;
@@ -8034,6 +8078,8 @@ UINT MSI_InstallPackage( MSIPACKAGE *package, LPCWSTR szPackagePath,
msi_adjust_privilege_properties( package );
msi_set_context( package );
+ start_dummy_thread(&thread_info);
+
productcode = msi_dup_property( package->db, szProductCode );
if (strcmpiW( productcode, package->ProductCode ))
{
@@ -8070,6 +8116,8 @@ UINT MSI_InstallPackage( MSIPACKAGE *package, LPCWSTR szPackagePath,
/* finish up running custom actions */
ACTION_FinishCustomActions(package);
+ stop_dummy_thread(&thread_info);
+
if (package->need_rollback && !(reinstall = msi_dup_property( package->db, szReinstall )))
{
WARN("installation failed, running rollback script\n");
--
2.14.2

View File

@ -1 +0,0 @@
Fixes: [18070] Workaround COM/MTA issues due to lack of separate msi custom action process

View File

@ -52,7 +52,7 @@ usage()
# Get the upstream commit sha
upstream_commit()
{
echo "d6654dbf2b38d02f3c6e0ede706a0388cd7cd4a6"
echo "9fecb7499531ddbcde7970b4d98df92dbc1bc010"
}
# Show version information
@ -195,7 +195,6 @@ patch_enable_all ()
enable_mountmgr_DosDevices="$1"
enable_mscoree_CorValidateImage="$1"
enable_mshtml_HTMLLocation_put_hash="$1"
enable_msi_Dummy_Thread="$1"
enable_msi_MsiGetDatabaseState="$1"
enable_msi_msi_vcl_get_cost="$1"
enable_msidb_Implementation="$1"
@ -388,7 +387,6 @@ patch_enable_all ()
enable_wined3d_QUERY_Stubs="$1"
enable_wined3d_Silence_FIXMEs="$1"
enable_wined3d_UAV_Counters="$1"
enable_wined3d_Viewports="$1"
enable_wined3d_WINED3D_RS_COLORWRITEENABLE="$1"
enable_wined3d_wined3d_guess_gl_vendor="$1"
enable_winedbg_Process_Arguments="$1"
@ -775,9 +773,6 @@ patch_enable ()
mshtml-HTMLLocation_put_hash)
enable_mshtml_HTMLLocation_put_hash="$2"
;;
msi-Dummy_Thread)
enable_msi_Dummy_Thread="$2"
;;
msi-MsiGetDatabaseState)
enable_msi_MsiGetDatabaseState="$2"
;;
@ -1354,9 +1349,6 @@ patch_enable ()
wined3d-UAV_Counters)
enable_wined3d_UAV_Counters="$2"
;;
wined3d-Viewports)
enable_wined3d_Viewports="$2"
;;
wined3d-WINED3D_RS_COLORWRITEENABLE)
enable_wined3d_WINED3D_RS_COLORWRITEENABLE="$2"
;;
@ -1928,20 +1920,6 @@ if test "$enable_wined3d_CSMT_Main" -eq 1; then
enable_wined3d_UAV_Counters=1
fi
if test "$enable_wined3d_Dual_Source_Blending" -eq 1; then
if test "$enable_wined3d_Viewports" -gt 1; then
abort "Patchset wined3d-Viewports disabled, but wined3d-Dual_Source_Blending depends on that."
fi
enable_wined3d_Viewports=1
fi
if test "$enable_wined3d_Viewports" -eq 1; then
if test "$enable_d3d11_Depth_Bias" -gt 1; then
abort "Patchset d3d11-Depth_Bias disabled, but wined3d-Viewports depends on that."
fi
enable_d3d11_Depth_Bias=1
fi
if test "$enable_winebuild_Fake_Dlls" -eq 1; then
if test "$enable_ntdll_User_Shared_Data" -gt 1; then
abort "Patchset ntdll-User_Shared_Data disabled, but winebuild-Fake_Dlls depends on that."
@ -4595,21 +4573,6 @@ if test "$enable_mshtml_HTMLLocation_put_hash" -eq 1; then
) >> "$patchlist"
fi
# Patchset msi-Dummy_Thread
# |
# | This patchset fixes the following Wine bugs:
# | * [#18070] Workaround COM/MTA issues due to lack of separate msi custom action process
# |
# | Modified files:
# | * dlls/msi/action.c
# |
if test "$enable_msi_Dummy_Thread" -eq 1; then
patch_apply msi-Dummy_Thread/0001-msi-Create-dummy-thread-to-initialize-COM-for-custom.patch
(
printf '%s\n' '+ { "Michael Müller", "msi: Create dummy thread to initialize COM for custom actions.", 1 },';
) >> "$patchlist"
fi
# Patchset msi-MsiGetDatabaseState
# |
# | Modified files:
@ -7885,27 +7848,8 @@ if test "$enable_wined3d_Accounting" -eq 1; then
) >> "$patchlist"
fi
# Patchset wined3d-Viewports
# |
# | This patchset has the following (direct or indirect) dependencies:
# | * d3d11-Depth_Bias
# |
# | Modified files:
# | * dlls/d3d11/tests/d3d11.c, dlls/d3d8/directx.c, dlls/d3d9/directx.c, dlls/ddraw/ddraw_private.h, dlls/wined3d/state.c,
# | include/wine/wined3d.h
# |
if test "$enable_wined3d_Viewports" -eq 1; then
patch_apply wined3d-Viewports/0001-wined3d-Allow-arbitrary-viewports-for-d3d11.patch
(
printf '%s\n' '+ { "Michael Müller", "wined3d: Allow arbitrary viewports for d3d11.", 1 },';
) >> "$patchlist"
fi
# Patchset wined3d-Dual_Source_Blending
# |
# | This patchset has the following (direct or indirect) dependencies:
# | * d3d11-Depth_Bias, wined3d-Viewports
# |
# | Modified files:
# | * dlls/d3d11/tests/d3d11.c, dlls/wined3d/context.c, dlls/wined3d/directx.c, dlls/wined3d/glsl_shader.c,
# | dlls/wined3d/shader.c, dlls/wined3d/state.c, dlls/wined3d/wined3d_private.h
@ -7967,8 +7911,8 @@ fi
# Patchset wined3d-CSMT_Main
# |
# | This patchset has the following (direct or indirect) dependencies:
# | * d3d11-Deferred_Context, d3d9-Tests, wined3d-Accounting, wined3d-DXTn, d3d11-Depth_Bias, wined3d-Viewports, wined3d-
# | Dual_Source_Blending, wined3d-QUERY_Stubs, wined3d-Silence_FIXMEs, wined3d-UAV_Counters
# | * d3d11-Deferred_Context, d3d9-Tests, wined3d-Accounting, wined3d-DXTn, wined3d-Dual_Source_Blending, wined3d-QUERY_Stubs,
# | wined3d-Silence_FIXMEs, wined3d-UAV_Counters
# |
# | Modified files:
# | * dlls/wined3d/cs.c, dlls/wined3d/device.c, dlls/wined3d/view.c, dlls/wined3d/wined3d_private.h

View File

@ -1,4 +1,4 @@
From 0fa0ee7e130eb76702db6420a8f78f5b2d391728 Mon Sep 17 00:00:00 2001
From e5a957d77afa0539b75ba4819d1682a4f5749219 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Michael=20M=C3=BCller?= <michael@fds-team.de>
Date: Fri, 18 Aug 2017 23:22:16 +0200
Subject: [PATCH] d3d11/tests: Add basic dual source blend test.
@ -8,10 +8,10 @@ Subject: [PATCH] d3d11/tests: Add basic dual source blend test.
1 file changed, 169 insertions(+)
diff --git a/dlls/d3d11/tests/d3d11.c b/dlls/d3d11/tests/d3d11.c
index c6b9221..ae1e954 100644
index 8ca6634..242a003 100644
--- a/dlls/d3d11/tests/d3d11.c
+++ b/dlls/d3d11/tests/d3d11.c
@@ -25392,6 +25392,174 @@ static void test_unbound_multisample_texture(void)
@@ -26553,6 +26553,174 @@ static void test_multisample_resolve(void)
release_test_context(&test_context);
}
@ -186,8 +186,8 @@ index c6b9221..ae1e954 100644
START_TEST(d3d11)
{
unsigned int argc, i;
@@ -25518,6 +25686,7 @@ START_TEST(d3d11)
test_negative_viewports();
@@ -26682,6 +26850,7 @@ START_TEST(d3d11)
test_fractional_viewports();
test_early_depth_stencil();
test_conservative_depth_output();
+ test_dual_blending();

View File

@ -1,2 +1 @@
Fixes: Implement dual source blending in wined3d
Depends: wined3d-Viewports

View File

@ -1,163 +0,0 @@
From c609a9065e0139dba4a6c50419e1bc06a2bf53aa Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Michael=20M=C3=BCller?= <michael@fds-team.de>
Date: Thu, 17 Aug 2017 19:29:30 +0200
Subject: [PATCH] wined3d: Allow arbitrary viewports for d3d11.
---
dlls/d3d11/tests/d3d11.c | 55 ++++++++++++++++++++++++++++++++++++++++++++++
dlls/d3d8/directx.c | 2 +-
dlls/d3d9/directx.c | 2 +-
dlls/ddraw/ddraw_private.h | 2 +-
dlls/wined3d/state.c | 11 ++++++----
include/wine/wined3d.h | 1 +
6 files changed, 66 insertions(+), 7 deletions(-)
diff --git a/dlls/d3d11/tests/d3d11.c b/dlls/d3d11/tests/d3d11.c
index 1b713e4..531d955 100644
--- a/dlls/d3d11/tests/d3d11.c
+++ b/dlls/d3d11/tests/d3d11.c
@@ -24217,6 +24217,60 @@ static void test_fractional_viewports(void)
release_test_context(&test_context);
}
+static void test_negative_viewports(void)
+{
+ struct d3d11_test_context test_context;
+ ID3D11DeviceContext *context;
+ D3D11_VIEWPORT vp;
+ DWORD color;
+
+ static const float red[] = {1.0f, 0.0f, 0.0f, 1.0f};
+ static const struct vec4 white = {1.0f, 1.0f, 1.0f, 1.0f};
+
+ if (!init_test_context(&test_context, NULL))
+ return;
+
+ context = test_context.immediate_context;
+
+ ID3D11DeviceContext_ClearRenderTargetView(context, test_context.backbuffer_rtv, red);
+ draw_color_quad(&test_context, &white);
+ color = get_texture_color(test_context.backbuffer, 320, 240);
+ ok(compare_color(color, 0xffffffff, 1), "Got unexpected color 0x%08x.\n", color);
+
+ vp.TopLeftX = -640;
+ vp.TopLeftY = 0;
+ vp.Width = 640 * 2;
+ vp.Height = 480;
+ vp.MinDepth = 0.0f;
+ vp.MaxDepth = 1.0f;
+ ID3D11DeviceContext_RSSetViewports(context, 1, &vp);
+
+ ID3D11DeviceContext_ClearRenderTargetView(context, test_context.backbuffer_rtv, red);
+ draw_color_quad(&test_context, &white);
+ color = get_texture_color(test_context.backbuffer, 320, 240);
+ ok(compare_color(color, 0xffffffff, 1), "Got unexpected color 0x%08x.\n", color);
+
+ vp.Width = 640;
+ ID3D11DeviceContext_RSSetViewports(context, 1, &vp);
+
+ ID3D11DeviceContext_ClearRenderTargetView(context, test_context.backbuffer_rtv, red);
+ draw_color_quad(&test_context, &white);
+ color = get_texture_color(test_context.backbuffer, 320, 240);
+ ok(compare_color(color, 0xff0000ff, 1), "Got unexpected color 0x%08x.\n", color);
+
+ vp.Width = 640 + 320;
+ ID3D11DeviceContext_RSSetViewports(context, 1, &vp);
+
+ ID3D11DeviceContext_ClearRenderTargetView(context, test_context.backbuffer_rtv, red);
+ draw_color_quad(&test_context, &white);
+ color = get_texture_color(test_context.backbuffer, 320, 240);
+ ok(compare_color(color, 0xff0000ff, 1), "Got unexpected color 0x%08x.\n", color);
+ color = get_texture_color(test_context.backbuffer, 319, 240);
+ ok(compare_color(color, 0xffffffff, 1), "Got unexpected color 0x%08x.\n", color);
+
+ release_test_context(&test_context);
+}
+
static void test_early_depth_stencil(void)
{
ID3D11DepthStencilState *depth_stencil_state;
@@ -26479,6 +26533,7 @@ START_TEST(d3d11)
test_gather_c();
test_depth_bias();
test_fractional_viewports();
+ test_negative_viewports();
test_early_depth_stencil();
test_conservative_depth_output();
test_format_compatibility();
diff --git a/dlls/d3d8/directx.c b/dlls/d3d8/directx.c
index 68300c0..6e8f93a 100644
--- a/dlls/d3d8/directx.c
+++ b/dlls/d3d8/directx.c
@@ -417,7 +417,7 @@ BOOL d3d8_init(struct d3d8 *d3d8)
DWORD flags = WINED3D_LEGACY_DEPTH_BIAS | WINED3D_VIDMEM_ACCOUNTING
| WINED3D_HANDLE_RESTORE | WINED3D_PIXEL_CENTER_INTEGER
| WINED3D_LEGACY_UNBOUND_RESOURCE_COLOR | WINED3D_NO_PRIMITIVE_RESTART
- | WINED3D_LEGACY_CUBEMAP_FILTERING;
+ | WINED3D_LEGACY_CUBEMAP_FILTERING | WINED3D_LIMIT_VIEWPORT;
d3d8->IDirect3D8_iface.lpVtbl = &d3d8_vtbl;
d3d8->refcount = 1;
diff --git a/dlls/d3d9/directx.c b/dlls/d3d9/directx.c
index cdce669..644766c 100644
--- a/dlls/d3d9/directx.c
+++ b/dlls/d3d9/directx.c
@@ -579,7 +579,7 @@ BOOL d3d9_init(struct d3d9 *d3d9, BOOL extended)
DWORD flags = WINED3D_PRESENT_CONVERSION | WINED3D_HANDLE_RESTORE | WINED3D_PIXEL_CENTER_INTEGER
| WINED3D_SRGB_READ_WRITE_CONTROL | WINED3D_LEGACY_UNBOUND_RESOURCE_COLOR
| WINED3D_NO_PRIMITIVE_RESTART | WINED3D_LEGACY_CUBEMAP_FILTERING
- | WINED3D_NORMALIZED_DEPTH_BIAS;
+ | WINED3D_NORMALIZED_DEPTH_BIAS | WINED3D_LIMIT_VIEWPORT;
if (!extended)
flags |= WINED3D_VIDMEM_ACCOUNTING;
diff --git a/dlls/ddraw/ddraw_private.h b/dlls/ddraw/ddraw_private.h
index b8552af..50e4d82 100644
--- a/dlls/ddraw/ddraw_private.h
+++ b/dlls/ddraw/ddraw_private.h
@@ -66,7 +66,7 @@ struct FvfToDecl
#define DDRAW_WINED3D_FLAGS (WINED3D_LEGACY_DEPTH_BIAS | WINED3D_VIDMEM_ACCOUNTING \
| WINED3D_RESTORE_MODE_ON_ACTIVATE | WINED3D_FOCUS_MESSAGES | WINED3D_PIXEL_CENTER_INTEGER \
| WINED3D_LEGACY_UNBOUND_RESOURCE_COLOR | WINED3D_NO_PRIMITIVE_RESTART \
- | WINED3D_LEGACY_CUBEMAP_FILTERING)
+ | WINED3D_LEGACY_CUBEMAP_FILTERING | WINED3D_LIMIT_VIEWPORT)
enum ddraw_device_state
{
diff --git a/dlls/wined3d/state.c b/dlls/wined3d/state.c
index 88e6181..d665012 100644
--- a/dlls/wined3d/state.c
+++ b/dlls/wined3d/state.c
@@ -4559,10 +4559,13 @@ static void get_viewports(struct wined3d_context *context, const struct wined3d_
if (target)
{
- if (viewports[i].width > target->width)
- viewports[i].width = target->width;
- if (viewports[i].height > target->height)
- viewports[i].height = target->height;
+ if (context->d3d_info->wined3d_creation_flags & WINED3D_LIMIT_VIEWPORT)
+ {
+ if (viewports[i].width > target->width)
+ viewports[i].width = target->width;
+ if (viewports[i].height > target->height)
+ viewports[i].height = target->height;
+ }
}
}
diff --git a/include/wine/wined3d.h b/include/wine/wined3d.h
index 6bfbc03..97fb693 100644
--- a/include/wine/wined3d.h
+++ b/include/wine/wined3d.h
@@ -1315,6 +1315,7 @@ enum wined3d_shader_byte_code_format
#define WINED3D_NO_PRIMITIVE_RESTART 0x00000800
#define WINED3D_LEGACY_CUBEMAP_FILTERING 0x00001000
#define WINED3D_NORMALIZED_DEPTH_BIAS 0x00002000
+#define WINED3D_LIMIT_VIEWPORT 0x00004000
#define WINED3D_RESZ_CODE 0x7fa05000
--
2.7.4

View File

@ -1,3 +0,0 @@
Fixes: Allow arbitrary viewports for d3d11 in wined3d
Depends: d3d11-Depth_Bias
# For Overwatch; see https://www.winehq.org/pipermail/wine-devel/2016-November/115312.html