about video memory detection in wine

Stefan Dösinger stefandoesinger at gmx.at
Thu Aug 13 11:59:01 CDT 2009

Am Wednesday 12 August 2009 10:04:10 schrieb Sun, Sunny:

> I think you can first detect GL_ATI_meminfo in
> glGetString(GL_EXTENSIONS); if GL_ATI_meminfo exists, then you can use
> glGetIntegerv(GL_VBO_FREE_MEMORY_ATI, param) to get the current free
> video memory, you can see more info at:
A minor problem with GL_ATI_meminfo is that it doesn't report the total amount 
of video memory available. D3D8 and D3D9 only report the free amount as well, 
but DirectDraw can return the total amount. There are some games that first 
query the total amount using ddraw, then continue with d3d8 or 9. Depending 
on what other apps are doing, reporting the currently free amount as total 
might result in the app thinking that free vidmem > total vidmem, running 
into all sorts of troubles. (For example, another app frees a lot of textures 
between the ddraw vidmem query and the d3d9 vidmem query)

The other issue is that if some other apps use lots of video memory(like 
Compiz, etc), then we can still run into the same out of memory issue if 
other apps consume too much video memory.

We should probably also fall back to a saner default on newer d3d10 class 
cards - a radeon 9500 isn't really representative for them any more.

More information about the wine-devel mailing list