Bug 104302 - Wolfenstein 2 (2017) under wine graphical artifacting on RADV
Summary: Wolfenstein 2 (2017) under wine graphical artifacting on RADV
Alias: None
Product: Mesa
Classification: Unclassified
Component: Drivers/Vulkan/radeon (show other bugs)
Version: git
Hardware: x86-64 (AMD64) Linux (All)
: medium normal
Assignee: mesa-dev
QA Contact: mesa-dev
Depends on:
Reported: 2017-12-17 11:11 UTC by Matt
Modified: 2018-10-31 14:15 UTC (History)
3 users (show)

See Also:
i915 platform:
i915 features:

workaround for the shoot issue (547 bytes, patch)
2018-02-23 13:26 UTC, Samuel Pitoiset
Details | Splinter Review

Description Matt 2017-12-17 11:11:37 UTC
Wolfenstein 2 under a patched wine (patches outlined here https://bugs.winehq.org/show_bug.cgi?id=43935), produces bizarre artifacting (not my video but precisely what I experience https://youtu.be/f0EzOxs_Ofc?t=106)

Currently running mesa-git 17.4.0-0.10.devel.git.b926da241a on Fedora 27 with mainline 4.15rc3 kerenel (for DC), but experience same symptoms if I downgrade to 17.3

If you need more information, I can provide
Comment 1 Matt 2018-02-02 10:03:09 UTC
Have attempted using a different wine solution to run the game - https://github.com/roderickc/wine-vulkan . Users of this have reported it working on the RX480, but is still incorrectly rendering (as per original video) on R9 Fury Nano (Fiji).

Also have moved up to Mesa 18.0RC2 with LLVM 6.0 issue still pressent.
Comment 2 Matt 2018-02-02 10:57:46 UTC
Further to this - I have the VulkanSDK installed under my wine instance - would a VKtrace dump help bisect the issue or is this useless for driver debug?
Comment 3 Samuel Pitoiset 2018-02-23 13:23:45 UTC

This should fix the "cutscene" issue https://patchwork.freedesktop.org/patch/206486/ .
Comment 4 Samuel Pitoiset 2018-02-23 13:26:14 UTC
Created attachment 137556 [details] [review]
workaround for the shoot issue

Also, if you want to get rid of the "shoot" issue temporarily, you might want to apply the attached patch. I will try to write a proper fix as soon as possible.

Comment 5 Thomas Crider 2018-02-24 19:27:41 UTC
@Samuel Pitoiset
both patches work great with mesa! the distance render blackness is fixed and the shooting bloom and light effect bloom bugs are fixed. now just need the melty-faces fixed and the game is golden (as far as bugs I've come across)
Comment 6 Samuel Pitoiset 2018-02-26 13:10:45 UTC
This fixes the "cutscene" issue https://cgit.freedesktop.org/mesa/mesa/commit/?id=e05507a427b79e481eb8e45d7aa3c9b4b78376bf
Comment 7 Thomas Crider 2018-02-27 01:28:58 UTC
thats what I meant by the distance render blackness - it's fixed in cutscenes. gun shooting and the weird light rays are fixed also. The remaining problem is the facial animations are a bit melty in some cut scenes. for example his mother's face in the scene where she offers him soup or porridge in bed
Comment 8 Samuel Pitoiset 2018-02-27 08:55:54 UTC
Wait, gun shooting is also fixed for you? Which LLVM version are you using? Because for me it's not the same issue.
Comment 9 Thomas Crider 2018-02-28 05:35:07 UTC
Sorry for the delayed response, have been at work. Today roderickc/wine-vulkan patches were implemented into mainline wine and wine-staging was rebased, so I was able to run the following video with a full vulkan implementation on wine with no additional patches. Here is my current setup:

Wine-staging 3.3 git. (github.com/wine-staging/wine-staging)
with rebase hash 9ae8b8c00f2cca205fdf4ce76e221778b7dfbea7

Arch Linux Kernel: 4.16 rc3 
Mesa 18.0.0 rc4 
LLVM 6.0.0 rc3 
AMD RX Vega 64


shooting seems to work fine
cutscene backgrounds render fine

*mouth facial animations are a bit off/odd/melty
Comment 10 Thomas Crider 2018-02-28 08:12:30 UTC
to clarify on my previous post, this is -WITH- Samuel Pitoiset's two out of tree patches
Comment 11 Samuel Pitoiset 2018-02-28 08:40:03 UTC
Yeah, so that makes sense. Thanks for testing :-)

By the way, here's a potential fix for the shoot issue https://reviews.llvm.org/D43831
Comment 12 Thomas Crider 2018-03-08 03:18:09 UTC
Just thought I'd follow up and let you know the llvm "shoot" patch (https://reviews.llvm.org/D43831) you provided works very well! The hack patch for mesa works also. Thanks again!
Comment 13 Thomas Crider 2018-03-08 03:19:29 UTC
(to clarify for other users -- use either the shoot "hack" patch for mesa, or the llvm patch to remove the weirdly blinding "shoot" bug and ring-lights etc on the submarine, not both)
Comment 14 Samuel Pitoiset 2018-03-12 13:59:34 UTC
The shoot issue has been fixed with "* 99cdc019bf - ac: make use of if/loop build helpers (5 days ago)". Note that it's a side-effect, there is still an issue with the SIInsertWaitcnts pass in LLVM.

The last one is the face issue.
Comment 15 Charadon 2018-04-30 12:29:07 UTC
Most issues from what I can see have been fixed after updating to 18.0.1, however I can confirm the face issues are still around.
Comment 16 Matt 2018-04-30 21:46:07 UTC
Confirming everything is fixed bar the melting facial animations with Fedora 28, Mesa-git 18.2 and LLVM 7.0
Comment 17 Samuel Pitoiset 2018-05-01 17:15:47 UTC
Thanks for confirming. I'm aware of the faces issue but I haven't been able to fix it yet.
Comment 18 Charadon 2018-05-02 19:31:36 UTC
I dunno if this information helps, but the face issue doesn't exist in AMD's enterprise drivers.
Comment 19 Samuel Pitoiset 2018-05-15 20:09:21 UTC
Yeah, it's a LLVM issue. I partially figured out the problem but it's hard to fix it correctly. I will let you know when I have something better.
Comment 20 Samuel Pitoiset 2018-10-12 13:53:46 UTC
Faces issue fixed with the possible patch reported here https://bugs.llvm.org/show_bug.cgi?id=37744#c2
Comment 21 Thomas Crider 2018-10-13 05:07:10 UTC
Can confirm @Samuel Pitoiset v2 of that llvm patch fixes the face issue! Just got around to testing it today, working well
Comment 22 Samuel Pitoiset 2018-10-17 09:46:25 UTC
Patch available here https://reviews.llvm.org/D53359
Comment 23 Samuel Pitoiset 2018-10-31 14:15:38 UTC
This is now fixed! Thanks to Christian and Nicolai!

commit 91533e99d40c335134a635deaee79c726bb618f0
Author: Nicolai Haehnle <nhaehnle@gmail.com>
Date:   Wed Oct 31 13:26:48 2018 +0000

    AMDGPU: Remove PHI loop condition optimization
    The optimization to early break out of loops if all threads are dead was
    never fully implemented.
    But the PHI node analyzing is actually causing a number of problems, so
    remove all the extra code for it.
    (This does actually regress code quality in a few places because it
     ends up relying more heavily on phi's of i1, which we don't do a
     great job with. However, since it fixes real bugs in the wild, we
     should take this change. I have some prototype changes to improve
     i1 lowering in general -- not just for control flow -- which should
     help recover the code quality, I just need to make those changes
     fit for general consumption. -- Nicolai)
    Change-Id: I6fc6c6c8961857ac6009fcfb9f7e5e48dc23fbb1
    Patch-by: Christian König <christian.koenig@amd.com>
    Reviewers: arsenm, rampitec, tpr
    Subscribers: kzhuravl, jvesely, wdng, yaxunl, dstuttard, t-tye, llvm-commits
    Differential Revision: https://reviews.llvm.org/D53359
    git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@345718 91177308-0d34-0410-b5e6-96231b3b80d8

Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.