wine-nine-standalone icon indicating copy to clipboard operation
wine-nine-standalone copied to clipboard

some alphatests show bright outline pixels in Mirror's Edge

Open aufkrawall opened this issue 3 years ago • 14 comments

17410_20201216185721_1

It doesn't look that way with native D3D9 on Windows or with DXVK. It might be that WineD3D shows the same issue, can re-check that.

I once noticed this a year or two ago on Polaris and can still confirm with RX 5700 XT and recent mesa-git. Not related to MSAA.

aufkrawall avatar Dec 16 '20 19:12 aufkrawall

Can you please give us an apitrace or at least a savegame so that we can reproduce this issue?

Venemo avatar Dec 16 '20 19:12 Venemo

Sure, I'm going to post an apitrace soon. The issue is already visible in the beginning of the tutorial level when looking at the orange walking grids.

aufkrawall avatar Dec 16 '20 19:12 aufkrawall

Native D3D9 captured on Windows: https://drive.google.com/file/d/1imZf0X9cmB3AOZxek2Vy0nRcZzhuE5pG/view?usp=sharing

aufkrawall avatar Dec 16 '20 22:12 aufkrawall

With the trace taken on windows, it replays fine with my local mesa. Maybe it's some flags nine doesn't advertise correctly. When you replay locally do you see the issue ?

Btw for future traces: To find bugs, we have to run many many time the traces, thus it helps to set a low resolution (vsync on to cap framerate) such that it replays very fast.

axeldavy avatar Dec 18 '20 16:12 axeldavy

I haven't actually replayed any of my apitraces so far. I just did so and realized how inconvenient the slow-motion speed is. Sorry about that!

Yes, I can see the slight corruption in the apitrace with Nine, whereas it's not there with DXVK.

Nine (it seems to be most prominent in shadowed areas, but it looks to me like if the alphatests also looked too aliased in bright areas): Screenshot_20201218_201405

DXVK RADV ACO: Screenshot_20201218_201008

I also reproduced with WineD3D and it looks like Gallium Nine. So I'd suspect the issue is in Mesa/RadeonSI/LLVM and not Gallium Nine.

aufkrawall avatar Dec 18 '20 19:12 aufkrawall

Indeed I can reproduce this artifact. To investigate it, I would need a trace that can execute very fast please.

axeldavy avatar Dec 18 '20 20:12 axeldavy

I think the game was already heavily throttled by apitrace CPU overhead. Would it help further if I capped the frame rate to e.g. 10fps or so for the capture process?

aufkrawall avatar Dec 18 '20 21:12 aufkrawall

Yes, the fewer frames, the better

axeldavy avatar Dec 18 '20 23:12 axeldavy

Here are two new traces (720p 10fps): One is a bit shorter and shows the alphatests from afar, while the other is a bit longer to show the corruption up close: https://drive.google.com/file/d/1ez76hBfCauss2Ah0obXQ412XFWH88Sot/view?usp=sharing

The issue starts occurring with high texture details, so perhaps it's something with normal/bump mapping (wild guess)?

aufkrawall avatar Dec 19 '20 18:12 aufkrawall

21647774 is one of the calls of the long trace that draws the buggy stairs.

The shader features a texkill and it is apparent the buggy pattern happens on a grid of 2x2 superpixels when at least one pixel is not drawn. Thus it is yet another texkill/WQM radeonsi llvm bug.

axeldavy avatar Dec 20 '20 23:12 axeldavy

Thanks for your analysis! So this would need to be fixed in LLVM? I could try llvm-git from unofficial mesa-git repository for Arch (as building it is too painful with my 6700k).

Edit: Ok, it's unchanged with lib32-llvm-libs-git 12.0.0_r374967.eb66bf0802f9-1. Waiting for RadeonSI ACO? :grin:

aufkrawall avatar Dec 20 '20 23:12 aufkrawall

@aufkrawall Since you mentioned that this works correctly with DXVK + RADV/ACO, can I ask you to please try if it works or not with DXVK + RADV/LLVM? This would help identify if it really is an LLVM bug or not. You will need to use the RADV_DEBUG=llvm environment variable.

Venemo avatar Dec 21 '20 10:12 Venemo

Yeah, I should have thought of that. Indeed then the issue is also there with DXVK + RADV: Screenshot_20201221_141741

aufkrawall avatar Dec 21 '20 13:12 aufkrawall

Interesting. Thanks @aufkrawall for checking. This is either a bug in LLVM itself, or mesa's usage of LLVM.

Venemo avatar Dec 21 '20 16:12 Venemo