[PATCH] 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.

Roderick Colenbrander thunderbird2k at gmx.net
Mon Jun 2 16:06:01 CDT 2008


---
 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..9a2fcc7 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, "AllowMultisampling", 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;
-- 
1.5.3.4


--========GMX269181212433799936297--



More information about the wine-patches mailing list