From 042d0394dcc56da3bc496941aec05b0b82f1b71d Mon Sep 17 00:00:00 2001 From: Roderick Colenbrander Date: Mon, 2 Jun 2008 21:06:01 +0000 Subject: [PATCH] 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 deletion(-) diff --git a/dlls/wined3d/directx.c b/dlls/wined3d/directx.c index 32f7323624e..51013eb208d 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 fe2c4fd10f3..27de8764421 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 6f4836e06f4..26952be1f91 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; -- 2.11.4.GIT