http://bugs.winehq.org/show_bug.cgi?id=19002
Summary: Regression in postal 2 with wine 1.1.24 Product: Wine Version: 1.1.24 Platform: PC OS/Version: Linux Status: UNCONFIRMED Severity: normal Priority: P2 Component: directx-d3d AssignedTo: wine-bugs@winehq.org ReportedBy: matej.spindler@auspuh.com CC: stefan@codeweavers.com
Todays commits caused a regression in Postal2 game.
Regression test prints:
b2f09fd20421d0a5e179b42332ca63bc5ac17d8a is first bad commit commit b2f09fd20421d0a5e179b42332ca63bc5ac17d8a Author: Stefan Doesinger stefan@codeweavers.com Date: Wed Jun 17 22:51:34 2009 +0200
wined3d: Emulate clipplanes in ARB if the NV extensions are not available.
This patch tries to find a free texture coordinate to load up to 4 clip coordinates into the pixel shader, and uses KIL to throw away fragments that are cut by a clipplane. If no free texture coordinate is found, clipping is not done. If more than 4 clipplanes are used, only the first 4 are actually enabled. That should be pretty rare though.
:040000 040000 451683035b96e5b0e1bd85b72aeecb1c4746a75b 779b982f8d4d876f0f782b550af91557e6f3ac64 M dlls
My box runs Ubuntu 9.04. I have NVIDIA 6600GT with 180.44 driver
http://bugs.winehq.org/show_bug.cgi?id=19002
--- Comment #1 from Matej Spindler matej.spindler@auspuh.com 2009-06-19 13:00:32 --- Screenshots of the game:
Loading menu: http://www.shrani.si/f/2i/Ny/1Vluu84x/postal2regression1.png
In game: http://www.shrani.si/f/2m/10f/1bZVZzKh/postal2regression2.png
http://bugs.winehq.org/show_bug.cgi?id=19002
--- Comment #2 from Matej Spindler matej.spindler@auspuh.com 2009-06-19 15:37:22 --- Same thing with Lineage 2 Gracia Final Client !
http://www.shrani.si/f/3v/da/4HQ92Q3w/lineagewinebug.png
http://bugs.winehq.org/show_bug.cgi?id=19002
Stefan Dösinger stefandoesinger@gmx.at changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |stefandoesinger@gmx.at
--- Comment #3 from Stefan Dösinger stefandoesinger@gmx.at 2009-06-19 17:20:49 --- Are you using GLSL or ARB shaders?
It seems a bit odd that this causes a regression on nvidia hardware since the patch should not become active on cards that do not support GL_NV_vertex_program2_option.
Are there downloadable demos of this game?
http://bugs.winehq.org/show_bug.cgi?id=19002
--- Comment #4 from Matej Spindler matej.spindler@auspuh.com 2009-06-19 17:58:52 --- There is a download for Postal 2 Demo at: http://www.gamershell.com/download_1851.shtml or http://games.softpedia.com/progDownload/Postal-DEMO-Download-99.html
Demo has the same problem. (Set MouseWarpOverride = force to avoid mouse problems)
GLSL or ARB ?
I guess GLSL since i didn't change anything related do d3d in registry.
According to glxinfo my card does have GL_NV_vertex_program2_option.
http://bugs.winehq.org/show_bug.cgi?id=19002
--- Comment #5 from Stefan Dösinger stefandoesinger@gmx.at 2009-06-20 07:40:17 --- This patch only changes arb_program_shader.c, so it cannot affect GLSL. See if you have a HKEY_CURRENT_USER/Software/Wine/Direct3D/UseGLSL key. If it doesn't exist, or is set to anything other than "disabled", you're using GLSL, and the regression test is most likely wrong. If it is set to "disabled", you're using ARB shaders, and the regression test may be correct.
Note that even if you use ARB and switching to GLSL fixes the problem, the bug still remains valid - ARB should work as well.
http://bugs.winehq.org/show_bug.cgi?id=19002
Vitaliy Margolen vitaliy@kievinfo.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Keywords| |regression Summary|Regression in postal 2 with |Postal 2 - graphics |wine 1.1.24 |problems
--- Comment #6 from Vitaliy Margolen vitaliy@kievinfo.com 2009-06-20 12:28:43 --- What sort of regression are you talking about? Specify _what_ is not working.
http://bugs.winehq.org/show_bug.cgi?id=19002
--- Comment #7 from Matej Spindler matej.spindler@auspuh.com 2009-06-20 13:38:37 ---
(In reply to comment #6)
What sort of regression are you talking about? Specify _what_ is not working.
Well see the screen shots. There are transparent textures all over the place!
So I did some testing.
I tested 1.1.24 deb from WienHQ repo. Same story. So probably nothing wrong with my build tree.
I found another game with problems. Killing floor. Like with Postal and Lineage this game is using unreal engine.
Changing UseGLSL doesn't produce any changes. I tested with new wine prefix (no DirectX key in reg), with UseGLSL="disabled" and with UseGLSL="asdf". Same results at every run.
Is there a way to find out what is wine using (GLSL or ARB) during runtime ? Is there any chance my card is ignoring GLSL and falling back to ARB for whatever reason?
I did a "manual" regression test and firs checked out:
commit 7baf7c65184fd112938475804b7074abe11d234e Author: Stefan Doesinger stefan@codeweavers.com Date: Mon Jun 8 15:35:42 2009 -0700
wined3d: Implement vertex texture fetch in ARB.
Did a "./configure && make" and all three games worked fine. Then I checked out and compiled:
commit b2f09fd20421d0a5e179b42332ca63bc5ac17d8a Author: Stefan Doesinger stefan@codeweavers.com Date: Wed Jun 17 22:51:34 2009 +0200
wined3d: Emulate clipplanes in ARB if the NV extensions are not available.
All three games now have problems. So problems do start with this commit.
http://bugs.winehq.org/show_bug.cgi?id=19002
--- Comment #8 from Henri Verbeet hverbeet@gmail.com 2009-06-20 13:45:55 --- Created an attachment (id=21913) --> (http://bugs.winehq.org/attachment.cgi?id=21913) patch?
No idea if this is at all related, but does this patch make any difference?
http://bugs.winehq.org/show_bug.cgi?id=19002
Henri Verbeet hverbeet@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Attachment #21913|0 |1 is patch| |
http://bugs.winehq.org/show_bug.cgi?id=19002
--- Comment #9 from Matej Spindler matej.spindler@auspuh.com 2009-06-20 14:33:16 --- (In reply to comment #8)
Created an attachment (id=21913)
--> (http://bugs.winehq.org/attachment.cgi?id=21913) [details]
patch?
No idea if this is at all related, but does this patch make any difference?
No difference.
http://bugs.winehq.org/show_bug.cgi?id=19002
--- Comment #10 from Stefan Dösinger stefandoesinger@gmx.at 2009-06-21 04:03:09 --- Can you search for
if(ffp_clip_emul(stateblock) && device->vs_clipping) shader_addline(&buffer, "KIL fragment.texcoord[7];\n");
in gen_arbfp_ffp_shader(), arb_program_shader.c, and replace it with
if(ffp_clip_emul(stateblock) && !device->vs_clipping) shader_addline(&buffer, "KIL fragment.texcoord[7];\n");
Ie, negate device->vs_clipping. It should be in line 5173. (Sorry, no patch atm, my wine tree is quite different)
http://bugs.winehq.org/show_bug.cgi?id=19002
--- Comment #11 from Matej Spindler matej.spindler@auspuh.com 2009-06-21 04:42:29 --- Created an attachment (id=21924) --> (http://bugs.winehq.org/attachment.cgi?id=21924) negate device->vs_clipping
That worked! All three games now render correctly!
http://bugs.winehq.org/show_bug.cgi?id=19002
--- Comment #12 from Stefan Dösinger stefandoesinger@gmx.at 2009-06-21 06:01:08 --- Ok, I'll send a patch.
The added negation is correct by the way. device->vs_clipping is true if the GL vertex shader implementation supports clipping, for example with GLSL, or ARB+NVvp2. In that case the vertex shader doesn't set the clipping texcoord, and random vertices are clipped. I don't know why I forgot to negate this in the first place, or why I didn't notice the problem. I did test GLSL, but maybe I was just "lucky" with my random fragment.texcoord contents.
A similar consideration applies to the fixed function pipeline. The KIL should not be used in this case because (a) clipping works the normal way anyway, and (b) the texcoord is not initialized.
http://bugs.winehq.org/show_bug.cgi?id=19002
Ken Sharp kennybobs@o2.co.uk changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |sebastien.fievet@free.fr
--- Comment #13 from Ken Sharp kennybobs@o2.co.uk 2009-06-22 17:28:33 --- *** Bug 19010 has been marked as a duplicate of this bug. ***
http://bugs.winehq.org/show_bug.cgi?id=19002
Casey Jones jonescaseyb@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |jonescaseyb@gmail.com
--- Comment #14 from Casey Jones jonescaseyb@gmail.com 2009-06-22 17:32:59 --- I can confirm that Stefan's patch works too. Also using an Nvidia card.
http://bugs.winehq.org/show_bug.cgi?id=19002
Matej Spindler matej.spindler@auspuh.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Status|UNCONFIRMED |RESOLVED Resolution| |FIXED
--- Comment #15 from Matej Spindler matej.spindler@auspuh.com 2009-06-23 16:34:14 --- Today commits fixed the problem!
http://bugs.winehq.org/show_bug.cgi?id=19002
Alexandre Julliard julliard@winehq.org changed:
What |Removed |Added ---------------------------------------------------------------------------- Status|RESOLVED |CLOSED
--- Comment #16 from Alexandre Julliard julliard@winehq.org 2009-07-03 12:27:05 --- Closing bugs fixed in 1.1.25.