Bug 33792

Summary: [r600g] Evergreen vertex shaders transform vertices incorrectly in wine programs
Product: Mesa Reporter: Rubén Fernández <rubenf3000>
Component: Drivers/Gallium/r600Assignee: Default DRI bug account <dri-devel>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: medium    
Version: git   
Hardware: All   
OS: All   
Whiteboard:
i915 platform: i915 features:
Attachments: correct rendering (via llvmpipe)
output log with llvmpipe with RADEON_DEBUG=vp MESA_GLSL=dump
Screenshot of wrong rendering with r600g
output log from r600g with RADEON_DEBUG=vp MESA_GLSL=dump
Screenshot with Tom Stellard's branch of r600g
output log from using Tom Stellard's branch of r600g
Screenshot after applying Henri Verbeet's patch
Output log after applying Henri Verbeet's patch

Description Rubén Fernández 2011-01-31 21:35:40 UTC
All the wine applications and games using vertex shaders that I've tried in
evergreen position the vertices incorrectly.

All of them render correctly using llvmpipe and an r300g card/driver.

Graphics Card: ATI Technologies Inc Juniper [Radeon HD 5750 Series]
CPU: Intel Core Duo 1.8 Ghz, 2.5 GB RAM
Linux kernel 2.6.37, libdrm 2.4.23
Latest Mesa git

Games tested:
Call of Cthulhu: Dark Corners of the Earth
Portal
Sam & Max Season One
Tales of Monkey Island
Back to the Future: The Game

I'll post logs and screenshots for Tales of Monkey Island
Comment 1 Rubén Fernández 2011-01-31 21:38:18 UTC
Created attachment 42788 [details]
correct rendering (via llvmpipe)
Comment 2 Rubén Fernández 2011-01-31 21:39:26 UTC
Created attachment 42789 [details]
output log with llvmpipe with RADEON_DEBUG=vp MESA_GLSL=dump
Comment 3 Rubén Fernández 2011-01-31 21:40:16 UTC
Created attachment 42790 [details]
Screenshot of wrong rendering with r600g
Comment 4 Rubén Fernández 2011-01-31 21:41:10 UTC
Created attachment 42791 [details]
output log from r600g with RADEON_DEBUG=vp MESA_GLSL=dump
Comment 5 Rubén Fernández 2011-01-31 21:43:57 UTC
Created attachment 42792 [details]
Screenshot with Tom Stellard's branch of r600g

Using Tom Stellard's branch (in the hopes it produces more useful debugging
output):

git://anongit.freedesktop.org/~tstellar/mesa

we get a screenshot that renders correctly the inanimate objects, but the
characters are not rendered at all
Comment 6 Rubén Fernández 2011-01-31 21:45:15 UTC
Created attachment 42793 [details]
output log from using Tom Stellard's branch of r600g

Hoping this branch's output gives more useful info
Comment 7 Henri Verbeet 2011-02-06 07:28:06 UTC
This may be similar to bug 31667, does https://bugs.freedesktop.org/attachment.cgi?id=42992 make it any better?
Comment 8 Rubén Fernández 2011-02-06 13:22:21 UTC
(In reply to comment #7)
> This may be similar to bug 31667, does
> https://bugs.freedesktop.org/attachment.cgi?id=42992 make it any better?

Your patch makes the errors go away in three of the five games I tested for the error: Call of Cthulhu, Sam & Max, and Back to the Future.

Portal seems to be unaffected, and Tales of Monkey Island continues to transform the vertices incorrectly, yet in a different way than before; I'll attach a new screenshot and log for the latter.

So yes, I agree this is, at least in part, the same bug as 31667.
Comment 9 Rubén Fernández 2011-02-06 13:23:46 UTC
Created attachment 43009 [details]
Screenshot after applying Henri Verbeet's patch
Comment 10 Rubén Fernández 2011-02-06 13:24:37 UTC
Created attachment 43010 [details]
Output log after applying Henri Verbeet's patch
Comment 11 Rubén Fernández 2011-02-06 13:26:53 UTC
Aside from Portal and Tales of Monkey Island, all the other games work perfectly now, thanks to Henri's patch
Comment 12 Rubén Fernández 2011-04-04 22:34:56 UTC
This bug is gone with the latest version of mesa git; it seems it was commit df3d11f6cab5dd5b4ff3cb0f10c8fe3e5954a16d "FLT_TO_INT_FLOOR and FLT_TO_INT_RPI are vector-only instructions on Evergreen" that did the trick.

Also, the commits:

  244a3bbf14ef4f739e7f3be298c8613a2667fce0 "Handle texture fetch instructions with relative addressing",
  da5b4764b28a1efd2e9dbf0741247288da36f546 "Handle texture fetch instructions with neg or abs on source register", and
  78037d95da06b81799e75410154c8141b0a30ec0 "Handle texture fetch instructions with swizzle on source register",

fixed texture addressing problems in those same games (that went unnoticed due to the geometry misrendering)

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.