-
Notifications
You must be signed in to change notification settings - Fork 1
/
WS9Wine1.7.11-noflicker-verbeet.diff
executable file
·93 lines (85 loc) · 4.5 KB
/
WS9Wine1.7.11-noflicker-verbeet.diff
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
diff --git a/dlls/wined3d/context.c b/dlls/wined3d/context.c
index 587613c..c617c75 100644
--- a/dlls/wined3d/context.c
+++ b/dlls/wined3d/context.c
@@ -1106,8 +1106,8 @@ void context_invalidate_state(struct wined3d_context *context, DWORD state)
}
/* This function takes care of wined3d pixel format selection. */
-static int context_choose_pixel_format(const struct wined3d_device *device, HDC hdc,
- const struct wined3d_format *color_format, const struct wined3d_format *ds_format,
+static int context_choose_pixel_format(const struct wined3d_device *device, const struct wined3d_swapchain *swapchain,
+ HDC hdc, const struct wined3d_format *color_format, const struct wined3d_format *ds_format,
BOOL auxBuffers, BOOL findCompatible)
{
int iPixelFormat=0;
@@ -1115,6 +1115,7 @@ static int context_choose_pixel_format(const struct wined3d_device *device, HDC
BYTE depthBits=0, stencilBits=0;
unsigned int current_value;
unsigned int cfg_count = device->adapter->cfg_count;
+ BOOL double_buffer = TRUE;
unsigned int i;
TRACE("device %p, dc %p, color_format %s, ds_format %s, aux_buffers %#x, find_compatible %#x.\n",
@@ -1128,6 +1129,9 @@ static int context_choose_pixel_format(const struct wined3d_device *device, HDC
return 0;
}
+ if (wined3d_settings.offscreen_rendering_mode == ORM_FBO && !swapchain->desc.backbuffer_count)
+ double_buffer = FALSE;
+
getDepthStencilBits(ds_format, &depthBits, &stencilBits);
current_value = 0;
@@ -1141,7 +1145,7 @@ static int context_choose_pixel_format(const struct wined3d_device *device, HDC
if (cfg->iPixelType != WGL_TYPE_RGBA_ARB)
continue;
/* In window mode we need a window drawable format and double buffering. */
- if (!(cfg->windowDrawable && cfg->doubleBuffer))
+ if (!cfg->windowDrawable || (double_buffer && !cfg->doubleBuffer))
continue;
if (cfg->redSize < redBits)
continue;
@@ -1164,17 +1168,19 @@ static int context_choose_pixel_format(const struct wined3d_device *device, HDC
* depth it is no problem to emulate 16-bit using e.g. 24-bit, so accept that. */
if (cfg->depthSize == depthBits)
value += 1;
- if (cfg->stencilSize == stencilBits)
+ if (!cfg->doubleBuffer == !double_buffer)
value += 2;
- if (cfg->alphaSize == alphaBits)
+ if (cfg->stencilSize == stencilBits)
value += 4;
+ if (cfg->alphaSize == alphaBits)
+ value += 8;
/* We like to have aux buffers in backbuffer mode */
if (auxBuffers && cfg->auxBuffers)
- value += 8;
+ value += 16;
if (cfg->redSize == redBits
&& cfg->greenSize == greenBits
&& cfg->blueSize == blueBits)
- value += 16;
+ value += 32;
if (value > current_value)
{
@@ -1195,7 +1201,9 @@ static int context_choose_pixel_format(const struct wined3d_device *device, HDC
ZeroMemory(&pfd, sizeof(pfd));
pfd.nSize = sizeof(pfd);
pfd.nVersion = 1;
- pfd.dwFlags = PFD_SUPPORT_OPENGL | PFD_DOUBLEBUFFER | PFD_DRAW_TO_WINDOW;/*PFD_GENERIC_ACCELERATED*/
+ pfd.dwFlags = PFD_SUPPORT_OPENGL | PFD_DRAW_TO_WINDOW;/*PFD_GENERIC_ACCELERATED*/
+ if (double_buffer)
+ pfd.dwFlags |= PFD_DOUBLEBUFFER;
pfd.iPixelType = PFD_TYPE_RGBA;
pfd.cAlphaBits = alphaBits;
pfd.cColorBits = colorBits;
@@ -1386,13 +1394,13 @@ struct wined3d_context *context_create(struct wined3d_swapchain *swapchain,
color_format = wined3d_get_format(gl_info, WINED3DFMT_B8G8R8A8_UNORM);
/* Try to find a pixel format which matches our requirements. */
- pixel_format = context_choose_pixel_format(device, hdc, color_format, ds_format, auxBuffers, FALSE);
+ pixel_format = context_choose_pixel_format(device, swapchain, hdc, color_format, ds_format, auxBuffers, FALSE);
/* Try to locate a compatible format if we weren't able to find anything. */
if (!pixel_format)
{
TRACE("Trying to locate a compatible pixel format because an exact match failed.\n");
- pixel_format = context_choose_pixel_format(device, hdc, color_format, ds_format, auxBuffers, TRUE);
+ pixel_format = context_choose_pixel_format(device, swapchain, hdc, color_format, ds_format, auxBuffers, TRUE);
}
/* If we still don't have a pixel format, something is very wrong as ChoosePixelFormat barely fails */