http://bugs.winehq.org/show_bug.cgi?id=28078
Summary: 1914 Shells of Fury: text rendering issue Product: Wine Version: 1.3.26 Platform: x86 OS/Version: Linux Status: UNCONFIRMED Severity: minor Priority: P2 Component: directx-d3d AssignedTo: wine-bugs@winehq.org ReportedBy: gyebro69@gmail.com CC: stefandoesinger@gmx.at Regression SHA1: 4f594777a28c935d2eac23169012144fba974e40
Created an attachment (id=35949) --> (http://bugs.winehq.org/attachment.cgi?id=35949) terminal output
Certain messages in the game don't appear correctly. The upcoming screenshots will clearly show the problem. Those messageboxes should be transparent, however, in current Wine, the text is displayed in front of a solid background.
This used to work in Wine-1.1.35 and the result of a regression test pointed to:
4f594777a28c935d2eac23169012144fba974e40 is the first bad commit commit 4f594777a28c935d2eac23169012144fba974e40 Author: Stefan Dösinger stefan@codeweavers.com Date: Thu Dec 24 16:35:07 2009 +0100
wined3d: Drop the VBO if too many full buffer conversions occur.
:040000 040000 1e34e941631f6bb32ee682d3199db6f02a07e415 4bbefab9106f0a6ec616a67e301f9c00f70a0df5 M dlls
git checkout 4f594777a28c935d2eac23169012144fba974e40 >> text not displayed correctly git reset --hard HEAD^ >> text is OK
No demo available. Native components in use: d3dx9_36
Fedora 15 x86 Nvidia GeForce 250 / driver 280.13
http://bugs.winehq.org/show_bug.cgi?id=28078
--- Comment #1 from GyB gyebro69@gmail.com 2011-08-14 07:19:14 CDT --- Created an attachment (id=35950) --> (http://bugs.winehq.org/attachment.cgi?id=35950) screenshot (comparison)
http://bugs.winehq.org/show_bug.cgi?id=28078
--- Comment #2 from GyB gyebro69@gmail.com 2011-08-14 07:22:54 CDT --- Created an attachment (id=35951) --> (http://bugs.winehq.org/attachment.cgi?id=35951) screenshot #2
Another occurrence of the problem: when using the deck gun in the game, the target list on the target sheet is unreadable (text is replaced by solid black color). This makes targeting impossible because one cannot read the distance of the target or the elevation of the gun.
http://bugs.winehq.org/show_bug.cgi?id=28078
GyB gyebro69@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Keywords| |regression
http://bugs.winehq.org/show_bug.cgi?id=28078
--- Comment #3 from Stefan Dösinger stefandoesinger@gmx.at 2011-08-15 13:32:06 CDT --- Is there a demo I can download?
http://bugs.winehq.org/show_bug.cgi?id=28078
--- Comment #4 from GyB gyebro69@gmail.com 2011-08-15 13:41:05 CDT --- (In reply to comment #3)
Is there a demo I can download?
Unfortunately, no demo exists. Can I provide any logs for you?
http://bugs.winehq.org/show_bug.cgi?id=28078
--- Comment #5 from Stefan Dösinger stefandoesinger@gmx.at 2011-08-16 08:56:59 CDT --- Created an attachment (id=35988) --> (http://bugs.winehq.org/attachment.cgi?id=35988) disable the change made by 4f594777a28c935d2eac23169012144fba974e40
I can't think of any specific cause right now, so reading through logs would be like searching for a needle in a haystack, especially without knowing which draw(s) fail. But you can try to essentially revert the patch with the attached diff and see if the issue goes away.
http://bugs.winehq.org/show_bug.cgi?id=28078
--- Comment #6 from GyB gyebro69@gmail.com 2011-08-16 11:26:10 CDT --- (In reply to comment #5)
Created an attachment (id=35988)
--> (http://bugs.winehq.org/attachment.cgi?id=35988) [details]
disable the change made by 4f594777a28c935d2eac23169012144fba974e40
I can't think of any specific cause right now, so reading through logs would be like searching for a needle in a haystack, especially without knowing which draw(s) fail. But you can try to essentially revert the patch with the attached diff and see if the issue goes away.
The patch restored the original condition and text appears as it should in the game. If you need further investigation on this bug I can gift you a copy of the game, available on Gamersgate digital distribution service. A few words about Gamersgate: registration is free and their download client works out-of-the-box in Wine. The game itself is DRM free and can be installed and tested without much of a hassle under Wine (requires only native d3dx9_36.dll) . Please send me a pm if you're interested.
Anyway, thanks for your help so far.
http://bugs.winehq.org/show_bug.cgi?id=28078
--- Comment #7 from Stefan Dösinger stefandoesinger@gmx.at 2011-08-16 15:42:01 CDT --- There are two more things I can think of to test. For both of them revert my patch again.
1) Edit directx.c and in EXTENSION_MAP at the top of the file comment out the lines listing the GL_ARB_vertex_buffer_object and GL_ARB_pixel_buffer_object extensions. Then test the game again and see if it works properly. If you're not sure what I mean I'll create a patch
2) If the game still works properly after (1), revert the change again and create a +d3d log. As soon as the problem shows up kill the game(e.g. wineserver -k) to keep the size of the logfiles to a minimum. Don't exit the game, just kill it - shutdown entries are sometimes confusing.
http://bugs.winehq.org/show_bug.cgi?id=28078
--- Comment #8 from GyB gyebro69@gmail.com 2011-08-16 22:08:38 CDT --- Created an attachment (id=35999) --> (http://bugs.winehq.org/attachment.cgi?id=35999) screenshot after modifications
I could fulfill the first part of my 'homework' so far: after the modifications in (1) the problem is more striking: text with black outlines appears in the menu, too. In the main game certain messages appear with that black outlines, other messages are unreadable (replaced by black color). Don't know what to do with (2): if I understood correctly you need a log with only the reverted patch applied (but without modifications in directx.c)? The problem is not reproducible that way as I stated in comment #6.
http://bugs.winehq.org/show_bug.cgi?id=28078
--- Comment #9 from Stefan Dösinger stefandoesinger@gmx.at 2011-08-17 02:25:23 CDT --- No need to bother about (2), I have my suspicion now. I guess that the game draws transformed geometry(x/y/z/rhw position), where the rhw doesn't influence the vertex's position, but affects texturing. Without converted vertex buffers we ignore the rhw(reciprocal w) because opengl expects x/rhw, y/rhw, z/rhw, 1/rhw. This is could be considered a performance hack.
If my suspicion is correct the proper fix is a vertex pipeline replacement shader.
http://bugs.winehq.org/show_bug.cgi?id=28078
--- Comment #10 from Henri Verbeet hverbeet@gmail.com 2011-08-17 07:23:23 CDT --- (In reply to comment #9)
No need to bother about (2), I have my suspicion now. I guess that the game draws transformed geometry(x/y/z/rhw position), where the rhw doesn't influence the vertex's position, but affects texturing. Without converted vertex buffers we ignore the rhw(reciprocal w) because opengl expects x/rhw, y/rhw, z/rhw, 1/rhw. This is could be considered a performance hack.
Using VBOs or not shouldn't make a difference. Without VBOs you're supposed to go to the immediate mode path and do the same fixup there.
http://bugs.winehq.org/show_bug.cgi?id=28078
--- Comment #11 from Stefan Dösinger stefandoesinger@gmx.at 2011-08-17 09:55:32 CDT --- (In reply to comment #10)
Using VBOs or not shouldn't make a difference. Without VBOs you're supposed to go to the immediate mode path and do the same fixup there.
Note the hardcoded "3" in the glVertexPointer command in load_vertex_data, state.c in the case where we're not using a VBO. This is an ancient hack. The short-term fix would be to fall back to drawStridedSlow, for which I'll write a patch later today to see if my suspicion is correct.
http://bugs.winehq.org/show_bug.cgi?id=28078
--- Comment #12 from Henri Verbeet hverbeet@gmail.com 2011-08-17 10:01:53 CDT --- (In reply to comment #11)
(In reply to comment #10)
Using VBOs or not shouldn't make a difference. Without VBOs you're supposed to go to the immediate mode path and do the same fixup there.
Note the hardcoded "3" in the glVertexPointer command in load_vertex_data, state.c in the case where we're not using a VBO. This is an ancient hack. The short-term fix would be to fall back to drawStridedSlow, for which I'll write a patch later today to see if my suspicion is correct.
We should already be using that for transformed vertices.
http://bugs.winehq.org/show_bug.cgi?id=28078
--- Comment #13 from Stefan Dösinger stefandoesinger@gmx.at 2011-08-18 04:23:17 CDT --- Indeed, I guess you changed that a while ago. Well, that means I'm kinda out of ideas. I doubt that mixing data from a converted and unconverted buffer is the problem here because the bug still occurs without any VBOs at all.
GyB, can you attach a +d3d,+d3d_draw log with plain Wine, without any of the patches from this bug report?
http://bugs.winehq.org/show_bug.cgi?id=28078
--- Comment #14 from GyB gyebro69@gmail.com 2011-08-18 09:29:16 CDT --- Created an attachment (id=36036) --> (http://bugs.winehq.org/attachment.cgi?id=36036) 7zipped +d3d,+d3d_draw debug log (uncompressed 164 MB)
Here's how the log file was created: I started the game and skipped the intro video immediately. The game seems to load a fair amount of data whilst the main menu appears. I chose one of the tutorial missions from the menu (another loading stage is coming). When the actual game is fully loaded I clicked on the icon on the user interface 3 times (which brings up the status message appearing without transparency). Then I killed the game immediately.
One more thing I'd like to note: when running the game with WINEDEBUG=+d3d,+d3d_draw, framerate dropped dramatically and I noticed that the status message in question did show up correctly (with transparency) for a mere second. Afterwards it changed to opaque and it stayed that way for the rest of the game (as you can see on the screenshot in comment #1).
http://bugs.winehq.org/show_bug.cgi?id=28078
--- Comment #15 from Stefan Dösinger stefandoesinger@gmx.at 2011-08-18 12:22:45 CDT --- Thanks for the log. I'm looking at it!
(In reply to comment #14)
One more thing I'd like to note: when running the game with WINEDEBUG=+d3d,+d3d_draw, framerate dropped dramatically
That is expected.
and I noticed that the status message in question did show up correctly (with transparency) for a mere second.
Yes, because wined3d keeps the vertex buffer for a few draws(until it has been converted 5 times).
http://bugs.winehq.org/show_bug.cgi?id=28078
--- Comment #16 from Stefan Dösinger stefandoesinger@gmx.at 2011-08-18 12:55:59 CDT --- I think I see the problem. The app is using D3DTOP_SELECTARG1 as color and alpha op, and D3DTA_SPECULAR as color and alpha arg 1. This means it is feeding the specular alpha directly as input into the alpha blending operation.
The problem is that there is no such thing as specular alpha, at least not in opengl. D3D usually puts manual fog coordinates there, but the fragment processing can read the values there as well. So what the app does is murky, but legal.
GL_EXT_secondary_color explicitly doesn't provide a glSecondaryColor4 function to provide the secondary color in immediate mode. It also disallows secondary color pointers with 4 components when using vertex arrays, but most GL implementations accept them, and actually do what we want with them. So when a vertex buffer is used this game works by luck.
So it's a different issue than I originally thought, but the prescription is the same: With a vertex pipeline replacement shader we could use numbered attributes to pass the specular color and make this behavior work reliably.
http://bugs.winehq.org/show_bug.cgi?id=28078
--- Comment #17 from GyB gyebro69@gmail.com 2012-05-02 13:06:45 CDT --- Still an issue as of wine-1.5.3-73-g93a0ca7.
http://bugs.winehq.org/show_bug.cgi?id=28078
--- Comment #18 from Henri Verbeet hverbeet@gmail.com 2013-06-13 05:57:28 CDT --- Created attachment 44784 --> http://bugs.winehq.org/attachment.cgi?id=44784 patch
Does the attached patch make it any better? Strictly speaking this isn't quite a complete fix for the issue Stefan described, but it might be enough.
http://bugs.winehq.org/show_bug.cgi?id=28078
--- Comment #19 from GyB gyebro69@gmail.com 2013-06-13 11:58:16 CDT --- (In reply to comment #18)
Created attachment 44784 [details] patch
Does the attached patch make it any better? Strictly speaking this isn't quite a complete fix for the issue Stefan described, but it might be enough.
I retested this bug in wine-1.6-rc1-47-gf8c7cd9 and found that the 2 problems reported here are somewhat different ones. The first one (in comment #1) has been already fixed (somewhere between 1.5.30 and 1.6-rc1) so the ship status messages are transparent as they should be. The other problem (in comment #2) still remains in current Wine, and your patch indeed fixes that one. Tested with Nvidia binary drivers 319.23.
http://bugs.winehq.org/show_bug.cgi?id=28078
Henri Verbeet hverbeet@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Fixed by SHA1| |ffc9f535eb7817ea4cd0d065747 | |1e61a9813debd Status|UNCONFIRMED |RESOLVED Resolution| |FIXED
--- Comment #20 from Henri Verbeet hverbeet@gmail.com 2013-06-15 01:45:16 CDT --- Should be fixed by commit ffc9f535eb7817ea4cd0d0657471e61a9813debd.
http://bugs.winehq.org/show_bug.cgi?id=28078
Alexandre Julliard julliard@winehq.org changed:
What |Removed |Added ---------------------------------------------------------------------------- Status|RESOLVED |CLOSED
--- Comment #21 from Alexandre Julliard julliard@winehq.org 2013-06-21 13:33:00 CDT --- Closing bugs fixed in 1.6-rc3.