Skip to contentSkip to conversation

Glitches with soft shadows and MSAA in Knights of the Old Republic 2

Bug 93767 [email protected] 1 participant 13 messages Jan 19, 2016 – Apr 27, 2016

lore
Share & tools
lore
#0 lore raw

https://bugs.freedesktop.org/show_bug.cgi?id=93767

Bug ID: 93767
Summary: Glitches with soft shadows and MSAA in Knights of the
Old Republic 2
Product: Mesa
Version: git
Hardware: Other
OS: All
Status: NEW
Severity: normal
Priority: medium
Component: Drivers/Gallium/radeonsi
Assignee: [email protected]
Reporter: [email protected]
QA Contact: [email protected]

Created attachment 121127
--> https://bugs.freedesktop.org/attachment.cgi?id=121127&action=edit
Screenshot of the glitch

When enabling both soft shadows and antialiasing in Knights of the Old Republic 2 [0], there are lines visible in addition to the shadows.

Here is an apitrace showing the problem:

http://constexpr.org/tmp/KotOR2-shadows-radeonsi.trace.xz (37 MiB)

The same trace (and the game) render fine with Catalyst 15.12.

Disabling either soft shadows or antialiasing also fixes the rendering.

GPU: Radeon HD 7950 (TAHITI)
Mesa 11.2.0-devel (git-d018619)
LLVM r255414

Quoted 1 line

From what I can tell the problem first appears in e.g. draw call 1919333 in my

trace - the stencil buffer has value 127 everywhere except for parts covered by the shadow volumes. The color buffer however contains jagged lines afterwards in addition to the pixels covered by the shadows.

NB: The game also has fog issues like those worked around in the ATI_fs implementation [1] for the first KotOR game, but they are also present with Catalyst and even in one of the official screenshots [2] on the game's Steam store page. I think its fair to assume that that is a game bug, but if anyone wants to try it out with another driver / HW, here is another apitrace:

http://constexpr.org/tmp/KotOR2-fog-radeonsi.trace.xz (35 MiB)

[0] http://store.steampowered.com/app/208580/
[1] http://lists.freedesktop.org/archives/mesa-dev/2015-December/103263.html
[2]
http://cdn.akamai.steamstatic.com/steam/apps/208580/ss_e2043ae5d872d5576fd160acb3aa1169a5d0222c.1920x1080.jpg?t=1451421385

Signature · 2 lines
You are receiving this mail because:
You are the assignee for the bug.

_______________________________________________
dri-devel mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/dri-devel

#1 lore raw

https://bugs.freedesktop.org/show_bug.cgi?id=93767

Daniel Scharrer <[email protected]> changed:

What |Removed |Added
----------------------------------------------------------------------------

 Attachment #121127|text/plain                  |image/jpeg
          mime type|                            |
Signature · 2 lines
You are receiving this mail because:
You are the assignee for the bug.

_______________________________________________
dri-devel mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/dri-devel

#2 lore raw
In reply to [email protected]

https://bugs.freedesktop.org/show_bug.cgi?id=93767

--- Comment #1 from almos <[email protected]> ---
With the ATI_fs patch series v4 applied (even the ones that are not in master yet), I see no such glitches in KotOR 2. Shadows are correct, and fog is correct. The only problem I see is that enabling soft shadows makes the shadows so faint they are barely visible, but I think that's a bug in the game.

I'm using latest Mesa from git, llvm 3.7.1, Wine 1.9.6.

Note that Steam only offers the remastered version of KotOR2 now, which doesn't use ATI_fs anymore. The screenshots on the store page may be from the old version though.

Signature · 2 lines
You are receiving this mail because:
You are the assignee for the bug.

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel

#3 lore raw
In reply to [email protected]

https://bugs.freedesktop.org/show_bug.cgi?id=93767

--- Comment #2 from Daniel Scharrer <[email protected]> ---

Quoted 2 lines

Note that Steam only offers the remastered version of KotOR2 now, which doesn't use ATI_fs anymore.

Yes, I'm talking about the remastered version (the only one that has a native linux release). Did you test the original?

Anyway, I'm still seeing the glitches here. Soft shadows aren't any fainter than hard shadows as far as I can tell.

GPU: R9 380X (tonga)
Mesa 11.3.0-devel (git-9076e04)
LLVM r265023

Signature · 2 lines
You are receiving this mail because:
You are the assignee for the bug.

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel

#4 lore raw
In reply to [email protected]

https://bugs.freedesktop.org/show_bug.cgi?id=93767

--- Comment #3 from almos <[email protected]> --- (In reply to Daniel Scharrer from comment #2)

Quoted 6 lines
Quoted 2 lines

Note that Steam only offers the remastered version of KotOR2 now, which doesn't use ATI_fs anymore.

Yes, I'm talking about the remastered version (the only one that has a native linux release). Did you test the original?

Quoted 6 lines

Anyway, I'm still seeing the glitches here. Soft shadows aren't any fainter than hard shadows as far as I can tell.

GPU: R9 380X (tonga)
Mesa 11.3.0-devel (git-9076e04)
LLVM r265023

My last comment was about the original version. Now I checked the remastered, and it seems fine, although I haven't gotten very far yet. I see that they fixed the faint soft shadows in the remaster.

Signature · 2 lines
You are receiving this mail because:
You are the assignee for the bug.

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel

#5 lore raw
In reply to [email protected]

https://bugs.freedesktop.org/show_bug.cgi?id=93767

almos <[email protected]> changed:

What |Removed |Added
----------------------------------------------------------------------------
CC| |[email protected]

--- Comment #4 from almos <[email protected]> ---
I took a look at your traces. The shadow trace renders fine here. I examined both call 1919333 and the final frame, and I see no corruption. In the fog trace some surfaces get no fog, while others get too much. I'm very far from reaching that point in the remastered version, so I can't verify this in-game.

Signature · 2 lines
You are receiving this mail because:
You are the assignee for the bug.

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel

#6 lore raw
In reply to [email protected]

https://bugs.freedesktop.org/show_bug.cgi?id=93767

--- Comment #5 from Nicolai H�hnle <[email protected]> ---
Hi Daniel, thanks for the apitrace and preliminary investigation. I can confirm that the trace shows a rendering error on Verde, Bonaire, and Tonga. A workaround for now is to set R600_DEBUG=nohyperz.

Could you please test whether the problem appears also on lower MSAA levels?

almos, I'm surprised that you're not seeing the glitch. What's your system setup and hardware?

A proper fix may involve disabling ALLOW_EXPCLEAR for MSAA stencil.

Signature · 2 lines
You are receiving this mail because:
You are the assignee for the bug.

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel

#7 lore raw
In reply to [email protected]

https://bugs.freedesktop.org/show_bug.cgi?id=93767

--- Comment #6 from Daniel Scharrer <[email protected]> --- Hi, thanks for looking into this.

The problem happens on all MSAA levels the game offers: 2, 4 and 6 (I assume this maps to 8). The there are less lines with lower MSAA levels though, or at least they are less noticeable.

R600_DEBUG=nohyperz does get rid of the glitches for all MSAA levels.

Signature · 2 lines
You are receiving this mail because:
You are the assignee for the bug.

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel

#8 lore raw
In reply to [email protected]

https://bugs.freedesktop.org/show_bug.cgi?id=93767

--- Comment #7 from almos <[email protected]> ---
Created attachment 122748
--> https://bugs.freedesktop.org/attachment.cgi?id=122748&action=edit
kotor2-shadows-frame296.png

(In reply to Nicolai H�hnle from comment #5)

Quoted 2 lines

almos, I'm surprised that you're not seeing the glitch. What's your system setup and hardware?

I attached the saved image of frame 296 (which contains call 1919333 mentioned in the original report) from the shadows trace. I don't see corruption on it, even though MSAA seems to be enabled in glretrace. My card is a R9 270x, and I have Mesa 11.1.2, LLVM 3.7.1.

Signature · 2 lines
You are receiving this mail because:
You are the assignee for the bug.

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel

#9 lore raw
In reply to [email protected]

https://bugs.freedesktop.org/show_bug.cgi?id=93767

--- Comment #8 from Nicolai H�hnle <[email protected]> ---
This makes sense. Mesa 11.1 does not contain the stencil fast clear changes. I'm going to try to get some clarification on what's going wrong here.

Signature · 2 lines
You are receiving this mail because:
You are the assignee for the bug.

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel

#10 lore raw
In reply to [email protected]

https://bugs.freedesktop.org/show_bug.cgi?id=93767

--- Comment #9 from almos <[email protected]> ---
I confirm that the glitch occurs with Mesa 11.3-dev, and the patch "radeonsi:
work around an MSAA fast stencil clear problem" posted to mesa-dev fixes it.

Signature · 2 lines
You are receiving this mail because:
You are the assignee for the bug.

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel

#11 lore raw
In reply to [email protected]

https://bugs.freedesktop.org/show_bug.cgi?id=93767

--- Comment #10 from Daniel Scharrer <[email protected]> --- I can also confirm that the patch fixes the issue with the game.

Signature · 2 lines
You are receiving this mail because:
You are the assignee for the bug.

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel

#12 lore raw
In reply to [email protected]

https://bugs.freedesktop.org/show_bug.cgi?id=93767

Nicolai H�hnle <[email protected]> changed:

What |Removed |Added
----------------------------------------------------------------------------

         Resolution|---                         |FIXED
             Status|NEW                         |RESOLVED

--- Comment #11 from Nicolai H�hnle <[email protected]> --- The workaround is now in Mesa master, commit 8c43c06e0463515c1339d44cbb8f78169e6a06fb

Signature · 2 lines
You are receiving this mail because:
You are the assignee for the bug.

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel