http://bugs.winehq.org/show_bug.cgi?id=16456
--- Comment #32 from Jeffrey Bonggren 7wtjvu302@sneakemail.com 2009-02-01 15:43:59 --- The git version from the evening of Jan 31 still has the problem. FYI
I added some code to keep a running total of the number of IWineD3DSurfaceImpls in existence. I incremented in IWineD3DDeviceImpl_CreateSurface and decremented in IWineD3DSurfaceImpl_Release(ref==0).
The number of surfaces steadily grows as the game runs, but it does stabilize.
Here is an example of the running total I got when I loaded a game that was saved after I won, so I have lots of ships around.
691 opening cinematics 1038 main menu 1076 game setup another 500+ during loading once game starts, climbs steadily to 5288 zooming around a 200-ship fleet gets me up to 5458
The number of surfaces goes up when I zoom in on a new planet area with different ships, etc. It does up and down in groups of 12 after that. Bringing up the various menus during the game increases the surface count.
Interestingly, it doesn't go down much when I end a game and go back to the main menu screens. When I start a new game, the surface count doesnt go up much more, so it is probably reusing the surfaces that weren't freed when I ended the game.
I tried to completely exit the game to see if those surfaces are freed, but it always crashes when I exit, so no luck there.
The number of surfaces doesn't seem related to when I get the GL_OUT_OF_MEMORY error. On one test, I got the surface count up past 6200 before running out of memory.
Depending on the type of graphics card, the graphics memory may be a shared pool or partitioned into specific areas like vertex buffers, frame buffers, and texture memory. This may have an effect on how this bug manifests itself. For what it's worth, I am using a NVIDIA GeForce 9800GTX+ with 1G of video RAM. I am using the 177.82 driver.