http://bugs.winehq.org/show_bug.cgi?id=9775
--- Comment #40 from Matteo Modesti mattemod@gmail.com 2008-07-07 22:22:56 --- Okay, I found a few very interesting things.
First of all, all my tests were done with OffscreenRenderingMode="pbuffers" (with the final 's'... I've never understood if it exists or if it use the default, but anyway it worked) because Morrowind crashed in outside areas for me with "fbo". About half an hour ago I tried to use "fbo" with your patch and... *tada!* It worked! So your patch also fix that bug :) I did some more testing then and found out the following things.
Since I own Morrowind I can take a look at these. Did the FIXMEs appear before applying the patch?
No, but instead of them there was fixme:d3d_surface:fb_copy_to_texture_direct >>>>>>>>>>>>>>>>> GL_INVALID_OPERATION (0x502) from glCopyTexSubImage2D @ surface.c / 2745
In line 509, add checkGLcall("glEnable"); after the glEnable call.
The GL_INVALID_ENUM state is probably not coming from GenTextures at all.
___With "pbuffers"___
As I said, maps work correctly but the character in inventory in upside-down and there's a red line above it.
After adding the checkGLcall() call, the first FIXME changed:
fixme:d3d_surface:IWineD3DSurfaceImpl_PreLoad >>>>>>>>>>>>>>>>> GL_INVALID_ENUM (0x500) from glEnable @ surface.c / 510 fixme:d3d_surface:IWineD3DSurfaceImpl_PreLoad >>>>>>>>>>>>>>>>> GL_INVALID_ENUM (0x500) from glBindTexture @ surface.c / 518 fixme:d3d_surface:surface_allocate_surface >>>>>>>>>>>>>>>>> GL_INVALID_ENUM (0x500) from glTexImage2D @ surface.c / 340 fixme:d3d_surface:read_from_framebuffer_texture >>>>>>>>>>>>>>>>> GL_INVALID_ENUM (0x500) from glCopyTexSubImage2D @ surface.c / 937
I noted that the FIXMEs aren't printed out when loading for the first time (in main menu) but only when you load from a different location or when you load games saved in outside areas.
___With "fbo"___
The FIXMEs aren't printed out at all. The character in inventory is not upside-down and the red line's not there anymore... it works correctly :)
BUT the local map doesn't work at all for me: it's all dark, apart some very little parts which fade from clear to dark. I'm referring to the one that appears right-clicking the mouse, not the one in the bottom-right corner of the screen. If I'm not wrong, there's only one "faded part" for each area (you can better see it going outside and scrolling the local map).
I think I'll continue using "pbuffers", because the map's more important than the character in the inventory and because I'd like to help you fix "pbuffers" problems :) ...uh, and because it seems "fbo" is a bit slower :P