Skip to contentSkip to conversation

Pillars of Eternity glitch in maps

Bug 91656 [email protected] 1 participant 19 messages Aug 16, 2015 – Mar 17, 2016

lore
Share & tools
lore
#0 lore raw

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

Bug ID: 91656
Summary: Pillars of Eternity glitch in maps
Product: Mesa
Version: git
Hardware: Other
OS: Linux (All)
Status: NEW
Severity: normal
Priority: medium
Component: Drivers/Gallium/r600
Assignee: [email protected]
Reporter: [email protected]
QA Contact: [email protected]

There is a regression/graphical glitch when playing Pillars of Eternity. When I use the ingame map, it is partly "dark/black".

You can find a screenshot here:
http://images.akamai.steamusercontent.com/ugc/439450977393999113/19DF4F643F0C4BB058665F056DBC4600D669ED7B/

The map looks fine with regular Ubuntu drivers (10.1.3), I checked a couple of days ago with a reinstall (my harddisk broke). After an "upgrade" to oibaf repository, the glitch appeared.

The glitch was not there mid-June with 10.6(?) or so. I used oibaf then too, but didn't play for a month. It was probably introduced about June 15 or later. (Maybe a bit earlier, I don't upgrade the beta drivers every day). It was there when I started playing again July 18th.

My card is a Radeon 4870:

OpenGL vendor string: X.Org
OpenGL renderer string: Gallium 0.4 on AMD RV770
OpenGL core profile version string: 3.3 (Core Profile) Mesa 11.0.0-devel (git-28ed1e0 2015-08-14 trusty-oibaf-ppa)

If you need me to test something or need further information, please feel free to ask. (Enable debug output somehow?) I have browsed PoE logfiles and /var/log, but couldn't find anything that looked even vaguely related. No errors when loading the map or displaying it.

(Btw.: Congrats to Mesa 11!)

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=91656

--- Comment #2 from [email protected] ---
Hi have create an apitrace, you can find it here:
https://drive.google.com/file/d/0B3-ikYPrROroM3M3SFM4NGd4c0E/view?usp=sharing

I noticed something interesting. The trace slows the rendering of the map down. What I perceived previously as "flickering" became kind of an "animation".

The map is shown an initially nearly "correct". Then it fades and most of it becomes darker and darker till it becomes as in the screenshot. I can create some screenshots, if they are helpful.

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

#3 lore raw
In reply to [email protected]

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

--- Comment #3 from Matias Hilden <[email protected]> --- This issue also happens on radeonsi, with Mesa 11.1.0-devel (git-d6fbcf6).

According to POE forums, it used to happen on catalyst too at some point, but it has been fixed since.

My card is R9 280.

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

author Reviewed-by Marek Olšák Reviewed-by Jose Fonseca
#5 lore raw
In reply to [email protected]

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

--- Comment #5 from Daniel Scharrer <[email protected]> ---
I can reproduce this on my TAHITI - renders fine with llvmpipe though. Bisected to:

commit c1de7df6d4086070e63369ab0af3950f53a03592

Author: Brian Paul <[email protected]>
Date:   Mon Jun 22 14:04:09 2015 -0600

st/mesa: remove unneeded pipe_surface_release() in st_render_texture()

This caused us to always free the pipe_surface for the renderbuffer. The subsequent call to st_update_renderbuffer_surface() would typically just recreate it. Remove the call to pipe_surface_release() and let st_update_renderbuffer_surface() take care of freeing the old surface if it needs to be replaced (because of change to mipmap level, etc).

This can save quite a few calls to pipe_context::create_surface() and surface_destroy().

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

#6 lore raw
In reply to [email protected]

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

--- Comment #6 from Damien Grassart <[email protected]> --- Hi, just wanted to confirm that reverting commit c1de7df6d4086070e63369ab0af3950f53a03592 does indeed fix the issue on my HD7870. Thanks for bisecting Daniel.

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

#7 lore raw
In reply to [email protected]

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

--- Comment #7 from [email protected] --- I have this issue on radeonsi also. Reverting c1de7df6d4086070e63369ab0af3950f53a03592 fixes the problem.

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

#8 lore raw
In reply to [email protected]

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

--- Comment #8 from Edmondo Tommasina <[email protected]> --- Thanks Daniel.
Reverting commit c1de7df6d4086070e63369ab0af3950f53a03592 fixes the map issue on my EVERGREEN (HD5850).

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

#9 lore raw
In reply to [email protected]

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

--- Comment #9 from Daniel Scharrer <[email protected]> --- This looks like an application bug to me - here's what the game does with the minimap fog of war in the apitrace (right at the start of each frame, so it's easy to find):

1. Uploads the fog of war to GL_ALPHA texture 2487
2. Binds framebuffer 2
3. Attaches texture 6613 as the color0 buffer
4. Clears color to (0, 0, 0, 0)
5. Unbinds framebuffer 2
6. Binds framebuffer 2
7. Attaches texture 6613 as the color0 buffer
8. Binds 6613 as texture0
9. Binds 2487 as texture1
10. Draws a full-screen quad with a shader that boils down to a = pow(texture1.a, 8);
color0 = a * (0, 0, 0, 1) + (1 - a) * texture0;

Reading from and writing to the same texture in this way is undefined without inserting the appropriate memory barriers.

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

#10 lore raw
In reply to [email protected]

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

--- Comment #10 from Marek Olšák <[email protected]> ---
It should be fine as long as the texture(x,y) maps to the same coordinates in the color buffer. If there is only one draw call, a barrier isn't required.

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

#11 lore raw
In reply to [email protected]

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

--- Comment #11 from Daniel Scharrer <[email protected]> --- There is also a glClear though. Currently the texture read ends up with the data before the clear (uninitialized for the first frame, unitialized content with the fog of war blended on top n times for subsequent frames). Are you saying the texture reads should get the color from the clear without any synchronization?

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

#12 lore raw
In reply to [email protected]

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

--- Comment #12 from Marek Olšák <[email protected]> --- (In reply to Daniel Scharrer from comment #11)

Quoted 5 lines

There is also a glClear though. Currently the texture read ends up with the data before the clear (uninitialized for the first frame, unitialized content with the fog of war blended on top n times for subsequent frames). Are you saying the texture reads should get the color from the clear without any synchronization?

No, glClear+glDraw indeed requires a barrier in between.

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

#13 lore raw
In reply to [email protected]

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

--- Comment #13 from Andre Heider <[email protected]> --- So it's a bug in mesa then?

My distro is at 11.0.4 atm, if I'm about to ask for a fix, what's the appropriate measure?
Just revert c1de7df6d4086070e63369ab0af3950f53a03592 for now? Cherry-pick a proper fix?

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

#14 lore raw
In reply to [email protected]

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

--- Comment #14 from [email protected] --- This was just posted in PoE forums regarding this issue:

-----
Reported development thread on official forums here -
https://forums.obsidian.net/topic/82875-the-map-is-not-displayed-correctly/

Also, please be aware of this thread, which details Mesa rendering issues and a current fix regarding the driver -
http://forums.obsidian.net/topic/82667-rendering-issues-on-linux-now-theres-a-work-around/?hl=%2Blinux+%2Bhack
-----

Since somebody already hacked a fix, developers should be able to come up with a nice fix soon.

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

#15 lore raw
In reply to [email protected]

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

Christoph Brill <[email protected]> changed:

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

            Summary|Pillars of Eternity glitch  |[APITRACE] [bistected]
                   |in maps                     |Pillars of Eternity glitch
                   |                            |in maps
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

#16 lore raw
In reply to [email protected]

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

Christoph Brill <[email protected]> changed:

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

            Summary|[APITRACE] [bistected]      |[APITRACE] [bisected]
                   |Pillars of Eternity glitch  |Pillars of Eternity glitch
                   |in maps                     |in maps
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

#17 lore raw
In reply to [email protected]

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

--- Comment #15 from Daniel Scharrer <[email protected]> --- Looks like this has been fixed in the latest beta for Pillars of Eternity (what will become 3.02) along with the black spots (caused by denormals) in the water shader.

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

#18 lore raw
In reply to [email protected]

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

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

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

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

--- Comment #16 from Nicolai H�hnle <[email protected]> --- For what it's worth, a comment in the hack posted on the forum says

"PoE tries to read from and render to a texture at the same time when rendering the minimap. This happens directly after clearing the fbo to (0, 0, 0, 0) so bind a dummy texture with that value instead."

So this was either a PoE bug (so-called "feedback loop") or possibly a driver bug related to clearing a currently bound texture that was fixed recently. In any case, this seems to be fixed now, so closing this report.

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