http://bugs.winehq.org/show_bug.cgi?id=25324
Steven vornne@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |vornne@gmail.com
--- Comment #9 from Steven vornne@gmail.com 2010-12-16 04:41:29 CST --- I've been playing Mount&Blade Warband with wine for over a year now; at first I could use the latest version of wine without many problems, but beginning with the 1.1.42 release the game wouldn't run, with various errors, so I've kept using 1.1.41. I finally got around to doing more testing the other day - after patching a few other issues with version 1.3.9, this bug showed up: the game starts as a black window, with only the game cursor visible, and these lines are repeatedly output to the console:
err:d3d:swapchain_blit >>>>>>>>>>>>>>>>> GL_INVALID_OPERATION (0x502) from Swapchain present blit(EXT_framebuffer_blit) @ ../../../dlls/wined3d/swapchain.c / 134
I then verified again (using git) that this problem existed in version 1.1.42 but not in 1.1.41, and then ran a bisect between those versions, which resulted in this commit:
dc918d43946462ad4c04ed373cda72d1ebe9b6d3 is the first bad commit commit dc918d43946462ad4c04ed373cda72d1ebe9b6d3 Author: Stefan Dösinger stefan@codeweavers.com Date: Sun Mar 28 16:42:32 2010 +0200
wined3d: Use FBOs when the onscreen depth stencil format isn't suitable.
This allows proper support of float depth buffers when rendering to onscreen surfaces.
:040000 040000 44d70c59cce2f82aa3f2d8b6e19679588f81e1b8 15635de2c11dfbeb36cc3542bbaa6bc3f840468f M dlls
I then reverified that the game worked at the commit before, and then tested with various display resolutions and depths, windowed and fullscreen, selecting the game's DirectX7 and DirectX9 modes; all still failed. I'm running 64 bit gentoo linux with a 7900GS and the binary nvidia-drivers-260.19.21; I can successfully run warband and quite a few other windows games with this system, at least when using version 1.1.41.
After looking at the commit and finding that the swapchain.c file mentioned in the error is barely modified, it seemed that the main change in the patch was to add context_validate_onscreen_formats to dlls/wined3d/context.c and call it: after checking out 1.3.9 again and commenting out all the calls of that function, the game worked. I narrowed it down a bit more to the two lines in that function "swapchain->render_to_fbo = TRUE; context_set_render_offscreen(context, device->StateTable, TRUE);" both of which need to be commented out for the game to work; since these seem to be the main point of the function, I guess just removing all calls to context_validate_onscreen_formats might be a temporary workaround. Only the calls from _draw_state and _clear_state needed to be disabled for warband to work, not the _blit_state one.
Patch to wine-1.3.9 attached in case anybody wants a quick (probably incorrect) fix.