[PATCH] wined3d: Remove the version parameter (try 3).

Stefan Dösinger stefan at codeweavers.com
Thu Mar 20 09:51:45 CDT 2014


This supersedes patch 103338.

Try 3: Ignore a potential 3D-incapable device in d3d8/9/dxgi

Try 2: Don't add an extra flag and just disable 3D if the registry key
is set regardless of the used client library.

In dxgi I could in theory filter out adapters that don't support 3D. But
since we have d3d on all adapters or none I don't think it's worth the
extra code.
---
 dlls/d3d8/directx.c            | 2 +-
 dlls/d3d9/directx.c            | 2 +-
 dlls/ddraw/ddraw.c             | 4 ++--
 dlls/ddraw/main.c              | 4 ++--
 dlls/dxgi/factory.c            | 2 +-
 dlls/wined3d/directx.c         | 3 +--
 dlls/wined3d/wined3d.spec      | 2 +-
 dlls/wined3d/wined3d_main.c    | 8 ++++----
 dlls/wined3d/wined3d_private.h | 3 +--
 include/wine/wined3d.h         | 2 +-
 10 files changed, 15 insertions(+), 17 deletions(-)

diff --git a/dlls/d3d8/directx.c b/dlls/d3d8/directx.c
index 4aac722..7270881 100644
--- a/dlls/d3d8/directx.c
+++ b/dlls/d3d8/directx.c
@@ -410,7 +410,7 @@ BOOL d3d8_init(struct d3d8 *d3d8)
     d3d8->refcount = 1;
 
     wined3d_mutex_lock();
-    d3d8->wined3d = wined3d_create(8, flags);
+    d3d8->wined3d = wined3d_create(flags);
     wined3d_mutex_unlock();
     if (!d3d8->wined3d)
         return FALSE;
diff --git a/dlls/d3d9/directx.c b/dlls/d3d9/directx.c
index 79e9eb5..6280d12 100644
--- a/dlls/d3d9/directx.c
+++ b/dlls/d3d9/directx.c
@@ -644,7 +644,7 @@ BOOL d3d9_init(struct d3d9 *d3d9, BOOL extended)
     d3d9->refcount = 1;
 
     wined3d_mutex_lock();
-    d3d9->wined3d = wined3d_create(9, flags);
+    d3d9->wined3d = wined3d_create(flags);
     wined3d_mutex_unlock();
     if (!d3d9->wined3d)
         return FALSE;
diff --git a/dlls/ddraw/ddraw.c b/dlls/ddraw/ddraw.c
index ed0606f..aa74a1e 100644
--- a/dlls/ddraw/ddraw.c
+++ b/dlls/ddraw/ddraw.c
@@ -4871,9 +4871,9 @@ HRESULT ddraw_init(struct ddraw *ddraw, enum wined3d_device_type device_type)
     ddraw->ref7 = 1;
 
     flags = WINED3D_LEGACY_DEPTH_BIAS | WINED3D_VIDMEM_ACCOUNTING;
-    if (!(ddraw->wined3d = wined3d_create(7, flags)))
+    if (!(ddraw->wined3d = wined3d_create(flags)))
     {
-        if (!(ddraw->wined3d = wined3d_create(7, flags | WINED3D_NO3D)))
+        if (!(ddraw->wined3d = wined3d_create(flags | WINED3D_NO3D)))
         {
             WARN("Failed to create a wined3d object.\n");
             return E_FAIL;
diff --git a/dlls/ddraw/main.c b/dlls/ddraw/main.c
index 3bcd9b8..68bf3e3 100644
--- a/dlls/ddraw/main.c
+++ b/dlls/ddraw/main.c
@@ -408,9 +408,9 @@ HRESULT WINAPI DirectDrawEnumerateExA(LPDDENUMCALLBACKEXA callback, void *contex
         FIXME("flags 0x%08x not handled\n", flags & ~DDENUM_ATTACHEDSECONDARYDEVICES);
 
     TRACE("Enumerating ddraw interfaces\n");
-    if (!(wined3d = wined3d_create(7, WINED3D_LEGACY_DEPTH_BIAS)))
+    if (!(wined3d = wined3d_create(WINED3D_LEGACY_DEPTH_BIAS)))
     {
-        if (!(wined3d = wined3d_create(7, WINED3D_LEGACY_DEPTH_BIAS | WINED3D_NO3D)))
+        if (!(wined3d = wined3d_create(WINED3D_LEGACY_DEPTH_BIAS | WINED3D_NO3D)))
         {
             WARN("Failed to create a wined3d object.\n");
             return E_FAIL;
diff --git a/dlls/dxgi/factory.c b/dlls/dxgi/factory.c
index ac2450e..98d036e 100644
--- a/dlls/dxgi/factory.c
+++ b/dlls/dxgi/factory.c
@@ -329,7 +329,7 @@ static HRESULT dxgi_factory_init(struct dxgi_factory *factory, BOOL extended)
     factory->refcount = 1;
 
     EnterCriticalSection(&dxgi_cs);
-    factory->wined3d = wined3d_create(10, 0);
+    factory->wined3d = wined3d_create(0);
     if (!factory->wined3d)
     {
         LeaveCriticalSection(&dxgi_cs);
diff --git a/dlls/wined3d/directx.c b/dlls/wined3d/directx.c
index eaf2427..ef81278 100644
--- a/dlls/wined3d/directx.c
+++ b/dlls/wined3d/directx.c
@@ -5204,9 +5204,8 @@ const struct wined3d_parent_ops wined3d_null_parent_ops =
     wined3d_null_wined3d_object_destroyed,
 };
 
-HRESULT wined3d_init(struct wined3d *wined3d, UINT version, DWORD flags)
+HRESULT wined3d_init(struct wined3d *wined3d, DWORD flags)
 {
-    wined3d->dxVersion = version;
     wined3d->ref = 1;
     wined3d->flags = flags;
 
diff --git a/dlls/wined3d/wined3d.spec b/dlls/wined3d/wined3d.spec
index 3a6dd33..3243f77 100644
--- a/dlls/wined3d/wined3d.spec
+++ b/dlls/wined3d/wined3d.spec
@@ -6,7 +6,7 @@
 @ cdecl wined3d_check_device_format_conversion(ptr long long long long)
 @ cdecl wined3d_check_device_multisample_type(ptr long long long long long ptr)
 @ cdecl wined3d_check_device_type(ptr long long long long long)
-@ cdecl wined3d_create(long long)
+@ cdecl wined3d_create(long)
 @ cdecl wined3d_decref(ptr)
 @ cdecl wined3d_enum_adapter_modes(ptr long long long long ptr)
 @ cdecl wined3d_get_adapter_count(ptr)
diff --git a/dlls/wined3d/wined3d_main.c b/dlls/wined3d/wined3d_main.c
index a0ecfa7..7ab2448 100644
--- a/dlls/wined3d/wined3d_main.c
+++ b/dlls/wined3d/wined3d_main.c
@@ -87,7 +87,7 @@ struct wined3d_settings wined3d_settings =
     FALSE,          /* 3D support enabled by default. */
 };
 
-struct wined3d * CDECL wined3d_create(UINT version, DWORD flags)
+struct wined3d * CDECL wined3d_create(DWORD flags)
 {
     struct wined3d *object;
     HRESULT hr;
@@ -99,10 +99,10 @@ struct wined3d * CDECL wined3d_create(UINT version, DWORD flags)
         return NULL;
     }
 
-    if (version == 7 && wined3d_settings.no_3d)
+    if (wined3d_settings.no_3d)
         flags |= WINED3D_NO3D;
 
-    hr = wined3d_init(object, version, flags);
+    hr = wined3d_init(object, flags);
     if (FAILED(hr))
     {
         WARN("Failed to initialize wined3d object, hr %#x.\n", hr);
@@ -110,7 +110,7 @@ struct wined3d * CDECL wined3d_create(UINT version, DWORD flags)
         return NULL;
     }
 
-    TRACE("Created wined3d object %p for d3d%d support.\n", object, version);
+    TRACE("Created wined3d object %p.\n", object);
 
     return object;
 }
diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h
index ff31ebc..0199ef8 100644
--- a/dlls/wined3d/wined3d_private.h
+++ b/dlls/wined3d/wined3d_private.h
@@ -1785,12 +1785,11 @@ struct wined3d
 {
     LONG ref;
     DWORD flags;
-    UINT dxVersion;
     UINT adapter_count;
     struct wined3d_adapter adapters[1];
 };
 
-HRESULT wined3d_init(struct wined3d *wined3d, UINT version, DWORD flags) DECLSPEC_HIDDEN;
+HRESULT wined3d_init(struct wined3d *wined3d, DWORD flags) DECLSPEC_HIDDEN;
 BOOL wined3d_register_window(HWND window, struct wined3d_device *device) DECLSPEC_HIDDEN;
 void wined3d_unregister_window(HWND window) DECLSPEC_HIDDEN;
 
diff --git a/include/wine/wined3d.h b/include/wine/wined3d.h
index 7bb37d6..e6fa2d1 100644
--- a/include/wine/wined3d.h
+++ b/include/wine/wined3d.h
@@ -2024,7 +2024,7 @@ HRESULT __cdecl wined3d_check_device_multisample_type(const struct wined3d *wine
 HRESULT __cdecl wined3d_check_device_type(const struct wined3d *wined3d, UINT adapter_idx,
         enum wined3d_device_type device_type, enum wined3d_format_id display_format_id,
         enum wined3d_format_id backbuffer_format_id, BOOL windowed);
-struct wined3d * __cdecl wined3d_create(UINT version, DWORD flags);
+struct wined3d * __cdecl wined3d_create(DWORD flags);
 ULONG __cdecl wined3d_decref(struct wined3d *wined3d);
 HRESULT __cdecl wined3d_enum_adapter_modes(const struct wined3d *wined3d, UINT adapter_idx,
         enum wined3d_format_id format_id, enum wined3d_scanline_ordering scanline_ordering,
-- 
1.8.3.2




More information about the wine-patches mailing list