http://bugs.winehq.org/show_bug.cgi?id=11584
Tiemen Schreuder tietmen@hotmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |tietmen@hotmail.com
--- Comment #32 from Tiemen Schreuder tietmen@hotmail.com 2008-04-10 05:25:35 --- Tested the four cases and the combination of the patch and your suggested change ('check') seems to work alright too. The patch is required to prevent stack overflow tho, the check should increases performance slightly, although not noticeable for me in game.
In the long run, making sure FindContext never leads to (re-)activation seems a more elegant solution (but in effect similar to current patches). Unfortunately I know very little about DirectX, but looking through the code the only reason ActivateContext is called from read_from_framebuffer_texture is seemingly to set the 'usage' to something else, not to actually activate it. How about (yes, this is probably a bit rash) a seperate function for that? So:
ActivateContext(..,usage) -..stuff (find context, preload, read_from_framebuffer).. -SetContextUsage(.,usage) [instead of switch statement]
read_from_framebuffer_texture -..stuff.. -SetContextUsage(.,BLIT) [instead of ActivateContext] -..stuff.
SetContextUsage(.,usage) [new function] <current code from ActivateContext usage switch statement>
I can test if it works if you want, however considering the size of the change (not in time to apply, but in possible undesirable side-effects) I rather wait till you've given it a quick glance in case there are any obvious errors.