[PATCH 4/5] wined3d: Refuse to create a D3D10 wined3d device if it is not supported by the GPU.

Matteo Bruni mbruni at codeweavers.com
Mon Oct 24 11:58:48 CDT 2011


---
 dlls/wined3d/device.c |    9 +++++++++
 1 files changed, 9 insertions(+), 0 deletions(-)

diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c
index cffe5f7..c3f3dfb 100644
--- a/dlls/wined3d/device.c
+++ b/dlls/wined3d/device.c
@@ -6054,6 +6054,15 @@ HRESULT device_init(struct wined3d_device *device, struct wined3d *wined3d,
     if (device->shader_backend)
     {
         device->shader_backend->shader_get_caps(&adapter->gl_info, &shader_caps);
+
+        if (wined3d->dxVersion >= 10 && (shader_caps.VertexShaderVersion < WINED3DVS_VERSION(4,0)
+                || shader_caps.PixelShaderVersion < WINED3DPS_VERSION(4,0)))
+        {
+            WARN("Direct3D 10 unsupported on this GPU with the current shader backend.\n");
+            wined3d_decref(device->wined3d);
+            return WINED3DERR_NOTAVAILABLE;
+        }
+
         device->d3d_vshader_constantF = shader_caps.MaxVertexShaderConst;
         device->d3d_pshader_constantF = shader_caps.MaxPixelShaderConst;
         device->vs_clipping = shader_caps.VSClipping;
-- 
1.7.3.4




More information about the wine-patches mailing list