Module: wine
Branch: master
Commit: a38e5a95efb28757de812b68359c23a9125d1310
URL: http://source.winehq.org/git/wine.git/?a=commit;h=a38e5a95efb28757de812b683…
Author: Roderick Colenbrander <thunderbird2k(a)gmx.net>
Date: Sun Apr 27 17:42:48 2008 +0000
wined3d: Let WineD3D_ChoosePixelFormat operate on the pixel format database we store at WineD3D startup.
---
dlls/wined3d/context.c | 111 ++++++++++++++++++++++++++++++------------------
1 files changed, 69 insertions(+), 42 deletions(-)
diff --git a/dlls/wined3d/context.c b/dlls/wined3d/context.c
index 79ea74c..901a36c 100644
--- a/dlls/wined3d/context.c
+++ b/dlls/wined3d/context.c
@@ -113,65 +113,91 @@ static WineD3DContext *AddContextToArray(IWineD3DDeviceImpl *This, HWND win_hand
/* This function takes care of WineD3D pixel format selection. */
static int WineD3D_ChoosePixelFormat(IWineD3DDeviceImpl *This, HDC hdc, WINED3DFORMAT ColorFormat, WINED3DFORMAT DepthStencilFormat, BOOL auxBuffers, BOOL pbuffer, BOOL findCompatible)
{
- int iPixelFormat = 0;
- int attribs[256];
- int nAttribs = 0;
- unsigned int nFormats;
+ int iPixelFormat=0;
short redBits, greenBits, blueBits, alphaBits, colorBits;
short depthBits=0, stencilBits=0;
- BOOL result = FALSE;
-#define PUSH1(att) attribs[nAttribs++] = (att);
-#define PUSH2(att,value) attribs[nAttribs++] = (att); attribs[nAttribs++] = (value);
+ int i = 0;
+ int nCfgs = This->adapter->nCfgs;
+ WineD3D_PixelFormat *cfgs = This->adapter->cfgs;
- if(getColorBits(ColorFormat, &redBits, &greenBits, &blueBits, &alphaBits, &colorBits)) {
- PUSH2(WGL_COLOR_BITS_ARB, colorBits);
- PUSH2(WGL_RED_BITS_ARB, redBits);
- PUSH2(WGL_GREEN_BITS_ARB, greenBits);
- PUSH2(WGL_BLUE_BITS_ARB, blueBits);
- PUSH2(WGL_ALPHA_BITS_ARB, alphaBits);
- } else {
+ if(!getColorBits(ColorFormat, &redBits, &greenBits, &blueBits, &alphaBits, &colorBits)) {
ERR("Unable to get color bits for format %s (%#x)!\n", debug_d3dformat(ColorFormat), ColorFormat);
return 0;
}
- /* Request depth/stencil when we need it */
- if(DepthStencilFormat && getDepthStencilBits(DepthStencilFormat, &depthBits, &stencilBits)) {
- PUSH2(WGL_DEPTH_BITS_ARB, depthBits);
- PUSH2(WGL_STENCIL_BITS_ARB, stencilBits);
+ if(DepthStencilFormat) {
+ getDepthStencilBits(DepthStencilFormat, &depthBits, &stencilBits);
}
- PUSH2(WGL_PIXEL_TYPE_ARB, WGL_TYPE_RGBA_ARB); /* Make sure we don't get a float or color index format */
- PUSH2(WGL_SUPPORT_OPENGL_ARB, GL_TRUE);
- PUSH2(WGL_ACCELERATION_ARB, WGL_FULL_ACCELERATION_ARB); /* Make sure we receive an accelerated format. On windows (at least on ATI) this is not always the case */
-
- if(auxBuffers) {
- TRACE("Requesting 2 aux buffers\n");
- /* We like to have two aux buffers in backbuffer mode */
- PUSH2(WGL_AUX_BUFFERS_ARB, 2);
+ /* Find a pixel format which EXACTLY matches our requirements (except for depth) */
+ for(i=0; i<nCfgs; i++) {
+ BOOL exactDepthMatch = TRUE;
+
+ /* For now only accept RGBA formats. Perhaps some day we will
+ * allow floating point formats for pbuffers. */
+ if(cfgs->iPixelType != WGL_TYPE_RGBA_ARB)
+ continue;
+
+ /* In all cases except when we are in pbuffer-mode we need a window drawable format with double buffering. */
+ if(!pbuffer && !cfgs->windowDrawable && !cfgs->doubleBuffer)
+ continue;
+
+ /* We like to have aux buffers in backbuffer mode */
+ if(auxBuffers && !cfgs->auxBuffers)
+ continue;
+
+ /* In pbuffer-mode we need a pbuffer-capable format */
+ if(pbuffer && !cfgs->pbufferDrawable)
+ continue;
+
+ if(cfgs->redSize != redBits)
+ continue;
+ if(cfgs->greenSize != greenBits)
+ continue;
+ if(cfgs->blueSize != blueBits)
+ continue;
+ if(cfgs->alphaSize != alphaBits)
+ continue;
+
+ /* We try to locate a format which matches our requirements exactly. In case of
+ * depth it is no problem to emulate 16-bit using e.g. 24-bit, so accept that. */
+ if(cfgs->depthSize < depthBits)
+ continue;
+ else if(cfgs->depthSize > depthBits)
+ exactDepthMatch = FALSE;
+
+ /* In all cases make sure the number of stencil bits matches our requirements
+ * even when we don't need stencil because it could affect performance */
+ if(!(cfgs->stencilSize == stencilBits))
+ continue;
+
+ /* When we have passed all the checks then we have found a format which matches our
+ * requirements. Note that we only check for a limit number of capabilities right now,
+ * so there can easily be a dozen of pixel formats which appear to be the 'same' but
+ * can still differ in things like multisampling, stereo, SRGB and other flags.
+ */
- PUSH2(WGL_DRAW_TO_WINDOW_ARB, GL_TRUE); /* We want to draw to a window */
- PUSH2(WGL_DOUBLE_BUFFER_ARB, GL_TRUE);
- } else if(pbuffer) {
- PUSH2(WGL_DRAW_TO_PBUFFER_ARB, GL_TRUE); /* We need pbuffer support; doublebuffering isn't needed */
- } else {
- PUSH2(WGL_DRAW_TO_WINDOW_ARB, GL_TRUE); /* We want to draw to a window */
- PUSH2(WGL_DOUBLE_BUFFER_ARB, GL_TRUE);
+ /* Exit the loop as we have found a format :) */
+ if(exactDepthMatch) {
+ iPixelFormat = cfgs->iPixelFormat;
+ break;
+ } else if(!iPixelFormat) {
+ /* In the end we might end up with a format which doesn't exactly match our depth
+ * requirements. Accept the first format we found because formats with higher iPixelFormat
+ * values tend to have more extended capabilities (e.g. multisampling) which we don't need. */
+ iPixelFormat = cfgs->iPixelFormat;
+ }
}
- PUSH1(0); /* end the list */
-
-#undef PUSH1
-#undef PUSH2
-
- result = GL_EXTCALL(wglChoosePixelFormatARB(hdc, (const int*)&attribs, NULL, 1, &iPixelFormat, &nFormats));
- if(!result && !findCompatible) {
+ /* When findCompatible is set and no suitable format was found, let ChoosePixelFormat choose a pixel format in order not to crash. */
+ if(!iPixelFormat && !findCompatible) {
ERR("Can't find a suitable iPixelFormat\n");
return FALSE;
} else {
PIXELFORMATDESCRIPTOR pfd;
- TRACE("Falling back to ChoosePixelFormat as wglChoosePixelFormatARB failed\n");
+ TRACE("Falling back to ChoosePixelFormat as we weren't able to find an exactly matching pixel format\n");
/* PixelFormat selection */
ZeroMemory(&pfd, sizeof(pfd));
pfd.nSize = sizeof(pfd);
@@ -192,6 +218,7 @@ static int WineD3D_ChoosePixelFormat(IWineD3DDeviceImpl *This, HDC hdc, WINED3DF
}
}
+ TRACE("Found iPixelFormat=%d for ColorFormat=%s, DepthStencilFormat=%s\n", cfgs->iPixelFormat, debug_d3dformat(ColorFormat), debug_d3dformat(DepthStencilFormat));
return iPixelFormat;
}
Module: wine
Branch: master
Commit: ec5400b4f815da9215e11f11a43857f44ef0f313
URL: http://source.winehq.org/git/wine.git/?a=commit;h=ec5400b4f815da9215e11f11a…
Author: Roderick Colenbrander <thunderbird2k(a)gmx.net>
Date: Sun Apr 27 17:35:27 2008 +0000
wined3d: Split WGL pixel format selection code off from CreateContext.
---
dlls/wined3d/context.c | 162 +++++++++++++++++++++++++++++++-----------------
1 files changed, 106 insertions(+), 56 deletions(-)
diff --git a/dlls/wined3d/context.c b/dlls/wined3d/context.c
index 1fb65ae..79ea74c 100644
--- a/dlls/wined3d/context.c
+++ b/dlls/wined3d/context.c
@@ -110,6 +110,91 @@ static WineD3DContext *AddContextToArray(IWineD3DDeviceImpl *This, HWND win_hand
return This->contexts[This->numContexts - 1];
}
+/* This function takes care of WineD3D pixel format selection. */
+static int WineD3D_ChoosePixelFormat(IWineD3DDeviceImpl *This, HDC hdc, WINED3DFORMAT ColorFormat, WINED3DFORMAT DepthStencilFormat, BOOL auxBuffers, BOOL pbuffer, BOOL findCompatible)
+{
+ int iPixelFormat = 0;
+ int attribs[256];
+ int nAttribs = 0;
+ unsigned int nFormats;
+ short redBits, greenBits, blueBits, alphaBits, colorBits;
+ short depthBits=0, stencilBits=0;
+ BOOL result = FALSE;
+
+#define PUSH1(att) attribs[nAttribs++] = (att);
+#define PUSH2(att,value) attribs[nAttribs++] = (att); attribs[nAttribs++] = (value);
+
+ if(getColorBits(ColorFormat, &redBits, &greenBits, &blueBits, &alphaBits, &colorBits)) {
+ PUSH2(WGL_COLOR_BITS_ARB, colorBits);
+ PUSH2(WGL_RED_BITS_ARB, redBits);
+ PUSH2(WGL_GREEN_BITS_ARB, greenBits);
+ PUSH2(WGL_BLUE_BITS_ARB, blueBits);
+ PUSH2(WGL_ALPHA_BITS_ARB, alphaBits);
+ } else {
+ ERR("Unable to get color bits for format %s (%#x)!\n", debug_d3dformat(ColorFormat), ColorFormat);
+ return 0;
+ }
+
+ /* Request depth/stencil when we need it */
+ if(DepthStencilFormat && getDepthStencilBits(DepthStencilFormat, &depthBits, &stencilBits)) {
+ PUSH2(WGL_DEPTH_BITS_ARB, depthBits);
+ PUSH2(WGL_STENCIL_BITS_ARB, stencilBits);
+ }
+
+ PUSH2(WGL_PIXEL_TYPE_ARB, WGL_TYPE_RGBA_ARB); /* Make sure we don't get a float or color index format */
+ PUSH2(WGL_SUPPORT_OPENGL_ARB, GL_TRUE);
+ PUSH2(WGL_ACCELERATION_ARB, WGL_FULL_ACCELERATION_ARB); /* Make sure we receive an accelerated format. On windows (at least on ATI) this is not always the case */
+
+ if(auxBuffers) {
+ TRACE("Requesting 2 aux buffers\n");
+ /* We like to have two aux buffers in backbuffer mode */
+ PUSH2(WGL_AUX_BUFFERS_ARB, 2);
+
+ PUSH2(WGL_DRAW_TO_WINDOW_ARB, GL_TRUE); /* We want to draw to a window */
+ PUSH2(WGL_DOUBLE_BUFFER_ARB, GL_TRUE);
+ } else if(pbuffer) {
+ PUSH2(WGL_DRAW_TO_PBUFFER_ARB, GL_TRUE); /* We need pbuffer support; doublebuffering isn't needed */
+ } else {
+ PUSH2(WGL_DRAW_TO_WINDOW_ARB, GL_TRUE); /* We want to draw to a window */
+ PUSH2(WGL_DOUBLE_BUFFER_ARB, GL_TRUE);
+ }
+
+ PUSH1(0); /* end the list */
+
+#undef PUSH1
+#undef PUSH2
+
+ result = GL_EXTCALL(wglChoosePixelFormatARB(hdc, (const int*)&attribs, NULL, 1, &iPixelFormat, &nFormats));
+ if(!result && !findCompatible) {
+ ERR("Can't find a suitable iPixelFormat\n");
+ return FALSE;
+ } else {
+ PIXELFORMATDESCRIPTOR pfd;
+
+ TRACE("Falling back to ChoosePixelFormat as wglChoosePixelFormatARB failed\n");
+ /* PixelFormat selection */
+ 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.iPixelType = PFD_TYPE_RGBA;
+ pfd.cAlphaBits = alphaBits;
+ pfd.cColorBits = colorBits;
+ pfd.cDepthBits = depthBits;
+ pfd.cStencilBits = stencilBits;
+ pfd.iLayerType = PFD_MAIN_PLANE;
+
+ iPixelFormat = ChoosePixelFormat(hdc, &pfd);
+ if(!iPixelFormat) {
+ /* If this happens something is very wrong as ChoosePixelFormat barely fails */
+ ERR("Can't find a suitable iPixelFormat\n");
+ return FALSE;
+ }
+ }
+
+ return iPixelFormat;
+}
+
/*****************************************************************************
* CreateContext
*
@@ -205,13 +290,10 @@ WineD3DContext *CreateContext(IWineD3DDeviceImpl *This, IWineD3DSurfaceImpl *tar
} else {
PIXELFORMATDESCRIPTOR pfd;
int iPixelFormat;
- short redBits, greenBits, blueBits, alphaBits, colorBits;
- short depthBits=0, stencilBits=0;
int res;
- int attribs[256];
- int nAttribs = 0;
- unsigned int nFormats;
- WINED3DFORMAT fmt = target->resource.format;
+ WINED3DFORMAT ColorFormat = target->resource.format;
+ WINED3DFORMAT DepthStencilFormat = 0;
+ BOOL auxBuffers = FALSE;
hdc = GetDC(win_handle);
if(hdc == NULL) {
@@ -219,76 +301,44 @@ WineD3DContext *CreateContext(IWineD3DDeviceImpl *This, IWineD3DSurfaceImpl *tar
goto out;
}
- /* PixelFormat selection */
- PUSH2(WGL_DRAW_TO_WINDOW_ARB, GL_TRUE); /* We want to draw to a window */
- PUSH2(WGL_DOUBLE_BUFFER_ARB, GL_TRUE);
- PUSH2(WGL_PIXEL_TYPE_ARB, WGL_TYPE_RGBA_ARB); /* Make sure we don't get a float or color index format */
- PUSH2(WGL_SUPPORT_OPENGL_ARB, GL_TRUE);
- PUSH2(WGL_ACCELERATION_ARB, WGL_FULL_ACCELERATION_ARB); /* Make sure we receive an accelerated format. On windows (at least on ATI) this is not always the case */
-
/* In case of ORM_BACKBUFFER, make sure to request an alpha component for X4R4G4B4/X8R8G8B8 as we might need it for the backbuffer. */
if(wined3d_settings.offscreen_rendering_mode == ORM_BACKBUFFER) {
+ auxBuffers = TRUE;
+
if(target->resource.format == WINED3DFMT_X4R4G4B4)
- fmt = WINED3DFMT_A4R4G4B4;
+ ColorFormat = WINED3DFMT_A4R4G4B4;
else if(target->resource.format == WINED3DFMT_X8R8G8B8)
- fmt = WINED3DFMT_A8R8G8B8;
-
- /* We like to have two aux buffers in backbuffer mode */
- PUSH2(WGL_AUX_BUFFERS_ARB, 2);
+ ColorFormat = WINED3DFMT_A8R8G8B8;
}
/* DirectDraw supports 8bit paletted render targets and these are used by old games like Starcraft and C&C.
* Most modern hardware doesn't support 8bit natively so we perform some form of 8bit -> 32bit conversion.
* The conversion (ab)uses the alpha component for storing the palette index. For this reason we require
* a format with 8bit alpha, so request A8R8G8B8. */
- if(fmt == WINED3DFMT_P8)
- fmt = WINED3DFMT_A8R8G8B8;
-
- if(!getColorBits(fmt, &redBits, &greenBits, &blueBits, &alphaBits, &colorBits)) {
- ERR("Unable to get color bits for format %#x!\n", target->resource.format);
- return FALSE;
- }
- PUSH2(WGL_COLOR_BITS_ARB, colorBits);
- PUSH2(WGL_RED_BITS_ARB, redBits);
- PUSH2(WGL_GREEN_BITS_ARB, greenBits);
- PUSH2(WGL_BLUE_BITS_ARB, blueBits);
- PUSH2(WGL_ALPHA_BITS_ARB, alphaBits);
+ if(ColorFormat == WINED3DFMT_P8)
+ ColorFormat = WINED3DFMT_A8R8G8B8;
/* Retrieve the depth stencil format from the present parameters.
* The choice of the proper format can give a nice performance boost
* in case of GPU limited programs. */
if(pPresentParms->EnableAutoDepthStencil) {
TRACE("pPresentParms->EnableAutoDepthStencil=enabled; using AutoDepthStencilFormat=%s\n", debug_d3dformat(pPresentParms->AutoDepthStencilFormat));
- if(!getDepthStencilBits(pPresentParms->AutoDepthStencilFormat, &depthBits, &stencilBits)) {
- ERR("Unable to get depth / stencil bits for AutoDepthStencilFormat %#x!\n", pPresentParms->AutoDepthStencilFormat);
- return FALSE;
- }
- PUSH2(WGL_DEPTH_BITS_ARB, depthBits);
- PUSH2(WGL_STENCIL_BITS_ARB, stencilBits);
+ DepthStencilFormat = pPresentParms->AutoDepthStencilFormat;
}
- PUSH1(0); /* end the list */
+ /* Try to find a pixel format which matches our requirements */
+ iPixelFormat = WineD3D_ChoosePixelFormat(This, hdc, ColorFormat, DepthStencilFormat, auxBuffers, FALSE /* PBUFFER */, FALSE /* findCompatible */);
- /* In case of failure hope that standard ChoosePixelFormat will find something suitable */
- if(!GL_EXTCALL(wglChoosePixelFormatARB(hdc, (const int*)&attribs, NULL, 1, &iPixelFormat, &nFormats)))
- {
- /* PixelFormat selection */
- 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.iPixelType = PFD_TYPE_RGBA;
- pfd.cAlphaBits = alphaBits;
- pfd.cColorBits = colorBits;
- pfd.cDepthBits = depthBits;
- pfd.cStencilBits = stencilBits;
- pfd.iLayerType = PFD_MAIN_PLANE;
+ /* Try to locate a compatible format if we weren't able to find anything */
+ if(!iPixelFormat) {
+ TRACE("Trying to locate a compatible pixel format because an exact match failed.\n");
+ iPixelFormat = WineD3D_ChoosePixelFormat(This, hdc, ColorFormat, DepthStencilFormat, auxBuffers, FALSE /* PBUFFER */, TRUE /* findCompatible */ );
+ }
- iPixelFormat = ChoosePixelFormat(hdc, &pfd);
- if(!iPixelFormat) {
- /* If this happens something is very wrong as ChoosePixelFormat barely fails */
- ERR("Can't find a suitable iPixelFormat\n");
- }
+ /* If we still don't have a pixel format, something is very wrong as ChoosePixelFormat barely fails */
+ if(!iPixelFormat) {
+ ERR("Can't find a suitable iPixelFormat\n");
+ return FALSE;
}
DescribePixelFormat(hdc, iPixelFormat, sizeof(pfd), &pfd);
Module: website
Branch: master
Commit: 8f7a007c4c4fba1e03c5ca19904507b9e97bcb2f
URL: http://source.winehq.org/git/website.git/?a=commit;h=8f7a007c4c4fba1e03c5ca…
Author: Austin English <austinenglish(a)gmail.com>
Date: Wed Apr 23 18:33:09 2008 -0500
download.template: Update Mandriva download info (try 2)
------=_Part_5172_25697671.1208993589752
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
Content-Disposition: inline
First one had a typo. See bug 12661.
First one had a typo. See bug 12661.<br>
>From f7421b7fc6dcb726879080dc8adf28ccde625ef8 Mon Sep 17 00:00:00 2001
From: Austin English <austinenglish(a)gmail.com>
Date: Sun, 20 Apr 2008 22:21:53 -0500
Subject: [PATCH] download.template: update Mandriva download info
---
templates/en/download.template | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/templates/en/download.template b/templates/en/download.template
index d0bbd9a..4fdcb9d 100644
--- a/templates/en/download.template
+++ b/templates/en/download.template
@@ -50,8 +50,8 @@ for post-installation instructions.</b></p>
<img src="{$root}/images/distro/mandriva.png" width="50" height="50" alt="Mandriva Linux" border="0"></a>
</td>
<td> <b><a href="http://sourceforge.net/project/showfiles.php?group_id=6241&package_id=8…">Mandriva</a></b>
- binary .rpms for Mandriva Linux 2006 and 2007. Download the 2007.1 package if your Mandriva is a 2007.1
- release, eg. 2007 Spring. Download the 2007.0 package if your Mandriva is the first 2007 release.</td>
+ binary .rpms for Mandriva Linux 2006, 2007, and 2008. Download the 2008.1 package if your Mandriva is a 2008.1
+ release, eg. 2008 Spring. Download the 2008.0 package if your Mandriva is the first 2008 release.</td>
<td><a href="mailto:marco@mandrivaclub.nl">Marco Meijer</a></td>
</tr>
Module: wine
Branch: master
Commit: 21cd6865c839c85b5a7d0813373426eff6f18384
URL: http://source.winehq.org/git/wine.git/?a=commit;h=21cd6865c839c85b5a7d08133…
Author: Rob Shearman <rob(a)codeweavers.com>
Date: Fri Apr 25 10:58:24 2008 +0100
widl: Rename pident to declarator and parse the array declarations as part of declarators.
This allows arrays to be used in typedefs and const statements.
---
tools/widl/parser.y | 129 ++++++++++++++++++++++++------------------------
tools/widl/widltypes.h | 7 ++-
2 files changed, 68 insertions(+), 68 deletions(-)
Diff: http://source.winehq.org/git/wine.git/?a=commitdiff;h=21cd6865c839c85b5a7d0…