WineD3D: gpu detection

Roderick Colenbrander thunderbird2k at
Fri Aug 18 17:09:31 CDT 2006


In case of Direct3D each device exports the pci device/vendor ids of the videocard. Lots of programs use these ids to get an idea about the capabilities of the card, enable/disable features based on the detected card or sometimes they are used for evil purposes aswell (working around bugs).

In case of OpenGL there's no way to retrieve the pci id. The most basic thing you can do is parse the opengl renderer string which contains the name and model of the videocard and translate this into a pci id. Only in case of Nvidia cards there are dozens of different videocards. Using smart tricks the list can be compressed. The main issue of this way is that it requires a lot of maintenance. If a card is too new, we would fall back to a very basic pci id or no id.

Another way would to 'ask' the operating system what card is in use. In case of linux /proc/bus/pci/devices could be parsed but this way is not very portable, it isn't 100% reliable as you might be using remote X or you might have multiple videocards installed. This way is not a good option.

This patch tackles the problem in a different way. The idea is not to return the exact videocard but a close match (a card supporting more or less the same opengl features or with similar performance). Based on test using the closed source drivers from nvidia and ati and also using the opensource radeon dri drivers, I made a list of what extensions are available on the cards. Further I checked which of the extensions indicate correspond to certain directx versions.

Based on this information I made some directx capability checks based on the opengl extensions supported by the card. This is the first detection that is done. After this the detection is more refined. For instance in case of Direct3d9 all decent cards from the last 3 years support it. To select a card from the 'correct' generation or with similar performance I parse a number of renderer strings and select a close match.

Compared to the first method which I described which solely relied on the parsing of renderer strings this method is better because it takes into account the opengl capabilities of the videocard. So when a new card is out which isn't in our list, we won't fallback to a very basic card but can still return a 'close match' because of the opengl extension checks.

Roderick Colenbrander

Der GMX SmartSurfer hilft bis zu 70% Ihrer Onlinekosten zu sparen!
Ideal für Modem und ISDN:
-------------- next part --------------
A non-text attachment was scrubbed...
Name: wined3d_gpu_detection.patch
Type: text/x-diff
Size: 16704 bytes
Desc: not available
Url :

More information about the wine-patches mailing list