[Bug 34266] New: Division by zero in shader results in NaNs
http://bugs.winehq.org/show_bug.cgi?id=34266 Bug #: 34266 Summary: Division by zero in shader results in NaNs Product: Wine Version: 1.7.0 Platform: x86 OS/Version: Linux Status: UNCONFIRMED Severity: normal Priority: P2 Component: directx-d3d AssignedTo: wine-bugs(a)winehq.org ReportedBy: achurch+wine(a)achurch.org Classification: Unclassified Created attachment 45619 --> http://bugs.winehq.org/attachment.cgi?id=45619 Proof-of-concept patch As reported in the AppDB, if the HDR rendering option is enabled in Final Fantasy XIV, some scenes have large black squares covering the screen. This appears to stem from NaNs getting stored in floating-point framebuffers as the result of division by zero in a fragment shader. Granted there's a whole bunch of wild guessing involved, but changing the translation of the HLSL rcp instruction to explicitly check for zero and return a huge value instead of performing the division seems to fix the problem without causing any side effects (see attached patch). I do note that HLSL defines the rcp instruction to return infinity for a zero operand (*1), while the GLSL spec says that division by zero "result[s] in an unspecified value" (*2). (*1) http://msdn.microsoft.com/en-us/library/windows/desktop/hh447205%28v=vs.85%2... (*2) http://www.opengl.org/registry/doc/GLSLangSpec.Full.1.20.8.pdf (section 5.9 "Expressions") -- bizarrely, the GLSL 4.4 spec keeps that language but adds section 4.7.1 "Range and Precision" which says that "dividing a non-zero by 0 results in the appropriately signed IEEE Inf", so the spec is internally inconsistent and who knows what you'll get. -- Configure bugmail: http://bugs.winehq.org/userprefs.cgi?tab=email Do not reply to this email, post in Bugzilla using the above URL to reply. ------- You are receiving this mail because: ------- You are watching all bug changes.
http://bugs.winehq.org/show_bug.cgi?id=34266 --- Comment #1 from Andrew Church <achurch+wine(a)achurch.org> 2013-08-15 05:50:55 CDT --- Created attachment 45620 --> http://bugs.winehq.org/attachment.cgi?id=45620 Generated GLSL source of bad shader For reference, this shader was responsible for most of the black squares visible in the current FFXIV:ARR benchmark. The problematic instruction is line 66: R0.z = (1.0 / R2.w) where R2 is an RGBA value read from a texture. -- Configure bugmail: http://bugs.winehq.org/userprefs.cgi?tab=email Do not reply to this email, post in Bugzilla using the above URL to reply. ------- You are receiving this mail because: ------- You are watching all bug changes.
http://bugs.winehq.org/show_bug.cgi?id=34266 --- Comment #2 from Andrew Church <achurch+wine(a)achurch.org> 2013-08-15 08:23:42 CDT --- I suppose it's also possible that a native D3D renderer either rasterizes the triangles or samples the texture (which is DXT1 with some transparent areas) in such a way that the shader never reads any texture samples with alpha equal to zero. (That seems to me to be a risky design strategy since it fails horribly if your vertex coordinates are even slightly off, but I've seen stranger design choices before...) -- Configure bugmail: http://bugs.winehq.org/userprefs.cgi?tab=email Do not reply to this email, post in Bugzilla using the above URL to reply. ------- You are receiving this mail because: ------- You are watching all bug changes.
http://bugs.winehq.org/show_bug.cgi?id=34266 --- Comment #3 from Henri Verbeet <hverbeet(a)gmail.com> 2013-08-15 08:28:58 CDT --- (In reply to comment #0)
I do note that HLSL defines the rcp instruction to return infinity for a zero operand (*1), while the GLSL spec says that division by zero "result[s] in an unspecified value" (*2).
...
(*2) http://www.opengl.org/registry/doc/GLSLangSpec.Full.1.20.8.pdf (section 5.9 "Expressions") -- bizarrely, the GLSL 4.4 spec keeps that language but adds section 4.7.1 "Range and Precision" which says that "dividing a non-zero by 0 results in the appropriately signed IEEE Inf", so the spec is internally inconsistent and who knows what you'll get. Sort of. It's undefined in GLSL 1.20, but later versions are supposed to follow IEEE floating point rules.
(In reply to comment #1)
visible in the current FFXIV:ARR benchmark. The problematic instruction is line 66: R0.z = (1.0 / R2.w) where R2 is an RGBA value read from a texture. The issue is actually likely to be in line 68. The problem isn't that division by 0 generates NaNs, it doesn't. Instead, division by zero generates infinities as expected, and when such an infinity is then multiplied by 0 you'll get a NaN. That's what's supposed to happen according to IEEE floating point rules, but d3d9 has a rule that 0 * anything == 0.
You don't mention what GPU you're using, but if you look at the AMD R600 ISA docs for example you'll notice the GPU has e.g. both "MUL" and "MUL_IEEE" instructions for this reason. I think the right way to fix this issue is to create a GL extension that allows us to specify D3D or IEEE rules. -- Configure bugmail: http://bugs.winehq.org/userprefs.cgi?tab=email Do not reply to this email, post in Bugzilla using the above URL to reply. ------- You are receiving this mail because: ------- You are watching all bug changes.
http://bugs.winehq.org/show_bug.cgi?id=34266 --- Comment #4 from Andrew Church <achurch+wine(a)achurch.org> 2013-08-17 03:58:19 CDT --- Thanks for the insight. (For reference, I'm using an NVIDIA GTX450; I'm not familiar with the ISA, but I assume it has a similar zeroing MUL instruction for use with D3D9.) It looks like D3D10 and later follow the IEEE rules as well, so I'm not sure how much support we could get for an OpenGL extension just to support legacy shaders. I wonder if we could work around the problem with the mix() function from GLSL 1.30? Something like: dest = mix(vecN(0), a * b, equal(a, vecN(0)) || equal(b, vecN(0))) -- Configure bugmail: http://bugs.winehq.org/userprefs.cgi?tab=email Do not reply to this email, post in Bugzilla using the above URL to reply. ------- You are receiving this mail because: ------- You are watching all bug changes.
http://bugs.winehq.org/show_bug.cgi?id=34266 --- Comment #5 from Andrew Church <achurch+wine(a)achurch.org> 2013-08-17 05:32:40 CDT --- PSA: Don't actually try that on an NVIDIA card, it'll hang the driver... -- Configure bugmail: http://bugs.winehq.org/userprefs.cgi?tab=email Do not reply to this email, post in Bugzilla using the above URL to reply. ------- You are receiving this mail because: ------- You are watching all bug changes.
http://bugs.winehq.org/show_bug.cgi?id=34266 --- Comment #6 from Henri Verbeet <hverbeet(a)gmail.com> 2013-08-17 05:56:42 CDT --- (In reply to comment #4)
Thanks for the insight. (For reference, I'm using an NVIDIA GTX450; I'm not familiar with the ISA, but I assume it has a similar zeroing MUL instruction for use with D3D9.)
Afaik at least older hardware has a context global switch for this, newer hardware may have separate instructions.
It looks like D3D10 and later follow the IEEE rules as well, so I'm not sure how much support we could get for an OpenGL extension just to support legacy shaders. I wonder if we could work around the problem with the mix() function from GLSL 1.30? Something like:
dest = mix(vecN(0), a * b, equal(a, vecN(0)) || equal(b, vecN(0))) That would be really expensive, the performance impact would pretty much not make it worth it. In terms of hacks, avoiding infinities in instructions like rcp, rsq, etc. tends to work well enough, although the performance hit is still noticeable, but it's not something that can go into Wine either way.
We've brought this up with driver vendors in the past, and at least NVIDIA and Mesa seemed open to the idea. We didn't get a direct response from fglrx. At some point we talked about an EXT_zero_mul_conventions extension with NVIDIA, but that seems to have stalled somewhere inside NVIDIA for reasons that aren't entirely clear to me. -- Configure bugmail: http://bugs.winehq.org/userprefs.cgi?tab=email Do not reply to this email, post in Bugzilla using the above URL to reply. ------- You are receiving this mail because: ------- You are watching all bug changes.
http://bugs.winehq.org/show_bug.cgi?id=34266 Andrew Church <achurch+wine(a)achurch.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Summary|Division by zero in shader |0*inf in D3D9 shaders |results in NaNs |outputs NaNs to | |floating-point framebuffers --- Comment #7 from Andrew Church <achurch+wine(a)achurch.org> 2013-08-17 06:36:15 CDT --- Okay, thanks for letting me know. I've updated the bug description to better reflect the problem. -- Configure bugmail: http://bugs.winehq.org/userprefs.cgi?tab=email Do not reply to this email, post in Bugzilla using the above URL to reply. ------- You are receiving this mail because: ------- You are watching all bug changes.
http://bugs.winehq.org/show_bug.cgi?id=34266 Andrew Church <achurch+wine(a)achurch.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #45619|0 |1 is obsolete| | --- Comment #8 from Andrew Church <achurch+wine(a)achurch.org> 2013-08-27 23:27:50 CDT --- Created attachment 45756 --> http://bugs.winehq.org/attachment.cgi?id=45756 Proof-of-concept patch v2 In case anyone wants to apply it locally, here's an updated version that also catches log2(0.0) and inversesqrt(0.0), and also works for vector operands. With this version, I haven't seen any glitches in >10h of FF14 gameplay. Interestingly, I didn't see any significant difference in benchmark performance from 3-run averages with and without the patch (in fact, the average score was slightly better with the patch applied, though I suspect that's just random variation). -- Configure bugmail: http://bugs.winehq.org/userprefs.cgi?tab=email Do not reply to this email, post in Bugzilla using the above URL to reply. ------- You are receiving this mail because: ------- You are watching all bug changes.
http://bugs.winehq.org/show_bug.cgi?id=34266 rmlipman(a)gmail.com changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |rmlipman(a)gmail.com -- Configure bugmail: http://bugs.winehq.org/userprefs.cgi?tab=email Do not reply to this email, post in Bugzilla using the above URL to reply. ------- You are receiving this mail because: ------- You are watching all bug changes.
http://bugs.winehq.org/show_bug.cgi?id=34266 DL <dredgingthelake(a)gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |dredgingthelake(a)gmail.com --- Comment #9 from DL <dredgingthelake(a)gmail.com> --- I tested the v2 proof of concept patch against wine-1.7.4 and it fixes http://bugs.winehq.org/show_bug.cgi?id=28883 It doesn't appear to affect performance in any way. -- Do not reply to this email, post in Bugzilla using the above URL to reply. You are receiving this mail because: You are watching all bug changes.
http://bugs.winehq.org/show_bug.cgi?id=34266 Andrew Church <achurch+wine(a)achurch.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #45756|0 |1 is obsolete| | --- Comment #10 from Andrew Church <achurch+wine(a)achurch.org> --- Created attachment 47795 --> http://bugs.winehq.org/attachment.cgi?id=47795 Proof-of-concept patch (1.7.11) Here's an updated version of the patch that seems to work for 1.7.11+ (at least for FF14). -- Do not reply to this email, post in Bugzilla using the above URL to reply. You are receiving this mail because: You are watching all bug changes.
http://bugs.winehq.org/show_bug.cgi?id=34266 Jonathan Strander <mblackwell1024(a)gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |mblackwell1024(a)gmail.com --- Comment #11 from Jonathan Strander <mblackwell1024(a)gmail.com> --- I haven't tested this patch before but I just tried the latest and can NOT confirm that it fixes Bug 28883 on my machine. Am I perhaps missing some setting? -- Do not reply to this email, post in Bugzilla using the above URL to reply. You are receiving this mail because: You are watching all bug changes.
http://bugs.winehq.org/show_bug.cgi?id=34266 --- Comment #12 from Jonathan Strander <mblackwell1024(a)gmail.com> --- Nevermind I forgot to enable GLSL. -- Do not reply to this email, post in Bugzilla using the above URL to reply. You are receiving this mail because: You are watching all bug changes.
http://bugs.winehq.org/show_bug.cgi?id=34266 --- Comment #13 from Jonathan Strander <mblackwell1024(a)gmail.com> --- Also this causes the Cinematic DOF setting in The Witcher 2 to function seemingly correctly (previously it would draw mostly black/glitchy surfaces). -- Do not reply to this email, post in Bugzilla using the above URL to reply. You are receiving this mail because: You are watching all bug changes.
https://bugs.winehq.org/show_bug.cgi?id=34266 Ken Sharp <imwellcushtymelike(a)gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- See Also| |https://bugs.winehq.org/sho | |w_bug.cgi?id=28883 -- Do not reply to this email, post in Bugzilla using the above URL to reply. You are receiving this mail because: You are watching all bug changes.
https://bugs.winehq.org/show_bug.cgi?id=34266 jingai <jingai(a)floatingpenguins.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |jingai(a)floatingpenguins.com -- Do not reply to this email, post in Bugzilla using the above URL to reply. You are receiving this mail because: You are watching all bug changes.
https://bugs.winehq.org/show_bug.cgi?id=34266 Sergey Isakov <isakov-sl(a)bk.ru> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |isakov-sl(a)bk.ru --- Comment #14 from Sergey Isakov <isakov-sl(a)bk.ru> --- (In reply to Andrew Church from comment #10)
Created attachment 47795 [details] Proof-of-concept patch (1.7.11)
Here's an updated version of the patch that seems to work for 1.7.11+ (at least for FF14).
The patch is wrong for me: Unigine Heaven 4.0, DirectX9 mode. MacOSX 10.9.5 Radeon HD6700M Log contains this: ~~~~ fixme:d3d_shader:print_glsl_info_log Info log received from GLSL shader #81: fixme:d3d_shader:print_glsl_info_log ERROR: 0:35: No matching function for call to mix(vec2, vec2, bvec2) fixme:d3d_shader:print_glsl_info_log ERROR: 0:44: No matching function for call to mix(vec2, vec2, bvec2) fixme:d3d_shader:shader_glsl_validate_link Program 83 link status invalid. ... fixme:d3d_shader:print_glsl_info_log ERROR: One or more attached shaders not successfully compiled ~~~~ And visible artefacts in screen attached -- Do not reply to this email, post in Bugzilla using the above URL to reply. You are receiving this mail because: You are watching all bug changes.
https://bugs.winehq.org/show_bug.cgi?id=34266 --- Comment #15 from Sergey Isakov <isakov-sl(a)bk.ru> --- Created attachment 53470 --> https://bugs.winehq.org/attachment.cgi?id=53470 artefacts in Unigine Heaven, red arrow to show -- Do not reply to this email, post in Bugzilla using the above URL to reply. You are receiving this mail because: You are watching all bug changes.
https://bugs.winehq.org/show_bug.cgi?id=34266 --- Comment #16 from Andrew Church <achurch+wine(a)achurch.org> --- (In reply to Sergey Isakov from comment #14)
fixme:d3d_shader:print_glsl_info_log Info log received from GLSL shader #81: fixme:d3d_shader:print_glsl_info_log ERROR: 0:35: No matching function for call to mix(vec2, vec2, bvec2)
A lot has changed in Wine's OpenGL code since 1.7.11. I don't play FFXIV anymore, but I'll take a look if I find some time. -- Do not reply to this email, post in Bugzilla using the above URL to reply. You are receiving this mail because: You are watching all bug changes.
https://bugs.winehq.org/show_bug.cgi?id=34266 --- Comment #17 from Sergey Isakov <isakov-sl(a)bk.ru> --- (In reply to Andrew Church from comment #16)
(In reply to Sergey Isakov from comment #14)
fixme:d3d_shader:print_glsl_info_log Info log received from GLSL shader #81: fixme:d3d_shader:print_glsl_info_log ERROR: 0:35: No matching function for call to mix(vec2, vec2, bvec2)
A lot has changed in Wine's OpenGL code since 1.7.11. I don't play FFXIV anymore, but I'll take a look if I find some time.
You can test the patch with https://unigine.com/products/benchmarks/heaven/ -- Do not reply to this email, post in Bugzilla using the above URL to reply. You are receiving this mail because: You are watching all bug changes.
https://bugs.winehq.org/show_bug.cgi?id=34266 Andrew Church <achurch+wine(a)achurch.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #47795|0 |1 is obsolete| | --- Comment #18 from Andrew Church <achurch+wine(a)achurch.org> --- Created attachment 53985 --> https://bugs.winehq.org/attachment.cgi?id=53985 Proof-of-concept patch (for wine-1.9.5) I've confirmed this fixes FFXIV (at least in the character creation screen), and I don't see the artifacts reported in the Unigine Heaven benchmark in comment #15 with this patch applied. -- Do not reply to this email, post in Bugzilla using the above URL to reply. You are receiving this mail because: You are watching all bug changes.
https://bugs.winehq.org/show_bug.cgi?id=34266 Józef Kucia <joseph.kucia(a)gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- See Also| |https://bugs.winehq.org/sho | |w_bug.cgi?id=7284 -- Do not reply to this email, post in Bugzilla using the above URL to reply. You are receiving this mail because: You are watching all bug changes.
https://bugs.winehq.org/show_bug.cgi?id=34266 Alistair Leslie-Hughes <leslie_alistair(a)hotmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Keywords| |patch -- Do not reply to this email, post in Bugzilla using the above URL to reply. You are receiving this mail because: You are watching all bug changes.
https://bugs.winehq.org/show_bug.cgi?id=34266 Paul Gofman <gofmanp(a)gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |gofmanp(a)gmail.com -- Do not reply to this email, post in Bugzilla using the above URL to reply. You are receiving this mail because: You are watching all bug changes.
https://bugs.winehq.org/show_bug.cgi?id=34266 Fabian Maurer <dark.shadow4(a)web.de> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |dark.shadow4(a)web.de --- Comment #19 from Fabian Maurer <dark.shadow4(a)web.de> --- Does this issue still exist as of wine 2.20? -- Do not reply to this email, post in Bugzilla using the above URL to reply. You are receiving this mail because: You are watching all bug changes.
https://bugs.winehq.org/show_bug.cgi?id=34266 Jan Havran <havran.jan(a)email.cz> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |havran.jan(a)email.cz -- Do not reply to this email, post in Bugzilla using the above URL to reply. You are receiving this mail because: You are watching all bug changes.
https://bugs.winehq.org/show_bug.cgi?id=34266 --- Comment #20 from Andrew Church <achurch+wine(a)achurch.org> --- Apologies for the delay in confirming, but yes, the issue still exists in Wine 2.20. My existing patch (when tweaked to apply against 2.20) does not seem to fix the problem anymore, as I still get black squares over bright spots in the benchmark's character creation screen, but I suspect that's because there been enough changes to Wine's shader translator that the patch no longer does its job. -- Do not reply to this email, post in Bugzilla using the above URL to reply. You are receiving this mail because: You are watching all bug changes.
https://bugs.winehq.org/show_bug.cgi?id=34266 George Gibbs <vash63(a)gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |vash63(a)gmail.com -- Do not reply to this email, post in Bugzilla using the above URL to reply. You are receiving this mail because: You are watching all bug changes.
https://bugs.winehq.org/show_bug.cgi?id=34266 --- Comment #21 from Matteo Bruni <matteo.mystral(a)gmail.com> --- *** Bug 28883 has been marked as a duplicate of this bug. *** -- Do not reply to this email, post in Bugzilla using the above URL to reply. You are receiving this mail because: You are watching all bug changes.
https://bugs.winehq.org/show_bug.cgi?id=34266 Matteo Bruni <matteo.mystral(a)gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |jeff(a)deseret-tech.com --- Comment #22 from Matteo Bruni <matteo.mystral(a)gmail.com> --- *** Bug 29397 has been marked as a duplicate of this bug. *** -- Do not reply to this email, post in Bugzilla using the above URL to reply. You are receiving this mail because: You are watching all bug changes.
https://bugs.winehq.org/show_bug.cgi?id=34266 Matteo Bruni <matteo.mystral(a)gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- See Also|https://bugs.winehq.org/sho |https://bugs.winehq.org/sho |w_bug.cgi?id=28883 |w_bug.cgi?id=21197 -- Do not reply to this email, post in Bugzilla using the above URL to reply. You are receiving this mail because: You are watching all bug changes.
https://bugs.winehq.org/show_bug.cgi?id=34266 Matteo Bruni <matteo.mystral(a)gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |dank(a)kegel.com --- Comment #23 from Matteo Bruni <matteo.mystral(a)gmail.com> --- *** Bug 26617 has been marked as a duplicate of this bug. *** -- Do not reply to this email, post in Bugzilla using the above URL to reply. You are receiving this mail because: You are watching all bug changes.
https://bugs.winehq.org/show_bug.cgi?id=34266 --- Comment #24 from Matteo Bruni <matteo.mystral(a)gmail.com> --- See bug 26617 for some more recent patches you can experiment with. -- Do not reply to this email, post in Bugzilla using the above URL to reply. You are receiving this mail because: You are watching all bug changes.
https://bugs.winehq.org/show_bug.cgi?id=34266 Matteo Bruni <matteo.mystral(a)gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |andrey.goosev(a)gmail.com --- Comment #25 from Matteo Bruni <matteo.mystral(a)gmail.com> --- *** Bug 36089 has been marked as a duplicate of this bug. *** -- Do not reply to this email, post in Bugzilla using the above URL to reply. You are receiving this mail because: You are watching all bug changes.
https://bugs.winehq.org/show_bug.cgi?id=34266 Matteo Bruni <matteo.mystral(a)gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |gyebro69(a)gmail.com --- Comment #26 from Matteo Bruni <matteo.mystral(a)gmail.com> --- *** Bug 35279 has been marked as a duplicate of this bug. *** -- Do not reply to this email, post in Bugzilla using the above URL to reply. You are receiving this mail because: You are watching all bug changes.
https://bugs.winehq.org/show_bug.cgi?id=34266 Jeff MacLoue <jeff(a)macloue.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |jeff(a)macloue.com --- Comment #27 from Jeff MacLoue <jeff(a)macloue.com> --- Bug still present in Wine 4.13 Staging (tested with Witcher 2), the patch (applies with a single reject) does not change anything - black areas are visible at Geralt's face identical to the screenshot in bug #28883. -- Do not reply to this email, post in Bugzilla using the above URL to reply. You are receiving this mail because: You are watching all bug changes.
https://bugs.winehq.org/show_bug.cgi?id=34266 --- Comment #28 from Andrew Church <achurch+wine(a)achurch.org> --- Patch https://bugs.winehq.org/attachment.cgi?id=64452 from bug 26617 seems to fix the original FFXIV 2.0 benchmark (the game itself has dropped D3D9 support and is no longer affected by this bug), so you might give that a try. -- Do not reply to this email, post in Bugzilla using the above URL to reply. You are receiving this mail because: You are watching all bug changes.
https://bugs.winehq.org/show_bug.cgi?id=34266 --- Comment #29 from Matteo Bruni <matteo.mystral(a)gmail.com> --- *** Bug 46336 has been marked as a duplicate of this bug. *** -- Do not reply to this email, post in Bugzilla using the above URL to reply. You are receiving this mail because: You are watching all bug changes.
https://bugs.winehq.org/show_bug.cgi?id=34266 Matteo Bruni <matteo.mystral(a)gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |K1773R(a)darkgamex.ch --- Comment #30 from Matteo Bruni <matteo.mystral(a)gmail.com> --- *** Bug 30061 has been marked as a duplicate of this bug. *** -- Do not reply to this email, post in Bugzilla using the above URL to reply. You are receiving this mail because: You are watching all bug changes.
https://bugs.winehq.org/show_bug.cgi?id=34266 --- Comment #31 from Matteo Bruni <matteo.mystral(a)gmail.com> --- *** Bug 46821 has been marked as a duplicate of this bug. *** -- Do not reply to this email, post in Bugzilla using the above URL to reply. You are receiving this mail because: You are watching all bug changes.
https://bugs.winehq.org/show_bug.cgi?id=34266 Oliver Klee <dev+wine(a)oliverklee.de> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |dev+wine(a)oliverklee.de -- Do not reply to this email, post in Bugzilla using the above URL to reply. You are receiving this mail because: You are watching all bug changes.
https://bugs.winehq.org/show_bug.cgi?id=34266 mikachu(a)gmail.com changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |mikachu(a)gmail.com -- Do not reply to this email, post in Bugzilla using the above URL to reply. You are receiving this mail because: You are watching all bug changes.
https://bugs.winehq.org/show_bug.cgi?id=34266 --- Comment #32 from Jeff MacLoue <jeff(a)macloue.com> --- (In reply to Andrew Church from comment #28)
Patch https://bugs.winehq.org/attachment.cgi?id=64452 from bug 26617 seems to fix the original FFXIV 2.0 benchmark (the game itself has dropped D3D9 support and is no longer affected by this bug), so you might give that a try.
Unfortunately no (visible) changes in The Witcher 2 with this patch. -- Do not reply to this email, post in Bugzilla using the above URL to reply. You are receiving this mail because: You are watching all bug changes.
https://bugs.winehq.org/show_bug.cgi?id=34266 --- Comment #33 from Paul Gofman <gofmanp(a)gmail.com> --- Created attachment 65229 --> https://bugs.winehq.org/attachment.cgi?id=65229 Workaround 0 * inf in each multiplication (In reply to Jeff MacLoue from comment #32)
Unfortunately no (visible) changes in The Witcher 2 with this patch.
I tested The Wicther 2 a bit and could reproduce the problem: - at the very start of tutorial, black spots on the face of the character sometimes while rotating the camera around the character; - at the start of the new game, black screen in cu scenes. Both glitches were worked around for me by https://bugs.winehq.org/attachment.cgi?id=64443 (first, more generic patch from bug #26617). I am attaching a bit updated version of the patch here. -- Do not reply to this email, post in Bugzilla using the above URL to reply. You are receiving this mail because: You are watching all bug changes.
https://bugs.winehq.org/show_bug.cgi?id=34266 --- Comment #34 from Paul Gofman <gofmanp(a)gmail.com> --- A patch with two distinct workarounds for this bug has been added to Staging. They are controlled by HKCU\\Software\\Wine\\Direct3D\\multiply_special registry value (DWORD value). None of the workarounds are enabled by default. Both workarounds have no effect on shaders 4.0 and higher (that is, Directx 10+), the workarounds concern Directx 8 and 9 shaders only. 1. Setting multiply_special to 1 avoids infinity in RCP, RSQ and LOG instructions (returns [-]FLT_MAX instead of infinity). This is supposed to avoid rendering problems in most, if not all, games affected by this bug. Yet there can potentially exist games which suffer from this bug but for which this won't help. It can happen if, e. g., the game gets infinity through floating point overflow which is later multiplied by zero, or passes infinity or nan through shader constants. I observed the latter in some games but ironically those were not affected by this bug. This approach can have some impact on shader performance, but the impact is supposed to be not very big. It is also potentially possible that some games which are not affected by this bug will regress when using it, though I am not aware of real examples of that. 2. Setting multiply_special to 2 wraps each multiplication and dot product in shader with a check for zero operand, so that 0 * something result is always 0. This is supposed to workaround this bug more or less universally. But this approach is disastrous for shader performance. So it is mostly meant for debugging purposes. Yet maybe if the game is not GPU bound on the given hardware this mode can be used to play it, if setting multiply_special to 1 does not help. What is particularly interesting for testing is: 1. Are there any games which are fixed by setting multiply_special to 2 but not to 1? 2. Are there any games (not affected by this bug) which have rendering problems with multiply_special set to 1? Any reports on that are appreciated. -- Do not reply to this email, post in Bugzilla using the above URL to reply. You are receiving this mail because: You are watching all bug changes.
https://bugs.winehq.org/show_bug.cgi?id=34266 --- Comment #35 from Jeff MacLoue <jeff(a)macloue.com> --- Verified The Witcher 2 EE (latest GOG version) - the rendering issues are gone with multiply_special = 1, no perceptible drop in performance. multiply_special = 2 also works fine. multiply_special = 0 gets the black spots back - no surprise here. PS Unfortunately couldn't verify the performance - the game lacks FPS display, and GLXOSD didn't work right away. Specs: Intel Core i5-8600K, 64 Gb RAM, GeForce 1050 Ti/4Gb VRAM -- Do not reply to this email, post in Bugzilla using the above URL to reply. You are receiving this mail because: You are watching all bug changes.
https://bugs.winehq.org/show_bug.cgi?id=34266 --- Comment #36 from Andrey Gusev <andrey.goosev(a)gmail.com> --- *** Bug 34715 has been marked as a duplicate of this bug. *** -- Do not reply to this email, post in Bugzilla using the above URL to reply. You are receiving this mail because: You are watching all bug changes.
https://bugs.winehq.org/show_bug.cgi?id=34266 Zebediah Figura <z.figura12(a)gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |kmaterka(a)wp.pl --- Comment #37 from Zebediah Figura <z.figura12(a)gmail.com> --- *** Bug 35876 has been marked as a duplicate of this bug. *** -- Do not reply to this email, post in Bugzilla using the above URL to reply. You are receiving this mail because: You are watching all bug changes.
https://bugs.winehq.org/show_bug.cgi?id=34266 --- Comment #38 from Paul Gofman <gofmanp(a)gmail.com> --- The following games are reported to be fixed by either 1 or 2 multiply_special setting: Alan Wake Gas Guzzlers Combat Carnage Shift 2 Unleashed SpinTires Tech demo The Witcher 2 Assassins of Kings EE Thanks Andrey Gusev for testing and letting me know. -- Do not reply to this email, post in Bugzilla using the above URL to reply. You are receiving this mail because: You are watching all bug changes.
https://bugs.winehq.org/show_bug.cgi?id=34266 --- Comment #39 from Matteo Bruni <matteo.mystral(a)gmail.com> --- *** Bug 38699 has been marked as a duplicate of this bug. *** -- Do not reply to this email, post in Bugzilla using the above URL to reply. You are receiving this mail because: You are watching all bug changes.
https://bugs.winehq.org/show_bug.cgi?id=34266 --- Comment #40 from Paul Gofman <gofmanp(a)gmail.com> --- (In reply to Paul Gofman from comment #38)
The following games are reported to be fixed by either 1 or 2 multiply_special setting:
Sorry, to be clear, fixed by any, that is, RCP / RSQ / LOG guard is enough to fix them. -- Do not reply to this email, post in Bugzilla using the above URL to reply. You are receiving this mail because: You are watching all bug changes.
https://bugs.winehq.org/show_bug.cgi?id=34266 --- Comment #41 from Andrey Gusev <andrey.goosev(a)gmail.com> --- Works for Murderous Pursuits. -- Do not reply to this email, post in Bugzilla using the above URL to reply. You are receiving this mail because: You are watching all bug changes.
https://bugs.winehq.org/show_bug.cgi?id=34266 Andrey Gusev <andrey.goosev(a)gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |berillions(a)gmail.com --- Comment #42 from Andrey Gusev <andrey.goosev(a)gmail.com> --- *** Bug 40531 has been marked as a duplicate of this bug. *** -- Do not reply to this email, post in Bugzilla using the above URL to reply. You are receiving this mail because: You are watching all bug changes.
https://bugs.winehq.org/show_bug.cgi?id=34266 --- Comment #43 from Béla Gyebrószki <gyebro69(a)gmail.com> --- *** Bug 35141 has been marked as a duplicate of this bug. *** -- Do not reply to this email, post in Bugzilla using the above URL to reply. You are receiving this mail because: You are watching all bug changes.
https://bugs.winehq.org/show_bug.cgi?id=34266 --- Comment #44 from Béla Gyebrószki <gyebro69(a)gmail.com> --- *** Bug 35130 has been marked as a duplicate of this bug. *** -- Do not reply to this email, post in Bugzilla using the above URL to reply. You are receiving this mail because: You are watching all bug changes.
https://bugs.winehq.org/show_bug.cgi?id=34266 Zebediah Figura <z.figura12(a)gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |wgpierce01(a)gmail.com --- Comment #45 from Zebediah Figura <z.figura12(a)gmail.com> --- *** Bug 49133 has been marked as a duplicate of this bug. *** -- Do not reply to this email, post in Bugzilla using the above URL to reply. You are receiving this mail because: You are watching all bug changes.
https://bugs.winehq.org/show_bug.cgi?id=34266 --- Comment #46 from William Pierce <wgpierce01(a)gmail.com> --- Since it's specifically asked for here:
1. Are there any games which are fixed by setting multiply_special to 2 but not to 1?
From duplicate bug https://bugs.winehq.org/show_bug.cgi?id=49133, setting multiply_special to 2 makes Bayonetta render fine, but setting it to 1 has no effect. Performance is fine after shader cache is built up.
-- Do not reply to this email, post in Bugzilla using the above URL to reply. You are receiving this mail because: You are watching all bug changes.
https://bugs.winehq.org/show_bug.cgi?id=34266 Gijs Vermeulen <gijsvrm(a)gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |conmanx360(a)gmail.com --- Comment #47 from Gijs Vermeulen <gijsvrm(a)gmail.com> --- *** Bug 45376 has been marked as a duplicate of this bug. *** -- Do not reply to this email, post in Bugzilla using the above URL to reply. You are receiving this mail because: You are watching all bug changes.
https://bugs.winehq.org/show_bug.cgi?id=34266 --- Comment #48 from Andrey Gusev <andrey.goosev(a)gmail.com> --- Another one game is Steel Armor: Blaze of War -- Do not reply to this email, post in Bugzilla using the above URL to reply. You are receiving this mail because: You are watching all bug changes.
https://bugs.winehq.org/show_bug.cgi?id=34266 Gijs Vermeulen <gijsvrm(a)gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |b.barwich(a)hotmail.com --- Comment #49 from Gijs Vermeulen <gijsvrm(a)gmail.com> --- *** Bug 41210 has been marked as a duplicate of this bug. *** -- Do not reply to this email, post in Bugzilla using the above URL to reply. You are receiving this mail because: You are watching all bug changes.
participants (2)
-
wine-bugs@winehq.org -
WineHQ Bugzilla