Added patch to revert pixelformat changes (caused regression for many apps).

Well, usually we don't revert Wine commits in this branch. In this case the original author of the
patches suggested to revert them, because its unfinished and the rest of the patches will not be
accepted anymore in the near future. Without the complete patchset it causes a lot of side effects
(flickering, black/grey screen, missing video). This makes Wine basically useless for all affected
apps. Since the revert was not accepted upstream, we do it in our branch, until either the problems
are gone, or the revert got accepted.
This commit is contained in:
Sebastian Lackner 2014-09-19 04:44:18 +02:00
parent 969e9d5583
commit 299a2daeac
12 changed files with 969 additions and 1 deletions

View File

@ -35,9 +35,14 @@ Wine. All those differences are also documented on the
Included bugfixes and improvements
==================================
**Bugfixes and features included in the next upcoming release [2]:**
**Bugfixes and features included in the next upcoming release [7]:**
* Don't fill KdHelp structure for usermode applications ([Wine Bug #37272](http://bugs.winehq.org/show_bug.cgi?id=37272 "CheatEngine 6.4 fails after remote process 'breakin', reporting 'Debugger Crash:Access violation (Last location:41)'"))
* Fix black screen on startup introduced by pixelformat changes. ([Wine Bug #35950](http://bugs.winehq.org/show_bug.cgi?id=35950 "StarCraft: Black screen, hangs on startup"))
* Fix flickering introduced by pixelformat changes. ([Wine Bug #35718](http://bugs.winehq.org/show_bug.cgi?id=35718 "Multiple games have extreme flicker, stutter, slowdown (Path of Exile, Roller Coaster Tycoon, Counter Strike: Global Offensive, Warframe, Crysis, Anno 1602, Splinter Cell: Blacklist)"))
* Fix gray screen on startup introduced by pixelformat changes. ([Wine Bug #35975](http://bugs.winehq.org/show_bug.cgi?id=35975 "Comanche 3 shows only gray screen"))
* Fix missing video introduced by pixelformat changes. ([Wine Bug #36900](http://bugs.winehq.org/show_bug.cgi?id=36900 "Star Wars Galactic Battlegrounds Clone Campaigns: no video (regression)"))
* Fix wined3d performance drop introduced by pixelformat changes. ([Wine Bug #35655](http://bugs.winehq.org/show_bug.cgi?id=35655 "Wined3d performance drop"))
* Support for FIND_FIRST_EX_LARGE_FETCH flag in FindFirstFileExW ([Wine Bug #35121](http://bugs.winehq.org/show_bug.cgi?id=35121 "Multiple applications/games fail to start with WinVer set to 'Windows 7' (FindFirstFileExW needs FIND_FIRST_EX_LARGE_FETCH support)(FotoQuelle Fotosoftware v4.13, QT5)"))

1
debian/changelog vendored
View File

@ -4,6 +4,7 @@ wine-compholio (1.7.27) UNRELEASED; urgency=low
* Added patch to fix deadlock caused by incorrect wrapper of glu polygon/contour function.
* Added patch to avoid filling out KdHelp for usermode applications.
* Added patch to silence repeated GSUB_apply_ChainContext[Subst|Pos] FIXMEs.
* Added patch to revert wined3d pixelformat changes (causes regression in many games).
* Removed patch to use assembly wrapper for TLS callbacks (accepted upstream).
* Removed patch to fix uninitialized cch struct member in GetMenuItemInfo (accepted upstream).
* Removed some patches for riched20/IText*-interface (accepted upstream).

View File

@ -68,6 +68,7 @@ PATCHLIST := \
user32-WndProc.ok \
wineboot-HKEY_DYN_DATA.ok \
winebuild-LinkerVersion.ok \
wined3d-Revert_PixelFormat.ok \
winepulse-PulseAudio_Support.ok \
winex11-Limited_Resolutions.ok \
winex11-Window_Groups.ok \
@ -1080,6 +1081,36 @@ winebuild-LinkerVersion.ok:
echo '+ { "winebuild-LinkerVersion", "Michael Müller", "Set a valid major and minor linker version in the PE header." },'; \
) > winebuild-LinkerVersion.ok
# Patchset wined3d-Revert_PixelFormat
# |
# | Included patches:
# | * Revert wined3d pixelformat changes. [by Ken Thomases]
# |
# | This patchset fixes the following Wine bugs:
# | * [#35655] Fix wined3d performance drop introduced by pixelformat changes.
# | * [#35718] Fix flickering introduced by pixelformat changes.
# | * [#35950] Fix black screen on startup introduced by pixelformat changes.
# | * [#35975] Fix gray screen on startup introduced by pixelformat changes.
# | * [#36900] Fix missing video introduced by pixelformat changes.
# |
# | Modified files:
# | * dlls/d3d8/tests/device.c, dlls/d3d9/tests/device.c, dlls/ddraw/tests/ddraw1.c, dlls/ddraw/tests/ddraw2.c,
# | dlls/ddraw/tests/ddraw4.c, dlls/ddraw/tests/ddraw7.c, dlls/wined3d/context.c, dlls/wined3d/wined3d_private.h
# |
.INTERMEDIATE: wined3d-Revert_PixelFormat.ok
wined3d-Revert_PixelFormat.ok:
$(call APPLY_FILE,wined3d-Revert_PixelFormat/0001-Revert-wined3d-Track-if-a-context-s-private-hdc-has-.patch)
$(call APPLY_FILE,wined3d-Revert_PixelFormat/0002-Revert-wined3d-Track-if-a-context-s-hdc-is-private-s.patch)
$(call APPLY_FILE,wined3d-Revert_PixelFormat/0003-Revert-wined3d-When-restoring-pixel-format-in-contex.patch)
$(call APPLY_FILE,wined3d-Revert_PixelFormat/0004-Revert-wined3d-Don-t-call-GetPixelFormat-to-set-a-fl.patch)
$(call APPLY_FILE,wined3d-Revert_PixelFormat/0005-Revert-wined3d-Restore-the-pixel-format-of-the-windo.patch)
$(call APPLY_FILE,wined3d-Revert_PixelFormat/0006-d3d8-Mark-tests-which-no-longer-pass-due-to-reverts-.patch)
$(call APPLY_FILE,wined3d-Revert_PixelFormat/0007-d3d9-Mark-tests-which-no-longer-pass-due-to-reverts-.patch)
$(call APPLY_FILE,wined3d-Revert_PixelFormat/0008-ddraw-Mark-tests-which-no-longer-pass-due-to-reverts.patch)
@( \
echo '+ { "wined3d-Revert_PixelFormat", "Ken Thomases", "Revert wined3d pixelformat changes." },'; \
) > wined3d-Revert_PixelFormat.ok
# Patchset winepulse-PulseAudio_Support
# |
# | Included patches:

View File

@ -0,0 +1,105 @@
From 61ed71d54a87884d8c771c548b8311fe48ee3c6a Mon Sep 17 00:00:00 2001
From: Ken Thomases <ken@codeweavers.com>
Date: Sun, 14 Sep 2014 19:46:53 -0500
Subject: Revert "wined3d: Track if a context's private hdc has had its pixel
format set, so we don't need to check it."
This reverts commit f3aa4812382caa459b9b612f66998c6ea8257594.
---
dlls/wined3d/context.c | 22 +++++-----------------
dlls/wined3d/wined3d_private.h | 3 +--
2 files changed, 6 insertions(+), 19 deletions(-)
diff --git a/dlls/wined3d/context.c b/dlls/wined3d/context.c
index 693267e..402878d 100644
--- a/dlls/wined3d/context.c
+++ b/dlls/wined3d/context.c
@@ -800,13 +800,9 @@ static BOOL context_restore_pixel_format(struct wined3d_context *ctx)
static BOOL context_set_pixel_format(struct wined3d_context *context, HDC dc, BOOL private, int format)
{
const struct wined3d_gl_info *gl_info = context->gl_info;
- int current;
+ int current = GetPixelFormat(dc);
- if (dc == context->hdc && context->hdc_is_private && context->hdc_has_format)
- return TRUE;
-
- current = GetPixelFormat(dc);
- if (current == format) goto success;
+ if (current == format) return TRUE;
if (!current)
{
@@ -820,7 +816,7 @@ static BOOL context_set_pixel_format(struct wined3d_context *context, HDC dc, BO
context->restore_pf = 0;
context->restore_pf_win = private ? NULL : WindowFromDC(dc);
- goto success;
+ return TRUE;
}
/* By default WGL doesn't allow pixel format adjustments but we need it
@@ -847,7 +843,7 @@ static BOOL context_set_pixel_format(struct wined3d_context *context, HDC dc, BO
context->restore_pf_win = win;
}
- goto success;
+ return TRUE;
}
/* OpenGL doesn't allow pixel format adjustments. Print an error and
@@ -857,11 +853,6 @@ static BOOL context_set_pixel_format(struct wined3d_context *context, HDC dc, BO
ERR("Unable to set pixel format %d on device context %p. Already using format %d.\n",
format, dc, current);
return TRUE;
-
-success:
- if (dc == context->hdc && context->hdc_is_private)
- context->hdc_has_format = TRUE;
- return TRUE;
}
static BOOL context_set_gl_context(struct wined3d_context *ctx)
@@ -947,7 +938,6 @@ static void context_update_window(struct wined3d_context *context)
context->win_handle = context->swapchain->win_handle;
context->hdc_is_private = FALSE;
- context->hdc_has_format = FALSE;
context->needs_set = 1;
context->valid = 1;
@@ -1189,8 +1179,7 @@ static void context_enter(struct wined3d_context *context)
context->restore_dc = wglGetCurrentDC();
context->needs_set = 1;
}
- else if (!context->needs_set && !(context->hdc_is_private && context->hdc_has_format)
- && context->pixel_format != GetPixelFormat(context->hdc))
+ else if (!context->needs_set && context->pixel_format != GetPixelFormat(context->hdc))
context->needs_set = 1;
}
}
@@ -1598,7 +1587,6 @@ struct wined3d_context *context_create(struct wined3d_swapchain *swapchain,
ret->win_handle = swapchain->win_handle;
ret->hdc = hdc;
ret->hdc_is_private = hdc_is_private;
- ret->hdc_has_format = TRUE;
ret->pixel_format = pixel_format;
ret->needs_set = 1;
diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h
index ff98ec0..16323ca 100644
--- a/dlls/wined3d/wined3d_private.h
+++ b/dlls/wined3d/wined3d_private.h
@@ -1103,8 +1103,7 @@ struct wined3d_context
DWORD rebind_fbo : 1;
DWORD needs_set : 1;
DWORD hdc_is_private : 1;
- DWORD hdc_has_format : 1; /* only meaningful if hdc_is_private */
- DWORD padding : 16;
+ DWORD padding : 17;
DWORD shader_update_mask;
DWORD constant_update_mask;
DWORD numbered_array_mask;
--
2.1.0

View File

@ -0,0 +1,128 @@
From 9266e76fa92231e5186cbd8bd9e0b2c2ba1c47d4 Mon Sep 17 00:00:00 2001
From: Ken Thomases <ken@codeweavers.com>
Date: Sun, 14 Sep 2014 19:47:03 -0500
Subject: Revert "wined3d: Track if a context's hdc is private so we never need
to restore its pixel format."
This reverts commit 272873823e9beff91ea1a62845fc7e5f94a9636f.
---
dlls/wined3d/context.c | 21 ++++++++-------------
dlls/wined3d/wined3d_private.h | 3 +--
2 files changed, 9 insertions(+), 15 deletions(-)
diff --git a/dlls/wined3d/context.c b/dlls/wined3d/context.c
index 402878d..a347a8b 100644
--- a/dlls/wined3d/context.c
+++ b/dlls/wined3d/context.c
@@ -797,7 +797,7 @@ static BOOL context_restore_pixel_format(struct wined3d_context *ctx)
return ret;
}
-static BOOL context_set_pixel_format(struct wined3d_context *context, HDC dc, BOOL private, int format)
+static BOOL context_set_pixel_format(struct wined3d_context *context, HDC dc, int format)
{
const struct wined3d_gl_info *gl_info = context->gl_info;
int current = GetPixelFormat(dc);
@@ -815,7 +815,7 @@ static BOOL context_set_pixel_format(struct wined3d_context *context, HDC dc, BO
}
context->restore_pf = 0;
- context->restore_pf_win = private ? NULL : WindowFromDC(dc);
+ context->restore_pf_win = WindowFromDC(dc);
return TRUE;
}
@@ -834,12 +834,12 @@ static BOOL context_set_pixel_format(struct wined3d_context *context, HDC dc, BO
return FALSE;
}
- win = private ? NULL : WindowFromDC(dc);
+ win = WindowFromDC(dc);
if (win != context->restore_pf_win)
{
context_restore_pixel_format(context);
- context->restore_pf = private ? 0 : current;
+ context->restore_pf = current;
context->restore_pf_win = win;
}
@@ -860,7 +860,7 @@ static BOOL context_set_gl_context(struct wined3d_context *ctx)
struct wined3d_swapchain *swapchain = ctx->swapchain;
BOOL backup = FALSE;
- if (!context_set_pixel_format(ctx, ctx->hdc, ctx->hdc_is_private, ctx->pixel_format))
+ if (!context_set_pixel_format(ctx, ctx->hdc, ctx->pixel_format))
{
WARN("Failed to set pixel format %d on device context %p.\n",
ctx->pixel_format, ctx->hdc);
@@ -893,7 +893,7 @@ static BOOL context_set_gl_context(struct wined3d_context *ctx)
return FALSE;
}
- if (!context_set_pixel_format(ctx, dc, TRUE, ctx->pixel_format))
+ if (!context_set_pixel_format(ctx, dc, ctx->pixel_format))
{
ERR("Failed to set pixel format %d on device context %p.\n",
ctx->pixel_format, dc);
@@ -937,7 +937,6 @@ static void context_update_window(struct wined3d_context *context)
wined3d_release_dc(context->win_handle, context->hdc);
context->win_handle = context->swapchain->win_handle;
- context->hdc_is_private = FALSE;
context->needs_set = 1;
context->valid = 1;
@@ -1388,7 +1387,6 @@ struct wined3d_context *context_create(struct wined3d_swapchain *swapchain,
int swap_interval;
DWORD state;
HDC hdc;
- BOOL hdc_is_private = FALSE;
TRACE("swapchain %p, target %p, window %p.\n", swapchain, target, swapchain->win_handle);
@@ -1456,9 +1454,7 @@ struct wined3d_context *context_create(struct wined3d_swapchain *swapchain,
{
WARN("Failed to retireve device context, trying swapchain backup.\n");
- if ((hdc = swapchain_get_backup_dc(swapchain)))
- hdc_is_private = TRUE;
- else
+ if (!(hdc = swapchain_get_backup_dc(swapchain)))
{
ERR("Failed to retrieve a device context.\n");
goto out;
@@ -1509,7 +1505,7 @@ struct wined3d_context *context_create(struct wined3d_swapchain *swapchain,
ret->gl_info = gl_info;
- if (!context_set_pixel_format(ret, hdc, hdc_is_private, pixel_format))
+ if (!context_set_pixel_format(ret, hdc, pixel_format))
{
ERR("Failed to set pixel format %d on device context %p.\n", pixel_format, hdc);
context_release(ret);
@@ -1586,7 +1582,6 @@ struct wined3d_context *context_create(struct wined3d_swapchain *swapchain,
ret->glCtx = ctx;
ret->win_handle = swapchain->win_handle;
ret->hdc = hdc;
- ret->hdc_is_private = hdc_is_private;
ret->pixel_format = pixel_format;
ret->needs_set = 1;
diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h
index 16323ca..849a44a 100644
--- a/dlls/wined3d/wined3d_private.h
+++ b/dlls/wined3d/wined3d_private.h
@@ -1102,8 +1102,7 @@ struct wined3d_context
DWORD lowest_disabled_stage : 4; /* Max MAX_TEXTURES, 8 */
DWORD rebind_fbo : 1;
DWORD needs_set : 1;
- DWORD hdc_is_private : 1;
- DWORD padding : 17;
+ DWORD padding : 18;
DWORD shader_update_mask;
DWORD constant_update_mask;
DWORD numbered_array_mask;
--
2.1.0

View File

@ -0,0 +1,57 @@
From eac78fe59a4ef614418f0e80a96571d5fdaa7593 Mon Sep 17 00:00:00 2001
From: Ken Thomases <ken@codeweavers.com>
Date: Sun, 14 Sep 2014 19:47:08 -0500
Subject: Revert "wined3d: When restoring pixel format in context_release(),
mark the context as needing to be set on the next context_acquire()."
This reverts commit 57c51710e0a4474872125cc54be7562ea8db6ccd.
---
dlls/wined3d/context.c | 9 +++------
1 file changed, 3 insertions(+), 6 deletions(-)
diff --git a/dlls/wined3d/context.c b/dlls/wined3d/context.c
index a347a8b..d5ee29b 100644
--- a/dlls/wined3d/context.c
+++ b/dlls/wined3d/context.c
@@ -766,10 +766,9 @@ void context_surface_update(struct wined3d_context *context, const struct wined3
}
}
-static BOOL context_restore_pixel_format(struct wined3d_context *ctx)
+static void context_restore_pixel_format(struct wined3d_context *ctx)
{
const struct wined3d_gl_info *gl_info = ctx->gl_info;
- BOOL ret = FALSE;
if (ctx->restore_pf && IsWindow(ctx->restore_pf_win))
{
@@ -778,7 +777,7 @@ static BOOL context_restore_pixel_format(struct wined3d_context *ctx)
HDC dc = GetDC(ctx->restore_pf_win);
if (dc)
{
- if (!(ret = GL_EXTCALL(wglSetPixelFormatWINE(dc, ctx->restore_pf))))
+ if (!GL_EXTCALL(wglSetPixelFormatWINE(dc, ctx->restore_pf)))
{
ERR("wglSetPixelFormatWINE failed to restore pixel format %d on window %p.\n",
ctx->restore_pf, ctx->restore_pf_win);
@@ -794,7 +793,6 @@ static BOOL context_restore_pixel_format(struct wined3d_context *ctx)
ctx->restore_pf = 0;
ctx->restore_pf_win = NULL;
- return ret;
}
static BOOL context_set_pixel_format(struct wined3d_context *context, HDC dc, int format)
@@ -1149,8 +1147,7 @@ void context_release(struct wined3d_context *context)
if (!--context->level)
{
- if (context_restore_pixel_format(context))
- context->needs_set = 1;
+ context_restore_pixel_format(context);
if (context->restore_ctx)
{
TRACE("Restoring GL context %p on device context %p.\n", context->restore_ctx, context->restore_dc);
--
2.1.0

View File

@ -0,0 +1,27 @@
From 84b7c245fd8cc43f5696c244156efe4cbd31572c Mon Sep 17 00:00:00 2001
From: Ken Thomases <ken@codeweavers.com>
Date: Sun, 14 Sep 2014 19:47:15 -0500
Subject: Revert "wined3d: Don't call GetPixelFormat() to set a flag that's
already set."
This reverts commit ffb357b717680b52917f280b3716da7b387f4af2.
---
dlls/wined3d/context.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/dlls/wined3d/context.c b/dlls/wined3d/context.c
index d5ee29b..8109a6f 100644
--- a/dlls/wined3d/context.c
+++ b/dlls/wined3d/context.c
@@ -1175,7 +1175,7 @@ static void context_enter(struct wined3d_context *context)
context->restore_dc = wglGetCurrentDC();
context->needs_set = 1;
}
- else if (!context->needs_set && context->pixel_format != GetPixelFormat(context->hdc))
+ else if (context->pixel_format != GetPixelFormat(context->hdc))
context->needs_set = 1;
}
}
--
2.1.0

View File

@ -0,0 +1,225 @@
From 1ed6f781025b1b360015e5b2fce084bd558a9af7 Mon Sep 17 00:00:00 2001
From: Ken Thomases <ken@codeweavers.com>
Date: Sun, 14 Sep 2014 19:47:30 -0500
Subject: Revert "wined3d: Restore the pixel format of the window whose pixel
format was actually changed."
This reverts commit 4c4552c5a1910a9d5adf8eccff0ac62d89ffe376.
For:
https://bugs.winehq.org/show_bug.cgi?id=35655
https://bugs.winehq.org/show_bug.cgi?id=35718
https://bugs.winehq.org/show_bug.cgi?id=35950
https://bugs.winehq.org/show_bug.cgi?id=35975
https://bugs.winehq.org/show_bug.cgi?id=36900
---
dlls/wined3d/context.c | 87 +++++++++++-------------------------------
dlls/wined3d/wined3d_private.h | 1 -
2 files changed, 22 insertions(+), 66 deletions(-)
diff --git a/dlls/wined3d/context.c b/dlls/wined3d/context.c
index 8109a6f..e1658d9 100644
--- a/dlls/wined3d/context.c
+++ b/dlls/wined3d/context.c
@@ -766,38 +766,8 @@ void context_surface_update(struct wined3d_context *context, const struct wined3
}
}
-static void context_restore_pixel_format(struct wined3d_context *ctx)
+static BOOL context_set_pixel_format(const struct wined3d_gl_info *gl_info, HDC dc, int format)
{
- const struct wined3d_gl_info *gl_info = ctx->gl_info;
-
- if (ctx->restore_pf && IsWindow(ctx->restore_pf_win))
- {
- if (ctx->gl_info->supported[WGL_WINE_PIXEL_FORMAT_PASSTHROUGH])
- {
- HDC dc = GetDC(ctx->restore_pf_win);
- if (dc)
- {
- if (!GL_EXTCALL(wglSetPixelFormatWINE(dc, ctx->restore_pf)))
- {
- ERR("wglSetPixelFormatWINE failed to restore pixel format %d on window %p.\n",
- ctx->restore_pf, ctx->restore_pf_win);
- }
- ReleaseDC(ctx->restore_pf_win, dc);
- }
- }
- else
- {
- ERR("can't restore pixel format %d on window %p\n", ctx->restore_pf, ctx->restore_pf_win);
- }
- }
-
- ctx->restore_pf = 0;
- ctx->restore_pf_win = NULL;
-}
-
-static BOOL context_set_pixel_format(struct wined3d_context *context, HDC dc, int format)
-{
- const struct wined3d_gl_info *gl_info = context->gl_info;
int current = GetPixelFormat(dc);
if (current == format) return TRUE;
@@ -811,9 +781,6 @@ static BOOL context_set_pixel_format(struct wined3d_context *context, HDC dc, in
format, dc, GetLastError());
return FALSE;
}
-
- context->restore_pf = 0;
- context->restore_pf_win = WindowFromDC(dc);
return TRUE;
}
@@ -823,24 +790,12 @@ static BOOL context_set_pixel_format(struct wined3d_context *context, HDC dc, in
* when really needed. */
if (gl_info->supported[WGL_WINE_PIXEL_FORMAT_PASSTHROUGH])
{
- HWND win;
-
if (!GL_EXTCALL(wglSetPixelFormatWINE(dc, format)))
{
ERR("wglSetPixelFormatWINE failed to set pixel format %d on device context %p.\n",
format, dc);
return FALSE;
}
-
- win = WindowFromDC(dc);
- if (win != context->restore_pf_win)
- {
- context_restore_pixel_format(context);
-
- context->restore_pf = current;
- context->restore_pf_win = win;
- }
-
return TRUE;
}
@@ -858,7 +813,7 @@ static BOOL context_set_gl_context(struct wined3d_context *ctx)
struct wined3d_swapchain *swapchain = ctx->swapchain;
BOOL backup = FALSE;
- if (!context_set_pixel_format(ctx, ctx->hdc, ctx->pixel_format))
+ if (!context_set_pixel_format(ctx->gl_info, ctx->hdc, ctx->pixel_format))
{
WARN("Failed to set pixel format %d on device context %p.\n",
ctx->pixel_format, ctx->hdc);
@@ -891,7 +846,7 @@ static BOOL context_set_gl_context(struct wined3d_context *ctx)
return FALSE;
}
- if (!context_set_pixel_format(ctx, dc, ctx->pixel_format))
+ if (!context_set_pixel_format(ctx->gl_info, dc, ctx->pixel_format))
{
ERR("Failed to set pixel format %d on device context %p.\n",
ctx->pixel_format, dc);
@@ -913,8 +868,15 @@ static BOOL context_set_gl_context(struct wined3d_context *ctx)
return TRUE;
}
-static void context_restore_gl_context(const struct wined3d_gl_info *gl_info, HDC dc, HGLRC gl_ctx)
+static void context_restore_gl_context(const struct wined3d_gl_info *gl_info, HDC dc, HGLRC gl_ctx, int pf)
{
+ if (!context_set_pixel_format(gl_info, dc, pf))
+ {
+ ERR("Failed to restore pixel format %d on device context %p.\n", pf, dc);
+ context_set_current(NULL);
+ return;
+ }
+
if (!wglMakeCurrent(dc, gl_ctx))
{
ERR("Failed to restore GL context %p on device context %p, last error %#x.\n",
@@ -955,9 +917,11 @@ static void context_destroy_gl_resources(struct wined3d_context *context)
HGLRC restore_ctx;
HDC restore_dc;
unsigned int i;
+ int restore_pf;
restore_ctx = wglGetCurrentContext();
restore_dc = wglGetCurrentDC();
+ restore_pf = GetPixelFormat(restore_dc);
if (restore_ctx == context->glCtx)
restore_ctx = NULL;
@@ -1046,10 +1010,9 @@ static void context_destroy_gl_resources(struct wined3d_context *context)
HeapFree(GetProcessHeap(), 0, context->free_occlusion_queries);
HeapFree(GetProcessHeap(), 0, context->free_event_queries);
- context_restore_pixel_format(context);
if (restore_ctx)
{
- context_restore_gl_context(gl_info, restore_dc, restore_ctx);
+ context_restore_gl_context(gl_info, restore_dc, restore_ctx, restore_pf);
}
else if (wglGetCurrentContext() && !wglMakeCurrent(NULL, NULL))
{
@@ -1145,16 +1108,12 @@ void context_release(struct wined3d_context *context)
WARN("Context %p is not the current context.\n", context);
}
- if (!--context->level)
+ if (!--context->level && context->restore_ctx)
{
- context_restore_pixel_format(context);
- if (context->restore_ctx)
- {
- TRACE("Restoring GL context %p on device context %p.\n", context->restore_ctx, context->restore_dc);
- context_restore_gl_context(context->gl_info, context->restore_dc, context->restore_ctx);
- context->restore_ctx = NULL;
- context->restore_dc = NULL;
- }
+ TRACE("Restoring GL context %p on device context %p.\n", context->restore_ctx, context->restore_dc);
+ context_restore_gl_context(context->gl_info, context->restore_dc, context->restore_ctx, context->restore_pf);
+ context->restore_ctx = NULL;
+ context->restore_dc = NULL;
}
}
@@ -1173,10 +1132,9 @@ static void context_enter(struct wined3d_context *context)
current_gl, wglGetCurrentDC());
context->restore_ctx = current_gl;
context->restore_dc = wglGetCurrentDC();
+ context->restore_pf = GetPixelFormat(context->restore_dc);
context->needs_set = 1;
}
- else if (context->pixel_format != GetPixelFormat(context->hdc))
- context->needs_set = 1;
}
}
@@ -1500,9 +1458,7 @@ struct wined3d_context *context_create(struct wined3d_swapchain *swapchain,
context_enter(ret);
- ret->gl_info = gl_info;
-
- if (!context_set_pixel_format(ret, hdc, pixel_format))
+ if (!context_set_pixel_format(gl_info, hdc, pixel_format))
{
ERR("Failed to set pixel format %d on device context %p.\n", pixel_format, hdc);
context_release(ret);
@@ -1557,6 +1513,7 @@ struct wined3d_context *context_create(struct wined3d_swapchain *swapchain,
goto out;
}
+ ret->gl_info = gl_info;
ret->d3d_info = &device->adapter->d3d_info;
ret->state_table = device->StateTable;
diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h
index 849a44a..cd8e958 100644
--- a/dlls/wined3d/wined3d_private.h
+++ b/dlls/wined3d/wined3d_private.h
@@ -1120,7 +1120,6 @@ struct wined3d_context
HGLRC restore_ctx;
HDC restore_dc;
int restore_pf;
- HWND restore_pf_win;
HGLRC glCtx;
HWND win_handle;
HDC hdc;
--
2.1.0

View File

@ -0,0 +1,73 @@
From de13cf416c368e9bca4c2504299a10292ab02a20 Mon Sep 17 00:00:00 2001
From: Ken Thomases <ken@codeweavers.com>
Date: Sun, 14 Sep 2014 19:47:36 -0500
Subject: d3d8: Mark tests which no longer pass due to reverts as todo_wine.
---
dlls/d3d8/tests/device.c | 16 ++++++++--------
1 file changed, 8 insertions(+), 8 deletions(-)
diff --git a/dlls/d3d8/tests/device.c b/dlls/d3d8/tests/device.c
index a92ca81..4ad61fd 100644
--- a/dlls/d3d8/tests/device.c
+++ b/dlls/d3d8/tests/device.c
@@ -5693,37 +5693,37 @@ static void test_pixel_format(void)
}
test_format = GetPixelFormat(hdc);
- ok(test_format == format, "window has pixel format %d, expected %d\n", test_format, format);
+ todo_wine ok(test_format == format, "window has pixel format %d, expected %d\n", test_format, format);
hr = IDirect3DDevice8_SetVertexShader(device, D3DFVF_XYZ);
ok(SUCCEEDED(hr), "Failed to set FVF, hr %#x.\n", hr);
test_format = GetPixelFormat(hdc);
- ok(test_format == format, "window has pixel format %d, expected %d\n", test_format, format);
+ todo_wine ok(test_format == format, "window has pixel format %d, expected %d\n", test_format, format);
hr = IDirect3DDevice8_BeginScene(device);
ok(SUCCEEDED(hr), "BeginScene failed %#x\n", hr);
test_format = GetPixelFormat(hdc);
- ok(test_format == format, "window has pixel format %d, expected %d\n", test_format, format);
+ todo_wine ok(test_format == format, "window has pixel format %d, expected %d\n", test_format, format);
hr = IDirect3DDevice8_DrawPrimitiveUP(device, D3DPT_POINTLIST, 1, point, 3 * sizeof(float));
ok(SUCCEEDED(hr), "Failed to draw, hr %#x.\n", hr);
test_format = GetPixelFormat(hdc);
- ok(test_format == format, "window has pixel format %d, expected %d\n", test_format, format);
+ todo_wine ok(test_format == format, "window has pixel format %d, expected %d\n", test_format, format);
hr = IDirect3DDevice8_EndScene(device);
ok(SUCCEEDED(hr), "EndScene failed %#x\n", hr);
test_format = GetPixelFormat(hdc);
- ok(test_format == format, "window has pixel format %d, expected %d\n", test_format, format);
+ todo_wine ok(test_format == format, "window has pixel format %d, expected %d\n", test_format, format);
hr = IDirect3DDevice8_Present(device, NULL, NULL, NULL, NULL);
ok(SUCCEEDED(hr), "Present failed %#x\n", hr);
test_format = GetPixelFormat(hdc);
- ok(test_format == format, "window has pixel format %d, expected %d\n", test_format, format);
+ todo_wine ok(test_format == format, "window has pixel format %d, expected %d\n", test_format, format);
if (hdc2)
{
@@ -5731,10 +5731,10 @@ static void test_pixel_format(void)
ok(SUCCEEDED(hr), "Present failed %#x\n", hr);
test_format = GetPixelFormat(hdc);
- ok(test_format == format, "window has pixel format %d, expected %d\n", test_format, format);
+ todo_wine ok(test_format == format, "window has pixel format %d, expected %d\n", test_format, format);
test_format = GetPixelFormat(hdc2);
- ok(test_format == format, "second window has pixel format %d, expected %d\n", test_format, format);
+ todo_wine ok(test_format == format, "second window has pixel format %d, expected %d\n", test_format, format);
}
cleanup:
--
2.1.0

View File

@ -0,0 +1,73 @@
From 6b755cbb559b7c0c4f055750a7c41bf72e17076c Mon Sep 17 00:00:00 2001
From: Ken Thomases <ken@codeweavers.com>
Date: Sun, 14 Sep 2014 19:47:41 -0500
Subject: d3d9: Mark tests which no longer pass due to reverts as todo_wine.
---
dlls/d3d9/tests/device.c | 16 ++++++++--------
1 file changed, 8 insertions(+), 8 deletions(-)
diff --git a/dlls/d3d9/tests/device.c b/dlls/d3d9/tests/device.c
index f3771d9..0faa501 100644
--- a/dlls/d3d9/tests/device.c
+++ b/dlls/d3d9/tests/device.c
@@ -8142,37 +8142,37 @@ static void test_pixel_format(void)
}
test_format = GetPixelFormat(hdc);
- ok(test_format == format, "window has pixel format %d, expected %d\n", test_format, format);
+ todo_wine ok(test_format == format, "window has pixel format %d, expected %d\n", test_format, format);
hr = IDirect3DDevice9_SetFVF(device, D3DFVF_XYZ);
ok(SUCCEEDED(hr), "Failed to set FVF, hr %#x.\n", hr);
test_format = GetPixelFormat(hdc);
- ok(test_format == format, "window has pixel format %d, expected %d\n", test_format, format);
+ todo_wine ok(test_format == format, "window has pixel format %d, expected %d\n", test_format, format);
hr = IDirect3DDevice9_BeginScene(device);
ok(SUCCEEDED(hr), "BeginScene failed %#x\n", hr);
test_format = GetPixelFormat(hdc);
- ok(test_format == format, "window has pixel format %d, expected %d\n", test_format, format);
+ todo_wine ok(test_format == format, "window has pixel format %d, expected %d\n", test_format, format);
hr = IDirect3DDevice9_DrawPrimitiveUP(device, D3DPT_POINTLIST, 1, point, 3 * sizeof(float));
ok(SUCCEEDED(hr), "Failed to draw, hr %#x.\n", hr);
test_format = GetPixelFormat(hdc);
- ok(test_format == format, "window has pixel format %d, expected %d\n", test_format, format);
+ todo_wine ok(test_format == format, "window has pixel format %d, expected %d\n", test_format, format);
hr = IDirect3DDevice9_EndScene(device);
ok(SUCCEEDED(hr), "EndScene failed %#x\n", hr);
test_format = GetPixelFormat(hdc);
- ok(test_format == format, "window has pixel format %d, expected %d\n", test_format, format);
+ todo_wine ok(test_format == format, "window has pixel format %d, expected %d\n", test_format, format);
hr = IDirect3DDevice9_Present(device, NULL, NULL, NULL, NULL);
ok(SUCCEEDED(hr), "Present failed %#x\n", hr);
test_format = GetPixelFormat(hdc);
- ok(test_format == format, "window has pixel format %d, expected %d\n", test_format, format);
+ todo_wine ok(test_format == format, "window has pixel format %d, expected %d\n", test_format, format);
if (hdc2)
{
@@ -8180,10 +8180,10 @@ static void test_pixel_format(void)
ok(SUCCEEDED(hr), "Present failed %#x\n", hr);
test_format = GetPixelFormat(hdc);
- ok(test_format == format, "window has pixel format %d, expected %d\n", test_format, format);
+ todo_wine ok(test_format == format, "window has pixel format %d, expected %d\n", test_format, format);
test_format = GetPixelFormat(hdc2);
- ok(test_format == format, "second window has pixel format %d, expected %d\n", test_format, format);
+ todo_wine ok(test_format == format, "second window has pixel format %d, expected %d\n", test_format, format);
}
cleanup:
--
2.1.0

View File

@ -0,0 +1,235 @@
From 8033154bf43433bebe38c792d12e32d65205261a Mon Sep 17 00:00:00 2001
From: Ken Thomases <ken@codeweavers.com>
Date: Sun, 14 Sep 2014 19:47:48 -0500
Subject: ddraw: Mark tests which no longer pass due to reverts as todo_wine.
---
dlls/ddraw/tests/ddraw1.c | 12 ++++++------
dlls/ddraw/tests/ddraw2.c | 12 ++++++------
dlls/ddraw/tests/ddraw4.c | 12 ++++++------
dlls/ddraw/tests/ddraw7.c | 12 ++++++------
4 files changed, 24 insertions(+), 24 deletions(-)
diff --git a/dlls/ddraw/tests/ddraw1.c b/dlls/ddraw/tests/ddraw1.c
index 4c35baa..a5d9687 100644
--- a/dlls/ddraw/tests/ddraw1.c
+++ b/dlls/ddraw/tests/ddraw1.c
@@ -4414,7 +4414,7 @@ static void test_pixel_format(void)
}
test_format = GetPixelFormat(hdc);
- ok(test_format == format, "window has pixel format %d, expected %d\n", test_format, format);
+ todo_wine ok(test_format == format, "window has pixel format %d, expected %d\n", test_format, format);
if (hdc2)
{
@@ -4424,7 +4424,7 @@ static void test_pixel_format(void)
ok(SUCCEEDED(hr), "Failed to set clipper window, hr %#x.\n", hr);
test_format = GetPixelFormat(hdc);
- ok(test_format == format, "window has pixel format %d, expected %d\n", test_format, format);
+ todo_wine ok(test_format == format, "window has pixel format %d, expected %d\n", test_format, format);
test_format = GetPixelFormat(hdc2);
ok(test_format == format, "second window has pixel format %d, expected %d\n", test_format, format);
@@ -4439,7 +4439,7 @@ static void test_pixel_format(void)
ok(SUCCEEDED(hr), "Failed to create surface, hr %#x.\n",hr);
test_format = GetPixelFormat(hdc);
- ok(test_format == format, "window has pixel format %d, expected %d\n", test_format, format);
+ todo_wine ok(test_format == format, "window has pixel format %d, expected %d\n", test_format, format);
if (hdc2)
{
@@ -4453,7 +4453,7 @@ static void test_pixel_format(void)
ok(SUCCEEDED(hr), "Failed to set clipper, hr %#x.\n", hr);
test_format = GetPixelFormat(hdc);
- ok(test_format == format, "window has pixel format %d, expected %d\n", test_format, format);
+ todo_wine ok(test_format == format, "window has pixel format %d, expected %d\n", test_format, format);
test_format = GetPixelFormat(hdc2);
ok(test_format == format, "second window has pixel format %d, expected %d\n", test_format, format);
@@ -4465,12 +4465,12 @@ static void test_pixel_format(void)
ok(SUCCEEDED(hr), "Failed to clear source surface, hr %#x.\n", hr);
test_format = GetPixelFormat(hdc);
- ok(test_format == format, "window has pixel format %d, expected %d\n", test_format, format);
+ todo_wine ok(test_format == format, "window has pixel format %d, expected %d\n", test_format, format);
if (hdc2)
{
test_format = GetPixelFormat(hdc2);
- ok(test_format == format, "second window has pixel format %d, expected %d\n", test_format, format);
+ todo_wine ok(test_format == format, "second window has pixel format %d, expected %d\n", test_format, format);
}
cleanup:
diff --git a/dlls/ddraw/tests/ddraw2.c b/dlls/ddraw/tests/ddraw2.c
index 750cc6e..3d06116 100644
--- a/dlls/ddraw/tests/ddraw2.c
+++ b/dlls/ddraw/tests/ddraw2.c
@@ -5490,7 +5490,7 @@ static void test_pixel_format(void)
}
test_format = GetPixelFormat(hdc);
- ok(test_format == format, "window has pixel format %d, expected %d\n", test_format, format);
+ todo_wine ok(test_format == format, "window has pixel format %d, expected %d\n", test_format, format);
if (hdc2)
{
@@ -5500,7 +5500,7 @@ static void test_pixel_format(void)
ok(SUCCEEDED(hr), "Failed to set clipper window, hr %#x.\n", hr);
test_format = GetPixelFormat(hdc);
- ok(test_format == format, "window has pixel format %d, expected %d\n", test_format, format);
+ todo_wine ok(test_format == format, "window has pixel format %d, expected %d\n", test_format, format);
test_format = GetPixelFormat(hdc2);
ok(test_format == format, "second window has pixel format %d, expected %d\n", test_format, format);
@@ -5515,7 +5515,7 @@ static void test_pixel_format(void)
ok(SUCCEEDED(hr), "Failed to create surface, hr %#x.\n",hr);
test_format = GetPixelFormat(hdc);
- ok(test_format == format, "window has pixel format %d, expected %d\n", test_format, format);
+ todo_wine ok(test_format == format, "window has pixel format %d, expected %d\n", test_format, format);
if (hdc2)
{
@@ -5529,7 +5529,7 @@ static void test_pixel_format(void)
ok(SUCCEEDED(hr), "Failed to set clipper, hr %#x.\n", hr);
test_format = GetPixelFormat(hdc);
- ok(test_format == format, "window has pixel format %d, expected %d\n", test_format, format);
+ todo_wine ok(test_format == format, "window has pixel format %d, expected %d\n", test_format, format);
test_format = GetPixelFormat(hdc2);
ok(test_format == format, "second window has pixel format %d, expected %d\n", test_format, format);
@@ -5541,12 +5541,12 @@ static void test_pixel_format(void)
ok(SUCCEEDED(hr), "Failed to clear source surface, hr %#x.\n", hr);
test_format = GetPixelFormat(hdc);
- ok(test_format == format, "window has pixel format %d, expected %d\n", test_format, format);
+ todo_wine ok(test_format == format, "window has pixel format %d, expected %d\n", test_format, format);
if (hdc2)
{
test_format = GetPixelFormat(hdc2);
- ok(test_format == format, "second window has pixel format %d, expected %d\n", test_format, format);
+ todo_wine ok(test_format == format, "second window has pixel format %d, expected %d\n", test_format, format);
}
cleanup:
diff --git a/dlls/ddraw/tests/ddraw4.c b/dlls/ddraw/tests/ddraw4.c
index 8776dec..706345b 100644
--- a/dlls/ddraw/tests/ddraw4.c
+++ b/dlls/ddraw/tests/ddraw4.c
@@ -6475,7 +6475,7 @@ static void test_pixel_format(void)
}
test_format = GetPixelFormat(hdc);
- ok(test_format == format, "window has pixel format %d, expected %d\n", test_format, format);
+ todo_wine ok(test_format == format, "window has pixel format %d, expected %d\n", test_format, format);
if (hdc2)
{
@@ -6485,7 +6485,7 @@ static void test_pixel_format(void)
ok(SUCCEEDED(hr), "Failed to set clipper window, hr %#x.\n", hr);
test_format = GetPixelFormat(hdc);
- ok(test_format == format, "window has pixel format %d, expected %d\n", test_format, format);
+ todo_wine ok(test_format == format, "window has pixel format %d, expected %d\n", test_format, format);
test_format = GetPixelFormat(hdc2);
ok(test_format == format, "second window has pixel format %d, expected %d\n", test_format, format);
@@ -6500,7 +6500,7 @@ static void test_pixel_format(void)
ok(SUCCEEDED(hr), "Failed to create surface, hr %#x.\n",hr);
test_format = GetPixelFormat(hdc);
- ok(test_format == format, "window has pixel format %d, expected %d\n", test_format, format);
+ todo_wine ok(test_format == format, "window has pixel format %d, expected %d\n", test_format, format);
if (hdc2)
{
@@ -6514,7 +6514,7 @@ static void test_pixel_format(void)
ok(SUCCEEDED(hr), "Failed to set clipper, hr %#x.\n", hr);
test_format = GetPixelFormat(hdc);
- ok(test_format == format, "window has pixel format %d, expected %d\n", test_format, format);
+ todo_wine ok(test_format == format, "window has pixel format %d, expected %d\n", test_format, format);
test_format = GetPixelFormat(hdc2);
ok(test_format == format, "second window has pixel format %d, expected %d\n", test_format, format);
@@ -6526,12 +6526,12 @@ static void test_pixel_format(void)
ok(SUCCEEDED(hr), "Failed to clear source surface, hr %#x.\n", hr);
test_format = GetPixelFormat(hdc);
- ok(test_format == format, "window has pixel format %d, expected %d\n", test_format, format);
+ todo_wine ok(test_format == format, "window has pixel format %d, expected %d\n", test_format, format);
if (hdc2)
{
test_format = GetPixelFormat(hdc2);
- ok(test_format == format, "second window has pixel format %d, expected %d\n", test_format, format);
+ todo_wine ok(test_format == format, "second window has pixel format %d, expected %d\n", test_format, format);
}
cleanup:
diff --git a/dlls/ddraw/tests/ddraw7.c b/dlls/ddraw/tests/ddraw7.c
index 5e88b33..160ba5b 100644
--- a/dlls/ddraw/tests/ddraw7.c
+++ b/dlls/ddraw/tests/ddraw7.c
@@ -6298,7 +6298,7 @@ static void test_pixel_format(void)
}
test_format = GetPixelFormat(hdc);
- ok(test_format == format, "window has pixel format %d, expected %d\n", test_format, format);
+ todo_wine ok(test_format == format, "window has pixel format %d, expected %d\n", test_format, format);
if (hdc2)
{
@@ -6308,7 +6308,7 @@ static void test_pixel_format(void)
ok(SUCCEEDED(hr), "Failed to set clipper window, hr %#x.\n", hr);
test_format = GetPixelFormat(hdc);
- ok(test_format == format, "window has pixel format %d, expected %d\n", test_format, format);
+ todo_wine ok(test_format == format, "window has pixel format %d, expected %d\n", test_format, format);
test_format = GetPixelFormat(hdc2);
ok(test_format == format, "second window has pixel format %d, expected %d\n", test_format, format);
@@ -6323,7 +6323,7 @@ static void test_pixel_format(void)
ok(SUCCEEDED(hr), "Failed to create surface, hr %#x.\n",hr);
test_format = GetPixelFormat(hdc);
- ok(test_format == format, "window has pixel format %d, expected %d\n", test_format, format);
+ todo_wine ok(test_format == format, "window has pixel format %d, expected %d\n", test_format, format);
if (hdc2)
{
@@ -6337,7 +6337,7 @@ static void test_pixel_format(void)
ok(SUCCEEDED(hr), "Failed to set clipper, hr %#x.\n", hr);
test_format = GetPixelFormat(hdc);
- ok(test_format == format, "window has pixel format %d, expected %d\n", test_format, format);
+ todo_wine ok(test_format == format, "window has pixel format %d, expected %d\n", test_format, format);
test_format = GetPixelFormat(hdc2);
ok(test_format == format, "second window has pixel format %d, expected %d\n", test_format, format);
@@ -6349,12 +6349,12 @@ static void test_pixel_format(void)
ok(SUCCEEDED(hr), "Failed to clear source surface, hr %#x.\n", hr);
test_format = GetPixelFormat(hdc);
- ok(test_format == format, "window has pixel format %d, expected %d\n", test_format, format);
+ todo_wine ok(test_format == format, "window has pixel format %d, expected %d\n", test_format, format);
if (hdc2)
{
test_format = GetPixelFormat(hdc2);
- ok(test_format == format, "second window has pixel format %d, expected %d\n", test_format, format);
+ todo_wine ok(test_format == format, "second window has pixel format %d, expected %d\n", test_format, format);
}
cleanup:
--
2.1.0

View File

@ -0,0 +1,8 @@
Author: Ken Thomases
Subject: Revert wined3d pixelformat changes.
Revision: 1
Fixes: [35655] Fix wined3d performance drop introduced by pixelformat changes.
Fixes: [35718] Fix flickering introduced by pixelformat changes.
Fixes: [35950] Fix black screen on startup introduced by pixelformat changes.
Fixes: [35975] Fix gray screen on startup introduced by pixelformat changes.
Fixes: [36900] Fix missing video introduced by pixelformat changes.