Bug 74803 - [r600g] HyperZ broken on RV630 (Cogs shadows are broken)
[r600g] HyperZ broken on RV630 (Cogs shadows are broken)
Product: Mesa
Classification: Unclassified
Component: Drivers/Gallium/r600
x86-64 (AMD64) Linux (All)
: medium normal
Assigned To: Default DRI bug account
Depends on:
Blocks: 75112
  Show dependency treegraph
Reported: 2014-02-10 17:44 UTC by funkydude
Modified: 2014-09-02 09:59 UTC (History)
1 user (show)

See Also:
i915 platform:
i915 features:

Cogs shadow corruption (1018.05 KB, text/plain)
2014-02-10 17:44 UTC, funkydude
Cogs shadow corruption (1018.05 KB, image/png)
2014-02-10 17:46 UTC, funkydude
glxinfo (57.04 KB, text/plain)
2014-02-10 19:59 UTC, funkydude
xorg log (50.78 KB, text/plain)
2014-02-10 20:00 UTC, funkydude

Note You need to log in before you can comment on or make changes to this bug.
Description funkydude 2014-02-10 17:44:16 UTC
Created attachment 93791 [details]
Cogs shadow corruption

When enabling shadows on Cogs, the game looks like the attached screenshot, shadows become corrupt.

Resolution: 1280x800
GPU: HD2600 Mobility
OS: Ubuntu 13.10
Kernel: 3.13
Running the latest builds of Mesa thanks to the oibaf repository.

Disabling shadows allows me to play the game fine.
Comment 1 funkydude 2014-02-10 17:46:47 UTC
Created attachment 93792 [details]
Cogs shadow corruption

Fixed screenshot.
Comment 2 Alex Deucher 2014-02-10 18:12:11 UTC
Is this a regression?  If so, can you bisect?  Also, please attach your xorg log and glxinfo and dmesg output.
Comment 3 funkydude 2014-02-10 19:22:07 UTC
No idea if it's a regression. The first time I played this game on Linux was ~2 weeks ago and the issue has been there since that time.

Shadows are on by default, and this is a pretty old game. My guess is it is a regression or it would have been noticed previously.

I'm not sure what bisect is or how to perform one. I'm also not sure where the xorg log is. Is that constantly logging? Should I delete the file and launch the game to create a small one if so?

glxinfo and dmesg are too large, how do I dump them to a file?
Comment 4 Alex Deucher 2014-02-10 19:26:57 UTC
Just redirect the output to a file:
glxinfo > glxinfo.txt
dmesg > dmesg.txt

The xorg log location is usually /var/log/Xorg.0.log.  Don't worry about deleting it.  It gets overwritten each time you start X.

Google for "git bisect howto" to see how to use git to bisect a regression.  If you are not comfortable with that, can you try older driver releases and see if you can narrow down which one caused the problem?
Comment 5 funkydude 2014-02-10 19:59:43 UTC
Created attachment 93797 [details]
Comment 6 funkydude 2014-02-10 20:00:58 UTC
Created attachment 93798 [details]
xorg log
Comment 7 funkydude 2014-02-10 20:13:21 UTC
I purged the PPA which downgraded me to mesa 9.2.1 (I think). The issue is still there.
Comment 8 Marek Olšák 2014-02-11 01:33:49 UTC
Try to set this environment variable:

Comment 9 funkydude 2014-02-11 11:42:18 UTC
I launched Cogs via Steam and used the following "launch option", hopefully that's correct.

R600_DEBUG=nohyperz %command%

That actually fixed the shadows, they all look normal.
Comment 10 funkydude 2014-02-11 12:05:42 UTC
Another game seems to be affected by this issue, "Anomaly Warzone Earth". Disabling HyperZ for that game also solves the shadows...

..but it reveals some other graphical anomalies and crashing issues probably more suited for another ticket.
Comment 11 Benjamin Bellec 2014-02-12 11:54:09 UTC
Probably the same bug happens for L4D2:
Comment 12 Andreas Boll 2014-02-12 12:00:45 UTC
Re-assigning back to r600g
Comment 13 funkydude 2014-02-12 15:57:56 UTC
(In reply to comment #12)
> Re-assigning back to r600g

Why r600g? Is HyperZ not enabled on others?
Comment 14 Alex Deucher 2014-02-12 16:25:41 UTC
(In reply to comment #13)
> (In reply to comment #12)
> > Re-assigning back to r600g
> Why r600g? Is HyperZ not enabled on others?

There should be a separate bug for hyperz issues with other drivers.
Comment 15 smoki 2014-05-22 06:40:18 UTC
 http://www.mesa3d.org/relnotes/10.0.5.html stated this bug is fixed :).

 Is it really fixed for r600 driver with enabled hyperz or it is fixed because hyperz is disabled by default?

 I also asking this because i don't have this bug in radeonsi :).
Comment 16 David Heidelberg (okias) 2014-05-31 14:02:24 UTC
You can try with HyperZ by passing R600_DEBUG=hyperz and running it again.

Most likely it's fixed by disabling HyperZ.
Comment 17 funkydude 2014-05-31 17:15:33 UTC
I haven't tested since I made the ticket. I assumed if there was going to be a change that fixed it that someone would respond here to inform me.
Comment 18 Marek Olšák 2014-09-01 20:50:44 UTC
Is this fixed with current Mesa git?
Comment 19 funkydude 2014-09-01 21:08:51 UTC
I'll update my oibaf laptop and try get back to you as soon as possible.
Comment 20 funkydude 2014-09-01 21:11:39 UTC
Oh I should ask this now. Is HyperZ enable now or do I need to change the Steam launch options?
Comment 21 Marek Olšák 2014-09-01 21:27:50 UTC
You need to set the environment variable:

Comment 22 funkydude 2014-09-01 22:09:35 UTC
No. Still broken using latest Oibaf.
Comment 23 smoki 2014-09-01 22:49:42 UTC
(In reply to comment #22)
> No. Still broken using latest Oibaf.

 Latest oibaf ppa packages still does not contain these fixes :) You need to wait for newer packages, one more update :)
Comment 24 funkydude 2014-09-02 08:58:51 UTC
Updated Oibaf and tried again. This time it does appear to be fixed! :-)
Comment 25 Marek Olšák 2014-09-02 09:59:53 UTC
(In reply to comment #24)
> Updated Oibaf and tried again. This time it does appear to be fixed! :-)

Thanks. Closing.