Roderick Colenbrander : wined3d: Add a registry key to allow/ disallow multisampling.
Alexandre Julliard
julliard at winehq.org
Tue Jun 3 04:52:21 CDT 2008
Module: wine
Branch: master
Commit: 042d0394dcc56da3bc496941aec05b0b82f1b71d
URL: http://source.winehq.org/git/wine.git/?a=commit;h=042d0394dcc56da3bc496941aec05b0b82f1b71d
Author: Roderick Colenbrander <thunderbird2k at gmx.net>
Date: Mon Jun 2 21:06:01 2008 +0000
wined3d: Add a registry key to allow/disallow multisampling.
Right now it is set to disabled due to an Nvidia GLXBadDrawable
bug. Second there is some issue (driver bug too?) in FBO mode.
---
dlls/wined3d/directx.c | 6 ++++++
dlls/wined3d/wined3d_main.c | 11 ++++++++++-
dlls/wined3d/wined3d_private.h | 1 +
3 files changed, 17 insertions(+), 1 deletions(-)
diff --git a/dlls/wined3d/directx.c b/dlls/wined3d/directx.c
index 32f7323..51013eb 100644
--- a/dlls/wined3d/directx.c
+++ b/dlls/wined3d/directx.c
@@ -1775,6 +1775,12 @@ static HRESULT WINAPI IWineD3DImpl_CheckDeviceMultiSampleType(IWineD3D *iface, U
if (WINED3DMULTISAMPLE_NONE == MultiSampleType) return WINED3D_OK;
+ /* By default multisampling is disabled right now as it causes issues
+ * on some Nvidia driver versions and it doesn't work well in combination
+ * with FBOs yet. */
+ if(!wined3d_settings.allow_multisampling)
+ return WINED3DERR_NOTAVAILABLE;
+
desc = getFormatDescEntry(SurfaceFormat, &Adapters[Adapter].gl_info, &glDesc);
if(!desc || !glDesc) {
return WINED3DERR_INVALIDCALL;
diff --git a/dlls/wined3d/wined3d_main.c b/dlls/wined3d/wined3d_main.c
index fe2c4fd..27de876 100644
--- a/dlls/wined3d/wined3d_main.c
+++ b/dlls/wined3d/wined3d_main.c
@@ -44,7 +44,8 @@ wined3d_settings_t wined3d_settings =
ORM_BACKBUFFER, /* Use the backbuffer to do offscreen rendering */
RTL_AUTO, /* Automatically determine best locking method */
0, /* The default of memory is set in FillGLCaps */
- NULL /* No wine logo by default */
+ NULL, /* No wine logo by default */
+ FALSE /* Disable multisampling for now due to Nvidia driver bugs which happens for some users */
};
IWineD3D* WINAPI WineDirect3DCreate(UINT SDKVersion, UINT dxVersion, IUnknown *parent) {
@@ -260,6 +261,14 @@ BOOL WINAPI DllMain(HINSTANCE hInstDLL, DWORD fdwReason, LPVOID lpv)
wined3d_settings.logo = HeapAlloc(GetProcessHeap(), 0, strlen(buffer) + 1);
if(wined3d_settings.logo) strcpy(wined3d_settings.logo, buffer);
}
+ if ( !get_config_key( hkey, appkey, "Multisampling", buffer, size) )
+ {
+ if (!strcmp(buffer,"enabled"))
+ {
+ TRACE("Allow multisampling\n");
+ wined3d_settings.allow_multisampling = TRUE;
+ }
+ }
}
if (wined3d_settings.vs_mode == VS_HW)
TRACE("Allow HW vertex shaders\n");
diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h
index 6f4836e..26952be 100644
--- a/dlls/wined3d/wined3d_private.h
+++ b/dlls/wined3d/wined3d_private.h
@@ -248,6 +248,7 @@ typedef struct wined3d_settings_s {
/* Memory tracking and object counting */
unsigned int emulated_textureram;
char *logo;
+ int allow_multisampling;
} wined3d_settings_t;
extern wined3d_settings_t wined3d_settings;
More information about the wine-cvs
mailing list