https://bugs.winehq.org/show_bug.cgi?id=33362
--- Comment #25 from Nicholas O'Connor nrfoconnor+wine@gmail.com --- Sorry for late response, I never received an email about this bug for some reason.
(In reply to Matteo Bruni from comment #24)
Notice that GL_OUT_OF_MEMORY means that libGL isn't able to allocate system memory, usually because the process filled up its addressing space. That has nothing to do with video memory accounting.
Why would libGL use system RAM for graphics processing? That makes no sense. In addition, that statement contradicts how the bug behaves on my system, where it has plenty of system RAM to work with (I have 4GB total, DAO only takes up maybe 1.5GB at maximum, my background processes take up ~600MB), but still hits GL_OUT_OF_MEMORY. The only logical explanation is its related to video memory.
It's very much possible that games are actually using the GetAvailableTextureMem function to decide whether or not they should unload something from their memory before loading something else in.
Unless there is an actual memory leak there is not much we can do. Lowering graphic / texture settings might help (as you noticed), manually lowering the amount of video memory reported to the game (e.g. via the VideoMemorySize registry setting) is another possible option.
I tried lowering VideoMemorySize with another game and got numerous GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT errors (and a nice little dialog box that said "Out of memory!" that I couldn't dismiss until I alt-tabbed to the terminal window and hit Ctrl-C, though I'm not certain whether Wine or my game generated that).
Unless everyone else can use that method just fine and it's only me, I do not feel comfortable with that being a recommended solution.