2 * Copyright 2002-2004 Jason Edmeades
3 * Copyright 2003-2004 Raphael Junqueira
4 * Copyright 2004 Christian Costa
5 * Copyright 2005 Oliver Stieber
6 * Copyright 2007-2008 Stefan Dösinger for CodeWeavers
7 * Copyright 2009-2011 Henri Verbeet for CodeWeavers
9 * This library is free software; you can redistribute it and/or
10 * modify it under the terms of the GNU Lesser General Public
11 * License as published by the Free Software Foundation; either
12 * version 2.1 of the License, or (at your option) any later version.
14 * This library is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
17 * Lesser General Public License for more details.
19 * You should have received a copy of the GNU Lesser General Public
20 * License along with this library; if not, write to the Free Software
21 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
25 #include "wine/port.h"
27 #include "wined3d_private.h"
30 WINE_DEFAULT_DEBUG_CHANNEL(d3d
);
31 WINE_DECLARE_DEBUG_CHANNEL(winediag
);
33 #define DEFAULT_REFRESH_RATE 0
35 enum wined3d_driver_model
44 /* The d3d device ID */
45 static const GUID IID_D3DDEVICE_D3DUID
= { 0xaeb2cdd4, 0x6e41, 0x43ea, { 0x94,0x1c,0x83,0x61,0xcc,0x76,0x07,0x81 } };
47 /**********************************************************
48 * Utility functions follow
49 **********************************************************/
51 const struct min_lookup minMipLookup
[] =
53 /* NONE POINT LINEAR */
54 {{GL_NEAREST
, GL_NEAREST
, GL_NEAREST
}}, /* NONE */
55 {{GL_NEAREST
, GL_NEAREST_MIPMAP_NEAREST
, GL_NEAREST_MIPMAP_LINEAR
}}, /* POINT*/
56 {{GL_LINEAR
, GL_LINEAR_MIPMAP_NEAREST
, GL_LINEAR_MIPMAP_LINEAR
}}, /* LINEAR */
59 const GLenum magLookup
[] =
61 /* NONE POINT LINEAR */
62 GL_NEAREST
, GL_NEAREST
, GL_LINEAR
,
65 void CDECL
wined3d_output_release_ownership(const struct wined3d_output
*output
)
67 D3DKMT_SETVIDPNSOURCEOWNER set_owner_desc
= {0};
69 TRACE("output %p.\n", output
);
71 set_owner_desc
.hDevice
= output
->kmt_device
;
72 D3DKMTSetVidPnSourceOwner(&set_owner_desc
);
75 HRESULT CDECL
wined3d_output_take_ownership(const struct wined3d_output
*output
, BOOL exclusive
)
77 D3DKMT_SETVIDPNSOURCEOWNER set_owner_desc
;
78 D3DKMT_VIDPNSOURCEOWNER_TYPE owner_type
;
81 TRACE("output %p, exclusive %#x.\n", output
, exclusive
);
83 owner_type
= exclusive
? D3DKMT_VIDPNSOURCEOWNER_EXCLUSIVE
: D3DKMT_VIDPNSOURCEOWNER_SHARED
;
84 set_owner_desc
.pType
= &owner_type
;
85 set_owner_desc
.pVidPnSourceId
= &output
->vidpn_source_id
;
86 set_owner_desc
.VidPnSourceCount
= 1;
87 set_owner_desc
.hDevice
= output
->kmt_device
;
88 status
= D3DKMTSetVidPnSourceOwner(&set_owner_desc
);
92 case STATUS_GRAPHICS_VIDPN_SOURCE_IN_USE
:
93 return DXGI_ERROR_NOT_CURRENTLY_AVAILABLE
;
94 case STATUS_INVALID_PARAMETER
:
96 case STATUS_PROCEDURE_NOT_FOUND
:
101 FIXME("Unhandled error %#x.\n", status
);
106 static void wined3d_output_cleanup(const struct wined3d_output
*output
)
108 D3DKMT_DESTROYDEVICE destroy_device_desc
;
109 D3DKMT_CLOSEADAPTER close_adapter_desc
;
111 TRACE("output %p.\n", output
);
113 destroy_device_desc
.hDevice
= output
->kmt_device
;
114 D3DKMTDestroyDevice(&destroy_device_desc
);
115 close_adapter_desc
.hAdapter
= output
->kmt_adapter
;
116 D3DKMTCloseAdapter(&close_adapter_desc
);
119 static HRESULT
wined3d_output_init(struct wined3d_output
*output
, unsigned int ordinal
,
120 struct wined3d_adapter
*adapter
, const WCHAR
*device_name
)
122 D3DKMT_OPENADAPTERFROMGDIDISPLAYNAME open_adapter_desc
;
123 D3DKMT_CREATEDEVICE create_device_desc
= {{0}};
124 D3DKMT_CLOSEADAPTER close_adapter_desc
;
126 TRACE("output %p, device_name %s.\n", output
, wine_dbgstr_w(device_name
));
128 lstrcpyW(open_adapter_desc
.DeviceName
, device_name
);
129 if (D3DKMTOpenAdapterFromGdiDisplayName(&open_adapter_desc
))
132 create_device_desc
.u
.hAdapter
= open_adapter_desc
.hAdapter
;
133 if (D3DKMTCreateDevice(&create_device_desc
))
135 close_adapter_desc
.hAdapter
= open_adapter_desc
.hAdapter
;
136 D3DKMTCloseAdapter(&close_adapter_desc
);
140 output
->ordinal
= ordinal
;
141 lstrcpyW(output
->device_name
, device_name
);
142 output
->adapter
= adapter
;
143 output
->kmt_adapter
= open_adapter_desc
.hAdapter
;
144 output
->kmt_device
= create_device_desc
.hDevice
;
145 output
->vidpn_source_id
= open_adapter_desc
.VidPnSourceId
;
150 /* Adjust the amount of used texture memory */
151 UINT64
adapter_adjust_memory(struct wined3d_adapter
*adapter
, INT64 amount
)
153 adapter
->vram_bytes_used
+= amount
;
154 TRACE("Adjusted used adapter memory by 0x%s to 0x%s.\n",
155 wine_dbgstr_longlong(amount
),
156 wine_dbgstr_longlong(adapter
->vram_bytes_used
));
157 return adapter
->vram_bytes_used
;
160 void wined3d_adapter_cleanup(struct wined3d_adapter
*adapter
)
162 unsigned int output_idx
;
164 for (output_idx
= 0; output_idx
< adapter
->output_count
; ++output_idx
)
165 wined3d_output_cleanup(&adapter
->outputs
[output_idx
]);
166 heap_free(adapter
->outputs
);
167 heap_free(adapter
->formats
);
170 ULONG CDECL
wined3d_incref(struct wined3d
*wined3d
)
172 ULONG refcount
= InterlockedIncrement(&wined3d
->ref
);
174 TRACE("%p increasing refcount to %u.\n", wined3d
, refcount
);
179 ULONG CDECL
wined3d_decref(struct wined3d
*wined3d
)
181 ULONG refcount
= InterlockedDecrement(&wined3d
->ref
);
183 TRACE("%p decreasing refcount to %u.\n", wined3d
, refcount
);
189 for (i
= 0; i
< wined3d
->adapter_count
; ++i
)
191 struct wined3d_adapter
*adapter
= wined3d
->adapters
[i
];
193 adapter
->adapter_ops
->adapter_destroy(adapter
);
201 /* Certain applications (e.g. Steam) complain if we report an outdated driver
204 * The driver version has the form "x.y.z.w".
206 * "x" is the Windows version / driver model the driver is meant for:
210 * 7 -> Vista - WDDM 1.0
211 * 8 -> Windows 7 - WDDM 1.1
212 * 9 -> Windows 8 - WDDM 1.2
213 * 10 -> Windows 8.1 - WDDM 1.3
214 * 20 -> Windows 10 - WDDM 2.0
215 * 21 -> Windows 10 Anniversary Update - WDDM 2.1
216 * 22 -> Windows 10 Creators Update - WDDM 2.2
217 * 23 -> Windows 10 Fall Creators Update - WDDM 2.3
218 * 24 -> Windows 10 April 2018 Update - WDDM 2.4
219 * 25 -> Windows 10 October 2018 Update - WDDM 2.5
220 * 26 -> Windows 10 May 2019 Update - WDDM 2.6
222 * "y" is the maximum Direct3D version / feature level the driver supports.
235 * "z" is the subversion number.
237 * "w" is the vendor specific driver build number.
239 * In practice the reported version is tied to the driver, not the actual
240 * Windows version or feature level. E.g. NVIDIA driver 445.87 advertises the
241 * exact same version 26.21.14.4587 on Windows 7 as it does on Windows 10
242 * (it's in fact the same driver). Similarly for driver 310.90 that advertises
243 * itself as 9.18.13.1090 on Windows Vista with a GeForce 9600M. */
245 struct driver_version_information
247 enum wined3d_display_driver driver
;
248 enum wined3d_driver_model driver_model
;
249 const char *driver_name
; /* name of Windows driver */
250 WORD subversion
; /* subversion word ('z'), contained in high word of DriverVersion.LowPart */
251 WORD build
; /* build number ('w'), contained in low word of DriverVersion.LowPart */
254 /* The driver version table contains driver information for different devices on several OS versions. */
255 static const struct driver_version_information driver_version_table
[] =
258 * - Radeon HD2x00 (R600) and up supported by current drivers.
259 * - Radeon 9500 (R300) - X1*00 (R5xx) supported up to Catalyst 9.3 (Linux) and 10.2 (XP/Vista/Win7)
260 * - Radeon 7xxx (R100) - 9250 (RV250) supported up to Catalyst 6.11 (XP)
261 * - Rage 128 supported up to XP, latest official build 6.13.3279 dated October 2001 */
262 {DRIVER_AMD_RAGE_128PRO
, DRIVER_MODEL_NT5X
, "ati2dvaa.dll", 3279, 0},
263 {DRIVER_AMD_R100
, DRIVER_MODEL_NT5X
, "ati2dvag.dll", 10, 6614},
264 {DRIVER_AMD_R300
, DRIVER_MODEL_NT5X
, "ati2dvag.dll", 10, 6764},
265 {DRIVER_AMD_R600
, DRIVER_MODEL_NT5X
, "ati2dvag.dll", 10, 1280},
266 {DRIVER_AMD_R300
, DRIVER_MODEL_NT6X
, "atiumdag.dll", 10, 741 },
267 {DRIVER_AMD_R600
, DRIVER_MODEL_NT6X
, "atiumdag.dll", 10, 1280},
268 {DRIVER_AMD_RX
, DRIVER_MODEL_NT6X
, "aticfx32.dll", 15002, 61},
271 * The drivers are unified but not all versions support all GPUs. At some point the 2k/xp
272 * drivers used ialmrnt5.dll for GMA800/GMA900 but at some point the file was renamed to
273 * igxprd32.dll but the GMA800 driver was never updated. */
274 {DRIVER_INTEL_GMA800
, DRIVER_MODEL_NT5X
, "ialmrnt5.dll", 10, 3889},
275 {DRIVER_INTEL_GMA900
, DRIVER_MODEL_NT5X
, "igxprd32.dll", 10, 4764},
276 {DRIVER_INTEL_GMA950
, DRIVER_MODEL_NT5X
, "igxprd32.dll", 10, 4926},
277 {DRIVER_INTEL_GMA3000
, DRIVER_MODEL_NT5X
, "igxprd32.dll", 10, 5218},
278 {DRIVER_INTEL_GMA950
, DRIVER_MODEL_NT6X
, "igdumd32.dll", 10, 1504},
279 {DRIVER_INTEL_GMA3000
, DRIVER_MODEL_NT6X
, "igdumd32.dll", 10, 1666},
280 {DRIVER_INTEL_HD4000
, DRIVER_MODEL_NT6X
, "igdumdim32.dll", 15, 4352},
283 * - Geforce8 and newer is supported by the current 340.52 driver on XP-Win8
284 * - Geforce6 and 7 support is up to 307.83 on XP-Win8
285 * - GeforceFX support is up to 173.x on <= XP
286 * - Geforce2MX/3/4 up to 96.x on <= XP
287 * - TNT/Geforce1/2 up to 71.x on <= XP
288 * All version numbers used below are from the Linux nvidia drivers. */
289 {DRIVER_NVIDIA_TNT
, DRIVER_MODEL_NT5X
, "nv4_disp.dll", 10, 7186},
290 {DRIVER_NVIDIA_GEFORCE2MX
, DRIVER_MODEL_NT5X
, "nv4_disp.dll", 10, 9371},
291 {DRIVER_NVIDIA_GEFORCEFX
, DRIVER_MODEL_NT5X
, "nv4_disp.dll", 11, 7516},
292 {DRIVER_NVIDIA_GEFORCE6
, DRIVER_MODEL_NT5X
, "nv4_disp.dll", 13, 783},
293 {DRIVER_NVIDIA_GEFORCE8
, DRIVER_MODEL_NT5X
, "nv4_disp.dll", 13, 4052},
294 {DRIVER_NVIDIA_GEFORCE6
, DRIVER_MODEL_NT6X
, "nvd3dum.dll", 13, 783},
295 {DRIVER_NVIDIA_GEFORCE8
, DRIVER_MODEL_NT6X
, "nvd3dum.dll", 13, 4052},
296 {DRIVER_NVIDIA_FERMI
, DRIVER_MODEL_NT6X
, "nvd3dum.dll", 13, 9135},
297 {DRIVER_NVIDIA_KEPLER
, DRIVER_MODEL_NT6X
, "nvd3dum.dll", 14, 4587},
300 {DRIVER_REDHAT_VIRGL
, DRIVER_MODEL_GENERIC
, "virgl.dll", 0, 0},
303 {DRIVER_VMWARE
, DRIVER_MODEL_NT5X
, "vm3dum.dll", 1, 1134},
306 {DRIVER_WINE
, DRIVER_MODEL_GENERIC
, "wined3d.dll", 0, 0},
309 /* The amount of video memory stored in the gpu description table is the minimum amount of video memory
310 * found on a board containing a specific GPU. */
311 static const struct wined3d_gpu_description gpu_description_table
[] =
314 {HW_VENDOR_NVIDIA
, CARD_NVIDIA_RIVA_128
, "NVIDIA RIVA 128", DRIVER_NVIDIA_TNT
, 4 },
315 {HW_VENDOR_NVIDIA
, CARD_NVIDIA_RIVA_TNT
, "NVIDIA RIVA TNT", DRIVER_NVIDIA_TNT
, 16 },
316 {HW_VENDOR_NVIDIA
, CARD_NVIDIA_RIVA_TNT2
, "NVIDIA RIVA TNT2/TNT2 Pro", DRIVER_NVIDIA_TNT
, 32 },
317 {HW_VENDOR_NVIDIA
, CARD_NVIDIA_GEFORCE
, "NVIDIA GeForce 256", DRIVER_NVIDIA_TNT
, 32 },
318 {HW_VENDOR_NVIDIA
, CARD_NVIDIA_GEFORCE2
, "NVIDIA GeForce2 GTS/GeForce2 Pro", DRIVER_NVIDIA_TNT
, 32 },
319 {HW_VENDOR_NVIDIA
, CARD_NVIDIA_GEFORCE2_MX
, "NVIDIA GeForce2 MX/MX 400", DRIVER_NVIDIA_GEFORCE2MX
,32 },
320 {HW_VENDOR_NVIDIA
, CARD_NVIDIA_GEFORCE3
, "NVIDIA GeForce3", DRIVER_NVIDIA_GEFORCE2MX
,64 },
321 {HW_VENDOR_NVIDIA
, CARD_NVIDIA_GEFORCE4_MX
, "NVIDIA GeForce4 MX 460", DRIVER_NVIDIA_GEFORCE2MX
,64 },
322 {HW_VENDOR_NVIDIA
, CARD_NVIDIA_GEFORCE4_TI4200
, "NVIDIA GeForce4 Ti 4200", DRIVER_NVIDIA_GEFORCE2MX
,64, },
323 {HW_VENDOR_NVIDIA
, CARD_NVIDIA_GEFORCEFX_5200
, "NVIDIA GeForce FX 5200", DRIVER_NVIDIA_GEFORCEFX
, 64 },
324 {HW_VENDOR_NVIDIA
, CARD_NVIDIA_GEFORCEFX_5600
, "NVIDIA GeForce FX 5600", DRIVER_NVIDIA_GEFORCEFX
, 128 },
325 {HW_VENDOR_NVIDIA
, CARD_NVIDIA_GEFORCEFX_5800
, "NVIDIA GeForce FX 5800", DRIVER_NVIDIA_GEFORCEFX
, 256 },
326 {HW_VENDOR_NVIDIA
, CARD_NVIDIA_GEFORCE_6200
, "NVIDIA GeForce 6200", DRIVER_NVIDIA_GEFORCE6
, 64 },
327 {HW_VENDOR_NVIDIA
, CARD_NVIDIA_GEFORCE_6600GT
, "NVIDIA GeForce 6600 GT", DRIVER_NVIDIA_GEFORCE6
, 128 },
328 {HW_VENDOR_NVIDIA
, CARD_NVIDIA_GEFORCE_6800
, "NVIDIA GeForce 6800", DRIVER_NVIDIA_GEFORCE6
, 128 },
329 {HW_VENDOR_NVIDIA
, CARD_NVIDIA_GEFORCE_7300
, "NVIDIA GeForce Go 7300", DRIVER_NVIDIA_GEFORCE6
, 256 },
330 {HW_VENDOR_NVIDIA
, CARD_NVIDIA_GEFORCE_7400
, "NVIDIA GeForce Go 7400", DRIVER_NVIDIA_GEFORCE6
, 256 },
331 {HW_VENDOR_NVIDIA
, CARD_NVIDIA_GEFORCE_7600
, "NVIDIA GeForce 7600 GT", DRIVER_NVIDIA_GEFORCE6
, 256 },
332 {HW_VENDOR_NVIDIA
, CARD_NVIDIA_GEFORCE_7800GT
, "NVIDIA GeForce 7800 GT", DRIVER_NVIDIA_GEFORCE6
, 256 },
333 {HW_VENDOR_NVIDIA
, CARD_NVIDIA_GEFORCE_8200
, "NVIDIA GeForce 8200", DRIVER_NVIDIA_GEFORCE8
, 512 },
334 {HW_VENDOR_NVIDIA
, CARD_NVIDIA_GEFORCE_8300GS
, "NVIDIA GeForce 8300 GS", DRIVER_NVIDIA_GEFORCE8
, 128 },
335 {HW_VENDOR_NVIDIA
, CARD_NVIDIA_GEFORCE_8400GS
, "NVIDIA GeForce 8400 GS", DRIVER_NVIDIA_GEFORCE8
, 128 },
336 {HW_VENDOR_NVIDIA
, CARD_NVIDIA_GEFORCE_8500GT
, "NVIDIA GeForce 8500 GT", DRIVER_NVIDIA_GEFORCE8
, 256 },
337 {HW_VENDOR_NVIDIA
, CARD_NVIDIA_GEFORCE_8600GT
, "NVIDIA GeForce 8600 GT", DRIVER_NVIDIA_GEFORCE8
, 256 },
338 {HW_VENDOR_NVIDIA
, CARD_NVIDIA_GEFORCE_8600MGT
, "NVIDIA GeForce 8600M GT", DRIVER_NVIDIA_GEFORCE8
, 512 },
339 {HW_VENDOR_NVIDIA
, CARD_NVIDIA_GEFORCE_8800GTS
, "NVIDIA GeForce 8800 GTS", DRIVER_NVIDIA_GEFORCE8
, 320 },
340 {HW_VENDOR_NVIDIA
, CARD_NVIDIA_GEFORCE_8800GTX
, "NVIDIA GeForce 8800 GTX", DRIVER_NVIDIA_GEFORCE8
, 768 },
341 {HW_VENDOR_NVIDIA
, CARD_NVIDIA_GEFORCE_9200
, "NVIDIA GeForce 9200", DRIVER_NVIDIA_GEFORCE8
, 256 },
342 {HW_VENDOR_NVIDIA
, CARD_NVIDIA_GEFORCE_9300
, "NVIDIA GeForce 9300", DRIVER_NVIDIA_GEFORCE8
, 256 },
343 {HW_VENDOR_NVIDIA
, CARD_NVIDIA_GEFORCE_9400M
, "NVIDIA GeForce 9400M", DRIVER_NVIDIA_GEFORCE8
, 256 },
344 {HW_VENDOR_NVIDIA
, CARD_NVIDIA_GEFORCE_9400GT
, "NVIDIA GeForce 9400 GT", DRIVER_NVIDIA_GEFORCE8
, 256 },
345 {HW_VENDOR_NVIDIA
, CARD_NVIDIA_GEFORCE_9500GT
, "NVIDIA GeForce 9500 GT", DRIVER_NVIDIA_GEFORCE8
, 256 },
346 {HW_VENDOR_NVIDIA
, CARD_NVIDIA_GEFORCE_9600GT
, "NVIDIA GeForce 9600 GT", DRIVER_NVIDIA_GEFORCE8
, 512 },
347 {HW_VENDOR_NVIDIA
, CARD_NVIDIA_GEFORCE_9700MGT
, "NVIDIA GeForce 9700M GT", DRIVER_NVIDIA_GEFORCE8
, 512 },
348 {HW_VENDOR_NVIDIA
, CARD_NVIDIA_GEFORCE_9800GT
, "NVIDIA GeForce 9800 GT", DRIVER_NVIDIA_GEFORCE8
, 512 },
349 {HW_VENDOR_NVIDIA
, CARD_NVIDIA_GEFORCE_210
, "NVIDIA GeForce 210", DRIVER_NVIDIA_GEFORCE8
, 512 },
350 {HW_VENDOR_NVIDIA
, CARD_NVIDIA_GEFORCE_GT220
, "NVIDIA GeForce GT 220", DRIVER_NVIDIA_GEFORCE8
, 512 },
351 {HW_VENDOR_NVIDIA
, CARD_NVIDIA_GEFORCE_GT240
, "NVIDIA GeForce GT 240", DRIVER_NVIDIA_GEFORCE8
, 512 },
352 {HW_VENDOR_NVIDIA
, CARD_NVIDIA_GEFORCE_GTS250
, "NVIDIA GeForce GTS 250", DRIVER_NVIDIA_GEFORCE8
, 1024},
353 {HW_VENDOR_NVIDIA
, CARD_NVIDIA_GEFORCE_GTX260
, "NVIDIA GeForce GTX 260", DRIVER_NVIDIA_GEFORCE8
, 1024},
354 {HW_VENDOR_NVIDIA
, CARD_NVIDIA_GEFORCE_GTX275
, "NVIDIA GeForce GTX 275", DRIVER_NVIDIA_GEFORCE8
, 896 },
355 {HW_VENDOR_NVIDIA
, CARD_NVIDIA_GEFORCE_GTX280
, "NVIDIA GeForce GTX 280", DRIVER_NVIDIA_GEFORCE8
, 1024},
356 {HW_VENDOR_NVIDIA
, CARD_NVIDIA_GEFORCE_315M
, "NVIDIA GeForce 315M", DRIVER_NVIDIA_GEFORCE8
, 512 },
357 {HW_VENDOR_NVIDIA
, CARD_NVIDIA_GEFORCE_320M
, "NVIDIA GeForce 320M", DRIVER_NVIDIA_GEFORCE8
, 256},
358 {HW_VENDOR_NVIDIA
, CARD_NVIDIA_GEFORCE_GT320M
, "NVIDIA GeForce GT 320M", DRIVER_NVIDIA_GEFORCE8
, 1024},
359 {HW_VENDOR_NVIDIA
, CARD_NVIDIA_GEFORCE_GT325M
, "NVIDIA GeForce GT 325M", DRIVER_NVIDIA_GEFORCE8
, 1024},
360 {HW_VENDOR_NVIDIA
, CARD_NVIDIA_GEFORCE_GT330
, "NVIDIA GeForce GT 330", DRIVER_NVIDIA_GEFORCE8
, 1024},
361 {HW_VENDOR_NVIDIA
, CARD_NVIDIA_GEFORCE_GTS350M
, "NVIDIA GeForce GTS 350M", DRIVER_NVIDIA_GEFORCE8
, 1024},
362 {HW_VENDOR_NVIDIA
, CARD_NVIDIA_GEFORCE_410M
, "NVIDIA GeForce 410M", DRIVER_NVIDIA_FERMI
, 512},
363 {HW_VENDOR_NVIDIA
, CARD_NVIDIA_GEFORCE_GT420
, "NVIDIA GeForce GT 420", DRIVER_NVIDIA_FERMI
, 2048},
364 {HW_VENDOR_NVIDIA
, CARD_NVIDIA_GEFORCE_GT425M
, "NVIDIA GeForce GT 425M", DRIVER_NVIDIA_FERMI
, 1024},
365 {HW_VENDOR_NVIDIA
, CARD_NVIDIA_GEFORCE_GT430
, "NVIDIA GeForce GT 430", DRIVER_NVIDIA_FERMI
, 1024},
366 {HW_VENDOR_NVIDIA
, CARD_NVIDIA_GEFORCE_GT440
, "NVIDIA GeForce GT 440", DRIVER_NVIDIA_FERMI
, 1024},
367 {HW_VENDOR_NVIDIA
, CARD_NVIDIA_GEFORCE_GTS450
, "NVIDIA GeForce GTS 450", DRIVER_NVIDIA_FERMI
, 1024},
368 {HW_VENDOR_NVIDIA
, CARD_NVIDIA_GEFORCE_GTX460
, "NVIDIA GeForce GTX 460", DRIVER_NVIDIA_FERMI
, 768 },
369 {HW_VENDOR_NVIDIA
, CARD_NVIDIA_GEFORCE_GTX460M
, "NVIDIA GeForce GTX 460M", DRIVER_NVIDIA_FERMI
, 1536},
370 {HW_VENDOR_NVIDIA
, CARD_NVIDIA_GEFORCE_GTX465
, "NVIDIA GeForce GTX 465", DRIVER_NVIDIA_FERMI
, 1024},
371 {HW_VENDOR_NVIDIA
, CARD_NVIDIA_GEFORCE_GTX470
, "NVIDIA GeForce GTX 470", DRIVER_NVIDIA_FERMI
, 1280},
372 {HW_VENDOR_NVIDIA
, CARD_NVIDIA_GEFORCE_GTX480
, "NVIDIA GeForce GTX 480", DRIVER_NVIDIA_FERMI
, 1536},
373 {HW_VENDOR_NVIDIA
, CARD_NVIDIA_GEFORCE_GT520
, "NVIDIA GeForce GT 520", DRIVER_NVIDIA_FERMI
, 1024},
374 {HW_VENDOR_NVIDIA
, CARD_NVIDIA_GEFORCE_GT525M
, "NVIDIA GeForce GT 525M", DRIVER_NVIDIA_FERMI
, 1024},
375 {HW_VENDOR_NVIDIA
, CARD_NVIDIA_GEFORCE_GT540M
, "NVIDIA GeForce GT 540M", DRIVER_NVIDIA_FERMI
, 1024},
376 {HW_VENDOR_NVIDIA
, CARD_NVIDIA_GEFORCE_GTX550
, "NVIDIA GeForce GTX 550 Ti", DRIVER_NVIDIA_FERMI
, 1024},
377 {HW_VENDOR_NVIDIA
, CARD_NVIDIA_GEFORCE_GT555M
, "NVIDIA GeForce GT 555M", DRIVER_NVIDIA_FERMI
, 1024},
378 {HW_VENDOR_NVIDIA
, CARD_NVIDIA_GEFORCE_GTX560TI
, "NVIDIA GeForce GTX 560 Ti", DRIVER_NVIDIA_FERMI
, 1024},
379 {HW_VENDOR_NVIDIA
, CARD_NVIDIA_GEFORCE_GTX560M
, "NVIDIA GeForce GTX 560M", DRIVER_NVIDIA_FERMI
, 3072},
380 {HW_VENDOR_NVIDIA
, CARD_NVIDIA_GEFORCE_GTX560
, "NVIDIA GeForce GTX 560", DRIVER_NVIDIA_FERMI
, 1024},
381 {HW_VENDOR_NVIDIA
, CARD_NVIDIA_GEFORCE_GTX570
, "NVIDIA GeForce GTX 570", DRIVER_NVIDIA_FERMI
, 1280},
382 {HW_VENDOR_NVIDIA
, CARD_NVIDIA_GEFORCE_GTX580
, "NVIDIA GeForce GTX 580", DRIVER_NVIDIA_FERMI
, 1536},
383 {HW_VENDOR_NVIDIA
, CARD_NVIDIA_GEFORCE_GT610
, "NVIDIA GeForce GT 610", DRIVER_NVIDIA_FERMI
, 1024},
384 {HW_VENDOR_NVIDIA
, CARD_NVIDIA_GEFORCE_GT630
, "NVIDIA GeForce GT 630", DRIVER_NVIDIA_KEPLER
, 1024},
385 {HW_VENDOR_NVIDIA
, CARD_NVIDIA_GEFORCE_GT630M
, "NVIDIA GeForce GT 630M", DRIVER_NVIDIA_FERMI
, 1024},
386 {HW_VENDOR_NVIDIA
, CARD_NVIDIA_GEFORCE_GT640
, "NVIDIA GeForce GT 640", DRIVER_NVIDIA_KEPLER
, 1024},
387 {HW_VENDOR_NVIDIA
, CARD_NVIDIA_GEFORCE_GT640M
, "NVIDIA GeForce GT 640M", DRIVER_NVIDIA_KEPLER
, 1024},
388 {HW_VENDOR_NVIDIA
, CARD_NVIDIA_GEFORCE_GT650M
, "NVIDIA GeForce GT 650M", DRIVER_NVIDIA_KEPLER
, 2048},
389 {HW_VENDOR_NVIDIA
, CARD_NVIDIA_GEFORCE_GTX650
, "NVIDIA GeForce GTX 650", DRIVER_NVIDIA_KEPLER
, 1024},
390 {HW_VENDOR_NVIDIA
, CARD_NVIDIA_GEFORCE_GTX650TI
, "NVIDIA GeForce GTX 650 Ti", DRIVER_NVIDIA_KEPLER
, 1024},
391 {HW_VENDOR_NVIDIA
, CARD_NVIDIA_GEFORCE_GTX660
, "NVIDIA GeForce GTX 660", DRIVER_NVIDIA_KEPLER
, 2048},
392 {HW_VENDOR_NVIDIA
, CARD_NVIDIA_GEFORCE_GTX660M
, "NVIDIA GeForce GTX 660M", DRIVER_NVIDIA_KEPLER
, 2048},
393 {HW_VENDOR_NVIDIA
, CARD_NVIDIA_GEFORCE_GTX660TI
, "NVIDIA GeForce GTX 660 Ti", DRIVER_NVIDIA_KEPLER
, 2048},
394 {HW_VENDOR_NVIDIA
, CARD_NVIDIA_GEFORCE_GTX670
, "NVIDIA GeForce GTX 670", DRIVER_NVIDIA_KEPLER
, 2048},
395 {HW_VENDOR_NVIDIA
, CARD_NVIDIA_GEFORCE_GTX670MX
, "NVIDIA GeForce GTX 670MX", DRIVER_NVIDIA_KEPLER
, 3072},
396 {HW_VENDOR_NVIDIA
, CARD_NVIDIA_GEFORCE_GTX675MX_1
, "NVIDIA GeForce GTX 675MX", DRIVER_NVIDIA_KEPLER
, 4096},
397 {HW_VENDOR_NVIDIA
, CARD_NVIDIA_GEFORCE_GTX675MX_2
, "NVIDIA GeForce GTX 675MX", DRIVER_NVIDIA_KEPLER
, 2048},
398 {HW_VENDOR_NVIDIA
, CARD_NVIDIA_GEFORCE_GTX680
, "NVIDIA GeForce GTX 680", DRIVER_NVIDIA_KEPLER
, 2048},
399 {HW_VENDOR_NVIDIA
, CARD_NVIDIA_GEFORCE_GTX690
, "NVIDIA GeForce GTX 690", DRIVER_NVIDIA_KEPLER
, 2048},
400 {HW_VENDOR_NVIDIA
, CARD_NVIDIA_GEFORCE_GT720
, "NVIDIA GeForce GT 720", DRIVER_NVIDIA_KEPLER
, 2048},
401 {HW_VENDOR_NVIDIA
, CARD_NVIDIA_GEFORCE_GT730
, "NVIDIA GeForce GT 730", DRIVER_NVIDIA_KEPLER
, 2048},
402 {HW_VENDOR_NVIDIA
, CARD_NVIDIA_GEFORCE_GT730M
, "NVIDIA GeForce GT 730M", DRIVER_NVIDIA_KEPLER
, 1024},
403 {HW_VENDOR_NVIDIA
, CARD_NVIDIA_GEFORCE_GT740M
, "NVIDIA GeForce GT 740M", DRIVER_NVIDIA_KEPLER
, 2048},
404 {HW_VENDOR_NVIDIA
, CARD_NVIDIA_GEFORCE_GT750M
, "NVIDIA GeForce GT 750M", DRIVER_NVIDIA_KEPLER
, 1024},
405 {HW_VENDOR_NVIDIA
, CARD_NVIDIA_GEFORCE_GT755M
, "NVIDIA GeForce GT 755M", DRIVER_NVIDIA_KEPLER
, 1024},
406 {HW_VENDOR_NVIDIA
, CARD_NVIDIA_GEFORCE_GTX750
, "NVIDIA GeForce GTX 750", DRIVER_NVIDIA_KEPLER
, 1024},
407 {HW_VENDOR_NVIDIA
, CARD_NVIDIA_GEFORCE_GTX750TI
, "NVIDIA GeForce GTX 750 Ti", DRIVER_NVIDIA_KEPLER
, 2048},
408 {HW_VENDOR_NVIDIA
, CARD_NVIDIA_GEFORCE_GTX760
, "NVIDIA GeForce GTX 760", DRIVER_NVIDIA_KEPLER
, 2048},
409 {HW_VENDOR_NVIDIA
, CARD_NVIDIA_GEFORCE_GTX760TI
, "NVIDIA GeForce GTX 760 Ti", DRIVER_NVIDIA_KEPLER
, 2048},
410 {HW_VENDOR_NVIDIA
, CARD_NVIDIA_GEFORCE_GTX765M
, "NVIDIA GeForce GTX 765M", DRIVER_NVIDIA_KEPLER
, 2048},
411 {HW_VENDOR_NVIDIA
, CARD_NVIDIA_GEFORCE_GTX770M
, "NVIDIA GeForce GTX 770M", DRIVER_NVIDIA_KEPLER
, 3072},
412 {HW_VENDOR_NVIDIA
, CARD_NVIDIA_GEFORCE_GTX770
, "NVIDIA GeForce GTX 770", DRIVER_NVIDIA_KEPLER
, 2048},
413 {HW_VENDOR_NVIDIA
, CARD_NVIDIA_GEFORCE_GTX775M
, "NVIDIA GeForce GTX 775M", DRIVER_NVIDIA_KEPLER
, 3072},
414 {HW_VENDOR_NVIDIA
, CARD_NVIDIA_GEFORCE_GTX780
, "NVIDIA GeForce GTX 780", DRIVER_NVIDIA_KEPLER
, 3072},
415 {HW_VENDOR_NVIDIA
, CARD_NVIDIA_GEFORCE_GTX780M
, "NVIDIA GeForce GTX 780M", DRIVER_NVIDIA_KEPLER
, 4096},
416 {HW_VENDOR_NVIDIA
, CARD_NVIDIA_GEFORCE_GTX780TI
, "NVIDIA GeForce GTX 780 Ti", DRIVER_NVIDIA_KEPLER
, 3072},
417 {HW_VENDOR_NVIDIA
, CARD_NVIDIA_GEFORCE_GTXTITAN
, "NVIDIA GeForce GTX TITAN", DRIVER_NVIDIA_KEPLER
, 6144},
418 {HW_VENDOR_NVIDIA
, CARD_NVIDIA_GEFORCE_GTXTITANB
, "NVIDIA GeForce GTX TITAN Black", DRIVER_NVIDIA_KEPLER
, 6144},
419 {HW_VENDOR_NVIDIA
, CARD_NVIDIA_GEFORCE_GTXTITANX
, "NVIDIA GeForce GTX TITAN X", DRIVER_NVIDIA_KEPLER
, 12288},
420 {HW_VENDOR_NVIDIA
, CARD_NVIDIA_GEFORCE_GTXTITANZ
, "NVIDIA GeForce GTX TITAN Z", DRIVER_NVIDIA_KEPLER
, 12288},
421 {HW_VENDOR_NVIDIA
, CARD_NVIDIA_GEFORCE_820M
, "NVIDIA GeForce 820M", DRIVER_NVIDIA_FERMI
, 2048},
422 {HW_VENDOR_NVIDIA
, CARD_NVIDIA_GEFORCE_830M
, "NVIDIA GeForce 830M", DRIVER_NVIDIA_KEPLER
, 2048},
423 {HW_VENDOR_NVIDIA
, CARD_NVIDIA_GEFORCE_840M
, "NVIDIA GeForce 840M", DRIVER_NVIDIA_KEPLER
, 2048},
424 {HW_VENDOR_NVIDIA
, CARD_NVIDIA_GEFORCE_845M
, "NVIDIA GeForce 845M", DRIVER_NVIDIA_KEPLER
, 2048},
425 {HW_VENDOR_NVIDIA
, CARD_NVIDIA_GEFORCE_GTX850M
, "NVIDIA GeForce GTX 850M", DRIVER_NVIDIA_KEPLER
, 2048},
426 {HW_VENDOR_NVIDIA
, CARD_NVIDIA_GEFORCE_GTX860M
, "NVIDIA GeForce GTX 860M", DRIVER_NVIDIA_KEPLER
, 2048},
427 {HW_VENDOR_NVIDIA
, CARD_NVIDIA_GEFORCE_GTX870M
, "NVIDIA GeForce GTX 870M", DRIVER_NVIDIA_KEPLER
, 3072},
428 {HW_VENDOR_NVIDIA
, CARD_NVIDIA_GEFORCE_GTX880M
, "NVIDIA GeForce GTX 880M", DRIVER_NVIDIA_KEPLER
, 4096},
429 {HW_VENDOR_NVIDIA
, CARD_NVIDIA_GEFORCE_940M
, "NVIDIA GeForce 940M", DRIVER_NVIDIA_KEPLER
, 4096},
430 {HW_VENDOR_NVIDIA
, CARD_NVIDIA_GEFORCE_GTX950
, "NVIDIA GeForce GTX 950", DRIVER_NVIDIA_KEPLER
, 2048},
431 {HW_VENDOR_NVIDIA
, CARD_NVIDIA_GEFORCE_GTX950M
, "NVIDIA GeForce GTX 950M", DRIVER_NVIDIA_KEPLER
, 4096},
432 {HW_VENDOR_NVIDIA
, CARD_NVIDIA_GEFORCE_GTX960
, "NVIDIA GeForce GTX 960", DRIVER_NVIDIA_KEPLER
, 4096},
433 {HW_VENDOR_NVIDIA
, CARD_NVIDIA_GEFORCE_GTX960M
, "NVIDIA GeForce GTX 960M", DRIVER_NVIDIA_KEPLER
, 2048},
434 {HW_VENDOR_NVIDIA
, CARD_NVIDIA_GEFORCE_GTX970
, "NVIDIA GeForce GTX 970", DRIVER_NVIDIA_KEPLER
, 4096},
435 {HW_VENDOR_NVIDIA
, CARD_NVIDIA_GEFORCE_GTX970M
, "NVIDIA GeForce GTX 970M", DRIVER_NVIDIA_KEPLER
, 3072},
436 {HW_VENDOR_NVIDIA
, CARD_NVIDIA_GEFORCE_GTX980
, "NVIDIA GeForce GTX 980", DRIVER_NVIDIA_KEPLER
, 4096},
437 {HW_VENDOR_NVIDIA
, CARD_NVIDIA_GEFORCE_GTX980TI
, "NVIDIA GeForce GTX 980 Ti", DRIVER_NVIDIA_KEPLER
, 6144},
438 {HW_VENDOR_NVIDIA
, CARD_NVIDIA_GEFORCE_GTX1050
, "NVIDIA GeForce GTX 1050", DRIVER_NVIDIA_KEPLER
, 2048},
439 {HW_VENDOR_NVIDIA
, CARD_NVIDIA_GEFORCE_GTX1050TI
, "NVIDIA GeForce GTX 1050 Ti", DRIVER_NVIDIA_KEPLER
, 4096},
440 {HW_VENDOR_NVIDIA
, CARD_NVIDIA_GEFORCE_GTX1060_3GB
,"NVIDIA GeForce GTX 1060 3GB", DRIVER_NVIDIA_KEPLER
, 3072},
441 {HW_VENDOR_NVIDIA
, CARD_NVIDIA_GEFORCE_GTX1060
, "NVIDIA GeForce GTX 1060", DRIVER_NVIDIA_KEPLER
, 6144},
442 {HW_VENDOR_NVIDIA
, CARD_NVIDIA_GEFORCE_GTX1070
, "NVIDIA GeForce GTX 1070", DRIVER_NVIDIA_KEPLER
, 8192},
443 {HW_VENDOR_NVIDIA
, CARD_NVIDIA_GEFORCE_GTX1080
, "NVIDIA GeForce GTX 1080", DRIVER_NVIDIA_KEPLER
, 8192},
444 {HW_VENDOR_NVIDIA
, CARD_NVIDIA_GEFORCE_GTX1080M
, "NVIDIA GeForce GTX 1080M", DRIVER_NVIDIA_KEPLER
, 8192},
445 {HW_VENDOR_NVIDIA
, CARD_NVIDIA_GEFORCE_GTX1080TI
, "NVIDIA GeForce GTX 1080 Ti", DRIVER_NVIDIA_KEPLER
, 11264},
446 {HW_VENDOR_NVIDIA
, CARD_NVIDIA_TITANX_PASCAL
, "NVIDIA TITAN X (Pascal)", DRIVER_NVIDIA_KEPLER
, 12288},
447 {HW_VENDOR_NVIDIA
, CARD_NVIDIA_TITANV
, "NVIDIA TITAN V", DRIVER_NVIDIA_KEPLER
, 12288},
448 {HW_VENDOR_NVIDIA
, CARD_NVIDIA_GEFORCE_GTX1650SUPER
,"NVIDIA GeForce GTX 1650 SUPER", DRIVER_NVIDIA_KEPLER
, 4096},
449 {HW_VENDOR_NVIDIA
, CARD_NVIDIA_GEFORCE_GTX1660SUPER
,"NVIDIA GeForce GTX 1660 SUPER", DRIVER_NVIDIA_KEPLER
, 6144},
450 {HW_VENDOR_NVIDIA
, CARD_NVIDIA_GEFORCE_GTX1660TI
, "NVIDIA GeForce GTX 1660 Ti", DRIVER_NVIDIA_KEPLER
, 6144},
451 {HW_VENDOR_NVIDIA
, CARD_NVIDIA_GEFORCE_RTX2060
, "NVIDIA GeForce RTX 2060", DRIVER_NVIDIA_KEPLER
, 6144},
452 {HW_VENDOR_NVIDIA
, CARD_NVIDIA_GEFORCE_RTX2070
, "NVIDIA GeForce RTX 2070", DRIVER_NVIDIA_KEPLER
, 8192},
453 {HW_VENDOR_NVIDIA
, CARD_NVIDIA_GEFORCE_RTX2080
, "NVIDIA GeForce RTX 2080", DRIVER_NVIDIA_KEPLER
, 8192},
454 {HW_VENDOR_NVIDIA
, CARD_NVIDIA_GEFORCE_RTX2080TI
, "NVIDIA GeForce RTX 2080 Ti", DRIVER_NVIDIA_KEPLER
, 11264},
457 {HW_VENDOR_AMD
, CARD_AMD_RAGE_128PRO
, "ATI Rage Fury", DRIVER_AMD_RAGE_128PRO
, 16 },
458 {HW_VENDOR_AMD
, CARD_AMD_RADEON_7200
, "ATI RADEON 7200 SERIES", DRIVER_AMD_R100
, 32 },
459 {HW_VENDOR_AMD
, CARD_AMD_RADEON_8500
, "ATI RADEON 8500 SERIES", DRIVER_AMD_R100
, 64 },
460 {HW_VENDOR_AMD
, CARD_AMD_RADEON_9500
, "ATI Radeon 9500", DRIVER_AMD_R300
, 64 },
461 {HW_VENDOR_AMD
, CARD_AMD_RADEON_XPRESS_200M
, "ATI RADEON XPRESS 200M Series", DRIVER_AMD_R300
, 64 },
462 {HW_VENDOR_AMD
, CARD_AMD_RADEON_X700
, "ATI Radeon X700 SE", DRIVER_AMD_R300
, 128 },
463 {HW_VENDOR_AMD
, CARD_AMD_RADEON_X1600
, "ATI Radeon X1600 Series", DRIVER_AMD_R300
, 128 },
464 {HW_VENDOR_AMD
, CARD_AMD_RADEON_HD2350
, "ATI Mobility Radeon HD 2350", DRIVER_AMD_R600
, 256 },
465 {HW_VENDOR_AMD
, CARD_AMD_RADEON_HD2600
, "ATI Mobility Radeon HD 2600", DRIVER_AMD_R600
, 256 },
466 {HW_VENDOR_AMD
, CARD_AMD_RADEON_HD2900
, "ATI Radeon HD 2900 XT", DRIVER_AMD_R600
, 512 },
467 {HW_VENDOR_AMD
, CARD_AMD_RADEON_HD3200
, "ATI Radeon HD 3200 Graphics", DRIVER_AMD_R600
, 128 },
468 {HW_VENDOR_AMD
, CARD_AMD_RADEON_HD3850
, "ATI Radeon HD 3850 AGP", DRIVER_AMD_R600
, 512 },
469 {HW_VENDOR_AMD
, CARD_AMD_RADEON_HD4200M
, "ATI Mobility Radeon HD 4200", DRIVER_AMD_R600
, 256 },
470 {HW_VENDOR_AMD
, CARD_AMD_RADEON_HD4350
, "ATI Radeon HD 4350", DRIVER_AMD_R600
, 256 },
471 {HW_VENDOR_AMD
, CARD_AMD_RADEON_HD4600
, "ATI Radeon HD 4600 Series", DRIVER_AMD_R600
, 512 },
472 {HW_VENDOR_AMD
, CARD_AMD_RADEON_HD4700
, "ATI Radeon HD 4700 Series", DRIVER_AMD_R600
, 512 },
473 {HW_VENDOR_AMD
, CARD_AMD_RADEON_HD4800
, "ATI Radeon HD 4800 Series", DRIVER_AMD_R600
, 512 },
474 {HW_VENDOR_AMD
, CARD_AMD_RADEON_HD5400
, "ATI Radeon HD 5400 Series", DRIVER_AMD_R600
, 512 },
475 {HW_VENDOR_AMD
, CARD_AMD_RADEON_HD5600
, "ATI Radeon HD 5600 Series", DRIVER_AMD_R600
, 512 },
476 {HW_VENDOR_AMD
, CARD_AMD_RADEON_HD5700
, "ATI Radeon HD 5700 Series", DRIVER_AMD_R600
, 512 },
477 {HW_VENDOR_AMD
, CARD_AMD_RADEON_HD5800
, "ATI Radeon HD 5800 Series", DRIVER_AMD_R600
, 1024},
478 {HW_VENDOR_AMD
, CARD_AMD_RADEON_HD5900
, "ATI Radeon HD 5900 Series", DRIVER_AMD_R600
, 1024},
479 {HW_VENDOR_AMD
, CARD_AMD_RADEON_HD6300
, "AMD Radeon HD 6300 series Graphics", DRIVER_AMD_R600
, 1024},
480 {HW_VENDOR_AMD
, CARD_AMD_RADEON_HD6400
, "AMD Radeon HD 6400 Series", DRIVER_AMD_R600
, 1024},
481 {HW_VENDOR_AMD
, CARD_AMD_RADEON_HD6410D
, "AMD Radeon HD 6410D", DRIVER_AMD_R600
, 1024},
482 {HW_VENDOR_AMD
, CARD_AMD_RADEON_HD6480G
, "AMD Radeon HD 6480G", DRIVER_AMD_R600
, 512 },
483 {HW_VENDOR_AMD
, CARD_AMD_RADEON_HD6490M
, "AMD Radeon HD 6490M", DRIVER_AMD_R600
, 1024},
484 {HW_VENDOR_AMD
, CARD_AMD_RADEON_HD6550D
, "AMD Radeon HD 6550D", DRIVER_AMD_R600
, 1024},
485 {HW_VENDOR_AMD
, CARD_AMD_RADEON_HD6600
, "AMD Radeon HD 6600 Series", DRIVER_AMD_R600
, 1024},
486 {HW_VENDOR_AMD
, CARD_AMD_RADEON_HD6600M
, "AMD Radeon HD 6600M Series", DRIVER_AMD_R600
, 512 },
487 {HW_VENDOR_AMD
, CARD_AMD_RADEON_HD6700
, "AMD Radeon HD 6700 Series", DRIVER_AMD_R600
, 1024},
488 {HW_VENDOR_AMD
, CARD_AMD_RADEON_HD6800
, "AMD Radeon HD 6800 Series", DRIVER_AMD_R600
, 1024},
489 {HW_VENDOR_AMD
, CARD_AMD_RADEON_HD6900
, "AMD Radeon HD 6900 Series", DRIVER_AMD_R600
, 2048},
490 {HW_VENDOR_AMD
, CARD_AMD_RADEON_HD7660D
, "AMD Radeon HD 7660D", DRIVER_AMD_R600
, 2048},
491 {HW_VENDOR_AMD
, CARD_AMD_RADEON_HD7700
, "AMD Radeon HD 7700 Series", DRIVER_AMD_R600
, 1024},
492 {HW_VENDOR_AMD
, CARD_AMD_RADEON_HD7800
, "AMD Radeon HD 7800 Series", DRIVER_AMD_R600
, 2048},
493 {HW_VENDOR_AMD
, CARD_AMD_RADEON_HD7870
, "AMD Radeon HD 7870 Series", DRIVER_AMD_R600
, 2048},
494 {HW_VENDOR_AMD
, CARD_AMD_RADEON_HD7900
, "AMD Radeon HD 7900 Series", DRIVER_AMD_R600
, 2048},
495 {HW_VENDOR_AMD
, CARD_AMD_RADEON_HD8600M
, "AMD Radeon HD 8600M Series", DRIVER_AMD_R600
, 1024},
496 {HW_VENDOR_AMD
, CARD_AMD_RADEON_HD8670
, "AMD Radeon HD 8670", DRIVER_AMD_R600
, 2048},
497 {HW_VENDOR_AMD
, CARD_AMD_RADEON_HD8770
, "AMD Radeon HD 8770", DRIVER_AMD_R600
, 2048},
498 {HW_VENDOR_AMD
, CARD_AMD_RADEON_R3
, "AMD Radeon HD 8400 / R3 Series", DRIVER_AMD_R600
, 2048},
499 {HW_VENDOR_AMD
, CARD_AMD_RADEON_R7
, "AMD Radeon(TM) R7 Graphics", DRIVER_AMD_R600
, 2048},
500 {HW_VENDOR_AMD
, CARD_AMD_RADEON_R9_285
, "AMD Radeon R9 285", DRIVER_AMD_RX
, 2048},
501 {HW_VENDOR_AMD
, CARD_AMD_RADEON_R9_290
, "AMD Radeon R9 290", DRIVER_AMD_RX
, 4096},
502 {HW_VENDOR_AMD
, CARD_AMD_RADEON_R9_290X
, "AMD Radeon R9 290X", DRIVER_AMD_RX
, 4096},
503 {HW_VENDOR_AMD
, CARD_AMD_RADEON_R9_FURY
, "AMD Radeon (TM) R9 Fury Series", DRIVER_AMD_RX
, 4096},
504 {HW_VENDOR_AMD
, CARD_AMD_RADEON_R9_M370X
, "AMD Radeon R9 M370X", DRIVER_AMD_RX
, 2048},
505 {HW_VENDOR_AMD
, CARD_AMD_RADEON_R9_M380
, "AMD Radeon R9 M380", DRIVER_AMD_RX
, 2048},
506 {HW_VENDOR_AMD
, CARD_AMD_RADEON_R9_M395X
, "AMD Radeon R9 M395X", DRIVER_AMD_RX
, 4096},
507 {HW_VENDOR_AMD
, CARD_AMD_RADEON_RX_460
, "Radeon(TM) RX 460 Graphics", DRIVER_AMD_RX
, 4096},
508 {HW_VENDOR_AMD
, CARD_AMD_RADEON_RX_480
, "Radeon (TM) RX 480 Graphics", DRIVER_AMD_RX
, 4096},
509 {HW_VENDOR_AMD
, CARD_AMD_RADEON_RX_VEGA_10
, "Radeon RX Vega", DRIVER_AMD_RX
, 8192},
510 {HW_VENDOR_AMD
, CARD_AMD_RADEON_RX_VEGA_12
, "Radeon Pro Vega 20", DRIVER_AMD_RX
, 4096},
511 {HW_VENDOR_AMD
, CARD_AMD_RADEON_RAVEN
, "AMD Radeon(TM) Vega 10 Mobile Graphics", DRIVER_AMD_RX
, 1024},
512 {HW_VENDOR_AMD
, CARD_AMD_RADEON_RX_VEGA_20
, "Radeon RX Vega 20", DRIVER_AMD_RX
, 4096},
513 {HW_VENDOR_AMD
, CARD_AMD_RADEON_RX_NAVI_10
, "Radeon RX 5700 / 5700 XT", DRIVER_AMD_RX
, 8192},
516 {HW_VENDOR_REDHAT
, CARD_REDHAT_VIRGL
, "Red Hat VirtIO GPU", DRIVER_REDHAT_VIRGL
, 1024},
519 {HW_VENDOR_VMWARE
, CARD_VMWARE_SVGA3D
, "VMware SVGA 3D (Microsoft Corporation - WDDM)", DRIVER_VMWARE
, 1024},
522 {HW_VENDOR_INTEL
, CARD_INTEL_830M
, "Intel(R) 82830M Graphics Controller", DRIVER_INTEL_GMA800
, 32 },
523 {HW_VENDOR_INTEL
, CARD_INTEL_855GM
, "Intel(R) 82852/82855 GM/GME Graphics Controller", DRIVER_INTEL_GMA800
, 32 },
524 {HW_VENDOR_INTEL
, CARD_INTEL_845G
, "Intel(R) 845G", DRIVER_INTEL_GMA800
, 32 },
525 {HW_VENDOR_INTEL
, CARD_INTEL_865G
, "Intel(R) 82865G Graphics Controller", DRIVER_INTEL_GMA800
, 32 },
526 {HW_VENDOR_INTEL
, CARD_INTEL_915G
, "Intel(R) 82915G/GV/910GL Express Chipset Family", DRIVER_INTEL_GMA900
, 64 },
527 {HW_VENDOR_INTEL
, CARD_INTEL_E7221G
, "Intel(R) E7221G", DRIVER_INTEL_GMA900
, 64 },
528 {HW_VENDOR_INTEL
, CARD_INTEL_915GM
, "Mobile Intel(R) 915GM/GMS,910GML Express Chipset Family", DRIVER_INTEL_GMA900
, 64 },
529 {HW_VENDOR_INTEL
, CARD_INTEL_945G
, "Intel(R) 945G", DRIVER_INTEL_GMA950
, 64 },
530 {HW_VENDOR_INTEL
, CARD_INTEL_945GM
, "Mobile Intel(R) 945GM Express Chipset Family", DRIVER_INTEL_GMA950
, 64 },
531 {HW_VENDOR_INTEL
, CARD_INTEL_945GME
, "Intel(R) 945GME", DRIVER_INTEL_GMA950
, 64 },
532 {HW_VENDOR_INTEL
, CARD_INTEL_Q35
, "Intel(R) Q35", DRIVER_INTEL_GMA950
, 64 },
533 {HW_VENDOR_INTEL
, CARD_INTEL_G33
, "Intel(R) G33", DRIVER_INTEL_GMA950
, 64 },
534 {HW_VENDOR_INTEL
, CARD_INTEL_Q33
, "Intel(R) Q33", DRIVER_INTEL_GMA950
, 64 },
535 {HW_VENDOR_INTEL
, CARD_INTEL_PNVG
, "Intel(R) IGD", DRIVER_INTEL_GMA950
, 64 },
536 {HW_VENDOR_INTEL
, CARD_INTEL_PNVM
, "Intel(R) IGD", DRIVER_INTEL_GMA950
, 64 },
537 {HW_VENDOR_INTEL
, CARD_INTEL_965Q
, "Intel(R) 965Q", DRIVER_INTEL_GMA3000
, 128},
538 {HW_VENDOR_INTEL
, CARD_INTEL_965G
, "Intel(R) 965G", DRIVER_INTEL_GMA3000
, 128},
539 {HW_VENDOR_INTEL
, CARD_INTEL_946GZ
, "Intel(R) 946GZ", DRIVER_INTEL_GMA3000
, 128},
540 {HW_VENDOR_INTEL
, CARD_INTEL_965GM
, "Mobile Intel(R) 965 Express Chipset Family", DRIVER_INTEL_GMA3000
, 128},
541 {HW_VENDOR_INTEL
, CARD_INTEL_965GME
, "Intel(R) 965GME", DRIVER_INTEL_GMA3000
, 128},
542 {HW_VENDOR_INTEL
, CARD_INTEL_GM45
, "Mobile Intel(R) GM45 Express Chipset Family", DRIVER_INTEL_GMA3000
, 512},
543 {HW_VENDOR_INTEL
, CARD_INTEL_IGD
, "Intel(R) Integrated Graphics Device", DRIVER_INTEL_GMA3000
, 512},
544 {HW_VENDOR_INTEL
, CARD_INTEL_G45
, "Intel(R) G45/G43", DRIVER_INTEL_GMA3000
, 512},
545 {HW_VENDOR_INTEL
, CARD_INTEL_Q45
, "Intel(R) Q45/Q43", DRIVER_INTEL_GMA3000
, 512},
546 {HW_VENDOR_INTEL
, CARD_INTEL_G41
, "Intel(R) G41", DRIVER_INTEL_GMA3000
, 512},
547 {HW_VENDOR_INTEL
, CARD_INTEL_B43
, "Intel(R) B43", DRIVER_INTEL_GMA3000
, 512},
548 {HW_VENDOR_INTEL
, CARD_INTEL_ILKD
, "Intel(R) HD Graphics", DRIVER_INTEL_GMA3000
, 1536},
549 {HW_VENDOR_INTEL
, CARD_INTEL_ILKM
, "Intel(R) HD Graphics", DRIVER_INTEL_GMA3000
, 1536},
550 {HW_VENDOR_INTEL
, CARD_INTEL_SNBD
, "Intel(R) HD Graphics 3000", DRIVER_INTEL_GMA3000
, 1536},
551 {HW_VENDOR_INTEL
, CARD_INTEL_SNBM
, "Intel(R) HD Graphics 3000", DRIVER_INTEL_GMA3000
, 1536},
552 {HW_VENDOR_INTEL
, CARD_INTEL_SNBS
, "Intel(R) HD Graphics Family", DRIVER_INTEL_GMA3000
, 1536},
553 {HW_VENDOR_INTEL
, CARD_INTEL_IVBD
, "Intel(R) HD Graphics 4000", DRIVER_INTEL_HD4000
, 1536},
554 {HW_VENDOR_INTEL
, CARD_INTEL_IVBM
, "Intel(R) HD Graphics 4000", DRIVER_INTEL_HD4000
, 1536},
555 {HW_VENDOR_INTEL
, CARD_INTEL_IVBS
, "Intel(R) HD Graphics Family", DRIVER_INTEL_HD4000
, 1536},
556 {HW_VENDOR_INTEL
, CARD_INTEL_HWD
, "Intel(R) HD Graphics 4600", DRIVER_INTEL_HD4000
, 1536},
557 {HW_VENDOR_INTEL
, CARD_INTEL_HWM
, "Intel(R) HD Graphics 4600", DRIVER_INTEL_HD4000
, 1536},
558 {HW_VENDOR_INTEL
, CARD_INTEL_HD5000_1
, "Intel(R) HD Graphics 5000", DRIVER_INTEL_HD4000
, 1536},
559 {HW_VENDOR_INTEL
, CARD_INTEL_HD5000_2
, "Intel(R) HD Graphics 5000", DRIVER_INTEL_HD4000
, 1536},
560 {HW_VENDOR_INTEL
, CARD_INTEL_I5100_1
, "Intel(R) Iris(TM) Graphics 5100", DRIVER_INTEL_HD4000
, 1536},
561 {HW_VENDOR_INTEL
, CARD_INTEL_I5100_2
, "Intel(R) Iris(TM) Graphics 5100", DRIVER_INTEL_HD4000
, 1536},
562 {HW_VENDOR_INTEL
, CARD_INTEL_I5100_3
, "Intel(R) Iris(TM) Graphics 5100", DRIVER_INTEL_HD4000
, 1536},
563 {HW_VENDOR_INTEL
, CARD_INTEL_I5100_4
, "Intel(R) Iris(TM) Graphics 5100", DRIVER_INTEL_HD4000
, 1536},
564 {HW_VENDOR_INTEL
, CARD_INTEL_IP5200_1
, "Intel(R) Iris(TM) Pro Graphics 5200", DRIVER_INTEL_HD4000
, 1536},
565 {HW_VENDOR_INTEL
, CARD_INTEL_IP5200_2
, "Intel(R) Iris(TM) Pro Graphics 5200", DRIVER_INTEL_HD4000
, 1536},
566 {HW_VENDOR_INTEL
, CARD_INTEL_IP5200_3
, "Intel(R) Iris(TM) Pro Graphics 5200", DRIVER_INTEL_HD4000
, 1536},
567 {HW_VENDOR_INTEL
, CARD_INTEL_IP5200_4
, "Intel(R) Iris(TM) Pro Graphics 5200", DRIVER_INTEL_HD4000
, 1536},
568 {HW_VENDOR_INTEL
, CARD_INTEL_IP5200_5
, "Intel(R) Iris(TM) Pro Graphics 5200", DRIVER_INTEL_HD4000
, 1536},
569 {HW_VENDOR_INTEL
, CARD_INTEL_IP5200_6
, "Intel(R) Iris(TM) Pro Graphics 5200", DRIVER_INTEL_HD4000
, 2048},
570 {HW_VENDOR_INTEL
, CARD_INTEL_HD5300
, "Intel(R) HD Graphics 5300", DRIVER_INTEL_HD4000
, 2048},
571 {HW_VENDOR_INTEL
, CARD_INTEL_HD5500
, "Intel(R) HD Graphics 5500", DRIVER_INTEL_HD4000
, 2048},
572 {HW_VENDOR_INTEL
, CARD_INTEL_HD5600
, "Intel(R) HD Graphics 5600", DRIVER_INTEL_HD4000
, 2048},
573 {HW_VENDOR_INTEL
, CARD_INTEL_HD6000
, "Intel(R) HD Graphics 6000", DRIVER_INTEL_HD4000
, 2048},
574 {HW_VENDOR_INTEL
, CARD_INTEL_I6100
, "Intel(R) Iris(TM) Graphics 6100", DRIVER_INTEL_HD4000
, 2048},
575 {HW_VENDOR_INTEL
, CARD_INTEL_IP6200
, "Intel(R) Iris(TM) Pro Graphics 6200", DRIVER_INTEL_HD4000
, 2048},
576 {HW_VENDOR_INTEL
, CARD_INTEL_IPP6300
, "Intel(R) Iris(TM) Pro Graphics P6300", DRIVER_INTEL_HD4000
, 2048},
577 {HW_VENDOR_INTEL
, CARD_INTEL_HD510_1
, "Intel(R) HD Graphics 510", DRIVER_INTEL_HD4000
, 2048},
578 {HW_VENDOR_INTEL
, CARD_INTEL_HD510_2
, "Intel(R) HD Graphics 510", DRIVER_INTEL_HD4000
, 2048},
579 {HW_VENDOR_INTEL
, CARD_INTEL_HD510_3
, "Intel(R) HD Graphics 510", DRIVER_INTEL_HD4000
, 2048},
580 {HW_VENDOR_INTEL
, CARD_INTEL_HD515
, "Intel(R) HD Graphics 515", DRIVER_INTEL_HD4000
, 2048},
581 {HW_VENDOR_INTEL
, CARD_INTEL_HD520_1
, "Intel(R) HD Graphics 520", DRIVER_INTEL_HD4000
, 2048},
582 {HW_VENDOR_INTEL
, CARD_INTEL_HD520_2
, "Intel(R) HD Graphics 520", DRIVER_INTEL_HD4000
, 2048},
583 {HW_VENDOR_INTEL
, CARD_INTEL_HD530_1
, "Intel(R) HD Graphics 530", DRIVER_INTEL_HD4000
, 2048},
584 {HW_VENDOR_INTEL
, CARD_INTEL_HD530_2
, "Intel(R) HD Graphics 530", DRIVER_INTEL_HD4000
, 2048},
585 {HW_VENDOR_INTEL
, CARD_INTEL_HDP530
, "Intel(R) HD Graphics P530", DRIVER_INTEL_HD4000
, 2048},
586 {HW_VENDOR_INTEL
, CARD_INTEL_I540
, "Intel(R) Iris(TM) Graphics 540", DRIVER_INTEL_HD4000
, 2048},
587 {HW_VENDOR_INTEL
, CARD_INTEL_I550
, "Intel(R) Iris(TM) Graphics 550", DRIVER_INTEL_HD4000
, 2048},
588 {HW_VENDOR_INTEL
, CARD_INTEL_I555
, "Intel(R) Iris(TM) Graphics 555", DRIVER_INTEL_HD4000
, 2048},
589 {HW_VENDOR_INTEL
, CARD_INTEL_IP555
, "Intel(R) Iris(TM) Graphics P555", DRIVER_INTEL_HD4000
, 2048},
590 {HW_VENDOR_INTEL
, CARD_INTEL_IP580_1
, "Intel(R) Iris(TM) Pro Graphics 580", DRIVER_INTEL_HD4000
, 2048},
591 {HW_VENDOR_INTEL
, CARD_INTEL_IP580_2
, "Intel(R) Iris(TM) Pro Graphics 580", DRIVER_INTEL_HD4000
, 2048},
592 {HW_VENDOR_INTEL
, CARD_INTEL_IPP580_1
, "Intel(R) Iris(TM) Pro Graphics P580", DRIVER_INTEL_HD4000
, 2048},
593 {HW_VENDOR_INTEL
, CARD_INTEL_IPP580_2
, "Intel(R) Iris(TM) Pro Graphics P580", DRIVER_INTEL_HD4000
, 2048},
594 {HW_VENDOR_INTEL
, CARD_INTEL_UHD617
, "Intel(R) UHD Graphics 617", DRIVER_INTEL_HD4000
, 2048},
595 {HW_VENDOR_INTEL
, CARD_INTEL_UHD620
, "Intel(R) UHD Graphics 620", DRIVER_INTEL_HD4000
, 3072},
596 {HW_VENDOR_INTEL
, CARD_INTEL_HD615
, "Intel(R) HD Graphics 615", DRIVER_INTEL_HD4000
, 2048},
597 {HW_VENDOR_INTEL
, CARD_INTEL_HD620
, "Intel(R) HD Graphics 620", DRIVER_INTEL_HD4000
, 3072},
598 {HW_VENDOR_INTEL
, CARD_INTEL_HD630_1
, "Intel(R) HD Graphics 630", DRIVER_INTEL_HD4000
, 3072},
599 {HW_VENDOR_INTEL
, CARD_INTEL_HD630_2
, "Intel(R) HD Graphics 630", DRIVER_INTEL_HD4000
, 3072},
602 static const struct driver_version_information
*get_driver_version_info(enum wined3d_display_driver driver
,
603 enum wined3d_driver_model driver_model
)
607 TRACE("Looking up version info for driver %#x, driver_model %#x.\n", driver
, driver_model
);
609 for (i
= 0; i
< ARRAY_SIZE(driver_version_table
); ++i
)
611 const struct driver_version_information
*entry
= &driver_version_table
[i
];
613 if (entry
->driver
== driver
&& (driver_model
== DRIVER_MODEL_GENERIC
614 || entry
->driver_model
== driver_model
))
616 TRACE("Found driver \"%s\", subversion %u, build %u.\n",
617 entry
->driver_name
, entry
->subversion
, entry
->build
);
624 const struct wined3d_gpu_description
*wined3d_get_gpu_description(enum wined3d_pci_vendor vendor
,
625 enum wined3d_pci_device device
)
629 for (i
= 0; i
< ARRAY_SIZE(gpu_description_table
); ++i
)
631 if (vendor
== gpu_description_table
[i
].vendor
&& device
== gpu_description_table
[i
].device
)
632 return &gpu_description_table
[i
];
638 const struct wined3d_gpu_description
*wined3d_get_user_override_gpu_description(enum wined3d_pci_vendor vendor
,
639 enum wined3d_pci_device device
)
641 const struct wined3d_gpu_description
*gpu_desc
;
642 static unsigned int once
;
644 if (wined3d_settings
.pci_vendor_id
== PCI_VENDOR_NONE
&& wined3d_settings
.pci_device_id
== PCI_DEVICE_NONE
)
647 if (wined3d_settings
.pci_vendor_id
!= PCI_VENDOR_NONE
)
649 vendor
= wined3d_settings
.pci_vendor_id
;
650 TRACE("Overriding vendor PCI ID with 0x%04x.\n", vendor
);
652 if (wined3d_settings
.pci_device_id
!= PCI_DEVICE_NONE
)
654 device
= wined3d_settings
.pci_device_id
;
655 TRACE("Overriding device PCI ID with 0x%04x.\n", device
);
658 if (!(gpu_desc
= wined3d_get_gpu_description(vendor
, device
)) && !once
++)
659 ERR_(winediag
)("Invalid GPU override %04x:%04x specified, ignoring.\n", vendor
, device
);
664 static void wined3d_copy_name(char *dst
, const char *src
, unsigned int dst_size
)
670 len
= min(strlen(src
), dst_size
- 1);
671 memcpy(dst
, src
, len
);
672 memset(&dst
[len
], 0, dst_size
- len
);
676 bool wined3d_driver_info_init(struct wined3d_driver_info
*driver_info
,
677 const struct wined3d_gpu_description
*gpu_desc
, enum wined3d_feature_level feature_level
,
678 UINT64 vram_bytes
, UINT64 sysmem_bytes
)
680 const struct driver_version_information
*version_info
;
681 WORD driver_os_version
, driver_feature_level
= 10;
682 enum wined3d_driver_model driver_model
;
683 enum wined3d_display_driver driver
;
684 MEMORYSTATUSEX memory_status
;
685 OSVERSIONINFOW os_version
;
687 memset(&os_version
, 0, sizeof(os_version
));
688 os_version
.dwOSVersionInfoSize
= sizeof(os_version
);
689 if (!GetVersionExW(&os_version
))
691 ERR("Failed to get OS version, reporting 2000/XP.\n");
692 driver_os_version
= 6;
693 driver_model
= DRIVER_MODEL_NT5X
;
697 TRACE("OS version %u.%u.\n", os_version
.dwMajorVersion
, os_version
.dwMinorVersion
);
698 switch (os_version
.dwMajorVersion
)
703 /* If needed we could distinguish between 9x and NT4, but this code won't make
704 * sense for NT4 since it had no way to obtain this info through DirectDraw 3.0.
706 driver_os_version
= 4;
707 driver_model
= DRIVER_MODEL_WIN9X
;
711 driver_os_version
= 6;
712 driver_model
= DRIVER_MODEL_NT5X
;
716 if (os_version
.dwMinorVersion
== 0)
718 driver_os_version
= 7;
719 driver_model
= DRIVER_MODEL_NT6X
;
721 else if (os_version
.dwMinorVersion
== 1)
723 driver_os_version
= 8;
724 driver_model
= DRIVER_MODEL_NT6X
;
726 else if (os_version
.dwMinorVersion
== 2)
728 driver_os_version
= 9;
729 driver_model
= DRIVER_MODEL_NT6X
;
733 if (os_version
.dwMinorVersion
> 3)
735 FIXME("Unhandled OS version %u.%u, reporting Windows 8.1.\n",
736 os_version
.dwMajorVersion
, os_version
.dwMinorVersion
);
738 driver_os_version
= 10;
739 driver_model
= DRIVER_MODEL_NT6X
;
744 driver_os_version
= 26;
745 driver_model
= DRIVER_MODEL_NT6X
;
749 FIXME("Unhandled OS version %u.%u, reporting Windows 7.\n",
750 os_version
.dwMajorVersion
, os_version
.dwMinorVersion
);
751 driver_os_version
= 8;
752 driver_model
= DRIVER_MODEL_NT6X
;
757 TRACE("GPU maximum feature level %#x.\n", feature_level
);
758 switch (feature_level
)
760 case WINED3D_FEATURE_LEVEL_NONE
:
761 case WINED3D_FEATURE_LEVEL_5
:
762 if (driver_model
== DRIVER_MODEL_WIN9X
)
763 driver_feature_level
= 5;
765 driver_feature_level
= 10;
767 case WINED3D_FEATURE_LEVEL_6
:
768 driver_feature_level
= 11;
770 case WINED3D_FEATURE_LEVEL_7
:
771 driver_feature_level
= 12;
773 case WINED3D_FEATURE_LEVEL_8
:
774 driver_feature_level
= 13;
776 case WINED3D_FEATURE_LEVEL_9_1
:
777 case WINED3D_FEATURE_LEVEL_9_2
:
778 case WINED3D_FEATURE_LEVEL_9_3
:
779 driver_feature_level
= 14;
781 case WINED3D_FEATURE_LEVEL_10
:
782 driver_feature_level
= 15;
784 case WINED3D_FEATURE_LEVEL_10_1
:
785 driver_feature_level
= 16;
787 case WINED3D_FEATURE_LEVEL_11
:
788 driver_feature_level
= 17;
790 case WINED3D_FEATURE_LEVEL_11_1
:
791 /* Advertise support for everything up to FL 12_x. */
792 driver_feature_level
= 21;
795 if (os_version
.dwMajorVersion
== 6 && !os_version
.dwMinorVersion
)
796 driver_feature_level
= min(driver_feature_level
, 18);
797 else if (os_version
.dwMajorVersion
< 6)
798 driver_feature_level
= min(driver_feature_level
, 14);
800 driver_info
->vendor
= gpu_desc
->vendor
;
801 driver_info
->device
= gpu_desc
->device
;
802 wined3d_copy_name(driver_info
->description
, gpu_desc
->description
, ARRAY_SIZE(driver_info
->description
));
803 driver_info
->vram_bytes
= vram_bytes
? vram_bytes
: (UINT64
)gpu_desc
->vidmem
* 1024 * 1024;
804 driver
= gpu_desc
->driver
;
806 if (wined3d_settings
.emulated_textureram
)
808 driver_info
->vram_bytes
= wined3d_settings
.emulated_textureram
;
809 TRACE("Overriding amount of video memory with 0x%s bytes.\n",
810 wine_dbgstr_longlong(driver_info
->vram_bytes
));
814 * Diablo 2 crashes when the amount of video memory is greater than 0x7fffffff.
815 * In order to avoid this application bug we limit the amount of video memory
816 * to LONG_MAX for older Windows versions.
818 if (driver_model
< DRIVER_MODEL_NT6X
&& driver_info
->vram_bytes
> LONG_MAX
)
820 TRACE("Limiting amount of video memory to %#lx bytes for OS version older than Vista.\n", LONG_MAX
);
821 driver_info
->vram_bytes
= LONG_MAX
;
824 if (!(driver_info
->sysmem_bytes
= sysmem_bytes
))
826 driver_info
->sysmem_bytes
= 64 * 1024 * 1024;
827 memory_status
.dwLength
= sizeof(memory_status
);
828 if (GlobalMemoryStatusEx(&memory_status
))
829 driver_info
->sysmem_bytes
= max(memory_status
.ullTotalPhys
/ 2, driver_info
->sysmem_bytes
);
831 ERR("Failed to get global memory status.\n");
834 /* Try to obtain driver version information for the current Windows version. This fails in
836 * - the gpu is not available on the currently selected OS version:
837 * - Geforce GTX480 on Win98. When running applications in compatibility mode on Windows,
838 * version information for the current Windows version is returned instead of faked info.
839 * We do the same and assume the default Windows version to emulate is WinXP.
841 * - Videocard is a Riva TNT but winver is set to win7 (there are no drivers for this beast)
842 * For now return the XP driver info. Perhaps later on we should return VESA.
844 * - the gpu is not in our database (can happen when the user overrides the vendor_id / device_id)
845 * This could be an indication that our database is not up to date, so this should be fixed.
847 if ((version_info
= get_driver_version_info(driver
, driver_model
))
848 || (version_info
= get_driver_version_info(driver
, DRIVER_MODEL_GENERIC
)))
850 driver_info
->name
= version_info
->driver_name
;
851 driver_info
->version_high
= MAKEDWORD_VERSION(driver_os_version
, driver_feature_level
);
852 driver_info
->version_low
= MAKEDWORD_VERSION(version_info
->subversion
, version_info
->build
);
857 ERR("No driver version info found for device %04x:%04x, driver model %#x.\n",
858 driver_info
->vendor
, driver_info
->device
, driver_model
);
862 enum wined3d_pci_device
wined3d_gpu_from_feature_level(enum wined3d_pci_vendor
*vendor
,
863 enum wined3d_feature_level feature_level
)
865 static const struct wined3d_fallback_card
867 enum wined3d_feature_level feature_level
;
868 enum wined3d_pci_device device_id
;
870 card_fallback_nvidia
[] =
872 {WINED3D_FEATURE_LEVEL_5
, CARD_NVIDIA_RIVA_128
},
873 {WINED3D_FEATURE_LEVEL_6
, CARD_NVIDIA_RIVA_TNT
},
874 {WINED3D_FEATURE_LEVEL_7
, CARD_NVIDIA_GEFORCE
},
875 {WINED3D_FEATURE_LEVEL_8
, CARD_NVIDIA_GEFORCE3
},
876 {WINED3D_FEATURE_LEVEL_9_2
, CARD_NVIDIA_GEFORCEFX_5800
},
877 {WINED3D_FEATURE_LEVEL_9_3
, CARD_NVIDIA_GEFORCE_6800
},
878 {WINED3D_FEATURE_LEVEL_10
, CARD_NVIDIA_GEFORCE_8800GTX
},
879 {WINED3D_FEATURE_LEVEL_11
, CARD_NVIDIA_GEFORCE_GTX470
},
880 {WINED3D_FEATURE_LEVEL_NONE
},
882 card_fallback_amd
[] =
884 {WINED3D_FEATURE_LEVEL_5
, CARD_AMD_RAGE_128PRO
},
885 {WINED3D_FEATURE_LEVEL_7
, CARD_AMD_RADEON_7200
},
886 {WINED3D_FEATURE_LEVEL_8
, CARD_AMD_RADEON_8500
},
887 {WINED3D_FEATURE_LEVEL_9_1
, CARD_AMD_RADEON_9500
},
888 {WINED3D_FEATURE_LEVEL_9_3
, CARD_AMD_RADEON_X1600
},
889 {WINED3D_FEATURE_LEVEL_10
, CARD_AMD_RADEON_HD2900
},
890 {WINED3D_FEATURE_LEVEL_11
, CARD_AMD_RADEON_HD5600
},
891 {WINED3D_FEATURE_LEVEL_NONE
},
893 card_fallback_intel
[] =
895 {WINED3D_FEATURE_LEVEL_5
, CARD_INTEL_845G
},
896 {WINED3D_FEATURE_LEVEL_8
, CARD_INTEL_915G
},
897 {WINED3D_FEATURE_LEVEL_9_3
, CARD_INTEL_945G
},
898 {WINED3D_FEATURE_LEVEL_10
, CARD_INTEL_G45
},
899 {WINED3D_FEATURE_LEVEL_11
, CARD_INTEL_IVBD
},
900 {WINED3D_FEATURE_LEVEL_NONE
},
905 enum wined3d_pci_vendor vendor
;
906 const struct wined3d_fallback_card
*cards
;
910 {HW_VENDOR_AMD
, card_fallback_amd
},
911 {HW_VENDOR_NVIDIA
, card_fallback_nvidia
},
912 {HW_VENDOR_VMWARE
, card_fallback_amd
},
913 {HW_VENDOR_INTEL
, card_fallback_intel
},
916 const struct wined3d_fallback_card
*cards
;
917 enum wined3d_pci_device device_id
;
921 for (i
= 0; i
< ARRAY_SIZE(fallbacks
); ++i
)
923 if (*vendor
== fallbacks
[i
].vendor
)
924 cards
= fallbacks
[i
].cards
;
928 *vendor
= HW_VENDOR_NVIDIA
;
929 cards
= card_fallback_nvidia
;
932 device_id
= cards
->device_id
;
933 for (i
= 0; cards
[i
].feature_level
; ++i
)
935 if (feature_level
>= cards
[i
].feature_level
)
936 device_id
= cards
[i
].device_id
;
941 struct wined3d_adapter
* CDECL
wined3d_get_adapter(const struct wined3d
*wined3d
, unsigned int idx
)
943 TRACE("wined3d %p, idx %u.\n", wined3d
, idx
);
945 if (idx
>= wined3d
->adapter_count
)
948 return wined3d
->adapters
[idx
];
951 UINT CDECL
wined3d_get_adapter_count(const struct wined3d
*wined3d
)
953 TRACE("wined3d %p, reporting %u adapters.\n",
954 wined3d
, wined3d
->adapter_count
);
956 return wined3d
->adapter_count
;
959 struct wined3d_output
* CDECL
wined3d_adapter_get_output(const struct wined3d_adapter
*adapter
,
962 TRACE("adapter %p, idx %u.\n", adapter
, idx
);
964 if (idx
>= adapter
->output_count
)
967 return &adapter
->outputs
[idx
];
970 unsigned int CDECL
wined3d_adapter_get_output_count(const struct wined3d_adapter
*adapter
)
972 TRACE("adapter %p, reporting %u outputs.\n", adapter
, adapter
->output_count
);
974 return adapter
->output_count
;
977 HRESULT CDECL
wined3d_register_software_device(struct wined3d
*wined3d
, void *init_function
)
979 FIXME("wined3d %p, init_function %p stub!\n", wined3d
, init_function
);
984 static BOOL CALLBACK
enum_monitor_proc(HMONITOR monitor
, HDC hdc
, RECT
*rect
, LPARAM lparam
)
986 struct wined3d_output_desc
*desc
= (struct wined3d_output_desc
*)lparam
;
987 MONITORINFOEXW monitor_info
;
989 monitor_info
.cbSize
= sizeof(monitor_info
);
990 if (GetMonitorInfoW(monitor
, (MONITORINFO
*)&monitor_info
) &&
991 !lstrcmpiW(desc
->device_name
, monitor_info
.szDevice
))
993 desc
->monitor
= monitor
;
994 desc
->desktop_rect
= monitor_info
.rcMonitor
;
995 desc
->attached_to_desktop
= TRUE
;
1002 HRESULT CDECL
wined3d_output_get_desc(const struct wined3d_output
*output
,
1003 struct wined3d_output_desc
*desc
)
1005 struct wined3d_display_mode mode
;
1007 TRACE("output %p, desc %p.\n", output
, desc
);
1009 memset(desc
, 0, sizeof(*desc
));
1010 desc
->ordinal
= output
->ordinal
;
1011 lstrcpyW(desc
->device_name
, output
->device_name
);
1012 EnumDisplayMonitors(NULL
, NULL
, enum_monitor_proc
, (LPARAM
)desc
);
1013 return wined3d_output_get_display_mode(output
, &mode
, &desc
->rotation
);
1016 /* FIXME: GetAdapterModeCount and EnumAdapterModes currently only returns modes
1017 of the same bpp but different resolutions */
1019 /* Note: dx9 supplies a format. Calls from d3d8 supply WINED3DFMT_UNKNOWN */
1020 unsigned int CDECL
wined3d_output_get_mode_count(const struct wined3d_output
*output
,
1021 enum wined3d_format_id format_id
, enum wined3d_scanline_ordering scanline_ordering
)
1023 const struct wined3d_adapter
*adapter
;
1024 const struct wined3d_format
*format
;
1030 TRACE("output %p, format %s, scanline_ordering %#x.\n",
1031 output
, debug_d3dformat(format_id
), scanline_ordering
);
1033 adapter
= output
->adapter
;
1034 format
= wined3d_get_format(adapter
, format_id
, WINED3D_BIND_RENDER_TARGET
);
1035 format_bits
= format
->byte_count
* CHAR_BIT
;
1037 memset(&mode
, 0, sizeof(mode
));
1038 mode
.dmSize
= sizeof(mode
);
1040 while (EnumDisplaySettingsExW(output
->device_name
, j
++, &mode
, 0))
1042 if (mode
.dmFields
& DM_DISPLAYFLAGS
)
1044 if (scanline_ordering
== WINED3D_SCANLINE_ORDERING_PROGRESSIVE
1045 && (mode
.u2
.dmDisplayFlags
& DM_INTERLACED
))
1048 if (scanline_ordering
== WINED3D_SCANLINE_ORDERING_INTERLACED
1049 && !(mode
.u2
.dmDisplayFlags
& DM_INTERLACED
))
1053 if (format_id
== WINED3DFMT_UNKNOWN
)
1055 /* This is for d3d8, do not enumerate P8 here. */
1056 if (mode
.dmBitsPerPel
== 32 || mode
.dmBitsPerPel
== 16) ++i
;
1058 else if (mode
.dmBitsPerPel
== format_bits
)
1064 TRACE("Returning %u matching modes (out of %u total) for output %p.\n", i
, j
, output
);
1069 /* Note: dx9 supplies a format. Calls from d3d8 supply WINED3DFMT_UNKNOWN */
1070 HRESULT CDECL
wined3d_output_get_mode(const struct wined3d_output
*output
,
1071 enum wined3d_format_id format_id
, enum wined3d_scanline_ordering scanline_ordering
,
1072 unsigned int mode_idx
, struct wined3d_display_mode
*mode
)
1074 const struct wined3d_adapter
*adapter
;
1075 const struct wined3d_format
*format
;
1081 TRACE("output %p, format %s, scanline_ordering %#x, mode_idx %u, mode %p.\n",
1082 output
, debug_d3dformat(format_id
), scanline_ordering
, mode_idx
, mode
);
1085 return WINED3DERR_INVALIDCALL
;
1087 adapter
= output
->adapter
;
1088 format
= wined3d_get_format(adapter
, format_id
, WINED3D_BIND_RENDER_TARGET
);
1089 format_bits
= format
->byte_count
* CHAR_BIT
;
1091 memset(&m
, 0, sizeof(m
));
1092 m
.dmSize
= sizeof(m
);
1094 while (i
<= mode_idx
)
1096 if (!EnumDisplaySettingsExW(output
->device_name
, j
++, &m
, 0))
1098 WARN("Invalid mode_idx %u.\n", mode_idx
);
1099 return WINED3DERR_INVALIDCALL
;
1102 if (m
.dmFields
& DM_DISPLAYFLAGS
)
1104 if (scanline_ordering
== WINED3D_SCANLINE_ORDERING_PROGRESSIVE
1105 && (m
.u2
.dmDisplayFlags
& DM_INTERLACED
))
1108 if (scanline_ordering
== WINED3D_SCANLINE_ORDERING_INTERLACED
1109 && !(m
.u2
.dmDisplayFlags
& DM_INTERLACED
))
1113 if (format_id
== WINED3DFMT_UNKNOWN
)
1115 /* This is for d3d8, do not enumerate P8 here. */
1116 if (m
.dmBitsPerPel
== 32 || m
.dmBitsPerPel
== 16) ++i
;
1118 else if (m
.dmBitsPerPel
== format_bits
)
1124 mode
->width
= m
.dmPelsWidth
;
1125 mode
->height
= m
.dmPelsHeight
;
1126 mode
->refresh_rate
= DEFAULT_REFRESH_RATE
;
1127 if (m
.dmFields
& DM_DISPLAYFREQUENCY
)
1128 mode
->refresh_rate
= m
.dmDisplayFrequency
;
1130 if (format_id
== WINED3DFMT_UNKNOWN
)
1131 mode
->format_id
= pixelformat_for_depth(m
.dmBitsPerPel
);
1133 mode
->format_id
= format_id
;
1135 if (!(m
.dmFields
& DM_DISPLAYFLAGS
))
1136 mode
->scanline_ordering
= WINED3D_SCANLINE_ORDERING_UNKNOWN
;
1137 else if (m
.u2
.dmDisplayFlags
& DM_INTERLACED
)
1138 mode
->scanline_ordering
= WINED3D_SCANLINE_ORDERING_INTERLACED
;
1140 mode
->scanline_ordering
= WINED3D_SCANLINE_ORDERING_PROGRESSIVE
;
1142 TRACE("%ux%u@%u %u bpp, %s %#x.\n", mode
->width
, mode
->height
, mode
->refresh_rate
,
1143 m
.dmBitsPerPel
, debug_d3dformat(mode
->format_id
), mode
->scanline_ordering
);
1148 HRESULT CDECL
wined3d_output_find_closest_matching_mode(const struct wined3d_output
*output
,
1149 struct wined3d_display_mode
*mode
)
1151 unsigned int i
, j
, mode_count
, matching_mode_count
, closest
;
1152 struct wined3d_display_mode
**matching_modes
;
1153 struct wined3d_display_mode
*modes
;
1156 TRACE("output %p, mode %p.\n", output
, mode
);
1158 if (!(mode_count
= wined3d_output_get_mode_count(output
, mode
->format_id
,
1159 WINED3D_SCANLINE_ORDERING_UNKNOWN
)))
1161 WARN("Output has 0 matching modes.\n");
1165 if (!(modes
= heap_calloc(mode_count
, sizeof(*modes
))))
1166 return E_OUTOFMEMORY
;
1167 if (!(matching_modes
= heap_calloc(mode_count
, sizeof(*matching_modes
))))
1170 return E_OUTOFMEMORY
;
1173 for (i
= 0; i
< mode_count
; ++i
)
1175 if (FAILED(hr
= wined3d_output_get_mode(output
, mode
->format_id
,
1176 WINED3D_SCANLINE_ORDERING_UNKNOWN
, i
, &modes
[i
])))
1178 heap_free(matching_modes
);
1182 matching_modes
[i
] = &modes
[i
];
1185 matching_mode_count
= mode_count
;
1187 if (mode
->scanline_ordering
!= WINED3D_SCANLINE_ORDERING_UNKNOWN
)
1189 for (i
= 0, j
= 0; i
< matching_mode_count
; ++i
)
1191 if (matching_modes
[i
]->scanline_ordering
== mode
->scanline_ordering
)
1192 matching_modes
[j
++] = matching_modes
[i
];
1195 matching_mode_count
= j
;
1198 if (mode
->refresh_rate
)
1200 for (i
= 0, j
= 0; i
< matching_mode_count
; ++i
)
1202 if (matching_modes
[i
]->refresh_rate
== mode
->refresh_rate
)
1203 matching_modes
[j
++] = matching_modes
[i
];
1206 matching_mode_count
= j
;
1209 if (!mode
->width
|| !mode
->height
)
1211 struct wined3d_display_mode current_mode
;
1212 if (FAILED(hr
= wined3d_output_get_display_mode(output
, ¤t_mode
, NULL
)))
1214 heap_free(matching_modes
);
1218 mode
->width
= current_mode
.width
;
1219 mode
->height
= current_mode
.height
;
1223 for (i
= 0, j
= 0; i
< matching_mode_count
; ++i
)
1225 unsigned int d
= abs(mode
->width
- matching_modes
[i
]->width
)
1226 + abs(mode
->height
- matching_modes
[i
]->height
);
1235 *mode
= *matching_modes
[j
];
1237 heap_free(matching_modes
);
1240 TRACE("Returning %ux%u@%u %s %#x.\n", mode
->width
, mode
->height
,
1241 mode
->refresh_rate
, debug_d3dformat(mode
->format_id
),
1242 mode
->scanline_ordering
);
1247 struct wined3d_adapter
* CDECL
wined3d_output_get_adapter(const struct wined3d_output
*output
)
1249 TRACE("output %p.\n", output
);
1251 return output
->adapter
;
1254 HRESULT CDECL
wined3d_output_get_display_mode(const struct wined3d_output
*output
,
1255 struct wined3d_display_mode
*mode
, enum wined3d_display_rotation
*rotation
)
1259 TRACE("output %p, display_mode %p, rotation %p.\n", output
, mode
, rotation
);
1262 return WINED3DERR_INVALIDCALL
;
1264 memset(&m
, 0, sizeof(m
));
1265 m
.dmSize
= sizeof(m
);
1267 EnumDisplaySettingsExW(output
->device_name
, ENUM_CURRENT_SETTINGS
, &m
, 0);
1268 mode
->width
= m
.dmPelsWidth
;
1269 mode
->height
= m
.dmPelsHeight
;
1270 mode
->refresh_rate
= DEFAULT_REFRESH_RATE
;
1271 if (m
.dmFields
& DM_DISPLAYFREQUENCY
)
1272 mode
->refresh_rate
= m
.dmDisplayFrequency
;
1273 mode
->format_id
= pixelformat_for_depth(m
.dmBitsPerPel
);
1275 /* Lie about the format. X11 can't change the color depth, and some apps
1276 * are pretty angry if they SetDisplayMode from 24 to 16 bpp and find out
1277 * that GetDisplayMode still returns 24 bpp. This should probably be
1278 * handled in winex11 instead. */
1279 if (output
->screen_format
&& output
->screen_format
!= mode
->format_id
)
1281 WARN("Overriding format %s with stored format %s.\n",
1282 debug_d3dformat(mode
->format_id
),
1283 debug_d3dformat(output
->screen_format
));
1284 mode
->format_id
= output
->screen_format
;
1287 if (!(m
.dmFields
& DM_DISPLAYFLAGS
))
1288 mode
->scanline_ordering
= WINED3D_SCANLINE_ORDERING_UNKNOWN
;
1289 else if (m
.u2
.dmDisplayFlags
& DM_INTERLACED
)
1290 mode
->scanline_ordering
= WINED3D_SCANLINE_ORDERING_INTERLACED
;
1292 mode
->scanline_ordering
= WINED3D_SCANLINE_ORDERING_PROGRESSIVE
;
1296 switch (m
.u1
.s2
.dmDisplayOrientation
)
1299 *rotation
= WINED3D_DISPLAY_ROTATION_0
;
1302 *rotation
= WINED3D_DISPLAY_ROTATION_90
;
1305 *rotation
= WINED3D_DISPLAY_ROTATION_180
;
1308 *rotation
= WINED3D_DISPLAY_ROTATION_270
;
1311 FIXME("Unhandled display rotation %#x.\n", m
.u1
.s2
.dmDisplayOrientation
);
1312 *rotation
= WINED3D_DISPLAY_ROTATION_UNSPECIFIED
;
1317 TRACE("Returning %ux%u@%u %s %#x.\n", mode
->width
, mode
->height
,
1318 mode
->refresh_rate
, debug_d3dformat(mode
->format_id
),
1319 mode
->scanline_ordering
);
1323 static BOOL
equal_display_mode(const DEVMODEW
*mode1
, const DEVMODEW
*mode2
)
1325 if (mode1
->dmFields
& mode2
->dmFields
& DM_PELSWIDTH
1326 && mode1
->dmPelsWidth
!= mode2
->dmPelsWidth
)
1329 if (mode1
->dmFields
& mode2
->dmFields
& DM_PELSHEIGHT
1330 && mode1
->dmPelsHeight
!= mode2
->dmPelsHeight
)
1333 if (mode1
->dmFields
& mode2
->dmFields
& DM_BITSPERPEL
1334 && mode1
->dmBitsPerPel
!= mode2
->dmBitsPerPel
)
1337 if (mode1
->dmFields
& mode2
->dmFields
& DM_DISPLAYFLAGS
1338 && mode1
->u2
.dmDisplayFlags
!= mode2
->u2
.dmDisplayFlags
)
1341 if (mode1
->dmFields
& mode2
->dmFields
& DM_DISPLAYFREQUENCY
1342 && mode1
->dmDisplayFrequency
!= mode2
->dmDisplayFrequency
)
1345 if (mode1
->dmFields
& mode2
->dmFields
& DM_DISPLAYORIENTATION
1346 && mode1
->u1
.s2
.dmDisplayOrientation
!= mode2
->u1
.s2
.dmDisplayOrientation
)
1349 if (mode1
->dmFields
& mode2
->dmFields
& DM_POSITION
1350 && (mode1
->u1
.s2
.dmPosition
.x
!= mode2
->u1
.s2
.dmPosition
.x
1351 || mode1
->u1
.s2
.dmPosition
.y
!= mode2
->u1
.s2
.dmPosition
.y
))
1357 HRESULT CDECL
wined3d_restore_display_modes(struct wined3d
*wined3d
)
1359 unsigned int adapter_idx
, output_idx
= 0;
1360 DEVMODEW current_mode
, registry_mode
;
1361 struct wined3d_adapter
*adapter
;
1362 DISPLAY_DEVICEW display_device
;
1363 struct wined3d_output
*output
;
1364 BOOL do_mode_change
= FALSE
;
1367 TRACE("wined3d %p.\n", wined3d
);
1369 memset(¤t_mode
, 0, sizeof(current_mode
));
1370 memset(®istry_mode
, 0, sizeof(registry_mode
));
1371 current_mode
.dmSize
= sizeof(current_mode
);
1372 registry_mode
.dmSize
= sizeof(registry_mode
);
1373 display_device
.cb
= sizeof(display_device
);
1374 while (EnumDisplayDevicesW(NULL
, output_idx
++, &display_device
, 0))
1376 if (!EnumDisplaySettingsExW(display_device
.DeviceName
, ENUM_CURRENT_SETTINGS
, ¤t_mode
, 0))
1378 ERR("Failed to read the current display mode for %s.\n",
1379 wine_dbgstr_w(display_device
.DeviceName
));
1380 return WINED3DERR_NOTAVAILABLE
;
1383 if (!EnumDisplaySettingsExW(display_device
.DeviceName
, ENUM_REGISTRY_SETTINGS
, ®istry_mode
, 0))
1385 ERR("Failed to read the registry display mode for %s.\n",
1386 wine_dbgstr_w(display_device
.DeviceName
));
1387 return WINED3DERR_NOTAVAILABLE
;
1390 if (!equal_display_mode(¤t_mode
, ®istry_mode
))
1392 do_mode_change
= TRUE
;
1399 ret
= ChangeDisplaySettingsExW(NULL
, NULL
, NULL
, 0, NULL
);
1400 if (ret
!= DISP_CHANGE_SUCCESSFUL
)
1402 ERR("Failed to restore all outputs to their registry display settings, error %d.\n", ret
);
1403 return WINED3DERR_NOTAVAILABLE
;
1408 TRACE("Skipping redundant mode setting call.\n");
1411 for (adapter_idx
= 0; adapter_idx
< wined3d
->adapter_count
; ++adapter_idx
)
1413 adapter
= wined3d
->adapters
[adapter_idx
];
1414 for (output_idx
= 0; output_idx
< adapter
->output_count
; ++output_idx
)
1416 output
= &adapter
->outputs
[output_idx
];
1418 if (!EnumDisplaySettingsExW(output
->device_name
, ENUM_CURRENT_SETTINGS
, ¤t_mode
, 0))
1420 ERR("Failed to read the current display mode for %s.\n",
1421 wine_dbgstr_w(output
->device_name
));
1422 return WINED3DERR_NOTAVAILABLE
;
1425 output
->screen_format
= pixelformat_for_depth(current_mode
.dmBitsPerPel
);
1432 HRESULT CDECL
wined3d_output_set_display_mode(struct wined3d_output
*output
,
1433 const struct wined3d_display_mode
*mode
)
1435 enum wined3d_format_id new_format_id
;
1436 const struct wined3d_format
*format
;
1437 DEVMODEW new_mode
, current_mode
;
1440 TRACE("output %p, mode %p.\n", output
, mode
);
1441 TRACE("mode %ux%u@%u %s %#x.\n", mode
->width
, mode
->height
, mode
->refresh_rate
,
1442 debug_d3dformat(mode
->format_id
), mode
->scanline_ordering
);
1444 memset(&new_mode
, 0, sizeof(new_mode
));
1445 new_mode
.dmSize
= sizeof(new_mode
);
1446 memset(¤t_mode
, 0, sizeof(current_mode
));
1447 current_mode
.dmSize
= sizeof(current_mode
);
1449 format
= wined3d_get_format(output
->adapter
, mode
->format_id
, WINED3D_BIND_RENDER_TARGET
);
1451 new_mode
.dmFields
= DM_BITSPERPEL
| DM_PELSWIDTH
| DM_PELSHEIGHT
;
1452 new_mode
.dmBitsPerPel
= format
->byte_count
* CHAR_BIT
;
1453 new_mode
.dmPelsWidth
= mode
->width
;
1454 new_mode
.dmPelsHeight
= mode
->height
;
1455 new_mode
.dmDisplayFrequency
= mode
->refresh_rate
;
1456 if (mode
->refresh_rate
)
1457 new_mode
.dmFields
|= DM_DISPLAYFREQUENCY
;
1458 if (mode
->scanline_ordering
!= WINED3D_SCANLINE_ORDERING_UNKNOWN
)
1460 new_mode
.dmFields
|= DM_DISPLAYFLAGS
;
1461 if (mode
->scanline_ordering
== WINED3D_SCANLINE_ORDERING_INTERLACED
)
1462 new_mode
.u2
.dmDisplayFlags
|= DM_INTERLACED
;
1464 new_format_id
= mode
->format_id
;
1466 /* Only change the mode if necessary. */
1467 if (!EnumDisplaySettingsW(output
->device_name
, ENUM_CURRENT_SETTINGS
, ¤t_mode
))
1469 ERR("Failed to get current display mode.\n");
1471 else if (equal_display_mode(¤t_mode
, &new_mode
))
1473 TRACE("Skipping redundant mode setting call.\n");
1474 output
->screen_format
= new_format_id
;
1478 ret
= ChangeDisplaySettingsExW(output
->device_name
, &new_mode
, NULL
, CDS_FULLSCREEN
, NULL
);
1479 if (ret
!= DISP_CHANGE_SUCCESSFUL
)
1481 if (new_mode
.dmFields
& DM_DISPLAYFREQUENCY
)
1483 WARN("ChangeDisplaySettingsExW failed, trying without the refresh rate.\n");
1484 new_mode
.dmFields
&= ~DM_DISPLAYFREQUENCY
;
1485 new_mode
.dmDisplayFrequency
= 0;
1486 ret
= ChangeDisplaySettingsExW(output
->device_name
, &new_mode
, NULL
, CDS_FULLSCREEN
, NULL
);
1488 if (ret
!= DISP_CHANGE_SUCCESSFUL
)
1489 return WINED3DERR_NOTAVAILABLE
;
1492 /* Store the new values. */
1493 output
->screen_format
= new_format_id
;
1498 HRESULT CDECL
wined3d_adapter_get_identifier(const struct wined3d_adapter
*adapter
,
1499 DWORD flags
, struct wined3d_adapter_identifier
*identifier
)
1501 TRACE("adapter %p, flags %#x, identifier %p.\n", adapter
, flags
, identifier
);
1503 wined3d_mutex_lock();
1505 wined3d_copy_name(identifier
->driver
, adapter
->driver_info
.name
, identifier
->driver_size
);
1506 wined3d_copy_name(identifier
->description
, adapter
->driver_info
.description
, identifier
->description_size
);
1508 identifier
->driver_version
.u
.HighPart
= adapter
->driver_info
.version_high
;
1509 identifier
->driver_version
.u
.LowPart
= adapter
->driver_info
.version_low
;
1510 identifier
->vendor_id
= adapter
->driver_info
.vendor
;
1511 identifier
->device_id
= adapter
->driver_info
.device
;
1512 identifier
->subsystem_id
= 0;
1513 identifier
->revision
= 0;
1514 identifier
->device_identifier
= IID_D3DDEVICE_D3DUID
;
1515 identifier
->driver_uuid
= adapter
->driver_uuid
;
1516 identifier
->device_uuid
= adapter
->device_uuid
;
1517 identifier
->whql_level
= (flags
& WINED3DENUM_NO_WHQL_LEVEL
) ? 0 : 1;
1518 identifier
->adapter_luid
= adapter
->luid
;
1519 identifier
->video_memory
= min(~(SIZE_T
)0, adapter
->driver_info
.vram_bytes
);
1520 identifier
->shared_system_memory
= min(~(SIZE_T
)0, adapter
->driver_info
.sysmem_bytes
);
1522 wined3d_mutex_unlock();
1527 HRESULT CDECL
wined3d_output_get_raster_status(const struct wined3d_output
*output
,
1528 struct wined3d_raster_status
*raster_status
)
1530 LONGLONG freq_per_frame
, freq_per_line
;
1531 LARGE_INTEGER counter
, freq_per_sec
;
1532 struct wined3d_display_mode mode
;
1536 FIXME("output %p, raster_status %p semi-stub!\n", output
, raster_status
);
1538 WARN("output %p, raster_status %p semi-stub!\n", output
, raster_status
);
1540 /* Obtaining the raster status is a widely implemented but optional
1541 * feature. When this method returns OK StarCraft 2 expects the
1542 * raster_status->InVBlank value to actually change over time.
1543 * And Endless Alice Crysis doesn't care even if this method fails.
1544 * Thus this method returns OK and fakes raster_status by
1545 * QueryPerformanceCounter. */
1547 if (!QueryPerformanceCounter(&counter
) || !QueryPerformanceFrequency(&freq_per_sec
))
1548 return WINED3DERR_INVALIDCALL
;
1549 if (FAILED(wined3d_output_get_display_mode(output
, &mode
, NULL
)))
1550 return WINED3DERR_INVALIDCALL
;
1551 if (mode
.refresh_rate
== DEFAULT_REFRESH_RATE
)
1552 mode
.refresh_rate
= 60;
1554 freq_per_frame
= freq_per_sec
.QuadPart
/ mode
.refresh_rate
;
1555 /* Assume 20 scan lines in the vertical blank. */
1556 freq_per_line
= freq_per_frame
/ (mode
.height
+ 20);
1557 raster_status
->scan_line
= (counter
.QuadPart
% freq_per_frame
) / freq_per_line
;
1558 if (raster_status
->scan_line
< mode
.height
)
1559 raster_status
->in_vblank
= FALSE
;
1562 raster_status
->scan_line
= 0;
1563 raster_status
->in_vblank
= TRUE
;
1566 TRACE("Returning fake value, in_vblank %u, scan_line %u.\n",
1567 raster_status
->in_vblank
, raster_status
->scan_line
);
1572 HRESULT CDECL
wined3d_check_depth_stencil_match(const struct wined3d_adapter
*adapter
,
1573 enum wined3d_device_type device_type
, enum wined3d_format_id adapter_format_id
,
1574 enum wined3d_format_id render_target_format_id
, enum wined3d_format_id depth_stencil_format_id
)
1576 const struct wined3d_format
*rt_format
;
1577 const struct wined3d_format
*ds_format
;
1579 TRACE("adapter %p, device_type %s, adapter_format %s, render_target_format %s, "
1580 "depth_stencil_format %s.\n",
1581 adapter
, debug_d3ddevicetype(device_type
), debug_d3dformat(adapter_format_id
),
1582 debug_d3dformat(render_target_format_id
), debug_d3dformat(depth_stencil_format_id
));
1584 rt_format
= wined3d_get_format(adapter
, render_target_format_id
, WINED3D_BIND_RENDER_TARGET
);
1585 ds_format
= wined3d_get_format(adapter
, depth_stencil_format_id
, WINED3D_BIND_DEPTH_STENCIL
);
1587 if (!(rt_format
->flags
[WINED3D_GL_RES_TYPE_TEX_2D
] & WINED3DFMT_FLAG_RENDERTARGET
))
1589 WARN("Format %s is not render target format.\n", debug_d3dformat(rt_format
->id
));
1590 return WINED3DERR_NOTAVAILABLE
;
1592 if (!(ds_format
->flags
[WINED3D_GL_RES_TYPE_TEX_2D
] & WINED3DFMT_FLAG_DEPTH_STENCIL
))
1594 WARN("Format %s is not depth/stencil format.\n", debug_d3dformat(ds_format
->id
));
1595 return WINED3DERR_NOTAVAILABLE
;
1598 if (adapter
->adapter_ops
->adapter_check_format(adapter
, NULL
, rt_format
, ds_format
))
1600 TRACE("Formats match.\n");
1604 TRACE("Unsupported format pair: %s and %s.\n",
1605 debug_d3dformat(render_target_format_id
),
1606 debug_d3dformat(depth_stencil_format_id
));
1608 return WINED3DERR_NOTAVAILABLE
;
1611 HRESULT CDECL
wined3d_check_device_multisample_type(const struct wined3d_adapter
*adapter
,
1612 enum wined3d_device_type device_type
, enum wined3d_format_id surface_format_id
, BOOL windowed
,
1613 enum wined3d_multisample_type multisample_type
, DWORD
*quality_levels
)
1615 const struct wined3d_format
*format
;
1616 HRESULT hr
= WINED3D_OK
;
1618 TRACE("adapter %p, device_type %s, surface_format %s, "
1619 "windowed %#x, multisample_type %#x, quality_levels %p.\n",
1620 adapter
, debug_d3ddevicetype(device_type
), debug_d3dformat(surface_format_id
),
1621 windowed
, multisample_type
, quality_levels
);
1623 if (surface_format_id
== WINED3DFMT_UNKNOWN
)
1624 return WINED3DERR_INVALIDCALL
;
1625 if (multisample_type
< WINED3D_MULTISAMPLE_NONE
)
1626 return WINED3DERR_INVALIDCALL
;
1627 if (multisample_type
> WINED3D_MULTISAMPLE_16_SAMPLES
)
1629 FIXME("multisample_type %u not handled yet.\n", multisample_type
);
1630 return WINED3DERR_NOTAVAILABLE
;
1633 format
= wined3d_get_format(adapter
, surface_format_id
, 0);
1635 if (multisample_type
&& !(format
->multisample_types
& 1u << (multisample_type
- 1)))
1636 hr
= WINED3DERR_NOTAVAILABLE
;
1638 if (SUCCEEDED(hr
) || (multisample_type
== WINED3D_MULTISAMPLE_NON_MASKABLE
&& format
->multisample_types
))
1642 if (multisample_type
== WINED3D_MULTISAMPLE_NON_MASKABLE
)
1643 *quality_levels
= wined3d_popcount(format
->multisample_types
);
1645 *quality_levels
= 1;
1650 TRACE("Returning not supported.\n");
1654 static BOOL
wined3d_check_depth_stencil_format(const struct wined3d_adapter
*adapter
,
1655 const struct wined3d_format
*adapter_format
, const struct wined3d_format
*ds_format
,
1656 enum wined3d_gl_resource_type gl_type
)
1658 if (!ds_format
->depth_size
&& !ds_format
->stencil_size
)
1661 return adapter
->adapter_ops
->adapter_check_format(adapter
, adapter_format
, NULL
, ds_format
);
1664 static BOOL
wined3d_check_surface_format(const struct wined3d_format
*format
)
1666 if ((format
->flags
[WINED3D_GL_RES_TYPE_TEX_2D
] | format
->flags
[WINED3D_GL_RES_TYPE_RB
]) & WINED3DFMT_FLAG_BLIT
)
1669 if ((format
->flags
[WINED3D_GL_RES_TYPE_TEX_2D
] & (WINED3DFMT_FLAG_EXTENSION
| WINED3DFMT_FLAG_TEXTURE
))
1670 == (WINED3DFMT_FLAG_EXTENSION
| WINED3DFMT_FLAG_TEXTURE
))
1676 /* OpenGL supports mipmapping on all formats. Wrapping is unsupported, but we
1677 * have to report mipmapping so we cannot reject WRAPANDMIP. Tests show that
1678 * Windows reports WRAPANDMIP on unfilterable surfaces as well, apparently to
1679 * show that wrapping is supported. The lack of filtering will sort out the
1680 * mipmapping capability anyway.
1682 * For now lets report this on all formats, but in the future we may want to
1683 * restrict it to some should applications need that. */
1684 HRESULT CDECL
wined3d_check_device_format(const struct wined3d
*wined3d
,
1685 const struct wined3d_adapter
*adapter
, enum wined3d_device_type device_type
,
1686 enum wined3d_format_id adapter_format_id
, DWORD usage
, unsigned int bind_flags
,
1687 enum wined3d_resource_type resource_type
, enum wined3d_format_id check_format_id
)
1689 const struct wined3d_format
*adapter_format
, *format
;
1690 enum wined3d_gl_resource_type gl_type
, gl_type_end
;
1691 BOOL mipmap_gen_supported
= TRUE
;
1692 unsigned int allowed_bind_flags
;
1693 DWORD format_flags
= 0;
1694 DWORD allowed_usage
;
1696 TRACE("wined3d %p, adapter %p, device_type %s, adapter_format %s, usage %s, %s, "
1697 "bind_flags %s, resource_type %s, check_format %s.\n",
1698 wined3d
, adapter
, debug_d3ddevicetype(device_type
), debug_d3dformat(adapter_format_id
),
1699 debug_d3dusage(usage
), debug_d3dusagequery(usage
), wined3d_debug_bind_flags(bind_flags
),
1700 debug_d3dresourcetype(resource_type
), debug_d3dformat(check_format_id
));
1702 adapter_format
= wined3d_get_format(adapter
, adapter_format_id
, WINED3D_BIND_RENDER_TARGET
);
1703 format
= wined3d_get_format(adapter
, check_format_id
, bind_flags
);
1705 switch (resource_type
)
1707 case WINED3D_RTYPE_NONE
:
1709 allowed_bind_flags
= WINED3D_BIND_RENDER_TARGET
1710 | WINED3D_BIND_DEPTH_STENCIL
1711 | WINED3D_BIND_UNORDERED_ACCESS
;
1712 gl_type
= WINED3D_GL_RES_TYPE_TEX_2D
;
1713 gl_type_end
= WINED3D_GL_RES_TYPE_TEX_3D
;
1716 case WINED3D_RTYPE_TEXTURE_1D
:
1717 allowed_usage
= WINED3DUSAGE_DYNAMIC
1718 | WINED3DUSAGE_SOFTWAREPROCESSING
1719 | WINED3DUSAGE_QUERY_FILTER
1720 | WINED3DUSAGE_QUERY_GENMIPMAP
1721 | WINED3DUSAGE_QUERY_POSTPIXELSHADER_BLENDING
1722 | WINED3DUSAGE_QUERY_SRGBREAD
1723 | WINED3DUSAGE_QUERY_SRGBWRITE
1724 | WINED3DUSAGE_QUERY_VERTEXTEXTURE
1725 | WINED3DUSAGE_QUERY_WRAPANDMIP
;
1726 allowed_bind_flags
= WINED3D_BIND_SHADER_RESOURCE
1727 | WINED3D_BIND_UNORDERED_ACCESS
;
1728 gl_type
= gl_type_end
= WINED3D_GL_RES_TYPE_TEX_1D
;
1731 case WINED3D_RTYPE_TEXTURE_2D
:
1732 allowed_usage
= WINED3DUSAGE_QUERY_POSTPIXELSHADER_BLENDING
;
1733 if (bind_flags
& WINED3D_BIND_RENDER_TARGET
)
1734 allowed_usage
|= WINED3DUSAGE_QUERY_SRGBWRITE
;
1735 allowed_bind_flags
= WINED3D_BIND_RENDER_TARGET
1736 | WINED3D_BIND_DEPTH_STENCIL
1737 | WINED3D_BIND_UNORDERED_ACCESS
;
1738 if (!(bind_flags
& WINED3D_BIND_SHADER_RESOURCE
))
1740 if (!wined3d_check_surface_format(format
))
1742 TRACE("%s is not supported for plain surfaces.\n", debug_d3dformat(format
->id
));
1743 return WINED3DERR_NOTAVAILABLE
;
1746 gl_type
= gl_type_end
= WINED3D_GL_RES_TYPE_RB
;
1749 allowed_usage
|= WINED3DUSAGE_DYNAMIC
1750 | WINED3DUSAGE_LEGACY_CUBEMAP
1751 | WINED3DUSAGE_SOFTWAREPROCESSING
1752 | WINED3DUSAGE_QUERY_FILTER
1753 | WINED3DUSAGE_QUERY_GENMIPMAP
1754 | WINED3DUSAGE_QUERY_LEGACYBUMPMAP
1755 | WINED3DUSAGE_QUERY_SRGBREAD
1756 | WINED3DUSAGE_QUERY_SRGBWRITE
1757 | WINED3DUSAGE_QUERY_VERTEXTEXTURE
1758 | WINED3DUSAGE_QUERY_WRAPANDMIP
;
1759 allowed_bind_flags
|= WINED3D_BIND_SHADER_RESOURCE
;
1760 gl_type
= gl_type_end
= WINED3D_GL_RES_TYPE_TEX_2D
;
1761 if (usage
& WINED3DUSAGE_LEGACY_CUBEMAP
)
1763 allowed_usage
&= ~WINED3DUSAGE_QUERY_LEGACYBUMPMAP
;
1764 allowed_bind_flags
&= ~WINED3D_BIND_DEPTH_STENCIL
;
1765 gl_type
= gl_type_end
= WINED3D_GL_RES_TYPE_TEX_CUBE
;
1769 case WINED3D_RTYPE_TEXTURE_3D
:
1770 allowed_usage
= WINED3DUSAGE_DYNAMIC
1771 | WINED3DUSAGE_SOFTWAREPROCESSING
1772 | WINED3DUSAGE_QUERY_FILTER
1773 | WINED3DUSAGE_QUERY_POSTPIXELSHADER_BLENDING
1774 | WINED3DUSAGE_QUERY_SRGBREAD
1775 | WINED3DUSAGE_QUERY_SRGBWRITE
1776 | WINED3DUSAGE_QUERY_VERTEXTEXTURE
1777 | WINED3DUSAGE_QUERY_WRAPANDMIP
;
1778 allowed_bind_flags
= WINED3D_BIND_SHADER_RESOURCE
1779 | WINED3D_BIND_UNORDERED_ACCESS
;
1780 gl_type
= gl_type_end
= WINED3D_GL_RES_TYPE_TEX_3D
;
1784 FIXME("Unhandled resource type %s.\n", debug_d3dresourcetype(resource_type
));
1785 return WINED3DERR_NOTAVAILABLE
;
1788 if ((usage
& allowed_usage
) != usage
)
1790 TRACE("Requested usage %#x, but resource type %s only allows %#x.\n",
1791 usage
, debug_d3dresourcetype(resource_type
), allowed_usage
);
1792 return WINED3DERR_NOTAVAILABLE
;
1795 if ((bind_flags
& allowed_bind_flags
) != bind_flags
)
1797 TRACE("Requested bind flags %s, but resource type %s only allows %s.\n",
1798 wined3d_debug_bind_flags(bind_flags
), debug_d3dresourcetype(resource_type
),
1799 wined3d_debug_bind_flags(allowed_bind_flags
));
1800 return WINED3DERR_NOTAVAILABLE
;
1803 if (bind_flags
& WINED3D_BIND_SHADER_RESOURCE
)
1804 format_flags
|= WINED3DFMT_FLAG_TEXTURE
;
1805 if (bind_flags
& WINED3D_BIND_RENDER_TARGET
)
1806 format_flags
|= WINED3DFMT_FLAG_RENDERTARGET
;
1807 if (bind_flags
& WINED3D_BIND_DEPTH_STENCIL
)
1808 format_flags
|= WINED3DFMT_FLAG_DEPTH_STENCIL
;
1809 if (bind_flags
& WINED3D_BIND_UNORDERED_ACCESS
)
1810 format_flags
|= WINED3DFMT_FLAG_UNORDERED_ACCESS
;
1811 if (usage
& WINED3DUSAGE_QUERY_FILTER
)
1812 format_flags
|= WINED3DFMT_FLAG_FILTERING
;
1813 if (usage
& WINED3DUSAGE_QUERY_POSTPIXELSHADER_BLENDING
)
1814 format_flags
|= WINED3DFMT_FLAG_POSTPIXELSHADER_BLENDING
;
1815 if (usage
& WINED3DUSAGE_QUERY_SRGBREAD
)
1816 format_flags
|= WINED3DFMT_FLAG_SRGB_READ
;
1817 if (usage
& WINED3DUSAGE_QUERY_SRGBWRITE
)
1818 format_flags
|= WINED3DFMT_FLAG_SRGB_WRITE
;
1819 if (usage
& WINED3DUSAGE_QUERY_VERTEXTEXTURE
)
1820 format_flags
|= WINED3DFMT_FLAG_VTF
;
1821 if (usage
& WINED3DUSAGE_QUERY_LEGACYBUMPMAP
)
1822 format_flags
|= WINED3DFMT_FLAG_BUMPMAP
;
1824 if ((format_flags
& WINED3DFMT_FLAG_TEXTURE
) && (wined3d
->flags
& WINED3D_NO3D
))
1826 TRACE("Requested texturing support, but wined3d was created with WINED3D_NO3D.\n");
1827 return WINED3DERR_NOTAVAILABLE
;
1830 for (; gl_type
<= gl_type_end
; ++gl_type
)
1832 if ((bind_flags
& WINED3D_BIND_RENDER_TARGET
)
1833 && !adapter
->adapter_ops
->adapter_check_format(adapter
, adapter_format
, format
, NULL
))
1835 TRACE("Requested WINED3D_BIND_RENDER_TARGET, but format %s is not supported for render targets.\n",
1836 debug_d3dformat(check_format_id
));
1837 return WINED3DERR_NOTAVAILABLE
;
1840 /* 3D depth / stencil textures are never supported. */
1841 if (bind_flags
== WINED3D_BIND_DEPTH_STENCIL
&& gl_type
== WINED3D_GL_RES_TYPE_TEX_3D
)
1844 if ((bind_flags
& WINED3D_BIND_DEPTH_STENCIL
)
1845 && !wined3d_check_depth_stencil_format(adapter
, adapter_format
, format
, gl_type
))
1847 TRACE("Requested WINED3D_BIND_DEPTH_STENCIL, but format %s is not supported for depth/stencil buffers.\n",
1848 debug_d3dformat(check_format_id
));
1849 return WINED3DERR_NOTAVAILABLE
;
1852 if ((bind_flags
& WINED3D_BIND_UNORDERED_ACCESS
) && wined3d_format_is_typeless(format
))
1854 TRACE("Requested WINED3D_BIND_UNORDERED_ACCESS, but format %s is typeless.\n",
1855 debug_d3dformat(check_format_id
));
1856 return WINED3DERR_NOTAVAILABLE
;
1859 if ((format
->flags
[gl_type
] & format_flags
) != format_flags
)
1861 TRACE("Requested format flags %#x, but format %s only has %#x.\n",
1862 format_flags
, debug_d3dformat(check_format_id
), format
->flags
[gl_type
]);
1863 return WINED3DERR_NOTAVAILABLE
;
1866 if (!(format
->flags
[gl_type
] & WINED3DFMT_FLAG_GEN_MIPMAP
))
1867 mipmap_gen_supported
= FALSE
;
1870 if ((usage
& WINED3DUSAGE_QUERY_GENMIPMAP
) && !mipmap_gen_supported
)
1872 TRACE("No WINED3DUSAGE_AUTOGENMIPMAP support, returning WINED3DOK_NOAUTOGEN.\n");
1873 return WINED3DOK_NOMIPGEN
;
1879 unsigned int CDECL
wined3d_calculate_format_pitch(const struct wined3d_adapter
*adapter
,
1880 enum wined3d_format_id format_id
, unsigned int width
)
1882 unsigned int row_pitch
, slice_pitch
;
1884 TRACE("adapter %p, format_id %s, width %u.\n", adapter
, debug_d3dformat(format_id
), width
);
1886 wined3d_format_calculate_pitch(wined3d_get_format(adapter
, format_id
, 0),
1887 1, width
, 1, &row_pitch
, &slice_pitch
);
1892 HRESULT CDECL
wined3d_check_device_format_conversion(const struct wined3d_output
*output
,
1893 enum wined3d_device_type device_type
, enum wined3d_format_id src_format
,
1894 enum wined3d_format_id dst_format
)
1896 FIXME("output %p, device_type %s, src_format %s, dst_format %s stub!\n",
1897 output
, debug_d3ddevicetype(device_type
), debug_d3dformat(src_format
),
1898 debug_d3dformat(dst_format
));
1903 HRESULT CDECL
wined3d_check_device_type(const struct wined3d
*wined3d
,
1904 const struct wined3d_output
*output
, enum wined3d_device_type device_type
,
1905 enum wined3d_format_id display_format
, enum wined3d_format_id backbuffer_format
,
1908 BOOL present_conversion
= wined3d
->flags
& WINED3D_PRESENT_CONVERSION
;
1910 TRACE("wined3d %p, output %p, device_type %s, display_format %s, backbuffer_format %s, windowed %#x.\n",
1911 wined3d
, output
, debug_d3ddevicetype(device_type
), debug_d3dformat(display_format
),
1912 debug_d3dformat(backbuffer_format
), windowed
);
1914 /* The task of this function is to check whether a certain display / backbuffer format
1915 * combination is available on the given output. In fullscreen mode microsoft specified
1916 * that the display format shouldn't provide alpha and that ignoring alpha the backbuffer
1917 * and display format should match exactly.
1918 * In windowed mode format conversion can occur and this depends on the driver. */
1920 /* There are only 4 display formats. */
1921 if (!(display_format
== WINED3DFMT_B5G6R5_UNORM
1922 || display_format
== WINED3DFMT_B5G5R5X1_UNORM
1923 || display_format
== WINED3DFMT_B8G8R8X8_UNORM
1924 || display_format
== WINED3DFMT_B10G10R10A2_UNORM
))
1926 TRACE("Format %s is not supported as display format.\n", debug_d3dformat(display_format
));
1927 return WINED3DERR_NOTAVAILABLE
;
1932 /* If the requested display format is not available, don't continue. */
1933 if (!wined3d_output_get_mode_count(output
, display_format
,
1934 WINED3D_SCANLINE_ORDERING_UNKNOWN
))
1936 TRACE("No available modes for display format %s.\n", debug_d3dformat(display_format
));
1937 return WINED3DERR_NOTAVAILABLE
;
1940 present_conversion
= FALSE
;
1942 else if (display_format
== WINED3DFMT_B10G10R10A2_UNORM
)
1944 /* WINED3DFMT_B10G10R10A2_UNORM is only allowed in fullscreen mode. */
1945 TRACE("Unsupported format combination %s / %s in windowed mode.\n",
1946 debug_d3dformat(display_format
), debug_d3dformat(backbuffer_format
));
1947 return WINED3DERR_NOTAVAILABLE
;
1950 if (present_conversion
)
1952 /* Use the display format as back buffer format if the latter is
1953 * WINED3DFMT_UNKNOWN. */
1954 if (backbuffer_format
== WINED3DFMT_UNKNOWN
)
1955 backbuffer_format
= display_format
;
1957 if (FAILED(wined3d_check_device_format_conversion(output
, device_type
, backbuffer_format
,
1960 TRACE("Format conversion from %s to %s not supported.\n",
1961 debug_d3dformat(backbuffer_format
), debug_d3dformat(display_format
));
1962 return WINED3DERR_NOTAVAILABLE
;
1967 /* When format conversion from the back buffer format to the display
1968 * format is not allowed, only a limited number of combinations are
1971 if (display_format
== WINED3DFMT_B5G6R5_UNORM
&& backbuffer_format
!= WINED3DFMT_B5G6R5_UNORM
)
1973 TRACE("Unsupported format combination %s / %s.\n",
1974 debug_d3dformat(display_format
), debug_d3dformat(backbuffer_format
));
1975 return WINED3DERR_NOTAVAILABLE
;
1978 if (display_format
== WINED3DFMT_B5G5R5X1_UNORM
1979 && !(backbuffer_format
== WINED3DFMT_B5G5R5X1_UNORM
|| backbuffer_format
== WINED3DFMT_B5G5R5A1_UNORM
))
1981 TRACE("Unsupported format combination %s / %s.\n",
1982 debug_d3dformat(display_format
), debug_d3dformat(backbuffer_format
));
1983 return WINED3DERR_NOTAVAILABLE
;
1986 if (display_format
== WINED3DFMT_B8G8R8X8_UNORM
1987 && !(backbuffer_format
== WINED3DFMT_B8G8R8X8_UNORM
|| backbuffer_format
== WINED3DFMT_B8G8R8A8_UNORM
))
1989 TRACE("Unsupported format combination %s / %s.\n",
1990 debug_d3dformat(display_format
), debug_d3dformat(backbuffer_format
));
1991 return WINED3DERR_NOTAVAILABLE
;
1994 if (display_format
== WINED3DFMT_B10G10R10A2_UNORM
1995 && backbuffer_format
!= WINED3DFMT_B10G10R10A2_UNORM
)
1997 TRACE("Unsupported format combination %s / %s.\n",
1998 debug_d3dformat(display_format
), debug_d3dformat(backbuffer_format
));
1999 return WINED3DERR_NOTAVAILABLE
;
2003 /* Validate that the back buffer format is usable for render targets. */
2004 if (FAILED(wined3d_check_device_format(wined3d
, output
->adapter
, device_type
,
2005 display_format
, 0, WINED3D_BIND_RENDER_TARGET
, WINED3D_RTYPE_TEXTURE_2D
,
2006 backbuffer_format
)))
2008 TRACE("Format %s not allowed for render targets.\n", debug_d3dformat(backbuffer_format
));
2009 return WINED3DERR_NOTAVAILABLE
;
2015 HRESULT CDECL
wined3d_get_device_caps(const struct wined3d_adapter
*adapter
,
2016 enum wined3d_device_type device_type
, struct wined3d_caps
*caps
)
2018 const struct wined3d_d3d_info
*d3d_info
;
2019 struct wined3d_vertex_caps vertex_caps
;
2020 DWORD ckey_caps
, blit_caps
, fx_caps
;
2021 struct fragment_caps fragment_caps
;
2022 struct shader_caps shader_caps
;
2024 TRACE("adapter %p, device_type %s, caps %p.\n",
2025 adapter
, debug_d3ddevicetype(device_type
), caps
);
2027 d3d_info
= &adapter
->d3d_info
;
2029 caps
->DeviceType
= (device_type
== WINED3D_DEVICE_TYPE_HAL
) ? WINED3D_DEVICE_TYPE_HAL
: WINED3D_DEVICE_TYPE_REF
;
2032 caps
->Caps2
= WINED3DCAPS2_CANRENDERWINDOWED
|
2033 WINED3DCAPS2_FULLSCREENGAMMA
|
2034 WINED3DCAPS2_DYNAMICTEXTURES
;
2036 caps
->Caps3
= WINED3DCAPS3_ALPHA_FULLSCREEN_FLIP_OR_DISCARD
|
2037 WINED3DCAPS3_COPY_TO_VIDMEM
|
2038 WINED3DCAPS3_COPY_TO_SYSTEMMEM
;
2040 caps
->CursorCaps
= WINED3DCURSORCAPS_COLOR
|
2041 WINED3DCURSORCAPS_LOWRES
;
2043 caps
->DevCaps
= WINED3DDEVCAPS_FLOATTLVERTEX
|
2044 WINED3DDEVCAPS_EXECUTESYSTEMMEMORY
|
2045 WINED3DDEVCAPS_TLVERTEXSYSTEMMEMORY
|
2046 WINED3DDEVCAPS_TLVERTEXVIDEOMEMORY
|
2047 WINED3DDEVCAPS_DRAWPRIMTLVERTEX
|
2048 WINED3DDEVCAPS_HWTRANSFORMANDLIGHT
|
2049 WINED3DDEVCAPS_EXECUTEVIDEOMEMORY
|
2050 WINED3DDEVCAPS_PUREDEVICE
|
2051 WINED3DDEVCAPS_HWRASTERIZATION
|
2052 WINED3DDEVCAPS_TEXTUREVIDEOMEMORY
|
2053 WINED3DDEVCAPS_TEXTURESYSTEMMEMORY
|
2054 WINED3DDEVCAPS_CANRENDERAFTERFLIP
|
2055 WINED3DDEVCAPS_DRAWPRIMITIVES2
|
2056 WINED3DDEVCAPS_DRAWPRIMITIVES2EX
;
2058 caps
->PrimitiveMiscCaps
= WINED3DPMISCCAPS_CULLNONE
|
2059 WINED3DPMISCCAPS_CULLCCW
|
2060 WINED3DPMISCCAPS_CULLCW
|
2061 WINED3DPMISCCAPS_COLORWRITEENABLE
|
2062 WINED3DPMISCCAPS_CLIPTLVERTS
|
2063 WINED3DPMISCCAPS_CLIPPLANESCALEDPOINTS
|
2064 WINED3DPMISCCAPS_MASKZ
|
2065 WINED3DPMISCCAPS_MRTPOSTPIXELSHADERBLENDING
;
2067 WINED3DPMISCCAPS_NULLREFERENCE
2068 WINED3DPMISCCAPS_FOGANDSPECULARALPHA
2069 WINED3DPMISCCAPS_FOGVERTEXCLAMPED */
2071 caps
->RasterCaps
= WINED3DPRASTERCAPS_DITHER
|
2072 WINED3DPRASTERCAPS_PAT
|
2073 WINED3DPRASTERCAPS_WFOG
|
2074 WINED3DPRASTERCAPS_ZFOG
|
2075 WINED3DPRASTERCAPS_FOGVERTEX
|
2076 WINED3DPRASTERCAPS_FOGTABLE
|
2077 WINED3DPRASTERCAPS_STIPPLE
|
2078 WINED3DPRASTERCAPS_SUBPIXEL
|
2079 WINED3DPRASTERCAPS_ZTEST
|
2080 WINED3DPRASTERCAPS_SCISSORTEST
|
2081 WINED3DPRASTERCAPS_SLOPESCALEDEPTHBIAS
|
2082 WINED3DPRASTERCAPS_DEPTHBIAS
;
2084 caps
->ZCmpCaps
= WINED3DPCMPCAPS_ALWAYS
|
2085 WINED3DPCMPCAPS_EQUAL
|
2086 WINED3DPCMPCAPS_GREATER
|
2087 WINED3DPCMPCAPS_GREATEREQUAL
|
2088 WINED3DPCMPCAPS_LESS
|
2089 WINED3DPCMPCAPS_LESSEQUAL
|
2090 WINED3DPCMPCAPS_NEVER
|
2091 WINED3DPCMPCAPS_NOTEQUAL
;
2093 /* WINED3DPBLENDCAPS_BOTHINVSRCALPHA and WINED3DPBLENDCAPS_BOTHSRCALPHA
2094 * are legacy settings for srcblend only. */
2095 caps
->SrcBlendCaps
= WINED3DPBLENDCAPS_BOTHINVSRCALPHA
|
2096 WINED3DPBLENDCAPS_BOTHSRCALPHA
|
2097 WINED3DPBLENDCAPS_DESTALPHA
|
2098 WINED3DPBLENDCAPS_DESTCOLOR
|
2099 WINED3DPBLENDCAPS_INVDESTALPHA
|
2100 WINED3DPBLENDCAPS_INVDESTCOLOR
|
2101 WINED3DPBLENDCAPS_INVSRCALPHA
|
2102 WINED3DPBLENDCAPS_INVSRCCOLOR
|
2103 WINED3DPBLENDCAPS_ONE
|
2104 WINED3DPBLENDCAPS_SRCALPHA
|
2105 WINED3DPBLENDCAPS_SRCALPHASAT
|
2106 WINED3DPBLENDCAPS_SRCCOLOR
|
2107 WINED3DPBLENDCAPS_ZERO
;
2109 caps
->DestBlendCaps
= WINED3DPBLENDCAPS_DESTALPHA
|
2110 WINED3DPBLENDCAPS_DESTCOLOR
|
2111 WINED3DPBLENDCAPS_INVDESTALPHA
|
2112 WINED3DPBLENDCAPS_INVDESTCOLOR
|
2113 WINED3DPBLENDCAPS_INVSRCALPHA
|
2114 WINED3DPBLENDCAPS_INVSRCCOLOR
|
2115 WINED3DPBLENDCAPS_ONE
|
2116 WINED3DPBLENDCAPS_SRCALPHA
|
2117 WINED3DPBLENDCAPS_SRCCOLOR
|
2118 WINED3DPBLENDCAPS_ZERO
;
2120 caps
->AlphaCmpCaps
= WINED3DPCMPCAPS_ALWAYS
|
2121 WINED3DPCMPCAPS_EQUAL
|
2122 WINED3DPCMPCAPS_GREATER
|
2123 WINED3DPCMPCAPS_GREATEREQUAL
|
2124 WINED3DPCMPCAPS_LESS
|
2125 WINED3DPCMPCAPS_LESSEQUAL
|
2126 WINED3DPCMPCAPS_NEVER
|
2127 WINED3DPCMPCAPS_NOTEQUAL
;
2129 caps
->ShadeCaps
= WINED3DPSHADECAPS_SPECULARGOURAUDRGB
|
2130 WINED3DPSHADECAPS_COLORGOURAUDRGB
|
2131 WINED3DPSHADECAPS_ALPHAFLATBLEND
|
2132 WINED3DPSHADECAPS_ALPHAGOURAUDBLEND
|
2133 WINED3DPSHADECAPS_COLORFLATRGB
|
2134 WINED3DPSHADECAPS_FOGFLAT
|
2135 WINED3DPSHADECAPS_FOGGOURAUD
|
2136 WINED3DPSHADECAPS_SPECULARFLATRGB
;
2138 caps
->TextureCaps
= WINED3DPTEXTURECAPS_ALPHA
|
2139 WINED3DPTEXTURECAPS_ALPHAPALETTE
|
2140 WINED3DPTEXTURECAPS_TRANSPARENCY
|
2141 WINED3DPTEXTURECAPS_BORDER
|
2142 WINED3DPTEXTURECAPS_MIPMAP
|
2143 WINED3DPTEXTURECAPS_PROJECTED
|
2144 WINED3DPTEXTURECAPS_PERSPECTIVE
;
2146 if (!d3d_info
->texture_npot
)
2148 caps
->TextureCaps
|= WINED3DPTEXTURECAPS_POW2
;
2149 if (d3d_info
->texture_npot_conditional
)
2150 caps
->TextureCaps
|= WINED3DPTEXTURECAPS_NONPOW2CONDITIONAL
;
2153 caps
->TextureFilterCaps
= WINED3DPTFILTERCAPS_MAGFLINEAR
|
2154 WINED3DPTFILTERCAPS_MAGFPOINT
|
2155 WINED3DPTFILTERCAPS_MINFLINEAR
|
2156 WINED3DPTFILTERCAPS_MINFPOINT
|
2157 WINED3DPTFILTERCAPS_MIPFLINEAR
|
2158 WINED3DPTFILTERCAPS_MIPFPOINT
|
2159 WINED3DPTFILTERCAPS_LINEAR
|
2160 WINED3DPTFILTERCAPS_LINEARMIPLINEAR
|
2161 WINED3DPTFILTERCAPS_LINEARMIPNEAREST
|
2162 WINED3DPTFILTERCAPS_MIPLINEAR
|
2163 WINED3DPTFILTERCAPS_MIPNEAREST
|
2164 WINED3DPTFILTERCAPS_NEAREST
;
2166 caps
->CubeTextureFilterCaps
= 0;
2167 caps
->VolumeTextureFilterCaps
= 0;
2169 caps
->TextureAddressCaps
= WINED3DPTADDRESSCAPS_INDEPENDENTUV
|
2170 WINED3DPTADDRESSCAPS_CLAMP
|
2171 WINED3DPTADDRESSCAPS_WRAP
;
2173 caps
->VolumeTextureAddressCaps
= 0;
2175 caps
->LineCaps
= WINED3DLINECAPS_TEXTURE
|
2176 WINED3DLINECAPS_ZTEST
|
2177 WINED3DLINECAPS_BLEND
|
2178 WINED3DLINECAPS_ALPHACMP
|
2179 WINED3DLINECAPS_FOG
;
2180 /* WINED3DLINECAPS_ANTIALIAS is not supported on Windows, and dx and gl seem to have a different
2181 * idea how generating the smoothing alpha values works; the result is different
2184 caps
->MaxTextureWidth
= d3d_info
->limits
.texture_size
;
2185 caps
->MaxTextureHeight
= d3d_info
->limits
.texture_size
;
2187 caps
->MaxVolumeExtent
= 0;
2189 caps
->MaxTextureRepeat
= 32768;
2190 caps
->MaxTextureAspectRatio
= d3d_info
->limits
.texture_size
;
2191 caps
->MaxVertexW
= 1e10f
;
2193 caps
->GuardBandLeft
= -32768.0f
;
2194 caps
->GuardBandTop
= -32768.0f
;
2195 caps
->GuardBandRight
= 32768.0f
;
2196 caps
->GuardBandBottom
= 32768.0f
;
2198 caps
->ExtentsAdjust
= 0.0f
;
2200 caps
->StencilCaps
= WINED3DSTENCILCAPS_DECRSAT
|
2201 WINED3DSTENCILCAPS_INCRSAT
|
2202 WINED3DSTENCILCAPS_INVERT
|
2203 WINED3DSTENCILCAPS_KEEP
|
2204 WINED3DSTENCILCAPS_REPLACE
|
2205 WINED3DSTENCILCAPS_ZERO
;
2207 caps
->MaxAnisotropy
= 0;
2208 caps
->MaxPointSize
= d3d_info
->limits
.pointsize_max
;
2210 caps
->MaxPrimitiveCount
= 0x555555; /* Taken from an AMD Radeon HD 5700 (Evergreen) GPU. */
2211 caps
->MaxVertexIndex
= 0xffffff; /* Taken from an AMD Radeon HD 5700 (Evergreen) GPU. */
2212 caps
->MaxStreams
= WINED3D_MAX_STREAMS
;
2213 caps
->MaxStreamStride
= 1024;
2215 /* d3d9.dll sets D3DDEVCAPS2_CAN_STRETCHRECT_FROM_TEXTURES here because StretchRects is implemented in d3d9 */
2216 caps
->DevCaps2
= WINED3DDEVCAPS2_STREAMOFFSET
|
2217 WINED3DDEVCAPS2_VERTEXELEMENTSCANSHARESTREAMOFFSET
;
2218 caps
->MaxNpatchTessellationLevel
= 0;
2220 caps
->NumSimultaneousRTs
= d3d_info
->limits
.max_rt_count
;
2222 caps
->StretchRectFilterCaps
= WINED3DPTFILTERCAPS_MINFPOINT
|
2223 WINED3DPTFILTERCAPS_MAGFPOINT
|
2224 WINED3DPTFILTERCAPS_MINFLINEAR
|
2225 WINED3DPTFILTERCAPS_MAGFLINEAR
;
2226 caps
->VertexTextureFilterCaps
= 0;
2228 adapter
->shader_backend
->shader_get_caps(adapter
, &shader_caps
);
2229 adapter
->fragment_pipe
->get_caps(adapter
, &fragment_caps
);
2230 adapter
->vertex_pipe
->vp_get_caps(adapter
, &vertex_caps
);
2232 /* Add shader misc caps. Only some of them belong to the shader parts of the pipeline */
2233 caps
->PrimitiveMiscCaps
|= fragment_caps
.PrimitiveMiscCaps
;
2235 caps
->VertexShaderVersion
= shader_caps
.vs_version
;
2236 caps
->MaxVertexShaderConst
= shader_caps
.vs_uniform_count
;
2238 caps
->PixelShaderVersion
= shader_caps
.ps_version
;
2239 caps
->PixelShader1xMaxValue
= shader_caps
.ps_1x_max_value
;
2241 caps
->TextureOpCaps
= fragment_caps
.TextureOpCaps
;
2242 caps
->MaxTextureBlendStages
= fragment_caps
.MaxTextureBlendStages
;
2243 caps
->MaxSimultaneousTextures
= fragment_caps
.MaxSimultaneousTextures
;
2245 caps
->MaxUserClipPlanes
= vertex_caps
.max_user_clip_planes
;
2246 caps
->MaxActiveLights
= vertex_caps
.max_active_lights
;
2247 caps
->MaxVertexBlendMatrices
= vertex_caps
.max_vertex_blend_matrices
;
2248 caps
->MaxVertexBlendMatrixIndex
= vertex_caps
.max_vertex_blend_matrix_index
;
2249 caps
->VertexProcessingCaps
= vertex_caps
.vertex_processing_caps
;
2250 caps
->FVFCaps
= vertex_caps
.fvf_caps
;
2251 caps
->RasterCaps
|= vertex_caps
.raster_caps
;
2253 /* The following caps are shader specific, but they are things we cannot detect, or which
2254 * are the same among all shader models. So to avoid code duplication set the shader version
2255 * specific, but otherwise constant caps here
2257 if (caps
->VertexShaderVersion
>= 3)
2259 /* Where possible set the caps based on OpenGL extensions and if they
2260 * aren't set (in case of software rendering) use the VS 3.0 from
2261 * MSDN or else if there's OpenGL spec use a hardcoded value minimum
2263 caps
->VS20Caps
.caps
= WINED3DVS20CAPS_PREDICATION
;
2264 /* VS 3.0 requires MAX_DYNAMICFLOWCONTROLDEPTH (24) */
2265 caps
->VS20Caps
.dynamic_flow_control_depth
= WINED3DVS20_MAX_DYNAMICFLOWCONTROLDEPTH
;
2266 caps
->VS20Caps
.temp_count
= 32;
2267 /* level of nesting in loops / if-statements; VS 3.0 requires MAX (4) */
2268 caps
->VS20Caps
.static_flow_control_depth
= WINED3DVS20_MAX_STATICFLOWCONTROLDEPTH
;
2270 caps
->MaxVShaderInstructionsExecuted
= 65535; /* VS 3.0 needs at least 65535, some cards even use 2^32-1 */
2271 caps
->MaxVertexShader30InstructionSlots
= WINED3DMIN30SHADERINSTRUCTIONS
;
2272 caps
->VertexTextureFilterCaps
= WINED3DPTFILTERCAPS_MINFPOINT
| WINED3DPTFILTERCAPS_MAGFPOINT
;
2274 else if (caps
->VertexShaderVersion
== 2)
2276 caps
->VS20Caps
.caps
= 0;
2277 caps
->VS20Caps
.dynamic_flow_control_depth
= WINED3DVS20_MIN_DYNAMICFLOWCONTROLDEPTH
;
2278 caps
->VS20Caps
.temp_count
= WINED3DVS20_MIN_NUMTEMPS
;
2279 caps
->VS20Caps
.static_flow_control_depth
= 1;
2281 caps
->MaxVShaderInstructionsExecuted
= 65535;
2282 caps
->MaxVertexShader30InstructionSlots
= 0;
2286 caps
->VS20Caps
.caps
= 0;
2287 caps
->VS20Caps
.dynamic_flow_control_depth
= 0;
2288 caps
->VS20Caps
.temp_count
= 0;
2289 caps
->VS20Caps
.static_flow_control_depth
= 0;
2291 caps
->MaxVShaderInstructionsExecuted
= 0;
2292 caps
->MaxVertexShader30InstructionSlots
= 0;
2295 if (caps
->PixelShaderVersion
>= 3)
2297 /* Where possible set the caps based on OpenGL extensions and if they
2298 * aren't set (in case of software rendering) use the PS 3.0 from
2299 * MSDN or else if there's OpenGL spec use a hardcoded value minimum
2302 /* Caps is more or less undocumented on MSDN but it appears to be
2303 * used for PS20Caps based on results from R9600/FX5900/Geforce6800
2304 * cards from Windows */
2305 caps
->PS20Caps
.caps
= WINED3DPS20CAPS_ARBITRARYSWIZZLE
|
2306 WINED3DPS20CAPS_GRADIENTINSTRUCTIONS
|
2307 WINED3DPS20CAPS_PREDICATION
|
2308 WINED3DPS20CAPS_NODEPENDENTREADLIMIT
|
2309 WINED3DPS20CAPS_NOTEXINSTRUCTIONLIMIT
;
2310 /* PS 3.0 requires MAX_DYNAMICFLOWCONTROLDEPTH (24) */
2311 caps
->PS20Caps
.dynamic_flow_control_depth
= WINED3DPS20_MAX_DYNAMICFLOWCONTROLDEPTH
;
2312 caps
->PS20Caps
.temp_count
= 32;
2313 /* PS 3.0 requires MAX_STATICFLOWCONTROLDEPTH (4) */
2314 caps
->PS20Caps
.static_flow_control_depth
= WINED3DPS20_MAX_STATICFLOWCONTROLDEPTH
;
2315 /* PS 3.0 requires MAX_NUMINSTRUCTIONSLOTS (512) */
2316 caps
->PS20Caps
.instruction_slot_count
= WINED3DPS20_MAX_NUMINSTRUCTIONSLOTS
;
2318 caps
->MaxPShaderInstructionsExecuted
= 65535;
2319 caps
->MaxPixelShader30InstructionSlots
= WINED3DMIN30SHADERINSTRUCTIONS
;
2321 else if (caps
->PixelShaderVersion
== 2)
2323 /* Below we assume PS2.0 specs, not extended 2.0a(GeforceFX)/2.0b(Radeon R3xx) ones */
2324 caps
->PS20Caps
.caps
= 0;
2325 caps
->PS20Caps
.dynamic_flow_control_depth
= 0; /* WINED3DVS20_MIN_DYNAMICFLOWCONTROLDEPTH = 0 */
2326 caps
->PS20Caps
.temp_count
= WINED3DPS20_MIN_NUMTEMPS
;
2327 caps
->PS20Caps
.static_flow_control_depth
= WINED3DPS20_MIN_STATICFLOWCONTROLDEPTH
; /* Minimum: 1 */
2328 /* Minimum number (64 ALU + 32 Texture), a GeforceFX uses 512 */
2329 caps
->PS20Caps
.instruction_slot_count
= WINED3DPS20_MIN_NUMINSTRUCTIONSLOTS
;
2331 caps
->MaxPShaderInstructionsExecuted
= 512; /* Minimum value, a GeforceFX uses 1024 */
2332 caps
->MaxPixelShader30InstructionSlots
= 0;
2336 caps
->PS20Caps
.caps
= 0;
2337 caps
->PS20Caps
.dynamic_flow_control_depth
= 0;
2338 caps
->PS20Caps
.temp_count
= 0;
2339 caps
->PS20Caps
.static_flow_control_depth
= 0;
2340 caps
->PS20Caps
.instruction_slot_count
= 0;
2342 caps
->MaxPShaderInstructionsExecuted
= 0;
2343 caps
->MaxPixelShader30InstructionSlots
= 0;
2346 if (caps
->VertexShaderVersion
>= 2)
2348 /* OpenGL supports all the formats below, perhaps not always
2349 * without conversion, but it supports them.
2350 * Further GLSL doesn't seem to have an official unsigned type so
2351 * don't advertise it yet as I'm not sure how we handle it.
2352 * We might need to add some clamping in the shader engine to
2354 * TODO: WINED3DDTCAPS_USHORT2N, WINED3DDTCAPS_USHORT4N, WINED3DDTCAPS_UDEC3, WINED3DDTCAPS_DEC3N */
2355 caps
->DeclTypes
= WINED3DDTCAPS_UBYTE4
|
2356 WINED3DDTCAPS_UBYTE4N
|
2357 WINED3DDTCAPS_SHORT2N
|
2358 WINED3DDTCAPS_SHORT4N
;
2362 caps
->DeclTypes
= 0;
2365 /* Set DirectDraw helper Caps */
2366 ckey_caps
= WINEDDCKEYCAPS_DESTBLT
|
2367 WINEDDCKEYCAPS_SRCBLT
;
2368 fx_caps
= WINEDDFXCAPS_BLTALPHA
|
2369 WINEDDFXCAPS_BLTMIRRORLEFTRIGHT
|
2370 WINEDDFXCAPS_BLTMIRRORUPDOWN
|
2371 WINEDDFXCAPS_BLTROTATION90
|
2372 WINEDDFXCAPS_BLTSHRINKX
|
2373 WINEDDFXCAPS_BLTSHRINKXN
|
2374 WINEDDFXCAPS_BLTSHRINKY
|
2375 WINEDDFXCAPS_BLTSHRINKYN
|
2376 WINEDDFXCAPS_BLTSTRETCHX
|
2377 WINEDDFXCAPS_BLTSTRETCHXN
|
2378 WINEDDFXCAPS_BLTSTRETCHY
|
2379 WINEDDFXCAPS_BLTSTRETCHYN
;
2380 blit_caps
= WINEDDCAPS_BLT
|
2381 WINEDDCAPS_BLTCOLORFILL
|
2382 WINEDDCAPS_BLTDEPTHFILL
|
2383 WINEDDCAPS_BLTSTRETCH
|
2384 WINEDDCAPS_CANBLTSYSMEM
|
2385 WINEDDCAPS_CANCLIP
|
2386 WINEDDCAPS_CANCLIPSTRETCHED
|
2387 WINEDDCAPS_COLORKEY
|
2388 WINEDDCAPS_COLORKEYHWASSIST
;
2390 /* Fill the ddraw caps structure */
2391 caps
->ddraw_caps
.caps
= WINEDDCAPS_GDI
|
2392 WINEDDCAPS_PALETTE
|
2394 caps
->ddraw_caps
.caps2
= WINEDDCAPS2_CERTIFIED
|
2395 WINEDDCAPS2_NOPAGELOCKREQUIRED
|
2396 WINEDDCAPS2_PRIMARYGAMMA
|
2397 WINEDDCAPS2_WIDESURFACES
|
2398 WINEDDCAPS2_CANRENDERWINDOWED
;
2399 caps
->ddraw_caps
.color_key_caps
= ckey_caps
;
2400 caps
->ddraw_caps
.fx_caps
= fx_caps
;
2401 caps
->ddraw_caps
.svb_caps
= blit_caps
;
2402 caps
->ddraw_caps
.svb_color_key_caps
= ckey_caps
;
2403 caps
->ddraw_caps
.svb_fx_caps
= fx_caps
;
2404 caps
->ddraw_caps
.vsb_caps
= blit_caps
;
2405 caps
->ddraw_caps
.vsb_color_key_caps
= ckey_caps
;
2406 caps
->ddraw_caps
.vsb_fx_caps
= fx_caps
;
2407 caps
->ddraw_caps
.ssb_caps
= blit_caps
;
2408 caps
->ddraw_caps
.ssb_color_key_caps
= ckey_caps
;
2409 caps
->ddraw_caps
.ssb_fx_caps
= fx_caps
;
2411 caps
->ddraw_caps
.dds_caps
= WINEDDSCAPS_FLIP
2412 | WINEDDSCAPS_OFFSCREENPLAIN
2413 | WINEDDSCAPS_PALETTE
2414 | WINEDDSCAPS_PRIMARYSURFACE
2415 | WINEDDSCAPS_TEXTURE
2416 | WINEDDSCAPS_ZBUFFER
2417 | WINEDDSCAPS_MIPMAP
;
2419 caps
->shader_double_precision
= d3d_info
->shader_double_precision
;
2420 caps
->viewport_array_index_any_shader
= d3d_info
->viewport_array_index_any_shader
;
2422 caps
->max_feature_level
= d3d_info
->feature_level
;
2424 adapter
->adapter_ops
->adapter_get_wined3d_caps(adapter
, caps
);
2429 HRESULT CDECL
wined3d_device_create(struct wined3d
*wined3d
, struct wined3d_adapter
*adapter
,
2430 enum wined3d_device_type device_type
, HWND focus_window
, DWORD flags
, BYTE surface_alignment
,
2431 const enum wined3d_feature_level
*feature_levels
, unsigned int feature_level_count
,
2432 struct wined3d_device_parent
*device_parent
, struct wined3d_device
**device
)
2434 struct wined3d_device
*object
;
2437 TRACE("wined3d %p, adapter %p, device_type %#x, focus_window %p, flags %#x, "
2438 "surface_alignment %u, feature_levels %p, feature_level_count %u, device_parent %p, device %p.\n",
2439 wined3d
, adapter
, device_type
, focus_window
, flags
, surface_alignment
,
2440 feature_levels
, feature_level_count
, device_parent
, device
);
2442 if (FAILED(hr
= adapter
->adapter_ops
->adapter_create_device(wined3d
, adapter
,
2443 device_type
, focus_window
, flags
, surface_alignment
,
2444 feature_levels
, feature_level_count
, device_parent
, &object
)))
2447 TRACE("Created device %p.\n", object
);
2450 device_parent
->ops
->wined3d_device_created(device_parent
, *device
);
2455 static const struct wined3d_state_entry_template misc_state_template_no3d
[] =
2457 {STATE_CONSTANT_BUFFER(WINED3D_SHADER_TYPE_VERTEX
), {STATE_VDECL
}},
2458 {STATE_CONSTANT_BUFFER(WINED3D_SHADER_TYPE_HULL
), {STATE_VDECL
}},
2459 {STATE_CONSTANT_BUFFER(WINED3D_SHADER_TYPE_DOMAIN
), {STATE_VDECL
}},
2460 {STATE_CONSTANT_BUFFER(WINED3D_SHADER_TYPE_GEOMETRY
), {STATE_VDECL
}},
2461 {STATE_CONSTANT_BUFFER(WINED3D_SHADER_TYPE_PIXEL
), {STATE_VDECL
}},
2462 {STATE_CONSTANT_BUFFER(WINED3D_SHADER_TYPE_COMPUTE
), {STATE_VDECL
}},
2463 {STATE_GRAPHICS_SHADER_RESOURCE_BINDING
, {STATE_VDECL
}},
2464 {STATE_GRAPHICS_UNORDERED_ACCESS_VIEW_BINDING
, {STATE_VDECL
}},
2465 {STATE_COMPUTE_SHADER_RESOURCE_BINDING
, {STATE_VDECL
}},
2466 {STATE_COMPUTE_UNORDERED_ACCESS_VIEW_BINDING
, {STATE_VDECL
}},
2467 {STATE_STREAM_OUTPUT
, {STATE_VDECL
}},
2468 {STATE_BLEND
, {STATE_VDECL
}},
2469 {STATE_BLEND_FACTOR
, {STATE_VDECL
}},
2470 {STATE_SAMPLE_MASK
, {STATE_VDECL
}},
2471 {STATE_DEPTH_STENCIL
, {STATE_VDECL
}},
2472 {STATE_STREAMSRC
, {STATE_VDECL
}},
2473 {STATE_VDECL
, {STATE_VDECL
, state_nop
}},
2474 {STATE_RASTERIZER
, {STATE_VDECL
}},
2475 {STATE_SCISSORRECT
, {STATE_VDECL
}},
2476 {STATE_POINTSPRITECOORDORIGIN
, {STATE_VDECL
}},
2478 {STATE_TEXTURESTAGE(0, WINED3D_TSS_BUMPENV_MAT00
), {STATE_VDECL
}},
2479 {STATE_TEXTURESTAGE(0, WINED3D_TSS_BUMPENV_MAT01
), {STATE_VDECL
}},
2480 {STATE_TEXTURESTAGE(0, WINED3D_TSS_BUMPENV_MAT10
), {STATE_VDECL
}},
2481 {STATE_TEXTURESTAGE(0, WINED3D_TSS_BUMPENV_MAT11
), {STATE_VDECL
}},
2482 {STATE_TEXTURESTAGE(1, WINED3D_TSS_BUMPENV_MAT00
), {STATE_VDECL
}},
2483 {STATE_TEXTURESTAGE(1, WINED3D_TSS_BUMPENV_MAT01
), {STATE_VDECL
}},
2484 {STATE_TEXTURESTAGE(1, WINED3D_TSS_BUMPENV_MAT10
), {STATE_VDECL
}},
2485 {STATE_TEXTURESTAGE(1, WINED3D_TSS_BUMPENV_MAT11
), {STATE_VDECL
}},
2486 {STATE_TEXTURESTAGE(2, WINED3D_TSS_BUMPENV_MAT00
), {STATE_VDECL
}},
2487 {STATE_TEXTURESTAGE(2, WINED3D_TSS_BUMPENV_MAT01
), {STATE_VDECL
}},
2488 {STATE_TEXTURESTAGE(2, WINED3D_TSS_BUMPENV_MAT10
), {STATE_VDECL
}},
2489 {STATE_TEXTURESTAGE(2, WINED3D_TSS_BUMPENV_MAT11
), {STATE_VDECL
}},
2490 {STATE_TEXTURESTAGE(3, WINED3D_TSS_BUMPENV_MAT00
), {STATE_VDECL
}},
2491 {STATE_TEXTURESTAGE(3, WINED3D_TSS_BUMPENV_MAT01
), {STATE_VDECL
}},
2492 {STATE_TEXTURESTAGE(3, WINED3D_TSS_BUMPENV_MAT10
), {STATE_VDECL
}},
2493 {STATE_TEXTURESTAGE(3, WINED3D_TSS_BUMPENV_MAT11
), {STATE_VDECL
}},
2494 {STATE_TEXTURESTAGE(4, WINED3D_TSS_BUMPENV_MAT00
), {STATE_VDECL
}},
2495 {STATE_TEXTURESTAGE(4, WINED3D_TSS_BUMPENV_MAT01
), {STATE_VDECL
}},
2496 {STATE_TEXTURESTAGE(4, WINED3D_TSS_BUMPENV_MAT10
), {STATE_VDECL
}},
2497 {STATE_TEXTURESTAGE(4, WINED3D_TSS_BUMPENV_MAT11
), {STATE_VDECL
}},
2498 {STATE_TEXTURESTAGE(5, WINED3D_TSS_BUMPENV_MAT00
), {STATE_VDECL
}},
2499 {STATE_TEXTURESTAGE(5, WINED3D_TSS_BUMPENV_MAT01
), {STATE_VDECL
}},
2500 {STATE_TEXTURESTAGE(5, WINED3D_TSS_BUMPENV_MAT10
), {STATE_VDECL
}},
2501 {STATE_TEXTURESTAGE(5, WINED3D_TSS_BUMPENV_MAT11
), {STATE_VDECL
}},
2502 {STATE_TEXTURESTAGE(6, WINED3D_TSS_BUMPENV_MAT00
), {STATE_VDECL
}},
2503 {STATE_TEXTURESTAGE(6, WINED3D_TSS_BUMPENV_MAT01
), {STATE_VDECL
}},
2504 {STATE_TEXTURESTAGE(6, WINED3D_TSS_BUMPENV_MAT10
), {STATE_VDECL
}},
2505 {STATE_TEXTURESTAGE(6, WINED3D_TSS_BUMPENV_MAT11
), {STATE_VDECL
}},
2506 {STATE_TEXTURESTAGE(7, WINED3D_TSS_BUMPENV_MAT00
), {STATE_VDECL
}},
2507 {STATE_TEXTURESTAGE(7, WINED3D_TSS_BUMPENV_MAT01
), {STATE_VDECL
}},
2508 {STATE_TEXTURESTAGE(7, WINED3D_TSS_BUMPENV_MAT10
), {STATE_VDECL
}},
2509 {STATE_TEXTURESTAGE(7, WINED3D_TSS_BUMPENV_MAT11
), {STATE_VDECL
}},
2510 {STATE_TEXTURESTAGE(0, WINED3D_TSS_BUMPENV_LSCALE
), {STATE_VDECL
}},
2511 {STATE_TEXTURESTAGE(0, WINED3D_TSS_BUMPENV_LOFFSET
), {STATE_VDECL
}},
2512 {STATE_TEXTURESTAGE(1, WINED3D_TSS_BUMPENV_LSCALE
), {STATE_VDECL
}},
2513 {STATE_TEXTURESTAGE(1, WINED3D_TSS_BUMPENV_LOFFSET
), {STATE_VDECL
}},
2514 {STATE_TEXTURESTAGE(2, WINED3D_TSS_BUMPENV_LSCALE
), {STATE_VDECL
}},
2515 {STATE_TEXTURESTAGE(2, WINED3D_TSS_BUMPENV_LOFFSET
), {STATE_VDECL
}},
2516 {STATE_TEXTURESTAGE(3, WINED3D_TSS_BUMPENV_LSCALE
), {STATE_VDECL
}},
2517 {STATE_TEXTURESTAGE(3, WINED3D_TSS_BUMPENV_LOFFSET
), {STATE_VDECL
}},
2518 {STATE_TEXTURESTAGE(4, WINED3D_TSS_BUMPENV_LSCALE
), {STATE_VDECL
}},
2519 {STATE_TEXTURESTAGE(4, WINED3D_TSS_BUMPENV_LOFFSET
), {STATE_VDECL
}},
2520 {STATE_TEXTURESTAGE(5, WINED3D_TSS_BUMPENV_LSCALE
), {STATE_VDECL
}},
2521 {STATE_TEXTURESTAGE(5, WINED3D_TSS_BUMPENV_LOFFSET
), {STATE_VDECL
}},
2522 {STATE_TEXTURESTAGE(6, WINED3D_TSS_BUMPENV_LSCALE
), {STATE_VDECL
}},
2523 {STATE_TEXTURESTAGE(6, WINED3D_TSS_BUMPENV_LOFFSET
), {STATE_VDECL
}},
2524 {STATE_TEXTURESTAGE(7, WINED3D_TSS_BUMPENV_LSCALE
), {STATE_VDECL
}},
2525 {STATE_TEXTURESTAGE(7, WINED3D_TSS_BUMPENV_LOFFSET
), {STATE_VDECL
}},
2527 {STATE_VIEWPORT
, {STATE_VDECL
}},
2528 {STATE_INDEXBUFFER
, {STATE_VDECL
}},
2529 {STATE_RENDER(WINED3D_RS_ANTIALIAS
), {STATE_VDECL
}},
2530 {STATE_RENDER(WINED3D_RS_TEXTUREPERSPECTIVE
), {STATE_VDECL
}},
2531 {STATE_RENDER(WINED3D_RS_WRAPU
), {STATE_VDECL
}},
2532 {STATE_RENDER(WINED3D_RS_WRAPV
), {STATE_VDECL
}},
2533 {STATE_RENDER(WINED3D_RS_LINEPATTERN
), {STATE_VDECL
}},
2534 {STATE_RENDER(WINED3D_RS_MONOENABLE
), {STATE_VDECL
}},
2535 {STATE_RENDER(WINED3D_RS_ROP2
), {STATE_VDECL
}},
2536 {STATE_RENDER(WINED3D_RS_PLANEMASK
), {STATE_VDECL
}},
2537 {STATE_RENDER(WINED3D_RS_LASTPIXEL
), {STATE_VDECL
}},
2538 {STATE_RENDER(WINED3D_RS_ZFUNC
), {STATE_VDECL
}},
2539 {STATE_RENDER(WINED3D_RS_DITHERENABLE
), {STATE_VDECL
}},
2540 {STATE_RENDER(WINED3D_RS_SUBPIXEL
), {STATE_VDECL
}},
2541 {STATE_RENDER(WINED3D_RS_SUBPIXELX
), {STATE_VDECL
}},
2542 {STATE_RENDER(WINED3D_RS_STIPPLEDALPHA
), {STATE_VDECL
}},
2543 {STATE_RENDER(WINED3D_RS_STIPPLEENABLE
), {STATE_VDECL
}},
2544 {STATE_RENDER(WINED3D_RS_MIPMAPLODBIAS
), {STATE_VDECL
}},
2545 {STATE_RENDER(WINED3D_RS_ANISOTROPY
), {STATE_VDECL
}},
2546 {STATE_RENDER(WINED3D_RS_FLUSHBATCH
), {STATE_VDECL
}},
2547 {STATE_RENDER(WINED3D_RS_TRANSLUCENTSORTINDEPENDENT
), {STATE_VDECL
}},
2548 {STATE_RENDER(WINED3D_RS_STENCILREF
), {STATE_VDECL
}},
2549 {STATE_RENDER(WINED3D_RS_WRAP0
), {STATE_VDECL
}},
2550 {STATE_RENDER(WINED3D_RS_WRAP1
), {STATE_VDECL
}},
2551 {STATE_RENDER(WINED3D_RS_WRAP2
), {STATE_VDECL
}},
2552 {STATE_RENDER(WINED3D_RS_WRAP3
), {STATE_VDECL
}},
2553 {STATE_RENDER(WINED3D_RS_WRAP4
), {STATE_VDECL
}},
2554 {STATE_RENDER(WINED3D_RS_WRAP5
), {STATE_VDECL
}},
2555 {STATE_RENDER(WINED3D_RS_WRAP6
), {STATE_VDECL
}},
2556 {STATE_RENDER(WINED3D_RS_WRAP7
), {STATE_VDECL
}},
2557 {STATE_RENDER(WINED3D_RS_WRAP8
), {STATE_VDECL
}},
2558 {STATE_RENDER(WINED3D_RS_WRAP9
), {STATE_VDECL
}},
2559 {STATE_RENDER(WINED3D_RS_WRAP10
), {STATE_VDECL
}},
2560 {STATE_RENDER(WINED3D_RS_WRAP11
), {STATE_VDECL
}},
2561 {STATE_RENDER(WINED3D_RS_WRAP12
), {STATE_VDECL
}},
2562 {STATE_RENDER(WINED3D_RS_WRAP13
), {STATE_VDECL
}},
2563 {STATE_RENDER(WINED3D_RS_WRAP14
), {STATE_VDECL
}},
2564 {STATE_RENDER(WINED3D_RS_WRAP15
), {STATE_VDECL
}},
2565 {STATE_RENDER(WINED3D_RS_EXTENTS
), {STATE_VDECL
}},
2566 {STATE_RENDER(WINED3D_RS_COLORKEYBLENDENABLE
), {STATE_VDECL
}},
2567 {STATE_RENDER(WINED3D_RS_SOFTWAREVERTEXPROCESSING
), {STATE_VDECL
}},
2568 {STATE_RENDER(WINED3D_RS_PATCHEDGESTYLE
), {STATE_VDECL
}},
2569 {STATE_RENDER(WINED3D_RS_PATCHSEGMENTS
), {STATE_VDECL
}},
2570 {STATE_RENDER(WINED3D_RS_POSITIONDEGREE
), {STATE_VDECL
}},
2571 {STATE_RENDER(WINED3D_RS_NORMALDEGREE
), {STATE_VDECL
}},
2572 {STATE_RENDER(WINED3D_RS_MINTESSELLATIONLEVEL
), {STATE_VDECL
}},
2573 {STATE_RENDER(WINED3D_RS_MAXTESSELLATIONLEVEL
), {STATE_VDECL
}},
2574 {STATE_RENDER(WINED3D_RS_ADAPTIVETESS_X
), {STATE_VDECL
}},
2575 {STATE_RENDER(WINED3D_RS_ADAPTIVETESS_Y
), {STATE_VDECL
}},
2576 {STATE_RENDER(WINED3D_RS_ADAPTIVETESS_Z
), {STATE_VDECL
}},
2577 {STATE_RENDER(WINED3D_RS_ADAPTIVETESS_W
), {STATE_VDECL
}},
2578 {STATE_RENDER(WINED3D_RS_ENABLEADAPTIVETESSELLATION
), {STATE_VDECL
}},
2579 {STATE_RENDER(WINED3D_RS_MULTISAMPLEANTIALIAS
), {STATE_VDECL
}},
2580 {STATE_RENDER(WINED3D_RS_DEBUGMONITORTOKEN
), {STATE_VDECL
}},
2581 {STATE_RENDER(WINED3D_RS_ZVISIBLE
), {STATE_VDECL
}},
2583 {STATE_SAMPLER(0), {STATE_VDECL
}},
2584 {STATE_SAMPLER(1), {STATE_VDECL
}},
2585 {STATE_SAMPLER(2), {STATE_VDECL
}},
2586 {STATE_SAMPLER(3), {STATE_VDECL
}},
2587 {STATE_SAMPLER(4), {STATE_VDECL
}},
2588 {STATE_SAMPLER(5), {STATE_VDECL
}},
2589 {STATE_SAMPLER(6), {STATE_VDECL
}},
2590 {STATE_SAMPLER(7), {STATE_VDECL
}},
2591 {STATE_SAMPLER(8), {STATE_VDECL
}},
2592 {STATE_SAMPLER(9), {STATE_VDECL
}},
2593 {STATE_SAMPLER(10), {STATE_VDECL
}},
2594 {STATE_SAMPLER(11), {STATE_VDECL
}},
2595 {STATE_SAMPLER(12), {STATE_VDECL
}},
2596 {STATE_SAMPLER(13), {STATE_VDECL
}},
2597 {STATE_SAMPLER(14), {STATE_VDECL
}},
2598 {STATE_SAMPLER(15), {STATE_VDECL
}},
2599 {STATE_SAMPLER(16), /* Vertex sampler 0 */ {STATE_VDECL
}},
2600 {STATE_SAMPLER(17), /* Vertex sampler 1 */ {STATE_VDECL
}},
2601 {STATE_SAMPLER(18), /* Vertex sampler 2 */ {STATE_VDECL
}},
2602 {STATE_SAMPLER(19), /* Vertex sampler 3 */ {STATE_VDECL
}},
2603 {STATE_BASEVERTEXINDEX
, {STATE_VDECL
}},
2604 {STATE_FRAMEBUFFER
, {STATE_VDECL
}},
2605 {STATE_SHADER(WINED3D_SHADER_TYPE_PIXEL
), {STATE_VDECL
}},
2606 {STATE_SHADER(WINED3D_SHADER_TYPE_HULL
), {STATE_VDECL
}},
2607 {STATE_SHADER(WINED3D_SHADER_TYPE_DOMAIN
), {STATE_VDECL
}},
2608 {STATE_SHADER(WINED3D_SHADER_TYPE_GEOMETRY
), {STATE_VDECL
}},
2609 {STATE_SHADER(WINED3D_SHADER_TYPE_COMPUTE
), {STATE_VDECL
}},
2610 {0}, /* Terminate */
2613 static void adapter_no3d_destroy(struct wined3d_adapter
*adapter
)
2615 wined3d_adapter_cleanup(adapter
);
2619 static HRESULT
adapter_no3d_create_device(struct wined3d
*wined3d
, const struct wined3d_adapter
*adapter
,
2620 enum wined3d_device_type device_type
, HWND focus_window
, unsigned int flags
, BYTE surface_alignment
,
2621 const enum wined3d_feature_level
*levels
, unsigned int level_count
,
2622 struct wined3d_device_parent
*device_parent
, struct wined3d_device
**device
)
2624 struct wined3d_device_no3d
*device_no3d
;
2627 if (!(device_no3d
= heap_alloc_zero(sizeof(*device_no3d
))))
2628 return E_OUTOFMEMORY
;
2630 if (FAILED(hr
= wined3d_device_init(&device_no3d
->d
, wined3d
, adapter
->ordinal
, device_type
, focus_window
,
2631 flags
, surface_alignment
, levels
, level_count
, adapter
->gl_info
.supported
, device_parent
)))
2633 WARN("Failed to initialize device, hr %#x.\n", hr
);
2634 heap_free(device_no3d
);
2638 *device
= &device_no3d
->d
;
2643 static void adapter_no3d_destroy_device(struct wined3d_device
*device
)
2645 wined3d_device_cleanup(device
);
2649 struct wined3d_context
*adapter_no3d_acquire_context(struct wined3d_device
*device
,
2650 struct wined3d_texture
*texture
, unsigned int sub_resource_idx
)
2652 TRACE("device %p, texture %p, sub_resource_idx %u.\n", device
, texture
, sub_resource_idx
);
2654 wined3d_from_cs(device
->cs
);
2656 if (!device
->context_count
)
2659 return &wined3d_device_no3d(device
)->context_no3d
;
2662 void adapter_no3d_release_context(struct wined3d_context
*context
)
2664 TRACE("context %p.\n", context
);
2667 static void adapter_no3d_get_wined3d_caps(const struct wined3d_adapter
*adapter
, struct wined3d_caps
*caps
)
2671 static BOOL
adapter_no3d_check_format(const struct wined3d_adapter
*adapter
,
2672 const struct wined3d_format
*adapter_format
, const struct wined3d_format
*rt_format
,
2673 const struct wined3d_format
*ds_format
)
2678 static HRESULT
adapter_no3d_init_3d(struct wined3d_device
*device
)
2680 struct wined3d_context
*context_no3d
;
2683 TRACE("device %p.\n", device
);
2685 context_no3d
= &wined3d_device_no3d(device
)->context_no3d
;
2686 if (FAILED(hr
= wined3d_context_no3d_init(context_no3d
, device
->swapchains
[0])))
2688 WARN("Failed to initialise context.\n");
2692 if (!device_context_add(device
, context_no3d
))
2694 ERR("Failed to add the newly created context to the context list.\n");
2695 wined3d_context_cleanup(context_no3d
);
2699 TRACE("Initialised context %p.\n", context_no3d
);
2701 if (!(device
->blitter
= wined3d_cpu_blitter_create()))
2703 ERR("Failed to create CPU blitter.\n");
2704 device_context_remove(device
, context_no3d
);
2705 wined3d_context_cleanup(context_no3d
);
2712 static void adapter_no3d_uninit_3d(struct wined3d_device
*device
)
2714 struct wined3d_context
*context_no3d
;
2716 TRACE("device %p.\n", device
);
2718 context_no3d
= &wined3d_device_no3d(device
)->context_no3d
;
2719 device
->blitter
->ops
->blitter_destroy(device
->blitter
, NULL
);
2720 wined3d_cs_finish(device
->cs
, WINED3D_CS_QUEUE_DEFAULT
);
2722 device_context_remove(device
, context_no3d
);
2723 wined3d_context_cleanup(context_no3d
);
2726 static void *adapter_no3d_map_bo_address(struct wined3d_context
*context
,
2727 const struct wined3d_bo_address
*data
, size_t size
, uint32_t map_flags
)
2729 if (data
->buffer_object
)
2731 ERR("Unsupported buffer object %#lx.\n", data
->buffer_object
);
2738 static void adapter_no3d_unmap_bo_address(struct wined3d_context
*context
,
2739 const struct wined3d_bo_address
*data
, unsigned int range_count
, const struct wined3d_range
*ranges
)
2741 if (data
->buffer_object
)
2742 ERR("Unsupported buffer object %#lx.\n", data
->buffer_object
);
2745 static void adapter_no3d_copy_bo_address(struct wined3d_context
*context
,
2746 const struct wined3d_bo_address
*dst
, const struct wined3d_bo_address
*src
, size_t size
)
2748 if (dst
->buffer_object
)
2749 ERR("Unsupported dst buffer object %#lx.\n", dst
->buffer_object
);
2750 if (src
->buffer_object
)
2751 ERR("Unsupported src buffer object %#lx.\n", src
->buffer_object
);
2752 if (dst
->buffer_object
|| src
->buffer_object
)
2754 memcpy(dst
->addr
, src
->addr
, size
);
2757 static HRESULT
adapter_no3d_create_swapchain(struct wined3d_device
*device
,
2758 struct wined3d_swapchain_desc
*desc
, struct wined3d_swapchain_state_parent
*state_parent
,
2759 void *parent
, const struct wined3d_parent_ops
*parent_ops
, struct wined3d_swapchain
**swapchain
)
2761 struct wined3d_swapchain
*swapchain_no3d
;
2764 TRACE("device %p, desc %p, state_parent %p, parent %p, parent_ops %p, swapchain %p.\n",
2765 device
, desc
, state_parent
, parent
, parent_ops
, swapchain
);
2767 if (!(swapchain_no3d
= heap_alloc_zero(sizeof(*swapchain_no3d
))))
2768 return E_OUTOFMEMORY
;
2770 if (FAILED(hr
= wined3d_swapchain_no3d_init(swapchain_no3d
, device
, desc
, state_parent
, parent
,
2773 WARN("Failed to initialise swapchain, hr %#x.\n", hr
);
2774 heap_free(swapchain_no3d
);
2778 TRACE("Created swapchain %p.\n", swapchain_no3d
);
2779 *swapchain
= swapchain_no3d
;
2784 static void adapter_no3d_destroy_swapchain(struct wined3d_swapchain
*swapchain
)
2786 wined3d_swapchain_cleanup(swapchain
);
2787 heap_free(swapchain
);
2790 static HRESULT
adapter_no3d_create_buffer(struct wined3d_device
*device
,
2791 const struct wined3d_buffer_desc
*desc
, const struct wined3d_sub_resource_data
*data
,
2792 void *parent
, const struct wined3d_parent_ops
*parent_ops
, struct wined3d_buffer
**buffer
)
2794 struct wined3d_buffer
*buffer_no3d
;
2797 TRACE("device %p, desc %p, data %p, parent %p, parent_ops %p, buffer %p.\n",
2798 device
, desc
, data
, parent
, parent_ops
, buffer
);
2800 if (!(buffer_no3d
= heap_alloc_zero(sizeof(*buffer_no3d
))))
2801 return E_OUTOFMEMORY
;
2803 if (FAILED(hr
= wined3d_buffer_no3d_init(buffer_no3d
, device
, desc
, data
, parent
, parent_ops
)))
2805 WARN("Failed to initialise buffer, hr %#x.\n", hr
);
2806 heap_free(buffer_no3d
);
2810 TRACE("Created buffer %p.\n", buffer_no3d
);
2811 *buffer
= buffer_no3d
;
2816 static void adapter_no3d_destroy_buffer(struct wined3d_buffer
*buffer
)
2818 struct wined3d_device
*device
= buffer
->resource
.device
;
2819 unsigned int swapchain_count
= device
->swapchain_count
;
2821 TRACE("buffer %p.\n", buffer
);
2823 /* Take a reference to the device, in case releasing the buffer would
2824 * cause the device to be destroyed. However, swapchain resources don't
2825 * take a reference to the device, and we wouldn't want to increment the
2826 * refcount on a device that's in the process of being destroyed. */
2827 if (swapchain_count
)
2828 wined3d_device_incref(device
);
2829 wined3d_buffer_cleanup(buffer
);
2830 wined3d_cs_destroy_object(device
->cs
, heap_free
, buffer
);
2831 if (swapchain_count
)
2832 wined3d_device_decref(device
);
2835 static HRESULT
adapter_no3d_create_texture(struct wined3d_device
*device
,
2836 const struct wined3d_resource_desc
*desc
, unsigned int layer_count
, unsigned int level_count
,
2837 uint32_t flags
, void *parent
, const struct wined3d_parent_ops
*parent_ops
, struct wined3d_texture
**texture
)
2839 struct wined3d_texture
*texture_no3d
;
2842 TRACE("device %p, desc %p, layer_count %u, level_count %u, flags %#x, parent %p, parent_ops %p, texture %p.\n",
2843 device
, desc
, layer_count
, level_count
, flags
, parent
, parent_ops
, texture
);
2845 if (!(texture_no3d
= wined3d_texture_allocate_object_memory(sizeof(*texture_no3d
), level_count
, layer_count
)))
2846 return E_OUTOFMEMORY
;
2848 if (FAILED(hr
= wined3d_texture_no3d_init(texture_no3d
, device
, desc
,
2849 layer_count
, level_count
, flags
, parent
, parent_ops
)))
2851 WARN("Failed to initialise texture, hr %#x.\n", hr
);
2852 heap_free(texture_no3d
);
2856 TRACE("Created texture %p.\n", texture_no3d
);
2857 *texture
= texture_no3d
;
2862 static void adapter_no3d_destroy_texture(struct wined3d_texture
*texture
)
2864 struct wined3d_device
*device
= texture
->resource
.device
;
2865 unsigned int swapchain_count
= device
->swapchain_count
;
2867 TRACE("texture %p.\n", texture
);
2869 /* Take a reference to the device, in case releasing the texture would
2870 * cause the device to be destroyed. However, swapchain resources don't
2871 * take a reference to the device, and we wouldn't want to increment the
2872 * refcount on a device that's in the process of being destroyed. */
2873 if (swapchain_count
)
2874 wined3d_device_incref(device
);
2876 wined3d_texture_sub_resources_destroyed(texture
);
2877 texture
->resource
.parent_ops
->wined3d_object_destroyed(texture
->resource
.parent
);
2879 wined3d_texture_cleanup(texture
);
2880 wined3d_cs_destroy_object(device
->cs
, heap_free
, texture
);
2882 if (swapchain_count
)
2883 wined3d_device_decref(device
);
2886 static HRESULT
adapter_no3d_create_rendertarget_view(const struct wined3d_view_desc
*desc
,
2887 struct wined3d_resource
*resource
, void *parent
, const struct wined3d_parent_ops
*parent_ops
,
2888 struct wined3d_rendertarget_view
**view
)
2890 struct wined3d_rendertarget_view
*view_no3d
;
2893 TRACE("desc %s, resource %p, parent %p, parent_ops %p, view %p.\n",
2894 wined3d_debug_view_desc(desc
, resource
), resource
, parent
, parent_ops
, view
);
2896 if (!(view_no3d
= heap_alloc_zero(sizeof(*view_no3d
))))
2897 return E_OUTOFMEMORY
;
2899 if (FAILED(hr
= wined3d_rendertarget_view_no3d_init(view_no3d
, desc
, resource
, parent
, parent_ops
)))
2901 WARN("Failed to initialise view, hr %#x.\n", hr
);
2902 heap_free(view_no3d
);
2906 TRACE("Created render target view %p.\n", view_no3d
);
2912 static void adapter_no3d_destroy_rendertarget_view(struct wined3d_rendertarget_view
*view
)
2914 struct wined3d_device
*device
= view
->resource
->device
;
2915 unsigned int swapchain_count
= device
->swapchain_count
;
2917 TRACE("view %p.\n", view
);
2919 /* Take a reference to the device, in case releasing the view's resource
2920 * would cause the device to be destroyed. However, swapchain resources
2921 * don't take a reference to the device, and we wouldn't want to increment
2922 * the refcount on a device that's in the process of being destroyed. */
2923 if (swapchain_count
)
2924 wined3d_device_incref(device
);
2925 wined3d_rendertarget_view_cleanup(view
);
2926 wined3d_cs_destroy_object(device
->cs
, heap_free
, view
);
2927 if (swapchain_count
)
2928 wined3d_device_decref(device
);
2931 static HRESULT
adapter_no3d_create_shader_resource_view(const struct wined3d_view_desc
*desc
,
2932 struct wined3d_resource
*resource
, void *parent
, const struct wined3d_parent_ops
*parent_ops
,
2933 struct wined3d_shader_resource_view
**view
)
2935 TRACE("desc %s, resource %p, parent %p, parent_ops %p, view %p.\n",
2936 wined3d_debug_view_desc(desc
, resource
), resource
, parent
, parent_ops
, view
);
2941 static void adapter_no3d_destroy_shader_resource_view(struct wined3d_shader_resource_view
*view
)
2943 TRACE("view %p.\n", view
);
2946 static HRESULT
adapter_no3d_create_unordered_access_view(const struct wined3d_view_desc
*desc
,
2947 struct wined3d_resource
*resource
, void *parent
, const struct wined3d_parent_ops
*parent_ops
,
2948 struct wined3d_unordered_access_view
**view
)
2950 TRACE("desc %s, resource %p, parent %p, parent_ops %p, view %p.\n",
2951 wined3d_debug_view_desc(desc
, resource
), resource
, parent
, parent_ops
, view
);
2956 static void adapter_no3d_destroy_unordered_access_view(struct wined3d_unordered_access_view
*view
)
2958 TRACE("view %p.\n", view
);
2961 static HRESULT
adapter_no3d_create_sampler(struct wined3d_device
*device
, const struct wined3d_sampler_desc
*desc
,
2962 void *parent
, const struct wined3d_parent_ops
*parent_ops
, struct wined3d_sampler
**sampler
)
2964 TRACE("device %p, desc %p, parent %p, parent_ops %p, sampler %p.\n",
2965 device
, desc
, parent
, parent_ops
, sampler
);
2970 static void adapter_no3d_destroy_sampler(struct wined3d_sampler
*sampler
)
2972 TRACE("sampler %p.\n", sampler
);
2975 static HRESULT
adapter_no3d_create_query(struct wined3d_device
*device
, enum wined3d_query_type type
,
2976 void *parent
, const struct wined3d_parent_ops
*parent_ops
, struct wined3d_query
**query
)
2978 TRACE("device %p, type %#x, parent %p, parent_ops %p, query %p.\n",
2979 device
, type
, parent
, parent_ops
, query
);
2981 return WINED3DERR_NOTAVAILABLE
;
2984 static void adapter_no3d_destroy_query(struct wined3d_query
*query
)
2986 TRACE("query %p.\n", query
);
2989 static void adapter_no3d_flush_context(struct wined3d_context
*context
)
2991 TRACE("context %p.\n", context
);
2994 static void adapter_no3d_draw_primitive(struct wined3d_device
*device
,
2995 const struct wined3d_state
*state
, const struct wined3d_draw_parameters
*parameters
)
2997 ERR("device %p, state %p, parameters %p.\n", device
, state
, parameters
);
3000 static void adapter_no3d_dispatch_compute(struct wined3d_device
*device
,
3001 const struct wined3d_state
*state
, const struct wined3d_dispatch_parameters
*parameters
)
3003 ERR("device %p, state %p, parameters %p.\n", device
, state
, parameters
);
3006 void adapter_no3d_clear_uav(struct wined3d_context
*context
,
3007 struct wined3d_unordered_access_view
*view
, const struct wined3d_uvec4
*clear_value
)
3009 ERR("context %p, view %p, clear_value %s.\n", context
, view
, debug_uvec4(clear_value
));
3012 static const struct wined3d_adapter_ops wined3d_adapter_no3d_ops
=
3014 .adapter_destroy
= adapter_no3d_destroy
,
3015 .adapter_create_device
= adapter_no3d_create_device
,
3016 .adapter_destroy_device
= adapter_no3d_destroy_device
,
3017 .adapter_acquire_context
= adapter_no3d_acquire_context
,
3018 .adapter_release_context
= adapter_no3d_release_context
,
3019 .adapter_get_wined3d_caps
= adapter_no3d_get_wined3d_caps
,
3020 .adapter_check_format
= adapter_no3d_check_format
,
3021 .adapter_init_3d
= adapter_no3d_init_3d
,
3022 .adapter_uninit_3d
= adapter_no3d_uninit_3d
,
3023 .adapter_map_bo_address
= adapter_no3d_map_bo_address
,
3024 .adapter_unmap_bo_address
= adapter_no3d_unmap_bo_address
,
3025 .adapter_copy_bo_address
= adapter_no3d_copy_bo_address
,
3026 .adapter_create_swapchain
= adapter_no3d_create_swapchain
,
3027 .adapter_destroy_swapchain
= adapter_no3d_destroy_swapchain
,
3028 .adapter_create_buffer
= adapter_no3d_create_buffer
,
3029 .adapter_destroy_buffer
= adapter_no3d_destroy_buffer
,
3030 .adapter_create_texture
= adapter_no3d_create_texture
,
3031 .adapter_destroy_texture
= adapter_no3d_destroy_texture
,
3032 .adapter_create_rendertarget_view
= adapter_no3d_create_rendertarget_view
,
3033 .adapter_destroy_rendertarget_view
= adapter_no3d_destroy_rendertarget_view
,
3034 .adapter_create_shader_resource_view
= adapter_no3d_create_shader_resource_view
,
3035 .adapter_destroy_shader_resource_view
= adapter_no3d_destroy_shader_resource_view
,
3036 .adapter_create_unordered_access_view
= adapter_no3d_create_unordered_access_view
,
3037 .adapter_destroy_unordered_access_view
= adapter_no3d_destroy_unordered_access_view
,
3038 .adapter_create_sampler
= adapter_no3d_create_sampler
,
3039 .adapter_destroy_sampler
= adapter_no3d_destroy_sampler
,
3040 .adapter_create_query
= adapter_no3d_create_query
,
3041 .adapter_destroy_query
= adapter_no3d_destroy_query
,
3042 .adapter_flush_context
= adapter_no3d_flush_context
,
3043 .adapter_draw_primitive
= adapter_no3d_draw_primitive
,
3044 .adapter_dispatch_compute
= adapter_no3d_dispatch_compute
,
3045 .adapter_clear_uav
= adapter_no3d_clear_uav
,
3048 static void wined3d_adapter_no3d_init_d3d_info(struct wined3d_adapter
*adapter
, unsigned int wined3d_creation_flags
)
3050 struct wined3d_d3d_info
*d3d_info
= &adapter
->d3d_info
;
3052 d3d_info
->wined3d_creation_flags
= wined3d_creation_flags
;
3053 d3d_info
->texture_npot
= TRUE
;
3054 d3d_info
->feature_level
= WINED3D_FEATURE_LEVEL_5
;
3057 static struct wined3d_adapter
*wined3d_adapter_no3d_create(unsigned int ordinal
, unsigned int wined3d_creation_flags
)
3059 struct wined3d_adapter
*adapter
;
3060 LUID primary_luid
, *luid
= NULL
;
3062 static const struct wined3d_gpu_description gpu_description
=
3064 HW_VENDOR_SOFTWARE
, CARD_WINE
, "WineD3D DirectDraw Emulation", DRIVER_WINE
, 128,
3067 TRACE("ordinal %u, wined3d_creation_flags %#x.\n", ordinal
, wined3d_creation_flags
);
3069 if (!(adapter
= heap_alloc_zero(sizeof(*adapter
))))
3072 if (ordinal
== 0 && wined3d_get_primary_adapter_luid(&primary_luid
))
3073 luid
= &primary_luid
;
3075 if (!wined3d_adapter_init(adapter
, ordinal
, luid
, &wined3d_adapter_no3d_ops
))
3081 if (!wined3d_adapter_no3d_init_format_info(adapter
))
3083 wined3d_adapter_cleanup(adapter
);
3088 if (!wined3d_driver_info_init(&adapter
->driver_info
, &gpu_description
, WINED3D_FEATURE_LEVEL_NONE
, 0, 0))
3090 wined3d_adapter_cleanup(adapter
);
3094 adapter
->vram_bytes_used
= 0;
3095 TRACE("Emulating 0x%s bytes of video ram.\n", wine_dbgstr_longlong(adapter
->driver_info
.vram_bytes
));
3097 adapter
->vertex_pipe
= &none_vertex_pipe
;
3098 adapter
->fragment_pipe
= &none_fragment_pipe
;
3099 adapter
->misc_state_template
= misc_state_template_no3d
;
3100 adapter
->shader_backend
= &none_shader_backend
;
3102 wined3d_adapter_no3d_init_d3d_info(adapter
, wined3d_creation_flags
);
3104 TRACE("Created adapter %p.\n", adapter
);
3109 BOOL
wined3d_adapter_init(struct wined3d_adapter
*adapter
, unsigned int ordinal
, const LUID
*luid
,
3110 const struct wined3d_adapter_ops
*adapter_ops
)
3112 DISPLAY_DEVICEW display_device
;
3113 unsigned int output_idx
;
3117 adapter
->ordinal
= ordinal
;
3118 adapter
->output_count
= 0;
3122 adapter
->luid
= *luid
;
3126 WARN("Allocating a random LUID.\n");
3127 if (!AllocateLocallyUniqueId(&adapter
->luid
))
3129 ERR("Failed to allocate a LUID, error %#x.\n", GetLastError());
3133 TRACE("adapter %p LUID %08x:%08x.\n", adapter
, adapter
->luid
.HighPart
, adapter
->luid
.LowPart
);
3135 display_device
.cb
= sizeof(display_device
);
3136 EnumDisplayDevicesW(NULL
, ordinal
, &display_device
, 0);
3137 TRACE("Display device: %s.\n", debugstr_w(display_device
.DeviceName
));
3138 strcpyW(adapter
->device_name
, display_device
.DeviceName
);
3140 if (!(adapter
->outputs
= heap_calloc(1, sizeof(*adapter
->outputs
))))
3142 ERR("Failed to allocate outputs.\n");
3146 if (FAILED(hr
= wined3d_output_init(&adapter
->outputs
[0], 0, adapter
,
3147 display_device
.DeviceName
)))
3149 ERR("Failed to initialise output, hr %#x.\n", hr
);
3152 adapter
->output_count
= 1;
3154 memset(&adapter
->driver_uuid
, 0, sizeof(adapter
->driver_uuid
));
3155 memset(&adapter
->device_uuid
, 0, sizeof(adapter
->device_uuid
));
3157 adapter
->formats
= NULL
;
3158 adapter
->adapter_ops
= adapter_ops
;
3163 for (output_idx
= 0; output_idx
< adapter
->output_count
; ++output_idx
)
3164 wined3d_output_cleanup(&adapter
->outputs
[output_idx
]);
3165 heap_free(adapter
->outputs
);
3170 static struct wined3d_adapter
*wined3d_adapter_create(unsigned int ordinal
, DWORD wined3d_creation_flags
)
3172 if (wined3d_creation_flags
& WINED3D_NO3D
)
3173 return wined3d_adapter_no3d_create(ordinal
, wined3d_creation_flags
);
3175 if (wined3d_settings
.renderer
== WINED3D_RENDERER_VULKAN
)
3176 return wined3d_adapter_vk_create(ordinal
, wined3d_creation_flags
);
3178 return wined3d_adapter_gl_create(ordinal
, wined3d_creation_flags
);
3181 static void STDMETHODCALLTYPE
wined3d_null_wined3d_object_destroyed(void *parent
) {}
3183 const struct wined3d_parent_ops wined3d_null_parent_ops
=
3185 wined3d_null_wined3d_object_destroyed
,
3188 HRESULT
wined3d_init(struct wined3d
*wined3d
, DWORD flags
)
3191 wined3d
->flags
= flags
;
3193 TRACE("Initialising adapters.\n");
3195 if (!(wined3d
->adapters
[0] = wined3d_adapter_create(0, flags
)))
3197 WARN("Failed to create adapter.\n");
3200 wined3d
->adapter_count
= 1;