Bug 108726 - [DXVK] The Witness - transparent objects are not drawn correctly
Summary: [DXVK] The Witness - transparent objects are not drawn correctly
Status: RESOLVED NOTOURBUG
Alias: None
Product: Mesa
Classification: Unclassified
Component: Drivers/Vulkan/intel (show other bugs)
Version: git
Hardware: Other All
: medium normal
Assignee: Intel 3D Bugs Mailing List
QA Contact: Intel 3D Bugs Mailing List
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2018-11-13 14:00 UTC by roever
Modified: 2018-11-18 10:51 UTC (History)
3 users (show)

See Also:
i915 platform:
i915 features:


Attachments
denys_attachment1 (1.22 MB, image/png)
2018-11-14 12:20 UTC, Denis
Details

Description roever 2018-11-13 14:00:51 UTC
Instead of noting all the details, have a look here

https://github.com/doitsujin/dxvk/issues/724

Summary:

it seems like the intel anv driver doesn't draw the transparent objects in "The Witness" correctly. nvidia and amd seem to draw it right.

Current stable (18.2.4) doesn't draw them at all
Current git (as of today November 13th) draws them, but they are opaque and black instead of colored transparent

The github issue contains a trace and some other information
Comment 1 Denis 2018-11-13 14:37:55 UTC
hi, could you please clarify this:
>Some puzzles in The Witness
is it possible to provide saves for this game? Or at least to point exactly to the level with an issue?
Comment 2 roever 2018-11-13 16:59:05 UTC
if you start the game the first time you will see the issue is the gate that leads out of the entry area. This gate is invisible in the current release 18.2.4, and you can't look through the holes of the gate in the current trunk.

Next possible good place that is easy to reach from a freshly started game is the so called "glass factory" and "symmetry island"

Have a look at this video

https://www.youtube.com/watch?v=Mj3nCfB64AI

at 2:50 he is standing in front of the gate
at 12:49 he is standing in front of the door that is shown in the github issue.
Comment 3 Denis 2018-11-13 17:08:50 UTC
aha. Got you. Now I am investigating the game, it works quite slow.
I found this location => https://camo.githubusercontent.com/9a8229aebe2cbd56478866c8382d7214ccd35f0d/68747470733a2f2f707265766965772e6962622e636f2f69633145574c2f6478766b2e706e67

Also so gates. Thanks for information. Will check
Comment 4 roever 2018-11-13 17:26:39 UTC
cool, tell me when you got something for me to check, and I will quickly run through all the places where I observed problems
Comment 5 Denis 2018-11-14 12:20:31 UTC
Created attachment 142464 [details]
denys_attachment1

Hi, I am afraid I can't reproduce it on my PC. I built vulkan x32 from source 18.2.4, and for me on mentioned places I saw all objects. Check attached screenshot please

Also interesting thing, I can't launch the game from steam. I am launching it from cmd -> wine '/home/den/.steam/steam/steamapps/common/The Witness/witness_d3d11.exe'
Comment 6 roever 2018-11-14 12:31:36 UTC
in that case what may be the difference?

here is my cpuinfo:

cpu family      : 6
model           : 94
model name      : Intel(R) Core(TM) i5-6500 CPU @ 3.20GHz
stepping        : 3
microcode       : 0x39
cpu MHz         : 2949.777
cache size      : 6144 KB

maybe it depends on the concrete GPU?
Comment 7 Denis 2018-11-14 12:40:08 UTC
that's a good question. But according to the original topic on github - user had HD620 graphic card, same with my.
But, hmm, you have " Intel® HD Graphics 530 " - it is SKL gen.
Ok, thanks for additional information. I will try to check on SKL cpu (I have 520 gpu), also will build 18.2.1 from release package (same with topic starter mesa-version) and check on it.

As I understood, I made correct screenshots with corruptions in your case? If so, that's great. At least I know - on what to look into.
Comment 8 roever 2018-11-14 12:46:22 UTC
yes, the screenshots are definitively both at the right place. 

I seem to be unable to start the witness in wine. Neither the 32 nor the 64 bit version will start... most probably because the dxvk library is only part of steam?!? (I don't know)

If you need any more information just ask, I will try to answer. I could also show you how the gate looks for me in trunk and version 18.2.4... if that would be helpful
Comment 9 Denis 2018-11-14 16:10:25 UTC
hm, are you sure that using openGL this issue doesn't available?
I failed to launch the game using steam and on SKL pc too, so I decided to run directly via wine again.

1. I didn't install dxvk, so assume, that my first tries were made via open GL.
Result: I don't see pazzle on first screenshot (gate). Wine was taken from repo (3.0, too low for dxvk compatibility).

2. Then I installed dxvk and more resent wine (3.20). Launched game and also didn't see gate.

I tried to make a renderdoc file, but wine crashes, so I am rebuilding 3.19. It should be more stable.

Short summ up: issue was reproduced on openGL and vulkan on SKL gen (GT520)
Both tests were made on 18.1.9 (openGL) and 18.3.0 vulkan (from 28.10 git).

Continue my investigations. Anyway it looks like a platform dependent issue, because on KBL it was ok for me
Comment 10 roever 2018-11-14 16:44:12 UTC
Sorry, I can't answer that question. I am a bit out of my realm of knowledge here

but from the processtree


python3 [...]/Steam/SteamApps/common/Proton 3.7/proton waitforexitandrun [...]/Steam/SteamApps/common/The Witness/witness_d3d11.exe

I can at least take that proton is used and not wine.

I also tried so set PROTON_USE_WINED3D to disable the vulkan output... output seemed a bit more sluggish but I am not really certain if I was successful. The content on the display was unchanged by my efforts, it always looked the same
Comment 11 Danylo 2018-11-16 16:03:22 UTC
The culprit is incorrect usage of dual source blending.

commit 00fc56a68d21d7aa91b95f0eaacba59a96c466f5 (HEAD -> master)
Author: Danylo Piliaiev <danylo.piliaiev@gmail.com>
Date:   Fri Jul 20 12:54:42 2018 +0300

    anv: Disable dual source blending when shader doesn't support it on gen8+
    
    Dual source blending behaviour is undefined when shader doesn't
    have second color output.
    
     "If SRC1 is included in a src/dst blend factor and
      a DualSource RT Write message is not used, results
      are UNDEFINED. (This reflects the same restriction in DX APIs,
      where undefined results are produced if “o1” is not written
      by a PS – there are no default values defined)."
    
    Dismissing fragment in such situation leads to a hang on gen8+
    if depth test in enabled.
    
    Since blending cannot be gracefully fixed in such case and the result
    is undefined - blending is simply disabled.
    
    v2 (Jason Ekstrand):
     - Apply the workaround to each individual entry
     - Emit a warning through debug_report
    
    Signed-off-by: Danylo Piliaiev <danylo.piliaiev@globallogic.com>
    Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
    Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>

After this commit blending is disabled when rendering with incorrect dual source blending setup. I can see the error in logs and relevant draw call in RenderDoc. (Also the same commit exists for OpenGL)

The verdict - not a mesa's bug, most likely it's a game's bug.


When I made that commit I though I was fixing some esoteric issue and now it's a second game in a month which exhibits it.
Comment 12 Jason Ekstrand 2018-11-16 16:21:24 UTC
I wondered about that... There's a subtle difference between how dual-src blending is done in OpenGL/Vulan vs. D3D.  It's bitten us before with various game ports on the OpenGL side.  I've explained on the DXVK bug; should be a simple DXVK fix.
Comment 13 roever 2018-11-18 10:51:13 UTC
the mentioned dxvk patch seems to fix all issues.


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.