Sometimes, when I'm playing games on Wine, the game crashes, and then I look in the log and see "Out of adapter memory". Then I run `winetricks videomemorysize=1024`, and it runs fine. My graphics card has 1536 MB of total VRAM. It seems to me that Wine isn't correctly autodetecting the amount of VRAM I have.
(DISCLAIMER: The following analysis is not based on any log output. It's based on my reading of the code, which may well be incorrect. If so, please correct me.)
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_VENDOR_ID_WINE, WGL_RENDERER_DEVICE_ID_WINE, and WGL_RENDERER_VIDEO_MEMORY_WINE are used to my knowledge, so I’d only implement those.
Does this sound correct?
~Theodore
On 1 April 2016 at 20:41, Theodore Dubois tblodt@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_VENDOR_ID_WINE, WGL_RENDERER_DEVICE_ID_WINE, and 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 CARD_NVIDIA_GEFORCE_6800, CARD_AMD_RADEON_X1600 or CARD_INTEL_945G. 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.
On Apr 1, 2016, at 2:13 PM, Henri Verbeet hverbeet@gmail.com wrote:
On 1 April 2016 at 20:41, Theodore Dubois tblodt@icloud.com wrote:
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_VENDOR_ID_WINE, WGL_RENDERER_DEVICE_ID_WINE, and WGL_RENDERER_VIDEO_MEMORY_WINE are used to my knowledge, so I’d only implement those.
I would have been happy if Henri had defined the WGL_WINE_query_renderer extension to be only the subset of GLX_MESA_query_renderer that wined3d actually needed, but given that he didn't, I think an implementation should strive to be complete.
I think Ken is working on supporting WINE_query_renderer in winemac.drv, but I don't know when that will be done.
Yes, I'm a good way through the implementation. wglQueryRenderer{Integer,String}WINE() are implemented, although not yet tested. wglQueryCurrentRenderer{Integer,String}WINE() should be relatively straightforward from there.
I don't yet have an ETA as I switch off to do other things, too.
-Ken