http://bugs.winehq.org/show_bug.cgi?id=11584
--- Comment #27 from Tiemen Schreuder tietmen@hotmail.com 2008-04-09 16:53:48 --- Created an attachment (id=12024) --> (http://bugs.winehq.org/attachment.cgi?id=12024) Possible wined3d CoD4 stack overflow ActivateContext fix
First of all, I'm new to this, so bare with me!
Confirming this bug in Call of Duty 4 [1.0] after level loaded (stack overflow, last calls to PreLoad, read_from_framebuffer_texture, etc).
The attached patch fixes the problem for me, and makes sure the lastActiveRenderTarget and lastThread is set before calling a function (FindContext) that might start indirect recursion. Patch fixes that in ActivateContext, which fixed it for me, but perhaps this happens in other places as well. Reading through the posts this seems similar to what Stefan suggested and a more permanent fix would probably indeed be to prevent this recursion from happening at all.