VRAM size autodetection on OS X

Henri Verbeet hverbeet at gmail.com
Fri Apr 1 14:13:59 CDT 2016

On 1 April 2016 at 20:41, Theodore Dubois <tblodt at icloud.com> wrote:
> I just had a look at the code. In dlls/wined3d/directx.c,
> query_gpu_description uses wglQueryCurrentRendererIntegerWINE to obtain the
> GPU vendor, device, and available VRAM. wglQueryCurrentRendererIntegerWINE
> is part of the WGL_WINE_QUERY_RENDERER extension, which...is not implemented
> in winemac.drv. It's only implemented in winex11.drv. I don't use X11 if I
> can help it. So, with absolutely no information about what the graphics card
> is, Wine defaults to an Nvidia Riva 128 with WINE_DEFAULT_VIDMEM (64MB) of
> VRAM. This is not close.
> I would like to write a patch to fix this problem. I'm thinking of adding an
> implementation of WGL_WINE_QUERY_RENDERER to winemac.drv. There are 12
> different things that can be queried about the renderer, but only
> WGL_RENDERER_VIDEO_MEMORY_WINE are used to my knowledge, so I’d only
> implement those.
> Does this sound correct?
Mostly. CARD_NVIDIA_RIVA_128 has 4 MiB of memory, but you're really
unlikely to end up with that one. With an unrecognised card you'll get
one of the "fallback" cards based on the feature level of the OpenGL
implementation. On MacOS without OpenGL core contexts that's typically
WINED3D_D3D_LEVEL_9_SM3, which would get you one of
The first two have 128 MiB, the Intel one has 64 MiB. Typical Linux
OpenGL implementations will get you either WINED3D_D3D_LEVEL_10 or
WINED3D_D3D_LEVEL_11, which would get you somewhere between 512 and
1280 MiB.

I think Ken is working on supporting WINE_query_renderer in
winemac.drv, but I don't know when that will be done. We're also like
to start using the wglCreateContextAttribsARB() support for selecting
a renderer at some point in the future if it becomes more common for
implementations to expose multiple renderers.

Regardless of WINE_query_renderer support, it's still a good idea to
add support for your card to the detection code.

More information about the wine-devel mailing list