Bug 31667 - r600c and r600g: wrong rendering for Savage2 game
Summary: r600c and r600g: wrong rendering for Savage2 game
Status: RESOLVED FIXED
Alias: None
Product: Mesa
Classification: Unclassified
Component: Drivers/Gallium/r600 (show other bugs)
Version: git
Hardware: Other All
: high normal
Assignee: romulasry
QA Contact:
URL: http://savage2.com/en/download.php
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-11-16 09:19 UTC by Török Edwin
Modified: 2013-04-16 00:58 UTC (History)
1 user (show)

See Also:
i915 platform:
i915 features:


Attachments
r600g_bad_transp_lines.jpg (365.23 KB, image/jpeg)
2010-11-16 09:19 UTC, Török Edwin
Details
r600g_bad_menu_lines.jpg (223.36 KB, image/jpeg)
2010-11-16 09:19 UTC, Török Edwin
Details
r600c_bad_partblack.jpg (157.57 KB, image/jpeg)
2010-11-16 09:20 UTC, Török Edwin
Details
r600c_menu_good.jpg (83.72 KB, image/jpeg)
2010-11-16 09:20 UTC, Török Edwin
Details
llvmpipe_ok.jpg (287.57 KB, image/jpeg)
2010-11-16 09:20 UTC, Török Edwin
Details
vert_frag.log (81.58 KB, text/x-log)
2010-12-07 03:35 UTC, Török Edwin
Details
Savage2 with that patch at http://paste.pocoo.org/raw/314893/ applied (844.23 KB, image/png)
2011-01-04 14:53 UTC, Kevin DeKorte
Details
Patch that improves Savage2, but doesn't quite fix it. (8.24 KB, patch)
2011-01-04 15:43 UTC, Kevin DeKorte
Details | Splinter Review
r600g_relative_addressing (23.64 KB, patch)
2011-02-06 07:26 UTC, Henri Verbeet
Details | Splinter Review
Top of screen *sky* renders white (2.04 MB, image/png)
2013-04-15 00:41 UTC, romulasry
Details
Edges of the screen renders just white (1.44 MB, image/png)
2013-04-15 00:48 UTC, romulasry
Details

Description Török Edwin 2010-11-16 09:19:42 UTC
Created attachment 40311 [details]
r600g_bad_transp_lines.jpg

Savage2 is a free to play (but not opensource) game with native Linux clients, it renders correctly with llvmpipe and fglrx.
It doesn't render correctly with r600c and r600g. Using latest git version (commit 063c6b8f74d114241f663ef8fd93732a0a07c10f).

llvmpipe that works (sort of, its very very slow):
$ LD_LIBRARY_PATH=$HOME/mesa/lib/gallium glxinfo | grep OpenGL
OpenGL vendor string: VMware, Inc.
OpenGL renderer string: Gallium 0.4 on llvmpipe
OpenGL version string: 2.1 Mesa 7.10-devel
OpenGL shading language version string: 1.20
OpenGL extensions:

r600c has part of the screen black (see attached screenshot r600c_bad_partblack.jpg), but the menu is good (r600c_menu_good.jpg):
$ glxinfo|grep OpenGL
OpenGL vendor string: Advanced Micro Devices, Inc.
OpenGL renderer string: Mesa DRI R600 (RV730 9498) 20090101  TCL DRI2
OpenGL version string: 2.1 Mesa 7.10-devel
OpenGL shading language version string: 1.20
OpenGL extensions:

r600g doesn't have the blackness bug, but the main character is missing/totally transparent you just see some swords running around (r600g_bad_transp_lines.jpg),
and it has some thin black horizontal lines all over the screen. The menu also has the thin black horizontal lines (r600g_bad_menu_lines.jpg).
LIBGL_DRIVERS_PATH=$HOME/mesa/lib/gallium glxinfo|grep OpenGL
OpenGL vendor string: X.Org
OpenGL renderer string: Gallium 0.4 on AMD RV730
OpenGL version string: 2.1 Mesa 7.10-devel
OpenGL shading language version string: 1.20
OpenGL extensions:

The video card is:
01:00.0 VGA compatible controller: ATI Technologies Inc RV730 PRO [Radeon HD 4650]
Comment 1 Török Edwin 2010-11-16 09:19:58 UTC
Created attachment 40312 [details]
r600g_bad_menu_lines.jpg
Comment 2 Török Edwin 2010-11-16 09:20:16 UTC
Created attachment 40313 [details]
r600c_bad_partblack.jpg
Comment 3 Török Edwin 2010-11-16 09:20:32 UTC
Created attachment 40314 [details]
r600c_menu_good.jpg
Comment 4 Török Edwin 2010-11-16 09:20:46 UTC
Created attachment 40315 [details]
llvmpipe_ok.jpg
Comment 5 Török Edwin 2010-11-16 09:22:37 UTC
To reproduce bug:
1. Install Savage2
2. LIBGL_DRIVERS_PATH=$HOME/mesa/lib/gallium ./savage2.bin
3. Press "Practice" (that way you can play locally, and don't have to join multiplayer server etc.)
4. Wait till it loads, can take quite a while
5. When in the game you can take screenshot with F5 (they are saved in ~/.savage2/game/screenshots), as soon as you enter the game you can see the rendering errors.

If you need any more info please ask.
Comment 6 Török Edwin 2010-11-18 03:04:04 UTC
On mesa commit 185d862cd8cd0a56dd86daa01d9c692ff4abfb54 right now, and the horizontal black lines problem is fixed on r600g, the transparent character problem stays though.
Comment 7 Török Edwin 2010-11-18 10:28:10 UTC
The missing character is a similar symptom to that of this bug for r300g which got fixed:
http://bugs.freedesktop.org/show_bug.cgi?id=28517

Do you need the RADEON_DEBUG=vp logs (or something else)?
Comment 8 Alex Deucher 2010-11-19 12:09:21 UTC
this is probably a dupe of bug 31613.
Comment 9 Kevin DeKorte 2010-12-06 07:55:16 UTC
Testing r600g from mesa git as of Dec 5, 2010 the menus look good, but the characters are still invisible on the main game screen and in the tutorial.

I'm using kernel 2.6.36.1 and libdrm 2.4.23

I tested secondlife and it works really good with this build. Sometimes frame rates over 50 on an 3650 card.
Comment 10 Török Edwin 2010-12-07 03:34:49 UTC
Also as soon as you start the game, the character on the menu screen is missing too with r600g (softpipe and llvmpipe is fine).
Attached is the FRAG and VERT dumps (I uncommented the tgsi_dump in r600g).
Comment 11 Török Edwin 2010-12-07 03:35:08 UTC
Created attachment 40867 [details]
vert_frag.log
Comment 12 Tilman Sauerbeck 2010-12-08 13:26:03 UTC
I wonder if bug 31771 might be the same problem as this one (on r600g at least).
Maybe comparing shader dumps for sauerbraten to these ones might give a clue...?
Comment 13 Kevin DeKorte 2010-12-08 13:43:23 UTC
When I put Savage2 in the Low resolution mode, I get a lot of funky red triangles on the main screen (where the big red demon should be). Made me wonder if the coordinates or normals were being interpreted incorrectly for the demon model. Everything else on the screen looks right however.
Comment 14 Kevin DeKorte 2011-01-04 14:53:14 UTC
http://paste.pocoo.org/raw/314893/  seems to help, makes more of the character visible, but head of character is still missing...
Comment 15 Kevin DeKorte 2011-01-04 14:53:58 UTC
Created attachment 41652 [details]
Savage2 with that patch at http://paste.pocoo.org/raw/314893/ applied
Comment 16 Kevin DeKorte 2011-01-04 15:42:34 UTC
I'm going to attach the patch here, just so it doesn't get lost. 

It also appears as if the suit of armor is rotated clockwise on the Z? axis 90 degrees. I believe you should almost always see the back of the armor.
Comment 17 Kevin DeKorte 2011-01-04 15:43:13 UTC
Created attachment 41655 [details] [review]
Patch that improves Savage2, but doesn't quite fix it.
Comment 18 Henri Verbeet 2011-01-05 00:46:19 UTC
Well, there are at least two things that are broken in current r600g. The first one is using constant buffer indices > 63, and the patch you tried should help there. The other thing that's broken is relative addressing of constant buffers. It happens to somewhat work as long as the resulting constant index falls within the kcache window, but in general it just doesn't work at all. All the "CONST[ADDR[0].x]" arguments in vert_frag.log are using relative addressing.
Comment 19 Kevin DeKorte 2011-01-07 06:33:12 UTC
with mesa git db61b9ce39bccc43140357652ceb78baaf2aea44 Savage2 now crashes immediately. Believe it did not crash with e31defc825ee94f1d1092e277954abad7097c552
Comment 20 Kevin DeKorte 2011-01-16 13:53:41 UTC
The crashing problems seem to be solved and I talked to Christian about this. It appears that relative shader addressing of constants still need to be fixed. Anyway, git of r600g is looking better. The menu in Savage nearly looks correct now.
Comment 21 Henri Verbeet 2011-02-06 07:26:27 UTC
Created attachment 42992 [details] [review]
r600g_relative_addressing

Does this patch make it any better? It's still incomplete (most obviously it doesn't handle relative addressing for all instructions), but should already work for the common cases.
Comment 22 Kevin DeKorte 2011-02-06 12:59:02 UTC
Henri,

Yes that patch does seem to help alot...

After that patch the only thing broken is shadows.

Please apply the relative_addressing or similar patch.
Comment 23 Kevin DeKorte 2011-02-07 08:48:40 UTC
Appears the patch is merged in... I can disable shadows in the game and it looks really great... should I open a new bug on the shadows, or should we continue the issue here?
Comment 24 Török Edwin 2011-02-07 09:13:24 UTC
(In reply to comment #23)
> Appears the patch is merged in... I can disable shadows in the game and it
> looks really great... 


Confirmed, latest Mesa from git works just fine.
Many thanks for fixing this.

> should I open a new bug on the shadows, or should we
> continue the issue here?

I don't know, only thing I notice wrong with shadows is that they are very very slow.
Comment 25 Jerome Glisse 2012-02-22 10:04:33 UTC
Closing
Comment 26 romulasry 2013-04-15 00:41:21 UTC
Created attachment 77965 [details]
Top of screen *sky* renders white

Reopening due to rendering bug found with top of screen area. Please see attachment.
Comment 27 romulasry 2013-04-15 00:48:41 UTC
Created attachment 77966 [details]
Edges of the screen renders just white

The first of the screenshots I submitted was from running the tutorial.

This screenshot is from running an online level. It is almost impossible to see in the distance due to it rendering the edges in all in just white.
Comment 28 Alex Deucher 2013-04-15 12:43:42 UTC
(In reply to comment #26)
> Created attachment 77965 [details]
> Top of screen *sky* renders white
> 
> Reopening due to rendering bug found with top of screen area. Please see
> attachment.

Please open a new bug if this is a new regression in the driver.
Comment 29 romulasry 2013-04-16 00:47:53 UTC
I did a git bisect for this and got:

02b808b08acc73b9b3d31832a7f137a9aae4bdd9 is the first bad commit
commit 02b808b08acc73b9b3d31832a7f137a9aae4bdd9
Author: Francisco Jerez <currojerez@riseup.net>
Date:   Sun Apr 7 18:31:06 2013 +0200

    clover: Fix usage of incorrect object as destination in clEnqueueCopyBufferToImage.
    
    Signed-off-by: Francisco Jerez <currojerez@riseup.net>

:040000 040000 ab0699e5d6ff9b4ebf721a6a750e96e15d76b209 e28c39023f81b08b323a1062f957ceb3824bd860 M    src


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.